diff --git a/.gitignore b/.gitignore index 813e4da6fb2371aea230629e7ab3d08c119cc152..181608b1714cd331b95eb987544cab3972df4e59 100644 --- a/.gitignore +++ b/.gitignore @@ -14,7 +14,6 @@ /app/etc/local.xml /app/etc/local.xml.* /app/etc/modules/XEnterprise_Enabler.xml -/app/locale/en_US_org /downloader/.cache /downloader/cache.cfg /downloader/connect.cfg diff --git a/app/Mage.php b/app/Mage.php index 2c15fe09506ec488d923050a0bbbd47aa8d72682..60df8c62a14053e12a120a0375acc5f19a71ab21 100644 --- a/app/Mage.php +++ b/app/Mage.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -397,7 +397,7 @@ final class Mage * * @link Mage_Core_Model_Config::getModelInstance * @param string $modelClass - * @param array $arguments + * @param array|object $arguments * @return Mage_Core_Model_Abstract */ public static function getModel($modelClass = '', $arguments = array()) @@ -497,7 +497,7 @@ final class Mage } /** - * Retreive resource helper object + * Retrieve resource helper object * * @param string $moduleName * @return Mage_Core_Model_Resource_Helper_Abstract @@ -555,7 +555,8 @@ final class Mage self::$_app = new Mage_Core_Model_App(); self::setRoot(); self::$_events = new Varien_Event_Collection(); - self::$_config = new Mage_Core_Model_Config($options); + self::setIsInstalled($options); + self::setConfigModel($options); Magento_Profiler::start('self::app::init'); self::$_app->init($code, $type, $options); @@ -577,7 +578,8 @@ final class Mage try { self::setRoot(); self::$_app = new Mage_Core_Model_App(); - self::$_config = new Mage_Core_Model_Config(); + self::setIsInstalled($options); + self::setConfigModel($options); if (!empty($modules)) { self::$_app->initSpecified($code, $type, $options, $modules); @@ -616,7 +618,8 @@ final class Mage self::$_app->setResponse($options['response']); } self::$_events = new Varien_Event_Collection(); - self::$_config = new Mage_Core_Model_Config($options); + self::setIsInstalled($options); + self::setConfigModel($options); self::$_app->run(array( 'scope_code' => $code, 'scope_type' => $type, @@ -647,6 +650,40 @@ final class Mage } } + /** + * Set application isInstalled flag based on given options + * + * @param array $options + */ + public static function setIsInstalled($options = array()) + { + if (isset($options['is_installed']) && $options['is_installed']) { + self::$_isInstalled = true; + } + } + + /** + * Set application Config model + * + * @param array $options + */ + public static function setConfigModel($options = array()) + { + if (isset($options['config_model']) && Magento_Autoload::getInstance()->classExists($options['config_model'])) { + $alternativeConfigModelName = $options['config_model']; + unset($options['config_model']); + $alternativeConfigModel = new $alternativeConfigModelName($options); + } else { + $alternativeConfigModel = null; + } + + if (!is_null($alternativeConfigModel) && ($alternativeConfigModel instanceof Mage_Core_Model_Config)) { + self::$_config = $alternativeConfigModel; + } else { + self::$_config = new Mage_Core_Model_Config($options); + } + } + /** * Retrieve application installation flag * diff --git a/app/bootstrap.php b/app/bootstrap.php index cb2098ccc96a08b30ca21b88a97f9e7d36c36923..5f431e8380777525c981330c2a251407d323dd99 100644 --- a/app/bootstrap.php +++ b/app/bootstrap.php @@ -19,7 +19,7 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category Magento - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/community/Phoenix/Moneybookers/Block/Form.php b/app/code/community/Phoenix/Moneybookers/Block/Form.php index 78940d79cece51cbb737ccda685cac998976da18..e47da3411e1189fa7c5c64e07844de93fc21da10 100644 --- a/app/code/community/Phoenix/Moneybookers/Block/Form.php +++ b/app/code/community/Phoenix/Moneybookers/Block/Form.php @@ -20,7 +20,7 @@ * * @category Phoenix * @package Phoenix_Moneybookers - * @copyright Copyright (c) 2011 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) + * @copyright Copyright (c) 2012 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Phoenix_Moneybookers_Block_Form extends Mage_Payment_Block_Form diff --git a/app/code/community/Phoenix/Moneybookers/Block/Info.php b/app/code/community/Phoenix/Moneybookers/Block/Info.php index 61ed815305cdd611497672a01a35f22345e3b99a..d418a6828c0c45bb1cdec50d33ae2166b3ca67d2 100644 --- a/app/code/community/Phoenix/Moneybookers/Block/Info.php +++ b/app/code/community/Phoenix/Moneybookers/Block/Info.php @@ -20,7 +20,7 @@ * * @category Phoenix * @package Phoenix_Moneybookers - * @copyright Copyright (c) 2011 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) + * @copyright Copyright (c) 2012 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Phoenix_Moneybookers_Block_Info extends Mage_Payment_Block_Info diff --git a/app/code/community/Phoenix/Moneybookers/Block/Jsinit.php b/app/code/community/Phoenix/Moneybookers/Block/Jsinit.php index fb0d5b316eb10944d16dfba6ae5a0a982b5628e7..b4080349822737938f2842ff82ed819f0156a228 100644 --- a/app/code/community/Phoenix/Moneybookers/Block/Jsinit.php +++ b/app/code/community/Phoenix/Moneybookers/Block/Jsinit.php @@ -20,7 +20,7 @@ * * @category Phoenix * @package Phoenix_Moneybookers - * @copyright Copyright (c) 2011 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) + * @copyright Copyright (c) 2012 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Phoenix_Moneybookers_Block_Jsinit extends Mage_Adminhtml_Block_Template diff --git a/app/code/community/Phoenix/Moneybookers/Block/Payment.php b/app/code/community/Phoenix/Moneybookers/Block/Payment.php index 48bb8b9f17f1bda6a4b72ffe982d4e5949480e02..870db6ad7f0f19090bc5819f47761a2f66ae7adb 100644 --- a/app/code/community/Phoenix/Moneybookers/Block/Payment.php +++ b/app/code/community/Phoenix/Moneybookers/Block/Payment.php @@ -20,7 +20,7 @@ * * @category Phoenix * @package Phoenix_Moneybookers - * @copyright Copyright (c) 2011 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) + * @copyright Copyright (c) 2012 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Phoenix_Moneybookers_Block_Payment extends Mage_Core_Block_Template diff --git a/app/code/community/Phoenix/Moneybookers/Block/Placeform.php b/app/code/community/Phoenix/Moneybookers/Block/Placeform.php index 025fe292bcb46e8fbdd7ac92c925e5754128a211..6d02bbad043a6b7a834ea86fb35b604adf57333b 100644 --- a/app/code/community/Phoenix/Moneybookers/Block/Placeform.php +++ b/app/code/community/Phoenix/Moneybookers/Block/Placeform.php @@ -20,7 +20,7 @@ * * @category Phoenix * @package Phoenix_Moneybookers - * @copyright Copyright (c) 2011 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) + * @copyright Copyright (c) 2012 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Phoenix_Moneybookers_Block_Placeform extends Mage_Core_Block_Template diff --git a/app/code/community/Phoenix/Moneybookers/Block/Redirect.php b/app/code/community/Phoenix/Moneybookers/Block/Redirect.php index 362da4b5890101afb0ee0104fe238445fad6affe..418f6d71140475af6b9ea153389912e466bd446d 100644 --- a/app/code/community/Phoenix/Moneybookers/Block/Redirect.php +++ b/app/code/community/Phoenix/Moneybookers/Block/Redirect.php @@ -20,7 +20,7 @@ * * @category Phoenix * @package Phoenix_Moneybookers - * @copyright Copyright (c) 2011 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) + * @copyright Copyright (c) 2012 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Phoenix_Moneybookers_Block_Redirect extends Mage_Core_Block_Template diff --git a/app/code/community/Phoenix/Moneybookers/Helper/Data.php b/app/code/community/Phoenix/Moneybookers/Helper/Data.php index 83be78bf166a0b7ebdcc880ae779a34ab7fc006b..75fcb1d3ce9baabe19cc175bcf31a564c714ee9a 100644 --- a/app/code/community/Phoenix/Moneybookers/Helper/Data.php +++ b/app/code/community/Phoenix/Moneybookers/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Phoenix * @package Phoenix_Moneybookers - * @copyright Copyright (c) 2011 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) + * @copyright Copyright (c) 2012 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Phoenix_Moneybookers_Helper_Data extends Mage_Payment_Helper_Data diff --git a/app/code/community/Phoenix/Moneybookers/Model/Abstract.php b/app/code/community/Phoenix/Moneybookers/Model/Abstract.php index 74c8fcded236b7bac93d468526139efb67ad6cec..80f4eff14c34185de652799a4412063079523953 100644 --- a/app/code/community/Phoenix/Moneybookers/Model/Abstract.php +++ b/app/code/community/Phoenix/Moneybookers/Model/Abstract.php @@ -20,7 +20,7 @@ * * @category Phoenix * @package Phoenix_Moneybookers - * @copyright Copyright (c) 2011 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) + * @copyright Copyright (c) 2012 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ abstract class Phoenix_Moneybookers_Model_Abstract extends Mage_Payment_Model_Method_Abstract diff --git a/app/code/community/Phoenix/Moneybookers/Model/Acc.php b/app/code/community/Phoenix/Moneybookers/Model/Acc.php index 2be5714cdd40af01c2a5ad34262b67c767081b05..22a2df45016ae471885e8daad83d24ff6c6ad59f 100644 --- a/app/code/community/Phoenix/Moneybookers/Model/Acc.php +++ b/app/code/community/Phoenix/Moneybookers/Model/Acc.php @@ -20,7 +20,7 @@ * * @category Phoenix * @package Phoenix_Moneybookers - * @copyright Copyright (c) 2011 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) + * @copyright Copyright (c) 2012 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Phoenix_Moneybookers_Model_Acc extends Phoenix_Moneybookers_Model_Abstract diff --git a/app/code/community/Phoenix/Moneybookers/Model/Csi.php b/app/code/community/Phoenix/Moneybookers/Model/Csi.php index c6bdd49779468653fef139dcae00b73535e68665..4b19d99d23e926b74823d0071cddffa2b5bace2b 100644 --- a/app/code/community/Phoenix/Moneybookers/Model/Csi.php +++ b/app/code/community/Phoenix/Moneybookers/Model/Csi.php @@ -20,7 +20,7 @@ * * @category Phoenix * @package Phoenix_Moneybookers - * @copyright Copyright (c) 2011 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) + * @copyright Copyright (c) 2012 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Phoenix_Moneybookers_Model_Csi extends Phoenix_Moneybookers_Model_Abstract diff --git a/app/code/community/Phoenix/Moneybookers/Model/Did.php b/app/code/community/Phoenix/Moneybookers/Model/Did.php index f0f1c7554ff850bff59b73501c1c472ad02e60ed..842b6b26015b36be814189f6e4dce8e21fa21c44 100644 --- a/app/code/community/Phoenix/Moneybookers/Model/Did.php +++ b/app/code/community/Phoenix/Moneybookers/Model/Did.php @@ -20,7 +20,7 @@ * * @category Phoenix * @package Phoenix_Moneybookers - * @copyright Copyright (c) 2011 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) + * @copyright Copyright (c) 2012 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Phoenix_Moneybookers_Model_Did extends Phoenix_Moneybookers_Model_Abstract diff --git a/app/code/community/Phoenix/Moneybookers/Model/Dnk.php b/app/code/community/Phoenix/Moneybookers/Model/Dnk.php index 9caee9881d96e46d85f1c6681e84c73a0b8ff8b3..7e0a130b64beff5a5f6e57b6a59ec9762253ffab 100644 --- a/app/code/community/Phoenix/Moneybookers/Model/Dnk.php +++ b/app/code/community/Phoenix/Moneybookers/Model/Dnk.php @@ -20,7 +20,7 @@ * * @category Phoenix * @package Phoenix_Moneybookers - * @copyright Copyright (c) 2011 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) + * @copyright Copyright (c) 2012 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Phoenix_Moneybookers_Model_Dnk extends Phoenix_Moneybookers_Model_Abstract diff --git a/app/code/community/Phoenix/Moneybookers/Model/Ebt.php b/app/code/community/Phoenix/Moneybookers/Model/Ebt.php index f04d5b93fb51b18d1004d5e33c8bcf4917fef924..26ef8296aad0f82b1d6ca13df6cd158891f6dec2 100644 --- a/app/code/community/Phoenix/Moneybookers/Model/Ebt.php +++ b/app/code/community/Phoenix/Moneybookers/Model/Ebt.php @@ -20,7 +20,7 @@ * * @category Phoenix * @package Phoenix_Moneybookers - * @copyright Copyright (c) 2011 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) + * @copyright Copyright (c) 2012 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Phoenix_Moneybookers_Model_Ebt extends Phoenix_Moneybookers_Model_Abstract diff --git a/app/code/community/Phoenix/Moneybookers/Model/Ent.php b/app/code/community/Phoenix/Moneybookers/Model/Ent.php index f57f433d81cc38b16da43460aa50b0223f3b9cde..051378fdadaa921538493f7b66caa54a5df1977f 100644 --- a/app/code/community/Phoenix/Moneybookers/Model/Ent.php +++ b/app/code/community/Phoenix/Moneybookers/Model/Ent.php @@ -20,7 +20,7 @@ * * @category Phoenix * @package Phoenix_Moneybookers - * @copyright Copyright (c) 2011 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) + * @copyright Copyright (c) 2012 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Phoenix_Moneybookers_Model_Ent extends Phoenix_Moneybookers_Model_Abstract diff --git a/app/code/community/Phoenix/Moneybookers/Model/Event.php b/app/code/community/Phoenix/Moneybookers/Model/Event.php index 32c144b1e26255725b24e7241559df0c1f569018..ad043de07b2f9455739b954bef0c6addab73d32a 100644 --- a/app/code/community/Phoenix/Moneybookers/Model/Event.php +++ b/app/code/community/Phoenix/Moneybookers/Model/Event.php @@ -20,7 +20,7 @@ * * @category Phoenix * @package Phoenix_Moneybookers - * @copyright Copyright (c) 2011 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) + * @copyright Copyright (c) 2012 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/community/Phoenix/Moneybookers/Model/Gcb.php b/app/code/community/Phoenix/Moneybookers/Model/Gcb.php index 62b60426ce485bd027f78fc34d291f5399986069..3b46d2b686ac636f4fcaef2f5485fb0553b3faf8 100644 --- a/app/code/community/Phoenix/Moneybookers/Model/Gcb.php +++ b/app/code/community/Phoenix/Moneybookers/Model/Gcb.php @@ -20,7 +20,7 @@ * * @category Phoenix * @package Phoenix_Moneybookers - * @copyright Copyright (c) 2011 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) + * @copyright Copyright (c) 2012 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Phoenix_Moneybookers_Model_Gcb extends Phoenix_Moneybookers_Model_Abstract diff --git a/app/code/community/Phoenix/Moneybookers/Model/Gir.php b/app/code/community/Phoenix/Moneybookers/Model/Gir.php index af91eb7a10410ec1a496ff4893c653a10835173e..5617cdff9036c4a1c8447c958ba96e1fe3d806fa 100644 --- a/app/code/community/Phoenix/Moneybookers/Model/Gir.php +++ b/app/code/community/Phoenix/Moneybookers/Model/Gir.php @@ -20,7 +20,7 @@ * * @category Phoenix * @package Phoenix_Moneybookers - * @copyright Copyright (c) 2011 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) + * @copyright Copyright (c) 2012 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Phoenix_Moneybookers_Model_Gir extends Phoenix_Moneybookers_Model_Abstract diff --git a/app/code/community/Phoenix/Moneybookers/Model/Idl.php b/app/code/community/Phoenix/Moneybookers/Model/Idl.php index 36fc568d9aacc46f9eda01c0173f2911af48a8ca..c8246a3a10450e7c9f2bd85c708fdebfa0f5391d 100644 --- a/app/code/community/Phoenix/Moneybookers/Model/Idl.php +++ b/app/code/community/Phoenix/Moneybookers/Model/Idl.php @@ -20,7 +20,7 @@ * * @category Phoenix * @package Phoenix_Moneybookers - * @copyright Copyright (c) 2011 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) + * @copyright Copyright (c) 2012 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Phoenix_Moneybookers_Model_Idl extends Phoenix_Moneybookers_Model_Abstract diff --git a/app/code/community/Phoenix/Moneybookers/Model/Lsr.php b/app/code/community/Phoenix/Moneybookers/Model/Lsr.php index f9ea17b4c79429d7869be5a6a2d43f2fd7e71107..e134116d4e157edf0fddb197875ef4fad27be651 100644 --- a/app/code/community/Phoenix/Moneybookers/Model/Lsr.php +++ b/app/code/community/Phoenix/Moneybookers/Model/Lsr.php @@ -20,7 +20,7 @@ * * @category Phoenix * @package Phoenix_Moneybookers - * @copyright Copyright (c) 2011 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) + * @copyright Copyright (c) 2012 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Phoenix_Moneybookers_Model_Lsr extends Phoenix_Moneybookers_Model_Abstract diff --git a/app/code/community/Phoenix/Moneybookers/Model/Mae.php b/app/code/community/Phoenix/Moneybookers/Model/Mae.php index 37c6780408bf6eff266c5a92e9cee056f0a0c0f5..1f45ad5c92512e77646541243721b03d708217e5 100644 --- a/app/code/community/Phoenix/Moneybookers/Model/Mae.php +++ b/app/code/community/Phoenix/Moneybookers/Model/Mae.php @@ -20,7 +20,7 @@ * * @category Phoenix * @package Phoenix_Moneybookers - * @copyright Copyright (c) 2011 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) + * @copyright Copyright (c) 2012 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Phoenix_Moneybookers_Model_Mae extends Phoenix_Moneybookers_Model_Abstract diff --git a/app/code/community/Phoenix/Moneybookers/Model/Npy.php b/app/code/community/Phoenix/Moneybookers/Model/Npy.php index b0351157b27c3dc4613e5371ba0c97d92549390f..b975c5f2fb83ff0a59c1c8d68e392a4731c9e567 100644 --- a/app/code/community/Phoenix/Moneybookers/Model/Npy.php +++ b/app/code/community/Phoenix/Moneybookers/Model/Npy.php @@ -20,7 +20,7 @@ * * @category Phoenix * @package Phoenix_Moneybookers - * @copyright Copyright (c) 2011 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) + * @copyright Copyright (c) 2012 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Phoenix_Moneybookers_Model_Npy extends Phoenix_Moneybookers_Model_Abstract diff --git a/app/code/community/Phoenix/Moneybookers/Model/Obt.php b/app/code/community/Phoenix/Moneybookers/Model/Obt.php index a236c4eb7e133657d395bddc3dd7008d767f53fb..90226f2a903b5cdec826272a527172f9a08c4d1f 100644 --- a/app/code/community/Phoenix/Moneybookers/Model/Obt.php +++ b/app/code/community/Phoenix/Moneybookers/Model/Obt.php @@ -20,7 +20,7 @@ * * @category Phoenix * @package Phoenix_Moneybookers - * @copyright Copyright (c) 2011 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) + * @copyright Copyright (c) 2012 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Phoenix_Moneybookers_Model_Obt extends Phoenix_Moneybookers_Model_Abstract diff --git a/app/code/community/Phoenix/Moneybookers/Model/Pli.php b/app/code/community/Phoenix/Moneybookers/Model/Pli.php index 4809302e76bed801a00e067430663a07bfc41ee3..31381dd9d891e492c664e81b7dd9cde880a8fd8b 100644 --- a/app/code/community/Phoenix/Moneybookers/Model/Pli.php +++ b/app/code/community/Phoenix/Moneybookers/Model/Pli.php @@ -20,7 +20,7 @@ * * @category Phoenix * @package Phoenix_Moneybookers - * @copyright Copyright (c) 2011 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) + * @copyright Copyright (c) 2012 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Phoenix_Moneybookers_Model_Pli extends Phoenix_Moneybookers_Model_Abstract diff --git a/app/code/community/Phoenix/Moneybookers/Model/Psp.php b/app/code/community/Phoenix/Moneybookers/Model/Psp.php index 3ebb011f5bb7016cf47d1f96ea1d30b23dcbfb21..e7e502dbebfdcda1083766eefe7d5be84d0953d4 100644 --- a/app/code/community/Phoenix/Moneybookers/Model/Psp.php +++ b/app/code/community/Phoenix/Moneybookers/Model/Psp.php @@ -20,7 +20,7 @@ * * @category Phoenix * @package Phoenix_Moneybookers - * @copyright Copyright (c) 2011 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) + * @copyright Copyright (c) 2012 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Phoenix_Moneybookers_Model_Psp extends Phoenix_Moneybookers_Model_Abstract diff --git a/app/code/community/Phoenix/Moneybookers/Model/Pwy.php b/app/code/community/Phoenix/Moneybookers/Model/Pwy.php index f70fe7b809074a56d1bfefeb580609ccf761ab5a..457421c779a51442ed836fbfa552805883f8962a 100644 --- a/app/code/community/Phoenix/Moneybookers/Model/Pwy.php +++ b/app/code/community/Phoenix/Moneybookers/Model/Pwy.php @@ -20,7 +20,7 @@ * * @category Phoenix * @package Phoenix_Moneybookers - * @copyright Copyright (c) 2011 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) + * @copyright Copyright (c) 2012 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Phoenix_Moneybookers_Model_Pwy extends Phoenix_Moneybookers_Model_Abstract diff --git a/app/code/community/Phoenix/Moneybookers/Model/Sft.php b/app/code/community/Phoenix/Moneybookers/Model/Sft.php index c8600a6029572e095e0fa77caab914513a5037f7..c0d204059555a971f515d31494ef40fc9fea1606 100644 --- a/app/code/community/Phoenix/Moneybookers/Model/Sft.php +++ b/app/code/community/Phoenix/Moneybookers/Model/Sft.php @@ -20,7 +20,7 @@ * * @category Phoenix * @package Phoenix_Moneybookers - * @copyright Copyright (c) 2011 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) + * @copyright Copyright (c) 2012 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Phoenix_Moneybookers_Model_Sft extends Phoenix_Moneybookers_Model_Abstract diff --git a/app/code/community/Phoenix/Moneybookers/Model/So2.php b/app/code/community/Phoenix/Moneybookers/Model/So2.php index 589c2ed3b0605b82f5bf2be879db3ed3a2b21aff..dc687e6d987051a9988965855a76354906ed4c6f 100644 --- a/app/code/community/Phoenix/Moneybookers/Model/So2.php +++ b/app/code/community/Phoenix/Moneybookers/Model/So2.php @@ -20,7 +20,7 @@ * * @category Phoenix * @package Phoenix_Moneybookers - * @copyright Copyright (c) 2011 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) + * @copyright Copyright (c) 2012 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Phoenix_Moneybookers_Model_So2 extends Phoenix_Moneybookers_Model_Abstract diff --git a/app/code/community/Phoenix/Moneybookers/Model/Wlt.php b/app/code/community/Phoenix/Moneybookers/Model/Wlt.php index d5afa6c617ef8a270821fb51e4903ff2cd739202..7f62412eef17ef76b0e66d12e6e3b38718e9c328 100644 --- a/app/code/community/Phoenix/Moneybookers/Model/Wlt.php +++ b/app/code/community/Phoenix/Moneybookers/Model/Wlt.php @@ -20,7 +20,7 @@ * * @category Phoenix * @package Phoenix_Moneybookers - * @copyright Copyright (c) 2011 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) + * @copyright Copyright (c) 2012 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Phoenix_Moneybookers_Model_Wlt extends Phoenix_Moneybookers_Model_Abstract diff --git a/app/code/community/Phoenix/Moneybookers/controllers/MoneybookersController.php b/app/code/community/Phoenix/Moneybookers/controllers/MoneybookersController.php index 8fb226f56f713b3e87a9af19f183719be699f2e7..d71c3f7ff274af8f78c6b6a8794e45e7a4aa7e53 100644 --- a/app/code/community/Phoenix/Moneybookers/controllers/MoneybookersController.php +++ b/app/code/community/Phoenix/Moneybookers/controllers/MoneybookersController.php @@ -20,7 +20,7 @@ * * @category Phoenix * @package Phoenix_Moneybookers - * @copyright Copyright (c) 2011 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) + * @copyright Copyright (c) 2012 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Phoenix_Moneybookers_MoneybookersController extends Mage_Adminhtml_Controller_Action diff --git a/app/code/community/Phoenix/Moneybookers/controllers/ProcessingController.php b/app/code/community/Phoenix/Moneybookers/controllers/ProcessingController.php index 187e593372168d458b450e1c4bcaa4ff257a6d2e..2bb4d8ba3d901c44fa0cc3a56e6aebbbcfc95dff 100644 --- a/app/code/community/Phoenix/Moneybookers/controllers/ProcessingController.php +++ b/app/code/community/Phoenix/Moneybookers/controllers/ProcessingController.php @@ -20,7 +20,7 @@ * * @category Phoenix * @package Phoenix_Moneybookers - * @copyright Copyright (c) 2011 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) + * @copyright Copyright (c) 2012 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Phoenix_Moneybookers_ProcessingController extends Mage_Core_Controller_Front_Action diff --git a/app/code/community/Phoenix/Moneybookers/etc/adminhtml.xml b/app/code/community/Phoenix/Moneybookers/etc/adminhtml.xml index 36afe10c99d3b881afd2bb3b03ad0a42ae4ff92f..2a2b02f59c6f3dcaeb7d72d744ef8f80cfd0f0fa 100644 --- a/app/code/community/Phoenix/Moneybookers/etc/adminhtml.xml +++ b/app/code/community/Phoenix/Moneybookers/etc/adminhtml.xml @@ -21,7 +21,7 @@ * * @category Phoenix * @package Phoenix_Moneybookers - * @copyright Copyright (c) 2011 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) + * @copyright Copyright (c) 2012 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ --> diff --git a/app/code/community/Phoenix/Moneybookers/etc/config.xml b/app/code/community/Phoenix/Moneybookers/etc/config.xml index e1811b93186e8f884ad32e77ea7033bcedada98a..9d6fa55ad6e2dc8d97ab510ca48abb59831140c8 100644 --- a/app/code/community/Phoenix/Moneybookers/etc/config.xml +++ b/app/code/community/Phoenix/Moneybookers/etc/config.xml @@ -21,7 +21,7 @@ * * @category Phoenix * @package Phoenix_Moneybookers - * @copyright Copyright (c) 2011 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) + * @copyright Copyright (c) 2012 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ --> diff --git a/app/code/community/Phoenix/Moneybookers/etc/system.xml b/app/code/community/Phoenix/Moneybookers/etc/system.xml index d9099c6ede7bcfe16e81c7db6e0fe5516c148140..d2dae0a0ccdfe2fd7fde1d6cdb30d7c26d6698c8 100644 --- a/app/code/community/Phoenix/Moneybookers/etc/system.xml +++ b/app/code/community/Phoenix/Moneybookers/etc/system.xml @@ -21,7 +21,7 @@ * * @category Phoenix * @package Phoenix_Moneybookers - * @copyright Copyright (c) 2011 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) + * @copyright Copyright (c) 2012 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ --> diff --git a/app/code/community/Phoenix/Moneybookers/sql/moneybookers_setup/install-1.6.0.0.php b/app/code/community/Phoenix/Moneybookers/sql/moneybookers_setup/install-1.6.0.0.php index 7614447e1e03f99e9557262074110a7942674dd3..6d1346ecfed8fc2b4986d2ba9773bfa00f3d74b1 100644 --- a/app/code/community/Phoenix/Moneybookers/sql/moneybookers_setup/install-1.6.0.0.php +++ b/app/code/community/Phoenix/Moneybookers/sql/moneybookers_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Phoenix * @package Phoenix_Moneybookers - * @copyright Copyright (c) 2011 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) + * @copyright Copyright (c) 2012 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/community/Phoenix/Moneybookers/view/adminhtml/activation.js b/app/code/community/Phoenix/Moneybookers/view/adminhtml/activation.js index 441181a328c9e6436a7c0632d7b0a83c28a447bc..fc30ee9a748c58a43ea3aff0aaa854fcc3afc6e7 100644 --- a/app/code/community/Phoenix/Moneybookers/view/adminhtml/activation.js +++ b/app/code/community/Phoenix/Moneybookers/view/adminhtml/activation.js @@ -19,7 +19,7 @@ * * @category Phoenix * @package Phoenix_Moneybookers - * @copyright Copyright (c) 2011 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) + * @copyright Copyright (c) 2012 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/community/Phoenix/Moneybookers/view/adminhtml/info.phtml b/app/code/community/Phoenix/Moneybookers/view/adminhtml/info.phtml index 6e0b9e6e43db4fc67f7687b25323d5ae36d689f9..8c3625a0ef44c06c8dc17f2cd0553bfa9fc46824 100644 --- a/app/code/community/Phoenix/Moneybookers/view/adminhtml/info.phtml +++ b/app/code/community/Phoenix/Moneybookers/view/adminhtml/info.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) + * @copyright Copyright (c) 2012 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ ?> diff --git a/app/code/community/Phoenix/Moneybookers/view/adminhtml/jsinit.phtml b/app/code/community/Phoenix/Moneybookers/view/adminhtml/jsinit.phtml index 716755ef0d74a2de021babf29289c74f2d5510af..80a78fcfbb9f94d2f27261c333c0fb49a9473728 100644 --- a/app/code/community/Phoenix/Moneybookers/view/adminhtml/jsinit.phtml +++ b/app/code/community/Phoenix/Moneybookers/view/adminhtml/jsinit.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) + * @copyright Copyright (c) 2012 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ ?> diff --git a/app/code/community/Phoenix/Moneybookers/view/adminhtml/layout.xml b/app/code/community/Phoenix/Moneybookers/view/adminhtml/layout.xml index 4ee3351f27f2f71798e0def8a9061a2b8cf263b4..29b7b0d40c2838a74447bfc219a07125e2a03c5c 100644 --- a/app/code/community/Phoenix/Moneybookers/view/adminhtml/layout.xml +++ b/app/code/community/Phoenix/Moneybookers/view/adminhtml/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) + * @copyright Copyright (c) 2012 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ --> diff --git a/app/code/community/Phoenix/Moneybookers/view/adminhtml/pdf/info.phtml b/app/code/community/Phoenix/Moneybookers/view/adminhtml/pdf/info.phtml index 16fe5c4531a8b859593169deeae0968bd9e3c01f..e2f9ad7ae9d84d8255651b5a4f58cae9fe463ce2 100644 --- a/app/code/community/Phoenix/Moneybookers/view/adminhtml/pdf/info.phtml +++ b/app/code/community/Phoenix/Moneybookers/view/adminhtml/pdf/info.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) + * @copyright Copyright (c) 2012 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ ?> diff --git a/app/code/community/Phoenix/Moneybookers/view/frontend/blank.phtml b/app/code/community/Phoenix/Moneybookers/view/frontend/blank.phtml index c56c42610c944e6706101109ca65b9da964c3b6a..1752c9c4b302a7b981364732e9c4dc08e6fb19f7 100644 --- a/app/code/community/Phoenix/Moneybookers/view/frontend/blank.phtml +++ b/app/code/community/Phoenix/Moneybookers/view/frontend/blank.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) + * @copyright Copyright (c) 2012 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ ?> diff --git a/app/code/community/Phoenix/Moneybookers/view/frontend/form.phtml b/app/code/community/Phoenix/Moneybookers/view/frontend/form.phtml index fc81acd03c95c28372aa388377a32ca6068a3e96..8484c1e2b6d6b51e4bc1b2ff27fc6bb2d7ee6819 100644 --- a/app/code/community/Phoenix/Moneybookers/view/frontend/form.phtml +++ b/app/code/community/Phoenix/Moneybookers/view/frontend/form.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) + * @copyright Copyright (c) 2012 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ ?> diff --git a/app/code/community/Phoenix/Moneybookers/view/frontend/info.phtml b/app/code/community/Phoenix/Moneybookers/view/frontend/info.phtml index 2e1aa28623ef055549c58a182551dedf406ff0a4..8e03475a7f9616ff95dd372bfa6d0c9c3a06ad17 100644 --- a/app/code/community/Phoenix/Moneybookers/view/frontend/info.phtml +++ b/app/code/community/Phoenix/Moneybookers/view/frontend/info.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) + * @copyright Copyright (c) 2012 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ ?> diff --git a/app/code/community/Phoenix/Moneybookers/view/frontend/layout.xml b/app/code/community/Phoenix/Moneybookers/view/frontend/layout.xml index 78315e278f236b7390a14eae16046e2bab35b700..aff28c1b59d08ca559feaa6ef698010e8cf2bf17 100644 --- a/app/code/community/Phoenix/Moneybookers/view/frontend/layout.xml +++ b/app/code/community/Phoenix/Moneybookers/view/frontend/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) + * @copyright Copyright (c) 2012 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/community/Phoenix/Moneybookers/view/frontend/payment.phtml b/app/code/community/Phoenix/Moneybookers/view/frontend/payment.phtml index 598648a66f033bf942a8934a8a04746869f2d73e..a1f13e95623dbaeca9b1866dafb78fd05ad369b0 100644 --- a/app/code/community/Phoenix/Moneybookers/view/frontend/payment.phtml +++ b/app/code/community/Phoenix/Moneybookers/view/frontend/payment.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) + * @copyright Copyright (c) 2012 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ ?> diff --git a/app/code/community/Phoenix/Moneybookers/view/frontend/placeform.phtml b/app/code/community/Phoenix/Moneybookers/view/frontend/placeform.phtml index 4314c9f3aae2f8c6ce2027b8f3623724d15b7def..0a0c2457ab060516e8413a29771d537a2a0f8778 100644 --- a/app/code/community/Phoenix/Moneybookers/view/frontend/placeform.phtml +++ b/app/code/community/Phoenix/Moneybookers/view/frontend/placeform.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) + * @copyright Copyright (c) 2012 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ ?> diff --git a/app/code/community/Phoenix/Moneybookers/view/frontend/redirect.phtml b/app/code/community/Phoenix/Moneybookers/view/frontend/redirect.phtml index 5278afd266037f3004a4beee4146cdc1add484c9..5ce2ebdf968d4f3885944124d3c42eb24ab3ff34 100644 --- a/app/code/community/Phoenix/Moneybookers/view/frontend/redirect.phtml +++ b/app/code/community/Phoenix/Moneybookers/view/frontend/redirect.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) + * @copyright Copyright (c) 2012 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ ?> diff --git a/app/code/core/Mage/Admin/Helper/Data.php b/app/code/core/Mage/Admin/Helper/Data.php index 0bc10b5f8b31647c4186f3dfe43d1db3ae7d6f33..16efad6d9947545ba726dad978fddf17b2498f29 100644 --- a/app/code/core/Mage/Admin/Helper/Data.php +++ b/app/code/core/Mage/Admin/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Admin/Model/Acl.php b/app/code/core/Mage/Admin/Model/Acl.php index aa5a2da69981bf6d4a49284f9730b50770e32f3b..57ad0e01ff731c147b9c9619417ee8ce474a8527 100644 --- a/app/code/core/Mage/Admin/Model/Acl.php +++ b/app/code/core/Mage/Admin/Model/Acl.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Admin - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Admin/Model/Acl/Resource.php b/app/code/core/Mage/Admin/Model/Acl/Resource.php index c0b6542a52cab53ddb6b596d2738873b9c0dcdb0..54ce97615e0cead6007a6ab4e30477a19abb9843 100644 --- a/app/code/core/Mage/Admin/Model/Acl/Resource.php +++ b/app/code/core/Mage/Admin/Model/Acl/Resource.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Admin - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Admin/Model/Acl/Role/Generic.php b/app/code/core/Mage/Admin/Model/Acl/Role/Generic.php index 83b0d9f6b21e1bbfd005e1b1b16642a5b61aee7b..232e528f4c6b2bc0aa9c58d72e953b808f31d9ea 100644 --- a/app/code/core/Mage/Admin/Model/Acl/Role/Generic.php +++ b/app/code/core/Mage/Admin/Model/Acl/Role/Generic.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Admin - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Admin/Model/Acl/Role/Group.php b/app/code/core/Mage/Admin/Model/Acl/Role/Group.php index 5bf94647c9c46ff05d25aee644c773eafab19b39..4afcea59df50ec5b6118b8bca90643bc0d9866d9 100644 --- a/app/code/core/Mage/Admin/Model/Acl/Role/Group.php +++ b/app/code/core/Mage/Admin/Model/Acl/Role/Group.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Admin - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Admin/Model/Acl/Role/Registry.php b/app/code/core/Mage/Admin/Model/Acl/Role/Registry.php index e3e8f2086db633adba987ea3726b86e44ff1d185..41c56f9d4d398302c079841838e1891656667861 100644 --- a/app/code/core/Mage/Admin/Model/Acl/Role/Registry.php +++ b/app/code/core/Mage/Admin/Model/Acl/Role/Registry.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Admin - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Admin/Model/Acl/Role/User.php b/app/code/core/Mage/Admin/Model/Acl/Role/User.php index f68c266be4e385a2b41766308aa29bca5c4f7289..728b20b199b9ef25e4bfdf9bd0fb836f0ec5ec13 100644 --- a/app/code/core/Mage/Admin/Model/Acl/Role/User.php +++ b/app/code/core/Mage/Admin/Model/Acl/Role/User.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Admin - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Admin/Model/Config.php b/app/code/core/Mage/Admin/Model/Config.php index 04830f2cb971038043a6f95ef245264308c335d6..6dcd1c41f50871e5a22daa84bde6d788be0e6a3f 100644 --- a/app/code/core/Mage/Admin/Model/Config.php +++ b/app/code/core/Mage/Admin/Model/Config.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Admin - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -101,6 +101,9 @@ class Mage_Admin_Model_Config extends Varien_Simplexml_Config } foreach ($children as $res) { + if (1 == $res->disabled) { + continue; + } $this->loadAclResources($acl, $res, $resourceName); } return $this; diff --git a/app/code/core/Mage/Admin/Model/Observer.php b/app/code/core/Mage/Admin/Model/Observer.php index 1a6742665f1e84397e93be7ba92ba5577b2acafc..89de6db9211af5a93ef0816f540cb57ee95a3727 100644 --- a/app/code/core/Mage/Admin/Model/Observer.php +++ b/app/code/core/Mage/Admin/Model/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Admin - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -33,6 +33,7 @@ */ class Mage_Admin_Model_Observer { + const FLAG_NO_LOGIN = 'no-login'; /** * Handler for controller_action_predispatch event * @@ -51,7 +52,8 @@ class Mage_Admin_Model_Observer 'forgotpassword', 'resetpassword', 'resetpasswordpost', - 'logout' + 'logout', + 'refresh' // captcha refresh ); if (in_array($requestedActionName, $openActions)) { $request->setDispatched(true); @@ -64,7 +66,7 @@ class Mage_Admin_Model_Observer $postLogin = $request->getPost('login'); $username = isset($postLogin['username']) ? $postLogin['username'] : ''; $password = isset($postLogin['password']) ? $postLogin['password'] : ''; - $user = $session->login($username, $password, $request); + $session->login($username, $password, $request); $request->setPost('login', null); } if (!$request->getParam('forwarded')) { diff --git a/app/code/core/Mage/Admin/Model/Resource/Acl.php b/app/code/core/Mage/Admin/Model/Resource/Acl.php index 92d45d22cc17a37bef3e5551fe74d18b6a97239b..c5b8d578521fa5536b268c00af6aa9365dc41fdf 100755 --- a/app/code/core/Mage/Admin/Model/Resource/Acl.php +++ b/app/code/core/Mage/Admin/Model/Resource/Acl.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Admin - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Admin/Model/Resource/Permissions/Collection.php b/app/code/core/Mage/Admin/Model/Resource/Permissions/Collection.php index c4222f94a152acd834176e038b0cbd3db1d4d79e..1781a2294cd4c0de6391ed74b27ac53731560014 100755 --- a/app/code/core/Mage/Admin/Model/Resource/Permissions/Collection.php +++ b/app/code/core/Mage/Admin/Model/Resource/Permissions/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Admin - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Admin/Model/Resource/Role.php b/app/code/core/Mage/Admin/Model/Resource/Role.php index 73728a22db22230e38c2384de86d75b252c0892d..3e8112bf3fbe86b0d709eb8b056ac1f4b9424b5b 100755 --- a/app/code/core/Mage/Admin/Model/Resource/Role.php +++ b/app/code/core/Mage/Admin/Model/Resource/Role.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Admin - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Admin/Model/Resource/Role/Collection.php b/app/code/core/Mage/Admin/Model/Resource/Role/Collection.php index 2fef922f2cd94f2b3c1045c74f16670cedddc2f8..5e5191981b8ca9bcf03c5f584906ff5ead575d77 100755 --- a/app/code/core/Mage/Admin/Model/Resource/Role/Collection.php +++ b/app/code/core/Mage/Admin/Model/Resource/Role/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Admin - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Admin/Model/Resource/Roles.php b/app/code/core/Mage/Admin/Model/Resource/Roles.php index 7241563db2cd4d285a0d1d4e3387462b78b398a2..eef0f4cf72434e0b1a6a431698e6f31dbea12368 100755 --- a/app/code/core/Mage/Admin/Model/Resource/Roles.php +++ b/app/code/core/Mage/Admin/Model/Resource/Roles.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Admin - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Admin/Model/Resource/Roles/Collection.php b/app/code/core/Mage/Admin/Model/Resource/Roles/Collection.php index 5d856ed1a1ff1a0d8a14f654ed320cc4d187be83..08b07eead7bc9a3fa41608e882db3d5bc7dba144 100755 --- a/app/code/core/Mage/Admin/Model/Resource/Roles/Collection.php +++ b/app/code/core/Mage/Admin/Model/Resource/Roles/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Admin - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Admin/Model/Resource/Roles/User/Collection.php b/app/code/core/Mage/Admin/Model/Resource/Roles/User/Collection.php index e5dab9a4a5194582dc32108761770ac7571be61c..1ee78cdfba988e86f9a92dcd0fa8f18c73718c7a 100755 --- a/app/code/core/Mage/Admin/Model/Resource/Roles/User/Collection.php +++ b/app/code/core/Mage/Admin/Model/Resource/Roles/User/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Admin - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Admin/Model/Resource/Rules.php b/app/code/core/Mage/Admin/Model/Resource/Rules.php index c636ba0740ca8b76cfa2ca782fc15c4add7a80a0..ea4d214939418ce44cccce8bfc3895f2ba57ec49 100755 --- a/app/code/core/Mage/Admin/Model/Resource/Rules.php +++ b/app/code/core/Mage/Admin/Model/Resource/Rules.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Admin - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Admin/Model/Resource/Rules/Collection.php b/app/code/core/Mage/Admin/Model/Resource/Rules/Collection.php index 16f498807696ac79dfceb63e735d05698f550dca..ece1b0dc1b09c7ee3907d95860100f836e6c7157 100755 --- a/app/code/core/Mage/Admin/Model/Resource/Rules/Collection.php +++ b/app/code/core/Mage/Admin/Model/Resource/Rules/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Admin - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Admin/Model/Resource/User.php b/app/code/core/Mage/Admin/Model/Resource/User.php index 04d52fac1fdac71a1bf28310ff62d442fc76c728..274db25183a62afb980375a3c57d411c9231e2e1 100755 --- a/app/code/core/Mage/Admin/Model/Resource/User.php +++ b/app/code/core/Mage/Admin/Model/Resource/User.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Admin - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Admin/Model/Resource/User/Collection.php b/app/code/core/Mage/Admin/Model/Resource/User/Collection.php index 37ba2c50a7ca1360b147e6492a73101f9c54e8c5..07065b0c03fcbfa8dfd716192d158d48832d9c23 100755 --- a/app/code/core/Mage/Admin/Model/Resource/User/Collection.php +++ b/app/code/core/Mage/Admin/Model/Resource/User/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Admin - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Admin/Model/Role.php b/app/code/core/Mage/Admin/Model/Role.php index ff22a35b0718cbc850fef5de94c92f5818a13ca7..c2f8d283cb07a8d6753419465ea85f458af423c0 100644 --- a/app/code/core/Mage/Admin/Model/Role.php +++ b/app/code/core/Mage/Admin/Model/Role.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Admin - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Admin/Model/Roles.php b/app/code/core/Mage/Admin/Model/Roles.php index 90386a9afc13e3a7844531a52966fa8949d322a3..62ebfcfadc527815452dae97d782142bf931df80 100644 --- a/app/code/core/Mage/Admin/Model/Roles.php +++ b/app/code/core/Mage/Admin/Model/Roles.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Admin - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -53,42 +53,86 @@ class Mage_Admin_Model_Roles extends Mage_Core_Model_Abstract */ protected $_eventPrefix = 'admin_roles'; + /** + * Constructor + */ protected function _construct() { $this->_init('Mage_Admin_Model_Resource_Roles'); } + /** + * Update object into database + * + * @return Mage_Admin_Model_Roles + */ public function update() { $this->getResource()->update($this); return $this; } + /** + * Retrieve users collection + * + * @return Mage_Admin_Model_Resource_Roles_User_Collection + */ public function getUsersCollection() { return Mage::getResourceModel('Mage_Admin_Model_Resource_Roles_User_Collection'); } + /** + * Return tree of acl resources + * + * @return array|null|Varien_Simplexml_Element + */ public function getResourcesTree() { return $this->_buildResourcesArray(null, null, null, null, true); } + /** + * Return list of acl resources + * + * @return array|null|Varien_Simplexml_Element + */ public function getResourcesList() { return $this->_buildResourcesArray(); } + /** + * Return list of acl resources in 2D format + * + * @return array|null|Varien_Simplexml_Element + */ public function getResourcesList2D() { return $this->_buildResourcesArray(null, null, null, true); } + /** + * Return users for role + * + * @return array|false + */ public function getRoleUsers() { return $this->getResource()->getRoleUsers($this); } + /** + * Build resources array process + * + * @param null|Varien_Simplexml_Element $resource + * @param null $parentName + * @param int $level + * @param null $represent2Darray + * @param bool $rawNodes + * @param string $module + * @return array|null|Varien_Simplexml_Element + */ protected function _buildResourcesArray(Varien_Simplexml_Element $resource = null, $parentName = null, $level = 0, $represent2Darray = null, $rawNodes = false, $module = 'Mage_Adminhtml') { @@ -99,7 +143,7 @@ class Mage_Admin_Model_Roles extends Mage_Core_Model_Abstract $level = -1; } else { $resourceName = $parentName; - if ($resource->getName() != 'title' && $resource->getName() != 'sort_order' && $resource->getName() != 'children') { + if (!in_array($resource->getName(), array('title', 'sort_order', 'children', 'disabled'))) { $resourceName = (is_null($parentName) ? '' : $parentName . '/') . $resource->getName(); //assigning module for its' children nodes @@ -121,22 +165,20 @@ class Mage_Admin_Model_Roles extends Mage_Core_Model_Abstract } } + //check children and run recursion if they exists $children = $resource->children(); - if (empty($children)) { - if ($rawNodes) { - return $resource; - } else { - return $result; + foreach ($children as $key => $child) { + if (1 == $child->disabled) { + $resource->{$key} = null; + continue; } - } - foreach ($children as $child) { $this->_buildResourcesArray($child, $resourceName, $level + 1, $represent2Darray, $rawNodes, $module); } + if ($rawNodes) { return $resource; } else { return $result; } } - } diff --git a/app/code/core/Mage/Admin/Model/Rules.php b/app/code/core/Mage/Admin/Model/Rules.php index 98c4572c5acdd29199dc837318e93398bf303ebd..18510a626481f790a7cfc362d4bb4afdc71d3f87 100644 --- a/app/code/core/Mage/Admin/Model/Rules.php +++ b/app/code/core/Mage/Admin/Model/Rules.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Admin - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Admin/Model/Session.php b/app/code/core/Mage/Admin/Model/Session.php index 21e6eeb370dc6b8e7067bce3980c46b954f3a9ec..87b119e050c2a824e753bbdfcc537b2594596f8c 100644 --- a/app/code/core/Mage/Admin/Model/Session.php +++ b/app/code/core/Mage/Admin/Model/Session.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Admin - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Admin/Model/User.php b/app/code/core/Mage/Admin/Model/User.php index 5d5107adb3575078d0fd746f7c401dc234a8bc2d..68f3d61bbf9ad00e53e8b299d6a22a009c5df42b 100644 --- a/app/code/core/Mage/Admin/Model/User.php +++ b/app/code/core/Mage/Admin/Model/User.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Admin - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -317,6 +317,10 @@ class Mage_Admin_Model_User extends Mage_Core_Model_Abstract $result = false; try { + Mage::dispatchEvent('admin_user_authenticate_before', array( + 'username' => $username, + 'user' => $this + )); $this->loadByUsername($username); $sensitive = ($config) ? $username == $this->getUsername() : true; @@ -384,7 +388,10 @@ class Mage_Admin_Model_User extends Mage_Core_Model_Abstract */ public function loadByUsername($username) { - $this->setData($this->getResource()->loadByUsername($username)); + $data = $this->getResource()->loadByUsername($username); + if ($data !== false) { + $this->setData($data); + } return $this; } @@ -533,7 +540,7 @@ class Mage_Admin_Model_User extends Mage_Core_Model_Abstract throw Mage::exception('Mage_Core', Mage::helper('Mage_Adminhtml_Helper_Data')->__('Invalid password reset token.')); } $this->setRpToken($newResetPasswordLinkToken); - $currentDate = Varien_Date::now(true); + $currentDate = Varien_Date::now(); $this->setRpTokenCreatedAt($currentDate); return $this; @@ -555,7 +562,7 @@ class Mage_Admin_Model_User extends Mage_Core_Model_Abstract $tokenExpirationPeriod = Mage::helper('Mage_Admin_Helper_Data')->getResetPasswordLinkExpirationPeriod(); - $currentDate = Varien_Date::now(true); + $currentDate = Varien_Date::now(); $currentTimestamp = Varien_Date::toTimestamp($currentDate); $tokenTimestamp = Varien_Date::toTimestamp($resetPasswordLinkTokenCreatedAt); if ($tokenTimestamp > $currentTimestamp) { diff --git a/app/code/core/Mage/Admin/data/admin_setup/data-install-1.6.0.0.php b/app/code/core/Mage/Admin/data/admin_setup/data-install-1.6.0.0.php index 235194f62aa19a943a5327293824dd63cc191b74..e72af399b2c8b4de2a1ba6893ac3f3a578db36ec 100644 --- a/app/code/core/Mage/Admin/data/admin_setup/data-install-1.6.0.0.php +++ b/app/code/core/Mage/Admin/data/admin_setup/data-install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Admin - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Admin/etc/config.xml b/app/code/core/Mage/Admin/etc/config.xml index cf108ed6cae85e0dec6016158e8204e379f0f79a..94990102f3dfd36836f130705cc124220996deee 100644 --- a/app/code/core/Mage/Admin/etc/config.xml +++ b/app/code/core/Mage/Admin/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Admin - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Admin/sql/admin_setup/install-1.6.0.0.php b/app/code/core/Mage/Admin/sql/admin_setup/install-1.6.0.0.php index ed2bbfe49f6f7532c7e5b66b7437afe5fd771fe8..139bdb89320aba3f7dfe8b3a194a9b40846ca2f7 100644 --- a/app/code/core/Mage/Admin/sql/admin_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/Admin/sql/admin_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Admin - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Admin/sql/admin_setup/mysql4-upgrade-1.6.0.0-1.6.1.0.php b/app/code/core/Mage/Admin/sql/admin_setup/mysql4-upgrade-1.6.0.0-1.6.1.0.php index 9333601b894f638ca7b391e61ceb3734023ceeae..e859d61215945847a6ad0eb704d6125199068c43 100644 --- a/app/code/core/Mage/Admin/sql/admin_setup/mysql4-upgrade-1.6.0.0-1.6.1.0.php +++ b/app/code/core/Mage/Admin/sql/admin_setup/mysql4-upgrade-1.6.0.0-1.6.1.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Admin - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/AdminNotification/Helper/Data.php b/app/code/core/Mage/AdminNotification/Helper/Data.php index 739dfb2ca1bb4ee88e3da456d1c189b4d3b216e2..03c809d472051e8ea5dff032f3923e81292f9d49 100644 --- a/app/code/core/Mage/AdminNotification/Helper/Data.php +++ b/app/code/core/Mage/AdminNotification/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_AdminNotification - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/AdminNotification/Model/Feed.php b/app/code/core/Mage/AdminNotification/Model/Feed.php index c31860923d03db6c33d26aeb799b75fe727ce93d..8abf3a6a85a358f3a6144067c211a35b160c632d 100644 --- a/app/code/core/Mage/AdminNotification/Model/Feed.php +++ b/app/code/core/Mage/AdminNotification/Model/Feed.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_AdminNotification - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/AdminNotification/Model/Inbox.php b/app/code/core/Mage/AdminNotification/Model/Inbox.php index 5bf8eac7486199b0ab22d03a5656463df1e1b5ad..ad0388bfa1b2ba19ba47b68e0bdd81def960f6bf 100644 --- a/app/code/core/Mage/AdminNotification/Model/Inbox.php +++ b/app/code/core/Mage/AdminNotification/Model/Inbox.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_AdminNotification - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/AdminNotification/Model/Observer.php b/app/code/core/Mage/AdminNotification/Model/Observer.php index a8889e2efeee180325825cc0e1bf35f65820dc57..23eaea6dbcfb4d818870b9daf2b121e12252f061 100644 --- a/app/code/core/Mage/AdminNotification/Model/Observer.php +++ b/app/code/core/Mage/AdminNotification/Model/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_AdminNotification - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/AdminNotification/Model/Resource/Inbox.php b/app/code/core/Mage/AdminNotification/Model/Resource/Inbox.php index bc063aaa821114f8f0a4cd0c0ff249ca8187425e..4cda51102758ac44d349fc156c8f7d3ed3540855 100755 --- a/app/code/core/Mage/AdminNotification/Model/Resource/Inbox.php +++ b/app/code/core/Mage/AdminNotification/Model/Resource/Inbox.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_AdminNotification - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/AdminNotification/Model/Resource/Inbox/Collection.php b/app/code/core/Mage/AdminNotification/Model/Resource/Inbox/Collection.php index 27e3efb566046e19601413fbf3e6c60901ab452e..e6a25b0bfb49eafc946fed8030bd33c61b307be3 100755 --- a/app/code/core/Mage/AdminNotification/Model/Resource/Inbox/Collection.php +++ b/app/code/core/Mage/AdminNotification/Model/Resource/Inbox/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_AdminNotification - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/AdminNotification/Model/Survey.php b/app/code/core/Mage/AdminNotification/Model/Survey.php index 727e2ae957700d4074a50e2b5ae291ed198dbd3d..60c9c050a77c3db256198744116c71b4383d8c68 100644 --- a/app/code/core/Mage/AdminNotification/Model/Survey.php +++ b/app/code/core/Mage/AdminNotification/Model/Survey.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_AdminNotification - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/AdminNotification/etc/adminhtml.xml b/app/code/core/Mage/AdminNotification/etc/adminhtml.xml index fcbccd651f364e168cf3559cf4af996f1a8cd3a8..5b832ebd0e77fe6806293b4c08b67012a2e7855c 100644 --- a/app/code/core/Mage/AdminNotification/etc/adminhtml.xml +++ b/app/code/core/Mage/AdminNotification/etc/adminhtml.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_AdminNotification - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/AdminNotification/etc/config.xml b/app/code/core/Mage/AdminNotification/etc/config.xml index 48f895a52c2713e87a903f59ca5cccae03d171db..ca235e0c651e18f8fcfe80ed86107a02789a40d7 100644 --- a/app/code/core/Mage/AdminNotification/etc/config.xml +++ b/app/code/core/Mage/AdminNotification/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_AdminNotification - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/AdminNotification/etc/system.xml b/app/code/core/Mage/AdminNotification/etc/system.xml index 1b84bb524e11fdb83d2ea3397bcfd1a2dc126cb7..25c3d665814b6a9fdec12ec22550087c1c85f8e9 100644 --- a/app/code/core/Mage/AdminNotification/etc/system.xml +++ b/app/code/core/Mage/AdminNotification/etc/system.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_AdminNotification - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/AdminNotification/sql/adminnotification_setup/install-1.6.0.0.php b/app/code/core/Mage/AdminNotification/sql/adminnotification_setup/install-1.6.0.0.php index 4cab117cbdd8156c24dd1bb2248dc71f58df8d0d..ddf4acb5a0a9dceeb29b42cb414eb6b41c2a458d 100644 --- a/app/code/core/Mage/AdminNotification/sql/adminnotification_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/AdminNotification/sql/adminnotification_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_AdminNotification - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Abstract.php b/app/code/core/Mage/Adminhtml/Block/Abstract.php index 8f35c49e5405dee43926f75721a6cbeb97e3b917..6c74c6351c2347e31135ef65646adc47c143b619 100644 --- a/app/code/core/Mage/Adminhtml/Block/Abstract.php +++ b/app/code/core/Mage/Adminhtml/Block/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Api/Buttons.php b/app/code/core/Mage/Adminhtml/Block/Api/Buttons.php index 46e025c8f5abff54a8ce375c38a363a810dcd165..4211fcf00ca2cffbcf1ffe298f4dfa78744bb97e 100644 --- a/app/code/core/Mage/Adminhtml/Block/Api/Buttons.php +++ b/app/code/core/Mage/Adminhtml/Block/Api/Buttons.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Api/Editroles.php b/app/code/core/Mage/Adminhtml/Block/Api/Editroles.php index d8efed829779145d2429c965b8095b874582d283..35fda6fe972bbd321bb8d7272a845e95e3c36907 100644 --- a/app/code/core/Mage/Adminhtml/Block/Api/Editroles.php +++ b/app/code/core/Mage/Adminhtml/Block/Api/Editroles.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Api/Grid/Role.php b/app/code/core/Mage/Adminhtml/Block/Api/Grid/Role.php index eb8427e7bb305d1724c295c6abd4c1f2675a23e1..a1c429c4c3db4d2d1657ad0f51333ce53854b913 100644 --- a/app/code/core/Mage/Adminhtml/Block/Api/Grid/Role.php +++ b/app/code/core/Mage/Adminhtml/Block/Api/Grid/Role.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Api/Role.php b/app/code/core/Mage/Adminhtml/Block/Api/Role.php index 5ca3f0389ad5caceb25e2fe8caa708489d511bb4..233c1cb740344939bad7f145e5160095f9684578 100644 --- a/app/code/core/Mage/Adminhtml/Block/Api/Role.php +++ b/app/code/core/Mage/Adminhtml/Block/Api/Role.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Api/Role/Grid/User.php b/app/code/core/Mage/Adminhtml/Block/Api/Role/Grid/User.php index 475dfcb11cd82a36c473ca987aca4bf1c2dfbf43..2631695500acee54ce04ed448480b5ab990a7c96 100644 --- a/app/code/core/Mage/Adminhtml/Block/Api/Role/Grid/User.php +++ b/app/code/core/Mage/Adminhtml/Block/Api/Role/Grid/User.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Api/Roles.php b/app/code/core/Mage/Adminhtml/Block/Api/Roles.php index db7a76b33ed0840760d139af862c9418dfc67e68..808487f9f4865eff3757d0c76ffe777d5a730004 100644 --- a/app/code/core/Mage/Adminhtml/Block/Api/Roles.php +++ b/app/code/core/Mage/Adminhtml/Block/Api/Roles.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Api/Tab/Roleinfo.php b/app/code/core/Mage/Adminhtml/Block/Api/Tab/Roleinfo.php index 02f01cc3263c05901d63ffbb38e28e9805b00e7c..e44c43ebfb16ae9b2595a0fc985a341cb62370b2 100644 --- a/app/code/core/Mage/Adminhtml/Block/Api/Tab/Roleinfo.php +++ b/app/code/core/Mage/Adminhtml/Block/Api/Tab/Roleinfo.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Api/Tab/Rolesedit.php b/app/code/core/Mage/Adminhtml/Block/Api/Tab/Rolesedit.php index aa6b9d0ec9bdb34d1a0d07dbec2b3105ee798d84..2975b5b897072dbdc8aa43956bc7345ba6ed5bfe 100644 --- a/app/code/core/Mage/Adminhtml/Block/Api/Tab/Rolesedit.php +++ b/app/code/core/Mage/Adminhtml/Block/Api/Tab/Rolesedit.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Api/Tab/Rolesusers.php b/app/code/core/Mage/Adminhtml/Block/Api/Tab/Rolesusers.php index 7171f0dcae7a0fd38155de0621cb22fb620ce85e..b807d26da58c7db0a9eb63365bb4421f4d699fa4 100644 --- a/app/code/core/Mage/Adminhtml/Block/Api/Tab/Rolesusers.php +++ b/app/code/core/Mage/Adminhtml/Block/Api/Tab/Rolesusers.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Api/User.php b/app/code/core/Mage/Adminhtml/Block/Api/User.php index 4867b31b716f5404bf36499eb830f8bb5f12f769..f7178573d2f3f8f86840cefbd79f1ce8997f5d0b 100644 --- a/app/code/core/Mage/Adminhtml/Block/Api/User.php +++ b/app/code/core/Mage/Adminhtml/Block/Api/User.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -42,4 +42,14 @@ class Mage_Adminhtml_Block_Api_User extends Mage_Adminhtml_Block_Widget_Grid_Con parent::__construct(); } + /** + * Prepare output HTML + * + * @return string + */ + protected function _toHtml() + { + Mage::dispatchEvent('api_user_html_before', array('block' => $this)); + return parent::_toHtml(); + } } diff --git a/app/code/core/Mage/Adminhtml/Block/Api/User/Edit.php b/app/code/core/Mage/Adminhtml/Block/Api/User/Edit.php index b03c2e10f4052da2cdedae47c205497353e2409f..4a16f75a3a7d0fe472f4e239c58f2d43dee7b980 100644 --- a/app/code/core/Mage/Adminhtml/Block/Api/User/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/Api/User/Edit.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Api/User/Edit/Form.php b/app/code/core/Mage/Adminhtml/Block/Api/User/Edit/Form.php index 273d8308dba99c9c12ff7a7eb6775b7aa64ecd11..0b379121b3053f1c225ac0e96bcd980fd1e4b07f 100644 --- a/app/code/core/Mage/Adminhtml/Block/Api/User/Edit/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Api/User/Edit/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Api/User/Edit/Tab/Main.php b/app/code/core/Mage/Adminhtml/Block/Api/User/Edit/Tab/Main.php index 1526533aefb0188d8c77652b7b2ec919d15d8660..23d6191bb277bd69eb51532940807f75bdd17b12 100644 --- a/app/code/core/Mage/Adminhtml/Block/Api/User/Edit/Tab/Main.php +++ b/app/code/core/Mage/Adminhtml/Block/Api/User/Edit/Tab/Main.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Api/User/Edit/Tab/Roles.php b/app/code/core/Mage/Adminhtml/Block/Api/User/Edit/Tab/Roles.php index e26862298e441d01bd4c70310e390f2411c39dc4..24540a34d6ff5e4230bfe83d854cd919da4279ce 100644 --- a/app/code/core/Mage/Adminhtml/Block/Api/User/Edit/Tab/Roles.php +++ b/app/code/core/Mage/Adminhtml/Block/Api/User/Edit/Tab/Roles.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Api/User/Edit/Tabs.php b/app/code/core/Mage/Adminhtml/Block/Api/User/Edit/Tabs.php index 5fb0a9b5f01c62926c7efded4c7d8af5fb3a1ee5..2b8da75ce3824766551845b404295096583c4a46 100644 --- a/app/code/core/Mage/Adminhtml/Block/Api/User/Edit/Tabs.php +++ b/app/code/core/Mage/Adminhtml/Block/Api/User/Edit/Tabs.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Api/User/Grid.php b/app/code/core/Mage/Adminhtml/Block/Api/User/Grid.php index 16c5bea7c0c0c9544f89ada6eeee440c3bdbb15a..97f58f6afe42227a3a4048daee64821efcd5a6a9 100644 --- a/app/code/core/Mage/Adminhtml/Block/Api/User/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Api/User/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Backup.php b/app/code/core/Mage/Adminhtml/Block/Backup.php index 6f4423b08ff3504c51e414ca8906e800de645c7d..18b3a26f741647f8d769ea05d90edda06a0f4dc5 100644 --- a/app/code/core/Mage/Adminhtml/Block/Backup.php +++ b/app/code/core/Mage/Adminhtml/Block/Backup.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -31,14 +31,14 @@ * @package Mage_Adminhtml * @author Magento Core Team <core@magentocommerce.com> */ - class Mage_Adminhtml_Block_Backup extends Mage_Adminhtml_Block_Template { - public function __construct() - { - parent::__construct(); - $this->setTemplate('backup/list.phtml'); - } + /** + * Block's template + * + * @var string + */ + protected $_template = 'backup/list.phtml'; protected function _prepareLayout() { @@ -46,14 +46,32 @@ class Mage_Adminhtml_Block_Backup extends Mage_Adminhtml_Block_Template $this->setChild('createButton', $this->getLayout()->createBlock('Mage_Adminhtml_Block_Widget_Button') ->setData(array( - 'label' => Mage::helper('Mage_Backup_Helper_Data')->__('Create Backup'), - 'onclick' => "window.location.href='" . $this->getUrl('*/*/create') . "'", + 'label' => Mage::helper('Mage_Backup_Helper_Data')->__('Database Backup'), + 'onclick' => "return backup.backup('" . Mage_Backup_Helper_Data::TYPE_DB . "')", 'class' => 'task' )) ); + $this->setChild('createSnapshotButton', + $this->getLayout()->createBlock('Mage_Adminhtml_Block_Widget_Button') + ->setData(array( + 'label' => Mage::helper('Mage_Backup_Helper_Data')->__('System Backup'), + 'onclick' => "return backup.backup('" . Mage_Backup_Helper_Data::TYPE_SYSTEM_SNAPSHOT . "')", + 'class' => '' + )) + ); + $this->setChild('createMediaBackupButton', + $this->getLayout()->createBlock('Mage_Adminhtml_Block_Widget_Button') + ->setData(array( + 'label' => Mage::helper('Mage_Backup_Helper_Data')->__('Database and Media Backup'), + 'onclick' => "return backup.backup('" . Mage_Backup_Helper_Data::TYPE_MEDIA . "')", + 'class' => '' + )) + ); $this->setChild('backupsGrid', $this->getLayout()->createBlock('Mage_Adminhtml_Block_Backup_Grid') ); + + $this->setChild('dialogs', $this->getLayout()->createBlock('Mage_Adminhtml_Block_Backup_Dialogs')); } public function getCreateButtonHtml() @@ -61,8 +79,38 @@ class Mage_Adminhtml_Block_Backup extends Mage_Adminhtml_Block_Template return $this->getChildHtml('createButton'); } + /** + * Generate html code for "Create System Snapshot" button + * + * @return string + */ + public function getCreateSnapshotButtonHtml() + { + return $this->getChildHtml('createSnapshotButton'); + } + + /** + * Generate html code for "Create Media Backup" button + * + * @return string + */ + public function getCreateMediaBackupButtonHtml() + { + return $this->getChildHtml('createMediaBackupButton'); + } + public function getGridHtml() { return $this->getChildHtml('backupsGrid'); } + + /** + * Generate html code for pop-up messages that will appear when user click on "Rollback" link + * + * @return string + */ + public function getDialogsHtml() + { + return $this->getChildHtml('dialogs'); + } } diff --git a/app/code/core/Mage/Adminhtml/Block/Backup/Dialogs.php b/app/code/core/Mage/Adminhtml/Block/Backup/Dialogs.php new file mode 100644 index 0000000000000000000000000000000000000000..bb8dd2029bfa1c20589ea1b13a761d512a9729f7 --- /dev/null +++ b/app/code/core/Mage/Adminhtml/Block/Backup/Dialogs.php @@ -0,0 +1,53 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Adminhtml + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Adminhtml rollback dialogs block + * + * @category Mage + * @package Mage_Adminhtml + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Adminhtml_Block_Backup_Dialogs extends Mage_Adminhtml_Block_Template +{ + /** + * Block's template + * + * @var string + */ + protected $_template = 'backup/dialogs.phtml'; + + /** + * Include backup.js file in page before rendering + * + * @see Mage_Core_Block_Abstract::_prepareLayout() + */ + protected function _prepareLayout() + { + $this->getLayout()->getBlock('head')->addJs('mage/adminhtml/backup.js'); + parent::_prepareLayout(); + } +} diff --git a/app/code/core/Mage/Adminhtml/Block/Backup/Grid.php b/app/code/core/Mage/Adminhtml/Block/Backup/Grid.php index 9c1970073bf86066538e363a760244b978dac347..dad58e2aa479772b0a11041b0054a7c12b617f09 100644 --- a/app/code/core/Mage/Adminhtml/Block/Backup/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Backup/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -51,8 +51,29 @@ class Mage_Adminhtml_Block_Backup_Grid extends Mage_Adminhtml_Block_Widget_Grid return parent::_prepareCollection(); } + /** + * Prepare mass action controls + * + * @return Mage_Adminhtml_Block_Backup_Grid + */ + protected function _prepareMassaction() + { + $this->setMassactionIdField('id'); + $this->getMassactionBlock()->setFormFieldName('ids'); + + $this->getMassactionBlock()->addItem('delete', array( + 'label'=> Mage::helper('Mage_Adminhtml_Helper_Data')->__('Delete'), + 'url' => $this->getUrl('*/*/massDelete'), + 'confirm' => Mage::helper('Mage_Backup_Helper_Data')->__('Are you sure you want to delete the selected backup(s)?') + )); + + return $this; + } + /** * Configuration of grid + * + * @return Mage_Adminhtml_Block_Backup_Grid */ protected function _prepareColumns() { @@ -62,45 +83,58 @@ class Mage_Adminhtml_Block_Backup_Grid extends Mage_Adminhtml_Block_Widget_Grid 'header' => Mage::helper('Mage_Backup_Helper_Data')->__('Time'), 'index' => 'date_object', 'type' => 'datetime', + 'width' => 200 + )); + + $this->addColumn('display_name', array( + 'header' => Mage::helper('Mage_Backup_Helper_Data')->__('Name'), + 'index' => 'display_name', + 'filter' => false, + 'sortable' => true, + 'width' => 350 )); $this->addColumn('size', array( 'header' => Mage::helper('Mage_Backup_Helper_Data')->__('Size, Bytes'), 'index' => 'size', 'type' => 'number', - 'sortable' => false, + 'sortable' => true, 'filter' => false )); $this->addColumn('type', array( 'header' => Mage::helper('Mage_Backup_Helper_Data')->__('Type'), 'type' => 'options', - 'options' => array('db' => Mage::helper('Mage_Backup_Helper_Data')->__('DB')), - 'index' =>'type' + 'options' => Mage::helper('Mage_Backup_Helper_Data')->getBackupTypes(), + 'index' => 'type', + 'width' => 300 )); $this->addColumn('download', array( 'header' => Mage::helper('Mage_Backup_Helper_Data')->__('Download'), - 'format' => '<a href="' . $this->getUrl('*/*/download', array('time' => '$time', 'type' => '$type')) .'">gz</a> <small>('.$url7zip.')</small>', + 'format' => '<a href="' . $this->getUrl('*/*/download', array('time' => '$time', 'type' => '$type')) + . '">$extension</a> <small>('.$url7zip.')</small>', 'index' => 'type', 'sortable' => false, 'filter' => false )); - $this->addColumn('action', array( - 'header' => Mage::helper('Mage_Backup_Helper_Data')->__('Action'), - 'type' => 'action', - 'width' => '80px', - 'filter' => false, - 'sortable' => false, - 'actions' => array(array( - 'url' => $this->getUrl('*/*/delete', array('time' => '$time', 'type' => '$type')), - 'caption' => Mage::helper('Mage_Adminhtml_Helper_Data')->__('Delete'), - 'confirm' => Mage::helper('Mage_Adminhtml_Helper_Data')->__('Are you sure you want to do this?') - )), - 'index' => 'type', - 'sortable' => false - )); + if (Mage::helper('Mage_Backup_Helper_Data')->isRollbackAllowed()){ + $this->addColumn('action', array( + 'header' => Mage::helper('Mage_Backup_Helper_Data')->__('Action'), + 'type' => 'action', + 'width' => '80px', + 'filter' => false, + 'sortable' => false, + 'actions' => array(array( + 'url' => '#', + 'caption' => Mage::helper('Mage_Backup_Helper_Data')->__('Rollback'), + 'onclick' => 'return backup.rollback(\'$type\', \'$time\');' + )), + 'index' => 'type', + 'sortable' => false + )); + } return $this; } diff --git a/app/code/core/Mage/Adminhtml/Block/Cache.php b/app/code/core/Mage/Adminhtml/Block/Cache.php index 7e91468d7c3536deb321c8749b67bb4524ed3958..cd98aacd9c520f4727fec0a58e6556c5fe2fb710 100644 --- a/app/code/core/Mage/Adminhtml/Block/Cache.php +++ b/app/code/core/Mage/Adminhtml/Block/Cache.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Cache/Additional.php b/app/code/core/Mage/Adminhtml/Block/Cache/Additional.php index e22931a1d980afd8d775a99a3829dfa427c9cb92..45838b407d01d0148967672894a0660fe040ae01 100644 --- a/app/code/core/Mage/Adminhtml/Block/Cache/Additional.php +++ b/app/code/core/Mage/Adminhtml/Block/Cache/Additional.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Cache/Grid.php b/app/code/core/Mage/Adminhtml/Block/Cache/Grid.php index a4c14debd79755290378a0ce89d93c5a6e497d5d..bf74757f6de97d4d1af0b09a93d78ef1ac7ba572 100644 --- a/app/code/core/Mage/Adminhtml/Block/Cache/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Cache/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Cache/Notifications.php b/app/code/core/Mage/Adminhtml/Block/Cache/Notifications.php index 3cb64e2862ca717cc6557134f7aa99a61a78957b..6fc5c8f9d2e1b9d908767679413c26905df44f58 100644 --- a/app/code/core/Mage/Adminhtml/Block/Cache/Notifications.php +++ b/app/code/core/Mage/Adminhtml/Block/Cache/Notifications.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Abstract.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Abstract.php index a804a383b62d1428a728ec9464179de1dea5e4ae..d1f31abad59e82b437c753c8481738647423761f 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Abstract.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Checkboxes/Tree.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Checkboxes/Tree.php index 2277c4f8216525cfa9cbfe21fe4e4d90f79447ce..0db2e8028ddf30f41312aab84904f5dd7cae70e8 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Checkboxes/Tree.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Checkboxes/Tree.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Edit.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Edit.php index 1eb19e60428c56d7fe44b7cd9126ed38e3a7fd81..9b42349804a6c9801dc9004c4305e42f59b7d6a6 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Edit.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Edit/Form.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Edit/Form.php index 2c04e2c035038be451807f44e4c61ec1850b1c8f..99fbb442e51569d7d025466238550297c3350793 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Edit/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Edit/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Helper/Image.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Helper/Image.php index 19ddf2b64c60da05c27f1cc2a66371f56f1bd6e6..c29d1eb4ce7a20fab2bc95d99be762eb43bd5e91 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Helper/Image.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Helper/Image.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Helper/Pricestep.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Helper/Pricestep.php index 8359777215501cfa68ad8b59b5e9e6a56f6fb81d..addd5efdf4df129c8374898d2d142cfa3991e1e6 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Helper/Pricestep.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Helper/Pricestep.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Helper/Sortby/Available.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Helper/Sortby/Available.php index ba9543926d3ffa5512913f42ee640666b64201ca..77723bca792567b15e3abf5d3354b303a5c27428 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Helper/Sortby/Available.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Helper/Sortby/Available.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Helper/Sortby/Default.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Helper/Sortby/Default.php index 012e84e3c6ff68e5cf68fbacc8a8523e03e17dfa..8b32d7a5f390ccb0519ce0fde4aaecf830d0422b 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Helper/Sortby/Default.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Helper/Sortby/Default.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tab/Attributes.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tab/Attributes.php index 3f7f5f3ff2235c4773b33a181cdc1c431fbf273a..f95592d9cfab465a3f35fe9389f0bd1b9c9a4ad5 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tab/Attributes.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tab/Attributes.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -158,6 +158,8 @@ class Mage_Adminhtml_Block_Catalog_Category_Tab_Attributes extends Mage_Adminhtm $form->addValues($this->getCategory()->getData()); + Mage::dispatchEvent('adminhtml_catalog_category_edit_prepare_form', array('form'=>$form)); + $form->setFieldNameSuffix('general'); $this->setForm($form); diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tab/Design.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tab/Design.php index f60c209cdafdbf71f1e2e30cf62b1f016b5c221d..223c90e8a69b6507fc760ceae674b7ba1f2df4c0 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tab/Design.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tab/Design.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Adminhtml_Block_Catalog_Category_Tab_Design extends Mage_Adminhtml_Block_Catalog_Form diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tab/General.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tab/General.php index 3f0ab2aab8841cb6549ca7e45715f8851e69ec65..866972f700c698779940fa25fa916686adac84a9 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tab/General.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tab/General.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tab/Product.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tab/Product.php index a826bb636f5483985ab89dfb4438a56f3359d158..0645b1182b24f0ea8409d59815d7128d42b49065 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tab/Product.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tab/Product.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tabs.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tabs.php index f0ebc3ceb407f038d6323d240896cd1fce548fa0..690df6c4f3a590fb39ffed5df2c4572954861d0c 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tabs.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tabs.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tree.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tree.php index 218836465ef8a6dd489be35ca26b79ac06b12d25..09c1c33fb2943e56b14b37c0d9e0ee673b566ae5 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tree.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tree.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Widget/Chooser.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Widget/Chooser.php index 63fb88bf906316679d14aff5649a3fcf73d4ce5f..8795d35ed9b2c81370c06bc5ab36881b57b2aa27 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Widget/Chooser.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Widget/Chooser.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Form.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Form.php index 4beeda55020cf822a68912c3b0b9e43ae28bd1b3..3258b54b0e196e8406cb35626a6b995423449f36 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Form/Renderer/Attribute/Urlkey.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Form/Renderer/Attribute/Urlkey.php index a2c60ba726773c23b38d92c572c9c26102acd462..d6620f5a61d0227eca0f47105fed6a32822dbd44 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Form/Renderer/Attribute/Urlkey.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Form/Renderer/Attribute/Urlkey.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Form/Renderer/Config/DateFieldsOrder.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Form/Renderer/Config/DateFieldsOrder.php index b6e94bcf59293b3d7e31716357003af4a08e12da..1c3f91607f8d28e7c32a310bc5ff9e5ce8cdad25 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Form/Renderer/Config/DateFieldsOrder.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Form/Renderer/Config/DateFieldsOrder.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -31,7 +31,8 @@ * @package Mage_Adminhtml * @author Magento Core Team <core@magentocommerce.com> */ -class Mage_Adminhtml_Block_Catalog_Form_Renderer_Config_DateFieldsOrder extends Mage_Adminhtml_Block_System_Config_Form_Field +class Mage_Adminhtml_Block_Catalog_Form_Renderer_Config_DateFieldsOrder + extends Mage_Adminhtml_Block_System_Config_Form_Field { protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element) @@ -43,7 +44,7 @@ class Mage_Adminhtml_Block_Catalog_Form_Renderer_Config_DateFieldsOrder extends ); $element->setValues($_options) - ->setStyle('width:70px;') + ->setClass('select-date') ->setName($element->getName() . '[]'); if ($element->getValue()) { $values = explode(',', $element->getValue()); @@ -56,6 +57,6 @@ class Mage_Adminhtml_Block_Catalog_Form_Renderer_Config_DateFieldsOrder extends $_parts[] = $element->setValue(isset($values[1]) ? $values[1] : null)->getElementHtml(); $_parts[] = $element->setValue(isset($values[2]) ? $values[2] : null)->getElementHtml(); - return implode(' / ', $_parts); + return implode(' <span>/</span> ', $_parts); } } diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Form/Renderer/Config/YearRange.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Form/Renderer/Config/YearRange.php index 01825609f052bc65fd9f40bacaa9a92d2ee7bd1f..1cb3b55ec428d69b117b9ca6844e88ac407ce253 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Form/Renderer/Config/YearRange.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Form/Renderer/Config/YearRange.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Form/Renderer/Fieldset/Element.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Form/Renderer/Fieldset/Element.php index c1c037356ab47573fa61cb0e9d706914099b2f25..64d9bf059cdeb8dd4ba5b7038ce0452f84f9db5e 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Form/Renderer/Fieldset/Element.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Form/Renderer/Fieldset/Element.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Helper/Form/Wysiwyg.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Helper/Form/Wysiwyg.php index d78754868277528a99d38951859a62dd17256bf5..98758aa32b9b1aa719d4f5c0aa3d4d9e45cfb7be 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Helper/Form/Wysiwyg.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Helper/Form/Wysiwyg.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Helper/Form/Wysiwyg/Content.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Helper/Form/Wysiwyg/Content.php index 09b672c08ad2a467abd8841ffa6b85e017ca865f..3771e6d50fa308d0dec36c63e790645dc915cd7a 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Helper/Form/Wysiwyg/Content.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Helper/Form/Wysiwyg/Content.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product.php index dfa9b2a816467fabdea9ded0d98b2f4bc3dc4205..0c4d72eb06a742c0edbeb9faddb1913757beefc7 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute.php index d74d8b1684b48e0dcd40d9f68d8d3b4a0728d5a2..f8394342e0527839cc0f7d4584e213921320a76c 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Edit.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Edit.php index 536d128f609aeed1fd1dc9195186e229a186f01d..10dbbc8aca748045dfc7ccad534725d81dc914ee 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Edit.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Edit/Form.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Edit/Form.php index 2cce45dc082e4fb15bbadec8921827abd66f9fcf..33d804ea8e3475d3d198a737f77f4dec6997fa57 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Edit/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Edit/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Edit/Tab/Front.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Edit/Tab/Front.php index 705bf5a830438c13f70ddaa60057df355b0fff2c..37716de504ea8fa4ebd97c02ea54543c9c6d8911 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Edit/Tab/Front.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Edit/Tab/Front.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Edit/Tab/Main.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Edit/Tab/Main.php index e2669552a2c4f6153736cc2b91d0179b97710fce..2ef8b05f4e167bca29a990729c517490f20dae8b 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Edit/Tab/Main.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Edit/Tab/Main.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Edit/Tab/Options.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Edit/Tab/Options.php index cd27d2dac698d42566cffc74ce7008926aff60bf..3af4de122652fce567ec9d4aa564e5c5a2616083 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Edit/Tab/Options.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Edit/Tab/Options.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Edit/Tab/System.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Edit/Tab/System.php index cbcc14110ff84db9ccb80159d4ca9a5dd2f1c4a6..eddd31325e39520b7910e1cc461fb492c614fe44 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Edit/Tab/System.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Edit/Tab/System.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Edit/Tabs.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Edit/Tabs.php index 27608d7c7c63b4c273a7b14e2ce62c6ad149bd83..5be21368edc86d36937ef7b47c1b5f01cfd25360 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Edit/Tabs.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Edit/Tabs.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Grid.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Grid.php index dd4813e5d9ace02d856451db10655ecf06e0c586..f2545cfbf041aefa7317790acd9a029c7a393e08 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/New/Product/Attributes.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/New/Product/Attributes.php index 65343384a0edf50f025b293cfbef2bd503d710b4..a8ee27db74a4c08898961ad7970f35fe2ebd0024 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/New/Product/Attributes.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/New/Product/Attributes.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/New/Product/Created.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/New/Product/Created.php index d60eb01f097609bd123d128b80e70139d0d092f1..f2d709176c3068feaa98be94602643818ec2cad2 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/New/Product/Created.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/New/Product/Created.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Grid.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Grid.php index a3ecc79ecfdaabc67e34b4a9904845978a1127c4..906047aed0f77820a229da8ca14a6925c57236ee 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Main.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Main.php index eeaa644fb29a7c886a867f47c94fa38ef33dd8de..32446600eb7f9191d475ea58e982124adf251395 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Main.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Main.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Main/Formattribute.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Main/Formattribute.php index 41b54c51ecaf082a1ef53852193ff82b4641faca..9f4d406311284c14a197c2d9c692538c59278cbb 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Main/Formattribute.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Main/Formattribute.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Main/Formgroup.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Main/Formgroup.php index 22e9480aef7695a1a60349afca52ea8e7c5a16e8..99bc887bd009629a60bfdc02dd1c1dcc3a520ef8 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Main/Formgroup.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Main/Formgroup.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Main/Formset.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Main/Formset.php index e2fc74ccb4975e585e460b469fd78a825d2c850c..9bc9872ebfebe88e8c4fce96cc8855df68759d41 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Main/Formset.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Main/Formset.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Main/Tree/Attribute.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Main/Tree/Attribute.php index 5f3a8e7b4a48d915a443e2261df097f01e8a8ed9..f8076dbd393947adf1e1ec1f57c248fb0bd2c84f 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Main/Tree/Attribute.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Main/Tree/Attribute.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Main/Tree/Group.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Main/Tree/Group.php index a1709c68a239ec49c34ec259a2dd9ca67f73b49d..64054a1d636bfac72f2868c6edf070654a44e98f 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Main/Tree/Group.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Main/Tree/Group.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Toolbar/Add.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Toolbar/Add.php index d01770f7668d5e7a85610ba18d414e157a481386..f88d94ad344684457850b592e583533514e166c0 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Toolbar/Add.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Toolbar/Add.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Toolbar/Main.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Toolbar/Main.php index d2d6e64a93eb8a01764988bc6c6ce8a22f3aca86..35249d1728d7a33817a872db58159317eccec5d1 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Toolbar/Main.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Toolbar/Main.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Toolbar/Main/Filter.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Toolbar/Main/Filter.php index 18be72a97d650258bb50399fea3220e7b79132d2..f7ccf2cc16c162aabd5834c8a01364f2db32cb18 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Toolbar/Main/Filter.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Toolbar/Main/Filter.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Composite/Configure.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Composite/Configure.php index 04a3a2f8841b026644620f05c13019b4ea3da7de..9c0d3e22610f57542fd6639416e3a48e5c4bdd80 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Composite/Configure.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Composite/Configure.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Composite/Error.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Composite/Error.php index 8ce3965558a95b3fcf7089bbc535be8dbdb300d1..16e3e24342ed11b7697fb10556e0dc014bb6b0c5 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Composite/Error.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Composite/Error.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Composite/Fieldset.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Composite/Fieldset.php index ad622feda89a04e8374fb19ff8085623d41c83c6..09707c6d161adbfe64096adfd2926037188c8599 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Composite/Fieldset.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Composite/Fieldset.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Composite/Fieldset/Configurable.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Composite/Fieldset/Configurable.php index 38b89043664a6da1cbf3d0d7978229b6d177b513..55a1ef946e72d1bf0006232b72af6e70f045d718 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Composite/Fieldset/Configurable.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Composite/Fieldset/Configurable.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Composite/Fieldset/Grouped.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Composite/Fieldset/Grouped.php index d2134ed7f33777da19ed2679a8e1a72487292177..518e2e55a32c83da7e4be4eae9ff3169b611af40 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Composite/Fieldset/Grouped.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Composite/Fieldset/Grouped.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Composite/Fieldset/Options.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Composite/Fieldset/Options.php index 018e84473db59c52d4ec95a9540316ff01ffb50e..4c0ed1e572c1a6573bc2a9f991471bc3211f892b 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Composite/Fieldset/Options.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Composite/Fieldset/Options.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Composite/Fieldset/Qty.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Composite/Fieldset/Qty.php index fd9bc26c04d9a9b628b4e759d6fca89165135aed..9f713afe29a556cab26bdd310dae6c437a9528fb 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Composite/Fieldset/Qty.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Composite/Fieldset/Qty.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Composite/Update/Result.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Composite/Update/Result.php index f1ddbd71e01813d953fd7e9e4cb0d7073ba45904..587a64a09d576ea5d7c626e8468370ee24a1bf5a 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Composite/Update/Result.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Composite/Update/Result.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Created.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Created.php index 6bbd6f9925422fd7635b2350e4e2c9462e5ab05f..07e298ef379524a18d6a81c9ab615c9c13ed5045 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Created.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Created.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit.php index 8a68f84cda92838c30785712eddec7c193007894..3de983aff69b160e1acbd807e8decd9a0101acba 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Action/Attribute.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Action/Attribute.php index 5c50466e3cdd861b5e62482674d9d74b6179639e..86c497318117ff8189d38e23c0eec53fc652b038 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Action/Attribute.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Action/Attribute.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Action/Attribute/Tab/Attributes.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Action/Attribute/Tab/Attributes.php index 308e37495314e2f22f62d4d3d57e5209f2915907..5249a57b00edb89ad842a9f79577b208e756ac55 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Action/Attribute/Tab/Attributes.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Action/Attribute/Tab/Attributes.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -44,7 +44,9 @@ class Mage_Adminhtml_Block_Catalog_Product_Edit_Action_Attribute_Tab_Attributes protected function _prepareForm() { - $this->setFormExcludedFieldList(array('tier_price','gallery', 'media_gallery', 'recurring_profile')); + $this->setFormExcludedFieldList(array( + 'tier_price','gallery', 'media_gallery', 'recurring_profile', 'group_price' + )); Mage::dispatchEvent('adminhtml_catalog_product_form_prepare_excluded_field_list', array('object'=>$this)); $form = new Varien_Data_Form(); @@ -79,9 +81,9 @@ class Mage_Adminhtml_Block_Catalog_Product_Edit_Action_Attribute_Tab_Attributes { return array( 'price' => Mage::getConfig()->getBlockClassName('Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Price'), + 'weight' => Mage::getConfig()->getBlockClassName('Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Weight'), 'image' => Mage::getConfig()->getBlockClassName('Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Image'), - 'boolean' => Mage::getConfig() - ->getBlockClassName('Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Boolean') + 'boolean' => Mage::getConfig()->getBlockClassName('Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Boolean') ); } diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Action/Attribute/Tab/Inventory.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Action/Attribute/Tab/Inventory.php index a4629d51677b605fe0709a87ca929e68ca88b1ae..cce1db62b87b928e1fb36a0d26425b1ca074b704 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Action/Attribute/Tab/Inventory.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Action/Attribute/Tab/Inventory.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Action/Attribute/Tab/Websites.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Action/Attribute/Tab/Websites.php index 90b73bc9e38f5f0acad7ffcac27f87391e4c60dc..37df2746433d85e8ecd0c0f6fd071ff13a7016d6 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Action/Attribute/Tab/Websites.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Action/Attribute/Tab/Websites.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Action/Attribute/Tabs.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Action/Attribute/Tabs.php index f4a9020de85797d91aec72b40131a0731b04a897..73084ceeffe1aee82141c94d5eb63d37f1d9675f 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Action/Attribute/Tabs.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Action/Attribute/Tabs.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Js.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Js.php index ee9a816bca61bed870894470e000f33f3cd37927..902c4aa8ae8cd58975faed96505dde7cbe8c5f3b 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Js.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Js.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Ajax/Serializer.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Ajax/Serializer.php index a053a3455bb4ca927702b693d2f8bed0ac1cc4ec..f76b8583faa6a861b91f2835f64e5b8368c5197e 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Ajax/Serializer.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Ajax/Serializer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Alerts.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Alerts.php index 52e84df03cfe37bcab7334b7ca24ab200e7730f9..7cd8cadd3b6058bf1b39ffa615bfe37cfe1c465f 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Alerts.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Alerts.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Alerts/Price.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Alerts/Price.php index 907dbcf67359302fafdd855eb1dd53b6178a7bb4..816c19d7c05f348d503c65d4b213862c7d84fcd7 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Alerts/Price.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Alerts/Price.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Alerts/Stock.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Alerts/Stock.php index 368b490ea3ea439eb35229bb5036d5162c9f5318..3f7dc31b189952adacb2fe1e709c840141ec9e8b 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Alerts/Stock.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Alerts/Stock.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Attributes.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Attributes.php index 4ce3b4631823ed2f84496829a19ee1504953038c..6f843771fea5359133dc0ddba7143465821e35a6 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Attributes.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Attributes.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -29,69 +29,79 @@ * * @category Mage * @package Mage_Adminhtml - * @author Magento Core Team <core@magentocommerce.com> + * @author Magento Core Team <core@magentocommerce.com> */ class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Attributes extends Mage_Adminhtml_Block_Catalog_Form { /** - * Load Wysiwyg on demand and Prepare layout + * Load Wysiwyg on demand and prepare layout */ protected function _prepareLayout() { parent::_prepareLayout(); - if (Mage::helper('Mage_Catalog_Helper_Data')->isModuleEnabled('Mage_Cms')) { - if (Mage::getSingleton('Mage_Cms_Model_Wysiwyg_Config')->isEnabled()) { - $this->getLayout()->getBlock('head')->setCanLoadTinyMce(true); - } + if (Mage::helper('Mage_Catalog_Helper_Data')->isModuleEnabled('Mage_Cms') + && Mage::getSingleton('Mage_Cms_Model_Wysiwyg_Config')->isEnabled() + ) { + $this->getLayout()->getBlock('head')->setCanLoadTinyMce(true); } } + /** + * Prepare attributes form + * + * @return null + */ protected function _prepareForm() { - if ($group = $this->getGroup()) { + $group = $this->getGroup(); + if ($group) { $form = new Varien_Data_Form(); - /** - * Initialize product object as form property - * for using it in elements generation - */ + + // Initialize product object as form property to use it during elements generation $form->setDataObject(Mage::registry('product')); - $fieldset = $form->addFieldset('group_fields'.$group->getId(), - array( - 'legend'=>Mage::helper('Mage_Catalog_Helper_Data')->__($group->getAttributeGroupName()), - 'class'=>'fieldset-wide', + $fieldset = $form->addFieldset('group_fields' . $group->getId(), array( + 'legend' => Mage::helper('Mage_Catalog_Helper_Data')->__($group->getAttributeGroupName()), + 'class' => 'fieldset-wide' )); $attributes = $this->getGroupAttributes(); $this->_setFieldset($attributes, $fieldset, array('gallery')); - if ($urlKey = $form->getElement('url_key')) { + $urlKey = $form->getElement('url_key'); + if ($urlKey) { $urlKey->setRenderer( $this->getLayout()->createBlock('Mage_Adminhtml_Block_Catalog_Form_Renderer_Attribute_Urlkey') ); } - if ($tierPrice = $form->getElement('tier_price')) { + $tierPrice = $form->getElement('tier_price'); + if ($tierPrice) { $tierPrice->setRenderer( $this->getLayout()->createBlock('Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Price_Tier') ); } - if ($recurringProfile = $form->getElement('recurring_profile')) { + $groupPrice = $form->getElement('group_price'); + if ($groupPrice) { + $groupPrice->setRenderer( + $this->getLayout()->createBlock('Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Price_Group') + ); + } + + $recurringProfile = $form->getElement('recurring_profile'); + if ($recurringProfile) { $recurringProfile->setRenderer( $this->getLayout()->createBlock('Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Price_Recurring') ); } - /** - * Add new attribute button if not image tab - */ + // Add new attribute button if it is not an image tab if (!$form->getElement('media_gallery') - && Mage::getSingleton('Mage_Admin_Model_Session')->isAllowed('catalog/attributes/attributes')) { - $headerBar = $this->getLayout()->createBlock( - 'Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Attributes_Create' - ); + && Mage::getSingleton('Mage_Admin_Model_Session')->isAllowed('catalog/attributes/attributes') + ) { + $headerBar = $this->getLayout()->createBlock('Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Attributes_Create'); $headerBar->getConfig() ->setTabId('group_' . $group->getId()) @@ -101,9 +111,7 @@ class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Attributes extends Mage_Admi ->setTypeId($form->getDataObject()->getTypeId()) ->setProductId($form->getDataObject()->getId()); - $fieldset->setHeaderBar( - $headerBar->toHtml() - ); + $fieldset->setHeaderBar($headerBar->toHtml()); } if ($form->getElement('meta_description')) { @@ -111,9 +119,8 @@ class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Attributes extends Mage_Admi } $values = Mage::registry('product')->getData(); - /** - * Set attribute default values for new product - */ + + // Set default attribute values for new product if (!Mage::registry('product')->getId()) { foreach ($attributes as $attribute) { if (!isset($values[$attribute->getAttributeCode()])) { @@ -124,7 +131,8 @@ class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Attributes extends Mage_Admi if (Mage::registry('product')->hasLockedAttributes()) { foreach (Mage::registry('product')->getLockedAttributes() as $attribute) { - if ($element = $form->getElement($attribute)) { + $element = $form->getElement($attribute); + if ($element) { $element->setReadonly(true, true); } } @@ -132,32 +140,33 @@ class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Attributes extends Mage_Admi $form->addValues($values); $form->setFieldNameSuffix('product'); - Mage::dispatchEvent('adminhtml_catalog_product_edit_prepare_form', array('form'=>$form)); + Mage::dispatchEvent('adminhtml_catalog_product_edit_prepare_form', array('form' => $form)); $this->setForm($form); } } + /** + * Retrieve additional element types + * + * @return array + */ protected function _getAdditionalElementTypes() { $result = array( - 'price' => Mage::getConfig() - ->getBlockClassName('Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Price'), - 'gallery' => Mage::getConfig() - ->getBlockClassName('Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Gallery'), - 'image' => Mage::getConfig() - ->getBlockClassName('Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Image'), - 'boolean' => Mage::getConfig() - ->getBlockClassName('Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Boolean'), - 'textarea' => Mage::getConfig() - ->getBlockClassName('Mage_Adminhtml_Block_Catalog_Helper_Form_Wysiwyg') + 'price' => Mage::getConfig()->getBlockClassName('Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Price'), + 'weight' => Mage::getConfig()->getBlockClassName('Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Weight'), + 'gallery' => Mage::getConfig()->getBlockClassName('Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Gallery'), + 'image' => Mage::getConfig()->getBlockClassName('Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Image'), + 'boolean' => Mage::getConfig()->getBlockClassName('Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Boolean'), + 'textarea' => Mage::getConfig()->getBlockClassName('Mage_Adminhtml_Block_Catalog_Helper_Form_Wysiwyg') ); $response = new Varien_Object(); $response->setTypes(array()); - Mage::dispatchEvent('adminhtml_catalog_product_edit_element_types', array('response'=>$response)); + Mage::dispatchEvent('adminhtml_catalog_product_edit_element_types', array('response' => $response)); - foreach ($response->getTypes() as $typeName=>$typeClass) { + foreach ($response->getTypes() as $typeName => $typeClass) { $result[$typeName] = $typeClass; } diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Attributes/Create.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Attributes/Create.php index be4631cef2186c0409014f10d1909729c68eae13..7af6caf9c03398ee4687d180c98fe9e73839acbc 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Attributes/Create.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Attributes/Create.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Categories.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Categories.php index 407652c13a9ddbd2341e13485737815ac77bd366..a3584bac8d2a705b7d99127b9ea4e162c1c212dc 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Categories.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Categories.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Crosssell.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Crosssell.php index 1ba22bc77f639169bf7c4461e0d1e95c9eefa3ad..aa7cdacd65e9367df3a0b40adec7a33294139fcb 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Crosssell.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Crosssell.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Inventory.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Inventory.php index ff16577268c9c03609d826f28514e5627db1023e..76bc7d6ca2ef855c486add51dbf150cda23a1815 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Inventory.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Inventory.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options.php index 4533d5aa59e21cb5a37214ed4836f9bea09bc975..0983514907065399aa7a4c94fd018dcc5c13f483 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options/Option.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options/Option.php index 6e34b95280f42c0dd1a743f64f1f32605fb35552..4317e806088f6694d57c5b36beb7e572482b1cec 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options/Option.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options/Option.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options/Type/Abstract.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options/Type/Abstract.php index ae56830fc11ce2b9e751ee8ba68a5c062807b590..adc6187f6c18d25f6e467bc17184cf2ce777c3fe 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options/Type/Abstract.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options/Type/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options/Type/Date.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options/Type/Date.php index 2f15647420dccf8a9f30d00b1583f70f2d29db59..1c589e59ea7b4d2024f130d7d1950f19aa58988d 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options/Type/Date.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options/Type/Date.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options/Type/File.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options/Type/File.php index d9cc45812b44800946f3a2eb7d5df8b006d99a0f..0ed86370b05d045c87f04f49e622c2524554d1cd 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options/Type/File.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options/Type/File.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options/Type/Select.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options/Type/Select.php index 6833acc351a2b2f2a0667abdadfffba5ece0261c..0b54dcafd143e7b5f83e3895ff0ae2c3cc073e95 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options/Type/Select.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options/Type/Select.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options/Type/Text.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options/Type/Text.php index 6f90cddf78dc8b6e7c2bdcd9992e377c6a1bc293..6692161ea78c2185d862c1358236af07015fc1d3 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options/Type/Text.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options/Type/Text.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Price.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Price.php index 64cc63ca24cf2b71e4c1b8a55df66ed63ba947d5..93efce32f226d2692b21991a5600300bf502576a 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Price.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Price.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Price/Group.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Price/Group.php new file mode 100644 index 0000000000000000000000000000000000000000..289b2fc9de5bcdda89677f24595381d5a1c83565 --- /dev/null +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Price/Group.php @@ -0,0 +1,97 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Adminhtml + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + + +/** + * Adminhtml group price item renderer + * + * @category Mage + * @package Mage_Adminhtml + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Price_Group + extends Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Price_Group_Abstract +{ + /** + * Initialize block + */ + public function __construct() + { + $this->setTemplate('catalog/product/edit/price/group.phtml'); + } + + /** + * Sort values + * + * @param array $data + * @return array + */ + protected function _sortValues($data) + { + usort($data, array($this, '_sortGroupPrices')); + return $data; + } + + /** + * Sort group price values callback method + * + * @param array $a + * @param array $b + * @return int + */ + protected function _sortGroupPrices($a, $b) + { + if ($a['website_id'] != $b['website_id']) { + return $a['website_id'] < $b['website_id'] ? -1 : 1; + } + if ($a['cust_group'] != $b['cust_group']) { + return $this->getCustomerGroups($a['cust_group']) < $this->getCustomerGroups($b['cust_group']) ? -1 : 1; + } + return 0; + } + + /** + * Prepare global layout + * + * Add "Add Group Price" button to layout + * + * @return Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Price_Group + */ + protected function _prepareLayout() + { + $button = $this->getLayout()->createBlock('Mage_Adminhtml_Block_Widget_Button') + ->setData(array( + 'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Add Group Price'), + 'onclick' => 'return groupPriceControl.addItem()', + 'class' => 'add' + )); + $button->setName('add_group_price_item_button'); + + $this->setChild('add_button', $button); + return parent::_prepareLayout(); + } + +} diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Price/Group/Abstract.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Price/Group/Abstract.php new file mode 100644 index 0000000000000000000000000000000000000000..520c7140fdaa4ad775ef8d12cd987531c2b4bc10 --- /dev/null +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Price/Group/Abstract.php @@ -0,0 +1,348 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Adminhtml + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + + +/** + * Adminhtml group price item abstract renderer + * + * @category Mage + * @package Mage_Adminhtml + * @author Magento Core Team <core@magentocommerce.com> + */ +abstract class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Price_Group_Abstract + extends Mage_Adminhtml_Block_Widget + implements Varien_Data_Form_Element_Renderer_Interface +{ + /** + * Form element instance + * + * @var Varien_Data_Form_Element_Abstract + */ + protected $_element; + + /** + * Customer groups cache + * + * @var array + */ + protected $_customerGroups; + + /** + * Websites cache + * + * @var array + */ + protected $_websites; + + /** + * Retrieve current product instance + * + * @return Mage_Catalog_Model_Product + */ + public function getProduct() + { + return Mage::registry('product'); + } + + /** + * Render HTML + * + * @param Varien_Data_Form_Element_Abstract $element + * @return string + */ + public function render(Varien_Data_Form_Element_Abstract $element) + { + $this->setElement($element); + return $this->toHtml(); + } + + /** + * Set form element instance + * + * @param Varien_Data_Form_Element_Abstract $element + * @return Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Price_Group_Abstract + */ + public function setElement(Varien_Data_Form_Element_Abstract $element) + { + $this->_element = $element; + return $this; + } + + /** + * Retrieve form element instance + * + * @return Varien_Data_Form_Element_Abstract + */ + public function getElement() + { + return $this->_element; + } + + /** + * Prepare group price values + * + * @return array + */ + public function getValues() + { + $values = array(); + $data = $this->getElement()->getValue(); + + if (is_array($data)) { + $values = $this->_sortValues($data); + } + + foreach ($values as &$value) { + $value['readonly'] = ($value['website_id'] == 0) + && $this->isShowWebsiteColumn() + && !$this->isAllowChangeWebsite(); + } + + return $values; + } + + /** + * Sort values + * + * @param array $data + * @return array + */ + protected function _sortValues($data) + { + return $data; + } + + /** + * Retrieve allowed customer groups + * + * @param int|null $groupId return name by customer group id + * @return array|string + */ + public function getCustomerGroups($groupId = null) + { + if ($this->_customerGroups === null) { + if (!Mage::helper('Mage_Catalog_Helper_Data')->isModuleEnabled('Mage_Customer')) { + return array(); + } + $collection = Mage::getModel('Mage_Customer_Model_Group')->getCollection(); + $this->_customerGroups = $this->_getInitialCustomerGroups(); + + foreach ($collection as $item) { + /** @var $item Mage_Customer_Model_Group */ + $this->_customerGroups[$item->getId()] = $item->getCustomerGroupCode(); + } + } + + if ($groupId !== null) { + return isset($this->_customerGroups[$groupId]) ? $this->_customerGroups[$groupId] : array(); + } + + return $this->_customerGroups; + } + + /** + * Retrieve list of initial customer groups + * + * @return array + */ + protected function _getInitialCustomerGroups() + { + return array(); + } + + /** + * Retrieve number of websites + * + * @return int + */ + public function getWebsiteCount() + { + return count($this->getWebsites()); + } + + /** + * Show website column and switcher for group price table + * + * @return bool + */ + public function isMultiWebsites() + { + return !Mage::app()->isSingleStoreMode(); + } + + /** + * Retrieve allowed for edit websites + * + * @return array + */ + public function getWebsites() + { + if (!is_null($this->_websites)) { + return $this->_websites; + } + + $this->_websites = array( + 0 => array( + 'name' => Mage::helper('Mage_Catalog_Helper_Data')->__('All Websites'), + 'currency' => Mage::app()->getBaseCurrencyCode() + ) + ); + + if (!$this->isScopeGlobal() && $this->getProduct()->getStoreId()) { + /** @var $website Mage_Core_Model_Website */ + $website = Mage::app()->getStore($this->getProduct()->getStoreId())->getWebsite(); + + $this->_websites[$website->getId()] = array( + 'name' => $website->getName(), + 'currency' => $website->getBaseCurrencyCode() + ); + } elseif (!$this->isScopeGlobal()) { + $websites = Mage::app()->getWebsites(false); + $productWebsiteIds = $this->getProduct()->getWebsiteIds(); + foreach ($websites as $website) { + /** @var $website Mage_Core_Model_Website */ + if (!in_array($website->getId(), $productWebsiteIds)) { + continue; + } + $this->_websites[$website->getId()] = array( + 'name' => $website->getName(), + 'currency' => $website->getBaseCurrencyCode() + ); + } + } + + return $this->_websites; + } + + /** + * Retrieve default value for customer group + * + * @return int + */ + public function getDefaultCustomerGroup() + { + return Mage_Customer_Model_Group::CUST_GROUP_ALL; + } + + /** + * Retrieve default value for website + * + * @return int + */ + public function getDefaultWebsite() + { + if ($this->isShowWebsiteColumn() && !$this->isAllowChangeWebsite()) { + return Mage::app()->getStore($this->getProduct()->getStoreId())->getWebsiteId(); + } + return 0; + } + + /** + * Retrieve 'add group price item' button HTML + * + * @return string + */ + public function getAddButtonHtml() + { + return $this->getChildHtml('add_button'); + } + + /** + * Retrieve customized price column header + * + * @param string $default + * @return string + */ + public function getPriceColumnHeader($default) + { + if ($this->hasData('price_column_header')) { + return $this->getData('price_column_header'); + } else { + return $default; + } + } + + /** + * Retrieve customized price column header + * + * @param string $default + * @return string + */ + public function getPriceValidation($default) + { + if ($this->hasData('price_validation')) { + return $this->getData('price_validation'); + } else { + return $default; + } + } + + /** + * Retrieve Group Price entity attribute + * + * @return Mage_Catalog_Model_Resource_Eav_Attribute + */ + public function getAttribute() + { + return $this->getElement()->getEntityAttribute(); + } + + /** + * Check group price attribute scope is global + * + * @return bool + */ + public function isScopeGlobal() + { + return $this->getAttribute()->isScopeGlobal(); + } + + /** + * Show group prices grid website column + * + * @return bool + */ + public function isShowWebsiteColumn() + { + if ($this->isScopeGlobal() || Mage::app()->isSingleStoreMode()) { + return false; + } + return true; + } + + /** + * Check is allow change website value for combination + * + * @return bool + */ + public function isAllowChangeWebsite() + { + if (!$this->isShowWebsiteColumn() || $this->getProduct()->getStoreId()) { + return false; + } + return true; + } +} diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Price/Recurring.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Price/Recurring.php index 4f05528eafab094503acaadca05a8436f250b1d7..9c4a89597f7274c9f9d92fb6b67eea1697846455 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Price/Recurring.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Price/Recurring.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Price/Tier.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Price/Tier.php index e442a00b866737a319f25868745458699eb85459..a663bb93d4ecae5cc7b8b19e3a8f644eccbabc84 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Price/Tier.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Price/Tier.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -32,33 +32,11 @@ * @author Magento Core Team <core@magentocommerce.com> */ class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Price_Tier - extends Mage_Adminhtml_Block_Widget - implements Varien_Data_Form_Element_Renderer_Interface + extends Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Price_Group_Abstract { - /** - * Form element instance - * - * @var Varien_Data_Form_Element - */ - protected $_element; /** - * Customer Groups cache - * - * @var array - */ - protected $_customerGroups; - - /** - * Websites cache - * - * @var array - */ - protected $_websites; - - /** - * Define tier price template file - * + * Initialize block */ public function __construct() { @@ -66,69 +44,25 @@ class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Price_Tier } /** - * Retrieve current edit product instance - * - * @return Mage_Catalog_Model_Product - */ - public function getProduct() - { - return Mage::registry('product'); - } - - /** - * Render HTML + * Retrieve list of initial customer groups * - * @param Varien_Data_Form_Element_Abstract $element - * @return string - */ - public function render(Varien_Data_Form_Element_Abstract $element) - { - $this->setElement($element); - return $this->toHtml(); - } - - /** - * Set form element instance - * - * @param Varien_Data_Form_Element_Abstract $element - * @return Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Price_Tier - */ - public function setElement(Varien_Data_Form_Element_Abstract $element) - { - $this->_element = $element; - return $this; - } - - /** - * Retrieve form element instance - * - * @return Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Price_Tier + * @return array */ - public function getElement() + protected function _getInitialCustomerGroups() { - return $this->_element; + return array(Mage_Customer_Model_Group::CUST_GROUP_ALL => Mage::helper('Mage_Catalog_Helper_Data')->__('ALL GROUPS')); } /** - * Prepare Tier Price values + * Sort values * + * @param array $data * @return array */ - public function getValues() + protected function _sortValues($data) { - $values = array(); - $data = $this->getElement()->getValue(); - - if (is_array($data)) { - usort($data, array($this, '_sortTierPrices')); - $values = $data; - } - - foreach ($values as &$v) { - $v['readonly'] = $v['website_id'] == 0 && $this->isShowWebsiteColumn() && !$this->isAllowChangeWebsite(); - } - - return $values; + usort($data, array($this, '_sortTierPrices')); + return $data; } /** @@ -153,123 +87,6 @@ class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Price_Tier return 0; } - /** - * Retrieve allowed customer groups - * - * @param int $groupId return name by customer group id - * @return array|string - */ - public function getCustomerGroups($groupId = null) - { - if ($this->_customerGroups === null) { - if (!Mage::helper('Mage_Catalog_Helper_Data')->isModuleEnabled('Mage_Customer')) { - return array(); - } - $collection = Mage::getModel('Mage_Customer_Model_Group')->getCollection(); - $this->_customerGroups = array( - Mage_Customer_Model_Group::CUST_GROUP_ALL => Mage::helper('Mage_Catalog_Helper_Data')->__('ALL GROUPS') - ); - - foreach ($collection as $item) { - /* @var $item Mage_Customer_Model_Group */ - $this->_customerGroups[$item->getId()] = $item->getCustomerGroupCode(); - } - } - - if ($groupId !== null) { - return isset($this->_customerGroups[$groupId]) ? $this->_customerGroups[$groupId] : array(); - } - - return $this->_customerGroups; - } - - /** - * Retrieve count of websites - * - * @return int - */ - public function getWebsiteCount() - { - return count($this->getWebsites()); - } - - /** - * Show Website column and switcher for tier price table - * - * @return bool - */ - public function isMultiWebsites() - { - return !Mage::app()->isSingleStoreMode(); - } - - /** - * Retrieve allowed for edit websites - * - * @return array - */ - public function getWebsites() - { - if (!is_null($this->_websites)) { - return $this->_websites; - } - - $this->_websites = array( - 0 => array( - 'name' => Mage::helper('Mage_Catalog_Helper_Data')->__('All Websites'), - 'currency' => Mage::app()->getBaseCurrencyCode() - ) - ); - - if (!$this->isScopeGlobal() && $this->getProduct()->getStoreId()) { - /* @var $website Mage_Core_Model_Website */ - $website = Mage::app()->getStore($this->getProduct()->getStoreId())->getWebsite(); - - $this->_websites[$website->getId()] = array( - 'name' => $website->getName(), - 'currency' => $website->getBaseCurrencyCode() - ); - } else if (!$this->isScopeGlobal()) { - $websites = Mage::app()->getWebsites(false); - $productWebsiteIds = $this->getProduct()->getWebsiteIds(); - foreach ($websites as $website) { - /* @var $website Mage_Core_Model_Website */ - if (!in_array($website->getId(), $productWebsiteIds)) { - continue; - } - $this->_websites[$website->getId()] = array( - 'name' => $website->getName(), - 'currency' => $website->getBaseCurrencyCode() - ); - } - } - - return $this->_websites; - } - - /** - * Retrieve default value for customer group - * - * @return int - */ - public function getDefaultCustomerGroup() - { - return Mage_Customer_Model_Group::CUST_GROUP_ALL; - } - - /** - * Retrieve default value for website - * - * @return int - */ - public function getDefaultWebsite() - { - if ($this->isShowWebsiteColumn() && !$this->isAllowChangeWebsite()) { - return Mage::app()->getStore($this->getProduct()->getStoreId())->getWebsiteId(); - } - return 0; - } - /** * Prepare global layout * Add "Add tier" button to layout @@ -280,9 +97,9 @@ class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Price_Tier { $button = $this->getLayout()->createBlock('Mage_Adminhtml_Block_Widget_Button') ->setData(array( - 'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Add Tier'), - 'onclick' => 'return tierPriceControl.addItem()', - 'class' => 'add' + 'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Add Tier'), + 'onclick' => 'return tierPriceControl.addItem()', + 'class' => 'add' )); $button->setName('add_tier_price_item_button'); @@ -290,93 +107,4 @@ class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Price_Tier return parent::_prepareLayout(); } - /** - * Retrieve Add Tier Price Item button HTML - * - * @return string - */ - public function getAddButtonHtml() - { - return $this->getChildHtml('add_button'); - } - - /** - * Returns customized price column header - * that was seted through set... - * - * @param string $default - * @return string - */ - public function getPriceColumnHeader($default) - { - if ($this->hasData('price_column_header')) { - return $this->getData('price_column_header'); - } else { - return $default; - } - } - - /** - * Returns customized price column header - * that was seted through set... - * - * @param string $default - * @return string - */ - public function getPriceValidation($default) - { - if ($this->hasData('price_validation')) { - return $this->getData('price_validation'); - } else { - return $default; - } - } - - /** - * Retrieve Tier Price entity attribute - * - * @return Mage_Catalog_Model_Resource_Eav_Attribute - */ - public function getAttribute() - { - return $this->getElement()->getEntityAttribute(); - } - - /** - * Check tier price attribute scope is global - * - * @return bool - */ - public function isScopeGlobal() - { - return $this->getAttribute()->isScopeGlobal(); - } - - /** - * Show tier prices grid website column - * - * @return bool - */ - public function isShowWebsiteColumn() - { - if ($this->isScopeGlobal()) { - return false; - } else if (Mage::app()->isSingleStoreMode()) { - return false; - } - return true; - } - - /** - * Check is allow change website value for combination - * - * @return bool - */ - public function isAllowChangeWebsite() - { - if (!$this->isShowWebsiteColumn() || $this->getProduct()->getStoreId()) { - return false; - } - return true; - } } diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Related.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Related.php index f8762fa05c6d8ec2787f997fad62a524d9be51f3..d08609e19036373b88efbf4d2d6430a633debfb5 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Related.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Related.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Reviews.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Reviews.php index 5028c63a45b4c25121e0f05714996179afca8fe1..bbab4ff9c1210134d6168ac619c6bfcd921cadfe 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Reviews.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Reviews.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Settings.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Settings.php index c55c28a3c321263268113e5cd212a9a73cc24c13..3708c2cc69b9d3a30b2ebb29f4dbef9788f48f3b 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Settings.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Settings.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Config.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Config.php index 7b90c9308ebad100073f574b8d57a531416ff5cc..12d2d5d8f6c6cfd5bb3fde93027450ea0a8076b8 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Config.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Config.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -66,7 +66,28 @@ class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Super_Config extends Mage_Ad */ public function isReadonly() { - return $this->_getProduct()->getCompositeReadonly(); + return (bool) $this->_getProduct()->getCompositeReadonly(); + } + + /** + * Check whether attributes of configurable products can be editable + * + * @return boolean + */ + public function isAttributesConfigurationReadonly() + { + return (bool) $this->_getProduct()->getAttributesConfigurationReadonly(); + } + + /** + * Check whether prices of configurable products can be editable + * + * @return boolean + */ + public function isAttributesPricesReadonly() + { + return $this->_getProduct()->getAttributesConfigurationReadonly() || + (Mage::helper('Mage_Catalog_Helper_Data')->isPriceGlobal() && $this->isReadonly()); } /** diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Config/Grid.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Config/Grid.php index c67361f2b38fe4f9fba04553826f0dec1fd85264..50e98d66eee72db78283503556b8148dd905ef95 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Config/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Config/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Config/Grid/Filter/Inventory.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Config/Grid/Filter/Inventory.php index 872b1b4f03d525150e3b5fd60aa028ce325c8f35..152a028ada55e0b5b7792856c8e2b13775a095d0 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Config/Grid/Filter/Inventory.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Config/Grid/Filter/Inventory.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Config/Grid/Renderer/Checkbox.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Config/Grid/Renderer/Checkbox.php index 142b3e5892f43fd681543b0112bc8afc6bc64d80..68d0e03732500ac7d66c2678529fa6bdab29053a 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Config/Grid/Renderer/Checkbox.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Config/Grid/Renderer/Checkbox.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Config/Grid/Renderer/Inventory.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Config/Grid/Renderer/Inventory.php index 94657b2ba9f58c751414923690eb231740a13e10..41ef013c12bce6f0c7c5029be58d394aba1ab1ae 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Config/Grid/Renderer/Inventory.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Config/Grid/Renderer/Inventory.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Config/Simple.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Config/Simple.php index 94ee9b249aecef1287463e0a9e336c685b36259e..a64d57ac00bc0e5c26bf138788311fa85727c7ce 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Config/Simple.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Config/Simple.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -31,7 +31,8 @@ * @package Mage_Adminhtml * @author Magento Core Team <core@magentocommerce.com> */ -class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Super_Config_Simple extends Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Attributes +class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Super_Config_Simple + extends Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Attributes { /** * Link to currently editing product @@ -56,7 +57,7 @@ class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Super_Config_Simple extends 'additional' => array('name', 'sku', 'visibility', 'status') ); - $availableTypes = array('text', 'select', 'multiselect', 'textarea', 'price'); + $availableTypes = array('text', 'select', 'multiselect', 'textarea', 'price', 'weight'); $attributes = Mage::getModel('Mage_Catalog_Model_Product') ->setTypeId(Mage_Catalog_Model_Product_Type::TYPE_SIMPLE) @@ -70,10 +71,12 @@ class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Super_Config_Simple extends // If not applied to configurable && !in_array(Mage_Catalog_Model_Product_Type::TYPE_CONFIGURABLE, $attribute->getApplyTo()) // If not used in configurable - && !in_array($attribute->getId(),$this->_getProduct()->getTypeInstance()->getUsedProductAttributeIds($this->_getProduct()))) + && !in_array($attribute->getId(), + $this->_getProduct()->getTypeInstance()->getUsedProductAttributeIds($this->_getProduct())) + ) // Or in additional - || in_array($attribute->getAttributeCode(), $attributesConfig['additional'])) { - + || in_array($attribute->getAttributeCode(), $attributesConfig['additional']) + ) { $inputType = $attribute->getFrontend()->getInputType(); if (!in_array($inputType, $availableTypes)) { continue; @@ -112,8 +115,8 @@ class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Super_Config_Simple extends } /* Configurable attributes */ - $product = $this->_getProduct(); - foreach ($product->getTypeInstance()->getUsedProductAttributes($product) as $attribute) { + $usedAttributes = $this->_getProduct()->getTypeInstance()->getUsedProductAttributes($this->_getProduct()); + foreach ($usedAttributes as $attribute) { $attributeCode = $attribute->getAttributeCode(); $fieldset->addField( 'simple_product_' . $attributeCode, 'select', array( 'label' => $attribute->getFrontend()->getLabel(), @@ -177,8 +180,6 @@ class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Super_Config_Simple extends ) )); - - $this->setForm($form); } diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Group.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Group.php index 0d70649d9a3ccef9f965d1538ac8b01cb66d67fe..4633b7522709d30cb3733e75e2796b36ce0b1c8d 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Group.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Group.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Settings.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Settings.php index 40bb1d39907d3060735d1b52f0dc084cac3f80e3..09f400bd3743acd74ea3f3d34c09ffb58788fa2e 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Settings.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Settings.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Tag.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Tag.php index c334f4f9a46d35489dc5406fe27a18d9bac99dd6..49a246f592dac25b7a6c212ee2e78eb97020374c 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Tag.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Tag.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Tag/Customer.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Tag/Customer.php index fcb99623cf833ec120b4cbebe6e9054a22b45dbf..c4b190ffce57391534337e553a36fb9fa1888008 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Tag/Customer.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Tag/Customer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Upsell.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Upsell.php index 17574602866ff4f4dd3e11b42ce3bf8e4b395ef4..561657d2f991dd060eb967f9292cada26df39119 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Upsell.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Upsell.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Websites.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Websites.php index 7fde6fc37f2c95092c8331864ad2e5bcd8ae05bb..a767c223c5a1f29a1e6fc0052c389ede00233f53 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Websites.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Websites.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tabs.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tabs.php index 0c397e3299a42f51db8b720cb9f77fb24b465555..50212c276639f0d1c3023ab52fcf5327f93c929c 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tabs.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tabs.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tabs/Configurable.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tabs/Configurable.php index bf4042a49b3202c1b378fbe92cbcfee0fa72c099..e8c6e29e6ebff86702d9588d7ea9a0de229d476a 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tabs/Configurable.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tabs/Configurable.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tabs/Grouped.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tabs/Grouped.php index 7928edc7ffc7e08f6f50e6fcb3afb3dd9230cb9d..e2c4c92ec0d355c2fff9fb7dbdd8bc63df363cfe 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tabs/Grouped.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tabs/Grouped.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Frontend/Product/Watermark.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Frontend/Product/Watermark.php index 977647226aac21bad474cefd85d00a256b904b7d..03219a6c5ccef2fb1fffbe295726f76869631e5b 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Frontend/Product/Watermark.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Frontend/Product/Watermark.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Grid.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Grid.php index 655beefc602cc0fbfa59f4a5b9de820bb19eab87..a29eb868e898c321e51c3c7144bfc7ef65e57738 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Apply.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Apply.php index b112559572de5f133485ca7714605c99feda118a..70afc08ccaa68a790943baf58831abd5718b9aa1 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Apply.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Apply.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Boolean.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Boolean.php index 4018eeaac59bb61e27ec234b1751951798728665..c5e7c79daccbf3eaf3b4ac49b85e544911108b05 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Boolean.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Boolean.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Config.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Config.php index 340a8482d735332de8754b8d41267fb5d62750b0..22030ded8171047be3f9ef2d4af949267d3fff1e 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Config.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Config.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Gallery.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Gallery.php index 472b0ea5b80fefbfb6df12f6d9eaed46ef337c48..6d045fe039176eb50cd1c17592a90abdbb68d857 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Gallery.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Gallery.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Gallery/Content.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Gallery/Content.php index 1b392e63d7ef18f0f4c67d3cbc6c34e2ad1da967..ce96be325c0ab9d6a001b95df1d44702430392fc 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Gallery/Content.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Gallery/Content.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -57,6 +57,8 @@ class Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Gallery_Content extends M ) )); + Mage::dispatchEvent('catalog_product_gallery_prepare_layout', array('block' => $this)); + return parent::_prepareLayout(); } diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Image.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Image.php index 2397aadeab0fec4c3060bcc16f930f2aae71abd8..9116ea3b197de94192a5adb6970b8a462b51516a 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Image.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Image.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Msrp/Enabled.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Msrp/Enabled.php index 02358d5e42aee72556c337b4b6a092495e156de9..4e7538b607ea9bf343e0a52c3fb5a51f2977a356 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Msrp/Enabled.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Msrp/Enabled.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Msrp/Price.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Msrp/Price.php index af67119cdfdb7a47170e30c761c1944ad19e7198..708476ca2daa3eb70ecdf87265ca7effe3ca41f4 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Msrp/Price.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Msrp/Price.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Price.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Price.php index 395c1162969e3ba8616fd55380a2a2138ac1132e..1f6a85c983630cefae4ada3084bae958a6457ecd 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Price.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Price.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Weight.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Weight.php new file mode 100644 index 0000000000000000000000000000000000000000..fe682362a62135e6931689024421b8c6d0ef508a --- /dev/null +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Weight.php @@ -0,0 +1,46 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Adminhtml + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Product form weight field helper + * + * @category Mage + * @package Mage_Adminhtml + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Weight extends Varien_Data_Form_Element_Text +{ + /** + * Validation classes for weight field which corresponds to DECIMAL(12,4) SQL type + * + * @param array $attributes + */ + public function __construct(array $attributes = array()) + { + parent::__construct($attributes); + $this->addClass('validate-number validate-zero-or-greater validate-number-range number-range-0-99999999.9999'); + } +} diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Price.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Price.php index 6c5f8a7ee4ea960afee7912d41de0a5985437f9c..198960c3b147eaf4e47551d36d96a18b52fe6d61 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Price.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Price.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Widget/Chooser.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Widget/Chooser.php index 212f42ea188e48b69dd29a65095d7cefb4ff32d4..ac05ed6a54f3cd6a5265e7385952e35a1a1c4cf1 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Widget/Chooser.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Widget/Chooser.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -100,8 +100,8 @@ class Mage_Adminhtml_Block_Catalog_Product_Widget_Chooser extends Mage_Adminhtml public function getCheckboxCheckCallback() { if ($this->getUseMassaction()) { - return "function (grid, event) { - $(grid.containerId).fire('product:changed', {}); + return "function (grid, element) { + $(grid.containerId).fire('product:changed', {element: element}); }"; } } diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Widget/Chooser/Container.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Widget/Chooser/Container.php index 66aac1d76d25685b2c97e14c0c4d3df26473db9c..d5b5f47ea2e2798819a0b97d983abc971d98d7b3 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Widget/Chooser/Container.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Widget/Chooser/Container.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Search.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Search.php index 8f7e48fa9ecbcd7ba5138716f9e7ee4d714a1120..b4fc9e5971f87ecae20bd3c77f05faea41eca1e8 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Search.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Search.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Search/Edit.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Search/Edit.php index e1554378fcbc99e8fab9d04651565cf6920710bb..8f74dc337ee34a0a4e3bb0ddf1be2f0fd3a9722f 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Search/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Search/Edit.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Search/Edit/Form.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Search/Edit/Form.php index c6bf3ee9bed71009c93b85272c8d661054f46b26..f40c59fda372b34635df8e4727e15ddf640e650e 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Search/Edit/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Search/Edit/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -93,6 +93,7 @@ class Mage_Adminhtml_Block_Catalog_Search_Edit_Form extends Mage_Adminhtml_Block 'title' => Mage::helper('Mage_Catalog_Helper_Data')->__('Store'), 'values' => Mage::getSingleton('Mage_Adminhtml_Model_System_Store')->getStoreValuesForForm(true, false), 'required' => true, + 'after_element_html' => Mage::getBlockSingleton('Mage_Adminhtml_Block_Store_Switcher')->getHintHtml() )); } else { @@ -104,48 +105,41 @@ class Mage_Adminhtml_Block_Catalog_Search_Edit_Form extends Mage_Adminhtml_Block if ($model->getId()) { $fieldset->addField('num_results', 'text', array( - 'name' => 'num_results', - 'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Number of results<br/>(For the last time placed)'), - 'title' => Mage::helper('Mage_Catalog_Helper_Data')->__('Number of results<br/>(For the last time placed)'), - 'required' => true, + 'name' => 'num_results', + 'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Number of results'), + 'title' => Mage::helper('Mage_Catalog_Helper_Data')->__('Number of results (For the last time placed)'), + 'note' => Mage::helper('Mage_Catalog_Helper_Data')->__('For the last time placed.'), + 'required' => true, )); $fieldset->addField('popularity', 'text', array( - 'name' => 'popularity', - 'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Number of Uses'), - 'title' => Mage::helper('Mage_Catalog_Helper_Data')->__('Number of Uses'), - 'required' => true, + 'name' => 'popularity', + 'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Number of Uses'), + 'title' => Mage::helper('Mage_Catalog_Helper_Data')->__('Number of Uses'), + 'required' => true, )); } - $afterElementHtml = '<p class="nm"><small>' - . Mage::helper('Mage_Catalog_Helper_Data')->__('(Will make search for the query above return results for this search.)') - . '</small></p>'; - $fieldset->addField('synonym_for', 'text', array( - 'name' => 'synonym_for', - 'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Synonym For'), - 'title' => Mage::helper('Mage_Catalog_Helper_Data')->__('Synonym For'), - 'after_element_html' => $afterElementHtml, + 'name' => 'synonym_for', + 'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Synonym For'), + 'title' => Mage::helper('Mage_Catalog_Helper_Data')->__('Synonym For'), + 'note' => Mage::helper('Mage_Catalog_Helper_Data')->__('Will make search for the query above return results for this search.'), )); - $afterElementHtml = '<p class="nm"><small>' - . Mage::helper('Mage_Catalog_Helper_Data')->__('ex. http://domain.com') - . '</small></p>'; - $fieldset->addField('redirect', 'text', array( - 'name' => 'redirect', - 'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Redirect URL'), - 'title' => Mage::helper('Mage_Catalog_Helper_Data')->__('Redirect URL'), - 'class' => 'validate-url', - 'after_element_html' => $afterElementHtml, + 'name' => 'redirect', + 'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Redirect URL'), + 'title' => Mage::helper('Mage_Catalog_Helper_Data')->__('Redirect URL'), + 'class' => 'validate-url', + 'note' => Mage::helper('Mage_Catalog_Helper_Data')->__('ex. http://domain.com'), )); $fieldset->addField('display_in_terms', 'select', array( - 'name' => 'display_in_terms', - 'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Display in Suggested Terms'), - 'title' => Mage::helper('Mage_Catalog_Helper_Data')->__('Display in Suggested Terms'), - 'values' => $yesno, + 'name' => 'display_in_terms', + 'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Display in Suggested Terms'), + 'title' => Mage::helper('Mage_Catalog_Helper_Data')->__('Display in Suggested Terms'), + 'values' => $yesno, )); $form->setValues($model->getData()); diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Search/Grid.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Search/Grid.php index 9314dd373d4c298cc4416e32fe5c06c4de342573..50fcd748bdb5ed6b4b8a57241f2932a207db4a6b 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Search/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Search/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Checkout/Agreement.php b/app/code/core/Mage/Adminhtml/Block/Checkout/Agreement.php index fd67f8e45c80cef44f1d22c3163bebbb8a6ecb3f..285182d782a876117c0d50bf8563322bcdd99d2c 100644 --- a/app/code/core/Mage/Adminhtml/Block/Checkout/Agreement.php +++ b/app/code/core/Mage/Adminhtml/Block/Checkout/Agreement.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -37,7 +37,7 @@ class Mage_Adminhtml_Block_Checkout_Agreement extends Mage_Adminhtml_Block_Widge public function __construct() { $this->_controller = 'checkout_agreement'; - $this->_headerText = Mage::helper('Mage_Checkout_Helper_Data')->__('Manage Checkout Terms and Conditions'); + $this->_headerText = Mage::helper('Mage_Checkout_Helper_Data')->__('Manage Terms and Conditions'); $this->_addButtonLabel = Mage::helper('Mage_Checkout_Helper_Data')->__('Add New Condition'); parent::__construct(); } diff --git a/app/code/core/Mage/Adminhtml/Block/Checkout/Agreement/Edit.php b/app/code/core/Mage/Adminhtml/Block/Checkout/Agreement/Edit.php index f2027f3bfd18f5b96cc51cc76f44ae48c3b7a194..c3d82f468fbaf0c97bfcb64cab0a9ed499e6b90d 100644 --- a/app/code/core/Mage/Adminhtml/Block/Checkout/Agreement/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/Checkout/Agreement/Edit.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -60,7 +60,7 @@ class Mage_Adminhtml_Block_Checkout_Agreement_Edit extends Mage_Adminhtml_Block_ return Mage::helper('Mage_Checkout_Helper_Data')->__('Edit Terms and Conditions'); } else { - return Mage::helper('Mage_Checkout_Helper_Data')->__('New Condition'); + return Mage::helper('Mage_Checkout_Helper_Data')->__('New Terms and Conditions'); } } } diff --git a/app/code/core/Mage/Adminhtml/Block/Checkout/Agreement/Edit/Form.php b/app/code/core/Mage/Adminhtml/Block/Checkout/Agreement/Edit/Form.php index 2aa29468c446e3f7b17c19645b8a02e1bbe422e6..2c31643f7235e14be70dfb78ea256889d61ce73c 100644 --- a/app/code/core/Mage/Adminhtml/Block/Checkout/Agreement/Edit/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Checkout/Agreement/Edit/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -105,6 +105,7 @@ class Mage_Adminhtml_Block_Checkout_Agreement_Edit_Form extends Mage_Adminhtml_B 'title' => Mage::helper('Mage_Checkout_Helper_Data')->__('Store View'), 'required' => true, 'values' => Mage::getSingleton('Mage_Adminhtml_Model_System_Store')->getStoreValuesForForm(false, true), + 'after_element_html' => Mage::getBlockSingleton('Mage_Adminhtml_Block_Store_Switcher')->getHintHtml() )); } else { diff --git a/app/code/core/Mage/Adminhtml/Block/Checkout/Agreement/Grid.php b/app/code/core/Mage/Adminhtml/Block/Checkout/Agreement/Grid.php index e281739c5d91a5b39d16e16563b6b99842a392c3..60b18d512988a0c12def75cfff855c8f3e274e75 100644 --- a/app/code/core/Mage/Adminhtml/Block/Checkout/Agreement/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Checkout/Agreement/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Adminhtml_Block_Checkout_Agreement_Grid extends Mage_Adminhtml_Block_Widget_Grid diff --git a/app/code/core/Mage/Adminhtml/Block/Cms/Block.php b/app/code/core/Mage/Adminhtml/Block/Cms/Block.php index 49accfc467765410aadfac7262b972bc85525fdf..98817622fbad918f900b427744391580e7b68f8d 100644 --- a/app/code/core/Mage/Adminhtml/Block/Cms/Block.php +++ b/app/code/core/Mage/Adminhtml/Block/Cms/Block.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Cms/Block/Edit.php b/app/code/core/Mage/Adminhtml/Block/Cms/Block/Edit.php index 47c90aff5a37a641ebf0966b2e267224ef23165c..74105ce18fdf699f425915a1977aad7598a87993 100644 --- a/app/code/core/Mage/Adminhtml/Block/Cms/Block/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/Cms/Block/Edit.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Cms/Block/Edit/Form.php b/app/code/core/Mage/Adminhtml/Block/Cms/Block/Edit/Form.php index c1b19e9724b84b3f45813620efd8d8fc271d26a0..692aa99419f398b590104eccd2c32019c62f7362 100644 --- a/app/code/core/Mage/Adminhtml/Block/Cms/Block/Edit/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Cms/Block/Edit/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -60,7 +60,9 @@ class Mage_Adminhtml_Block_Cms_Block_Edit_Form extends Mage_Adminhtml_Block_Widg { $model = Mage::registry('cms_block'); - $form = new Varien_Data_Form(array('id' => 'edit_form', 'action' => $this->getData('action'), 'method' => 'post')); + $form = new Varien_Data_Form( + array('id' => 'edit_form', 'action' => $this->getData('action'), 'method' => 'post') + ); $form->setHtmlIdPrefix('block_'); @@ -97,6 +99,7 @@ class Mage_Adminhtml_Block_Cms_Block_Edit_Form extends Mage_Adminhtml_Block_Widg 'title' => Mage::helper('Mage_Cms_Helper_Data')->__('Store View'), 'required' => true, 'values' => Mage::getSingleton('Mage_Adminhtml_Model_System_Store')->getStoreValuesForForm(false, true), + 'after_element_html' => Mage::getBlockSingleton('Mage_Adminhtml_Block_Store_Switcher')->getHintHtml() )); } else { diff --git a/app/code/core/Mage/Adminhtml/Block/Cms/Block/Grid.php b/app/code/core/Mage/Adminhtml/Block/Cms/Block/Grid.php index 6e20ce047d7ad61b0d6f6a1561e26ca4566bb363..f536fc6958902261f510bc68fab248f304aa7984 100644 --- a/app/code/core/Mage/Adminhtml/Block/Cms/Block/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Cms/Block/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Cms/Block/Widget/Chooser.php b/app/code/core/Mage/Adminhtml/Block/Cms/Block/Widget/Chooser.php index 549458253b818f7bccab9710ebc5160da705a123..64d196d5a5552976b2d23924606db433b54ec26f 100644 --- a/app/code/core/Mage/Adminhtml/Block/Cms/Block/Widget/Chooser.php +++ b/app/code/core/Mage/Adminhtml/Block/Cms/Block/Widget/Chooser.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Cms/Page.php b/app/code/core/Mage/Adminhtml/Block/Cms/Page.php index c7d8f665b1a3ec6d7c55a5032b35c89d3c5e0bda..e0aba177d7a0245517333664c4f5969f5b02cc34 100644 --- a/app/code/core/Mage/Adminhtml/Block/Cms/Page.php +++ b/app/code/core/Mage/Adminhtml/Block/Cms/Page.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Cms/Page/Edit.php b/app/code/core/Mage/Adminhtml/Block/Cms/Page/Edit.php index 1ed1213f18b02fe48a216c7b18dccf4a3379ad3c..e8a68e02e33a68fe1d51ec59514213233f5b07d8 100644 --- a/app/code/core/Mage/Adminhtml/Block/Cms/Page/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/Cms/Page/Edit.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Cms/Page/Edit/Form.php b/app/code/core/Mage/Adminhtml/Block/Cms/Page/Edit/Form.php index e8a169b96d9e92fead6ef7a25c3b780b07efc349..da6406743521a3ea8f2d6b29b65c2b1786abe0ea 100644 --- a/app/code/core/Mage/Adminhtml/Block/Cms/Page/Edit/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Cms/Page/Edit/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Cms/Page/Edit/Tab/Content.php b/app/code/core/Mage/Adminhtml/Block/Cms/Page/Edit/Tab/Content.php index b1bacfe1d7ece9e8293eba0c2bbc1b6b1b07cff3..6cc4f6b7463da8023614382af41fa0b5ec6edcf9 100644 --- a/app/code/core/Mage/Adminhtml/Block/Cms/Page/Edit/Tab/Content.php +++ b/app/code/core/Mage/Adminhtml/Block/Cms/Page/Edit/Tab/Content.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Cms/Page/Edit/Tab/Design.php b/app/code/core/Mage/Adminhtml/Block/Cms/Page/Edit/Tab/Design.php index 659ebc1847476e216b7227ef4c97d086c6bdf148..ef65d01fb639a60f13fa575db96356082671c9c8 100644 --- a/app/code/core/Mage/Adminhtml/Block/Cms/Page/Edit/Tab/Design.php +++ b/app/code/core/Mage/Adminhtml/Block/Cms/Page/Edit/Tab/Design.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Adminhtml_Block_Cms_Page_Edit_Tab_Design diff --git a/app/code/core/Mage/Adminhtml/Block/Cms/Page/Edit/Tab/Main.php b/app/code/core/Mage/Adminhtml/Block/Cms/Page/Edit/Tab/Main.php index ed971e140ab790ed8a0b381fb842749423804fa8..9ad0f0705526eef90581f4bdd8ff9b7374538e7f 100644 --- a/app/code/core/Mage/Adminhtml/Block/Cms/Page/Edit/Tab/Main.php +++ b/app/code/core/Mage/Adminhtml/Block/Cms/Page/Edit/Tab/Main.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -91,7 +91,8 @@ class Mage_Adminhtml_Block_Cms_Page_Edit_Tab_Main 'title' => Mage::helper('Mage_Cms_Helper_Data')->__('Store View'), 'required' => true, 'values' => Mage::getSingleton('Mage_Adminhtml_Model_System_Store')->getStoreValuesForForm(false, true), - 'disabled' => $isElementDisabled + 'disabled' => $isElementDisabled, + 'after_element_html' => Mage::getBlockSingleton('Mage_Adminhtml_Block_Store_Switcher')->getHintHtml() )); } else { diff --git a/app/code/core/Mage/Adminhtml/Block/Cms/Page/Edit/Tab/Meta.php b/app/code/core/Mage/Adminhtml/Block/Cms/Page/Edit/Tab/Meta.php index ec7f5b979747685d9d9e497f7dd46096cb08d46b..c03cb54f4ba0edfc5aea52cc0ce38b12889eb4da 100644 --- a/app/code/core/Mage/Adminhtml/Block/Cms/Page/Edit/Tab/Meta.php +++ b/app/code/core/Mage/Adminhtml/Block/Cms/Page/Edit/Tab/Meta.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Cms/Page/Edit/Tabs.php b/app/code/core/Mage/Adminhtml/Block/Cms/Page/Edit/Tabs.php index 11e9214a3272cb6186610aad0cf0bdebae8f2107..b75241e2dbb9a4a39b05f9abfcf552311fa6c209 100644 --- a/app/code/core/Mage/Adminhtml/Block/Cms/Page/Edit/Tabs.php +++ b/app/code/core/Mage/Adminhtml/Block/Cms/Page/Edit/Tabs.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Cms/Page/Grid.php b/app/code/core/Mage/Adminhtml/Block/Cms/Page/Grid.php index 80a3ad68370710a05228a6979349e0612114568e..b3694b8d1fd3f74c74c9048bd418886e5878ee69 100644 --- a/app/code/core/Mage/Adminhtml/Block/Cms/Page/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Cms/Page/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Cms/Page/Grid/Renderer/Action.php b/app/code/core/Mage/Adminhtml/Block/Cms/Page/Grid/Renderer/Action.php index e609ad1cd0aadb8549c51f7b0e2e287b36461ede..fefdff0aadfddeae3014f62d68d3f08fc8359aa5 100644 --- a/app/code/core/Mage/Adminhtml/Block/Cms/Page/Grid/Renderer/Action.php +++ b/app/code/core/Mage/Adminhtml/Block/Cms/Page/Grid/Renderer/Action.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Cms/Page/Widget/Chooser.php b/app/code/core/Mage/Adminhtml/Block/Cms/Page/Widget/Chooser.php index 1d50d2fc86eb28c1f7f1ed985772beef132727da..cfc1c1cf5a3c8dca7ef949520271b3ded033df8f 100644 --- a/app/code/core/Mage/Adminhtml/Block/Cms/Page/Widget/Chooser.php +++ b/app/code/core/Mage/Adminhtml/Block/Cms/Page/Widget/Chooser.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Cms/Wysiwyg/Images/Content.php b/app/code/core/Mage/Adminhtml/Block/Cms/Wysiwyg/Images/Content.php index 2079f2dd91d3a428f7df4a6a1762aac230a96f76..12049ea81636490a441eb5ed39b6b87badb8e7c6 100644 --- a/app/code/core/Mage/Adminhtml/Block/Cms/Wysiwyg/Images/Content.php +++ b/app/code/core/Mage/Adminhtml/Block/Cms/Wysiwyg/Images/Content.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Cms/Wysiwyg/Images/Content/Files.php b/app/code/core/Mage/Adminhtml/Block/Cms/Wysiwyg/Images/Content/Files.php index 7479c76f52e1df96f8ad974e915fb1e60eb96de5..5fea94f344c1c8a3f736a6f0069f71ded60e6edd 100644 --- a/app/code/core/Mage/Adminhtml/Block/Cms/Wysiwyg/Images/Content/Files.php +++ b/app/code/core/Mage/Adminhtml/Block/Cms/Wysiwyg/Images/Content/Files.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Cms/Wysiwyg/Images/Content/Newfolder.php b/app/code/core/Mage/Adminhtml/Block/Cms/Wysiwyg/Images/Content/Newfolder.php index 1d1f906a80da1d3808c5d9dc0f9fc79a4d7340b4..6b8c2418dd6b25bc00dff4637bb167c07ba328b2 100644 --- a/app/code/core/Mage/Adminhtml/Block/Cms/Wysiwyg/Images/Content/Newfolder.php +++ b/app/code/core/Mage/Adminhtml/Block/Cms/Wysiwyg/Images/Content/Newfolder.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Cms/Wysiwyg/Images/Content/Uploader.php b/app/code/core/Mage/Adminhtml/Block/Cms/Wysiwyg/Images/Content/Uploader.php index cca705291ba1c439ddacedc6da2bcebfab4903ca..e166fc285bd8aaf58c080cb049f6747564fc719b 100644 --- a/app/code/core/Mage/Adminhtml/Block/Cms/Wysiwyg/Images/Content/Uploader.php +++ b/app/code/core/Mage/Adminhtml/Block/Cms/Wysiwyg/Images/Content/Uploader.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Cms/Wysiwyg/Images/Tree.php b/app/code/core/Mage/Adminhtml/Block/Cms/Wysiwyg/Images/Tree.php index 677dba04f836fc9a4808a912ad143f2f78607986..c952baebbf517689fe22f2b96ad0909bc964449d 100644 --- a/app/code/core/Mage/Adminhtml/Block/Cms/Wysiwyg/Images/Tree.php +++ b/app/code/core/Mage/Adminhtml/Block/Cms/Wysiwyg/Images/Tree.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Customer.php b/app/code/core/Mage/Adminhtml/Block/Customer.php index 3b60b571a7d7b6a0d016888d70febf7a3ef29509..055c081bc411d73d74cd2b05fe13ac8319159778 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Edit.php b/app/code/core/Mage/Adminhtml/Block/Customer/Edit.php index e18527704291e05fa62ac13a216eb3fe33fac4a9..64e61a605eb00ac2595ab18eebe97ddf4b0cba76 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Edit.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Form.php b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Form.php index 8501358f2ad87ce112e3abe0b8d3ad2aeaf3a795..9041686ab5a2c2d257a5bcc7f29c2b50f0a8853f 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Renderer/Attribute/Group.php b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Renderer/Attribute/Group.php new file mode 100644 index 0000000000000000000000000000000000000000..335b153fd910a35a03cc73ff489ce164edf8886d --- /dev/null +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Renderer/Attribute/Group.php @@ -0,0 +1,105 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Adminhtml + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Renderer for customer group ID + * + * @category Mage + * @package Mage_Adminhtml + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Adminhtml_Block_Customer_Edit_Renderer_Attribute_Group + extends Mage_Adminhtml_Block_Widget_Form_Renderer_Fieldset_Element +{ + /** + * Override parent constructor just for setting custom template + */ + protected function _construct() + { + parent::_construct(); + $this->setTemplate('customer/edit/tab/account/form/renderer/group.phtml'); + } + + /** + * Retrieve disable auto group change element HTML ID + * + * @return string + */ + protected function _getDisableAutoGroupChangeElementHtmlId() + { + return $this->getDisableAutoGroupChangeAttribute()->getAttributeCode(); + } + + /** + * Retrieve disable auto group change checkbox label text + * + * @return string + */ + public function getDisableAutoGroupChangeCheckboxLabel() + { + return Mage::helper('Mage_Customer_Helper_Data')->__($this->getDisableAutoGroupChangeAttribute()->getFrontend()->getLabel()); + } + + /** + * Retrieve disable auto group change checkbox state + * + * @return string + */ + public function getDisableAutoGroupChangeCheckboxState() + { + $customer = Mage::registry('current_customer'); + $checkedByDefault = ($customer && $customer->getId()) + ? false : Mage::helper('Mage_Customer_Helper_Address')->getDisableAutoGroupAssignDefaultValue(); + + $value = $this->getDisableAutoGroupChangeAttributeValue(); + $state = ''; + if (!empty($value) || $checkedByDefault) { + $state = 'checked'; + } + return $state; + } + + /** + * Retrieve disable auto group change checkbox element HTML NAME + * + * @return string + */ + public function getDisableAutoGroupChangeCheckboxElementName() + { + return $this->getElement()->getForm()->getFieldNameSuffix() + . '[' . $this->_getDisableAutoGroupChangeElementHtmlId() . ']'; + } + + /** + * Retrieve disable auto group change checkbox element HTML ID + * + * @return string + */ + public function getDisableAutoGroupChangeCheckboxElementId() + { + return $this->_getDisableAutoGroupChangeElementHtmlId(); + } +} diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Renderer/Newpass.php b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Renderer/Newpass.php index dacc11ac6867137a8facc04dc7e1b8cc7a652c19..3469e23b68651746c0c674cd5b5d1a818a610c95 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Renderer/Newpass.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Renderer/Newpass.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Renderer/Region.php b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Renderer/Region.php index dccb8100a2ee28ff00c22ee11003e04727b2b52c..f20ca90f20ffae729f0288187159464b30f52dce 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Renderer/Region.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Renderer/Region.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Account.php b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Account.php index f39b7938deb70854ba5fad043651926d37dab486..b247209c9688f42682802ac9c5a765c1d44caea6 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Account.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Account.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -33,11 +33,19 @@ */ class Mage_Adminhtml_Block_Customer_Edit_Tab_Account extends Mage_Adminhtml_Block_Widget_Form { + /** + * Initialize block + */ public function __construct() { parent::__construct(); } + /** + * Initialize form + * + * @return Mage_Adminhtml_Block_Customer_Edit_Tab_Account + */ public function initForm() { $form = new Varien_Data_Form(); @@ -46,36 +54,62 @@ class Mage_Adminhtml_Block_Customer_Edit_Tab_Account extends Mage_Adminhtml_Bloc $customer = Mage::registry('current_customer'); - /* @var $customerForm Mage_Customer_Model_Form */ + /** @var $customerForm Mage_Customer_Model_Form */ $customerForm = Mage::getModel('Mage_Customer_Model_Form'); $customerForm->setEntity($customer) ->setFormCode('adminhtml_customer') ->initDefaultValues(); - $fieldset = $form->addFieldset('base_fieldset', - array('legend'=>Mage::helper('Mage_Customer_Helper_Data')->__('Account Information')) - ); + $fieldset = $form->addFieldset('base_fieldset', array( + 'legend' => Mage::helper('Mage_Customer_Helper_Data')->__('Account Information') + )); $attributes = $customerForm->getAttributes(); foreach ($attributes as $attribute) { + /* @var $attribute Mage_Eav_Model_Entity_Attribute */ + $attribute->setFrontendLabel(Mage::helper('Mage_Customer_Helper_Data')->__($attribute->getFrontend()->getLabel())); $attribute->unsIsVisible(); } - $this->_setFieldset($attributes, $fieldset); + + $disableAutoGroupChangeAttributeName = 'disable_auto_group_change'; + $this->_setFieldset($attributes, $fieldset, array($disableAutoGroupChangeAttributeName)); + + $form->getElement('group_id')->setRenderer($this->getLayout() + ->createBlock('Mage_Adminhtml_Block_Customer_Edit_Renderer_Attribute_Group') + ->setDisableAutoGroupChangeAttribute($customerForm->getAttribute($disableAutoGroupChangeAttributeName)) + ->setDisableAutoGroupChangeAttributeValue($customer->getData($disableAutoGroupChangeAttributeName))); if ($customer->getId()) { $form->getElement('website_id')->setDisabled('disabled'); $form->getElement('created_in')->setDisabled('disabled'); } else { $fieldset->removeField('created_in'); - } + $form->getElement('website_id')->addClass('validate-website-has-store'); -// if (Mage::app()->isSingleStoreMode()) { -// $fieldset->removeField('website_id'); -// $fieldset->addField('website_id', 'hidden', array( -// 'name' => 'website_id' -// )); -// $customer->setWebsiteId(Mage::app()->getStore(true)->getWebsiteId()); -// } + $websites = array(); + foreach (Mage::app()->getWebsites(true) as $website) { + $websites[$website->getId()] = !is_null($website->getDefaultStore()); + } + $prefix = $form->getHtmlIdPrefix(); + + $form->getElement('website_id')->setAfterElementHtml( + '<script type="text/javascript">' + . " + var {$prefix}_websites = " . Mage::helper('Mage_Core_Helper_Data')->jsonEncode($websites) ."; + Validation.add( + 'validate-website-has-store', + '" . Mage::helper('Mage_Customer_Helper_Data')->__('Please select a website which contains store view') . "', + function(v, elem){ + return {$prefix}_websites[elem.value] == true; + } + ); + Element.observe('{$prefix}website_id', 'change', function(){ + Validation.validate($('{$prefix}website_id')) + }.bind($('{$prefix}website_id'))); + " + . '</script>' + ); + } $customerStoreId = null; if ($customer->getId()) { @@ -119,10 +153,10 @@ class Mage_Adminhtml_Block_Customer_Edit_Tab_Account extends Mage_Adminhtml_Bloc if ($customer->getId()) { if (!$customer->isReadonly()) { - // add password management fieldset + // Add password management fieldset $newFieldset = $form->addFieldset( 'password_fieldset', - array('legend'=>Mage::helper('Mage_Customer_Helper_Data')->__('Password Management')) + array('legend' => Mage::helper('Mage_Customer_Helper_Data')->__('Password Management')) ); // New customer password $field = $newFieldset->addField('new_password', 'text', @@ -136,7 +170,7 @@ class Mage_Adminhtml_Block_Customer_Edit_Tab_Account extends Mage_Adminhtml_Bloc $this->getLayout()->createBlock('Mage_Adminhtml_Block_Customer_Edit_Renderer_Newpass') ); - // prepare customer confirmation control (only for existing customers) + // Prepare customer confirmation control (only for existing customers) $confirmationKey = $customer->getConfirmation(); if ($confirmationKey || $customer->isConfirmationRequired()) { $confirmationAttribute = $customer->getAttribute('confirmation'); @@ -149,8 +183,8 @@ class Mage_Adminhtml_Block_Customer_Edit_Tab_Account extends Mage_Adminhtml_Bloc ))->setEntityAttribute($confirmationAttribute) ->setValues(array('' => 'Confirmed', $confirmationKey => 'Not confirmed')); - // prepare send welcome email checkbox, if customer is not confirmed - // no need to add it, if website id is empty + // Prepare send welcome email checkbox if customer is not confirmed + // no need to add it, if website ID is empty if ($customer->getConfirmation() && $customer->getWebsiteId()) { $fieldset->addField('sendemail', 'checkbox', array( 'name' => 'sendemail', @@ -175,7 +209,7 @@ class Mage_Adminhtml_Block_Customer_Edit_Tab_Account extends Mage_Adminhtml_Bloc ); $field->setRenderer($this->getLayout()->createBlock('Mage_Adminhtml_Block_Customer_Edit_Renderer_Newpass')); - // prepare send welcome email checkbox + // Prepare send welcome email checkbox $fieldset->addField('sendemail', 'checkbox', array( 'label' => Mage::helper('Mage_Customer_Helper_Data')->__('Send Welcome Email'), 'name' => 'sendemail', @@ -191,7 +225,7 @@ class Mage_Adminhtml_Block_Customer_Edit_Tab_Account extends Mage_Adminhtml_Bloc } } - // make sendemail and sendmail_store_id disabled, if website_id has empty value + // Make sendemail and sendmail_store_id disabled if website_id has empty value $isSingleMode = Mage::app()->isSingleStoreMode(); $sendEmailId = $isSingleMode ? 'sendemail' : 'sendemail_store_id'; $sendEmail = $form->getElement($sendEmailId); diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Addresses.php b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Addresses.php index 5e9c7b6ee31653fabb0d5dc7d6595129df12062d..fe00e65c877d0c90b9485d4be62148565dfaa8f8 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Addresses.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Addresses.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -128,6 +128,8 @@ class Mage_Adminhtml_Block_Customer_Edit_Tab_Addresses extends Mage_Adminhtml_Bl ->processStreetAttribute($attributes['street']); } foreach ($attributes as $attribute) { + /* @var $attribute Mage_Eav_Model_Entity_Attribute */ + $attribute->setFrontendLabel(Mage::helper('Mage_Customer_Helper_Data')->__($attribute->getFrontend()->getLabel())); $attribute->unsIsVisible(); } $this->_setFieldset($attributes, $fieldset); diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Cart.php b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Cart.php index 5ea7e00bf9312ffd4132249439dc381c1c9cf06a..1eb4a4fefbfadf86b6d7727507b927ca287bc898 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Cart.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Cart.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -37,12 +37,22 @@ class Mage_Adminhtml_Block_Customer_Edit_Tab_Cart extends Mage_Adminhtml_Block_W public function __construct($attributes=array()) { parent::__construct($attributes); - $this->setId('customer_cart_grid'.$this->getWebsiteId()); $this->setUseAjax(true); $this->_parentTemplate = $this->getTemplate(); $this->setTemplate('customer/tab/cart.phtml'); } + /** + * Prepare grid + * + * @return void + */ + protected function _prepareGrid() + { + $this->setId('customer_cart_grid' . $this->getWebsiteId()); + parent::_prepareGrid(); + } + protected function _prepareCollection() { $customer = Mage::registry('current_customer'); diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Carts.php b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Carts.php index 3ad7c84cebd76620f375e30fb20b4bb303ce71b5..e71cc9a2c9f8010468c20503de5211b8119827c3 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Carts.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Carts.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Newsletter.php b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Newsletter.php index 9cb071e4417e6ea1e52bca3188b1f5608a944d26..a89fa69e28723d6ee161baa13ef436b6baf32518 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Newsletter.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Newsletter.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Newsletter/Grid.php b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Newsletter/Grid.php index f5f7a75558f54520941ea289f57402bf6d290969..7cd5e2656dda671e614850e6e1331800e3ab46ce 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Newsletter/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Newsletter/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Newsletter/Grid/Filter/Status.php b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Newsletter/Grid/Filter/Status.php index 5533d2ab7b8c25e74fe1f2fde4340373785f2e36..d8d3925f416cb08e62a451b53a4fef1d46e9c5d2 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Newsletter/Grid/Filter/Status.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Newsletter/Grid/Filter/Status.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Newsletter/Grid/Renderer/Action.php b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Newsletter/Grid/Renderer/Action.php index ee732c60a0ba447047921e79b4df7ccfb3f98e9a..c5339919cc7229f932a169c77bb1b1c9fd168e1d 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Newsletter/Grid/Renderer/Action.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Newsletter/Grid/Renderer/Action.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Newsletter/Grid/Renderer/Status.php b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Newsletter/Grid/Renderer/Status.php index 96188255fb90b333d0fc7991ed7107d28e3ad467..faa9f535f32249892bf49f311c27ac0ae9296a19 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Newsletter/Grid/Renderer/Status.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Newsletter/Grid/Renderer/Status.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Orders.php b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Orders.php index 220f9ff656e34f05db4b7009d6ee311e2b6ac8b5..f59e6312901db8961afafb3d77c319fb433308bb 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Orders.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Orders.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Reviews.php b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Reviews.php index c07a0e60fd27d6f07ab7a26148aa7e53d67367b9..c3f6db54273629badcb8262547f161c4a84e124e 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Reviews.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Reviews.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Tag.php b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Tag.php index 2a6d75dced07be61cb94187b2103c0c10cd4a242..d4a540ea94402931c8fb06decd80e42e5a2cfd7f 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Tag.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Tag.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Tags.php b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Tags.php index 2f880f81621ea2f7dc7326ebc03179beb1be7ded..34a5c15acc70eb3ce55fbb37070c51aa4f4ccd71 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Tags.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Tags.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View.php b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View.php index d1766cd7a45d818d7781fd10b20a4462221752a8..7d38b8c7033c2c895e38152a1444aeecbdccf601 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View/Accordion.php b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View/Accordion.php index 829aac5863a9799e46dc4ecce82f845c64ac5d7b..1fa39a2597fabde13f9841e9dd67b20c0bc17a9c 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View/Accordion.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View/Accordion.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -58,9 +58,7 @@ class Mage_Adminhtml_Block_Customer_Edit_Tab_View_Accordion extends Mage_Adminht // prepare title for cart $title = Mage::helper('Mage_Customer_Helper_Data')->__('Shopping Cart - %d item(s)', $cartItemsCount); if (count($customer->getSharedWebsiteIds()) > 1) { - $title = Mage::helper('Mage_Customer_Helper_Data')->__('Shopping Cart of %1$s - %2$d item(s)', - $website->getName(), $cartItemsCount - ); + $title = Mage::helper('Mage_Customer_Helper_Data')->__('Shopping Cart of %1$s - %2$d item(s)', $website->getName(), $cartItemsCount); } // add cart ajax accordion diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View/Cart.php b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View/Cart.php index 30e8d1abdb36bb67358e5fba035d1c1c14dda3dc..8d3db643da2d547158ae76f2cce14c66a6f5c26d 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View/Cart.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View/Cart.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View/Grid/Renderer/Item.php b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View/Grid/Renderer/Item.php index 7291c25e26ffcf1f7bcae87a664d5fbd46048036..739fcc0b490dd22409c4671b0c126082bac91362 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View/Grid/Renderer/Item.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View/Grid/Renderer/Item.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View/Orders.php b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View/Orders.php index 80b6fa1951518b03b21865f464c15fb298b3edde..54852514128d0b0eecaf3314aa985cfab08ecac3 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View/Orders.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View/Orders.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View/Sales.php b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View/Sales.php index 7bb95072bc2223248fc4f8a6968ead7c7091961c..24d3387ff4e523882f06c3e59204be75fd712ed0 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View/Sales.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View/Sales.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View/Wishlist.php b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View/Wishlist.php index d5034784cc90e1daf44f05aa458db08a61c0901c..17c02c167a176a74bc2499f01697ca84384dfaf9 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View/Wishlist.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View/Wishlist.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Wishlist.php b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Wishlist.php index 5fbe1d7295ca6a9b2ca1eab1933b60f1260d5dc9..bcbb23b30803fe63d83c8b324de3ee2c2be8f249 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Wishlist.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Wishlist.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Wishlist/Grid/Renderer/Description.php b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Wishlist/Grid/Renderer/Description.php index 677449514d7f4fb034fec13dbd5f53326dbd03f6..3b9d22ee2646fd12b2245886b136e86fff15f5cc 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Wishlist/Grid/Renderer/Description.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Wishlist/Grid/Renderer/Description.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tabs.php b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tabs.php index aecd88f1cb53378dfb6eef53634fc86567e3a930..74d90c4fc3c0085d6431c5d3366d00dac6c00a52 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tabs.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tabs.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Form/Element/Boolean.php b/app/code/core/Mage/Adminhtml/Block/Customer/Form/Element/Boolean.php index 0d8de4a8b43ab46cee0f46504ece4f752664d13d..e296fec73ca764c9f2df920b48e1ea2d4e52d9cf 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Form/Element/Boolean.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Form/Element/Boolean.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Form/Element/File.php b/app/code/core/Mage/Adminhtml/Block/Customer/Form/Element/File.php index 0217933433b0c172b8e9207806deb73b1d4e1380..02b71d3804d925372351fe1608d581d358aa1234 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Form/Element/File.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Form/Element/File.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Form/Element/Image.php b/app/code/core/Mage/Adminhtml/Block/Customer/Form/Element/Image.php index 2492a542894e1674613d20b8969ac134d1ce9695..52de6839e34c7a8ee749c6fcb26f9256751624fe 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Form/Element/Image.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Form/Element/Image.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Grid.php b/app/code/core/Mage/Adminhtml/Block/Customer/Grid.php index 587f4625388eab46cca864e8bcf7cb5b15b6afc8..7986d9c77032ab74f6decabf4462c70158195b97 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Grid/Filter/Country.php b/app/code/core/Mage/Adminhtml/Block/Customer/Grid/Filter/Country.php index f78530258c88a9f971a0b796ab4b10a98d6ddf9a..cf77d4cccfbadfe0c3bee8752653f50b48b389f9 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Grid/Filter/Country.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Grid/Filter/Country.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Grid/Renderer/Multiaction.php b/app/code/core/Mage/Adminhtml/Block/Customer/Grid/Renderer/Multiaction.php index 8663e9dae6c5b1e3ba05ed996e89f7e58c4dda8b..9d0bb5d53fff063a40bf23e1808c649a6cef51cf 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Grid/Renderer/Multiaction.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Grid/Renderer/Multiaction.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Group.php b/app/code/core/Mage/Adminhtml/Block/Customer/Group.php index f94b7cb929c2e4d007f48c826fdf1259b1efea9c..a681e699e3357f6593a24ed59506146b850774ba 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Group.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Group.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Group/Edit.php b/app/code/core/Mage/Adminhtml/Block/Customer/Group/Edit.php index 422f16dd09363b3df0aaab8e44161b9293134ca6..0db3c67f36908ae68f3ae978e3dbbb0241d203dc 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Group/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Group/Edit.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Group/Edit/Form.php b/app/code/core/Mage/Adminhtml/Block/Customer/Group/Edit/Form.php index aa8e2ba81d97716711c3937f3435bdf3a11a2f05..6a046ca73e3a186fa5c862a48ebc1738a753c7da 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Group/Edit/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Group/Edit/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -51,8 +51,7 @@ class Mage_Adminhtml_Block_Customer_Group_Edit_Form extends Mage_Adminhtml_Block 'name' => 'code', 'label' => Mage::helper('Mage_Customer_Helper_Data')->__('Group Name'), 'title' => Mage::helper('Mage_Customer_Helper_Data')->__('Group Name'), - 'note' => Mage::helper('Mage_Customer_Helper_Data')->__('Maximum length must be less then %s symbols', - Mage_Customer_Model_Group::GROUP_CODE_MAX_LENGTH), + 'note' => Mage::helper('Mage_Customer_Helper_Data')->__('Maximum length must be less then %s symbols', Mage_Customer_Model_Group::GROUP_CODE_MAX_LENGTH), 'class' => $validateClass, 'required' => true, ) diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Group/Grid.php b/app/code/core/Mage/Adminhtml/Block/Customer/Group/Grid.php index 8114257a017c85d29afef77f5ad5710bb8ee883d..f343754b86fd6e27d2905babc23320a868ef5088 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Group/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Group/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Online.php b/app/code/core/Mage/Adminhtml/Block/Customer/Online.php index bdc1092695f8d73a11d6e70f4005205424a141c6..a780c57a80751f4b21caeb1ee1ab55f99a9fa2dd 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Online.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Online.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Online/Filter.php b/app/code/core/Mage/Adminhtml/Block/Customer/Online/Filter.php index cdbcac97d3205587212f557197029ed3bf1f1816..95e7e382f34f90f63ca6ccc6df95a93726bc400b 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Online/Filter.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Online/Filter.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Online/Grid.php b/app/code/core/Mage/Adminhtml/Block/Customer/Online/Grid.php index 12bc28285d756de6e571a5a06b5b9af50e035824..b25f28c0273203f3c676b543fdb54cdf6bf8e417 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Online/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Online/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Online/Grid/Renderer/Ip.php b/app/code/core/Mage/Adminhtml/Block/Customer/Online/Grid/Renderer/Ip.php index a86421137a8d307439ee7fcb08176ac4c0990763..de30d6d84e09366834e3605825c5fc510d7b549a 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Online/Grid/Renderer/Ip.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Online/Grid/Renderer/Ip.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Online/Grid/Renderer/Type.php b/app/code/core/Mage/Adminhtml/Block/Customer/Online/Grid/Renderer/Type.php index 70200957b84f5968cfdaaeed98e21598192a176f..45b0cb70073b056d5177673907fb31d38d46a90d 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Online/Grid/Renderer/Type.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Online/Grid/Renderer/Type.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Online/Grid/Renderer/Url.php b/app/code/core/Mage/Adminhtml/Block/Customer/Online/Grid/Renderer/Url.php index 1cb7bab9efbb1d4b2fe4f11080c7079ec73a3df5..70853370d70df328b0e192d90e3eaea3c8a1bd27 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Online/Grid/Renderer/Url.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Online/Grid/Renderer/Url.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Sales/Order/Address/Form/Renderer/Vat.php b/app/code/core/Mage/Adminhtml/Block/Customer/Sales/Order/Address/Form/Renderer/Vat.php new file mode 100644 index 0000000000000000000000000000000000000000..9847fc918dc851214a82e2fc930a011ba720aff7 --- /dev/null +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Sales/Order/Address/Form/Renderer/Vat.php @@ -0,0 +1,93 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Adminhtml + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * VAT ID element renderer + * + * @category Mage + * @package Mage_Adminhtml + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Adminhtml_Block_Customer_Sales_Order_Address_Form_Renderer_Vat + extends Mage_Adminhtml_Block_Widget_Form_Renderer_Fieldset_Element +{ + /** + * Validate button block + * + * @var null|Mage_Adminhtml_Block_Widget_Button + */ + protected $_validateButton = null; + + /** + * Set custom template for 'VAT number' + */ + protected function _construct() + { + $this->setTemplate('customer/sales/order/create/address/form/renderer/vat.phtml'); + } + + /** + * Retrieve validate button block + * + * @return Mage_Adminhtml_Block_Widget_Button + */ + public function getValidateButton() + { + if (is_null($this->_validateButton)) { + /** @var $form Varien_Data_Form */ + $form = $this->_element->getForm(); + + $vatElementId = $this->_element->getHtmlId(); + + $countryElementId = $form->getElement('country_id')->getHtmlId(); + $validateUrl = Mage::getSingleton('Mage_Adminhtml_Model_Url') + ->getUrl('*/customer_system_config_validatevat/validateAdvanced'); + + $vatValidateOptions = Mage::helper('Mage_Core_Helper_Data')->jsonEncode(array( + 'vatElementId' => $vatElementId, + 'countryElementId' => $countryElementId, + 'groupIdHtmlId' => 'group_id', + 'validateUrl' => $validateUrl, + 'vatValidMessage' => Mage::helper('Mage_Customer_Helper_Data')->__('The VAT ID is valid. The current Customer Group will be used.'), + 'vatValidAndGroupChangeMessage' => Mage::helper('Mage_Customer_Helper_Data')->__('Based on the VAT ID, the customer would belong to the Customer Group %s.') . "\n" + . Mage::helper('Mage_Customer_Helper_Data')->__('The customer is currently assigned to Customer Group %s.') . ' ' + . Mage::helper('Mage_Customer_Helper_Data')->__('Would you like to change the Customer Group for this order?'), + 'vatInvalidMessage' => Mage::helper('Mage_Customer_Helper_Data')->__('The VAT ID entered (%s) is not a valid VAT ID.'), + 'vatValidationFailedMessage' => Mage::helper('Mage_Customer_Helper_Data')->__('There was an error validating the VAT ID. Please try again later.'), + )); + + $optionsVarName = $this->getJsVariablePrefix() . 'VatParameters'; + $beforeHtml = '<script type="text/javascript">var ' . $optionsVarName . ' = ' . $vatValidateOptions + . ';</script>'; + $this->_validateButton = $this->getLayout()->createBlock('Mage_Adminhtml_Block_Widget_Button')->setData(array( + 'label' => Mage::helper('Mage_Customer_Helper_Data')->__('Validate VAT Number'), + 'before_html' => $beforeHtml, + 'onclick' => 'order.validateVat(' . $optionsVarName . ')' + )); + } + return $this->_validateButton; + } +} diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/System/Config/Validatevat.php b/app/code/core/Mage/Adminhtml/Block/Customer/System/Config/Validatevat.php new file mode 100644 index 0000000000000000000000000000000000000000..215fec693317cb9118bfc1be15c2802acf2dcd2d --- /dev/null +++ b/app/code/core/Mage/Adminhtml/Block/Customer/System/Config/Validatevat.php @@ -0,0 +1,79 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Adminhtml + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Adminhtml VAT ID validation block + * + * @category Mage + * @package Mage_Adminhtml + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Adminhtml_Block_Customer_System_Config_Validatevat extends Mage_Adminhtml_Block_System_Config_Form_Field +{ + /** + * Set template to itself + * + * @return Mage_Adminhtml_Block_Customer_System_Config_Validatevat + */ + protected function _prepareLayout() + { + parent::_prepareLayout(); + if (!$this->getTemplate()) { + $this->setTemplate('customer/system/config/validatevat.phtml'); + } + return $this; + } + + /** + * Unset some non-related element parameters + * + * @param Varien_Data_Form_Element_Abstract $element + * @return string + */ + public function render(Varien_Data_Form_Element_Abstract $element) + { + $element->unsScope()->unsCanUseWebsiteValue()->unsCanUseDefaultValue(); + return parent::render($element); + } + + /** + * Get the button and scripts contents + * + * @param Varien_Data_Form_Element_Abstract $element + * @return string + */ + protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element) + { + $originalData = $element->getOriginalData(); + $this->addData(array( + 'button_label' => Mage::helper('Mage_Customer_Helper_Data')->__($originalData['button_label']), + 'html_id' => $element->getHtmlId(), + 'ajax_url' => Mage::getSingleton('Mage_Adminhtml_Model_Url')->getUrl('*/customer_system_config_validatevat/validate') + )); + + return $this->_toHtml(); + } +} diff --git a/app/code/core/Mage/Adminhtml/Block/Dashboard.php b/app/code/core/Mage/Adminhtml/Block/Dashboard.php index 9c750ff65002557270c32a7263e6650b1f4a4701..d3ca02a9933ed7410c011f761b804980722ffbd0 100644 --- a/app/code/core/Mage/Adminhtml/Block/Dashboard.php +++ b/app/code/core/Mage/Adminhtml/Block/Dashboard.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Dashboard/Abstract.php b/app/code/core/Mage/Adminhtml/Block/Dashboard/Abstract.php index 93ccbd1bd4a548feadfa1cb6664480925cf492ce..1f134e5e0c179d39afe30dd5a753ef6da1d4cc54 100644 --- a/app/code/core/Mage/Adminhtml/Block/Dashboard/Abstract.php +++ b/app/code/core/Mage/Adminhtml/Block/Dashboard/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Dashboard/Bar.php b/app/code/core/Mage/Adminhtml/Block/Dashboard/Bar.php index 9117b436bd9b2cd606b68a3988d926370a20bd86..27440af4949746cccda858143c8556cf7ef0eea7 100644 --- a/app/code/core/Mage/Adminhtml/Block/Dashboard/Bar.php +++ b/app/code/core/Mage/Adminhtml/Block/Dashboard/Bar.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Dashboard/Diagrams.php b/app/code/core/Mage/Adminhtml/Block/Dashboard/Diagrams.php index 390e2704fe21ad43f5e349d41011b6b3861335fb..0de6169097d4d6de6927fbc7f12630507ddac8b4 100644 --- a/app/code/core/Mage/Adminhtml/Block/Dashboard/Diagrams.php +++ b/app/code/core/Mage/Adminhtml/Block/Dashboard/Diagrams.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Dashboard/Graph.php b/app/code/core/Mage/Adminhtml/Block/Dashboard/Graph.php index fff9a3a967b141308e510781b50710d8f5ee7274..c57342332369b26f89df552126d9e27df3ae769b 100644 --- a/app/code/core/Mage/Adminhtml/Block/Dashboard/Graph.php +++ b/app/code/core/Mage/Adminhtml/Block/Dashboard/Graph.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Dashboard/Grid.php b/app/code/core/Mage/Adminhtml/Block/Dashboard/Grid.php index f101d7440dad245a3e3b871174d8bf4071cca7d9..17abc4ddcb73b49def85f28bdd13c3b78e350c6c 100644 --- a/app/code/core/Mage/Adminhtml/Block/Dashboard/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Dashboard/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Dashboard/Grids.php b/app/code/core/Mage/Adminhtml/Block/Dashboard/Grids.php index 5df46ebdb36e501909a780dec250299fd69db232..09f70ee1028fa592e320fb5bec400e8fa30396c9 100644 --- a/app/code/core/Mage/Adminhtml/Block/Dashboard/Grids.php +++ b/app/code/core/Mage/Adminhtml/Block/Dashboard/Grids.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Dashboard/Orders/Grid.php b/app/code/core/Mage/Adminhtml/Block/Dashboard/Orders/Grid.php index cb81cb0c63dbff60098f671d18c3322480f2725a..9df2dc29f336b3d185050920e7a436b9e77508c4 100644 --- a/app/code/core/Mage/Adminhtml/Block/Dashboard/Orders/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Dashboard/Orders/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Dashboard/Sales.php b/app/code/core/Mage/Adminhtml/Block/Dashboard/Sales.php index 687cb6975e32ba0b87206aadfb08dfbb02048a68..76cc1dc213407d2ea1923dddc7099dd702ab73b6 100644 --- a/app/code/core/Mage/Adminhtml/Block/Dashboard/Sales.php +++ b/app/code/core/Mage/Adminhtml/Block/Dashboard/Sales.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Dashboard/Searches/Last.php b/app/code/core/Mage/Adminhtml/Block/Dashboard/Searches/Last.php index 528d24b17b420bfe01e22da47b80502fc0f124fa..531ad5a8731fade66940b0314ac8c3728f59bbac 100644 --- a/app/code/core/Mage/Adminhtml/Block/Dashboard/Searches/Last.php +++ b/app/code/core/Mage/Adminhtml/Block/Dashboard/Searches/Last.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Dashboard/Searches/Renderer/Searchquery.php b/app/code/core/Mage/Adminhtml/Block/Dashboard/Searches/Renderer/Searchquery.php index 6b89b01c5ef708e4b1645e4844b0919d3930d4a7..932bd74e6ad4bd55aa0245134ba654fb915b96f5 100644 --- a/app/code/core/Mage/Adminhtml/Block/Dashboard/Searches/Renderer/Searchquery.php +++ b/app/code/core/Mage/Adminhtml/Block/Dashboard/Searches/Renderer/Searchquery.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Dashboard/Searches/Top.php b/app/code/core/Mage/Adminhtml/Block/Dashboard/Searches/Top.php index 6827c49a2fb5c44dcfd26eee761243179d224637..4f18eaa23fecb364d5b1cb64a7dd24a6dc243dcf 100644 --- a/app/code/core/Mage/Adminhtml/Block/Dashboard/Searches/Top.php +++ b/app/code/core/Mage/Adminhtml/Block/Dashboard/Searches/Top.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Dashboard/Tab/Amounts.php b/app/code/core/Mage/Adminhtml/Block/Dashboard/Tab/Amounts.php index c55c472b553595bbd56dd3dbe166452317908f6b..ad5169c640cf78cd2bd2c25263a7ebbe18f38f86 100644 --- a/app/code/core/Mage/Adminhtml/Block/Dashboard/Tab/Amounts.php +++ b/app/code/core/Mage/Adminhtml/Block/Dashboard/Tab/Amounts.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Dashboard/Tab/Customers/Most.php b/app/code/core/Mage/Adminhtml/Block/Dashboard/Tab/Customers/Most.php index 0910b9d287350e6eb807baaa338865ec2b5f28ef..61e93f6d1aef77b9990a7762830a1b1869b91c73 100644 --- a/app/code/core/Mage/Adminhtml/Block/Dashboard/Tab/Customers/Most.php +++ b/app/code/core/Mage/Adminhtml/Block/Dashboard/Tab/Customers/Most.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Dashboard/Tab/Customers/Newest.php b/app/code/core/Mage/Adminhtml/Block/Dashboard/Tab/Customers/Newest.php index f10f8013b3f310a256ca3dba820d78c8019a6e7f..38ef358038f910b0b961b8e8baf7d34c9a9487f1 100644 --- a/app/code/core/Mage/Adminhtml/Block/Dashboard/Tab/Customers/Newest.php +++ b/app/code/core/Mage/Adminhtml/Block/Dashboard/Tab/Customers/Newest.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Dashboard/Tab/Orders.php b/app/code/core/Mage/Adminhtml/Block/Dashboard/Tab/Orders.php index 1310b90ab593e2f60f6c201250096b7f0958e2aa..89cd8626549413a693ac0afee54a42ddad782e57 100644 --- a/app/code/core/Mage/Adminhtml/Block/Dashboard/Tab/Orders.php +++ b/app/code/core/Mage/Adminhtml/Block/Dashboard/Tab/Orders.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Dashboard/Tab/Products/Ordered.php b/app/code/core/Mage/Adminhtml/Block/Dashboard/Tab/Products/Ordered.php index d5cf584e8e3dc6210c376cc05e5dd72aa8934b63..f5ff92b2682f4972e424ca3f56e8515cd2c1baf4 100644 --- a/app/code/core/Mage/Adminhtml/Block/Dashboard/Tab/Products/Ordered.php +++ b/app/code/core/Mage/Adminhtml/Block/Dashboard/Tab/Products/Ordered.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Dashboard/Tab/Products/Viewed.php b/app/code/core/Mage/Adminhtml/Block/Dashboard/Tab/Products/Viewed.php index b458d4f506b8b77d9bc2f617b2bd550e73693f89..0a1eef69dd86242352d78773eb1a5e8f52e06a42 100644 --- a/app/code/core/Mage/Adminhtml/Block/Dashboard/Tab/Products/Viewed.php +++ b/app/code/core/Mage/Adminhtml/Block/Dashboard/Tab/Products/Viewed.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Dashboard/Totals.php b/app/code/core/Mage/Adminhtml/Block/Dashboard/Totals.php index e43b36db65e340bb0bc4462bf4f63417f9df6a2e..3c24ab0e44bb101b690079044a06ff54b2924878 100644 --- a/app/code/core/Mage/Adminhtml/Block/Dashboard/Totals.php +++ b/app/code/core/Mage/Adminhtml/Block/Dashboard/Totals.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Denied.php b/app/code/core/Mage/Adminhtml/Block/Denied.php index eeeb652814da3972c1829e6cb744807daedd0983..e0b9db466090cae3219c80444db149798965a0bb 100644 --- a/app/code/core/Mage/Adminhtml/Block/Denied.php +++ b/app/code/core/Mage/Adminhtml/Block/Denied.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Html/Date.php b/app/code/core/Mage/Adminhtml/Block/Html/Date.php index 7f07527f76d2788a7061b81976072a00ca0549df..f946792abc7dd9c45f3df8607f899c2491a8f60c 100644 --- a/app/code/core/Mage/Adminhtml/Block/Html/Date.php +++ b/app/code/core/Mage/Adminhtml/Block/Html/Date.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Html/Select.php b/app/code/core/Mage/Adminhtml/Block/Html/Select.php index dab8a3ca2e21f0ee499cc50cbe2b6e20efd654b4..6ab1974691d228d8b6d628b03da620b4c09e4ade 100644 --- a/app/code/core/Mage/Adminhtml/Block/Html/Select.php +++ b/app/code/core/Mage/Adminhtml/Block/Html/Select.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Media/Editor.php b/app/code/core/Mage/Adminhtml/Block/Media/Editor.php index ad90e5c413c92c16a02c4bc89c7fad4d800d9270..84765e872207b9d7aaa93b603767d4b682e9c7b1 100644 --- a/app/code/core/Mage/Adminhtml/Block/Media/Editor.php +++ b/app/code/core/Mage/Adminhtml/Block/Media/Editor.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Media/Uploader.php b/app/code/core/Mage/Adminhtml/Block/Media/Uploader.php index 061a8c0f922cef8c9499c742ff174146bdbae0e0..7835decad2a000a469f3be116c3d381f292f6755 100644 --- a/app/code/core/Mage/Adminhtml/Block/Media/Uploader.php +++ b/app/code/core/Mage/Adminhtml/Block/Media/Uploader.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -195,11 +195,12 @@ class Mage_Adminhtml_Block_Media_Uploader extends Mage_Adminhtml_Block_Widget } /** - * Retrive full uploader SWF's file URL + * Retrieve full uploader SWF's file URL * Implemented to solve problem with cross domain SWFs * Now uploader can be only in the same URL where backend located * - * @param string url to uploader in current theme + * @param string $url url to uploader in current theme + * * @return string full URL */ public function getUploaderUrl($url) diff --git a/app/code/core/Mage/Adminhtml/Block/Messages.php b/app/code/core/Mage/Adminhtml/Block/Messages.php index 06dffe7f0a5c624b4245ec4b80bde88949666c55..0ff5da661b8054c4b2bb1ca907596e34927b1229 100644 --- a/app/code/core/Mage/Adminhtml/Block/Messages.php +++ b/app/code/core/Mage/Adminhtml/Block/Messages.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Newsletter/Problem.php b/app/code/core/Mage/Adminhtml/Block/Newsletter/Problem.php index 395e171a20b74e49f10dc11d23a6a455104235b8..74f73e4a7f3f6a03b26f12d6b85c895b02591cd0 100644 --- a/app/code/core/Mage/Adminhtml/Block/Newsletter/Problem.php +++ b/app/code/core/Mage/Adminhtml/Block/Newsletter/Problem.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Newsletter/Problem/Grid.php b/app/code/core/Mage/Adminhtml/Block/Newsletter/Problem/Grid.php index fa5832ae02d6d2b78f5049c7ea2ad437152acd0e..faa1ababdb815fe9727a48889565407b3239b7e8 100644 --- a/app/code/core/Mage/Adminhtml/Block/Newsletter/Problem/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Newsletter/Problem/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Newsletter/Problem/Grid/Filter/Checkbox.php b/app/code/core/Mage/Adminhtml/Block/Newsletter/Problem/Grid/Filter/Checkbox.php index bb10bace3a6f863b190c08f4f2ddc351b76d98f1..82043530b98c88b3e2d549c53354ffc72ea43318 100644 --- a/app/code/core/Mage/Adminhtml/Block/Newsletter/Problem/Grid/Filter/Checkbox.php +++ b/app/code/core/Mage/Adminhtml/Block/Newsletter/Problem/Grid/Filter/Checkbox.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Newsletter/Problem/Grid/Renderer/Checkbox.php b/app/code/core/Mage/Adminhtml/Block/Newsletter/Problem/Grid/Renderer/Checkbox.php index 8e4d0238e59b71912862396b8ee502bd8e11c861..1a45eb91dc38ee3b807418f56a4c0c6f7eb1a978 100644 --- a/app/code/core/Mage/Adminhtml/Block/Newsletter/Problem/Grid/Renderer/Checkbox.php +++ b/app/code/core/Mage/Adminhtml/Block/Newsletter/Problem/Grid/Renderer/Checkbox.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Newsletter/Queue.php b/app/code/core/Mage/Adminhtml/Block/Newsletter/Queue.php index 4afed56549b408b9602657102e24c746fc3b0aee..80d8a5826d6c0f5781e132736c2d4fd945bdf5ea 100644 --- a/app/code/core/Mage/Adminhtml/Block/Newsletter/Queue.php +++ b/app/code/core/Mage/Adminhtml/Block/Newsletter/Queue.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Newsletter/Queue/Edit.php b/app/code/core/Mage/Adminhtml/Block/Newsletter/Queue/Edit.php index 467f985c4a826e33da07798b9c2c70fd9c0c1d20..169f616cd90a9221494318be4220c6acfe53912a 100644 --- a/app/code/core/Mage/Adminhtml/Block/Newsletter/Queue/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/Newsletter/Queue/Edit.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Newsletter/Queue/Edit/Form.php b/app/code/core/Mage/Adminhtml/Block/Newsletter/Queue/Edit/Form.php index 5a049f3359d7ae65007527998de578976f94aa9f..448e8277e4430df8bbc234e68fcb378a43436013 100644 --- a/app/code/core/Mage/Adminhtml/Block/Newsletter/Queue/Edit/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Newsletter/Queue/Edit/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Newsletter/Queue/Grid.php b/app/code/core/Mage/Adminhtml/Block/Newsletter/Queue/Grid.php index 4403a3ae18df63f04fd3d9bd53544279bfd47765..811e5c9e2275be3fae19599edc40dd0c96f0aa63 100644 --- a/app/code/core/Mage/Adminhtml/Block/Newsletter/Queue/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Newsletter/Queue/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Newsletter/Queue/Grid/Renderer/Action.php b/app/code/core/Mage/Adminhtml/Block/Newsletter/Queue/Grid/Renderer/Action.php index ba15789b729ba9084bfa3774a9c8d58bac3194d8..1641b41701741d3fba1cbde187742ffdfde2c19d 100644 --- a/app/code/core/Mage/Adminhtml/Block/Newsletter/Queue/Grid/Renderer/Action.php +++ b/app/code/core/Mage/Adminhtml/Block/Newsletter/Queue/Grid/Renderer/Action.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Newsletter/Queue/Preview.php b/app/code/core/Mage/Adminhtml/Block/Newsletter/Queue/Preview.php index bd1cb9d683afdb495e862dabc7006938d0fe6295..90e969bdd54718f80d9ae15d282aebbe356b1433 100644 --- a/app/code/core/Mage/Adminhtml/Block/Newsletter/Queue/Preview.php +++ b/app/code/core/Mage/Adminhtml/Block/Newsletter/Queue/Preview.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Newsletter/Queue/Preview/Form.php b/app/code/core/Mage/Adminhtml/Block/Newsletter/Queue/Preview/Form.php index 5939a0c203d4c6665932b12fa40d7ef35ec351cb..9fbc38a8e610666cc6bab4d043fd795d04669842 100644 --- a/app/code/core/Mage/Adminhtml/Block/Newsletter/Queue/Preview/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Newsletter/Queue/Preview/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Newsletter/Subscriber.php b/app/code/core/Mage/Adminhtml/Block/Newsletter/Subscriber.php index 95e360c6e15ce684e946f96795e8cb14122e1b50..ffc107093e09bb834f56d5114048df91dbb73bb7 100644 --- a/app/code/core/Mage/Adminhtml/Block/Newsletter/Subscriber.php +++ b/app/code/core/Mage/Adminhtml/Block/Newsletter/Subscriber.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Newsletter/Subscriber/Grid.php b/app/code/core/Mage/Adminhtml/Block/Newsletter/Subscriber/Grid.php index a96d08bd7d62b5ae4f6de9248a075c0ef860232c..d3efd3aee10620a44ade36dbc817327794bcc1bf 100644 --- a/app/code/core/Mage/Adminhtml/Block/Newsletter/Subscriber/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Newsletter/Subscriber/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Newsletter/Subscriber/Grid/Filter/Checkbox.php b/app/code/core/Mage/Adminhtml/Block/Newsletter/Subscriber/Grid/Filter/Checkbox.php index b154ea84339dcea91b55c5a3dc7eeace01412701..9a3a1b9a8cb689fbe21b51dddcd0ff35ac120b99 100644 --- a/app/code/core/Mage/Adminhtml/Block/Newsletter/Subscriber/Grid/Filter/Checkbox.php +++ b/app/code/core/Mage/Adminhtml/Block/Newsletter/Subscriber/Grid/Filter/Checkbox.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Newsletter/Subscriber/Grid/Filter/Website.php b/app/code/core/Mage/Adminhtml/Block/Newsletter/Subscriber/Grid/Filter/Website.php index 9a24ff92bb3e299e7083d313f144572472d3404c..7fbc843ca046df99bdf5cdc23ab92fad85104fd7 100644 --- a/app/code/core/Mage/Adminhtml/Block/Newsletter/Subscriber/Grid/Filter/Website.php +++ b/app/code/core/Mage/Adminhtml/Block/Newsletter/Subscriber/Grid/Filter/Website.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Newsletter/Subscriber/Grid/Renderer/Checkbox.php b/app/code/core/Mage/Adminhtml/Block/Newsletter/Subscriber/Grid/Renderer/Checkbox.php index 66e841e03c03818ad05260813f442c42a3403ff5..1cfdc93dc105f769c908fdd2e69bd5b038bf388f 100644 --- a/app/code/core/Mage/Adminhtml/Block/Newsletter/Subscriber/Grid/Renderer/Checkbox.php +++ b/app/code/core/Mage/Adminhtml/Block/Newsletter/Subscriber/Grid/Renderer/Checkbox.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Newsletter/Template.php b/app/code/core/Mage/Adminhtml/Block/Newsletter/Template.php index 33dcc6efc2329f7abdd750025adb0cd1adcbd0f6..dd1967206bd963e7bb5ecd4cdeca4f289a79d204 100644 --- a/app/code/core/Mage/Adminhtml/Block/Newsletter/Template.php +++ b/app/code/core/Mage/Adminhtml/Block/Newsletter/Template.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Newsletter/Template/Edit.php b/app/code/core/Mage/Adminhtml/Block/Newsletter/Template/Edit.php index 67d062a8ac6bd0887f81b694d7ff87cca80e9cdf..5d34599122453d5059798cf0d719585a5b7b3f4f 100644 --- a/app/code/core/Mage/Adminhtml/Block/Newsletter/Template/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/Newsletter/Template/Edit.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Newsletter/Template/Edit/Form.php b/app/code/core/Mage/Adminhtml/Block/Newsletter/Template/Edit/Form.php index 63b5760ac125a013020b4b6e7a0c197e995a7336..e4cddbed458e3f26f76af3e318a3d393c84d9b66 100644 --- a/app/code/core/Mage/Adminhtml/Block/Newsletter/Template/Edit/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Newsletter/Template/Edit/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Newsletter/Template/Grid.php b/app/code/core/Mage/Adminhtml/Block/Newsletter/Template/Grid.php index bb5e60268f768e9791ae2c90c77332ef22605aa9..8f497d66d5bb9fe9de3e45eed2236388452dc2ee 100644 --- a/app/code/core/Mage/Adminhtml/Block/Newsletter/Template/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Newsletter/Template/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Newsletter/Template/Grid/Renderer/Action.php b/app/code/core/Mage/Adminhtml/Block/Newsletter/Template/Grid/Renderer/Action.php index fddc1967d1a44ade4847d6e3523683fd2a0850ca..9ddcb00afa79b08c762616fad9d5e4dce546c4c6 100644 --- a/app/code/core/Mage/Adminhtml/Block/Newsletter/Template/Grid/Renderer/Action.php +++ b/app/code/core/Mage/Adminhtml/Block/Newsletter/Template/Grid/Renderer/Action.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Newsletter/Template/Grid/Renderer/Sender.php b/app/code/core/Mage/Adminhtml/Block/Newsletter/Template/Grid/Renderer/Sender.php index 8f5bb82d78610e09e91f1c4994437e98059a8b1d..ad90b211907f311c3d9c73aa9075b4f4edaf907f 100644 --- a/app/code/core/Mage/Adminhtml/Block/Newsletter/Template/Grid/Renderer/Sender.php +++ b/app/code/core/Mage/Adminhtml/Block/Newsletter/Template/Grid/Renderer/Sender.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Newsletter/Template/Preview.php b/app/code/core/Mage/Adminhtml/Block/Newsletter/Template/Preview.php index 8feb49de7958a8da257eda4f3479f23c62834278..fc89ae09a74940e8c73ae0925534a5fe33091500 100644 --- a/app/code/core/Mage/Adminhtml/Block/Newsletter/Template/Preview.php +++ b/app/code/core/Mage/Adminhtml/Block/Newsletter/Template/Preview.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Newsletter/Template/Preview/Form.php b/app/code/core/Mage/Adminhtml/Block/Newsletter/Template/Preview/Form.php index ef39ea765f9df2771d34017d6899076e0c79e7f4..5b7d506dffdfcd70281a48506c3c2c4af3a57356 100644 --- a/app/code/core/Mage/Adminhtml/Block/Newsletter/Template/Preview/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Newsletter/Template/Preview/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Notification/Baseurl.php b/app/code/core/Mage/Adminhtml/Block/Notification/Baseurl.php index 94aafac8ca9909a72219508f4296635cffa8e9e2..a41455c40a2fdc5bc4ec595270cc63adec569226 100644 --- a/app/code/core/Mage/Adminhtml/Block/Notification/Baseurl.php +++ b/app/code/core/Mage/Adminhtml/Block/Notification/Baseurl.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Notification/Grid.php b/app/code/core/Mage/Adminhtml/Block/Notification/Grid.php index 3bdc2f24d614e5cad24bc83ea5aef915525da2c1..eccb17d690e69d544a4d37d8a0abaa109f88db92 100644 --- a/app/code/core/Mage/Adminhtml/Block/Notification/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Notification/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Notification/Grid/Renderer/Actions.php b/app/code/core/Mage/Adminhtml/Block/Notification/Grid/Renderer/Actions.php index eec12534645126e876d5a1eb56064ae8aca6d134..e24d4fe76cbc7c070a2f54dd6c7c8439cdac3868 100644 --- a/app/code/core/Mage/Adminhtml/Block/Notification/Grid/Renderer/Actions.php +++ b/app/code/core/Mage/Adminhtml/Block/Notification/Grid/Renderer/Actions.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Notification/Grid/Renderer/Notice.php b/app/code/core/Mage/Adminhtml/Block/Notification/Grid/Renderer/Notice.php index 6243ddf0305ff515181f58afb6cebe80dfb7ce68..5b0f34580dd30833257f1b9ce064c1e1652a971a 100644 --- a/app/code/core/Mage/Adminhtml/Block/Notification/Grid/Renderer/Notice.php +++ b/app/code/core/Mage/Adminhtml/Block/Notification/Grid/Renderer/Notice.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Notification/Grid/Renderer/Severity.php b/app/code/core/Mage/Adminhtml/Block/Notification/Grid/Renderer/Severity.php index bce8cb6a78fb0b33eaa7f63366340d967638cb08..bb34441c938cd226e008a6c6992e07f02218ff23 100644 --- a/app/code/core/Mage/Adminhtml/Block/Notification/Grid/Renderer/Severity.php +++ b/app/code/core/Mage/Adminhtml/Block/Notification/Grid/Renderer/Severity.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Notification/Inbox.php b/app/code/core/Mage/Adminhtml/Block/Notification/Inbox.php index e7a2d1c3d8aefdbcb4618e3473812adec5b46e0b..44d65654385f9fd5d04c94b4889c2da385ae1fbe 100644 --- a/app/code/core/Mage/Adminhtml/Block/Notification/Inbox.php +++ b/app/code/core/Mage/Adminhtml/Block/Notification/Inbox.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Notification/Security.php b/app/code/core/Mage/Adminhtml/Block/Notification/Security.php index 9459a83045b751e06634033dc425455c82dccdff..7e524804d6d095a3003c7f680b4d6fe6922d01c7 100644 --- a/app/code/core/Mage/Adminhtml/Block/Notification/Security.php +++ b/app/code/core/Mage/Adminhtml/Block/Notification/Security.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Notification/Survey.php b/app/code/core/Mage/Adminhtml/Block/Notification/Survey.php index b53b53f01d3121b0605728e486af7792867bf680..5401ca36344334c2ab3be05d7e2ecea1584191d8 100644 --- a/app/code/core/Mage/Adminhtml/Block/Notification/Survey.php +++ b/app/code/core/Mage/Adminhtml/Block/Notification/Survey.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Notification/Toolbar.php b/app/code/core/Mage/Adminhtml/Block/Notification/Toolbar.php index d95bf115e9773116fdaa7a48f6dfb2fbfff51718..a906da0d6fafaa020895400fe9542df9ad416957 100644 --- a/app/code/core/Mage/Adminhtml/Block/Notification/Toolbar.php +++ b/app/code/core/Mage/Adminhtml/Block/Notification/Toolbar.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Notification/Window.php b/app/code/core/Mage/Adminhtml/Block/Notification/Window.php index bba13e15d48b0b76be88e0ad8c99f93b60308770..5673b22ecec722e04576af210c478755a8d1ae22 100644 --- a/app/code/core/Mage/Adminhtml/Block/Notification/Window.php +++ b/app/code/core/Mage/Adminhtml/Block/Notification/Window.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Page.php b/app/code/core/Mage/Adminhtml/Block/Page.php index 308aa0745cc3a7e88a64e07bde5486badcc6d135..4b4e66d360e9942c8ca724c89968b8bdb27e3919 100644 --- a/app/code/core/Mage/Adminhtml/Block/Page.php +++ b/app/code/core/Mage/Adminhtml/Block/Page.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Page/Footer.php b/app/code/core/Mage/Adminhtml/Block/Page/Footer.php index 53c95b17eb489ba74ebb21acf5b95202bd998701..9a7282f0570c8e86d843a85fa0269eb9f3d5a875 100644 --- a/app/code/core/Mage/Adminhtml/Block/Page/Footer.php +++ b/app/code/core/Mage/Adminhtml/Block/Page/Footer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Page/Head.php b/app/code/core/Mage/Adminhtml/Block/Page/Head.php index d146d043daedd4977e5bb430d88a37d22fe94ad8..b654a150f94030c8532ec8951843f747528ba622 100644 --- a/app/code/core/Mage/Adminhtml/Block/Page/Head.php +++ b/app/code/core/Mage/Adminhtml/Block/Page/Head.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Page/Header.php b/app/code/core/Mage/Adminhtml/Block/Page/Header.php index 4e0a05826e3e74d6129e4b8b0bfdd6617054d0c8..4751e991680c2658df7ae557f5e294e1b186af45 100644 --- a/app/code/core/Mage/Adminhtml/Block/Page/Header.php +++ b/app/code/core/Mage/Adminhtml/Block/Page/Header.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Page/Menu.php b/app/code/core/Mage/Adminhtml/Block/Page/Menu.php index cf7fcc6acb7c140e2c184aea078de0114974e1b0..d4036a8c0a37b356d45e898ac602256c4ca9c219 100644 --- a/app/code/core/Mage/Adminhtml/Block/Page/Menu.php +++ b/app/code/core/Mage/Adminhtml/Block/Page/Menu.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Page/Notices.php b/app/code/core/Mage/Adminhtml/Block/Page/Notices.php index 4b9c4a9956647981d985749eee175b98fb328a8b..0ae1c05099941a30dc9974a88f8b16cd8f6ad3f3 100644 --- a/app/code/core/Mage/Adminhtml/Block/Page/Notices.php +++ b/app/code/core/Mage/Adminhtml/Block/Page/Notices.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Permissions/Buttons.php b/app/code/core/Mage/Adminhtml/Block/Permissions/Buttons.php index acfca95d5720c91e71469058a11ce70bf5c5f70a..b670116a6a13d9b4d1cf4116f85bd7fe22cb1f65 100644 --- a/app/code/core/Mage/Adminhtml/Block/Permissions/Buttons.php +++ b/app/code/core/Mage/Adminhtml/Block/Permissions/Buttons.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Permissions/Editroles.php b/app/code/core/Mage/Adminhtml/Block/Permissions/Editroles.php index f8147b8ff90756a272ecbf92a075aea52a1b13d9..d2f1eb7aaad6a2f70d68f2b564634d3e87a04cc5 100644 --- a/app/code/core/Mage/Adminhtml/Block/Permissions/Editroles.php +++ b/app/code/core/Mage/Adminhtml/Block/Permissions/Editroles.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Permissions/Grid/Role.php b/app/code/core/Mage/Adminhtml/Block/Permissions/Grid/Role.php index ab3cf3b5864182c44fb7751a5e3b12d0bd157916..d27fd8067ace1ba9807bea313b71862d02828913 100644 --- a/app/code/core/Mage/Adminhtml/Block/Permissions/Grid/Role.php +++ b/app/code/core/Mage/Adminhtml/Block/Permissions/Grid/Role.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Permissions/Grid/User.php b/app/code/core/Mage/Adminhtml/Block/Permissions/Grid/User.php index 82f4d069e539920ee14faeb42eb9f068c2264058..5e86970cea8973079124e953359fa86c914a295e 100644 --- a/app/code/core/Mage/Adminhtml/Block/Permissions/Grid/User.php +++ b/app/code/core/Mage/Adminhtml/Block/Permissions/Grid/User.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Permissions/Role.php b/app/code/core/Mage/Adminhtml/Block/Permissions/Role.php index b7ae80b7a3ccab31d37b43069078b837cbc777ec..6c43b2fb35dc02e3b15f63d8d80b36e85ebbc8d4 100644 --- a/app/code/core/Mage/Adminhtml/Block/Permissions/Role.php +++ b/app/code/core/Mage/Adminhtml/Block/Permissions/Role.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Permissions/Role/Grid/User.php b/app/code/core/Mage/Adminhtml/Block/Permissions/Role/Grid/User.php index 1458283d01a9d99031122a0e7a5560c6ab038084..52fee442a6fb1f5ab80441f0141e9d5042d20542 100644 --- a/app/code/core/Mage/Adminhtml/Block/Permissions/Role/Grid/User.php +++ b/app/code/core/Mage/Adminhtml/Block/Permissions/Role/Grid/User.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Permissions/Roles.php b/app/code/core/Mage/Adminhtml/Block/Permissions/Roles.php index 949593c76c81370accc3da9b50a3b4a100adfd34..dfda51c8974cddc7ba53c4eaa04def6805889621 100644 --- a/app/code/core/Mage/Adminhtml/Block/Permissions/Roles.php +++ b/app/code/core/Mage/Adminhtml/Block/Permissions/Roles.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Permissions/Tab/Roleinfo.php b/app/code/core/Mage/Adminhtml/Block/Permissions/Tab/Roleinfo.php index ca91a6017a362420386d650f6277e2ca02e48713..7c00eea95e2cb7801496cc4662443f2b4c2bf8b4 100644 --- a/app/code/core/Mage/Adminhtml/Block/Permissions/Tab/Roleinfo.php +++ b/app/code/core/Mage/Adminhtml/Block/Permissions/Tab/Roleinfo.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Permissions/Tab/Rolesedit.php b/app/code/core/Mage/Adminhtml/Block/Permissions/Tab/Rolesedit.php index 2c90761e477977d3ee073dd9064f251b87398e10..288dbd238102247f088e0fc19ab90c57a41c8bec 100644 --- a/app/code/core/Mage/Adminhtml/Block/Permissions/Tab/Rolesedit.php +++ b/app/code/core/Mage/Adminhtml/Block/Permissions/Tab/Rolesedit.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Permissions/Tab/Rolesusers.php b/app/code/core/Mage/Adminhtml/Block/Permissions/Tab/Rolesusers.php index 88f8bdbb5a59fa2a71d45c0ae23b2bd1e42d0085..db6289e7955ba457ece437099b092e0ca4864ec6 100644 --- a/app/code/core/Mage/Adminhtml/Block/Permissions/Tab/Rolesusers.php +++ b/app/code/core/Mage/Adminhtml/Block/Permissions/Tab/Rolesusers.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Permissions/Tab/Useredit.php b/app/code/core/Mage/Adminhtml/Block/Permissions/Tab/Useredit.php index 735a0280c83f2526e94fc8c4bdce19773f4427f6..43d93ab12823ba4501ccdb0a7319f143ddce5474 100644 --- a/app/code/core/Mage/Adminhtml/Block/Permissions/Tab/Useredit.php +++ b/app/code/core/Mage/Adminhtml/Block/Permissions/Tab/Useredit.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Adminhtml_Block_Permissions_Tab_Useredit extends Mage_Adminhtml_Block_Widget_Form diff --git a/app/code/core/Mage/Adminhtml/Block/Permissions/User.php b/app/code/core/Mage/Adminhtml/Block/Permissions/User.php index 12176e873256a3212a4e7ef47c7cc28ac718a0fa..1f4c302683bb9176deb5ea2cefcf9c10a7dde087 100644 --- a/app/code/core/Mage/Adminhtml/Block/Permissions/User.php +++ b/app/code/core/Mage/Adminhtml/Block/Permissions/User.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -42,4 +42,14 @@ class Mage_Adminhtml_Block_Permissions_User extends Mage_Adminhtml_Block_Widget_ parent::__construct(); } + /** + * Prepare output HTML + * + * @return string + */ + protected function _toHtml() + { + Mage::dispatchEvent('permissions_user_html_before', array('block' => $this)); + return parent::_toHtml(); + } } diff --git a/app/code/core/Mage/Adminhtml/Block/Permissions/User/Edit.php b/app/code/core/Mage/Adminhtml/Block/Permissions/User/Edit.php index 0298f781d9e02d544e25f9116d8fe2a79c669f74..5dd3aa5acdf4537e817e86f390ff99c59b818e83 100644 --- a/app/code/core/Mage/Adminhtml/Block/Permissions/User/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/Permissions/User/Edit.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Permissions/User/Edit/Form.php b/app/code/core/Mage/Adminhtml/Block/Permissions/User/Edit/Form.php index 30a834336f101e32e58ef4b5bc8e7db2f8a4d4ab..9dee15e75510d9782c69d7bf62cbc5d7082b222b 100644 --- a/app/code/core/Mage/Adminhtml/Block/Permissions/User/Edit/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Permissions/User/Edit/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Permissions/User/Edit/Tab/Main.php b/app/code/core/Mage/Adminhtml/Block/Permissions/User/Edit/Tab/Main.php index 29ccc8249c1d7008eede8d9a1e817178d10cfffc..d87cdf44111ec911180f4a30d0e3701db78af718 100644 --- a/app/code/core/Mage/Adminhtml/Block/Permissions/User/Edit/Tab/Main.php +++ b/app/code/core/Mage/Adminhtml/Block/Permissions/User/Edit/Tab/Main.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Permissions/User/Edit/Tab/Roles.php b/app/code/core/Mage/Adminhtml/Block/Permissions/User/Edit/Tab/Roles.php index 7ee6c07a7c46193af53e8f9a4cd6a7269f2152b7..0d9f8061267cc11bf92ff62094a3bf3ac1935668 100644 --- a/app/code/core/Mage/Adminhtml/Block/Permissions/User/Edit/Tab/Roles.php +++ b/app/code/core/Mage/Adminhtml/Block/Permissions/User/Edit/Tab/Roles.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Permissions/User/Edit/Tabs.php b/app/code/core/Mage/Adminhtml/Block/Permissions/User/Edit/Tabs.php index f2c98e04788c5bec9efda735438c7522bcf012bb..1758bdc2af05c47a97074f945bb96d8735457150 100644 --- a/app/code/core/Mage/Adminhtml/Block/Permissions/User/Edit/Tabs.php +++ b/app/code/core/Mage/Adminhtml/Block/Permissions/User/Edit/Tabs.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Permissions/User/Grid.php b/app/code/core/Mage/Adminhtml/Block/Permissions/User/Grid.php index 4b6d78a307c0ff2716ce4e51d5c5166d90d7aee0..f92b9b03d8fdc2035fd70fad9dfd9058d9f64bca 100644 --- a/app/code/core/Mage/Adminhtml/Block/Permissions/User/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Permissions/User/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Permissions/Users.php b/app/code/core/Mage/Adminhtml/Block/Permissions/Users.php index 5ed922866afeebe0346220f9c5e3c2473e20457a..3d7fb972b97ce2dcc215ab88137c8d008f058986 100644 --- a/app/code/core/Mage/Adminhtml/Block/Permissions/Users.php +++ b/app/code/core/Mage/Adminhtml/Block/Permissions/Users.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Poll/Answer/Edit.php b/app/code/core/Mage/Adminhtml/Block/Poll/Answer/Edit.php index 81c302f3444da1302f773423041b72b82af353f1..6743578dc20f04b89eab20c2af507d6d511cba5d 100644 --- a/app/code/core/Mage/Adminhtml/Block/Poll/Answer/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/Poll/Answer/Edit.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Poll/Answer/Edit/Form.php b/app/code/core/Mage/Adminhtml/Block/Poll/Answer/Edit/Form.php index 4f9489bb1d3219f8e81943078effe2a7a4711ffd..2cd67b1d9219fe5523f4bd56319300d625ef497c 100644 --- a/app/code/core/Mage/Adminhtml/Block/Poll/Answer/Edit/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Poll/Answer/Edit/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Poll/Edit.php b/app/code/core/Mage/Adminhtml/Block/Poll/Edit.php index 20c8a95dc94099e8e2ea5aaf434b7fa59ed40729..eac54f7fbd89d26c1ca6786597d03ae12f61f468 100644 --- a/app/code/core/Mage/Adminhtml/Block/Poll/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/Poll/Edit.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Poll/Edit/Form.php b/app/code/core/Mage/Adminhtml/Block/Poll/Edit/Form.php index 51bc2dc972fb244bc271c1ef88bc6c57926d66d4..476bfc7f9cd83a775fa102dc66174dadf4397617 100644 --- a/app/code/core/Mage/Adminhtml/Block/Poll/Edit/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Poll/Edit/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Poll/Edit/Tab/Answers.php b/app/code/core/Mage/Adminhtml/Block/Poll/Edit/Tab/Answers.php index 5935a96294365bd7b1aea6d0b1134a7471987576..8d344d5b2a3d9119681d6916371724841992f9fa 100644 --- a/app/code/core/Mage/Adminhtml/Block/Poll/Edit/Tab/Answers.php +++ b/app/code/core/Mage/Adminhtml/Block/Poll/Edit/Tab/Answers.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Poll/Edit/Tab/Answers/Form.php b/app/code/core/Mage/Adminhtml/Block/Poll/Edit/Tab/Answers/Form.php index db96bcf4fbb4546b4c818e6c56c1c9957ff4440a..640b44008b9c119f76914965d11d09a67272896d 100644 --- a/app/code/core/Mage/Adminhtml/Block/Poll/Edit/Tab/Answers/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Poll/Edit/Tab/Answers/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Poll/Edit/Tab/Answers/Grid.php b/app/code/core/Mage/Adminhtml/Block/Poll/Edit/Tab/Answers/Grid.php index 68a118d4ae261c91eb596348781e21df90df16da..93a7eb8fa307c0d066bdcd9770e5c4cebe2a65ad 100644 --- a/app/code/core/Mage/Adminhtml/Block/Poll/Edit/Tab/Answers/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Poll/Edit/Tab/Answers/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Poll/Edit/Tab/Answers/List.php b/app/code/core/Mage/Adminhtml/Block/Poll/Edit/Tab/Answers/List.php index 01685ff866b0e7ec321fc16530fcdcbe4f69e289..120c51482a643527322b1298905a4c8bb249a318 100644 --- a/app/code/core/Mage/Adminhtml/Block/Poll/Edit/Tab/Answers/List.php +++ b/app/code/core/Mage/Adminhtml/Block/Poll/Edit/Tab/Answers/List.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Poll/Edit/Tab/Form.php b/app/code/core/Mage/Adminhtml/Block/Poll/Edit/Tab/Form.php index bfec8b8d441900af30b08266fba1a1ae3f7bed7e..4a753879f3cf1b4ecc48d4ba00e2d0dda2c59123 100644 --- a/app/code/core/Mage/Adminhtml/Block/Poll/Edit/Tab/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Poll/Edit/Tab/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -68,7 +68,8 @@ class Mage_Adminhtml_Block_Poll_Edit_Tab_Form extends Mage_Adminhtml_Block_Widge 'required' => true, 'name' => 'store_ids[]', 'values' => Mage::getSingleton('Mage_Adminhtml_Model_System_Store')->getStoreValuesForForm(), - 'value' => Mage::registry('poll_data')->getStoreIds() + 'value' => Mage::registry('poll_data')->getStoreIds(), + 'after_element_html' => Mage::getBlockSingleton('Mage_Adminhtml_Block_Store_Switcher')->getHintHtml() )); } else { diff --git a/app/code/core/Mage/Adminhtml/Block/Poll/Edit/Tabs.php b/app/code/core/Mage/Adminhtml/Block/Poll/Edit/Tabs.php index 29720ea02af8e2df052f79eb1beb33dc6cc34ea6..5686acbb97376d32c460ee63206b4a1cbf870ebe 100644 --- a/app/code/core/Mage/Adminhtml/Block/Poll/Edit/Tabs.php +++ b/app/code/core/Mage/Adminhtml/Block/Poll/Edit/Tabs.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Poll/Grid.php b/app/code/core/Mage/Adminhtml/Block/Poll/Grid.php index fc35b18dcd3e49701fe59f004fc9af64768f204c..62b12e5812f7535abde24f6e4d2dff52665b303f 100644 --- a/app/code/core/Mage/Adminhtml/Block/Poll/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Poll/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Poll/Poll.php b/app/code/core/Mage/Adminhtml/Block/Poll/Poll.php index 644aaffc5e5c5372a211f8c7a8f03c10b4da2919..719c660028823a70234cc41f2ddbf61035a4dcea 100644 --- a/app/code/core/Mage/Adminhtml/Block/Poll/Poll.php +++ b/app/code/core/Mage/Adminhtml/Block/Poll/Poll.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Promo/Catalog.php b/app/code/core/Mage/Adminhtml/Block/Promo/Catalog.php index 6438342ff1ac61e5883d6dbcd7939f6a7772a69b..ddd75e0a051b31bbd2a89454671c313b3d94b92e 100644 --- a/app/code/core/Mage/Adminhtml/Block/Promo/Catalog.php +++ b/app/code/core/Mage/Adminhtml/Block/Promo/Catalog.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Edit.php b/app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Edit.php index cc7efdff6b9b7cb7fbce7e4e6c5ccb278548220a..aaeb523be9f69d769c2bf459c86e9f98f8de1279 100644 --- a/app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Edit.php @@ -20,22 +20,22 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ /** - * description - * - * @category Mage - * @category Mage - * @package Mage_Adminhtml - * @author Magento Core Team <core@magentocommerce.com> + * Catalog rule edit form block */ class Mage_Adminhtml_Block_Promo_Catalog_Edit extends Mage_Adminhtml_Block_Widget_Form_Container { - + /** + * Initialize form + * Add standard buttons + * Add "Save and Apply" button + * Add "Save and Continue" button + */ public function __construct() { $this->_objectId = 'id'; @@ -43,33 +43,24 @@ class Mage_Adminhtml_Block_Promo_Catalog_Edit extends Mage_Adminhtml_Block_Widge parent::__construct(); - $this->_updateButton('save', 'label', Mage::helper('Mage_CatalogRule_Helper_Data')->__('Save Rule')); - $this->_updateButton('delete', 'label', Mage::helper('Mage_CatalogRule_Helper_Data')->__('Delete Rule')); - - $rule = Mage::registry('current_promo_catalog_rule'); - - if (!$rule || !$rule->isDeleteable()) { - $this->_removeButton('delete'); - } + $this->_addButton('save_apply', array( + 'class' => 'save', + 'label' => Mage::helper('Mage_CatalogRule_Helper_Data')->__('Save and Apply'), + 'onclick' => "$('rule_auto_apply').value=1; editForm.submit()", + )); - if (!$rule || !$rule->isReadonly()) { - $this->_addButton('save_apply', array( - 'class'=>'save', - 'label'=>Mage::helper('Mage_CatalogRule_Helper_Data')->__('Save and Apply'), - 'onclick'=>"$('rule_auto_apply').value=1; editForm.submit()", - )); - $this->_addButton('save_and_continue', array( - 'label' => Mage::helper('Mage_CatalogRule_Helper_Data')->__('Save and Continue Edit'), - 'onclick' => 'saveAndContinueEdit()', - 'class' => 'save' - ), 10); - $this->_formScripts[] = " function saveAndContinueEdit(){ editForm.submit($('edit_form').action + 'back/edit/') } "; - } else { - $this->_removeButton('reset'); - $this->_removeButton('save'); - } + $this->_addButton('save_and_continue_edit', array( + 'class' => 'save', + 'label' => Mage::helper('Mage_CatalogRule_Helper_Data')->__('Save and Continue Edit'), + 'onclick' => 'editForm.submit($(\'edit_form\').action + \'back/edit/\')', + ), 10); } + /** + * Getter for form header text + * + * @return string + */ public function getHeaderText() { $rule = Mage::registry('current_promo_catalog_rule'); diff --git a/app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Edit/Form.php b/app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Edit/Form.php index 559df8e80b0eb47030ef32ed987caa3abfa3ed86..a8d3203f3cff0db96677160abd4d4d227e5d10e4 100644 --- a/app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Edit/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Edit/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Edit/Js.php b/app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Edit/Js.php index 34cee5950f23cc26e48928114885bef5af48fa31..5cfdd3dee02ac34e942a75a024e4728b5d16c0f6 100644 --- a/app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Edit/Js.php +++ b/app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Edit/Js.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Edit/Tab/Actions.php b/app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Edit/Tab/Actions.php index c97bbb087c33ec75ee7d2afcad2753ef8da92088..6335dc445a722a2cf1f2f6c995c04b055061ca61 100644 --- a/app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Edit/Tab/Actions.php +++ b/app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Edit/Tab/Actions.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Edit/Tab/Conditions.php b/app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Edit/Tab/Conditions.php index 94dd87dbdf9d146da7cd51430c7bc1535adad1aa..d7676cfbb0ce28419ff3f49f60115cd46bc85621 100644 --- a/app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Edit/Tab/Conditions.php +++ b/app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Edit/Tab/Conditions.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Edit/Tab/Main.php b/app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Edit/Tab/Main.php index 0c5ac36d6d9fe24149b8e7df71a5f3478bf9b2ea..d1df446b14a6b2c6e41b5c21cbc5b784dcd946c4 100644 --- a/app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Edit/Tab/Main.php +++ b/app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Edit/Tab/Main.php @@ -20,17 +20,16 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ /** - * description + * Catalog Rule General Information Tab * - * @category Mage - * @category Mage - * @package Mage_Adminhtml - * @author Magento Core Team <core@magentocommerce.com> + * @category Mage + * @package Mage_Adminhtml + * @author Magento Core Team <core@magentocommerce.com> */ class Mage_Adminhtml_Block_Promo_Catalog_Edit_Tab_Main extends Mage_Adminhtml_Block_Widget_Form @@ -57,7 +56,7 @@ class Mage_Adminhtml_Block_Promo_Catalog_Edit_Tab_Main } /** - * Returns status flag about this tab can be showen or not + * Returns status flag about this tab can be showed or not * * @return true */ @@ -84,7 +83,9 @@ class Mage_Adminhtml_Block_Promo_Catalog_Edit_Tab_Main $form->setHtmlIdPrefix('rule_'); - $fieldset = $form->addFieldset('base_fieldset', array('legend'=>Mage::helper('Mage_CatalogRule_Helper_Data')->__('General Information'))); + $fieldset = $form->addFieldset('base_fieldset', + array('legend '=> Mage::helper('Mage_CatalogRule_Helper_Data')->__('General Information')) + ); $fieldset->addField('auto_apply', 'hidden', array( 'name' => 'auto_apply', @@ -121,34 +122,21 @@ class Mage_Adminhtml_Block_Promo_Catalog_Edit_Tab_Main ), )); - if (!Mage::app()->isSingleStoreMode()) { + if (Mage::app()->isSingleStoreMode()) { + $websiteId = Mage::app()->getStore(true)->getWebsiteId(); + $fieldset->addField('website_ids', 'hidden', array( + 'name' => 'website_ids[]', + 'value' => $websiteId + )); + $model->setWebsiteIds($websiteId); + } else { $fieldset->addField('website_ids', 'multiselect', array( - 'name' => 'website_ids[]', + 'name' => 'website_ids[]', 'label' => Mage::helper('Mage_CatalogRule_Helper_Data')->__('Websites'), 'title' => Mage::helper('Mage_CatalogRule_Helper_Data')->__('Websites'), - 'required' => true, - 'values' => Mage::getSingleton('Mage_Adminhtml_Model_System_Config_Source_Website')->toOptionArray(), - )); - } - else { - $fieldset->addField('website_ids', 'hidden', array( - 'name' => 'website_ids[]', - 'value' => Mage::app()->getStore(true)->getWebsiteId() + 'required' => true, + 'values' => Mage::getSingleton('Mage_Adminhtml_Model_System_Store')->getWebsiteValuesForForm() )); - $model->setWebsiteIds(Mage::app()->getStore(true)->getWebsiteId()); - } - - $customerGroups = Mage::getResourceModel('Mage_Customer_Model_Resource_Group_Collection') - ->load()->toOptionArray(); - - $found = false; - foreach ($customerGroups as $group) { - if ($group['value']==0) { - $found = true; - } - } - if (!$found) { - array_unshift($customerGroups, array('value'=>0, 'label'=>Mage::helper('Mage_CatalogRule_Helper_Data')->__('NOT LOGGED IN'))); } $fieldset->addField('customer_group_ids', 'multiselect', array( @@ -156,7 +144,7 @@ class Mage_Adminhtml_Block_Promo_Catalog_Edit_Tab_Main 'label' => Mage::helper('Mage_CatalogRule_Helper_Data')->__('Customer Groups'), 'title' => Mage::helper('Mage_CatalogRule_Helper_Data')->__('Customer Groups'), 'required' => true, - 'values' => $customerGroups, + 'values' => Mage::getResourceModel('Mage_Customer_Model_Resource_Group_Collection')->toOptionArray() )); $dateFormatIso = Mage::app()->getLocale()->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT); diff --git a/app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Edit/Tabs.php b/app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Edit/Tabs.php index 007f8e1018c8c2fe4605853443f8fd9ad5fbed86..acaa5dc92b6b65c9716a706112d6a2c247c971b8 100644 --- a/app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Edit/Tabs.php +++ b/app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Edit/Tabs.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Grid.php b/app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Grid.php index 6050519c40ecf18e1d58669d45c772a54f0e0a20..50a4e6e974a829b73379929860f39f03abf9ccc5 100644 --- a/app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Grid.php @@ -20,21 +20,23 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ /** - * description + * Catalog Rules Grid * - * @category Mage - * @category Mage - * @package Mage_Adminhtml - * @author Magento Core Team <core@magentocommerce.com> + * @category Mage + * @package Mage_Adminhtml + * @author Magento Core Team <core@magentocommerce.com> */ class Mage_Adminhtml_Block_Promo_Catalog_Grid extends Mage_Adminhtml_Block_Widget_Grid { - + /** + * Initialize grid + * Set sort settings + */ public function __construct() { parent::__construct(); @@ -44,14 +46,29 @@ class Mage_Adminhtml_Block_Promo_Catalog_Grid extends Mage_Adminhtml_Block_Widge $this->setSaveParametersInSession(true); } + /** + * Add websites to catalog rules collection + * Set collection + * + * @return Mage_Adminhtml_Block_Promo_Catalog_Grid + */ protected function _prepareCollection() { + /** @var $collection Mage_CatalogRule_Model_Resource_Rule_Collection */ $collection = Mage::getModel('Mage_CatalogRule_Model_Rule') ->getResourceCollection(); + $collection->addWebsitesToResult(); $this->setCollection($collection); - return parent::_prepareCollection(); + + parent::_prepareCollection(); + return $this; } + /** + * Add grid columns + * + * @return Mage_Adminhtml_Block_Promo_Catalog_Grid + */ protected function _prepareColumns() { $this->addColumn('rule_id', array( @@ -96,9 +113,29 @@ class Mage_Adminhtml_Block_Promo_Catalog_Grid extends Mage_Adminhtml_Block_Widge ), )); - return parent::_prepareColumns(); + if (!Mage::app()->isSingleStoreMode()) { + $this->addColumn('rule_website', array( + 'header' => Mage::helper('Mage_CatalogRule_Helper_Data')->__('Website'), + 'align' =>'left', + 'index' => 'website_ids', + 'type' => 'options', + 'sortable' => false, + 'options' => Mage::getSingleton('Mage_Adminhtml_Model_System_Store')->getWebsiteOptionHash(), + 'width' => 200, + )); + } + + parent::_prepareColumns(); + return $this; } + /** + * Retrieve row click URL + * + * @param Varien_Object $row + * + * @return string + */ public function getRowUrl($row) { return $this->getUrl('*/*/edit', array('id' => $row->getRuleId())); diff --git a/app/code/core/Mage/Adminhtml/Block/Promo/Quote.php b/app/code/core/Mage/Adminhtml/Block/Promo/Quote.php index c574c2e9e0af4c36b35b4a3c448e85ccdc5d2e7e..d18fdd616e57bbfb8b00fbf678e156be461283f0 100644 --- a/app/code/core/Mage/Adminhtml/Block/Promo/Quote.php +++ b/app/code/core/Mage/Adminhtml/Block/Promo/Quote.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit.php b/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit.php index 6e0582d23fa2c399b2aae93bf0337645d7644eee..39b76c15d21422c831aaf3d652dc714340707114 100644 --- a/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit.php @@ -20,22 +20,22 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ /** - * description - * - * @category Mage - * @category Mage - * @package Mage_Adminhtml - * @author Magento Core Team <core@magentocommerce.com> + * Shopping cart rule edit form block */ class Mage_Adminhtml_Block_Promo_Quote_Edit extends Mage_Adminhtml_Block_Widget_Form_Container { + /** + * Initialize form + * Add standard buttons + * Add "Save and Continue" button + */ public function __construct() { $this->_objectId = 'id'; @@ -43,30 +43,18 @@ class Mage_Adminhtml_Block_Promo_Quote_Edit extends Mage_Adminhtml_Block_Widget_ parent::__construct(); - $this->_updateButton('save', 'label', Mage::helper('Mage_SalesRule_Helper_Data')->__('Save Rule')); - $this->_updateButton('delete', 'label', Mage::helper('Mage_SalesRule_Helper_Data')->__('Delete Rule')); - - $rule = Mage::registry('current_promo_quote_rule'); - - if (!$rule || !$rule->isDeleteable()) { - $this->_removeButton('delete'); - } - - if ($rule && $rule->isReadonly()) { - $this->_removeButton('save'); - $this->_removeButton('reset'); - } else { - $this->_addButton('save_and_continue', array( - 'label' => Mage::helper('Mage_SalesRule_Helper_Data')->__('Save and Continue Edit'), - 'onclick' => 'saveAndContinueEdit()', - 'class' => 'save' - ), 10); - $this->_formScripts[] = " function saveAndContinueEdit(){ editForm.submit($('edit_form').action + 'back/edit/') } "; - } - - #$this->setTemplate('promo/quote/edit.phtml'); + $this->_addButton('save_and_continue_edit', array( + 'class' => 'save', + 'label' => Mage::helper('Mage_SalesRule_Helper_Data')->__('Save and Continue Edit'), + 'onclick' => 'editForm.submit($(\'edit_form\').action + \'back/edit/\')', + ), 10); } + /** + * Getter for form header text + * + * @return string + */ public function getHeaderText() { $rule = Mage::registry('current_promo_quote_rule'); @@ -78,6 +66,11 @@ class Mage_Adminhtml_Block_Promo_Quote_Edit extends Mage_Adminhtml_Block_Widget_ } } + /** + * Retrieve products JSON + * + * @return string + */ public function getProductsJson() { return '{}'; diff --git a/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Form.php b/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Form.php index 2115c3941c3b52c68c052f50a58c5a16347d11f9..468c63a2714fb78ca1265b6ac73d15b9e18d79bb 100644 --- a/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Actions.php b/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Actions.php index d085c232e300034ab2e237956c8339312f42c072..44139c3263c063f07aabac08cdad91f22a1649e5 100644 --- a/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Actions.php +++ b/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Actions.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Conditions.php b/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Conditions.php index e4e7ecf1a6fb89df418049ea553679193827dfe4..0cf071b6976e4024eb8242dcee82622e23b64953 100644 --- a/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Conditions.php +++ b/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Conditions.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Coupons.php b/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Coupons.php new file mode 100644 index 0000000000000000000000000000000000000000..2f778e2188b0966624266d0297c8cfb1667fd745 --- /dev/null +++ b/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Coupons.php @@ -0,0 +1,88 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Adminhtml + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * "Manage Coupons Codes" Tab + * + * @category Mage + * @package Mage_Adminhtml + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Adminhtml_Block_Promo_Quote_Edit_Tab_Coupons + extends Mage_Adminhtml_Block_Text_List + implements Mage_Adminhtml_Block_Widget_Tab_Interface +{ + /** + * Prepare content for tab + * + * @return string + */ + public function getTabLabel() + { + return Mage::helper('Mage_SalesRule_Helper_Data')->__('Manage Coupon Codes'); + } + + /** + * Prepare title for tab + * + * @return string + */ + public function getTabTitle() + { + return Mage::helper('Mage_SalesRule_Helper_Data')->__('Manage Coupon Codes'); + } + + /** + * Returns status flag about this tab can be shown or not + * + * @return bool + */ + public function canShowTab() + { + return $this->_isEditing(); + } + + /** + * Returns status flag about this tab hidden or not + * + * @return bool + */ + public function isHidden() + { + return !$this->_isEditing(); + } + + /** + * Check whether we edit existing rule or adding new one + * + * @return bool + */ + protected function _isEditing() + { + $priceRule = Mage::registry('current_promo_quote_rule'); + return !is_null($priceRule->getRuleId()); + } +} diff --git a/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Coupons/Form.php b/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Coupons/Form.php new file mode 100644 index 0000000000000000000000000000000000000000..78a5d4fdabdf0e163fb05e888526910d08acc982 --- /dev/null +++ b/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Coupons/Form.php @@ -0,0 +1,147 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Adminhtml + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + + +/** + * Coupons generation parameters form + * + * @category Mage + * @package Mage_Adminhtml + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Adminhtml_Block_Promo_Quote_Edit_Tab_Coupons_Form + extends Mage_Adminhtml_Block_Widget_Form +{ + /** + * Prepare coupon codes generation parameters form + * + * @return Mage_Adminhtml_Block_Widget_Form + */ + protected function _prepareForm() + { + $form = new Varien_Data_Form(); + + /** + * @var Mage_SalesRule_Helper_Coupon $couponHelper + */ + $couponHelper = Mage::helper('Mage_SalesRule_Helper_Coupon'); + + $model = Mage::registry('current_promo_quote_rule'); + $ruleId = $model->getId(); + + $form->setHtmlIdPrefix('coupons_'); + + $gridBlock = $this->getLayout()->getBlock('promo_quote_edit_tab_coupons_grid'); + $gridBlockJsObject = ''; + if ($gridBlock) { + $gridBlockJsObject = $gridBlock->getJsObjectName(); + } + + $fieldset = $form->addFieldset('information_fieldset', array('legend'=>Mage::helper('Mage_SalesRule_Helper_Data')->__('Coupons Information'))); + $fieldset->addClass('ignore-validate'); + + $fieldset->addField('rule_id', 'hidden', array( + 'name' => 'rule_id', + 'value' => $ruleId + )); + + $fieldset->addField('qty', 'text', array( + 'name' => 'qty', + 'label' => Mage::helper('Mage_SalesRule_Helper_Data')->__('Coupon Qty'), + 'title' => Mage::helper('Mage_SalesRule_Helper_Data')->__('Coupon Qty'), + 'required' => true, + 'class' => 'validate-digits validate-greater-than-zero' + )); + + $fieldset->addField('length', 'text', array( + 'name' => 'length', + 'label' => Mage::helper('Mage_SalesRule_Helper_Data')->__('Code Length'), + 'title' => Mage::helper('Mage_SalesRule_Helper_Data')->__('Code Length'), + 'required' => true, + 'note' => Mage::helper('Mage_SalesRule_Helper_Data')->__('Excluding prefix, suffix and separators.'), + 'value' => $couponHelper->getDefaultLength(), + 'class' => 'validate-digits validate-greater-than-zero' + )); + + $fieldset->addField('format', 'select', array( + 'label' => Mage::helper('Mage_SalesRule_Helper_Data')->__('Code Format'), + 'name' => 'format', + 'options' => $couponHelper->getFormatsList(), + 'required' => true, + 'value' => $couponHelper->getDefaultFormat() + )); + + $fieldset->addField('prefix', 'text', array( + 'name' => 'prefix', + 'label' => Mage::helper('Mage_SalesRule_Helper_Data')->__('Code Prefix'), + 'title' => Mage::helper('Mage_SalesRule_Helper_Data')->__('Code Prefix'), + 'value' => $couponHelper->getDefaultPrefix() + )); + + $fieldset->addField('suffix', 'text', array( + 'name' => 'suffix', + 'label' => Mage::helper('Mage_SalesRule_Helper_Data')->__('Code Suffix'), + 'title' => Mage::helper('Mage_SalesRule_Helper_Data')->__('Code Suffix'), + 'value' => $couponHelper->getDefaultSuffix() + )); + + $fieldset->addField('dash', 'text', array( + 'name' => 'dash', + 'label' => Mage::helper('Mage_SalesRule_Helper_Data')->__('Dash Every X Characters'), + 'title' => Mage::helper('Mage_SalesRule_Helper_Data')->__('Dash Every X Characters'), + 'note' => Mage::helper('Mage_SalesRule_Helper_Data')->__('If empty no separation.'), + 'value' => $couponHelper->getDefaultDashInterval(), + 'class' => 'validate-digits' + )); + + $idPrefix = $form->getHtmlIdPrefix(); + $generateUrl = $this->getGenerateUrl(); + + $fieldset->addField('generate_button', 'note', array( + 'text' => $this->getButtonHtml( + Mage::helper('Mage_SalesRule_Helper_Data')->__('Generate'), + "generateCouponCodes('{$idPrefix}' ,'{$generateUrl}', '{$gridBlockJsObject}')", + 'generate' + ) + )); + + $this->setForm($form); + + Mage::dispatchEvent('adminhtml_promo_quote_edit_tab_coupons_form_prepare_form', array('form' => $form)); + + return parent::_prepareForm(); + } + + /** + * Retrieve URL to Generate Action + * + * @return string + */ + public function getGenerateUrl() + { + return $this->getUrl('*/*/generate'); + } +} diff --git a/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Coupons/Grid.php b/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Coupons/Grid.php new file mode 100644 index 0000000000000000000000000000000000000000..104f0707ed8fbe65d5d62d921b9b9f0a5a6a2f29 --- /dev/null +++ b/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Coupons/Grid.php @@ -0,0 +1,146 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Adminhtml + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + + +/** + * Coupon codes grid + * + * @category Mage + * @package Mage_Adminhtml + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Adminhtml_Block_Promo_Quote_Edit_Tab_Coupons_Grid extends Mage_Adminhtml_Block_Widget_Grid +{ + /** + * Constructor + */ + public function __construct() + { + parent::__construct(); + $this->setId('couponCodesGrid'); + $this->setUseAjax(true); + } + + /** + * Prepare collection for grid + * + * @return Mage_Adminhtml_Block_Widget_Grid + */ + protected function _prepareCollection() + { + $priceRule = Mage::registry('current_promo_quote_rule'); + + /** + * @var Mage_SalesRule_Model_Resource_Coupon_Collection $collection + */ + $collection = Mage::getResourceModel('Mage_SalesRule_Model_Resource_Coupon_Collection') + ->addRuleToFilter($priceRule) + ->addGeneratedCouponsFilter(); + + $this->setCollection($collection); + + return parent::_prepareCollection(); + } + + /** + * Define grid columns + * + * @return Mage_Adminhtml_Block_Widget_Grid + */ + protected function _prepareColumns() + { + $this->addColumn('code', array( + 'header' => Mage::helper('Mage_SalesRule_Helper_Data')->__('Coupon Code'), + 'index' => 'code' + )); + + $this->addColumn('created_at', array( + 'header' => Mage::helper('Mage_SalesRule_Helper_Data')->__('Created On'), + 'index' => 'created_at', + 'type' => 'datetime', + 'align' => 'center', + 'width' => '160' + )); + + $this->addColumn('used', array( + 'header' => Mage::helper('Mage_SalesRule_Helper_Data')->__('Used'), + 'index' => 'times_used', + 'width' => '100', + 'type' => 'options', + 'options' => array( + Mage::helper('Mage_Adminhtml_Helper_Data')->__('No'), + Mage::helper('Mage_Adminhtml_Helper_Data')->__('Yes') + ), + 'renderer' => 'adminhtml/promo_quote_edit_tab_coupons_grid_column_renderer_used', + 'filter_condition_callback' => array( + Mage::getResourceModel('Mage_SalesRule_Model_Resource_Coupon_Collection'), 'addIsUsedFilterCallback' + ) + )); + + $this->addColumn('times_used', array( + 'header' => Mage::helper('Mage_SalesRule_Helper_Data')->__('Times Used'), + 'index' => 'times_used', + 'width' => '50', + 'type' => 'number', + )); + + $this->addExportType('*/*/exportCouponsCsv', Mage::helper('Mage_Customer_Helper_Data')->__('CSV')); + $this->addExportType('*/*/exportCouponsXml', Mage::helper('Mage_Customer_Helper_Data')->__('Excel XML')); + return parent::_prepareColumns(); + } + + /** + * Configure grid mass actions + * + * @return Mage_Adminhtml_Block_Promo_Quote_Edit_Tab_Coupons_Grid + */ + protected function _prepareMassaction() + { + $this->setMassactionIdField('coupon_id'); + $this->getMassactionBlock()->setFormFieldName('ids'); + $this->getMassactionBlock()->setUseAjax(true); + $this->getMassactionBlock()->setHideFormElement(true); + + $this->getMassactionBlock()->addItem('delete', array( + 'label'=> Mage::helper('Mage_Adminhtml_Helper_Data')->__('Delete'), + 'url' => $this->getUrl('*/*/couponsMassDelete', array('_current' => true)), + 'confirm' => Mage::helper('Mage_SalesRule_Helper_Data')->__('Are you sure you want to delete the selected coupon(s)?'), + 'complete' => 'refreshCouponCodesGrid' + )); + + return $this; + } + + /** + * Get grid url + * + * @return string + */ + public function getGridUrl() + { + return $this->getUrl('*/*/couponsGrid', array('_current'=> true)); + } +} diff --git a/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Coupons/Grid/Column/Renderer/Used.php b/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Coupons/Grid/Column/Renderer/Used.php new file mode 100755 index 0000000000000000000000000000000000000000..42a6e3341b9c501e167f11ca3516dae749b445c0 --- /dev/null +++ b/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Coupons/Grid/Column/Renderer/Used.php @@ -0,0 +1,42 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Adminhtml + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Coupon codes grid "Used" column renderer + * + * @category Mage + * @package Mage_Adminhtml + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Adminhtml_Block_Promo_Quote_Edit_Tab_Coupons_Grid_Column_Renderer_Used + extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Text +{ + public function render(Varien_Object $row) + { + $value = (int)$row->getData($this->getColumn()->getIndex()); + return empty($value) ? Mage::helper('Mage_Adminhtml_Helper_Data')->__('No') : Mage::helper('Mage_Adminhtml_Helper_Data')->__('Yes'); + } +} \ No newline at end of file diff --git a/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Labels.php b/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Labels.php index 672aec25cf2faf6a8bc854ce4e2648bb1b59cc9d..361689760f588b3a6ad12f0166f7de604ba4eb6b 100644 --- a/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Labels.php +++ b/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Labels.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -89,6 +89,9 @@ class Mage_Adminhtml_Block_Promo_Quote_Edit_Tab_Labels 'legend' => Mage::helper('Mage_SalesRule_Helper_Data')->__('Store View Specific Labels'), 'table_class' => 'form-list stores-tree', )); + $renderer = $this->getLayout()->createBlock('Mage_Adminhtml_Block_Store_Switcher_Form_Renderer_Fieldset'); + $fieldset->setRenderer($renderer); + foreach (Mage::app()->getWebsites() as $website) { $fieldset->addField("w_{$website->getId()}_label", 'note', array( 'label' => $website->getName(), diff --git a/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Main.php b/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Main.php index 0d0062c1676aa57ce6b16c85bc60f6e2829a5ea8..90c16d4e8a974f2f2bd21469ed0c9769dfc20bc5 100644 --- a/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Main.php +++ b/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Main.php @@ -20,17 +20,16 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ /** - * description + * Shopping Cart Price Rule General Information Tab * - * @category Mage - * @category Mage - * @package Mage_Adminhtml - * @author Magento Core Team <core@magentocommerce.com> + * @category Mage + * @package Mage_Adminhtml + * @author Magento Core Team <core@magentocommerce.com> */ class Mage_Adminhtml_Block_Promo_Quote_Edit_Tab_Main extends Mage_Adminhtml_Block_Widget_Form @@ -57,7 +56,7 @@ class Mage_Adminhtml_Block_Promo_Quote_Edit_Tab_Main } /** - * Returns status flag about this tab can be showen or not + * Returns status flag about this tab can be showed or not * * @return true */ @@ -80,14 +79,11 @@ class Mage_Adminhtml_Block_Promo_Quote_Edit_Tab_Main { $model = Mage::registry('current_promo_quote_rule'); - //$form = new Varien_Data_Form(array('id' => 'edit_form1', 'action' => $this->getData('action'), 'method' => 'post')); $form = new Varien_Data_Form(); - $form->setHtmlIdPrefix('rule_'); - $fieldset = $form->addFieldset( - 'base_fieldset', - array('legend'=>Mage::helper('Mage_SalesRule_Helper_Data')->__('General Information')) + $fieldset = $form->addFieldset('base_fieldset', + array('legend' => Mage::helper('Mage_SalesRule_Helper_Data')->__('General Information')) ); if ($model->getId()) { @@ -124,39 +120,41 @@ class Mage_Adminhtml_Block_Promo_Quote_Edit_Tab_Main '0' => Mage::helper('Mage_SalesRule_Helper_Data')->__('Inactive'), ), )); + if (!$model->getId()) { $model->setData('is_active', '1'); } - - if (!Mage::app()->isSingleStoreMode()) { - $fieldset->addField('website_ids', 'multiselect', array( - 'name' => 'website_ids[]', - 'label' => Mage::helper('Mage_CatalogRule_Helper_Data')->__('Websites'), - 'title' => Mage::helper('Mage_CatalogRule_Helper_Data')->__('Websites'), - 'required' => true, - 'values' => Mage::getSingleton('Mage_Adminhtml_Model_System_Config_Source_Website')->toOptionArray(), - )); - } - else { + if (Mage::app()->isSingleStoreMode()) { + $websiteId = Mage::app()->getStore(true)->getWebsiteId(); $fieldset->addField('website_ids', 'hidden', array( - 'name' => 'website_ids[]', - 'value' => Mage::app()->getStore(true)->getWebsiteId() + 'name' => 'website_ids[]', + 'value' => $websiteId + )); + $model->setWebsiteIds($websiteId); + } else { + $fieldset->addField('website_ids', 'multiselect', array( + 'name' => 'website_ids[]', + 'label' => Mage::helper('Mage_SalesRule_Helper_Data')->__('Websites'), + 'title' => Mage::helper('Mage_SalesRule_Helper_Data')->__('Websites'), + 'required' => true, + 'values' => Mage::getSingleton('Mage_Adminhtml_Model_System_Store')->getWebsiteValuesForForm() )); - $model->setWebsiteIds(Mage::app()->getStore(true)->getWebsiteId()); } - $customerGroups = Mage::getResourceModel('Mage_Customer_Model_Resource_Group_Collection') - ->load()->toOptionArray(); - + $customerGroups = Mage::getResourceModel('Mage_Customer_Model_Resource_Group_Collection')->load()->toOptionArray(); $found = false; + foreach ($customerGroups as $group) { if ($group['value']==0) { $found = true; } } if (!$found) { - array_unshift($customerGroups, array('value'=>0, 'label'=>Mage::helper('Mage_SalesRule_Helper_Data')->__('NOT LOGGED IN'))); + array_unshift($customerGroups, array( + 'value' => 0, + 'label' => Mage::helper('Mage_SalesRule_Helper_Data')->__('NOT LOGGED IN')) + ); } $fieldset->addField('customer_group_ids', 'multiselect', array( @@ -164,7 +162,7 @@ class Mage_Adminhtml_Block_Promo_Quote_Edit_Tab_Main 'label' => Mage::helper('Mage_SalesRule_Helper_Data')->__('Customer Groups'), 'title' => Mage::helper('Mage_SalesRule_Helper_Data')->__('Customer Groups'), 'required' => true, - 'values' => $customerGroups, + 'values' => Mage::getResourceModel('Mage_Customer_Model_Resource_Group_Collection')->toOptionArray(), )); $couponTypeFiled = $fieldset->addField('coupon_type', 'select', array( @@ -180,6 +178,18 @@ class Mage_Adminhtml_Block_Promo_Quote_Edit_Tab_Main 'required' => true, )); + $autoGenerationCheckbox = $fieldset->addField('use_auto_generation', 'checkbox', array( + 'name' => 'use_auto_generation', + 'label' => Mage::helper('Mage_SalesRule_Helper_Data')->__('Use Auto Generation'), + 'note' => Mage::helper('Mage_SalesRule_Helper_Data')->__('If you select and save the rule you will be able to generate multiple coupon codes.'), + 'onclick' => 'handleCouponsTabContentActivity()', + 'checked' => (int)$model->getUseAutoGeneration() > 0 ? 'checked' : '' + )); + + $autoGenerationCheckbox->setRenderer( + $this->getLayout()->createBlock('Mage_Adminhtml_Block_Promo_Quote_Edit_Tab_Main_Renderer_Checkbox') + ); + $usesPerCouponFiled = $fieldset->addField('uses_per_coupon', 'text', array( 'name' => 'uses_per_coupon', 'label' => Mage::helper('Mage_SalesRule_Helper_Data')->__('Uses per Coupon'), @@ -230,6 +240,8 @@ class Mage_Adminhtml_Block_Promo_Quote_Edit_Tab_Main $form->setValues($model->getData()); + $autoGenerationCheckbox->setValue(1); + if ($model->isReadonly()) { foreach ($fieldset->getElements() as $element) { $element->setReadonly(true, true); @@ -245,11 +257,16 @@ class Mage_Adminhtml_Block_Promo_Quote_Edit_Tab_Main ->createBlock('Mage_Adminhtml_Block_Widget_Form_Element_Dependence') ->addFieldMap($couponTypeFiled->getHtmlId(), $couponTypeFiled->getName()) ->addFieldMap($couponCodeFiled->getHtmlId(), $couponCodeFiled->getName()) + ->addFieldMap($autoGenerationCheckbox->getHtmlId(), $autoGenerationCheckbox->getName()) ->addFieldMap($usesPerCouponFiled->getHtmlId(), $usesPerCouponFiled->getName()) ->addFieldDependence( $couponCodeFiled->getName(), $couponTypeFiled->getName(), Mage_SalesRule_Model_Rule::COUPON_TYPE_SPECIFIC) + ->addFieldDependence( + $autoGenerationCheckbox->getName(), + $couponTypeFiled->getName(), + Mage_SalesRule_Model_Rule::COUPON_TYPE_SPECIFIC) ->addFieldDependence( $usesPerCouponFiled->getName(), $couponTypeFiled->getName(), diff --git a/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Main/Renderer/Checkbox.php b/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Main/Renderer/Checkbox.php new file mode 100644 index 0000000000000000000000000000000000000000..b922bb526e3dfd4b35238e94fef2af0b49997738 --- /dev/null +++ b/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Main/Renderer/Checkbox.php @@ -0,0 +1,59 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Adminhtml + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Renderer for specific checkbox that is used on Rule Information tab in Shopping cart price rules + * + * @category Mage + * @package Mage_Adminhtml + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Adminhtml_Block_Promo_Quote_Edit_Tab_Main_Renderer_Checkbox + extends Mage_Adminhtml_Block_Abstract + implements Varien_Data_Form_Element_Renderer_Interface +{ + /** + * Checkbox render function + * + * @param Varien_Data_Form_Element_Abstract $element + * @return string + */ + public function render(Varien_Data_Form_Element_Abstract $element) + { + $checkbox = new Varien_Data_Form_Element_Checkbox($element->getData()); + $checkbox->setForm($element->getForm()); + + $elementHtml = $checkbox->getElementHtml() . sprintf( + '<label for="%s"><b>%s</b></label><p class="note">%s</p>', + $element->getHtmlId(), $element->getLabel(), $element->getNote() + ); + $html = '<td class="label"> </td>'; + $html .= '<td class="value">' . $elementHtml . '</td>'; + + return $html; + } + +} diff --git a/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tabs.php b/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tabs.php index 9f607f0aca7c19d9a02886a8655c5f5b42cbe51a..181bc26fa88a4587d8c0a189cb3c584bb65f9a14 100644 --- a/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tabs.php +++ b/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tabs.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Grid.php b/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Grid.php index 567ec36a8d70c4aa04ccebb45f8e9eca07db1827..a4df99204043b1734829c6635a578aa207981528 100644 --- a/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Grid.php @@ -20,21 +20,23 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ /** - * description + * Shopping Cart Rules Grid * - * @category Mage - * @category Mage - * @package Mage_Adminhtml - * @author Magento Core Team <core@magentocommerce.com> + * @category Mage + * @package Mage_Adminhtml + * @author Magento Core Team <core@magentocommerce.com> */ class Mage_Adminhtml_Block_Promo_Quote_Grid extends Mage_Adminhtml_Block_Widget_Grid { - + /** + * Initialize grid + * Set sort settings + */ public function __construct() { parent::__construct(); @@ -44,14 +46,29 @@ class Mage_Adminhtml_Block_Promo_Quote_Grid extends Mage_Adminhtml_Block_Widget_ $this->setSaveParametersInSession(true); } + /** + * Add websites to sales rules collection + * Set collection + * + * @return Mage_Adminhtml_Block_Promo_Quote_Grid + */ protected function _prepareCollection() { + /** @var $collection Mage_SalesRule_Model_Resource_Rule_Collection */ $collection = Mage::getModel('Mage_SalesRule_Model_Rule') ->getResourceCollection(); + $collection->addWebsitesToResult(); $this->setCollection($collection); - return parent::_prepareCollection(); + + parent::_prepareCollection(); + return $this; } + /** + * Add grid columns + * + * @return Mage_Adminhtml_Block_Promo_Quote_Grid + */ protected function _prepareColumns() { $this->addColumn('rule_id', array( @@ -103,15 +120,36 @@ class Mage_Adminhtml_Block_Promo_Quote_Grid extends Mage_Adminhtml_Block_Widget_ ), )); + if (!Mage::app()->isSingleStoreMode()) { + $this->addColumn('rule_website', array( + 'header' => Mage::helper('Mage_SalesRule_Helper_Data')->__('Website'), + 'align' =>'left', + 'index' => 'website_ids', + 'type' => 'options', + 'sortable' => false, + 'options' => Mage::getSingleton('Mage_Adminhtml_Model_System_Store')->getWebsiteOptionHash(), + 'width' => 200, + )); + } + $this->addColumn('sort_order', array( 'header' => Mage::helper('Mage_SalesRule_Helper_Data')->__('Priority'), 'align' => 'right', 'index' => 'sort_order', + 'width' => 100, )); - return parent::_prepareColumns(); + parent::_prepareColumns(); + return $this; } + /** + * Retrieve row click URL + * + * @param Varien_Object $row + * + * @return string + */ public function getRowUrl($row) { return $this->getUrl('*/*/edit', array('id' => $row->getRuleId())); diff --git a/app/code/core/Mage/Adminhtml/Block/Promo/Widget/Chooser.php b/app/code/core/Mage/Adminhtml/Block/Promo/Widget/Chooser.php index 28cb4c78eda25481b0fc15ef553f9b5892288ca3..d70740a5e163c2877ee4da3bf2a640b0b84cf895 100644 --- a/app/code/core/Mage/Adminhtml/Block/Promo/Widget/Chooser.php +++ b/app/code/core/Mage/Adminhtml/Block/Promo/Widget/Chooser.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -103,6 +103,10 @@ class Mage_Adminhtml_Block_Promo_Widget_Chooser extends Mage_Adminhtml_Block_Wid $collection = Mage::getModel('Mage_SalesRule_Model_Rule')->getResourceCollection(); $this->setCollection($collection); + Mage::dispatchEvent('adminhtml_block_promo_widget_chooser_prepare_collection', array( + 'collection' => $collection + )); + return parent::_prepareCollection(); } diff --git a/app/code/core/Mage/Adminhtml/Block/Promo/Widget/Chooser/Daterange.php b/app/code/core/Mage/Adminhtml/Block/Promo/Widget/Chooser/Daterange.php index 5ae0037b444c81a984c20c910b7af5bba5516498..609dab77415a7f0a5ccf1509a16d316dd315b4ee 100644 --- a/app/code/core/Mage/Adminhtml/Block/Promo/Widget/Chooser/Daterange.php +++ b/app/code/core/Mage/Adminhtml/Block/Promo/Widget/Chooser/Daterange.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Promo/Widget/Chooser/Sku.php b/app/code/core/Mage/Adminhtml/Block/Promo/Widget/Chooser/Sku.php index 4a089f14aac43beaaef603ddaf451315d2b1ed9f..f6be73d220028781dae5a636c58bccc85d00a80b 100644 --- a/app/code/core/Mage/Adminhtml/Block/Promo/Widget/Chooser/Sku.php +++ b/app/code/core/Mage/Adminhtml/Block/Promo/Widget/Chooser/Sku.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Rating/Edit.php b/app/code/core/Mage/Adminhtml/Block/Rating/Edit.php index d2ae17ea99ab73af16d6b7f8dda6216c37c54ed8..6cb2d330fa8c2a36ce769a06ba531ee8183aa91e 100644 --- a/app/code/core/Mage/Adminhtml/Block/Rating/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/Rating/Edit.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Rating/Edit/Form.php b/app/code/core/Mage/Adminhtml/Block/Rating/Edit/Form.php index 9a05c7a3b4998a206f606f053e594d24eb597987..85c5d7111edce4ac235a05e49cbde7a666a8cd49 100644 --- a/app/code/core/Mage/Adminhtml/Block/Rating/Edit/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Rating/Edit/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Rating/Edit/Tab/Form.php b/app/code/core/Mage/Adminhtml/Block/Rating/Edit/Tab/Form.php index 81f6a10e89f5b93d3440c4769b5d2611652e0f33..cb0bd8203ff8a578e82573e735c59191cc08a1d1 100644 --- a/app/code/core/Mage/Adminhtml/Block/Rating/Edit/Tab/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Rating/Edit/Tab/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -111,7 +111,8 @@ class Mage_Adminhtml_Block_Rating_Edit_Tab_Form extends Mage_Adminhtml_Block_Wid 'label' => Mage::helper('Mage_Rating_Helper_Data')->__('Visible In'), // 'required' => true, 'name' => 'stores[]', - 'values' => Mage::getSingleton('Mage_Adminhtml_Model_System_Store')->getStoreValuesForForm() + 'values' => Mage::getSingleton('Mage_Adminhtml_Model_System_Store')->getStoreValuesForForm(), + 'after_element_html' => Mage::getBlockSingleton('Mage_Adminhtml_Block_Store_Switcher')->getHintHtml() )); if (Mage::registry('rating_data')) { diff --git a/app/code/core/Mage/Adminhtml/Block/Rating/Edit/Tab/Options.php b/app/code/core/Mage/Adminhtml/Block/Rating/Edit/Tab/Options.php index b61ee1561d4e47ee866b0aa1c8dd48a201ab3458..6cdd867bd2ea9c878094f0c4e07ba9001fb48e3c 100644 --- a/app/code/core/Mage/Adminhtml/Block/Rating/Edit/Tab/Options.php +++ b/app/code/core/Mage/Adminhtml/Block/Rating/Edit/Tab/Options.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Rating/Edit/Tabs.php b/app/code/core/Mage/Adminhtml/Block/Rating/Edit/Tabs.php index d901c44568cab02b59e99b3cac985b719bbd70df..bd103b980e366650efe00141ff0e7e18a482ed67 100644 --- a/app/code/core/Mage/Adminhtml/Block/Rating/Edit/Tabs.php +++ b/app/code/core/Mage/Adminhtml/Block/Rating/Edit/Tabs.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Rating/Grid.php b/app/code/core/Mage/Adminhtml/Block/Rating/Grid.php index 5fb9ac1cd36b197763db01c0b015678aa9a4a656..5c9ff3a609bc2d8d4de4f9341ff2f6a8894f1965 100644 --- a/app/code/core/Mage/Adminhtml/Block/Rating/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Rating/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Rating/Rating.php b/app/code/core/Mage/Adminhtml/Block/Rating/Rating.php index 2c70205bd7ce9c6410307fdb251570f262a4d374..e967b81f8eccc7f55a021eb4b14e2328537d351c 100644 --- a/app/code/core/Mage/Adminhtml/Block/Rating/Rating.php +++ b/app/code/core/Mage/Adminhtml/Block/Rating/Rating.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Config/Form/Field/MtdStart.php b/app/code/core/Mage/Adminhtml/Block/Report/Config/Form/Field/MtdStart.php index 224f1e951f123b697eddc5973371ae3f0af0bec0..a1f5160b8d5078489d232487b8f48c3a6a584e49 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Config/Form/Field/MtdStart.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Config/Form/Field/MtdStart.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Config/Form/Field/YtdStart.php b/app/code/core/Mage/Adminhtml/Block/Report/Config/Form/Field/YtdStart.php index 612ce30826604f208d6ad56092a8070b9f822eff..cf16cab47e8c07e42848fbd06c8db421387b7267 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Config/Form/Field/YtdStart.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Config/Form/Field/YtdStart.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Customer/Accounts.php b/app/code/core/Mage/Adminhtml/Block/Report/Customer/Accounts.php index bed85b8b3fb3a13f6527c2f4e636db07b5767b01..47a237f87e8235364be5d4a0807821970c363ede 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Customer/Accounts.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Customer/Accounts.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Customer/Accounts/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Customer/Accounts/Grid.php index c5c35bc497eccba10988234e57ad7f56b3982165..0c608c302e1556ccfd622c84e7bf7f1618723360 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Customer/Accounts/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Customer/Accounts/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Customer/Orders.php b/app/code/core/Mage/Adminhtml/Block/Report/Customer/Orders.php index ec70acc122bf2cd4264d0265c41238384d3e9a93..509b8abc47ad291ea3e1b24f6c7094b4e104be34 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Customer/Orders.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Customer/Orders.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Customer/Orders/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Customer/Orders/Grid.php index 0e837b93bc5d27688ebfe8ad1f790847ade45ded..9ee9c64ab1c8651cbcf8370618893c4e4744a79f 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Customer/Orders/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Customer/Orders/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Customer/Totals.php b/app/code/core/Mage/Adminhtml/Block/Report/Customer/Totals.php index 500a4029e9a77689888d34cc6fbd5bf4616f69f2..3ed8fa38db786a50a2fccf8e774ce74f1f371bc0 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Customer/Totals.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Customer/Totals.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Customer/Totals/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Customer/Totals/Grid.php index adc0e5328bc43feb0b7502b6a5cfcd5aededb722..2b4ac463f476de2638c53031ec0b81076b0f4b07 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Customer/Totals/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Customer/Totals/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Filter/Form.php b/app/code/core/Mage/Adminhtml/Block/Report/Filter/Form.php index ac2fc45c891ccab08bb2bb767a0a53860062b34e..48b985c245bd42e95911f26fef82a4685ce7f2a9 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Filter/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Filter/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Grid.php index 225dd82f645d13b64c5fefb1d47e0c7611c04961..b400c00f55a45d82066bb87216764f1f4a8df421 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Grid/Abstract.php b/app/code/core/Mage/Adminhtml/Block/Report/Grid/Abstract.php index 5b131bfe6edeaf99facb2dea89202431247323e1..7373473d67effd1453d106e05988b9151d8fc783 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Grid/Abstract.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Grid/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -159,9 +159,11 @@ class Mage_Adminhtml_Block_Report_Grid_Abstract extends Mage_Adminhtml_Block_Wid ->setPeriod($filterData->getData('period_type')) ->setDateRange($filterData->getData('from', null), $filterData->getData('to', null)) ->addStoreFilter($storeIds) - ->addOrderStatusFilter($filterData->getData('order_statuses')) ->setAggregatedColumns($this->_getAggregatedColumns()); + $this->_addOrderStatusFilter($resourceCollection, $filterData); + $this->_addCustomFilter($resourceCollection, $filterData); + if ($this->_isExport) { $this->setCollection($resourceCollection); return $this; @@ -185,9 +187,12 @@ class Mage_Adminhtml_Block_Report_Grid_Abstract extends Mage_Adminhtml_Block_Wid ->setPeriod($filterData->getData('period_type')) ->setDateRange($filterData->getData('from', null), $filterData->getData('to', null)) ->addStoreFilter($storeIds) - ->addOrderStatusFilter($filterData->getData('order_statuses')) ->setAggregatedColumns($this->_getAggregatedColumns()) ->isTotals(true); + + $this->_addOrderStatusFilter($totalsCollection, $filterData); + $this->_addCustomFilter($totalsCollection, $filterData); + foreach ($totalsCollection as $item) { $this->setTotals($item); break; @@ -208,9 +213,11 @@ class Mage_Adminhtml_Block_Report_Grid_Abstract extends Mage_Adminhtml_Block_Wid ->setPeriod($filterData->getData('period_type')) ->setDateRange($filterData->getData('from', null), $filterData->getData('to', null)) ->addStoreFilter($this->_getStoreIds()) - ->addOrderStatusFilter($filterData->getData('order_statuses')) ->setAggregatedColumns($this->_getAggregatedColumns()) ->isTotals(true); + + $this->_addOrderStatusFilter($totalsCollection, $filterData); + if (count($totalsCollection->getItems()) < 1 || !$filterData->getData('from')) { $this->setTotals(new Varien_Object()); } else { @@ -230,9 +237,11 @@ class Mage_Adminhtml_Block_Report_Grid_Abstract extends Mage_Adminhtml_Block_Wid ->setPeriod($filterData->getData('period_type')) ->setDateRange($filterData->getData('from', null), $filterData->getData('to', null)) ->addStoreFilter($this->_getStoreIds()) - ->addOrderStatusFilter($filterData->getData('order_statuses')) ->setAggregatedColumns($this->_getAggregatedColumns()) ->isSubTotals(true); + + $this->_addOrderStatusFilter($subTotalsCollection, $filterData); + $this->setSubTotals($subTotalsCollection->getItems()); return parent::getSubTotals(); } @@ -252,7 +261,7 @@ class Mage_Adminhtml_Block_Report_Grid_Abstract extends Mage_Adminhtml_Block_Wid } return $this->_currentCurrencyCode; } - + /** * Get currency rate (base to given currency) * @@ -263,4 +272,30 @@ class Mage_Adminhtml_Block_Report_Grid_Abstract extends Mage_Adminhtml_Block_Wid { return Mage::app()->getStore()->getBaseCurrency()->getRate($toCurrency); } + + /** + * Add order status filter + * + * @param Mage_Reports_Model_Resource_Report_Collection_Abstract $collection + * @param Varien_Object $filterData + * @return Mage_Adminhtml_Block_Report_Grid_Abstract + */ + protected function _addOrderStatusFilter($collection, $filterData) + { + $collection->addOrderStatusFilter($filterData->getData('order_statuses')); + return $this; + } + + /** + * Adds custom filter to resource collection + * Can be overridden in child classes if custom filter needed + * + * @param Mage_Reports_Model_Resource_Report_Collection_Abstract $collection + * @param Varien_Object $filterData + * @return Mage_Adminhtml_Block_Report_Grid_Abstract + */ + protected function _addCustomFilter($collection, $filterData) + { + return $this; + } } diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Grid/Column/Renderer/Blanknumber.php b/app/code/core/Mage/Adminhtml/Block/Report/Grid/Column/Renderer/Blanknumber.php index 112f47439e1cb867891aecf521c74a2c5e56f0d5..d6d780e24c3dd2a6e01b5ad26b928b7a07c519fb 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Grid/Column/Renderer/Blanknumber.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Grid/Column/Renderer/Blanknumber.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Grid/Column/Renderer/Currency.php b/app/code/core/Mage/Adminhtml/Block/Report/Grid/Column/Renderer/Currency.php index c22a7d3ba04b0e0c93d6e67d4d377b4a902b97c3..6a11bd9ad5138bbefcc5ae5ede01e176fdd2ad4f 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Grid/Column/Renderer/Currency.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Grid/Column/Renderer/Currency.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Grid/Column/Renderer/Customer.php b/app/code/core/Mage/Adminhtml/Block/Report/Grid/Column/Renderer/Customer.php index 69c0840d0c910d7bf44980b5d8c26ee37f3ebad9..bc444bbef06112feb5077e33770b1b186e632322 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Grid/Column/Renderer/Customer.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Grid/Column/Renderer/Customer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Grid/Column/Renderer/Product.php b/app/code/core/Mage/Adminhtml/Block/Report/Grid/Column/Renderer/Product.php index a2b4a87519094fc5871319e5a45db229a84984b4..447e9baa6e6874d564f1ad739bd0cf4e20f35064 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Grid/Column/Renderer/Product.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Grid/Column/Renderer/Product.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Grid/Shopcart.php b/app/code/core/Mage/Adminhtml/Block/Report/Grid/Shopcart.php index ad56636771dc00569c28ac5d24d7e0c082273bc3..2cc8d48efe8723360536d0014f46017117dbd88f 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Grid/Shopcart.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Grid/Shopcart.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Product.php b/app/code/core/Mage/Adminhtml/Block/Report/Product.php index 89fc2fda0c6e3ab6211e1aacd3a5935ca5480224..449973aeac13659faf42b7c3743cbcdbfce70079 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Product.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Product.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Product/Downloads.php b/app/code/core/Mage/Adminhtml/Block/Report/Product/Downloads.php index 9be7e57be3abea013427f25fa488c2a978a9346b..4f76093eb96c8e20f33e1036bf8acf97b355fbad 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Product/Downloads.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Product/Downloads.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Product/Downloads/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Product/Downloads/Grid.php index 55c91fa73a51cce1c1d167502bac4da5cff5c109..e2cba3fd031daa9182383d26f948dcc6c57aebac 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Product/Downloads/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Product/Downloads/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Product/Downloads/Renderer/Purchases.php b/app/code/core/Mage/Adminhtml/Block/Report/Product/Downloads/Renderer/Purchases.php index cb0f6f5aa3c9966739c2de8542a99b1a4254bf37..62dffc57693a610ddbb4c1d3c7a392b0858147eb 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Product/Downloads/Renderer/Purchases.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Product/Downloads/Renderer/Purchases.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Product/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Product/Grid.php index 6e8882f7fbc45a2c2a9758c92608466077d86fa7..1cc0007e8e7349dbaa89fd065426364f5caa0936 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Product/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Product/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Product/Lowstock.php b/app/code/core/Mage/Adminhtml/Block/Report/Product/Lowstock.php index 21af16014b4285f59730f658f9f598177ee4a391..ce636758120feab65255f1caf3e627574a18c948 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Product/Lowstock.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Product/Lowstock.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Product/Lowstock/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Product/Lowstock/Grid.php index f24df812255b36a8552e194b63bc6f5711f91c20..5fbd939c573555152c4ee59f530cc7aba4b1df53 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Product/Lowstock/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Product/Lowstock/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Product/Sold.php b/app/code/core/Mage/Adminhtml/Block/Report/Product/Sold.php index 53e8db8d04c98527cb466c84d08b76369d628987..cff4cd59ce0565108265b16728f431b23967308e 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Product/Sold.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Product/Sold.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Product/Sold/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Product/Sold/Grid.php index bf501f4f66ad066556663bc88c2d0c8aeccb5c29..ffb05118922ed288767f20f8408d5d7a65860c9e 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Product/Sold/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Product/Sold/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Product/Viewed.php b/app/code/core/Mage/Adminhtml/Block/Report/Product/Viewed.php index b3be762a007190de1dd119ecf2c0f168352381b4..d0416921e860ffd07d14d6616ee3d0de315632c0 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Product/Viewed.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Product/Viewed.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -39,6 +39,22 @@ class Mage_Adminhtml_Block_Report_Product_Viewed extends Mage_Adminhtml_Block_Wi $this->_controller = 'report_product_viewed'; $this->_headerText = Mage::helper('Mage_Reports_Helper_Data')->__('Most Viewed'); parent::__construct(); + $this->setTemplate('report/grid/container.phtml'); $this->_removeButton('add'); + $this->addButton('filter_form_submit', array( + 'label' => Mage::helper('Mage_Reports_Helper_Data')->__('Show Report'), + 'onclick' => 'filterFormSubmit()' + )); + } + + /** + * Get filter url + * + * @return string + */ + public function getFilterUrl() + { + $this->getRequest()->setParam('filter', null); + return $this->getUrl('*/*/viewed', array('_current' => true)); } } diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Product/Viewed/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Product/Viewed/Grid.php index 0977aff84194cf58cd812d830fc37456fc908d1f..44f3d36e282965750f727e773ae0f6bf89264e77 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Product/Viewed/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Product/Viewed/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -31,49 +31,94 @@ * @package Mage_Adminhtml * @author Magento Core Team <core@magentocommerce.com> */ -class Mage_Adminhtml_Block_Report_Product_Viewed_Grid extends Mage_Adminhtml_Block_Report_Grid +class Mage_Adminhtml_Block_Report_Product_Viewed_Grid extends Mage_Adminhtml_Block_Report_Grid_Abstract { + /** + * Column for grid to be grouped by + * + * @var string + */ + protected $_columnGroupBy = 'period'; + /** + * Grid resource collection name + * + * @var string + */ + protected $_resourceCollectionName = 'Mage_Reports_Model_Resource_Product_Viewed_Collection'; + + /** + * Init grid parameters + */ public function __construct() { parent::__construct(); - $this->setId('gridViewedProducts'); - } - - protected function _prepareCollection() - { - parent::_prepareCollection(); - $this->getCollection()->initReport('Mage_Reports_Model_Resource_Product_Viewed_Collection'); + $this->setCountTotals(true); } + /** + * Custom columns preparation + * + * @return Mage_Adminhtml_Block_Widget_Grid + */ protected function _prepareColumns() { - $this->addColumn('name', array( - 'header' =>Mage::helper('Mage_Reports_Helper_Data')->__('Product Name'), - 'index' =>'name', - 'total' =>Mage::helper('Mage_Reports_Helper_Data')->__('Subtotal') + $this->addColumn('period', array( + 'header' => Mage::helper('Mage_Adminhtml_Helper_Data')->__('Period'), + 'index' => 'period', + 'width' => 100, + 'sortable' => false, + 'period_type' => $this->getPeriodType(), + 'renderer' => 'Mage_Adminhtml_Block_Report_Sales_Grid_Column_Renderer_Date', + 'totals_label' => Mage::helper('Mage_Adminhtml_Helper_Data')->__('Total'), + 'html_decorators' => array('nobr'), + )); + + $this->addColumn('product_name', array( + 'header' => Mage::helper('Mage_Adminhtml_Helper_Data')->__('Product Name'), + 'index' => 'product_name', + 'type' => 'string', + 'sortable' => false )); - $this->addColumn('price', array( - 'header' => Mage::helper('Mage_Reports_Helper_Data')->__('Price'), - 'width' => '120px', + if ($this->getFilterData()->getStoreIds()) { + $this->setStoreIds(explode(',', $this->getFilterData()->getStoreIds())); + } + $currencyCode = $this->getCurrentCurrencyCode(); + + $this->addColumn('product_price', array( + 'header' => Mage::helper('Mage_Adminhtml_Helper_Data')->__('Price'), 'type' => 'currency', - 'currency_code' => $this->getCurrentCurrencyCode(), - 'index' => 'price', + 'currency_code' => $currencyCode, + 'index' => 'product_price', + 'sortable' => false, + 'rate' => $this->getRate($currencyCode), )); - $this->addColumn('views', array( - 'header' =>Mage::helper('Mage_Reports_Helper_Data')->__('Number of Views'), - 'width' =>'120px', - 'align' =>'right', - 'index' =>'views', - 'total' =>'sum' + $this->addColumn('views_num', array( + 'header' => Mage::helper('Mage_Adminhtml_Helper_Data')->__('Number of Views'), + 'index' => 'views_num', + 'type' => 'number', + 'total' => 'sum', + 'sortable' => false )); - $this->addExportType('*/*/exportViewedCsv', Mage::helper('Mage_Reports_Helper_Data')->__('CSV')); - $this->addExportType('*/*/exportViewedExcel', Mage::helper('Mage_Reports_Helper_Data')->__('Excel XML')); + + $this->addExportType('*/*/exportViewedCsv', Mage::helper('Mage_Adminhtml_Helper_Data')->__('CSV')); + $this->addExportType('*/*/exportViewedExcel', Mage::helper('Mage_Adminhtml_Helper_Data')->__('Excel XML')); return parent::_prepareColumns(); } + /** + * Don't use orders in collection + * + * @param Mage_Reports_Model_Resource_Report_Collection_Abstract $collection + * @param Varien_Object $filterData + * @return Mage_Adminhtml_Block_Report_Grid_Abstract + */ + protected function _addOrderStatusFilter($collection, $filterData) + { + return $this; + } } diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Refresh/Statistics.php b/app/code/core/Mage/Adminhtml/Block/Report/Refresh/Statistics.php index 60567210c341ec27953d7e2668c74010e7fc933c..196c6988e524cb8e4951b8062e5ce4bdb4bd3a06 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Refresh/Statistics.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Refresh/Statistics.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Refresh/Statistics/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Refresh/Statistics/Grid.php index f7be00082f7273b7f7f77eedd84370cd70674024..9b375d6192f042dd34c7e753a842b94406bfcba5 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Refresh/Statistics/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Refresh/Statistics/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -97,7 +97,13 @@ class Mage_Adminhtml_Block_Report_Refresh_Statistics_Grid extends Mage_Adminhtml 'report' => Mage::helper('Mage_Sales_Helper_Data')->__('Bestsellers'), 'comment' => Mage::helper('Mage_Sales_Helper_Data')->__('Products Bestsellers Report'), 'updated_at' => $this->_getUpdatedAt(Mage_Reports_Model_Flag::REPORT_BESTSELLERS_FLAG_CODE) - ) + ), + array( + 'id' => 'viewed', + 'report' => Mage::helper('Mage_Sales_Helper_Data')->__('Most Viewed'), + 'comment' => Mage::helper('Mage_Sales_Helper_Data')->__('Most Viewed Products Report'), + 'updated_at' => $this->_getUpdatedAt(Mage_Reports_Model_Flag::REPORT_PRODUCT_VIEWED_FLAG_CODE) + ), ); foreach ($data as $value) { diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Review/Customer.php b/app/code/core/Mage/Adminhtml/Block/Report/Review/Customer.php index bc201f719180ab17e205f2e1209b6f45c0f7993c..0bb956516b49c2f6027a4577e50c55d49aea6a51 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Review/Customer.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Review/Customer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Review/Customer/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Review/Customer/Grid.php index 6e2323e86420b38b126cc988e4aa3634b8e03a30..26e1d3c9e692a05ee8c0cf242d6f3b4f68c8c5c5 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Review/Customer/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Review/Customer/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Review/Detail.php b/app/code/core/Mage/Adminhtml/Block/Report/Review/Detail.php index 3e19ffa3d99c264bb07b30720a31c366972ef808..acb8f2b9a3ce5b14210b7300314dae3f103f627a 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Review/Detail.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Review/Detail.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Review/Detail/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Review/Detail/Grid.php index 35632c83aaae66ba5e28bf28a069dcac1da0db49..6e1e82c1fc69159eceba6653a5d21adc053aab4f 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Review/Detail/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Review/Detail/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Review/Product.php b/app/code/core/Mage/Adminhtml/Block/Report/Review/Product.php index 20cfdee1172eee4eaa746764227b990f59f9ed57..c57fc871f857de9205962de703656df40fdf55dc 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Review/Product.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Review/Product.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Review/Product/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Review/Product/Grid.php index 70be59cf59451692820d41ac9fbed76f3a1148dd..4afc2bb6b3f9e9e8657c389ddc5dc15f7dc93961 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Review/Product/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Review/Product/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Bestsellers.php b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Bestsellers.php index e6524384f18d61e5688200d9517863495e968c99..ae10b5da67ca5046c4236bc5d55ae88e3df6d8c1 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Bestsellers.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Bestsellers.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Bestsellers/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Bestsellers/Grid.php index b97e66e2aff66865759b94b6fc522b9b63630062..b45547a81a16788d7151bb931cc8aa76ae9c7bf1 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Bestsellers/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Bestsellers/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Coupons.php b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Coupons.php index 42a8f5cb52d2c115bef4c2bc60f27564a50cb777..44c5f28f567a35c17aa3ac24936cbab1058e225b 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Coupons.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Coupons.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Coupons/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Coupons/Grid.php index 7e8c3ee54d4b194532bde5608aa7f1e621633220..a3cc27901235b7cbdad94059f88e0a24d7881955 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Coupons/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Coupons/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -71,6 +71,12 @@ class Mage_Adminhtml_Block_Report_Sales_Coupons_Grid extends Mage_Adminhtml_Bloc 'index' => 'coupon_code' )); + $this->addColumn('rule_name', array( + 'header' => Mage::helper('Mage_SalesRule_Helper_Data')->__('Shopping Cart Price Rule'), + 'sortable' => false, + 'index' => 'rule_name' + )); + $this->addColumn('coupon_uses', array( 'header' => Mage::helper('Mage_SalesRule_Helper_Data')->__('Number of Uses'), 'sortable' => false, @@ -150,4 +156,24 @@ class Mage_Adminhtml_Block_Report_Sales_Coupons_Grid extends Mage_Adminhtml_Bloc return parent::_prepareColumns(); } + + /** + * Add price rule filter + * + * @param Mage_Reports_Model_Resource_Report_Collection_Abstract $collection + * @param Varien_Object $filterData + * @return Mage_Adminhtml_Block_Report_Grid_Abstract + */ + protected function _addCustomFilter($collection, $filterData) + { + if ($filterData->getPriceRuleType()) { + $rulesList = $filterData->getData('rules_list'); + if (isset($rulesList[0])) { + $rulesIds = explode(',', $rulesList[0]); + $collection->addRuleFilter($rulesIds); + } + } + + return parent::_addCustomFilter($filterData, $collection); + } } diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Grid/Column/Renderer/Date.php b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Grid/Column/Renderer/Date.php index 704fddc6e7200e5efe0c8eb90aa94984554e0eaa..d51584421b7a677f82fd748fbb0ae2b9b9a50863 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Grid/Column/Renderer/Date.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Grid/Column/Renderer/Date.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Invoiced.php b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Invoiced.php index 17fa760cbcabbc86cdca8a3fd2cae5246349913c..84bc0cb5e2ec7178bd8ac1d4f204ab0d9260a90d 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Invoiced.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Invoiced.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Invoiced/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Invoiced/Grid.php index 6b6afca319228e2cf0cd170e750fdf169074d582..5797984df029c8379cf3eebe4be3e935730a35b2 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Invoiced/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Invoiced/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Refunded.php b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Refunded.php index 7c0f6f3ce05b2c584e8dfc8ad476257bff458904..1005f3489f57e9c13de21570f4d663b41fa53122 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Refunded.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Refunded.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Refunded/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Refunded/Grid.php index 9319edc3c8991686a6da847bb80e9c10ba177c66..a6ead9d286096f9494a572f16b869f2cabbcf0f0 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Refunded/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Refunded/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Sales.php b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Sales.php index 23accdffb75b1fa63188f532f36155ebc516caba..5453ce4d97e9274270788e2adafa5719403861f1 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Sales.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Sales.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Sales/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Sales/Grid.php index 7019851792e809646502a431459f28ea24baae4a..9288f97e78d5b410b07bdd4d575a5328219daad9 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Sales/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Sales/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Shipping.php b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Shipping.php index 35f35212bcd622573ce1ee793df84a8c350edee0..dc3bca9836bffda8f722842b2d35fe909cf9f5be 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Shipping.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Shipping.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Shipping/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Shipping/Grid.php index 531b3461e3eb0d2da2926279908d63e6ff3aa9f9..37bc997b4b34e2dd85dba179157c4b83e967805b 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Shipping/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Shipping/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Tax.php b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Tax.php index 15319f6909e09cde00c6205df04100bbc0f6cdfa..9ce1f72896f3b8e4f885f34fb2a2a25d1e4e3049 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Tax.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Tax.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Tax/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Tax/Grid.php index a444ed8b59ff42a38d0ecd382e8dc9889aa446cd..b68c9ca514cbeb44c47b89495ee471bac71f45b9 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Tax/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Tax/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Search.php b/app/code/core/Mage/Adminhtml/Block/Report/Search.php index 9b36108be24b40bb0228f28bc5219fc35aec1aaa..fd4e6e9f32ff9ea2700eb35847009346a3586487 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Search.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Search.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Search/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Search/Grid.php index d40e25418b651a7a06147200bf1ed5f7f91996eb..de5cb6a32dafb0eb9fd47cc1bf86a3d07f123330 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Search/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Search/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Shopcart/Abandoned.php b/app/code/core/Mage/Adminhtml/Block/Report/Shopcart/Abandoned.php index 7755a89d3149f7d5c73888d9ac1b60fa051e7872..74534f9c42ac48c87a1ddd2e1440c87ed8c731b8 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Shopcart/Abandoned.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Shopcart/Abandoned.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Shopcart/Abandoned/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Shopcart/Abandoned/Grid.php index e41de634aaf971a302b06bf7ab6c23153d09faaa..b148285d0567848bd040aeed7bca9d164d5a638f 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Shopcart/Abandoned/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Shopcart/Abandoned/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Shopcart/Customer.php b/app/code/core/Mage/Adminhtml/Block/Report/Shopcart/Customer.php index b4f7aac251fcf2f1e6ee5b47489d056969a9a7e2..adf338ef44d31d4a62000afd5ade97e899fdf762 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Shopcart/Customer.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Shopcart/Customer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Shopcart/Customer/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Shopcart/Customer/Grid.php index 503278abbd9ea5f313d7130f8bc78d44082deb5c..00cea8f443aabb1a90b0163ff34f8affb51deacd 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Shopcart/Customer/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Shopcart/Customer/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Shopcart/Product.php b/app/code/core/Mage/Adminhtml/Block/Report/Shopcart/Product.php index 1fbf809d4eb645898f9104bbced096b298e92e1b..d53272dc0c5bbd48c74e1306d65b4db3dd415dad 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Shopcart/Product.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Shopcart/Product.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Shopcart/Product/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Shopcart/Product/Grid.php index be7259c7a50c71dccb4e685f36a9d9cbb2f8b104..1ccb4542187f3eebd302b3d309a2f2d1a142111c 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Shopcart/Product/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Shopcart/Product/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Tag/Customer.php b/app/code/core/Mage/Adminhtml/Block/Report/Tag/Customer.php index d737209ad63b080d18f400addb3783225ce41fca..2d8984c80621f2123bb69131205ca5dbcea3a7f5 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Tag/Customer.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Tag/Customer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Tag/Customer/Detail.php b/app/code/core/Mage/Adminhtml/Block/Report/Tag/Customer/Detail.php index cfe9cadb282233b344346e0331c5689c3e07fac0..60562550a92b66722de250d5f609d5beea634cc0 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Tag/Customer/Detail.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Tag/Customer/Detail.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Tag/Customer/Detail/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Tag/Customer/Detail/Grid.php index 58ae3eaaf11480b4fa629c66598d4be540d58bac..f6ab7795b866b63ccca351e4c8c6cf134c988be1 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Tag/Customer/Detail/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Tag/Customer/Detail/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Tag/Customer/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Tag/Customer/Grid.php index 4c64041c7b23fb68fd01475ed0e4234abdba828d..e667ae47121c97216d59d9cdf1adecdd7de81b03 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Tag/Customer/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Tag/Customer/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Tag/Popular.php b/app/code/core/Mage/Adminhtml/Block/Report/Tag/Popular.php index bee076d400934460e5a7e0586c88053ee143db22..f6427c30aa0be83a5e29978c287716756278cd1e 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Tag/Popular.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Tag/Popular.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Tag/Popular/Detail.php b/app/code/core/Mage/Adminhtml/Block/Report/Tag/Popular/Detail.php index dd74f4eb52110fc1f7ca4e59ac19b07cca252409..9932ee540e68cdb52cec9c2a0384f6b7485816df 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Tag/Popular/Detail.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Tag/Popular/Detail.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Tag/Popular/Detail/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Tag/Popular/Detail/Grid.php index 5dcdd87ce19e93e66001537963960669dc5bbd00..96d816861c8c04ddc1e93487b8f6516154706bea 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Tag/Popular/Detail/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Tag/Popular/Detail/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Tag/Popular/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Tag/Popular/Grid.php index c0fa5b17f5af826553bcc5d27b134e4150cb79af..f8c9b57ce5f3e7be99eaa09a7562426e1cde54fe 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Tag/Popular/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Tag/Popular/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Tag/Product.php b/app/code/core/Mage/Adminhtml/Block/Report/Tag/Product.php index fb2b8da234ac297b9bdb2c0f416cbcd7f511d757..2bb3f0f50d1ac71cabb0d5c20c1be99a7e6f1eb7 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Tag/Product.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Tag/Product.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Tag/Product/Detail.php b/app/code/core/Mage/Adminhtml/Block/Report/Tag/Product/Detail.php index 50f5e9497538122de53998a80adfe62fb7362278..cddb0869fa2d18d2273437fb2d777d72494d9925 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Tag/Product/Detail.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Tag/Product/Detail.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Tag/Product/Detail/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Tag/Product/Detail/Grid.php index 134b817a54417136d54bfba1d1f7ac06074dac84..8564f6325e2a75453d9969ab652f03758c9d55ed 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Tag/Product/Detail/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Tag/Product/Detail/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Tag/Product/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Tag/Product/Grid.php index 2f15b9a6cf296973415ee86031a82e69e375bec4..857ad36fb74da4c532b84697bcbd3224378d9640 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Tag/Product/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Tag/Product/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Wishlist.php b/app/code/core/Mage/Adminhtml/Block/Report/Wishlist.php index d15ecd7a2b1c4ad93e55aa433455ea5126426cb0..f1a9f41284b9cf9d93c59b02f20042215a610b87 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Wishlist.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Wishlist.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Wishlist/Grid.php b/app/code/core/Mage/Adminhtml/Block/Report/Wishlist/Grid.php index 25b1cea1e69ff9488b1fabeedbe5a1edb239d07f..254e39c280a0107cdb9344704a1a88eadb587924 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Wishlist/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Wishlist/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Review/Add.php b/app/code/core/Mage/Adminhtml/Block/Review/Add.php index 7495871b8eab3f503018178276522a0fc2e652b4..5096863702c5a08e2b033ac6b6e06cf56b3565a8 100644 --- a/app/code/core/Mage/Adminhtml/Block/Review/Add.php +++ b/app/code/core/Mage/Adminhtml/Block/Review/Add.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Review/Add/Form.php b/app/code/core/Mage/Adminhtml/Block/Review/Add/Form.php index 683bf4094a296f8266c967083c2339bbb71f072e..e237d79ad803b5270270c336419a8a9fee801a9d 100644 --- a/app/code/core/Mage/Adminhtml/Block/Review/Add/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Review/Add/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -54,8 +54,7 @@ class Mage_Adminhtml_Block_Review_Add_Form extends Mage_Adminhtml_Block_Widget_F 'label' => Mage::helper('Mage_Review_Helper_Data')->__('Product Rating'), 'required' => true, 'text' => '<div id="rating_detail">' - . $this->getLayout()->createBlock('Mage_Adminhtml_Block_Review_Rating_Detailed')->toHtml() - . '</div>', + . $this->getLayout()->createBlock('Mage_Adminhtml_Block_Review_Rating_Detailed')->toHtml() . '</div>', )); $fieldset->addField('status_id', 'select', array( @@ -73,7 +72,8 @@ class Mage_Adminhtml_Block_Review_Add_Form extends Mage_Adminhtml_Block_Widget_F 'label' => Mage::helper('Mage_Review_Helper_Data')->__('Visible In'), 'required' => true, 'name' => 'select_stores[]', - 'values' => Mage::getSingleton('Mage_Adminhtml_Model_System_Store')->getStoreValuesForForm() + 'values' => Mage::getSingleton('Mage_Adminhtml_Model_System_Store')->getStoreValuesForForm(), + 'after_element_html' => Mage::getBlockSingleton('Mage_Adminhtml_Block_Store_Switcher')->getHintHtml() )); } diff --git a/app/code/core/Mage/Adminhtml/Block/Review/Edit.php b/app/code/core/Mage/Adminhtml/Block/Review/Edit.php index b88b1609656f8224ed84e6bb1835a23c8ef7f67e..9c821c72e6e795c86afeaf51d2c4ae1c836100a7 100644 --- a/app/code/core/Mage/Adminhtml/Block/Review/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/Review/Edit.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Review/Edit/Form.php b/app/code/core/Mage/Adminhtml/Block/Review/Edit/Form.php index 84b82b15b1bee28080f1edca606085cdad400d07..9e98750af83897e73b47247de0bdb4134dddd1c9 100644 --- a/app/code/core/Mage/Adminhtml/Block/Review/Edit/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Review/Edit/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -58,11 +58,7 @@ class Mage_Adminhtml_Block_Review_Edit_Form extends Mage_Adminhtml_Block_Widget_ )); if ($customer->getId()) { - $customerText = Mage::helper('Mage_Review_Helper_Data')->__('<a href="%1$s" onclick="this.target=\'blank\'">%2$s %3$s</a> <a href="mailto:%4$s">(%4$s)</a>', - $this->getUrl('*/customer/edit', array('id' => $customer->getId(), 'active_tab'=>'review')), - $this->escapeHtml($customer->getFirstname()), - $this->escapeHtml($customer->getLastname()), - $this->escapeHtml($customer->getEmail())); + $customerText = Mage::helper('Mage_Review_Helper_Data')->__('<a href="%1$s" onclick="this.target=\'blank\'">%2$s %3$s</a> <a href="mailto:%4$s">(%4$s)</a>', $this->getUrl('*/customer/edit', array('id' => $customer->getId(), 'active_tab'=>'review')), $this->escapeHtml($customer->getFirstname()), $this->escapeHtml($customer->getLastname()), $this->escapeHtml($customer->getEmail())); } else { if (is_null($review->getCustomerId())) { $customerText = Mage::helper('Mage_Review_Helper_Data')->__('Guest'); @@ -85,8 +81,8 @@ class Mage_Adminhtml_Block_Review_Edit_Form extends Mage_Adminhtml_Block_Widget_ 'label' => Mage::helper('Mage_Review_Helper_Data')->__('Detailed Rating'), 'required' => true, 'text' => '<div id="rating_detail">' - . $this->getLayout()->createBlock('Mage_Adminhtml_Block_Review_Rating_Detailed')->toHtml() - . '</div>', + . $this->getLayout()->createBlock('Mage_Adminhtml_Block_Review_Rating_Detailed')->toHtml() + . '</div>', )); $fieldset->addField('status_id', 'select', array( @@ -104,7 +100,8 @@ class Mage_Adminhtml_Block_Review_Edit_Form extends Mage_Adminhtml_Block_Widget_ 'label' => Mage::helper('Mage_Review_Helper_Data')->__('Visible In'), 'required' => true, 'name' => 'stores[]', - 'values' => Mage::getSingleton('Mage_Adminhtml_Model_System_Store')->getStoreValuesForForm() + 'values' => Mage::getSingleton('Mage_Adminhtml_Model_System_Store')->getStoreValuesForForm(), + 'after_element_html' => Mage::getBlockSingleton('Mage_Adminhtml_Block_Store_Switcher')->getHintHtml() )); $review->setSelectStores($review->getStores()); } diff --git a/app/code/core/Mage/Adminhtml/Block/Review/Grid.php b/app/code/core/Mage/Adminhtml/Block/Review/Grid.php index 6be785f4114d5b3ab67a7d81f6329c6d9e50c41a..68b91465bdd071d40bcd20cd6f59f13f531c46ec 100644 --- a/app/code/core/Mage/Adminhtml/Block/Review/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Review/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -47,12 +47,20 @@ class Mage_Adminhtml_Block_Review_Grid extends Mage_Adminhtml_Block_Widget_Grid $collection = $model->getProductCollection(); if ($this->getProductId() || $this->getRequest()->getParam('productId', false)) { - $this->setProductId(($this->getProductId() ? $this->getProductId() : $this->getRequest()->getParam('productId'))); + $productId = $this->getProductId(); + if (!$productId) { + $productId = $this->getRequest()->getParam('productId'); + } + $this->setProductId($productId); $collection->addEntityFilter($this->getProductId()); } if ($this->getCustomerId() || $this->getRequest()->getParam('customerId', false)) { - $this->setCustomerId(($this->getCustomerId() ? $this->getCustomerId() : $this->getRequest()->getParam('customerId'))); + $customerId = $this->getCustomerId(); + if (!$customerId){ + $customerId = $this->getRequest()->getParam('customerId'); + } + $this->setCustomerId($customerId); $collection->addCustomerFilter($this->getCustomerId()); } @@ -211,12 +219,16 @@ class Mage_Adminhtml_Block_Review_Grid extends Mage_Adminhtml_Block_Widget_Grid protected function _prepareMassaction() { $this->setMassactionIdField('review_id'); + $this->setMassactionIdFilter('rt.review_id'); $this->setMassactionIdFieldOnlyIndexValue(true); $this->getMassactionBlock()->setFormFieldName('reviews'); $this->getMassactionBlock()->addItem('delete', array( 'label'=> Mage::helper('Mage_Review_Helper_Data')->__('Delete'), - 'url' => $this->getUrl('*/*/massDelete', array('ret' => Mage::registry('usePendingFilter') ? 'pending' : 'index')), + 'url' => $this->getUrl( + '*/*/massDelete', + array('ret' => Mage::registry('usePendingFilter') ? 'pending' : 'index') + ), 'confirm' => Mage::helper('Mage_Review_Helper_Data')->__('Are you sure?') )); @@ -227,7 +239,10 @@ class Mage_Adminhtml_Block_Review_Grid extends Mage_Adminhtml_Block_Widget_Grid array_unshift($statuses, array('label'=>'', 'value'=>'')); $this->getMassactionBlock()->addItem('update_status', array( 'label' => Mage::helper('Mage_Review_Helper_Data')->__('Update Status'), - 'url' => $this->getUrl('*/*/massUpdateStatus', array('ret' => Mage::registry('usePendingFilter') ? 'pending' : 'index')), + 'url' => $this->getUrl( + '*/*/massUpdateStatus', + array('ret' => Mage::registry('usePendingFilter') ? 'pending' : 'index') + ), 'additional' => array( 'status' => array( 'name' => 'status', @@ -253,12 +268,15 @@ class Mage_Adminhtml_Block_Review_Grid extends Mage_Adminhtml_Block_Widget_Grid public function getGridUrl() { if( $this->getProductId() || $this->getCustomerId() ) { - return $this->getUrl('*/catalog_product_review/' . (Mage::registry('usePendingFilter') ? 'pending' : ''), array( - 'productId' => $this->getProductId(), - 'customerId' => $this->getCustomerId(), - )); + return $this->getUrl( + '*/catalog_product_review/' . (Mage::registry('usePendingFilter') ? 'pending' : ''), + array( + 'productId' => $this->getProductId(), + 'customerId' => $this->getCustomerId(), + ) + ); } else { return $this->getCurrentUrl(); } } -} +} \ No newline at end of file diff --git a/app/code/core/Mage/Adminhtml/Block/Review/Grid/Filter/Type.php b/app/code/core/Mage/Adminhtml/Block/Review/Grid/Filter/Type.php index 7e9bbf7087a705bb133d6e56a2b112ed77abf97b..1aa24f50bef0bb0230ba1b640e3f729a8941e816 100644 --- a/app/code/core/Mage/Adminhtml/Block/Review/Grid/Filter/Type.php +++ b/app/code/core/Mage/Adminhtml/Block/Review/Grid/Filter/Type.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Review/Grid/Renderer/Type.php b/app/code/core/Mage/Adminhtml/Block/Review/Grid/Renderer/Type.php index 8c9b77e3bbd09863eaa4e5b06b78991869495107..8414a101057b62bf7027e84692f7ab112e537028 100644 --- a/app/code/core/Mage/Adminhtml/Block/Review/Grid/Renderer/Type.php +++ b/app/code/core/Mage/Adminhtml/Block/Review/Grid/Renderer/Type.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Review/Main.php b/app/code/core/Mage/Adminhtml/Block/Review/Main.php index 930bed3c476e33aee60f25b0ed1f1bafffab86c1..72e595e6804ae6a568c18e029d7dc4e443d8e5d5 100644 --- a/app/code/core/Mage/Adminhtml/Block/Review/Main.php +++ b/app/code/core/Mage/Adminhtml/Block/Review/Main.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Review/Product/Grid.php b/app/code/core/Mage/Adminhtml/Block/Review/Product/Grid.php index 0bdfe306fc4e96c5c6f1c03c44f97fe2d47bd0b8..00512541127af8fb81d80dd78dfa73782f1d108d 100644 --- a/app/code/core/Mage/Adminhtml/Block/Review/Product/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Review/Product/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Review/Rating/Detailed.php b/app/code/core/Mage/Adminhtml/Block/Review/Rating/Detailed.php index db64b9a94ffc9df99eeb25c9c370109d7a08c25a..6f14ada7cc90b648707ae03336ec906990f3b6e0 100644 --- a/app/code/core/Mage/Adminhtml/Block/Review/Rating/Detailed.php +++ b/app/code/core/Mage/Adminhtml/Block/Review/Rating/Detailed.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Review/Rating/Summary.php b/app/code/core/Mage/Adminhtml/Block/Review/Rating/Summary.php index 62209d61e4dcbc632e62c7ca4488baa0af05fa4d..03595184c74fb60c63e4ae082feb2c467295cd88 100644 --- a/app/code/core/Mage/Adminhtml/Block/Review/Rating/Summary.php +++ b/app/code/core/Mage/Adminhtml/Block/Review/Rating/Summary.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Creditmemo.php b/app/code/core/Mage/Adminhtml/Block/Sales/Creditmemo.php index f86d390cf4c4685f7d68d52cc20ff619331cbe09..a0c606f32b86374d781cac93624f277d238b79b4 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Creditmemo.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Creditmemo.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Creditmemo/Grid.php b/app/code/core/Mage/Adminhtml/Block/Sales/Creditmemo/Grid.php index 1f1ae7ff878b078192c104e4908023d63d5b55fd..e87763b7b9356e9bd7f3c6d8f33a1ea88fbed200 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Creditmemo/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Creditmemo/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Invoice.php b/app/code/core/Mage/Adminhtml/Block/Sales/Invoice.php index 7d7b0cfe01bcc4166076808d7ca722c8c4e9075f..5ac099b9e756b0c1a58e5ea0d7bdf1eaf92e2a8e 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Invoice.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Invoice.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Invoice/Grid.php b/app/code/core/Mage/Adminhtml/Block/Sales/Invoice/Grid.php index f31944adeb8cca66e233ff2c6fc570de1a07509f..e43ff053c8105b65a42b8829f82e01346cf635bc 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Invoice/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Invoice/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Items/Abstract.php b/app/code/core/Mage/Adminhtml/Block/Sales/Items/Abstract.php index 11c3967157ef4100c8c5508cbfa35375b14c22cb..d02f569b6eb2a23c22901a0c96e8368078a7a9a9 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Items/Abstract.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Items/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Items/Column/Default.php b/app/code/core/Mage/Adminhtml/Block/Sales/Items/Column/Default.php index ef0d0196a7e9cdcce64092ff26aa348072f3dde5..d6181335a82ba0ce6c92149bad0737d002c7e882 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Items/Column/Default.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Items/Column/Default.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Items/Column/Name.php b/app/code/core/Mage/Adminhtml/Block/Sales/Items/Column/Name.php index 7550357243b50614498bb6033c9ca637d11e2df3..320111ec41ca0793c43a1bb114090cfa26f0b453 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Items/Column/Name.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Items/Column/Name.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Items/Column/Name/Grouped.php b/app/code/core/Mage/Adminhtml/Block/Sales/Items/Column/Name/Grouped.php index a216d92eebcf3e91a3ca5f62a7fc3c911343086f..849a342a89868355b10a2ff18d86031efc5dcc12 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Items/Column/Name/Grouped.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Items/Column/Name/Grouped.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Items/Column/Qty.php b/app/code/core/Mage/Adminhtml/Block/Sales/Items/Column/Qty.php index 6a5294d9cc8fa6d7d8b912f9ee843ea46d269aaa..3e85a97fa74ce30c93aa884b31bbb83c0cd997e8 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Items/Column/Qty.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Items/Column/Qty.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Items/Renderer/Configurable.php b/app/code/core/Mage/Adminhtml/Block/Sales/Items/Renderer/Configurable.php index e7d281dc703467f0981a6757251dcd9b471ce238..19ac5d6b048722ad123b6bc160b58d4224bfef4c 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Items/Renderer/Configurable.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Items/Renderer/Configurable.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Items/Renderer/Default.php b/app/code/core/Mage/Adminhtml/Block/Sales/Items/Renderer/Default.php index 6f17e08eba5f4e7b8820015a943249a129b74411..7ec8e74241c825f09bb0063cf1d5c091e3153f3d 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Items/Renderer/Default.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Items/Renderer/Default.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order.php index 2af514c0dae4cff66b14ffb56121bf1363de80b5..d07c8bb425f0ead19517f09c64c07cace121b317 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Abstract.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Abstract.php index 12696b7b068053d4b74864a4b5cd76d0c7b517cb..cfab3669406d4311306587a0f4bc1c1afc71c61e 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Abstract.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Address.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Address.php index e992f1bbeded8d4142ab505af2e79ce1097aa2cf..f2da47b838f3524c705b6d97de28ac85e8c71344 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Address.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Address.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Address/Form.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Address/Form.php index bcb4b98255bf48dc507515c234af6af73378b387..6397dd7239d276fd868f5b37e46ae711ba4df947 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Address/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Address/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Comments/View.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Comments/View.php index d2534e65c617a7e84ade272a3da556456038d132..9c5c17cfacc33e09045afc6bfad0236e6d928873 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Comments/View.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Comments/View.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create.php index 4d95c20ff2db703af302675dcabe91c33411fc55..33c7984ff868c98c0f986e602c9b16612c1804b7 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -56,6 +56,8 @@ class Mage_Adminhtml_Block_Sales_Order_Create extends Mage_Adminhtml_Block_Widge } $this->_updateButton('back', 'id', 'back_order_top_button'); + $this->_updateButton('back', 'onclick', 'setLocation(\'' . $this->getBackUrl() . '\')'); + $this->_updateButton('reset', 'id', 'reset_order_top_button'); if (is_null($customerId)) { @@ -122,4 +124,14 @@ class Mage_Adminhtml_Block_Sales_Order_Create extends Mage_Adminhtml_Block_Widge return $url; } + + /** + * Get URL for back (reset) button + * + * @return string + */ + public function getBackUrl() + { + return $this->getUrl('*/' . $this->_controller . '/'); + } } diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Abstract.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Abstract.php index 55bae951fcea09f122eb5c1cb76cb2f8a97d40a7..71a4e34e8205be2da4cdd1aca263c40b0f6410e7 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Abstract.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Billing/Address.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Billing/Address.php index c67abe60f3b0d206adc74bd4d74385401a8930e1..ecbea6b539c6eb0e42af37a1d57aeac660fc5dc0 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Billing/Address.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Billing/Address.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -62,6 +62,7 @@ class Mage_Adminhtml_Block_Sales_Order_Create_Billing_Address */ protected function _prepareForm() { + $this->setJsVariablePrefix('billingAddress'); parent::_prepareForm(); $this->_form->addFieldNameSuffix('order[billing_address]'); diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Billing/Method.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Billing/Method.php index 55b55bcfa64eb0b87513afde3c615f05dbc78029..b342f5faf1ef0271469b0f734ede602b377cfa8c 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Billing/Method.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Billing/Method.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Billing/Method/Form.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Billing/Method/Form.php index 8f9af3bf45fa266001a1896b46f76aa10351d34e..a3c1661217467fb4fbd0c1bac72560564b613d73 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Billing/Method/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Billing/Method/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Comment.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Comment.php index 050693a66545bb1ab3f71b590ff01d3db59edc81..d6fd2d777ec4c15b3a238e3428fd639a1382b8ab 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Comment.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Comment.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Coupons.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Coupons.php index 5b4cfb38741e368bad8d91ac38e9c2547afa8f54..93ce6e82c134edb41250f4bdb3da44b35bc05e8e 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Coupons.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Coupons.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Coupons/Form.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Coupons/Form.php index 5d25132133d95e2622313e4d5af13b7be3bf2f1f..ac37cfe6efc1fd23afc166801526674e703c4af6 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Coupons/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Coupons/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Customer.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Customer.php index b598a0b33874ea51626f2594f6ceffc0e191d71f..81903b3b289ad969498881b442906bff796a8b12 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Customer.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Customer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Customer/Grid.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Customer/Grid.php index f2b39121dd66f391f01988ea92e083928947f12f..ea55e7b62f95a3ce3e3f3e1e94bf65d5af04c709 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Customer/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Customer/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Data.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Data.php index 66ec5c963b15d2ac6547da9fe0e9e6ba38b3c6bb..8cbd45ab686ed94c76c1f144953e6689f7b878e2 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Data.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Form.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Form.php index 2f52276bdca8d00669b087946178b981119e56c3..007d0f70ebacd00905191ddbaf4143fc6cbbed87 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Form/Abstract.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Form/Abstract.php index 3d04629278d9d8d60edc5a2ffae9078b3d4c9e1f..547ff84a8bdd471f6dbd6e1731a5b6410223dc2c 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Form/Abstract.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Form/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -148,7 +148,7 @@ abstract class Mage_Adminhtml_Block_Sales_Order_Create_Form_Abstract if ($inputType) { $element = $form->addField($attribute->getAttributeCode(), $inputType, array( 'name' => $attribute->getAttributeCode(), - 'label' => $attribute->getStoreLabel(), + 'label' => $this->__($attribute->getStoreLabel()), 'class' => $attribute->getFrontend()->getClass(), 'required' => $attribute->getIsRequired(), )); diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Form/Account.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Form/Account.php index 636361558f3a12139ab1b13755e5e78dec5fa465..b4d009cd945968910ff7f9c49b8d37c3211548fd 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Form/Account.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Form/Account.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Form/Address.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Form/Address.php index 515237c86151f9dd3fa9fd889504966a0011d5a1..9d6d0f57e1eadda5ce4e34e349e23c9c67439de4 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Form/Address.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Form/Address.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -31,7 +31,8 @@ * @package Mage_Adminhtml * @author Magento Core Team <core@magentocommerce.com> */ -class Mage_Adminhtml_Block_Sales_Order_Create_Form_Address extends Mage_Adminhtml_Block_Sales_Order_Create_Form_Abstract +class Mage_Adminhtml_Block_Sales_Order_Create_Form_Address + extends Mage_Adminhtml_Block_Sales_Order_Create_Form_Abstract { /** * Customer Address Form instance @@ -83,7 +84,9 @@ class Mage_Adminhtml_Block_Sales_Order_Create_Form_Address extends Mage_Adminhtm foreach ($this->getAddressCollection() as $address) { $addressForm->setEntity($address); - $data[$address->getId()] = $addressForm->outputData(Mage_Customer_Model_Attribute_Data::OUTPUT_FORMAT_JSON); + $data[$address->getId()] = $addressForm->outputData( + Mage_Customer_Model_Attribute_Data::OUTPUT_FORMAT_JSON + ); } return Mage::helper('Mage_Core_Helper_Data')->jsonEncode($data); } @@ -169,6 +172,15 @@ class Mage_Adminhtml_Block_Sales_Order_Create_Form_Address extends Mage_Adminhtm ); } + // Set custom renderer for VAT field if needed + $vatIdElement = $this->_form->getElement('vat_id'); + if ($vatIdElement && $this->getDisplayVatValidationButton() !== false) { + $vatIdElement->setRenderer( + $this->getLayout()->createBlock('Mage_Adminhtml_Block_Customer_Sales_Order_Address_Form_Renderer_Vat') + ->setJsVariablePrefix($this->getJsVariablePrefix()) + ); + } + return $this; } diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Giftmessage.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Giftmessage.php index 19a94e05f4f62dd5222542dc51802cdab4fab2be..6d2fd6a0ef9d38a1fbc313f5dc28022a2f0b404f 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Giftmessage.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Giftmessage.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Giftmessage/Form.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Giftmessage/Form.php index 714f3c3acab4e0cfd7286528c992a8a849761c48..eb6c30d1412e0b15519e6b468320be1972357d4b 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Giftmessage/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Giftmessage/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Header.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Header.php index da7a157ad20fcd5c4cb7b33e4082f73f46b845fe..bc4163f3bc16f254c956ca9730435f7dae69ebca 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Header.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Header.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Items.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Items.php index 2bfa33bb7d307781961dc4b91c2a5bd608e889af..6916e636e341ba82d0fac1c273932bef8f1360b6 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Items.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Items.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -29,38 +29,78 @@ * * @category Mage * @package Mage_Adminhtml - * @author Magento Core Team <core@magentocommerce.com> + * @author Magento Core Team <core@magentocommerce.com> */ class Mage_Adminhtml_Block_Sales_Order_Create_Items extends Mage_Adminhtml_Block_Sales_Order_Create_Abstract { + /** + * Contains button descriptions to be shown at the top of accordion + * @var array + */ + protected $_buttons = array(); + + /** + * Define block ID + */ public function __construct() { parent::__construct(); $this->setId('sales_order_create_items'); } + /** + * Accordion header text + * + * @return string + */ public function getHeaderText() { return Mage::helper('Mage_Sales_Helper_Data')->__('Items Ordered'); } + /** + * Returns all visible items + * + * @return array + */ public function getItems() { -// return $this->getQuote()->getAllItems(); return $this->getQuote()->getAllVisibleItems(); } + /** + * Add button to the items header + * + * @param $args array + */ + public function addButton($args) + { + $this->_buttons[] = $args; + } + + /** + * Render buttons and return HTML code + * + * @return string + */ public function getButtonsHtml() { - $addButtonData = array( - 'label' => Mage::helper('Mage_Sales_Helper_Data')->__('Add Products'), - 'onclick' => "order.productGridShow(this)", - 'class' => 'add', - ); - return $this->getLayout()->createBlock('Mage_Adminhtml_Block_Widget_Button')->setData($addButtonData)->toHtml(); + $html = ''; + // Make buttons to be rendered in opposite order of addition. This makes "Add products" the last one. + $this->_buttons = array_reverse($this->_buttons); + foreach ($this->_buttons as $buttonData) { + $html .= $this->getLayout()->createBlock('Mage_Adminhtml_Block_Widget_Button')->setData($buttonData)->toHtml(); + } + + return $html; } + /** + * Return HTML code of the block + * + * @return string + */ protected function _toHtml() { if ($this->getStoreId()) { diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Items/Grid.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Items/Grid.php index 90540c0856b93b451e5fb9e7c6a8b1b1bf77b48b..83d021a83468e6c1d939d606df60bdd7fcff3a6d 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Items/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Items/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Load.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Load.php index cfa1cc3c759e7987eacfa41c831d81999d0998d2..b0769e4d9dcad5fa19fc5b44810593dfe15ee08b 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Load.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Load.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Messages.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Messages.php index 125712a85eb06797c2b138194a506eca01aabfc7..302cc8d9429a1d8e3bbdcb91dbdba695e95b2c6a 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Messages.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Messages.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Newsletter.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Newsletter.php index bc67073ca88da1c6c2ca063583c42dc16a4ec1ad..b84e140f8b0dd7344fa01cc2952dc985f6231aa7 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Newsletter.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Newsletter.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Newsletter/Form.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Newsletter/Form.php index 623a7cb0547961a7978898f4a7ace8808d980231..e2bebac3e43273cf22a50db6ca7502932dc1781a 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Newsletter/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Newsletter/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Search.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Search.php index 31c4067c2a17839311c302c26dc49712b980378b..f49908d5e987cbb1363e59191f8ad28b5a855743 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Search.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Search.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Search/Grid.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Search/Grid.php index 1b9a2e207acfdeacfee800313cbbe7d28e2dd41e..647959a771ec9ad661125af83d92c8d854e91ebb 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Search/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Search/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Search/Grid/Renderer/Price.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Search/Grid/Renderer/Price.php index 2ba1493ea6674e5d4c059cdf0264bb76517faca4..49c7e653896365a9e34291d0ed762caecaeb55ea 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Search/Grid/Renderer/Price.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Search/Grid/Renderer/Price.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -31,7 +31,8 @@ * @package Mage_Adminhtml * @author Magento Core Team <core@magentocommerce.com> */ -class Mage_Adminhtml_Block_Sales_Order_Create_Search_Grid_Renderer_Price extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Price +class Mage_Adminhtml_Block_Sales_Order_Create_Search_Grid_Renderer_Price extends + Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Price { /** * Render minimal price for downloadable products @@ -41,7 +42,7 @@ class Mage_Adminhtml_Block_Sales_Order_Create_Search_Grid_Renderer_Price extends */ public function render(Varien_Object $row) { - if ($row->getTypeId() == Mage_Downloadable_Model_Product_Type::TYPE_DOWNLOADABLE) { + if ($row->getTypeId() == 'downloadable') { $row->setPrice($row->getPrice()); } return parent::render($row); diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Search/Grid/Renderer/Product.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Search/Grid/Renderer/Product.php index 29ec38c87b98d5f7a824c872d9d482026ba1c3e3..4f3db1504fda2e624beab79daf59833df3cc633c 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Search/Grid/Renderer/Product.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Search/Grid/Renderer/Product.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Search/Grid/Renderer/Qty.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Search/Grid/Renderer/Qty.php index 206279dd546f11bff8f95649e99fe1c42fec4c02..98ee55f9b32c03c22413fef60ece3c8207b38870 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Search/Grid/Renderer/Qty.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Search/Grid/Renderer/Qty.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Shipping/Address.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Shipping/Address.php index 3e7b68329b65275f42bc1f567e4111f65f336382..24f7277e740a8342552e8b8ac826e72d5974c8dc 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Shipping/Address.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Shipping/Address.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -62,6 +62,7 @@ class Mage_Adminhtml_Block_Sales_Order_Create_Shipping_Address */ protected function _prepareForm() { + $this->setJsVariablePrefix('shippingAddress'); parent::_prepareForm(); $this->_form->addFieldNameSuffix('order[shipping_address]'); diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Shipping/Method.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Shipping/Method.php index f66bd6be84163f4bc68bf9a2d86acde39ada1477..7e3aa7e706136a76a0d293ef0c5f07a21e5d7701 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Shipping/Method.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Shipping/Method.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Shipping/Method/Form.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Shipping/Method/Form.php index 8c2edc39038204e6dcb6c048a04aae4c634e86b6..fb67af04aa091c98da35b98b805058240ea49277 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Shipping/Method/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Shipping/Method/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar.php index 90a42573d9311401ba4a24008c6dc4893cdd0412..689b4ac7cfdc1e5a6873e2fbf0f3cf7c2681fe67 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar/Abstract.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar/Abstract.php index 7a6d76ddf63bf01ead10126eda02427e13a2db5d..c34c0a148bcfd18b5b059f05156c79343efa19a4 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar/Abstract.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar/Cart.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar/Cart.php index cdba1633a0277f8eb9296c6423ef3f7e8f7252bc..7c6a203b1ee51675499a64cab936612769a80577 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar/Cart.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar/Cart.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -31,7 +31,8 @@ * @package Mage_Adminhtml * @author Magento Core Team <core@magentocommerce.com> */ -class Mage_Adminhtml_Block_Sales_Order_Create_Sidebar_Cart extends Mage_Adminhtml_Block_Sales_Order_Create_Sidebar_Abstract +class Mage_Adminhtml_Block_Sales_Order_Create_Sidebar_Cart + extends Mage_Adminhtml_Block_Sales_Order_Create_Sidebar_Abstract { /** * Storage action on selected item @@ -93,4 +94,24 @@ class Mage_Adminhtml_Block_Sales_Order_Create_Sidebar_Cart extends Mage_Adminhtm { return $item->getProduct()->getId(); } + + /** + * Prepare layout + * + * Add button that clears customer's shopping cart + * + * @return Mage_Adminhtml_Block_Sales_Order_Create_Sidebar_Cart + */ + protected function _prepareLayout() + { + $deleteAllConfirmString = Mage::helper('Mage_Sales_Helper_Data')->__('Are you sure you want to delete all items from shopping cart?'); + $button = $this->getLayout()->createBlock('Mage_Adminhtml_Block_Widget_Button')->setData(array( + 'label' => Mage::helper('Mage_Sales_Helper_Data')->__('Clear Shopping Cart'), + 'onclick' => 'order.clearShoppingCart(\'' . $deleteAllConfirmString . '\')', + 'style' => 'float: right;' + )); + $this->setChild('empty_customer_cart_button', $button); + + return parent::_prepareLayout(); + } } diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar/Compared.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar/Compared.php index 3db14aba45100356acbcc64cc8fa38fdec3c621e..fa648b92cb3d75eaaddb7e4cd60bcbd83d661c0a 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar/Compared.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar/Compared.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar/Pcompared.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar/Pcompared.php index 3915111e4638f285b56cc0c229b5fa5c07896c39..2de07b73f1248bfe4248125e114c6bd446d01406 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar/Pcompared.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar/Pcompared.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar/Pviewed.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar/Pviewed.php index eb1c63e91271bcd1f327bc2b4f284bea86eca3ea..b2441db7fea6040d4b1242b43b57d2c2913fbc0a 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar/Pviewed.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar/Pviewed.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar/Reorder.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar/Reorder.php index ec4e111274222c725e124823027eaf8fd4abf297..db4b111deca8e4a68950ad9c9ffd5843478492ad 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar/Reorder.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar/Reorder.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar/Viewed.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar/Viewed.php index 2da79490650a5af95e243a94ecece9658c5d2daa..5b1146583b766e7cbe8573d68b1918edf8360e67 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar/Viewed.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar/Viewed.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar/Wishlist.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar/Wishlist.php index 1ae558edeb04172da6291a048e20b2dd8f5951e7..973be1af5015f78b8038e6247949f98c13fe0ec7 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar/Wishlist.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar/Wishlist.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Store.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Store.php index 4006b547618a27d68d933671b0108173d3464314..4d3a1ef1923e7481a82c9fb7d0bab04e7622f445 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Store.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Store.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Store/Select.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Store/Select.php index f18ecbedd911b06fd95eb982afe7f314f672944b..323f0d1710a275d5d6a218b3018a08dcb26b37d7 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Store/Select.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Store/Select.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Totals.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Totals.php index 5302951eff57444354f1d52b4904c9bbbfce6eda..b287f80c49fcff13470a0db370bc3a526cbceb7c 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Totals.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Totals.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -97,13 +97,6 @@ class Mage_Adminhtml_Block_Sales_Order_Create_Totals extends Mage_Adminhtml_Bloc $html .= $this->renderTotal($total, $area, $colspan); } return $html; - - $html = ''; - foreach($this->getTotals() as $total) { - $html .= $this->renderTotal($total, $area, $colspan); - } - - return $html; } public function canSendNewOrderConfirmationEmail() diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Totals/Default.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Totals/Default.php index a4dfd54a69cbe818b3f8e13d95b5a6f6e6a4b150..954752fa4d97937e1b723bb3f7de66942cf4640e 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Totals/Default.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Totals/Default.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Totals/Discount.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Totals/Discount.php index 4ba00af27bdedfaf36b0a990969a3816bc9687f6..82b1279a48e19b86776edb466116caf318fc5981 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Totals/Discount.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Totals/Discount.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Totals/Grandtotal.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Totals/Grandtotal.php index f1b2d9f8ff888d65fac237bf7bd53486099a6f86..e2a7d6b794ea620b01410105e4cb1fa04acbf565 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Totals/Grandtotal.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Totals/Grandtotal.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Totals/Shipping.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Totals/Shipping.php index 8067f28ba917a13b2a6883b3157187c7169b6632..da3885c390e91199201976fb7b8c4e1c3b92a1c8 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Totals/Shipping.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Totals/Shipping.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Totals/Subtotal.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Totals/Subtotal.php index 7e3ede85d2e4fa63c8c789a9d57a4846d82795ed..d870fef58cb94e1c74f678e9b6141c72560a3128 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Totals/Subtotal.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Totals/Subtotal.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Totals/Table.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Totals/Table.php index 934a90ba120b3b4864e8d0531673c7e36d27c978..c21d1eec121f1764c9c54b0b01ff542caebaa0a1 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Totals/Table.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Totals/Table.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Totals/Tax.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Totals/Tax.php index 9ca77ed307e16d7c564a542f4e540296b77d5075..da376ed16ea4456c91d4c92d95637ac1ad0087e5 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Totals/Tax.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Totals/Tax.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/Create.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/Create.php index ef91eea22ae7ff2030c55fde7eaee1c509348f2e..b158afce4bb69ff0d95ec5431dcd7f613d352e4b 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/Create.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/Create.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -67,20 +67,12 @@ class Mage_Adminhtml_Block_Sales_Order_Creditmemo_Create extends Mage_Adminhtml_ public function getHeaderText() { if ($this->getCreditmemo()->getInvoice()) { - $header = Mage::helper('Mage_Sales_Helper_Data')->__('New Credit Memo for Invoice #%s', - $this->getCreditmemo()->getInvoice()->getIncrementId() - ); + $header = Mage::helper('Mage_Sales_Helper_Data')->__('New Credit Memo for Invoice #%s', $this->getCreditmemo()->getInvoice()->getIncrementId()); } else { - $header = Mage::helper('Mage_Sales_Helper_Data')->__('New Credit Memo for Order #%s', - $this->getCreditmemo()->getOrder()->getRealOrderId() - ); + $header = Mage::helper('Mage_Sales_Helper_Data')->__('New Credit Memo for Order #%s', $this->getCreditmemo()->getOrder()->getRealOrderId()); } - /*$header = Mage::helper('Mage_Sales_Helper_Data')->__('New Credit Memo for Order #%s | Order Date: %s | Customer Name: %s', - $this->getCreditmemo()->getOrder()->getRealOrderId(), - $this->formatDate($this->getCreditmemo()->getOrder()->getCreatedAt(), 'medium', true), - $this->getCreditmemo()->getOrder()->getCustomerName() - );*/ + return $header; } @@ -91,4 +83,4 @@ class Mage_Adminhtml_Block_Sales_Order_Creditmemo_Create extends Mage_Adminhtml_ array('order_id' => $this->getCreditmemo() ? $this->getCreditmemo()->getOrderId() : null) ); } -} +} \ No newline at end of file diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/Create/Adjustments.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/Create/Adjustments.php index 42f51abe56ef85a1ca549f18a8213f09d9dbde8e..6faee9e4a6c22cd21dbbdeab09557c7a2506b416 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/Create/Adjustments.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/Create/Adjustments.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Adminhtml_Block_Sales_Order_Creditmemo_Create_Adjustments extends Mage_Adminhtml_Block_Template diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/Create/Form.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/Create/Form.php index b103c01d878ecaa9ae10522eeea7a0a7717de7e0..5e564020d652dedb5735ebdae9733c8dd2c8dc84 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/Create/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/Create/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/Create/Items.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/Create/Items.php index 1858cfd3a05ccc8ed79b328e8ca0f951bc59a1a2..e7ad2d8423b440142dc75c7473f90b87a577e02b 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/Create/Items.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/Create/Items.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/Totals.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/Totals.php index 8c4b79cd01bba8cda3ceb549a1fd9cba7c3c2a28..ed434c5102b9dcf917add707fcdae241ef72df94 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/Totals.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/Totals.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/View.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/View.php index 5a4b2364ae83601439fba73fac976efbb8909b94..27cbdb7fd7f60f45dc77947c4c982ab3ee1a7be2 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/View.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/View.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/View/Comments.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/View/Comments.php index fbade9489abf0efd361ec5267a73d1dbe50ab580..236535dbd8d6bfd3c7bafe25ec7f541edf39f389 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/View/Comments.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/View/Comments.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/View/Form.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/View/Form.php index eea699be8dd7c03e0dcc81767ab8fab0df810e10..7c0033050e82ef72d6119244acec0f7439cec8ea 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/View/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/View/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/View/Items.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/View/Items.php index c2cc67c19b0a076a9aaea6baf50fbcbcd204cf8d..322044c11d2f6346f82a451de55d3316de1a2f62 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/View/Items.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/View/Items.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Grid.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Grid.php index 91e411ab6436831c167de2eddef8bb8172e66609..a81933f28224d78b883d7cb7a802ee943d1442e0 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Invoice/Create.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Invoice/Create.php index aa3a7341eaf6bb30d75285f86f4b9a29207ee59f..f0cbb24f17526c985cd8e36d7f601cffb2b1e5e3 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Invoice/Create.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Invoice/Create.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Invoice/Create/Form.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Invoice/Create/Form.php index e6332e90498621b03a22fefc91669bd1af071b25..4722b59e6e8626839638209e8395d4bd2f80518f 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Invoice/Create/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Invoice/Create/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Invoice/Create/Items.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Invoice/Create/Items.php index 43ed5147c50afe1cf71743886b5aa9c289b1fc27..6d860d55fba703598c111157ca822966e4d9d473 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Invoice/Create/Items.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Invoice/Create/Items.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Invoice/Create/Tracking.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Invoice/Create/Tracking.php index 543a4cbadf8c34a737b5022853f1c2eb08dbfcd9..3ddca10d5fbd229a0478e25b406770af6363db10 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Invoice/Create/Tracking.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Invoice/Create/Tracking.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Invoice/Totals.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Invoice/Totals.php index 2461dfd0c03b49662923bddb583761603b95ee71..af6f2c598598a71456d983cf4c28e71f30162d22 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Invoice/Totals.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Invoice/Totals.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Invoice/View.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Invoice/View.php index a132b246f590f0deb4543d7d161669052e2592c6..371728fe716c2e219e95e633d8a5a648d5ae879c 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Invoice/View.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Invoice/View.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Invoice/View/Comments.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Invoice/View/Comments.php index c3bb5d9eeebd2b1db3f2a58c0a6ca4a48f619e8a..510ae32ad6e2982334e15b43c7452efa74bb568c 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Invoice/View/Comments.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Invoice/View/Comments.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Invoice/View/Form.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Invoice/View/Form.php index 870c39060262d2bf1752c957ceb6e454a93326f3..47b29fb3bff1924a3ad8bc7430cf90c4d81c9e60 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Invoice/View/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Invoice/View/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Invoice/View/Items.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Invoice/View/Items.php index 0a3ed08628faaba5c651da8f338e301f6661b4f8..1cc3ecb4f6f5aca913db643ae21d387821a5f4dd 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Invoice/View/Items.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Invoice/View/Items.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Payment.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Payment.php index 5f98ec54984e4674ccfef6574dc0c20ed0f48ef3..aa90eeb03bed67c6b0193ff93a9d88022bb99739 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Payment.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Payment.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/Create.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/Create.php index fee5f6c70a384bb58ae00937ed2eea8d4ad60098..49dffcb542c50ad6154c936641e0d58e5fe59412 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/Create.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/Create.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/Create/Form.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/Create/Form.php index 8340be7b75d94b6da20383f9f82577572dbc61ae..5de4d370581328003faf82347cd937e0f419c494 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/Create/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/Create/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/Create/Items.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/Create/Items.php index 8c97862ec4c6fcdc1d20b45ab2113c697d52f61e..2b3e2fb7b77f27de564e2f0dc13d571a33daf43d 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/Create/Items.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/Create/Items.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -129,6 +129,7 @@ class Mage_Adminhtml_Block_Sales_Order_Shipment_Create_Items extends Mage_Adminh */ public function canCreateShippingLabel() { - return $this->getOrder()->getShippingCarrier()->isShippingLabelsAvailable(); + $shippingCarrier = $this->getOrder()->getShippingCarrier(); + return $shippingCarrier && $shippingCarrier->isShippingLabelsAvailable(); } } diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/Create/Tracking.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/Create/Tracking.php index 9760ec275fd87f4310a8174d938ee0adcb5d8396..3835aca15cb712e494900be82177b6ee4fc24bb0 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/Create/Tracking.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/Create/Tracking.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/Packaging.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/Packaging.php index 69fc4dbf092f458b08335b636e89834a02ed1621..20d93cda90039f56e9c7186a853710de437085bd 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/Packaging.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/Packaging.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/Packaging/Grid.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/Packaging/Grid.php index 0876b950178bc4b6f886a356f1dc2bc3ab5fa374..9dea4d955afb69f1cc740e4e931c6eea9a9b5432 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/Packaging/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/Packaging/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/Tracking/Info.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/Tracking/Info.php index 5d2122cb73273a0867520085fba34db96964337c..aeae658c07737667061f47ddfeb00bb70d54f6df 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/Tracking/Info.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/Tracking/Info.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/View.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/View.php index 74b0ef0eb3f970644782da37065ccd1bc6d87a8f..27e7b3e853f19dc33baf6661d8f338f6f81b2fa5 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/View.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/View.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/View/Comments.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/View/Comments.php index ebe389ee5186d6d391f6d551659ba231e49b32f2..d4c9935462a8ea7499ba31a66aee526617b0a928 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/View/Comments.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/View/Comments.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/View/Form.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/View/Form.php index c663c939615b2d877feb0c21d5b4c65f7dacd27a..07c04195c34e0ff953bf18821438112b9aa1e311 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/View/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/View/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -118,10 +118,11 @@ class Mage_Adminhtml_Block_Sales_Order_Shipment_View_Form extends Mage_Adminhtml /** * Check is carrier has functionality of creation shipping labels * - * @return boolean + * @return bool */ public function canCreateShippingLabel() { - return $this->getOrder()->getShippingCarrier()->isShippingLabelsAvailable(); + $shippingCarrier = $this->getOrder()->getShippingCarrier(); + return $shippingCarrier && $shippingCarrier->isShippingLabelsAvailable(); } } diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/View/Items.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/View/Items.php index 02ed083cd1aad1c3ffd78f731e8ad048ed010f01..8023a12b4ac26c4e062a0a243cc19a1e765443ed 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/View/Items.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/View/Items.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/View/Tracking.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/View/Tracking.php index 3845b591c81e49b2d4e47fa6d1c4a7107643f3e8..f2d40d0edc84d22d947c85055307c9e7922c8892 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/View/Tracking.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/View/Tracking.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status.php index 6e0ea63a4e0531d4660c0795c5147fd1e7fdce37..79b1703fe12abe88b2cab4a4433fe2f53415544f 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status/Assign.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status/Assign.php index 43e96e70434f9ba4ca1960eb9c99f614037e7196..31667725049b54ba3086577e5508673746040bde 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status/Assign.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status/Assign.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status/Assign/Form.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status/Assign/Form.php index 7ad9eac26be1fb7e96d9cc8153b7e9d69933f220..2bd5cc4672ba5ff5cec3c46447cf9cbcb94b3760 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status/Assign/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status/Assign/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status/Edit.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status/Edit.php index fa6555fb9e260c6255100d641ee371ecfc9d8678..cc2535138ceee7ea27b729cfaf932fd94e17342b 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status/Edit.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status/Edit/Form.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status/Edit/Form.php index a168cc833343ebb18e7c30ccf8e49bf40992711b..b6b8dbe8628494cd91a5d12aabe8fb93686cd17d 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status/Edit/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status/Edit/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status/Grid.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status/Grid.php index 9d72ca0b9397a404a2880cd3ecae11242babda6a..00d17b8357bacb690af87f031154d51dacb84fb7 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status/New.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status/New.php index 1ee76e7b8e8e14e08cd070e7f13ccc073a17d3a4..3a0b65aa7fed5fcb66607525f3d9ef2cbf07154c 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status/New.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status/New.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status/New/Form.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status/New/Form.php index 680a263ad7de6e45b051d920ddd14d09b9fff34b..bc2b79a60c4b700bec65b87b6703d032e431d570 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status/New/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Status/New/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Totalbar.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Totalbar.php index c166b8850b841eacfa5c52fa047e9aa822983732..35e371bed285f93cd87c9f670e3e3611919825fb 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Totalbar.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Totalbar.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Totals.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Totals.php index 7a3bbf5b70f056a2b13f6aa6e065878acc1056f7..591dc74dec16b33e4ec7aae0d0a1449d47d8fe77 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Totals.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Totals.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Totals/Item.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Totals/Item.php index 3efd8cbe19584c0045ab7c4bbe4b572e5f24b478..88a7433308cb404d4fa179a3de17858cf28bc9a6 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Totals/Item.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Totals/Item.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Totals/Tax.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Totals/Tax.php index 704193f3335ce4c4e73eb7d4bcbfc4442483efef..acfe53235de329dd865595e3e1c50c08dd6f0ca2 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Totals/Tax.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Totals/Tax.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View.php index 6973726b88a559aeac51760b95501cfe9ee90bc6..ad29f707314f84d7d5ea3ccc5e96896f040fed00 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Form.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Form.php index 3b4ab89523729a1476395e4b97e39b7539abc95f..6eedbaa4a2fa8deac50b28e76296be268be33ae1 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Giftmessage.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Giftmessage.php index a35c4bf1bc6a9156058021aabd3280d2bc57a9fd..a2b4856cdd73bc06433cfd8a24c0f25acb4d1999 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Giftmessage.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Giftmessage.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/History.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/History.php index 1e71c04e742663037619bef8ef114c201c2d0f74..2f0482dae3f6ca41b5e47f4c5d0f0e464aebffed 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/History.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/History.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Info.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Info.php index 929bf5c4b2fa46de29d1ffce3b423a6052d4653f..c443a089af7ad2a4038af0e4e0a556533b07735f 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Info.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Info.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Items.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Items.php index 3423562b6ee143192d514a052468ca2fc1227a42..47c3572563f79d0ef83b54aa5afc4f4eed4ff5fb 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Items.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Items.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Items/Renderer/Default.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Items/Renderer/Default.php index 1225b0dec6e41f1fc6513b3622c41c89185d70aa..f23511b3edf1e1dad0e1d83cdf0cb149bd54bce5 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Items/Renderer/Default.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Items/Renderer/Default.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Messages.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Messages.php index debf3e7d777e53b5eb875e46c143cfd5eb4a0ca3..efcac73c6298e8148a4fc44d8285f042beec5c0e 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Messages.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Messages.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/Creditmemos.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/Creditmemos.php index 0f8b9256f49d059fb92bd220a45e1cef8e1627e3..5487b05b6065bf47705917bf2c392efbd4358e72 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/Creditmemos.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/Creditmemos.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/History.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/History.php index b2131fbd7ec279366f83c9c7d2167b450e2984fb..b88dfe21739d39ee7d679429ee2003a99c21f2d4 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/History.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/History.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/Info.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/Info.php index 95c4c7cc999e5b7d232f67b7773acbcac2e874eb..f8fece3e7de496338d99a75629babbe76d7f501f 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/Info.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/Info.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/Invoices.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/Invoices.php index 9a420c24b3a7936670f302aa06c99bdbf170d9b3..c29481f2241bb4b34ff7e243c31a569a5fc95183 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/Invoices.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/Invoices.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/Shipments.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/Shipments.php index cfa913424c25791c5f0bf1597e9d2e030aa9586b..04a41b14224c1b3ff111999b41ebc4eccfe8b198 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/Shipments.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/Shipments.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/Transactions.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/Transactions.php index aabb99f4636292afbf5def2faa717764f959aae6..a4fbacc871194236af6c30bb0dec1e75b979d00b 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/Transactions.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/Transactions.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tabs.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tabs.php index 423bc75b3fbd37aa0278035df3369f507c4b8951..9fb61ff9b2b2ed26fcdf77523e430b382d11d59d 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tabs.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tabs.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Reorder/Renderer/Action.php b/app/code/core/Mage/Adminhtml/Block/Sales/Reorder/Renderer/Action.php index d4d9f32651748bbcbad8a886adaa400c532673f7..0f6258573dc5d8fa22717a81794391643e040079 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Reorder/Renderer/Action.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Reorder/Renderer/Action.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Shipment.php b/app/code/core/Mage/Adminhtml/Block/Sales/Shipment.php index bd44b33aac0062ec5e332ea54f224bfe9daefab9..41c0518bdc20f95fc22b74d32859238be5b4317f 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Shipment.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Shipment.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Shipment/Grid.php b/app/code/core/Mage/Adminhtml/Block/Sales/Shipment/Grid.php index ef06d49a6c6ebaba8d71cac5cdc3d30470f44d87..8fac4a2a100157cb1413df1bc449bf1565d8da63 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Shipment/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Shipment/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Totals.php b/app/code/core/Mage/Adminhtml/Block/Sales/Totals.php index c814dff61730ac6333c5ecc1b89da72090a891db..63624c56a8d1fa2f4ebc07c027222862d8f3e8f3 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Totals.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Totals.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Transactions.php b/app/code/core/Mage/Adminhtml/Block/Sales/Transactions.php index 5be551236bb3f57372105a87007e601a7516b4ae..f06e8c9053d2a953dd6c9d3bd68ddeca17dce60c 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Transactions.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Transactions.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Transactions/Child/Grid.php b/app/code/core/Mage/Adminhtml/Block/Sales/Transactions/Child/Grid.php index 8476e5622f55b5007958dbeefef6a2345945fcc2..8ad17f2feecf80801da0949ecb9646a3bb04fdf4 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Transactions/Child/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Transactions/Child/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Transactions/Detail.php b/app/code/core/Mage/Adminhtml/Block/Sales/Transactions/Detail.php index de3e9e042cf4932a9115004ff680a079bba67c7d..bad4781fff7f29164b678caf895a0af4a141447d 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Transactions/Detail.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Transactions/Detail.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -78,10 +78,7 @@ class Mage_Adminhtml_Block_Sales_Transactions_Detail extends Mage_Adminhtml_Bloc */ public function getHeaderText() { - return Mage::helper('Mage_Sales_Helper_Data')->__("Transaction # %s | %s", - $this->_txn->getTxnId(), - $this->formatDate($this->_txn->getCreatedAt(), Mage_Core_Model_Locale::FORMAT_TYPE_MEDIUM, true) - ); + return Mage::helper('Mage_Sales_Helper_Data')->__("Transaction # %s | %s", $this->_txn->getTxnId(), $this->formatDate($this->_txn->getCreatedAt(), Mage_Core_Model_Locale::FORMAT_TYPE_MEDIUM, true)); } protected function _toHtml() diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Transactions/Detail/Grid.php b/app/code/core/Mage/Adminhtml/Block/Sales/Transactions/Detail/Grid.php index cf50e6b008b34aecb3b94297632fbb80aac1f7a3..c844e1bd5e9506ad16395fce92608944e82f6de1 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Transactions/Detail/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Transactions/Detail/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Transactions/Grid.php b/app/code/core/Mage/Adminhtml/Block/Sales/Transactions/Grid.php index b290c5bd915697af4dddaa298e382585918aab6b..6500065dc4811b448c715fc58c9d77cc951a6aa7 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Transactions/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Transactions/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Shipping/Carrier/Tablerate/Grid.php b/app/code/core/Mage/Adminhtml/Block/Shipping/Carrier/Tablerate/Grid.php index 4ca852ed61ce00d4fea022e64d9d0a1c92a775cf..272811022f8994ff459ec94593707d3752e80211 100644 --- a/app/code/core/Mage/Adminhtml/Block/Shipping/Carrier/Tablerate/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Shipping/Carrier/Tablerate/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sitemap.php b/app/code/core/Mage/Adminhtml/Block/Sitemap.php index 6d799081a2d702a3c5eb94698a4976362198825b..1828ebfee0714fa8b3180a986b14154f132f533b 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sitemap.php +++ b/app/code/core/Mage/Adminhtml/Block/Sitemap.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sitemap/Edit.php b/app/code/core/Mage/Adminhtml/Block/Sitemap/Edit.php index 10d2a120835ea1f5cb21d90d0e82f74d8b17f3e4..bb9e211a23d8f219373253bea44e9165c5ed26a9 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sitemap/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/Sitemap/Edit.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sitemap/Edit/Form.php b/app/code/core/Mage/Adminhtml/Block/Sitemap/Edit/Form.php index 408b95ffa1cc3e5a5e1ca5922054f56a76adb77b..13a7ce2773f1f4d3430ff0dc5c2f20169c672fcf 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sitemap/Edit/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Sitemap/Edit/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sitemap/Grid.php b/app/code/core/Mage/Adminhtml/Block/Sitemap/Grid.php index bc7580d5b2640f16814065bd659787e6bc9754c3..6beaf53884ea563283d1a6aabc78b76f8353a967 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sitemap/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Sitemap/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sitemap/Grid/Renderer/Action.php b/app/code/core/Mage/Adminhtml/Block/Sitemap/Grid/Renderer/Action.php index 38b4ace6788025d9ce727daeded32001d19a7ed5..56ec63bf18550a24010b858bca070fb611e58848 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sitemap/Grid/Renderer/Action.php +++ b/app/code/core/Mage/Adminhtml/Block/Sitemap/Grid/Renderer/Action.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sitemap/Grid/Renderer/Link.php b/app/code/core/Mage/Adminhtml/Block/Sitemap/Grid/Renderer/Link.php index 28bc6dc00819421635e3d39259a9db17ec5182b1..4feee719d22f983ffc16376b808c8929167f9afb 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sitemap/Grid/Renderer/Link.php +++ b/app/code/core/Mage/Adminhtml/Block/Sitemap/Grid/Renderer/Link.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Sitemap/Grid/Renderer/Time.php b/app/code/core/Mage/Adminhtml/Block/Sitemap/Grid/Renderer/Time.php index e19f43feadd80306e2fdf0483676d78473c2ff30..426d7109af6c6d7c3d63d1faf5c4a2b5b2779202 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sitemap/Grid/Renderer/Time.php +++ b/app/code/core/Mage/Adminhtml/Block/Sitemap/Grid/Renderer/Time.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Store/Switcher.php b/app/code/core/Mage/Adminhtml/Block/Store/Switcher.php index 8dced1495761eae1969c9f2101f4730491163ebc..6e22b106231b449835cb97832dc3b89c7b3e54e8 100644 --- a/app/code/core/Mage/Adminhtml/Block/Store/Switcher.php +++ b/app/code/core/Mage/Adminhtml/Block/Store/Switcher.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -29,17 +29,34 @@ * * @category Mage * @package Mage_Adminhtml - * @author Magento Core Team <core@magentocommerce.com> + * @author Magento Core Team <core@magentocommerce.com> */ class Mage_Adminhtml_Block_Store_Switcher extends Mage_Adminhtml_Block_Template { + /** + * Key in config for store switcher hint + */ + const XPATH_HINT_KEY = 'store_switcher'; + /** * @var array */ protected $_storeIds; + /** + * Name of store variable + * + * @var string + */ protected $_storeVarName = 'store'; + /** + * Url for store switcher hint + * + * @var string + */ + protected $_hintUrl; + /** * @var bool */ @@ -206,4 +223,38 @@ class Mage_Adminhtml_Block_Store_Switcher extends Mage_Adminhtml_Block_Template } return $this->_hasDefaultOption; } + + /** + * Return url for store switcher hint + * + * @return string + */ + public function getHintUrl() + { + if (null === $this->_hintUrl) { + $this->_hintUrl = Mage::helper('Mage_Core_Helper_Hint')->getHintByCode(self::XPATH_HINT_KEY); + } + return $this->_hintUrl; + } + + /** + * Return store switcher hint html + * + * @return string + */ + public function getHintHtml() + { + $html = ''; + $url = $this->getHintUrl(); + if ($url) { + $html = '<a' + . ' href="'. $this->escapeUrl($url) . '"' + . ' onclick="this.target=\'_blank\'"' + . ' title="' . $this->__('What is this?') . '"' + . ' class="link-storeScope">' + . $this->__('What is this?') + . '</a>'; + } + return $html; + } } diff --git a/app/code/core/Mage/Adminhtml/Block/Store/Switcher/Form/Renderer/Fieldset.php b/app/code/core/Mage/Adminhtml/Block/Store/Switcher/Form/Renderer/Fieldset.php new file mode 100644 index 0000000000000000000000000000000000000000..f5ce3250ab5e44f88596b25e8a15a12945a86851 --- /dev/null +++ b/app/code/core/Mage/Adminhtml/Block/Store/Switcher/Form/Renderer/Fieldset.php @@ -0,0 +1,83 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Adminhtml + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Form fieldset renderer + * + * @category Mage + * @package Mage_Adminhtml + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Adminhtml_Block_Store_Switcher_Form_Renderer_Fieldset + extends Mage_Adminhtml_Block_Template implements Varien_Data_Form_Element_Renderer_Interface +{ + /** + * Form element which re-rendering + * + * @var Varien_Data_Form_Element_Fieldset + */ + protected $_element; + + /** + * Constructor + */ + protected function _construct() + { + $this->setTemplate('store/switcher/form/renderer/fieldset.phtml'); + } + + /** + * Retrieve an element + * + * @return Varien_Data_Form_Element_Fieldset + */ + public function getElement() + { + return $this->_element; + } + + /** + * Render element + * + * @param Varien_Data_Form_Element_Abstract $element + * @return string + */ + public function render(Varien_Data_Form_Element_Abstract $element) + { + $this->_element = $element; + return $this->toHtml(); + } + + /** + * Return html for store switcher hint + * + * @return string + */ + public function getHintHtml() + { + return Mage::getBlockSingleton('Mage_Adminhtml_Block_Store_Switcher')->getHintHtml(); + } +} diff --git a/app/code/core/Mage/Adminhtml/Block/System/Account/Edit.php b/app/code/core/Mage/Adminhtml/Block/System/Account/Edit.php index 7af6ff68982fd00a6b873d856d2747077fd36807..5b13145fc57ace49168e82c3e4107e3acb5d382e 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Account/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Account/Edit.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Account/Edit/Form.php b/app/code/core/Mage/Adminhtml/Block/System/Account/Edit/Form.php index c260898796c6c7bbfac379d7f758d4f69fb3faff..df5f16fd56b6167283684658de4eb221fe106b65 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Account/Edit/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Account/Edit/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Cache/Edit.php b/app/code/core/Mage/Adminhtml/Block/System/Cache/Edit.php index 7179a595aa56e550352e7afa3972d8689ec7dd05..b1bcf6d04eaddd79d6f6158bf5914c294d57938d 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Cache/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Cache/Edit.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Cache/Form.php b/app/code/core/Mage/Adminhtml/Block/System/Cache/Form.php index a4ce57ab2038dfb91f085f2ea1e34185cf46ad57..565a9703217ca3bbdf2db3174718b86495870825 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Cache/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Cache/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Config/Dwstree.php b/app/code/core/Mage/Adminhtml/Block/System/Config/Dwstree.php index 1630ada314ade80ad0972ff71f616ca8c7887575..db2339f17f3a4e93a4ee1f8b742448e3425565b9 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Config/Dwstree.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Config/Dwstree.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Config/Edit.php b/app/code/core/Mage/Adminhtml/Block/System/Config/Edit.php index 8f66e08e17a0977f8c4f237099b88ffc7b21227c..006d82e14e19235e25d36805cba44002ca7c9a43 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Config/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Config/Edit.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Config/Form.php b/app/code/core/Mage/Adminhtml/Block/System/Config/Form.php index 353ea0a710ba932af852d7e7663621b9cb3c2743..bdd5a49a7167f5b32d33ec46a3b6b69b8213e386 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Config/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Config/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -332,12 +332,16 @@ class Mage_Adminhtml_Block_System_Config_Form extends Mage_Adminhtml_Block_Widge if ($e->depends) { foreach ($e->depends->children() as $dependent) { + /* @var $dependent Mage_Core_Model_Config_Element */ $dependentId = $section->getName() . '_' . $group->getName() . '_' . $fieldPrefix . $dependent->getName(); $shouldBeAddedDependence = true; $dependentValue = (string) $dependent; + if (isset($dependent['separator'])) { + $dependentValue = explode((string)$dependent['separator'], $dependentValue); + } $dependentFieldName = $fieldPrefix . $dependent->getName(); $dependentField = $group->fields->$dependentFieldName; /* @@ -350,10 +354,12 @@ class Mage_Adminhtml_Block_System_Config_Form extends Mage_Adminhtml_Block_Widge . '/' . $group->getName() . '/' . $fieldPrefix . $dependent->getName(); - $shouldBeAddedDependence = $dependentValue != Mage::getStoreConfig( - $dependentFullPath, - $this->getStoreCode() - ); + $dependentValueInStore = Mage::getStoreConfig($dependentFullPath, $this->getStoreCode()); + if (is_array($dependentValue)) { + $shouldBeAddedDependence = !in_array($dependentValueInStore, $dependentValue); + } else { + $shouldBeAddedDependence = $dependentValue != $dependentValueInStore; + } } if($shouldBeAddedDependence) { $this->_getDependence() diff --git a/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field.php b/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field.php index 37d0c348ba7f6475249ba55fcfc5d17872141039..989a7cbac3651989ffda77481ca540e48599e8ae 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Array/Abstract.php b/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Array/Abstract.php index 02c3ff64500571cf92c525593caaae252d0aff3c..3e3d263ca064a7ac26a03653427b10778f38c19d 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Array/Abstract.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Array/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Datetime.php b/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Datetime.php index fcd7e9e78373dc2b1a71d824524425aad5d227ef..f51bd9ab6cc045435fcbdc64dc8f191ca7a51f0e 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Datetime.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Datetime.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Export.php b/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Export.php index 877563bff5c70626cc25eb2c9f27d8c4cea21643..05d9c92bea877a48b688dfeac8276feda9a52219 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Export.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Export.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/File.php b/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/File.php index 07a24da5992cbdd79081eeda9073905954fb6d2c..6727c50c6b7567148c66c6505cbe54d548db46ca 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/File.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/File.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Heading.php b/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Heading.php index 30676a93876100e42be6f81bc6f6f89242321717..1b3188340b3a862a4cb0ffe8f0392d356bb774c0 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Heading.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Heading.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Image.php b/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Image.php index 801918ac603328597dfff793869a0696f8350c44..f6405a23278937dda343822d2e16d879a0b8409b 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Image.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Image.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Import.php b/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Import.php index 3898f913d1678a6de2bba5ccf9da078493334fa0..a70f81b0807bfe8c570739fffd8510440c61b4f3 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Import.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Import.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Notification.php b/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Notification.php index 395c5ed4d98e34a40269186407a6a9d807b15d27..db3f2e551b43bfdd7bc71286debf46cfe8dcbba7 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Notification.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Notification.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Regexceptions.php b/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Regexceptions.php index 35a63d6c17779b1374c4d8c646e067343c69dd8d..fae00ccbaa264180d94af17526f77b85f7d7e0a4 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Regexceptions.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Regexceptions.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Select/Allowspecific.php b/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Select/Allowspecific.php index e2d053f4acceb35f6acd225bd380ac95cdeb7527..630dc0c10fb48a9500810381f7d6b15b7ef60cce 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Select/Allowspecific.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Select/Allowspecific.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Select/Flatcatalog.php b/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Select/Flatcatalog.php index 2cdcb8a0adbad211b9b5aafb97e9df37be3f1357..a669dc0e09f09e7b33de15cb1b9d5674d1f835e1 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Select/Flatcatalog.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Select/Flatcatalog.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Select/Flatproduct.php b/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Select/Flatproduct.php index e1c3e33c3eb8c2c3ac3c946ebaa0f7a742a4842f..576da571c143a9915893d50c8beed61a4616a005 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Select/Flatproduct.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Select/Flatproduct.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Fieldset.php b/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Fieldset.php index f654e7217c69306bf067430913e9dbda3c3401ab..0456c29e0f24db167d68d150ccfe1d4dd227805c 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Fieldset.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Fieldset.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Fieldset/Modules/DisableOutput.php b/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Fieldset/Modules/DisableOutput.php index 9a35d44b62d73abe9d8b85f3650b57da9beea5f8..2e9137cff19efaa8ec63ed573b45fb115429506f 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Fieldset/Modules/DisableOutput.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Fieldset/Modules/DisableOutput.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -38,6 +38,13 @@ class Mage_Adminhtml_Block_System_Config_Form_Fieldset_Modules_DisableOutput $modules = array_keys((array)Mage::getConfig()->getNode('modules')->children()); + $dispatchResult = new Varien_Object($modules); + Mage::dispatchEvent( + 'adminhtml_system_config_advanced_disableoutput_render_before', + array('modules' => $dispatchResult) + ); + $modules = $dispatchResult->toArray(); + sort($modules); foreach ($modules as $moduleName) { diff --git a/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Fieldset/Order/Statuses.php b/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Fieldset/Order/Statuses.php index 52ce47a4c08723788cae2564c38ea07d3f5083d8..95f72e21dd4211f6b4e972523a6a40a302023dd5 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Fieldset/Order/Statuses.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Fieldset/Order/Statuses.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Config/Switcher.php b/app/code/core/Mage/Adminhtml/Block/System/Config/Switcher.php index 4491298fe6094ca1f426baa898e6c93e708acff3..a6a6aa0a277531e93fa63c2239d4633d6eb9e9fc 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Config/Switcher.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Config/Switcher.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -106,4 +106,13 @@ class Mage_Adminhtml_Block_System_Config_Switcher extends Mage_Adminhtml_Block_T return $options; } + /** + * Return store switcher hint html + * + * @return mixed + */ + public function getHintHtml() + { + return Mage::getBlockSingleton('Mage_Adminhtml_Block_Store_Switcher')->getHintHtml(); + } } diff --git a/app/code/core/Mage/Adminhtml/Block/System/Config/System/Storage/Media/Synchronize.php b/app/code/core/Mage/Adminhtml/Block/System/Config/System/Storage/Media/Synchronize.php index ef417f0c6d912809d4cc8b3532b5ca98dd0ddb98..c43bc232d9aac5e9fe07d5aa204ceeec2492faf2 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Config/System/Storage/Media/Synchronize.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Config/System/Storage/Media/Synchronize.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Config/Tabs.php b/app/code/core/Mage/Adminhtml/Block/System/Config/Tabs.php index 559e5d58b5b2e6ba825d06c1bc5b7ef596f4ccc2..fdd8628adc43a44875f89d9b9187a5733b6b3873 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Config/Tabs.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Config/Tabs.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -80,7 +80,7 @@ class Mage_Adminhtml_Block_System_Config_Tabs extends Mage_Adminhtml_Block_Widge $configFields = Mage::getSingleton('Mage_Adminhtml_Model_Config'); $sections = $configFields->getSections($current); $tabs = (array)$configFields->getTabs()->children(); - + $sections = (array)$sections; @@ -99,7 +99,7 @@ class Mage_Adminhtml_Block_System_Config_Tabs extends Mage_Adminhtml_Block_Widge foreach ($sections as $section) { - + Mage::dispatchEvent('adminhtml_block_system_config_init_tab_sections_before', array('section' => $section)); $hasChildren = $configFields->hasChildren($section, $websiteCode, $storeCode); //$code = $section->getPath(); diff --git a/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui.php b/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui.php index f0b813f03590a95d3395554f5ba78eae6ba16de3..9720b100b706f2e3d63440661035e75200ca4d05 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui/Edit.php b/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui/Edit.php index aee6289a93d0acdcff5e8455cd5713cb64f5a250..3e4d29a612970b1510a9169ede8d390a002d98a2 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui/Edit.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui/Edit/Form.php b/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui/Edit/Form.php index f55accf7d55273ea2a20beb77695f99e3c08672b..78696eab00f1b200f5a43fe817fe6721595c77ac 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui/Edit/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui/Edit/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui/Edit/Tab/Upload.php b/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui/Edit/Tab/Upload.php index d44555aa54113c9836c88ab7435a9fdb06a98263..f3fcc1400943aba290727460338353241fde7b37 100755 --- a/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui/Edit/Tab/Upload.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui/Edit/Tab/Upload.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui/Edit/Tab/View.php b/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui/Edit/Tab/View.php index c2004f64d9ea660a470d1e6d69a25395efd4fcab..841364335f730f3d0b23598cbc805c957b2b8835 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui/Edit/Tab/View.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui/Edit/Tab/View.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui/Edit/Tab/Wizard.php b/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui/Edit/Tab/Wizard.php index 8bed5325e2297ee3e8f6f60afe4d559eb857d365..65814db41361bae065afffa582f9c9937f6a8934 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui/Edit/Tab/Wizard.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui/Edit/Tab/Wizard.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui/Edit/Tabs.php b/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui/Edit/Tabs.php index 211c1a18342d3bb9ad8e467340e0a4a0e0c89d59..2bb3d75326b61f244752bf894f29d3270a1aade3 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui/Edit/Tabs.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui/Edit/Tabs.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui/Grid.php b/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui/Grid.php index 5d1f1181809d947ab2d01d4335f587e4e34162de..8ab719ae28d36e5a4067b5671183db41961b41dd 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile.php b/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile.php index 3b109a83d228db498ff2b7b12fd0ba0c66b5f247..af280f7a45f3f934a133826f11830c64452d30e5 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Edit.php b/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Edit.php index 695189a305a2ed96f3a1c27e0fc5c12d5242d52e..0026ed341354eefb2ffffdec8ec4fb611a4a5a57 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Edit.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Edit/Filter/Action.php b/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Edit/Filter/Action.php index 8df5ffc212f71b1f0242775e91c5cee13744da9c..c86333f3bcecb2e6e2c5c0afb0a2ee59128013d5 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Edit/Filter/Action.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Edit/Filter/Action.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Edit/Form.php b/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Edit/Form.php index b11dffbe13ea9bbcf4bf610eb8c924ae85af7c08..14932689ff4db7130083f478b25209a1d822fba3 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Edit/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Edit/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Edit/Renderer/Action.php b/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Edit/Renderer/Action.php index 208336617bf1209489d807236fea70015288d851..38569d0d636e085c10c3ce9ac959a4e8d0b528fe 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Edit/Renderer/Action.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Edit/Renderer/Action.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Edit/Tab/Edit.php b/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Edit/Tab/Edit.php index c826762e8c8074838392d8c1cd9bb945a17f79c9..00f1cd2dbc4d8d9325b4a16cd809fbded33dbc88 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Edit/Tab/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Edit/Tab/Edit.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Edit/Tab/History.php b/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Edit/Tab/History.php index f307e8847b0298bb7b466dcfbb24caf6a9ce3e32..2b1332491316715d1aa51b9af3d7c33fe0f3db58 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Edit/Tab/History.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Edit/Tab/History.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Edit/Tab/Run.php b/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Edit/Tab/Run.php index 6e726f4d227214b1c0f5b20c673628fde0bfcf41..10b18855f6ab672edf2ed1f28607eef6b54a1068 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Edit/Tab/Run.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Edit/Tab/Run.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Edit/Tabs.php b/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Edit/Tabs.php index 172c90d37d49bdc7325a85460aac4ca7f7781745..bea1e3ef1a3c603f08523b70f8b1dda94c3ed15c 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Edit/Tabs.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Edit/Tabs.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Grid.php b/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Grid.php index 8b640949e02347b4710690aa238e82bccc6f1a12..24ff410a659bbb126a9c0e989fef94bf8988ea0c 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Run.php b/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Run.php index 61ebcc27002700ca27b5c0a05f1a25d68cda307c..b73da08cc22e70427efdab90e91933dd6a576e48 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Run.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Run.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Currency.php b/app/code/core/Mage/Adminhtml/Block/System/Currency.php index 8d674f3dce436631ab62e8a741617ef07293f97a..4a27d0791af6f935acaad3ca91403faf4f7ac022 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Currency.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Currency.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Currency/Edit/Form.php b/app/code/core/Mage/Adminhtml/Block/System/Currency/Edit/Form.php index af2a377d5fd703e610e12f0acc2ba496bf11082e..baeaa6ba12508b15151bc38a78396e6bc7fa3292 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Currency/Edit/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Currency/Edit/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Currency/Edit/Tab/Main.php b/app/code/core/Mage/Adminhtml/Block/System/Currency/Edit/Tab/Main.php index d5412d8183fd38bf3c09619f322df29afcbbb4cd..79ab475febd9b89b2752d2ac698eca144e9d25f0 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Currency/Edit/Tab/Main.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Currency/Edit/Tab/Main.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Currency/Edit/Tab/Rates.php b/app/code/core/Mage/Adminhtml/Block/System/Currency/Edit/Tab/Rates.php index 882c00c37a336d80d7fb42f60f3a09da8b08b79f..d4cbaa4ace3681e2d3ccf536c68d119b948a25d9 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Currency/Edit/Tab/Rates.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Currency/Edit/Tab/Rates.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Currency/Edit/Tabs.php b/app/code/core/Mage/Adminhtml/Block/System/Currency/Edit/Tabs.php index 84d42f0ac7e1e20d1dc92f73a6a3ee732c65a576..30669ce4a56b7a0bfe0eae9b826af2989ea6f590 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Currency/Edit/Tabs.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Currency/Edit/Tabs.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Currency/Rate/Matrix.php b/app/code/core/Mage/Adminhtml/Block/System/Currency/Rate/Matrix.php index c7d1ae6d83cf7d821a8562d233467eaedd82cccb..c2eeef9176d3d264aa1131c0637a0e6bdd1acb5c 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Currency/Rate/Matrix.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Currency/Rate/Matrix.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Currency/Rate/Services.php b/app/code/core/Mage/Adminhtml/Block/System/Currency/Rate/Services.php index 49ab98861eb53506874a4dbe6a0156d4b71a16a0..6a955ceb21ed260744ba2cce01aabee7b0ec341a 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Currency/Rate/Services.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Currency/Rate/Services.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Design.php b/app/code/core/Mage/Adminhtml/Block/System/Design.php index 2f053310cf9deb4752f39a3e2ac90bfec75eb1aa..caa6ee7063e322286724b155dd7da93a2b88354b 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Design.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Design.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Design/Edit.php b/app/code/core/Mage/Adminhtml/Block/System/Design/Edit.php index 78210fe058fed8ad4266a4180532d585c0d070bb..f2905b1e8b3ddd5373599a67b72c8f25495e80aa 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Design/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Design/Edit.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Design/Edit/Tab/General.php b/app/code/core/Mage/Adminhtml/Block/System/Design/Edit/Tab/General.php index 889a7d656fd92c695acba6b606e287d34df5a659..6ddf5a0a2c27b2c5ac39ce92ce315a602eef3674 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Design/Edit/Tab/General.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Design/Edit/Tab/General.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Adminhtml_Block_System_Design_Edit_Tab_General extends Mage_Adminhtml_Block_Widget_Form diff --git a/app/code/core/Mage/Adminhtml/Block/System/Design/Edit/Tabs.php b/app/code/core/Mage/Adminhtml/Block/System/Design/Edit/Tabs.php index b897516bdcac03ed407d1046c3689930034310b3..bd4c59f2c0566a7227847b09bf1f58174f383e19 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Design/Edit/Tabs.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Design/Edit/Tabs.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Design/Grid.php b/app/code/core/Mage/Adminhtml/Block/System/Design/Grid.php index 66a4639c50d8e99690864b80aba06a70fd64ed9d..9f7d1c8dcdb3c62399f730a1be88a61f8cb45e44 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Design/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Design/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Email/Template.php b/app/code/core/Mage/Adminhtml/Block/System/Email/Template.php index e1cffa68ccf599fab6d9835b071754372286655c..2921fb58b3c1cba6e51d509b983919eea2865ccd 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Email/Template.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Email/Template.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Edit.php b/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Edit.php index a186a0a9df57508dfc96314c158233e5edf13b18..44d3eab20dbfd3056ba1d37c454c96acd5a268e6 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Edit.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Edit/Form.php b/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Edit/Form.php index 1b0435a0fbe9fdf84f83ee109a5d217bfda7423e..aeb14a9192e6324d33f569a13e603318843d5e6d 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Edit/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Edit/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Grid.php b/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Grid.php index 2b86d2e410838009f08ead75d77a5b6b84ede423..cb49590a0c2514f7870f88191cae4c05441b0b30 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Grid/Filter/Type.php b/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Grid/Filter/Type.php index dd52f4ef98045960bf531a229b33aeda2ca69d1e..131656f62bdc7dd2049d3927e01e54bb7dd8fd5c 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Grid/Filter/Type.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Grid/Filter/Type.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -32,19 +32,20 @@ * @author Magento Core Team <core@magentocommerce.com> */ -class Mage_Adminhtml_Block_System_Email_Template_Grid_Filter_Type extends Mage_Adminhtml_Block_Widget_Grid_Column_Filter_Select +class Mage_Adminhtml_Block_System_Email_Template_Grid_Filter_Type + extends Mage_Adminhtml_Block_Widget_Grid_Column_Filter_Select { protected static $_types = array( - null => null, + null => null, Mage_Newsletter_Model_Template::TYPE_HTML => 'HTML', - Mage_Newsletter_Model_Template::TYPE_TEXT => 'Text', + Mage_Newsletter_Model_Template::TYPE_TEXT => 'Text', ); protected function _getOptions() { $result = array(); - foreach (self::$_types as $code=>$label) { - $result[] = array('value'=>$code, 'label'=>Mage::helper('Mage_Adminhtml_Helper_Data')->__($label)); + foreach (self::$_types as $code => $label) { + $result[] = array('value' => $code, 'label' => Mage::helper('Mage_Adminhtml_Helper_Data')->__($label)); } return $result; @@ -57,8 +58,6 @@ class Mage_Adminhtml_Block_System_Email_Template_Grid_Filter_Type extends Mage_A return null; } - return array('eq'=>$this->getValue()); + return array('eq' => $this->getValue()); } - - -}// Class Mage_Adminhtml_Block_Newsletter_Queue_Grid_Filter_Status END +} diff --git a/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Grid/Renderer/Action.php b/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Grid/Renderer/Action.php index f7e800e8f02190c2dbabca26d51153801088396f..ee494a4286d1b9af2ee80088e137f7c15d92014f 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Grid/Renderer/Action.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Grid/Renderer/Action.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Grid/Renderer/Sender.php b/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Grid/Renderer/Sender.php index 374a69cce8ad2e52a14e49bba43f69941f137cdd..7e71a41febbcafa0fd1d9627380285d33f56e241 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Grid/Renderer/Sender.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Grid/Renderer/Sender.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Grid/Renderer/Type.php b/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Grid/Renderer/Type.php index 2192abcd31d1ce8f8cbc1c4ad07e90f0544d9508..c12fd51b5b2547f9e6805419bd915204859b298d 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Grid/Renderer/Type.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Grid/Renderer/Type.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -32,11 +32,12 @@ * @author Magento Core Team <core@magentocommerce.com> */ -class Mage_Adminhtml_Block_System_Email_Template_Grid_Renderer_Type extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract +class Mage_Adminhtml_Block_System_Email_Template_Grid_Renderer_Type + extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract { protected static $_types = array( - Mage_Newsletter_Model_Template::TYPE_HTML => 'HTML', - Mage_Newsletter_Model_Template::TYPE_TEXT => 'Text', + Mage_Newsletter_Model_Template::TYPE_HTML => 'HTML', + Mage_Newsletter_Model_Template::TYPE_TEXT => 'Text', ); public function render(Varien_Object $row) { diff --git a/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Preview.php b/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Preview.php index ccfb30def2114b9b526d3469138f6ae558f7b1ca..2ee03216e5587752fa8ef35676221b36f19d629f 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Preview.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Preview.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -29,23 +29,27 @@ * * @category Mage * @package Mage_Adminhtml - * @author Magento Core Team <core@magentocommerce.com> + * @author Magento Core Team <core@magentocommerce.com> */ class Mage_Adminhtml_Block_System_Email_Template_Preview extends Mage_Adminhtml_Block_Widget { - protected function _toHtml() { + /** @var $template Mage_Core_Model_Email_Template */ $template = Mage::getModel('Mage_Core_Model_Email_Template'); - if($id = (int)$this->getRequest()->getParam('id')) { + if ($id = (int)$this->getRequest()->getParam('id')) { $template->load($id); } else { $template->setTemplateType($this->getRequest()->getParam('type')); $template->setTemplateText($this->getRequest()->getParam('text')); $template->setTemplateStyles($this->getRequest()->getParam('styles')); } + + /* @var $filter Mage_Core_Model_Input_Filter_MaliciousCode */ + $filter = Mage::getSingleton('Mage_Core_Model_Input_Filter_MaliciousCode'); + $template->setTemplateText( - $this->escapeHtml($template->getTemplateText()) + $filter->filter($template->getTemplateText()) ); Magento_Profiler::start("email_template_proccessing"); @@ -53,7 +57,7 @@ class Mage_Adminhtml_Block_System_Email_Template_Preview extends Mage_Adminhtml_ $templateProcessed = $template->getProcessedTemplate($vars, true); - if($template->isPlain()) { + if ($template->isPlain()) { $templateProcessed = "<pre>" . htmlspecialchars($templateProcessed) . "</pre>"; } @@ -61,5 +65,4 @@ class Mage_Adminhtml_Block_System_Email_Template_Preview extends Mage_Adminhtml_ return $templateProcessed; } - } diff --git a/app/code/core/Mage/Adminhtml/Block/System/Store/Delete.php b/app/code/core/Mage/Adminhtml/Block/System/Store/Delete.php index 68a46d2e748a6f9cbf6451c3685d172da8f7a637..637bdbab4d5d191229a3cd513ea8659933ffa8a3 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Store/Delete.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Store/Delete.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Store/Delete/Form.php b/app/code/core/Mage/Adminhtml/Block/System/Store/Delete/Form.php index 757ba812c8e3bfa2ffbd2ad6ff9f419b72399891..51c29058078e84e7593590dc9b72b321b2f3d696 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Store/Delete/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Store/Delete/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Store/Delete/Group.php b/app/code/core/Mage/Adminhtml/Block/System/Store/Delete/Group.php index 3847d6177b09a54bd4cdaa9efe6122194af08268..38021deacb299a84e7e088e71e9841422be0e2fc 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Store/Delete/Group.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Store/Delete/Group.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Store/Delete/Website.php b/app/code/core/Mage/Adminhtml/Block/System/Store/Delete/Website.php index 946147f122bc650d478505745bd9a04221437b6d..8e79abc8d6988b4c803aef313340656a6f04f033 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Store/Delete/Website.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Store/Delete/Website.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Store/Edit.php b/app/code/core/Mage/Adminhtml/Block/System/Store/Edit.php index 4323bfca72780dc2cf7bca1fcbb6ff66792aa173..9451223ee8f1c3007eafed0ae1d2e79c2a42cdf8 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Store/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Store/Edit.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Store/Edit/Form.php b/app/code/core/Mage/Adminhtml/Block/System/Store/Edit/Form.php index 4fc6b2a2a6490959410153432480d7b22a3d3ab7..7bc32a689ba201f06d52b8f9c5cc97ff0811ea14 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Store/Edit/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Store/Edit/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -109,7 +109,8 @@ class Mage_Adminhtml_Block_System_Store_Edit_Form extends Mage_Adminhtml_Block_W )); if (Mage::registry('store_action') == 'edit') { - $groups = Mage::getModel('Mage_Core_Model_Store_Group')->getCollection()->addWebsiteFilter($websiteModel->getId())->toOptionArray(); + $groups = Mage::getModel('Mage_Core_Model_Store_Group')->getCollection() + ->addWebsiteFilter($websiteModel->getId())->toOptionArray(); //array_unshift($groups, array('label'=>'', 'value'=>0)); $fieldset->addField('website_default_group_id', 'select', array( 'name' => 'website[default_group_id]', @@ -202,7 +203,8 @@ class Mage_Adminhtml_Block_System_Store_Edit_Form extends Mage_Adminhtml_Block_W )); if (Mage::registry('store_action') == 'edit') { - $stores = Mage::getModel('Mage_Core_Model_Store')->getCollection()->addGroupFilter($groupModel->getId())->toOptionArray(); + $stores = Mage::getModel('Mage_Core_Model_Store')->getCollection() + ->addGroupFilter($groupModel->getId())->toOptionArray(); //array_unshift($stores, array('label'=>'', 'value'=>0)); $fieldset->addField('group_default_store_id', 'select', array( 'name' => 'group[default_store_id]', @@ -335,6 +337,8 @@ class Mage_Adminhtml_Block_System_Store_Edit_Form extends Mage_Adminhtml_Block_W $form->setUseContainer(true); $this->setForm($form); + Mage::dispatchEvent('adminhtml_store_edit_form_prepare_form', array('block' => $this)); + return parent::_prepareForm(); } } diff --git a/app/code/core/Mage/Adminhtml/Block/System/Store/Grid.php b/app/code/core/Mage/Adminhtml/Block/System/Store/Grid.php index ea0293d8b30ebfa7a6ae2c16e152fa8c7f568897..20393ceea748c15da8e6f82e952d3d89ebc65255 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Store/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Store/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Store/Grid/Render/Group.php b/app/code/core/Mage/Adminhtml/Block/System/Store/Grid/Render/Group.php index b10bd63d73d27d4be984ebf2a5cd892fbafdc1a3..8daf2b05ba8996cd999bad7b29621003ecc64fb3 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Store/Grid/Render/Group.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Store/Grid/Render/Group.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Store/Grid/Render/Store.php b/app/code/core/Mage/Adminhtml/Block/System/Store/Grid/Render/Store.php index 058d18e3ab2fdecb633a9b42ebf04aaa5dad08f1..4e31be80b40ef9e397dff9784307e63418f892ec 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Store/Grid/Render/Store.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Store/Grid/Render/Store.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Store/Grid/Render/Website.php b/app/code/core/Mage/Adminhtml/Block/System/Store/Grid/Render/Website.php index 03b669717fddd9173b4d9b26d7f9e46dafbb7b9c..bfe37c43b8be1dce3f44ff2a6825355e1a36b50c 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Store/Grid/Render/Website.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Store/Grid/Render/Website.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Store/Store.php b/app/code/core/Mage/Adminhtml/Block/System/Store/Store.php index 9f4e78732854eb5c475183c87b38b943cf756bff..20ab308d32f9577b26ab04bddd755095a439a0f7 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Store/Store.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Store/Store.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Variable.php b/app/code/core/Mage/Adminhtml/Block/System/Variable.php index 53fef74468535c10c30fea0764711bcb0544c17e..df71cb899e8351c5565f2669c3bf4c0842b9671e 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Variable.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Variable.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Variable/Edit.php b/app/code/core/Mage/Adminhtml/Block/System/Variable/Edit.php index 54e2b289121a1f4f3528bb58a34aacdb32c9ca77..cdb509e268ab67e057f8c9ab64b0e7316d2c12fc 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Variable/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Variable/Edit.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Variable/Edit/Form.php b/app/code/core/Mage/Adminhtml/Block/System/Variable/Edit/Form.php index 55158565a3498cedc87cabfe21e9c306c9173e15..6ac08491069c0385404c5004cbe68405401a14d9 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Variable/Edit/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Variable/Edit/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/System/Variable/Grid.php b/app/code/core/Mage/Adminhtml/Block/System/Variable/Grid.php index 340231aba35f63728c6cd77622d89e4e7e260d8b..d381657e1becc1e570d3408dc26647626664dfbb 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Variable/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Variable/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Tag/Assigned/Grid.php b/app/code/core/Mage/Adminhtml/Block/Tag/Assigned/Grid.php index b0a33d8099e58c7cc16a7ba66bb48fd182f8acf8..593a9ba853de5a469ef65c76f2067f69f8f91218 100644 --- a/app/code/core/Mage/Adminhtml/Block/Tag/Assigned/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Tag/Assigned/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Tag/Customer.php b/app/code/core/Mage/Adminhtml/Block/Tag/Customer.php index 8648b9c538b2f27711ca16b8f6df17dfa32d58e6..a9704f35c0c772607120e7522ffc7e87bc820bb5 100644 --- a/app/code/core/Mage/Adminhtml/Block/Tag/Customer.php +++ b/app/code/core/Mage/Adminhtml/Block/Tag/Customer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Tag/Customer/Grid.php b/app/code/core/Mage/Adminhtml/Block/Tag/Customer/Grid.php index db2ce964f2bb578c71cfc547f1cefc64d5ccc0d4..ec2203dd2a2f4e7b4a62e5b00717090c99e076b3 100644 --- a/app/code/core/Mage/Adminhtml/Block/Tag/Customer/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Tag/Customer/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Tag/Edit.php b/app/code/core/Mage/Adminhtml/Block/Tag/Edit.php index b0ba793c23118411a3478cb90f0ada05b1c435c3..2e840c7b3bfb8d0c2ebd3c35323d654edc27019f 100644 --- a/app/code/core/Mage/Adminhtml/Block/Tag/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/Tag/Edit.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Tag/Edit/Accordion.php b/app/code/core/Mage/Adminhtml/Block/Tag/Edit/Accordion.php index d1a7469abb96f1333f6363eec26e533f36f97c3e..abf8a4ccffe118b954556e7aa6bf4244ac5ea26c 100644 --- a/app/code/core/Mage/Adminhtml/Block/Tag/Edit/Accordion.php +++ b/app/code/core/Mage/Adminhtml/Block/Tag/Edit/Accordion.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Tag/Edit/Assigned.php b/app/code/core/Mage/Adminhtml/Block/Tag/Edit/Assigned.php index 219ff984233e153d879857125baba7f1798f0755..3f17919d0d9f85ceb9e1fc9d06cecb5ee1718660 100644 --- a/app/code/core/Mage/Adminhtml/Block/Tag/Edit/Assigned.php +++ b/app/code/core/Mage/Adminhtml/Block/Tag/Edit/Assigned.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Tag/Edit/Form.php b/app/code/core/Mage/Adminhtml/Block/Tag/Edit/Form.php index 703dcbb6c0901d0474564d9cd3699fc1880f3a12..b2b661fa0f9f3c8c632a8d908b18b820208b9bfb 100644 --- a/app/code/core/Mage/Adminhtml/Block/Tag/Edit/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Tag/Edit/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Tag/Grid/All.php b/app/code/core/Mage/Adminhtml/Block/Tag/Grid/All.php index 168c9993f534b112f29bc222f188f04e003952a7..a0a461fb4d5e6c8834e15bd927fd9ee57feab1df 100644 --- a/app/code/core/Mage/Adminhtml/Block/Tag/Grid/All.php +++ b/app/code/core/Mage/Adminhtml/Block/Tag/Grid/All.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Tag/Grid/Pending.php b/app/code/core/Mage/Adminhtml/Block/Tag/Grid/Pending.php index 7bf8eafacc04c83e69cbb2ee8bb93af53474c50a..f2ca70e1530c5b607f9765b629e64f25094f216c 100644 --- a/app/code/core/Mage/Adminhtml/Block/Tag/Grid/Pending.php +++ b/app/code/core/Mage/Adminhtml/Block/Tag/Grid/Pending.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Tag/Pending.php b/app/code/core/Mage/Adminhtml/Block/Tag/Pending.php index 1df8209170e734ef1215fdb58a7be8e54597cec7..346f62188382d0c437fab2d2bd78a13af474e01a 100644 --- a/app/code/core/Mage/Adminhtml/Block/Tag/Pending.php +++ b/app/code/core/Mage/Adminhtml/Block/Tag/Pending.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Tag/Product.php b/app/code/core/Mage/Adminhtml/Block/Tag/Product.php index b40fa79ea2bfc5b55d80527505ab9e54dc94d156..46b50f966cc867fda792d1db098a23ae6f71a624 100644 --- a/app/code/core/Mage/Adminhtml/Block/Tag/Product.php +++ b/app/code/core/Mage/Adminhtml/Block/Tag/Product.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Tag/Product/Grid.php b/app/code/core/Mage/Adminhtml/Block/Tag/Product/Grid.php index caaca3fa21b667f7a208f9b6062c4eb51e5dcead..b40c6ed554c0136a4d739df408bd6940274d1273 100644 --- a/app/code/core/Mage/Adminhtml/Block/Tag/Product/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Tag/Product/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Tag/Store/Switcher.php b/app/code/core/Mage/Adminhtml/Block/Tag/Store/Switcher.php index 0edafe30496ec6cd945d15eb804aaad9a7067877..975c049c3849bc0e43c563148bdc023c8afa1094 100644 --- a/app/code/core/Mage/Adminhtml/Block/Tag/Store/Switcher.php +++ b/app/code/core/Mage/Adminhtml/Block/Tag/Store/Switcher.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Tag/Tag.php b/app/code/core/Mage/Adminhtml/Block/Tag/Tag.php index 7dbc36ce80df5a4e15d47ce34c59e593cf1d34f1..f174dce123bff91ba655cc0ae76f50ab0281eae0 100644 --- a/app/code/core/Mage/Adminhtml/Block/Tag/Tag.php +++ b/app/code/core/Mage/Adminhtml/Block/Tag/Tag.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Tag/Tag/Grid.php b/app/code/core/Mage/Adminhtml/Block/Tag/Tag/Grid.php index 964103de94aebd5af6b9f330d91e044893c976f6..16fed2f14824eb329981d8bd44b71e74df514f51 100644 --- a/app/code/core/Mage/Adminhtml/Block/Tag/Tag/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Tag/Tag/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Tax/Class.php b/app/code/core/Mage/Adminhtml/Block/Tax/Class.php index 5dc047068eaf2d1dd87b9a687ff616ccb06a8c67..922aa393d83a120807c51babb473c7a52637825a 100644 --- a/app/code/core/Mage/Adminhtml/Block/Tax/Class.php +++ b/app/code/core/Mage/Adminhtml/Block/Tax/Class.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Tax/Class/Edit.php b/app/code/core/Mage/Adminhtml/Block/Tax/Class/Edit.php index 4ecde13d8cc4e6fb937cc64a80d9d529819220cd..68471b20b58394066d98f05679c2f9990c5f5c47 100644 --- a/app/code/core/Mage/Adminhtml/Block/Tax/Class/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/Tax/Class/Edit.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Tax/Class/Edit/Form.php b/app/code/core/Mage/Adminhtml/Block/Tax/Class/Edit/Form.php index 2260c733d2e3992fd9d58f96971cffda2b48d727..647900de26b4ab39cf6bbfab3925a1790be0cf61 100644 --- a/app/code/core/Mage/Adminhtml/Block/Tax/Class/Edit/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Tax/Class/Edit/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Tax/Class/Grid.php b/app/code/core/Mage/Adminhtml/Block/Tax/Class/Grid.php index 2a58e8adff0d711c394c3a8bb04b31f7593c8859..61b72885fc7680c52068e493a04880ebf98e1fc4 100644 --- a/app/code/core/Mage/Adminhtml/Block/Tax/Class/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Tax/Class/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Form.php b/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Form.php index 49f01b6078732e19fc8433677bd244a1d2f444f5..c363a752b72a273508493c9d63c1f7ebdf9a33cd 100644 --- a/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -158,6 +158,7 @@ class Mage_Adminhtml_Block_Tax_Rate_Form extends Mage_Adminhtml_Block_Widget_For 'label' => Mage::helper('Mage_Tax_Helper_Data')->__('Range From'), 'value' => $rateObject->getZipFrom(), 'required' => true, + 'maxlength' => 9, 'class' => 'validate-digits' ) ); @@ -168,6 +169,7 @@ class Mage_Adminhtml_Block_Tax_Rate_Form extends Mage_Adminhtml_Block_Widget_For 'label' => Mage::helper('Mage_Tax_Helper_Data')->__('Range To'), 'value' => $rateObject->getZipTo(), 'required' => true, + 'maxlength' => 9, 'class' => 'validate-digits' ) ); diff --git a/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Grid.php b/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Grid.php index 56881f99d2fb59499148678be1c59247040264a7..f36a16eadce45b17b200657c5c22be5e06898e2f 100644 --- a/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Adminhtml_Block_Tax_Rate_Grid extends Mage_Adminhtml_Block_Widget_Grid diff --git a/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Grid/Renderer/Country.php b/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Grid/Renderer/Country.php index b114afc8d02a20548b8ed38d7ac7809c730281f3..efda945e45ee4e564ac6a76fcf5029fcff947307 100644 --- a/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Grid/Renderer/Country.php +++ b/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Grid/Renderer/Country.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Grid/Renderer/Data.php b/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Grid/Renderer/Data.php index 53563b70adc9faa49cf1bc160cdfae4cfbdda98a..2523b38f294555d4d3502585158f8c2da24557ed 100644 --- a/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Grid/Renderer/Data.php +++ b/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Grid/Renderer/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Tax/Rate/ImportExport.php b/app/code/core/Mage/Adminhtml/Block/Tax/Rate/ImportExport.php index 8a7ce77a22e4ceb952f286de8357f62f8b2252e8..d0a2d48898e09a54c95dbddba5a0d57ada2bfdae 100644 --- a/app/code/core/Mage/Adminhtml/Block/Tax/Rate/ImportExport.php +++ b/app/code/core/Mage/Adminhtml/Block/Tax/Rate/ImportExport.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Title.php b/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Title.php index b3159a52f3560933c2ffb960ea77d50378cbe52a..983b82e8eeb0ad6cf697a02834a38a0c1c393a8d 100644 --- a/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Title.php +++ b/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Title.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Title/Fieldset.php b/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Title/Fieldset.php index eb1dd23bf135722b06368adf6d639cd471234e4d..783e0d303f91bb23656c82edc7e94d7e011037b0 100644 --- a/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Title/Fieldset.php +++ b/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Title/Fieldset.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Toolbar/Add.php b/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Toolbar/Add.php index 816a8c00e210184845275c6a12e1a73757d5be6a..f8d382bc13150ab2c660dbd4485cc52762beb9d8 100644 --- a/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Toolbar/Add.php +++ b/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Toolbar/Add.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Toolbar/Save.php b/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Toolbar/Save.php index 3e7fbe58ff0b79d3e5019a5a9feb8f2c153750d5..e318311bfc5cc78377a6c75335ef03e44b562bc6 100644 --- a/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Toolbar/Save.php +++ b/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Toolbar/Save.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Tax/Rule.php b/app/code/core/Mage/Adminhtml/Block/Tax/Rule.php index 9bed46d7947667da9e15393513dca9677cab7477..10b6c1d8fe78309801304046f7965cb527f34f72 100644 --- a/app/code/core/Mage/Adminhtml/Block/Tax/Rule.php +++ b/app/code/core/Mage/Adminhtml/Block/Tax/Rule.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Tax/Rule/Edit.php b/app/code/core/Mage/Adminhtml/Block/Tax/Rule/Edit.php index 53860ec59166f845f7a5e665fb20c5f84b1cee49..11402c15de524dca622db5c0644da39203c0d051 100644 --- a/app/code/core/Mage/Adminhtml/Block/Tax/Rule/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/Tax/Rule/Edit.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Tax/Rule/Edit/Form.php b/app/code/core/Mage/Adminhtml/Block/Tax/Rule/Edit/Form.php index 97eb916c082f883521680ce1803af812448a90fe..9fb12c24b7d58dedc86f5fd1f8c1412c8ed64837 100644 --- a/app/code/core/Mage/Adminhtml/Block/Tax/Rule/Edit/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Tax/Rule/Edit/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Tax/Rule/Grid.php b/app/code/core/Mage/Adminhtml/Block/Tax/Rule/Grid.php index c0d99f87c0d4e96aba4087730a965e46c3d69614..1f80a2b28279c89fc60b078dd90f5051ad461699 100644 --- a/app/code/core/Mage/Adminhtml/Block/Tax/Rule/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Tax/Rule/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Adminhtml_Block_Tax_Rule_Grid extends Mage_Adminhtml_Block_Widget_Grid diff --git a/app/code/core/Mage/Adminhtml/Block/Template.php b/app/code/core/Mage/Adminhtml/Block/Template.php index 1a778332e461ee7511ea48de7962660fec8f5231..0f10f814cb8b5cc11b58927f36dfd6988dd3dd7e 100644 --- a/app/code/core/Mage/Adminhtml/Block/Template.php +++ b/app/code/core/Mage/Adminhtml/Block/Template.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Text/List.php b/app/code/core/Mage/Adminhtml/Block/Text/List.php index 59241283bb9d3208be92f41c65ce9990c3d289ec..80dd06a882a0a65362ac1c7f78ae3a70fe0b51f7 100644 --- a/app/code/core/Mage/Adminhtml/Block/Text/List.php +++ b/app/code/core/Mage/Adminhtml/Block/Text/List.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Urlrewrite.php b/app/code/core/Mage/Adminhtml/Block/Urlrewrite.php index 18af1c211f266683259679fcb50835767b3dc6a6..6e7d3c28d180e6e8ba498b75d5bbe4d4b59d7ea0 100644 --- a/app/code/core/Mage/Adminhtml/Block/Urlrewrite.php +++ b/app/code/core/Mage/Adminhtml/Block/Urlrewrite.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Category/Tree.php b/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Category/Tree.php index 5a0e83e5092ec3955a5d2f519c22ff7f17d21ffa..abc007a3b42cd275fea175f553bfc4b5bd5fb06a 100644 --- a/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Category/Tree.php +++ b/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Category/Tree.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Edit.php b/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Edit.php index f400b556d8843abba12342086ef49cbde4e6837a..62f39cc040161022b56afc53ea8369c881f78394 100644 --- a/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Edit.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Edit/Form.php b/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Edit/Form.php index 39eb70cff23177e98e770253e5204362e8394296..2b51a48ef099e4ff6e368a564bb27b0220ff7315 100644 --- a/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Edit/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Edit/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Grid.php b/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Grid.php index 4c9da4ac78b4ea4c44c323489e79bc2c4280f90e..cf23382565ec509581816cc3c737a43a08a40aaa 100644 --- a/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Link.php b/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Link.php index 372acc6c25a093d0bd3e62e4e7a5e8a5aaa8b8a5..faac783c5f972bb1afbf9c74a07fcdb593706c57 100644 --- a/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Link.php +++ b/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Link.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Product/Grid.php b/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Product/Grid.php index 94547f47b88e3bfeab5b4b6b96a7dba8424dc13c..0f74b58b84ad7b99476becf37e5f00ae99d243b7 100644 --- a/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Product/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Product/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Selector.php b/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Selector.php index d65368ba8559687e1ee54bd9857f4c217cacf085..30af91a9ac9364a467cee8ffa404a1e08bbbf421 100644 --- a/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Selector.php +++ b/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Selector.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Widget.php b/app/code/core/Mage/Adminhtml/Block/Widget.php index 0b15d63829b03f70731cb2996a90b625c4b9454d..48620bdea8d454f268fe2c26196cf2a87a7ec105 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Accordion.php b/app/code/core/Mage/Adminhtml/Block/Widget/Accordion.php index 9da7cc44fa302395eaff3eb3df146f1eebf0014e..64419881e05122a3ce9c8ef9e4537da3232b8ecf 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Accordion.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Accordion.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Accordion/Item.php b/app/code/core/Mage/Adminhtml/Block/Widget/Accordion/Item.php index bd74b6e2d8c01fd2677f50bec8b594667e093c13..e694b938f34d59920c32687307239eef4f38bb66 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Accordion/Item.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Accordion/Item.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Breadcrumbs.php b/app/code/core/Mage/Adminhtml/Block/Widget/Breadcrumbs.php index a426379b8a2e99ed8bb72e82ff88447970d1b25f..e2c5e158a98ed5e3223e5674c0db631262813257 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Breadcrumbs.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Breadcrumbs.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Button.php b/app/code/core/Mage/Adminhtml/Block/Widget/Button.php index 702616bb8d25001d556d820cde99b0bebc8cbcba..5148dbeb75fe2f46d8a70b220c99eeee73436fb3 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Button.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Button.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -63,7 +63,7 @@ class Mage_Adminhtml_Block_Widget_Button extends Mage_Adminhtml_Block_Widget . ' style="'.$this->getStyle() .'"' . ($this->getValue()?' value="'.$this->getValue() . '"':'') . ($this->getDisabled() ? ' disabled="disabled"' : '') - . '><span>' .$this->getLabel().'</span></button>'.$this->getAfterHtml(); + . '><span><span><span>' .$this->getLabel().'</span></span></span></button>'.$this->getAfterHtml(); return $html; } diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Container.php b/app/code/core/Mage/Adminhtml/Block/Widget/Container.php index c11cab81610b761cc102043c4da1b741e82d058f..52f927125ed55e978a196846ba3209c4c7803894 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Container.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Container.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Form.php b/app/code/core/Mage/Adminhtml/Block/Widget/Form.php index 30ff2459f74922f398c723e56f1f46f77c05000c..cfa68500e81cd8ce002cbb30bd8f4ca38e4bcdfa 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -189,11 +189,10 @@ class Mage_Adminhtml_Block_Widget_Form extends Mage_Adminhtml_Block_Widget $element->setValues($attribute->getSource()->getAllOptions(true, true)); } else if ($inputType == 'multiselect') { $element->setValues($attribute->getSource()->getAllOptions(false, true)); + $element->setCanBeEmpty(true); } else if ($inputType == 'date') { $element->setImage($this->getSkinUrl('images/grid-cal.gif')); - $element->setFormat( - Mage::app()->getLocale()->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT) - ); + $element->setFormat(Mage::app()->getLocale()->getDateFormatWithLongYear()); } else if ($inputType == 'multiline') { $element->setLineCount($attribute->getMultilineCount()); } diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Form/Container.php b/app/code/core/Mage/Adminhtml/Block/Widget/Form/Container.php index dcc4f29f4bb8ded7039ef290d584639b81cc9755..e02832dbbca676cce5f0a27cf3b2225f40653eeb 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Form/Container.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Form/Container.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Form/Element.php b/app/code/core/Mage/Adminhtml/Block/Widget/Form/Element.php index 63cc4fe4d5e39f24f044dc47f3d2b89fd97259ae..eedbbe6316e5be7cac5d8a91c715ae851df9db88 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Form/Element.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Form/Element.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Form/Element/Dependence.php b/app/code/core/Mage/Adminhtml/Block/Widget/Form/Element/Dependence.php index f7cebf0ed1dcd7ad06ca30a305b083f64b0e0ee2..2bfe984de68da1731c67d7791c043c13a208bb48 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Form/Element/Dependence.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Form/Element/Dependence.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -73,8 +73,6 @@ class Mage_Adminhtml_Block_Widget_Form_Element_Dependence extends Mage_Adminhtml /** * Register field name dependence one from each other by specified values * - * @TODO: multiple values per dependency is not implemented. The values OR comparison is anticipated - * * @param string $fieldName * @param string $fieldNameFrom * @param string|array $refValues @@ -82,9 +80,6 @@ class Mage_Adminhtml_Block_Widget_Form_Element_Dependence extends Mage_Adminhtml */ public function addFieldDependence($fieldName, $fieldNameFrom, $refValues) { - if (is_array($refValues)) { - Mage::throwException('Dependency from multiple values is not implemented yet. Please fix to your widget.xml'); - } $this->_depends[$fieldName][$fieldNameFrom] = $refValues; return $this; } diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Form/Element/Gallery.php b/app/code/core/Mage/Adminhtml/Block/Widget/Form/Element/Gallery.php index db673c9a1bfe5e73dba2a9336138306d11697171..434c123c1188f37ab080856acbb92a655c4eb28a 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Form/Element/Gallery.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Form/Element/Gallery.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Form/Renderer/Element.php b/app/code/core/Mage/Adminhtml/Block/Widget/Form/Renderer/Element.php index 1cceb8e257244e70258c24e12ac93a4a519c7375..7883424759e85083f5bfb6bc0fc61d1c4e6f82c8 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Form/Renderer/Element.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Form/Renderer/Element.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Form/Renderer/Fieldset.php b/app/code/core/Mage/Adminhtml/Block/Widget/Form/Renderer/Fieldset.php index 052538072b449163c7d8ddccd11f022157f2fb4d..e32cd21ccaf6c99a41a4ef824e4a49601c8ca18b 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Form/Renderer/Fieldset.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Form/Renderer/Fieldset.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Form/Renderer/Fieldset/Element.php b/app/code/core/Mage/Adminhtml/Block/Widget/Form/Renderer/Fieldset/Element.php index 23ed3ffe460fc3895111dd7a762586379803560a..07a3d4aa3cdaec625c309936928a3243ea392dbd 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Form/Renderer/Fieldset/Element.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Form/Renderer/Fieldset/Element.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -31,7 +31,8 @@ * @package Mage_Adminhtml * @author Magento Core Team <core@magentocommerce.com> */ -class Mage_Adminhtml_Block_Widget_Form_Renderer_Fieldset_Element extends Mage_Adminhtml_Block_Template implements Varien_Data_Form_Element_Renderer_Interface +class Mage_Adminhtml_Block_Widget_Form_Renderer_Fieldset_Element extends Mage_Adminhtml_Block_Template + implements Varien_Data_Form_Element_Renderer_Interface { protected $_element; @@ -50,4 +51,4 @@ class Mage_Adminhtml_Block_Widget_Form_Renderer_Fieldset_Element extends Mage_Ad $this->_element = $element; return $this->toHtml(); } -} \ No newline at end of file +} diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid.php index ee51257a667785b198df59a230d6ef9d49e575a7..eeb363594240f49d4552b2c9916b4b24465ba4b5 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -175,6 +175,13 @@ class Mage_Adminhtml_Block_Widget_Grid extends Mage_Adminhtml_Block_Widget */ protected $_massactionIdField = null; + /** + * Massaction row id filter + * + * @var string + */ + protected $_massactionIdFilter = null; + /** * Massaction block name * @@ -543,8 +550,8 @@ class Mage_Adminhtml_Block_Widget_Grid extends Mage_Adminhtml_Block_Widget protected function _preparePage() { - $this->getCollection()->setPageSize($this->getParam($this->getVarNameLimit(), $this->_defaultLimit)); - $this->getCollection()->setCurPage($this->getParam($this->getVarNamePage(), $this->_defaultPage)); + $this->getCollection()->setPageSize((int) $this->getParam($this->getVarNameLimit(), $this->_defaultLimit)); + $this->getCollection()->setCurPage((int) $this->getParam($this->getVarNamePage(), $this->_defaultPage)); } protected function _prepareColumns() @@ -589,11 +596,12 @@ class Mage_Adminhtml_Block_Widget_Grid extends Mage_Adminhtml_Block_Widget $columnId = 'massaction'; $massactionColumn = $this->getLayout()->createBlock('Mage_Adminhtml_Block_Widget_Grid_Column') ->setData(array( - 'index' => $this->getMassactionIdField(), - 'type' => 'massaction', - 'name' => $this->getMassactionBlock()->getFormFieldName(), - 'align' => 'center', - 'is_system' => true + 'index' => $this->getMassactionIdField(), + 'filter_index' => $this->getMassactionIdFilter(), + 'type' => 'massaction', + 'name' => $this->getMassactionBlock()->getFormFieldName(), + 'align' => 'center', + 'is_system' => true )); if ($this->getNoFilterMassactionColumn()) { @@ -1262,7 +1270,7 @@ class Mage_Adminhtml_Block_Widget_Grid extends Mage_Adminhtml_Block_Widget } /** - * Retrive massaction row identifier field + * Retrieve massaction row identifier field * * @return string */ @@ -1283,6 +1291,28 @@ class Mage_Adminhtml_Block_Widget_Grid extends Mage_Adminhtml_Block_Widget return $this; } + /** + * Retrieve massaction row identifier filter + * + * @return string + */ + public function getMassactionIdFilter() + { + return $this->_massactionIdFilter; + } + + /** + * Set massaction row identifier filter + * + * @param string $idFilter + * @return Mage_Adminhtml_Block_Widget_Grid + */ + public function setMassactionIdFilter($idFilter) + { + $this->_massactionIdFilter = $idFilter; + return $this; + } + /** * Retrive massaction block name * diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column.php index eefc5b82d9c3860bed6cc326ac08991b6a29df96..5683600eda4ae3a2858a2946b292e432e5636eff 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Abstract.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Abstract.php index bb447d990a88d2cf42759601fc8596df3989a48e..0e3015813d9b719ab24582de52e5492dfb469403 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Abstract.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Checkbox.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Checkbox.php index 66becacbc87d3e971e9eff7d4feb04e58011883a..448d5c6032dcbcf4c684ccf1e2cee16e687a0423 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Checkbox.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Checkbox.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Country.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Country.php index d9efe38ce3c0de0ad1761f85e2ec3b2a11521661..ed5d7b808bcdd6ad65a7108d404d57a604f9adee 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Country.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Country.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Date.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Date.php index f22ea97bbfd386646ed90471fafda3362e803fca..a41f5680077edddd33685bdc1f1d17712fdfc703 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Date.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Date.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Datetime.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Datetime.php index 95fd4bc79a141fb6569d6555a62af0688acc1cb6..66275f4db3849b42285a84ec95f9b4d6502e83a2 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Datetime.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Datetime.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Interface.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Interface.php index b50aaed12bf3eaed88f8fc62a0ea7e9fe9041c99..3458a3f62d193a33b1425172b520e335dd27e611 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Interface.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Interface.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Massaction.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Massaction.php index ee80e33778a944091f4d48a82aad52a7b61a4a0c..5b25af02bc403a815e5122d8439f164b00678ee8 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Massaction.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Massaction.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Price.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Price.php index 4201689a44ab46ff245009b624c821eb66f5b3a7..951b56b4d4743041cd7e5353aac6cac40f2a0c82 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Price.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Price.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Radio.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Radio.php index 066b9dfa7e5cf1cc49c4398e9a22cbf6449c7db8..a2c3106ceae77d875d55262dc5155ce364a881c4 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Radio.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Radio.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Range.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Range.php index fef6047733d77da197547be078510b65841c05c2..4d90615ada2a45c5418edb2c8156ace827e61dae 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Range.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Range.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Select.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Select.php index 656080838e1e12c38245f7cc0bf4380801652ec9..1b54ddc9e8b7f33fabce9e30e334e3ac50c4726b 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Select.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Select.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Store.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Store.php index bdb6f9d7a94d9fd1ac2f9a71dbe193b2491564c4..641b01599a406700845f69dcc0e43314bf899dc7 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Store.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Store.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Text.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Text.php index 705fd08f226e4ac9ba18784b9e21dfa385c9736a..533d326fa4a6cdfe7e056b96b4cf1abc59749b4e 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Text.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Text.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Theme.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Theme.php index d9da6f8abb1fde59ab6af34bd38d0dfd26f46082..5489b48aba91f4ce9aac52fa74c065f20b9b10b9 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Theme.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Theme.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Abstract.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Abstract.php index 37b6cf692f9f2543c4a5c0326c4eca4baed98702..be35373185c34d18252f49739db5d79398f85b5b 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Abstract.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Action.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Action.php index cb87475d7efbfbfb533f30898483972a514df2c6..732c9e3f1d738ebefd3a4bb08031311a543754f0 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Action.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Action.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Checkbox.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Checkbox.php index 49422240ce43fdfb6b19078e900a290978c00110..81a4ada485cd1eaddd817745d617f9024fc87f7b 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Checkbox.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Checkbox.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Concat.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Concat.php index 09c0114ae03780767fac9a21aee7daa9a46b5828..bb1dae1bd08104bd37baa85f15fc30dd69fa80bf 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Concat.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Concat.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Country.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Country.php index 46ecb86d0980d8d0cf11ab1a41a8d8ceec70cca5..3f76302ef9133723826be070f7e0ebb6df72035d 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Country.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Country.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Currency.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Currency.php index 49908ee95e35591e278719a47d45af72a58deb69..f27ec269e4bf0238f36281b256a9d2c19795c4ec 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Currency.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Currency.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Date.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Date.php index 1a465781b29e3f1de99f816d4589c9913435753b..9e4a6a8286ebe332939680b233bdf78be8917c8a 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Date.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Date.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Datetime.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Datetime.php index a661960d4caca5697ab2c06a93321c32c41c604a..863c0731fc015b1b00fe461da0741e8facdc2852 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Datetime.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Datetime.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Input.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Input.php index c4883f6d7cddef3b6c380a69f1c6f803f3b42331..395ecaf20e3ecedbc72e3d8c18a0a765b922e08f 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Input.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Input.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Interface.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Interface.php index 73c218b846bafb2598551b4c88942ab978291e8a..baaa488a3131395d7c1be67514ac61828e8b6f20 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Interface.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Interface.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Ip.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Ip.php index 4c94be98a64cc405ca04319e3982a982b2360227..d24a31938a78fc3221e68c7578cc576d2f58c595 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Ip.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Ip.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Longtext.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Longtext.php index 71102ba8eb12fabc7a2ac611bbd3833c5820eb2f..ae76e300998bafb5b9007588d8634f36b4945353 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Longtext.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Longtext.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Massaction.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Massaction.php index 2fe160f04e41b8ff628d6fd18c009337eab6cf5e..ea9f3c65316be2b9f2c9fa813017ef6cde8a6f76 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Massaction.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Massaction.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Number.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Number.php index 829d655bdc41b1196c0fa8b7ffbafb463f11216e..5fd161105df385db1b1e54f2e9816c985519bfb3 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Number.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Number.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Options.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Options.php index 815a9d28c638d4a5424bf19108721c1cea681595..6c0238bcdc249f1709f7b5ee10c7de5cb083de51 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Options.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Options.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Price.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Price.php index a01bbd51bed6dcbe4e51b49a300bd3bb2e242309..c647cf71cccdbe2fb2f21a0b861f3af8ea8605f7 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Price.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Price.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Radio.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Radio.php index 82ac6e7ead1f468ca317c4a16cf96c473c64b885..f7a17e77a2346da64f892e6361f1777a01c14f56 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Radio.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Radio.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Select.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Select.php index f8337e3d5763b5332028e8b369407dc069fd199f..f63c5dcd3943d5856288ea61d0d8644338f8ea9a 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Select.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Select.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Store.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Store.php index 314011fd3527de17359034eb524d9b0131f3411e..21e53e8e78b7bdf33eba20dc31342f4f199b8861 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Store.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Store.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Text.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Text.php index ea4808aabae88ed7c4ebb70cccbcaec8e0e97b2f..691bf7416c27ad105ecaf1e962c48c2c3d4a96a8 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Text.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Text.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Wrapline.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Wrapline.php index 0eaaa1765ef2e6530acf3c42d7a112ae90f97c5e..ce991d3739ba9ecc86fc2559a7f04ba6d7e7769f 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Wrapline.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Wrapline.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Container.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Container.php index 4f6f5a66f5bcd9c8f7d74e360b54c5f141d7a8b5..c91d4cf4f735a5fdf9cf5204d021d51d34628a9c 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Container.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Container.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Massaction.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Massaction.php index ff8b246b0719e500002a54f0297e9334722a8968..51a2db9cb46d352d636da8ab63f87e7358737b33 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Massaction.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Massaction.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Massaction/Abstract.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Massaction/Abstract.php index 15cc44447af8a279d3bab4d51408da994bcf5c61..ae845927376b1f7da3a47e350e5bfd2937c8d7a2 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Massaction/Abstract.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Massaction/Abstract.php @@ -20,13 +20,15 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ /** * Grid widget massaction block * + * @method Mage_Sales_Model_Quote setHideFormElement(boolean $value) Hide Form element to prevent IE errors + * @method boolean getHideFormElement() * @category Mage * @package Mage_Adminhtml * @author Magento Core Team <core@magentocommerce.com> @@ -40,6 +42,9 @@ abstract class Mage_Adminhtml_Block_Widget_Grid_Massaction_Abstract extends Mage */ protected $_items = array(); + /** + * Sets Massaction template + */ public function __construct() { parent::__construct(); @@ -187,10 +192,8 @@ abstract class Mage_Adminhtml_Block_Widget_Grid_Massaction_Abstract extends Mage if($selected = $this->getRequest()->getParam($this->getFormFieldNameInternal())) { $selected = explode(',', $selected); return join(',', $selected); -// return Mage::helper('Mage_Core_Helper_Data')->jsonEncode($selected); } else { return ''; -// return '[]'; } } @@ -221,13 +224,14 @@ abstract class Mage_Adminhtml_Block_Widget_Grid_Massaction_Abstract extends Mage public function getJavaScript() { - return " - var {$this->getJsObjectName()} = new varienGridMassaction('{$this->getHtmlId()}', {$this->getGridJsObjectName()}, '{$this->getSelectedJson()}', '{$this->getFormFieldNameInternal()}', '{$this->getFormFieldName()}'); - {$this->getJsObjectName()}.setItems({$this->getItemsJson()}); - {$this->getJsObjectName()}.setGridIds('{$this->getGridIdsJson()}'); - ". ($this->getUseAjax() ? "{$this->getJsObjectName()}.setUseAjax(true);" : '') . " - ". ($this->getUseSelectAll() ? "{$this->getJsObjectName()}.setUseSelectAll(true);" : '') . - "{$this->getJsObjectName()}.errorText = '{$this->getErrorText()}';"; + return " var {$this->getJsObjectName()} = new varienGridMassaction('{$this->getHtmlId()}', " + . "{$this->getGridJsObjectName()}, '{$this->getSelectedJson()}'" + . ", '{$this->getFormFieldNameInternal()}', '{$this->getFormFieldName()}');" + . "{$this->getJsObjectName()}.setItems({$this->getItemsJson()}); " + . "{$this->getJsObjectName()}.setGridIds('{$this->getGridIdsJson()}');" + . ($this->getUseAjax() ? "{$this->getJsObjectName()}.setUseAjax(true);" : '') + . ($this->getUseSelectAll() ? "{$this->getJsObjectName()}.setUseSelectAll(true);" : '') + . "{$this->getJsObjectName()}.errorText = '{$this->getErrorText()}';"; } public function getGridIdsJson() @@ -240,10 +244,8 @@ abstract class Mage_Adminhtml_Block_Widget_Grid_Massaction_Abstract extends Mage if(!empty($gridIds)) { return join(",", $gridIds); - //return Mage::helper('Mage_Core_Helper_Data')->jsonEncode($gridIds); } return ''; - //return '[]'; } public function getHtmlId() @@ -288,4 +290,3 @@ abstract class Mage_Adminhtml_Block_Widget_Grid_Massaction_Abstract extends Mage return $this; } } - // Class Mage_Adminhtml_Block_Widget_Grid_Massaction_Abstract End diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Massaction/Item.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Massaction/Item.php index 494054c841597e7ccd0bf0dd2bf80d8fd3d23d9a..7a640229621cb323439554cd249fe145a9b31e42 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Massaction/Item.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Massaction/Item.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Massaction/Item/Additional/Default.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Massaction/Item/Additional/Default.php index e6042f8bf8ee0bf3cd1bc0e85ae2c63d96a808ed..f6a27990c440042a3ad7764030b1b28a6e391a0b 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Massaction/Item/Additional/Default.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Massaction/Item/Additional/Default.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Massaction/Item/Additional/Interface.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Massaction/Item/Additional/Interface.php index d07a8dd253fb9e73ce40cab341d5c035029510cd..222c39f82cc91a732657e79e407cf20bc46f5a7b 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Massaction/Item/Additional/Interface.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Massaction/Item/Additional/Interface.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Serializer.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Serializer.php index b085660a421c90ed885bbe4239ce800d6e718537..9de0d775db813ce9040bcae183eed7688f3a9580 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Serializer.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Serializer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Tab/Interface.php b/app/code/core/Mage/Adminhtml/Block/Widget/Tab/Interface.php index a11b346b7b9e89a4d827a60c2a36f0085cfb83d4..716b4173a1ddfc2735ba69be3996e0a370966d70 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Tab/Interface.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Tab/Interface.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Tabs.php b/app/code/core/Mage/Adminhtml/Block/Widget/Tabs.php index d02f84d2601646c38659b31064cefb2b7ec046dc..2597095aacaba49ffa8670644b5488be0ba800af 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Tabs.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Tabs.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/View/Container.php b/app/code/core/Mage/Adminhtml/Block/Widget/View/Container.php index 0c4072f1313ea1c8b1a884b064e3d1385c7c1e45..e20f5d74d75c43404e89e9ad06d5de61597bed1a 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/View/Container.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/View/Container.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Controller/Action.php b/app/code/core/Mage/Adminhtml/Controller/Action.php index efbfd9c351cfe5f88acc13db0250a207714725ce..e6e3d2cbc03e89f8b559e54e813fced61a6ecc18 100644 --- a/app/code/core/Mage/Adminhtml/Controller/Action.php +++ b/app/code/core/Mage/Adminhtml/Controller/Action.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Controller/Report/Abstract.php b/app/code/core/Mage/Adminhtml/Controller/Report/Abstract.php new file mode 100644 index 0000000000000000000000000000000000000000..adcebaf55cc37c585f2a3c5b18c1f1aaa40a4293 --- /dev/null +++ b/app/code/core/Mage/Adminhtml/Controller/Report/Abstract.php @@ -0,0 +1,124 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Adminhtml + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + + +/** + * Admin abstract reports controller + * + * @category Mage + * @package Mage_Adminhtml + * @author Magento Core Team <core@magentocommerce.com> + */ +abstract class Mage_Adminhtml_Controller_Report_Abstract extends Mage_Adminhtml_Controller_Action +{ + /** + * Admin session model + * + * @var null|Mage_Admin_Model_Session + */ + protected $_adminSession = null; + + /** + * Retrieve admin session model + * + * @return Mage_Admin_Model_Session + */ + protected function _getSession() + { + if (is_null($this->_adminSession)) { + $this->_adminSession = Mage::getSingleton('Mage_Admin_Model_Session'); + } + return $this->_adminSession; + } + + /** + * Add report breadcrumbs + * + * @return Mage_Adminhtml_Controller_Report_Abstract + */ + public function _initAction() + { + $this->loadLayout() + ->_addBreadcrumb(Mage::helper('Mage_Reports_Helper_Data')->__('Reports'), Mage::helper('Mage_Reports_Helper_Data')->__('Reports')); + return $this; + } + + /** + * Report action init operations + * + * @param array|Varien_Object $blocks + * @return Mage_Adminhtml_Controller_Report_Abstract + */ + public function _initReportAction($blocks) + { + if (!is_array($blocks)) { + $blocks = array($blocks); + } + + $requestData = Mage::helper('Mage_Adminhtml_Helper_Data')->prepareFilterString($this->getRequest()->getParam('filter')); + $requestData = $this->_filterDates($requestData, array('from', 'to')); + $requestData['store_ids'] = $this->getRequest()->getParam('store_ids'); + $params = new Varien_Object(); + + foreach ($requestData as $key => $value) { + if (!empty($value)) { + $params->setData($key, $value); + } + } + + foreach ($blocks as $block) { + if ($block) { + $block->setPeriodType($params->getData('period_type')); + $block->setFilterData($params); + } + } + + return $this; + } + + /** + * Add refresh statistics links + * + * @param string $flagCode + * @param string $refreshCode + * @return Mage_Adminhtml_Controller_Report_Abstract + */ + protected function _showLastExecutionTime($flagCode, $refreshCode) + { + $flag = Mage::getModel('Mage_Reports_Model_Flag')->setReportFlagCode($flagCode)->loadSelf(); + $updatedAt = ($flag->hasData()) + ? Mage::app()->getLocale()->storeDate( + 0, new Zend_Date($flag->getLastUpdate(), Varien_Date::DATETIME_INTERNAL_FORMAT), true + ) + : 'undefined'; + + $refreshStatsLink = $this->getUrl('*/report_statistics'); + $directRefreshLink = $this->getUrl('*/report_statistics/refreshRecent', array('code' => $refreshCode)); + + Mage::getSingleton('Mage_Adminhtml_Model_Session')->addNotice(Mage::helper('Mage_Adminhtml_Helper_Data')->__('Last updated: %s. To refresh last day\'s <a href="%s">statistics</a>, click <a href="%s">here</a>.', $updatedAt, $refreshStatsLink, $directRefreshLink)); + return $this; + } +} diff --git a/app/code/core/Mage/Adminhtml/Controller/Sales/Creditmemo.php b/app/code/core/Mage/Adminhtml/Controller/Sales/Creditmemo.php index a3db9bac1b0b825425d487b666492a6c4de745bb..4765143f4438444ae0434934c8fecb833cd2136d 100644 --- a/app/code/core/Mage/Adminhtml/Controller/Sales/Creditmemo.php +++ b/app/code/core/Mage/Adminhtml/Controller/Sales/Creditmemo.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Controller/Sales/Invoice.php b/app/code/core/Mage/Adminhtml/Controller/Sales/Invoice.php index 5b899ba9b74324b1076f64f722b43179ddf12917..5f713086ecea6406fea824cb2e2009b35d8bda1f 100644 --- a/app/code/core/Mage/Adminhtml/Controller/Sales/Invoice.php +++ b/app/code/core/Mage/Adminhtml/Controller/Sales/Invoice.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Controller/Sales/Shipment.php b/app/code/core/Mage/Adminhtml/Controller/Sales/Shipment.php index 9683ec828adfdafb2e241c4d1fc717e972f39ce4..c64b21fd1ee3e05d4fa32f0350ed41fc07b7f895 100644 --- a/app/code/core/Mage/Adminhtml/Controller/Sales/Shipment.php +++ b/app/code/core/Mage/Adminhtml/Controller/Sales/Shipment.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Exception.php b/app/code/core/Mage/Adminhtml/Exception.php index aec29c1ea29d6422c6491ad4a3bf086573b6e475..62a57f0379d4f8ef4b1327781c0a56091526e184 100644 --- a/app/code/core/Mage/Adminhtml/Exception.php +++ b/app/code/core/Mage/Adminhtml/Exception.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Helper/Addresses.php b/app/code/core/Mage/Adminhtml/Helper/Addresses.php index 6ccfb65b6398425520b471a588a7b4f9641b2d52..bd9225aebf4953d7afb8491b06276ead3e844ab7 100644 --- a/app/code/core/Mage/Adminhtml/Helper/Addresses.php +++ b/app/code/core/Mage/Adminhtml/Helper/Addresses.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Helper/Catalog.php b/app/code/core/Mage/Adminhtml/Helper/Catalog.php index 9ae0bc4854d5346f3ba965d6c9ea43a4ee45084f..2fd481c71145ae3c079e38d48b66c32a8d0a2d12 100644 --- a/app/code/core/Mage/Adminhtml/Helper/Catalog.php +++ b/app/code/core/Mage/Adminhtml/Helper/Catalog.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Helper/Catalog/Product/Composite.php b/app/code/core/Mage/Adminhtml/Helper/Catalog/Product/Composite.php index 9c16f029078d6867c9982f4a66ab50717d7ff2f9..688e9e244f29585ff02daacf258c5b550c560bb5 100644 --- a/app/code/core/Mage/Adminhtml/Helper/Catalog/Product/Composite.php +++ b/app/code/core/Mage/Adminhtml/Helper/Catalog/Product/Composite.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Helper/Catalog/Product/Edit/Action/Attribute.php b/app/code/core/Mage/Adminhtml/Helper/Catalog/Product/Edit/Action/Attribute.php index 745a8553cf5df2066f684221d2cd0dfc200d327a..3bcbb4241e5da8d44547a19edd1bae723bbbf9d6 100644 --- a/app/code/core/Mage/Adminhtml/Helper/Catalog/Product/Edit/Action/Attribute.php +++ b/app/code/core/Mage/Adminhtml/Helper/Catalog/Product/Edit/Action/Attribute.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Helper/Dashboard/Abstract.php b/app/code/core/Mage/Adminhtml/Helper/Dashboard/Abstract.php index 7b851d3e7a4c5d6488c382380f39c1f0bab3071f..66c59d0e40556099b4baf8bdf488240ff32abc57 100644 --- a/app/code/core/Mage/Adminhtml/Helper/Dashboard/Abstract.php +++ b/app/code/core/Mage/Adminhtml/Helper/Dashboard/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Helper/Dashboard/Data.php b/app/code/core/Mage/Adminhtml/Helper/Dashboard/Data.php index d395d20a498d81aceb4942a04bdcaf586ea060cd..6119ac7c2a23400d635b60d24fdb48024dbee056 100644 --- a/app/code/core/Mage/Adminhtml/Helper/Dashboard/Data.php +++ b/app/code/core/Mage/Adminhtml/Helper/Dashboard/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Helper/Dashboard/Order.php b/app/code/core/Mage/Adminhtml/Helper/Dashboard/Order.php index 096cba611cd67052ec053e99cd53e667eb3b441d..bb19399e09762e29f06d055aa13ef412d8a8d85a 100644 --- a/app/code/core/Mage/Adminhtml/Helper/Dashboard/Order.php +++ b/app/code/core/Mage/Adminhtml/Helper/Dashboard/Order.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Helper/Data.php b/app/code/core/Mage/Adminhtml/Helper/Data.php index 0fa97d28d11bc1c67c4a74240702d57941d57fc3..3792f5ee02dca1c5a181cc4e55bdc31b6d25ea4d 100644 --- a/app/code/core/Mage/Adminhtml/Helper/Data.php +++ b/app/code/core/Mage/Adminhtml/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Helper/Js.php b/app/code/core/Mage/Adminhtml/Helper/Js.php index e3ddc85c7463eadfd3da39a28b8f9d6e8cad3aca..9b30e7f8e629cda8f17922ae3cb1fd37caf8c143 100644 --- a/app/code/core/Mage/Adminhtml/Helper/Js.php +++ b/app/code/core/Mage/Adminhtml/Helper/Js.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Helper/Media/Js.php b/app/code/core/Mage/Adminhtml/Helper/Media/Js.php index 9e274513c13509edd6f48c59103a845616907e4b..523da5baca4259b356400b39103871cd32e47e76 100644 --- a/app/code/core/Mage/Adminhtml/Helper/Media/Js.php +++ b/app/code/core/Mage/Adminhtml/Helper/Media/Js.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -28,9 +28,10 @@ /** * Media library js helper * + * @deprecated since 1.7.0.0 * @category Mage * @package Mage_Adminhtml - * @author Magento Core Team <core@magentocommerce.com> + * @author Magento Core Team <core@magentocommerce.com> */ class Mage_Adminhtml_Helper_Media_Js extends Mage_Core_Helper_Js { diff --git a/app/code/core/Mage/Adminhtml/Helper/Rss.php b/app/code/core/Mage/Adminhtml/Helper/Rss.php index 90291d8e846d682dca260f67edc5ba727c920599..572ce277439228dfd34c6a569f41832f9465c624 100644 --- a/app/code/core/Mage/Adminhtml/Helper/Rss.php +++ b/app/code/core/Mage/Adminhtml/Helper/Rss.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Helper/Sales.php b/app/code/core/Mage/Adminhtml/Helper/Sales.php index 120aaf12821b35fdc9534bd4f5ddfcdf6fb261af..4e639d046fe44d2db64aa473f0666466c36e0481 100644 --- a/app/code/core/Mage/Adminhtml/Helper/Sales.php +++ b/app/code/core/Mage/Adminhtml/Helper/Sales.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/Config.php b/app/code/core/Mage/Adminhtml/Model/Config.php index 8a55f0636b1364dce991c36fa25d45440b15a27b..9517f4b700154f580a2f0cd14d443e923f42911c 100644 --- a/app/code/core/Mage/Adminhtml/Model/Config.php +++ b/app/code/core/Mage/Adminhtml/Model/Config.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/Config/Data.php b/app/code/core/Mage/Adminhtml/Model/Config/Data.php index 50c7afc4ec8194feb3dc7ebadf886a9d6f6f15d0..01b8cb121e4820330a9a6da4a096403ceca9fd35 100644 --- a/app/code/core/Mage/Adminhtml/Model/Config/Data.php +++ b/app/code/core/Mage/Adminhtml/Model/Config/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -45,6 +45,8 @@ class Mage_Adminhtml_Model_Config_Data extends Varien_Object $this->_validate(); $this->_getScope(); + Mage::dispatchEvent('model_config_data_save_before', array('object' => $this)); + $section = $this->getSection(); $website = $this->getWebsite(); $store = $this->getStore(); diff --git a/app/code/core/Mage/Adminhtml/Model/Customer/Renderer/Region.php b/app/code/core/Mage/Adminhtml/Model/Customer/Renderer/Region.php index 6488fe75ac86925f78f55f6186c52decc603758f..d8976ffd318cc4d38a9f52f9263ef9597d76b7c1 100644 --- a/app/code/core/Mage/Adminhtml/Model/Customer/Renderer/Region.php +++ b/app/code/core/Mage/Adminhtml/Model/Customer/Renderer/Region.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/Email/Template.php b/app/code/core/Mage/Adminhtml/Model/Email/Template.php index 4b05d4d6c37003261d97c393145298193a4803b8..2d0cdbfcf483b680df8c308cd89bf1f2cfb4d9ee 100644 --- a/app/code/core/Mage/Adminhtml/Model/Email/Template.php +++ b/app/code/core/Mage/Adminhtml/Model/Email/Template.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/Extension.php b/app/code/core/Mage/Adminhtml/Model/Extension.php index a17ada6516cbdad7d3ada34abdf3251f6c8a9bcd..e791ee747905200563fbbc00d4888f207c1def6c 100644 --- a/app/code/core/Mage/Adminhtml/Model/Extension.php +++ b/app/code/core/Mage/Adminhtml/Model/Extension.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/Giftmessage/Save.php b/app/code/core/Mage/Adminhtml/Model/Giftmessage/Save.php index f53e8c78ea7029d321b9144f29784e282a9e91c4..627c10c5a37f5275cb5de71286c1e003d0f72d57 100644 --- a/app/code/core/Mage/Adminhtml/Model/Giftmessage/Save.php +++ b/app/code/core/Mage/Adminhtml/Model/Giftmessage/Save.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/LayoutUpdate/Validator.php b/app/code/core/Mage/Adminhtml/Model/LayoutUpdate/Validator.php index deec68f06b6021fd9c1ef6df61cfaa495490ef22..2e10b422a51f68db80525bc4e9393fc83c84bd7c 100644 --- a/app/code/core/Mage/Adminhtml/Model/LayoutUpdate/Validator.php +++ b/app/code/core/Mage/Adminhtml/Model/LayoutUpdate/Validator.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/Newsletter/Renderer/Text.php b/app/code/core/Mage/Adminhtml/Model/Newsletter/Renderer/Text.php index 06aef2f20b239f09cfaa2d2784848dbea6b7d4b0..b679b993c95c8e9698a14970b6cbd11a06c38d95 100644 --- a/app/code/core/Mage/Adminhtml/Model/Newsletter/Renderer/Text.php +++ b/app/code/core/Mage/Adminhtml/Model/Newsletter/Renderer/Text.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/Observer.php b/app/code/core/Mage/Adminhtml/Model/Observer.php index 276dc2ab73a8ea0f360f5550e7a26c974d69cc82..099aa335fcd81b57ba474c4a7d0502f288339d07 100644 --- a/app/code/core/Mage/Adminhtml/Model/Observer.php +++ b/app/code/core/Mage/Adminhtml/Model/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/Report/Item.php b/app/code/core/Mage/Adminhtml/Model/Report/Item.php index 8bd7756813271d124c023a20c5d85b9dcbbe8f6c..44b86db696fdbaffb3fec4fa84f5488d1485538d 100644 --- a/app/code/core/Mage/Adminhtml/Model/Report/Item.php +++ b/app/code/core/Mage/Adminhtml/Model/Report/Item.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Adminhtml_Model_Report_Item extends Varien_Object diff --git a/app/code/core/Mage/Adminhtml/Model/Sales/Order.php b/app/code/core/Mage/Adminhtml/Model/Sales/Order.php index 296cd74bf87771d684f0774523ae781bd4792ca5..9b1013bcd0f89c9b510fde9c0fa815edf68818e7 100644 --- a/app/code/core/Mage/Adminhtml/Model/Sales/Order.php +++ b/app/code/core/Mage/Adminhtml/Model/Sales/Order.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -71,9 +71,7 @@ class Mage_Adminhtml_Model_Sales_Order foreach ($order->getAllItems() as $item) { if (!$productCollection->getItemById($item->getProductId())) { $this->_getSession()->addError( - Mage::helper('Mage_Adminhtml_Helper_Data')->__('The item %s (SKU %s) does not exist in the catalog anymore.', - $item->getName(), - $item->getSku() + Mage::helper('Mage_Adminhtml_Helper_Data')->__('The item %s (SKU %s) does not exist in the catalog anymore.', $item->getName(), $item->getSku() )); $hasBadItems = true; } @@ -87,4 +85,3 @@ class Mage_Adminhtml_Model_Sales_Order } } - diff --git a/app/code/core/Mage/Adminhtml/Model/Sales/Order/Create.php b/app/code/core/Mage/Adminhtml/Model/Sales/Order/Create.php index 92bf730c98d978fa012d6acf3611ee1594a7d17d..26dc8d39a4875986419adb0722c3e6342715e9e9 100644 --- a/app/code/core/Mage/Adminhtml/Model/Sales/Order/Create.php +++ b/app/code/core/Mage/Adminhtml/Model/Sales/Order/Create.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -32,7 +32,7 @@ * @package Mage_Adminhtml * @author Magento Core Team <core@magentocommerce.com> */ -class Mage_Adminhtml_Model_Sales_Order_Create extends Varien_Object +class Mage_Adminhtml_Model_Sales_Order_Create extends Varien_Object implements Mage_Checkout_Model_Cart_Interface { /** * Quote session object @@ -111,6 +111,13 @@ class Mage_Adminhtml_Model_Sales_Order_Create extends Varien_Object */ protected $_errors = array(); + /** + * Quote associated with the model + * + * @var Mage_Sales_Model_Quote + */ + protected $_quote; + public function __construct() { $this->_session = Mage::getSingleton('Mage_Adminhtml_Model_Session_Quote'); @@ -233,7 +240,22 @@ class Mage_Adminhtml_Model_Sales_Order_Create extends Varien_Object */ public function getQuote() { - return $this->getSession()->getQuote(); + if (!$this->_quote) { + $this->_quote = $this->getSession()->getQuote(); + } + return $this->_quote; + } + + /** + * Set quote object + * + * @param Mage_Sales_Model_Quote $quote + * @return Mage_Adminhtml_Model_Sales_Order_Create + */ + public function setQuote(Mage_Sales_Model_Quote $quote) + { + $this->_quote = $quote; + return $this; } /** @@ -633,6 +655,9 @@ class Mage_Adminhtml_Model_Sales_Order_Create extends Varien_Object $this->removeItem($itemId, $from); } } + if (isset($data['empty_customer_cart']) && (int)$data['empty_customer_cart'] == 1) { + $this->getCustomerCart()->removeAllItems()->collectTotals()->save(); + } return $this; } diff --git a/app/code/core/Mage/Adminhtml/Model/Sales/Order/Random.php b/app/code/core/Mage/Adminhtml/Model/Sales/Order/Random.php index 99c7a104837f44b2cfc1ec3042d91c0dc7fdff49..4ce4b49c867fcee66bf049ae964104e90cf01f25 100644 --- a/app/code/core/Mage/Adminhtml/Model/Sales/Order/Random.php +++ b/app/code/core/Mage/Adminhtml/Model/Sales/Order/Random.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/Search/Catalog.php b/app/code/core/Mage/Adminhtml/Model/Search/Catalog.php index 2f58b22b4c104af9e628f8767358a8b591af15e1..f9d7d9bb7d028ad7a97cdf1934315b9524cf302a 100644 --- a/app/code/core/Mage/Adminhtml/Model/Search/Catalog.php +++ b/app/code/core/Mage/Adminhtml/Model/Search/Catalog.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/Search/Customer.php b/app/code/core/Mage/Adminhtml/Model/Search/Customer.php index b06896883f1a59e571ed87ef49821922813fd31b..a860a55c4cb4c1b90e6ad86874795b1e3c11b846 100644 --- a/app/code/core/Mage/Adminhtml/Model/Search/Customer.php +++ b/app/code/core/Mage/Adminhtml/Model/Search/Customer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/Search/Order.php b/app/code/core/Mage/Adminhtml/Model/Search/Order.php index eb93779a7a419df5d4cbca2e1d4ddd91ea942baf..77a33e8501847eab248f20f62be83682a37d9052 100644 --- a/app/code/core/Mage/Adminhtml/Model/Search/Order.php +++ b/app/code/core/Mage/Adminhtml/Model/Search/Order.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/Session.php b/app/code/core/Mage/Adminhtml/Model/Session.php index 401136d23949256fba7e15616f4e17e487d1041a..7ebb30e7ad8c4296a67acd5053983da76d1e4463 100644 --- a/app/code/core/Mage/Adminhtml/Model/Session.php +++ b/app/code/core/Mage/Adminhtml/Model/Session.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/Session/Quote.php b/app/code/core/Mage/Adminhtml/Model/Session/Quote.php index d8bf31246f219a26b23b0cdcef96e504ac838efd..8ff13b2d3f57ac03c676c8a636b5523b7adf47b8 100644 --- a/app/code/core/Mage/Adminhtml/Model/Session/Quote.php +++ b/app/code/core/Mage/Adminhtml/Model/Session/Quote.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Admin/Custom.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Admin/Custom.php index 57a4a5fee563100ccf5a7560f15fcda99cecae1e..e7abd834904abe5ee44ee6d488f3e6bbcff49985 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Admin/Custom.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Admin/Custom.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Admin/Custompath.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Admin/Custompath.php index 5c02fa82b4b1ae2af7dc27c3b4cb4135745398ab..e1475539175be886a805935405064249255f700f 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Admin/Custompath.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Admin/Custompath.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Admin/Observer.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Admin/Observer.php index 5b033370680bb6b12f48da08d84cfc8f11d44179..6060269ae0b84d1c3e4a387fd7e4c48bdf3c2ee5 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Admin/Observer.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Admin/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Admin/Password/Link/Expirationperiod.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Admin/Password/Link/Expirationperiod.php index c0b48d180a5ba22cbe3c90092f54685857d32783..42c3fc4a1b80203af4f03fa474642ec618701d12 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Admin/Password/Link/Expirationperiod.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Admin/Password/Link/Expirationperiod.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Admin/Usecustom.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Admin/Usecustom.php index 1f23c85a2c1e894ca5d9841088ea3981aa8de20b..6c3523528d4c20c3681dc92556aa3f551e925823 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Admin/Usecustom.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Admin/Usecustom.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Admin/Usecustompath.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Admin/Usecustompath.php index 5b5040bd18b17d4af97d69608a8aee44292da168..bcdcc7e0b4e6ca0ecc955122d6eed74d01717036 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Admin/Usecustompath.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Admin/Usecustompath.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Admin/Usesecretkey.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Admin/Usesecretkey.php index 1318d6b05fe10446a99a57932b282003cf62a8e0..e422d45a38475561895777eb4d45da914e09177a 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Admin/Usesecretkey.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Admin/Usesecretkey.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Baseurl.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Baseurl.php index 5186d288fe06d630eee9384b378994e92f2e2a15..8d3df8a603e6bcb28fb5ee113763dfd230cf3caf 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Baseurl.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Baseurl.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Cache.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Cache.php index 6a3204fc5f4a34221b31ece9647bb09683f8f794..f9f6af5e63dbafc681810b935da666b911ca7cbd 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Cache.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Cache.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Catalog/Inventory/Managestock.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Catalog/Inventory/Managestock.php index 1e1f57a984a7b836e0fe87af650a2866eccb1b4b..d54f4121f9843395b9c4f140e675a6925d64d114 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Catalog/Inventory/Managestock.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Catalog/Inventory/Managestock.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Catalog/Search/Type.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Catalog/Search/Type.php index ecb19cc3e2661efd412c57aa8f9b463c338360bc..92c220973c3f9a004e470945f2806aa3433c03a2 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Catalog/Search/Type.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Catalog/Search/Type.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Category.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Category.php index 0b43edb3affbc8b9a46e32ae7d5e6aa154255f9e..80ac66c3b43a8ad208054d0cf6cae0d3da5a025f 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Category.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Category.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Currency/Abstract.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Currency/Abstract.php index 25c14e4b3bf4ab9c5f44e460c9525a8a5a958a44..c8e8deabf3dc2a99a6f41c9a10562c2f3aabc7fd 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Currency/Abstract.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Currency/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Currency/Allow.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Currency/Allow.php index 8456d0d95541bf0ceb1c45fe483ecf4e1b63424c..d244be362bfab7e4afa3726568dd45fefbaa7107 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Currency/Allow.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Currency/Allow.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Currency/Base.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Currency/Base.php index 71a9ed14a2422edef8854a4ebe311a136083300f..dcbac27fd83110364efb45949a11436fb2931008 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Currency/Base.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Currency/Base.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Currency/Cron.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Currency/Cron.php index 07e3105efd493868c665fa57a94fa2399f09cbdb..3c315bbe06487966ee4e44c075819d70fcc57ddc 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Currency/Cron.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Currency/Cron.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Currency/Default.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Currency/Default.php index 54af420d7081b6b135b6b2d381fa8df762c6d9be..25200d6ab9ebaad83d5a4e8dc2940383422712f0 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Currency/Default.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Currency/Default.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Customer/Address/Street.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Customer/Address/Street.php index 9a47c77fdc10c15adabeb975945883d375c40df5..b14d0f5d9310e0fd738d63e01c8d1fec60a93d50 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Customer/Address/Street.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Customer/Address/Street.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Customer/GroupAutoAssign.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Customer/GroupAutoAssign.php new file mode 100644 index 0000000000000000000000000000000000000000..06eaed7428161da91f842136e9dd7e9ceea4ec6f --- /dev/null +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Customer/GroupAutoAssign.php @@ -0,0 +1,57 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Adminhtml + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Auto-assign customer group Model + * + * @category Mage + * @package Mage_Adminhtml + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Adminhtml_Model_System_Config_Backend_Customer_GroupAutoAssign extends Mage_Core_Model_Config_Data +{ + /** + * If merchant country is not in EU, VAT Validation should be disabled + * + * @return Mage_Core_Model_Abstract + */ + protected function _beforeSave() + { + $storeId = $this->getScopeId(); + $merchantCountry = Mage::getStoreConfig('general/store_information/merchant_country', $storeId); + + if (!Mage::helper('Mage_Core_Helper_Data')->isCountryInEU($merchantCountry, $storeId)) { + Mage::getConfig()->saveConfig( + Mage_Customer_Helper_Address::XML_PATH_VAT_VALIDATION_ENABLED, + 0, + $this->getScope(), + $storeId + ); + } + + return parent::_beforeSave(); + } +} diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Customer/Password/Link/Expirationperiod.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Customer/Password/Link/Expirationperiod.php index c64ddee4d11d77deed8d2a9bf827c9c4f29019b8..3e3ead27555a9cc8e31cf6896f314513b0707c07 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Customer/Password/Link/Expirationperiod.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Customer/Password/Link/Expirationperiod.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Customer/Show/Address.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Customer/Show/Address.php index e5b2cabb2bd5f6414280cb0432fc2bc145026ae9..a549a002efb247e68f8c283d93575350888dd535 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Customer/Show/Address.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Customer/Show/Address.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Customer/Show/Customer.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Customer/Show/Customer.php index dc7488f9a2981abc8a2de1f3c4c3fab1a3ec735d..83d5b132fda787acc83ba9a625b4254f8d363ba9 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Customer/Show/Customer.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Customer/Show/Customer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Datashare.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Datashare.php index 42430935f1ca346d75ed06b8867fa66bd435d119..7c472a0b7ab20c7772d31a349d1c95943fefdea0 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Datashare.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Datashare.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Design/Exception.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Design/Exception.php index 21c08ca4b0e00760a76254c4532d93922bd045cc..a1648d1c033a209cb8f893c906db97fd3199bfc6 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Design/Exception.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Design/Exception.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Email/Address.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Email/Address.php index 65548f8fcc92af167d3654c062aa3a40ce741492..80a458feccb09cb0b966a687ef8f15192d634f70 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Email/Address.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Email/Address.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Email/Sender.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Email/Sender.php index fb58b92052659f1bd851c429f652a25c9521ca60..56d87bd571951dfaba7c7f9afc7fa38a85de617e 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Email/Sender.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Email/Sender.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Encrypted.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Encrypted.php index f7a08ca013bc6ca041f1525c30034903833a9d8d..14a1129a27f54937c3fab18e93441c7f71b5358a 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Encrypted.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Encrypted.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/File.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/File.php index 44642951370b7a6bfcb5d8ddbcaf4e3e3a272971..bf8c5bee0e2630582837197342702dcf68fc8b4f 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/File.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/File.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Filename.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Filename.php index 95a11f853ab155a2de6c73ce59915d2ac996af3f..83a0c76ccb59f6fde243bcdc732d5dd06a728d6c 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Filename.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Filename.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Image.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Image.php index ad148be31cdd19e3e9e704423cc8de9562efd880..02c402377c36ed3238d9f10ed03c8ce45b041957 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Image.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Image.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Image/Favicon.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Image/Favicon.php index dfa5d057e51462c95fe8d6f4b41ea14668f18118..89894e871d62638676c8463fb67c67a94874166f 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Image/Favicon.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Image/Favicon.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Image/Pdf.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Image/Pdf.php index f393bd4d2a2240f527ace30bfc4b06b904a7b30a..575dffbb0c86639b6ae206df33a9ec07c0f6d86b 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Image/Pdf.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Image/Pdf.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Locale.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Locale.php index aeefd0d8e05a169c2d7907076335f03f5f27895f..30a0c8061a6ab1916d8d1843ada726f629b5698a 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Locale.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Locale.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -48,8 +48,11 @@ class Mage_Adminhtml_Model_System_Config_Backend_Locale extends Mage_Core_Model_ $values = explode(',', $this->getValue()); $exceptions = array(); + foreach ($collection as $data) { $match = false; + $scopeName = Mage::helper('Mage_Adminhtml_Helper_Data')->__('Default scope'); + if (preg_match('/(base|default)$/', $data->getPath(), $match)) { if (!in_array($data->getValue(), $values)) { $currencyName = Mage::app()->getLocale()->currency($data->getValue())->getName(); @@ -76,11 +79,7 @@ class Mage_Adminhtml_Model_System_Config_Backend_Locale extends Mage_Core_Model_ break; } - $exceptions[] = Mage::helper('Mage_Adminhtml_Helper_Data')->__('Currency "%s" is used as %s in %s.', - $currencyName, - $fieldName, - $scopeName - ); + $exceptions[] = Mage::helper('Mage_Adminhtml_Helper_Data')->__('Currency "%s" is used as %s in %s.', $currencyName, $fieldName, $scopeName); } } } diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Locale/Timezone.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Locale/Timezone.php index b280ecbe842f2e46bde9f010166630988b6f1b8d..048fa75f8386d7e42d1de64f72efa00e94ef6fac 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Locale/Timezone.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Locale/Timezone.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Log/Cron.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Log/Cron.php index 5ef3d4bcc376bd1839c3e804ba8a73ba9211c872..a2e85090949255a7e9dceec7dcc0e9cc5a5e5154 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Log/Cron.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Log/Cron.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Price/Scope.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Price/Scope.php index d627818b581f088128f1b9ad236b4c1ec092a850..3c22b87e9256509960bc2613c65ee7086c8e3ba3 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Price/Scope.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Price/Scope.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Product/Alert/Cron.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Product/Alert/Cron.php index 7061fa7abb0cc7c296eef56f083c12740c7895ba..50a2e1df57507897d91dd23033bc58712588fc94 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Product/Alert/Cron.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Product/Alert/Cron.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Secure.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Secure.php index a0c513250a7eead9a4b083ba5ad0b6351a218c94..c3ae44f80d0cec371677ce68bfbbaa535f9c764b 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Secure.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Secure.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Seo/Product.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Seo/Product.php index 3012bb38430344f4d7ca484d8e2dd1e42ac5aab6..64a0632c3f77e6bdb41a8f8f5f029d5dabfd643a 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Seo/Product.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Seo/Product.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Serialized.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Serialized.php index 26c60859f0379f1289776c9f72f4a0162b5823f4..3355f1776c662b10a0232f4bc5b08cab5e7514ba 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Serialized.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Serialized.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Serialized/Array.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Serialized/Array.php index 83f8d185952612a169923c637fae29a46135c364..df16b1a1e3aec18ba6e0b19987bd07391b934df6 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Serialized/Array.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Serialized/Array.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Shipping/Tablerate.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Shipping/Tablerate.php index feb9065fe9e8f1acaa10b7a4511fcc7c97c5abcf..91fe5ff23f2d37e63110f57d2a1dd7082bda3f86 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Shipping/Tablerate.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Shipping/Tablerate.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Sitemap.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Sitemap.php index 6eb50a972f8bd46bfa71bae6affbd19658038728..dc7c042260f16d4b5dac081d4264c2f5be4e7890 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Sitemap.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Sitemap.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Sitemap/Cron.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Sitemap/Cron.php index b3674526433e3b5329abf83e48cc4ddc50f376b2..793f0cc96d2b752fdf5d3d02a379458b2be8d691 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Sitemap/Cron.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Sitemap/Cron.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Storage/Media/Database.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Storage/Media/Database.php index c20160b0bb444a88deeed553bfa8185d502bba16..877d20f2b7ae5044cf5c9d350edde38ec488e543 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Storage/Media/Database.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Storage/Media/Database.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Store.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Store.php index f4d51d76687b249d52c59c9350bbd924655c3247..95ed09a1f58ed5afa264f2f31bee277488a060a8 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Store.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Store.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Translate.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Translate.php index c01da5d67c837823eab148da191a485f1fa23dd8..f92dd2d7ba453282e6de543119951f423514d6cc 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Translate.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Translate.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Clone/Media/Image.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Clone/Media/Image.php index 7c69ef9161aa8f60d828c9f808f4b0d9930721b7..e19c2ea81e593d54dfb18d7f520f585ad287d997 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Clone/Media/Image.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Clone/Media/Image.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Admin/Page.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Admin/Page.php index 47b52a07f1c4e4496ae3be3e7d08465736c06472..fadd44c9a53dcd1114d19fe308bb9126933860bf 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Admin/Page.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Admin/Page.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Allregion.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Allregion.php index 449d9301f64adc1b4c40ee060d99b48f56f1f462..bf12e42c5b194ca580990e00928ca076d4269ead 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Allregion.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Allregion.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Catalog/GridPerPage.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Catalog/GridPerPage.php index 05bc9fd390ff7e866a4c7da3d0ce609c91b99c3b..c99eb155663047f109d17fb67f339993e9ef2a75 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Catalog/GridPerPage.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Catalog/GridPerPage.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Catalog/ListMode.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Catalog/ListMode.php index c0f151116bcd4cf8f750ffe4157ccbf847170dc5..7caeb03bd5de5c04dfdd1459ec2f91c1819f9c8d 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Catalog/ListMode.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Catalog/ListMode.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Catalog/ListPerPage.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Catalog/ListPerPage.php index d2937baa09e899ea58ca23bd316a80c2e1101753..bf66a4285a62bb0005e02350834117949c87ec1f 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Catalog/ListPerPage.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Catalog/ListPerPage.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Catalog/ListSort.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Catalog/ListSort.php index 35b74e5b62b54f1cb49b44b32bcb01bdb894f18b..cdc3000b29503c1fc4233adb4e27bde7e979524b 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Catalog/ListSort.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Catalog/ListSort.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Catalog/Search/Type.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Catalog/Search/Type.php index 833277380e031b70fb70a21dcdee6a531ba4ce82..594837eeb4bdb7210eaac57eb156347d09fdf2e4 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Catalog/Search/Type.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Catalog/Search/Type.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Catalog/TimeFormat.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Catalog/TimeFormat.php index 8df61bbecf06176200ade73db78f64a81010e179..0769b1d537a6f79f564e2855b0e108de2267413d 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Catalog/TimeFormat.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Catalog/TimeFormat.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Category.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Category.php index cf0d386bd12ccdfbd2d52f3ebb003ce18e5c498b..20494281f94f75bc42af2a671748f5a0666b8447 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Category.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Category.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Checktype.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Checktype.php index e045b3503b835c3214c28ef6cddd274c3a7131f7..2408f979b0954b71e0faf0736aee83c94ff2e736 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Checktype.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Checktype.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Cms/Page.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Cms/Page.php index 88045ca2aceebab7d2d586dabc5be3be8e5943a8..107c8986834d1754450a9813b682d4d879b25a70 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Cms/Page.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Cms/Page.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Adminhtml_Model_System_Config_Source_Cms_Page diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Cms/Wysiwyg/Enabled.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Cms/Wysiwyg/Enabled.php index 5129e7b527af5b1c35c2f99dd0ab72265ab6c2fe..4e18f373a30d8cf67988e56280d5ef6418785fa7 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Cms/Wysiwyg/Enabled.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Cms/Wysiwyg/Enabled.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Country.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Country.php index 7ac4be48931ef4f20a4178c52ee14dda4bd28594..538f7ad80055dc0fd6acb104a72de7e5b066e517 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Country.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Country.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Country/Full.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Country/Full.php index f2b8048d935ec676a9b0ac485a3b89553062f0e5..f1e4a7be5f3c919d891874d111ec8e84496f0dd4 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Country/Full.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Country/Full.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Cron/Frequency.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Cron/Frequency.php index e14c92cc4948a91df0bb805dbc5f33d118d2b175..432b30ad75b74912bd561cf3e118b0e21a511933 100755 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Cron/Frequency.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Cron/Frequency.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Currency.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Currency.php index b24ed935a9299f952a0ca55155c2106dee6b6c41..44d0862e437b72f2b0ee917b8d2052b494f9feb0 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Currency.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Currency.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Currency/Service.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Currency/Service.php index bb2b913d8be52aa8c36f39e9b38f143e7c03c117..b15df5aac2b3f102fdfd7fe646babb6d62ae9e7f 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Currency/Service.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Currency/Service.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Customer/Address/Type.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Customer/Address/Type.php new file mode 100644 index 0000000000000000000000000000000000000000..f37e323ad3f5b9a4e592370849678bbb1633c2d9 --- /dev/null +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Customer/Address/Type.php @@ -0,0 +1,48 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Adminhtml + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Source model of customer address types + * + * @category Mage + * @package Mage_Adminhtml + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Adminhtml_Model_System_Config_Source_Customer_Address_Type +{ + /** + * Retrieve possible customer address types + * + * @return array + */ + public function toOptionArray() + { + return array( + Mage_Customer_Model_Address_Abstract::TYPE_BILLING => Mage::helper('Mage_Adminhtml_Helper_Data')->__('Billing Address'), + Mage_Customer_Model_Address_Abstract::TYPE_SHIPPING => Mage::helper('Mage_Adminhtml_Helper_Data')->__('Shipping Address') + ); + } +} diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Customer/Group.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Customer/Group.php index 46f829933d4ef100542e52813049550b36481361..c67aa416a6471f51454d1ca4b08bc44ea85e866a 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Customer/Group.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Customer/Group.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Customer/Group/Multiselect.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Customer/Group/Multiselect.php new file mode 100644 index 0000000000000000000000000000000000000000..0b168734c1bc4c2d1ec99d854475e462ee3fc603 --- /dev/null +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Customer/Group/Multiselect.php @@ -0,0 +1,50 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Adminhtml + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +class Mage_Adminhtml_Model_System_Config_Source_Customer_Group_Multiselect +{ + /** + * Customer groups options array + * + * @var null|array + */ + protected $_options; + + /** + * Retrieve customer groups as array + * + * @return array + */ + public function toOptionArray() + { + if (!$this->_options) { + $this->_options = Mage::getResourceModel('Mage_Customer_Model_Resource_Group_Collection') + ->setRealGroupsFilter() + ->loadData()->toOptionArray(); + } + return $this->_options; + } +} diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Date/Short.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Date/Short.php index b4d62ce4288b421dbadf8a8e3df6f8cfb8fb081a..b0d9bee836d4fb8924980130b395acba824ea45e 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Date/Short.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Date/Short.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Design/Package.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Design/Package.php index 04b993ddcd3dde4bb03fd2fab4275645f1db1070..dba7cb508eca83486f4a9d266aa774bbe05053ee 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Design/Package.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Design/Package.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Adminhtml_Model_System_Config_Source_Package diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Design/Robots.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Design/Robots.php index 11090da9b51c82981529f32826a268133fed49b1..2b63840fac323865b356e551b2a3c983755239c1 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Design/Robots.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Design/Robots.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Dev/Dbautoup.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Dev/Dbautoup.php index 1109dec13e2e7f41bb3de21014a2baacc06bfe18..e9ce071f07a4b2620e97bbeeaca01a362104b2f6 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Dev/Dbautoup.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Dev/Dbautoup.php @@ -20,18 +20,17 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Adminhtml_Model_System_Config_Source_Dev_Dbautoup { public function toOptionArray() { - $hlp = Mage::helper('Mage_Adminhtml_Helper_Data'); return array( - array('value'=>Mage_Core_Model_Resource::AUTO_UPDATE_ALWAYS, 'label'=>$hlp->__('Always (during development)')), - array('value'=>Mage_Core_Model_Resource::AUTO_UPDATE_ONCE, 'label'=>$hlp->__('Only Once (version upgrade)')), - array('value'=>Mage_Core_Model_Resource::AUTO_UPDATE_NEVER, 'label'=>$hlp->__('Never (production)')), + array('value'=>Mage_Core_Model_Resource::AUTO_UPDATE_ALWAYS, 'label' => Mage::helper('Mage_Adminhtml_Helper_Data')->__('Always (during development)')), + array('value'=>Mage_Core_Model_Resource::AUTO_UPDATE_ONCE, 'label' => Mage::helper('Mage_Adminhtml_Helper_Data')->__('Only Once (version upgrade)')), + array('value'=>Mage_Core_Model_Resource::AUTO_UPDATE_NEVER, 'label' => Mage::helper('Mage_Adminhtml_Helper_Data')->__('Never (production)')), ); } diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Email/Identity.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Email/Identity.php index 94848aa1f908ec5a4ed8112f4f70adcc0bb6d8eb..1882c960145977246682e0397f90d7d5bc5371b6 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Email/Identity.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Email/Identity.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Email/Method.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Email/Method.php index 57eac63173e305228460d71c90ab462d2707a8aa..b877438992f2eed342c2f60dad1069c8d954b8e3 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Email/Method.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Email/Method.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Email/Smtpauth.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Email/Smtpauth.php index a806cad68ee4c50367e6cca5d4b4d8b570587777..4918cbe6c2b3eb2761330f26b719f814e1cdc71c 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Email/Smtpauth.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Email/Smtpauth.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Email/Template.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Email/Template.php index f5c0eea54ab3d0170a5373eff363a5c1e33ab94f..442bd95f49212208f4fc6597dc75d93f368b2d39 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Email/Template.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Email/Template.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Enabledisable.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Enabledisable.php index 6f766f806bf7321033bd7e2ed7e0ecadb8c574f9..160978f1be99872f1f16934bc52f90e113faaabe 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Enabledisable.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Enabledisable.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Frequency.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Frequency.php index 2b174aa591fb2d7a2d643af66fa3c0c958bf7961..ecdd2004b7437526fe09a4503610c3cc3c4ed7a2 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Frequency.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Frequency.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Locale.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Locale.php index e892ba8f6193c360f3e2d352de38cd591f84c9d7..f2d2ab830c08094d9f19c6b6eb8f168a64b5f7c5 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Locale.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Locale.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Locale/Country.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Locale/Country.php index ac26271a5d141fb1842d46508a93864d70fe8b1f..cb509591d2641982633a4df1015d91ee0b2ba0f4 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Locale/Country.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Locale/Country.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Locale/Currency.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Locale/Currency.php index 0635ed83396ac41d3e198c1f8d1a2aba929c86cf..ab5b2dfadfe681d17f0932ecf2b585a4e4922187 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Locale/Currency.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Locale/Currency.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Locale/Currency/All.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Locale/Currency/All.php index e346ec591114ecb45847f6070c36faf602ffd7ac..ff1a617b394abcb58d07c3766db1d0982dc03819 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Locale/Currency/All.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Locale/Currency/All.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Locale/Timezone.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Locale/Timezone.php index 0e409f7f9f8041e41d44a3e9651fb056efd37e7d..9a319c11346b93066834c16ff65eecbb1657ee4d 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Locale/Timezone.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Locale/Timezone.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Locale/Weekdays.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Locale/Weekdays.php index 66d041f336b41481848a9dfc9dd5172ffaa75459..d5905b739b85cd81b911bc0aac71036ff63edf97 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Locale/Weekdays.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Locale/Weekdays.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Nooptreq.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Nooptreq.php index 6aca0a43557a873b526e6977973bccf7cc3bea55..9ad6c4d5f9a44b11a4809cbc2f1065763bbf93ee 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Nooptreq.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Nooptreq.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Adminhtml_Model_System_Config_Source_Nooptreq diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Notification/Frequency.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Notification/Frequency.php index 6ea6a55987713f4b1e7e932dd089a47a63a6d7f5..6811eb8d969e3be59a0a42ee47440b86704a6f3a 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Notification/Frequency.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Notification/Frequency.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Order/Status.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Order/Status.php index 55a42316c7b8004f194a45546fd3861c996c7464..0fa4aa566173635410de8d48123af551a2699e1d 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Order/Status.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Order/Status.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Order/Status/New.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Order/Status/New.php index d18071c8c1c228de4e2aeea9573bbcddc4333af7..4f87b182f3701fa4a3d336b4c75484cfd8bc0699 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Order/Status/New.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Order/Status/New.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Order/Status/Newprocessing.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Order/Status/Newprocessing.php index 7a51d1c77cbc43048f9acb9163ea125c3ff0fd91..7a71d272de4128498284668d57822c52c9d175d8 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Order/Status/Newprocessing.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Order/Status/Newprocessing.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Order/Status/Processing.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Order/Status/Processing.php index 76852c533f741b3b418fa58ebaf8cfa952b536f7..42892359248d8ada677ff5c79c2860c60cc24d48 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Order/Status/Processing.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Order/Status/Processing.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Payment/Allmethods.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Payment/Allmethods.php index 8c59feadea6776f231356ad6e7fe9d8956c95902..350f10a4e4d1ff6fbbafef4f5a58763e92010bf1 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Payment/Allmethods.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Payment/Allmethods.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Payment/Allowedmethods.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Payment/Allowedmethods.php index d321d0234f4ea3edd486c2430ef8cee41f79ae34..ad11e10bf7bf40d750f5d1c06fd78d8ca9ba398f 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Payment/Allowedmethods.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Payment/Allowedmethods.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Payment/Allspecificcountries.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Payment/Allspecificcountries.php index 9173aafeec69bc2304fb8a11fa235e86895247b7..4fc42b8451e8799531af96c5f2abb7181feb7584 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Payment/Allspecificcountries.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Payment/Allspecificcountries.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Payment/Cctype.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Payment/Cctype.php index 3d2a3a5c32c13c691c0024c3bfb16824f5df5971..a23ba7937f1b7e3fac40b515127fb754089da81d 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Payment/Cctype.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Payment/Cctype.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Price/Scope.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Price/Scope.php index 72b6573f192eb7fe1488bd5c69d712e4de91a60d..c171c71a3c5a4297b79e0b31ca159173e3c83e59 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Price/Scope.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Price/Scope.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Price/Step.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Price/Step.php index 1522bde835b43802fb3767c104ced95b0da3c79d..1b5691533988cf99528f6eca87ae47b597035fc4 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Price/Step.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Price/Step.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Product/Options/Price.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Product/Options/Price.php index e1256e06d94562a616bd0a33e1154b594c5c4159..ae3a07fc5de38e3eb7ec47ab171a542658ffe40e 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Product/Options/Price.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Product/Options/Price.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Product/Options/Type.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Product/Options/Type.php index 69d2bf44d3a884ccaf8dcf5b545829d71145878f..9563ca278e78ed7e42bccb875b5b545be8fdf16b 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Product/Options/Type.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Product/Options/Type.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -41,13 +41,16 @@ class Mage_Adminhtml_Model_System_Config_Source_Product_Options_Type array('value' => '', 'label' => Mage::helper('Mage_Adminhtml_Helper_Data')->__('-- Please select --')) ); + $helper = Mage::helper('Mage_Catalog_Helper_Data'); + foreach (Mage::getConfig()->getNode(self::PRODUCT_OPTIONS_GROUPS_PATH)->children() as $group) { $types = array(); $typesPath = self::PRODUCT_OPTIONS_GROUPS_PATH . '/' . $group->getName() . '/types'; foreach (Mage::getConfig()->getNode($typesPath)->children() as $type) { - $labelPath = self::PRODUCT_OPTIONS_GROUPS_PATH . '/' . $group->getName() . '/types/' . $type->getName() . '/label'; + $labelPath = self::PRODUCT_OPTIONS_GROUPS_PATH . '/' . $group->getName() . '/types/' . $type->getName() + . '/label'; $types[] = array( - 'label' => (string) Mage::getConfig()->getNode($labelPath), + 'label' => $helper->__((string) Mage::getConfig()->getNode($labelPath)), 'value' => $type->getName() ); } @@ -55,7 +58,7 @@ class Mage_Adminhtml_Model_System_Config_Source_Product_Options_Type $labelPath = self::PRODUCT_OPTIONS_GROUPS_PATH . '/' . $group->getName() . '/label'; $groups[] = array( - 'label' => (string) Mage::getConfig()->getNode($labelPath), + 'label' => $helper->__((string) Mage::getConfig()->getNode($labelPath)), 'value' => $types ); } diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Product/Thumbnail.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Product/Thumbnail.php index 97c24d8f6962e964d44956a15e5ef1ba150e9b1b..8e22dbf982a37e366adda12da2dbc6ace38a15c7 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Product/Thumbnail.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Product/Thumbnail.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Reports/Scope.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Reports/Scope.php index 5f03696f04adcc4c3a6e93c86af5e7ed2d9280dc..2654b32fdbe00739e106e03af418a59e76a8a8d9 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Reports/Scope.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Reports/Scope.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Shipping/Allmethods.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Shipping/Allmethods.php index 0fd6a7e6af0f44224c31e21ab8ee94f727c4431e..81bf95798b6157320f10c418b97973a516c3ef90 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Shipping/Allmethods.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Shipping/Allmethods.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Shipping/Allspecificcountries.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Shipping/Allspecificcountries.php index 3e19f9ebe7548e22909256fc31f2ed79c5d6c495..5c3b9728a875aed22bbc1fcda4395a926c807c3f 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Shipping/Allspecificcountries.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Shipping/Allspecificcountries.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Shipping/Flatrate.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Shipping/Flatrate.php index c1c352119e9e8a33e42eb809e220dfcd2d444676..c16ec105968548cf2c119cdf3df9790e7c4d9fb7 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Shipping/Flatrate.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Shipping/Flatrate.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Shipping/Tablerate.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Shipping/Tablerate.php index c399fd08b4760496abd0d4a29901100922d9c370..c0a039be5e5dc0525836abb1626f77905ee8bd97 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Shipping/Tablerate.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Shipping/Tablerate.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Shipping/Taxclass.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Shipping/Taxclass.php index a6f7beee6fa138c089e5a06125785cc08fe93782..649085ff44cc92101aee9fb84aba065621106179 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Shipping/Taxclass.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Shipping/Taxclass.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Adminhtml_Model_System_Config_Source_Shipping_Taxclass diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Storage/Media/Database.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Storage/Media/Database.php index 81e39b8989d612ae1b4cf45b14e0375a62ef5305..c2670add3d8dad6b848681b5b351cf9c89abd663 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Storage/Media/Database.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Storage/Media/Database.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Storage/Media/Storage.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Storage/Media/Storage.php index 810e217f4e0676a7962a1e812d87b8feed750331..75d7a2750c0016a4948e52f3908953e799d32d52 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Storage/Media/Storage.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Storage/Media/Storage.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Store.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Store.php index 53280ce35196684040266a47e8dbb9181592f6d4..f847b9651e97fcb1b33ebfb8f90d3014c10e56d8 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Store.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Store.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Tax/Apply/On.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Tax/Apply/On.php index ba4520305b679e74effb46b65bbe90555d18249a..327166b01da1690e35acdda12ec861d9e05fb392 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Tax/Apply/On.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Tax/Apply/On.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Adminhtml_Model_System_Config_Source_Tax_Apply_On diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Tax/Basedon.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Tax/Basedon.php index e29597965d3c360a52ee3fef4747a55b46966126..2a6f595d8d1b05f3af286f4b382aca8946ccf721 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Tax/Basedon.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Tax/Basedon.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Adminhtml_Model_System_Config_Source_Tax_Basedon diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Tax/Catalog.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Tax/Catalog.php index 891655c603e247e0b45e82162c6238be2c7541bf..48c735ea4d84210d337eefff3da75465341cfc67 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Tax/Catalog.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Tax/Catalog.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Adminhtml_Model_System_Config_Source_Tax_Catalog diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Watermark/Position.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Watermark/Position.php index 9d5dd6c20173e084cddc8f5071430a5fb146bb23..43e15984d5736455fc67e16e3303b9c5a3cfbd37 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Watermark/Position.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Watermark/Position.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Web/Protocol.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Web/Protocol.php index 597c9a610313e91d38f9098a17a7bd68b5e8ce12..a647f6d60dbb6a5452b46a1610ff8df3a1f6482b 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Web/Protocol.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Web/Protocol.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Adminhtml_Model_System_Config_Source_Web_Protocol diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Web/Redirect.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Web/Redirect.php index 5f34070176861120162a0f2702563ea75cf8ad7e..a18dc4c7c7d5e83cdd044f25215d48922ddb5d2d 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Web/Redirect.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Web/Redirect.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Adminhtml_Model_System_Config_Source_Web_Redirect diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Website.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Website.php index d3c30777f66c8a42adf8a6cf9368efe800f2c4d3..1cd91b35bff3fa708c4263abf13edbc80a53099b 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Website.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Website.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Yesno.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Yesno.php index 1a7701829d16ecefbdd30261a5122a58b13012d4..3b2d6026e99ff7f827eb850fd2c842593f98687b 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Yesno.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Yesno.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Yesnocustom.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Yesnocustom.php index 921d976d5dbba8bb546e42ff9e87255ef2f3a82c..5144aed6defa5669ec709c30d75547564516120a 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Yesnocustom.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Yesnocustom.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/Model/System/Store.php b/app/code/core/Mage/Adminhtml/Model/System/Store.php index e41c7263b6f73688b091431edfe7348e13f99b86..ac4bf40ae55ea173489664b37a672041649ea082 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Store.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Store.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -488,7 +488,7 @@ class Mage_Adminhtml_Model_System_Store extends Varien_Object if (isset($this->_storeCollection[$storeId])) { $data = $this->_storeCollection[$storeId]; $name .= $this->getWebsiteName($data->getWebsiteId()); - $name .= ($name ? '/' : '').$this->getGroupName($data->getGroupId()); + $name .= ($name ? '/' : '') . $this->getGroupName($data->getGroupId()); } } return $name; diff --git a/app/code/core/Mage/Adminhtml/Model/Url.php b/app/code/core/Mage/Adminhtml/Model/Url.php index b6f4c52c7a5699da9fd54227a15ff2053b8766b4..01b9fe6b8f3838cac100759eb4b56d798ad653cd 100644 --- a/app/code/core/Mage/Adminhtml/Model/Url.php +++ b/app/code/core/Mage/Adminhtml/Model/Url.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Adminhtml_Model_Url extends Mage_Core_Model_Url diff --git a/app/code/core/Mage/Adminhtml/controllers/AjaxController.php b/app/code/core/Mage/Adminhtml/controllers/AjaxController.php index 6556682fda2e476b1a04eec2731e7c03b68bd6ce..fa1ac333fae3bc01293d38559abc2b6b8cc740f6 100644 --- a/app/code/core/Mage/Adminhtml/controllers/AjaxController.php +++ b/app/code/core/Mage/Adminhtml/controllers/AjaxController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Api/RoleController.php b/app/code/core/Mage/Adminhtml/controllers/Api/RoleController.php index 4d1c6e339e46af262cc309741b9b56ec252ad7a2..183f9d4f5744d6df172967a80d286f037a36f3a3 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Api/RoleController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Api/RoleController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Api/UserController.php b/app/code/core/Mage/Adminhtml/controllers/Api/UserController.php index e6fc444f908dde974d1907684bcc62bc2d380261..faffad63918a820041cff309059c553966336997 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Api/UserController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Api/UserController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Adminhtml_Api_UserController extends Mage_Adminhtml_Controller_Action diff --git a/app/code/core/Mage/Adminhtml/controllers/CacheController.php b/app/code/core/Mage/Adminhtml/controllers/CacheController.php index e696bedb67557f36ee6a74291e71eedfaee01f82..f15798160ab0d93ca732f8a334ec7531bcb0c223 100644 --- a/app/code/core/Mage/Adminhtml/controllers/CacheController.php +++ b/app/code/core/Mage/Adminhtml/controllers/CacheController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Catalog/Category/WidgetController.php b/app/code/core/Mage/Adminhtml/controllers/Catalog/Category/WidgetController.php index 800dc53079fdb5fa7499dc8272e79dbc92c6db56..6c379bd7c27b42eef56df4fa2989d8de18a6d197 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Catalog/Category/WidgetController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Catalog/Category/WidgetController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Catalog/CategoryController.php b/app/code/core/Mage/Adminhtml/controllers/Catalog/CategoryController.php index d12527f87697e265583e76b7fc89c924e6297051..8a826f781955e1e65905d51a480a4e89a8b8d16c 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Catalog/CategoryController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Catalog/CategoryController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -178,13 +178,23 @@ class Mage_Adminhtml_Catalog_CategoryController extends Mage_Adminhtml_Controlle ->setLastEditedCategory($category->getId()); // $this->_initLayoutMessages('Mage_Adminhtml_Model_Session'); $this->loadLayout(); - $this->getResponse()->setBody(Mage::helper('Mage_Core_Helper_Data')->jsonEncode(array( - 'messages' => $this->getLayout()->getMessagesBlock()->getGroupedHtml(), - 'content' => - $this->getLayout()->getBlock('category.edit')->getFormHtml() + + $eventResponse = new Varien_Object(array( + 'content' => $this->getLayout()->getBlock('category.edit')->getFormHtml() . $this->getLayout()->getBlock('category.tree') - ->getBreadcrumbsJavascript($breadcrumbsPath, 'editingCategoryBreadcrumbs') - ))); + ->getBreadcrumbsJavascript($breadcrumbsPath, 'editingCategoryBreadcrumbs'), + 'messages' => $this->getLayout()->getMessagesBlock()->getGroupedHtml(), + )); + + Mage::dispatchEvent('category_prepare_ajax_response', array( + 'response' => $eventResponse, + 'controller' => $this + )); + + $this->getResponse()->setBody( + Mage::helper('Mage_Core_Helper_Data')->jsonEncode($eventResponse->getData()) + ); + return; } diff --git a/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/Action/AttributeController.php b/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/Action/AttributeController.php index 8152355a71aadb2bd49a5bf29b6b4270b28bf6ac..4d7366bace430048604fc304852ef0d4ecc89964 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/Action/AttributeController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/Action/AttributeController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -159,8 +159,7 @@ class Mage_Adminhtml_Catalog_Product_Action_AttributeController extends Mage_Adm } $this->_getSession()->addSuccess( - $this->__('Total of %d record(s) were updated', - count($this->_getHelper()->getProductIds())) + $this->__('Total of %d record(s) were updated', count($this->_getHelper()->getProductIds())) ); } catch (Mage_Core_Exception $e) { diff --git a/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/AttributeController.php b/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/AttributeController.php index f931ee02454c82397a092be069f5ceba6011de5a..3db2d854392df136210d8e73dad90a9d3672f4b1 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/AttributeController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/AttributeController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -185,7 +185,8 @@ class Mage_Adminhtml_Catalog_Product_AttributeController extends Mage_Adminhtml_ $validatorAttrCode = new Zend_Validate_Regex(array('pattern' => '/^[a-z][a-z_0-9]{1,254}$/')); if (!$validatorAttrCode->isValid($data['attribute_code'])) { $session->addError( - $helper->__('Attribute code is invalid. Please use only letters (a-z), numbers (0-9) or underscore(_) in this field, first character should be a letter.')); + Mage::helper('Mage_Catalog_Helper_Data')->__('Attribute code is invalid. Please use only letters (a-z), numbers (0-9) or underscore(_) in this field, first character should be a letter.') + ); $this->_redirect('*/*/edit', array('attribute_id' => $id, '_current' => true)); return; } diff --git a/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/DatafeedsController.php b/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/DatafeedsController.php index 6168cc499c3256414fa1e990fde83753af05dd55..178df4f1390857e5a03a3f87dbcffd68c4f2a102 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/DatafeedsController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/DatafeedsController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/GalleryController.php b/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/GalleryController.php index bebc327ebc5a0b842995c5b37c01865f09f2b90a..8aa70f916ad9df012c5615435651e8fda2881dc6 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/GalleryController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/GalleryController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -46,6 +46,11 @@ class Mage_Adminhtml_Catalog_Product_GalleryController extends Mage_Adminhtml_Co Mage::getSingleton('Mage_Catalog_Model_Product_Media_Config')->getBaseTmpMediaPath() ); + Mage::dispatchEvent('catalog_product_gallery_upload_image_after', array( + 'result' => $result, + 'action' => $this + )); + /** * Workaround for prototype 1.7 methods "isJSON", "evalJSON" on Windows OS */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/GroupController.php b/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/GroupController.php index aabfb08c6f2bdb63401bb51d37469b3dff800d07..2dd43295ea21f45bcfdc6796235551e2d98b7302 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/GroupController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/GroupController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/ReviewController.php b/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/ReviewController.php index d2089a0e397800d5861c1ed0ce867739b2121ac6..29c540a5d0746e3a3f274513e4976c9e914f3e91 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/ReviewController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/ReviewController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/SetController.php b/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/SetController.php index 2e8e7bc61c1782fbb063820f4302c70f8c3ae69e..939a9316d6172ad906fa1ac13b3e3915ca405724 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/SetController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/SetController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/WidgetController.php b/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/WidgetController.php index 20dd441e93fbfeaeb206345fbe636dc11143c51e..322d2a54bb3e4e6bc4c80715c410a6c0fc92ee54 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/WidgetController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/WidgetController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Catalog/ProductController.php b/app/code/core/Mage/Adminhtml/controllers/Catalog/ProductController.php index a9c04062b85996958e698bf87b41c9f2e397decc..a305ce08b92223e6ed6adfc2b5fe225c516d73d3 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Catalog/ProductController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Catalog/ProductController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Catalog/SearchController.php b/app/code/core/Mage/Adminhtml/controllers/Catalog/SearchController.php index eb1acc6bce4014abef32014a2eef4031c1202cb0..26a3a8bcc4945e4e07d0046b8baa50f6b7dff2a3 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Catalog/SearchController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Catalog/SearchController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -178,9 +178,7 @@ class Mage_Adminhtml_Catalog_SearchController extends Mage_Adminhtml_Controller_ $model->delete(); } Mage::getSingleton('Mage_Adminhtml_Model_Session')->addSuccess( - Mage::helper('Mage_Adminhtml_Helper_Data')->__( - 'Total of %d record(s) were deleted', count($searchIds) - ) + Mage::helper('Mage_Adminhtml_Helper_Data')->__('Total of %d record(s) were deleted', count($searchIds)) ); } catch (Exception $e) { Mage::getSingleton('Mage_Adminhtml_Model_Session')->addError($e->getMessage()); diff --git a/app/code/core/Mage/Adminhtml/controllers/Checkout/AgreementController.php b/app/code/core/Mage/Adminhtml/controllers/Checkout/AgreementController.php index bd1b2cf6454b9cb96da9a9d56703af1d0f4ac90b..584997bdd102d913dd256c9811c8e84b1ffb4680 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Checkout/AgreementController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Checkout/AgreementController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -54,11 +54,13 @@ class Mage_Adminhtml_Checkout_AgreementController extends Mage_Adminhtml_Control $id = $this->getRequest()->getParam('id'); $agreementModel = Mage::getModel('Mage_Checkout_Model_Agreement'); - $hlp = Mage::helper('Mage_Checkout_Helper_Data'); + if ($id) { $agreementModel->load($id); if (!$agreementModel->getId()) { - Mage::getSingleton('Mage_Adminhtml_Model_Session')->addError($hlp->__('This condition no longer exists.')); + Mage::getSingleton('Mage_Adminhtml_Model_Session')->addError( + Mage::helper('Mage_Checkout_Helper_Data')->__('This condition no longer exists.') + ); $this->_redirect('*/*/'); return; } @@ -74,7 +76,12 @@ class Mage_Adminhtml_Checkout_AgreementController extends Mage_Adminhtml_Control Mage::register('checkout_agreement', $agreementModel); $this->_initAction() - ->_addBreadcrumb($id ? $hlp->__('Edit Condition') : $hlp->__('New Condition'), $id ? $hlp->__('Edit Condition') : $hlp->__('New Condition')) + ->_addBreadcrumb( + $id ? Mage::helper('Mage_Checkout_Helper_Data')->__('Edit Condition') + : Mage::helper('Mage_Checkout_Helper_Data')->__('New Condition'), + $id ? Mage::helper('Mage_Checkout_Helper_Data')->__('Edit Condition') + : Mage::helper('Mage_Checkout_Helper_Data')->__('New Condition') + ) ->_addContent( $this->getLayout() ->createBlock('Mage_Adminhtml_Block_Checkout_Agreement_Edit') diff --git a/app/code/core/Mage/Adminhtml/controllers/Cms/Block/WidgetController.php b/app/code/core/Mage/Adminhtml/controllers/Cms/Block/WidgetController.php index b4f1356aa824cb9ef311dc0bfb1b12f024738bab..d5133d5fb89cd79f4bf0597868ce81adb7385ad2 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Cms/Block/WidgetController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Cms/Block/WidgetController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Cms/BlockController.php b/app/code/core/Mage/Adminhtml/controllers/Cms/BlockController.php index f62c7cfba06b70fb4707dbe0a0f261ad19435d61..ae7bfc9eec6c9937e94c2951b3d827081cbe2ded 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Cms/BlockController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Cms/BlockController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Cms/Page/WidgetController.php b/app/code/core/Mage/Adminhtml/controllers/Cms/Page/WidgetController.php index 16cf4a07cdf81b7c63c046e8ba3785edaac44495..4980db54ee5f0ff9f1d770a4dedc1a2c7044f889 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Cms/Page/WidgetController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Cms/Page/WidgetController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Cms/PageController.php b/app/code/core/Mage/Adminhtml/controllers/Cms/PageController.php index 8f738ca13b44d8afa8ff5d891b95fb4ce0cc44cc..ae5f9cc32cca0d5869e60a161f5f11f6a80c0d78 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Cms/PageController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Cms/PageController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Cms/Wysiwyg/ImagesController.php b/app/code/core/Mage/Adminhtml/controllers/Cms/Wysiwyg/ImagesController.php index 60b139f5b4213e8c36a681dbbf1d0f11e3cacfaa..5b1bf2d3c0a711367f45420ee1faa3cae3f311af 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Cms/Wysiwyg/ImagesController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Cms/Wysiwyg/ImagesController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Cms/WysiwygController.php b/app/code/core/Mage/Adminhtml/controllers/Cms/WysiwygController.php index f3381bfc1656f9f25a95b5882e645c9cab2bfb16..caf3e505e00a981b9fcf28afc0ba82befa533429 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Cms/WysiwygController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Cms/WysiwygController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Customer/Cart/Product/Composite/CartController.php b/app/code/core/Mage/Adminhtml/controllers/Customer/Cart/Product/Composite/CartController.php index 1eede4696599f7eb86aafe857cfe9b1183069b13..3c7eadc7c34b6b7d1ffe28f8fa25ca43e831311d 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Customer/Cart/Product/Composite/CartController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Customer/Cart/Product/Composite/CartController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Customer/GroupController.php b/app/code/core/Mage/Adminhtml/controllers/Customer/GroupController.php index 6823962aa557cda03dc614e67774a6d824cfdef1..0d48c0a2a22fba88b232ddc2b941f04d2d28eb4d 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Customer/GroupController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Customer/GroupController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Customer/OnlineController.php b/app/code/core/Mage/Adminhtml/controllers/Customer/OnlineController.php index b375799915c6247be034d2cf7dadac62b7d9380c..e08ec599a0155b1f177f27a1fc317b66ac6bfbe0 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Customer/OnlineController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Customer/OnlineController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Adminhtml_Customer_OnlineController extends Mage_Adminhtml_Controller_Action diff --git a/app/code/core/Mage/Adminhtml/controllers/Customer/System/Config/ValidatevatController.php b/app/code/core/Mage/Adminhtml/controllers/Customer/System/Config/ValidatevatController.php new file mode 100644 index 0000000000000000000000000000000000000000..7d8d7831049b2d8a70964a0d40f874906245f4a6 --- /dev/null +++ b/app/code/core/Mage/Adminhtml/controllers/Customer/System/Config/ValidatevatController.php @@ -0,0 +1,91 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Adminhtml + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * VAT validation controller + * + * @category Mage + * @package Mage_Adminhtml + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Adminhtml_Customer_System_Config_ValidatevatController extends Mage_Adminhtml_Controller_Action +{ + /** + * Perform customer VAT ID validation + * + * @return Varien_Object + */ + protected function _validate() + { + return Mage::helper('Mage_Customer_Helper_Data')->checkVatNumber( + $this->getRequest()->getParam('country'), + $this->getRequest()->getParam('vat') + ); + } + + /** + * Check whether vat is valid + * + * @return void + */ + public function validateAction() + { + $result = $this->_validate(); + $this->getResponse()->setBody((int)$result->getIsValid()); + } + + /** + * Retrieve validation result as JSON + * + * @return void + */ + public function validateAdvancedAction() + { + /** @var $coreHelper Mage_Core_Helper_Data */ + $coreHelper = Mage::helper('Mage_Core_Helper_Data'); + + $result = $this->_validate(); + $valid = $result->getIsValid(); + $success = $result->getRequestSuccess(); + // ID of the store where order is placed + $storeId = $this->getRequest()->getParam('store_id'); + // Sanitize value if needed + if (!is_null($storeId)) { + $storeId = (int)$storeId; + } + + $groupId = Mage::helper('Mage_Customer_Helper_Data')->getCustomerGroupIdBasedOnVatNumber( + $this->getRequest()->getParam('country'), $result, $storeId + ); + + $body = $coreHelper->jsonEncode(array( + 'valid' => $valid, + 'group' => $groupId, + 'success' => $success + )); + $this->getResponse()->setBody($body); + } +} diff --git a/app/code/core/Mage/Adminhtml/controllers/Customer/Wishlist/Product/Composite/WishlistController.php b/app/code/core/Mage/Adminhtml/controllers/Customer/Wishlist/Product/Composite/WishlistController.php index 7c8b79fb8dba3a24e83e8a50d039497563c9a699..86822d08579e1fe3bd302e7484c1430b229e38cf 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Customer/Wishlist/Product/Composite/WishlistController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Customer/Wishlist/Product/Composite/WishlistController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/CustomerController.php b/app/code/core/Mage/Adminhtml/controllers/CustomerController.php index 618f62885bb5721a4845f640f203d0822923041e..df2e4801712634a41ef302069abf8fdb2be07987 100644 --- a/app/code/core/Mage/Adminhtml/controllers/CustomerController.php +++ b/app/code/core/Mage/Adminhtml/controllers/CustomerController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -86,7 +86,7 @@ class Mage_Adminhtml_CustomerController extends Mage_Adminhtml_Controller_Action public function gridAction() { $this->loadLayout(); - $this->getResponse()->setBody($this->getLayout()->createBlock('Mage_Adminhtml_Block_Customer_Grid')->toHtml()); + $this->renderLayout(); } /** @@ -186,21 +186,27 @@ class Mage_Adminhtml_CustomerController extends Mage_Adminhtml_Controller_Action { $data = $this->getRequest()->getPost(); if ($data) { - $redirectBack = $this->getRequest()->getParam('back', false); + $redirectBack = $this->getRequest()->getParam('back', false); $this->_initCustomer('customer_id'); - /* @var $customer Mage_Customer_Model_Customer */ + /** @var $customer Mage_Customer_Model_Customer */ $customer = Mage::registry('current_customer'); - /* @var $customerForm Mage_Customer_Model_Form */ + /** @var $customerForm Mage_Customer_Model_Form */ $customerForm = Mage::getModel('Mage_Customer_Model_Form'); $customerForm->setEntity($customer) ->setFormCode('adminhtml_customer') ->ignoreInvisible(false) ; - $formData = $customerForm->extractData($this->getRequest(), 'account'); - $errors = $customerForm->validateData($formData); + $formData = $customerForm->extractData($this->getRequest(), 'account'); + + // Handle 'disable auto_group_change' attribute + if (isset($formData['disable_auto_group_change'])) { + $formData['disable_auto_group_change'] = empty($formData['disable_auto_group_change']) ? '0' : '1'; + } + + $errors = $customerForm->validateData($formData); if ($errors !== true) { foreach ($errors as $error) { $this->_getSession()->addError($error); @@ -212,27 +218,36 @@ class Mage_Adminhtml_CustomerController extends Mage_Adminhtml_Controller_Action $customerForm->compactData($formData); - // unset template data + // Unset template data if (isset($data['address']['_template_'])) { unset($data['address']['_template_']); } $modifiedAddresses = array(); if (!empty($data['address'])) { - /* @var $addressForm Mage_Customer_Model_Form */ + /** @var $addressForm Mage_Customer_Model_Form */ $addressForm = Mage::getModel('Mage_Customer_Model_Form'); $addressForm->setFormCode('adminhtml_customer_address')->ignoreInvisible(false); foreach (array_keys($data['address']) as $index) { $address = $customer->getAddressItemById($index); if (!$address) { - $address = Mage::getModel('Mage_Customer_Model_Address'); + $address = Mage::getModel('Mage_Customer_Model_Address'); } $requestScope = sprintf('address/%s', $index); $formData = $addressForm->setEntity($address) ->extractData($this->getRequest(), $requestScope); - $errors = $addressForm->validateData($formData); + + // Set default billing and shipping flags to address + $isDefaultBilling = isset($data['account']['default_billing']) + && $data['account']['default_billing'] == $index; + $address->setIsDefaultBilling($isDefaultBilling); + $isDefaultShipping = isset($data['account']['default_shipping']) + && $data['account']['default_shipping'] == $index; + $address->setIsDefaultShipping($isDefaultShipping); + + $errors = $addressForm->validateData($formData); if ($errors !== true) { foreach ($errors as $error) { $this->_getSession()->addError($error); @@ -257,7 +272,7 @@ class Mage_Adminhtml_CustomerController extends Mage_Adminhtml_Controller_Action } } - // default billing and shipping + // Default billing and shipping if (isset($data['account']['default_billing'])) { $customer->setData('default_billing', $data['account']['default_billing']); } @@ -268,7 +283,7 @@ class Mage_Adminhtml_CustomerController extends Mage_Adminhtml_Controller_Action $customer->setData('confirmation', $data['account']['confirmation']); } - // not modified customer addresses mark for delete + // Mark not modified customer addresses for delete foreach ($customer->getAddressesCollection() as $customerAddress) { if ($customerAddress->getId() && !in_array($customerAddress->getId(), $modifiedAddresses)) { $customerAddress->setData('_deleted', true); @@ -286,7 +301,7 @@ class Mage_Adminhtml_CustomerController extends Mage_Adminhtml_Controller_Action $isNewCustomer = $customer->isObjectNew(); try { $sendPassToEmail = false; - // force new customer active + // Force new customer confirmation if ($isNewCustomer) { $customer->setPassword($data['account']['password']); $customer->setForceConfirmed(true); @@ -303,14 +318,13 @@ class Mage_Adminhtml_CustomerController extends Mage_Adminhtml_Controller_Action $customer->save(); - // send welcome email + // Send welcome email if ($customer->getWebsiteId() && (isset($data['account']['sendemail']) || $sendPassToEmail)) { $storeId = $customer->getSendemailStoreId(); if ($isNewCustomer) { $customer->sendNewAccountEmail('registered', '', $storeId); - } - // confirm not confirmed customer - else if ((!$customer->getConfirmation())) { + } elseif ((!$customer->getConfirmation())) { + // Confirm not confirmed customer $customer->sendNewAccountEmail('confirmed', '', $storeId); } } @@ -334,8 +348,8 @@ class Mage_Adminhtml_CustomerController extends Mage_Adminhtml_Controller_Action if ($redirectBack) { $this->_redirect('*/*/edit', array( - 'id' => $customer->getId(), - '_current'=>true + 'id' => $customer->getId(), + '_current' => true )); return; } @@ -409,8 +423,8 @@ class Mage_Adminhtml_CustomerController extends Mage_Adminhtml_Controller_Action ->loadByCustomer(Mage::registry('current_customer')); Mage::register('subscriber', $subscriber); - $this->getResponse()->setBody( - $this->getLayout()->createBlock('Mage_Adminhtml_Block_Customer_Edit_Tab_Newsletter_Grid')->toHtml()); + $this->loadLayout() + ->renderLayout(); } public function wishlistAction() @@ -470,10 +484,9 @@ class Mage_Adminhtml_CustomerController extends Mage_Adminhtml_Controller_Action } } - $this->getResponse()->setBody( - $this->getLayout()->createBlock('Mage_Adminhtml_Block_Customer_Edit_Tab_Cart', 'admin.customer.view.cart', - array('website_id'=>$websiteId))->toHtml() - ); + $this->loadLayout(); + $this->getLayout()->getBlock('admin.customer.view.edit.cart')->setWebsiteId($websiteId); + $this->renderLayout(); } /** @@ -534,11 +547,11 @@ class Mage_Adminhtml_CustomerController extends Mage_Adminhtml_Controller_Action public function tagGridAction() { $this->_initCustomer(); - $this->getResponse()->setBody( - $this->getLayout()->createBlock('Mage_Adminhtml_Block_Customer_Edit_Tab_Tag', 'admin.customer.tags') - ->setCustomerId(Mage::registry('current_customer')) - ->toHtml() + $this->loadLayout(); + $this->getLayout()->getBlock('admin.customer.tags')->setCustomerId( + Mage::registry('current_customer') ); + $this->renderLayout(); } public function validateAction() @@ -639,9 +652,7 @@ class Mage_Adminhtml_CustomerController extends Mage_Adminhtml_Controller_Action $customer->save(); } Mage::getSingleton('Mage_Adminhtml_Model_Session')->addSuccess( - Mage::helper('Mage_Adminhtml_Helper_Data')->__( - 'Total of %d record(s) were updated.', count($customersIds) - ) + Mage::helper('Mage_Adminhtml_Helper_Data')->__('Total of %d record(s) were updated.', count($customersIds)) ); } catch (Exception $e) { Mage::getSingleton('Mage_Adminhtml_Model_Session')->addError($e->getMessage()); @@ -663,9 +674,7 @@ class Mage_Adminhtml_CustomerController extends Mage_Adminhtml_Controller_Action $customer->save(); } Mage::getSingleton('Mage_Adminhtml_Model_Session')->addSuccess( - Mage::helper('Mage_Adminhtml_Helper_Data')->__( - 'Total of %d record(s) were updated.', count($customersIds) - ) + Mage::helper('Mage_Adminhtml_Helper_Data')->__('Total of %d record(s) were updated.', count($customersIds)) ); } catch (Exception $e) { Mage::getSingleton('Mage_Adminhtml_Model_Session')->addError($e->getMessage()); @@ -689,9 +698,7 @@ class Mage_Adminhtml_CustomerController extends Mage_Adminhtml_Controller_Action ->delete(); } Mage::getSingleton('Mage_Adminhtml_Model_Session')->addSuccess( - Mage::helper('Mage_Adminhtml_Helper_Data')->__( - 'Total of %d record(s) were deleted.', count($customersIds) - ) + Mage::helper('Mage_Adminhtml_Helper_Data')->__('Total of %d record(s) were deleted.', count($customersIds)) ); } catch (Exception $e) { Mage::getSingleton('Mage_Adminhtml_Model_Session')->addError($e->getMessage()); @@ -714,9 +721,7 @@ class Mage_Adminhtml_CustomerController extends Mage_Adminhtml_Controller_Action $customer->save(); } Mage::getSingleton('Mage_Adminhtml_Model_Session')->addSuccess( - Mage::helper('Mage_Adminhtml_Helper_Data')->__( - 'Total of %d record(s) were updated.', count($customersIds) - ) + Mage::helper('Mage_Adminhtml_Helper_Data')->__('Total of %d record(s) were updated.', count($customersIds)) ); } catch (Exception $e) { Mage::getSingleton('Mage_Adminhtml_Model_Session')->addError($e->getMessage()); diff --git a/app/code/core/Mage/Adminhtml/controllers/DashboardController.php b/app/code/core/Mage/Adminhtml/controllers/DashboardController.php index b08448c4fdf0b489b825d75d7cc9ccb14be7f220..1c19a6bd56899037a6a3d8fa4cbaa559f6d660d9 100644 --- a/app/code/core/Mage/Adminhtml/controllers/DashboardController.php +++ b/app/code/core/Mage/Adminhtml/controllers/DashboardController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/IndexController.php b/app/code/core/Mage/Adminhtml/controllers/IndexController.php index e269689391f323ac3e1a0fb7182f22637f8eb6c2..043f37dea93a6f54224f656f9de02480e8fb87ea 100644 --- a/app/code/core/Mage/Adminhtml/controllers/IndexController.php +++ b/app/code/core/Mage/Adminhtml/controllers/IndexController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -76,14 +76,10 @@ class Mage_Adminhtml_IndexController extends Mage_Adminhtml_Controller_Action return; } $loginData = $this->getRequest()->getParam('login'); - $data = array(); + $username = (is_array($loginData) && array_key_exists('username', $loginData)) ? $loginData['username'] : null; - if(is_array($loginData) && array_key_exists('username', $loginData)) { - $data['username'] = $loginData['username']; - } else { - $data['username'] = null; - } - $this->_outTemplate('admin/login', $data); + $this->loadLayout(); + $this->renderLayout(); } /** @@ -217,40 +213,36 @@ class Mage_Adminhtml_IndexController extends Mage_Adminhtml_Controller_Action if (!empty($email) && !empty($params)) { // Validate received data to be an email address - if (!Zend_Validate::is($email, 'EmailAddress')) { - $this->_getSession()->addError($this->__('Invalid email address.')); - $this->_outTemplate('forgotpassword'); - return; - } - $collection = Mage::getResourceModel('Mage_Admin_Model_Resource_User_Collection'); - /** @var $collection Mage_Admin_Model_Resource_User_Collection */ - $collection->addFieldToFilter('email', $email); - $collection->load(false); - - if ($collection->getSize() > 0) { - foreach ($collection as $item) { - $user = Mage::getModel('Mage_Admin_Model_User')->load($item->getId()); - if ($user->getId()) { - $newResetPasswordLinkToken = Mage::helper('Mage_Admin_Helper_Data')->generateResetPasswordLinkToken(); - $user->changeResetPasswordLinkToken($newResetPasswordLinkToken); - $user->save(); - $user->sendPasswordResetConfirmationEmail(); + if (Zend_Validate::is($email, 'EmailAddress')) { + $collection = Mage::getResourceModel('Mage_Admin_Model_Resource_User_Collection'); + /** @var $collection Mage_Admin_Model_Resource_User_Collection */ + $collection->addFieldToFilter('email', $email); + $collection->load(false); + + if ($collection->getSize() > 0) { + foreach ($collection as $item) { + $user = Mage::getModel('Mage_Admin_Model_User')->load($item->getId()); + if ($user->getId()) { + $newResetPasswordLinkToken = Mage::helper('Mage_Admin_Helper_Data')->generateResetPasswordLinkToken(); + $user->changeResetPasswordLinkToken($newResetPasswordLinkToken); + $user->save(); + $user->sendPasswordResetConfirmationEmail(); + } + break; } - break; } + $this->_getSession() + ->addSuccess(Mage::helper('Mage_Adminhtml_Helper_Data')->__('If there is an account associated with %s you will receive an email with a link to reset your password.', Mage::helper('Mage_Adminhtml_Helper_Data')->escapeHtml($email))); + $this->_redirect('*/*/login'); + return; + } else { + $this->_getSession()->addError($this->__('Invalid email address.')); } - $this->_getSession() - ->addSuccess(Mage::helper('Mage_Adminhtml_Helper_Data')->__('If there is an account associated with %s you will receive an email with a link to reset your password.', Mage::helper('Mage_Adminhtml_Helper_Data')->escapeHtml($email))); - $this->_redirect('*/*/login'); - return; } elseif (!empty($params)) { $this->_getSession()->addError(Mage::helper('Mage_Adminhtml_Helper_Data')->__('The email address is empty.')); } - - $data = array( - 'email' => $email - ); - $this->_outTemplate('admin/forgotpassword', $data); + $this->loadLayout(); + $this->renderLayout(); } /** diff --git a/app/code/core/Mage/Adminhtml/controllers/JsonController.php b/app/code/core/Mage/Adminhtml/controllers/JsonController.php index 63441b834b99e508301e59687f7010ae557e42eb..a6c9216e69f8689b51bb9af30e180656b304e23c 100644 --- a/app/code/core/Mage/Adminhtml/controllers/JsonController.php +++ b/app/code/core/Mage/Adminhtml/controllers/JsonController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Media/EditorController.php b/app/code/core/Mage/Adminhtml/controllers/Media/EditorController.php index ed99b068485b58c8bc4452416b6261457e80b2cc..b1845ab1dff623964c8edc394df5230d405f4233 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Media/EditorController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Media/EditorController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Media/UploaderController.php b/app/code/core/Mage/Adminhtml/controllers/Media/UploaderController.php index 4f20ef9921e7a4d80a07cf01c1c5616581f23ca0..f635125d6fb715cf21a080783a4233039e873f9d 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Media/UploaderController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Media/UploaderController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Newsletter/ProblemController.php b/app/code/core/Mage/Adminhtml/controllers/Newsletter/ProblemController.php index 058db895ee0372b970b7eac12542af485581769a..c558026b1ff89716247bbb498c555ad9b561a040 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Newsletter/ProblemController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Newsletter/ProblemController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Newsletter/QueueController.php b/app/code/core/Mage/Adminhtml/controllers/Newsletter/QueueController.php index a5eb1aca82d78d87d0e8819f4534139890b903ad..3fbd4f20ed7e844031df79d87656463199a4f4bb 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Newsletter/QueueController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Newsletter/QueueController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Newsletter/SubscriberController.php b/app/code/core/Mage/Adminhtml/controllers/Newsletter/SubscriberController.php index 9a5538c87b31d86e46a47906911c52477c50caa2..8036960e43b0f52bfc2e4bb61e511a19625f793b 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Newsletter/SubscriberController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Newsletter/SubscriberController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -102,9 +102,7 @@ class Mage_Adminhtml_Newsletter_SubscriberController extends Mage_Adminhtml_Cont $subscriber->unsubscribe(); } Mage::getSingleton('Mage_Adminhtml_Model_Session')->addSuccess( - Mage::helper('Mage_Adminhtml_Helper_Data')->__( - 'Total of %d record(s) were updated', count($subscribersIds) - ) + Mage::helper('Mage_Adminhtml_Helper_Data')->__('Total of %d record(s) were updated', count($subscribersIds)) ); } catch (Exception $e) { Mage::getSingleton('Mage_Adminhtml_Model_Session')->addError($e->getMessage()); @@ -127,9 +125,7 @@ class Mage_Adminhtml_Newsletter_SubscriberController extends Mage_Adminhtml_Cont $subscriber->delete(); } Mage::getSingleton('Mage_Adminhtml_Model_Session')->addSuccess( - Mage::helper('Mage_Adminhtml_Helper_Data')->__( - 'Total of %d record(s) were deleted', count($subscribersIds) - ) + Mage::helper('Mage_Adminhtml_Helper_Data')->__('Total of %d record(s) were deleted', count($subscribersIds)) ); } catch (Exception $e) { Mage::getSingleton('Mage_Adminhtml_Model_Session')->addError($e->getMessage()); diff --git a/app/code/core/Mage/Adminhtml/controllers/Newsletter/TemplateController.php b/app/code/core/Mage/Adminhtml/controllers/Newsletter/TemplateController.php index 337864afac653ce8fd0d7026445617883e304c58..497702674b00700a0b75d1816102527e203a7199 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Newsletter/TemplateController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Newsletter/TemplateController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ /** diff --git a/app/code/core/Mage/Adminhtml/controllers/NotificationController.php b/app/code/core/Mage/Adminhtml/controllers/NotificationController.php index f4bb81de63399b570abf136ac6a2a8b16bcf61f8..9b697988e14b5fede55ebdd82cb4a10d6a427135 100644 --- a/app/code/core/Mage/Adminhtml/controllers/NotificationController.php +++ b/app/code/core/Mage/Adminhtml/controllers/NotificationController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Permissions/RoleController.php b/app/code/core/Mage/Adminhtml/controllers/Permissions/RoleController.php index 99a505f282c4576edf6ed93c06efeca9598206de..564499ad955cb24aac745c006451df5e898ec258 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Permissions/RoleController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Permissions/RoleController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Permissions/UserController.php b/app/code/core/Mage/Adminhtml/controllers/Permissions/UserController.php index cffcb101a8d873919a779d3f693fd39c05656353..b79561ad5cce5ed9d4fd8b48e0b94b2cd7d05742 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Permissions/UserController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Permissions/UserController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Adminhtml_Permissions_UserController extends Mage_Adminhtml_Controller_Action diff --git a/app/code/core/Mage/Adminhtml/controllers/Poll/AnswerController.php b/app/code/core/Mage/Adminhtml/controllers/Poll/AnswerController.php index bd614f58d135946ab13db4949f2729baf093a04b..9157e592b396c5ff45212839779405abc43b9218 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Poll/AnswerController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Poll/AnswerController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/PollController.php b/app/code/core/Mage/Adminhtml/controllers/PollController.php index 39705e9aafd7835db7eeea28cd21bc7fd2162f56..73cddfeed8a7444ca06e3d10f037cdf002b683f2 100644 --- a/app/code/core/Mage/Adminhtml/controllers/PollController.php +++ b/app/code/core/Mage/Adminhtml/controllers/PollController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Promo/CatalogController.php b/app/code/core/Mage/Adminhtml/controllers/Promo/CatalogController.php index 65467c839059ca1fe442a5b8da6f3cd882e4de44..64b484575313f1e358bdfc488bc85d3191670011 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Promo/CatalogController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Promo/CatalogController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -137,11 +137,10 @@ class Mage_Adminhtml_Promo_CatalogController extends Mage_Adminhtml_Controller_A $data['conditions'] = $data['rule']['conditions']; unset($data['rule']); + $autoApply = false; if (!empty($data['auto_apply'])) { $autoApply = true; unset($data['auto_apply']); - } else { - $autoApply = false; } $model->loadPost($data); @@ -277,17 +276,15 @@ class Mage_Adminhtml_Promo_CatalogController extends Mage_Adminhtml_Controller_A */ public function applyRulesAction() { + $errorMessage = Mage::helper('Mage_CatalogRule_Helper_Data')->__('Unable to apply rules.'); try { Mage::getModel('Mage_CatalogRule_Model_Rule')->applyAll(); Mage::app()->removeCache('catalog_rules_dirty'); - Mage::getSingleton('Mage_Adminhtml_Model_Session')->addSuccess( - Mage::helper('Mage_CatalogRule_Helper_Data')->__('The rules have been applied.') - ); + $this->_getSession()->addSuccess(Mage::helper('Mage_CatalogRule_Helper_Data')->__('The rules have been applied.')); + } catch (Mage_Core_Exception $e) { + $this->_getSession()->addError($errorMessage . ' ' . $e->getMessage()); } catch (Exception $e) { - Mage::getSingleton('Mage_Adminhtml_Model_Session')->addError( - Mage::helper('Mage_CatalogRule_Helper_Data')->__('Unable to apply rules.') - ); - throw $e; + $this->_getSession()->addError($errorMessage); } $this->_redirect('*/*'); } diff --git a/app/code/core/Mage/Adminhtml/controllers/Promo/QuoteController.php b/app/code/core/Mage/Adminhtml/controllers/Promo/QuoteController.php index a117e62f947319d5f339a64f06af54ae7741e2ad..7de8f01ed9fd2ce5ecf590d7bdb84c751e48dd4b 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Promo/QuoteController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Promo/QuoteController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -32,9 +32,14 @@ class Mage_Adminhtml_Promo_QuoteController extends Mage_Adminhtml_Controller_Act $this->_title($this->__('Promotions'))->_title($this->__('Shopping Cart Price Rules')); Mage::register('current_promo_quote_rule', Mage::getModel('Mage_SalesRule_Model_Rule')); - if ($id = (int) $this->getRequest()->getParam('id')) { - Mage::registry('current_promo_quote_rule') - ->load($id); + $id = (int)$this->getRequest()->getParam('id'); + + if (!$id && $this->getRequest()->getParam('rule_id')) { + $id = (int)$this->getRequest()->getParam('rule_id'); + } + + if ($id) { + Mage::registry('current_promo_quote_rule')->load($id); } } @@ -110,21 +115,12 @@ class Mage_Adminhtml_Promo_QuoteController extends Mage_Adminhtml_Controller_Act { if ($this->getRequest()->getPost()) { try { + /** @var $model Mage_SalesRule_Model_Rule */ $model = Mage::getModel('Mage_SalesRule_Model_Rule'); Mage::dispatchEvent( 'adminhtml_controller_salesrule_prepare_save', array('request' => $this->getRequest())); $data = $this->getRequest()->getPost(); - - //filter HTML tags - /** @var $helper Mage_Adminhtml_Helper_Data */ - $helper = Mage::helper('Mage_Adminhtml_Helper_Data'); - $data['name'] = $helper->stripTags($data['name']); - $data['description'] = $helper->stripTags($data['description']); - foreach ($data['store_labels'] as &$label) { - $label = $helper->stripTags($label); - } - $data = $this->_filterDates($data, array('from_date', 'to_date')); $id = $this->getRequest()->getParam('rule_id'); if ($id) { @@ -159,6 +155,9 @@ class Mage_Adminhtml_Promo_QuoteController extends Mage_Adminhtml_Controller_Act unset($data['rule']); $model->loadPost($data); + $useAutoGeneration = (int)!empty($data['use_auto_generation']); + $model->setUseAutoGeneration($useAutoGeneration); + $session->setPageData($model->getData()); $model->save(); @@ -172,12 +171,20 @@ class Mage_Adminhtml_Promo_QuoteController extends Mage_Adminhtml_Controller_Act return; } catch (Mage_Core_Exception $e) { $this->_getSession()->addError($e->getMessage()); + $id = (int)$this->getRequest()->getParam('rule_id'); + if (!empty($id)) { + $this->_redirect('*/*/edit', array('id' => $id)); + } else { + $this->_redirect('*/*/new'); + } + return; + } catch (Exception $e) { $this->_getSession()->addError( Mage::helper('Mage_CatalogRule_Helper_Data')->__('An error occurred while saving the rule data. Please review the log and try again.')); Mage::logException($e); Mage::getSingleton('Mage_Adminhtml_Model_Session')->setPageData($data); - $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('rule_id'))); + $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('rule_id'))); return; } } @@ -264,6 +271,128 @@ class Mage_Adminhtml_Promo_QuoteController extends Mage_Adminhtml_Controller_Act $this->renderLayout(); } + /** + * Coupon codes grid + */ + public function couponsGridAction() + { + $this->_initRule(); + $this->loadLayout()->renderLayout(); + } + + /** + * Export coupon codes as excel xml file + * + * @return void + */ + public function exportCouponsXmlAction() + { + $this->_initRule(); + $rule = Mage::registry('current_promo_quote_rule'); + if ($rule->getId()) { + $fileName = 'coupon_codes.xml'; + $content = $this->getLayout() + ->createBlock('Mage_Adminhtml_Block_Promo_Quote_Edit_Tab_Coupons_Grid') + ->getExcelFile($fileName); + $this->_prepareDownloadResponse($fileName, $content); + } else { + $this->_redirect('*/*/detail', array('_current' => true)); + return; + } + } + + /** + * Export coupon codes as CSV file + * + * @return void + */ + public function exportCouponsCsvAction() + { + $this->_initRule(); + $rule = Mage::registry('current_promo_quote_rule'); + if ($rule->getId()) { + $fileName = 'coupon_codes.csv'; + $content = $this->getLayout() + ->createBlock('Mage_Adminhtml_Block_Promo_Quote_Edit_Tab_Coupons_Grid') + ->getCsvFile(); + $this->_prepareDownloadResponse($fileName, $content); + } else { + $this->_redirect('*/*/detail', array('_current' => true)); + return; + } + } + + /** + * Coupons mass delete action + */ + public function couponsMassDeleteAction() + { + $this->_initRule(); + $rule = Mage::registry('current_promo_quote_rule'); + + if (!$rule->getId()) { + $this->_forward('noRoute'); + } + + $codesIds = $this->getRequest()->getParam('ids'); + + if (is_array($codesIds)) { + + $couponsCollection = Mage::getResourceModel('Mage_SalesRule_Model_Resource_Coupon_Collection') + ->addFieldToFilter('coupon_id', array('in' => $codesIds)); + + foreach ($couponsCollection as $coupon) { + $coupon->delete(); + } + } + } + + /** + * Generate Coupons action + */ + public function generateAction() + { + if (!$this->getRequest()->isAjax()) { + $this->_forward('noRoute'); + return; + } + $result = array(); + $this->_initRule(); + + /** @var $rule Mage_SalesRule_Model_Rule */ + $rule = Mage::registry('current_promo_quote_rule'); + + if (!$rule->getId()) { + $result['error'] = Mage::helper('Mage_SalesRule_Helper_Data')->__('Rule is not defined'); + } else { + try { + $data = $this->getRequest()->getParams(); + if (!empty($data['to_date'])) { + $data = array_merge($data, $this->_filterDates($data, array('to_date'))); + } + + /** @var $generator Mage_SalesRule_Model_Coupon_Massgenerator */ + $generator = $rule->getCouponMassGenerator(); + if (!$generator->validateData($data)) { + $result['error'] = Mage::helper('Mage_SalesRule_Helper_Data')->__('Not valid data provided'); + } else { + $generator->setData($data); + $generator->generatePool(); + $generated = $generator->getGeneratedCount(); + $this->_getSession()->addSuccess(Mage::helper('Mage_SalesRule_Helper_Data')->__('%s Coupon(s) generated successfully', $generated)); + $this->_initLayoutMessages('Mage_Adminhtml_Model_Session'); + $result['messages'] = $this->getLayout()->getMessagesBlock()->getGroupedHtml(); + } + } catch (Mage_Core_Exception $e) { + $result['error'] = $e->getMessage(); + } catch (Exception $e) { + $result['error'] = Mage::helper('Mage_SalesRule_Helper_Data')->__('An error occurred while generating coupons. Please review the log and try again.'); + Mage::logException($e); + } + } + $this->getResponse()->setBody(Mage::helper('Mage_Core_Helper_Data')->jsonEncode($result)); + } + /** * Chooser source action */ @@ -276,6 +405,10 @@ class Mage_Adminhtml_Promo_QuoteController extends Mage_Adminhtml_Controller_Act $this->getResponse()->setBody($chooserBlock->toHtml()); } + /** + * Returns result of current user permission check on resource and privilege + * @return boolean + */ protected function _isAllowed() { return Mage::getSingleton('Mage_Admin_Model_Session')->isAllowed('promo/quote'); diff --git a/app/code/core/Mage/Adminhtml/controllers/Promo/WidgetController.php b/app/code/core/Mage/Adminhtml/controllers/Promo/WidgetController.php index 2d704b6db0b9b8f0b57736e8252a0f9852708d89..3ab0ee973182dfdfe5d99584aee069cfc5cc7763 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Promo/WidgetController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Promo/WidgetController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/PromoController.php b/app/code/core/Mage/Adminhtml/controllers/PromoController.php index cc1d5174b91baa45fd322170e2a0c9c81e8fb482..5182793342dc96cc435658053f7c0a93675250b7 100644 --- a/app/code/core/Mage/Adminhtml/controllers/PromoController.php +++ b/app/code/core/Mage/Adminhtml/controllers/PromoController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/RatingController.php b/app/code/core/Mage/Adminhtml/controllers/RatingController.php index 5d4747d9d4fa27b5d5b0e010bebed6b25c6d1ccb..44691f3b52d4115b3b8a074d1f4473bd0e1a928c 100644 --- a/app/code/core/Mage/Adminhtml/controllers/RatingController.php +++ b/app/code/core/Mage/Adminhtml/controllers/RatingController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Report/CustomerController.php b/app/code/core/Mage/Adminhtml/controllers/Report/CustomerController.php index d9ff764ae915e99e7504fc22a90404437eb32ba3..20438ca5d363741096bfa00cfc0bf3efba545c23 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Report/CustomerController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Report/CustomerController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Report/ProductController.php b/app/code/core/Mage/Adminhtml/controllers/Report/ProductController.php index a7bd792c400a8e8e323f4d2aa9559418939f2c70..394d43ab12f78fc980fdc92ab058e7068cbbecc1 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Report/ProductController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Report/ProductController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -32,21 +32,17 @@ * @package Mage_Adminhtml * @author Magento Core Team <core@magentocommerce.com> */ -class Mage_Adminhtml_Report_ProductController extends Mage_Adminhtml_Controller_Action +class Mage_Adminhtml_Report_ProductController extends Mage_Adminhtml_Controller_Report_Abstract { /** - * init + * Add report/products breadcrumbs * * @return Mage_Adminhtml_Report_ProductController */ public function _initAction() { - $act = $this->getRequest()->getActionName(); - if(!$act) - $act = 'default'; - $this->loadLayout() - ->_addBreadcrumb(Mage::helper('Mage_Reports_Helper_Data')->__('Reports'), Mage::helper('Mage_Reports_Helper_Data')->__('Reports')) - ->_addBreadcrumb(Mage::helper('Mage_Reports_Helper_Data')->__('Products'), Mage::helper('Mage_Reports_Helper_Data')->__('Products')); + parent::_initAction(); + $this->_addBreadcrumb(Mage::helper('Mage_Reports_Helper_Data')->__('Products'), Mage::helper('Mage_Reports_Helper_Data')->__('Products')); return $this; } @@ -101,15 +97,23 @@ class Mage_Adminhtml_Report_ProductController extends Mage_Adminhtml_Controller_ */ public function viewedAction() { - $this->_title($this->__('Reports')) - ->_title($this->__('Products')) - ->_title($this->__('Most Viewed')); + $this->_title($this->__('Reports'))->_title($this->__('Products'))->_title($this->__('Most Viewed')); + + $this->_showLastExecutionTime(Mage_Reports_Model_Flag::REPORT_PRODUCT_VIEWED_FLAG_CODE, 'viewed'); $this->_initAction() - ->_setActiveMenu('report/product/viewed') - ->_addBreadcrumb(Mage::helper('Mage_Reports_Helper_Data')->__('Most Viewed'), Mage::helper('Mage_Reports_Helper_Data')->__('Most Viewed')) - ->_addContent($this->getLayout()->createBlock('Mage_Adminhtml_Block_Report_Product_Viewed')) - ->renderLayout(); + ->_setActiveMenu('report/products/viewed') + ->_addBreadcrumb(Mage::helper('Mage_Adminhtml_Helper_Data')->__('Products Most Viewed Report'), Mage::helper('Mage_Adminhtml_Helper_Data')->__('Products Most Viewed Report')); + + $gridBlock = $this->getLayout()->getBlock('report_product_viewed.grid'); + $filterFormBlock = $this->getLayout()->getBlock('grid.filter.form'); + + $this->_initReportAction(array( + $gridBlock, + $filterFormBlock + )); + + $this->renderLayout(); } /** @@ -119,10 +123,9 @@ class Mage_Adminhtml_Report_ProductController extends Mage_Adminhtml_Controller_ public function exportViewedCsvAction() { $fileName = 'products_mostviewed.csv'; - $content = $this->getLayout()->createBlock('Mage_Adminhtml_Block_Report_Product_Viewed_Grid') - ->getCsv(); - - $this->_prepareDownloadResponse($fileName, $content); + $grid = $this->getLayout()->createBlock('Mage_Adminhtml_Block_Report_Product_Viewed_Grid'); + $this->_initReportAction($grid); + $this->_prepareDownloadResponse($fileName, $grid->getCsvFile()); } /** @@ -132,10 +135,9 @@ class Mage_Adminhtml_Report_ProductController extends Mage_Adminhtml_Controller_ public function exportViewedExcelAction() { $fileName = 'products_mostviewed.xml'; - $content = $this->getLayout()->createBlock('Mage_Adminhtml_Block_Report_Product_Viewed_Grid') - ->getExcel($fileName); - - $this->_prepareDownloadResponse($fileName, $content); + $grid = $this->getLayout()->createBlock('Mage_Adminhtml_Block_Report_Product_Viewed_Grid'); + $this->_initReportAction($grid); + $this->_prepareDownloadResponse($fileName, $grid->getExcelFile($fileName)); } /** diff --git a/app/code/core/Mage/Adminhtml/controllers/Report/ReviewController.php b/app/code/core/Mage/Adminhtml/controllers/Report/ReviewController.php index 3494c5cb9d517cc893a55fb068a18adbe2250a2f..0bd28bf18ccaca2373c15a0489643818c71e6afb 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Report/ReviewController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Report/ReviewController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Report/SalesController.php b/app/code/core/Mage/Adminhtml/controllers/Report/SalesController.php index 6b21f87f440b8343fc81f3dcc29c99e3610f3191..0b2b0f0e41f72d894ff4798e8ebb4544fffe215f 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Report/SalesController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Report/SalesController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -29,49 +29,19 @@ * * @category Mage * @package Mage_Adminhtml - * @author Magento Core Team <core@magentocommerce.com> + * @author Magento Core Team <core@magentocommerce.com> */ -class Mage_Adminhtml_Report_SalesController extends Mage_Adminhtml_Controller_Action +class Mage_Adminhtml_Report_SalesController extends Mage_Adminhtml_Controller_Report_Abstract { /** - * Admin session model + * Add report/sales breadcrumbs * - * @var null|Mage_Admin_Model_Session + * @return Mage_Adminhtml_Report_SalesController */ - protected $_adminSession = null; - public function _initAction() { - $this->loadLayout() - ->_addBreadcrumb(Mage::helper('Mage_Reports_Helper_Data')->__('Reports'), Mage::helper('Mage_Reports_Helper_Data')->__('Reports')) - ->_addBreadcrumb(Mage::helper('Mage_Reports_Helper_Data')->__('Sales'), Mage::helper('Mage_Reports_Helper_Data')->__('Sales')); - return $this; - } - - public function _initReportAction($blocks) - { - if (!is_array($blocks)) { - $blocks = array($blocks); - } - - $requestData = Mage::helper('Mage_Adminhtml_Helper_Data')->prepareFilterString($this->getRequest()->getParam('filter')); - $requestData = $this->_filterDates($requestData, array('from', 'to')); - $requestData['store_ids'] = $this->getRequest()->getParam('store_ids'); - $params = new Varien_Object(); - - foreach ($requestData as $key => $value) { - if (!empty($value)) { - $params->setData($key, $value); - } - } - - foreach ($blocks as $block) { - if ($block) { - $block->setPeriodType($params->getData('period_type')); - $block->setFilterData($params); - } - } - + parent::_initAction(); + $this->_addBreadcrumb(Mage::helper('Mage_Reports_Helper_Data')->__('Sales'), Mage::helper('Mage_Reports_Helper_Data')->__('Sales')); return $this; } @@ -103,7 +73,7 @@ class Mage_Adminhtml_Report_SalesController extends Mage_Adminhtml_Controller_Ac $this->_showLastExecutionTime(Mage_Reports_Model_Flag::REPORT_BESTSELLERS_FLAG_CODE, 'bestsellers'); $this->_initAction() - ->_setActiveMenu('report/sales/bestsellers') + ->_setActiveMenu('report/products/bestsellers') ->_addBreadcrumb(Mage::helper('Mage_Adminhtml_Helper_Data')->__('Products Bestsellers Report'), Mage::helper('Mage_Adminhtml_Helper_Data')->__('Products Bestsellers Report')); $gridBlock = $this->getLayout()->getBlock('report_sales_bestsellers.grid'); @@ -139,22 +109,6 @@ class Mage_Adminhtml_Report_SalesController extends Mage_Adminhtml_Controller_Ac $this->_prepareDownloadResponse($fileName, $grid->getExcelFile($fileName)); } - protected function _showLastExecutionTime($flagCode, $refreshCode) - { - $flag = Mage::getModel('Mage_Reports_Model_Flag')->setReportFlagCode($flagCode)->loadSelf(); - $updatedAt = ($flag->hasData()) - ? Mage::app()->getLocale()->storeDate( - 0, new Zend_Date($flag->getLastUpdate(), Varien_Date::DATETIME_INTERNAL_FORMAT), true - ) - : 'undefined'; - - $refreshStatsLink = $this->getUrl('*/*/refreshstatistics'); - $directRefreshLink = $this->getUrl('*/*/refreshRecent', array('code' => $refreshCode)); - - Mage::getSingleton('Mage_Adminhtml_Model_Session')->addNotice(Mage::helper('Mage_Adminhtml_Helper_Data')->__('Last updated: %s. To refresh last day\'s <a href="%s">statistics</a>, click <a href="%s">here</a>.', $updatedAt, $refreshStatsLink, $directRefreshLink)); - return $this; - } - /** * Refresh statistics for last 25 hours * @@ -449,17 +403,4 @@ class Mage_Adminhtml_Report_SalesController extends Mage_Adminhtml_Controller_Ac break; } } - - /** - * Retrieve admin session model - * - * @return Mage_Admin_Model_Session - */ - protected function _getSession() - { - if (is_null($this->_adminSession)) { - $this->_adminSession = Mage::getSingleton('Mage_Admin_Model_Session'); - } - return $this->_adminSession; - } } diff --git a/app/code/core/Mage/Adminhtml/controllers/Report/ShopcartController.php b/app/code/core/Mage/Adminhtml/controllers/Report/ShopcartController.php index 7c9e049840a28a73d624ce6dae774a3571412710..0240fd481f4b5782a05c5204412be54685782f00 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Report/ShopcartController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Report/ShopcartController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Report/StatisticsController.php b/app/code/core/Mage/Adminhtml/controllers/Report/StatisticsController.php index 927b109984113e388d740798e731db56fdbe2bef..874145813389310841184f5151793f1319457d33 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Report/StatisticsController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Report/StatisticsController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -99,13 +99,14 @@ class Mage_Adminhtml_Report_StatisticsController extends Mage_Adminhtml_Controll } $aliases = array( - 'sales' => 'Mage_Sales_Model_Resource_Report_Order', - 'tax' => 'Mage_Tax_Model_Resource_Report_Tax', - 'shipping' => 'Mage_Sales_Model_Resource_Report_Shipping', - 'invoiced' => 'Mage_Sales_Model_Resource_Report_Invoiced', - 'refunded' => 'Mage_Sales_Model_Resource_Report_Refunded', - 'coupons' => 'Mage_SalesRule_Model_Resource_Report_Rule', + 'sales' => 'Mage_Sales_Model_Resource_Report_Order', + 'tax' => 'Mage_Tax_Model_Resource_Report_Tax', + 'shipping' => 'Mage_Sales_Model_Resource_Report_Shipping', + 'invoiced' => 'Mage_Sales_Model_Resource_Report_Invoiced', + 'refunded' => 'Mage_Sales_Model_Resource_Report_Refunded', + 'coupons' => 'Mage_SalesRule_Model_Resource_Report_Rule', 'bestsellers' => 'Mage_Sales_Model_Resource_Report_Bestsellers', + 'viewed' => 'Mage_Sales_Model_Resource_Report_Product_Viewed', ); $out = array(); foreach ($codes as $code) { diff --git a/app/code/core/Mage/Adminhtml/controllers/Report/TagController.php b/app/code/core/Mage/Adminhtml/controllers/Report/TagController.php index a4a07753c671b1761df1c9a65c76bc6c60c54c47..5f3afbedfd794dc88e10ecf36fd9c5073082275b 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Report/TagController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Report/TagController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/ReportController.php b/app/code/core/Mage/Adminhtml/controllers/ReportController.php index 215cc14b53197cde8bef42ba237dd8b8f2dce3e8..a8d5af09ee324d84105c6431688b6ca4131fe758 100644 --- a/app/code/core/Mage/Adminhtml/controllers/ReportController.php +++ b/app/code/core/Mage/Adminhtml/controllers/ReportController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Rss/CatalogController.php b/app/code/core/Mage/Adminhtml/controllers/Rss/CatalogController.php index 419f924f2c6c1567d1ded2e809c0ce78b3474ba9..b51fe96cba787c578632c85ce298636658f1bfce 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Rss/CatalogController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Rss/CatalogController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Rss/OrderController.php b/app/code/core/Mage/Adminhtml/controllers/Rss/OrderController.php index 0339059a0595b7ebe87478588c29cd89da3fdd00..9760fd1a79d05e06c04c3480732d42756c3c87e0 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Rss/OrderController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Rss/OrderController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Sales/Billing/AgreementController.php b/app/code/core/Mage/Adminhtml/controllers/Sales/Billing/AgreementController.php index c9c14966fdf91277c35c50fc06f7dda6731e23c0..57cca433f10ae5823c38874942afab34bda89be3 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Sales/Billing/AgreementController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Sales/Billing/AgreementController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Sales/CreditmemoController.php b/app/code/core/Mage/Adminhtml/controllers/Sales/CreditmemoController.php index 6b815042f3cb8d9b85887b455198cf7143b2ef2a..75ca991988b7391705db4da1ba0e3b1e59ea0241 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Sales/CreditmemoController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Sales/CreditmemoController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Sales/InvoiceController.php b/app/code/core/Mage/Adminhtml/controllers/Sales/InvoiceController.php index 1a1f7da746177c6ed15db1347816719790d9df5c..acfd358fc7e1af2bc83fd7d7572b4ff8b28085eb 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Sales/InvoiceController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Sales/InvoiceController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Sales/Order/CreateController.php b/app/code/core/Mage/Adminhtml/controllers/Sales/Order/CreateController.php index 0aec3763f3c90f9c2e7eb24a4476c62b0c8b2c38..735aa1756360aa281e90bb440a4f1eba62bce6f2 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Sales/Order/CreateController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Sales/Order/CreateController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -131,6 +131,14 @@ class Mage_Adminhtml_Sales_Order_CreateController extends Mage_Adminhtml_Control */ protected function _processActionData($action = null) { + $eventData = array( + 'order_create_model' => $this->_getOrderCreateModel(), + 'request_model' => $this->getRequest(), + 'session' => $this->_getSession(), + ); + + Mage::dispatchEvent('adminhtml_sales_order_create_process_data_before', $eventData); + /** * Saving order data */ @@ -279,7 +287,8 @@ class Mage_Adminhtml_Sales_Order_CreateController extends Mage_Adminhtml_Control $data = $this->getRequest()->getPost('order'); if (!empty($data['coupon']['code'])) { if ($this->_getQuote()->getCouponCode() !== $data['coupon']['code']) { - $this->_getSession()->addError($this->__('"%s" coupon code is not valid.', $data['coupon']['code'])); + $this->_getSession()->addError( + $this->__('"%s" coupon code is not valid.', $this->_getHelper()->escapeHtml($data['coupon']['code']))); } else { $this->_getSession()->addSuccess($this->__('The coupon code has been accepted.')); } @@ -611,4 +620,14 @@ class Mage_Adminhtml_Sales_Order_CreateController extends Mage_Adminhtml_Control return false; } } + + /** + * Process data and display index page + */ + public function processDataAction() + { + $this->_initSession(); + $this->_processData(); + $this->_forward('index'); + } } diff --git a/app/code/core/Mage/Adminhtml/controllers/Sales/Order/CreditmemoController.php b/app/code/core/Mage/Adminhtml/controllers/Sales/Order/CreditmemoController.php index 5f7d91b52b2ca9a0090c64927a7ed9af6651d10f..780d64da8dd9f946237d6b52519104bcc9be3896 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Sales/Order/CreditmemoController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Sales/Order/CreditmemoController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Sales/Order/EditController.php b/app/code/core/Mage/Adminhtml/controllers/Sales/Order/EditController.php index fe038cb4c706e9a65f6b8581a6a8a5dedf238de9..be3d5c1c783c954755521378c791e535e03dc3b1 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Sales/Order/EditController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Sales/Order/EditController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -52,13 +52,21 @@ class Mage_Adminhtml_Sales_Order_EditController extends Mage_Adminhtml_Sales_Ord $orderId = $this->getRequest()->getParam('order_id'); $order = Mage::getModel('Mage_Sales_Model_Order')->load($orderId); - if ($order->getId()) { - $this->_getSession()->setUseOldShippingMethod(true); - $this->_getOrderCreateModel()->initFromOrder($order); - $this->_redirect('*/*'); - } - else { - $this->_redirect('*/sales_order/'); + try { + if ($order->getId()) { + $this->_getSession()->setUseOldShippingMethod(true); + $this->_getOrderCreateModel()->initFromOrder($order); + $this->_redirect('*/*'); + } + else { + $this->_redirect('*/sales_order/'); + } + } catch (Mage_Core_Exception $e) { + Mage::getSingleton('Mage_Adminhtml_Model_Session')->addError($e->getMessage()); + $this->_redirect('*/sales_order/view', array('order_id' => $orderId)); + } catch (Exception $e) { + Mage::getSingleton('Mage_Adminhtml_Model_Session')->addException($e, $e->getMessage()); + $this->_redirect('*/sales_order/view', array('order_id' => $orderId)); } } @@ -74,7 +82,7 @@ class Mage_Adminhtml_Sales_Order_EditController extends Mage_Adminhtml_Sales_Ord ->_setActiveMenu('sales/order') ->renderLayout(); } - + /** * Acl check for admin * @@ -83,5 +91,5 @@ class Mage_Adminhtml_Sales_Order_EditController extends Mage_Adminhtml_Sales_Ord protected function _isAllowed() { return Mage::getSingleton('Mage_Admin_Model_Session')->isAllowed('sales/order/actions/edit'); - } + } } diff --git a/app/code/core/Mage/Adminhtml/controllers/Sales/Order/InvoiceController.php b/app/code/core/Mage/Adminhtml/controllers/Sales/Order/InvoiceController.php index 274e0bc070ceafc21369f55386f5323ceb2488dc..05278cf0fbf88c4d736b1390c9d28d04bfdb78db 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Sales/Order/InvoiceController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Sales/Order/InvoiceController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Sales/Order/ShipmentController.php b/app/code/core/Mage/Adminhtml/controllers/Sales/Order/ShipmentController.php index 80a659193eddbb3e951ba9914e30f83d43c15ea4..c7dba1e42920c3eb13a3241e892e1d5c1bad79af 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Sales/Order/ShipmentController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Sales/Order/ShipmentController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -220,9 +220,12 @@ class Mage_Adminhtml_Sales_Order_ShipmentController extends Mage_Adminhtml_Contr $this->_saveShipment($shipment); $shipment->sendEmail(!empty($data['send_email']), $comment); - $this->_getSession()->addSuccess($isNeedCreateLabel ? - $this->__('The shipment has been created. The shipping label has been created.') : - $this->__('The shipment has been created.')); + + $shipmentCreatedMessage = $this->__('The shipment has been created.'); + $labelCreatedMessage = $this->__('The shipping label has been created.'); + + $this->_getSession()->addSuccess($isNeedCreateLabel ? $shipmentCreatedMessage . ' ' . $labelCreatedMessage + : $shipmentCreatedMessage); Mage::getSingleton('Mage_Adminhtml_Model_Session')->getCommentText(true); } catch (Mage_Core_Exception $e) { if ($isNeedCreateLabel) { @@ -708,4 +711,4 @@ class Mage_Adminhtml_Sales_Order_ShipmentController extends Mage_Adminhtml_Contr ->toHtml() ); } -} +} \ No newline at end of file diff --git a/app/code/core/Mage/Adminhtml/controllers/Sales/Order/StatusController.php b/app/code/core/Mage/Adminhtml/controllers/Sales/Order/StatusController.php index 0bf610d523081314f17799a79949b861f0cd4f29..fded5b638ea25a2f6e92e658b96bde73e027919f 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Sales/Order/StatusController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Sales/Order/StatusController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Sales/Order/View/GiftmessageController.php b/app/code/core/Mage/Adminhtml/controllers/Sales/Order/View/GiftmessageController.php index 23472dda968db74f756788ac758ba4633a7793df..b49c257c42b95940fe5a4fda0ce0c453e828a6e6 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Sales/Order/View/GiftmessageController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Sales/Order/View/GiftmessageController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Sales/OrderController.php b/app/code/core/Mage/Adminhtml/controllers/Sales/OrderController.php index 756bf19ee8c1604ec40f4fb71b8302f9216cca75..c09b76df946d82ab03a30f08f4e8a344e1782848 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Sales/OrderController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Sales/OrderController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -722,10 +722,17 @@ class Mage_Adminhtml_Sales_OrderController extends Mage_Adminhtml_Controller_Act $addressId = $this->getRequest()->getParam('address_id'); $address = Mage::getModel('Mage_Sales_Model_Order_Address') ->getCollection() + ->addFilter('entity_id', $addressId) ->getItemById($addressId); if ($address) { Mage::register('order_address', $address); $this->loadLayout(); + // Do not display VAT validation button on edit order address form + $addressFormContainer = $this->getLayout()->getBlock('sales_order_address.form.container'); + if ($addressFormContainer) { + $addressFormContainer->getChild('form')->setDisplayVatValidationButton(false); + } + $this->renderLayout(); } else { $this->_redirect('*/*/'); diff --git a/app/code/core/Mage/Adminhtml/controllers/Sales/Recurring/ProfileController.php b/app/code/core/Mage/Adminhtml/controllers/Sales/Recurring/ProfileController.php index d401fb77ef1d8eb1997d19e76a7e62d3fbf82d7b..5ef0e55d88128675adfcb889a59ffae251aa5da7 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Sales/Recurring/ProfileController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Sales/Recurring/ProfileController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Sales/ShipmentController.php b/app/code/core/Mage/Adminhtml/controllers/Sales/ShipmentController.php index 1117d13a0a02e4fca9fbdadaf282cb15e3c8e1aa..0678cbc57eec0fdfd809a8e67d0ab7413a627f44 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Sales/ShipmentController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Sales/ShipmentController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Sales/TransactionsController.php b/app/code/core/Mage/Adminhtml/controllers/Sales/TransactionsController.php index 9316a7fdf5c07c168d738c0c3de466fa52aecf07..e3666be4ac5fc8875b5725d2bfa80199fa1955eb 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Sales/TransactionsController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Sales/TransactionsController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -110,13 +110,15 @@ class Mage_Adminhtml_Sales_TransactionsController extends Mage_Adminhtml_Control ->setOrder($txn->getOrder()) ->importTransactionInfo($txn); $txn->save(); - Mage::getSingleton('Mage_Adminhtml_Model_Session')->addSuccess(Mage::helper('Mage_Adminhtml_Helper_Data') - ->__('The transaction details have been updated.')); + Mage::getSingleton('Mage_Adminhtml_Model_Session')->addSuccess( + Mage::helper('Mage_Adminhtml_Helper_Data')->__('The transaction details have been updated.') + ); } catch (Mage_Core_Exception $e) { Mage::getSingleton('Mage_Adminhtml_Model_Session')->addError($e->getMessage()); } catch (Exception $e) { - Mage::getSingleton('Mage_Adminhtml_Model_Session')->addError(Mage::helper('Mage_Adminhtml_Helper_Data') - ->__('Unable to update transaction details.')); + Mage::getSingleton('Mage_Adminhtml_Model_Session')->addError( + Mage::helper('Mage_Adminhtml_Helper_Data')->__('Unable to update transaction details.') + ); Mage::logException($e); } $this->_redirect('*/sales_transactions/view', array('_current' => true)); diff --git a/app/code/core/Mage/Adminhtml/controllers/SitemapController.php b/app/code/core/Mage/Adminhtml/controllers/SitemapController.php index a58707276c1c68e5d718584d10b199e197b74129..be5b6e27eed4e6170e4014bc9f2be8ddf7231a83 100644 --- a/app/code/core/Mage/Adminhtml/controllers/SitemapController.php +++ b/app/code/core/Mage/Adminhtml/controllers/SitemapController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/SurveyController.php b/app/code/core/Mage/Adminhtml/controllers/SurveyController.php index ee2a83772404f24f5cb2aa9c0ab49eb16a616c27..276c05b457667a09ea83b92051962afde60f87b3 100644 --- a/app/code/core/Mage/Adminhtml/controllers/SurveyController.php +++ b/app/code/core/Mage/Adminhtml/controllers/SurveyController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/System/AccountController.php b/app/code/core/Mage/Adminhtml/controllers/System/AccountController.php index 400c56943693d1610e24d62f9aa7c4a8934b0c08..b417c7c9d2bf959ad8a2cc5ee45f1d0d8a03cc20 100644 --- a/app/code/core/Mage/Adminhtml/controllers/System/AccountController.php +++ b/app/code/core/Mage/Adminhtml/controllers/System/AccountController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/System/BackupController.php b/app/code/core/Mage/Adminhtml/controllers/System/BackupController.php index 9542b8b1bfffc4308147a932477eebfbbd449e1d..cc173fdad32fc7b1e75408920454b9321f4a3beb 100644 --- a/app/code/core/Mage/Adminhtml/controllers/System/BackupController.php +++ b/app/code/core/Mage/Adminhtml/controllers/System/BackupController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -66,43 +66,105 @@ class Mage_Adminhtml_System_BackupController extends Mage_Adminhtml_Controller_A /** * Create backup action + * + * @return Mage_Adminhtml_Controller_Action */ public function createAction() { + if (!$this->getRequest()->isAjax()) { + return $this->getUrl('*/*/index'); + } + + $response = new Varien_Object(); + + /** + * @var Mage_Backup_Helper_Data $helper + */ + $helper = Mage::helper('Mage_Backup_Helper_Data'); + try { - $backupDb = Mage::getModel('Mage_Backup_Model_Db'); - $backup = Mage::getModel('Mage_Backup_Model_Backup') + $type = $this->getRequest()->getParam('type'); + + if ($type == Mage_Backup_Helper_Data::TYPE_SYSTEM_SNAPSHOT + && $this->getRequest()->getParam('exclude_media')) + { + $type = Mage_Backup_Helper_Data::TYPE_SNAPSHOT_WITHOUT_MEDIA; + } + + $backupManager = Mage_Backup::getBackupInstance($type) + ->setBackupExtension($helper->getExtensionByType($type)) ->setTime(time()) - ->setType('db') - ->setPath(Mage::getBaseDir("var") . DS . "backups"); + ->setBackupsDir($helper->getBackupsDir()); + + $backupManager->setName($this->getRequest()->getParam('backup_name')); - Mage::register('backup_model', $backup); + Mage::register('backup_manager', $backupManager); - $backupDb->createBackup($backup); - $this->_getSession()->addSuccess(Mage::helper('Mage_Adminhtml_Helper_Data')->__('The backup has been created.')); + if ($this->getRequest()->getParam('maintenance_mode')) { + $turnedOn = $helper->turnOnMaintenanceMode(); + + if (!$turnedOn) { + $response->setError( + Mage::helper('Mage_Backup_Helper_Data')->__("Warning! System couldn't put store on the maintenance mode.") . ' ' + . Mage::helper('Mage_Backup_Helper_Data')->__("Please deselect the sufficient check-box, if you want to continue backup's creation") + ); + $backupManager->setErrorMessage(Mage::helper('Mage_Backup_Helper_Data')->__("System couldn't put store on the maintenance mode")); + return $this->getResponse()->setBody($response->toJson()); + } + } + + if ($type != Mage_Backup_Helper_Data::TYPE_DB) { + $backupManager->setRootDir(Mage::getBaseDir()) + ->addIgnorePaths($helper->getBackupIgnorePaths()); + } + + $successMessage = $helper->getCreateSuccessMessageByType($type); + + $backupManager->create(); + + $this->_getSession()->addSuccess($successMessage); + + $response->setRedirectUrl($this->getUrl('*/*/index')); + } catch (Mage_Backup_Exception_NotEnoughFreeSpace $e) { + $errorMessage = Mage::helper('Mage_Backup_Helper_Data')->__('Not enough free space to create backup.'); + } catch (Mage_Backup_Exception_NotEnoughPermissions $e) { + Mage::log($e->getMessage()); + $errorMessage = Mage::helper('Mage_Backup_Helper_Data')->__('Not enough permissions to create backup.'); + } catch (Exception $e) { + Mage::log($e->getMessage()); + $errorMessage = Mage::helper('Mage_Backup_Helper_Data')->__('An error occurred while creating the backup.'); } - catch (Exception $e) { - $this->_getSession()->addException($e, Mage::helper('Mage_Adminhtml_Helper_Data')->__('An error occurred while creating the backup.')); + + if (!empty($errorMessage)) { + $response->setError($errorMessage); + $backupManager->setErrorMessage($errorMessage); } - $this->_redirect('*/*'); + + if ($this->getRequest()->getParam('maintenance_mode')) { + $helper->turnOffMaintenanceMode(); + } + + $this->getResponse()->setBody($response->toJson()); } /** * Download backup action + * + * @return Mage_Adminhtml_Controller_Action */ public function downloadAction() { - $backup = Mage::getModel('Mage_Backup_Model_Backup') - ->setTime((int)$this->getRequest()->getParam('time')) - ->setType($this->getRequest()->getParam('type')) - ->setPath(Mage::getBaseDir("var") . DS . "backups"); /* @var $backup Mage_Backup_Model_Backup */ + $backup = Mage::getModel('Mage_Backup_Model_Backup')->loadByTimeAndType( + $this->getRequest()->getParam('time'), + $this->getRequest()->getParam('type') + ); - if (!$backup->exists()) { - $this->_redirect('*/*'); + if (!$backup->getTime() || !$backup->exists()) { + return $this->_redirect('*/*'); } - $fileName = 'backup-' . date('YmdHis', $backup->getTime()) . '.sql.gz'; + $fileName = Mage::helper('Mage_Backup_Helper_Data')->generateBackupDownloadName($backup); $this->_prepareDownloadResponse($fileName, null, 'application/octet-stream', $backup->getSize()); @@ -113,29 +175,187 @@ class Mage_Adminhtml_System_BackupController extends Mage_Adminhtml_Controller_A } /** - * Delete backup action + * Rollback Action + * + * @return Mage_Adminhtml_Controller_Action */ - public function deleteAction() + public function rollbackAction() { + if (!Mage::helper('Mage_Backup_Helper_Data')->isRollbackAllowed()){ + return $this->_forward('denied'); + } + + if (!$this->getRequest()->isAjax()) { + return $this->getUrl('*/*/index'); + } + + $helper = Mage::helper('Mage_Backup_Helper_Data'); + $response = new Varien_Object(); + try { - $backup = Mage::getModel('Mage_Backup_Model_Backup') - ->setTime((int)$this->getRequest()->getParam('time')) - ->setType($this->getRequest()->getParam('type')) - ->setPath(Mage::getBaseDir("var") . DS . "backups") - ->deleteFile(); + /* @var $backup Mage_Backup_Model_Backup */ + $backup = Mage::getModel('Mage_Backup_Model_Backup')->loadByTimeAndType( + $this->getRequest()->getParam('time'), + $this->getRequest()->getParam('type') + ); + + if (!$backup->getTime() || !$backup->exists()) { + return $this->_redirect('*/*'); + } + + if (!$backup->getTime()) { + throw new Mage_Backup_Exception_CantLoadSnapshot(); + } + + $type = $backup->getType(); + + $backupManager = Mage_Backup::getBackupInstance($type) + ->setBackupExtension($helper->getExtensionByType($type)) + ->setTime($backup->getTime()) + ->setBackupsDir($helper->getBackupsDir()) + ->setName($backup->getName(), false) + ->setResourceModel(Mage::getResourceModel('Mage_Backup_Model_Resource_Db')); + + Mage::register('backup_manager', $backupManager); + + $passwordValid = Mage::getModel('Mage_Backup_Model_Backup')->validateUserPassword( + $this->getRequest()->getParam('password') + ); - Mage::register('backup_model', $backup); + if (!$passwordValid) { + $response->setError(Mage::helper('Mage_Backup_Helper_Data')->__('Invalid Password.')); + $backupManager->setErrorMessage(Mage::helper('Mage_Backup_Helper_Data')->__('Invalid Password.')); + return $this->getResponse()->setBody($response->toJson()); + } - $this->_getSession()->addSuccess(Mage::helper('Mage_Adminhtml_Helper_Data')->__('Backup record was deleted.')); + if ($this->getRequest()->getParam('maintenance_mode')) { + $turnedOn = $helper->turnOnMaintenanceMode(); + + if (!$turnedOn) { + $response->setError( + Mage::helper('Mage_Backup_Helper_Data')->__("Warning! System couldn't put store on the maintenance mode.") . ' ' + . Mage::helper('Mage_Backup_Helper_Data')->__("Please deselect the sufficient check-box, if you want to continue rollback processing") + ); + $backupManager->setErrorMessage(Mage::helper('Mage_Backup_Helper_Data')->__("System couldn't put store on the maintenance mode")); + return $this->getResponse()->setBody($response->toJson()); + } + } + + if ($type != Mage_Backup_Helper_Data::TYPE_DB) { + + $backupManager->setRootDir(Mage::getBaseDir()) + ->addIgnorePaths($helper->getRollbackIgnorePaths()); + + if ($this->getRequest()->getParam('use_ftp', false)) { + $backupManager->setUseFtp( + $this->getRequest()->getParam('ftp_host', ''), + $this->getRequest()->getParam('ftp_user', ''), + $this->getRequest()->getParam('ftp_pass', ''), + $this->getRequest()->getParam('ftp_path', '') + ); + } + } + + $backupManager->rollback(); + + $helper->invalidateCache()->invalidateIndexer(); + + $adminSession = $this->_getSession(); + $adminSession->unsetAll(); + $adminSession->getCookie()->delete($adminSession->getSessionName()); + + $response->setRedirectUrl($this->getUrl('*')); + } catch (Mage_Backup_Exception_CantLoadSnapshot $e) { + $errorMsg = Mage::helper('Mage_Backup_Helper_Data')->__('Backup file not found'); + } catch (Mage_Backup_Exception_FtpConnectionFailed $e) { + $errorMsg = Mage::helper('Mage_Backup_Helper_Data')->__('Failed to connect to FTP'); + } catch (Mage_Backup_Exception_FtpValidationFailed $e) { + $errorMsg = Mage::helper('Mage_Backup_Helper_Data')->__('Failed to validate FTP'); + } catch (Mage_Backup_Exception_NotEnoughPermissions $e) { + Mage::log($e->getMessage()); + $errorMsg = Mage::helper('Mage_Backup_Helper_Data')->__('Not enough permissions to perform rollback'); + } catch (Exception $e) { + Mage::log($e->getMessage()); + $errorMsg = Mage::helper('Mage_Backup_Helper_Data')->__('Failed to rollback'); } - catch (Exception $e) { - // Nothing + + if (!empty($errorMsg)) { + $response->setError($errorMsg); + $backupManager->setErrorMessage($errorMsg); } - $this->_redirect('*/*/'); + if ($this->getRequest()->getParam('maintenance_mode')) { + $helper->turnOffMaintenanceMode(); + } + $this->getResponse()->setBody($response->toJson()); } + /** + * Delete backups mass action + * + * @return Mage_Adminhtml_Controller_Action + */ + public function massDeleteAction() + { + $backupIds = $this->getRequest()->getParam('ids', array()); + + if (!is_array($backupIds) || !count($backupIds)) { + return $this->_redirect('*/*/index'); + } + + /** @var $backupModel Mage_Backup_Model_Backup */ + $backupModel = Mage::getModel('Mage_Backup_Model_Backup'); + $resultData = new Varien_Object(); + $resultData->setIsSuccess(false); + $resultData->setDeleteResult(array()); + Mage::register('backup_manager', $resultData); + + $deleteFailMessage = Mage::helper('Mage_Backup_Helper_Data')->__('Failed to delete one or several backups.'); + + try { + $allBackupsDeleted = true; + + foreach ($backupIds as $id) { + list($time, $type) = explode('_', $id); + $backupModel + ->loadByTimeAndType($time, $type) + ->deleteFile(); + + if ($backupModel->exists()) { + $allBackupsDeleted = false; + $result = Mage::helper('Mage_Adminhtml_Helper_Data')->__('failed'); + } else { + $result = Mage::helper('Mage_Adminhtml_Helper_Data')->__('successful'); + } + + $resultData->setDeleteResult( + array_merge($resultData->getDeleteResult(), array($backupModel->getFileName() . ' ' . $result)) + ); + } + + $resultData->setIsSuccess(true); + if ($allBackupsDeleted) { + $this->_getSession()->addSuccess( + Mage::helper('Mage_Backup_Helper_Data')->__('The selected backup(s) has been deleted.') + ); + } + else { + throw new Exception($deleteFailMessage); + } + } catch (Exception $e) { + $resultData->setIsSuccess(false); + $this->_getSession()->addError($deleteFailMessage); + } + + return $this->_redirect('*/*/index'); + } + + /** + * Check Permissions for all actions + * + * @return bool + */ protected function _isAllowed() { return Mage::getSingleton('Mage_Admin_Model_Session')->isAllowed('system/tools/backup'); diff --git a/app/code/core/Mage/Adminhtml/controllers/System/Config/System/StorageController.php b/app/code/core/Mage/Adminhtml/controllers/System/Config/System/StorageController.php index 9eea567c2dacae4df22f5bc12eab19bdd3af47bc..5e8ad0ff43232b15ba5aca94c4217dfae3303bb5 100644 --- a/app/code/core/Mage/Adminhtml/controllers/System/Config/System/StorageController.php +++ b/app/code/core/Mage/Adminhtml/controllers/System/Config/System/StorageController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/System/ConfigController.php b/app/code/core/Mage/Adminhtml/controllers/System/ConfigController.php index fcb622cf32874599bcdadd3114b00ae9227af35e..a56869bd2350adc95998e9a42c7d447c3e5ee9fc 100644 --- a/app/code/core/Mage/Adminhtml/controllers/System/ConfigController.php +++ b/app/code/core/Mage/Adminhtml/controllers/System/ConfigController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -161,6 +161,11 @@ class Mage_Adminhtml_System_ConfigController extends Mage_Adminhtml_Controller_A // reinit configuration Mage::getConfig()->reinit(); + Mage::dispatchEvent('admin_system_config_section_save_after', array( + 'website' => $website, + 'store' => $store, + 'section' => $section + )); Mage::app()->reinitStores(); // website and store codes can be used in event implementation, so set them as well diff --git a/app/code/core/Mage/Adminhtml/controllers/System/Convert/GuiController.php b/app/code/core/Mage/Adminhtml/controllers/System/Convert/GuiController.php index f204abb3845eddc89c8d9f234a4857c18baa65a1..bcfecca04be2b63972204f122c097db843014720 100644 --- a/app/code/core/Mage/Adminhtml/controllers/System/Convert/GuiController.php +++ b/app/code/core/Mage/Adminhtml/controllers/System/Convert/GuiController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/System/Convert/ProfileController.php b/app/code/core/Mage/Adminhtml/controllers/System/Convert/ProfileController.php index 146459d14091f57579d1f624502cf9dc96b8a1ea..91c07695829dc3a938025a32014381ca35f4848d 100644 --- a/app/code/core/Mage/Adminhtml/controllers/System/Convert/ProfileController.php +++ b/app/code/core/Mage/Adminhtml/controllers/System/Convert/ProfileController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/System/CurrencyController.php b/app/code/core/Mage/Adminhtml/controllers/System/CurrencyController.php index 0dc2addd12e814db6c5e774534cb80d8015b2ebf..1c90bc0abbbdf7d3739a30fc660454eeb5189eb8 100644 --- a/app/code/core/Mage/Adminhtml/controllers/System/CurrencyController.php +++ b/app/code/core/Mage/Adminhtml/controllers/System/CurrencyController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/System/DesignController.php b/app/code/core/Mage/Adminhtml/controllers/System/DesignController.php index 7e9659be6e8850c9387b698fb2e53bed8406e716..fedcd19c554e6c61a0f9c2ba33866403e0c3285d 100644 --- a/app/code/core/Mage/Adminhtml/controllers/System/DesignController.php +++ b/app/code/core/Mage/Adminhtml/controllers/System/DesignController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/System/Email/TemplateController.php b/app/code/core/Mage/Adminhtml/controllers/System/Email/TemplateController.php index 958cfb6304ede7d21390e00a7a5ee33107060ace..7083db6957b2b5fdaa2146c164e20341cebaca51 100644 --- a/app/code/core/Mage/Adminhtml/controllers/System/Email/TemplateController.php +++ b/app/code/core/Mage/Adminhtml/controllers/System/Email/TemplateController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/System/StoreController.php b/app/code/core/Mage/Adminhtml/controllers/System/StoreController.php index 44654754535cc56621b5532bb4af51b3ab257d3d..923783795821f2ca2229beaada1e2c51b57411a5 100644 --- a/app/code/core/Mage/Adminhtml/controllers/System/StoreController.php +++ b/app/code/core/Mage/Adminhtml/controllers/System/StoreController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -172,6 +172,7 @@ class Mage_Adminhtml_System_StoreController extends Mage_Adminhtml_Controller_Ac try { switch ($postData['store_type']) { case 'website': + $postData['website']['name'] = $this->_getHelper()->removeTags($postData['website']['name']); $websiteModel = Mage::getModel('Mage_Core_Model_Website'); if ($postData['website']['website_id']) { $websiteModel->load($postData['website']['website_id']); @@ -186,6 +187,7 @@ class Mage_Adminhtml_System_StoreController extends Mage_Adminhtml_Controller_Ac break; case 'group': + $postData['group']['name'] = $this->_getHelper()->removeTags($postData['group']['name']); $groupModel = Mage::getModel('Mage_Core_Model_Store_Group'); if ($postData['group']['group_id']) { $groupModel->load($postData['group']['group_id']); @@ -205,6 +207,7 @@ class Mage_Adminhtml_System_StoreController extends Mage_Adminhtml_Controller_Ac case 'store': $eventName = 'store_edit'; $storeModel = Mage::getModel('Mage_Core_Model_Store'); + $postData['store']['name'] = $this->_getHelper()->removeTags($postData['store']['name']); if ($postData['store']['store_id']) { $storeModel->load($postData['store']['store_id']); } @@ -498,4 +501,3 @@ class Mage_Adminhtml_System_StoreController extends Mage_Adminhtml_Controller_Ac } } - diff --git a/app/code/core/Mage/Adminhtml/controllers/System/VariableController.php b/app/code/core/Mage/Adminhtml/controllers/System/VariableController.php index 228f91d1d579a7d55967bd182b7f12d25e6ec739..9c2b457669f6df5d6fa4ed7e10d7f25cbf807e14 100644 --- a/app/code/core/Mage/Adminhtml/controllers/System/VariableController.php +++ b/app/code/core/Mage/Adminhtml/controllers/System/VariableController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -56,7 +56,7 @@ class Mage_Adminhtml_System_VariableController extends Mage_Adminhtml_Controller $this->_title($this->__('System'))->_title($this->__('Custom Variables')); $variableId = $this->getRequest()->getParam('variable_id', null); - $storeId = $this->getRequest()->getParam('store', 0); + $storeId = (int)$this->getRequest()->getParam('store', 0); /* @var $emailVariable Mage_Core_Model_Variable */ $variable = Mage::getModel('Mage_Core_Model_Variable'); if ($variableId) { @@ -101,9 +101,9 @@ class Mage_Adminhtml_System_VariableController extends Mage_Adminhtml_Controller $this->_initLayout() ->_addContent($this->getLayout()->createBlock('Mage_Adminhtml_Block_System_Variable_Edit')) - ->_addJs($this->getLayout() - ->createBlock('Mage_Core_Block_Template', '', array('template' => 'system/variable/js.phtml')) - ) + ->_addJs($this->getLayout()->createBlock('Mage_Core_Block_Template', '', array( + 'template' => 'system/variable/js.phtml' + ))) ->renderLayout(); } diff --git a/app/code/core/Mage/Adminhtml/controllers/SystemController.php b/app/code/core/Mage/Adminhtml/controllers/SystemController.php index e7f56acd65414a073700c8ff2af6b8e8a8698473..3a194ba68018d52325bc548228e62f21980fd70b 100644 --- a/app/code/core/Mage/Adminhtml/controllers/SystemController.php +++ b/app/code/core/Mage/Adminhtml/controllers/SystemController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/TagController.php b/app/code/core/Mage/Adminhtml/controllers/TagController.php index 29db3ccb350fcd74c4cd7fb0d1bf0267036119f5..9a7f56cea422abb3b00d74aa14f1744f55548840 100644 --- a/app/code/core/Mage/Adminhtml/controllers/TagController.php +++ b/app/code/core/Mage/Adminhtml/controllers/TagController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -82,7 +82,6 @@ class Mage_Adminhtml_TagController extends Mage_Adminhtml_Controller_Action $this->_initAction() ->_addBreadcrumb(Mage::helper('Mage_Adminhtml_Helper_Data')->__('All Tags'), Mage::helper('Mage_Adminhtml_Helper_Data')->__('All Tags')) ->_setActiveMenu('catalog/tag/all') - ->_addContent($this->getLayout()->createBlock('Mage_Adminhtml_Block_Tag_Tag')) ->renderLayout(); } @@ -93,7 +92,7 @@ class Mage_Adminhtml_TagController extends Mage_Adminhtml_Controller_Action public function ajaxGridAction() { $this->loadLayout(); - $this->getResponse()->setBody($this->getLayout()->createBlock('Mage_Adminhtml_Block_Tag_Tag_Grid')->toHtml()); + $this->renderLayout(); } /** @@ -103,9 +102,7 @@ class Mage_Adminhtml_TagController extends Mage_Adminhtml_Controller_Action public function ajaxPendingGridAction() { $this->loadLayout(); - $this->getResponse()->setBody( - $this->getLayout()->createBlock('Mage_Adminhtml_Block_Tag_Grid_Pending')->toHtml() - ); + $this->renderLayout(); } /** @@ -172,7 +169,9 @@ class Mage_Adminhtml_TagController extends Mage_Adminhtml_Controller_Action $model->addData($data); if (isset($postData['tag_assigned_products'])) { - $productIds = Mage::helper('Mage_Adminhtml_Helper_Js')->decodeGridSerializedInput($postData['tag_assigned_products']); + $productIds = Mage::helper('Mage_Adminhtml_Helper_Js')->decodeGridSerializedInput( + $postData['tag_assigned_products'] + ); $tagRelationModel = Mage::getModel('Mage_Tag_Model_Tag_Relation'); $tagRelationModel->addRelations($model, $productIds); } @@ -236,7 +235,6 @@ class Mage_Adminhtml_TagController extends Mage_Adminhtml_Controller_Action $this->_initAction() ->_addBreadcrumb(Mage::helper('Mage_Adminhtml_Helper_Data')->__('Pending Tags'), Mage::helper('Mage_Adminhtml_Helper_Data')->__('Pending Tags')) ->_setActiveMenu('catalog/tag/pending') - ->_addContent($this->getLayout()->createBlock('Mage_Adminhtml_Block_Tag_Pending')) ->renderLayout(); } @@ -271,9 +269,8 @@ class Mage_Adminhtml_TagController extends Mage_Adminhtml_Controller_Action public function productAction() { $this->_initTag(); - $this->getResponse()->setBody( - $this->getLayout()->createBlock('Mage_Adminhtml_Block_Tag_Product_Grid')->toHtml() - ); + $this->loadLayout(); + $this->renderLayout(); } /** @@ -283,9 +280,8 @@ class Mage_Adminhtml_TagController extends Mage_Adminhtml_Controller_Action public function customerAction() { $this->_initTag(); - $this->getResponse()->setBody( - $this->getLayout()->createBlock('Mage_Adminhtml_Block_Tag_Customer_Grid')->toHtml() - ); + $this->loadLayout(); + $this->renderLayout(); } /** diff --git a/app/code/core/Mage/Adminhtml/controllers/Tax/Class/CustomerController.php b/app/code/core/Mage/Adminhtml/controllers/Tax/Class/CustomerController.php index b47b1016e532cbbfc53db041d127d8cf6f20af4e..4528abc6246544233ab9e9abf700c9f99704631e 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Tax/Class/CustomerController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Tax/Class/CustomerController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Tax/Class/ProductController.php b/app/code/core/Mage/Adminhtml/controllers/Tax/Class/ProductController.php index 0f6f1ffc44ff6960af3761b74e42f31b8a74e284..1d0ce11c2e4960ee8d2c2755eafba7973ec7914c 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Tax/Class/ProductController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Tax/Class/ProductController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/controllers/Tax/ClassController.php b/app/code/core/Mage/Adminhtml/controllers/Tax/ClassController.php index e08ac92ab47b7f0ce435d1dca1365da077202ee8..ec86c4170ee023f2742179b3ff5e722d313b99b8 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Tax/ClassController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Tax/ClassController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -41,9 +41,6 @@ class Mage_Adminhtml_Tax_ClassController extends Mage_Adminhtml_Controller_Actio { if ($postData = $this->getRequest()->getPost()) { - //filtering - $postData['class_name'] = Mage::helper('Mage_Adminhtml_Helper_Data')->stripTags($postData['class_name']); - $model = Mage::getModel('Mage_Tax_Model_Class')->setData($postData); try { diff --git a/app/code/core/Mage/Adminhtml/controllers/Tax/RateController.php b/app/code/core/Mage/Adminhtml/controllers/Tax/RateController.php index 522d51036307eb2500f2eff4c0efd846ec6a52c4..5fd17b64f65a531dbc4da54c83ee9e7268e7f17b 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Tax/RateController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Tax/RateController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -93,16 +93,6 @@ class Mage_Adminhtml_Tax_RateController extends Mage_Adminhtml_Controller_Action { $ratePost = $this->getRequest()->getPost(); if ($ratePost) { - //filter tags in titles - /** @var $helper Mage_Adminhtml_Helper_Data */ - $helper = Mage::helper('Mage_Adminhtml_Helper_Data'); - $ratePost['code'] = $helper->stripTags($ratePost['code']); - if (!empty($ratePost['title'])) { - foreach ($ratePost['title'] as &$title) { - $title = $helper->stripTags($title); - } - } - $rateId = $this->getRequest()->getParam('tax_calculation_rate_id'); if ($rateId) { $rateModel = Mage::getSingleton('Mage_Tax_Model_Calculation_Rate')->load($rateId); @@ -302,7 +292,9 @@ class Mage_Adminhtml_Tax_RateController extends Mage_Adminhtml_Controller_Action $stores = array(); $unset = array(); $storeCollection = Mage::getModel('Mage_Core_Model_Store')->getCollection()->setLoadDefault(false); - for ($i = count($csvFields); $i < count($csvData[0]); $i++) { + $cvsFieldsNum = count($csvFields); + $cvsDataNum = count($csvData[0]); + for ($i = $cvsFieldsNum; $i < $cvsDataNum; $i++) { $header = $csvData[0][$i]; $found = false; foreach ($storeCollection as $store) { @@ -367,7 +359,7 @@ class Mage_Adminhtml_Tax_RateController extends Mage_Adminhtml_Controller_Action if (!empty($regions[$v[1]][$v[2]])) { $rateData = array( - 'code' => $helper->stripTags($v[0]), + 'code' => $v[0], 'tax_country_id' => $v[1], 'tax_region_id' => ($regions[$v[1]][$v[2]] == '*') ? 0 : $regions[$v[1]][$v[2]], 'tax_postcode' => (empty($v[3]) || $v[3]=='*') ? null : $v[3], @@ -387,11 +379,6 @@ class Mage_Adminhtml_Tax_RateController extends Mage_Adminhtml_Controller_Action $titles[$id] = $v[$field]; } - //filter tags in titles - foreach ($titles as &$title) { - $title = $helper->stripTags($title); - } - $rateModel->setTitle($titles); $rateModel->save(); } @@ -482,4 +469,4 @@ class Mage_Adminhtml_Tax_RateController extends Mage_Adminhtml_Controller_Action break; } } -} +} \ No newline at end of file diff --git a/app/code/core/Mage/Adminhtml/controllers/Tax/RuleController.php b/app/code/core/Mage/Adminhtml/controllers/Tax/RuleController.php index 0c95d266ed1b71a0bd60f17d727f5996f078c6d7..6f9cb234764f033cf11e85507bb16de1e1925ca7 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Tax/RuleController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Tax/RuleController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -89,11 +89,6 @@ class Mage_Adminhtml_Tax_RuleController extends Mage_Adminhtml_Controller_Action { if ($postData = $this->getRequest()->getPost()) { - //filtering - /** @var $helper Mage_Adminhtml_Helper_Data */ - $helper = Mage::helper('Mage_Adminhtml_Helper_Data'); - $postData['code'] = $helper->stripTags($postData['code']); - $ruleModel = Mage::getSingleton('Mage_Tax_Model_Calculation_Rule'); $ruleModel->setData($postData); diff --git a/app/code/core/Mage/Adminhtml/controllers/UrlrewriteController.php b/app/code/core/Mage/Adminhtml/controllers/UrlrewriteController.php index cbbabdb9bdf88b99764e73dbe2de007490ac9cbd..e5d5cf7259f2e9dc93d2e65ff5f1d358c2371ddd 100644 --- a/app/code/core/Mage/Adminhtml/controllers/UrlrewriteController.php +++ b/app/code/core/Mage/Adminhtml/controllers/UrlrewriteController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/etc/adminhtml.xml b/app/code/core/Mage/Adminhtml/etc/adminhtml.xml index 50245e920535f6a6a6695aace1c9ec7e07bf3fa5..025cba8a08f40ee392a4c905242f63bd0bcd6500 100644 --- a/app/code/core/Mage/Adminhtml/etc/adminhtml.xml +++ b/app/code/core/Mage/Adminhtml/etc/adminhtml.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Adminhtml/etc/config.xml b/app/code/core/Mage/Adminhtml/etc/config.xml index 7eb6f302d2f7279c3390fd9eab9fef7738fd11f7..3656c858ad450022c8dd1d23a29ccb70525e913e 100644 --- a/app/code/core/Mage/Adminhtml/etc/config.xml +++ b/app/code/core/Mage/Adminhtml/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> @@ -207,6 +207,12 @@ </input_types> </validator_data> </general> + <hints> + <store_switcher> + <url><![CDATA[http://www.magentocommerce.com/knowledge-base/entry/understanding-store-scopes]]></url> + <enabled>1</enabled> + </store_switcher> + </hints> </default> <stores> <admin> diff --git a/app/code/core/Mage/Adminhtml/etc/translater.xml b/app/code/core/Mage/Adminhtml/etc/translater.xml new file mode 100644 index 0000000000000000000000000000000000000000..8454ad559c2786988b105e5c1a55cd1997a6aaa9 --- /dev/null +++ b/app/code/core/Mage/Adminhtml/etc/translater.xml @@ -0,0 +1,65 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * 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_AFL.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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Adminhtml + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<translater> + <!-- flexuploader.js --> + <flexuploader-complete translate="message" module="Mage_Adminhtml"> + <message>Complete</message> + </flexuploader-complete> + <flexuploader-security-error translate="message" module="Mage_Adminhtml"> + <message>Upload Security Error</message> + </flexuploader-security-error> + <flexuploader-http-error translate="message" module="Mage_Adminhtml"> + <message>Upload HTTP Error</message> + </flexuploader-http-error> + <flexuploader-io-error translate="message" module="Mage_Adminhtml"> + <message>Upload I/O Error</message> + </flexuploader-io-error> + <flexuploader-ssl-error translate="message" module="Mage_Adminhtml"> + <message>SSL Error: Invalid or self-signed certificate</message> + </flexuploader-ssl-error> + <flexuploader-tb translate="message" module="Mage_Adminhtml"> + <message>Tb</message> + </flexuploader-tb> + <flexuploader-gb translate="message" module="Mage_Adminhtml"> + <message>Gb</message> + </flexuploader-gb> + <flexuploader-mb translate="message" module="Mage_Adminhtml"> + <message>Mb</message> + </flexuploader-mb> + <flexuploader-kb translate="message" module="Mage_Adminhtml"> + <message>Kb</message> + </flexuploader-kb> + <flexuploader-b translate="message" module="Mage_Adminhtml"> + <message>b</message> + </flexuploader-b> + <!-- end flexuploader.js --> + <sales-order-create-addproducts translate="message" module="Mage_Adminhtml"> + <message>Add Products</message> + </sales-order-create-addproducts> +</translater> + diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/admin.xml b/app/code/core/Mage/Adminhtml/view/adminhtml/admin.xml index 7e313b32d1f9e0abcd98658a4e019ee68b051991..f10404e154998551e794f75b70eee599103ee333 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/admin.xml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/admin.xml @@ -21,7 +21,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/admin/access_denied.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/admin/access_denied.phtml index bf85d99edddb218590ba9d96dbb994f9d936a19a..fcb90c48c3fe1c3819134940b11b6f356b38693c 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/admin/access_denied.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/admin/access_denied.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/admin/forgotpassword.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/admin/forgotpassword.phtml index 7bcbb183a6320c4750d81b1d460f5c7d19064cc3..8cdfb5bb61167184ad0985d30ea3972247c8b817 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/admin/forgotpassword.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/admin/forgotpassword.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -39,6 +39,7 @@ <script type="text/javascript" src="<?php echo $this->getSkinUrl('mage/adminhtml/events.js'); ?>"></script> <script type="text/javascript" src="<?php echo $this->getSkinUrl('mage/adminhtml/form.js'); ?>"></script> <script type="text/javascript" src="<?php echo $this->getSkinUrl('scriptaculous/effects.js'); ?>"></script> + <script type="text/javascript" src="<?php echo $this->getSkinUrl('mage/captcha.js') ?>"></script> <!--[if IE]> <link rel="stylesheet" href="<?php echo $this->getSkinUrl('iestyles.css'); ?>" type="text/css" media="all" /> <![endif]--> <!--[if lt IE 7]> <link rel="stylesheet" href="<?php echo $this->getSkinUrl('below_ie7.css'); ?>" type="text/css" media="all" /> <![endif]--> @@ -57,10 +58,11 @@ <div class="input-box forgot-password"><label for="email"><?php echo Mage::helper('Mage_Adminhtml_Helper_Data')->__('Email Address:'); ?></label><br /> <input type="text" id="email" name="email" value="" class="required-entry input-text forgot-password validate-email" style="width:461px;" /> </div> + <?php echo $this->getChildHtml('form.additional.info'); ?> <div class="clear"></div> <div class="form-buttons"> <a class="left" href="<?php echo $this->getUrl('adminhtml', array('_nosecret' => true)); ?>">« <?php echo Mage::helper('Mage_Adminhtml_Helper_Data')->__('Back to Login'); ?></a> - <button class="forgot-password" onclick="loginForm.submit()" type="button"><span><?php echo Mage::helper('Mage_Adminhtml_Helper_Data')->__('Retrieve Password'); ?></span></button> + <button class="forgot-password" onclick="loginForm.submit()" type="button"><span><span><span><?php echo Mage::helper('Mage_Adminhtml_Helper_Data')->__('Retrieve Password'); ?></span></span></span></button> </div> </fieldset> <p class="legal"><?php echo Mage::helper('Mage_Adminhtml_Helper_Data')->__('Magento is a trademark of Magento Inc. Copyright © %s Magento Inc.', date('Y')); ?></p> @@ -73,4 +75,3 @@ </div> </body> </html> - diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/admin/formkey.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/admin/formkey.phtml index 7ab082d367454c99fadf8779894b52e2ca6ba1c6..9ac18a669eef4e2fed65fdeacdfeeebfbe4ea169 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/admin/formkey.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/admin/formkey.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/admin/login.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/admin/login.phtml index a6153c6a3e0d1109b1090cfeafe97a5d4b1a27c4..8ad67aa44c0ce3afb226f31c38438ab64c41a2fa 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/admin/login.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/admin/login.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -38,6 +38,7 @@ <script type="text/javascript" src="<?php echo $this->getSkinUrl('prototype/validation.js') ?>"></script> <script type="text/javascript" src="<?php echo $this->getSkinUrl('scriptaculous/effects.js') ?>"></script> <script type="text/javascript" src="<?php echo $this->getSkinUrl('mage/adminhtml/form.js') ?>"></script> + <script type="text/javascript" src="<?php echo $this->getSkinUrl('mage/captcha.js') ?>"></script> <!--[if IE]> <link rel="stylesheet" href="<?php echo $this->getSkinUrl('iestyles.css') ?>" type="text/css" media="all" /> <![endif]--> <!--[if lt IE 7]> <link rel="stylesheet" href="<?php echo $this->getSkinUrl('below_ie7.css') ?>" type="text/css" media="all" /> <![endif]--> @@ -57,6 +58,7 @@ <input type="text" id="username" name="login[username]" value="" class="required-entry input-text" /></div> <div class="input-box input-right"><label for="login"><?php echo Mage::helper('Mage_Adminhtml_Helper_Data')->__('Password:') ?></label><br /> <input type="password" id="login" name="login[password]" class="required-entry input-text" value="" /></div> + <?php echo $this->getChildHtml('form.additional.info'); ?> <div class="clear"></div> <div class="form-buttons"> <a class="left" href="<?php echo Mage::helper('Mage_Adminhtml_Helper_Data')->getUrl('adminhtml/index/forgotpassword', array('_nosecret' => true)) ?>"><?php echo Mage::helper('Mage_Adminhtml_Helper_Data')->__('Forgot your password?') ?></a> @@ -72,4 +74,3 @@ </div> </body> </html> - diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/admin/overlay_popup.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/admin/overlay_popup.phtml index 7a26c1d06f6e929f8480d7b2e7994d4daa5896f1..84a11c67099cb99bac0e9a0673a94967d524cbcc 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/admin/overlay_popup.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/admin/overlay_popup.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/admin/page.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/admin/page.phtml index 906b448c8404a141f1dc4ee33176e0956738b08b..30e0a13f8d910296d9293cf43acaf7c46091302e 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/admin/page.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/admin/page.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -43,7 +43,7 @@ <?php echo $this->getChildHtml('head') ?> </head> -<body id="html-body"<?php echo $this->getBodyClass()?'class="'.$this->getBodyClass().'"':'' ?>> +<body id="html-body"<?php echo $this->getBodyClass() ? ' class="' . $this->getBodyClass() . '"' : ''; ?>> <?php echo $this->getChildHtml('notification_window'); ?> <div class="wrapper"> <?php echo $this->getChildHtml('global_notices') ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/admin/popup.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/admin/popup.phtml index 874cbe1dd6880d8f92e971f17fb1749c9f4ae89a..69c93163f2e855901578320c99f36edda3b91023 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/admin/popup.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/admin/popup.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/adminnotification.xml b/app/code/core/Mage/Adminhtml/view/adminhtml/adminnotification.xml index 869eef8dbbf212c5c999655ff3c81ba8e1624a2a..5c4bc5d549609726de70a6e5a0c89f7298475697 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/adminnotification.xml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/adminnotification.xml @@ -21,7 +21,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/api/role_users_grid_js.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/api/role_users_grid_js.phtml index 838135e7459b6ba6622f8ec07ba060627526098b..79ffafe5fe4102edc09cd0dd03321b25f524600a 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/api/role_users_grid_js.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/api/role_users_grid_js.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/api/roleinfo.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/api/roleinfo.phtml index e74f89123493b25a8162262b7413cf7e5ed45f80..053723aeba5f5c64b21d2b70eb82fb3503fb7e60 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/api/roleinfo.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/api/roleinfo.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/api/roles.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/api/roles.phtml index 4713c7b0d107e78b83b5801d9e9e480d565a3df0..cebb8dcb143228424fa0e6fb686ef8a27741e304 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/api/roles.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/api/roles.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -29,7 +29,7 @@ <tr> <td style="width:50%;"><h3 class="icon-head head-permissions-role"><?php echo $this->__('Roles') ?></h3></td> <td class="form-buttons"> - <button class="scalable add" onclick="window.location='<?php echo $this->getAddNewUrl() ?>'"><span><?php echo $this->__('Add New Role') ?></span></button> + <button class="scalable add" onclick="window.location='<?php echo $this->getAddNewUrl() ?>'"><span><span><span><?php echo $this->__('Add New Role') ?></span></span></span></button> </td> </tr> </table> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/api/rolesedit.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/api/rolesedit.phtml index 07c06c7b754da89dbff5d96458b21ee568853673..e031b7da666397aca8ed0642cd332a3b04977c51 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/api/rolesedit.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/api/rolesedit.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/api/rolesusers.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/api/rolesusers.phtml index 3727f5c4ac917ad3f53b2f9b97bc0e47783b0c1e..e09eb58a42257849bb874ea64fe716c664d4f81d 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/api/rolesusers.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/api/rolesusers.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/api/user_roles_grid_js.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/api/user_roles_grid_js.phtml index 57a60860f8ea606db35faaa988e0946449670038..cc042e99e851ac85654518424b3f94286df3f513 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/api/user_roles_grid_js.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/api/user_roles_grid_js.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/api/userinfo.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/api/userinfo.phtml index c9be39d10b18f0e82be00e9593e119092c80d8f6..5290bbcf433cf4291634f7ad99fb1fe95b2d5832 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/api/userinfo.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/api/userinfo.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/api/usernroles.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/api/usernroles.phtml index 8106d8e6ff28c4d4011a652caf92732b6a009c0e..9ccb82acbfbfb2c485157c823a81da7fb50a6ae2 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/api/usernroles.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/api/usernroles.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/backup/dialogs.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/backup/dialogs.phtml new file mode 100644 index 0000000000000000000000000000000000000000..7b2b8635d54f961c480e65903ab1d3d37734b49f --- /dev/null +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/backup/dialogs.phtml @@ -0,0 +1,190 @@ +<?php +/** + * Magento + * + * 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_AFL.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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category design + * @package default_default + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +?> +<div class="backup-dialog" style="display: none;" id="rollback-warning"> + <div class="entry-edit"> + <div class="entry-edit-head"> + <h4 class="head-edit-form fieldset-legend"><?php echo $this->__('Warning') ?></h4> + </div> + <div class="content"> + <div><?php echo $this->__('Any data created since the backup was made will be lost including admin users, customers and orders.')?></div> + <div class="question"><?php echo $this->__('Are you sure you want to proceed?')?></div> + </div> + <div class="buttons-set"> + <div class="f-right"> + <button type="button" class="scalable " onclick="backup.requestPassword()"><span><?php echo $this->__('OK')?></span></button> + <button type="button" class="scalable " onclick="backup.hidePopups()"><span><?php echo $this->__('Cancel')?></span></button> + </div> + </div> + </div> +</div> + +<div class="backup-dialog" style="display: none;" id="backup-warning"> + <div class="entry-edit"> + <div class="entry-edit-head"> + <h4 class="head-edit-form fieldset-legend"><?php echo $this->__('Warning') ?></h4> + </div> + <div class="content"> + <div class="backup-messages" style="display: none;"><ul class="messages"></ul></div> + <div><?php echo $this->__("The backup's creation process will take time.")?></div> + <div><?php echo $this->__('You will need to wait when the action ends.')?></div> + <div><?php echo $this->__('Do you really want to proceed?')?></div> + </div> + <div class="buttons-set"> + <div class="f-right"> + <button type="button" class="scalable " onclick="backup.requestBackupOptions()"><span><?php echo $this->__('OK')?></span></button> + <button type="button" class="scalable " onclick="backup.hidePopups()"><span><?php echo $this->__('Cancel')?></span></button> + </div> + </div> + </div> +</div> + +<div class="backup-dialog" style="display: none;" id="backup-options"> + <div class="entry-edit"> + <div class="entry-edit-head"> + <h4 class="head-edit-form fieldset-legend"><?php echo $this->__('Backup options') ?></h4> + </div> + <div class="content"> + <div class="backup-messages" style="display: none;"><ul class="messages"></ul></div> + <div><?php echo $this->__('Please specify backup creation options')?></div> + <form action="" method="post" id="backup-form" onsubmit="return backup.submitBackup();"> + <table class="form-list question" cellspacing="0"> + <tr> + <td style="padding-right: 8px;"><label for="backup_name" class="nobr"><?php echo $this->__('Backup Name')?></label></td> + <td> + <input type="text" name="backup_name" id="backup_name" class="validate-alphanum-with-spaces" style="width: 343px"/> + <p class="note"><span><?php echo $this->__('Please use only letters (a-z or A-Z), numbers (0-9) or spaces in this field.'); ?></span></p> + </td> + </tr> + <tr> + <td> </td> + <td class="maintenance-checkbox-container"> + <input type="checkbox" name="maintenance_mode" value="1" id="backup_maintenance_mode"/> + <label for="backup_maintenance_mode"><?php echo $this->__('Put store on the maintenance mode while backup creation')?></label> + </td> + </tr> + <tr id="exclude-media-checkbox-container" style="display: none;"> + <td> </td> + <td> + <input type="checkbox" name="exclude_media" value="1" id="exclude_media"/> + <label for="exclude_media"><?php echo $this->__('Exclude media folder from backup')?></label> + </td> + </tr> + </table> + </form> + </div> + <div class="buttons-set"> + <div class="f-right"> + <button type="button" class="scalable " onclick="backup.submitBackup()"><span><?php echo $this->__('OK')?></span></button> + <button type="button" class="scalable " onclick="backup.hidePopups()"><span><?php echo $this->__('Cancel')?></span></button> + </div> + </div> + </div> + </div> + +<div class="backup-dialog" style="display: none;" id="rollback-request-password"> + <div class="entry-edit"> + <div class="entry-edit-head"> + <h4 class="head-edit-form fieldset-legend"><?php echo $this->__('Please enter password') ?></h4> + </div> + <div class="content"> + <div class="backup-messages" style="display: none;"><ul class="messages"></ul></div> + <div><?php echo $this->__('Please enter password to confirm rollback.')?></div> + <div><?php echo $this->__('This action cannot be undone.')?></div> + <div class="question"><?php echo $this->__('Are you sure you want to proceed?')?></div> + <form action="" method="post" id="rollback-form" onsubmit="return backup.submitRollback();"> + <div class="password-box-container"> + <table class="form-list" cellspacing="0"> + <tr> + <td style="padding-right: 8px;"><label for="password" class="nobr"><?php echo $this->__('User Password')?> <span class="required">*</span></label></td> + <td><input type="password" name="password" id="password" class="required-entry"></td> + </tr> + <tr> + <td> </td> + <td class="maintenance-checkbox-container"> + <input type="checkbox" name="maintenance_mode" value="1" id="rollback_maintenance_mode"/> + <label for="rollback_maintenance_mode"><?php echo $this->__('Put store on the maintenance mode while rollback processing')?></label> + </td> + </tr> + <tr id="use-ftp-checkbox-row" style="display: none;"> + <td> </td> + <td><input type="checkbox" name="use_ftp" value="1" id="use_ftp" onClick="backup.toggleFtpCredentialsForm();"/> <label for="use_ftp"><?php echo $this->__('Use FTP Connection')?></label></td> + </tr> + </table> + </div> + <div class="entry-edit" id="ftp-credentials-container" style="display: none;"> + <div class="entry-edit-head"> + <h4 class=""><?php echo $this->__('FTP credentials')?></h4> + </div> + <fieldset> + <table class="form-list" cellspacing="0"> + <tr> + <td class="label"><label for="ftp_host"><?php echo $this->__('FTP Host')?> <span class="required">*</span></label></td> + <td class="value"><input type="text" name="ftp_host" id="ftp_host"></td> + </tr> + <tr> + <td class="label"><label for="ftp_user"><?php echo $this->__('FTP Login')?> <span class="required">*</span></label></td> + <td class="value"><input type="text" name="ftp_user" id="ftp_user"></td> + </tr> + <tr> + <td class="label"><label for="ftp_pass"><?php echo $this->__('FTP Password')?> <span class="required">*</span></label></td> + <td class="value"><input type="password" name="ftp_pass" id="ftp_pass"></td> + </tr> + <tr> + <td class="label"><label for="ftp_path"><?php echo $this->__('Magento root directory')?></label></td> + <td class="value"><input type="text" name="ftp_path" id="ftp_path"></td> + </tr> + </table> + </fieldset> + </div> + </form> + </div> + <div class="buttons-set"> + <div class="f-right"> + <button type="button" class="scalable " onclick="backup.submitRollback()"><span><?php echo $this->__('OK')?></span></button> + <button type="button" class="scalable " onclick="backup.hidePopups()"><span><?php echo $this->__('Cancel')?></span></button> + </div> + </div> + </div> +</div> + +<div id="popup-window-mask" style="display: none;"></div> + +<?php + $helper = Mage::helper('Mage_Backup_Helper_Data'); + $rollbackUrl = $this->getUrl('*/*/rollback'); + $backupUrl = $this->getUrl('*/*/create'); +?> + +<script type="text/javascript"> +//<![CDATA[ + document.observe('dom:loaded', function () { + backup = new AdminBackup(); + backup.rollbackUrl = '<?php echo $helper->jsQuoteEscape($rollbackUrl);?>'; + backup.backupUrl = '<?php echo $helper->jsQuoteEscape($backupUrl);?>'; + }); +//]]> +</script> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/backup/left.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/backup/left.phtml index 5c07412a14ebd86cd8af86257e8deaa79e9a0731..d684b1233af600e26f798daee26d2dab04e7e4bd 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/backup/left.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/backup/left.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/backup/list.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/backup/list.phtml index 0e2b40194c995aedb75249089d9131803d18327e..686a9e0abd09c2690432b3ae5df7d25d688b4ef9 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/backup/list.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/backup/list.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -28,8 +28,13 @@ <table cellspacing="0"> <tr> <td style="width:50%;"><h3 class="icon-head head-backups-control"><?php echo Mage::helper('Mage_Backup_Helper_Data')->__('Backups') ?></h3></td> - <td class="form-buttons"><?php echo $this->getCreateButtonHtml(); ?></td> + <td class="form-buttons"> + <?php echo $this->getCreateSnapshotButtonHtml(); ?> + <?php echo $this->getCreateMediaBackupButtonHtml(); ?> + <?php echo $this->getCreateButtonHtml(); ?> + </td> </tr> </table> </div> <?php echo $this->getGridHtml() ?> +<?php echo $this->getDialogsHtml() ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog.xml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog.xml index 8a3333c88462345e4098662501576f98e0cd90d4..49abfdbbb1123fff6d609d5ca2aa466b9f973cc7 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog.xml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog.xml @@ -21,7 +21,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/category/checkboxes/tree.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/category/checkboxes/tree.phtml index e80f37103d8c7e7ea435f73282714d59cdb77c5b..18832c8a1145bb93fcd1f37ecf9f30b34d19dad1 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/category/checkboxes/tree.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/category/checkboxes/tree.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/category/edit.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/category/edit.phtml index 6453c9208ab75d26113418d14796df3fbbb72f93..89d6e6900e83f6698862bcd15853d41b3a00b19c 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/category/edit.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/category/edit.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/category/edit/form.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/category/edit/form.phtml index 8739d513c422a08a23eb5b5186d219d9b0a75239..c3f11437f27fa33d6e880fae3e0f1aa52b938a59 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/category/edit/form.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/category/edit/form.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/category/tree.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/category/tree.phtml index a993a5f56235cb1ebd07e16095f2a2b5a89dd680..6bcb21d5cd85a16201ff780ca3de00a7c9fe2fda 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/category/tree.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/category/tree.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/category/widget/tree.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/category/widget/tree.phtml index 5dd3a0d85e2ce78d6df4813a705adc8e53a1a5fe..4fe27d3568e36210a3d52c6702442c6251a327db 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/category/widget/tree.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/category/widget/tree.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/form/renderer/fieldset/element.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/form/renderer/fieldset/element.phtml index eaa1ff880df1a72f88bd3995d42ca6d6098dfdef..e3305ad1cb2e70434828da5708b34ce44d239ed3 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/form/renderer/fieldset/element.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/form/renderer/fieldset/element.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product.js b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product.js index e6aae5f63a999a912c07a051233650c3bcb5b984..2ba1d5141958846a6ddaefbb217a399991f4c6fc 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product.js +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product.js @@ -19,7 +19,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product.phtml index abccdff0c47ad7be2c82399a07ed85ee1a3a70ff..e17878ee458bab9fd8df43bec78a660ebd045c51 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/attribute/js.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/attribute/js.phtml index deb22a1ffcf18181d4b0263a5389c26ed72297d9..3a9d956706a1e823e225137ac572cb1257527eb9 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/attribute/js.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/attribute/js.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/attribute/new/created.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/attribute/new/created.phtml index a0ab7f942c7a9c71bdc96216739c141d6944a495..00b11f381bcdcacfb35be2da89f3ec1bbd16270d 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/attribute/new/created.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/attribute/new/created.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/attribute/options.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/attribute/options.phtml index 46980932046727ecf07766eeeb3d6b8c0c4f01ea..f1b17645d38a549b550437cb9b09ed8cc12cd048 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/attribute/options.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/attribute/options.phtml @@ -20,13 +20,13 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> <?php /** - * Attribute otions control + * Attribute options control * * @see Mage_Adminhtml_Block_Catalog_Product_Attribute_Edit_Tab_Options */ diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/attribute/set/main.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/attribute/set/main.phtml index eae17b5706a67f3a6992b2a9e7b2f11d8e3990a4..d49b59b32ffef575233edf93894a126ca21597b0 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/attribute/set/main.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/attribute/set/main.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/attribute/set/main/tree/attribute.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/attribute/set/main/tree/attribute.phtml index 2acd065758f7c7846dc7d29aa3976e6abf1cda16..06b9fcb86a249705cbf2cb1f1e7e4d7ef9474497 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/attribute/set/main/tree/attribute.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/attribute/set/main/tree/attribute.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/attribute/set/main/tree/group.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/attribute/set/main/tree/group.phtml index 91fe9250a425de2e2f4f0f72e2f267fc0f67397c..dc4ec6d0c351bf9565cd7226f31a1af3afd67bf3 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/attribute/set/main/tree/group.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/attribute/set/main/tree/group.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/attribute/set/toolbar/add.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/attribute/set/toolbar/add.phtml index c6584ab878e9586f9e90a427553ffdeb75befcd3..2bfd88b8729e6c62f83c29d2d07cff08c029f3b4 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/attribute/set/toolbar/add.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/attribute/set/toolbar/add.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/attribute/set/toolbar/main.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/attribute/set/toolbar/main.phtml index f4419690084eed975dfa4552bad359b58cb3e993..a8d0cc85efefa920d8dbe330d3290ea29b2b1d3b 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/attribute/set/toolbar/main.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/attribute/set/toolbar/main.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/composite/configure.js b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/composite/configure.js index 4d2c123796cf7827e23e0f63b7263b750666afa9..98d5706a987383ddc46ade6fcdc5fe77d1d76dba 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/composite/configure.js +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/composite/configure.js @@ -19,7 +19,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ @@ -213,16 +213,16 @@ ProductConfigure.prototype = { } else if (response) { response = response + ''; this.blockFormFields.update(response); - + // Add special div to hold mage data, e.g. scripts to execute on every popup show var mageData = {}; var scripts = response.extractScripts(); mageData.scripts = scripts; - + var scriptHolder = new Element('div', {'style': 'display:none'}); scriptHolder.mageData = mageData; this.blockFormFields.insert(scriptHolder); - + // Show window this._showWindow(); } @@ -694,7 +694,7 @@ ProductConfigure.prototype = { restoreConfirmedValues(this.blockFormFields.getElementsByTagName('input')); restoreConfirmedValues(this.blockFormFields.getElementsByTagName('select')); restoreConfirmedValues(this.blockFormFields.getElementsByTagName('textarea')); - + // Execute scripts if (mageData && mageData.scripts) { this.restorePhase = true; diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/composite/configure.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/composite/configure.phtml index ac32f74671cfaad76017043b397aabdb89d89bf1..93b116ea16bba3a377596a17d916a8a91630d654 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/composite/configure.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/composite/configure.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -39,8 +39,8 @@ <div id="product_composite_configure_form_additional" style="display:none;"></div> <div id="product_composite_configure_form_confirmed" style="display:none;"></div> <div class="buttons-set a-right"> - <button type="button" class="scalable" onclick="productConfigure.onCancelBtn()" id="product_composite_configure_form_cancel"><span><?php echo Mage::helper('Mage_Catalog_Helper_Data')->__('Cancel') ?></span></button> - <button type="submit" class="scalable"><span><?php echo Mage::helper('Mage_Catalog_Helper_Data')->__('OK') ?></span></button> + <button type="button" class="scalable" onclick="productConfigure.onCancelBtn()" id="product_composite_configure_form_cancel"><span><span><span><?php echo Mage::helper('Mage_Catalog_Helper_Data')->__('Cancel') ?></span></span></span></button> + <button type="submit" class="scalable"><span><span><span><?php echo Mage::helper('Mage_Catalog_Helper_Data')->__('OK') ?></span></span></span></button> </div> </div> <input type="hidden" name="as_js_varname" value="iFrameResponse" /> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/composite/fieldset/configurable.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/composite/fieldset/configurable.phtml index b28458c6b4c7db0609229252292b4289c4686f99..ec879c360f8e4d31b51f437700e6b555f8ff4e79 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/composite/fieldset/configurable.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/composite/fieldset/configurable.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/composite/fieldset/grouped.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/composite/fieldset/grouped.phtml index 8cda4468cc754aaa16e0d084f55f8404a7f14a8a..75d29b0725c877da234c3d28297fda857f2c4264 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/composite/fieldset/grouped.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/composite/fieldset/grouped.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/composite/fieldset/options.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/composite/fieldset/options.phtml index 9c3b616522e898145497b1ebe1a11cb41171ebae..0e23a4e19eebb9239ee2fe9461c0335aa614667e 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/composite/fieldset/options.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/composite/fieldset/options.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/composite/fieldset/options/js.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/composite/fieldset/options/js.phtml index d5d6361a364c33ebce721a57e5219ba13df95d62..30f453aa28cc879da267c1f05bf306d22260a25c 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/composite/fieldset/options/js.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/composite/fieldset/options/js.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/composite/fieldset/options/type/date.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/composite/fieldset/options/type/date.phtml index d83f9a3a244dd45dfa47e8f385ba86241b785d49..3e491c7d14e5c6cd46561f7673b5e442935768fa 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/composite/fieldset/options/type/date.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/composite/fieldset/options/type/date.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/composite/fieldset/options/type/default.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/composite/fieldset/options/type/default.phtml index 8337938533154c20116d4a70589978350911225e..df324cd804552da05509b37a4675c6579c3ca6aa 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/composite/fieldset/options/type/default.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/composite/fieldset/options/type/default.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/composite/fieldset/options/type/file.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/composite/fieldset/options/type/file.phtml index 6e9e4b8a1a3dadb10e3008efdde357d889f56dfb..484534cd2104c43d1217958c92271dec8ef38849 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/composite/fieldset/options/type/file.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/composite/fieldset/options/type/file.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/composite/fieldset/options/type/select.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/composite/fieldset/options/type/select.phtml index 8b9119ac771cdaffd32e86513ad8bc918af9588d..4ee993292959b68cbd3d25c24dadf5d5dabb6f1b 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/composite/fieldset/options/type/select.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/composite/fieldset/options/type/select.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/composite/fieldset/options/type/text.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/composite/fieldset/options/type/text.phtml index 836685a6d6b500ac95611dde814aa8a4d279f61a..ac193203ec6c2a28114df94de7da080a5c8273c1 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/composite/fieldset/options/type/text.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/composite/fieldset/options/type/text.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/composite/fieldset/qty.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/composite/fieldset/qty.phtml index 20d32b49a1dc8a2abb64b5d2ddcebb25f7746a07..63d0b6bfe736c0b3a48fd583aef2e214d068ef4f 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/composite/fieldset/qty.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/composite/fieldset/qty.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/created.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/created.phtml index 7f5cd5e6801c62d084bae2a639e4de566987f0c3..0306b20a29b821ac1abb179dfe0244304123e497 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/created.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/created.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit.phtml index 8d099da86a895da4fbfaa22faf633f206d3ab820..361cd25ba830156a64c397b105c2cbad5117291e 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/action/attribute.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/action/attribute.phtml index e3d5fd1f00407ce5601a4efcd74a9488454d0cd5..92a0348d2b907c372715061061943d9839993249 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/action/attribute.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/action/attribute.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/action/inventory.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/action/inventory.phtml index 2ae37985247de07d7cef8ba1a57d9017bd202511..1ac9fb6bb73b607c96cb065bd63feb042620e9f7 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/action/inventory.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/action/inventory.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/action/websites.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/action/websites.phtml index e76829c821fd523c230e2728f88e717d9853254d..2a7a0c5f023f807ec4dbf0cbe53bd86e9cef42e0 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/action/websites.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/action/websites.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/categories.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/categories.phtml index d02a5d1606715abdf33c346a500642a5f0bd4f2d..436ebdd18a7c6a9eac6f532f3a93eb26f5e33890 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/categories.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/categories.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/options.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/options.phtml index ab7aae28e735bce09db6a965a11e6ac92ad48197..5062bdd8e4484bb58d9fc2205470e91e36bf46ac 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/options.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/options.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/options/option.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/options/option.phtml index 08ea5068e45a74d11daa1334218b50d3554fe79f..94bb4eb1ce7cdfade9fb2aacce114c2f48454cd0 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/options/option.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/options/option.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -330,7 +330,7 @@ if($('<?php echo $this->getAddButtonId() ?>')){ //validation for selected input type Validation.addAllThese([ - ['required-option-select', '<?php echo Mage::helper('Mage_Catalog_Helper_Data')->__('Select type of option') ?>', function(v, elm) { + ['required-option-select', <?php echo $this->helper('Mage_Core_Helper_Data')->jsonEncode(Mage::helper('Mage_Catalog_Helper_Data')->__('Select type of option')) ?>, function(v, elm) { if (elm.getValue() == '') { return false; } diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/options/type/date.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/options/type/date.phtml index 07f48a91c557537fcf964fbe84d7f36f960ed8d1..d97e519e3ae1602884eded11aff13a2a7803bca0 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/options/type/date.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/options/type/date.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -36,7 +36,7 @@ OptionTemplateDate = '<table class="border" cellpadding="0" cellspacing="0">'+ '</tr>'+ '<tr>'+ <?php if ($this->getCanReadPrice() !== false) : ?> - '<td><input type="text" class="input-text validate-zero-or-greater product-option-price" id="product_option_{{option_id}}_price" name="product[options][{{option_id}}][price]" value="{{price}}"<?php if ($this->getCanEditPrice() === false) : ?> disabled="disabled"<?php endif; ?>></td>' + + '<td><input type="text" class="input-text validate-number product-option-price" id="product_option_{{option_id}}_price" name="product[options][{{option_id}}][price]" value="{{price}}"<?php if ($this->getCanEditPrice() === false) : ?> disabled="disabled"<?php endif; ?>></td>' + '<td><?php echo $this->getPriceTypeSelectHtml() ?>{{checkboxScopePrice}}</td>' + <?php else : ?> '<input type="hidden" id="product_option_{{option_id}}_price" name="product[options][{{option_id}}][price]">' + diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/options/type/file.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/options/type/file.phtml index 674fbd701d5ff5162476ecc423297137075adcc9..34f54fd675e247e635b2c90d76f58b359a4ca9b8 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/options/type/file.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/options/type/file.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -29,24 +29,28 @@ OptionTemplateFile = '<table class="border" cellpadding="0" cellspacing="0">'+ '<tr class="headings">'+ <?php if ($this->getCanReadPrice() !== false) : ?> - '<th class="type-price"><?php echo Mage::helper('Mage_Catalog_Helper_Data')->__('Price') ?></th>' + - '<th class="type-type"><?php echo Mage::helper('Mage_Catalog_Helper_Data')->__('Price Type') ?></th>' + + '<th class="type-price">' + <?php echo $this->helper('Mage_Core_Helper_Data')->jsonEncode(Mage::helper('Mage_Catalog_Helper_Data')->__('Price')); ?> + '</th>' + + '<th class="type-type">' + <?php echo $this->helper('Mage_Core_Helper_Data')->jsonEncode(Mage::helper('Mage_Catalog_Helper_Data')->__('Price Type')); ?> + '</th>' + <?php endif; ?> - '<th class="type-sku"><?php echo Mage::helper('Mage_Catalog_Helper_Data')->__('SKU') ?></th>'+ - '<th class="type-title"><?php echo Mage::helper('Mage_Catalog_Helper_Data')->__('Allowed File Extensions') ?></th>'+ - '<th class="last"><?php echo Mage::helper('Mage_Catalog_Helper_Data')->__('Maximum Image Size') ?></th>'+ - '</tr>'+ - '<tr>'+ + '<th class="type-sku">' + <?php echo $this->helper('Mage_Core_Helper_Data')->jsonEncode(Mage::helper('Mage_Catalog_Helper_Data')->__('SKU')); ?> + '</th>' + + '<th class="type-title">' + <?php echo $this->helper('Mage_Core_Helper_Data')->jsonEncode(Mage::helper('Mage_Catalog_Helper_Data')->__('Allowed File Extensions')); ?> + '</th>'+ + '<th class="last">' + <?php echo $this->helper('Mage_Core_Helper_Data')->jsonEncode(Mage::helper('Mage_Catalog_Helper_Data')->__('Maximum Image Size')); ?> + '</th>' + + '</tr>' + + '<tr>' + <?php if ($this->getCanReadPrice() !== false) : ?> '<td><input class="input-text validate-zero-or-greater" type="text" name="product[options][{{option_id}}][price]" value="{{price}}"<?php if ($this->getCanEditPrice() === false) : ?> disabled="disabled"<?php endif; ?>></td>' + - '<td><?php echo $this->getPriceTypeSelectHtml() ?></td>' + + '<td>' + <?php echo $this->helper('Mage_Core_Helper_Data')->jsonEncode($this->getPriceTypeSelectHtml()) ?> + '</td>' + <?php else : ?> '<input type="hidden" name="product[options][{{option_id}}][price]">' + '<input type="hidden" name="product[options][{{option_id}}][price_type]" id="product_option_{{option_id}}_price_type">' + <?php endif; ?> - '<td><input type="text" class="input-text" name="product[options][{{option_id}}][sku]" value="{{sku}}"></td>'+ - '<td><input class="input-text" type="text" name="product[options][{{option_id}}][file_extension]" value="{{file_extension}}"></td>'+ - '<td class="type-last last" nowrap><input class="input-text" type="text" name="product[options][{{option_id}}][image_size_x]" value="{{image_size_x}}"> <?php echo Mage::helper('Mage_Catalog_Helper_Data')->__('x') ?> <input class="input-text" type="text" name="product[options][{{option_id}}][image_size_y]" value="{{image_size_y}}"> <?php echo Mage::helper('Mage_Catalog_Helper_Data')->__('px.') ?><br/><?php echo Mage::helper('Mage_Catalog_Helper_Data')->__('leave blank if its not an image') ?></td>'+ + '<td><input type="text" class="input-text" name="product[options][{{option_id}}][sku]" value="{{sku}}"></td>' + + '<td><input class="input-text" type="text" name="product[options][{{option_id}}][file_extension]" value="{{file_extension}}"></td>' + + '<td class="type-last last" nowrap><input class="input-text" type="text" name="product[options][{{option_id}}][image_size_x]" value="{{image_size_x}}">' + + <?php echo $this->helper('Mage_Core_Helper_Data')->jsonEncode(Mage::helper('Mage_Catalog_Helper_Data')->__('x')) ?> + + '<input class="input-text" type="text" name="product[options][{{option_id}}][image_size_y]" value="{{image_size_y}}">' + + <?php echo $this->helper('Mage_Core_Helper_Data')->jsonEncode(Mage::helper('Mage_Catalog_Helper_Data')->__('px.')) ?> + + '<br/>' + <?php echo $this->helper('Mage_Core_Helper_Data')->jsonEncode(Mage::helper('Mage_Catalog_Helper_Data')->__('leave blank if its not an image')) ?> + '</td>' + '</tr>'+ '</table>'; diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/options/type/select.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/options/type/select.phtml index 69644ed6899b97067616d51b4e1efac418cf400f..dd526b5c55fa54d85956394f2d6e06d1663a844a 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/options/type/select.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/options/type/select.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -153,7 +153,7 @@ if ($('option_panel_type_select')) { selectOptionType.bindRemoveButtons(); Validation.addAllThese([ - ['required-option-select-type-rows', '<?php echo Mage::helper('Mage_Catalog_Helper_Data')->__('Please add rows to option.') ?>', function(v, elm) { + ['required-option-select-type-rows', <?php echo $this->helper('Mage_Core_Helper_Data')->jsonEncode(Mage::helper('Mage_Catalog_Helper_Data')->__('Please add rows to option.')); ?>, function(v, elm) { var optionContainerElm = elm.up('div.grid'); var selectTypesFlag = false; selectTypeElements = $$('#'+optionContainerElm.id+' .select-type-title'); diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/options/type/text.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/options/type/text.phtml index ffba61919d569b4cdf3976e2937fb7353283d728..05f49df6490b4d0c5fee37432595ca0002f476cf 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/options/type/text.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/options/type/text.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/price/group.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/price/group.phtml new file mode 100644 index 0000000000000000000000000000000000000000..745d20b3de205bbf6299a6c780c9803e655cca8a --- /dev/null +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/price/group.phtml @@ -0,0 +1,169 @@ +<?php +/** + * Magento + * + * 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_AFL.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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category design + * @package default_default + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +?> +<?php +/** @var $this Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Price_Group */ +$_htmlId = $this->getElement()->getHtmlId(); +$_htmlClass = $this->getElement()->getClass(); +$_htmlName = $this->getElement()->getName(); +$_readonly = $this->getElement()->getReadonly(); +$_priceValueValidation = $this->getPriceValidation('validate-zero-or-greater'); + +$_showWebsite= $this->isMultiWebsites(); +?> +<tr> + <td class="label"><?php echo $this->getElement()->getLabel(); ?></td> + <td colspan="10" class="grid tier"> + <table cellspacing="0" class="data border" id="group_prices_table"> + <?php if ($_showWebsite) : ?> + <col width="135" /> + <?php endif; ?> + <col width="120" /> + <col /> + <col width="1" /> + <thead> + <tr class="headings"> + <th <?php if (!$_showWebsite): ?>style="display: none;"<?php endif; ?>><?php echo Mage::helper('Mage_Catalog_Helper_Data')->__('Website'); ?></th> + <th><?php echo Mage::helper('Mage_Catalog_Helper_Data')->__('Customer Group'); ?></th> + <th><?php echo $this->getPriceColumnHeader(Mage::helper('Mage_Catalog_Helper_Data')->__('Price')); ?></th> + <th class="last"><?php echo Mage::helper('Mage_Catalog_Helper_Data')->__('Action'); ?></th> + </tr> + </thead> + <tbody id="<?php echo $_htmlId; ?>_container"></tbody> + <tfoot> + <tr> + <td <?php if (!$_showWebsite): ?>style="display: none;"<?php endif; ?>></td> + <td colspan="4" class="a-right"><?php echo $this->getAddButtonHtml(); ?></td> + </tr> + </tfoot> + </table> + +<script type="text/javascript"> +//<![CDATA[ +var groupPriceRowTemplate = '<tr>' + + '<td<?php if (!$_showWebsite): ?> style="display:none"<?php endif; ?>>' + + '<select class="<?php echo $_htmlClass; ?> required-entry" name="<?php echo $_htmlName; ?>[{{index}}][website_id]" id="group_price_row_{{index}}_website">' + <?php foreach ($this->getWebsites() as $_websiteId => $_info) : ?> + + '<option value="<?php echo $_websiteId; ?>"><?php echo $this->jsQuoteEscape($this->escapeHtml($_info['name'])); ?><?php if (!empty($_info['currency'])) : ?> [<?php echo $this->escapeHtml($_info['currency']); ?>]<?php endif; ?></option>' + <?php endforeach; ?> + + '</select></td>' + + '<td><select class="<?php echo $_htmlClass; ?> custgroup required-entry" name="<?php echo $_htmlName; ?>[{{index}}][cust_group]" id="group_price_row_{{index}}_cust_group">' + <?php foreach ($this->getCustomerGroups() as $_groupId => $_groupName): ?> + + '<option value="<?php echo $_groupId; ?>"><?php echo $this->jsQuoteEscape($this->escapeHtml($_groupName)); ?></option>' + <?php endforeach; ?> + + '</select></td>' + + '<td><input class="<?php echo $_htmlClass; ?> required-entry <?php echo $_priceValueValidation; ?>" type="text" name="<?php echo $_htmlName; ?>[{{index}}][price]" value="{{price}}" id="group_price_row_{{index}}_price" /></td>' + + '<td class="last"><input type="hidden" name="<?php echo $_htmlName; ?>[{{index}}][delete]" class="delete" value="" id="group_price_row_{{index}}_delete" />' + + '<button title="<?php echo Mage::helper('Mage_Catalog_Helper_Data')->__('Delete Group Price'); ?>" type="button" class="scalable delete icon-btn delete-product-option" id="group_price_row_{{index}}_delete_button" onclick="return groupPriceControl.deleteItem(event);">' + + '<span><?php echo Mage::helper('Mage_Catalog_Helper_Data')->__('Delete'); ?></span></button></td>' + + '</tr>'; + +var groupPriceControl = { + template: new Template(groupPriceRowTemplate, new RegExp('(^|.|\\r|\\n)({{\\s*(\\w+)\\s*}})', '')), + itemsCount: 0, + addItem : function () { + <?php if ($_readonly): ?> + if (arguments.length < 3) { + return; + } + <?php endif; ?> + var data = { + website_id: '<?php echo $this->getDefaultWebsite(); ?>', + group: '<?php echo $this->getDefaultCustomerGroup(); ?>', + price: '', + readOnly: false, + index: this.itemsCount++ + }; + + if(arguments.length >= 3) { + data.website_id = arguments[0]; + data.group = arguments[1]; + data.price = arguments[2]; + } + if (arguments.length == 4) { + data.readOnly = arguments[3]; + } + + Element.insert($('<?php echo $_htmlId; ?>_container'), { + bottom : this.template.evaluate(data) + }); + + $('group_price_row_' + data.index + '_cust_group').value = data.group; + $('group_price_row_' + data.index + '_website').value = data.website_id; + + <?php if ($this->isShowWebsiteColumn() && !$this->isAllowChangeWebsite()): ?> + var websiteElement = $('group_price_row_' + data.index + '_website'); + var websiteCaption = websiteElement.options[websiteElement.selectedIndex].text; + + websiteElement.insert({after:'<span class="website-name">' + websiteCaption + '</span>'}); + websiteElement.hide(); + <?php endif;?> + + if (data.readOnly == '1') { + ['website', 'cust_group', 'price', 'delete'].each(function(element_suffix) { + $('group_price_row_' + data.index + '_' + element_suffix).disabled = true; + }); + $('group_price_row_' + data.index + '_delete_button').hide(); + } + + <?php if ($_readonly): ?> + $('<?php echo $_htmlId; ?>_container').select('input', 'select').each(this.disableElement); + $('<?php echo $_htmlId; ?>_container').up('table').select('button').each(this.disableElement); + <?php else: ?> + $('<?php echo $_htmlId; ?>_container').select('input', 'select').each(function(element) { + Event.observe(element, 'change', element.setHasChanges.bind(element)); + }); + <?php endif; ?> + }, + disableElement: function(element) { + element.disabled = true; + element.addClassName('disabled'); + }, + deleteItem: function(event) { + var tr = Event.findElement(event, 'tr'); + if (tr) { + Element.select(tr, '.delete').each(function(element) { + element.value='1'; + }); + Element.select(tr, ['input', 'select']).each(function(element) { + element.hide(); + }); + Element.hide(tr); + Element.addClassName(tr, 'no-display template'); + } + return false; + } +}; +<?php foreach ($this->getValues() as $_item) : ?> +groupPriceControl.addItem('<?php echo $_item['website_id']; ?>', '<?php echo $_item['cust_group']; ?>', '<?php echo sprintf('%.2f', $_item['price']); ?>', <?php echo (int)!empty($_item['readonly']); ?>); +<?php endforeach; ?> +<?php if ($_readonly) : ?> +$('<?php echo $_htmlId; ?>_container').up('table').select('button') + .each(groupPriceControl.disableElement); +<?php endif; ?> +//]]> +</script> +</td></tr> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/price/tier.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/price/tier.phtml index 13c37b17c23f0dc3b111aad59f12ea7f5faebaa1..43c76b81d3c62192cfa8cc843ba5f267919f72e9 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/price/tier.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/price/tier.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /* @var $this Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Price_Tier */ @@ -80,11 +80,11 @@ var tierPriceRowTemplate = '<tr>' <?php endforeach ?> + '</select></td>' + '<td class="nobr"><input class="<?php echo $_htmlClass ?> qty required-entry validate-greater-than-zero" type="text" name="<?php echo $_htmlName ?>[{{index}}][price_qty]" value="{{qty}}" id="tier_price_row_{{index}}_qty" />' - + ' <small class="nobr"><?php echo Mage::helper("Mage_Catalog_Helper_Data")->__("and above")?></small></td>' + + ' <small class="nobr"><?php echo Mage::helper('Mage_Catalog_Helper_Data')->__("and above")?></small></td>' + '<td><input class="<?php echo $_htmlClass ?> required-entry <?php echo $_priceValueValidation ?>" type="text" name="<?php echo $_htmlName ?>[{{index}}][price]" value="{{price}}" id="tier_price_row_{{index}}_price" /></td>' + '<td class="last"><input type="hidden" name="<?php echo $_htmlName ?>[{{index}}][delete]" class="delete" value="" id="tier_price_row_{{index}}_delete" />' - + '<button title="<?php echo Mage::helper("Mage_Catalog_Helper_Data")->__("Delete Tier") ?>" type="button" class="scalable delete icon-btn delete-product-option" id="tier_price_row_{{index}}_delete_button" onclick="return tierPriceControl.deleteItem(event);">' - + '<span><?php echo Mage::helper("Mage_Catalog_Helper_Data")->__("Delete") ?></span></button></td>' + + '<button title="<?php echo Mage::helper('Mage_Catalog_Helper_Data')->__("Delete Tier") ?>" type="button" class="scalable delete icon-btn delete-product-option" id="tier_price_row_{{index}}_delete_button" onclick="return tierPriceControl.deleteItem(event);">' + + '<span><span><span><?php echo Mage::helper('Mage_Catalog_Helper_Data')->__("Delete") ?></span></span></span></button></td>' + '</tr>'; var tierPriceControl = { diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/serializer.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/serializer.phtml index 00d66f8c154256540f0296a9af01de819933d057..cf461700366601a2e2d6e39ee766d4f8a8c519c3 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/serializer.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/serializer.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/super/config.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/super/config.phtml index 409a3a0749a071a919202e96159658aae8c109f2..3af9eba4ce81f381f63f8ff53fb9e2b6fdbdf457 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/super/config.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/super/config.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -72,7 +72,7 @@ </div> <div class="values-container right"> <label for="__id___label" class="bold"><?php echo Mage::helper('Mage_Catalog_Helper_Data')->__('Attribute Name:') ?></label> - <input id="__id___label" type="text" <?php if ($this->isReadonly()):?> disabled="disabled" <?php endif;?> class="input-text attribute-label required-entry template no-display" value="'{{label}}'" readonly="label" /> + <input id="__id___label" type="text" <?php if ($this->isAttributesConfigurationReadonly()): ?> disabled="disabled" <?php endif;?> class="input-text attribute-label required-entry template no-display" value="'{{label}}'" readonly="label" /> <input id="__id___label_use_default" type="checkbox" value="1" " checked="use_default" class="attribute-use-default-label"> <label for="__id___label_use_default"><?php echo Mage::helper('Mage_Catalog_Helper_Data')->__('Use default')?> ('{{store_label}}')</label> <ul class="attribute-values"> @@ -87,17 +87,17 @@ <div class="attribute-values-container-main"> <div class="attribute-values-container left"> <?php echo Mage::helper('Mage_Catalog_Helper_Data')->__('Price:') ?> - <input id="__id___pricing" type="text" <?php if ($this->isReadonly() || $this->getCanEditPrice() === false):?> disabled="disabled" <?php endif;?> class="input-text attribute-price validate-number template no-display" value="'{{pricing_value}}'"/> + <input id="__id___pricing" type="text" <?php if ($this->isAttributesPricesReadonly() || $this->getCanEditPrice() === false): ?> disabled="disabled" <?php endif;?> class="input-text attribute-price validate-number template no-display" value="'{{pricing_value}}'"/> </div> <div class="attribute-values-container left"> - <select class="attribute-price-type" id="__id___price_type" <?php if ($this->isReadonly() || $this->getCanEditPrice() === false):?> disabled="disabled" <?php endif;?>> + <select class="attribute-price-type" id="__id___price_type" <?php if ($this->isAttributesPricesReadonly() || $this->getCanEditPrice() === false): ?> disabled="disabled" <?php endif;?>> <option value="0"><?php echo Mage::helper('Mage_Catalog_Helper_Data')->__('Fixed') ?></option> <option value="1"><?php echo Mage::helper('Mage_Catalog_Helper_Data')->__('Percentage') ?></option> </select> </div> <?php if ($this->getShowUseDefaultPrice()):?> <div class="attribute-values-container"> - <input id="__id___default" type="checkbox" <?php if ($this->isReadonly() || $this->getCanEditPrice() === false):?> disabled="disabled" <?php endif;?> class="attribute-use-default-value"> <label for="__id___default" class="normal"><?php echo Mage::helper('Mage_Catalog_Helper_Data')->__('Use Default Value') ?></label> + <input id="__id___default" type="checkbox" <?php if ($this->isAttributesPricesReadonly() || $this->getCanEditPrice() === false): ?> disabled="disabled" <?php endif;?> class="attribute-use-default-value"> <label for="__id___default" class="normal"><?php echo Mage::helper('Mage_Catalog_Helper_Data')->__('Use Default Value') ?></label> </div> <?php endif;?> <?php else : ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/websites.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/websites.phtml index e68873d54a020610fbd31fbf7ce1c80e8fb0e92e..721bd19a37fa46b6d55aa7aec742dec57289528f 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/websites.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/websites.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -38,6 +38,7 @@ </li> </ul> <?php endif; ?> + <?php echo $this->getHintHtml() ?> <?php foreach ($this->getWebsiteCollection() as $_website): ?> <div> <div class="website-name"> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/helper/gallery.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/helper/gallery.phtml index f956dfbefa8c20165d055b3c93909a62c5689cfb..f1aa4f26ad75020f1e3c8d4269bd2a3f3b24deda 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/helper/gallery.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/helper/gallery.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/js.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/js.phtml index 30495e2ca3f1497d1f60576f4a1f345529ab8268..12f3e401f3ca622b7d4599f09d07da91734808be 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/js.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/js.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/price.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/price.phtml index 67a04d5e95ee5c3f27a1d7932e33df2f04da1497..f0bb82f09f5edda485fcb581aa649936285e8fcb 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/price.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/price.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -213,13 +213,13 @@ $_inclTax = $_taxHelper->getPrice($_product, $_minimalPriceValue, $includingTax <p class="special-price"> <span class="price-label"><?php echo $this->__('Special Price:') ?></span> <span class="price-excluding-tax"> - <span class="label"><?php echo $_taxHelper->__('Excl. Tax:') ?></span> + <span class="label"><?php echo $this->helper('Mage_Tax_Helper_Data')->__('Excl. Tax:') ?></span> <span class="price" id="price-excluding-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"> <?php echo $_coreHelper->currencyByStore($_finalPrice+$_weeeTaxAmount, $_storeId, true, false) ?> </span> </span> <span class="price-including-tax"> - <span class="label"><?php echo $_taxHelper->__('Incl. Tax:') ?></span> + <span class="label"><?php echo $this->helper('Mage_Tax_Helper_Data')->__('Incl. Tax:') ?></span> <span class="price" id="price-including-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"> <?php echo $_coreHelper->currencyByStore($_finalPriceInclTax+$_weeeTaxAmount, $_storeId, true, false) ?> </span> @@ -245,7 +245,7 @@ $_inclTax = $_taxHelper->getPrice($_product, $_minimalPriceValue, $includingTax <p class="special-price"> <span class="price-label"><?php echo $this->__('Special Price:') ?></span> <span class="price-excluding-tax"> - <span class="label"><?php echo $_taxHelper->__('Excl. Tax:') ?></span> + <span class="label"><?php echo $this->helper('Mage_Tax_Helper_Data')->__('Excl. Tax:') ?></span> <span class="price" id="price-excluding-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"> <?php echo $_coreHelper->currencyByStore($_finalPrice+$_weeeTaxAmount, $_storeId, true, false) ?> </span> @@ -275,7 +275,7 @@ $_inclTax = $_taxHelper->getPrice($_product, $_minimalPriceValue, $includingTax <p class="special-price"> <span class="price-label"><?php echo $this->__('Special Price:') ?></span> <span class="price-excluding-tax"> - <span class="label"><?php echo $_taxHelper->__('Excl. Tax:') ?></span> + <span class="label"><?php echo $this->helper('Mage_Tax_Helper_Data')->__('Excl. Tax:') ?></span> <span class="price" id="price-excluding-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"> <?php echo $_coreHelper->currencyByStore($_finalPrice+$_weeeTaxAmount, $_storeId, true, false) ?> </span> @@ -305,7 +305,7 @@ $_inclTax = $_taxHelper->getPrice($_product, $_minimalPriceValue, $includingTax <p class="special-price"> <span class="price-label"><?php echo $this->__('Special Price:') ?></span> <span class="price-excluding-tax"> - <span class="label"><?php echo $_taxHelper->__('Excl. Tax:') ?></span> + <span class="label"><?php echo $this->helper('Mage_Tax_Helper_Data')->__('Excl. Tax:') ?></span> <span class="price" id="price-excluding-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"> <?php echo $_coreHelper->currencyByStore($_finalPrice, $_storeId, true, false) ?> </span> @@ -316,7 +316,7 @@ $_inclTax = $_taxHelper->getPrice($_product, $_minimalPriceValue, $includingTax </span> <?php endforeach; ?> <span class="price-including-tax"> - <span class="label"><?php echo $_taxHelper->__('Incl. Tax:') ?></span> + <span class="label"><?php echo $this->helper('Mage_Tax_Helper_Data')->__('Incl. Tax:') ?></span> <span class="price" id="price-including-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"> <?php echo $_coreHelper->currencyByStore($_finalPriceInclTax+$_weeeTaxAmount, $_storeId, true, false) ?> </span> @@ -334,7 +334,7 @@ $_inclTax = $_taxHelper->getPrice($_product, $_minimalPriceValue, $includingTax <p class="special-price"> <span class="price-label"><?php echo $this->__('Special Price:') ?></span> <span class="price-excluding-tax"> - <span class="label"><?php echo $_taxHelper->__('Excl. Tax:') ?></span> + <span class="label"><?php echo $this->helper('Mage_Tax_Helper_Data')->__('Excl. Tax:') ?></span> <span class="price" id="price-excluding-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"> <?php echo $_coreHelper->currencyByStore($_finalPrice, $_storeId, true, false) ?> </span> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/tab/alert.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/tab/alert.phtml index 07931d0e5956eb72a4552b71b432a153b49bf057..d1843d7c9f99edd57231516cb571737851430968 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/tab/alert.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/tab/alert.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/tab/inventory.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/tab/inventory.phtml index cd1bf4009b0b90d2c8aab9a4b13fe88e38f509f2..99f450f03a5e86d18589d4285ef79fbbc56fc689 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/tab/inventory.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/tab/inventory.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/widget/chooser/container.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/widget/chooser/container.phtml index beaccd822dc38486d3503f449c96b8f621705d6a..89af4ea1bb98ad9404bc2837545c7932627f8ae8 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/widget/chooser/container.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/widget/chooser/container.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/wysiwyg/js.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/wysiwyg/js.phtml index 926b55367dcf204a68b37237a4893bd7d649e446..96c56085bb4f81f0fc0f4efdf36299d7cca5d368 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/wysiwyg/js.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/catalog/wysiwyg/js.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/catalogsearch.xml b/app/code/core/Mage/Adminhtml/view/adminhtml/catalogsearch.xml index 1ccc658f2ed58f004918f1c91705fc1b0e77e7d6..f39405ee7f78fe06c83604a0990b4172e07e4f91 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/catalogsearch.xml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/catalogsearch.xml @@ -21,7 +21,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/cms.xml b/app/code/core/Mage/Adminhtml/view/adminhtml/cms.xml index 94669268012b53ef584c47e3f7319ae364fa577e..8b5fb088421985bc3f4a4d5710b52ec863b29e26 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/cms.xml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/cms.xml @@ -21,7 +21,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/cms/browser/content.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/cms/browser/content.phtml index 7466ac1ac63d40aad5fc156a29f18f41b5450359..3447515cf041a888fe6d58647350822a1a6b92cf 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/cms/browser/content.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/cms/browser/content.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/cms/browser/content/files.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/cms/browser/content/files.phtml index d99fb9c65c5fefd1525026df82e69e3ac852a642..f43abd58dee9482f7427c2946d4eb17813cb3371 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/cms/browser/content/files.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/cms/browser/content/files.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/cms/browser/content/newfolder.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/cms/browser/content/newfolder.phtml index 022cea673ef420e45279a80f6d368a0f5447c69b..10af59bd1ab228b1b8bd8c4d1467d3c40203df65 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/cms/browser/content/newfolder.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/cms/browser/content/newfolder.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/cms/browser/content/uploader.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/cms/browser/content/uploader.phtml index 8d89251209dc4d535265d86f33a2fd3db9ae86c4..14c425fe3bb25e6659c5a57afa5c394ebce0a683 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/cms/browser/content/uploader.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/cms/browser/content/uploader.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -31,9 +31,6 @@ * @see Mage_Adminhtml_Block_Cms_Wysiwyg_Images_Content_Uploader */ ?> - -<?php echo $this->helper('Mage_Adminhtml_Helper_Media_Js')->getTranslatorScript() ?> - <div id="<?php echo $this->getHtmlId() ?>" class="uploader"> <div class="buttons"> <div id="<?php echo $this->getHtmlId() ?>-install-flash" style="display:none"> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/cms/browser/js.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/cms/browser/js.phtml index 7f05ec014aaba9db7829b855387a1affb024649b..956c885129873fdefe499a393339053953037d4f 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/cms/browser/js.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/cms/browser/js.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/cms/browser/tree.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/cms/browser/tree.phtml index cfe7c6bc73ba762c6fda645ec74ecfe6ceef5aa5..f08a05fac89e29150f1ace6b6ea3878fffe4f544 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/cms/browser/tree.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/cms/browser/tree.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/cms/page/edit/form/renderer/content.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/cms/page/edit/form/renderer/content.phtml index 83479460834bd6f7b8c79df0f2f5ce6adb19b7b8..41bff8988edd5bc4a07ff8021a90f08b87dece79 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/cms/page/edit/form/renderer/content.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/cms/page/edit/form/renderer/content.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/customer.xml b/app/code/core/Mage/Adminhtml/view/adminhtml/customer.xml index 8462f32f13c6b46eb494329195b18ee94496479b..538c9f3b53b29ff461d093c22775a9b16d84a0ee 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/customer.xml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/customer.xml @@ -21,7 +21,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> @@ -57,47 +57,70 @@ <adminhtml_customer_wishlist> <block type="Mage_Adminhtml_Block_Customer_Edit_Tab_Wishlist" name="customer.wishlist.edit.tab" output="toHtml" /> </adminhtml_customer_wishlist> - + <adminhtml_customer_orders> <block type="Mage_Core_Block_Text_List" name="root" output="toHtml"> <block type="Mage_Adminhtml_Block_Customer_Edit_Tab_Orders" name="adminhtml.customer.edit.tab.orders"/> </block> </adminhtml_customer_orders> - + <adminhtml_customer_carts> <block type="Mage_Core_Block_Text_List" name="root" output="toHtml"> <block type="Mage_Adminhtml_Block_Customer_Edit_Tab_Carts" name="admin.customer.carts"/> </block> </adminhtml_customer_carts> - + <adminhtml_customer_viewcart> <block type="Mage_Core_Block_Text_List" name="root" output="toHtml"> <block type="Mage_Adminhtml_Block_Customer_Edit_Tab_View_Cart" name="admin.customer.view.cart"/> </block> </adminhtml_customer_viewcart> - + <adminhtml_customer_viewwishlist> <block type="Mage_Core_Block_Text_List" name="root" output="toHtml"> <block type="Mage_Adminhtml_Block_Customer_Edit_Tab_View_Wishlist" name="admin.customer.view.wishlist"/> </block> </adminhtml_customer_viewwishlist> - + <adminhtml_customer_lastorders> <block type="Mage_Core_Block_Text_List" name="root" output="toHtml"> <block type="Mage_Adminhtml_Block_Customer_Edit_Tab_View_Orders" name="admin.customer.lastorders"/> </block> </adminhtml_customer_lastorders> - + <adminhtml_customer_productreviews> <block type="Mage_Core_Block_Text_List" name="root" output="toHtml"> <block type="Mage_Adminhtml_Block_Customer_Edit_Tab_Reviews" name="admin.customer.reviews"/> </block> </adminhtml_customer_productreviews> - + <adminhtml_customer_producttags> <block type="Mage_Core_Block_Text_List" name="root" output="toHtml"> <block type="Mage_Adminhtml_Block_Customer_Edit_Tab_Tag" name="admin.customer.tags"/> </block> </adminhtml_customer_producttags> - + + <adminhtml_customer_taggrid> + <block type="Mage_Core_Block_Text_List" name="root" output="toHtml"> + <block type="Mage_Adminhtml_Block_Customer_Edit_Tab_Tag" name="admin.customer.tags"/> + </block> + </adminhtml_customer_taggrid> + + <adminhtml_customer_newsletter> + <block type="Mage_Core_Block_Text_List" name="root" output="toHtml"> + <block type="Mage_Adminhtml_Block_Customer_Edit_Tab_Newsletter_Grid" name="admin.customer.newsletter.grid"/> + </block> + </adminhtml_customer_newsletter> + + <adminhtml_customer_grid> + <block type="Mage_Core_Block_Text_List" name="root" output="toHtml"> + <block type="Mage_Adminhtml_Block_Customer_Grid" name="admin.customer.grid"/> + </block> + </adminhtml_customer_grid> + + <adminhtml_customer_cart> + <block type="Mage_Core_Block_Text_List" name="root" output="toHtml"> + <block type="Mage_Adminhtml_Block_Customer_Edit_Tab_Cart" name="admin.customer.view.edit.cart" /> + </block> + </adminhtml_customer_cart> </layout> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/customer/edit/js.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/customer/edit/js.phtml index 90a187665fefcb14f913a81dd536afe2700f5a59..24e7c31dc6a330ff5cd8fa022cf93090736110df 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/customer/edit/js.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/customer/edit/js.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/customer/edit/tab/account/form/renderer/group.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/customer/edit/tab/account/form/renderer/group.phtml new file mode 100644 index 0000000000000000000000000000000000000000..36684c8912fa36d7d34802734e6e4a2b54ea8d63 --- /dev/null +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/customer/edit/tab/account/form/renderer/group.phtml @@ -0,0 +1,52 @@ +<?php +/** + * Magento + * + * 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_AFL.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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category design + * @package default_default + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +?> +<?php +$_element = $this->getElement(); +$_note = $_element->getNote(); +$_trId = $_element->getHtmlContainerId(); +$_class = $_element->getFieldsetHtmlClass(); +?> +<?php if (!$_element->getNoDisplay()): ?> +<tr<?php if ($_trId): ?> id="<?php echo $_trId; ?>"<?php endif; ?>> + <?php if ($_element->getType() == 'hidden'): ?> + <td colspan="2" class="hidden"><?php echo trim($_element->getElementHtml()); ?></td> + <?php else: ?> + <td class="label<?php echo $_class ? " {$_class}-label" : ''; ?>"><?php echo trim($_element->getLabelHtml()); ?></td> + <td class="<?php echo $_element->hasValueClass() ? $_element->getValueClass() : 'value'; ?><?php echo $_class ? " {$_class}-value" : ''; ?>"> + <?php echo trim($_element->getElementHtml()); ?> + <?php if ($this->getDisableAutoGroupChangeAttribute()): ?> + <br/> + <input id="<?php echo $this->escapeHtml($this->getDisableAutoGroupChangeCheckboxElementId()); ?>" name="<?php echo $this->escapeHtml($this->getDisableAutoGroupChangeCheckboxElementName()); ?>" type="checkbox"<?php if ($this->getDisableAutoGroupChangeCheckboxState() == 'checked') :?> checked="checked"<?php endif; ?> value="1"/> + <label for="<?php echo $this->escapeHtml($this->getDisableAutoGroupChangeCheckboxElementId()); ?>"><?php echo $this->escapeHtml($this->getDisableAutoGroupChangeCheckboxLabel()); ?></label> + <?php endif; ?> + <?php if ($_note): ?> + <p class="note<?php echo $_class ? " {$_class}-note" : ''; ?>" id="note_<?php echo $_element->getId(); ?>"><span><?php echo $_note; ?></span></p> + <?php endif ?> + </td> + <?php endif; ?> +</tr> +<?php endif; ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/customer/edit/tab/view/grid/item.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/customer/edit/tab/view/grid/item.phtml index 7fce785e0def1d74f51458869e3f7ed9f8566617..7dab73d693da3d527a9e723080fe70704cecaea2 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/customer/edit/tab/view/grid/item.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/customer/edit/tab/view/grid/item.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/customer/online.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/customer/online.phtml index 73361bed99f44c5df8d39223d2f25c53967cff1b..33d669557d008c47bd2621e62a2ccb39b880579f 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/customer/online.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/customer/online.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/customer/sales/order/create/address/form/renderer/vat.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/customer/sales/order/create/address/form/renderer/vat.phtml new file mode 100644 index 0000000000000000000000000000000000000000..89299ce938cfd7ebf734aa8789a7a80ebb22215f --- /dev/null +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/customer/sales/order/create/address/form/renderer/vat.phtml @@ -0,0 +1,52 @@ +<?php +/** + * Magento + * + * 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_AFL.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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category design + * @package default_default + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +?> +<?php +$_element = $this->getElement(); +$_note = $_element->getNote(); +$_trId = $_element->getHtmlContainerId(); +$_class = $_element->getFieldsetHtmlClass(); +$_validateButton = $this->getValidateButton(); +?> +<?php if (!$_element->getNoDisplay()): ?> +<tr<?php if($_trId): ?> id="<?php echo $_trId; ?>"<?php endif; ?>> + <?php if ($_element->getType()=='hidden'): ?> + <td colspan="2" class="hidden"><?php echo trim($_element->getElementHtml()); ?></td> + <?php else: ?> + <td class="label<?php echo $_class ? " {$_class}-label" : ''?>"><?php echo trim($_element->getLabelHtml()); ?></td> + <td class="<?php echo $_element->hasValueClass() ? $_element->getValueClass() : 'value'; ?><?php echo $_class ? " {$_class}-value" : ''; ?>"> + <?php echo trim($_element->getElementHtml()); ?> + <?php if ($_note): ?> + <p class="note<?php echo $_class ? " {$_class}-note" : ''; ?>" id="note_<?php echo $_element->getId(); ?>"><span><?php echo $_note; ?></span></p> + <?php endif; ?> + <div class="validate-vat"> + <?php echo $_validateButton->toHtml(); ?> + </div> + </td> + <?php endif; ?> + +</tr> +<?php endif; ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/customer/system/config/validatevat.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/customer/system/config/validatevat.phtml new file mode 100644 index 0000000000000000000000000000000000000000..f31b51554e15bc60ba009d6ad48bae567f838211 --- /dev/null +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/customer/system/config/validatevat.phtml @@ -0,0 +1,65 @@ +<?php +/** + * Magento + * + * 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_AFL.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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category design + * @package default_default + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +?> +<?php +/** + * @see Mage_Adminhtml_Block_Customer_System_Config_Validatevat + */ +?> +<script type="text/javascript"> +//<![CDATA[ + function validateVat() { + var elem = $('<?php echo $this->getHtmlId() ?>'); + + params = { + country: $('general_store_information_merchant_country').value, + vat: $('general_store_information_merchant_vat_number').value + }; + + new Ajax.Request('<?php echo $this->getAjaxUrl() ?>', { + parameters: params, + onSuccess: function(response) { + result = '<?php echo $this->__('VAT Number is Invalid') ?>'; + try { + response = response.responseText; + if (response == 1) { + result = '<?php echo $this->__('VAT Number is Valid') ?>'; + elem.removeClassName('fail').addClassName('success') + } else { + elem.removeClassName('success').addClassName('fail') + } + } catch (e) { + elem.removeClassName('success').addClassName('fail') + } + $('validation_result').update(result); + } + }); + } +//]]> +</script> +<button onclick="javascript:validateVat(); return false;" class="scalable" type="button" id="<?php echo $this->getHtmlId() ?>"> + <span id="validation_result"><?php echo $this->escapeHtml($this->getButtonLabel()) ?></span> +</button> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/customer/tab/addresses.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/customer/tab/addresses.phtml index ea1892f5919e466bb3e99ce63b4e04fc48a4793e..ced2f290bacbd9ff51fd6ac692449fe8ca9f7f77 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/customer/tab/addresses.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/customer/tab/addresses.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -406,8 +406,12 @@ addressesModel.prototype = { var html = this.itemContentTemplate.evaluate(data); html = html.replace(new RegExp('(<br\\s*/?>\\s*){2,}','img'),'<br/>'); html = html.replace(new RegExp('<br\\s*/?>(\\s*,){1,}\\s*<br\\s*/?>','ig'),'<br/>'); + html = html.replace(new RegExp('<br\\s*/?>(\\s*,){1,}(.*)<br\\s*/?>','ig'),'<br/>$2<br/>'); + html = html.replace(new RegExp('<br\\s*/?>(.*?)(,\\s*){1,}<br\\s*/?>','ig'),'<br/>$1<br/>'); + html = html.replace(new RegExp('<br\\s*/?>(.*?)(,\\s*){2,}(.*?)<br\\s*/?>','ig'),'<br/>$1, $3<br/>'); html = html.replace(new RegExp('t:\\s*<br\\s*/?>','ig'),''); - html = html.replace(new RegExp('f:\\s*$','ig'),''); + html = html.replace(new RegExp('f:\\s*<br\\s*/?>','ig'),''); + html = html.replace(new RegExp('vat:\\s*$','ig'),''); itemContainer[0].innerHTML = html; } } diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/customer/tab/cart.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/customer/tab/cart.phtml index bb337528fa7c0b1285f459378ab1df0d71ca9b60..671f37952df05132230472ea5b0f413c02727db8 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/customer/tab/cart.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/customer/tab/cart.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/customer/tab/newsletter.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/customer/tab/newsletter.phtml index 1e3ddc990e7a4294461145774e3b125a9ade79d8..fa2b24de4bfcaa4ff8c1b8f876485842fc8e5975 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/customer/tab/newsletter.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/customer/tab/newsletter.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/customer/tab/view.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/customer/tab/view.phtml index 73f151e3b85de1e650758236060e3255b898cfb1..9a61d3e3e33ef14609372df640add380d90dff7e 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/customer/tab/view.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/customer/tab/view.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/customer/tab/view/sales.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/customer/tab/view/sales.phtml index 06bff3a25e77fd27a65a306f4e250bb3ee6d5a9a..3ab79a2dd9cfc396f203fc3c5247a81bc96203e8 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/customer/tab/view/sales.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/customer/tab/view/sales.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/customer/tab/wishlist.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/customer/tab/wishlist.phtml index d256d33ef2ba21985cb54e654f08c6963f20b237..f6b2343f259fc11dc159d85a90745a7c54593298 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/customer/tab/wishlist.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/customer/tab/wishlist.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/dashboard/graph.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/dashboard/graph.phtml index 673ed1ada35b369fd3ac43c49da7c148dae3a196..aac9ce29fec4b19d97fe5b1226c7ae0cc2af3135 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/dashboard/graph.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/dashboard/graph.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /* diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/dashboard/graph/disabled.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/dashboard/graph/disabled.phtml index 5acb9197f1cbf5ecb201b6efaad69fbe363ee2c5..3d6dc96e00e0015697d642fdd863e1dbed00e499 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/dashboard/graph/disabled.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/dashboard/graph/disabled.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/dashboard/grid.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/dashboard/grid.phtml index 305a2ceb24759f27e81ee4beadf8afcfadc02648..a636859def2910c60b4f2e2f115c4f48aac3e960 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/dashboard/grid.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/dashboard/grid.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/dashboard/index.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/dashboard/index.phtml index 588504bd14b39d939efd9698c6fd5c8ff8d4d5c6..1f302d5e2cfc0a282985fd3e49f0ba72b9137ac9 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/dashboard/index.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/dashboard/index.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/dashboard/salebar.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/dashboard/salebar.phtml index ca849d1ec2d8b26dbcdeed55cc5f21e6892379a6..c41191acae65b784d8cfcea78e80ca876e982dec 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/dashboard/salebar.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/dashboard/salebar.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/dashboard/searches.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/dashboard/searches.phtml index 02928d05340473eb9354a6c8b4c322548c42c856..46fd0230011e36d4767ba94642c9d4c13600f5f4 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/dashboard/searches.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/dashboard/searches.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/dashboard/store/switcher.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/dashboard/store/switcher.phtml index 52c1d4daeb758ea7419e328a9571e8e7a98795b8..d991bd23a4c359725ccfdd67bfda8a5f9a781c2a 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/dashboard/store/switcher.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/dashboard/store/switcher.phtml @@ -20,11 +20,12 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> -<p class="switcher"><label for="store_switcher"><?php echo $this->__('View Statistics For') ?>:</label> +<p class="switcher"><label for="store_switcher"><?php echo $this->__('View Statistics For:') ?></label> +<?php echo $this->getHintHtml() ?> <select name="store_switcher" id="store_switcher" class="left-col-block" onchange="return switchStore(this);"> <option value=""><?php echo $this->__('All Websites') ?></option> <?php foreach ($this->getWebsiteCollection() as $_website): ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/dashboard/totalbar.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/dashboard/totalbar.phtml index f3c124c83124b02358a0f9c3e47e714ed0c5f552..e479afbad802f0e2aa2527c4ad6f6d2a87856a44 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/dashboard/totalbar.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/dashboard/totalbar.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/dataflow.xml b/app/code/core/Mage/Adminhtml/view/adminhtml/dataflow.xml index 0d9c0ae00d98fdc2341885b0d9c601b4418180b5..0ea564b913a4dcd1d5deabe512d212227b512efd 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/dataflow.xml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/dataflow.xml @@ -21,7 +21,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/email/order/items.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/email/order/items.phtml index 49e84c84da1ba06270e05db9bf9b6345005f57dc..1fc426f7c0be97229dd65d47686d90ab117c191c 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/email/order/items.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/email/order/items.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/main.xml b/app/code/core/Mage/Adminhtml/view/adminhtml/main.xml index 59a4e85a0ffba260198f241b0c62efd37b048261..76a1a9e968cbbd619ca97c6598da18eaeecf1881 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/main.xml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/main.xml @@ -21,7 +21,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ @@ -56,6 +56,8 @@ Default layout, loads most of the pages <block type="Mage_Adminhtml_Block_Page_Head" name="head" as="head" template="page/head.phtml"> <action method="setTitle" translate="title"><title>Magento Admin</title></action> <action method="addJs"><file>prototype/prototype.js</file></action> + <action method="addJs"><file>mage/adminhtml/fix-extjs-defer.js</file><params/><if/><condition>can_load_ext_js</condition></action> + <action method="addJs"><file>mage/adminhtml/fix-extjs-defer-before.js</file><params/><if/><condition>can_load_ext_js</condition></action> <action method="addJs"><file>prototype/window.js</file></action> <action method="addJs"><file>scriptaculous/builder.js</file></action> <action method="addJs"><file>scriptaculous/effects.js</file></action> @@ -110,6 +112,8 @@ Default layout, loads most of the pages <!--<update handle="formkey"/> this won't work, see the try/catch and a jammed exception in Mage_Core_Model_Layout::createBlock() --> <block type="Mage_Core_Block_Template" name="formkey" as="formkey" template="Mage_Adminhtml::admin/formkey.phtml"/> + + <!-- deprecated since 1.7.0.0 see Mage_Page_Block_Js_Translate --> <block type="Mage_Page_Block_Js_Translate" name="js_translate" as="js_translate" template="Mage_Adminhtml::page/js/translate.phtml"/> <block type="Mage_Core_Block_Text_List" name="left" as="left"/> <block type="Mage_Core_Block_Text_List" name="content" as="content"/> @@ -235,10 +239,24 @@ Base preview layout </block> </adminhtml_dashboard_productsviewed> + <adminhtml_index_login> + <block type="Mage_Core_Block_Text_List" name="root" output="toHtml"> + <block type="Mage_Adminhtml_Block_Template" name="content" template="admin/login.phtml"> + <block type="Mage_Core_Block_Text_List" name="form.additional.info" /> + </block> + </block> + </adminhtml_index_login> + + <adminhtml_index_forgotpassword> + <block type="Mage_Core_Block_Text_List" name="root" output="toHtml"> + <block type="Mage_Adminhtml_Block_Template" name="content" template="admin/forgotpassword.phtml"> + <block type="Mage_Core_Block_Text_List" name="form.additional.info" /> + </block> + </block> + </adminhtml_index_forgotpassword> <!-- Empty hanle for ajax response etc. --> <empty> </empty> - </layout> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/media/editor.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/media/editor.phtml index 9afe134cc4f0742e837dab935f912bfd8d2b7c28..0eb6f7f13c142632f62ae26dec1900658edb3f53 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/media/editor.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/media/editor.phtml @@ -20,14 +20,13 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> <?php echo $this->helper('Mage_Adminhtml_Helper_Media_Js')->includeScript('lib/flex.js') ?> <?php echo $this->helper('Mage_Adminhtml_Helper_Media_Js')->includeScript('lib/FABridge.js') ?> <?php echo $this->helper('Mage_Adminhtml_Helper_Media_Js')->includeScript('mage/adminhtml/image.js') ?> -<?php echo $this->helper('Mage_Adminhtml_Helper_Media_Js')->getTranslatorScript() ?> <div id="<?php echo $this->getHtmlId() ?>" class="editor" style="width:100%; height:100%;"> <div class="buttons" style="margin-bottom: 20px;"> <?php echo $this->getRotatecwButtonHtml() ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/media/uploader.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/media/uploader.phtml index 65422810a0e162c8e8c11ac22eb77c01fbb54b4c..21a608bb47fa5dba401d2d2c6b431aff059b84f1 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/media/uploader.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/media/uploader.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -33,8 +33,6 @@ <?php echo $this->helper('Mage_Adminhtml_Helper_Media_Js')->includeScript('lib/flex.js') ?> <?php echo $this->helper('Mage_Adminhtml_Helper_Media_Js')->includeScript('mage/adminhtml/flexuploader.js') ?> <?php echo $this->helper('Mage_Adminhtml_Helper_Media_Js')->includeScript('lib/FABridge.js') ?> -<?php echo $this->helper('Mage_Adminhtml_Helper_Media_Js')->getTranslatorScript() ?> - <div id="<?php echo $this->getHtmlId() ?>" class="uploader"> <div class="buttons"> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/newsletter.xml b/app/code/core/Mage/Adminhtml/view/adminhtml/newsletter.xml index c6f84dff7bdc44775b610f07cd542d34621732ab..b8cda057b2955345cafa514c3418341746491c73 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/newsletter.xml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/newsletter.xml @@ -21,7 +21,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/newsletter/preview/iframeswitcher.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/newsletter/preview/iframeswitcher.phtml index ba7fc16faac94b2c49dc637fd482e690601f05c1..f9182aff4331c07ffe2b2b5f476e96496704037e 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/newsletter/preview/iframeswitcher.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/newsletter/preview/iframeswitcher.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -41,7 +41,7 @@ <?php if (!Mage::app()->isSingleStoreMode()) :?> <p class="switcher"> <?php echo $this->getChildHtml('store_switcher') ?> - <button class="button" onclick="preview();"><span><?php echo $this->__('Preview'); ?></span></button> + <button class="button" onclick="preview();"><span><span><span><?php echo $this->__('Preview'); ?></span></span></span></button> </p> <?php endif;?> </div> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/newsletter/preview/store.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/newsletter/preview/store.phtml index 713a9537cc33b308af1431284de4d0fd3dcb991f..06cd2bb8f7c3e98f3694cfe88fc6d9d6c19464f4 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/newsletter/preview/store.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/newsletter/preview/store.phtml @@ -20,13 +20,13 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> <?php if ($websites = $this->getWebsites()): ?> -<label for="store_switcher"><?php echo $this->__('Choose Store View') ?>:</label> +<label for="store_switcher"><?php echo $this->__('Choose Store View:') ?></label> <select name="store_switcher" id="store_switcher"> <?php foreach ($websites as $website): ?> <?php $showWebsite=false; ?> @@ -49,6 +49,7 @@ <?php endforeach; ?> <?php endforeach; ?> </select> +<?php echo $this->getHintHtml() ?> <script type="text/javascript"> //<![CDATA[ Event.observe($('store_switcher'), 'change', function(event) { diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/newsletter/problem/list.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/newsletter/problem/list.phtml index 0c393ebc5182bf8e883a19a1406bb5b2fb7cddfa..a8b0c3aab96622ed48199dca8608b5c467c94b49 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/newsletter/problem/list.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/newsletter/problem/list.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/newsletter/queue/edit.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/newsletter/queue/edit.phtml index b2fbc3948f53fe4ff03a1695f029f92f81233835..36a7cf63c8c45e3157d98afb71c19e8083a9e3d4 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/newsletter/queue/edit.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/newsletter/queue/edit.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /* @var $this Mage_Adminhtml_Block_Newsletter_Queue_Edit */ diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/newsletter/queue/list.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/newsletter/queue/list.phtml index 5e42e56cca2b0d6de8d1e40f5ab81a968ae37861..7d94fde3c5e84fed321169f60f5df2dd79c491e5 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/newsletter/queue/list.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/newsletter/queue/list.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/newsletter/queue/preview.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/newsletter/queue/preview.phtml index 59c5469ca1c3854b195e79407722e7aa2d1b6460..c5ff4ba60b90d162c1ef09e176e78bd390daadd8 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/newsletter/queue/preview.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/newsletter/queue/preview.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/newsletter/subscriber/list.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/newsletter/subscriber/list.phtml index 31ee9eaf35c651de06980734897eef58fe20a24d..b23ba77d167fb4cc12a05087de37c4c9884186e6 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/newsletter/subscriber/list.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/newsletter/subscriber/list.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -41,7 +41,7 @@ <option value="<?php echo $_queue['value'] ?>"><?php echo $_queue['label'] ?> #<?php echo $_queue['value'] ?></option> <?php endforeach; ?> </select> - <button class="scalable" onclick="subscriberController.addToQueue();"><span><?php echo Mage::helper('Mage_Newsletter_Helper_Data')->__('Add to Queue'); ?></span></button> + <button class="scalable" onclick="subscriberController.addToQueue();"><span><span><span><?php echo Mage::helper('Mage_Newsletter_Helper_Data')->__('Add to Queue'); ?></span></span></span></button> </div> <?php endif ?> <script type="text/javascript"> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/newsletter/template/edit.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/newsletter/template/edit.phtml index 34bcce405cdd8fa5d22fe747c8e2c2712adb201e..518a23e8417e3cd3466a7e7d170853e6de384871 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/newsletter/template/edit.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/newsletter/template/edit.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /* @var $this Mage_Adminhtml_Block_Newsletter_Template_Edit */ diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/newsletter/template/list.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/newsletter/template/list.phtml index be2cb3de9a1d72eeda82cf532dbc086e35af7b96..cdfb6787034ae3619a6b08c8b73855b735f3246f 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/newsletter/template/list.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/newsletter/template/list.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -29,7 +29,7 @@ <tr> <td style="width:50%;"><h3 class="icon-head head-newsletter-list"><?php echo $this->getHeaderText() ?></h3></td> <td class="form-buttons"> - <button class="scalable add" onclick="window.location='<?php echo $this->getCreateUrl() ?>'"><span><?php echo Mage::helper('Mage_Newsletter_Helper_Data')->__('Add New Template'); ?></span></button> + <button class="scalable add" onclick="window.location='<?php echo $this->getCreateUrl() ?>'"><span><span><span><?php echo Mage::helper('Mage_Newsletter_Helper_Data')->__('Add New Template'); ?></span></span></span></button> </td> </tr> </table> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/newsletter/template/preview.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/newsletter/template/preview.phtml index 59c5469ca1c3854b195e79407722e7aa2d1b6460..c5ff4ba60b90d162c1ef09e176e78bd390daadd8 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/newsletter/template/preview.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/newsletter/template/preview.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/notification/baseurl.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/notification/baseurl.phtml index 761a9b0c790836a569d21406b4854a7e91427527..b662d2c12a1e44beaf2b0fed48283e118c82e4db 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/notification/baseurl.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/notification/baseurl.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /** diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/notification/security.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/notification/security.phtml index 334c3fbd98f0161398ed102b1cedb7ed04ca628c..b1d6d4d84509f32fef81617fe4e4f604fdf06b50 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/notification/security.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/notification/security.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /** diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/notification/survey.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/notification/survey.phtml index 24b04cfc1e85080c5a7825b2b589efa0bd5c87f6..903bdd51b49ab5f95eafcf4a97543d2afcadca42 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/notification/survey.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/notification/survey.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/notification/toolbar.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/notification/toolbar.phtml index 3fa5fc3ba1cbb05be8269e81b071c21f23c0382e..7c5b2e1836544de0b1756ae39d7bb554fc88a31b 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/notification/toolbar.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/notification/toolbar.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -59,10 +59,7 @@ $latestNoticeUrl = $this->getLatestNoticeUrl(); ?> <?php /* - <span class="f-right"><?php echo $this->__('You have %s unread message(s). <a href="%s">Go to messages inbox</a>.', - $msgStats, - $this->getNoticesInboxUrl() - );?></span> + <span class="f-right"><?php echo $this->__('You have %s unread message(s). <a href="%s">Go to messages inbox</a>.', $msgStats, $this->getNoticesInboxUrl());?></span> */?> <span class="f-right"> @@ -70,12 +67,7 @@ <?php echo $this->__('You have %s unread message(s).', $msgStats) ?> <a href="<?php echo $this->getNoticesInboxUrl() ?>"><?php echo $goToBoxMessage ?></a> </span> <?php /* ********** temporary commented - <span class="f-right"><?php echo $this->__('You have %s, %s and %s unread messages. <a href="%s">Go to messages inbox</a>.', - '<span class="critical"><strong>'.$this->getCriticalCount().'</strong> '.$this->__('critical').'</span>', - '<strong>'.$this->getMajorCount().'</strong> '.$this->__('major'), - '<strong>'.$this->getMinorCount().'</strong> '.$this->__('minor'), - $this->getNoticesInboxUrl() - );?></span> + <span class="f-right"><?php echo $this->__('You have %s, %s and %s unread messages. <a href="%s">Go to messages inbox</a>.', '<span class="critical"><strong>'.$this->getCriticalCount().'</strong> '.$this->__('critical').'</span>', '<strong>'.$this->getMajorCount().'</strong> '.$this->__('major'), '<strong>'.$this->getMinorCount().'</strong> '.$this->__('minor'), $this->getNoticesInboxUrl());?></span> ******** */?> <?php if ($this->isMessageWindowAvailable()): ?> <strong class="label clickable" onclick="openMessagePopup()"> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/notification/window.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/notification/window.phtml index 4e3b40c1bb0848fbd0c56ba64de6af1beebc22d9..2545eed4a71b71e90099ab25a1d89f1f8109096c 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/notification/window.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/notification/window.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/page/footer.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/page/footer.phtml index 14e81f6bf9f77d562ee0381791a1dd037a1f9b9e..5a828b19d82c10650c1a2d6516759920ba68badc 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/page/footer.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/page/footer.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/page/head.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/page/head.phtml index 3c8c18c2683bc7e2b673f2e8890ffa07d4bc547c..4f1bc8bec20be733fd3de4b943f25e9de921fbf5 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/page/head.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/page/head.phtml @@ -20,13 +20,11 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> <meta http-equiv="Content-Type" content="<?php echo $this->getContentType() ?>"/> -<?php if($this->getCanLoadTinyMce()): ?> -<?php endif; ?> <title><?php echo htmlspecialchars(html_entity_decode($this->getTitle())) ?></title> <link rel="icon" href="<?php echo $this->getSkinUrl('Mage_Page::favicon.ico') ?>" type="image/x-icon"/> <link rel="shortcut icon" href="<?php echo $this->getSkinUrl('Mage_Page::favicon.ico') ?>" type="image/x-icon"/> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/page/header.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/page/header.phtml index 7b3e67d0bfc8cdb48aec70e2c72ec2f251b6f39b..625d5500d1eab4f4efa79352633576b5ec574aa8 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/page/header.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/page/header.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/page/js/calendar.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/page/js/calendar.phtml index 7b3b0a19bc898ad435795c31ac91d9d53451598d..69a4a69a368c44707415c7be13635b47d4210efa 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/page/js/calendar.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/page/js/calendar.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ // no notice of license for now diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/page/js/translate.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/page/js/translate.phtml index 002f3e73a7750d439d5eb321c261292bc7ebb0d5..99ebce66f7eda5bbb3012d08d3ab3edc4ee8c6d4 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/page/js/translate.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/page/js/translate.phtml @@ -20,10 +20,17 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ - +?> + +<?php +/** + * @var $this Mage_Page_Block_Js_Translate + */ +?> +<?php $_data = array( 'Please select an option.' => $this->__('Please select an option.'), 'This is a required field.' => $this->__('This is a required field.'), @@ -52,10 +59,7 @@ $_data = array( 'Please enter valid password.' => $this->__('Please enter valid password.'), 'Please enter a number greater than 0 in this field.' => $this->__('Please enter a number greater than 0 in this field.'), 'Please enter a valid credit card number.' => $this->__('Please enter a valid credit card number.'), - 'Please wait, loading...' => $this->__('Please wait, loading...'), - /*'' => $this->__(''), - '' => $this->__(''), - '' => $this->__(''),*/ + 'Please wait, loading...' => $this->__('Please wait, loading...') ); ?> <script type="text/javascript"> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/page/menu.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/page/menu.phtml index 3287331e35c9baf1070b6ac374ab67f6ee4121f4..fae8bb3785a7478ed1f422ed5a016773aedc9869 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/page/menu.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/page/menu.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -33,7 +33,7 @@ <?php function drawMenuLevel($_menu, $_level=0) { ?> <ul <?php if(!$_level): ?>id="nav"<?php endif ?>> <?php foreach ($_menu as $_item): ?> - <li <?php if(!empty($_item['children'])): ?>onmouseover="Element.addClassName(this,'over')" onmouseout="Element.removeClassName(this,'over')"<?php endif ?> class=" <?php echo (!$_level && !empty($_item['active']))?' active':'' ?> <?php echo !empty($_item['children'])?' parent':'' ?><?php echo (!empty($_level) && !empty($_item['last']))?' last':'' ?> level<?php echo $_level ?>"> <a href="<?php echo $_item['url'] ?>" <?php if(!empty($_item['title'])): ?>title="<?php echo $_item['title'] ?>"<?php endif ?> <?php if(!empty($_item['click'])): ?>onclick="<?php echo $_item['click']; ?>"<?php endif ?> class="<?php echo ($_level===0 && !empty($_item['active']))?'active':'' ?>"><span><?php echo $_item['label'] ?><?php if(!$_level): ?><?php endif ?></span></a> + <li <?php if(!empty($_item['children'])): ?>onmouseover="Element.addClassName(this,'over')" onmouseout="Element.removeClassName(this,'over')"<?php endif ?> class=" <?php echo (!$_level && !empty($_item['active']))?' active':'' ?> <?php echo !empty($_item['children'])?' parent':'' ?><?php echo (!empty($_level) && !empty($_item['last']))?' last':'' ?> level<?php echo $_level ?>"> <a href="<?php echo $_item['url'] ?>" <?php if(!empty($_item['title'])): ?>title="<?php echo $_item['title'] ?>"<?php endif ?> <?php if(!empty($_item['click'])): ?>onclick="<?php echo $_item['click']; ?>"<?php endif ?> class="<?php echo ($_level===0 && !empty($_item['active']))?'active':'' ?>"><span><?php echo Mage::helper('Mage_Adminhtml_Helper_Data')->escapeHtml($_item['label']); ?><?php if(!$_level): ?><?php endif ?></span></a> <?php if(!empty($_item['children'])): ?> <?php drawMenuLevel($_item['children'], $_level+1); ?> <?php endif; ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/page/notices.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/page/notices.phtml index 3fb87360c72c29504a2df63ac85c4e17843f1dca..04c26a984cdea28f1dfebab28433cb69678c6370 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/page/notices.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/page/notices.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -33,7 +33,7 @@ <noscript> <div class="noscript"> <div class="noscript-inner"> - <p><strong><?php echo $this->__('We detected that your JavaScript seem to be disabled.'); ?></strong></p> + <p><strong><?php echo $this->__('JavaScript seems to be disabled in your browser.'); ?></strong></p> <p><?php echo $this->__('You must have JavaScript enabled in your browser to utilize the functionality of this website.'); ?></p> </div> </div> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/permissions/role_users_grid_js.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/permissions/role_users_grid_js.phtml index 012d656e22cd8324056427104897c9b15de0331e..f35308cc61aaf3f02f26566aa7e26d1a2bfd8400 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/permissions/role_users_grid_js.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/permissions/role_users_grid_js.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/permissions/roleinfo.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/permissions/roleinfo.phtml index eae37f6b9e1172a5addb8fff0ba8fd9177195371..9244d32599211d8afb91e8108ef3a8ddbde932a3 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/permissions/roleinfo.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/permissions/roleinfo.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/permissions/roles.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/permissions/roles.phtml index 4713c7b0d107e78b83b5801d9e9e480d565a3df0..cebb8dcb143228424fa0e6fb686ef8a27741e304 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/permissions/roles.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/permissions/roles.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -29,7 +29,7 @@ <tr> <td style="width:50%;"><h3 class="icon-head head-permissions-role"><?php echo $this->__('Roles') ?></h3></td> <td class="form-buttons"> - <button class="scalable add" onclick="window.location='<?php echo $this->getAddNewUrl() ?>'"><span><?php echo $this->__('Add New Role') ?></span></button> + <button class="scalable add" onclick="window.location='<?php echo $this->getAddNewUrl() ?>'"><span><span><span><?php echo $this->__('Add New Role') ?></span></span></span></button> </td> </tr> </table> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/permissions/rolesedit.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/permissions/rolesedit.phtml index 8006369fa579dba917d9b50b6ca06ecc71da7b46..ca389b990bd2146ea7cb0d6df95953f918ccedcd 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/permissions/rolesedit.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/permissions/rolesedit.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/permissions/rolesusers.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/permissions/rolesusers.phtml index 3727f5c4ac917ad3f53b2f9b97bc0e47783b0c1e..e09eb58a42257849bb874ea64fe716c664d4f81d 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/permissions/rolesusers.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/permissions/rolesusers.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/permissions/user_roles_grid_js.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/permissions/user_roles_grid_js.phtml index 57a60860f8ea606db35faaa988e0946449670038..cc042e99e851ac85654518424b3f94286df3f513 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/permissions/user_roles_grid_js.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/permissions/user_roles_grid_js.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/permissions/userinfo.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/permissions/userinfo.phtml index c9be39d10b18f0e82be00e9593e119092c80d8f6..5290bbcf433cf4291634f7ad99fb1fe95b2d5832 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/permissions/userinfo.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/permissions/userinfo.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/permissions/users.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/permissions/users.phtml index da6c6b1ade69c1bcd5dfc5a0c83d9fd88a2b1974..f4df96e9efeee588891231a82c24ff00f3cc7116 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/permissions/users.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/permissions/users.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -29,7 +29,7 @@ <tr> <td style="width:50%;"><h3><?php echo $this->__('Users') ?></h3></td> <td class="a-right"> - <button class="scalable add" onclick="window.location='<?php echo $this->getAddNewUrl() ?>'"><span><?php echo $this->__('Add New User') ?></span></button> + <button class="scalable add" onclick="window.location='<?php echo $this->getAddNewUrl() ?>'"><span><span><span><?php echo $this->__('Add New User') ?></span></span></span></button> </td> </tr> </table> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/poll/answers/list.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/poll/answers/list.phtml index dfb31fa93d751effe580d2e3d4d1dc3d7226a3d2..d18db3cdb85ed3dcc47ffacafaa334da4244d1f3 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/poll/answers/list.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/poll/answers/list.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/promo.xml b/app/code/core/Mage/Adminhtml/view/adminhtml/promo.xml index 7502cf2ecd0b633ef7d84df011c35fbdd2ba0045..0db056d5f4956c16db713e090a897c91ac86f6e5 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/promo.xml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/promo.xml @@ -21,7 +21,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> @@ -73,14 +73,25 @@ <block type="Mage_Adminhtml_Block_Promo_Quote_Edit_Tab_Conditions" name="promo_quote_edit_tab_conditions"/> <block type="Mage_Adminhtml_Block_Promo_Quote_Edit_Tab_Actions" name="promo_quote_edit_tab_actions"/> <block type="Mage_Adminhtml_Block_Promo_Quote_Edit_Tab_Labels" name="promo_quote_edit_tab_labels"/> + <block type="Mage_Adminhtml_Block_Promo_Quote_Edit_Tab_Coupons" name="promo_quote_edit_tab_coupons"> + <block type="Mage_Adminhtml_Block_Promo_Quote_Edit_Tab_Coupons_Form" name="promo_quote_edit_tab_coupons_form"/> + <block type="Mage_Adminhtml_Block_Promo_Quote_Edit_Tab_Coupons_Grid" name="promo_quote_edit_tab_coupons_grid"/> + </block> <action method="addTab"><name>main_section</name><block>promo_quote_edit_tab_main</block></action> <action method="addTab"><name>conditions_section</name><block>promo_quote_edit_tab_conditions</block></action> <action method="addTab"><name>actions_section</name><block>promo_quote_edit_tab_actions</block></action> <action method="addTab"><name>labels_section</name><block>promo_quote_edit_tab_labels</block></action> + <action method="addTab"><name>coupons_section</name><block>promo_quote_edit_tab_coupons</block></action> </block> + <block type="Mage_Adminhtml_Block_Template" template="promo/salesrulejs.phtml" name="promo_quote_edit_jsinit"/> </reference> <reference name="content"> <block type="Mage_Adminhtml_Block_Promo_Quote_Edit" name="promo_quote_edit"></block> </reference> </adminhtml_promo_quote_edit> + <adminhtml_promo_quote_couponsgrid> + <block type="Mage_Core_Block_Text_List" name="root" output="toHtml"> + <block type="Mage_Adminhtml_Block_Promo_Quote_Edit_Tab_Coupons_Grid" name="promo_quote_edit_tab_coupons_grid" /> + </block> + </adminhtml_promo_quote_couponsgrid> </layout> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/promo/fieldset.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/promo/fieldset.phtml index 2327f4ebdd22be7f8c9caf22b7c9d845174bb425..403cf9e7ba21c4553c957e0f1fbfdadfba5e7ac3 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/promo/fieldset.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/promo/fieldset.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/promo/form.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/promo/form.phtml index 0690bcb2bcd85a9812546c4717dcecb0ad9cb748..1dc278b7ddf4ab9406cb119cf43bcc000ff2d8cc 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/promo/form.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/promo/form.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/promo/js.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/promo/js.phtml index e185569e585c974a4e818b0cade6e71a792a1f24..119a01a527c6a7d6fcb0fe3e10f72ca201ee8f25 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/promo/js.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/promo/js.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/promo/rules.js b/app/code/core/Mage/Adminhtml/view/adminhtml/promo/rules.js index e0c06814446d267d9ec9190f3640c1de68a9c18c..1b1ee89e24bf27b901dbe3d3c08a8aba12181003 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/promo/rules.js +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/promo/rules.js @@ -19,7 +19,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/promo/salesrulejs.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/promo/salesrulejs.phtml new file mode 100644 index 0000000000000000000000000000000000000000..ae07da53ff53c9b8309a92eb75656512c4dd746f --- /dev/null +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/promo/salesrulejs.phtml @@ -0,0 +1,113 @@ +<?php +/** + * Magento + * + * 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_AFL.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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category design + * @package default_default + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +?> +<script type="text/javascript"> +//<![CDATA[ +var couponTypeSpecific = '<?php echo Mage_SalesRule_Model_Rule::COUPON_TYPE_SPECIFIC ?>'; +var tmpButtonsActionsStorage = []; + +function disableEnableCouponsTabContent(disable) { + var containerId = 'promo_catalog_edit_tabs_coupons_section_content'; + if($(containerId)){ + var dataFields = $(containerId).select('input', 'select', 'textarea', 'button'); + for(var i = 0; i < dataFields.length; i++) { + disable ? dataFields[i].disable().addClassName('disabled') + : dataFields[i].enable().removeClassName('disabled'); + } + } + disable ? $('rule_coupon_code').enable() : $('rule_coupon_code').disable(); +} + +function handleCouponsTabContentActivity() { + disableEnableCouponsTabContent(!$('rule_use_auto_generation').checked); +} + +function handleCouponTypeChange() { + $('rule_coupon_type').observe('change', function() { + var disable = $('rule_coupon_type').value != couponTypeSpecific; + if (!disable) { + disable = !$('rule_use_auto_generation').checked; + } + disableEnableCouponsTabContent(disable); + }); +} + +function refreshCouponCodesGrid(grid, gridMassAction, transport) { + grid.reload(); +} + +function generateCouponCodes(idPrefix, generateUrl, grid) { + $(idPrefix + 'information_fieldset').removeClassName('ignore-validate'); + var validationResult = $(idPrefix + 'information_fieldset').select('input', + 'select', 'textarea').collect( function(elm) { + return Validation.validate(elm, { + useTitle :false, + onElementValidate : function() { + } + }); + }).all(); + $(idPrefix + 'information_fieldset').addClassName('ignore-validate'); + + if (!validationResult) { + return; + } + var elements = $(idPrefix + 'information_fieldset').select('input', 'select', 'textarea'); + + elements = elements.concat( + $$('#rule_uses_per_coupon'), + $$('#rule_uses_per_customer'), + $$('#rule_to_date') + ); + + var params = Form.serializeElements(elements, true); + params.form_key = FORM_KEY; + $('messages').update(); + var couponCodesGrid = eval(grid); + new Ajax.Request(generateUrl, { + parameters :params, + method :'post', + onComplete : function (transport, param){ + var response = false; + if (transport && transport.responseText) { + response = eval('(' + transport.responseText + ')'); + } + if (couponCodesGrid) { + couponCodesGrid.reload(); + } + if (response && response.messages) { + $('messages').update(response.messages); + } + if (response && response.error) { + alert(response.error); + } + } + }); +} + +document.observe("dom:loaded", handleCouponsTabContentActivity); +document.observe("dom:loaded", handleCouponTypeChange); +//]]> +</script> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/rating/detailed.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/rating/detailed.phtml index 326246b5f12eb96972898791b009fd4d8af06e16..2e7a3e66d1b214e9112ee42569040f9a659b819f 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/rating/detailed.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/rating/detailed.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/rating/options.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/rating/options.phtml index 16f00aeec545393430932bf645555d84cba6f6bc..fb644635fb72363a3c471c5883c9be5ba2c76541 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/rating/options.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/rating/options.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/rating/stars/detailed.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/rating/stars/detailed.phtml index d164d4f223f71b505a1cb579f930b8e1d958acbe..25a30e55a75c744a6716e6b2880c1282c29867d6 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/rating/stars/detailed.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/rating/stars/detailed.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/rating/stars/summary.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/rating/stars/summary.phtml index cba500ee8fb05700a26fd03b18cc52caf7ea18b2..995a5bc749e41e7b7ac8cad9c98f50da9bf00186 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/rating/stars/summary.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/rating/stars/summary.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/report.xml b/app/code/core/Mage/Adminhtml/view/adminhtml/report.xml index 1ca1aadea3625457e52ac0d6efaccf638d27da1a..d8ead1037286aa24a417e7f86c55df801835fcaf 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/report.xml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/report.xml @@ -21,7 +21,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> @@ -32,4 +32,24 @@ <block type="Mage_Adminhtml_Block_Report_Refresh_Statistics" template="report/refresh/statistics.phtml" name="sales.report.refreshstatistics" /> </reference> </adminhtml_report_statistics_index> + <adminhtml_report_product_viewed> + <reference name="messages"> + <action method="addNotice" translate="message"> + <message>This report depends on timezone configuration. Once timezone is changed, the lifetime statistics need to be refreshed.</message> + </action> + </reference> + <reference name="content"> + <block type="Mage_Adminhtml_Block_Report_Product_Viewed" template="report/grid/container.phtml" name="product.report.grid.container"> + <block type="Mage_Adminhtml_Block_Store_Switcher" template="report/store/switcher/enhanced.phtml" name="store.switcher"> + <action method="setStoreVarName"><var_name>store_ids</var_name></action> + </block> + <block type="Mage_Adminhtml_Block_Report_Filter_Form" name="grid.filter.form"> + <action method="setFieldVisibility"> + <field>report_type</field> + <visibility>0</visibility> + </action> + </block> + </block> + </reference> + </adminhtml_report_product_viewed> </layout> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/report/grid.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/report/grid.phtml index da75d61c8152c3554e0556455a76a9d32636f739..9d8497b81bf8766ab3581723531340a6642e25e9 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/report/grid.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/report/grid.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/report/grid/container.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/report/grid/container.phtml index bd98e3e9311b61c10cfa554609d28c1e0dff6b84..1f2f82301722233f537ac4e1b35e0ea3e46699ca 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/report/grid/container.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/report/grid/container.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -42,6 +42,7 @@ <?php echo $this->getGridHtml() ?> </div> <script type="text/javascript"> +//<![CDATA[ function filterFormSubmit() { var filters = $$('#filter_form input', '#filter_form select'); var elements = []; @@ -53,4 +54,5 @@ setLocation('<?php echo $this->getFilterUrl(); ?>filter/'+encode_base64(Form.serializeElements(elements))+'/'); } } +//]]> </script> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/report/refresh/statistics.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/report/refresh/statistics.phtml index c4dc32a97b6f616e19a46ed24841dcd1ec0c1148..683776eb10eac2ce57f59cb749a488d750294aec 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/report/refresh/statistics.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/report/refresh/statistics.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/report/store/switcher.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/report/store/switcher.phtml index aec031ccbb294720a164c70c2b43e2b3369e6ce2..08ea6a430fbc33382d821086edfd6d149f97bfc1 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/report/store/switcher.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/report/store/switcher.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -30,7 +30,7 @@ */ ?> <?php if ($this->isShow()): ?> -<p class="switcher"><label for="store_switcher"><?php echo $this->__('Show Report For') ?>:</label> +<p class="switcher"><label for="store_switcher"><?php echo $this->__('Show Report For:') ?></label> <select name="store_switcher" id="store_switcher" onchange="return switchStore(this);"> <option value=""><?php echo $this->__('All Websites') ?></option> <?php foreach ($this->getWebsiteCollection() as $_website): ?> @@ -55,6 +55,7 @@ <?php endforeach; ?> <?php endforeach; ?> </select> +<?php echo $this->getHintHtml() ?> </p> <script type="text/javascript"> function switchStore(obj){ diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/report/store/switcher/enhanced.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/report/store/switcher/enhanced.phtml index 7e9ff6e8a2ce47d80d3a10d67fdc103fcfa39bcd..05f9db477f537ef1e77cc1b2f0f568e7293dd053 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/report/store/switcher/enhanced.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/report/store/switcher/enhanced.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -31,7 +31,7 @@ ?> <?php if ($this->isShow()): ?> -<p class="switcher"><label for="store_switcher"><?php echo $this->__('Show Report For') ?>:</label> +<p class="switcher"><label for="store_switcher"><?php echo $this->__('Show Report For:') ?></label> <select name="store_switcher" id="store_switcher" onchange="return switchStore(this);"> <option value=""><?php echo $this->__('All Websites') ?></option> <?php foreach ($this->getWebsiteCollection() as $_website): ?> @@ -55,6 +55,7 @@ <?php endforeach; ?> <?php endforeach; ?> </select> +<?php echo $this->getHintHtml() ?> </p> <script type="text/javascript"> function switchStore(obj){ diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/report/wishlist.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/report/wishlist.phtml index 6f20cfc887eb29537a7e6a7dccc32f21ba80154d..6c4532bac301fa6b8fd5624755b322a286f652c3 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/report/wishlist.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/report/wishlist.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/review/add.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/review/add.phtml index 57673ff7676454dbc50ad3672dfb8c72cae24f09..0ddb18ac7b6b4030e900986399067f088b22f1f9 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/review/add.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/review/add.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales.xml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales.xml index a9e9207dd20b5aa19d4c59e67b77b93852352254..a3973fc77176702a326746f5e8edf5b15c77b199 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales.xml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales.xml @@ -21,7 +21,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> @@ -917,7 +917,7 @@ <block type="Mage_Adminhtml_Block_Store_Switcher" template="report/store/switcher/enhanced.phtml" name="store.switcher"> <action method="setStoreVarName"><var_name>store_ids</var_name></action> </block> - <block type="Mage_Sales_Block_Adminhtml_Report_Filter_Form" name="grid.filter.form"> + <block type="Mage_Sales_Block_Adminhtml_Report_Filter_Form_Coupon" name="grid.filter.form"> <action method="addReportTypeOption" translate="value"> <key>created_at_order</key> <value>Order Created Date</value> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/items/column/name.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/items/column/name.phtml index c7c1f4ec3cdbfa9546a89f12ed1200b7a21dc553..2f6af91b079bf49fb049169bbecdb862a07e2c83 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/items/column/name.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/items/column/name.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/items/column/qty.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/items/column/qty.phtml index c1ba8e12e3bef98648a9bf85882698855442dfd9..fa7706fee9439743e915528111313543952aa2ec 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/items/column/qty.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/items/column/qty.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/items/renderer/default.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/items/renderer/default.phtml index 762b3ffbac04de4ea5ebed01662c2c615fea7823..4d43624ffde85d205ba21fc987695b6a80c60cb0 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/items/renderer/default.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/items/renderer/default.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/address/form.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/address/form.phtml index dc6ccbab63e9508d09a17710ccac1e3378871e21..e731d795f83496123768984881a7131ecb2ae670 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/address/form.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/address/form.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/comments/view.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/comments/view.phtml index a74a9841e8c48ef8ba9c4fdfb47ab25def0515df..5abf4dd75b82935f8a7c49334d199f20ce6d1bf2 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/comments/view.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/comments/view.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/abstract.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/abstract.phtml index 3e97b6ddf5372f033b2068ee397118fe3631aeaf..a88008cb6efbc858d45d6d3282f270e16cb94e27 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/abstract.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/abstract.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/billing/method/form.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/billing/method/form.phtml index a834dff0030e7181bbd992ea0549e0bc10719902..64370824b53665747fcbd8b4ca771680e48b32dd 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/billing/method/form.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/billing/method/form.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -50,5 +50,5 @@ </div> <script type="text/javascript">order.setPaymentMethod('<?php echo $this->getSelectedMethodCode() ?>')</script> <?php else: ?> - <?php echo Mage::helper('Mage_Sales_Helper_Data')->__('No Payment Methods') ?> + <div><?php echo Mage::helper('Mage_Sales_Helper_Data')->__('No Payment Methods') ?></div> <?php endif; ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/comment.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/comment.phtml index 83fb544616227734f6ae243e62ae8f22db628c66..5c9a99c0d3d50c80ca5a95035ec9225aadc2200e 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/comment.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/comment.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/coupons/form.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/coupons/form.phtml index 9c6a0fd755dca7efbe68a5dad5c8e9d1003fae23..fe95484e613e39780e06bf86ad3f7c407cb8b4e2 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/coupons/form.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/coupons/form.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/data.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/data.phtml index b10924ff959ca1ff80a8c2796855256cc81bd7c3..576f20da91b9f3649d7c0a3bcf541c22dfbdee79 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/data.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/data.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -42,8 +42,10 @@ </td> <?php endif; ?> <td <?php if($this->getCustomerId()): ?>class="main-col"<?php endif; ?>> + <div id="order-additional_area" style="display:none" class="order-additional-area"><?php echo $this->getChildHtml('additional_area') ?></div> <div id="order-search" style="display:none" class="order-search-items"><?php echo $this->getChildHtml('search') ?></div> <div id="order-items"><?php echo $this->getChildHtml('items') ?></div> + <div id="order-errors"><?php echo $this->getChildHtml('errors') ?></div> <div id="order-form_account"><?php echo $this->getChildHtml('form_account') ?></div> <div id="order-addresses"> <div id="order-billing_address" class="box-left"><?php echo $this->getChildHtml('billing_address') ?></div> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/form.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/form.phtml index 45107eb4c3fbb2fcceffa09ad646d12f5ca33e54..052dee376b34dceb4a7f58cf5df897695d41ad37 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/form.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/form.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/form/account.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/form/account.phtml index c43ffd862ddec9964a73895a286ee3061a1a0ebb..092b6e2ca5767a49de8e16ee4100a3af7de16e8c 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/form/account.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/form/account.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/form/address.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/form/address.phtml index b5c630933e02e866acaac5d2d6a5a5d8e055ad46..5b22e27ff75b06fa6b4c6a75ca2f35cd2014977d 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/form/address.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/form/address.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ if($this->getIsShipping()): diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/giftmessage.js b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/giftmessage.js index 82e1343f209dc3c0895b33a53b7a83715563627c..5ce20bbb4a149e1b427e1b83b743131f96a72ca2 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/giftmessage.js +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/giftmessage.js @@ -19,7 +19,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/giftmessage.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/giftmessage.phtml index 6853fbbca0104d2ed302f057df4549103e156d46..7a63708413ded59a208333b095de110b393fd24f 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/giftmessage.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/giftmessage.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/items.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/items.phtml index 25633ebb61d547048cbf8251c771a85a739c6b74..b258f84955f5a66cbaf4aab538d128635fd63a71 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/items.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/items.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/items/grid.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/items/grid.phtml index 5ff91ee747abbee7216e9860d997695e2de9f6ce..5e79118db11d8d10c5ec46502995a3ec40511e2f 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/items/grid.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/items/grid.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/js.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/js.phtml index 76a868fb7edd2bc549926ae9d40cd5204d87ddef..7a7b6d92aee38345d4820d13588aa00e5f475303 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/js.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/js.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/newsletter/form.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/newsletter/form.phtml index 73359fa216f738757ae7d6a2c2d0375b0c0a8981..0bc2d60acad0b83c1a6c2f3559b0c3c1f5e4426b 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/newsletter/form.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/newsletter/form.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/scripts.js b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/scripts.js index ae7eb3f2af298e39790b9cafefa6dbde82d9701f..d046613a534d9fa9235eb3ddbb246a3b359fc90a 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/scripts.js +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/scripts.js @@ -19,7 +19,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ var AdminOrder = new Class.create(); @@ -42,6 +42,48 @@ AdminOrder.prototype = { this.giftMessageDataChanged = false; this.productConfigureAddFields = {}; this.productPriceBase = {}; + this.collectElementsValue = true; + Event.observe(window, 'load', (function(){ + this.dataArea = new OrderFormArea('data', $(this.getAreaId('data')), this); + this.itemsArea = Object.extend(new OrderFormArea('items', $(this.getAreaId('items')), this), { + addControlButton: function(button){ + var controlButtonArea = $(this.node).select('.form-buttons')[0]; + if (typeof controlButtonArea != 'undefined') { + var buttons = controlButtonArea.childElements(); + for (var i = 0; i < buttons.length; i++) { + if (buttons[i].innerHTML.include(button.label)) { + return ; + } + } + button.insertIn(controlButtonArea, 'top'); + } + } + }); + + var searchButton = new ControlButton(Translator.translate('Add Products')), + searchAreaId = this.getAreaId('search'); + searchButton.onClick = function() { + $(searchAreaId).show(); + this.remove(); + } + this.itemsArea.onLoad = this.itemsArea.onLoad.wrap(function(proceed) { + proceed(); + if (!$(searchAreaId).visible()) { + this.addControlButton(searchButton); + } + }); + this.areasLoaded(); + }).bind(this)); + }, + + areasLoaded: function(){ + }, + + itemsLoaded: function(){ + }, + + dataLoaded: function(){ + this.dataShow(); }, setLoadBaseUrl : function(url){ @@ -63,7 +105,7 @@ AdminOrder.prototype = { setCustomerAfter : function () { this.customerSelectorHide(); if (this.storeId) { - $(this.getAreaId('data')).callback = 'dataShow'; + $(this.getAreaId('data')).callback = 'dataLoaded'; this.loadArea(['data'], true); } else { @@ -219,14 +261,26 @@ AdminOrder.prototype = { } }, - disableShippingAddress : function(flag){ + disableShippingAddress : function(flag) { this.shippingAsBilling = flag; - if($('order-shipping_address_customer_address_id')) { - $('order-shipping_address_customer_address_id').disabled=flag; + if ($('order-shipping_address_customer_address_id')) { + $('order-shipping_address_customer_address_id').disabled = flag; } - if($(this.shippingAddressContainer)){ + if ($(this.shippingAddressContainer)) { var dataFields = $(this.shippingAddressContainer).select('input', 'select', 'textarea'); - for(var i=0;i<dataFields.length;i++) dataFields[i].disabled = flag; + for (var i = 0; i < dataFields.length; i++) { + dataFields[i].disabled = flag; + } + var buttons = $(this.shippingAddressContainer).select('button'); + // Add corresponding class to buttons while disabling them + for (i = 0; i < buttons.length; i++) { + buttons[i].disabled = flag; + if (flag) { + buttons[i].addClassName('disabled'); + } else { + buttons[i].removeClassName('disabled'); + } + } } }, @@ -598,13 +652,27 @@ AdminOrder.prototype = { this.showArea('data'); }, - sidebarApplyChanges : function(){ - if($(this.getAreaId('sidebar'))){ - var data = {}; - var elems = $(this.getAreaId('sidebar')).select('input'); - for(var i=0; i<elems.length; i++){ - if(elems[i].getValue()){ - data[elems[i].name] = elems[i].getValue(); + clearShoppingCart : function(confirmMessage){ + if (confirm(confirmMessage)) { + this.collectElementsValue = false; + order.sidebarApplyChanges({'sidebar[empty_customer_cart]': 1}); + } + }, + + sidebarApplyChanges : function(auxiliaryParams) { + if ($(this.getAreaId('sidebar'))) { + var data = {}; + if (this.collectElementsValue) { + var elems = $(this.getAreaId('sidebar')).select('input'); + for (var i=0; i < elems.length; i++) { + if (elems[i].getValue()) { + data[elems[i].name] = elems[i].getValue(); + } + } + } + if (auxiliaryParams instanceof Object) { + for (var paramName in auxiliaryParams) { + data[paramName] = String(auxiliaryParams[paramName]); } } data.reset_shipping = true; @@ -1056,5 +1124,125 @@ AdminOrder.prototype = { top: parentPos[1] + 'px', left: parentPos[0] + 'px' }); + }, + + validateVat: function(parameters) + { + var params = { + country: $(parameters.countryElementId).value, + vat: $(parameters.vatElementId).value + }; + + if (this.storeId !== false) { + params.store_id = this.storeId; + } + + var currentCustomerGroupId = $(parameters.groupIdHtmlId).value; + + new Ajax.Request(parameters.validateUrl, { + parameters: params, + onSuccess: function(response) { + var message = ''; + var groupChangeRequired = false; + try { + response = response.responseText.evalJSON(); + + if (true === response.valid) { + message = parameters.vatValidMessage; + if (currentCustomerGroupId != response.group) { + message = parameters.vatValidAndGroupChangeMessage; + groupChangeRequired = true; + } + } else if (response.success) { + message = parameters.vatInvalidMessage.replace(/%s/, params.vat); + } else { + message = parameters.vatValidationFailedMessage; + } + + } catch (e) { + message = parameters.vatValidationFailedMessage; + } + if (!groupChangeRequired) { + alert(message); + } + else { + this.processCustomerGroupChange(parameters.groupIdHtmlId, message, response.group); + } + }.bind(this) + }); + }, + + processCustomerGroupChange: function(groupIdHtmlId, message, groupId) + { + var currentCustomerGroupId = $(groupIdHtmlId).value; + var currentCustomerGroupTitle = $$('#' + groupIdHtmlId + ' > option[value=' + currentCustomerGroupId + ']')[0].text; + var customerGroupOption = $$('#' + groupIdHtmlId + ' > option[value=' + groupId + ']')[0]; + var confirmText = message.replace(/%s/, customerGroupOption.text); + confirmText = confirmText.replace(/%s/, currentCustomerGroupTitle); + if (confirm(confirmText)) { + $$('#' + groupIdHtmlId + ' option').each(function(o) { + o.selected = o.readAttribute('value') == groupId; + }); + this.accountGroupChange(); + } + } +}; + +var OrderFormArea = Class.create(); +OrderFormArea.prototype = { + _name: null, + _node: null, + _parent: null, + _callbackName: null, + + initialize: function(name, node, parent){ + this._name = name; + this._parent = parent; + this._callbackName = node.callback; + if (typeof this._callbackName == 'undefined') { + this._callbackName = name + 'Loaded'; + node.callback = this._callbackName; + } + parent[this._callbackName] = parent[this._callbackName].wrap((function (proceed){ + proceed(); + this.onLoad(); + }).bind(this)); + + this.setNode(node); + }, + + setNode: function(node){ + if (!node.callback) { + node.callback = this._callbackName; + } + this.node = node; + }, + + onLoad: function(){ + } +}; + +var ControlButton = Class.create(); +ControlButton.prototype = { + _label: '', + _node: null, + + initialize: function(label){ + this._label = label; + this._node = new Element('button', { + 'class': 'scalable add' + }); + }, + + onClick: function(){ + }, + + insertIn: function(element, position){ + var node = Object.extend(this._node), + content = {}; + node.observe('click', this.onClick); + node.update('<span>' + this._label + '</span>'); + content[position] = node; + Element.insert(element, content); } }; diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/shipping/method/form.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/shipping/method/form.phtml index 12adadf285b92a5158f5937dd28232108664aff6..cc67d26832048ab140defc5df5bf681c0516dcd5 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/shipping/method/form.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/shipping/method/form.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -91,7 +91,7 @@ <a href="#" onclick="order.loadShippingRates();return false"> <?php echo Mage::helper('Mage_Sales_Helper_Data')->__('Get shipping methods and rates') ?> </a> - <input type="hidden" name="order[has_shipping]" value="" class="required-entry"> + <input type="hidden" name="order[has_shipping]" value="" class="required-entry" /> </div> <?php endif; ?> <div style="display:none;" id="shipping-method-overlay" class="overlay"><span><?php echo $this->__('Shipping method selection is not applicable') ?></span></div> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/sidebar.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/sidebar.phtml index 87b28fcd872406431995d3840b4a074c1ed132d5..e81cab68e1f6ce8ce0b5e1501208cd53680f514a 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/sidebar.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/sidebar.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/sidebar/items.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/sidebar/items.phtml index 83547f2a50b6787743fddcaf6ed43f551a04be94..d524bb08db920da2efd5edeff81372c159dbbfa1 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/sidebar/items.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/sidebar/items.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -92,5 +92,8 @@ <p class="center"><?php echo Mage::helper('Mage_Sales_Helper_Data')->__('No items') ?></p> <?php endif ?> </div> + <?php if ($this->getItemCount() && $this->canRemoveItems()): ?> + <?php echo $this->getChildHtml('empty_customer_cart_button'); ?> + <?php endif; ?> </div> </div> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/store/select.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/store/select.phtml index 97c02ff6f0855a06019fd84da8ae6053b4857f11..cb19c36c07984f099d008b022a730d222472cce1 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/store/select.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/store/select.phtml @@ -20,11 +20,12 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> <?php /* @var $this Mage_Adminhtml_Block_Sales_Order_Create_Store_Select */ ?> +<?php echo $this->getHintHtml() ?> <?php foreach ($this->getWebsiteCollection() as $_website): ?> <?php $showWebsite=false; ?> <?php foreach ($this->getGroupCollection($_website) as $_group): ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/totals.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/totals.phtml index 73863759ad4e706ba9f5ef9d7c8cbe0a9571b908..870926f59da0517e6b82d529d3993624bc74a638 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/totals.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/totals.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/totals/default.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/totals/default.phtml index 8ddf39d3173d8171fbbfa4f8c4e16085ee191a00..3b66de9de0b964eb5a31180a13ff6bd90addf0b3 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/totals/default.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/totals/default.phtml @@ -20,14 +20,14 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> <tr class="<?php echo $this->getTotal()->getCode(); ?>"> <td style="<?php echo $this->getTotal()->getStyle() ?>" class="a-right" colspan="<?php echo $this->getColspan(); ?>"> <?php if ($this->getRenderingArea() == $this->getTotal()->getArea()): ?><strong><?php endif; ?> - <?php echo $this->getTotal()->getTitle() ?> + <?php echo $this->escapeHtml($this->getTotal()->getTitle()); ?> <?php if ($this->getRenderingArea() == $this->getTotal()->getArea()): ?></strong><?php endif; ?> </td> <td style="<?php echo $this->getTotal()->getStyle() ?>" class="a-right"> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/totals/grandtotal.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/totals/grandtotal.phtml index c84aa4adc45cf6022dba9017881dd0b5b837dfb1..f14446390b18f67fa02db00b78e2eb75abb99acd 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/totals/grandtotal.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/totals/grandtotal.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /** diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/totals/shipping.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/totals/shipping.phtml index d304e1163fd61fd3ac24345a3f5c1e27ceaeda16..69c4371a0075a1c699f9e90dbc99e0e3d9305d04 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/totals/shipping.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/totals/shipping.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /** diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/totals/subtotal.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/totals/subtotal.phtml index c005216acb9f4658ac75d5bd03519e8ee1b493fc..a7d021dd6353daadc724b112db7189c8b14c00c3 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/totals/subtotal.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/totals/subtotal.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /** diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/totals/tax.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/totals/tax.phtml index cbb419a8fa6c4a25f099d244d64cb3c751ab4f7f..13b1b0497eba1655f35a0ba79597648e849166c7 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/totals/tax.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/totals/tax.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/creditmemo/create/form.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/creditmemo/create/form.phtml index 7629c505067f547dc8bdc0dd9fb6dd52d53f180e..face88352ee4df6d7b3536e124f88055b712ba75 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/creditmemo/create/form.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/creditmemo/create/form.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/creditmemo/create/items.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/creditmemo/create/items.phtml index 198e10e5e533fd38b8be74d7e215a4d7c990de5a..042a395f105e7fa4df5ab2986ee3d695cb0a3836 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/creditmemo/create/items.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/creditmemo/create/items.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/creditmemo/create/items/renderer/configurable.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/creditmemo/create/items/renderer/configurable.phtml index b0876731b90a525a1c6c88beefaa4f33b828c984..ddebb797ec4b432b6a5d58f89aa40dea787d891a 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/creditmemo/create/items/renderer/configurable.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/creditmemo/create/items/renderer/configurable.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -228,12 +228,11 @@ <?php endif; ?> <?php if (Mage::helper('Mage_Weee_Helper_Data')->typeOfDisplay($_item, 2, 'sales')): ?> - <br /><span class="nobr"><?php echo Mage::helper('Mage_Weee_Helper_Data')->__('Total'); ?>:<br /> <?php echo $this->displayPrices($_baseIncl+$_item->getBaseWeeeTaxAppliedRowAmnt(), $_incl+$_item->getWeeeTaxAppliedRowAmount()); ?></span> + <br /><span class="nobr"><?php echo Mage::helper('Mage_Weee_Helper_Data')->__('Total'); ?>:<br /> <?php echo $this->displayPrices($_baseIncl+$_item->getBaseWeeeTaxAppliedRowAmount(), $_incl+$_item->getWeeeTaxAppliedRowAmount()); ?></span> <?php endif; ?> <?php endif; ?> </span> <?php endif; ?> - </span> </td> <td class="a-right"><?php echo $this->displayPriceAttribute('tax_amount') ?></td> <td class="a-right"><?php echo $this->displayPriceAttribute('discount_amount') ?></td> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/creditmemo/create/items/renderer/default.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/creditmemo/create/items/renderer/default.phtml index 01c96a1f5c09560843915b2573210dfa79db8f48..63677f43dc294c00985b0d53f41002b74bef7030 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/creditmemo/create/items/renderer/default.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/creditmemo/create/items/renderer/default.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -233,7 +233,6 @@ <?php endif; ?> </span> <?php endif; ?> - </span> </td> <td class="a-right"><?php echo $this->displayPriceAttribute('tax_amount') ?></td> <td class="a-right"><?php echo $this->displayPriceAttribute('discount_amount') ?></td> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/creditmemo/create/totals/adjustments.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/creditmemo/create/totals/adjustments.phtml index 82181d24b4375e2bd7d37b470ead5f3de9e80ed3..6af4d00c97262706cedb80231ebe6034dbaa2aa2 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/creditmemo/create/totals/adjustments.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/creditmemo/create/totals/adjustments.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/creditmemo/view/form.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/creditmemo/view/form.phtml index f25c4f38c37b6e5dcae002e87386a9c644c55769..ee8d6e46a52d67407fc3c511fbcca9fca257d6b8 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/creditmemo/view/form.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/creditmemo/view/form.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/creditmemo/view/items.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/creditmemo/view/items.phtml index 616f49d8fc666086d861ceed5efffc67cc123abb..12358444ecb72987f0c8df68bc658bebc770e932 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/creditmemo/view/items.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/creditmemo/view/items.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/creditmemo/view/items/renderer/configurable.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/creditmemo/view/items/renderer/configurable.phtml index 41ccaa15c7380c5ebcdd6acb3dd31a9429180d33..60be10a9812dedd1d264b09beed1ebe0425e91c6 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/creditmemo/view/items/renderer/configurable.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/creditmemo/view/items/renderer/configurable.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -215,12 +215,11 @@ <?php endif; ?> <?php if (Mage::helper('Mage_Weee_Helper_Data')->typeOfDisplay($_item, 2, 'sales')): ?> - <br /><span class="nobr"><?php echo Mage::helper('Mage_Weee_Helper_Data')->__('Total'); ?>:<br /> <?php echo $this->displayPrices($_baseIncl+$_item->getBaseWeeeTaxAppliedRowAmnt(), $_incl+$_item->getWeeeTaxAppliedRowAmount()); ?></span> + <br /><span class="nobr"><?php echo Mage::helper('Mage_Weee_Helper_Data')->__('Total'); ?>:<br /> <?php echo $this->displayPrices($_baseIncl+$_item->getBaseWeeeTaxAppliedRowAmount(), $_incl+$_item->getWeeeTaxAppliedRowAmount()); ?></span> <?php endif; ?> <?php endif; ?> </span> <?php endif; ?> - </span> </td> <td class="a-right"><?php echo $this->displayPriceAttribute('tax_amount') ?></td> <td class="a-right"><?php echo $this->displayPriceAttribute('discount_amount') ?></td> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/creditmemo/view/items/renderer/default.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/creditmemo/view/items/renderer/default.phtml index 4ef3c15b2004aa89e8a1b16a037ec8ebaf5a0944..29ad5b5f7b66179ff04ec0982c1281ea1afcf88d 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/creditmemo/view/items/renderer/default.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/creditmemo/view/items/renderer/default.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -221,7 +221,6 @@ <?php endif; ?> </span> <?php endif; ?> - </span> </td> <td class="a-right"><?php echo $this->displayPriceAttribute('tax_amount') ?></td> <td class="a-right"><?php echo $this->displayPriceAttribute('discount_amount') ?></td> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/giftoptions.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/giftoptions.phtml index ddf58a0816edc75e77f39bf586b61fb5e6baa767..550a5223d581ff5f484f6e832594c96795cf3974 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/giftoptions.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/giftoptions.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/giftoptions_tooltip.js b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/giftoptions_tooltip.js index 519efaf5e2276721a4290f76fba275a6d5701f11..99675a27f72c677ad4f3f87c2907d136f4515c2b 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/giftoptions_tooltip.js +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/giftoptions_tooltip.js @@ -19,7 +19,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/invoice/create/form.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/invoice/create/form.phtml index d34ce1ae18e63223fde884580ed81080980a15eb..2c43ff9c0ba856410b3e69dd4c23904c9d7d7965 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/invoice/create/form.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/invoice/create/form.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/invoice/create/items.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/invoice/create/items.phtml index d60b56da3cfac7ceee52abac417a1061f3dd4aa6..8bb3ea5fc6530d09d2a53d18d4eedbd91bfd3430 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/invoice/create/items.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/invoice/create/items.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/invoice/create/items/renderer/configurable.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/invoice/create/items/renderer/configurable.phtml index 8a6e9ce2a99c61a39e2f96f651f26cad9f8c64f7..57e88e3fb1183d3761d92d4dc1d967493d748f52 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/invoice/create/items/renderer/configurable.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/invoice/create/items/renderer/configurable.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -227,7 +227,6 @@ <?php endif; ?> </span> <?php endif; ?> - </span> </td> <td class="a-right"><?php echo $this->displayPriceAttribute('tax_amount') ?></td> <td class="a-right"><?php echo $this->displayPriceAttribute('discount_amount') ?></td> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/invoice/create/items/renderer/default.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/invoice/create/items/renderer/default.phtml index 6cab2cf4bcb145cad7937e44599d2aefb05c254d..11b62382c1ba5285ac0de9d41ffc26b8adb35c0f 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/invoice/create/items/renderer/default.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/invoice/create/items/renderer/default.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -227,7 +227,6 @@ <?php endif; ?> </span> <?php endif; ?> - </span> </td> <td class="a-right"><?php echo $this->displayPriceAttribute('tax_amount') ?></td> <td class="a-right"><?php echo $this->displayPriceAttribute('discount_amount') ?></td> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/invoice/create/tracking.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/invoice/create/tracking.phtml index 37c36500f4f59051e3abcf0374af353cb612e2cf..9b1d50936ea994d0d31dd2327422dc23b50aa529 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/invoice/create/tracking.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/invoice/create/tracking.phtml @@ -20,11 +20,12 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> <script type="text/javascript"> +//<![CDATA[ var trackingControl = {}; trackingControl = { index : 0, @@ -64,6 +65,7 @@ trackingControl = { } } } +//]]> </script> <div class="grid"> <table cellspacing="0" class="data" id="tracking_numbers_table"> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/invoice/view/form.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/invoice/view/form.phtml index fa54fbeebe68999edb6c6684806a428e76a6dfa1..ac33f2db3fcc905eb760981426b9602bf6cb069b 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/invoice/view/form.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/invoice/view/form.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/invoice/view/items.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/invoice/view/items.phtml index 8bbc47ed57bacf8251ec2b0304678e3c73300498..b65e181c376e85496f66f338c6c761832c3a6fa9 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/invoice/view/items.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/invoice/view/items.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/invoice/view/items/renderer/configurable.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/invoice/view/items/renderer/configurable.phtml index 8a6e9ce2a99c61a39e2f96f651f26cad9f8c64f7..f42e2c83d735e6831694238c2869c96e6ea013b5 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/invoice/view/items/renderer/configurable.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/invoice/view/items/renderer/configurable.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -222,12 +222,12 @@ <?php endif; ?> <?php if (Mage::helper('Mage_Weee_Helper_Data')->typeOfDisplay($_item, 2, 'sales')): ?> - <br /><span class="nobr"><?php echo Mage::helper('Mage_Weee_Helper_Data')->__('Total'); ?>:<br /> <?php echo $this->displayPrices($_baseIncl+$_item->getBaseWeeeTaxAppliedRowAmnt(), $_incl+$_item->getWeeeTaxAppliedRowAmount()); ?></span> + <br /><span class="nobr"><?php echo Mage::helper('Mage_Weee_Helper_Data')->__('Total'); ?>:<br /> <?php echo $this->displayPrices($_baseIncl+$_item->getBaseWeeeTaxAppliedRowAmount(), $_incl+$_item->getWeeeTaxAppliedRowAmount()); ?></span> <?php endif; ?> <?php endif; ?> </span> <?php endif; ?> - </span> + </td> <td class="a-right"><?php echo $this->displayPriceAttribute('tax_amount') ?></td> <td class="a-right"><?php echo $this->displayPriceAttribute('discount_amount') ?></td> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/invoice/view/items/renderer/default.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/invoice/view/items/renderer/default.phtml index 3c61f51b46f22a2f9fb230406407301c3cbf1b00..45eba3ec63061c37ff488db0fd7165cbb78afa23 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/invoice/view/items/renderer/default.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/invoice/view/items/renderer/default.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -221,7 +221,6 @@ <?php endif; ?> </span> <?php endif; ?> - </span> </td> <td class="a-right"><?php echo $this->displayPriceAttribute('tax_amount') ?></td> <td class="a-right"><?php echo $this->displayPriceAttribute('discount_amount') ?></td> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/create/form.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/create/form.phtml index 4d19df6f8f4a28765aba2d662067f3034c90d0b0..0f7346d1e335e37380f2f36b0210256a67b025f5 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/create/form.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/create/form.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/create/items.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/create/items.phtml index ad2600932cd22eb58166e300c04aa804fa92656a..9558c568d957d7e9f1ad927f3410234aaefceb7a 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/create/items.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/create/items.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/create/items/renderer/configurable.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/create/items/renderer/configurable.phtml index 1cc67f2a09c82a6be637201ddc69787c5cdd6397..cca9e03bf989cfcf416520c34318f7916ecc0bbb 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/create/items/renderer/configurable.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/create/items/renderer/configurable.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/create/items/renderer/default.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/create/items/renderer/default.phtml index d735fc08dfd4d014ac77ee899e52c33901c2aaac..e1861670e19ba589e8f0bc9283a84d521fe6e2e3 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/create/items/renderer/default.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/create/items/renderer/default.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/create/tracking.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/create/tracking.phtml index fbf66aff6993a0be1580835bb77fc993fcc2d1be..7a095d19d42688d69b4ed28578bd66edd723d959 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/create/tracking.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/create/tracking.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/packaging.js b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/packaging.js index ac99fe5ebe5e35249fba82b504749aec1e22590e..fd0739b8b57e005a196f3e539e5f553918af9726 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/packaging.js +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/packaging.js @@ -19,7 +19,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ var Packaging = Class.create(); @@ -248,6 +248,17 @@ Packaging.prototype = { }, validate: function() { + var dimensionElements = $("packaging_window").select( + 'input[name=container_length],input[name=container_width],input[name=container_height]' + ); + var callback = null; + if ( dimensionElements.any(function(element) { return !!element.value; })) { + callback = function(element) { $(element).addClassName('required-entry'); }; + } else { + callback = function(element) { $(element).removeClassName('required-entry'); }; + } + dimensionElements.each(callback); + return result = $$('[id^="package_block_"] input').collect(function (element) { return this.validateElement(element) }, this).all(); @@ -609,7 +620,7 @@ Packaging.prototype = { return; } - currentNode.select( + $(currentNode).select( 'input[name=container_length],input[name=container_width],input[name=container_height],select[name=container_dimension_units]' ).each(function(inputElement) { if (disable) { diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/packaging/grid.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/packaging/grid.phtml index a1e597d7ec02095d22ffc3caa11e8c862a868e41..560dc5f451a318e24f95ff05ef6f3e4c866337d6 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/packaging/grid.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/packaging/grid.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -81,7 +81,7 @@ <input type="hidden" name="price" value="<?php echo $item->getPrice(); ?>"> <input type="text" name="qty" value="<?php echo $item->getQty()*1; ?>" class="input-text qty<?php if ($item->getOrderItem()->getIsQtyDecimal()): ?> qty-decimal<?php endif ?>"> <button type="button" class="scalable delete icon-btn" onclick="packaging.deleteItem(this);" style="display:none;"> - <span><?php echo Mage::helper('Mage_Sales_Helper_Data')->__('Delete') ?></span> + <span><span><span><?php echo Mage::helper('Mage_Sales_Helper_Data')->__('Delete') ?></span></span></span> </button> </td> </tr> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/packaging/packed.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/packaging/packed.phtml index 9508ea3911d02a30cc0a6c005d71aa566921648a..c2ddd754047d424f602269338dabe2d26ab0e0c8 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/packaging/packed.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/packaging/packed.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -190,7 +190,7 @@ <div class="buttons-set a-right"> <?php echo $this->getPrintButton() ?> <button type="button" class="scalable SavePackagesBtn save" onclick="hidePackedWindow();" title="<?php echo Mage::helper('Mage_Sales_Helper_Data')->__('Products should be added to package(s)')?>"> - <span><?php echo Mage::helper('Mage_Sales_Helper_Data')->__('OK') ?></span> + <span><span><span><?php echo Mage::helper('Mage_Sales_Helper_Data')->__('OK') ?></span></span></span> </button> </div> </div> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/packaging/popup.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/packaging/popup.phtml index ceb39072c653af653b0f1d72e60f5f83120aedd1..92348e12d67bfcff86df28e771a7ee6f1a273e58 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/packaging/popup.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/packaging/popup.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -46,7 +46,7 @@ document.observe("dom:loaded", function() { <div class="entry-edit"> <div class="entry-edit-head"> <button type="button" class="scalable AddPackageBtn" onclick="packaging.newPackage();"> - <span><?php echo Mage::helper('Mage_Sales_Helper_Data')->__('Add Package') ?></span> + <span><span><span><?php echo Mage::helper('Mage_Sales_Helper_Data')->__('Add Package') ?></span></span></span> </button> <h4 class="icon-head fieldset-legend"><?php echo Mage::helper('Mage_Sales_Helper_Data')->__('Create Packages') ?></h4> </div> @@ -156,12 +156,12 @@ document.observe("dom:loaded", function() { <?php endif; ?> <td> <button type="button" class="scalable AddItemsBtn" onclick="packaging.getItemsForPack(this);"> - <span><?php echo Mage::helper('Mage_Sales_Helper_Data')->__('Add Products') ?></span> + <span><span><span><?php echo Mage::helper('Mage_Sales_Helper_Data')->__('Add Products') ?></span></span></span> </button> </td> <td> <button type="button" class="scalable DeletePackageBtn" onclick="packaging.deletePackage(this);"> - <span><?php echo Mage::helper('Mage_Sales_Helper_Data')->__('Delete Package') ?></span> + <span><span><span><?php echo Mage::helper('Mage_Sales_Helper_Data')->__('Delete Package') ?></span></span></span> </button> </td> </tbody> @@ -198,7 +198,7 @@ document.observe("dom:loaded", function() { <div class="package_prapare" style="display:none"> <div class="entry-edit-head"> <button type="button" class="scalable AddSelectedBtn" onclick="packaging.packItems(this);"> - <span><?php echo Mage::helper('Mage_Sales_Helper_Data')->__('Add Selected Product(s) to Package') ?></span> + <span><span><span><?php echo Mage::helper('Mage_Sales_Helper_Data')->__('Add Selected Product(s) to Package') ?></span></span></span> </button> <h4><?php echo Mage::helper('Mage_Sales_Helper_Data')->__('Please Select Products to Add') ?></h4> </div> @@ -210,10 +210,10 @@ document.observe("dom:loaded", function() { </div> <div class="buttons-set a-right"> <button type="button" class="scalable disabled SavePackagesBtn" disabled="disabled" onclick="packaging.confirmPackaging();" title="<?php echo Mage::helper('Mage_Sales_Helper_Data')->__('Products should be added to package(s)')?>"> - <span><?php echo Mage::helper('Mage_Sales_Helper_Data')->__('OK') ?></span> + <span><span><span><?php echo Mage::helper('Mage_Sales_Helper_Data')->__('OK') ?></span></span></span> </button> <button type="button" class="scalable" onclick="packaging.cancelPackaging();"> - <span><?php echo Mage::helper('Mage_Sales_Helper_Data')->__('Cancel') ?></span> + <span><span><span><?php echo Mage::helper('Mage_Sales_Helper_Data')->__('Cancel') ?></span></span></span> </button> </div> </div> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/tracking/info.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/tracking/info.phtml index d4df9d10c96f21822cce07825daadc121fc97df6..e134686dba3ab7198755808f06758c2a2661c378 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/tracking/info.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/tracking/info.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/view/form.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/view/form.phtml index 6c06d7c91d896e48135915f6c9b887ce6c9be949..bd37961776f4b28ae89524184b609ee07feb9a26 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/view/form.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/view/form.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/view/items.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/view/items.phtml index 4f95554aa49d6df58e712f631ec38cc3a92d90fa..9b0c3defc4caebd31df63da40eea202caeb4730b 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/view/items.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/view/items.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/view/items/renderer/configurable.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/view/items/renderer/configurable.phtml index 372700c1262d10d65561750972da9115c565f05d..5bdf2a91a6f6243330df8315d12e3bcf4ee00a7d 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/view/items/renderer/configurable.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/view/items/renderer/configurable.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/view/items/renderer/default.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/view/items/renderer/default.phtml index 148d0f69d76521142ef12629e21658aad955ea25..5b5e0f62aad6e56a248e0840b344a51c27baa52b 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/view/items/renderer/default.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/view/items/renderer/default.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/view/tracking.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/view/tracking.phtml index 43963306ae17e743fa0f51f759f72194e3a78ff9..7457113720068ed7fcd2df74908f39fb330c1f44 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/view/tracking.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/shipment/view/tracking.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -74,6 +74,7 @@ </table> </div> <script type="text/javascript"> +//<![CDATA[ function selectCarrier(elem) { option = elem.options[elem.selectedIndex]; if (option.value && option.value != 'custom') { @@ -89,4 +90,5 @@ function deleteTrackingNumber(url) { submitAndReloadArea($('shipment_tracking_info').parentNode, url) } } +//]]> </script> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/totalbar.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/totalbar.phtml index cae1e44e9affb7ba36dbd3dff61a44bbd03a03a2..81448cb2a29f372e0e8f39ea9d3848d68ab87f74 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/totalbar.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/totalbar.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/totals.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/totals.phtml index a343bca3f4b947da6403761f09dcbafb996d79cb..536e9aa713f10857e3d05e841003c0e469132d4a 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/totals.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/totals.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -35,52 +35,52 @@ <table cellspacing="0" width="100%"> <col /> <col width="1" /> - <?php $_totals = $this->getTotals('')?> + <?php $_totals = $this->getTotals('footer')?> <?php if ($_totals):?> - <tbody> - <?php foreach ($_totals as $_code => $_total): ?> + <tfoot> + <?php foreach ($this->getTotals('footer') as $_code => $_total): ?> <?php if ($_total->getBlockName()): ?> <?php echo $this->getChildHtml($_total->getBlockName(), false); ?> <?php else:?> <tr class="<?php echo $_code?>"> <td <?php echo $this->getLabelProperties()?> class="label"> - <?php if ($_total->getStrong()):?> - <strong><?php echo $_total->getLabel()?></strong> - <?php else:?> - <?php echo $_total->getLabel()?> - <?php endif?> + <strong><?php echo $this->escapeHtml($_total->getLabel()); ?></strong> </td> - <?php if ($_total->getStrong()):?> <td <?php echo $this->getValueProperties()?> class="emph"> <strong><?php echo $this->formatValue($_total) ?></strong> - <?php else:?> - <td <?php echo $this->getValueProperties()?>> - <?php echo $this->formatValue($_total) ?> - <?php endif?> </td> </tr> <?php endif?> <?php endforeach?> - </tbody> + </tfoot> <?php endif?> - <?php $_totals = $this->getTotals('footer')?> + <?php $_totals = $this->getTotals('')?> <?php if ($_totals):?> - <tfoot> - <?php foreach ($this->getTotals('footer') as $_code => $_total): ?> + <tbody> + <?php foreach ($_totals as $_code => $_total): ?> <?php if ($_total->getBlockName()): ?> <?php echo $this->getChildHtml($_total->getBlockName(), false); ?> <?php else:?> <tr class="<?php echo $_code?>"> <td <?php echo $this->getLabelProperties()?> class="label"> - <strong><?php echo $_total->getLabel()?></strong> + <?php if ($_total->getStrong()):?> + <strong><?php echo $this->escapeHtml($_total->getLabel()); ?></strong> + <?php else:?> + <?php echo $this->escapeHtml($_total->getLabel()); ?> + <?php endif?> </td> + <?php if ($_total->getStrong()):?> <td <?php echo $this->getValueProperties()?> class="emph"> <strong><?php echo $this->formatValue($_total) ?></strong> + <?php else:?> + <td <?php echo $this->getValueProperties()?>> + <?php echo $this->formatValue($_total) ?> + <?php endif?> </td> </tr> <?php endif?> <?php endforeach?> - </tfoot> + </tbody> <?php endif?> </table> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/totals/discount.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/totals/discount.phtml index 7911c993e1a2c12c36b3835a498902ca9e5f3257..4ccfd708423592a5dc559174126843bb8bf68633 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/totals/discount.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/totals/discount.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/totals/due.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/totals/due.phtml index 4b05ffb74288ea8915a3ec0a119b275a56cfcd02..8c37ce3b4f2eee8dab09667af5d23f299f54fd4b 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/totals/due.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/totals/due.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/totals/footer.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/totals/footer.phtml index bf027e603ae695074e5f82f4dc1b2480126dca20..5618bbe5b71a335867151961d9d573b036ef271b 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/totals/footer.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/totals/footer.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/totals/grand.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/totals/grand.phtml index aa4c3ea02366c998892a29bf0df260d1d7d03186..f4ab25eea94af9a91d01619d9df8fe61b87b9fe8 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/totals/grand.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/totals/grand.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/totals/item.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/totals/item.phtml index f16c9bb177054b3216aa803944624acfa9eabf2b..ee552ea45618c37e0caa3cf9d7f70a94a9737965 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/totals/item.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/totals/item.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/totals/main.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/totals/main.phtml index c85a611c6aef04cff61079878cff3117529284f1..518a2ceecd70813992a9080918a984c2904b5efe 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/totals/main.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/totals/main.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/totals/paid.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/totals/paid.phtml index 249a907407833927b781e6726d38373fd73917a4..d9d5e3d09a01a27785dc7c37f8a8725d575f9d72 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/totals/paid.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/totals/paid.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/totals/refunded.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/totals/refunded.phtml index c6770626c18b426501fa140806f4c7aed300f764..c3437c5b943fc84858bf2bb11ae8c614b292f327 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/totals/refunded.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/totals/refunded.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/totals/shipping.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/totals/shipping.phtml index 130ca52d94e81afe8964f4023736cb61f36c014f..6d5b67f7bdc277ac0eb1fc65c2778e13348e7df5 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/totals/shipping.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/totals/shipping.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/totals/tax.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/totals/tax.phtml index c522ef9f8de8940c017cc07e64153a20703d7f5b..e08b9049e6567f331a9f2fa8269e7afbad48f443 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/totals/tax.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/totals/tax.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /** @var $this Mage_Adminhtml_Block_Sales_Order_Totals_Tax */ diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/view/form.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/view/form.phtml index 9e094c7ce83ec30eac9b65ffc4d57318ad6ff14a..226ff5f39065bb7c0df266df7c0a43fa35253c32 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/view/form.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/view/form.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/view/giftmessage.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/view/giftmessage.phtml index 26390983ce028a485a0a751413421e9f187c068c..c2ce110c0b4960338c933acc3d8fa9ce82df75a4 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/view/giftmessage.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/view/giftmessage.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/view/history.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/view/history.phtml index 8876f987a1c93676568abf463cc233ba7ceabfc8..f46dd2e20e62b7abb64dba98adb1f98757ed05ed 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/view/history.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/view/history.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/view/info.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/view/info.phtml index 56a555b9d1ea3c0512c215149f67e117a8e808b5..7c1666437c4a7e84df510a9954558ca2e11ad7b5 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/view/info.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/view/info.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/view/items.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/view/items.phtml index 3f18a3ad111729ade3d014a64b13db63119a666a..4dda557ff70be8564c3387d141546214cec3bd24 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/view/items.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/view/items.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/view/items/renderer/default.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/view/items/renderer/default.phtml index 9e73fbc0e392c6c340a7f645826c3daab1a24903..43c90c1a2f58717183c3da4b64f05a27452dac7f 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/view/items/renderer/default.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/view/items/renderer/default.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/view/tab/history.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/view/tab/history.phtml index 292e7b707c8b4a5b6868f3a9c0caee6f070bf7a8..46c5f57d2892ea1ba8991edc0db3f31f67907780 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/view/tab/history.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/view/tab/history.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/view/tab/info.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/view/tab/info.phtml index 0328eb1366d1f9a654c29888f299194c69701373..57b1ffec9a1f14ed308cb6ebad72187fb149e332 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/view/tab/info.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/view/tab/info.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/view/tracking.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/view/tracking.phtml index a434cffcb95e437819f845ef36eb787021f5efaf..ff559b74657763dc8731f185d71598abd25fa985 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/view/tracking.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/view/tracking.phtml @@ -20,23 +20,24 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> -<?php if($this->getOrder()->getShippingCarrier()->isTrackingAvailable()) : ?> +<?php $_shippingCarrier = $this->getOrder()->getShippingCarrier(); ?> +<?php if ($_shippingCarrier && $_shippingCarrier->isTrackingAvailable()): ?> <span class="field-row" id="order_tracking_info"> <table cellpadding="0" cellspacing="0" width="100%"> <tr> - <td><label id="tracking_number"><?php echo Mage::helper('Mage_Sales_Helper_Data')->__('Tracking Number') ?></label></td> + <td><label for="tracking_number"><?php echo Mage::helper('Mage_Sales_Helper_Data')->__('Tracking Number') ?></label></td> <td width="100%"> - <?php if($_numbers = $this->getOrder()->getTrackingNumbers()): ?> - - <?php foreach ($_numbers as $_number): ?> - <a href="#" onclick="<?php echo $this->getViewLinkHtml($_number) ?>"><?php echo $_number ?></a> - <a href="#" onclick="<?php echo $this->getRemoveLinkHtml($_number) ?>"><?php echo Mage::helper('Mage_Sales_Helper_Data')->__('Delete') ?></a><br/> - <span id="order_tracking_info_response_<?php echo $_number ?>"></span> - <?php endforeach; ?> + <?php $_numbers = $this->getOrder()->getTrackingNumbers(); ?> + <?php if ($_numbers): ?> + <?php foreach ($_numbers as $_number): ?> + <a href="#" onclick="<?php echo $this->getViewLinkHtml($_number) ?>"><?php echo $_number ?></a> + <a href="#" onclick="<?php echo $this->getRemoveLinkHtml($_number) ?>"><?php echo Mage::helper('Mage_Sales_Helper_Data')->__('Delete') ?></a><br/> + <span id="order_tracking_info_response_<?php echo $_number ?>"></span> + <?php endforeach; ?> <?php endif; ?> <input class="input-text" type="text" id="tracking_number" name="tracking_number" value="" style="width:120px;"/> <?php echo $this->getSaveButtonHtml() ?> @@ -44,4 +45,4 @@ </tr> </table> </span> -<?php endif ?> +<?php endif; ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/transactions/detail.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/transactions/detail.phtml index ec029946e11df4ea0ac642c6616dff74d66415d4..9c6ab7a905972cbc580102309233b10e81d29dd0 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/transactions/detail.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/transactions/detail.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/store/switcher.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/store/switcher.phtml index 8819f353ec465558104f73bf015d81585292d5f0..ccdcefe9e4da3fd1a56594ecf0074d30e36796fe 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/store/switcher.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/store/switcher.phtml @@ -20,13 +20,13 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> <?php /* @var $this Mage_Core_Block_Template */ ?> <?php if ($websites = $this->getWebsites()): ?> -<p class="switcher"><label for="store_switcher"><?php echo $this->__('Choose Store View') ?>:</label> +<p class="switcher"><label for="store_switcher"><?php echo $this->__('Choose Store View:') ?></label> <select name="store_switcher" id="store_switcher" onchange="return switchStore(this);"> <?php if ($this->hasDefaultOption()): ?> <option value=""><?php echo $this->getDefaultStoreName() ?></option> @@ -52,6 +52,7 @@ <?php endforeach; ?> <?php endforeach; ?> </select> +<?php echo $this->getHintHtml() ?> </p> <script type="text/javascript"> function switchStore(obj) { diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/store/switcher/enhanced.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/store/switcher/enhanced.phtml index 7b30a4e632b3980f35ad91a9b2c52b501eb7d1c4..70aef2a93008ae1fc63f53b5b8dcccfe25af2381 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/store/switcher/enhanced.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/store/switcher/enhanced.phtml @@ -20,14 +20,14 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> <?php $_websiteCollection = $this->getWebsiteCollection() ?> <?php if ($_websiteCollection->getSize()): ?> <div id="store_switcher_container"> -<p class="switcher"><label for="store_switcher"><?php echo $this->__('Choose Store View') ?>:</label> +<p class="switcher"><label for="store_switcher"><?php echo $this->__('Choose Store View:') ?></label> <select name="store_switcher" id="store_switcher" class="left-col-block"> <option value=""><?php echo $this->getDefaultStoreName() ?></option> <?php foreach ($_websiteCollection as $_website): ?> @@ -51,6 +51,7 @@ <?php endforeach; ?> <?php endforeach; ?> </select> +<?php echo $this->getHintHtml() ?> </p> </div> <script type="text/javascript"> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/store/switcher/form/renderer/fieldset.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/store/switcher/form/renderer/fieldset.phtml new file mode 100644 index 0000000000000000000000000000000000000000..296aea419a4d3b89f52db4690e06956c1891cf2c --- /dev/null +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/store/switcher/form/renderer/fieldset.phtml @@ -0,0 +1,61 @@ +<?php +/** + * Magento + * + * 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_AFL.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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Adminhtml + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +?> +<?php $_element = $this->getElement() ?> +<?php if ($_element->getFieldsetContainerId()): ?> +<div id="<?php echo $_element->getFieldsetContainerId(); ?>"> +<?php endif; ?> +<?php if ($_element->getLegend()): ?> +<div class="entry-edit-head"> + <h4 class="icon-head head-edit-form fieldset-legend"><?php echo $_element->getLegend() ?></h4> + <div class="form-buttons"><?php echo $_element->getHeaderBar() ?></div> +</div> +<?php endif; ?> +<?php if (!$_element->getNoContainer()): ?> + <div class="fieldset <?php echo $_element->getClass() ?>" id="<?php echo $_element->getHtmlId() ?>"> +<?php endif; ?> + <?php echo $this->getHintHtml() ?> + <div class="hor-scroll"> + <?php if ($_element->getComment()): ?> + <p class="comment"><?php echo $this->escapeHtml($_element->getComment()) ?></p> + <?php endif; ?> + <?php if ($_element->hasHtmlContent()): ?> + <?php echo $_element->getHtmlContent(); ?> + <?php else: ?> + <table cellspacing="0" class="<?php echo $_element->hasTableClass() ? $_element->getTableClass() : 'form-list'?>"> + <tbody> + <?php echo $_element->getChildrenHtml(); ?> + </tbody> + </table> + <?php endif; ?> + </div> + <?php echo $_element->getSubFieldsetHtml() ?> +<?php if (!$_element->getNoContainer()): ?> + </div> +<?php endif; ?> +<?php if ($_element->getFieldsetContainerId()): ?> +</div> +<?php endif; ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/system/autocomplete.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/system/autocomplete.phtml index 456e48b260aba1256ed517b018920547cd656cf4..534c11b4da6e856275f6b83b76880e9c2b0afd4e 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/system/autocomplete.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/system/autocomplete.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/system/cache/additional.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/system/cache/additional.phtml index 4b3332db3346209fa3b2f0c6240efde51768bba9..56b7799a6992d15e4dc1cff214a73e4088c5dba1 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/system/cache/additional.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/system/cache/additional.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -35,7 +35,7 @@ <table class="form-list"> <tr> <td class="scope-label"> - <button onclick="setLocation('<?php echo $this->getCleanImagesUrl()?>')" type="button" class="scalable"><span><?php echo Mage::helper('Mage_Adminhtml_Helper_Data')->__('Flush Catalog Images Cache') ?></span></button> + <button onclick="setLocation('<?php echo $this->getCleanImagesUrl()?>')" type="button" class="scalable"><span><span><span><?php echo Mage::helper('Mage_Adminhtml_Helper_Data')->__('Flush Catalog Images Cache') ?></span></span></span></button> </td> <td class="scope-label"> <?php echo Mage::helper('Mage_Adminhtml_Helper_Data')->__('Pregenerated product images files.')?> @@ -43,7 +43,7 @@ </tr> <tr> <td class="scope-label"> - <button onclick="setLocation('<?php echo $this->getCleanMediaUrl()?>')" type="button" class="scalable"><span><?php echo Mage::helper('Mage_Adminhtml_Helper_Data')->__('Flush JavaScript/CSS Cache') ?></span></button> + <button onclick="setLocation('<?php echo $this->getCleanMediaUrl()?>')" type="button" class="scalable"><span><span><span><?php echo Mage::helper('Mage_Adminhtml_Helper_Data')->__('Flush JavaScript/CSS Cache') ?></span></span></span></button> </td> <td class="scope-label"> <?php echo Mage::helper('Mage_Adminhtml_Helper_Data')->__('Themes JavaScript and CSS files combined to one file.')?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/system/cache/edit.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/system/cache/edit.phtml index 967300dca05da823e836bd5897c55262528b3fa2..0406b7ab6e77f7b0698d7d812d4ef42579ca8065 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/system/cache/edit.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/system/cache/edit.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -73,7 +73,7 @@ <?php if (isset($_button['warning']) && $_button['warning']): ?> <?php $clickAction = "if (confirm('".addslashes($_button['warning'])."')) {{$clickAction}}"; ?> <?php endif; ?> - <button <?php if (!isset($_button['disabled']) || !$_button['disabled']):?>onclick="<?php echo $clickAction; ?>"<?php endif; ?> id="<?php echo $_button['name'] ?>" type="button" class="scalable <?php if (isset($_button['disabled']) && $_button['disabled']):?>disabled<?php endif; ?>" style=""><span><?php echo $_button['action'] ?></span></button> + <button <?php if (!isset($_button['disabled']) || !$_button['disabled']):?>onclick="<?php echo $clickAction; ?>"<?php endif; ?> id="<?php echo $_button['name'] ?>" type="button" class="scalable <?php if (isset($_button['disabled']) && $_button['disabled']):?>disabled<?php endif; ?>" style=""><span><span><span><?php echo $_button['action'] ?></span></span></span></button> <?php if (isset($_button['comment'])): ?> <br /> <small><?php echo $_button['comment']; ?></small> <?php endif; ?> <?php endforeach; ?> </td> @@ -96,7 +96,7 @@ <tr> <td class="label"><label><?php echo $this->__('JavaScript/CSS Cache') ?></label></td> <td class="value"> - <button onclick="setCacheAction('jscss_action', this)" id='jscss_action' type="button" class="scalable"><span><?php echo $this->__('Clear') ?></span></button> + <button onclick="setCacheAction('jscss_action', this)" id='jscss_action' type="button" class="scalable"><span><span><span><?php echo $this->__('Clear') ?></span></span></span></button> </td> </tr> </tbody> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/system/cache/notifications.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/system/cache/notifications.phtml index 61b87a8b635288cf17699b0e80d5fcfe373cdd43..d88f71e06ef6fe80d9032905b774508d06ccb7cb 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/system/cache/notifications.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/system/cache/notifications.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/system/config/edit.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/system/config/edit.phtml index 0f26cefb2d26529ee540688f9700830da74be184..773f37810f3b07f906460d157a173eabdac585e9 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/system/config/edit.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/system/config/edit.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/system/config/form/field/array.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/system/config/form/field/array.phtml index c6105517438b10c6cbe0c0112783e39a21bcfb01..2fc0dd12fa27d8db6bf784149f2efba31a4e2481 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/system/config/form/field/array.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/system/config/form/field/array.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -50,7 +50,7 @@ $_colspan = $_colspan > 1 ? 'colspan="' . $_colspan . '"' : ''; <td colspan="<?php echo count($this->_columns) ?>"></td> <td <?php echo $_colspan?>> <button style="" onclick="" class="scalable add" type="button" id="addToEndBtn<?php echo $_htmlId ?>"> - <span><?php echo $this->_addButtonLabel ?></span> + <span><span><span><?php echo $this->_addButtonLabel ?></span></span></span> </button> </td> </tr> @@ -61,7 +61,7 @@ $_colspan = $_colspan > 1 ? 'colspan="' . $_colspan . '"' : ''; </div> <div id="empty<?php echo $_htmlId ?>"> <button style="" onclick="" class="scalable add" type="button" id="emptyAddBtn<?php echo $_htmlId ?>"> - <span><?php echo $this->_addButtonLabel ?></span> + <span><span><span><?php echo $this->_addButtonLabel ?></span></span></span> </button> </div> @@ -78,9 +78,9 @@ var arrayRow<?php echo $_htmlId ?> = { +'<\/td>' <?php endforeach;?> <?php if ($this->_addAfter):?> - +'<td><button onclick="" class="scalable add" type="button" id="addAfterBtn#{_id}"><span><?php echo Mage::helper('Mage_Adminhtml_Helper_Data')->__('Add after') ?><\/span><\/button><\/td>' + +'<td><button onclick="" class="scalable add" type="button" id="addAfterBtn#{_id}"><span><span><span><?php echo Mage::helper('Mage_Adminhtml_Helper_Data')->__('Add after') ?><\/span><\/span><\/span><\/button><\/td>' <?php endif;?> - +'<td><button onclick="arrayRow<?php echo $_htmlId ?>.del(\'#{_id}\')" class="scalable delete" type="button"><span><?php echo Mage::helper('Mage_Adminhtml_Helper_Data')->__('Delete') ?><\/span><\/button><\/td>' + +'<td><button onclick="arrayRow<?php echo $_htmlId ?>.del(\'#{_id}\')" class="scalable delete" type="button"><span><span><span><?php echo Mage::helper('Mage_Adminhtml_Helper_Data')->__('Delete') ?><\/span><\/span><\/span><\/button><\/td>' +'<\/tr>' ), diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/system/config/js.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/system/config/js.phtml index ed0118619894a2b84eba1e4e3221574e3b165db6..9ddc15343d20c9bb28d1f03b0d894959bfe95820 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/system/config/js.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/system/config/js.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -251,11 +251,6 @@ perPageModel.prototype = { var values = $(elm.id + '_values').value.split(','); return values.indexOf(v) != -1; }); - - this.gridValuesElement.addClassName('validate-per-page-value-list'); - this.listValuesElement.addClassName('validate-per-page-value-list'); - this.gridElement.addClassName('validate-per-page-value'); - this.listElement.addClassName('validate-per-page-value'); } } diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/system/config/switcher.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/system/config/switcher.phtml index 1e084a74049fa3e66471d01eb1cc73048617cb89..f7b4e4ed6822ae6a74432cb581eccf74e4a656f4 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/system/config/switcher.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/system/config/switcher.phtml @@ -20,13 +20,14 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> <?php /* @var $this Mage_Core_Block_Template */ ?> <div class="switcher"> <label for="store_switcher"><?php echo $this->__('Current Configuration Scope:') ?></label> + <?php echo $this->getHintHtml() ?> <select id="store_switcher" class="system-config-store-switcher" onchange="location.href=this.options[this.selectedIndex].getAttribute('url')"> <?php foreach ($this->getStoreSelectOptions() as $_value => $_option): ?> <?php if (isset($_option['is_group'])): ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/system/config/system/storage/media/synchronize.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/system/config/system/storage/media/synchronize.phtml index f61ed22e9966a004e38903fa7d5fbf23d81ec9b8..37c79ece9e48d3eddbec646902e329809244c2a4 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/system/config/system/storage/media/synchronize.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/system/config/system/storage/media/synchronize.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/system/config/tabs.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/system/config/tabs.phtml index 1cbd22ab634d22879652df07cf5602ab087ff40d..1fb6c887171126a710db40f3b0edb57d56ef4d72 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/system/config/tabs.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/system/config/tabs.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/system/convert/profile/process.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/system/convert/profile/process.phtml index 1e4f65d5cbf19ff9512385668cba70dec1d1b677..b9e67731b6f067512b13a65af0229dfab935517f 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/system/convert/profile/process.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/system/convert/profile/process.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/system/convert/profile/run.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/system/convert/profile/run.phtml index 87f1fe0007feb1acadddc22e3903edd7af5774c0..a7cbf39e3b08230a9a6c528abd23bbfed25d6f90 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/system/convert/profile/run.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/system/convert/profile/run.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/system/convert/profile/upload.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/system/convert/profile/upload.phtml index 907a0e432d8820562d338158a9901d3a9dcb4bda..986ab842fc7800e7953498ad0a6a616a698c9a2d 100755 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/system/convert/profile/upload.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/system/convert/profile/upload.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/system/convert/profile/wizard.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/system/convert/profile/wizard.phtml index d7fc151e5a88775cd73cd06bb6331440eb6fb1ec..0b6970ff4a6f953390265be105cae78466a05d4a 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/system/convert/profile/wizard.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/system/convert/profile/wizard.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/system/currency/rate/matrix.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/system/currency/rate/matrix.phtml index f0b320dfaff823704c738916cda98c30a99a9a37..2e2961304cea562b0fdb9ef4a6c22a3f156a910e 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/system/currency/rate/matrix.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/system/currency/rate/matrix.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/system/currency/rate/services.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/system/currency/rate/services.phtml index 54a4aa081192054e0d055687bdc3a513490f7ace..97d1aed32671e34261f5288c1b54c8f2b78e729f 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/system/currency/rate/services.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/system/currency/rate/services.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/system/currency/rates.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/system/currency/rates.phtml index 827071ed9954c4e65a7f12e1df49066482901c37..e57247636476ef8fb6f18020b62f70410cfa5af1 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/system/currency/rates.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/system/currency/rates.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/system/design/edit.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/system/design/edit.phtml index de823e62358f86f5722de62558550b7f71db7e2e..48921b85bcafed49fbcb31d8eb73b7adc90beb09 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/system/design/edit.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/system/design/edit.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/system/design/index.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/system/design/index.phtml index 0bd113396ec13e5c2585b8299e6c2ecc2c5b21e5..4eece28a869511953ae192952c0599be23159af1 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/system/design/index.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/system/design/index.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/system/email/template/edit.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/system/email/template/edit.phtml index c6f7ac8d0c1ceb5510060aadd0ac70533fa2f830..b6188cded82c7bf2b53174303de89268162a7471 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/system/email/template/edit.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/system/email/template/edit.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/system/email/template/list.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/system/email/template/list.phtml index d304728d5a97db841651ef371c9d166cadf7f288..69957a9928a130d3a3b2827dc2c10325d2a68d17 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/system/email/template/list.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/system/email/template/list.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/system/email/template/preview.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/system/email/template/preview.phtml index 7f8b4962059ff453cac4075e22464cc00ad9a784..17789e49cd1aad674f338b03216a2f303e078373 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/system/email/template/preview.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/system/email/template/preview.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/system/info.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/system/info.phtml index 9d98003ffcda401d879d5889ba40203e48bf8131..0b48cc33d99766506ca96b9927fdab80f18bf43e 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/system/info.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/system/info.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/system/shipping/applicable_country.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/system/shipping/applicable_country.phtml index 96a395b3e21367f3050eee909226c6c45e9cd34b..858e44817945a7217920af43f69b1a3c049fd947 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/system/shipping/applicable_country.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/system/shipping/applicable_country.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/system/shipping/ups.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/system/shipping/ups.phtml index e21206ac524a43fd097c29a2b5e6ab6c570aaf18..0299bac0634bc43c80a4bf070830f1fba27d516c 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/system/shipping/ups.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/system/shipping/ups.phtml @@ -20,203 +20,176 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ +/** @var $upsModel Mage_Usa_Model_Shipping_Carrier_Ups */ +$upsModel = Mage::getSingleton('Mage_Usa_Model_Shipping_Carrier_Ups'); +$orShipArr = $upsModel->getCode('originShipment'); +$defShipArr = $upsModel->getCode('method'); -$orShipArr = Mage::getSingleton('Mage_Usa_Model_Shipping_Carrier_Ups')->getCode('originShipment'); - -$defShipArr = Mage::getSingleton('Mage_Usa_Model_Shipping_Carrier_Ups')->getCode('method'); - +/** @var $this Mage_Adminhtml_Block_Template */ $sectionCode = $this->getRequest()->getParam('section'); $websiteCode = $this->getRequest()->getParam('website'); $storeCode = $this->getRequest()->getParam('store'); - -if(!$storeCode && $websiteCode){ +if (!$storeCode && $websiteCode) { + /** @var $web Mage_Core_Model_Website */ $web = Mage::getModel('Mage_Core_Model_Website')->load($websiteCode); - $stroredAllowedMethods = $web->getConfig('carriers/ups/allowed_methods'); - $stroredAllowedMethods = explode(',',$stroredAllowedMethods); - $stroredOriginShipment = $web->getConfig('carriers/ups/origin_shipment'); - $stroredFreeShipment = $web->getConfig('carriers/ups/free_method'); + $storedAllowedMethods = explode(',', $web->getConfig('carriers/ups/allowed_methods')); + $storedOriginShipment = $web->getConfig('carriers/ups/origin_shipment'); + $storedFreeShipment = $web->getConfig('carriers/ups/free_method'); + $storedUpsType = $web->getConfig('carriers/ups/type'); } elseif ($storeCode) { - $stroredAllowedMethods = Mage::getStoreConfig('carriers/ups/allowed_methods',$storeCode); - $stroredAllowedMethods = explode(',',$stroredAllowedMethods); - $stroredOriginShipment = Mage::getStoreConfig('carriers/ups/origin_shipment',$storeCode); - $stroredFreeShipment = Mage::getStoreConfig('carriers/ups/free_method',$storeCode); + $storedAllowedMethods = explode(',', Mage::getStoreConfig('carriers/ups/allowed_methods', $storeCode)); + $storedOriginShipment = Mage::getStoreConfig('carriers/ups/origin_shipment', $storeCode); + $storedFreeShipment = Mage::getStoreConfig('carriers/ups/free_method', $storeCode); + $storedUpsType = Mage::getStoreConfig('carriers/ups/type', $storeCode); } else { - $stroredAllowedMethods = Mage::getStoreConfig('carriers/ups/allowed_methods'); - $stroredAllowedMethods = explode(',',$stroredAllowedMethods); - $stroredOriginShipment = Mage::getStoreConfig('carriers/ups/origin_shipment'); - $stroredFreeShipment = Mage::getStoreConfig('carriers/ups/free_method'); + $storedAllowedMethods = explode(',', Mage::getStoreConfig('carriers/ups/allowed_methods')); + $storedOriginShipment = Mage::getStoreConfig('carriers/ups/origin_shipment'); + $storedFreeShipment = Mage::getStoreConfig('carriers/ups/free_method'); + $storedUpsType = Mage::getStoreConfig('carriers/ups/type'); } ?> <script type="text/javascript"> //<![CDATA[ - originShipmentObj = new Object(); - - - <?php - //get origin shipment data, using in UPS XML module - foreach ($orShipArr as $key=>$val){ - print "originShipmentObj['$key'] = new Object();\n"; - foreach ($val as $code=>$label){ - print "\toriginShipmentObj['$key']['$code'] = '$label';\n"; - } - } - ?> - //get default shipment data, using in UPS module - <?php - print "originShipmentObj['default'] = new Object();\n"; - foreach ($defShipArr as $code=>$label){ - print "\toriginShipmentObj['default']['$code'] = '$label';\n"; - } - ?> - //get stored Allowed Methods - <?php - print "stroredAllowedMethods = new Array();\n"; - foreach ($stroredAllowedMethods as $code){ - print "\tstroredAllowedMethods.push('$code');\n"; - } - ?> - //set stored origin shipment - <?php - print "stroredOriginShipment='$stroredOriginShipment'"; - ?> - - //set stored Free origin shipment - <?php - print "stroredFreeShipment='$stroredFreeShipment'"; - ?> - - - function hideRowArrayElements(arr,method) + function hideRowArrayElements(arr) { - for(a=0;a<arr.length;a++){ + for (var a = 0; a < arr.length; a++) { $(arr[a]).up(1).hide(); } } - function showRowArrayElements(arr,method) + function showRowArrayElements(arr) { - for(a=0;a<arr.length;a++){ + for (var a = 0; a < arr.length; a++) { $(arr[a]).up(1).show(); } } - function inArray(arr,value) + function inArray(arr, value) { - var i; - for (i=0; i < arr.length; i++) { - if (arr[i] === value) { - return true; - } + for (var i = 0; i < arr.length; i++) { + if (arr[i] === value) { + return true; + } } return false; } var upsXml = Class.create(); upsXml.prototype = { - initialize : function() + initialize: function() { - this.carriersUpsTypeId = 'carriers_ups_type'; - if($(this.carriersUpsTypeId)){ - this.checkingUpsXmlId = new Array('carriers_ups_gateway_xml_url','carriers_ups_username','carriers_ups_password','carriers_ups_access_license_number'); - this.checkingUpsId = new Array('carriers_ups_gateway_url'); - this.originShipmentTitle = ''; - this.allowedMethodsId = 'carriers_ups_allowed_methods'; - this.freeShipmentId = 'carriers_ups_free_method'; - this.onlyUpsXmlElements = new Array('carriers_ups_gateway_xml_url','carriers_ups_tracking_xml_url','carriers_ups_username','carriers_ups_password','carriers_ups_access_license_number','carriers_ups_origin_shipment','carriers_ups_negotiated_active','carriers_ups_shipper_number','carriers_ups_mode_xml'); - this.onlyUpsElements = new Array('carriers_ups_gateway_url'); - this.setFormValues(); - Event.observe($('carriers_ups_type'), 'change', this.setFormValues.bind(this)); + if (!$(this.carriersUpsTypeId)) { + return; } + this.checkingUpsXmlId = ['carriers_ups_gateway_xml_url','carriers_ups_username', + 'carriers_ups_password','carriers_ups_access_license_number']; + this.checkingUpsId = ['carriers_ups_gateway_url']; + this.originShipmentTitle = ''; + this.allowedMethodsId = 'carriers_ups_allowed_methods'; + this.freeShipmentId = 'carriers_ups_free_method'; + this.onlyUpsXmlElements = ['carriers_ups_gateway_xml_url','carriers_ups_tracking_xml_url', + 'carriers_ups_username','carriers_ups_password','carriers_ups_access_license_number', + 'carriers_ups_origin_shipment','carriers_ups_negotiated_active','carriers_ups_shipper_number', + 'carriers_ups_mode_xml']; + this.onlyUpsElements = ['carriers_ups_gateway_url']; + + this.storedOriginShipment = '<?php echo $storedOriginShipment ?>'; + this.storedFreeShipment = '<?php echo $storedFreeShipment ?>'; + this.storedUpsType = '<?php echo $storedUpsType ?>'; + <?php /** @var $_coreHelper Mage_Core_Helper_Data */ $_coreHelper = Mage::helper('Mage_Core_Helper_Data'); ?> + this.storedAllowedMethods = <?php echo $_coreHelper->jsonEncode($storedAllowedMethods) ?>; + this.originShipmentObj = <?php echo $_coreHelper->jsonEncode($orShipArr) ?>; + this.originShipmentObj['default'] = <?php echo $_coreHelper->jsonEncode($defShipArr) ?>; + + this.setFormValues(); + Event.observe($(this.carriersUpsTypeId), 'change', this.setFormValues.bind(this)); }, updateAllowedMethods: function(originShipmentTitle) { - selectFieldAllowedMethod = $(this.allowedMethodsId); - selectFieldFreeShipment = $(this.freeShipmentId); + var allowedMethods = $(this.allowedMethodsId), // multiselect + freeMethod = $(this.freeShipmentId), // single-choice select + originShipment = this.originShipmentObj[originShipmentTitle]; - originShipment = originShipmentObj[originShipmentTitle]; - - while (selectFieldAllowedMethod.length> 0) { - selectFieldAllowedMethod.remove(0); - } - while (selectFieldFreeShipment.length> 0) { - selectFieldFreeShipment.remove(0); + while (allowedMethods.length > 0) { + allowedMethods.remove(0); } - var optionFree = document.createElement("OPTION"); - optionFree.text = 'None'; - optionFree.value = ''; - try { - selectFieldFreeShipment.add(optionFree, null); - } catch(ex) { - selectFieldFreeShipment.add(optionFree); + while (freeMethod.length > 0) { + freeMethod.remove(0); } - for(code in originShipment){ - var option = document.createElement("OPTION"); - option.text = originShipment[code]; - option.value = code; - - var optionFree = document.createElement("OPTION"); - optionFree.text = originShipment[code]; - optionFree.value = code; + freeMethod.insert(new Element('option', {value:''}).update('None')); - if( (originShipmentTitle == stroredOriginShipment || originShipmentTitle=='default') && stroredFreeShipment==code){ - optionFree.selected = true; + var code, option; + for (code in originShipment) { + option = new Element('option', {value:code}).update(originShipment[code]); + if ((originShipmentTitle == this.storedOriginShipment || originShipmentTitle == 'default') + && this.storedFreeShipment == code + ) { + option.selected = true; } - if( (originShipmentTitle == stroredOriginShipment || originShipmentTitle=='default') && inArray(stroredAllowedMethods,code)){ + freeMethod.insert(option); + + option = new Element('option', {value:code}).update(originShipment[code]); + if (this.storedUpsType == 'UPS') { + if (originShipmentTitle != 'default' || inArray(this.storedAllowedMethods, code)) { + option.selected = true; + } + } else if (originShipmentTitle != this.storedOriginShipment + || inArray(this.storedAllowedMethods, code) + ) { option.selected = true; } - try { - selectFieldAllowedMethod.add(option, null); // standards compliant; doesn't work in IE - selectFieldFreeShipment.add(optionFree, null); - } catch(ex) { - selectFieldAllowedMethod.add(option); // IE only - selectFieldFreeShipment.add(optionFree); + + if ((originShipmentTitle == 'default' || originShipmentTitle == this.storedOriginShipment) + && inArray(this.storedAllowedMethods, code) + ) { + option.selected = true; } + + allowedMethods.insert(option); } }, setFormValues: function() { - if($F(this.carriersUpsTypeId) == 'UPS'){ - for(a=0;a<this.checkingUpsXmlId.length;a++){ + var a; + if ($F(this.carriersUpsTypeId) == 'UPS') { + for (a = 0; a < this.checkingUpsXmlId.length; a++) { $(this.checkingUpsXmlId[a]).removeClassName('required-entry'); } - for(a=0;a<this.checkingUpsId.length;a++){ + for (a = 0; a < this.checkingUpsId.length; a++) { $(this.checkingUpsXmlId[a]).addClassName('required-entry'); } Event.stopObserving($('carriers_ups_origin_shipment'), 'change', this.changeOriginShipment.bind(this)); showRowArrayElements(this.onlyUpsElements); hideRowArrayElements(this.onlyUpsXmlElements); - this.changeOriginShipment(null,'default'); + this.changeOriginShipment(null, 'default'); } else { - for(a=0;a<this.checkingUpsXmlId.length;a++){ + for (a = 0; a < this.checkingUpsXmlId.length; a++) { $(this.checkingUpsXmlId[a]).addClassName('required-entry'); } - for(a=0;a<this.checkingUpsId.length;a++){ + for (a = 0; a < this.checkingUpsId.length; a++) { $(this.checkingUpsXmlId[a]).removeClassName('required-entry'); } Event.observe($('carriers_ups_origin_shipment'), 'change', this.changeOriginShipment.bind(this)); showRowArrayElements(this.onlyUpsXmlElements); hideRowArrayElements(this.onlyUpsElements); - this.changeOriginShipment(); + this.changeOriginShipment(null, null); } }, - changeOriginShipment: function(Event,key) + changeOriginShipment: function(Event, key) { - if(key) - this.originShipmentTitle = key - else - this.originShipmentTitle = $F('carriers_ups_origin_shipment'); + this.originShipmentTitle = key ? key : $F('carriers_ups_origin_shipment'); this.updateAllowedMethods(this.originShipmentTitle); } - } + }; xml = new upsXml(); -//]]> + //]]> </script> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/system/variable/js.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/system/variable/js.phtml index 8dc7adb27973d4972d70a480925836313f30f274..65f2a32c38fe3f518fcc7749ddc0f86fa93a9c6a 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/system/variable/js.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/system/variable/js.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/tag.xml b/app/code/core/Mage/Adminhtml/view/adminhtml/tag.xml index 2834b470a9a1cace964bdcfe88796d5afa82d67d..7f036133d956157253c3b56cf1227b32903d4c20 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/tag.xml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/tag.xml @@ -21,7 +21,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> @@ -49,4 +49,40 @@ <remove name="root" /> <block type="Mage_Adminhtml_Block_Tag_Assigned_Grid" name="assigned_grid" output="toHtml" /> </adminhtml_tag_assignedgridonly> + + <adminhtml_tag_index> + <reference name="content"> + <block type="Mage_Adminhtml_Block_Tag_Tag" name="adminhtml.tag.tag"/> + </reference> + </adminhtml_tag_index> + + <adminhtml_tag_pending> + <reference name="content"> + <block type="Mage_Adminhtml_Block_Tag_Pending" name="adminhtml.tag.pending"/> + </reference> + </adminhtml_tag_pending> + + <adminhtml_tag_ajaxgrid> + <block type="Mage_Core_Block_Text_List" name="root" output="toHtml"> + <block type="Mage_Adminhtml_Block_Tag_Tag_Grid" name="adminhtml.tag.tag.grid"/> + </block> + </adminhtml_tag_ajaxgrid> + + <adminhtml_tag_ajaxpendinggrid> + <block type="Mage_Core_Block_Text_List" name="root" output="toHtml"> + <block type="Mage_Adminhtml_Block_Tag_Grid_Pending" name="adminhtml.tag.grid.pending"/> + </block> + </adminhtml_tag_ajaxpendinggrid> + + <adminhtml_tag_product> + <block type="Mage_Core_Block_Text_List" name="root" output="toHtml"> + <block type="Mage_Adminhtml_Block_Tag_Product_Grid" name="adminhtml.tag.product.grid"/> + </block> + </adminhtml_tag_product> + + <adminhtml_tag_customer> + <block type="Mage_Core_Block_Text_List" name="root" output="toHtml"> + <block type="Mage_Adminhtml_Block_Tag_Customer_Grid" name="adminhtml.tag.customer.grid"/> + </block> + </adminhtml_tag_customer> </layout> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/tag/edit/container.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/tag/edit/container.phtml index 14af436f9fd6e3466dff16767bc0cd27269b2634..0d7f20b9d3677229eef848c7914f6c49e28de426 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/tag/edit/container.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/tag/edit/container.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/tag/index.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/tag/index.phtml index e5c5e79af6f6927a88ceec75d8c1156ecfb4c198..6a64592b2ddea26507667f6de6a73459927d8338 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/tag/index.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/tag/index.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/tax/class/page/edit.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/tax/class/page/edit.phtml index 23ed082ffd50a07f65bf112cd6cae9310dbc03da..7a5391e95dba8c1bd23c8b4d7b5eaeb89cdb3855 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/tax/class/page/edit.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/tax/class/page/edit.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/tax/importExport.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/tax/importExport.phtml index 2a3770900a3bc8b8afbc23339e05002db6be9cb5..9e09822fd30e5d456bd6b8cea0693a12a3b5a218 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/tax/importExport.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/tax/importExport.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/tax/rate/form.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/tax/rate/form.phtml index 253ac8d871b557322132cbd53ba9706033d1f259..55c7efdac469ab2a602c45d850a250f1306e0e4a 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/tax/rate/form.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/tax/rate/form.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/tax/rate/title.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/tax/rate/title.phtml index 721438fe3f214f83b865acf37c02f0acfd63a3ef..e64b44a393c3710b034f73c4167c35839ff25679 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/tax/rate/title.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/tax/rate/title.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/tax/toolbar/class/add.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/tax/toolbar/class/add.phtml index caa4c17c72d675e9b1a21cd9b4fd1629d08ebae8..d34398a4ee1cfda12d985f36db0e22791ebdb6a2 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/tax/toolbar/class/add.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/tax/toolbar/class/add.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -29,7 +29,7 @@ <tr> <td style="width:50%;"><h3 class="icon-head head-tax"><?php echo $header ?></h3></td> <td class="form-buttons"> - <button class="scalable add" onclick="window.location.href='<?php echo $createUrl ?>'"><span><?php echo Mage::helper('Mage_Tax_Helper_Data')->__('Add New Class') ?></span></button> + <button class="scalable add" onclick="window.location.href='<?php echo $createUrl ?>'"><span><span><span><?php echo Mage::helper('Mage_Tax_Helper_Data')->__('Add New Class') ?></span></span></span></button> </td> </tr> </table> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/tax/toolbar/class/save.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/tax/toolbar/class/save.phtml index 0f846b5d719c8f26577a4199da12c066d8a242e0..29dc54c21ea6e211a46a2b484283fcf0bb776a2d 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/tax/toolbar/class/save.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/tax/toolbar/class/save.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/tax/toolbar/rate/add.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/tax/toolbar/rate/add.phtml index c099c6227cec4811409bfb2cbe357f4821c6c4b9..f1edfc322b1cece4356ad34c41cb44d844d6ade6 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/tax/toolbar/rate/add.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/tax/toolbar/rate/add.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/tax/toolbar/rate/save.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/tax/toolbar/rate/save.phtml index 5f7e4ef32665acffdc4fa90f19e5b26ec912be2d..cdde037d888221ce84bf3e21463b37120c788750 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/tax/toolbar/rate/save.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/tax/toolbar/rate/save.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/tax/toolbar/rule/add.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/tax/toolbar/rule/add.phtml index 9a602d46ede66784e21700772127bd03b46c5d73..f9070d02eb07588341ac139cbb29fc2e6af16bce 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/tax/toolbar/rule/add.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/tax/toolbar/rule/add.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -29,7 +29,7 @@ <tr> <td style="width:50%;"><h3 class="icon-head head-tax"><?php echo $header ?></h3></td> <td class="form-buttons"> - <button class="scalable add" onclick="window.location.href='<?php echo $createUrl ?>'"><span><?php echo Mage::helper('Mage_Tax_Helper_Data')->__('Add New Tax Rule') ?></span></button> + <button class="scalable add" onclick="window.location.href='<?php echo $createUrl ?>'"><span><span><span><?php echo Mage::helper('Mage_Tax_Helper_Data')->__('Add New Tax Rule') ?></span></span></span></button> </td> </tr> </table> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/tax/toolbar/rule/save.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/tax/toolbar/rule/save.phtml index e9b12ec3018c1ac6c0bde2a8741bdb388f2245eb..356fe3e6a63a92dc4d8997d1f068dbce54b811ea 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/tax/toolbar/rule/save.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/tax/toolbar/rule/save.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/urlrewrite/categories.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/urlrewrite/categories.phtml index 3a160365c868218790e525f697aa43d6a57dae60..32d1c022618aa3d3eabdd1f3dd6ecdc59e9a2314 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/urlrewrite/categories.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/urlrewrite/categories.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/urlrewrite/edit.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/urlrewrite/edit.phtml index 57be9648f473e7b940bee301b0d89e9a49ee54f1..7ae6052b52f01109d5916e3c1fc229f51f496290 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/urlrewrite/edit.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/urlrewrite/edit.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/urlrewrite/selector.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/urlrewrite/selector.phtml index cc650ee93415f631d7c4dd75af82d528cc6def99..8522feb6cee295cba05c450c2a30156ae672ce28 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/urlrewrite/selector.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/urlrewrite/selector.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/variables.js b/app/code/core/Mage/Adminhtml/view/adminhtml/variables.js index 8b54d92d5ed400205876d4e27c4fe6e267f4909e..cf9ffd27bdbe3996a804bd661809af63b3daa0be 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/variables.js +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/variables.js @@ -19,7 +19,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/widget/accordion.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/widget/accordion.phtml index ea1e4638d8680da8b8bb3b0427e83e66bf6295bd..38a15353a9b2ec4fe99069b1e564d17edaafc247 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/widget/accordion.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/widget/accordion.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -29,11 +29,11 @@ * Template for Mage_Adminhtml_Block_Widget_Accordion */ ?> -<dl id="<?php echo $this->getHtmlId() ?>" class="accordion"> +<dl id="tab_content_<?php echo $this->getHtmlId() ?>" name="tab_content_<?php echo $this->getHtmlId() ?>" class="accordion"> <?php foreach ($this->getItems() as $_item): ?> <?php echo $this->getChildHtml($_item->getId()) ?> <?php endforeach ?> </dl> <script type="text/javascript"> - <?php echo $this->getHtmlId() ?>AccordionJs = new varienAccordion('<?php echo $this->getHtmlId() ?>', '<?php echo $this->getShowOnlyOne() ?>'); + tab_content_<?php echo $this->getHtmlId() ?>AccordionJs = new varienAccordion('tab_content_<?php echo $this->getHtmlId() ?>', '<?php echo $this->getShowOnlyOne() ?>'); </script> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/widget/breadcrumbs.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/widget/breadcrumbs.phtml index e1bad537b688c713ffbde0d6b4560ba221b21995..24668763af5c089a09d389d4faf135ea02629154 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/widget/breadcrumbs.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/widget/breadcrumbs.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/widget/form.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/widget/form.phtml index c048a166a08f11f6ba1022e4b8e48ae8014041e0..04a297f0adb82537d7161778c7de941b057b8d62 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/widget/form.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/widget/form.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/widget/form/container.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/widget/form/container.phtml index fc0f9f8191526fb20e4e3f1cf17d48a75f2ec879..9fd68966b19247b829bb511ae886f13921d1ddcb 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/widget/form/container.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/widget/form/container.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/widget/form/element.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/widget/form/element.phtml index fce21172174d6e42c4f7138bfd2ec53897d1254f..ebf3c96263f3940b6fec1883106d4ec8a4b8103c 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/widget/form/element.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/widget/form/element.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/widget/form/element/gallery.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/widget/form/element/gallery.phtml index 592ea9f7972e8703e809ea9675a59d2a354a19db..68770dce8491798196070cc1d93d95bd64361ff4 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/widget/form/element/gallery.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/widget/form/element/gallery.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/widget/form/renderer/element.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/widget/form/renderer/element.phtml index 9f4fb73b85efdfd2556a07eb016e3fe4df2b534b..4348f5861827e233b639866696bc82503d04c66f 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/widget/form/renderer/element.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/widget/form/renderer/element.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/widget/form/renderer/fieldset.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/widget/form/renderer/fieldset.phtml index 36e698e001d2187c14f80febf5d10b6a534680dd..78d7b3c7490fbcf5257fc9ac14b7efa5a42b69bf 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/widget/form/renderer/fieldset.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/widget/form/renderer/fieldset.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/widget/form/renderer/fieldset/element.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/widget/form/renderer/fieldset/element.phtml index 8269cda7d4846a92fea289d2159c16e6f8373b65..6b783b76a72308370e9b274378c536ddce3330ac 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/widget/form/renderer/fieldset/element.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/widget/form/renderer/fieldset/element.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/widget/grid.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/widget/grid.phtml index 15220c0343e34b032b6ebb7378316e757ccaf5ce..0f004f1d83cf5a0a631ddf9d532dde35e1596da8 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/widget/grid.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/widget/grid.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/widget/grid/container.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/widget/grid/container.phtml index e8acc20ef976424b41c8d80c4a6ff3070056fe31..fb76b3c55b338d0b16eef70cd74a4b0053b8e832 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/widget/grid/container.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/widget/grid/container.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/widget/grid/massaction.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/widget/grid/massaction.phtml index 76be70bad73888fce736513650488e48947cd2ad..1c0855161f34f5ffe18a213d8752878b8f2edef7 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/widget/grid/massaction.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/widget/grid/massaction.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -42,7 +42,9 @@ <td> <div class="right"> <div class="entry-edit"> + <?php if ($this->getHideFormElement() !== true):?> <form action="" id="<?php echo $this->getHtmlId() ?>-form" method="post"> + <?php endif ?> <?php echo $this->getBlockHtml('formkey')?> <fieldset> <span class="field-row"> @@ -60,7 +62,9 @@ <?php echo $this->getApplyButtonHtml() ?> </span> </fieldset> + <?php if ($this->getHideFormElement() !== true):?> </form> + <?php endif ?> </div> <div class="no-display"> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/widget/grid/serializer.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/widget/grid/serializer.phtml index 86dd54e07f647f5965cf5de0a8e63b774acd7f86..cda25d5e381f7818065db0efab0551261e85b8c0 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/widget/grid/serializer.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/widget/grid/serializer.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/widget/tabs.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/widget/tabs.phtml index 760c858bc3b8689c46b2915aeaa1e85dfc93401a..723f9c4e82edf5feec9e9e3cf4d87f9ef3669691 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/widget/tabs.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/widget/tabs.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/widget/tabshoriz.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/widget/tabshoriz.phtml index c90300dbe9c32055458df544902e4ba8fa173272..81f5df1d4773f805ce36ae03b8bbbfdc1b68d673 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/widget/tabshoriz.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/widget/tabshoriz.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/widget/tabsleft.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/widget/tabsleft.phtml index c7e8e4bb369d54a494b9199f53183e4b67ec6951..fec2c9b0f7f807459ad21e3d24e9d625e8741040 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/widget/tabsleft.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/widget/tabsleft.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/widget/view/container.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/widget/view/container.phtml index e4e318581d2ece3840570a5c6aa5acdfa90870c6..2fed87758217e47f612b58dfca516591314accee 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/widget/view/container.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/widget/view/container.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Api/Controller/Action.php b/app/code/core/Mage/Api/Controller/Action.php index f8274cf838abbf9c194fe99fdf508cfef4a26ebd..8781fda354c808261b1e46f9f3a0d6a17d17bf27 100644 --- a/app/code/core/Mage/Api/Controller/Action.php +++ b/app/code/core/Mage/Api/Controller/Action.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Exception.php b/app/code/core/Mage/Api/Exception.php index 2e52caaa089d68865cb8bd0491e26615c2be88fc..ebd3fd8de641c14e6f284827937174afe27f570e 100644 --- a/app/code/core/Mage/Api/Exception.php +++ b/app/code/core/Mage/Api/Exception.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Helper/Data.php b/app/code/core/Mage/Api/Helper/Data.php index 0ededf84745034b2e619266c6283ea261cd19090..b604fc672b3200303821b258b8c84a28ea7f92fe 100644 --- a/app/code/core/Mage/Api/Helper/Data.php +++ b/app/code/core/Mage/Api/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/Acl.php b/app/code/core/Mage/Api/Model/Acl.php index a47f7931b9c3251d77953b4c5544b9b25c9a687d..5a873750fd34b5bac6b578b049446918d18a2761 100644 --- a/app/code/core/Mage/Api/Model/Acl.php +++ b/app/code/core/Mage/Api/Model/Acl.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/Acl/Resource.php b/app/code/core/Mage/Api/Model/Acl/Resource.php index 514819c0be13e1dc241699851410a19a9d55692d..1157e6da21e05eca15e86e2b62cd67696c01301f 100644 --- a/app/code/core/Mage/Api/Model/Acl/Resource.php +++ b/app/code/core/Mage/Api/Model/Acl/Resource.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/Acl/Role.php b/app/code/core/Mage/Api/Model/Acl/Role.php index 9fdbe47b28bd7c4af2be0ddc070e34c0e8722ed0..f3723bf424535e2bff8d826cf36564dad44a6f88 100644 --- a/app/code/core/Mage/Api/Model/Acl/Role.php +++ b/app/code/core/Mage/Api/Model/Acl/Role.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/Acl/Role/Generic.php b/app/code/core/Mage/Api/Model/Acl/Role/Generic.php index 3a145bd249d4ffd6c9d02b3e3993c9452d91df4f..4323e48c1e9238f8f7cd738b99e5d9e4a5f602d0 100644 --- a/app/code/core/Mage/Api/Model/Acl/Role/Generic.php +++ b/app/code/core/Mage/Api/Model/Acl/Role/Generic.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/Acl/Role/Group.php b/app/code/core/Mage/Api/Model/Acl/Role/Group.php index ebb710d7b0f392729d378b53ff78ee782b16d066..fc6ca50bb72d238694414ffae6d56e5c989dc60a 100644 --- a/app/code/core/Mage/Api/Model/Acl/Role/Group.php +++ b/app/code/core/Mage/Api/Model/Acl/Role/Group.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/Acl/Role/Registry.php b/app/code/core/Mage/Api/Model/Acl/Role/Registry.php index 6744f5ef53ec80b9e1b4841d842e0fc1a08f4694..0a42cc0efb341a49b2cbaef27fca21d2de157acf 100644 --- a/app/code/core/Mage/Api/Model/Acl/Role/Registry.php +++ b/app/code/core/Mage/Api/Model/Acl/Role/Registry.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/Acl/Role/User.php b/app/code/core/Mage/Api/Model/Acl/Role/User.php index dde5d2b3116b35cfc95f212217c00fcd7e7e4e03..bade58da92acd2312d7a8793dac67f9c56087567 100644 --- a/app/code/core/Mage/Api/Model/Acl/Role/User.php +++ b/app/code/core/Mage/Api/Model/Acl/Role/User.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/Config.php b/app/code/core/Mage/Api/Model/Config.php index 77abc5aec1c339c037bca1df25dc64d7a6628c37..e8b70d3a8296ec3e08e434332c193c54b30d5805 100644 --- a/app/code/core/Mage/Api/Model/Config.php +++ b/app/code/core/Mage/Api/Model/Config.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/Resource/Abstract.php b/app/code/core/Mage/Api/Model/Resource/Abstract.php index ad770c63bd5e3f81a74d3c1e2f02e0c0644536c6..549e349178f01d03a8a12f102624ce6194e42af7 100644 --- a/app/code/core/Mage/Api/Model/Resource/Abstract.php +++ b/app/code/core/Mage/Api/Model/Resource/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/Resource/Acl.php b/app/code/core/Mage/Api/Model/Resource/Acl.php index 78ef2fbbd9de4fbfcef0b00a71a3f9fff95df60a..9fefdc2c91bb520549079bee796682feb2cb1048 100755 --- a/app/code/core/Mage/Api/Model/Resource/Acl.php +++ b/app/code/core/Mage/Api/Model/Resource/Acl.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/Resource/Acl/Role.php b/app/code/core/Mage/Api/Model/Resource/Acl/Role.php index 6652490513fca71fefe4a0c69049e8755769cfae..b4eb87b3b613f89a9be46c7fc1cff4b871220979 100755 --- a/app/code/core/Mage/Api/Model/Resource/Acl/Role.php +++ b/app/code/core/Mage/Api/Model/Resource/Acl/Role.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/Resource/Acl/Role/Collection.php b/app/code/core/Mage/Api/Model/Resource/Acl/Role/Collection.php index a073ed37a5d322a221672ccfc071300814843b7a..eaa7968118474569a4ddad4eaf7ec110345db5f6 100755 --- a/app/code/core/Mage/Api/Model/Resource/Acl/Role/Collection.php +++ b/app/code/core/Mage/Api/Model/Resource/Acl/Role/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/Resource/Permissions/Collection.php b/app/code/core/Mage/Api/Model/Resource/Permissions/Collection.php index 49d73abe31dc06e321069d2b595816060df3f884..a6ef7ebb706e8228ae51a1bec2e0deb9d3beec6e 100755 --- a/app/code/core/Mage/Api/Model/Resource/Permissions/Collection.php +++ b/app/code/core/Mage/Api/Model/Resource/Permissions/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/Resource/Role.php b/app/code/core/Mage/Api/Model/Resource/Role.php index 507a1b63eb1d7c588a0f59a91df24162a2bee371..ae39a30c9033bedf60ad88df300887140b8b53c4 100755 --- a/app/code/core/Mage/Api/Model/Resource/Role.php +++ b/app/code/core/Mage/Api/Model/Resource/Role.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/Resource/Role/Collection.php b/app/code/core/Mage/Api/Model/Resource/Role/Collection.php index c52c34d99b2cc9844cf62d376a2a65e97e552c20..a490823768fc826e55b53b29294d6f706cd4cae3 100755 --- a/app/code/core/Mage/Api/Model/Resource/Role/Collection.php +++ b/app/code/core/Mage/Api/Model/Resource/Role/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/Resource/Roles.php b/app/code/core/Mage/Api/Model/Resource/Roles.php index 8b6f8bcbbb23b1c5b48d7eb7915dee06e200dfb2..43448bd61ceb1228988761b989f0e560f4e1b8b1 100755 --- a/app/code/core/Mage/Api/Model/Resource/Roles.php +++ b/app/code/core/Mage/Api/Model/Resource/Roles.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/Resource/Roles/Collection.php b/app/code/core/Mage/Api/Model/Resource/Roles/Collection.php index 1a72e9f9880c0b6950e79bc9d975c2a1a7040502..e0def9cb02c647437139a0314e32ab43ff760a12 100755 --- a/app/code/core/Mage/Api/Model/Resource/Roles/Collection.php +++ b/app/code/core/Mage/Api/Model/Resource/Roles/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/Resource/Roles/User/Collection.php b/app/code/core/Mage/Api/Model/Resource/Roles/User/Collection.php index b3861edd220be20d1bd0a7958d35b524f4bd32bc..4b282900e2fcab2bdf6ed922a6d19cbd8ec65ba0 100755 --- a/app/code/core/Mage/Api/Model/Resource/Roles/User/Collection.php +++ b/app/code/core/Mage/Api/Model/Resource/Roles/User/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/Resource/Rules.php b/app/code/core/Mage/Api/Model/Resource/Rules.php index 7a65f1b405d3c7197760b7ac267b47bc58e5d410..82052d38cc889ee62094eb8b8ef2cc02bba00448 100755 --- a/app/code/core/Mage/Api/Model/Resource/Rules.php +++ b/app/code/core/Mage/Api/Model/Resource/Rules.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/Resource/Rules/Collection.php b/app/code/core/Mage/Api/Model/Resource/Rules/Collection.php index 774d6d49052a1990595c96df4f686c5d6a77af66..48dc8a7b34900fa7c9d875f4b81451e057ccbc98 100755 --- a/app/code/core/Mage/Api/Model/Resource/Rules/Collection.php +++ b/app/code/core/Mage/Api/Model/Resource/Rules/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/Resource/User.php b/app/code/core/Mage/Api/Model/Resource/User.php index b960fc862738ffddf3b1bfbd6415daa657ea6827..878de72994be7107679569475b3c2439068db9b3 100755 --- a/app/code/core/Mage/Api/Model/Resource/User.php +++ b/app/code/core/Mage/Api/Model/Resource/User.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/Resource/User/Collection.php b/app/code/core/Mage/Api/Model/Resource/User/Collection.php index 13a632799a2527dc3098d4ba4ef73969de19e87c..9577cf9cc06b4278b84f0a9f253492536f85ab0b 100755 --- a/app/code/core/Mage/Api/Model/Resource/User/Collection.php +++ b/app/code/core/Mage/Api/Model/Resource/User/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/Role.php b/app/code/core/Mage/Api/Model/Role.php index e0978371db884b3557403400d8da08540c9ecfc6..599ca42fab4b2329fbbb490f078d2fc7ce5d5e00 100644 --- a/app/code/core/Mage/Api/Model/Role.php +++ b/app/code/core/Mage/Api/Model/Role.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/Roles.php b/app/code/core/Mage/Api/Model/Roles.php index d1f63492acc1692bc033d5eea5d69b944656fe1d..69a3b30e2a67b38d9c7b146691147570656c1b2c 100644 --- a/app/code/core/Mage/Api/Model/Roles.php +++ b/app/code/core/Mage/Api/Model/Roles.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/Rules.php b/app/code/core/Mage/Api/Model/Rules.php index b8e95d003182bb42992090fa70dcbd52efc45374..8c319032a952be2819315be4f5242f7c34cc217d 100644 --- a/app/code/core/Mage/Api/Model/Rules.php +++ b/app/code/core/Mage/Api/Model/Rules.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/Server.php b/app/code/core/Mage/Api/Model/Server.php index 29dc0b5440e051b300effef51c36248a1991613c..536d0fd8c1462aeb2695e413e479e83085074930 100644 --- a/app/code/core/Mage/Api/Model/Server.php +++ b/app/code/core/Mage/Api/Model/Server.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/Server/Adapter/Interface.php b/app/code/core/Mage/Api/Model/Server/Adapter/Interface.php index f5ee1916e7d4fa84a77d09550b11745e1c5c5182..e48430c4f60e682134bf5cee5d3fa0bbd9a9f066 100644 --- a/app/code/core/Mage/Api/Model/Server/Adapter/Interface.php +++ b/app/code/core/Mage/Api/Model/Server/Adapter/Interface.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/Server/Adapter/Soap.php b/app/code/core/Mage/Api/Model/Server/Adapter/Soap.php index 818abbbfa5224ae6a635025484b3d0c685c09fa3..c46832bb1dc21ec9a075dfb2b070822a1600e7b1 100644 --- a/app/code/core/Mage/Api/Model/Server/Adapter/Soap.php +++ b/app/code/core/Mage/Api/Model/Server/Adapter/Soap.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/Server/Adapter/Xmlrpc.php b/app/code/core/Mage/Api/Model/Server/Adapter/Xmlrpc.php index e5dfdf8ebc1c463fa17f4a72718a68052d0fc47d..18b8bebeaff5e842d8ee9848c9d503e35c00ff7b 100644 --- a/app/code/core/Mage/Api/Model/Server/Adapter/Xmlrpc.php +++ b/app/code/core/Mage/Api/Model/Server/Adapter/Xmlrpc.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/Server/Handler.php b/app/code/core/Mage/Api/Model/Server/Handler.php index 29b42ef0cfc82df5a70039d52a1812c8c15fb3f4..4c4181b77e0fe72cf00f22272982bc8926809c8f 100644 --- a/app/code/core/Mage/Api/Model/Server/Handler.php +++ b/app/code/core/Mage/Api/Model/Server/Handler.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/Server/Handler/Abstract.php b/app/code/core/Mage/Api/Model/Server/Handler/Abstract.php index 432e09c868d9a6265f6a4aed8f91376e0f979d39..7f7b549d01fa4eb26de2f076c64861e942e67e56 100644 --- a/app/code/core/Mage/Api/Model/Server/Handler/Abstract.php +++ b/app/code/core/Mage/Api/Model/Server/Handler/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/Server/V2/Adapter/Soap.php b/app/code/core/Mage/Api/Model/Server/V2/Adapter/Soap.php index 6071193a5bd7ec2fc358c1e453e87c9985b41e25..a9cbeaa622fab2876d61dea09e025c12af44dc0f 100644 --- a/app/code/core/Mage/Api/Model/Server/V2/Adapter/Soap.php +++ b/app/code/core/Mage/Api/Model/Server/V2/Adapter/Soap.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/Server/V2/Handler.php b/app/code/core/Mage/Api/Model/Server/V2/Handler.php index c615d9cc315f3d55f6e6744f9364ca36ef43a79a..978a42372f65001f91b944486c44e6e0919bc6e4 100644 --- a/app/code/core/Mage/Api/Model/Server/V2/Handler.php +++ b/app/code/core/Mage/Api/Model/Server/V2/Handler.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/Server/Wsi/Adapter/Soap.php b/app/code/core/Mage/Api/Model/Server/Wsi/Adapter/Soap.php index f9b6572709811705a52918bf4453abc81e337892..7b3a4963b34cdb2f2c6714154ea478b37427d168 100644 --- a/app/code/core/Mage/Api/Model/Server/Wsi/Adapter/Soap.php +++ b/app/code/core/Mage/Api/Model/Server/Wsi/Adapter/Soap.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/Server/Wsi/Handler.php b/app/code/core/Mage/Api/Model/Server/Wsi/Handler.php index 38c44e871e2bbe778f122eddae11c8764d31f0a7..0192d728913dbafdf27f70581a1c84a111bdc91f 100644 --- a/app/code/core/Mage/Api/Model/Server/Wsi/Handler.php +++ b/app/code/core/Mage/Api/Model/Server/Wsi/Handler.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/Session.php b/app/code/core/Mage/Api/Model/Session.php index 79519a7d5601d3f710e49ffef6a99812cb3b55cb..e6624481c9e51c2cb5f6516e401369576571c568 100644 --- a/app/code/core/Mage/Api/Model/Session.php +++ b/app/code/core/Mage/Api/Model/Session.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/User.php b/app/code/core/Mage/Api/Model/User.php index 93a42209c5818038e04eae3b8da5d9f96c1aa314..ee5e139283ded099775283a5d4863f7efd039cef 100644 --- a/app/code/core/Mage/Api/Model/User.php +++ b/app/code/core/Mage/Api/Model/User.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -56,6 +56,13 @@ */ class Mage_Api_Model_User extends Mage_Core_Model_Abstract { + /** + * Prefix of model events names + * + * @var string + */ + protected $_eventPrefix = 'api_user'; + protected function _construct() { $this->_init('Mage_Api_Model_Resource_User'); diff --git a/app/code/core/Mage/Api/Model/Wsdl/Config.php b/app/code/core/Mage/Api/Model/Wsdl/Config.php index 6c5580074005c479be9d347ab3daa8d53ca7db5f..f94bf37991bed68148ad3b6f0c8e1528dc50c341 100644 --- a/app/code/core/Mage/Api/Model/Wsdl/Config.php +++ b/app/code/core/Mage/Api/Model/Wsdl/Config.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/Wsdl/Config/Base.php b/app/code/core/Mage/Api/Model/Wsdl/Config/Base.php index 72dd66bc8d79b8604523b374064c0b2112cac17e..49db9a717d8388e2b522ea881dc35609112486d1 100644 --- a/app/code/core/Mage/Api/Model/Wsdl/Config/Base.php +++ b/app/code/core/Mage/Api/Model/Wsdl/Config/Base.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/Model/Wsdl/Config/Element.php b/app/code/core/Mage/Api/Model/Wsdl/Config/Element.php index d44a987a48fd80eec15691746929d64e93ae0ccb..fe11244090b599c24d48ccc0bb29d68eca196c39 100644 --- a/app/code/core/Mage/Api/Model/Wsdl/Config/Element.php +++ b/app/code/core/Mage/Api/Model/Wsdl/Config/Element.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/controllers/IndexController.php b/app/code/core/Mage/Api/controllers/IndexController.php index fb724559977f4d7676a45f4fb01f75e5cb0f7831..39753e5924bbd6b3034872c160b2ee04a6cb4fd6 100644 --- a/app/code/core/Mage/Api/controllers/IndexController.php +++ b/app/code/core/Mage/Api/controllers/IndexController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/controllers/SoapController.php b/app/code/core/Mage/Api/controllers/SoapController.php index 3674c65c25bd48e4e481d134463f957e1f746faa..91f4ec7b8cea98fa8a01d96c1880a29dfd0e4363 100644 --- a/app/code/core/Mage/Api/controllers/SoapController.php +++ b/app/code/core/Mage/Api/controllers/SoapController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/controllers/V2/SoapController.php b/app/code/core/Mage/Api/controllers/V2/SoapController.php index 6f183b5d27225b098018b514a34b69abd90c7e38..18395b95af8fddb3e74d1250564a1ffcf461229a 100644 --- a/app/code/core/Mage/Api/controllers/V2/SoapController.php +++ b/app/code/core/Mage/Api/controllers/V2/SoapController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/controllers/XmlrpcController.php b/app/code/core/Mage/Api/controllers/XmlrpcController.php index 29a0edb8b4d7ea2bb7d2b8a6b08566f0a9e9fe48..1573ed59069378f4bc539c7aa32e52e7b82cdb56 100644 --- a/app/code/core/Mage/Api/controllers/XmlrpcController.php +++ b/app/code/core/Mage/Api/controllers/XmlrpcController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Api/etc/adminhtml.xml b/app/code/core/Mage/Api/etc/adminhtml.xml index a3d1fb4d07d701132955cc34147560cb7fb800ac..a756ac4538ee1314f02c716b05839d66f1a9dfec 100644 --- a/app/code/core/Mage/Api/etc/adminhtml.xml +++ b/app/code/core/Mage/Api/etc/adminhtml.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Api/etc/api.xml b/app/code/core/Mage/Api/etc/api.xml index 3989d783347625accbd0dafde3f96aedb9d8d2b9..695ee9b259e88c2cc0ce8bcc3bf09e5dbb5ced4d 100644 --- a/app/code/core/Mage/Api/etc/api.xml +++ b/app/code/core/Mage/Api/etc/api.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Api/etc/config.xml b/app/code/core/Mage/Api/etc/config.xml index f1d7bab35da0532a20c4824a8a447718324f4e12..2492346a4a278400565cf06b0f7c6b71b4d65938 100644 --- a/app/code/core/Mage/Api/etc/config.xml +++ b/app/code/core/Mage/Api/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Api/etc/system.xml b/app/code/core/Mage/Api/etc/system.xml index 25818a76a17da874832035b2dbfd827f4d115a0c..bc9c8e122b484c2af997317713d51bb1b8f12924 100644 --- a/app/code/core/Mage/Api/etc/system.xml +++ b/app/code/core/Mage/Api/etc/system.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Api/sql/api_setup/install-1.6.0.0.php b/app/code/core/Mage/Api/sql/api_setup/install-1.6.0.0.php index fb9df666844f92a55dcbd348caac13c320832f54..68bb78a1570c82fe32b991ec6c915adeff0c50ee 100644 --- a/app/code/core/Mage/Api/sql/api_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/Api/sql/api_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Authorizenet/Block/Directpost/Form.php b/app/code/core/Mage/Authorizenet/Block/Directpost/Form.php index e1bdfe5d4df019d1520e104f7a94437cc19d60c5..355e2422e066e61c63cff4b48dc083556abe0a20 100644 --- a/app/code/core/Mage/Authorizenet/Block/Directpost/Form.php +++ b/app/code/core/Mage/Authorizenet/Block/Directpost/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Authorizenet - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Authorizenet/Block/Directpost/Iframe.php b/app/code/core/Mage/Authorizenet/Block/Directpost/Iframe.php index a450291edbbd0502b552692a1e79eaccd920fea8..9cadfc3ccdd53c5f002ac743ca2c07e6d99c0561 100644 --- a/app/code/core/Mage/Authorizenet/Block/Directpost/Iframe.php +++ b/app/code/core/Mage/Authorizenet/Block/Directpost/Iframe.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Authorizenet - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Authorizenet/Helper/Data.php b/app/code/core/Mage/Authorizenet/Helper/Data.php index bc63f67119d59a5d6fcd04b052e9320f4e7330cb..a7298578ea93df47e5554233e39dc8807ae70248 100755 --- a/app/code/core/Mage/Authorizenet/Helper/Data.php +++ b/app/code/core/Mage/Authorizenet/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Authorizenet - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Authorizenet/Model/Directpost.php b/app/code/core/Mage/Authorizenet/Model/Directpost.php index 9efc94c97307a269d0264ae9fd3aee34c2ef992a..e4eee4781bf84ca3d7a1e14cbfea9cdcfa9507c3 100644 --- a/app/code/core/Mage/Authorizenet/Model/Directpost.php +++ b/app/code/core/Mage/Authorizenet/Model/Directpost.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Authorizenet - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Authorizenet/Model/Directpost/Observer.php b/app/code/core/Mage/Authorizenet/Model/Directpost/Observer.php index 75f2fdcef2bfd59ce832b930f66d56aac8a2649f..6477f12ce0ba04ba4a3e33b94b5b0ae052717401 100644 --- a/app/code/core/Mage/Authorizenet/Model/Directpost/Observer.php +++ b/app/code/core/Mage/Authorizenet/Model/Directpost/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Authorizenet - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Authorizenet/Model/Directpost/Request.php b/app/code/core/Mage/Authorizenet/Model/Directpost/Request.php index 2d66651dff6491737664c21d2847e39eec990f0b..57fcd15eebd082822eda0ee85459dd62600c3918 100644 --- a/app/code/core/Mage/Authorizenet/Model/Directpost/Request.php +++ b/app/code/core/Mage/Authorizenet/Model/Directpost/Request.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Authorizenet - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Authorizenet/Model/Directpost/Response.php b/app/code/core/Mage/Authorizenet/Model/Directpost/Response.php index 4f47518cae8790aba65331f5b4db85cfb66e45f2..9486793f8878ef2ae0a79461e9253e19e5eda422 100644 --- a/app/code/core/Mage/Authorizenet/Model/Directpost/Response.php +++ b/app/code/core/Mage/Authorizenet/Model/Directpost/Response.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Authorizenet - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Authorizenet/Model/Directpost/Session.php b/app/code/core/Mage/Authorizenet/Model/Directpost/Session.php index b7b9d53be184788b3c065a3f5323f3883101a464..a827b6deb300c30ad4ddf1cfaf08ef7f1b93e514 100644 --- a/app/code/core/Mage/Authorizenet/Model/Directpost/Session.php +++ b/app/code/core/Mage/Authorizenet/Model/Directpost/Session.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Authorizenet - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Authorizenet/controllers/Adminhtml/Authorizenet/Directpost/PaymentController.php b/app/code/core/Mage/Authorizenet/controllers/Adminhtml/Authorizenet/Directpost/PaymentController.php index 9162394ad4c7c616f40fbdb50b89acbdfbf56ca8..8be65c3f7c72149703a0bfca3f755bffdfd64997 100644 --- a/app/code/core/Mage/Authorizenet/controllers/Adminhtml/Authorizenet/Directpost/PaymentController.php +++ b/app/code/core/Mage/Authorizenet/controllers/Adminhtml/Authorizenet/Directpost/PaymentController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Authorizenet - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Authorizenet/controllers/Directpost/PaymentController.php b/app/code/core/Mage/Authorizenet/controllers/Directpost/PaymentController.php index 995c427325a950bfdec22ba6aa8b354a91d5b061..87a489758a0629e4640b0518a2d5e78f12298655 100644 --- a/app/code/core/Mage/Authorizenet/controllers/Directpost/PaymentController.php +++ b/app/code/core/Mage/Authorizenet/controllers/Directpost/PaymentController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Authorizenet - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Authorizenet/etc/config.xml b/app/code/core/Mage/Authorizenet/etc/config.xml index 894e94d2accca1f880b6eb7117f53d40facab30f..88f8782aaab995d641ef3f771547baf8a2428ce5 100755 --- a/app/code/core/Mage/Authorizenet/etc/config.xml +++ b/app/code/core/Mage/Authorizenet/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Authorizenet - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Authorizenet/etc/system.xml b/app/code/core/Mage/Authorizenet/etc/system.xml index 52f8b54abfa81b9e68a748d02c6550cb6be9056c..2a479f02f731be9e0e7c9694bb1e838138e4f21f 100755 --- a/app/code/core/Mage/Authorizenet/etc/system.xml +++ b/app/code/core/Mage/Authorizenet/etc/system.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Authorizenet - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> @@ -210,6 +210,7 @@ <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> <show_in_store>0</show_in_store> + <frontend_class>validate-number</frontend_class> </sort_order> </fields> </authorizenet_directpost> diff --git a/app/code/core/Mage/Authorizenet/view/adminhtml/directpost/iframe.phtml b/app/code/core/Mage/Authorizenet/view/adminhtml/directpost/iframe.phtml index 35b8c0c16f9964e2ce4b99afe555633272f0fa8f..1f1d2f3a37e617af63e3a22f9fe623f9af753710 100644 --- a/app/code/core/Mage/Authorizenet/view/adminhtml/directpost/iframe.phtml +++ b/app/code/core/Mage/Authorizenet/view/adminhtml/directpost/iframe.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/Authorizenet/view/adminhtml/directpost/info.phtml b/app/code/core/Mage/Authorizenet/view/adminhtml/directpost/info.phtml index c4b65dc8b08aaba05e99992d0f9c3687e88fc3b8..419596204224439712629df6cd1e2fb885f3e8fd 100644 --- a/app/code/core/Mage/Authorizenet/view/adminhtml/directpost/info.phtml +++ b/app/code/core/Mage/Authorizenet/view/adminhtml/directpost/info.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/Authorizenet/view/adminhtml/layout.xml b/app/code/core/Mage/Authorizenet/view/adminhtml/layout.xml index 423270a2320f1907322538b6851e35ca7044057b..c8a299ed74ed29d4aed5c3702e0fe49fec18288c 100644 --- a/app/code/core/Mage/Authorizenet/view/adminhtml/layout.xml +++ b/app/code/core/Mage/Authorizenet/view/adminhtml/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/Authorizenet/view/frontend/directpost/form.phtml b/app/code/core/Mage/Authorizenet/view/frontend/directpost/form.phtml index 7ac49e2ef60651b5a7837bad5280cfb3904cb5f3..2f979a708ed5f9c1f8bcfd583331be2880faecc7 100644 --- a/app/code/core/Mage/Authorizenet/view/frontend/directpost/form.phtml +++ b/app/code/core/Mage/Authorizenet/view/frontend/directpost/form.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/Authorizenet/view/frontend/directpost/iframe.phtml b/app/code/core/Mage/Authorizenet/view/frontend/directpost/iframe.phtml index 611c034ef1952c1d107b688632e9796824787b42..9d2c612ca245be47a2f59057831ee849862ad06f 100644 --- a/app/code/core/Mage/Authorizenet/view/frontend/directpost/iframe.phtml +++ b/app/code/core/Mage/Authorizenet/view/frontend/directpost/iframe.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/Authorizenet/view/frontend/directpost/info.phtml b/app/code/core/Mage/Authorizenet/view/frontend/directpost/info.phtml index d4ba4ac82aded028b34a69698b033a9bfa23f51d..d8e6ff2275dd5499ab758749bc24762e8fda41c9 100644 --- a/app/code/core/Mage/Authorizenet/view/frontend/directpost/info.phtml +++ b/app/code/core/Mage/Authorizenet/view/frontend/directpost/info.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/Authorizenet/view/frontend/layout.xml b/app/code/core/Mage/Authorizenet/view/frontend/layout.xml index 0cde93890510a9e62fceb0341fe00efe67d0c564..558852a8590375fba13dc7ea9a5ffe06cf88cd4c 100644 --- a/app/code/core/Mage/Authorizenet/view/frontend/layout.xml +++ b/app/code/core/Mage/Authorizenet/view/frontend/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/Backup/Exception.php b/app/code/core/Mage/Backup/Exception.php index 8be06068a244fdfda3a9eac8794aaa56de868604..cbdfdc8a4e0cb4fe6d490762a787da3d4d5bd477 100644 --- a/app/code/core/Mage/Backup/Exception.php +++ b/app/code/core/Mage/Backup/Exception.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Backup - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Backup/Helper/Data.php b/app/code/core/Mage/Backup/Helper/Data.php index c9540e00e14ac59a25296188a8d3247ca8d98c7b..3f53a87aa62bbfe2802e3ed601e79d141b308a68 100644 --- a/app/code/core/Mage/Backup/Helper/Data.php +++ b/app/code/core/Mage/Backup/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Backup - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -29,5 +29,305 @@ */ class Mage_Backup_Helper_Data extends Mage_Core_Helper_Abstract { + /** + * Backup type constant for database backup + * + * @const string + */ + const TYPE_DB = 'db'; + /** + * Backup type constant for filesystem backup + * + * @const string + */ + const TYPE_FILESYSTEM = 'filesystem'; + + /** + * Backup type constant for full system backup(database + filesystem) + * + * @const string + */ + const TYPE_SYSTEM_SNAPSHOT = 'snapshot'; + + /** + * Backup type constant for media and database backup + * + * @const string + */ + const TYPE_MEDIA = 'media'; + + /** + * Backup type constant for full system backup excluding media folder + * + * @const string + */ + const TYPE_SNAPSHOT_WITHOUT_MEDIA = 'nomedia'; + + /** + * Get all possible backup type values with descriptive title + * + * @return array + */ + public function getBackupTypes() + { + return array( + self::TYPE_DB => self::__('Database'), + self::TYPE_MEDIA => self::__('Database and Media'), + self::TYPE_SYSTEM_SNAPSHOT => self::__('System'), + self::TYPE_SNAPSHOT_WITHOUT_MEDIA => self::__('System (excluding Media)') + ); + } + + /** + * Get all possible backup type values + * + * @return array + */ + public function getBackupTypesList() + { + return array( + self::TYPE_DB, + self::TYPE_SYSTEM_SNAPSHOT, + self::TYPE_SNAPSHOT_WITHOUT_MEDIA, + self::TYPE_MEDIA + ); + } + + /** + * Get default backup type value + * + * @return string + */ + public function getDefaultBackupType() + { + return self::TYPE_DB; + } + + /** + * Get directory path where backups stored + * + * @return string + */ + public function getBackupsDir() + { + return Mage::getBaseDir('var') . DS . 'backups'; + } + + /** + * Get backup file extension by backup type + * + * @param string $type + * @return string + */ + public function getExtensionByType($type) + { + $extensions = $this->getExtensions(); + return isset($extensions[$type]) ? $extensions[$type] : ''; + } + + /** + * Get all types to extensions map + * + * @return array + */ + public function getExtensions() + { + return array( + self::TYPE_SYSTEM_SNAPSHOT => 'tgz', + self::TYPE_SNAPSHOT_WITHOUT_MEDIA => 'tgz', + self::TYPE_MEDIA => 'tgz', + self::TYPE_DB => 'gz' + ); + } + + /** + * Generate backup download name + * + * @param Mage_Backup_Model_Backup $backup + * @return string + */ + public function generateBackupDownloadName(Mage_Backup_Model_Backup $backup) + { + $additionalExtension = $backup->getType() == self::TYPE_DB ? '.sql' : ''; + return $backup->getType() . '-' . date('YmdHis', $backup->getTime()) . $additionalExtension . '.' + . $this->getExtensionByType($backup->getType()); + } + + /** + * Check Permission for Rollback + * + * @return boolean + */ + public function isRollbackAllowed(){ + return Mage::getSingleton('Mage_Admin_Model_Session')->isAllowed('system/tools/backup/rollback' ); + } + + /** + * Get paths that should be ignored when creating system snapshots + * + * @return array + */ + public function getBackupIgnorePaths() + { + return array( + '.svn', + 'maintenance.flag', + Mage::getBaseDir('var') . DS . 'session', + Mage::getBaseDir('var') . DS . 'cache', + Mage::getBaseDir('var') . DS . 'full_page_cache', + Mage::getBaseDir('var') . DS . 'locks', + Mage::getBaseDir('var') . DS . 'log', + Mage::getBaseDir('var') . DS . 'report' + ); + } + + /** + * Get paths that should be ignored when rolling back system snapshots + * + * @return array + */ + public function getRollbackIgnorePaths() + { + return array( + '.svn', + 'maintenance.flag', + Mage::getBaseDir('var') . DS . 'session', + Mage::getBaseDir('var') . DS . 'locks', + Mage::getBaseDir('var') . DS . 'log', + Mage::getBaseDir('var') . DS . 'report', + Mage::getBaseDir('app') . DS . 'Mage.php', + Mage::getBaseDir() . DS . 'errors', + Mage::getBaseDir() . DS . 'index.php' + ); + } + + /** + * Put store into maintenance mode + * + * @return bool + */ + public function turnOnMaintenanceMode() + { + $maintenanceFlagFile = $this->getMaintenanceFlagFilePath(); + $result = file_put_contents($maintenanceFlagFile, 'maintenance'); + + return $result !== false; + } + + /** + * Turn off store maintenance mode + */ + public function turnOffMaintenanceMode() + { + $maintenanceFlagFile = $this->getMaintenanceFlagFilePath(); + @unlink($maintenanceFlagFile); + } + + /** + * Get backup create success message by backup type + * + * @param string $type + * @return string + */ + public function getCreateSuccessMessageByType($type) + { + $messagesMap = array( + self::TYPE_SYSTEM_SNAPSHOT => $this->__('The system backup has been created.'), + self::TYPE_SNAPSHOT_WITHOUT_MEDIA => $this->__('The system backup has been created.'), + self::TYPE_MEDIA => $this->__('The database and media backup has been created.'), + self::TYPE_DB => $this->__('The database backup has been created.') + ); + + if (!isset($messagesMap[$type])) { + return; + } + + return $messagesMap[$type]; + } + + /** + * Get path to maintenance flag file + * + * @return string + */ + protected function getMaintenanceFlagFilePath() + { + return Mage::getBaseDir() . DS . 'maintenance.flag'; + } + + /** + * Invalidate Cache + * @return Mage_Backup_Helper_Data + */ + public function invalidateCache() + { + if ($cacheTypesNode = Mage::getConfig()->getNode(Mage_Core_Model_Cache::XML_PATH_TYPES)) { + $cacheTypesList = array_keys($cacheTypesNode->asArray()); + Mage::app()->getCacheInstance()->invalidateType($cacheTypesList); + } + return $this; + } + + /** + * Invalidate Indexer + * + * @return Mage_Backup_Helper_Data + */ + public function invalidateIndexer() + { + foreach (Mage::getResourceModel('Mage_Index_Model_Resource_Process_Collection') as $process){ + $process->changeStatus(Mage_Index_Model_Process::STATUS_REQUIRE_REINDEX); + } + return $this; + } + + /** + * Creates backup's display name from it's name + * + * @param string $name + * @return string + */ + public function nameToDisplayName($name) + { + return str_replace('_', ' ', $name); + } + + /** + * Extracts information from backup's filename + * + * @param string $filename + * @return Varien_Object + */ + public function extractDataFromFilename($filename) + { + $extensions = $this->getExtensions(); + + $filenameWithoutExtension = $filename; + + foreach ($extensions as $extension) { + $filenameWithoutExtension = preg_replace('/' . preg_quote($extension, '/') . '$/', '', + $filenameWithoutExtension + ); + } + + $filenameWithoutExtension = substr($filenameWithoutExtension, 0, strrpos($filenameWithoutExtension, ".")); + + list($time, $type) = explode("_", $filenameWithoutExtension); + + $name = str_replace($time . '_' . $type, '', $filenameWithoutExtension); + + if (!empty($name)) { + $name = substr($name, 1); + } + + $result = new Varien_Object(); + $result->addData(array( + 'name' => $name, + 'type' => $type, + 'time' => $time + )); + + return $result; + } } diff --git a/app/code/core/Mage/Backup/Model/Backup.php b/app/code/core/Mage/Backup/Model/Backup.php index fb3a75d3f2b14e951c5714c72e1d4b7803cad664..8ecf82c21388784ae44a79f92625de4425d6b13b 100644 --- a/app/code/core/Mage/Backup/Model/Backup.php +++ b/app/code/core/Mage/Backup/Model/Backup.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Backup - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -29,23 +29,17 @@ * * @category Mage * @package Mage_Backup - * @author Magento Core Team <core@magentocommerce.com> + * @author Magento Core Team <core@magentocommerce.com> */ class Mage_Backup_Model_Backup extends Varien_Object { - /* backup types */ - const BACKUP_DB = 'db'; - const BACKUP_VIEW = 'view'; - const BACKUP_MEDIA = 'media'; - /* internal constants */ - const BACKUP_EXTENSION = 'gz'; const COMPRESS_RATE = 9; /** * Type of backup file * - * @var string db|media|view + * @var string */ private $_type = 'db'; @@ -65,14 +59,19 @@ class Mage_Backup_Model_Backup extends Varien_Object */ public function load($fileName, $filePath) { - list ($time, $type) = explode("_", substr($fileName, 0, strrpos($fileName, "."))); + $backupData = Mage::helper('Mage_Backup_Helper_Data')->extractDataFromFilename($fileName); + $this->addData(array( 'id' => $filePath . DS . $fileName, - 'time' => (int)$time, + 'time' => (int)$backupData->getTime(), 'path' => $filePath, - 'date_object' => new Zend_Date((int)$time) + 'extension' => Mage::helper('Mage_Backup_Helper_Data')->getExtensionByType($backupData->getType()), + 'display_name' => Mage::helper('Mage_Backup_Helper_Data')->nameToDisplayName($backupData->getName()), + 'name' => $backupData->getName(), + 'date_object' => new Zend_Date((int)$backupData->getTime(), Mage::app()->getLocale()->getLocaleCode()) )); - $this->setType($type); + + $this->setType($backupData->getType()); return $this; } @@ -93,19 +92,29 @@ class Mage_Backup_Model_Backup extends Varien_Object */ public function getFileName() { - return $this->getTime() . "_" . $this->getType() - . "." . self::BACKUP_EXTENSION; + $filename = $this->getTime() . "_" . $this->getType(); + $backupName = $this->getName(); + + if (!empty($backupName)) { + $filename .= '_' . $backupName; + } + + $filename .= '.' . Mage::helper('Mage_Backup_Helper_Data')->getExtensionByType($this->getType()); + + return $filename; } /** * Sets type of file * - * @param string $value db|media|view + * @param string $value + * @return Mage_Backup_Model_Backup */ public function setType($value='db') { - if(!in_array($value, array('db','media','view'))) { - $value = 'db'; + $possibleTypes = Mage::helper('Mage_Backup_Helper_Data')->getBackupTypesList(); + if(!in_array($value, $possibleTypes)) { + $value = Mage::helper('Mage_Backup_Helper_Data')->getDefaultBackupType(); } $this->_type = $value; @@ -117,7 +126,7 @@ class Mage_Backup_Model_Backup extends Varien_Object /** * Returns type of backup file * - * @return string db|media|view + * @return string */ public function getType() { @@ -205,6 +214,7 @@ class Mage_Backup_Model_Backup extends Varien_Object * Delete backup file * * @throws Mage_Backup_Exception + * @return Mage_Backup_Model_Backup */ public function deleteFile() { @@ -249,11 +259,12 @@ class Mage_Backup_Model_Backup extends Varien_Object $mode = $write ? 'wb' . self::COMPRESS_RATE : 'rb'; - try { - $this->_handler = gzopen($filePath, $mode); - } - catch (Exception $e) { - Mage::exception('Mage_Backup', Mage::helper('Mage_Backup_Helper_Data')->__('Backup file "%s" cannot be read from or written to.', $this->getFileName())); + $this->_handler = @gzopen($filePath, $mode); + + if (!$this->_handler) { + throw new Mage_Backup_Exception_NotEnoughPermissions( + Mage::helper('Mage_Backup_Helper_Data')->__('Backup file "%s" cannot be read from or written to.', $this->getFileName()) + ); } return $this; @@ -351,4 +362,41 @@ class Mage_Backup_Model_Backup extends Varien_Object return 0; } + + /** + * Validate user password + * + * @param string $password + * @return bool + */ + public function validateUserPassword($password) + { + $userPasswordHash = Mage::getModel('Mage_Admin_Model_Session')->getUser()->getPassword(); + return Mage::helper('Mage_Core_Helper_Data')->validateHash($password, $userPasswordHash); + } + + /** + * Load backup by it's type and creation timestamp + * + * @param int $timestamp + * @param string $type + * @return Mage_Backup_Model_Backup + */ + public function loadByTimeAndType($timestamp, $type) + { + $backupsCollection = Mage::getSingleton('Mage_Backup_Model_Fs_Collection'); + $backupId = $timestamp . '_' . $type; + + foreach ($backupsCollection as $backup) { + if ($backup->getId() == $backupId) { + $this->setType($backup->getType()) + ->setTime($backup->getTime()) + ->setName($backup->getName()) + ->setPath($backup->getPath()); + break; + } + } + + return $this; + } } diff --git a/app/code/core/Mage/Backup/Model/Config/Backend/Cron.php b/app/code/core/Mage/Backup/Model/Config/Backend/Cron.php new file mode 100644 index 0000000000000000000000000000000000000000..023b3a2fcfb85232713792998f6943201b33543e --- /dev/null +++ b/app/code/core/Mage/Backup/Model/Config/Backend/Cron.php @@ -0,0 +1,89 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Backup + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + + +/** + * Backup by cron backend model + * + * @category Mage + * @package Mage_Backup + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Backup_Model_Config_Backend_Cron extends Mage_Core_Model_Config_Data +{ + const CRON_STRING_PATH = 'crontab/jobs/system_backup/schedule/cron_expr'; + const CRON_MODEL_PATH = 'crontab/jobs/system_backup/run/model'; + + const XML_PATH_BACKUP_ENABLED = 'groups/backup/fields/enabled/value'; + const XML_PATH_BACKUP_TIME = 'groups/backup/fields/time/value'; + const XML_PATH_BACKUP_FREQUENCY = 'groups/backup/fields/frequency/value'; + + /** + * Cron settings after save + * + * @return Mage_Adminhtml_Model_System_Config_Backend_Log_Cron + */ + protected function _afterSave() + { + $enabled = $this->getData(self::XML_PATH_BACKUP_ENABLED); + $time = $this->getData(self::XML_PATH_BACKUP_TIME); + $frequency = $this->getData(self::XML_PATH_BACKUP_FREQUENCY); + + $frequencyWeekly = Mage_Adminhtml_Model_System_Config_Source_Cron_Frequency::CRON_WEEKLY; + $frequencyMonthly = Mage_Adminhtml_Model_System_Config_Source_Cron_Frequency::CRON_MONTHLY; + + if ($enabled) { + $cronExprArray = array( + intval($time[1]), # Minute + intval($time[0]), # Hour + ($frequency == $frequencyMonthly) ? '1' : '*', # Day of the Month + '*', # Month of the Year + ($frequency == $frequencyWeekly) ? '1' : '*', # Day of the Week + ); + $cronExprString = join(' ', $cronExprArray); + } + else { + $cronExprString = ''; + } + + try { + Mage::getModel('Mage_Core_Model_Config_Data') + ->load(self::CRON_STRING_PATH, 'path') + ->setValue($cronExprString) + ->setPath(self::CRON_STRING_PATH) + ->save(); + + Mage::getModel('Mage_Core_Model_Config_Data') + ->load(self::CRON_MODEL_PATH, 'path') + ->setValue((string) Mage::getConfig()->getNode(self::CRON_MODEL_PATH)) + ->setPath(self::CRON_MODEL_PATH) + ->save(); + } + catch (Exception $e) { + Mage::throwException(Mage::helper('Mage_Backup_Helper_Data')->__('Unable to save the cron expression.')); + } + } +} diff --git a/app/code/core/Mage/Backup/Model/Config/Source/Type.php b/app/code/core/Mage/Backup/Model/Config/Source/Type.php new file mode 100644 index 0000000000000000000000000000000000000000..abace0ebe8951fad9e4f718ceca01ec67bfc36d8 --- /dev/null +++ b/app/code/core/Mage/Backup/Model/Config/Source/Type.php @@ -0,0 +1,52 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Backup + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Backups types' source model for system configuration + * + * @category Mage + * @package Mage_Backup + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Backup_Model_Config_Source_Type +{ + /** + * return possible options + * + * @return array + */ + public function toOptionArray() + { + $backupTypes = array(); + foreach(Mage::helper('Mage_Backup_Helper_Data')->getBackupTypes() as $type => $label) { + $backupTypes[] = array( + 'label' => $label, + 'value' => $type, + ); + } + return $backupTypes; + } +} diff --git a/app/code/core/Mage/Backup/Model/Db.php b/app/code/core/Mage/Backup/Model/Db.php index 772c24b2bc09822a5b416139508585f96a5ec536..2126f41b9ce63df7b91a2addd5df6230b9a16318 100644 --- a/app/code/core/Mage/Backup/Model/Db.php +++ b/app/code/core/Mage/Backup/Model/Db.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Backup - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -37,10 +37,10 @@ class Mage_Backup_Model_Db /** * Buffer length for multi rows - * default 512 Kb + * default 100 Kb * */ - const BUFFER_LENGTH = 524288; + const BUFFER_LENGTH = 102400; /** * Retrieve resource model diff --git a/app/code/core/Mage/Backup/Model/Fs/Collection.php b/app/code/core/Mage/Backup/Model/Fs/Collection.php index 70f4b2e9b9b578af228ffcbe823089d84609d18a..d7850ae9f87113170e34644bb8f2cb03042855dd 100644 --- a/app/code/core/Mage/Backup/Model/Fs/Collection.php +++ b/app/code/core/Mage/Backup/Model/Fs/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Backup - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -58,10 +58,17 @@ class Mage_Backup_Model_Fs_Collection extends Varien_Data_Collection_Filesystem } // set collection specific params + $extensions = Mage::helper('Mage_Backup_Helper_Data')->getExtensions(); + + foreach ($extensions as $key => $value) { + $extensions[] = '(' . preg_quote($value, '/') . ')'; + } + $extensions = implode('|', $extensions); + $this ->setOrder('time', self::SORT_ORDER_DESC) ->addTargetDir($this->_baseDir) - ->setFilesFilter('/^[a-z0-9\-\_]+\.' . preg_quote(Mage_Backup_Model_Backup::BACKUP_EXTENSION, '/') . '$/') + ->setFilesFilter('/^[a-z0-9\-\_]+\.' . $extensions . '$/') ->setCollectRecursively(false) ; } @@ -80,6 +87,7 @@ class Mage_Backup_Model_Fs_Collection extends Varien_Data_Collection_Filesystem $row[$key] = $value; } $row['size'] = filesize($filename); + $row['id'] = $row['time'] . '_' . $row['type']; return $row; } } diff --git a/app/code/core/Mage/Backup/Model/Observer.php b/app/code/core/Mage/Backup/Model/Observer.php new file mode 100644 index 0000000000000000000000000000000000000000..9cd91aa26258aacda753a1a72a4da3484a7a72d3 --- /dev/null +++ b/app/code/core/Mage/Backup/Model/Observer.php @@ -0,0 +1,95 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Backup + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + + +/** + * Backup Observer + * + * @category Mage + * @package Mage_Backup + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Backup_Model_Observer +{ + const XML_PATH_BACKUP_ENABLED = 'system/backup/enabled'; + const XML_PATH_BACKUP_TYPE = 'system/backup/type'; + const XML_PATH_BACKUP_MAINTENANCE_MODE = 'system/backup/maintenance'; + + /** + * Error messages + * + * @var array + */ + protected $_errors = array(); + + /** + * Create Backup + * + * @return Mage_Log_Model_Cron + */ + public function scheduledBackup() + { + if (!Mage::getStoreConfigFlag(self::XML_PATH_BACKUP_ENABLED)) { + return $this; + } + + if (Mage::getStoreConfigFlag(self::XML_PATH_BACKUP_MAINTENANCE_MODE)) { + Mage::helper('Mage_Backup_Helper_Data')->turnOnMaintenanceMode(); + } + + $type = Mage::getStoreConfig(self::XML_PATH_BACKUP_TYPE); + + $this->_errors = array(); + try { + $backupManager = Mage_Backup::getBackupInstance($type) + ->setBackupExtension(Mage::helper('Mage_Backup_Helper_Data')->getExtensionByType($type)) + ->setTime(time()) + ->setBackupsDir(Mage::helper('Mage_Backup_Helper_Data')->getBackupsDir()); + + Mage::register('backup_manager', $backupManager); + + if ($type != Mage_Backup_Helper_Data::TYPE_DB) { + $backupManager->setRootDir(Mage::getBaseDir()) + ->addIgnorePaths(Mage::helper('Mage_Backup_Helper_Data')->getBackupIgnorePaths()); + } + + $backupManager->create(); + Mage::log(Mage::helper('Mage_Backup_Helper_Data')->getCreateSuccessMessageByType($type)); + } + catch (Exception $e) { + $this->_errors[] = $e->getMessage(); + $this->_errors[] = $e->getTrace(); + Mage::log($e->getMessage(), Zend_Log::ERR); + Mage::logException($e); + } + + if (Mage::getStoreConfigFlag(self::XML_PATH_BACKUP_MAINTENANCE_MODE)) { + Mage::helper('Mage_Backup_Helper_Data')->turnOffMaintenanceMode(); + } + + return $this; + } +} diff --git a/app/code/core/Mage/Backup/Model/Resource/Db.php b/app/code/core/Mage/Backup/Model/Resource/Db.php index 714cb16ba29b26fc80fcd1ff63d99f6ca09911ac..23beb2fb2e873d67f33e1b84b8dca5a58a70f252 100755 --- a/app/code/core/Mage/Backup/Model/Resource/Db.php +++ b/app/code/core/Mage/Backup/Model/Resource/Db.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Backup - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -35,11 +35,11 @@ class Mage_Backup_Model_Resource_Db { /** - * Read connection + * Database connection adapter * * @var Varien_Db_Adapter_Pdo_Mysql */ - protected $_read; + protected $_write; /** * tables Foreign key data array @@ -55,7 +55,7 @@ class Mage_Backup_Model_Resource_Db */ public function __construct() { - $this->_read = Mage::getSingleton('Mage_Core_Model_Resource')->getConnection('backup_read'); + $this->_write = Mage::getSingleton('Mage_Core_Model_Resource')->getConnection('backup_write'); } /** @@ -74,7 +74,7 @@ class Mage_Backup_Model_Resource_Db */ public function getTables() { - return $this->_read->listTables(); + return $this->_write->listTables(); } /** @@ -112,7 +112,10 @@ class Mage_Backup_Model_Resource_Db if (!$tableName) { $tables = $this->getTables(); foreach($tables as $table) { - $fkScript = $fkScript . Mage::getResourceHelper('Mage_Backup')->getTableForeignKeysSql($table); + $tableFkScript = Mage::getResourceHelper('Mage_Backup')->getTableForeignKeysSql($table); + if (!empty($tableFkScript)) { + $fkScript .= "\n" . $tableFkScript; + } } } else { $fkScript = $this->getTableForeignKeysSql($tableName); @@ -128,7 +131,7 @@ class Mage_Backup_Model_Resource_Db */ public function getTableStatus($tableName) { - $row = $this->_read->showTableStatus($tableName); + $row = $this->_write->showTableStatus($tableName); if ($row) { $statusObject = new Varien_Object(); @@ -137,8 +140,8 @@ class Mage_Backup_Model_Resource_Db $statusObject->setData(strtolower($field), $value); } - $cntRow = $this->_read->fetchRow( - $this->_read->select()->from($tableName, 'COUNT(1) as rows')); + $cntRow = $this->_write->fetchRow( + $this->_write->select()->from($tableName, 'COUNT(1) as rows')); $statusObject->setRows($cntRow['rows']); return $statusObject; @@ -157,8 +160,7 @@ class Mage_Backup_Model_Resource_Db */ public function getTableDataSql($tableName, $count = null, $offset = null) { - return Mage::getResourceHelper('Mage_Backup')->getInsertSql($tableName); - + return Mage::getResourceHelper('Mage_Backup')->getPartInsertSql($tableName, $count, $offset); } /** @@ -181,7 +183,7 @@ class Mage_Backup_Model_Resource_Db */ public function getTableHeader($tableName) { - $quotedTableName = $this->_read->quoteIdentifier($tableName); + $quotedTableName = $this->_write->quoteIdentifier($tableName); return "\n--\n" . "-- Table structure for table {$quotedTableName}\n" . "--\n\n"; @@ -249,7 +251,7 @@ class Mage_Backup_Model_Resource_Db public function beginTransaction() { Mage::getResourceHelper('Mage_Backup')->turnOnSerializableMode(); - $this->_read->beginTransaction(); + $this->_write->beginTransaction(); return $this; } @@ -260,7 +262,7 @@ class Mage_Backup_Model_Resource_Db */ public function commitTransaction() { - $this->_read->commit(); + $this->_write->commit(); Mage::getResourceHelper('Mage_Backup')->turnOnReadCommittedMode(); return $this; } @@ -272,7 +274,18 @@ class Mage_Backup_Model_Resource_Db */ public function rollBackTransaction() { - $this->_read->rollBack(); + $this->_write->rollBack(); + return $this; + } + + /** + * Run sql code + * + * @param $command + * @return Mage_Backup_Model_Resource_Db + */ + public function runCommand($command){ + $this->_write->query($command); return $this; } } diff --git a/app/code/core/Mage/Backup/Model/Resource/Helper/Mysql4.php b/app/code/core/Mage/Backup/Model/Resource/Helper/Mysql4.php index b166957d27eef8e7a177e466de0683308d361d5a..26de1344678f6cd121aafbe7699ecd2d7ba9ebd6 100644 --- a/app/code/core/Mage/Backup/Model/Resource/Helper/Mysql4.php +++ b/app/code/core/Mage/Backup/Model/Resource/Helper/Mysql4.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Backup - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -54,19 +54,40 @@ class Mage_Backup_Model_Resource_Helper_Mysql4 extends Mage_Core_Model_Resource_ */ public function getTableForeignKeysSql($tableName = null) { + $sql = false; + if ($tableName === null) { $sql = ''; foreach ($this->_foreignKeys as $table => $foreignKeys) { - $sql .= sprintf("ALTER TABLE %s\n %s;\n", - $this->_getReadAdapter()->quoteIdentifier($table), - join(",\n ", $foreignKeys) - ); + $sql .= $this->_buildForeignKeysAlterTableSql($table, $foreignKeys); } - return $sql; + } else if (isset($this->_foreignKeys[$tableName])) { + $foreignKeys = $this->_foreignKeys[$tableName]; + $sql = $this->_buildForeignKeysAlterTableSql($tableName, $foreignKeys); + } + + return $sql; + } + + /** + * Build sql that will add foreign keys to it + * + * @param string $tableName + * @param array $foreignKeys + * @return string + */ + protected function _buildForeignKeysAlterTableSql($tableName, $foreignKeys) + { + if (!is_array($foreignKeys) || empty($foreignKeys)) { + return ''; } - return false; + return sprintf("ALTER TABLE %s\n %s;\n", + $this->_getReadAdapter()->quoteIdentifier($tableName), + join(",\n ", $foreignKeys) + ); } + /** * Get create script for table * @@ -217,14 +238,17 @@ class Mage_Backup_Model_Resource_Helper_Mysql4 extends Mage_Core_Model_Resource_ * Return table part data SQL insert * * @param string $tableName + * @param int $count + * @param int $offset * @return string */ - public function getInsertSql($tableName) + public function getPartInsertSql($tableName, $count = null, $offset = null) { $sql = null; $adapter = $this->_getWriteAdapter(); $select = $adapter->select() - ->from($tableName); + ->from($tableName) + ->limit($count, $offset); $query = $adapter->query($select); while ($row = $query->fetch()) { @@ -243,7 +267,16 @@ class Mage_Backup_Model_Resource_Helper_Mysql4 extends Mage_Core_Model_Resource_ return $sql; } - + /** + * Return table data SQL insert + * + * @param string $tableName + * @return string + */ + public function getInsertSql($tableName) + { + return $this->getPartInsertSql($tableName); + } /** * Quote Table Row * diff --git a/app/code/core/Mage/Backup/etc/adminhtml.xml b/app/code/core/Mage/Backup/etc/adminhtml.xml index d598ee9a44abe1b06bbe11d6d499b0d02466e558..a8c2bccf7fadd25fa173e9c487bf89542b4272f1 100644 --- a/app/code/core/Mage/Backup/etc/adminhtml.xml +++ b/app/code/core/Mage/Backup/etc/adminhtml.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Backup - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> @@ -50,6 +50,11 @@ <children> <backup translate="title" module="Mage_Backup"> <title>Backups</title> + <children> + <rollback translate="title" module="Mage_Backup"> + <title>Rollback</title> + </rollback> + </children> </backup> </children> </tools> diff --git a/app/code/core/Mage/Backup/etc/config.xml b/app/code/core/Mage/Backup/etc/config.xml index 5179bd3febb8fcedf6a5897c2187379f69e1ed3a..c6d01a142ac99480de16b8b7d34e5fdc454225d1 100644 --- a/app/code/core/Mage/Backup/etc/config.xml +++ b/app/code/core/Mage/Backup/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Backup - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> @@ -51,4 +51,13 @@ </modules> </translate> </adminhtml> + <crontab> + <jobs> + <system_backup> + <run> + <model>Mage_Backup_Model_Observer::scheduledBackup</model> + </run> + </system_backup> + </jobs> + </crontab> </config> diff --git a/app/code/core/Mage/Backup/etc/system.xml b/app/code/core/Mage/Backup/etc/system.xml new file mode 100644 index 0000000000000000000000000000000000000000..f0e0a6f229bbf8bd29b4dedac35b4f3815c5fa4f --- /dev/null +++ b/app/code/core/Mage/Backup/etc/system.xml @@ -0,0 +1,95 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * 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_AFL.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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Backup + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<config> + <sections> + <system> + <groups> + <backup translate="label" module="Mage_Backup"> + <label>Scheduled Backup Settings</label> + <frontend_type>text</frontend_type> + <sort_order>500</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>0</show_in_website> + <show_in_store>0</show_in_store> + <fields> + <enabled translate="label" module="Mage_Backup"> + <label>Enable Scheduled Backup</label> + <frontend_type>select</frontend_type> + <source_model>Mage_Adminhtml_Model_System_Config_Source_Yesno</source_model> + <sort_order>10</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>0</show_in_website> + <show_in_store>0</show_in_store> + </enabled> + <type translate="label" module="Mage_Backup"> + <label>Backup Type</label> + <frontend_type>select</frontend_type> + <depends><enabled>1</enabled></depends> + <source_model>Mage_Backup_Model_Config_Source_Type</source_model> + <sort_order>20</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>0</show_in_website> + <show_in_store>0</show_in_store> + </type> + <time translate="label" module="Mage_Backup"> + <label>Start Time</label> + <frontend_type>time</frontend_type> + <depends><enabled>1</enabled></depends> + <sort_order>30</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>0</show_in_website> + <show_in_store>0</show_in_store> + </time> + <frequency translate="label" module="Mage_Backup"> + <label>Frequency</label> + <frontend_type>select</frontend_type> + <depends><enabled>1</enabled></depends> + <source_model>Mage_Adminhtml_Model_System_Config_Source_Cron_Frequency</source_model> + <backend_model>Mage_Backup_Model_Config_Backend_Cron</backend_model> + <sort_order>40</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>0</show_in_website> + <show_in_store>0</show_in_store> + </frequency> + <maintenance translate="label comment" module="Mage_Backup"> + <label>Maintenance Mode</label> + <comment>Put store on the maintenance mode while backup's creation</comment> + <frontend_type>select</frontend_type> + <depends><enabled>1</enabled></depends> + <source_model>Mage_Adminhtml_Model_System_Config_Source_Yesno</source_model> + <sort_order>50</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>0</show_in_website> + <show_in_store>0</show_in_store> + </maintenance> + </fields> + </backup> + </groups> + </system> + </sections> +</config> diff --git a/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Bundle.php b/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Bundle.php index 5e0c2c38cfbe5262210cb68881f9e89e4d206f1b..69d12354dcbc979ff44b45c1218cf46a6f552344 100644 --- a/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Bundle.php +++ b/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Bundle.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Options/Type/Checkbox.php b/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Options/Type/Checkbox.php index fa8f95eefed4df4af074ddc54c9f5895c4f01ca8..7df542e3d627e9f999dc0be7caf1f3739a9aadf3 100644 --- a/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Options/Type/Checkbox.php +++ b/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Options/Type/Checkbox.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Options/Type/Multi.php b/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Options/Type/Multi.php index 4ab148ca25ce0c12c41ddcec5d498e9d0fc60318..4a056642300c57c1a51ddac30ff5249557d8c1be 100644 --- a/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Options/Type/Multi.php +++ b/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Options/Type/Multi.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Options/Type/Radio.php b/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Options/Type/Radio.php index 82799e3f0f7f34bb6e2a63e02ca78c57d01294a5..5069b9aaeb88f75d9939ca1125be83523fcd246d 100644 --- a/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Options/Type/Radio.php +++ b/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Options/Type/Radio.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Options/Type/Select.php b/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Options/Type/Select.php index d156e96dd2a21d66edfe26a6842145b3c94f89fa..734c5795326955867412c0b9bdea6f73955b7813 100644 --- a/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Options/Type/Select.php +++ b/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Options/Type/Select.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Attributes.php b/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Attributes.php index decf8454d04b3a9008d2b1744c3f20ea3a35a45b..e7e1a75d950ef31baec9a9c6132842dcc511a9b7 100644 --- a/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Attributes.php +++ b/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Attributes.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -122,6 +122,15 @@ class Mage_Bundle_Block_Adminhtml_Catalog_Product_Edit_Tab_Attributes ); } + $groupPrice = $this->getForm()->getElement('group_price'); + if ($groupPrice) { + $groupPrice->setRenderer( + $this->getLayout()->createBlock('Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Price_Group') + ->setPriceColumnHeader(Mage::helper('Mage_Bundle_Helper_Data')->__('Percent Discount')) + ->setPriceValidation('validate-greater-than-zero validate-percents') + ); + } + $mapEnabled = $this->getForm()->getElement('msrp_enabled'); if ($mapEnabled && $this->getCanEditPrice() !== false) { $mapEnabled->setAfterElementHtml( diff --git a/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Attributes/Extend.php b/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Attributes/Extend.php index 3d918822545f2931165a7bc9bae7595366a08430..41911a42978e5ebf2cd304ed5cb84a3bc6b93488 100644 --- a/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Attributes/Extend.php +++ b/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Attributes/Extend.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Attributes/Special.php b/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Attributes/Special.php index 0a4963b01d7f272aa3227da35fe8e1289bb8c327..751c51851d4dd51e67acc72cd6b8e9e4065e5202 100644 --- a/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Attributes/Special.php +++ b/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Attributes/Special.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle.php b/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle.php index 35e382537545d838cc60f5ed2c8d35cf89ac98b7..bce14c76e7aef1ceed92c984b9c561fcd6f88be2 100644 --- a/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle.php +++ b/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option.php b/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option.php index 368ba3697116e1978548b9fcea9d813e111fafa2..79672d7390e721f470f4fd4286022830268216b0 100644 --- a/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option.php +++ b/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option/Search.php b/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option/Search.php index 0af8b00caa3fb1e4b0d405e87e14172095e38648..a1b9e6bec9be8984b09b030005c1e0a83a764f6e 100644 --- a/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option/Search.php +++ b/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option/Search.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option/Search/Grid.php b/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option/Search/Grid.php index c1f9b9e010d9f9bf877fee0f0b788e362a252bb1..65ccd040e74a68976fe37c4a12768314c0ce1611 100644 --- a/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option/Search/Grid.php +++ b/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option/Search/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option/Selection.php b/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option/Selection.php index 4cf4458c5de6db3ca1e1aaf4aa3b2aca2db3b0df..e05be53435bc3bac3de18ff77f0cba4801f412c3 100644 --- a/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option/Selection.php +++ b/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option/Selection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tabs.php b/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tabs.php index 80850647b400b560bcbb8506d89ac4a8f7db0f4d..0fccbafca990ec9a87057653749134acfb24ee82 100644 --- a/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tabs.php +++ b/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tabs.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/Block/Adminhtml/Sales/Order/Items/Renderer.php b/app/code/core/Mage/Bundle/Block/Adminhtml/Sales/Order/Items/Renderer.php index 4ce33d267614a2b931dc94bc02a3f19ed87e15c7..f8bb42b2a863b49c5027ec8fd53f020cf332339c 100644 --- a/app/code/core/Mage/Bundle/Block/Adminhtml/Sales/Order/Items/Renderer.php +++ b/app/code/core/Mage/Bundle/Block/Adminhtml/Sales/Order/Items/Renderer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/Block/Adminhtml/Sales/Order/View/Items/Renderer.php b/app/code/core/Mage/Bundle/Block/Adminhtml/Sales/Order/View/Items/Renderer.php index c21f8cef1c6de4c940ee732a4cd7f357ef7d217e..2dffeffa0222cb89a5e493058f18e50cdc51c120 100644 --- a/app/code/core/Mage/Bundle/Block/Adminhtml/Sales/Order/View/Items/Renderer.php +++ b/app/code/core/Mage/Bundle/Block/Adminhtml/Sales/Order/View/Items/Renderer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/Block/Catalog/Product/Price.php b/app/code/core/Mage/Bundle/Block/Catalog/Product/Price.php index 1b918f25061ed81fa395dbc16dee86c5d55876cf..d020577d761583fa056a43ca3b28b4fc07cb1c41 100644 --- a/app/code/core/Mage/Bundle/Block/Catalog/Product/Price.php +++ b/app/code/core/Mage/Bundle/Block/Catalog/Product/Price.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/Block/Catalog/Product/View.php b/app/code/core/Mage/Bundle/Block/Catalog/Product/View.php index c262ecbb084eea776c35b025d978cfcbf63f9e46..dd7f7515f6f63807c01fd83f7a1e14e4a830119d 100644 --- a/app/code/core/Mage/Bundle/Block/Catalog/Product/View.php +++ b/app/code/core/Mage/Bundle/Block/Catalog/Product/View.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/Block/Catalog/Product/View/Type/Bundle.php b/app/code/core/Mage/Bundle/Block/Catalog/Product/View/Type/Bundle.php index ef787faa8bb6936fa811835678dd56100336395f..473d10108420520fd44ed5fb79060cd3c327463a 100644 --- a/app/code/core/Mage/Bundle/Block/Catalog/Product/View/Type/Bundle.php +++ b/app/code/core/Mage/Bundle/Block/Catalog/Product/View/Type/Bundle.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -122,7 +122,8 @@ class Mage_Bundle_Block_Catalog_Product_View_Type_Bundle extends Mage_Catalog_Bl unset($tierPriceInfo); // break the reference with the last element $itemPrice = $bundlePriceModel->getSelectionFinalTotalPrice($currentProduct, $_selection, - $currentProduct->getQty(), $_selection->getQty(), false); + $currentProduct->getQty(), $_selection->getQty(), false, false + ); $canApplyMAP = false; diff --git a/app/code/core/Mage/Bundle/Block/Catalog/Product/View/Type/Bundle/Option.php b/app/code/core/Mage/Bundle/Block/Catalog/Product/View/Type/Bundle/Option.php index b9c930263572e2d5af2626374fa04707926c191d..832fd99648a6369795c11acee2182e93a6d7223a 100644 --- a/app/code/core/Mage/Bundle/Block/Catalog/Product/View/Type/Bundle/Option.php +++ b/app/code/core/Mage/Bundle/Block/Catalog/Product/View/Type/Bundle/Option.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -163,6 +163,11 @@ class Mage_Bundle_Block_Catalog_Product_View_Type_Bundle_Option extends Mage_Bun return $selectedQty; } + /** + * Get product model + * + * @return Mage_Catalog_Model_Product + */ public function getProduct() { if (!$this->hasData('product')) { diff --git a/app/code/core/Mage/Bundle/Block/Catalog/Product/View/Type/Bundle/Option/Checkbox.php b/app/code/core/Mage/Bundle/Block/Catalog/Product/View/Type/Bundle/Option/Checkbox.php index ddbc86de5154147d5b06ad542dac89ea74f5cb89..384b2b9c6fa5d6444e421e0dcf0147143fac6562 100644 --- a/app/code/core/Mage/Bundle/Block/Catalog/Product/View/Type/Bundle/Option/Checkbox.php +++ b/app/code/core/Mage/Bundle/Block/Catalog/Product/View/Type/Bundle/Option/Checkbox.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/Block/Catalog/Product/View/Type/Bundle/Option/Multi.php b/app/code/core/Mage/Bundle/Block/Catalog/Product/View/Type/Bundle/Option/Multi.php index 7976ee5b0452f4134a2e00adebe6f8a03d0ff766..09773dc91d4d655e06325df92c85adb1a6b1be82 100644 --- a/app/code/core/Mage/Bundle/Block/Catalog/Product/View/Type/Bundle/Option/Multi.php +++ b/app/code/core/Mage/Bundle/Block/Catalog/Product/View/Type/Bundle/Option/Multi.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/Block/Catalog/Product/View/Type/Bundle/Option/Radio.php b/app/code/core/Mage/Bundle/Block/Catalog/Product/View/Type/Bundle/Option/Radio.php index 4f6f50137de6c6989ad991c47d9f58dd534b53af..dfd7bddd0e6a990c54cb8ace1a30543846986ffa 100644 --- a/app/code/core/Mage/Bundle/Block/Catalog/Product/View/Type/Bundle/Option/Radio.php +++ b/app/code/core/Mage/Bundle/Block/Catalog/Product/View/Type/Bundle/Option/Radio.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/Block/Catalog/Product/View/Type/Bundle/Option/Select.php b/app/code/core/Mage/Bundle/Block/Catalog/Product/View/Type/Bundle/Option/Select.php index 5984c63128ade22d8846323bc1d2885d8d6d0ae3..745276925158a842f1a83d1becf34b3fac4cdd1e 100644 --- a/app/code/core/Mage/Bundle/Block/Catalog/Product/View/Type/Bundle/Option/Select.php +++ b/app/code/core/Mage/Bundle/Block/Catalog/Product/View/Type/Bundle/Option/Select.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/Block/Checkout/Cart/Item/Renderer.php b/app/code/core/Mage/Bundle/Block/Checkout/Cart/Item/Renderer.php index 9b159ab6f32b27f5cedab61d436d156bb2857309..58c7e4b88ec6dd695d29ed38c10572a75dbb3839 100644 --- a/app/code/core/Mage/Bundle/Block/Checkout/Cart/Item/Renderer.php +++ b/app/code/core/Mage/Bundle/Block/Checkout/Cart/Item/Renderer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/Block/Sales/Order/Items/Renderer.php b/app/code/core/Mage/Bundle/Block/Sales/Order/Items/Renderer.php index aa5ff499fb36ccf4bcbfe53963ec25d3271f012c..5daaa15b3bc93f0d12d8a19e0ac4ac7d6c3640ce 100644 --- a/app/code/core/Mage/Bundle/Block/Sales/Order/Items/Renderer.php +++ b/app/code/core/Mage/Bundle/Block/Sales/Order/Items/Renderer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/Helper/Catalog/Product/Configuration.php b/app/code/core/Mage/Bundle/Helper/Catalog/Product/Configuration.php index 472b9f16b7860bc944db8c8f2fe9e97ff67d6c17..d3a3fc9a2e6bf4d28b7606e7003a3bc798325d50 100644 --- a/app/code/core/Mage/Bundle/Helper/Catalog/Product/Configuration.php +++ b/app/code/core/Mage/Bundle/Helper/Catalog/Product/Configuration.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -57,12 +57,17 @@ class Mage_Bundle_Helper_Catalog_Product_Configuration extends Mage_Core_Helper_ * @param Mage_Catalog_Model_Product $selectionProduct * @return decimal */ - public function getSelectionFinalPrice(Mage_Catalog_Model_Product_Configuration_Item_Interface $item, $selectionProduct) + public function getSelectionFinalPrice(Mage_Catalog_Model_Product_Configuration_Item_Interface $item, + $selectionProduct) { - return $item->getProduct()->getPriceModel()->getSelectionFinalPrice( - $item->getProduct(), $selectionProduct, + $selectionProduct->unsetData('final_price'); + return $item->getProduct()->getPriceModel()->getSelectionFinalTotalPrice( + $item->getProduct(), + $selectionProduct, $item->getQty() * 1, - $this->getSelectionQty($item->getProduct(), $selectionProduct->getSelectionId()) + $this->getSelectionQty($item->getProduct(), $selectionProduct->getSelectionId()), + false, + true ); } @@ -86,7 +91,7 @@ class Mage_Bundle_Helper_Catalog_Product_Configuration extends Mage_Core_Helper_ // get bundle options $optionsQuoteItemOption = $item->getOptionByCode('bundle_option_ids'); - $bundleOptionsIds = unserialize($optionsQuoteItemOption->getValue()); + $bundleOptionsIds = $optionsQuoteItemOption ? unserialize($optionsQuoteItemOption->getValue()) : array(); if ($bundleOptionsIds) { /** * @var Mage_Bundle_Model_Resource_Option_Collection @@ -115,7 +120,9 @@ class Mage_Bundle_Helper_Catalog_Product_Configuration extends Mage_Core_Helper_ $qty = $this->getSelectionQty($product, $bundleSelection->getSelectionId()) * 1; if ($qty) { $option['value'][] = $qty . ' x ' . $this->escapeHtml($bundleSelection->getName()) - . ' ' . Mage::helper('Mage_Core_Helper_Data')->currency($this->getSelectionFinalPrice($item, $bundleSelection)); + . ' ' . Mage::helper('Mage_Core_Helper_Data')->currency( + $this->getSelectionFinalPrice($item, $bundleSelection) + ); } } diff --git a/app/code/core/Mage/Bundle/Helper/Data.php b/app/code/core/Mage/Bundle/Helper/Data.php index 12a0524a30c3c29991d79120fbf25915407c865c..26325296fa24be22eebb39db6884713d126512ab 100644 --- a/app/code/core/Mage/Bundle/Helper/Data.php +++ b/app/code/core/Mage/Bundle/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/Model/Observer.php b/app/code/core/Mage/Bundle/Model/Observer.php index ca53ac7519792c132aaf09ab80b806c67afa3b7a..06b83504c65db83c59c4766ea86e976b9c6bf24f 100644 --- a/app/code/core/Mage/Bundle/Model/Observer.php +++ b/app/code/core/Mage/Bundle/Model/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/Model/Option.php b/app/code/core/Mage/Bundle/Model/Option.php index 827c754577d1f18a338f8a8896d6208099618848..6afae3b27c3a36a8a64981ef854d0df7b0c89aad 100644 --- a/app/code/core/Mage/Bundle/Model/Option.php +++ b/app/code/core/Mage/Bundle/Model/Option.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/Model/Price/Index.php b/app/code/core/Mage/Bundle/Model/Price/Index.php index 60d4e741cabb2de10122a617b8dc5c17b5b9ab1b..24ad94b3051df0bcbbe1aaf46dfabddf6bdeae54 100644 --- a/app/code/core/Mage/Bundle/Model/Price/Index.php +++ b/app/code/core/Mage/Bundle/Model/Price/Index.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/Model/Product/Attribute/Source/Price/View.php b/app/code/core/Mage/Bundle/Model/Product/Attribute/Source/Price/View.php index 86376232fc6afc67047323c55517fc5faf0bdfd2..6415d43e81ab8282c416d8494d74d577257ae4f4 100644 --- a/app/code/core/Mage/Bundle/Model/Product/Attribute/Source/Price/View.php +++ b/app/code/core/Mage/Bundle/Model/Product/Attribute/Source/Price/View.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/Model/Product/Price.php b/app/code/core/Mage/Bundle/Model/Product/Price.php index 965cbe8037811e4c86c15a8894f728fbbbec5e92..7854949d24bfd6a8e0cce0694156116d7af7037e 100644 --- a/app/code/core/Mage/Bundle/Model/Product/Price.php +++ b/app/code/core/Mage/Bundle/Model/Product/Price.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -68,6 +68,40 @@ class Mage_Bundle_Model_Product_Price extends Mage_Catalog_Model_Product_Type_Pr } } + /** + * Get Total price for Bundle items + * + * @param Mage_Catalog_Model_Product $product + * @param null|float $qty + * @return float + */ + public function getTotalBundleItemsPrice($product, $qty = null) + { + $price = 0.0; + if ($product->hasCustomOptions()) { + $customOption = $product->getCustomOption('bundle_selection_ids'); + if ($customOption) { + $selectionIds = unserialize($customOption->getValue()); + $selections = $product->getTypeInstance()->getSelectionsByIds($selectionIds, $product); + $selections->addTierPriceData(); + Mage::dispatchEvent('prepare_catalog_product_collection_prices', array( + 'collection' => $selections, + 'store_id' => $product->getStoreId(), + )); + foreach ($selections->getItems() as $selection) { + if ($selection->isSalable()) { + $selectionQty = $product->getCustomOption('selection_qty_' . $selection->getSelectionId()); + if ($selectionQty) { + $price += $this->getSelectionFinalTotalPrice($product, $selection, $qty, + $selectionQty->getValue()); + } + } + } + } + } + return $price; + } + /** * Get product final price * @@ -81,45 +115,15 @@ class Mage_Bundle_Model_Product_Price extends Mage_Catalog_Model_Product_Type_Pr return $product->getCalculatedFinalPrice(); } - $finalPrice = $product->getPrice(); - - /** - * Just product with fixed price calculation has price - */ - if ($finalPrice) { - $tierPrice = $this->_applyTierPrice($product, $qty, $finalPrice); - $specialPrice = $this->_applySpecialPrice($product, $finalPrice); - $finalPrice = min(array($tierPrice, $specialPrice)); + $finalPrice = $this->getBasePrice($product, $qty); - $product->setFinalPrice($finalPrice); - Mage::dispatchEvent('catalog_product_get_final_price', array('product'=>$product)); - $finalPrice = $product->getData('final_price'); - } - $basePrice = $finalPrice; - - if ($product->hasCustomOptions()) { - $customOption = $product->getCustomOption('bundle_selection_ids'); - $selectionIds = unserialize($customOption->getValue()); - $selections = $product->getTypeInstance()->getSelectionsByIds($selectionIds, $product); - $selections->addTierPriceData(); - Mage::dispatchEvent('prepare_catalog_product_collection_prices', array( - 'collection' => $selections, - 'store_id' => $product->getStoreId(), - )); - foreach ($selections->getItems() as $selection) { - if ($selection->isSalable()) { - $selectionQty = $product->getCustomOption('selection_qty_' . $selection->getSelectionId()); - if ($selectionQty) { - $finalPrice += $this->getSelectionFinalTotalPrice($product, $selection, $qty, - $selectionQty->getValue()); - } - } - } - } - - $finalPrice = $finalPrice + $this->_applyOptionsPrice($product, $qty, $basePrice) - $basePrice; $product->setFinalPrice($finalPrice); + Mage::dispatchEvent('catalog_product_get_final_price', array('product' => $product, 'qty' => $qty)); + $finalPrice = $product->getData('final_price'); + $finalPrice += $this->getTotalBundleItemsPrice($product, $qty); + $finalPrice = $this->_applyOptionsPrice($product, $qty, $finalPrice); + $product->setFinalPrice($finalPrice); return max(0, $product->getData('final_price')); } @@ -138,7 +142,7 @@ class Mage_Bundle_Model_Product_Price extends Mage_Catalog_Model_Product_Type_Pr } /** - * Retrieve Price with take into account tier price + * Retrieve Price considering tier price * * @param Mage_Catalog_Model_Product $product * @param string|null $which @@ -150,9 +154,9 @@ class Mage_Bundle_Model_Product_Price extends Mage_Catalog_Model_Product_Type_Pr { // check calculated price index if ($product->getData('min_price') && $product->getData('max_price')) { - $minimalPrice = Mage::helper('Mage_Tax_Helper_Data')->getPrice($product, $product->getData('min_price'), $includeTax); - $maximalPrice = Mage::helper('Mage_Tax_Helper_Data')->getPrice($product, $product->getData('max_price'), $includeTax); - $this->_isPricesCalculatedByIndex = true; + $minimalPrice = Mage::helper('Mage_Tax_Helper_Data')->getPrice($product, $product->getData('min_price'), $includeTax); + $maximalPrice = Mage::helper('Mage_Tax_Helper_Data')->getPrice($product, $product->getData('max_price'), $includeTax); + $this->_isPricesCalculatedByIndex = true; } else { /** * Check if product price is fixed @@ -272,7 +276,7 @@ class Mage_Bundle_Model_Product_Price extends Mage_Catalog_Model_Product_Type_Pr if ($which == 'max') { return $maximalPrice; - } else if ($which == 'min') { + } elseif ($which == 'min') { return $minimalPrice; } @@ -327,6 +331,9 @@ class Mage_Bundle_Model_Product_Price extends Mage_Catalog_Model_Product_Type_Pr /** * Calculate price of selection * + * @deprecated after 1.6.2.0 + * @see Mage_Bundle_Model_Product_Price::getSelectionFinalTotalPrice() + * * @param Mage_Catalog_Model_Product $bundleProduct * @param Mage_Catalog_Model_Product $selectionProduct * @param float|null $selectionQty @@ -335,27 +342,7 @@ class Mage_Bundle_Model_Product_Price extends Mage_Catalog_Model_Product_Type_Pr */ public function getSelectionPrice($bundleProduct, $selectionProduct, $selectionQty = null, $multiplyQty = true) { - if (is_null($selectionQty)) { - $selectionQty = $selectionProduct->getSelectionQty(); - } - - if ($bundleProduct->getPriceType() == self::PRICE_TYPE_DYNAMIC) { - if ($multiplyQty) { - return $selectionProduct->getFinalPrice($selectionQty) * $selectionQty; - } else { - return $selectionProduct->getFinalPrice($selectionQty); - } - } else { - if ($selectionProduct->getSelectionPriceType()) { // percent - $price = $bundleProduct->getPrice() * ($selectionProduct->getSelectionPriceValue() / 100); - } else { // fixed - $price = $selectionProduct->getSelectionPriceValue(); - } - if ($multiplyQty) { - $price *= $selectionQty; - } - return $price; - } + return $this->getSelectionFinalTotalPrice($bundleProduct, $selectionProduct, 0, $selectionQty, $multiplyQty); } /** @@ -368,10 +355,7 @@ class Mage_Bundle_Model_Product_Price extends Mage_Catalog_Model_Product_Type_Pr */ public function getSelectionPreFinalPrice($bundleProduct, $selectionProduct, $qty = null) { - return $this->_applySpecialPrice( - $bundleProduct, - $this->getSelectionPrice($bundleProduct, $selectionProduct, $qty) - ); + return $this->getSelectionPrice($bundleProduct, $selectionProduct, $qty); } /** @@ -389,18 +373,85 @@ class Mage_Bundle_Model_Product_Price extends Mage_Catalog_Model_Product_Type_Pr public function getSelectionFinalTotalPrice($bundleProduct, $selectionProduct, $bundleQty, $selectionQty, $multiplyQty = true, $takeTierPrice = true) { - $selectionPrice = $this->getSelectionPrice($bundleProduct, $selectionProduct, $selectionQty, $multiplyQty); - - // apply bundle special price - $specialPrice = $this->_applySpecialPrice($bundleProduct, $selectionPrice); + if (is_null($selectionQty)) { + $selectionQty = $selectionProduct->getSelectionQty(); + } - if ($takeTierPrice) { - // apply bundle tier price - $tierPrice = $this->_applyTierPrice($bundleProduct, $bundleQty, $selectionPrice); - return min(array($tierPrice, $specialPrice)); + if ($bundleProduct->getPriceType() == self::PRICE_TYPE_DYNAMIC) { + $price = $selectionProduct->getFinalPrice($takeTierPrice ? $selectionQty : 1); } else { - return $specialPrice; + if ($selectionProduct->getSelectionPriceType()) { // percent + $price = $this->getPrice($bundleProduct) * ($selectionProduct->getSelectionPriceValue() / 100); + } else { // fixed + $price = $selectionProduct->getSelectionPriceValue(); + } + } + + if ($multiplyQty) { + $price *= $selectionQty; + } + + return min($price, + $this->_applyGroupPrice($bundleProduct, $price), + $this->_applyTierPrice($bundleProduct, $bundleQty, $price), + $this->_applySpecialPrice($bundleProduct, $price) + ); + } + + /** + * Apply group price for bundle product + * + * @param Mage_Catalog_Model_Product $product + * @param float $finalPrice + * @return float + */ + protected function _applyGroupPrice($product, $finalPrice) + { + $result = $finalPrice; + $groupPrice = $product->getGroupPrice(); + + if (is_numeric($groupPrice)) { + $groupPrice = $finalPrice - ($finalPrice * ($groupPrice / 100)); + $result = min($finalPrice, $groupPrice); } + + return $result; + } + + /** + * Get product group price + * + * @param Mage_Catalog_Model_Product $product + * @return float|null + */ + public function getGroupPrice($product) + { + $groupPrices = $product->getData('group_price'); + + if (is_null($groupPrices)) { + $attribute = $product->getResource()->getAttribute('group_price'); + if ($attribute) { + $attribute->getBackend()->afterLoad($product); + $groupPrices = $product->getData('group_price'); + } + } + + if (is_null($groupPrices) || !is_array($groupPrices)) { + return null; + } + + $customerGroup = $this->_getCustomerGroupId($product); + + $matchedPrice = 0; + + foreach ($groupPrices as $groupPrice) { + if ($groupPrice['cust_group'] == $customerGroup && $groupPrice['website_price'] > $matchedPrice) { + $matchedPrice = $groupPrice['website_price']; + break; + } + } + + return $matchedPrice; } /** @@ -536,11 +587,11 @@ class Mage_Bundle_Model_Product_Price extends Mage_Catalog_Model_Product_Type_Pr } /** - * Check is tier price value fixed or percent of original price + * Check is group price value fixed or percent of original price * * @return bool */ - public function isTierPriceFixed() + public function isGroupPriceFixed() { return false; } diff --git a/app/code/core/Mage/Bundle/Model/Product/Type.php b/app/code/core/Mage/Bundle/Model/Product/Type.php index e6d6a90421a62a161c487f70f8fa18bde8c70fb6..0983cb1330beb776fe59b1bb7ef9a296ed439c02 100644 --- a/app/code/core/Mage/Bundle/Model/Product/Type.php +++ b/app/code/core/Mage/Bundle/Model/Product/Type.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -654,7 +654,7 @@ class Mage_Bundle_Model_Product_Type extends Mage_Catalog_Model_Product_Type_Abs * Create extra attributes that will be converted to product options in order item * for selection (not for all bundle) */ - $price = $product->getPriceModel()->getSelectionPrice($product, $selection, $qty); + $price = $product->getPriceModel()->getSelectionFinalTotalPrice($product, $selection, 0, $qty); $attributes = array( 'price' => Mage::app()->getStore()->convertPrice($price), 'qty' => $qty, @@ -792,9 +792,7 @@ class Mage_Bundle_Model_Product_Type extends Mage_Catalog_Model_Product_Type_Abs if ($selection->isSalable()) { $selectionQty = $product->getCustomOption('selection_qty_' . $selection->getSelectionId()); if ($selectionQty) { - $price = $product->getPriceModel()->getSelectionPrice( - $product, - $selection, + $price = $product->getPriceModel()->getSelectionFinalTotalPrice($product, $selection, 0, $selectionQty->getValue() ); diff --git a/app/code/core/Mage/Bundle/Model/Resource/Bundle.php b/app/code/core/Mage/Bundle/Model/Resource/Bundle.php index dcd8b7b488119a477134c064e183581e5520c314..e8fdf82a86a02efe5daba61689efb14a8bdaa38c 100755 --- a/app/code/core/Mage/Bundle/Model/Resource/Bundle.php +++ b/app/code/core/Mage/Bundle/Model/Resource/Bundle.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/Model/Resource/Indexer/Price.php b/app/code/core/Mage/Bundle/Model/Resource/Indexer/Price.php index 9eb0f073c11ce245b317748c14c865a04b95c205..5080bbbe6940e9cb86154972b016a77743923a9b 100755 --- a/app/code/core/Mage/Bundle/Model/Resource/Indexer/Price.php +++ b/app/code/core/Mage/Bundle/Model/Resource/Indexer/Price.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -170,7 +170,13 @@ class Mage_Bundle_Model_Resource_Indexer_Price extends Mage_Catalog_Model_Resour ->joinLeft( array('tp' => $this->_getTierPriceIndexTable()), 'tp.entity_id = e.entity_id AND tp.website_id = cw.website_id' - . ' AND tp.customer_group_id = cg.customer_group_id', + . ' AND tp.customer_group_id = cg.customer_group_id', + array() + ) + ->joinLeft( + array('gp' => $this->_getGroupPriceIndexTable()), + 'gp.entity_id = e.entity_id AND gp.website_id = cw.website_id' + . ' AND gp.customer_group_id = cg.customer_group_id', array() ) ->where('e.type_id=?', $this->getTypeId()); @@ -201,7 +207,6 @@ class Mage_Bundle_Model_Resource_Indexer_Price extends Mage_Catalog_Model_Resour $specialTo = $this->_addAttributeToSelect($select, 'special_to_date', 'e.entity_id', 'cs.store_id'); $curentDate = new Zend_Db_Expr('cwd.website_date'); - $specialExpr = $write->getCheckSql( $write->getCheckSql( $specialFrom . ' IS NULL', @@ -225,6 +230,13 @@ class Mage_Bundle_Model_Resource_Indexer_Price extends Mage_Catalog_Model_Resour $specialPrice, '0' ); + + $groupPriceExpr = $write->getCheckSql( + 'gp.price IS NOT NULL AND gp.price > 0 AND gp.price < 100', + 'gp.price', + '0' + ); + $tierExpr = new Zend_Db_Expr("tp.min_price"); if ($priceType == Mage_Bundle_Model_Product_Price::PRICE_TYPE_FIXED) { @@ -235,24 +247,38 @@ class Mage_Bundle_Model_Resource_Indexer_Price extends Mage_Catalog_Model_Resour ); $tierPrice = $write->getCheckSql( $tierExpr . ' IS NOT NULL', - 'ROUND(' . $price .' - ' . '(' . $price . ' * (' . $tierExpr . ' / 100)), 4)', + 'ROUND(' . $price . ' - ' . '(' . $price . ' * (' . $tierExpr . ' / 100)), 4)', 'NULL' ); + $groupPrice = $write->getCheckSql( + $groupPriceExpr . ' > 0', + 'ROUND(' . $price . ' - ' . '(' . $price . ' * (' . $groupPriceExpr . ' / 100)), 4)', + 'NULL' + ); + $finalPrice = $write->getCheckSql( + "{$groupPrice} IS NOT NULL AND {$groupPrice} < {$finalPrice}", + $groupPrice, + $finalPrice + ); } else { $finalPrice = new Zend_Db_Expr("0"); $tierPrice = $write->getCheckSql($tierExpr . ' IS NOT NULL', '0', 'NULL'); + $groupPrice = $write->getCheckSql($groupPriceExpr . ' > 0', $groupPriceExpr, 'NULL'); } $select->columns(array( - 'price_type' => new Zend_Db_Expr($priceType), - 'special_price' => $specialExpr, - 'tier_percent' => $tierExpr, - 'orig_price' => $write->getCheckSql($price . ' IS NULL', '0', $price), - 'price' => $finalPrice, - 'min_price' => $finalPrice, - 'max_price' => $finalPrice, - 'tier_price' => $tierPrice, - 'base_tier' => $tierPrice, + 'price_type' => new Zend_Db_Expr($priceType), + 'special_price' => $specialExpr, + 'tier_percent' => $tierExpr, + 'orig_price' => $write->getCheckSql($price . ' IS NULL', '0', $price), + 'price' => $finalPrice, + 'min_price' => $finalPrice, + 'max_price' => $finalPrice, + 'tier_price' => $tierPrice, + 'base_tier' => $tierPrice, + 'group_price' => $groupPrice, + 'base_group_price' => $groupPrice, + 'group_price_percent' => new Zend_Db_Expr('gp.price'), )); if (!is_null($entityIds)) { @@ -302,6 +328,8 @@ class Mage_Bundle_Model_Resource_Indexer_Price extends Mage_Catalog_Model_Resour 'max_price' => $write->getCheckSql('i.group_type = 1', 'SUM(i.price)', 'MAX(i.price)'), 'tier_price' => $write->getCheckSql('i.is_required = 1', 'MIN(i.tier_price)', '0'), 'alt_tier_price' => $write->getCheckSql('i.is_required = 0', 'MIN(i.tier_price)', '0'), + 'group_price' => $write->getCheckSql('i.is_required = 1', 'MIN(i.group_price)', '0'), + 'alt_group_price' => $write->getCheckSql('i.is_required = 0', 'MIN(i.group_price)', '0'), )); $query = $select->insertFromSelect($this->_getBundleOptionTable()); @@ -324,6 +352,15 @@ class Mage_Bundle_Model_Resource_Indexer_Price extends Mage_Catalog_Model_Resour ) . ' + MIN(i.tier_price)', 'NULL' ); + $groupPrice = $write->getCheckSql( + 'MIN(i.group_price_percent) IS NOT NULL', + $write->getCheckSql( + 'SUM(io.group_price) = 0', + 'SUM(io.alt_group_price)', + 'SUM(io.group_price)' + ) . ' + MIN(i.group_price)', + 'NULL' + ); $select = $write->select() ->from( @@ -339,12 +376,14 @@ class Mage_Bundle_Model_Resource_Indexer_Price extends Mage_Catalog_Model_Resour ->group(array('io.entity_id', 'io.customer_group_id', 'io.website_id', 'i.tax_class_id', 'i.orig_price', 'i.price')) ->columns(array('i.tax_class_id', - 'orig_price' => 'i.orig_price', - 'price' => 'i.price', - 'min_price' => $minPrice, - 'max_price' => $maxPrice, - 'tier_price' => $tierPrice, - 'base_tier' => 'MIN(i.base_tier)' + 'orig_price' => 'i.orig_price', + 'price' => 'i.price', + 'min_price' => $minPrice, + 'max_price' => $maxPrice, + 'tier_price' => $tierPrice, + 'base_tier' => 'MIN(i.base_tier)', + 'group_price' => $groupPrice, + 'base_group_price' => 'MIN(i.base_group_price)', )); $query = $select->insertFromSelect($this->_getDefaultFinalPriceTable()); @@ -387,7 +426,6 @@ class Mage_Bundle_Model_Resource_Indexer_Price extends Mage_Catalog_Model_Resour ) . '* bs.selection_qty' ); - $tierExpr = $write->getCheckSql( 'i.base_tier IS NOT NULL', $write->getCheckSql( @@ -402,6 +440,24 @@ class Mage_Bundle_Model_Resource_Indexer_Price extends Mage_Catalog_Model_Resour ) . ' * bs.selection_qty', 'NULL' ); + + $groupExpr = $write->getCheckSql( + 'i.base_group_price IS NOT NULL', + $write->getCheckSql( + $selectionPriceType .' = 1', + $priceExpr, + $write->getCheckSql( + 'i.group_price_percent > 0', + 'ROUND(' . $selectionPriceValue + . ' - (' . $selectionPriceValue . ' * (i.group_price_percent / 100)),4)', + $selectionPriceValue + ) + ) . ' * bs.selection_qty', + 'NULL' + ); + $priceExpr = new Zend_Db_Expr( + $write->getCheckSql("{$groupExpr} < {$priceExpr}", $groupExpr, $priceExpr) + ); } else { $priceExpr = new Zend_Db_Expr( $write->getCheckSql( @@ -415,7 +471,21 @@ class Mage_Bundle_Model_Resource_Indexer_Price extends Mage_Catalog_Model_Resour 'ROUND(idx.min_price * (i.base_tier / 100), 4)* bs.selection_qty', 'NULL' ); - + $groupExpr = $write->getCheckSql( + 'i.base_group_price IS NOT NULL', + 'ROUND(idx.min_price * (i.base_group_price / 100), 4)* bs.selection_qty', + 'NULL' + ); + $groupPriceExpr = new Zend_Db_Expr( + $write->getCheckSql( + 'i.base_group_price IS NOT NULL AND i.base_group_price > 0 AND i.base_group_price < 100', + 'ROUND(idx.min_price - idx.min_price * (i.base_group_price / 100), 4)', + 'idx.min_price' + ) . ' * bs.selection_qty' + ); + $priceExpr = new Zend_Db_Expr( + $write->getCheckSql("{$groupPriceExpr} < {$priceExpr}", $groupPriceExpr, $priceExpr) + ); } $select = $write->select() @@ -459,6 +529,7 @@ class Mage_Bundle_Model_Resource_Indexer_Price extends Mage_Catalog_Model_Resour 'is_required' => 'bo.required', 'price' => $priceExpr, 'tier_price' => $tierExpr, + 'group_price' => $groupExpr, )); $query = $select->insertFromSelect($this->_getBundleSelectionTable()); @@ -476,6 +547,7 @@ class Mage_Bundle_Model_Resource_Indexer_Price extends Mage_Catalog_Model_Resour protected function _prepareBundlePrice($entityIds = null) { $this->_prepareTierPriceIndex($entityIds); + $this->_prepareGroupPriceIndex($entityIds); $this->_prepareBundlePriceTable(); $this->_prepareBundlePriceByType(Mage_Bundle_Model_Product_Price::PRICE_TYPE_FIXED, $entityIds); $this->_prepareBundlePriceByType(Mage_Bundle_Model_Product_Price::PRICE_TYPE_DYNAMIC, $entityIds); @@ -564,4 +636,63 @@ class Mage_Bundle_Model_Resource_Indexer_Price extends Mage_Catalog_Model_Resour return $this; } + + /** + * Prepare percentage group price for bundle products + * + * @see Mage_Catalog_Model_Resource_Product_Indexer_Price::_prepareGroupPriceIndex + * + * @param int|array $entityIds + * @return Mage_Bundle_Model_Resource_Indexer_Price + */ + protected function _prepareGroupPriceIndex($entityIds = null) + { + $adapter = $this->_getWriteAdapter(); + + // remove index by bundle products + $select = $adapter->select() + ->from(array('i' => $this->_getGroupPriceIndexTable()), null) + ->join( + array('e' => $this->getTable('catalog_product_entity')), + 'i.entity_id=e.entity_id', + array() + ) + ->where('e.type_id=?', $this->getTypeId()); + $query = $select->deleteFromSelect('i'); + $adapter->query($query); + + $select = $adapter->select() + ->from( + array('gp' => $this->getTable('catalog_product_entity_group_price')), + array('entity_id') + ) + ->join( + array('e' => $this->getTable('catalog_product_entity')), + 'gp.entity_id=e.entity_id', + array() + ) + ->join( + array('cg' => $this->getTable('customer_group')), + 'gp.all_groups = 1 OR (gp.all_groups = 0 AND gp.customer_group_id = cg.customer_group_id)', + array('customer_group_id') + ) + ->join( + array('cw' => $this->getTable('core_website')), + 'gp.website_id = 0 OR gp.website_id = cw.website_id', + array('website_id') + ) + ->where('cw.website_id != 0') + ->where('e.type_id=?', $this->getTypeId()) + ->columns(new Zend_Db_Expr('MIN(gp.value)')) + ->group(array('gp.entity_id', 'cg.customer_group_id', 'cw.website_id')); + + if (!empty($entityIds)) { + $select->where('gp.entity_id IN(?)', $entityIds); + } + + $query = $select->insertFromSelect($this->_getGroupPriceIndexTable()); + $adapter->query($query); + + return $this; + } } diff --git a/app/code/core/Mage/Bundle/Model/Resource/Indexer/Stock.php b/app/code/core/Mage/Bundle/Model/Resource/Indexer/Stock.php index 4d6765345b6c6993a3445c13404cf37d4f0ccf44..9194d063ee49bbec038d02f7570b0a19a50c095b 100755 --- a/app/code/core/Mage/Bundle/Model/Resource/Indexer/Stock.php +++ b/app/code/core/Mage/Bundle/Model/Resource/Indexer/Stock.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/Model/Resource/Option.php b/app/code/core/Mage/Bundle/Model/Resource/Option.php index 8714a94eebb43eb90f237ffd0dc1a66d8fc880ac..b5a2f56ff251c583368505aa9c3f8cfa984e614f 100755 --- a/app/code/core/Mage/Bundle/Model/Resource/Option.php +++ b/app/code/core/Mage/Bundle/Model/Resource/Option.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/Model/Resource/Option/Collection.php b/app/code/core/Mage/Bundle/Model/Resource/Option/Collection.php index 56fcc2c8a312b96990e29793da1d3c0ce7aba1aa..df6e62487f09a2c3cc4f8104c09f37d8d25aab8d 100755 --- a/app/code/core/Mage/Bundle/Model/Resource/Option/Collection.php +++ b/app/code/core/Mage/Bundle/Model/Resource/Option/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/Model/Resource/Price/Index.php b/app/code/core/Mage/Bundle/Model/Resource/Price/Index.php index 4a71987b70c777bb5a303fffc66854dd1fe9b55d..722d2646b50c0f6ea60f1b15d8bb11f9490ec45e 100755 --- a/app/code/core/Mage/Bundle/Model/Resource/Price/Index.php +++ b/app/code/core/Mage/Bundle/Model/Resource/Price/Index.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/Model/Resource/Selection.php b/app/code/core/Mage/Bundle/Model/Resource/Selection.php index 0ac65aa1c9c1e9b3e054d86c2d2d48a48653a83e..accc1c816a72d17bed34de13d69cf3d018a058a6 100755 --- a/app/code/core/Mage/Bundle/Model/Resource/Selection.php +++ b/app/code/core/Mage/Bundle/Model/Resource/Selection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/Model/Resource/Selection/Collection.php b/app/code/core/Mage/Bundle/Model/Resource/Selection/Collection.php index 243c69505d92163b5ecd8da88bf18ff29ff12121..7c578e51d84b02a530811657a2341d19632b3087 100755 --- a/app/code/core/Mage/Bundle/Model/Resource/Selection/Collection.php +++ b/app/code/core/Mage/Bundle/Model/Resource/Selection/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/Model/Sales/Order/Pdf/Items/Abstract.php b/app/code/core/Mage/Bundle/Model/Sales/Order/Pdf/Items/Abstract.php index e4fc0834dd0dc884884b9f2acc98afd1cf1fcf74..a2810309cdae9f433effdf5490ad2801ae2a57d5 100644 --- a/app/code/core/Mage/Bundle/Model/Sales/Order/Pdf/Items/Abstract.php +++ b/app/code/core/Mage/Bundle/Model/Sales/Order/Pdf/Items/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/Model/Sales/Order/Pdf/Items/Creditmemo.php b/app/code/core/Mage/Bundle/Model/Sales/Order/Pdf/Items/Creditmemo.php index 977b0f7e93426d3802be0ec91aae3b5342db425b..d94f213333bc6ddfb65366bd1f36c7cb6e07c8ae 100644 --- a/app/code/core/Mage/Bundle/Model/Sales/Order/Pdf/Items/Creditmemo.php +++ b/app/code/core/Mage/Bundle/Model/Sales/Order/Pdf/Items/Creditmemo.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/Model/Sales/Order/Pdf/Items/Invoice.php b/app/code/core/Mage/Bundle/Model/Sales/Order/Pdf/Items/Invoice.php index 9f9feb15a9442ef55143f3700f08724f4da2c4ef..eda3fffc320d287456cc4b0d3bf3bebb91906d54 100644 --- a/app/code/core/Mage/Bundle/Model/Sales/Order/Pdf/Items/Invoice.php +++ b/app/code/core/Mage/Bundle/Model/Sales/Order/Pdf/Items/Invoice.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/Model/Sales/Order/Pdf/Items/Shipment.php b/app/code/core/Mage/Bundle/Model/Sales/Order/Pdf/Items/Shipment.php index 9ce08855dc611eafbb40679aa66f2a5300287dd7..561937eda553456429b3b743b3071564be366018 100644 --- a/app/code/core/Mage/Bundle/Model/Sales/Order/Pdf/Items/Shipment.php +++ b/app/code/core/Mage/Bundle/Model/Sales/Order/Pdf/Items/Shipment.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/Model/Selection.php b/app/code/core/Mage/Bundle/Model/Selection.php index 7af28c5c50c5fc5ec36a697bd833f9f6628726ee..0285375b1c054b2bdaaf33936d992b90b8c5dd36 100644 --- a/app/code/core/Mage/Bundle/Model/Selection.php +++ b/app/code/core/Mage/Bundle/Model/Selection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/Model/Source/Option/Selection/Price/Type.php b/app/code/core/Mage/Bundle/Model/Source/Option/Selection/Price/Type.php index 84547a057b33b028eacea3f9077276bc91e29cbc..e3ebf898ac803fb640879d86db70c60f4e63ad09 100644 --- a/app/code/core/Mage/Bundle/Model/Source/Option/Selection/Price/Type.php +++ b/app/code/core/Mage/Bundle/Model/Source/Option/Selection/Price/Type.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/Model/Source/Option/Type.php b/app/code/core/Mage/Bundle/Model/Source/Option/Type.php index b283eda0a2ae686a50b84a3e2199f5040de12a81..c4cb9d60474837f338362ced2310aa58cf13d4bc 100644 --- a/app/code/core/Mage/Bundle/Model/Source/Option/Type.php +++ b/app/code/core/Mage/Bundle/Model/Source/Option/Type.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/controllers/Adminhtml/Bundle/Product/EditController.php b/app/code/core/Mage/Bundle/controllers/Adminhtml/Bundle/Product/EditController.php index 48e25938e187b9dbe19f6ef4895f398ef848f2d6..69019a202d5f45617535a7f969393870cf6a1542 100644 --- a/app/code/core/Mage/Bundle/controllers/Adminhtml/Bundle/Product/EditController.php +++ b/app/code/core/Mage/Bundle/controllers/Adminhtml/Bundle/Product/EditController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/controllers/Adminhtml/Bundle/SelectionController.php b/app/code/core/Mage/Bundle/controllers/Adminhtml/Bundle/SelectionController.php index cf59d4f149d779b6a624e8acf7d528534fcdff2b..50f6baf203910fd93588adda1e2b79454f8a9949 100644 --- a/app/code/core/Mage/Bundle/controllers/Adminhtml/Bundle/SelectionController.php +++ b/app/code/core/Mage/Bundle/controllers/Adminhtml/Bundle/SelectionController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/data/bundle_setup/data-install-1.6.0.0.php b/app/code/core/Mage/Bundle/data/bundle_setup/data-install-1.6.0.0.php index f11710d34b68837f7750a81ee6b3b66c5bbb223a..be8f0baefc0a6040a6b801fdeb414aa2bd34dd07 100644 --- a/app/code/core/Mage/Bundle/data/bundle_setup/data-install-1.6.0.0.php +++ b/app/code/core/Mage/Bundle/data/bundle_setup/data-install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/etc/config.xml b/app/code/core/Mage/Bundle/etc/config.xml index 4bb20ee96276f83e871fa80303af40d802857292..af9c2188587d432fd5853d05194688b5f6a48eb5 100644 --- a/app/code/core/Mage/Bundle/etc/config.xml +++ b/app/code/core/Mage/Bundle/etc/config.xml @@ -21,14 +21,14 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> <config> <modules> <Mage_Bundle> - <version>1.6.0.0</version> + <version>1.6.0.0.1</version> </Mage_Bundle> </modules> <global> diff --git a/app/code/core/Mage/Bundle/etc/fieldset.xml b/app/code/core/Mage/Bundle/etc/fieldset.xml index e97bd79595ac6c8034bc4683b33f9dc894ecb921..6e7b334120dadf8b70b84f174179c935ab45848b 100644 --- a/app/code/core/Mage/Bundle/etc/fieldset.xml +++ b/app/code/core/Mage/Bundle/etc/fieldset.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Bundle/sql/bundle_setup/install-1.6.0.0.php b/app/code/core/Mage/Bundle/sql/bundle_setup/install-1.6.0.0.php index 30f535f2c9d2ddb678c17b6a9c46ab7493179dea..759c47cdfe29e1f87c65f40673af649af9afcd06 100644 --- a/app/code/core/Mage/Bundle/sql/bundle_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/Bundle/sql/bundle_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-1.6.0.0-1.6.0.0.1.php b/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-1.6.0.0-1.6.0.0.1.php new file mode 100644 index 0000000000000000000000000000000000000000..43e2bf45535386ff80d19586a7fb1cc4ed221905 --- /dev/null +++ b/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-upgrade-1.6.0.0-1.6.0.0.1.php @@ -0,0 +1,44 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Bundle + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +$installFile = dirname(__FILE__) . DS . 'upgrade-1.6.0.0-1.6.0.0.1.php'; +if (file_exists($installFile)) { + include $installFile; +} + +/** @var $installer Mage_Catalog_Model_Resource_Setup */ +$installer = $this; +/** @var $connection Varien_Db_Adapter_Pdo_Mysql */ +$connection = $installer->getConnection(); +$memoryTables = array( + 'catalog_product_index_price_bundle_opt_tmp', + 'catalog_product_index_price_bundle_sel_tmp', + 'catalog_product_index_price_bundle_tmp', +); + +foreach ($memoryTables as $table) { + $connection->changeTableEngine($installer->getTable($table), Varien_Db_Adapter_Pdo_Mysql::ENGINE_MEMORY); +} diff --git a/app/code/core/Mage/Bundle/sql/bundle_setup/upgrade-1.6.0.0-1.6.0.0.1.php b/app/code/core/Mage/Bundle/sql/bundle_setup/upgrade-1.6.0.0-1.6.0.0.1.php new file mode 100644 index 0000000000000000000000000000000000000000..214d8d9194238f44bf74de0ad2b118c14065c587 --- /dev/null +++ b/app/code/core/Mage/Bundle/sql/bundle_setup/upgrade-1.6.0.0-1.6.0.0.1.php @@ -0,0 +1,84 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Bundle + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** @var $installer Mage_Catalog_Model_Resource_Setup */ +$installer = $this; +$connection = $installer->getConnection(); + +$priceIndexerTables = array( + 'catalog_product_index_price_bundle_idx', + 'catalog_product_index_price_bundle_tmp', +); + +$optionsPriceIndexerTables = array( + 'catalog_product_index_price_bundle_opt_idx', + 'catalog_product_index_price_bundle_opt_tmp', +); + +$selectionPriceIndexerTables = array( + 'catalog_product_index_price_bundle_sel_idx', + 'catalog_product_index_price_bundle_sel_tmp', +); + +foreach ($priceIndexerTables as $table) { + $connection->addColumn($installer->getTable($table), 'group_price', array( + 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, + 'length' => '12,4', + 'comment' => 'Group price', + )); + $connection->addColumn($installer->getTable($table), 'base_group_price', array( + 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, + 'length' => '12,4', + 'comment' => 'Base Group Price', + )); + $connection->addColumn($installer->getTable($table), 'group_price_percent', array( + 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, + 'length' => '12,4', + 'comment' => 'Group Price Percent', + )); +} + +foreach (array_merge($optionsPriceIndexerTables, $selectionPriceIndexerTables) as $table) { + $connection->addColumn($installer->getTable($table), 'group_price', array( + 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, + 'length' => '12,4', + 'comment' => 'Group price', + )); +} + +foreach ($optionsPriceIndexerTables as $table) { + $connection->addColumn($installer->getTable($table), 'alt_group_price', array( + 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, + 'length' => '12,4', + 'comment' => 'Alt Group Price', + )); +} + +$applyTo = explode(',', $installer->getAttribute(Mage_Catalog_Model_Product::ENTITY, 'group_price', 'apply_to')); +if (!in_array('bundle', $applyTo)) { + $applyTo[] = 'bundle'; + $installer->updateAttribute(Mage_Catalog_Model_Product::ENTITY, 'group_price', 'apply_to', implode(',', $applyTo)); +} diff --git a/app/code/core/Mage/Bundle/view/adminhtml/layout.xml b/app/code/core/Mage/Bundle/view/adminhtml/layout.xml index 217e6b9ee7cc96d1a75806c2b2c5676f14eb4901..04088e94f24f70a95e1ac9b0fa38e5c4138e1a47 100644 --- a/app/code/core/Mage/Bundle/view/adminhtml/layout.xml +++ b/app/code/core/Mage/Bundle/view/adminhtml/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Bundle/view/adminhtml/product/composite/fieldset/options/bundle.phtml b/app/code/core/Mage/Bundle/view/adminhtml/product/composite/fieldset/options/bundle.phtml index 7ec25c4ec74f52ebd91cc08f06708fc48f149125..812eaee17ca6f82d1bdb2ba6962cc599de360d8e 100644 --- a/app/code/core/Mage/Bundle/view/adminhtml/product/composite/fieldset/options/bundle.phtml +++ b/app/code/core/Mage/Bundle/view/adminhtml/product/composite/fieldset/options/bundle.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Bundle/view/adminhtml/product/composite/fieldset/options/type/checkbox.phtml b/app/code/core/Mage/Bundle/view/adminhtml/product/composite/fieldset/options/type/checkbox.phtml index ee9fe0f65e2cbe3932cd2c731ef170178aa99ae0..5e99121107a7bf2e74f01f9c81726a3ae0b22832 100644 --- a/app/code/core/Mage/Bundle/view/adminhtml/product/composite/fieldset/options/type/checkbox.phtml +++ b/app/code/core/Mage/Bundle/view/adminhtml/product/composite/fieldset/options/type/checkbox.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/Bundle/view/adminhtml/product/composite/fieldset/options/type/multi.phtml b/app/code/core/Mage/Bundle/view/adminhtml/product/composite/fieldset/options/type/multi.phtml index 4d9420abf44a700410cddf9d00c87fba394a3965..fb6fc84c93251aa31e14d8674370b2cc58c40352 100644 --- a/app/code/core/Mage/Bundle/view/adminhtml/product/composite/fieldset/options/type/multi.phtml +++ b/app/code/core/Mage/Bundle/view/adminhtml/product/composite/fieldset/options/type/multi.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/Bundle/view/adminhtml/product/composite/fieldset/options/type/radio.phtml b/app/code/core/Mage/Bundle/view/adminhtml/product/composite/fieldset/options/type/radio.phtml index 4ca4f23e7abf4988b65947361b9deab0975af212..2675e600acd9fb8e6f8099cbbcf1a69cada88586 100644 --- a/app/code/core/Mage/Bundle/view/adminhtml/product/composite/fieldset/options/type/radio.phtml +++ b/app/code/core/Mage/Bundle/view/adminhtml/product/composite/fieldset/options/type/radio.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/Bundle/view/adminhtml/product/composite/fieldset/options/type/select.phtml b/app/code/core/Mage/Bundle/view/adminhtml/product/composite/fieldset/options/type/select.phtml index abde139db0d48a7ea6dbbd0ed79ead3dd806d6c5..31526f0428680882f3da9960225c4c864cc72679 100644 --- a/app/code/core/Mage/Bundle/view/adminhtml/product/composite/fieldset/options/type/select.phtml +++ b/app/code/core/Mage/Bundle/view/adminhtml/product/composite/fieldset/options/type/select.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/Bundle/view/adminhtml/product/edit/bundle.phtml b/app/code/core/Mage/Bundle/view/adminhtml/product/edit/bundle.phtml index 0edb2a0043f704e4e1792e986ceca87a82297324..9fbde6677e2a9491934bd7d7a17ef1f6e8a3099d 100644 --- a/app/code/core/Mage/Bundle/view/adminhtml/product/edit/bundle.phtml +++ b/app/code/core/Mage/Bundle/view/adminhtml/product/edit/bundle.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Bundle/view/adminhtml/product/edit/bundle/option.phtml b/app/code/core/Mage/Bundle/view/adminhtml/product/edit/bundle/option.phtml index 7f681f66a706482a7a6449136b984f3e8016445c..0eddff17e2f2b48143f90f1dcbe61b681e4f2061 100644 --- a/app/code/core/Mage/Bundle/view/adminhtml/product/edit/bundle/option.phtml +++ b/app/code/core/Mage/Bundle/view/adminhtml/product/edit/bundle/option.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Bundle/view/adminhtml/product/edit/bundle/option/search.phtml b/app/code/core/Mage/Bundle/view/adminhtml/product/edit/bundle/option/search.phtml index 7a2fe9ba4f74339dcd3108716b425d20e1f73335..3649d47e9ffa5e4a700c9ef8b6ef8b6c339e252e 100644 --- a/app/code/core/Mage/Bundle/view/adminhtml/product/edit/bundle/option/search.phtml +++ b/app/code/core/Mage/Bundle/view/adminhtml/product/edit/bundle/option/search.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Bundle/view/adminhtml/product/edit/bundle/option/selection.phtml b/app/code/core/Mage/Bundle/view/adminhtml/product/edit/bundle/option/selection.phtml index 19e9b608a6de9ff7370af3a09e5b83fb2a8b7ce8..4db875553beb0b529be493331b5f4082381c00b4 100644 --- a/app/code/core/Mage/Bundle/view/adminhtml/product/edit/bundle/option/selection.phtml +++ b/app/code/core/Mage/Bundle/view/adminhtml/product/edit/bundle/option/selection.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Bundle/view/adminhtml/sales/creditmemo/create/items/renderer.phtml b/app/code/core/Mage/Bundle/view/adminhtml/sales/creditmemo/create/items/renderer.phtml index 9fa999f9429d91073e948acad2f88f6986698341..f67f5a9446e81b831078cff3db96400f634a6038 100644 --- a/app/code/core/Mage/Bundle/view/adminhtml/sales/creditmemo/create/items/renderer.phtml +++ b/app/code/core/Mage/Bundle/view/adminhtml/sales/creditmemo/create/items/renderer.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Bundle/view/adminhtml/sales/creditmemo/view/items/renderer.phtml b/app/code/core/Mage/Bundle/view/adminhtml/sales/creditmemo/view/items/renderer.phtml index 43fee1b0a78d158424af05f59a86db8bcb7916f9..cb0501c3c0022d1cab1a0bdc17f87a69fe302f77 100644 --- a/app/code/core/Mage/Bundle/view/adminhtml/sales/creditmemo/view/items/renderer.phtml +++ b/app/code/core/Mage/Bundle/view/adminhtml/sales/creditmemo/view/items/renderer.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Bundle/view/adminhtml/sales/invoice/create/items/renderer.phtml b/app/code/core/Mage/Bundle/view/adminhtml/sales/invoice/create/items/renderer.phtml index da23543ee1502cc44683e1b0377892e529d22857..4a347c2d07d4d67b523b79d91bc952f5e3b710ff 100644 --- a/app/code/core/Mage/Bundle/view/adminhtml/sales/invoice/create/items/renderer.phtml +++ b/app/code/core/Mage/Bundle/view/adminhtml/sales/invoice/create/items/renderer.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Bundle/view/adminhtml/sales/invoice/view/items/renderer.phtml b/app/code/core/Mage/Bundle/view/adminhtml/sales/invoice/view/items/renderer.phtml index b585e15270c10979b434a9b7be74a114a987646d..e5aec80b512b6e2e21ed425f8210b1077dea13ce 100644 --- a/app/code/core/Mage/Bundle/view/adminhtml/sales/invoice/view/items/renderer.phtml +++ b/app/code/core/Mage/Bundle/view/adminhtml/sales/invoice/view/items/renderer.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Bundle/view/adminhtml/sales/order/view/items/renderer.phtml b/app/code/core/Mage/Bundle/view/adminhtml/sales/order/view/items/renderer.phtml index 5b70bbd18028f71b04adac10728268559b77277c..991801fbaaac536e5c1bf51d6a2be77b302ee6e2 100644 --- a/app/code/core/Mage/Bundle/view/adminhtml/sales/order/view/items/renderer.phtml +++ b/app/code/core/Mage/Bundle/view/adminhtml/sales/order/view/items/renderer.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Bundle/view/adminhtml/sales/shipment/create/items/renderer.phtml b/app/code/core/Mage/Bundle/view/adminhtml/sales/shipment/create/items/renderer.phtml index 197f96021c37b9a19ba406407fdebac893995369..8924cf628b39428d15608c532afeb466f12020c0 100644 --- a/app/code/core/Mage/Bundle/view/adminhtml/sales/shipment/create/items/renderer.phtml +++ b/app/code/core/Mage/Bundle/view/adminhtml/sales/shipment/create/items/renderer.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Bundle/view/adminhtml/sales/shipment/view/items/renderer.phtml b/app/code/core/Mage/Bundle/view/adminhtml/sales/shipment/view/items/renderer.phtml index b89b9de260c78a54bc7da535cbaf59267305a6b0..9d5e11e269ddf221583b3297912df7dfdee46c0f 100644 --- a/app/code/core/Mage/Bundle/view/adminhtml/sales/shipment/view/items/renderer.phtml +++ b/app/code/core/Mage/Bundle/view/adminhtml/sales/shipment/view/items/renderer.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Bundle/view/frontend/bundle.js b/app/code/core/Mage/Bundle/view/frontend/bundle.js index 56c8c82c69f81f18838f3b09ad9df447fdbb7728..e803e253c8cf437007e54547a8d02de8b2860a48 100644 --- a/app/code/core/Mage/Bundle/view/frontend/bundle.js +++ b/app/code/core/Mage/Bundle/view/frontend/bundle.js @@ -19,7 +19,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ if(typeof Product=='undefined') { diff --git a/app/code/core/Mage/Bundle/view/frontend/catalog/product/price.phtml b/app/code/core/Mage/Bundle/view/frontend/catalog/product/price.phtml index df093c98d4626b4967d86d89693d504b738d9750..7ad2d7b58d309807b7de40f23e51e22d48b5f52f 100644 --- a/app/code/core/Mage/Bundle/view/frontend/catalog/product/price.phtml +++ b/app/code/core/Mage/Bundle/view/frontend/catalog/product/price.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -35,12 +35,17 @@ <?php if ($_product->getPriceType() == 1) { $_weeeTaxAmount = Mage::helper('Mage_Weee_Helper_Data')->getAmount($_product); + $_weeeTaxAmountInclTaxes = $_weeeTaxAmount; + if (Mage::helper('Mage_Weee_Helper_Data')->isTaxable()) { + $_attributes = Mage::helper('Mage_Weee_Helper_Data')->getProductWeeeAttributesForRenderer($_product, null, null, null, true); + $_weeeTaxAmountInclTaxes = Mage::helper('Mage_Weee_Helper_Data')->getAmountInclTaxes($_attributes); + } if ($_weeeTaxAmount && Mage::helper('Mage_Weee_Helper_Data')->typeOfDisplay($_product, array(0, 1, 4))) { $_minimalPriceTax += $_weeeTaxAmount; - $_minimalPriceInclTax += $_weeeTaxAmount; + $_minimalPriceInclTax += $_weeeTaxAmountInclTaxes; } if ($_weeeTaxAmount && Mage::helper('Mage_Weee_Helper_Data')->typeOfDisplay($_product, 2)) { - $_minimalPriceInclTax += $_weeeTaxAmount; + $_minimalPriceInclTax += $_weeeTaxAmountInclTaxes; } if (Mage::helper('Mage_Weee_Helper_Data')->typeOfDisplay($_product, array(1, 2, 4))) { @@ -153,10 +158,10 @@ if ($_product->getPriceType() == 1) { if ($_product->getPriceType() == 1) { if ($_weeeTaxAmount && Mage::helper('Mage_Weee_Helper_Data')->typeOfDisplay($_product, array(0, 1, 4))) { $_maximalPriceTax += $_weeeTaxAmount; - $_maximalPriceInclTax += $_weeeTaxAmount; + $_maximalPriceInclTax += $_weeeTaxAmountInclTaxes; } if ($_weeeTaxAmount && Mage::helper('Mage_Weee_Helper_Data')->typeOfDisplay($_product, 2)) { - $_maximalPriceInclTax += $_weeeTaxAmount; + $_maximalPriceInclTax += $_weeeTaxAmountInclTaxes; } } ?> diff --git a/app/code/core/Mage/Bundle/view/frontend/catalog/product/view/options/notice.phtml b/app/code/core/Mage/Bundle/view/frontend/catalog/product/view/options/notice.phtml index 8a4b97da0f1a418165a6dfe131e7962daea91502..93c8ff90e2c3de5afc8f29af75f1828618015bb6 100644 --- a/app/code/core/Mage/Bundle/view/frontend/catalog/product/view/options/notice.phtml +++ b/app/code/core/Mage/Bundle/view/frontend/catalog/product/view/options/notice.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Bundle/view/frontend/catalog/product/view/price.phtml b/app/code/core/Mage/Bundle/view/frontend/catalog/product/view/price.phtml index 10b6bcf98ec0892ce386e466bcf20802ac3b0ca5..8d9a5d297c5513486a4e1e96c61ec1a0f635ef48 100644 --- a/app/code/core/Mage/Bundle/view/frontend/catalog/product/view/price.phtml +++ b/app/code/core/Mage/Bundle/view/frontend/catalog/product/view/price.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Bundle/view/frontend/catalog/product/view/tierprices.phtml b/app/code/core/Mage/Bundle/view/frontend/catalog/product/view/tierprices.phtml index 80576267bef702e987f1733a904fa598173e3fa2..adf0f60e5597f0c0452d543c230233c04916f16f 100644 --- a/app/code/core/Mage/Bundle/view/frontend/catalog/product/view/tierprices.phtml +++ b/app/code/core/Mage/Bundle/view/frontend/catalog/product/view/tierprices.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Bundle/view/frontend/catalog/product/view/type/bundle.phtml b/app/code/core/Mage/Bundle/view/frontend/catalog/product/view/type/bundle.phtml index 8f331941f74bd4ca1fb0d1dabc42d1401fc41922..2ba0a21a548b47f6cdee1d805c272033b844338d 100644 --- a/app/code/core/Mage/Bundle/view/frontend/catalog/product/view/type/bundle.phtml +++ b/app/code/core/Mage/Bundle/view/frontend/catalog/product/view/type/bundle.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/Bundle/view/frontend/catalog/product/view/type/bundle/option/checkbox.phtml b/app/code/core/Mage/Bundle/view/frontend/catalog/product/view/type/bundle/option/checkbox.phtml index 47f5b382d9a46c7cf95c75fa49f11e8a2338da36..cc04c120ddb033f903bd2d73eff98a27b3e2daae 100644 --- a/app/code/core/Mage/Bundle/view/frontend/catalog/product/view/type/bundle/option/checkbox.phtml +++ b/app/code/core/Mage/Bundle/view/frontend/catalog/product/view/type/bundle/option/checkbox.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/Bundle/view/frontend/catalog/product/view/type/bundle/option/multi.phtml b/app/code/core/Mage/Bundle/view/frontend/catalog/product/view/type/bundle/option/multi.phtml index 78f7740964021836628d139a584b7dd7bb5e0398..5f115c67214ca3450e088983c00209632d0a5ce2 100644 --- a/app/code/core/Mage/Bundle/view/frontend/catalog/product/view/type/bundle/option/multi.phtml +++ b/app/code/core/Mage/Bundle/view/frontend/catalog/product/view/type/bundle/option/multi.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/Bundle/view/frontend/catalog/product/view/type/bundle/option/radio.phtml b/app/code/core/Mage/Bundle/view/frontend/catalog/product/view/type/bundle/option/radio.phtml index a8af8fd096d77a40b729e8270fac4ca1d781c2c4..f02ad6fea9c06d91476916fcdefcc4c0e758ef00 100644 --- a/app/code/core/Mage/Bundle/view/frontend/catalog/product/view/type/bundle/option/radio.phtml +++ b/app/code/core/Mage/Bundle/view/frontend/catalog/product/view/type/bundle/option/radio.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/Bundle/view/frontend/catalog/product/view/type/bundle/option/select.phtml b/app/code/core/Mage/Bundle/view/frontend/catalog/product/view/type/bundle/option/select.phtml index 0d28c8fdae571c866e9a45631b0d1fea1900c36d..c8cf9e8f8833ea64f5ba3b290b70e0475770c877 100644 --- a/app/code/core/Mage/Bundle/view/frontend/catalog/product/view/type/bundle/option/select.phtml +++ b/app/code/core/Mage/Bundle/view/frontend/catalog/product/view/type/bundle/option/select.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/Bundle/view/frontend/catalog/product/view/type/bundle/options.phtml b/app/code/core/Mage/Bundle/view/frontend/catalog/product/view/type/bundle/options.phtml index 1e1aa4f2eca3c1e18356a42b4d74059c7f2e4abe..c52f0ace16901d9d9b4b50648b648e051028f4ef 100644 --- a/app/code/core/Mage/Bundle/view/frontend/catalog/product/view/type/bundle/options.phtml +++ b/app/code/core/Mage/Bundle/view/frontend/catalog/product/view/type/bundle/options.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Bundle/view/frontend/email/order/items/creditmemo/default.phtml b/app/code/core/Mage/Bundle/view/frontend/email/order/items/creditmemo/default.phtml index b362fd38ed02afa3dc8b7db8edab7d1a5f82dde0..8cf26befcd0a29dd1222ed1ac8ae3d248dab8f20 100644 --- a/app/code/core/Mage/Bundle/view/frontend/email/order/items/creditmemo/default.phtml +++ b/app/code/core/Mage/Bundle/view/frontend/email/order/items/creditmemo/default.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Bundle/view/frontend/email/order/items/invoice/default.phtml b/app/code/core/Mage/Bundle/view/frontend/email/order/items/invoice/default.phtml index 1ae556187989abade2219a1c4d79d8c99fa0a1cc..ee29073b9411b746fa644491ea93a28daf8e24c6 100644 --- a/app/code/core/Mage/Bundle/view/frontend/email/order/items/invoice/default.phtml +++ b/app/code/core/Mage/Bundle/view/frontend/email/order/items/invoice/default.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Bundle/view/frontend/email/order/items/order/default.phtml b/app/code/core/Mage/Bundle/view/frontend/email/order/items/order/default.phtml index 60356b4247595b90184bfacfc60cd7b7c4d4111e..e5c5eee673ee57bf07e01824f6313b1d2085f830 100644 --- a/app/code/core/Mage/Bundle/view/frontend/email/order/items/order/default.phtml +++ b/app/code/core/Mage/Bundle/view/frontend/email/order/items/order/default.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Bundle/view/frontend/email/order/items/shipment/default.phtml b/app/code/core/Mage/Bundle/view/frontend/email/order/items/shipment/default.phtml index 59a872366042a587da3f9a2a7265ff4ef3849121..2a9e4ec53530853129eec452c5d52a09abceece3 100644 --- a/app/code/core/Mage/Bundle/view/frontend/email/order/items/shipment/default.phtml +++ b/app/code/core/Mage/Bundle/view/frontend/email/order/items/shipment/default.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Bundle/view/frontend/layout.xml b/app/code/core/Mage/Bundle/view/frontend/layout.xml index f0123909477a03ecd50dcf8a5c68eb2ac2ecfbca..b03fe0fcd2ec3a88a988661d4ab3303c27281637 100644 --- a/app/code/core/Mage/Bundle/view/frontend/layout.xml +++ b/app/code/core/Mage/Bundle/view/frontend/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/Bundle/view/frontend/rss/catalog/product/price.phtml b/app/code/core/Mage/Bundle/view/frontend/rss/catalog/product/price.phtml index 90233fd6c79528a8ee741e9979851ce81c6aa9eb..95b494afe38b3be2d01fc051ddd5cd63b99c3c9f 100644 --- a/app/code/core/Mage/Bundle/view/frontend/rss/catalog/product/price.phtml +++ b/app/code/core/Mage/Bundle/view/frontend/rss/catalog/product/price.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Bundle/view/frontend/sales/order/creditmemo/items/renderer.phtml b/app/code/core/Mage/Bundle/view/frontend/sales/order/creditmemo/items/renderer.phtml index b4b8514d4b8013f1472969b59f8928de9a81ea0c..00a5f0f7c607d3f2128bd3da3e8bf05cbafc32c8 100644 --- a/app/code/core/Mage/Bundle/view/frontend/sales/order/creditmemo/items/renderer.phtml +++ b/app/code/core/Mage/Bundle/view/frontend/sales/order/creditmemo/items/renderer.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Bundle/view/frontend/sales/order/invoice/items/renderer.phtml b/app/code/core/Mage/Bundle/view/frontend/sales/order/invoice/items/renderer.phtml index 9d1093369487941a17ee8b3bf3ba0d3729e39376..977d7e34361307f4a0d64b799eb80b693e986daa 100644 --- a/app/code/core/Mage/Bundle/view/frontend/sales/order/invoice/items/renderer.phtml +++ b/app/code/core/Mage/Bundle/view/frontend/sales/order/invoice/items/renderer.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Bundle/view/frontend/sales/order/items/renderer.phtml b/app/code/core/Mage/Bundle/view/frontend/sales/order/items/renderer.phtml index 7153357e3756f17302018715de0f6ebb07fd547b..0398cbea96e2b7554ea85f4b39c1fcc0be0e55f2 100644 --- a/app/code/core/Mage/Bundle/view/frontend/sales/order/items/renderer.phtml +++ b/app/code/core/Mage/Bundle/view/frontend/sales/order/items/renderer.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Bundle/view/frontend/sales/order/shipment/items/renderer.phtml b/app/code/core/Mage/Bundle/view/frontend/sales/order/shipment/items/renderer.phtml index 17afe53ea510da3eb5b77fa8fc9bf3c1849f3202..5349e886843134973fc7dc57d884966fc66ae4db 100644 --- a/app/code/core/Mage/Bundle/view/frontend/sales/order/shipment/items/renderer.phtml +++ b/app/code/core/Mage/Bundle/view/frontend/sales/order/shipment/items/renderer.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Captcha/Block/Captcha.php b/app/code/core/Mage/Captcha/Block/Captcha.php new file mode 100755 index 0000000000000000000000000000000000000000..7453fb41902db8cd641fee9cb340ee5acad2679c --- /dev/null +++ b/app/code/core/Mage/Captcha/Block/Captcha.php @@ -0,0 +1,48 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Captcha + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Captcha block + * + * @category Core + * @package Mage_Captcha + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Captcha_Block_Captcha extends Mage_Core_Block_Template +{ + /** + * Renders captcha HTML (if required) + * + * @return string + */ + protected function _toHtml() + { + $blockPath = Mage::helper('Mage_Captcha_Helper_Data')->getCaptcha($this->getFormId())->getBlockName(); + $block = $this->getLayout()->createBlock($blockPath); + $block->setData($this->getData()); + return $block->toHtml(); + } +} diff --git a/app/code/core/Mage/Captcha/Block/Captcha/Zend.php b/app/code/core/Mage/Captcha/Block/Captcha/Zend.php new file mode 100755 index 0000000000000000000000000000000000000000..814a173f19313633d2caaea6b6362eaa1854f578 --- /dev/null +++ b/app/code/core/Mage/Captcha/Block/Captcha/Zend.php @@ -0,0 +1,87 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Captcha + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Captcha block + * + * @category Core + * @package Mage_Captcha + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Captcha_Block_Captcha_Zend extends Mage_Core_Block_Template +{ + protected $_template = 'zend.phtml'; + + /** + * @var string + */ + protected $_captcha; + + /** + * Returns template path + * + * @return string + */ + public function getTemplate() + { + return $this->getIsAjax() ? '' : $this->_template; + } + + /** + * Returns URL to controller action which returns new captcha image + * + * @return string + */ + public function getRefreshUrl() + { + $url = Mage::app()->getStore()->isAdmin() ? "adminhtml/refresh/refresh" : "captcha/refresh"; + return Mage::getUrl($url, array('_secure' => Mage::app()->getRequest()->isSecure())); + } + + /** + * Renders captcha HTML (if required) + * + * @return string + */ + protected function _toHtml() + { + if ($this->getCaptchaModel()->isRequired()) { + $this->getCaptchaModel()->generate(); + return parent::_toHtml(); + } + return ''; + } + + /** + * Returns captcha model + * + * @return Mage_Captcha_Model_Abstract + */ + public function getCaptchaModel() + { + return Mage::helper('Mage_Captcha_Helper_Data')->getCaptcha($this->getFormId()); + } +} diff --git a/app/code/core/Mage/Captcha/Helper/Data.php b/app/code/core/Mage/Captcha/Helper/Data.php new file mode 100755 index 0000000000000000000000000000000000000000..bb6dbee4f2c5021ef59dc820c36415cca049f686 --- /dev/null +++ b/app/code/core/Mage/Captcha/Helper/Data.php @@ -0,0 +1,138 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Captcha + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Captcha image model + * + * @category Mage + * @package Mage_Captcha + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Captcha_Helper_Data extends Mage_Core_Helper_Abstract +{ + /** + * Used for "name" attribute of captcha's input field + */ + const INPUT_NAME_FIELD_VALUE = 'captcha'; + + /** + * Always show captcha + */ + const MODE_ALWAYS = 'always'; + + /** + * Show captcha only after certain number of unsuccessful attempts + */ + const MODE_AFTER_FAIL = 'after_fail'; + + /** + * Captcha fonts path + */ + const XML_PATH_CAPTCHA_FONTS = 'default/captcha/fonts'; + + /** + * List uses Models of Captcha + * @var array + */ + protected $_captcha = array(); + + /** + * Get Captcha + * + * @param string $formId + * @return Mage_Captcha_Model_Interface + */ + public function getCaptcha($formId) + { + if (!array_key_exists($formId, $this->_captcha)) { + $type = ucfirst($this->getConfigNode('type')); + $this->_captcha[$formId] = Mage::getModel('Mage_Captcha_Model_' . $type, array('formId' => $formId)); + } + return $this->_captcha[$formId]; + } + + /** + * Returns value of the node with respect to current area (frontend or backend) + * + * @param string $id The last part of XML_PATH_$area_CAPTCHA_ constant (case insensitive) + * @param Mage_Core_Model_Store $store + * @return Mage_Core_Model_Config_Element + */ + public function getConfigNode($id, $store = null) + { + $areaCode = Mage::app()->getStore($store)->isAdmin() ? 'admin' : 'customer'; + return Mage::getStoreConfig( $areaCode . '/captcha/' . $id, $store); + } + + /** + * Get list of available fonts + * Return format: + * [['arial'] => ['label' => 'Arial', 'path' => '/www/magento/fonts/arial.ttf']] + * + * @return array + */ + public function getFonts() + { + $node = Mage::getConfig()->getNode(Mage_Captcha_Helper_Data::XML_PATH_CAPTCHA_FONTS); + $fonts = array(); + if ($node) { + foreach ($node->children() as $fontName => $fontNode) { + $fonts[$fontName] = array( + 'label' => (string)$fontNode->label, + 'path' => Mage::getBaseDir('base') . DS . $fontNode->path + ); + } + } + return $fonts; + } + + /** + * Get captcha image directory + * + * @param mixed $website + * @return string + */ + public function getImgDir($website = null) + { + $websiteCode = Mage::app()->getWebsite($website)->getCode(); + $captchaDir = Mage::getBaseDir('media') . DS . 'captcha' . DS . $websiteCode . DS; + $io = new Varien_Io_File(); + $io->checkAndCreateFolder($captchaDir, 0755); + return $captchaDir; + } + + /** + * Get captcha image base URL + * + * @param mixed $website + * @return string + */ + public function getImgUrl($website = null) + { + $websiteCode = Mage::app()->getWebsite($website)->getCode(); + return Mage::getBaseUrl('media') . 'captcha' . '/' . $websiteCode . '/'; + } +} diff --git a/app/code/core/Mage/Captcha/Model/Config/Font.php b/app/code/core/Mage/Captcha/Model/Config/Font.php new file mode 100755 index 0000000000000000000000000000000000000000..7b11ef2b53a6e8a2374bd6b27b154cab21be8f7c --- /dev/null +++ b/app/code/core/Mage/Captcha/Model/Config/Font.php @@ -0,0 +1,49 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Captcha + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Captcha image model + * + * @category Mage + * @package Mage_Captcha + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Captcha_Model_Config_Font +{ + /** + * Get options for font selection field + * + * @return array + */ + public function toOptionArray() + { + $optionArray = array(); + foreach (Mage::helper('Mage_Captcha_Helper_Data')->getFonts() as $fontName => $fontData) { + $optionArray[] = array('label' => $fontData['label'], 'value' => $fontName); + } + return $optionArray; + } +} diff --git a/app/code/core/Mage/Captcha/Model/Config/Form/Abstract.php b/app/code/core/Mage/Captcha/Model/Config/Form/Abstract.php new file mode 100755 index 0000000000000000000000000000000000000000..444b5d3a1f04a99465d6e64c1bf059005ee7a19b --- /dev/null +++ b/app/code/core/Mage/Captcha/Model/Config/Form/Abstract.php @@ -0,0 +1,61 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Captcha + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Data source to fill "Forms" field + * + * @category Mage + * @package Mage_Captcha + * @author Magento Core Team <core@magentocommerce.com> + */ +abstract class Mage_Captcha_Model_Config_Form_Abstract extends Mage_Core_Model_Config_Data +{ + /** + * @var string + */ + protected $_configPath; + + /** + * Returns options for form multiselect + * + * @return array + */ + public function toOptionArray() + { + $optionArray = array(); + /* @var $backendNode Mage_Core_Model_Config_Element */ + $backendNode = Mage::getConfig()->getNode($this->_configPath); + if ($backendNode) { + foreach ($backendNode->children() as $formNode) { + /* @var $formNode Mage_Core_Model_Config_Element */ + if (!empty($formNode->label)) { + $optionArray[] = array('label' => (string)$formNode->label, 'value' => $formNode->getName()); + } + } + } + return $optionArray; + } +} diff --git a/app/code/core/Mage/Captcha/Model/Config/Form/Backend.php b/app/code/core/Mage/Captcha/Model/Config/Form/Backend.php new file mode 100755 index 0000000000000000000000000000000000000000..568c70ddb0183c6703c8c19b1539892b54463e03 --- /dev/null +++ b/app/code/core/Mage/Captcha/Model/Config/Form/Backend.php @@ -0,0 +1,40 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Captcha + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Captcha image model + * + * @category Mage + * @package Mage_Captcha + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Captcha_Model_Config_Form_Backend extends Mage_Captcha_Model_Config_Form_Abstract +{ + /** + * @var string + */ + protected $_configPath = 'default/captcha/backend/areas'; +} diff --git a/app/code/core/Mage/Captcha/Model/Config/Form/Frontend.php b/app/code/core/Mage/Captcha/Model/Config/Form/Frontend.php new file mode 100755 index 0000000000000000000000000000000000000000..112903c3031829f2f2ac821bbf4abcebaed3cfa8 --- /dev/null +++ b/app/code/core/Mage/Captcha/Model/Config/Form/Frontend.php @@ -0,0 +1,40 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Captcha + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Captcha image model + * + * @category Mage + * @package Mage_Captcha + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Captcha_Model_Config_Form_Frontend extends Mage_Captcha_Model_Config_Form_Abstract +{ + /** + * @var string + */ + protected $_configPath = 'default/captcha/frontend/areas'; +} diff --git a/app/code/core/Mage/Captcha/Model/Config/Mode.php b/app/code/core/Mage/Captcha/Model/Config/Mode.php new file mode 100755 index 0000000000000000000000000000000000000000..02cb7aa1f2d76aad77bfb1e57a4a893f0b188f02 --- /dev/null +++ b/app/code/core/Mage/Captcha/Model/Config/Mode.php @@ -0,0 +1,54 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Captcha + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Captcha image model + * + * @category Mage + * @package Mage_Captcha + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Captcha_Model_Config_Mode +{ + /** + * Get options for captcha mode selection field + * + * @return array + */ + public function toOptionArray() + { + return array( + array( + 'label' => Mage::helper('Mage_Captcha_Helper_Data')->__('Always'), + 'value' => Mage_Captcha_Helper_Data::MODE_ALWAYS + ), + array( + 'label' => Mage::helper('Mage_Captcha_Helper_Data')->__('After number of attempts to login'), + 'value' => Mage_Captcha_Helper_Data::MODE_AFTER_FAIL + ), + ); + } +} diff --git a/app/code/core/Mage/Captcha/Model/Interface.php b/app/code/core/Mage/Captcha/Model/Interface.php new file mode 100755 index 0000000000000000000000000000000000000000..2fa086c8be4405166fe54c6a07127131a050bdf0 --- /dev/null +++ b/app/code/core/Mage/Captcha/Model/Interface.php @@ -0,0 +1,60 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Captcha + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Captcha interface + * + * @category Mage + * @package Mage_Captcha + * @author Magento Core Team <core@magentocommerce.com> + */ +interface Mage_Captcha_Model_Interface +{ + /** + * Generates captcha + * + * @abstract + * @return void + */ + public function generate(); + + /** + * Checks whether word entered by user corresponds to the one generated by generate() + * + * @abstract + * @param string $word + * @return void + */ + public function isCorrect($word); + + + /** + * Get Block Name + * + * @return string + */ + public function getBlockName(); +} diff --git a/app/code/core/Mage/Captcha/Model/Observer.php b/app/code/core/Mage/Captcha/Model/Observer.php new file mode 100755 index 0000000000000000000000000000000000000000..8eb1ab84943727c198e675032fe8a2a492e85e58 --- /dev/null +++ b/app/code/core/Mage/Captcha/Model/Observer.php @@ -0,0 +1,292 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Captcha + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Captcha Observer + * + * @category Mage + * @package Mage_Captcha + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Captcha_Model_Observer +{ + /** + * Check Captcha On Forgot Password Page + * + * @param Varien_Event_Observer $observer + * @return Mage_Captcha_Model_Observer + */ + public function checkForgotpassword($observer) + { + $formId = 'user_forgotpassword'; + $captchaModel = Mage::helper('Mage_Captcha_Helper_Data')->getCaptcha($formId); + if ($captchaModel->isRequired()) { + $controller = $observer->getControllerAction(); + if (!$captchaModel->isCorrect($this->_getCaptchaString($controller->getRequest(), $formId))) { + Mage::getSingleton('Mage_Customer_Model_Session')->addError(Mage::helper('Mage_Captcha_Helper_Data')->__('Incorrect CAPTCHA.')); + $controller->setFlag('', Mage_Core_Controller_Varien_Action::FLAG_NO_DISPATCH, true); + $controller->getResponse()->setRedirect(Mage::getUrl('*/*/forgotpassword')); + } + } + return $this; + } + + /** + * Check Captcha On User Login Page + * + * @param Varien_Event_Observer $observer + * @return Mage_Captcha_Model_Observer + */ + public function checkUserLogin($observer) + { + $formId = 'user_login'; + $captchaModel = Mage::helper('Mage_Captcha_Helper_Data')->getCaptcha($formId); + $controller = $observer->getControllerAction(); + $loginParams = $controller->getRequest()->getPost('login'); + $login = array_key_exists('username', $loginParams) ? $loginParams['username'] : null; + if ($captchaModel->isRequired($login)) { + $word = $this->_getCaptchaString($controller->getRequest(), $formId); + if (!$captchaModel->isCorrect($word)) { + Mage::getSingleton('Mage_Customer_Model_Session')->addError(Mage::helper('Mage_Captcha_Helper_Data')->__('Incorrect CAPTCHA.')); + $controller->setFlag('', Mage_Core_Controller_Varien_Action::FLAG_NO_DISPATCH, true); + Mage::getSingleton('Mage_Customer_Model_Session')->setUsername($login); + $beforeUrl = Mage::getSingleton('Mage_Customer_Model_Session')->getBeforeAuthUrl(); + $url = $beforeUrl ? $beforeUrl : Mage::helper('Mage_Customer_Helper_Data')->getLoginUrl(); + $controller->getResponse()->setRedirect($url); + } + } + $captchaModel->logAttempt($login); + return $this; + } + + /** + * Check Captcha On Register User Page + * + * @param Varien_Event_Observer $observer + * @return Mage_Captcha_Model_Observer + */ + public function checkUserCreate($observer) + { + $formId = 'user_create'; + $captchaModel = Mage::helper('Mage_Captcha_Helper_Data')->getCaptcha($formId); + if ($captchaModel->isRequired()) { + $controller = $observer->getControllerAction(); + if (!$captchaModel->isCorrect($this->_getCaptchaString($controller->getRequest(), $formId))) { + Mage::getSingleton('Mage_Customer_Model_Session')->addError(Mage::helper('Mage_Captcha_Helper_Data')->__('Incorrect CAPTCHA.')); + $controller->setFlag('', Mage_Core_Controller_Varien_Action::FLAG_NO_DISPATCH, true); + Mage::getSingleton('Mage_Customer_Model_Session')->setCustomerFormData($controller->getRequest()->getPost()); + $controller->getResponse()->setRedirect(Mage::getUrl('*/*/create')); + } + } + return $this; + } + + /** + * Check Captcha On Checkout as Guest Page + * + * @param Varien_Event_Observer $observer + * @return Mage_Captcha_Model_Observer + */ + public function checkGuestCheckout($observer) + { + $formId = 'guest_checkout'; + $captchaModel = Mage::helper('Mage_Captcha_Helper_Data')->getCaptcha($formId); + $checkoutMethod = Mage::getSingleton('Mage_Checkout_Model_Type_Onepage')->getQuote()->getCheckoutMethod(); + if ($checkoutMethod == Mage_Checkout_Model_Type_Onepage::METHOD_GUEST) { + if ($captchaModel->isRequired()) { + $controller = $observer->getControllerAction(); + if (!$captchaModel->isCorrect($this->_getCaptchaString($controller->getRequest(), $formId))) { + $controller->setFlag('', Mage_Core_Controller_Varien_Action::FLAG_NO_DISPATCH, true); + $result = array('error' => 1, 'message' => Mage::helper('Mage_Captcha_Helper_Data')->__('Incorrect CAPTCHA.')); + $controller->getResponse()->setBody(Mage::helper('Mage_Core_Helper_Data')->jsonEncode($result)); + } + } + } + return $this; + } + + /** + * Check Captcha On Checkout Register Page + * + * @param Varien_Event_Observer $observer + * @return Mage_Captcha_Model_Observer + */ + public function checkRegisterCheckout($observer) + { + $formId = 'register_during_checkout'; + $captchaModel = Mage::helper('Mage_Captcha_Helper_Data')->getCaptcha($formId); + $checkoutMethod = Mage::getSingleton('Mage_Checkout_Model_Type_Onepage')->getQuote()->getCheckoutMethod(); + if ($checkoutMethod == Mage_Checkout_Model_Type_Onepage::METHOD_REGISTER) { + if ($captchaModel->isRequired()) { + $controller = $observer->getControllerAction(); + if (!$captchaModel->isCorrect($this->_getCaptchaString($controller->getRequest(), $formId))) { + $controller->setFlag('', Mage_Core_Controller_Varien_Action::FLAG_NO_DISPATCH, true); + $result = array('error' => 1, 'message' => Mage::helper('Mage_Captcha_Helper_Data')->__('Incorrect CAPTCHA.')); + $controller->getResponse()->setBody(Mage::helper('Mage_Core_Helper_Data')->jsonEncode($result)); + } + } + } + return $this; + } + + /** + * Check Captcha On User Login Backend Page + * + * @param Varien_Event_Observer $observer + * @return Mage_Captcha_Model_Observer + */ + public function checkUserLoginBackend($observer) + { + $formId = 'backend_login'; + $captchaModel = Mage::helper('Mage_Captcha_Helper_Data')->getCaptcha($formId); + $loginParams = Mage::app()->getRequest()->getPost('login'); + $login = is_array($loginParams) && array_key_exists('username', $loginParams) ? $loginParams['username'] : null; + if ($captchaModel->isRequired($login)) { + if (!$captchaModel->isCorrect($this->_getCaptchaString(Mage::app()->getRequest(), $formId))) { + $captchaModel->logAttempt($login); + Mage::throwException(Mage::helper('Mage_Captcha_Helper_Data')->__('Incorrect CAPTCHA.')); + } + } + $captchaModel->logAttempt($login); + return $this; + } + + /** + * Returns backend session + * + * @return Mage_Adminhtml_Model_Session + */ + protected function _getBackendSession() + { + return Mage::getSingleton('Mage_Adminhtml_Model_Session'); + } + + /** + * Check Captcha On User Login Backend Page + * + * @param Varien_Event_Observer $observer + * @return Mage_Captcha_Model_Observer + */ + public function checkUserForgotPasswordBackend($observer) + { + $formId = 'backend_forgotpassword'; + $captchaModel = Mage::helper('Mage_Captcha_Helper_Data')->getCaptcha($formId); + $controller = $observer->getControllerAction(); + $email = (string) $observer->getControllerAction()->getRequest()->getParam('email'); + $params = $observer->getControllerAction()->getRequest()->getParams(); + + if (!empty($email) && !empty($params)){ + if ($captchaModel->isRequired()){ + if (!$captchaModel->isCorrect($this->_getCaptchaString($controller->getRequest(), $formId))) { + $this->_getBackendSession()->setEmail((string) $controller->getRequest()->getPost('email')); + $controller->setFlag('', Mage_Core_Controller_Varien_Action::FLAG_NO_DISPATCH, true); + $this->_getBackendSession()->addError(Mage::helper('Mage_Captcha_Helper_Data')->__('Incorrect CAPTCHA.')); + $controller->getResponse()->setRedirect(Mage::getUrl('*/*/forgotpassword')); + } + } + } + return $this; + } + + /** + * Reset Attempts For Frontend + * + * @param Varien_Event_Observer $observer + * @return Mage_Captcha_Model_Observer + */ + public function resetAttemptForFrontend($observer) + { + return $this->_resetAttempt($observer->getModel()->getEmail()); + } + + /** + * Reset Attempts For Backend + * + * @param Varien_Event_Observer $observer + * @return Mage_Captcha_Model_Observer + */ + public function resetAttemptForBackend($observer) + { + return $this->_resetAttempt($observer->getUser()->getUsername()); + } + + /** + * Delete Unnecessary logged attempts + * + * @return Mage_Captcha_Model_Observer + */ + public function deleteOldAttempts() + { + Mage::getResourceModel('Mage_Captcha_Model_Resource_Log')->deleteOldAttempts(); + return $this; + } + + /** + * Delete Expired Captcha Images + * + * @return Mage_Captcha_Model_Observer + */ + public function deleteExpiredImages() + { + foreach (Mage::app()->getWebsites(true) as $website){ + $expire = time() - Mage::helper('Mage_Captcha_Helper_Data')->getConfigNode('timeout', $website->getDefaultStore())*60; + $imageDirectory = Mage::helper('Mage_Captcha_Helper_Data')->getImgDir($website); + foreach (new DirectoryIterator($imageDirectory) as $file) { + if ($file->isFile() && pathinfo($file->getFilename(), PATHINFO_EXTENSION) == 'png') { + if ($file->getMTime() < $expire) { + unlink($file->getPathname()); + } + } + } + } + return $this; + } + + /** + * Reset Attempts + * + * @param string $login + * @return Mage_Captcha_Model_Observer + */ + protected function _resetAttempt($login) + { + Mage::getResourceModel('Mage_Captcha_Model_Resource_Log')->deleteUserAttempts($login); + return $this; + } + + /** + * Get Captcha String + * + * @param Varien_Object $request + * @param string $formId + * @return string + */ + protected function _getCaptchaString($request, $formId) + { + $captchaParams = $request->getPost(Mage_Captcha_Helper_Data::INPUT_NAME_FIELD_VALUE); + return $captchaParams[$formId]; + } +} diff --git a/app/code/core/Mage/Captcha/Model/Resource/Log.php b/app/code/core/Mage/Captcha/Model/Resource/Log.php new file mode 100755 index 0000000000000000000000000000000000000000..9a9490611cdd64d738696dff067675c455ba60f9 --- /dev/null +++ b/app/code/core/Mage/Captcha/Model/Resource/Log.php @@ -0,0 +1,156 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Captcha + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Log Attempts resource + * + * @category Mage + * @package Mage_Captcha + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Captcha_Model_Resource_Log extends Mage_Core_Model_Resource_Db_Abstract +{ + /** + * Type Remote Address + */ + const TYPE_REMOTE_ADDRESS = 1; + /** + * Type User Login Name + */ + const TYPE_LOGIN = 2; + + /** + * Define main table + * + */ + protected function _construct() + { + $this->_init('captcha_log', array('type','value')); + } + + /** + * Save or Update count Attempts + * + * @param string|null $login + * @return Mage_Captcha_Model_Resource_Log + */ + public function logAttempt($login) + { + if ($login != null){ + $this->_getWriteAdapter()->insertOnDuplicate( + $this->getMainTable(), + array( + 'type' => self::TYPE_LOGIN, 'value' => $login, 'count' => 1, + 'updated_at' => Mage::getSingleton('Mage_Core_Model_Date')->gmtDate() + ), + array('count' => new Zend_Db_Expr('count+1'), 'updated_at') + ); + } + $ip = Mage::helper('Mage_Core_Helper_Http')->getRemoteAddr(); + if ($ip != null) { + $this->_getWriteAdapter()->insertOnDuplicate( + $this->getMainTable(), + array( + 'type' => self::TYPE_REMOTE_ADDRESS, 'value' => $ip, 'count' => 1, + 'updated_at' => Mage::getSingleton('Mage_Core_Model_Date')->gmtDate() + ), + array('count' => new Zend_Db_Expr('count+1'), 'updated_at') + ); + } + return $this; + } + + /** + * Delete User attempts by login + * + * @param string $login + * @return Mage_Captcha_Model_Resource_Log + */ + public function deleteUserAttempts($login) + { + if ($login != null) { + $this->_getWriteAdapter()->delete( + $this->getMainTable(), + array('type = ?' => self::TYPE_LOGIN, 'value = ?' => $login) + ); + } + $ip = Mage::helper('Mage_Core_Helper_Http')->getRemoteAddr(); + if ($ip != null) { + $this->_getWriteAdapter()->delete( + $this->getMainTable(), array('type = ?' => self::TYPE_REMOTE_ADDRESS, 'value = ?' => $ip) + ); + } + + return $this; + } + + /** + * Get count attempts by ip + * + * @return null|int + */ + public function countAttemptsByRemoteAddress() + { + $ip = Mage::helper('Mage_Core_Helper_Http')->getRemoteAddr(); + if (!$ip) { + return 0; + } + $read = $this->_getReadAdapter(); + $select = $read->select()->from($this->getMainTable(), 'count')->where('type = ?', self::TYPE_REMOTE_ADDRESS) + ->where('value = ?', $ip); + return $read->fetchOne($select); + } + + /** + * Get count attempts by user login + * + * @param string $login + * @return null|int + */ + public function countAttemptsByUserLogin($login) + { + if (!$login) { + return 0; + } + $read = $this->_getReadAdapter(); + $select = $read->select()->from($this->getMainTable(), 'count')->where('type = ?', self::TYPE_LOGIN) + ->where('value = ?', $login); + return $read->fetchOne($select); + } + + /** + * Delete attempts with expired in update_at time + * + * @return void + */ + public function deleteOldAttempts() + { + $this->_getWriteAdapter()->delete( + $this->getMainTable(), + array('updated_at < ?' => Mage::getSingleton('Mage_Core_Model_Date')->gmtDate(null, time() - 60*30)) + ); + } +} diff --git a/app/code/core/Mage/Captcha/Model/Zend.php b/app/code/core/Mage/Captcha/Model/Zend.php new file mode 100755 index 0000000000000000000000000000000000000000..435dd9a9a8b67c9a61b57c02ac8368731dbf819b --- /dev/null +++ b/app/code/core/Mage/Captcha/Model/Zend.php @@ -0,0 +1,504 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Captcha + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Implementation of Zend_Captcha + * + * @category Mage + * @package Mage_Captcha + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Captcha_Model_Zend extends Zend_Captcha_Image implements Mage_Captcha_Model_Interface +{ + /** + * Key in session for captcha code + */ + const SESSION_WORD = 'word'; + + /** + * Min captcha lengths default value + */ + const DEFAULT_WORD_LENGTH_FROM = 3; + + /** + * Max captcha lengths default value + */ + const DEFAULT_WORD_LENGTH_TO = 5; + + /** + * Helper Instance + * @var Mage_Captcha_Helper_Data + */ + protected $_helper = null; + + /** + * Captcha expire time + * @var int + */ + protected $_expiration; + + /** + * Override default value to prevent a captcha cut off + * @var int + * @see Zend_Captcha_Image::$_fsize + */ + protected $_fsize = 22; + + /** + * Captcha form id + * @var string + */ + protected $_formId; + + /** + * Zend captcha constructor + * + * @param array $params + */ + public function __construct($params) + { + if (!isset($params['formId'])) { + throw new Exception('formId is mandatory'); + } + $this->_formId = $params['formId']; + $this->setExpiration($this->getTimeout()); + } + + /** + * Returns key with respect of current form ID + * + * @param string $key + * @return string + */ + protected function _getFormIdKey($key) + { + return $this->_formId . '_' . $key; + } + + /** + * Get Block Name + * + * @return string + */ + public function getBlockName() + { + return 'Mage_Captcha_Block_Captcha_Zend'; + } + + + /** + * Whether captcha is required to be inserted to this form + * + * @param null|string $login + * @return bool + */ + public function isRequired($login = null) + { + if ($this->_isUserAuth() || !$this->_isEnabled() || !in_array($this->_formId, $this->_getTargetForms())) { + return false; + } + + return ($this->_isShowAlways() || $this->_isOverLimitAttempts($login) + || $this->getSession()->getData($this->_getFormIdKey('show_captcha')) + ); + } + + /** + * Check is overlimit attempts + * + * @param string $login + * @return bool + */ + protected function _isOverLimitAttempts($login) + { + return ($this->_isOverLimitIpAttempt() || $this->_isOverLimitLoginAttempts($login)); + } + + /** + * Returns number of allowed attempts for same login + * + * @return int + */ + protected function _getAllowedAttemptsForSameLogin() + { + return (int)$this->_getHelper()->getConfigNode('failed_attempts_login'); + } + + /** + * Returns number of allowed attempts from same IP + * + * @return int + */ + protected function _getAllowedAttemptsFromSameIp() + { + return (int)$this->_getHelper()->getConfigNode('failed_attempts_ip'); + } + + /** + * Check is overlimit saved attempts from one ip + * + * @return bool + */ + protected function _isOverLimitIpAttempt() + { + $countAttemptsByIp = Mage::getResourceModel('Mage_Captcha_Model_Resource_Log')->countAttemptsByRemoteAddress(); + return $countAttemptsByIp >= $this->_getAllowedAttemptsFromSameIp(); + } + + /** + * Is Over Limit Login Attempts + * + * @param string $login + * @return bool + */ + protected function _isOverLimitLoginAttempts($login) + { + if ($login != false) { + $countAttemptsByLogin = Mage::getResourceModel('Mage_Captcha_Model_Resource_Log')->countAttemptsByUserLogin($login); + return ($countAttemptsByLogin >= $this->_getAllowedAttemptsForSameLogin()); + } + return false; + } + + /** + * Check is user auth + * + * @return bool + */ + protected function _isUserAuth() + { + return Mage::app()->getStore()->isAdmin() + ? Mage::getSingleton('Mage_Admin_Model_Session')->isLoggedIn() + : Mage::getSingleton('Mage_Customer_Model_Session')->isLoggedIn(); + } + + /** + * Whether to respect case while checking the answer + * + * @return bool + */ + public function isCaseSensitive() + { + return (string)$this->_getHelper()->getConfigNode('case_sensitive'); + } + + /** + * Get font to use when generating captcha + * + * @return string + */ + public function getFont() + { + return $this->_getFontPath(); + } + + /** + * After this time isCorrect() is going to return FALSE even if word was guessed correctly + * + * @return int + */ + public function getTimeout() + { + if (!$this->_expiration) { + /** + * as "timeout" configuration parameter specifies timeout in minutes - we multiply it on 60 to set + * expiration in seconds + */ + $this->_expiration = (int)$this->_getHelper()->getConfigNode('timeout') * 60; + } + return $this->_expiration; + } + + /** + * Get captcha image directory + * + * @return string + */ + public function getImgDir() + { + return $this->_helper->getImgDir(); + } + + /** + * Get captcha image base URL + * + * @return string + */ + public function getImgUrl() + { + return $this->_helper->getImgUrl(); + } + + /** + * Checks whether captcha was guessed correctly by user + * + * @param string $word + * @return bool + */ + public function isCorrect($word) + { + $storedWord = $this->getWord(); + $this->_clearWord(); + + if (!$word || !$storedWord){ + return false; + } + + if (!$this->isCaseSensitive()) { + $storedWord = strtolower($storedWord); + $word = strtolower($word); + } + return $word == $storedWord; + } + + /** + * Returns session instance + * + * @return Mage_Customer_Model_Session + */ + public function getSession() + { + return Mage::getSingleton('Mage_Customer_Model_Session'); + } + + /** + * Return full URL to captcha image + * + * @return string + */ + public function getImgSrc() + { + return $this->getImgUrl() . $this->getId() . $this->getSuffix(); + } + + /** + * log Attempt + * + * @param string $login + * @return Mage_Captcha_Model_Zend + */ + public function logAttempt($login) + { + if ($this->_isEnabled() && in_array($this->_formId, $this->_getTargetForms())) { + Mage::getResourceModel('Mage_Captcha_Model_Resource_Log')->logAttempt($login); + if ($this->_isOverLimitLoginAttempts($login)) { + $this->getSession()->setData($this->_getFormIdKey('show_captcha'), 1); + } + } + return $this; + } + + /** + * Returns path for the font file, chosen to generate captcha + * + * @return string + */ + protected function _getFontPath() + { + $font = (string)$this->_getHelper()->getConfigNode('font'); + $fonts = $this->_getHelper()->getFonts(); + + if (isset($fonts[$font])) { + $fontPath = $fonts[$font]['path']; + } else { + $fontData = array_shift($fonts); + $fontPath = $fontData['path']; + } + + return $fontPath; + } + + /** + * Returns captcha helper + * + * @return Mage_Captcha_Helper_Data + */ + protected function _getHelper() + { + if (empty($this->_helper)) { + $this->_helper = Mage::helper('Mage_Captcha_Helper_Data'); + } + return $this->_helper; + } + + /** + * Generate word used for captcha render + * + * @return string + */ + protected function _generateWord() + { + $word = ''; + $symbols = $this->_getSymbols(); + $wordLen = $this->_getWordLen(); + for ($i = 0; $i < $wordLen; $i++) { + $word .= $symbols[array_rand($symbols)]; + } + return $word; + } + + /** + * Get symbols array to use for word generation + * + * @return array + */ + protected function _getSymbols() + { + return str_split((string)$this->_getHelper()->getConfigNode('symbols')); + } + + /** + * Returns length for generating captcha word. This value may be dynamic. + * + * @return int + */ + protected function _getWordLen() + { + $from = 0; + $to = 0; + $length = (string)$this->_getHelper()->getConfigNode('length'); + if (!is_numeric($length)) { + if (preg_match('/(\d+)-(\d+)/', $length, $matches)) { + $from = (int)$matches[1]; + $to = (int)$matches[2]; + } + } else { + $from = (int)$length; + $to = (int)$length; + } + + if (($to < $from) || ($from < 1) || ($to < 1)) { + $from = self::DEFAULT_WORD_LENGTH_FROM; + $to = self::DEFAULT_WORD_LENGTH_TO; + } + + return mt_rand($from, $to); + } + + /** + * Whether to show captcha for this form every time + * + * @return bool + */ + protected function _isShowAlways() + { + if ((string)$this->_getHelper()->getConfigNode('mode') == Mage_Captcha_Helper_Data::MODE_ALWAYS) { + return true; + } + + $alwaysFor = $this->_getHelper()->getConfigNode('always_for'); + foreach ($alwaysFor as $nodeFormId => $isAlwaysFor) { + if ($isAlwaysFor && $this->_formId == $nodeFormId) { + return true; + } + } + + return false; + } + + /** + * Whether captcha is enabled at this area + * + * @return bool + */ + protected function _isEnabled() + { + return (string)$this->_getHelper()->getConfigNode('enable'); + } + + /** + * Retrieve list of forms where captcha must be shown + * + * For frontend this list is based on current website + * + * @return array + */ + protected function _getTargetForms() + { + $formsString = (string) $this->_getHelper()->getConfigNode('forms'); + return explode(',', $formsString); + } + + /** + * Get captcha word + * + * @return string + */ + public function getWord() + { + $sessionData = $this->getSession()->getData($this->_getFormIdKey(self::SESSION_WORD)); + return time() < $sessionData['expires'] ? $sessionData['data'] : null; + } + + /** + * Set captcha word + * + * @param string $word + * @return Zend_Captcha_Word + */ + protected function _setWord($word) + { + $this->getSession()->setData($this->_getFormIdKey(self::SESSION_WORD), + array('data' => $word, 'expires' => time() + $this->getTimeout()) + ); + $this->_word = $word; + return $this; + } + + /** + * Set captcha word + * + * @return Mage_Captcha_Model_Zend + */ + protected function _clearWord() + { + $this->getSession()->unsetData($this->_getFormIdKey(self::SESSION_WORD)); + $this->_word = null; + return $this; + } + + /** + * Override function to generate less curly captcha that will not cut off + * + * @see Zend_Captcha_Image::_randomSize() + * @return int + */ + protected function _randomSize() + { + return mt_rand(280, 300) / 100; + } + + /** + * Overlap of the parent method + * + * Now deleting old captcha images make crontab script + * @see Mage_Captcha_Model_Observer::deleteExpiredImages + */ + protected function _gc() + { + //do nothing + } +} diff --git a/app/code/core/Mage/Captcha/controllers/Adminhtml/RefreshController.php b/app/code/core/Mage/Captcha/controllers/Adminhtml/RefreshController.php new file mode 100755 index 0000000000000000000000000000000000000000..09d0f5fb21872f511153934ddeae7b66a60cacef --- /dev/null +++ b/app/code/core/Mage/Captcha/controllers/Adminhtml/RefreshController.php @@ -0,0 +1,50 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Captcha + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Captcha controller + * + * @category Mage + * @package Mage_Captcha + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Captcha_Adminhtml_RefreshController extends Mage_Adminhtml_Controller_Action +{ + /** + * Refreshes captcha and returns JSON encoded URL to image (AJAX action) + * Example: {'imgSrc': 'http://example.com/media/captcha/67842gh187612ngf8s.png'} + * + * @return null + */ + public function refreshAction() + { + $formId = $this->getRequest()->getPost('formId'); + $captchaModel = Mage::helper('Mage_Captcha_Helper_Data')->getCaptcha($formId); + $this->getLayout()->createBlock($captchaModel->getBlockName())->setFormId($formId)->setIsAjax(true)->toHtml(); + $this->getResponse()->setBody(json_encode(array('imgSrc' => $captchaModel->getImgSrc()))); + $this->setFlag('', self::FLAG_NO_POST_DISPATCH, true); + } +} diff --git a/app/code/core/Mage/Captcha/controllers/RefreshController.php b/app/code/core/Mage/Captcha/controllers/RefreshController.php new file mode 100755 index 0000000000000000000000000000000000000000..dcc3c7f1815d87ecee7b6b2fdf4af9388880eff8 --- /dev/null +++ b/app/code/core/Mage/Captcha/controllers/RefreshController.php @@ -0,0 +1,50 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Captcha + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Captcha controller + * + * @category Mage + * @package Mage_Core + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Captcha_RefreshController extends Mage_Core_Controller_Front_Action +{ + /** + * Refreshes captcha and returns JSON encoded URL to image (AJAX action) + * Example: {'imgSrc': 'http://example.com/media/captcha/67842gh187612ngf8s.png'} + * + * @return null + */ + public function indexAction() + { + $formId = $this->getRequest()->getPost('formId'); + $captchaModel = Mage::helper('Mage_Captcha_Helper_Data')->getCaptcha($formId); + $this->getLayout()->createBlock($captchaModel->getBlockName())->setFormId($formId)->setIsAjax(true)->toHtml(); + $this->getResponse()->setBody(json_encode(array('imgSrc' => $captchaModel->getImgSrc()))); + $this->setFlag('', self::FLAG_NO_POST_DISPATCH, true); + } +} diff --git a/app/code/core/Mage/Captcha/etc/config.xml b/app/code/core/Mage/Captcha/etc/config.xml new file mode 100755 index 0000000000000000000000000000000000000000..a16dd6d31fba1741a9f0ff9042976b927420147b --- /dev/null +++ b/app/code/core/Mage/Captcha/etc/config.xml @@ -0,0 +1,250 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * 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_AFL.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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Captcha + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<config> + <modules> + <Mage_Captcha> + <version>1.7.0.0.0</version> + </Mage_Captcha> + </modules> + <global> + <resources> + <captcha_setup> + <setup> + <module>Mage_Captcha</module> + </setup> + </captcha_setup> + </resources> + <events> + <controller_action_predispatch_customer_account_loginPost> + <observers> + <captcha> + <class>Mage_Captcha_Model_Observer</class> + <method>checkUserLogin</method> + </captcha> + </observers> + </controller_action_predispatch_customer_account_loginPost> + <controller_action_predispatch_customer_account_forgotpasswordpost> + <observers> + <captcha> + <class>Mage_Captcha_Model_Observer</class> + <method>checkForgotPassword</method> + </captcha> + </observers> + </controller_action_predispatch_customer_account_forgotpasswordpost> + <controller_action_predispatch_customer_account_createpost> + <observers> + <captcha> + <class>Mage_Captcha_Model_Observer</class> + <method>checkUserCreate</method> + </captcha> + </observers> + </controller_action_predispatch_customer_account_createpost> + <controller_action_predispatch_adminhtml_index_forgotpassword> + <observers> + <captcha> + <class>Mage_Captcha_Model_Observer</class> + <method>checkUserForgotPasswordBackend</method> + </captcha> + </observers> + </controller_action_predispatch_adminhtml_index_forgotpassword> + <admin_user_authenticate_before> + <observers> + <captcha> + <class>Mage_Captcha_Model_Observer</class> + <method>checkUserLoginBackend</method> + </captcha> + </observers> + </admin_user_authenticate_before> + <controller_action_predispatch_checkout_onepage_saveBilling> + <observers> + <captcha_guest> + <class>Mage_Captcha_Model_Observer</class> + <method>checkGuestCheckout</method> + </captcha_guest> + <captcha_register> + <class>Mage_Captcha_Model_Observer</class> + <method>checkRegisterCheckout</method> + </captcha_register> + </observers> + </controller_action_predispatch_checkout_onepage_saveBilling> + <customer_customer_authenticated> + <observers> + <captcha_reset_attempt> + <class>Mage_Captcha_Model_Observer</class> + <method>resetAttemptForFrontend</method> + </captcha_reset_attempt> + </observers> + </customer_customer_authenticated> + <admin_session_user_login_success> + <observers> + <captcha_reset_attempt> + <class>Mage_Captcha_Model_Observer</class> + <method>resetAttemptForBackend</method> + </captcha_reset_attempt> + </observers> + </admin_session_user_login_success> + </events> + </global> + <frontend> + <routers> + <captcha> + <use>standard</use> + <args> + <module>Mage_Captcha</module> + <frontName>captcha</frontName> + </args> + </captcha> + </routers> + <layout> + <updates> + <captcha module="Mage_Captcha"> + <file>layout.xml</file> + </captcha> + </updates> + </layout> + </frontend> + <admin> + <routers> + <adminhtml> + <args> + <modules> + <captcha>Mage_Captcha_Adminhtml</captcha> + </modules> + </args> + </adminhtml> + </routers> + </admin> + <adminhtml> + <layout> + <updates> + <captcha module="Mage_Captcha"> + <file>layout.xml</file> + </captcha> + </updates> + </layout> + </adminhtml> + <default> + <admin> + <captcha> + <type>zend</type> + <enable>0</enable> + <font>linlibertine</font> + <mode>after_fail</mode> + <forms>backend_forgotpassword</forms> + <failed_attempts_login>3</failed_attempts_login> + <failed_attempts_ip>1000</failed_attempts_ip> + <timeout>7</timeout> + <length>4-5</length> + <symbols>ABCDEFGHJKMnpqrstuvwxyz23456789</symbols> + <case_sensitive>0</case_sensitive> + <always_for> + <backend_forgotpassword>1</backend_forgotpassword> + </always_for> + </captcha> + </admin> + <customer> + <captcha> + <type>zend</type> + <enable>0</enable> + <font>linlibertine</font> + <mode>after_fail</mode> + <forms>user_forgotpassword</forms> + <failed_attempts_login>3</failed_attempts_login> + <failed_attempts_ip>1000</failed_attempts_ip> + <timeout>7</timeout> + <length>4-5</length> + <symbols>ABCDEFGHJKMnpqrstuvwxyz23456789</symbols> + <case_sensitive>0</case_sensitive> + <always_for> + <user_create>1</user_create> + <user_forgotpassword>1</user_forgotpassword> + <guest_checkout>1</guest_checkout> + <register_during_checkout>1</register_during_checkout> + </always_for> + </captcha> + </customer> + <captcha translate="label"> + <fonts> + <linlibertine> + <label>LinLibertine</label> + <path>lib/LinLibertineFont/LinLibertine_Bd-2.8.1.ttf</path> + </linlibertine> + </fonts> + <frontend> + <areas> + <user_create> + <label>Create user</label> + </user_create> + <user_login> + <label>Login</label> + </user_login> + <user_forgotpassword> + <label>Forgot password</label> + </user_forgotpassword> + <guest_checkout> + <label>Checkout as Guest</label> + </guest_checkout> + <register_during_checkout> + <label>Register during Checkout</label> + </register_during_checkout> + </areas> + </frontend> + <backend> + <areas> + <backend_login> + <label>Admin Login</label> + </backend_login> + <backend_forgotpassword> + <label>Admin Forgot Password</label> + </backend_forgotpassword> + </areas> + </backend> + </captcha> + </default> + <crontab> + <jobs> + <captcha_delete_old_attempts> + <schedule> + <cron_expr>*/30 * * * *</cron_expr> + </schedule> + <run> + <model>Mage_Captcha_Model_Observer::deleteOldAttempts</model> + </run> + </captcha_delete_old_attempts> + <captcha_delete_expired_images> + <schedule> + <cron_expr>*/10 * * * *</cron_expr> + </schedule> + <run> + <model>Mage_Captcha_Model_Observer::deleteExpiredImages</model> + </run> + </captcha_delete_expired_images> + + </jobs> + </crontab> +</config> diff --git a/app/code/core/Mage/Captcha/etc/system.xml b/app/code/core/Mage/Captcha/etc/system.xml new file mode 100755 index 0000000000000000000000000000000000000000..a0b1e6e7232bd72f8be8193f2b750021d1614497 --- /dev/null +++ b/app/code/core/Mage/Captcha/etc/system.xml @@ -0,0 +1,250 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * 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_AFL.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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Captcha + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<config> + <sections> + <admin> + <groups> + <captcha translate="label"> + <label>CAPTCHA</label> + <frontend_type>text</frontend_type> + <sort_order>50</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>0</show_in_store> + <fields> + <enable translate="label"> + <label>Enable CAPTCHA in Admin</label> + <frontend_type>select</frontend_type> + <source_model>Mage_Adminhtml_Model_System_Config_Source_Yesno</source_model> + <sort_order>1</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>0</show_in_website> + <show_in_store>0</show_in_store> + </enable> + <font translate="label"> + <label>Font</label> + <frontend_type>select</frontend_type> + <source_model>Mage_Captcha_Model_Config_Font</source_model> + <sort_order>2</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>0</show_in_website> + <show_in_store>0</show_in_store> + <depends><enable>1</enable></depends> + </font> + <forms translate="label"> + <label>Forms</label> + <frontend_type>multiselect</frontend_type> + <source_model>Mage_Captcha_Model_Config_Form_Backend</source_model> + <sort_order>3</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>0</show_in_website> + <show_in_store>0</show_in_store> + <depends><enable>1</enable></depends> + </forms> + <mode translate="label"> + <label>Displaying Mode</label> + <frontend_type>select</frontend_type> + <source_model>Mage_Captcha_Model_Config_Mode</source_model> + <sort_order>4</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>0</show_in_website> + <show_in_store>0</show_in_store> + <depends><enable>1</enable></depends> + </mode> + <failed_attempts_login translate="label comment"> + <label>Number of Unsuccessful Attempts to Login</label> + <frontend_type>text</frontend_type> + <comment>If 0 is specified, CAPTCHA on the Login form will be always available.</comment> + <sort_order>5</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>0</show_in_website> + <show_in_store>0</show_in_store> + <depends> + <mode>after_fail</mode> + <enable>1</enable> + </depends> + <frontend_class>required-entry validate-digits</frontend_class> + </failed_attempts_login> + <timeout translate="label"> + <label>CAPTCHA Timeout (minutes)</label> + <frontend_type>text</frontend_type> + <sort_order>6</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>0</show_in_website> + <show_in_store>0</show_in_store> + <depends><enable>1</enable></depends> + <frontend_class>required-entry validate-digits</frontend_class> + </timeout> + <length translate="label comment"> + <label>Number of Symbols</label> + <frontend_type>text</frontend_type> + <comment>Please specify 8 symbols at the most. Range allowed (e.g. 3-5)</comment> + <sort_order>7</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>0</show_in_website> + <show_in_store>0</show_in_store> + <depends><enable>1</enable></depends> + <frontend_class>required-entry</frontend_class> + </length> + <symbols translate="label comment"> + <label>Symbols Used in CAPTCHA</label> + <frontend_type>text</frontend_type> + <comment><![CDATA[Please use only letters (a-z or A-Z) or numbers (0-9) in this field. No spaces or other characters are allowed.<br />Similar looking characters (e.g. "i", "l", "1") decrease chance of correct recognition by customer.]]></comment> + <sort_order>8</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>0</show_in_website> + <show_in_store>0</show_in_store> + <depends><enable>1</enable></depends> + <frontend_class>required-entry validate-alphanum</frontend_class> + </symbols> + <case_sensitive translate="label"> + <label>Case Sensitive</label> + <frontend_type>select</frontend_type> + <source_model>Mage_Adminhtml_Model_System_Config_Source_Yesno</source_model> + <sort_order>9</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>0</show_in_website> + <show_in_store>0</show_in_store> + <depends><enable>1</enable></depends> + </case_sensitive> + </fields> + </captcha> + </groups> + </admin> + <customer> + <groups> + <captcha translate="label"> + <label>CAPTCHA</label> + <frontend_type>text</frontend_type> + <sort_order>110</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>0</show_in_store> + <fields> + <enable translate="label"> + <label>Enable CAPTCHA on Frontend</label> + <frontend_type>select</frontend_type> + <source_model>Mage_Adminhtml_Model_System_Config_Source_Yesno</source_model> + <sort_order>1</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>0</show_in_store> + </enable> + <font translate="label"> + <label>Font</label> + <frontend_type>select</frontend_type> + <source_model>Mage_Captcha_Model_Config_Font</source_model> + <sort_order>2</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>0</show_in_store> + <depends><enable>1</enable></depends> + </font> + <forms translate="label comment"> + <label>Forms</label> + <frontend_type>multiselect</frontend_type> + <source_model>Mage_Captcha_Model_Config_Form_Frontend</source_model> + <comment>CAPTCHA for "Create user" and "Forgot password" forms is always enabled if chosen</comment> + <sort_order>3</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>0</show_in_store> + <depends><enable>1</enable></depends> + </forms> + <mode translate="label"> + <label>Displaying Mode</label> + <frontend_type>select</frontend_type> + <source_model>Mage_Captcha_Model_Config_Mode</source_model> + <sort_order>4</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>0</show_in_store> + <depends><enable>1</enable></depends> + </mode> + <failed_attempts_login translate="label comment"> + <label>Number of Unsuccessful Attempts to Login</label> + <frontend_type>text</frontend_type> + <comment>If 0 is specified, CAPTCHA on the Login form will be always available.</comment> + <sort_order>5</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>0</show_in_store> + <depends> + <enable>1</enable> + <mode>after_fail</mode> + </depends> + <frontend_class>required-entry validate-digits</frontend_class> + </failed_attempts_login> + <timeout translate="label"> + <label>CAPTCHA Timeout (minutes)</label> + <frontend_type>text</frontend_type> + <sort_order>6</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>0</show_in_store> + <depends><enable>1</enable></depends> + <frontend_class>required-entry validate-digits</frontend_class> + </timeout> + <length translate="label comment"> + <label>Number of Symbols</label> + <frontend_type>text</frontend_type> + <comment>Please specify 8 symbols at the most. Range allowed (e.g. 3-5)</comment> + <sort_order>7</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>0</show_in_store> + <depends><enable>1</enable></depends> + <frontend_class>required-entry</frontend_class> + </length> + <symbols translate="label comment"> + <label>Symbols Used in CAPTCHA</label> + <frontend_type>text</frontend_type> + <comment><![CDATA[Please use only letters (a-z or A-Z) or numbers (0-9) in this field. No spaces or other characters are allowed.<br />Similar looking characters (e.g. "i", "l", "1") decrease chance of correct recognition by customer.]]></comment> + <sort_order>8</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>0</show_in_store> + <depends><enable>1</enable></depends> + <frontend_class>required-entry validate-alphanum</frontend_class> + </symbols> + <case_sensitive translate="label"> + <label>Case Sensitive</label> + <frontend_type>select</frontend_type> + <source_model>Mage_Adminhtml_Model_System_Config_Source_Yesno</source_model> + <sort_order>9</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>0</show_in_store> + <depends><enable>1</enable></depends> + </case_sensitive> + </fields> + </captcha> + </groups> + </customer> + </sections> +</config> diff --git a/app/code/core/Mage/Captcha/sql/captcha_setup/install-1.7.0.0.0.php b/app/code/core/Mage/Captcha/sql/captcha_setup/install-1.7.0.0.0.php new file mode 100644 index 0000000000000000000000000000000000000000..82d3f629527499ba0767a65f327bdaab749b99b0 --- /dev/null +++ b/app/code/core/Mage/Captcha/sql/captcha_setup/install-1.7.0.0.0.php @@ -0,0 +1,52 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Captcha + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/* @var $installer Mage_Core_Model_Resource_Setup */ +$installer = $this; + +$installer->startSetup(); + +$table = $installer->getConnection() + ->newTable($installer->getTable('captcha_log')) + ->addColumn('type', Varien_Db_Ddl_Table::TYPE_TEXT, 32, array( + 'nullable' => false, + 'primary' => true, + ), 'Type') + ->addColumn('value', Varien_Db_Ddl_Table::TYPE_TEXT, 32, array( + 'nullable' => false, + 'unsigned' => true, + 'primary' => true, + ), 'Value') + ->addColumn('count', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array( + 'unsigned' => true, + 'nullable' => false, + 'default' => '0', + ), 'Count') + ->addColumn('updated_at', Varien_Db_Ddl_Table::TYPE_TIMESTAMP, null, array(), 'Update Time') + ->setComment('Count Login Attempts'); +$installer->getConnection()->createTable($table); + +$installer->endSetup(); diff --git a/app/code/core/Mage/Captcha/view/adminhtml/layout.xml b/app/code/core/Mage/Captcha/view/adminhtml/layout.xml new file mode 100644 index 0000000000000000000000000000000000000000..0ae5f1a74e49ddc0d14ca0b16883116b243497ec --- /dev/null +++ b/app/code/core/Mage/Captcha/view/adminhtml/layout.xml @@ -0,0 +1,47 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * 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_AFL.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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category design + * @package default_default + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<layout version="0.1.0"> + <adminhtml_index_login> + <reference name="form.additional.info"> + <block type="Mage_Captcha_Block_Captcha" name="captcha"> + <action method="setFormId"><formId>backend_login</formId></action> + <action method="setImgWidth"><width>226</width></action> + <action method="setImgHeight"><width>50</width></action> + </block> + </reference> + </adminhtml_index_login> + <adminhtml_index_forgotpassword> + <reference name="form.additional.info"> + <block type="Mage_Captcha_Block_Captcha" name="captcha"> + <action method="setFormId"><formId>backend_forgotpassword</formId></action> + <action method="setImgWidth"><width>226</width></action> + <action method="setImgHeight"><width>50</width></action> + </block> + </reference> + </adminhtml_index_forgotpassword> +</layout> diff --git a/app/code/core/Mage/Captcha/view/adminhtml/reload.png b/app/code/core/Mage/Captcha/view/adminhtml/reload.png new file mode 100644 index 0000000000000000000000000000000000000000..2b1e64bc158ab6cb284628823b12db2af8565dfc Binary files /dev/null and b/app/code/core/Mage/Captcha/view/adminhtml/reload.png differ diff --git a/app/code/core/Mage/Captcha/view/adminhtml/zend.phtml b/app/code/core/Mage/Captcha/view/adminhtml/zend.phtml new file mode 100644 index 0000000000000000000000000000000000000000..9ca705d4a92dba8ed67fc77a8f5919743ca19e6b --- /dev/null +++ b/app/code/core/Mage/Captcha/view/adminhtml/zend.phtml @@ -0,0 +1,57 @@ +<?php +/** + * Magento + * + * 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_AFL.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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Captcha + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +?> +<?php $captcha = $this->getCaptchaModel() ?> +<?php /* @var $this Mage_Core_Block_Captcha_Zend */ ?> +<div class="clear"></div> +<div class="captcha"> + <div class="captcha-input input-box input-left"> + <label for="captcha"><?php echo $this->__('Please type the letters from the image:') ?></label><br /> + <input type="text" name="<?php echo Mage_Captcha_Helper_Data::INPUT_NAME_FIELD_VALUE ?>[<?php echo $this->getFormId()?>]" id="captcha" class="required-entry input-text validation-failed"/> + </div> + <div class="captcha-image input-right"> + <img id="captcha-reload" class="captcha-reload" src="<?php echo $this->getSkinUrl('Mage_Captcha::reload.png') ?>" alt="<?php echo $this->__('Reload captcha') ?>"/> + <img id="<?php echo $this->getFormId() ?>" width="<?php echo $this->getImgWidth() ?>" height="<?php echo $this->getImgHeight() ?>" src="<?php echo $captcha->getImgSrc() ?>" /> + </div> +</div> +<?php if ($captcha->isCaseSensitive()) :?> +<div class="captcha-note"> + <p><?php echo $this->__('<strong>Attention</strong>: Captcha is case sensitive.') ?></p> +</div> +<?php endif; ?> +<script type="text/javascript"> +//<![CDATA[ + document.observe('dom:loaded', function () { + + var captcha = new Captcha('<?php echo $this->getRefreshUrl() ?>', '<?php echo $this->getFormId() ?>'); + + $('captcha-reload').observe('click', function () { + captcha.refresh(this); + }); + + }); +//]]> +</script> diff --git a/app/code/core/Mage/Captcha/view/frontend/layout.xml b/app/code/core/Mage/Captcha/view/frontend/layout.xml new file mode 100644 index 0000000000000000000000000000000000000000..8de21d6a6a17aeeeba71fd9ae9c86e9260079539 --- /dev/null +++ b/app/code/core/Mage/Captcha/view/frontend/layout.xml @@ -0,0 +1,105 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * 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_AFL.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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category design + * @package default_default + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<layout version="0.1.0"> + <customer_account_login> + <reference name="customer_form_login"> + <block type="Mage_Core_Block_Text_List" name="form.additional.info"> + <block type="Mage_Captcha_Block_Captcha" name="captcha"> + <reference name="head"> + <action method="addJs"><file>mage/captcha.js</file></action> + </reference> + <action method="setFormId"><formId>user_login</formId></action> + <action method="setImgWidth"><width>230</width></action> + <action method="setImgHeight"><width>50</width></action> + </block> + </block> + </reference> + </customer_account_login> + <customer_account_forgotpassword> + <reference name="forgotPassword"> + <block type="Mage_Core_Block_Text_List" name="form.additional.info"> + <block type="Mage_Captcha_Block_Captcha" name="captcha"> + <reference name="head"> + <action method="addJs"><file>mage/captcha.js</file></action> + </reference> + <action method="setFormId"><formId>user_forgotpassword</formId></action> + <action method="setImgWidth"><width>230</width></action> + <action method="setImgHeight"><width>50</width></action> + </block> + </block> + </reference> + </customer_account_forgotpassword> + <customer_account_create> + <reference name="customer_form_register"> + <block type="Mage_Core_Block_Text_List" name="form.additional.info"> + <block type="Mage_Captcha_Block_Captcha" name="captcha"> + <reference name="head"> + <action method="addJs"><file>mage/captcha.js</file></action> + </reference> + <action method="setFormId"><formId>user_create</formId></action> + <action method="setImgWidth"><width>230</width></action> + <action method="setImgHeight"><width>50</width></action> + </block> + </block> + </reference> + </customer_account_create> + <checkout_onepage_index> + <reference name="checkout.onepage.login"> + <block type="Mage_Core_Block_Text_List" name="form.additional.info"> + <block type="Mage_Captcha_Block_Captcha" name="captcha"> + <reference name="head"> + <action method="addJs"><file>mage/captcha.js</file></action> + </reference> + <action method="setFormId"><formId>user_login</formId></action> + <action method="setImgWidth"><width>230</width></action> + <action method="setImgHeight"><width>50</width></action> + </block> + </block> + </reference> + <reference name="checkout.onepage.billing"> + <block type="Mage_Core_Block_Text_List" name="form.additional.info"> + <block type="Mage_Captcha_Block_Captcha" name="captcha.guest.checkout"> + <reference name="head"> + <action method="addJs"><file>mage/captcha.js</file></action> + </reference> + <action method="setFormId"><formId>guest_checkout</formId></action> + <action method="setImgWidth"><width>230</width></action> + <action method="setImgHeight"><width>50</width></action> + </block> + <block type="Mage_Captcha_Block_Captcha" name="captcha.register.during.checkout"> + <reference name="head"> + <action method="addJs"><file>mage/captcha.js</file></action> + </reference> + <action method="setFormId"><formId>register_during_checkout</formId></action> + <action method="setImgWidth"><width>230</width></action> + <action method="setImgHeight"><width>50</width></action> + </block> + </block> + </reference> + </checkout_onepage_index> +</layout> diff --git a/app/code/core/Mage/Captcha/view/frontend/reload.png b/app/code/core/Mage/Captcha/view/frontend/reload.png new file mode 100644 index 0000000000000000000000000000000000000000..2b1e64bc158ab6cb284628823b12db2af8565dfc Binary files /dev/null and b/app/code/core/Mage/Captcha/view/frontend/reload.png differ diff --git a/app/code/core/Mage/Captcha/view/frontend/zend.phtml b/app/code/core/Mage/Captcha/view/frontend/zend.phtml new file mode 100644 index 0000000000000000000000000000000000000000..f6732e8972db12621e4ec6bbdc33fe614410a3d3 --- /dev/null +++ b/app/code/core/Mage/Captcha/view/frontend/zend.phtml @@ -0,0 +1,52 @@ +<?php +/** + * Magento + * + * 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_AFL.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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Captcha + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +?> +<?php /* @var $this Mage_Core_Block_Captcha_Zend */ ?> + +<?php /* @var $captcha Mage_Core_Model_Captcha_Zend */ ?> +<?php $captcha = $this->getCaptchaModel() ?> +<li id="captcha-input-box-<?php echo $this->getFormId()?>"> + <label for="captcha_<?php echo $this->getFormId() ?>" class="required"><em>*</em><?php echo $this->__('Please type the letters below')?></label> + <div class="input-box captcha"> + <input name="<?php echo Mage_Captcha_Helper_Data::INPUT_NAME_FIELD_VALUE ?>[<?php echo $this->getFormId()?>]" type="text" class="input-text required-entry" id="captcha_<?php echo $this->getFormId() ?>" /> + </div> +</li> +<li> + <div class="captcha-image" id="captcha-image-box-<?php echo $this->getFormId()?>"> + <script type="text/javascript"> + //<![CDATA[ + var captcha_<?php echo $this->getFormId()?> = new Captcha('<?php echo $this->getRefreshUrl() ?>', '<?php echo $this->getFormId() ?>'); + //]]> + </script> + <img id="catpcha-reload" class="captcha-reload" src="<?php echo $this->getSkinUrl('Mage_Captcha::reload.png') ?>" alt="<?php echo $this->__('Reload captcha') ?>" onclick="captcha_<?php echo $this->getFormId()?>.refresh(this)"> + <img id="<?php echo $this->getFormId() ?>" class="captcha-img" height="<?php echo $this->getImgHeight() ?>" src="<?php echo $captcha->getImgSrc() ?>"/> + <?php if ($captcha->isCaseSensitive()) :?> + <div class="captcha-note"> + <?php echo $this->__('<strong>Attention</strong>: Captcha is case sensitive.') ?> + </div> + <?php endif; ?> + </div> +</li> diff --git a/app/code/core/Mage/Catalog/Block/Breadcrumbs.php b/app/code/core/Mage/Catalog/Block/Breadcrumbs.php index da650999bc3b41fee6538b5d7e069032453f77f8..0691777e5a90ddaa4adf6c0e1924ad9973e2e444 100644 --- a/app/code/core/Mage/Catalog/Block/Breadcrumbs.php +++ b/app/code/core/Mage/Catalog/Block/Breadcrumbs.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Block/Category/View.php b/app/code/core/Mage/Catalog/Block/Category/View.php index c2483404c1b884457293aedc6a6ba492a4c84219..a0debf7483c8b9e93a55e0197905bf6c30f8a445 100644 --- a/app/code/core/Mage/Catalog/Block/Category/View.php +++ b/app/code/core/Mage/Catalog/Block/Category/View.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Block/Category/Widget/Link.php b/app/code/core/Mage/Catalog/Block/Category/Widget/Link.php index 696522d54d583eaaddde5749d8b1f17c2e03d4ec..8427a9b15655b499d8a1e7d0b1ddb3c1c0b04d41 100644 --- a/app/code/core/Mage/Catalog/Block/Category/Widget/Link.php +++ b/app/code/core/Mage/Catalog/Block/Category/Widget/Link.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Block/Layer/Filter/Abstract.php b/app/code/core/Mage/Catalog/Block/Layer/Filter/Abstract.php index 58b78d424bb460311ddf928aa7955bb84de59bcf..2708dfe3c127b8b913c4977841a36d24ebb0778b 100644 --- a/app/code/core/Mage/Catalog/Block/Layer/Filter/Abstract.php +++ b/app/code/core/Mage/Catalog/Block/Layer/Filter/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Block/Layer/Filter/Attribute.php b/app/code/core/Mage/Catalog/Block/Layer/Filter/Attribute.php index 83a2d75a84b2ed6f316e99cb591fe46582f80df8..fe03b2493db549cd3e4170f196cdb3ce8a1ecf62 100644 --- a/app/code/core/Mage/Catalog/Block/Layer/Filter/Attribute.php +++ b/app/code/core/Mage/Catalog/Block/Layer/Filter/Attribute.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Block/Layer/Filter/Category.php b/app/code/core/Mage/Catalog/Block/Layer/Filter/Category.php index afd22e7e1d7cf55c8ff189d67a41655d8c1e0b34..46207e73de6fe36316682e30e03325c29bf29525 100644 --- a/app/code/core/Mage/Catalog/Block/Layer/Filter/Category.php +++ b/app/code/core/Mage/Catalog/Block/Layer/Filter/Category.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Block/Layer/Filter/Decimal.php b/app/code/core/Mage/Catalog/Block/Layer/Filter/Decimal.php index 93b6edb25c49eba26b9fcaf83f6faf7dbdf18210..60e16e8ebb9d99f9ca0ff1081d0ba4b58b26584f 100644 --- a/app/code/core/Mage/Catalog/Block/Layer/Filter/Decimal.php +++ b/app/code/core/Mage/Catalog/Block/Layer/Filter/Decimal.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Block/Layer/Filter/Price.php b/app/code/core/Mage/Catalog/Block/Layer/Filter/Price.php index 17d921e2121640e791a3c65a067aca8c94c9403d..bc89dc30bb006985669f9a58816988274c43486c 100644 --- a/app/code/core/Mage/Catalog/Block/Layer/Filter/Price.php +++ b/app/code/core/Mage/Catalog/Block/Layer/Filter/Price.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Block/Layer/State.php b/app/code/core/Mage/Catalog/Block/Layer/State.php index ba978e2c0710bb62b37843964dd2ff16d2cd2651..2fbfa9486c9df05ca3dc0151f1b7c4e06fd863aa 100644 --- a/app/code/core/Mage/Catalog/Block/Layer/State.php +++ b/app/code/core/Mage/Catalog/Block/Layer/State.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Block/Layer/View.php b/app/code/core/Mage/Catalog/Block/Layer/View.php index 686c77eaa7d84d8adff89919698e5caa1a4b613e..dd991f8cb6e7fc1554cd572b9ff942e73f6085f3 100644 --- a/app/code/core/Mage/Catalog/Block/Layer/View.php +++ b/app/code/core/Mage/Catalog/Block/Layer/View.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -230,4 +230,14 @@ class Mage_Catalog_Block_Layer_View extends Mage_Core_Block_Template { return $this->getChild('_price_filter'); } + + /** + * Get url for 'Clear All' link + * + * @return string + */ + public function getClearUrl() + { + return $this->getChild('layer_state')->getClearUrl(); + } } diff --git a/app/code/core/Mage/Catalog/Block/Navigation.php b/app/code/core/Mage/Catalog/Block/Navigation.php index 1cc141ed9ecefe81629a5dc975143fc6c6f62af1..0f11913005435878ec7ec55743b2b5858e183b98 100644 --- a/app/code/core/Mage/Catalog/Block/Navigation.php +++ b/app/code/core/Mage/Catalog/Block/Navigation.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Block/Product.php b/app/code/core/Mage/Catalog/Block/Product.php index 18d6de8c5158bac7de5b085d381498cb7bf7659d..348d004a9fa5550728a758de942b7022c5214c38 100644 --- a/app/code/core/Mage/Catalog/Block/Product.php +++ b/app/code/core/Mage/Catalog/Block/Product.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Block/Product/Abstract.php b/app/code/core/Mage/Catalog/Block/Product/Abstract.php index b5dfbecc114276d7122d929a17f4911d8f229818..1177c24dee2802baa8231dcb7af55c91409899cd 100644 --- a/app/code/core/Mage/Catalog/Block/Product/Abstract.php +++ b/app/code/core/Mage/Catalog/Block/Product/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -344,12 +344,19 @@ abstract class Mage_Catalog_Block_Product_Abstract extends Mage_Core_Block_Templ $res = array(); if (is_array($prices)) { foreach ($prices as $price) { - $price['price_qty'] = $price['price_qty']*1; - if ($product->getPrice() != $product->getFinalPrice()) { + $price['price_qty'] = $price['price_qty'] * 1; + + $_productPrice = $product->getPrice(); + if ($_productPrice != $product->getFinalPrice()) { $_productPrice = $product->getFinalPrice(); - } else { - $_productPrice = $product->getPrice(); } + + // Group price must be used for percent calculation if it is lower + $groupPrice = $product->getGroupPrice(); + if ($_productPrice > $groupPrice) { + $_productPrice = $groupPrice; + } + if ($price['price'] < $_productPrice) { $price['savePercent'] = ceil(100 - ((100 / $_productPrice) * $price['price'])); diff --git a/app/code/core/Mage/Catalog/Block/Product/Compare/Abstract.php b/app/code/core/Mage/Catalog/Block/Product/Compare/Abstract.php index 220cf59e889475af3ea4a6a5340dae249a99ed33..2e670812eb032f794af2c038ff5fdcd867967d7c 100644 --- a/app/code/core/Mage/Catalog/Block/Product/Compare/Abstract.php +++ b/app/code/core/Mage/Catalog/Block/Product/Compare/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Block/Product/Compare/List.php b/app/code/core/Mage/Catalog/Block/Product/Compare/List.php index dc0cbe9d101a7ed6acbc8166f8fb96df3985d98b..8b7ef5afd30a03a4225eab785d734536228e45c5 100644 --- a/app/code/core/Mage/Catalog/Block/Product/Compare/List.php +++ b/app/code/core/Mage/Catalog/Block/Product/Compare/List.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Block/Product/Compare/Sidebar.php b/app/code/core/Mage/Catalog/Block/Product/Compare/Sidebar.php index 63bddb8974a7f998a2ee16fa84f901517e6b5780..29899bf186631a2699f6a55b357696738472bc12 100644 --- a/app/code/core/Mage/Catalog/Block/Product/Compare/Sidebar.php +++ b/app/code/core/Mage/Catalog/Block/Product/Compare/Sidebar.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Block/Product/Gallery.php b/app/code/core/Mage/Catalog/Block/Product/Gallery.php index c8bd70b7c3fb287d8a4ba903914b475d989a81d3..75c47245a509c40865cf5e7c53e050f44450e3ff 100644 --- a/app/code/core/Mage/Catalog/Block/Product/Gallery.php +++ b/app/code/core/Mage/Catalog/Block/Product/Gallery.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Block/Product/List.php b/app/code/core/Mage/Catalog/Block/Product/List.php index 422a46a226d907a87c018e11f227b78eb92e9aad..d2b02ce4d5456598afac9959f693336e30fd6a83 100644 --- a/app/code/core/Mage/Catalog/Block/Product/List.php +++ b/app/code/core/Mage/Catalog/Block/Product/List.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Block/Product/List/Crosssell.php b/app/code/core/Mage/Catalog/Block/Product/List/Crosssell.php index bd7bae35aaf9fe644c163cf6a089fbe7be4c3886..4eea20cd68e1098e21edb013e192726c5ad22d35 100644 --- a/app/code/core/Mage/Catalog/Block/Product/List/Crosssell.php +++ b/app/code/core/Mage/Catalog/Block/Product/List/Crosssell.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Block/Product/List/Promotion.php b/app/code/core/Mage/Catalog/Block/Product/List/Promotion.php index c3dfa323633150c9f046bc33e963efbe422915f9..fb3c95fd87a5329e3060331c51c782aaaed4745e 100755 --- a/app/code/core/Mage/Catalog/Block/Product/List/Promotion.php +++ b/app/code/core/Mage/Catalog/Block/Product/List/Promotion.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Catalog_Block_Product_List_Promotion extends Mage_Catalog_Block_Product_List diff --git a/app/code/core/Mage/Catalog/Block/Product/List/Random.php b/app/code/core/Mage/Catalog/Block/Product/List/Random.php index a5610d7c3dce6816c19b5ecb86a1fac27b7a774e..ad9caf80990b75255921ef7eca26d1d2a93aadbd 100644 --- a/app/code/core/Mage/Catalog/Block/Product/List/Random.php +++ b/app/code/core/Mage/Catalog/Block/Product/List/Random.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Block/Product/List/Related.php b/app/code/core/Mage/Catalog/Block/Product/List/Related.php index cf161f33f345143c1db39023d11266b999c88f4b..cd8b13f1ad0c8c99323c41b2d447083f849d713c 100644 --- a/app/code/core/Mage/Catalog/Block/Product/List/Related.php +++ b/app/code/core/Mage/Catalog/Block/Product/List/Related.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Block/Product/List/Toolbar.php b/app/code/core/Mage/Catalog/Block/Product/List/Toolbar.php index e6757d941f9f0348060b92e144b6f5c5a4e98b01..0cd04af31b4359fa7ddd7b9662339bd32451b46c 100644 --- a/app/code/core/Mage/Catalog/Block/Product/List/Toolbar.php +++ b/app/code/core/Mage/Catalog/Block/Product/List/Toolbar.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Block/Product/List/Upsell.php b/app/code/core/Mage/Catalog/Block/Product/List/Upsell.php index a0a42a93c0f67388a0df91e01d3de91f834ba7ad..4f3b7311b51bf8ba00c83996a979057f2b5cb402 100644 --- a/app/code/core/Mage/Catalog/Block/Product/List/Upsell.php +++ b/app/code/core/Mage/Catalog/Block/Product/List/Upsell.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Block/Product/New.php b/app/code/core/Mage/Catalog/Block/Product/New.php index 5ae9a8c4d81df8b91f42826115ee065f9de80103..6670455b7634d146f73050e60c73d32d8e2916cc 100644 --- a/app/code/core/Mage/Catalog/Block/Product/New.php +++ b/app/code/core/Mage/Catalog/Block/Product/New.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -81,19 +81,26 @@ class Mage_Catalog_Block_Product_New extends Mage_Catalog_Block_Product_Abstract */ protected function _beforeToHtml() { - $todayDate = Mage::app()->getLocale()->date()->toString(Varien_Date::DATETIME_INTERNAL_FORMAT); + $todayStartOfDayDate = Mage::app()->getLocale()->date() + ->setTime('00:00:00') + ->toString(Varien_Date::DATETIME_INTERNAL_FORMAT); + + $todayEndOfDayDate = Mage::app()->getLocale()->date() + ->setTime('23:59:59') + ->toString(Varien_Date::DATETIME_INTERNAL_FORMAT); $collection = Mage::getResourceModel('Mage_Catalog_Model_Resource_Product_Collection'); $collection->setVisibility(Mage::getSingleton('Mage_Catalog_Model_Product_Visibility')->getVisibleInCatalogIds()); + $collection = $this->_addProductAttributesAndPrices($collection) ->addStoreFilter() ->addAttributeToFilter('news_from_date', array('or'=> array( - 0 => array('date' => true, 'to' => $todayDate), + 0 => array('date' => true, 'to' => $todayEndOfDayDate), 1 => array('is' => new Zend_Db_Expr('null'))) ), 'left') ->addAttributeToFilter('news_to_date', array('or'=> array( - 0 => array('date' => true, 'from' => $todayDate), + 0 => array('date' => true, 'from' => $todayStartOfDayDate), 1 => array('is' => new Zend_Db_Expr('null'))) ), 'left') ->addAttributeToFilter( diff --git a/app/code/core/Mage/Catalog/Block/Product/Price.php b/app/code/core/Mage/Catalog/Block/Product/Price.php index 406985816b63da777f83420a7d53e2b8487086da..672bb8bfd7087fa552db0ec058d3f82bc4ad2a66 100644 --- a/app/code/core/Mage/Catalog/Block/Product/Price.php +++ b/app/code/core/Mage/Catalog/Block/Product/Price.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -72,21 +72,26 @@ class Mage_Catalog_Block_Product_Price extends Mage_Core_Block_Template if (is_null($product)) { $product = $this->getProduct(); } - $prices = $product->getFormatedTierPrice(); + $prices = $product->getFormatedTierPrice(); $res = array(); if (is_array($prices)) { foreach ($prices as $price) { - $price['price_qty'] = $price['price_qty']*1; + $price['price_qty'] = $price['price_qty'] * 1; + $productPrice = $product->getPrice(); if ($product->getPrice() != $product->getFinalPrice()) { $productPrice = $product->getFinalPrice(); - } else { - $productPrice = $product->getPrice(); } - if ($price['price']<$productPrice) { - $price['savePercent'] = ceil(100 - (( 100/$productPrice ) * $price['price'] )); + // Group price must be used for percent calculation if it is lower + $groupPrice = $product->getGroupPrice(); + if ($productPrice > $groupPrice) { + $productPrice = $groupPrice; + } + + if ($price['price'] < $productPrice) { + $price['savePercent'] = ceil(100 - ((100 / $productPrice) * $price['price'])); $tierPrice = Mage::app()->getStore()->convertPrice( Mage::helper('Mage_Tax_Helper_Data')->getPrice($product, $price['website_price']) diff --git a/app/code/core/Mage/Catalog/Block/Product/Price/Template.php b/app/code/core/Mage/Catalog/Block/Product/Price/Template.php index 8ae93ac6c27f9fdd6ac937df2b8cd028df074736..10f03d6d076709e74a8649ce8c8c1b64d8eacecc 100644 --- a/app/code/core/Mage/Catalog/Block/Product/Price/Template.php +++ b/app/code/core/Mage/Catalog/Block/Product/Price/Template.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Block/Product/Send.php b/app/code/core/Mage/Catalog/Block/Product/Send.php index f193c10dde9d386ca8752862cafb6a6036db1429..b141a1c27068ab921ce9fc8a1eba6b07b83559f9 100644 --- a/app/code/core/Mage/Catalog/Block/Product/Send.php +++ b/app/code/core/Mage/Catalog/Block/Product/Send.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Block/Product/View.php b/app/code/core/Mage/Catalog/Block/Product/View.php index f0bd3b79375718e22cd222c8e8d67791d9273a62..ff895feb962028daa8e7a10dd370287c78005816 100644 --- a/app/code/core/Mage/Catalog/Block/Product/View.php +++ b/app/code/core/Mage/Catalog/Block/Product/View.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -122,7 +122,7 @@ class Mage_Catalog_Block_Product_View extends Mage_Catalog_Block_Product_Abstrac } $addUrlKey = Mage_Core_Controller_Front_Action::PARAM_NAME_URL_ENCODED; - $addUrlValue = Mage::getUrl('*/*/*', array('_use_rewrite' => true, '_current' => false)); + $addUrlValue = Mage::getUrl('*/*/*', array('_use_rewrite' => true, '_current' => true)); $additional[$addUrlKey] = Mage::helper('Mage_Core_Helper_Data')->urlEncode($addUrlValue); return $this->helper('Mage_Checkout_Helper_Cart')->getAddUrl($product, $additional); @@ -254,4 +254,4 @@ class Mage_Catalog_Block_Product_View extends Mage_Catalog_Block_Product_Abstrac return $qty; } -} +} \ No newline at end of file diff --git a/app/code/core/Mage/Catalog/Block/Product/View/Abstract.php b/app/code/core/Mage/Catalog/Block/Product/View/Abstract.php index 53ec921ae3b9db4bd2a763f2fc85bd9c1a5a4ddb..28529dc2dd5a4f584ee706f5689009e8ca46b343 100644 --- a/app/code/core/Mage/Catalog/Block/Product/View/Abstract.php +++ b/app/code/core/Mage/Catalog/Block/Product/View/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Block/Product/View/Additional.php b/app/code/core/Mage/Catalog/Block/Product/View/Additional.php index a658e1e1dcdd303901b49eafc041aeb421796153..14beb1bf0e2b39128adcb5e90cd6c426cc190b8f 100644 --- a/app/code/core/Mage/Catalog/Block/Product/View/Additional.php +++ b/app/code/core/Mage/Catalog/Block/Product/View/Additional.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Block/Product/View/Attributes.php b/app/code/core/Mage/Catalog/Block/Product/View/Attributes.php index 79acac48b7abdd47fb271e55486c1cb996ae495b..dc80de96fd7b920eaba9eb3aa314726b394892ae 100644 --- a/app/code/core/Mage/Catalog/Block/Product/View/Attributes.php +++ b/app/code/core/Mage/Catalog/Block/Product/View/Attributes.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Block/Product/View/Description.php b/app/code/core/Mage/Catalog/Block/Product/View/Description.php index 27bd2f2f8a58382c6c556d07718f9a4b6034672d..223f1268ad43cd0e3d1c3a97b0fffa400cf6b2e5 100644 --- a/app/code/core/Mage/Catalog/Block/Product/View/Description.php +++ b/app/code/core/Mage/Catalog/Block/Product/View/Description.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Block/Product/View/Media.php b/app/code/core/Mage/Catalog/Block/Product/View/Media.php index 93456f5ee3ccc048f4a2e3e4c18ec679465160f0..f5c5c40072ca0867a708197568f7082881639290 100644 --- a/app/code/core/Mage/Catalog/Block/Product/View/Media.php +++ b/app/code/core/Mage/Catalog/Block/Product/View/Media.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Block/Product/View/Options.php b/app/code/core/Mage/Catalog/Block/Product/View/Options.php index ea8cf3e9258aeaa3ae739444f78eb1c1e058f76c..9f7c34416b70ddcf230ef42fff181b76906600d6 100644 --- a/app/code/core/Mage/Catalog/Block/Product/View/Options.php +++ b/app/code/core/Mage/Catalog/Block/Product/View/Options.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -135,6 +135,29 @@ class Mage_Catalog_Block_Product_View_Options extends Mage_Core_Block_Template return false; } + /** + * Get price configuration + * + * @param Mage_Catalog_Model_Product_Option_Value|Mage_Catalog_Model_Product_Option $option + * @return array + */ + protected function _getPriceConfiguration($option) + { + $data = array(); + $data['price'] = Mage::helper('Mage_Core_Helper_Data')->currency($option->getPrice(true), false, false); + $data['oldPrice'] = Mage::helper('Mage_Core_Helper_Data')->currency($option->getPrice(false), false, false); + $data['priceValue'] = $option->getPrice(false); + $data['type'] = $option->getPriceType(); + $data['excludeTax'] = $price = Mage::helper('Mage_Tax_Helper_Data')->getPrice($option->getProduct(), $data['price'], false); + $data['includeTax'] = $price = Mage::helper('Mage_Tax_Helper_Data')->getPrice($option->getProduct(), $data['price'], true); + return $data; + } + + /** + * Get json representation of + * + * @return string + */ public function getJsonConfig() { $config = array(); @@ -146,11 +169,12 @@ class Mage_Catalog_Block_Product_View_Options extends Mage_Core_Block_Template $_tmpPriceValues = array(); foreach ($option->getValues() as $value) { /* @var $value Mage_Catalog_Model_Product_Option_Value */ - $_tmpPriceValues[$value->getId()] = Mage::helper('Mage_Core_Helper_Data')->currency($value->getPrice(true), false, false); + $id = $value->getId(); + $_tmpPriceValues[$id] = $this->_getPriceConfiguration($value); } $priceValue = $_tmpPriceValues; } else { - $priceValue = Mage::helper('Mage_Core_Helper_Data')->currency($option->getPrice(true), false, false); + $priceValue = $this->_getPriceConfiguration($option); } $config[$option->getId()] = $priceValue; } diff --git a/app/code/core/Mage/Catalog/Block/Product/View/Options/Abstract.php b/app/code/core/Mage/Catalog/Block/Product/View/Options/Abstract.php index f01852ec6f64f64d6deedef24a9e678d43895868..4c01454682825f783089283062e6011ea4de9202 100644 --- a/app/code/core/Mage/Catalog/Block/Product/View/Options/Abstract.php +++ b/app/code/core/Mage/Catalog/Block/Product/View/Options/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -96,8 +96,8 @@ abstract class Mage_Catalog_Block_Product_View_Options_Abstract extends Mage_Cor { if ($option = $this->getOption()) { return $this->_formatPrice(array( - 'is_percent' => ($option->getPriceType() == 'percent') ? true : false, - 'pricing_value' => $option->getPrice(true) + 'is_percent' => ($option->getPriceType() == 'percent'), + 'pricing_value' => $option->getPrice($option->getPriceType() == 'percent') )); } return ''; diff --git a/app/code/core/Mage/Catalog/Block/Product/View/Options/Type/Date.php b/app/code/core/Mage/Catalog/Block/Product/View/Options/Type/Date.php index 978d1f5990ce9392e4739f409beed51e2203681b..9a80a3a027c4df3980ede15a43943fa1f9e96285 100644 --- a/app/code/core/Mage/Catalog/Block/Product/View/Options/Type/Date.php +++ b/app/code/core/Mage/Catalog/Block/Product/View/Options/Type/Date.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Block/Product/View/Options/Type/Default.php b/app/code/core/Mage/Catalog/Block/Product/View/Options/Type/Default.php index 8d683d7ef6469401609f7e0a6239258f52adfe23..f84c026a866205d4ece1ac09f28998930bed6451 100644 --- a/app/code/core/Mage/Catalog/Block/Product/View/Options/Type/Default.php +++ b/app/code/core/Mage/Catalog/Block/Product/View/Options/Type/Default.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Block/Product/View/Options/Type/File.php b/app/code/core/Mage/Catalog/Block/Product/View/Options/Type/File.php index 3a2c96f944028ae48eb458a0a223da63aa32315c..e36bb882e532c8b68ae44040b0455f3e0c84d428 100644 --- a/app/code/core/Mage/Catalog/Block/Product/View/Options/Type/File.php +++ b/app/code/core/Mage/Catalog/Block/Product/View/Options/Type/File.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Block/Product/View/Options/Type/Select.php b/app/code/core/Mage/Catalog/Block/Product/View/Options/Type/Select.php index ed037f5a20276b1ddab20ed258262b52cf689df2..efa36049637df141110c43899629714de6541c9b 100644 --- a/app/code/core/Mage/Catalog/Block/Product/View/Options/Type/Select.php +++ b/app/code/core/Mage/Catalog/Block/Product/View/Options/Type/Select.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -64,8 +64,8 @@ class Mage_Catalog_Block_Product_View_Options_Type_Select } foreach ($_option->getValues() as $_value) { $priceStr = $this->_formatPrice(array( - 'is_percent' => ($_value->getPriceType() == 'percent') ? true : false, - 'pricing_value' => $_value->getPrice(true) + 'is_percent' => ($_value->getPriceType() == 'percent'), + 'pricing_value' => $_value->getPrice(($_value->getPriceType() == 'percent')) ), false); $select->addOption( $_value->getOptionTypeId(), @@ -105,12 +105,11 @@ class Mage_Catalog_Block_Product_View_Options_Type_Select $type = 'radio'; $class = 'radio'; if (!$_option->getIsRequire()) { - $selectHtml .= '<li><input type="radio" id="options_' - . $_option->getId() . '" class="' . $class - . ' product-custom-option" name="options[' . $_option->getId() . ']"' + $selectHtml .= '<li><input type="radio" id="options_' . $_option->getId() . '" class="' + . $class . ' product-custom-option" name="options[' . $_option->getId() . ']"' . ($this->getSkipJsReloadPrice() ? '' : ' onclick="opConfig.reloadPrice()"') . ' value="" checked="checked" /><span class="label"><label for="options_' - . $_option->getId().'">' . $this->__('None') . '</label></span></li>'; + . $_option->getId() . '">' . $this->__('None') . '</label></span></li>'; } break; case Mage_Catalog_Model_Product_Option::OPTION_TYPE_CHECKBOX: @@ -124,8 +123,8 @@ class Mage_Catalog_Block_Product_View_Options_Type_Select $count++; $priceStr = $this->_formatPrice(array( - 'is_percent' => ($_value->getPriceType() == 'percent') ? true : false, - 'pricing_value' => $_value->getPrice(true) + 'is_percent' => ($_value->getPriceType() == 'percent'), + 'pricing_value' => $_value->getPrice($_value->getPriceType() == 'percent') )); $htmlValue = $_value->getOptionTypeId(); @@ -135,19 +134,19 @@ class Mage_Catalog_Block_Product_View_Options_Type_Select $checked = $configValue == $htmlValue ? 'checked' : ''; } - $selectHtml .= '<li>' . '<input type="' . $type . '" class="' . $class - . ' ' . $require . ' product-custom-option"' + $selectHtml .= '<li>' . '<input type="' . $type . '" class="' . $class . ' ' . $require + . ' product-custom-option"' . ($this->getSkipJsReloadPrice() ? '' : ' onclick="opConfig.reloadPrice()"') - . ' name="options[' . $_option->getId() . ']' . $arraySign . '" id="options_' - . $_option->getId() . '_' . $count . '" value="' . $htmlValue . '" ' . $checked . ' price="' - . $this->helper('Mage_Core_Helper_Data')->currencyByStore($_value->getPrice(true), $store, false) - . '" />' . '<span class="label"><label for="options_' . $_option->getId() . '_' . $count . '">' + . ' name="options[' . $_option->getId() . ']' . $arraySign . '" id="options_' . $_option->getId() + . '_' . $count . '" value="' . $htmlValue . '" ' . $checked . ' price="' + . $this->helper('Mage_Core_Helper_Data')->currencyByStore($_value->getPrice(true), $store, false) . '" />' + . '<span class="label"><label for="options_' . $_option->getId() . '_' . $count . '">' . $_value->getTitle() . ' ' . $priceStr . '</label></span>'; if ($_option->getIsRequire()) { - $selectHtml .= '<script type="text/javascript">' . '$(\'options_' . $_option->getId() - . '_' . $count . '\').advaiceContainer = \'options-' . $_option->getId() . '-container\';' - . '$(\'options_' . $_option->getId() . '_' . $count - . '\').callbackFunction = \'validateOptionsCallback\';' . '</script>'; + $selectHtml .= '<script type="text/javascript">' . '$(\'options_' . $_option->getId() . '_' + . $count . '\').advaiceContainer = \'options-' . $_option->getId() . '-container\';' + . '$(\'options_' . $_option->getId() . '_' . $count + . '\').callbackFunction = \'validateOptionsCallback\';' . '</script>'; } $selectHtml .= '</li>'; } diff --git a/app/code/core/Mage/Catalog/Block/Product/View/Options/Type/Text.php b/app/code/core/Mage/Catalog/Block/Product/View/Options/Type/Text.php index 697a12f317a660c6dcda9e3f4f17f68b5a522ba8..597d145d4337d8bffa8b0272112b78e15c7b81f0 100644 --- a/app/code/core/Mage/Catalog/Block/Product/View/Options/Type/Text.php +++ b/app/code/core/Mage/Catalog/Block/Product/View/Options/Type/Text.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Block/Product/View/Price.php b/app/code/core/Mage/Catalog/Block/Product/View/Price.php index a3359f11c1bef86868ef6d8989c7daaa06fd9632..d8bca253b8783b3ab1457e67b4d7531e5f0a844a 100644 --- a/app/code/core/Mage/Catalog/Block/Product/View/Price.php +++ b/app/code/core/Mage/Catalog/Block/Product/View/Price.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Block/Product/View/Tabs.php b/app/code/core/Mage/Catalog/Block/Product/View/Tabs.php index e2212d40c601fcc11fbad1502a55bf765afd332c..5c6107cd9648a09e6299ff03ee232734a67d5e9d 100644 --- a/app/code/core/Mage/Catalog/Block/Product/View/Tabs.php +++ b/app/code/core/Mage/Catalog/Block/Product/View/Tabs.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Block/Product/View/Type/Configurable.php b/app/code/core/Mage/Catalog/Block/Product/View/Type/Configurable.php index cf9a07de360f16c07a355524103e807eae3418e4..01c98a965732223756198e83ea49674794552aac 100644 --- a/app/code/core/Mage/Catalog/Block/Product/View/Type/Configurable.php +++ b/app/code/core/Mage/Catalog/Block/Product/View/Type/Configurable.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -34,20 +34,41 @@ */ class Mage_Catalog_Block_Product_View_Type_Configurable extends Mage_Catalog_Block_Product_View_Abstract { + /** + * Prices + * + * @var array + */ protected $_prices = array(); + + /** + * Prepared prices + * + * @var array + */ protected $_resPrices = array(); + /** + * Get allowed attributes + * + * @return array + */ public function getAllowAttributes() { return $this->getProduct()->getTypeInstance() ->getConfigurableAttributes($this->getProduct()); } + /** + * Check if allowed attributes have options + * + * @return bool + */ public function hasOptions() { $attributes = $this->getAllowAttributes(); if (count($attributes)) { - foreach ($attributes as $key => $attribute) { + foreach ($attributes as $attribute) { /** @var Mage_Catalog_Model_Product_Type_Configurable_Attribute $attribute */ if ($attribute->getData('prices')) { return true; @@ -57,6 +78,11 @@ class Mage_Catalog_Block_Product_View_Type_Configurable extends Mage_Catalog_Blo return false; } + /** + * Get Allowed Products + * + * @return array + */ public function getAllowProducts() { if (!$this->hasAllowProducts()) { @@ -171,11 +197,10 @@ class Mage_Catalog_Block_Product_View_Type_Configurable extends Mage_Catalog_Blo 'id' => $value['value_index'], 'label' => $value['label'], 'price' => $configurablePrice, - 'oldPrice' => $this->_preparePrice($value['pricing_value'], $value['is_percent']), + 'oldPrice' => $this->_prepareOldPrice($value['pricing_value'], $value['is_percent']), 'products' => $productsIndex, ); $optionPrices[] = $configurablePrice; - //$this->_registerAdditionalJsPrice($value['pricing_value'], $value['is_percent']); } } /** @@ -224,7 +249,6 @@ class Mage_Catalog_Block_Product_View_Type_Configurable extends Mage_Catalog_Blo $config = array( 'attributes' => $attributes, 'template' => str_replace('%s', '#{price}', $store->getCurrentCurrency()->getOutputFormat()), -// 'prices' => $this->_prices, 'basePrice' => $this->_registerJsPrice($this->_convertPrice($currentProduct->getFinalPrice())), 'oldPrice' => $this->_registerJsPrice($this->_convertPrice($currentProduct->getPrice())), 'productId' => $currentProduct->getId(), @@ -244,7 +268,7 @@ class Mage_Catalog_Block_Product_View_Type_Configurable extends Mage_Catalog_Blo /** * Validating of super product option value * - * @param array $attribute + * @param array $attributeId * @param array $value * @param array $options * @return boolean @@ -272,26 +296,57 @@ class Mage_Catalog_Block_Product_View_Type_Configurable extends Mage_Catalog_Blo return false; } - protected function _preparePrice($price, $isPercent=false) + /** + * Calculation real price + * + * @param float $price + * @param bool $isPercent + * @return mixed + */ + protected function _preparePrice($price, $isPercent = false) { if ($isPercent && !empty($price)) { - $price = $this->getProduct()->getFinalPrice()*$price/100; + $price = $this->getProduct()->getFinalPrice() * $price / 100; } return $this->_registerJsPrice($this->_convertPrice($price, true)); } - protected function _registerJsPrice($price) + /** + * Calculation price before special price + * + * @param float $price + * @param bool $isPercent + * @return mixed + */ + protected function _prepareOldPrice($price, $isPercent = false) { - $jsPrice = str_replace(',', '.', $price); + if ($isPercent && !empty($price)) { + $price = $this->getProduct()->getPrice() * $price / 100; + } -// if (!isset($this->_prices[$jsPrice])) { -// $this->_prices[$jsPrice] = strip_tags(Mage::app()->getStore()->formatPrice($price)); -// } - return $jsPrice; + return $this->_registerJsPrice($this->_convertPrice($price, true)); + } + + /** + * Replace ',' on '.' for js + * + * @param float $price + * @return string + */ + protected function _registerJsPrice($price) + { + return str_replace(',', '.', $price); } - protected function _convertPrice($price, $round=false) + /** + * Convert price from default currency to current currency + * + * @param float $price + * @param boolean $round + * @return float + */ + protected function _convertPrice($price, $round = false) { if (empty($price)) { return 0; @@ -302,32 +357,6 @@ class Mage_Catalog_Block_Product_View_Type_Configurable extends Mage_Catalog_Blo $price = $this->getCurrentStore()->roundPrice($price); } - return $price; } - -// protected function _registerAdditionalJsPrice($price, $isPercent=false) -// { -// if (empty($price) && isset($this->_prices[0])) { -// return $this; -// } -// -// $basePrice = $this->getProduct()->getFinalPrice(); -// if ($isPercent) { -// $price = $basePrice*$price/100; -// } -// else { -// $price = $price; -// } -// -// $price = $this->_convertPrice($price); -// -// foreach ($this->_resPrices as $prevPrice) { -// $additionalPrice = $prevPrice + $price; -// $this->_resPrices[] = $additionalPrice; -// $jsAdditionalPrice = str_replace(',', '.', $additionalPrice); -// $this->_prices[$jsAdditionalPrice] = strip_tags(Mage::app()->getStore()->formatPrice($additionalPrice)); -// } -// return $this; -// } } diff --git a/app/code/core/Mage/Catalog/Block/Product/View/Type/Grouped.php b/app/code/core/Mage/Catalog/Block/Product/View/Type/Grouped.php index ded54996233d7f9e0e798f033aad41ad9c5466a9..3453334b43159dbda056a86ee67e0f0460280e3f 100644 --- a/app/code/core/Mage/Catalog/Block/Product/View/Type/Grouped.php +++ b/app/code/core/Mage/Catalog/Block/Product/View/Type/Grouped.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Block/Product/View/Type/Simple.php b/app/code/core/Mage/Catalog/Block/Product/View/Type/Simple.php index e2bf595398a39e612c8275fe97cacafec2a1a459..fb4f9bb2eb7c00fa44b87fa1ce4a86076102d6ec 100644 --- a/app/code/core/Mage/Catalog/Block/Product/View/Type/Simple.php +++ b/app/code/core/Mage/Catalog/Block/Product/View/Type/Simple.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Block/Product/View/Type/Virtual.php b/app/code/core/Mage/Catalog/Block/Product/View/Type/Virtual.php index f8f503579c75e1e1c119375a250b570116f68db8..65f1c14fa12f8b40f50db3e5237c15718fc3aecb 100644 --- a/app/code/core/Mage/Catalog/Block/Product/View/Type/Virtual.php +++ b/app/code/core/Mage/Catalog/Block/Product/View/Type/Virtual.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Block/Product/Widget/Link.php b/app/code/core/Mage/Catalog/Block/Product/Widget/Link.php index 8adc3b0e82fd3253c03192ab971e1a64d7c23284..2d06f3d75e8486a640a766ece805c85ded5d9981 100644 --- a/app/code/core/Mage/Catalog/Block/Product/Widget/Link.php +++ b/app/code/core/Mage/Catalog/Block/Product/Widget/Link.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Block/Product/Widget/New.php b/app/code/core/Mage/Catalog/Block/Product/Widget/New.php index bf93aae3aa0906d661d4d6ca225fda17cec1db4b..6867d5b3b2407e537add77152a280b47970e9728 100644 --- a/app/code/core/Mage/Catalog/Block/Product/Widget/New.php +++ b/app/code/core/Mage/Catalog/Block/Product/Widget/New.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Block/Seo/Sitemap/Abstract.php b/app/code/core/Mage/Catalog/Block/Seo/Sitemap/Abstract.php index fd1c7e7db517ddd77be9c97064ac587159915a25..efc7f64167ad35b5e62f5ab77a0fa2a715a40490 100644 --- a/app/code/core/Mage/Catalog/Block/Seo/Sitemap/Abstract.php +++ b/app/code/core/Mage/Catalog/Block/Seo/Sitemap/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Block/Seo/Sitemap/Category.php b/app/code/core/Mage/Catalog/Block/Seo/Sitemap/Category.php index 88c8327f827fa07a6192c10b5e51b55e81701afe..24b7c6f9d7308cf8f650693d8a4c038ed7a90cd4 100644 --- a/app/code/core/Mage/Catalog/Block/Seo/Sitemap/Category.php +++ b/app/code/core/Mage/Catalog/Block/Seo/Sitemap/Category.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Block/Seo/Sitemap/Product.php b/app/code/core/Mage/Catalog/Block/Seo/Sitemap/Product.php index ea509fac42ca2121fde46eef675aff1db060a2c0..f1db0a9f108b949d6b34d17ed31f04c6e7db8328 100644 --- a/app/code/core/Mage/Catalog/Block/Seo/Sitemap/Product.php +++ b/app/code/core/Mage/Catalog/Block/Seo/Sitemap/Product.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Block/Seo/Sitemap/Tree/Category.php b/app/code/core/Mage/Catalog/Block/Seo/Sitemap/Tree/Category.php index 63fa4697d109a6ab1f1187cc2760de80dc1d5220..28789b5455af3cf094436a5c31350683d7cb2cea 100644 --- a/app/code/core/Mage/Catalog/Block/Seo/Sitemap/Tree/Category.php +++ b/app/code/core/Mage/Catalog/Block/Seo/Sitemap/Tree/Category.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Block/Seo/Sitemap/Tree/Pager.php b/app/code/core/Mage/Catalog/Block/Seo/Sitemap/Tree/Pager.php index e0b4805cb7fed8699b9da218602d91ab3ae9f79f..b762f2a13ea7d8722a6192ffa2e78bf35bb4665a 100644 --- a/app/code/core/Mage/Catalog/Block/Seo/Sitemap/Tree/Pager.php +++ b/app/code/core/Mage/Catalog/Block/Seo/Sitemap/Tree/Pager.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Block/Widget/Link.php b/app/code/core/Mage/Catalog/Block/Widget/Link.php index 9c5121d15fc5dd15ec7a06a01bc9ce54aca701e3..e5c94172ba02e385e0ef663d29b82639c99cd0ad 100644 --- a/app/code/core/Mage/Catalog/Block/Widget/Link.php +++ b/app/code/core/Mage/Catalog/Block/Widget/Link.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Controller/Product/View/Interface.php b/app/code/core/Mage/Catalog/Controller/Product/View/Interface.php index 4f2a6e9790504998d9916d662efa66087d6d3798..8e9f505193d720c3a43dc390891bbbc8550536c5 100644 --- a/app/code/core/Mage/Catalog/Controller/Product/View/Interface.php +++ b/app/code/core/Mage/Catalog/Controller/Product/View/Interface.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Exception.php b/app/code/core/Mage/Catalog/Exception.php index 7a572a962a4fd4110407926874251fa2963217d5..724265ed906753f056445685b2902456262a7896 100644 --- a/app/code/core/Mage/Catalog/Exception.php +++ b/app/code/core/Mage/Catalog/Exception.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Helper/Category.php b/app/code/core/Mage/Catalog/Helper/Category.php index 80ef7ac266daea63e4c08bed832345a4cf701036..bcbe25149abb81ed1d568a87fa3ace39f916ebf3 100644 --- a/app/code/core/Mage/Catalog/Helper/Category.php +++ b/app/code/core/Mage/Catalog/Helper/Category.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Helper/Category/Flat.php b/app/code/core/Mage/Catalog/Helper/Category/Flat.php index b8ed28b5a70b6de39d432d0d3622d352947eb2e4..658e212f3ac07d2f021f78def13a9f380c8bce6a 100644 --- a/app/code/core/Mage/Catalog/Helper/Category/Flat.php +++ b/app/code/core/Mage/Catalog/Helper/Category/Flat.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Helper/Data.php b/app/code/core/Mage/Catalog/Helper/Data.php index ec849e2dfdfb853b8159826f3abc7d9568e97fbf..1ec0743468e9d9cbb0e1c57962217a91821bb99a 100644 --- a/app/code/core/Mage/Catalog/Helper/Data.php +++ b/app/code/core/Mage/Catalog/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Helper/Image.php b/app/code/core/Mage/Catalog/Helper/Image.php index 5aa6e8de7c5f26c36157ba7b3949b85b0894b4fa..1f92f4cd3aa3c469b7c17e8ef21bd0739d54f045 100644 --- a/app/code/core/Mage/Catalog/Helper/Image.php +++ b/app/code/core/Mage/Catalog/Helper/Image.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -31,22 +31,87 @@ */ class Mage_Catalog_Helper_Image extends Mage_Core_Helper_Abstract { + /** + * Current model + * + * @var Mage_Catalog_Model_Product_Image + */ protected $_model; + + /** + * Scheduled for resize image + * + * @var bool + */ protected $_scheduleResize = false; + + /** + * Scheduled for rotate image + * + * @var bool + */ protected $_scheduleRotate = false; + + /** + * Angle + * + * @var int + */ protected $_angle; + /** + * Watermark file name + * + * @var string + */ protected $_watermark; + + /** + * Watermark Position + * + * @var string + */ protected $_watermarkPosition; + + /** + * Watermark Size + * + * @var string + */ protected $_watermarkSize; + + /** + * Watermark Image opacity + * + * @var int + */ protected $_watermarkImageOpacity; + /** + * Current Product + * + * @var Mage_Catalog_Model_Product + */ protected $_product; + + /** + * Image File + * + * @var string + */ protected $_imageFile; + + /** + * Image Placeholder + * + * @var string + */ protected $_placeholder; /** - * Reset all previos data + * Reset all previous data + * + * @return Mage_Catalog_Helper_Image */ protected function _reset() { @@ -63,6 +128,14 @@ class Mage_Catalog_Helper_Image extends Mage_Core_Helper_Abstract return $this; } + /** + * Initialize Helper to work with Image + * + * @param Mage_Catalog_Model_Product $product + * @param string $attributeName + * @param mixed $imageFile + * @return Mage_Catalog_Helper_Image + */ public function init(Mage_Catalog_Model_Product $product, $attributeName, $imageFile=null) { $this->_reset(); @@ -70,17 +143,24 @@ class Mage_Catalog_Helper_Image extends Mage_Core_Helper_Abstract $this->_getModel()->setDestinationSubdir($attributeName); $this->setProduct($product); - $this->setWatermark(Mage::getStoreConfig("design/watermark/{$this->_getModel()->getDestinationSubdir()}_image")); - $this->setWatermarkImageOpacity(Mage::getStoreConfig("design/watermark/{$this->_getModel()->getDestinationSubdir()}_imageOpacity")); - $this->setWatermarkPosition(Mage::getStoreConfig("design/watermark/{$this->_getModel()->getDestinationSubdir()}_position")); - $this->setWatermarkSize(Mage::getStoreConfig("design/watermark/{$this->_getModel()->getDestinationSubdir()}_size")); + $this->setWatermark( + Mage::getStoreConfig("design/watermark/{$this->_getModel()->getDestinationSubdir()}_image") + ); + $this->setWatermarkImageOpacity( + Mage::getStoreConfig("design/watermark/{$this->_getModel()->getDestinationSubdir()}_imageOpacity") + ); + $this->setWatermarkPosition( + Mage::getStoreConfig("design/watermark/{$this->_getModel()->getDestinationSubdir()}_position") + ); + $this->setWatermarkSize( + Mage::getStoreConfig("design/watermark/{$this->_getModel()->getDestinationSubdir()}_size") + ); if ($imageFile) { $this->setImageFile($imageFile); - } - else { + } else { // add for work original size - $this->_getModel()->setBaseFile( $this->getProduct()->getData($this->_getModel()->getDestinationSubdir()) ); + $this->_getModel()->setBaseFile($this->getProduct()->getData($this->_getModel()->getDestinationSubdir())); } return $this; } @@ -198,6 +278,12 @@ class Mage_Catalog_Helper_Image extends Mage_Core_Helper_Abstract return $this; } + /** + * Rotate image into specified angle + * + * @param int $angle + * @return Mage_Catalog_Helper_Image + */ public function rotate($angle) { $this->setAngle($angle); @@ -225,11 +311,22 @@ class Mage_Catalog_Helper_Image extends Mage_Core_Helper_Abstract return $this; } + /** + * Set placeholder + * + * @param string $fileName + * @return void + */ public function placeholder($fileName) { $this->_placeholder = $fileName; } + /** + * Get Placeholder + * + * @return string + */ public function getPlaceholder() { if (!$this->_placeholder) { @@ -239,41 +336,49 @@ class Mage_Catalog_Helper_Image extends Mage_Core_Helper_Abstract return $this->_placeholder; } + /** + * Return Image URL + * + * @return string + */ public function __toString() { try { - if( $this->getImageFile() ) { - $this->_getModel()->setBaseFile( $this->getImageFile() ); + $model = $this->_getModel(); + + if ($this->getImageFile()) { + $model->setBaseFile($this->getImageFile()); } else { - $this->_getModel()->setBaseFile( $this->getProduct()->getData($this->_getModel()->getDestinationSubdir()) ); + $model->setBaseFile($this->getProduct()->getData($model->getDestinationSubdir())); } - if( $this->_getModel()->isCached() ) { - return $this->_getModel()->getUrl(); + if ($model->isCached()) { + return $model->getUrl(); } else { - if( $this->_scheduleRotate ) { - $this->_getModel()->rotate( $this->getAngle() ); + if ($this->_scheduleRotate) { + $model->rotate($this->getAngle()); } if ($this->_scheduleResize) { - $this->_getModel()->resize(); + $model->resize(); } - if( $this->getWatermark() ) { - $this->_getModel()->setWatermark($this->getWatermark()); + if ($this->getWatermark()) { + $model->setWatermark($this->getWatermark()); } - $url = $this->_getModel()->saveFile()->getUrl(); + $url = $model->saveFile()->getUrl(); } - } catch( Exception $e ) { + } catch (Exception $e) { $url = Mage::getDesign()->getSkinUrl($this->getPlaceholder()); } return $url; } /** - * Enter description here... + * Set current Image model * + * @param Mage_Catalog_Model_Product_Image $model * @return Mage_Catalog_Helper_Image */ protected function _setModel($model) @@ -283,7 +388,7 @@ class Mage_Catalog_Helper_Image extends Mage_Core_Helper_Abstract } /** - * Enter description here... + * Get current Image model * * @return Mage_Catalog_Model_Product_Image */ @@ -292,12 +397,23 @@ class Mage_Catalog_Helper_Image extends Mage_Core_Helper_Abstract return $this->_model; } + /** + * Set Rotation Angle + * + * @param int $angle + * @return Mage_Catalog_Helper_Image + */ protected function setAngle($angle) { $this->_angle = $angle; return $this; } + /** + * Get Rotation Angle + * + * @return int + */ protected function getAngle() { return $this->_angle; @@ -393,44 +509,67 @@ class Mage_Catalog_Helper_Image extends Mage_Core_Helper_Abstract */ protected function getWatermarkImageOpacity() { - if( $this->_watermarkImageOpacity ) { + if ($this->_watermarkImageOpacity) { return $this->_watermarkImageOpacity; } return $this->_getModel()->getWatermarkImageOpacity(); } + /** + * Set current Product + * + * @param Mage_Catalog_Model_Product $product + * @return Mage_Catalog_Helper_Image + */ protected function setProduct($product) { $this->_product = $product; return $this; } + /** + * Get current Product + * + * @return Mage_Catalog_Model_Product + */ protected function getProduct() { return $this->_product; } + /** + * Set Image file + * + * @param string $file + * @return Mage_Catalog_Helper_Image + */ protected function setImageFile($file) { $this->_imageFile = $file; return $this; } + /** + * Get Image file + * + * @return string + */ protected function getImageFile() { return $this->_imageFile; } /** - * Enter description here... + * Retrieve size from string * - * @return array + * @param string $string + * @return array|bool */ protected function parseSize($string) { $size = explode('x', strtolower($string)); - if( sizeof($size) == 2 ) { + if (sizeof($size) == 2) { return array( 'width' => ($size[0] > 0) ? $size[0] : null, 'heigth' => ($size[1] > 0) ? $size[1] : null, @@ -478,13 +617,15 @@ class Mage_Catalog_Helper_Image extends Mage_Core_Helper_Abstract * * @param string $filePath * @return bool - * @throw Mage_Core_Exception + * @throws Mage_Core_Exception */ public function validateUploadFile($filePath) { if (!getimagesize($filePath)) { Mage::throwException($this->__('Disallowed file type.')); } - return true; + + $_processor = new Varien_Image($filePath); + return $_processor->getMimeType() !== null; } -} +} \ No newline at end of file diff --git a/app/code/core/Mage/Catalog/Helper/Map.php b/app/code/core/Mage/Catalog/Helper/Map.php index 3ecff8dab942451c01d132dd318444135c69cd94..e819ffb486173be9e5db466542df9a27e85f3fc6 100644 --- a/app/code/core/Mage/Catalog/Helper/Map.php +++ b/app/code/core/Mage/Catalog/Helper/Map.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Helper/Output.php b/app/code/core/Mage/Catalog/Helper/Output.php index f98e05e6edf19f694af41f8541b4ea9e53a8ac6a..c8f77a811d5ac38a7b8b34bb72813d5a23f0c1bc 100644 --- a/app/code/core/Mage/Catalog/Helper/Output.php +++ b/app/code/core/Mage/Catalog/Helper/Output.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Helper/Product.php b/app/code/core/Mage/Catalog/Helper/Product.php index 4ab7c80ae5479e50dd83397806e00b8299b703a1..378b76917063384c3b7473c9d31a97e7a1568340 100644 --- a/app/code/core/Mage/Catalog/Helper/Product.php +++ b/app/code/core/Mage/Catalog/Helper/Product.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Helper/Product/Compare.php b/app/code/core/Mage/Catalog/Helper/Product/Compare.php index 1a289e89655f6004bd204a38bdbcd7f6009df9f4..5da6aff01b0265c72673a10cfb6921f6af77f900 100644 --- a/app/code/core/Mage/Catalog/Helper/Product/Compare.php +++ b/app/code/core/Mage/Catalog/Helper/Product/Compare.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Helper/Product/Configuration.php b/app/code/core/Mage/Catalog/Helper/Product/Configuration.php index 71764ca435e349c4d58a137dc498a9859824bdb4..b435e3ce0b9483f17353dfc5a7877522d10856c9 100644 --- a/app/code/core/Mage/Catalog/Helper/Product/Configuration.php +++ b/app/code/core/Mage/Catalog/Helper/Product/Configuration.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Helper/Product/Configuration/Interface.php b/app/code/core/Mage/Catalog/Helper/Product/Configuration/Interface.php index 4352261c416e5d4167c703bc43888fde7d2950fb..f5575f1646f51b73240d211cda80bc643b1d94de 100644 --- a/app/code/core/Mage/Catalog/Helper/Product/Configuration/Interface.php +++ b/app/code/core/Mage/Catalog/Helper/Product/Configuration/Interface.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Helper/Product/Flat.php b/app/code/core/Mage/Catalog/Helper/Product/Flat.php index e7c26da5f22086b27a8b83f2fe23d58e756ca85c..59b11e858582b268ee65edccdbda8c40472b3118 100644 --- a/app/code/core/Mage/Catalog/Helper/Product/Flat.php +++ b/app/code/core/Mage/Catalog/Helper/Product/Flat.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Helper/Product/Options.php b/app/code/core/Mage/Catalog/Helper/Product/Options.php index f57ea7a23beeb185d604db437bddb850469bc001..53aaa083d4c6a11eed9450e44f9016d5c23fea4c 100644 --- a/app/code/core/Mage/Catalog/Helper/Product/Options.php +++ b/app/code/core/Mage/Catalog/Helper/Product/Options.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Helper/Product/Url.php b/app/code/core/Mage/Catalog/Helper/Product/Url.php index 8a3a77ea7880e977c2d4b2e1cce960603380eb95..3b9bb2507bddb952f4103fd38a0eb7fa4b7482cb 100644 --- a/app/code/core/Mage/Catalog/Helper/Product/Url.php +++ b/app/code/core/Mage/Catalog/Helper/Product/Url.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Helper/Product/View.php b/app/code/core/Mage/Catalog/Helper/Product/View.php index ebf84900627df04575006129fd9a8ab1eab608af..0d1f4350866e2189e534cfce0cceeac79d43a865 100644 --- a/app/code/core/Mage/Catalog/Helper/Product/View.php +++ b/app/code/core/Mage/Catalog/Helper/Product/View.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Abstract.php b/app/code/core/Mage/Catalog/Model/Abstract.php index 099cad5956af3b2cf99dab93506696f05b4f2e35..d5734c71d4a12b2c9e6c198e3efa1db95659952e 100644 --- a/app/code/core/Mage/Catalog/Model/Abstract.php +++ b/app/code/core/Mage/Catalog/Model/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Api/Resource.php b/app/code/core/Mage/Catalog/Model/Api/Resource.php index ca1e37eb9f4158d3e6d9f528acde4fbbb2f77e1d..274ff1675271539647940ea57e721f13e9d924ca 100644 --- a/app/code/core/Mage/Catalog/Model/Api/Resource.php +++ b/app/code/core/Mage/Catalog/Model/Api/Resource.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Attribute/Backend/Customlayoutupdate.php b/app/code/core/Mage/Catalog/Model/Attribute/Backend/Customlayoutupdate.php index 0b015ec24e6675cdc9814f5d8fd19cf099214a18..6d80ae114150002ce317f40db7a82b29280c8e79 100644 --- a/app/code/core/Mage/Catalog/Model/Attribute/Backend/Customlayoutupdate.php +++ b/app/code/core/Mage/Catalog/Model/Attribute/Backend/Customlayoutupdate.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Category.php b/app/code/core/Mage/Catalog/Model/Category.php index 8d1deddc64e72ce3730cec0ba7d8d575c73152ee..6635187282634ee948bf79ea5dacc4265453ec8f 100644 --- a/app/code/core/Mage/Catalog/Model/Category.php +++ b/app/code/core/Mage/Catalog/Model/Category.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Category/Api.php b/app/code/core/Mage/Catalog/Model/Category/Api.php index 209b47adac4c5d934c089f743872a9fbc6dd7d3c..4f7236d16a67f5ea8e69258d5b87a202fe24ffc7 100644 --- a/app/code/core/Mage/Catalog/Model/Category/Api.php +++ b/app/code/core/Mage/Catalog/Model/Category/Api.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Category/Api/V2.php b/app/code/core/Mage/Catalog/Model/Category/Api/V2.php index 685fcd6a16488a7c5d1fe5b18646fd70c0f7d65f..aa76e428596378e77ee66f9b4ef58ac4da4630b3 100644 --- a/app/code/core/Mage/Catalog/Model/Category/Api/V2.php +++ b/app/code/core/Mage/Catalog/Model/Category/Api/V2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Category/Attribute/Api.php b/app/code/core/Mage/Catalog/Model/Category/Attribute/Api.php index 51013ee567daa710f3e02fcec128d660cbf3ee7e..db9bf721ac01ba23b6e84d87fb871cbdd1015787 100644 --- a/app/code/core/Mage/Catalog/Model/Category/Attribute/Api.php +++ b/app/code/core/Mage/Catalog/Model/Category/Attribute/Api.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Category/Attribute/Api/V2.php b/app/code/core/Mage/Catalog/Model/Category/Attribute/Api/V2.php index ddd8489b9b3cb93834b6f1496d2ba5fe49a340bf..3328b324e0a8e16dc3d8790b3ccda0b1d4c2e4fc 100644 --- a/app/code/core/Mage/Catalog/Model/Category/Attribute/Api/V2.php +++ b/app/code/core/Mage/Catalog/Model/Category/Attribute/Api/V2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Category/Attribute/Backend/Image.php b/app/code/core/Mage/Catalog/Model/Category/Attribute/Backend/Image.php index 1d67a5098cd6e189da9d004bf64e56501d9a22ed..b9f07718ea03b106f149be1987d75df4784b2e60 100644 --- a/app/code/core/Mage/Catalog/Model/Category/Attribute/Backend/Image.php +++ b/app/code/core/Mage/Catalog/Model/Category/Attribute/Backend/Image.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Category/Attribute/Backend/Sortby.php b/app/code/core/Mage/Catalog/Model/Category/Attribute/Backend/Sortby.php index 12f184a16ed94075c69725f675202dbfd0a807dc..c7473ae2d8e2c9de8c3aca76c4a6fca56ddd705f 100644 --- a/app/code/core/Mage/Catalog/Model/Category/Attribute/Backend/Sortby.php +++ b/app/code/core/Mage/Catalog/Model/Category/Attribute/Backend/Sortby.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Category/Attribute/Backend/Urlkey.php b/app/code/core/Mage/Catalog/Model/Category/Attribute/Backend/Urlkey.php index f8075237b998cae89734ee4596b7e7eaf59bcf7d..f883af5e3a4191d3777b8d566926f43d5083bf06 100644 --- a/app/code/core/Mage/Catalog/Model/Category/Attribute/Backend/Urlkey.php +++ b/app/code/core/Mage/Catalog/Model/Category/Attribute/Backend/Urlkey.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Category/Attribute/Source/Layout.php b/app/code/core/Mage/Catalog/Model/Category/Attribute/Source/Layout.php index 26428f5716b04c897baf30876fa50ce0c7515437..47d2e1841ca4a1e14e339d45fdff8f5bb8b7f22d 100644 --- a/app/code/core/Mage/Catalog/Model/Category/Attribute/Source/Layout.php +++ b/app/code/core/Mage/Catalog/Model/Category/Attribute/Source/Layout.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Category/Attribute/Source/Mode.php b/app/code/core/Mage/Catalog/Model/Category/Attribute/Source/Mode.php index 51fb658ec738258860cd032476c0af15443d701e..36a74271d767baf70b48356c2d409d89a02fe5db 100644 --- a/app/code/core/Mage/Catalog/Model/Category/Attribute/Source/Mode.php +++ b/app/code/core/Mage/Catalog/Model/Category/Attribute/Source/Mode.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Category/Attribute/Source/Page.php b/app/code/core/Mage/Catalog/Model/Category/Attribute/Source/Page.php index 210c973559a786cf221443d5b438edd96ed704bc..d306e18be4aa6d6540917eddb4610da6e18e550b 100644 --- a/app/code/core/Mage/Catalog/Model/Category/Attribute/Source/Page.php +++ b/app/code/core/Mage/Catalog/Model/Category/Attribute/Source/Page.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Category/Attribute/Source/Sortby.php b/app/code/core/Mage/Catalog/Model/Category/Attribute/Source/Sortby.php index 5c14ae7134183d3f0f2c0a957913480823b5ae13..5561f00b30b024d81c62b744916b71b91ae8e51c 100644 --- a/app/code/core/Mage/Catalog/Model/Category/Attribute/Source/Sortby.php +++ b/app/code/core/Mage/Catalog/Model/Category/Attribute/Source/Sortby.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Category/Indexer/Flat.php b/app/code/core/Mage/Catalog/Model/Category/Indexer/Flat.php index 550e8d87ebda29cbc3438a7c8621e07c9e7be46a..0074a5d9ba04cc110d59601035074c5dba627505 100644 --- a/app/code/core/Mage/Catalog/Model/Category/Indexer/Flat.php +++ b/app/code/core/Mage/Catalog/Model/Category/Indexer/Flat.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Category/Indexer/Product.php b/app/code/core/Mage/Catalog/Model/Category/Indexer/Product.php index 0eba5f4ab0beb59da9cba4ed4c057e1c0992993c..1019e09db8f226cc5270fbe79cdc2d5ecd918120 100644 --- a/app/code/core/Mage/Catalog/Model/Category/Indexer/Product.php +++ b/app/code/core/Mage/Catalog/Model/Category/Indexer/Product.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Config.php b/app/code/core/Mage/Catalog/Model/Config.php index da4f57bc156717c8e5753b481877557295767704..80c4885f8f16a733cda7f8bff8ff544b281363ed 100644 --- a/app/code/core/Mage/Catalog/Model/Config.php +++ b/app/code/core/Mage/Catalog/Model/Config.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Convert.php b/app/code/core/Mage/Catalog/Model/Convert.php index c1f120ee1af5e581552d36d9e20ae5949cd8a941..8f2eebbe6f386f124855bf8b2ba8e02cb2630acd 100644 --- a/app/code/core/Mage/Catalog/Model/Convert.php +++ b/app/code/core/Mage/Catalog/Model/Convert.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Convert/Adapter/Catalog.php b/app/code/core/Mage/Catalog/Model/Convert/Adapter/Catalog.php index 0cb4c858d8da78fbf7f808fe88bbb475c4f12c36..eeb8ceab8106fd2fc1857ec47db4f7f470eb1556 100644 --- a/app/code/core/Mage/Catalog/Model/Convert/Adapter/Catalog.php +++ b/app/code/core/Mage/Catalog/Model/Convert/Adapter/Catalog.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Convert/Adapter/Product.php b/app/code/core/Mage/Catalog/Model/Convert/Adapter/Product.php index 083830e6854692e9d959119239183bce4523fb5e..1a3ff1f946c7ad1c2f8fb2736ea9d87e7aa3c7d1 100644 --- a/app/code/core/Mage/Catalog/Model/Convert/Adapter/Product.php +++ b/app/code/core/Mage/Catalog/Model/Convert/Adapter/Product.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -556,10 +556,7 @@ class Mage_Catalog_Model_Convert_Adapter_Product } catch (Exception $e) { if (!$e instanceof Mage_Dataflow_Model_Convert_Exception) { $this->addException( - Mage::helper('Mage_Catalog_Helper_Data')->__( - 'An error occurred while saving the collection, aborting. Error message: %s', - $e->getMessage() - ), + Mage::helper('Mage_Catalog_Helper_Data')->__('An error occurred while saving the collection, aborting. Error message: %s', $e->getMessage()), Mage_Dataflow_Model_Convert_Exception::FATAL ); } @@ -586,10 +583,7 @@ class Mage_Catalog_Model_Convert_Adapter_Product if (!is_null($this->getBatchParams('store'))) { $store = $this->getStoreById($this->getBatchParams('store')); } else { - $message = Mage::helper('Mage_Catalog_Helper_Data')->__( - 'Skipping import row, required field "%s" is not defined.', - 'store' - ); + $message = Mage::helper('Mage_Catalog_Helper_Data')->__('Skipping import row, required field "%s" is not defined.', 'store'); Mage::throwException($message); } } else { @@ -597,10 +591,7 @@ class Mage_Catalog_Model_Convert_Adapter_Product } if ($store === false) { - $message = Mage::helper('Mage_Catalog_Helper_Data')->__( - 'Skipping import row, store "%s" field does not exist.', - $importData['store'] - ); + $message = Mage::helper('Mage_Catalog_Helper_Data')->__('Skipping import row, store "%s" field does not exist.', $importData['store']); Mage::throwException($message); } @@ -622,11 +613,7 @@ class Mage_Catalog_Model_Convert_Adapter_Product */ if (empty($importData['type']) || !isset($productTypes[strtolower($importData['type'])])) { $value = isset($importData['type']) ? $importData['type'] : ''; - $message = Mage::helper('Mage_Catalog_Helper_Data')->__( - 'Skip import row, is not valid value "%s" for field "%s"', - $value, - 'type' - ); + $message = Mage::helper('Mage_Catalog_Helper_Data')->__('Skip import row, is not valid value "%s" for field "%s"', $value, 'type'); Mage::throwException($message); } $product->setTypeId($productTypes[strtolower($importData['type'])]); @@ -635,11 +622,7 @@ class Mage_Catalog_Model_Convert_Adapter_Product */ if (empty($importData['attribute_set']) || !isset($productAttributeSets[$importData['attribute_set']])) { $value = isset($importData['attribute_set']) ? $importData['attribute_set'] : ''; - $message = Mage::helper('Mage_Catalog_Helper_Data')->__( - 'Skip import row, the value "%s" is invalid for field "%s"', - $value, - 'attribute_set' - ); + $message = Mage::helper('Mage_Catalog_Helper_Data')->__('Skip import row, the value "%s" is invalid for field "%s"', $value, 'attribute_set'); Mage::throwException($message); } $product->setAttributeSetId($productAttributeSets[$importData['attribute_set']]); @@ -647,10 +630,7 @@ class Mage_Catalog_Model_Convert_Adapter_Product foreach ($this->_requiredFields as $field) { $attribute = $this->getAttribute($field); if (!isset($importData[$field]) && $attribute && $attribute->getIsRequired()) { - $message = Mage::helper('Mage_Catalog_Helper_Data')->__( - 'Skipping import row, required field "%s" for new products is not defined.', - $field - ); + $message = Mage::helper('Mage_Catalog_Helper_Data')->__('Skipping import row, required field "%s" for new products is not defined.', $field); Mage::throwException($message); } } diff --git a/app/code/core/Mage/Catalog/Model/Convert/Parser/Product.php b/app/code/core/Mage/Catalog/Model/Convert/Parser/Product.php index 0ca79d1abbdc4e7adb9a6fc2c412dbfa28fb3729..66b69b8f51cc2d09b49b7b106362e470fcee382f 100644 --- a/app/code/core/Mage/Catalog/Model/Convert/Parser/Product.php +++ b/app/code/core/Mage/Catalog/Model/Convert/Parser/Product.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Design.php b/app/code/core/Mage/Catalog/Model/Design.php index bd48204076dc92a4f062809d0991099c1f2e8610..723a83d42e180511030874d6a3b528179f5080d5 100644 --- a/app/code/core/Mage/Catalog/Model/Design.php +++ b/app/code/core/Mage/Catalog/Model/Design.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Entity/Attribute.php b/app/code/core/Mage/Catalog/Model/Entity/Attribute.php index 5947b4f000443c769afcca3c0b53f7d89285033a..2e892c7585e3f797ada3082efd84e2eea20b43af 100644 --- a/app/code/core/Mage/Catalog/Model/Entity/Attribute.php +++ b/app/code/core/Mage/Catalog/Model/Entity/Attribute.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Entity/Product/Attribute/Design/Options/Container.php b/app/code/core/Mage/Catalog/Model/Entity/Product/Attribute/Design/Options/Container.php index 58028a83837e5fa5d132bf95b607024cb1ab9fda..d7ab088c0cd1034b4a494e0a1932a1ef70c0d885 100644 --- a/app/code/core/Mage/Catalog/Model/Entity/Product/Attribute/Design/Options/Container.php +++ b/app/code/core/Mage/Catalog/Model/Entity/Product/Attribute/Design/Options/Container.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Index.php b/app/code/core/Mage/Catalog/Model/Index.php index 00bf3666a9696eb9770e7d10d6e7cd637633fd06..f064673283ba8434938e6e502c3f2192cf20f64f 100644 --- a/app/code/core/Mage/Catalog/Model/Index.php +++ b/app/code/core/Mage/Catalog/Model/Index.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Indexer/Url.php b/app/code/core/Mage/Catalog/Model/Indexer/Url.php index 36406301ebd0a09b77cc0dd7cf722f8935a157c5..fc0a8632cbadbb684a7c318e5201ec471d353ca7 100644 --- a/app/code/core/Mage/Catalog/Model/Indexer/Url.php +++ b/app/code/core/Mage/Catalog/Model/Indexer/Url.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Layer.php b/app/code/core/Mage/Catalog/Model/Layer.php index 1e1ae32fedda05d48afe3003d067d75f3cd739bd..fae1238644799d0078fff644d6852566066aa254 100644 --- a/app/code/core/Mage/Catalog/Model/Layer.php +++ b/app/code/core/Mage/Catalog/Model/Layer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Layer/Filter/Abstract.php b/app/code/core/Mage/Catalog/Model/Layer/Filter/Abstract.php index 79e6739b6fbc6281e912786db0e96d1a78ef11f7..952779a3dc2bf4ab34ce59f0856347c4c383a11c 100644 --- a/app/code/core/Mage/Catalog/Model/Layer/Filter/Abstract.php +++ b/app/code/core/Mage/Catalog/Model/Layer/Filter/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -300,4 +300,14 @@ abstract class Mage_Catalog_Model_Layer_Filter_Abstract extends Varien_Object { return $this->setData('website_id', $websiteId); } + + /** + * Clear current element link text, for example 'Clear Price' + * + * @return false|string + */ + public function getClearLinkText() + { + return false; + } } diff --git a/app/code/core/Mage/Catalog/Model/Layer/Filter/Attribute.php b/app/code/core/Mage/Catalog/Model/Layer/Filter/Attribute.php index 199cf14b76d3bde292e06e5d8f48d54727745cde..4c92b0a8a85b04a66af281a20e4220844d954385 100644 --- a/app/code/core/Mage/Catalog/Model/Layer/Filter/Attribute.php +++ b/app/code/core/Mage/Catalog/Model/Layer/Filter/Attribute.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -69,7 +69,7 @@ class Mage_Catalog_Model_Layer_Filter_Attribute extends Mage_Catalog_Model_Layer * Get option text from frontend model by option id * * @param int $optionId - * @return unknown + * @return string|bool */ protected function _getOptionText($optionId) { @@ -90,7 +90,7 @@ class Mage_Catalog_Model_Layer_Filter_Attribute extends Mage_Catalog_Model_Layer return $this; } $text = $this->_getOptionText($filter); - if ($filter && $text) { + if ($filter && strlen($text)) { $this->_getResource()->applyFilterToCollection($this, $filter); $this->getLayer()->getState()->addFilter($this->_createItem($text, $filter)); $this->_items = array(); diff --git a/app/code/core/Mage/Catalog/Model/Layer/Filter/Category.php b/app/code/core/Mage/Catalog/Model/Layer/Filter/Category.php index 5f50435fa596bd27a92c44ce69519a4fcfc0651b..4f031ee71dda087958c9bf136e077343b31a6e46 100644 --- a/app/code/core/Mage/Catalog/Model/Layer/Filter/Category.php +++ b/app/code/core/Mage/Catalog/Model/Layer/Filter/Category.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Layer/Filter/Decimal.php b/app/code/core/Mage/Catalog/Model/Layer/Filter/Decimal.php index 8cad0330dcc3dc96037d47f80132c56b6fa98361..289733df0ca43649134dee51ad9a5b355de1caee 100644 --- a/app/code/core/Mage/Catalog/Model/Layer/Filter/Decimal.php +++ b/app/code/core/Mage/Catalog/Model/Layer/Filter/Decimal.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Layer/Filter/Item.php b/app/code/core/Mage/Catalog/Model/Layer/Filter/Item.php index 5186d283dbc512980bba7668895ae751262662b8..f5c7fca79d0ef1139153959b68437d48046b124e 100644 --- a/app/code/core/Mage/Catalog/Model/Layer/Filter/Item.php +++ b/app/code/core/Mage/Catalog/Model/Layer/Filter/Item.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -78,6 +78,27 @@ class Mage_Catalog_Model_Layer_Filter_Item extends Varien_Object return Mage::getUrl('*/*/*', $params); } + /** + * Get url for "clear" link + * + * @return false|string + */ + public function getClearLinkUrl() + { + $clearLinkText = $this->getFilter()->getClearLinkText(); + if (!$clearLinkText) { + return false; + } + + $urlParams = array( + '_current' => true, + '_use_rewrite' => true, + '_query' => array($this->getFilter()->getRequestVar() => null), + '_escape' => true, + ); + return Mage::getUrl('*/*/*', $urlParams); + } + /** * Get item filter name * diff --git a/app/code/core/Mage/Catalog/Model/Layer/Filter/Price.php b/app/code/core/Mage/Catalog/Model/Layer/Filter/Price.php index d09fac9945bef6b1ccc2ab38fe16bfe62c8f297e..14f119f7ccd6d39f7236f8dd01ab3eb815a5953a 100644 --- a/app/code/core/Mage/Catalog/Model/Layer/Filter/Price.php +++ b/app/code/core/Mage/Catalog/Model/Layer/Filter/Price.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -40,6 +40,9 @@ class Mage_Catalog_Model_Layer_Filter_Price extends Mage_Catalog_Model_Layer_Fil { const XML_PATH_RANGE_CALCULATION = 'catalog/layered_navigation/price_range_calculation'; const XML_PATH_RANGE_STEP = 'catalog/layered_navigation/price_range_step'; + const XML_PATH_RANGE_MAX_INTERVALS = 'catalog/layered_navigation/price_range_max_intervals'; + const XML_PATH_ONE_PRICE_INTERVAL = 'catalog/layered_navigation/one_price_interval'; + const XML_PATH_INTERVAL_DIVISION_LIMIT = 'catalog/layered_navigation/interval_division_limit'; const RANGE_CALCULATION_AUTO = 'auto'; const RANGE_CALCULATION_MANUAL = 'manual'; @@ -107,10 +110,6 @@ class Mage_Catalog_Model_Layer_Filter_Price extends Mage_Catalog_Model_Layer_Fil } } - while (ceil($maxPrice / $range) > 25) { - $range *= 10; - } - $this->setData('price_range', $range); } @@ -146,6 +145,19 @@ class Mage_Catalog_Model_Layer_Filter_Price extends Mage_Catalog_Model_Layer_Fil $items = $this->getData($rangeKey); if (is_null($items)) { $items = $this->_getResource()->getCount($this, $range); + // checking max number of intervals + $i = 0; + $lastIndex = null; + $maxIntervalsNumber = $this->getMaxIntervalsNumber(); + foreach ($items as $k => $v) { + ++$i; + if ($i > 1 && $i > $maxIntervalsNumber) { + $items[$lastIndex] += $v; + unset($items[$k]); + } else { + $lastIndex = $k; + } + } $this->setData($rangeKey, $items); } @@ -182,34 +194,57 @@ class Mage_Catalog_Model_Layer_Filter_Price extends Mage_Catalog_Model_Layer_Fil $formattedFromPrice = $store->formatPrice($fromPrice); if (empty($toPrice)) { return Mage::helper('Mage_Catalog_Helper_Data')->__('%s and above', $formattedFromPrice); - } elseif ($fromPrice == $toPrice) { + } elseif ($fromPrice == $toPrice && Mage::app()->getStore()->getConfig(self::XML_PATH_ONE_PRICE_INTERVAL)) { return $formattedFromPrice; } else { - return Mage::helper('Mage_Catalog_Helper_Data')->__('%s - %s', $formattedFromPrice, $store->formatPrice($toPrice - .01)); + if ($fromPrice != $toPrice) { + $toPrice -= .01; + } + return Mage::helper('Mage_Catalog_Helper_Data')->__('%s - %s', $formattedFromPrice, $store->formatPrice($toPrice)); } } /** - * Get data generated by algorithm for build price filter items + * Get additional request param data * - * @return array + * @return string */ - protected function _getCalculatedItemsData() + protected function _getAdditionalRequestData() { + $result = ''; $appliedInterval = $this->getInterval(); if ($appliedInterval) { - return array(); + $result = ',' . $appliedInterval[0] . '-' . $appliedInterval[1]; + $priorIntervals = $this->getResetValue(); + if ($priorIntervals) { + $result .= ',' . $priorIntervals; + } } + return $result; + } + + /** + * Get data generated by algorithm for build price filter items + * + * @return array + */ + protected function _getCalculatedItemsData() + { /** @var $algorithmModel Mage_Catalog_Model_Layer_Filter_Price_Algorithm */ $algorithmModel = Mage::getSingleton('Mage_Catalog_Model_Layer_Filter_Price_Algorithm'); + $appliedInterval = $this->getInterval(); + if ($appliedInterval) { + $algorithmModel->setLimits($appliedInterval[0], $appliedInterval[1]); + } $this->_getResource()->loadAllPrices($algorithmModel, $this); $items = array(); foreach ($algorithmModel->calculateSeparators() as $separator) { $items[] = array( 'label' => $this->_renderRangeLabel($separator['from'], $separator['to']), - 'value' => (($separator['from'] == 0) ? '' : $separator['from']) . '-' . $separator['to'], + 'value' => (($separator['from'] == 0) ? '' : $separator['from']) + . '-' . $separator['to'] . $this->_getAdditionalRequestData(), 'count' => $separator['count'], ); } @@ -226,6 +261,8 @@ class Mage_Catalog_Model_Layer_Filter_Price extends Mage_Catalog_Model_Layer_Fil { if (Mage::app()->getStore()->getConfig(self::XML_PATH_RANGE_CALCULATION) == self::RANGE_CALCULATION_AUTO) { return $this->_getCalculatedItemsData(); + } elseif ($this->getInterval()) { + return array(); } $range = $this->getPriceRange(); @@ -262,6 +299,27 @@ class Mage_Catalog_Model_Layer_Filter_Price extends Mage_Catalog_Model_Layer_Fil return $this; } + /** + * Validate and parse filter request param + * + * @param string $filter + * @return array|bool + */ + protected function _validateFilter($filter) + { + $filter = explode('-', $filter); + if (count($filter) != 2) { + return false; + } + foreach ($filter as $v) { + if ($v !== '' && (float)$v <= 0) { + return false; + } + } + + return $filter; + } + /** * Apply price range filter * @@ -281,20 +339,31 @@ class Mage_Catalog_Model_Layer_Filter_Price extends Mage_Catalog_Model_Layer_Fil } //validate filter - $filter = explode('-', $filter); - if (count($filter) != 2) { + $filterParams = explode(',', $filter); + $filter = $this->_validateFilter($filterParams[0]); + if (!$filter) { return $this; } - foreach ($filter as $v) { - if ($v !== '' && (float)$v <= 0) { - return $this; - } - } list($from, $to) = $filter; $this->setInterval(array($from, $to)); + $priorFilters = array(); + for ($i = 1; $i < count($filterParams); ++$i) { + $priorFilter = $this->_validateFilter($filterParams[$i]); + if ($priorFilter) { + $priorFilters[] = $priorFilter; + } else { + //not valid data + $priorFilters = array(); + break; + } + } + if ($priorFilters) { + $this->setPriorIntervals($priorFilters); + } + $this->_applyPriceRange(); $this->getLayer()->getState()->addFilter($this->_createItem( $this->_renderRangeLabel(empty($from) ? 0 : $from, $to), @@ -370,4 +439,56 @@ class Mage_Catalog_Model_Layer_Filter_Price extends Mage_Catalog_Model_Layer_Fil { return $this->setData('currency_rate', $rate); } + + /** + * Get maximum number of intervals + * + * @return int + */ + public function getMaxIntervalsNumber() + { + return (int)Mage::app()->getStore()->getConfig(self::XML_PATH_RANGE_MAX_INTERVALS); + } + + /** + * Get interval division limit + * + * @return int + */ + public function getIntervalDivisionLimit() + { + return (int)Mage::app()->getStore()->getConfig(self::XML_PATH_INTERVAL_DIVISION_LIMIT); + } + + /** + * Get filter value for reset current filter state + * + * @return null|string + */ + public function getResetValue() + { + $priorIntervals = $this->getPriorIntervals(); + $value = array(); + if ($priorIntervals) { + foreach ($priorIntervals as $priorInterval) { + $value[] = implode('-', $priorInterval); + } + return implode(',', $value); + } + return parent::getResetValue(); + } + + /** + * Get 'clear price' link text + * + * @return false|string + */ + public function getClearLinkText() + { + if (Mage::app()->getStore()->getConfig(self::XML_PATH_RANGE_CALCULATION) == self::RANGE_CALCULATION_AUTO) { + return Mage::helper('Mage_Catalog_Helper_Data')->__('Clear Price'); + } + + return parent::getClearLinkText(); + } } diff --git a/app/code/core/Mage/Catalog/Model/Layer/Filter/Price/Algorithm.php b/app/code/core/Mage/Catalog/Model/Layer/Filter/Price/Algorithm.php index 57c79a0187bfe960b67bf5dcbbef7b3a9442b204..8d2a8afe8cc2f6dce29086c9c0f7012d94bfab85 100644 --- a/app/code/core/Mage/Catalog/Model/Layer/Filter/Price/Algorithm.php +++ b/app/code/core/Mage/Catalog/Model/Layer/Filter/Price/Algorithm.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -35,6 +35,7 @@ class Mage_Catalog_Model_Layer_Filter_Price_Algorithm { const MIN_POSSIBLE_PRICE = .01; const TEN_POWER_ROUNDING_FACTOR = 4; + const INTERVAL_DEFLECTION_LIMIT = .3; /** * Sorted array of all products prices @@ -58,39 +59,134 @@ class Mage_Catalog_Model_Layer_Filter_Price_Algorithm protected $_skippedQuantilesUpperLimits = array(); /** - * Set products prices + * Upper prices limit + * + * @var null|float + */ + protected $_upperLimit = null; + + /** + * Lower prices limit + * + * @var null|float + */ + protected $_lowerLimit = null; + + /** + * Search index of price, that satisfy conditions to be less or greater-or-equal than $value + * Returns -1 if index was not found + * + * @param float $value + * @param null|array $limits search [from, to] + * @param bool $isLess (to be less or greater-or-equal) + * @return int + */ + protected function _binarySearch($value, $limits = null, $isLess = true) + { + if (empty($this->_prices)) { + return -1; + } + + if (!is_array($limits)) { + $limits = array(); + } + if (!isset($limits[0])) { + $limits[0] = 0; + } + if (!isset($limits[1])) { + $limits[1] = count($this->_prices) - 1; + } + + if ($limits[0] > $limits[1] + || ($isLess && $this->_prices[$limits[1]] < $value) + || (!$isLess && $this->_prices[$limits[0]] >= $value) + ) { + return -1; + } + + if ($limits[1] - $limits[0] <= 1) { + if ($isLess) { + return ($this->_prices[$limits[0]] < $value) ? $limits[1] : $limits[0]; + } else { + return ($this->_prices[$limits[1]] >= $value) ? $limits[0] : $limits[1]; + } + } + + $separator = floor(($limits[0] + $limits[1]) / 2); + if ($isLess) { + if ($this->_prices[$separator] < $value) { + $limits[0] = $separator + 1; + } else { + $limits[1] = $separator; + } + } else { + if ($this->_prices[$separator] >= $value) { + $limits[1] = $separator - 1; + } else { + $limits[0] = $separator; + } + } + + return $this->_binarySearch($value, array($limits[0], $limits[1]), $isLess); + } + + /** + * Check prices to be in limits interval * - * @param array $prices * @return Mage_Catalog_Model_Layer_Filter_Price_Algorithm */ - public function setPrices(array $prices) + protected function _checkPrices() { - $this->_prices = $prices; - sort($this->_prices); - $this->_intervalsNumber = null; - $this->_skippedQuantilesUpperLimits = array(); + if (is_null($this->_prices)) { + return $this; + } + if (!is_null($this->_upperLimit) || !is_null($this->_lowerLimit)) { + $right = is_null($this->_upperLimit) + ? (count($this->_prices) - 1) + : $this->_binarySearch($this->_upperLimit, null, false); + $left = is_null($this->_lowerLimit) + ? 0 + : $this->_binarySearch($this->_lowerLimit, array(0, $right)); + if ($left > $right) { + $this->_prices = array(); + } else { + $this->_prices = array_slice($this->_prices, $left, $right - $left + 1); + } + } return $this; } /** - * Get min price + * Set lower and upper limit for algorithm * - * @return float + * @param null|float $lowerLimit + * @param null|float $upperLimit + * @return Mage_Catalog_Model_Layer_Filter_Price_Algorithm */ - public function getMinPrice() + public function setLimits($lowerLimit = null, $upperLimit = null) { - return empty($this->_prices) ? 0 : $this->_prices[0]; + $this->_lowerLimit = empty($lowerLimit) ? null : (float)$lowerLimit; + $this->_upperLimit = empty($upperLimit) ? null : (float)$upperLimit; + $this->_checkPrices(); + return $this; } /** - * Get max price + * Set products prices * - * @return float + * @param array $prices due to performance issue prices should be sorted (by DBMS engine) + * @return Mage_Catalog_Model_Layer_Filter_Price_Algorithm */ - public function getMaxPrice() + public function setPrices(array $prices) { - return (empty($this->_prices)) ? 0 : $this->_prices[count($this->_prices) - 1]; + $this->_prices = $prices; + + $this->_checkPrices(); + $this->_intervalsNumber = null; + $this->_skippedQuantilesUpperLimits = array(); + + return $this; } /** @@ -105,7 +201,8 @@ class Mage_Catalog_Model_Layer_Filter_Price_Algorithm } $pricesCount = count($this->_prices); - if ($pricesCount < 2 || ($this->getMaxPrice() - $this->getMinPrice() == 0)) { + $priceRange = empty($this->_prices) ? 0 : ($this->_prices[count($this->_prices) - 1] - $this->_prices[0]); + if ($pricesCount < 2 || ($priceRange == 0)) { //Same price couldn't be separated with several intervals $this->_intervalsNumber = 1; return $this->_intervalsNumber; @@ -118,10 +215,10 @@ class Mage_Catalog_Model_Layer_Filter_Price_Algorithm $sumSquares += $price * $price; } - if ($pricesCount * $sumSquares - $sum * $sum == 0) { + if ($pricesCount * $sumSquares - $sum * $sum <= 0) { $intervalsNumber = 1000; } else { - $intervalsNumber = ($this->getMaxPrice() - $this->getMinPrice()) * pow($pricesCount, 5 / 6) + $intervalsNumber = $priceRange * pow($pricesCount, 5 / 6) * sqrt(($pricesCount - 1) / ($pricesCount * $sumSquares - $sum * $sum)) / 3.5; } $this->_intervalsNumber = min(max(ceil($intervalsNumber), 2), 10); @@ -129,6 +226,16 @@ class Mage_Catalog_Model_Layer_Filter_Price_Algorithm return $this->_intervalsNumber; } + /** + * Get intervals number with checking skipped quantiles + * + * @return int + */ + protected function _getCalculatedIntervalsNumber() + { + return max(1, $this->getIntervalsNumber() - count($this->_skippedQuantilesUpperLimits)); + } + /** * Get quantile * @@ -210,19 +317,16 @@ class Mage_Catalog_Model_Layer_Filter_Price_Algorithm // round is used for such examples: (1194.32 / 0.02) or (5 / 100000) $lowerDivision = ceil(round($lowerPrice / $roundingFactor, self::TEN_POWER_ROUNDING_FACTOR + 3)); $upperDivision = floor(round($upperPrice / $roundingFactor, self::TEN_POWER_ROUNDING_FACTOR + 3)); - if ($lowerDivision > $upperDivision) { - return false; - } - $averageDivision = ($lowerDivision + $upperDivision) / 2; - $lowerAverageDivision = floor($averageDivision); - $result = array(round($lowerAverageDivision * $roundingFactor, 2)); - if ($averageDivision != $lowerAverageDivision) { - $upperAverageDivision = ceil($averageDivision); - $result[] = round($upperAverageDivision * $roundingFactor, 2); + + $result = array(); + for ($i = $lowerDivision; $i <= $upperDivision; ++$i) { + $result[] = round($i * $roundingFactor, 2); } + return $result; } + $result = array(); $tenPower = pow(10, self::TEN_POWER_ROUNDING_FACTOR); $roundingFactorCoefficients = array(10, 5, 2); while ($tenPower >= self::MIN_POSSIBLE_PRICE) { @@ -235,13 +339,34 @@ class Mage_Catalog_Model_Layer_Filter_Price_Algorithm $lowerPrice, $upperPrice, $returnEmpty, $roundingFactorCoefficient ); if ($roundPrices) { - return array($roundingFactorCoefficient, $roundPrices); + $result[round($roundingFactorCoefficient / self::MIN_POSSIBLE_PRICE)] = $roundPrices; } } $tenPower /= 10; } - return array(self::MIN_POSSIBLE_PRICE, array()); + return empty($result) ? array(1 => array()) : $result; + } + + /** + * Merge new round prices with old ones + * + * @param array $oldRoundPrices + * @param array $newRoundPrices + * @return void + */ + protected function _mergeRoundPrices(&$oldRoundPrices, &$newRoundPrices) + { + foreach ($newRoundPrices as $roundingFactor => $roundPriceValues) { + if (array_key_exists($roundingFactor, $oldRoundPrices)) { + $oldRoundPrices[$roundingFactor] = array_unique(array_merge( + $oldRoundPrices[$roundingFactor], + $roundPriceValues + )); + } else { + $oldRoundPrices[$roundingFactor] = $roundPriceValues; + } + } } /** @@ -255,76 +380,44 @@ class Mage_Catalog_Model_Layer_Filter_Price_Algorithm if ($quantileNumber < 1 || $quantileNumber >= $this->getIntervalsNumber()) { return null; } - $quantile = $this->_getQuantile($quantileNumber); - $lowerQuantile = floor($quantile); - $upperQuantile = ceil($quantile); $quantileInterval = $this->_getQuantileInterval($quantileNumber); - $quantileDeflection = 0; - $maxRoundingFactor = self::MIN_POSSIBLE_PRICE; $bestRoundPrice = array(); if ($this->_prices[$quantileInterval[0]] == $this->_prices[$quantileInterval[1]]) { if ($quantileNumber == 1) { - $i = $quantileInterval[0]; - while ($i >= 0 && ($this->_prices[$i] == $this->_prices[$quantileInterval[1]])) { - --$i; - } - if ($i >= 0) { - list($roundingFactor, $bestRoundPrice) = $this->_findRoundPrice( - $this->_prices[$i] + self::MIN_POSSIBLE_PRICE / 10, + $index = $this->_binarySearch( + $this->_prices[$quantileInterval[1]], + array(0, $quantileInterval[0]), + false + ); + if ($index != -1) { + $bestRoundPrice = $this->_findRoundPrice( + $this->_prices[$index] + self::MIN_POSSIBLE_PRICE / 10, $this->_prices[$quantileInterval[1]], false ); } } if ($quantileNumber == $this->getIntervalsNumber() - 1) { - $pricesCount = count($this->_prices); - $i = $quantileInterval[1]; - while ($i < $pricesCount && ($this->_prices[$quantileInterval[0]] == $this->_prices[$i])) { - ++$i; - } - if ($i < $pricesCount) { - list($upperRoundingFactor, $upperBestRoundPrice) = $this->_findRoundPrice( + $index = $this->_binarySearch( + $this->_prices[$quantileInterval[0]] + self::MIN_POSSIBLE_PRICE / 10, + array($quantileInterval[1]) + ); + if ($index != -1) { + $upperBestRoundPrice = $this->_findRoundPrice( $this->_prices[$quantileInterval[0]] + self::MIN_POSSIBLE_PRICE / 10, - $this->_prices[$i], + $this->_prices[$index], false ); - if (!empty($bestRoundPrice)) { - if ($upperRoundingFactor >= $roundingFactor) { - if ($upperRoundingFactor > $roundingFactor) { - $bestRoundPrice = $upperBestRoundPrice; - } else { - $bestRoundPrice = array_merge($bestRoundPrice, $upperBestRoundPrice); - } - } - } else { - $bestRoundPrice = $upperBestRoundPrice; - } + $this->_mergeRoundPrices($bestRoundPrice, $upperBestRoundPrice); } } } else { - while ($lowerQuantile - $quantileDeflection >= $quantileInterval[0] - || $upperQuantile + $quantileDeflection <= $quantileInterval[1] - ) { - $leftIndex = max($quantileInterval[0], $lowerQuantile - $quantileDeflection); - $rightIndex = min($quantileInterval[1], $upperQuantile + $quantileDeflection); - - list($roundingFactor, $roundPrice) = $this->_findRoundPrice( - $this->_prices[$leftIndex] + self::MIN_POSSIBLE_PRICE / 10, - $this->_prices[$rightIndex] - ); - - if ($roundingFactor >= $maxRoundingFactor) { - if ($roundingFactor == $maxRoundingFactor) { - $bestRoundPrice = array_unique(array_merge($bestRoundPrice, $roundPrice)); - } else { - $bestRoundPrice = $roundPrice; - $maxRoundingFactor = $roundingFactor; - } - } - ++$quantileDeflection; - } + $bestRoundPrice = $this->_findRoundPrice( + $this->_prices[$quantileInterval[0]] + self::MIN_POSSIBLE_PRICE / 10, + $this->_prices[$quantileInterval[1]] + ); } if (empty($bestRoundPrice)) { @@ -332,8 +425,46 @@ class Mage_Catalog_Model_Layer_Filter_Price_Algorithm return $bestRoundPrice; } - sort($bestRoundPrice); - return $bestRoundPrice; + ksort($bestRoundPrice, SORT_NUMERIC); + foreach ($bestRoundPrice as $index => &$bestRoundPriceValues) { + if (empty($bestRoundPriceValues)) { + unset($bestRoundPrice[$index]); + } else { + sort($bestRoundPriceValues); + } + } + return array_reverse($bestRoundPrice); + } + + /** + * Get separator nearest to quantile among the separators + * + * @param int $quantileNumber + * @param array $separators + * @param int $priceIndex + * @return bool|array [separatorPrice, pricesCount] + */ + protected function _findBestSeparator($quantileNumber, $separators, $priceIndex) + { + $result = false; + + $i = $priceIndex; + $pricesCount = count($this->_prices); + while ($i < $pricesCount && !empty($separators)) { + $i = $this->_binarySearch($separators[0], array($i)); + if ($i == -1) { + break; + } + + $separator = array_shift($separators); + + $deflection = abs(($quantileNumber + 1) * $pricesCount - $i * $this->_getCalculatedIntervalsNumber()); + if (!$result || $deflection < $result[0]) { + $result = array($deflection, $separator, $i - $priceIndex); + } + } + + return $result ? $result : false; } /** @@ -343,6 +474,7 @@ class Mage_Catalog_Model_Layer_Filter_Price_Algorithm */ public function calculateSeparators() { + $this->_checkPrices(); $separators = array(); for ($i = 1; $i < $this->getIntervalsNumber(); ++$i) { $separators[] = $this->_findPriceSeparator($i); @@ -351,8 +483,9 @@ class Mage_Catalog_Model_Layer_Filter_Price_Algorithm $i = 0; $result = array(); - $lastSeparator = 0; + $lastSeparator = is_null($this->_lowerLimit) ? 0 : $this->_lowerLimit; $quantile = 0; + $pricesPerInterval = $pricesCount / $this->_getCalculatedIntervalsNumber(); while (!empty($separators) && ($i < $pricesCount)) { while (!empty($separators) && empty($separators[0])) { array_shift($separators); @@ -360,59 +493,49 @@ class Mage_Catalog_Model_Layer_Filter_Price_Algorithm if (empty($separators)) { break; } - if ($this->_prices[$i] < $separators[0][0]) { - ++$i; - } else { - $separator = array_shift($separators[0]); - $separatorData = array( - 'from' => $lastSeparator, - 'to' => $separator, - 'count' => $i, - ); - - $deflection = abs(($quantile + 1) / $this->getIntervalsNumber() - $i / $pricesCount); - if (!array_key_exists($quantile, $result)) { - $result[$quantile] = array($deflection, $separatorData); - } elseif ($deflection < $result[$quantile][0]) { - $result[$quantile] = array($deflection, $separatorData); - } - if (empty($separators[0])) { - array_shift($separators); - if (!array_key_exists($quantile - 1, $result) - || $result[$quantile - 1][1]['count'] < $result[$quantile][1]['count'] - ) { - $lastSeparator = $result[$quantile][1]['to']; + $separatorCandidate = false; + $newLastSeparator = $lastSeparator; + while (!empty($separators[0]) && !array_key_exists($quantile, $result)) { + $separatorsPortion = array_shift($separators[0]); + $bestSeparator = $this->_findBestSeparator($quantile, $separatorsPortion, $i); + if ($bestSeparator && $bestSeparator[2] > 0) { + $isEqualPrice = ($this->_prices[$i] == $this->_prices[$i + $bestSeparator[2] - 1]) + ? $this->_prices[$i] + : false; + $separatorData = array( + 'from' => ($isEqualPrice !== false) ? $isEqualPrice : $lastSeparator, + 'to' => ($isEqualPrice !== false) ? $isEqualPrice : $bestSeparator[1], + 'count' => $bestSeparator[2], + ); + if (abs(1 - $bestSeparator[2] / $pricesPerInterval) <= self::INTERVAL_DEFLECTION_LIMIT) { + $newLastSeparator = $bestSeparator[1]; + $result[$quantile] = $separatorData; + } elseif (!$separatorCandidate || $bestSeparator[0] < $separatorCandidate[0]) { + $separatorCandidate = array($bestSeparator[0], $separatorData, $bestSeparator[1]); } - ++$quantile; } } - } - if ($i < $pricesCount || empty($result)) { - $result[$quantile] = array(0, array( - 'from' => $lastSeparator, - 'to' => '', - 'count' => $pricesCount, - )); - } - for ($i = count($result) - 1; $i >= 0; --$i) { - $rangeCount = ($i == 0) ? $result[$i][1]['count'] : ($result[$i][1]['count'] - $result[$i-1][1]['count']); - if ($rangeCount > 0) { - $result[$i] = $result[$i][1]; - $firstPriceInRange = $this->_prices[$result[$i]['count'] - $rangeCount]; - if ($this->_prices[$result[$i]['count'] - 1] == $firstPriceInRange) { - $result[$i]['from'] = $firstPriceInRange; - $result[$i]['to'] = $firstPriceInRange; - } - $result[$i]['from'] = round($result[$i]['from'], 2); - if (!empty($result[$i]['to'])) { - $result[$i]['to'] = round($result[$i]['to'], 2); - } - $result[$i]['count'] = $rangeCount; - } else { - unset($result[$i]); + if (!array_key_exists($quantile, $result) && $separatorCandidate) { + $newLastSeparator = $separatorCandidate[2]; + $result[$quantile] = $separatorCandidate[1]; } + + if (array_key_exists($quantile, $result)) { + $lastSeparator = $newLastSeparator; + $i = $this->_binarySearch($lastSeparator, array($i)); + array_shift($separators); + } + ++$quantile; + } + if ($i < $pricesCount) { + $isEqualPrice = ($this->_prices[$i] == $this->_prices[$pricesCount - 1]) ? $this->_prices[$i] : false; + $result[$quantile] = array( + 'from' => $isEqualPrice ? $isEqualPrice : $lastSeparator, + 'to' => $isEqualPrice ? $isEqualPrice : (is_null($this->_upperLimit) ? '' : $this->_upperLimit), + 'count' => $pricesCount - $i, + ); } return array_values($result); diff --git a/app/code/core/Mage/Catalog/Model/Layer/State.php b/app/code/core/Mage/Catalog/Model/Layer/State.php index 90b71dfdae51651d621e852fe00aad3a182914ce..2f2a0630ae9837bdc42ff5b482a349ec74790043 100644 --- a/app/code/core/Mage/Catalog/Model/Layer/State.php +++ b/app/code/core/Mage/Catalog/Model/Layer/State.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Observer.php b/app/code/core/Mage/Catalog/Model/Observer.php index 53dd9ff1c0efbf9c0145ba4d42cbf0a8a9b607b3..f05222203689a56a8f9f734adc172dffdd2eb9c5 100644 --- a/app/code/core/Mage/Catalog/Model/Observer.php +++ b/app/code/core/Mage/Catalog/Model/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product.php b/app/code/core/Mage/Catalog/Model/Product.php index 793a99d1ff330cce1d86248cba07619eb4cb18e5..0e533dfd2281125e3d58eff00ea945d855873eaf 100644 --- a/app/code/core/Mage/Catalog/Model/Product.php +++ b/app/code/core/Mage/Catalog/Model/Product.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -601,6 +601,16 @@ class Mage_Catalog_Model_Product extends Mage_Catalog_Model_Abstract return Mage::getSingleton('Mage_Catalog_Model_Product_Type')->priceFactory($this->getTypeId()); } + /** + * Get product group price + * + * @return float + */ + public function getGroupPrice() + { + return $this->getPriceModel()->getGroupPrice($this); + } + /** * Get product tier price by qty * @@ -1025,6 +1035,7 @@ class Mage_Catalog_Model_Product extends Mage_Catalog_Model_Abstract $this->getWebsiteIds(); $this->getCategoryIds(); + /* @var $newProduct Mage_Catalog_Model_Product */ $newProduct = Mage::getModel('Mage_Catalog_Model_Product')->setData($this->getData()) ->setIsDuplicate(true) ->setOriginalId($this->getId()) @@ -1040,16 +1051,6 @@ class Mage_Catalog_Model_Product extends Mage_Catalog_Model_Abstract array('current_product' => $this, 'new_product' => $newProduct) ); - /* @var $newProduct Mage_Catalog_Model_Product */ - - $newOptionsArray = array(); - $newProduct->setCanSaveCustomOptions(true); - foreach ($this->getOptions() as $_option) { - /* @var $_option Mage_Catalog_Model_Product_Option */ - $newOptionsArray[] = $_option->prepareOptionForDuplicate(); - } - $newProduct->setProductOptions($newOptionsArray); - /* Prepare Related*/ $data = array(); $this->getLinkInstance()->useRelatedLinks(); @@ -1800,6 +1801,7 @@ class Mage_Catalog_Model_Product extends Mage_Catalog_Model_Abstract */ public function reset() { + $this->unlockAttributes(); $this->_clearData(); return $this; } diff --git a/app/code/core/Mage/Catalog/Model/Product/Action.php b/app/code/core/Mage/Catalog/Model/Product/Action.php index 3cbd1b198df4024c31567df9eba7e4fa55774c3c..49e38dcf60965582400ab6704870d6d4cce681aa 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Action.php +++ b/app/code/core/Mage/Catalog/Model/Product/Action.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Api.php b/app/code/core/Mage/Catalog/Model/Product/Api.php index 560c4cbbfb36127e49530806e323681bb4988a20..e42af757c16c84e5f5816abb0d10689143f29b67 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Api.php +++ b/app/code/core/Mage/Catalog/Model/Product/Api.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -182,6 +182,11 @@ class Mage_Catalog_Model_Product_Api extends Mage_Catalog_Model_Api_Resource ->setTypeId($type) ->setSku($sku); + if (!isset($productData['stock_data']) || !is_array($productData['stock_data'])) { + //Set default stock_data if not exist in product data + $product->setStockData(array('use_config_manage_stock' => 0)); + } + $this->_prepareDataForSave($product, $productData); try { @@ -262,6 +267,14 @@ class Mage_Catalog_Model_Product_Api extends Mage_Catalog_Model_Api_Resource } foreach ($product->getTypeInstance()->getEditableAttributes($product) as $attribute) { + //Unset data if object attribute has no value in current store + if (Mage_Catalog_Model_Abstract::DEFAULT_STORE_ID !== $product->getStoreId() + && !$product->getExistsStoreValueFlag($attribute->getAttributeCode()) + && !$attribute->isScopeGlobal() + ) { + $product->setData($attribute->getAttributeCode(), false); + } + if ($this->_isAllowedAttribute($attribute)) { if (isset($productData[$attribute->getAttributeCode()])) { $product->setData( @@ -303,8 +316,6 @@ class Mage_Catalog_Model_Product_Api extends Mage_Catalog_Model_Api_Resource if (isset($productData['stock_data']) && is_array($productData['stock_data'])) { $product->setStockData($productData['stock_data']); - } else { - $product->setStockData(array('use_config_manage_stock' => 0)); } if (isset($productData['tier_price']) && is_array($productData['tier_price'])) { @@ -441,4 +452,4 @@ class Mage_Catalog_Model_Product_Api extends Mage_Catalog_Model_Api_Resource $this->_fault('product_attribute_set_not_valid'); } } -} // Class Mage_Catalog_Model_Product_Api End +} // Class Mage_Catalog_Model_Product_Api End \ No newline at end of file diff --git a/app/code/core/Mage/Catalog/Model/Product/Api/V2.php b/app/code/core/Mage/Catalog/Model/Product/Api/V2.php index d4dd81d038712c0d1a307dc6f96513f1f28261b1..92f1bbf57ef38d976d4a246c4e00278363b48b2a 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Api/V2.php +++ b/app/code/core/Mage/Catalog/Model/Product/Api/V2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -176,6 +176,12 @@ class Mage_Catalog_Model_Product_Api_V2 extends Mage_Catalog_Model_Product_Api ->setTypeId($type) ->setSku($sku); + if (!property_exists($productData, 'stock_data')) { + //Set default stock_data if not exist in product data + $_stockData = array('use_config_manage_stock' => 0); + $product->setStockData($_stockData); + } + $this->_prepareDataForSave($product, $productData); try { @@ -273,9 +279,18 @@ class Mage_Catalog_Model_Product_Api_V2 extends Mage_Catalog_Model_Product_Api foreach ($product->getTypeInstance()->getEditableAttributes($product) as $attribute) { $_attrCode = $attribute->getAttributeCode(); + + //Unset data if object attribute has no value in current store + if (Mage_Catalog_Model_Abstract::DEFAULT_STORE_ID !== (int) $product->getStoreId() + && !$product->getExistsStoreValueFlag($_attrCode) + && !$attribute->isScopeGlobal() + ) { + $product->setData($_attrCode, false); + } + if ($this->_isAllowedAttribute($attribute) && (isset($productData->$_attrCode))) { $product->setData( - $attribute->getAttributeCode(), + $_attrCode, $productData->$_attrCode ); } @@ -305,10 +320,8 @@ class Mage_Catalog_Model_Product_Api_V2 extends Mage_Catalog_Model_Product_Api foreach ($productData->stock_data as $key => $value) { $_stockData[$key] = $value; } - } else { - $_stockData = array('use_config_manage_stock' => 0); + $product->setStockData($_stockData); } - $product->setStockData($_stockData); if (property_exists($productData, 'tier_price')) { $tierPrices = Mage::getModel('Mage_Catalog_Model_Product_Attribute_Tierprice_Api_V2') diff --git a/app/code/core/Mage/Catalog/Model/Product/Attribute/Api.php b/app/code/core/Mage/Catalog/Model/Product/Attribute/Api.php index 282afd419dfaffdeddf5176f3be90a2a15b1e93f..645e85549bfb3ebe5ccc53ea3432bfa368a46dab 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Attribute/Api.php +++ b/app/code/core/Mage/Catalog/Model/Product/Attribute/Api.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Attribute/Api/V2.php b/app/code/core/Mage/Catalog/Model/Product/Attribute/Api/V2.php index 2702ee9c02e01d831fe2a1fa2748e2507e317e40..b5f3ffa7c60a707ecc389725a147b78073a76552 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Attribute/Api/V2.php +++ b/app/code/core/Mage/Catalog/Model/Product/Attribute/Api/V2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Boolean.php b/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Boolean.php index 97657baac24bf2ea7d28704a055ada9dbc164494..dbd87d3ef9183f9949c7bebe3908b32592ce17be 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Boolean.php +++ b/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Boolean.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Groupprice.php b/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Groupprice.php new file mode 100644 index 0000000000000000000000000000000000000000..2e905bd9fdcf46c0d70382ee12e57c6e23832775 --- /dev/null +++ b/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Groupprice.php @@ -0,0 +1,57 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Catalog + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + + +/** + * Catalog product group price backend attribute model + * + * @category Mage + * @package Mage_Catalog + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Catalog_Model_Product_Attribute_Backend_Groupprice + extends Mage_Catalog_Model_Product_Attribute_Backend_Groupprice_Abstract +{ + /** + * Retrieve resource instance + * + * @return Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Attribute_Backend_Tierprice + */ + protected function _getResource() + { + return Mage::getResourceSingleton('Mage_Catalog_Model_Resource_Product_Attribute_Backend_Groupprice'); + } + + /** + * Error message when duplicates + * + * @return string + */ + protected function _getDuplicateErrorMessage() + { + return Mage::helper('Mage_Catalog_Helper_Data')->__('Duplicate website group price customer group.'); + } +} diff --git a/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Groupprice/Abstract.php b/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Groupprice/Abstract.php new file mode 100644 index 0000000000000000000000000000000000000000..13a7f95eda196000d836b7acef1745d34982d478 --- /dev/null +++ b/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Groupprice/Abstract.php @@ -0,0 +1,369 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Catalog + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + + +/** + * Catalog product abstract group price backend attribute model + * + * @category Mage + * @package Mage_Catalog + * @author Magento Core Team <core@magentocommerce.com> + */ +abstract class Mage_Catalog_Model_Product_Attribute_Backend_Groupprice_Abstract + extends Mage_Catalog_Model_Product_Attribute_Backend_Price +{ + /** + * Website currency codes and rates + * + * @var array + */ + protected $_rates; + + /** + * Error message when duplicates + * + * @abstract + * @return string + */ + abstract protected function _getDuplicateErrorMessage(); + + /** + * Retrieve websites currency rates and base currency codes + * + * @return array + */ + protected function _getWebsiteCurrencyRates() + { + if (is_null($this->_rates)) { + $this->_rates = array(); + $baseCurrency = Mage::app()->getBaseCurrencyCode(); + foreach (Mage::app()->getWebsites() as $website) { + /* @var $website Mage_Core_Model_Website */ + if ($website->getBaseCurrencyCode() != $baseCurrency) { + $rate = Mage::getModel('Mage_Directory_Model_Currency') + ->load($baseCurrency) + ->getRate($website->getBaseCurrencyCode()); + if (!$rate) { + $rate = 1; + } + $this->_rates[$website->getId()] = array( + 'code' => $website->getBaseCurrencyCode(), + 'rate' => $rate + ); + } else { + $this->_rates[$website->getId()] = array( + 'code' => $baseCurrency, + 'rate' => 1 + ); + } + } + } + return $this->_rates; + } + + /** + * Get additional unique fields + * + * @param array $objectArray + * @return array + */ + protected function _getAdditionalUniqueFields($objectArray) + { + return array(); + } + + /** + * Whether group price value fixed or percent of original price + * + * @param Mage_Catalog_Model_Product_Type_Price $priceObject + * @return bool + */ + protected function _isPriceFixed($priceObject) + { + return $priceObject->isGroupPriceFixed(); + } + + /** + * Validate group price data + * + * @param Mage_Catalog_Model_Product $object + * @throws Mage_Core_Exception + * @return bool + */ + public function validate($object) + { + $attribute = $this->getAttribute(); + $priceRows = $object->getData($attribute->getName()); + if (empty($priceRows)) { + return true; + } + + // validate per website + $duplicates = array(); + foreach ($priceRows as $priceRow) { + if (!empty($priceRow['delete'])) { + continue; + } + $compare = join('-', array_merge( + array($priceRow['website_id'], $priceRow['cust_group']), + $this->_getAdditionalUniqueFields($priceRow) + )); + if (isset($duplicates[$compare])) { + Mage::throwException($this->_getDuplicateErrorMessage()); + } + $duplicates[$compare] = true; + } + + // if attribute scope is website and edit in store view scope + // add global group prices for duplicates find + if (!$attribute->isScopeGlobal() && $object->getStoreId()) { + $origGroupPrices = $object->getOrigData($attribute->getName()); + foreach ($origGroupPrices as $price) { + if ($price['website_id'] == 0) { + $compare = join('-', array_merge( + array($price['website_id'], $price['cust_group']), + $this->_getAdditionalUniqueFields($price) + )); + $duplicates[$compare] = true; + } + } + } + + // validate currency + $baseCurrency = Mage::app()->getBaseCurrencyCode(); + $rates = $this->_getWebsiteCurrencyRates(); + foreach ($priceRows as $priceRow) { + if (!empty($priceRow['delete'])) { + continue; + } + if ($priceRow['website_id'] == 0) { + continue; + } + + $globalCompare = join('-', array_merge( + array(0, $priceRow['cust_group']), + $this->_getAdditionalUniqueFields($priceRow) + )); + $websiteCurrency = $rates[$priceRow['website_id']]['code']; + + if ($baseCurrency == $websiteCurrency && isset($duplicates[$globalCompare])) { + Mage::throwException($this->_getDuplicateErrorMessage()); + } + } + + return true; + } + + /** + * Prepare group prices data for website + * + * @param array $priceData + * @param string $productTypeId + * @param int $websiteId + * @return array + */ + public function preparePriceData(array $priceData, $productTypeId, $websiteId) + { + $rates = $this->_getWebsiteCurrencyRates(); + $data = array(); + $price = Mage::getSingleton('Mage_Catalog_Model_Product_Type')->priceFactory($productTypeId); + foreach ($priceData as $v) { + $key = join('-', array_merge(array($v['cust_group']), $this->_getAdditionalUniqueFields($v))); + if ($v['website_id'] == $websiteId) { + $data[$key] = $v; + $data[$key]['website_price'] = $v['price']; + } else if ($v['website_id'] == 0 && !isset($data[$key])) { + $data[$key] = $v; + $data[$key]['website_id'] = $websiteId; + if ($this->_isPriceFixed($price)) { + $data[$key]['price'] = $v['price'] * $rates[$websiteId]['rate']; + $data[$key]['website_price'] = $v['price'] * $rates[$websiteId]['rate']; + } + } + } + + return $data; + } + + /** + * Assign group prices to product data + * + * @param Mage_Catalog_Model_Product $object + * @return Mage_Catalog_Model_Product_Attribute_Backend_Groupprice_Abstract + */ + public function afterLoad($object) + { + $storeId = $object->getStoreId(); + $websiteId = null; + if ($this->getAttribute()->isScopeGlobal()) { + $websiteId = 0; + } else if ($storeId) { + $websiteId = Mage::app()->getStore($storeId)->getWebsiteId(); + } + + $data = $this->_getResource()->loadPriceData($object->getId(), $websiteId); + foreach ($data as $k => $v) { + $data[$k]['website_price'] = $v['price']; + if ($v['all_groups']) { + $data[$k]['cust_group'] = Mage_Customer_Model_Group::CUST_GROUP_ALL; + } + } + + if (!$object->getData('_edit_mode') && $websiteId) { + $data = $this->preparePriceData($data, $object->getTypeId(), $websiteId); + } + + $object->setData($this->getAttribute()->getName(), $data); + $object->setOrigData($this->getAttribute()->getName(), $data); + + $valueChangedKey = $this->getAttribute()->getName() . '_changed'; + $object->setOrigData($valueChangedKey, 0); + $object->setData($valueChangedKey, 0); + + return $this; + } + + /** + * After Save Attribute manipulation + * + * @param Mage_Catalog_Model_Product $object + * @return Mage_Catalog_Model_Product_Attribute_Backend_Groupprice_Abstract + */ + public function afterSave($object) + { + $websiteId = Mage::app()->getStore($object->getStoreId())->getWebsiteId(); + $isGlobal = $this->getAttribute()->isScopeGlobal() || $websiteId == 0; + + $priceRows = $object->getData($this->getAttribute()->getName()); + if (empty($priceRows)) { + if ($isGlobal) { + $this->_getResource()->deletePriceData($object->getId()); + } else { + $this->_getResource()->deletePriceData($object->getId(), $websiteId); + } + return $this; + } + + $old = array(); + $new = array(); + + // prepare original data for compare + $origGroupPrices = $object->getOrigData($this->getAttribute()->getName()); + if (!is_array($origGroupPrices)) { + $origGroupPrices = array(); + } + foreach ($origGroupPrices as $data) { + if ($data['website_id'] > 0 || ($data['website_id'] == '0' && $isGlobal)) { + $key = join('-', array_merge( + array($data['website_id'], $data['cust_group']), + $this->_getAdditionalUniqueFields($data) + )); + $old[$key] = $data; + } + } + + // prepare data for save + foreach ($priceRows as $data) { + $hasEmptyData = false; + foreach ($this->_getAdditionalUniqueFields($data) as $field) { + if (empty($field)) { + $hasEmptyData = true; + break; + } + } + + if ($hasEmptyData || !isset($data['cust_group']) || !empty($data['delete'])) { + continue; + } + if ($this->getAttribute()->isScopeGlobal() && $data['website_id'] > 0) { + continue; + } + if (!$isGlobal && (int)$data['website_id'] == 0) { + continue; + } + + $key = join('-', array_merge( + array($data['website_id'], $data['cust_group']), + $this->_getAdditionalUniqueFields($data) + )); + + $useForAllGroups = $data['cust_group'] == Mage_Customer_Model_Group::CUST_GROUP_ALL; + $customerGroupId = !$useForAllGroups ? $data['cust_group'] : 0; + + $new[$key] = array_merge(array( + 'website_id' => $data['website_id'], + 'all_groups' => $useForAllGroups ? 1 : 0, + 'customer_group_id' => $customerGroupId, + 'value' => $data['price'], + ), $this->_getAdditionalUniqueFields($data)); + } + + $delete = array_diff_key($old, $new); + $insert = array_diff_key($new, $old); + $update = array_intersect_key($new, $old); + + $isChanged = false; + $productId = $object->getId(); + + if (!empty($delete)) { + foreach ($delete as $data) { + $this->_getResource()->deletePriceData($productId, null, $data['price_id']); + $isChanged = true; + } + } + + if (!empty($insert)) { + foreach ($insert as $data) { + $price = new Varien_Object($data); + $price->setEntityId($productId); + $this->_getResource()->savePriceData($price); + + $isChanged = true; + } + } + + if (!empty($update)) { + foreach ($update as $k => $v) { + if ($old[$k]['price'] != $v['value']) { + $price = new Varien_Object(array( + 'value_id' => $old[$k]['price_id'], + 'value' => $v['value'] + )); + $this->_getResource()->savePriceData($price); + + $isChanged = true; + } + } + } + + if ($isChanged) { + $valueChangedKey = $this->getAttribute()->getName() . '_changed'; + $object->setData($valueChangedKey, 1); + } + + return $this; + } +} diff --git a/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Media.php b/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Media.php index 62f794efc4ca22d5000d48764fe8333f889b733e..b317be56439eb426a91641b46b2880e16b442b17 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Media.php +++ b/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Media.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -163,6 +163,8 @@ class Mage_Catalog_Model_Product_Attribute_Backend_Media extends Mage_Eav_Model_ } } + Mage::dispatchEvent('catalog_product_media_save_before', array('product' => $object, 'images' => $value)); + $object->setData($attrCode, $value); return $this; @@ -268,6 +270,9 @@ class Mage_Catalog_Model_Product_Attribute_Backend_Media extends Mage_Eav_Model_ if (!$file || !file_exists($file)) { Mage::throwException(Mage::helper('Mage_Catalog_Helper_Data')->__('Image does not exist.')); } + + Mage::dispatchEvent('catalog_product_media_add_image', array('product' => $product, 'image' => $file)); + $pathinfo = pathinfo($file); $imgExtensions = array('jpg','jpeg','gif','png'); if (!isset($pathinfo['extension']) || !in_array(strtolower($pathinfo['extension']), $imgExtensions)) { diff --git a/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Msrp.php b/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Msrp.php index 5f8c81e8f40a8f68344775737d3f6803c8e9f653..e59929419d9d81e43d5a7a6fb9315b9a34d92cfb 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Msrp.php +++ b/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Msrp.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Price.php b/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Price.php index 51717e2a0eb8e906ae2fe74ef3e3bef76b2dde20..16538c868e128211730955a64a0652e485ba550d 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Price.php +++ b/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Price.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Recurring.php b/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Recurring.php index d93615a54963f4827c55db23d7739da34e84ec9e..eb4fd4a8d646f6915c3ebf918974f5eeaa8bd000 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Recurring.php +++ b/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Recurring.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Sku.php b/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Sku.php index 69c5ccc83aca4ba3416e5a7f0ad5c3b71c081eb3..ce16f66300d41c2cf4f00c2ab41acef2f58fd686 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Sku.php +++ b/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Sku.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Startdate.php b/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Startdate.php index 95994762aa61dd4efc36aaf4c2350b5a62af3f0a..a3634a2ee9860e3c90c53a137331b639870971bb 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Startdate.php +++ b/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Startdate.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Tierprice.php b/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Tierprice.php index d6a4dcf844d93cf9b86cff05169d830b4ea2cade..3e2f1743fee951fa52dc44fd1b3b2cb37d02e5ba 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Tierprice.php +++ b/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Tierprice.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -32,15 +32,9 @@ * @package Mage_Catalog * @author Magento Core Team <core@magentocommerce.com> */ -class Mage_Catalog_Model_Product_Attribute_Backend_Tierprice extends Mage_Catalog_Model_Product_Attribute_Backend_Price +class Mage_Catalog_Model_Product_Attribute_Backend_Tierprice + extends Mage_Catalog_Model_Product_Attribute_Backend_Groupprice_Abstract { - /** - * Website currency codes and rates - * - * @var array - */ - protected $_rates; - /** * Retrieve resource instance * @@ -54,278 +48,45 @@ class Mage_Catalog_Model_Product_Attribute_Backend_Tierprice extends Mage_Catalo /** * Retrieve websites rates and base currency codes * + * @deprecated since 1.12.0.0 * @return array */ public function _getWebsiteRates() { - if (is_null($this->_rates)) { - $this->_rates = array(); - $baseCurrency = Mage::app()->getBaseCurrencyCode(); - foreach (Mage::app()->getWebsites() as $website) { - /* @var $website Mage_Core_Model_Website */ - if ($website->getBaseCurrencyCode() != $baseCurrency) { - $rate = Mage::getModel('Mage_Directory_Model_Currency') - ->load($baseCurrency) - ->getRate($website->getBaseCurrencyCode()); - if (!$rate) { - $rate = 1; - } - $this->_rates[$website->getId()] = array( - 'code' => $website->getBaseCurrencyCode(), - 'rate' => $rate - ); - } else { - $this->_rates[$website->getId()] = array( - 'code' => $baseCurrency, - 'rate' => 1 - ); - } - } - } - return $this->_rates; - } - - /** - * Validate tier price data - * - * @param Mage_Catalog_Model_Product $object - * @throws Mage_Core_Exception - * @return bool - */ - public function validate($object) - { - $attribute = $this->getAttribute(); - $tiers = $object->getData($attribute->getName()); - if (empty($tiers)) { - return true; - } - - // validate per website - $duplicates = array(); - foreach ($tiers as $tier) { - if (!empty($tier['delete'])) { - continue; - } - $compare = join('-', array($tier['website_id'], $tier['cust_group'], $tier['price_qty'] * 1)); - if (isset($duplicates[$compare])) { - Mage::throwException( - Mage::helper('Mage_Catalog_Helper_Data')->__('Duplicate website tier price customer group and quantity.') - ); - } - $duplicates[$compare] = true; - } - - // if attribute scope is website and edit in store view scope - // add global tier prices for duplicates find - if (!$attribute->isScopeGlobal() && $object->getStoreId()) { - $origTierPrices = $object->getOrigData($attribute->getName()); - foreach ($origTierPrices as $tier) { - if ($tier['website_id'] == 0) { - $compare = join('-', array($tier['website_id'], $tier['cust_group'], $tier['price_qty'] * 1)); - $duplicates[$compare] = true; - } - } - } - - // validate currency - $baseCurrency = Mage::app()->getBaseCurrencyCode(); - $rates = $this->_getWebsiteRates(); - foreach ($tiers as $tier) { - if (!empty($tier['delete'])) { - continue; - } - if ($tier['website_id'] == 0) { - continue; - } - - $compare = join('-', array($tier['website_id'], $tier['cust_group'], $tier['price_qty'])); - $globalCompare = join('-', array(0, $tier['cust_group'], $tier['price_qty'] * 1)); - $websiteCurrency = $rates[$tier['website_id']]['code']; - - if ($baseCurrency == $websiteCurrency && isset($duplicates[$globalCompare])) { - Mage::throwException( - Mage::helper('Mage_Catalog_Helper_Data')->__('Duplicate website tier price customer group and quantity.') - ); - } - } - - return true; + return $this->_getWebsiteCurrencyRates(); } /** - * Prepare tier prices data for website + * Add price qty to unique fields * - * @param array $priceData - * @param string $productTypeId - * @param int $websiteId + * @param array $objectArray * @return array */ - public function preparePriceData(array $priceData, $productTypeId, $websiteId) + protected function _getAdditionalUniqueFields($objectArray) { - $rates = $this->_getWebsiteRates(); - $data = array(); - $price = Mage::getSingleton('Mage_Catalog_Model_Product_Type')->priceFactory($productTypeId); - foreach ($priceData as $v) { - $key = join('-', array($v['cust_group'], $v['price_qty'])); - if ($v['website_id'] == $websiteId) { - $data[$key] = $v; - $data[$key]['website_price'] = $v['price']; - } else if ($v['website_id'] == 0 && !isset($data[$key])) { - $data[$key] = $v; - $data[$key]['website_id'] = $websiteId; - if ($price->isTierPriceFixed()) { - $data[$key]['price'] = $v['price'] * $rates[$websiteId]['rate']; - $data[$key]['website_price'] = $v['price'] * $rates[$websiteId]['rate']; - } - } - } - - return $data; + $uniqueFields = parent::_getAdditionalUniqueFields($objectArray); + $uniqueFields['qty'] = $objectArray['price_qty'] * 1; + return $uniqueFields; } /** - * Assign tier prices to product data + * Error message when duplicates * - * @param Mage_Catalog_Model_Product $object - * @return Mage_Catalog_Model_Product_Attribute_Backend_Tierprice + * @return string */ - public function afterLoad($object) + protected function _getDuplicateErrorMessage() { - $storeId = $object->getStoreId(); - $websiteId = null; - if ($this->getAttribute()->isScopeGlobal()) { - $websiteId = 0; - } else if ($storeId) { - $websiteId = Mage::app()->getStore($storeId)->getWebsiteId(); - } - - $data = $this->_getResource()->loadPriceData($object->getId(), $websiteId); - foreach ($data as $k => $v) { - $data[$k]['website_price'] = $v['price']; - if ($v['all_groups']) { - $data[$k]['cust_group'] = Mage_Customer_Model_Group::CUST_GROUP_ALL; - } - } - - if (!$object->getData('_edit_mode') && $websiteId) { - $data = $this->preparePriceData($data, $object->getTypeId(), $websiteId); - } - - $object->setData($this->getAttribute()->getName(), $data); - $object->setOrigData($this->getAttribute()->getName(), $data); - - $valueChangedKey = $this->getAttribute()->getName() . '_changed'; - $object->setOrigData($valueChangedKey, 0); - $object->setData($valueChangedKey, 0); - - return $this; + return Mage::helper('Mage_Catalog_Helper_Data')->__('Duplicate website tier price customer group and quantity.'); } /** - * After Save Attribute manipulation + * Whether tier price value fixed or percent of original price * - * @param Mage_Catalog_Model_Product $object - * @return Mage_Catalog_Model_Product_Attribute_Backend_Tierprice + * @param Mage_Catalog_Model_Product_Type_Price $priceObject + * @return bool */ - public function afterSave($object) + protected function _isPriceFixed($priceObject) { - $websiteId = Mage::app()->getStore($object->getStoreId())->getWebsiteId(); - $isGlobal = $this->getAttribute()->isScopeGlobal() || $websiteId == 0; - - $tierPrices = $object->getData($this->getAttribute()->getName()); - if (empty($tierPrices)) { - if ($isGlobal) { - $this->_getResource()->deletePriceData($object->getId()); - } else { - $this->_getResource()->deletePriceData($object->getId(), $websiteId); - } - return $this; - } - - $old = array(); - $new = array(); - - // prepare original data for compare - $origTierPrices = $object->getOrigData($this->getAttribute()->getName()); - if (!is_array($origTierPrices)) { - $origTierPrices = array(); - } - foreach ($origTierPrices as $data) { - if ($data['website_id'] > 0 || ($data['website_id'] == '0' && $isGlobal)) { - $key = join('-', array($data['website_id'], $data['cust_group'], $data['price_qty'] * 1)); - $old[$key] = $data; - } - } - - // prepare data for save - foreach ($tierPrices as $data) { - if (empty($data['price_qty']) || !isset($data['cust_group']) || !empty($data['delete'])) { - continue; - } - if ($this->getAttribute()->isScopeGlobal() && $data['website_id'] > 0) { - continue; - } - if (!$isGlobal && (int)$data['website_id'] == 0) { - continue; - } - - $key = join('-', array($data['website_id'], $data['cust_group'], $data['price_qty'] * 1)); - - $useForAllGroups = $data['cust_group'] == Mage_Customer_Model_Group::CUST_GROUP_ALL; - $customerGroupId = !$useForAllGroups ? $data['cust_group'] : 0; - - $new[$key] = array( - 'website_id' => $data['website_id'], - 'all_groups' => $useForAllGroups ? 1 : 0, - 'customer_group_id' => $customerGroupId, - 'qty' => $data['price_qty'], - 'value' => $data['price'], - ); - } - - $delete = array_diff_key($old, $new); - $insert = array_diff_key($new, $old); - $update = array_intersect_key($new, $old); - - $isChanged = false; - $productId = $object->getId(); - - if (!empty($delete)) { - foreach ($delete as $data) { - $this->_getResource()->deletePriceData($productId, null, $data['price_id']); - $isChanged = true; - } - } - - if (!empty($insert)) { - foreach ($insert as $data) { - $price = new Varien_Object($data); - $price->setEntityId($productId); - $this->_getResource()->savePriceData($price); - - $isChanged = true; - } - } - - if (!empty($update)) { - foreach ($update as $k => $v) { - if ($old[$k]['price'] != $v['value']) { - $price = new Varien_Object(array( - 'value_id' => $old[$k]['price_id'], - 'value' => $v['value'] - )); - $this->_getResource()->savePriceData($price); - - $isChanged = true; - } - } - } - - if ($isChanged) { - $valueChangedKey = $this->getAttribute()->getName() . '_changed'; - $object->setData($valueChangedKey, 1); - } - - return $this; + return $priceObject->isTierPriceFixed(); } } diff --git a/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Urlkey.php b/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Urlkey.php index 77f104864f49c3beceef7e546de1792b14b6c456..9aec762c7392da5e8da4323c192a3116d06e7b29 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Urlkey.php +++ b/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Urlkey.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Attribute/Frontend/Image.php b/app/code/core/Mage/Catalog/Model/Product/Attribute/Frontend/Image.php index d000d4b84ddd5f355db04b6a6066fcaf8062769e..4c23bbeb26a9bc52e9beaaa9b606f5107e4b28a4 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Attribute/Frontend/Image.php +++ b/app/code/core/Mage/Catalog/Model/Product/Attribute/Frontend/Image.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Attribute/Group.php b/app/code/core/Mage/Catalog/Model/Product/Attribute/Group.php index 61a090f4f8bdbe40b913c5a9a696fee7609ef41e..729254cbe7d3117148d014825b9e576bf94a21b3 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Attribute/Group.php +++ b/app/code/core/Mage/Catalog/Model/Product/Attribute/Group.php @@ -21,7 +21,7 @@ * @category Mage * @package Mage_Catalog * @author Magento Core Team <core@magentocommerce.com> - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Attribute/Media/Api.php b/app/code/core/Mage/Catalog/Model/Product/Attribute/Media/Api.php index 6a5ee18d2cd87af136e13d731a831aaa59e40acc..32b036caab84cb7ba7408e97342decfdec5da970 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Attribute/Media/Api.php +++ b/app/code/core/Mage/Catalog/Model/Product/Attribute/Media/Api.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Attribute/Media/Api/V2.php b/app/code/core/Mage/Catalog/Model/Product/Attribute/Media/Api/V2.php index e0f2ba5e8cb269aa8045d26440776c08f00d282a..c150248937c7f18d536fe588201443259a171b91 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Attribute/Media/Api/V2.php +++ b/app/code/core/Mage/Catalog/Model/Product/Attribute/Media/Api/V2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Attribute/Set/Api.php b/app/code/core/Mage/Catalog/Model/Product/Attribute/Set/Api.php index 9c8b6358cf5d0e31dbf309a1d5c2ac6ab148b18c..3682034b372a6fcc7303d1957013e646ecc2ea11 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Attribute/Set/Api.php +++ b/app/code/core/Mage/Catalog/Model/Product/Attribute/Set/Api.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Attribute/Set/Api/V2.php b/app/code/core/Mage/Catalog/Model/Product/Attribute/Set/Api/V2.php index 517251b6e5c6e26a6a73ddea988affdb6c526ad8..34b7fce6559426431e760bf7ff8e85e7ad805d16 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Attribute/Set/Api/V2.php +++ b/app/code/core/Mage/Catalog/Model/Product/Attribute/Set/Api/V2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Attribute/Source/Boolean.php b/app/code/core/Mage/Catalog/Model/Product/Attribute/Source/Boolean.php index 2fc8399ec54adca39381205ca049ad2e3d4967de..b757fbf92d465dd41a74b9b4543025e711e15f77 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Attribute/Source/Boolean.php +++ b/app/code/core/Mage/Catalog/Model/Product/Attribute/Source/Boolean.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Attribute/Source/Countryofmanufacture.php b/app/code/core/Mage/Catalog/Model/Product/Attribute/Source/Countryofmanufacture.php index 52881a9a14b8d8fc00ff1c8dc0ae981032897248..1c4f246ca1dac945668fb24e9af7260506c5184e 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Attribute/Source/Countryofmanufacture.php +++ b/app/code/core/Mage/Catalog/Model/Product/Attribute/Source/Countryofmanufacture.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Attribute/Source/Inputtype.php b/app/code/core/Mage/Catalog/Model/Product/Attribute/Source/Inputtype.php index 76f452e83553c934187941e908b744b83936aa26..71f4c849be81ad3f1380bbd4b61d11923574dda0 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Attribute/Source/Inputtype.php +++ b/app/code/core/Mage/Catalog/Model/Product/Attribute/Source/Inputtype.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Attribute/Source/Layout.php b/app/code/core/Mage/Catalog/Model/Product/Attribute/Source/Layout.php index 319faac561542d77ef31aef3aeda43ddc808392d..e5b54ff772839475857534d00eb65b879fea5919 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Attribute/Source/Layout.php +++ b/app/code/core/Mage/Catalog/Model/Product/Attribute/Source/Layout.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Attribute/Source/Msrp/Type.php b/app/code/core/Mage/Catalog/Model/Product/Attribute/Source/Msrp/Type.php index 97c5cf2f72acc5c7cc5474a8e123980477bffae4..23a6496f333b4eae05f570ad8363c064012ba5bf 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Attribute/Source/Msrp/Type.php +++ b/app/code/core/Mage/Catalog/Model/Product/Attribute/Source/Msrp/Type.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Attribute/Source/Msrp/Type/Enabled.php b/app/code/core/Mage/Catalog/Model/Product/Attribute/Source/Msrp/Type/Enabled.php index 136e8d7d8879b0066a977f32482c9d87ba62a18b..78fa19ccfc450c122232894dac8fe6ad56da1e18 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Attribute/Source/Msrp/Type/Enabled.php +++ b/app/code/core/Mage/Catalog/Model/Product/Attribute/Source/Msrp/Type/Enabled.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Attribute/Source/Msrp/Type/Price.php b/app/code/core/Mage/Catalog/Model/Product/Attribute/Source/Msrp/Type/Price.php index ee91f6ead60a36f97d3a46e55362eda3eb4d5ae8..eebd5f55bfcc2bfc03db3a523cb4abc3b8cb4ad4 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Attribute/Source/Msrp/Type/Price.php +++ b/app/code/core/Mage/Catalog/Model/Product/Attribute/Source/Msrp/Type/Price.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Attribute/Tierprice/Api.php b/app/code/core/Mage/Catalog/Model/Product/Attribute/Tierprice/Api.php index e5587b26b741528cce39c278a480ba56645a0aa1..9c98fb945d63ac77285d0567c2d60c178cc38d1f 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Attribute/Tierprice/Api.php +++ b/app/code/core/Mage/Catalog/Model/Product/Attribute/Tierprice/Api.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Attribute/Tierprice/Api/V2.php b/app/code/core/Mage/Catalog/Model/Product/Attribute/Tierprice/Api/V2.php index 9a705373133c5208669f7bc7143e51bdeedfe43b..e04b3716918a1268f3293be3b1e5efa7af41642c 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Attribute/Tierprice/Api/V2.php +++ b/app/code/core/Mage/Catalog/Model/Product/Attribute/Tierprice/Api/V2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Compare/Item.php b/app/code/core/Mage/Catalog/Model/Product/Compare/Item.php index e1ed15e1b61fb465960d993e57dc320914fdf01c..d2543b612f922115a69121205e731d236b3cf693 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Compare/Item.php +++ b/app/code/core/Mage/Catalog/Model/Product/Compare/Item.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Compare/List.php b/app/code/core/Mage/Catalog/Model/Product/Compare/List.php index f0a69057e94ae89c3a776ed0ae5f259d5fe4b567..1b4cec5a3c703186741e85c6b1e93cbe89ba8b78 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Compare/List.php +++ b/app/code/core/Mage/Catalog/Model/Product/Compare/List.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Condition.php b/app/code/core/Mage/Catalog/Model/Product/Condition.php index e814f71221794ea1107ccdffba23fcb2584c72da..463d4b0a33a29546df46c367f36cf53ae00cbe39 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Condition.php +++ b/app/code/core/Mage/Catalog/Model/Product/Condition.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Condition/Interface.php b/app/code/core/Mage/Catalog/Model/Product/Condition/Interface.php index df5a4ef6d03ed093122d93856891ca6d577ccef3..f6d6104615528adadc5e319b38df28641302e08f 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Condition/Interface.php +++ b/app/code/core/Mage/Catalog/Model/Product/Condition/Interface.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Configuration/Item/Interface.php b/app/code/core/Mage/Catalog/Model/Product/Configuration/Item/Interface.php index 0b4aebfaa49e54381d677d12f79eedc33f0f8127..9aa55caeb31f232cf22b2fbd1e6fb0006943cd85 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Configuration/Item/Interface.php +++ b/app/code/core/Mage/Catalog/Model/Product/Configuration/Item/Interface.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Configuration/Item/Option.php b/app/code/core/Mage/Catalog/Model/Product/Configuration/Item/Option.php index acb9492bdefebabd41c38f04b5797b3c61878970..65d83bc7a7c204fb817ea3c6c2c40f9599d9a31e 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Configuration/Item/Option.php +++ b/app/code/core/Mage/Catalog/Model/Product/Configuration/Item/Option.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Configuration/Item/Option/Interface.php b/app/code/core/Mage/Catalog/Model/Product/Configuration/Item/Option/Interface.php index 146cf4e9b3b2f240e03d8a84407b453cd7e707e6..8e542c2d7c2f6c59eeb1e1625784e72d479e3a72 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Configuration/Item/Option/Interface.php +++ b/app/code/core/Mage/Catalog/Model/Product/Configuration/Item/Option/Interface.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Flat/Flag.php b/app/code/core/Mage/Catalog/Model/Product/Flat/Flag.php index 9eaf1058f48f67c643c410b8a2ca6a200241bafc..d12d4a45fabde0d516a01500610b68ebdd1afd6a 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Flat/Flag.php +++ b/app/code/core/Mage/Catalog/Model/Product/Flat/Flag.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Flat/Indexer.php b/app/code/core/Mage/Catalog/Model/Product/Flat/Indexer.php index e5fad36d501ded049235abd62aa110ff4c8d716e..690941b2223070cde6222007e6b0be1e51d8df6b 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Flat/Indexer.php +++ b/app/code/core/Mage/Catalog/Model/Product/Flat/Indexer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -296,4 +296,14 @@ class Mage_Catalog_Model_Product_Flat_Indexer extends Mage_Core_Model_Abstract $this->_getResource()->reindexAll(); return $this; } + + /** + * Retrieve list of attribute codes for flat + * + * @return array + */ + public function getAttributeCodes() + { + return $this->_getResource()->getAttributeCodes(); + } } diff --git a/app/code/core/Mage/Catalog/Model/Product/Flat/Observer.php b/app/code/core/Mage/Catalog/Model/Product/Flat/Observer.php index 5c8e3026ccc0822b136ab93f29a1c26a55b2277e..2f8fa8d5bedfd674e3ee1a0f0af3377bee3cce5c 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Flat/Observer.php +++ b/app/code/core/Mage/Catalog/Model/Product/Flat/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Image.php b/app/code/core/Mage/Catalog/Model/Product/Image.php index 1674ff74f46f5d6b97ba88802412770714f6f1ee..7dcab3a6d58663b56dfe39c002fca48a637cbe28 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Image.php +++ b/app/code/core/Mage/Catalog/Model/Product/Image.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Indexer/Eav.php b/app/code/core/Mage/Catalog/Model/Product/Indexer/Eav.php index 4ede822b5cd70a929377898b65df3e8697186757..6f1915a6b97fba7b824ed63c875d34ccb42f569c 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Indexer/Eav.php +++ b/app/code/core/Mage/Catalog/Model/Product/Indexer/Eav.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Indexer/Flat.php b/app/code/core/Mage/Catalog/Model/Product/Indexer/Flat.php index 76b4b675c73481161757ba19116e2832663388b6..0171de4a0a297becb6b3c1629705fd4c4b13d734 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Indexer/Flat.php +++ b/app/code/core/Mage/Catalog/Model/Product/Indexer/Flat.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Catalog_Model_Product_Indexer_Flat extends Mage_Index_Model_Indexer_Abstract @@ -103,7 +103,7 @@ class Mage_Catalog_Model_Product_Indexer_Flat extends Mage_Index_Model_Indexer_A return false; } - $data = $event->getNewData(); + $data = $event->getNewData(); if (isset($data[self::EVENT_MATCH_RESULT_KEY])) { return $data[self::EVENT_MATCH_RESULT_KEY]; } @@ -205,7 +205,7 @@ class Mage_Catalog_Model_Product_Indexer_Flat extends Mage_Index_Model_Indexer_A * Register data required by catalog product process in event object * * @param Mage_Index_Model_Event $event - * @return Mage_CatalogSearch_Model_Indexer_Search + * @return Mage_Catalog_Model_Product_Indexer_Flat */ protected function _registerCatalogProductEvent(Mage_Index_Model_Event $event) { @@ -237,7 +237,12 @@ class Mage_Catalog_Model_Product_Indexer_Flat extends Mage_Index_Model_Indexer_A $reindexData['catalog_product_flat_action_type'] = $actionObject->getActionType(); } - if (isset($attrData['price']) || isset($attrData['name'])) { + $flatAttributes = array(); + if (is_array($attrData)) { + $flatAttributes = array_intersect($this->_getFlatAttributes(), array_keys($attrData)); + } + + if (count($flatAttributes) > 0) { $reindexFlat = true; $reindexData['catalog_product_flat_force_update'] = true; } @@ -330,4 +335,14 @@ class Mage_Catalog_Model_Product_Indexer_Flat extends Mage_Index_Model_Indexer_A { $this->_getIndexer()->reindexAll(); } + + /** + * Retrieve list of attribute codes, that are used in flat + * + * @return array + */ + protected function _getFlatAttributes() + { + return Mage::getModel('Mage_Catalog_Model_Product_Flat_Indexer')->getAttributeCodes(); + } } diff --git a/app/code/core/Mage/Catalog/Model/Product/Indexer/Price.php b/app/code/core/Mage/Catalog/Model/Product/Indexer/Price.php index 483eba1bcb15ba3e1ae7bec326415821d637d096..f700beb49f59e92147f945c3846e7225159ce9fd 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Indexer/Price.php +++ b/app/code/core/Mage/Catalog/Model/Product/Indexer/Price.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ /** diff --git a/app/code/core/Mage/Catalog/Model/Product/Link.php b/app/code/core/Mage/Catalog/Model/Product/Link.php index 68958123f57f6362810db60d918ba44b2727f368..553a0610c9ef9008159d747b8579a8db1d596b81 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Link.php +++ b/app/code/core/Mage/Catalog/Model/Product/Link.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Link/Api.php b/app/code/core/Mage/Catalog/Model/Product/Link/Api.php index fde0633f707ab12ce23f248b7485fd6c3a599c22..d81d7f6053c305cb426da050abdeacd8c5fd7d53 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Link/Api.php +++ b/app/code/core/Mage/Catalog/Model/Product/Link/Api.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Link/Api/V2.php b/app/code/core/Mage/Catalog/Model/Product/Link/Api/V2.php index de6a3c967fdfc89f03a45c347865deefeea8e32d..279a0a7eab5b43b979301a85711fe64254f82d29 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Link/Api/V2.php +++ b/app/code/core/Mage/Catalog/Model/Product/Link/Api/V2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Media/Config.php b/app/code/core/Mage/Catalog/Model/Product/Media/Config.php index 0f1f7e43dde9108c54a3776d74b2eba6e86de6dd..76022f467b0054fa45c0541656c0ea981366cb43 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Media/Config.php +++ b/app/code/core/Mage/Catalog/Model/Product/Media/Config.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Option.php b/app/code/core/Mage/Catalog/Model/Product/Option.php index b98bdd5a57883b66f5cd48638d42d2abf542c549..73d012569118d89da7a3c22c0e0f3cb9121e39a9 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Option.php +++ b/app/code/core/Mage/Catalog/Model/Product/Option.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Option/Api.php b/app/code/core/Mage/Catalog/Model/Product/Option/Api.php index 22967e06ed78835b7f85e283814f721b44e3113e..5077e60cc6f425cff9e71afe2ba0e609d1bbbbbb 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Option/Api.php +++ b/app/code/core/Mage/Catalog/Model/Product/Option/Api.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Option/Api/V2.php b/app/code/core/Mage/Catalog/Model/Product/Option/Api/V2.php index f77f544f8267eb42edd93e14eea7c6386e72580e..4380c13c998dd7bab950ce35c718616ad69be485 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Option/Api/V2.php +++ b/app/code/core/Mage/Catalog/Model/Product/Option/Api/V2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Option/Observer.php b/app/code/core/Mage/Catalog/Model/Product/Option/Observer.php index 64885d4e37db56a037a358ecb55cdea19a9350b0..1bd2a3b6a34bc47cc279aa2746e1e6c3d037e1f6 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Option/Observer.php +++ b/app/code/core/Mage/Catalog/Model/Product/Option/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Option/Type/Date.php b/app/code/core/Mage/Catalog/Model/Product/Option/Type/Date.php index 4c046bed474e18f5dfdda33659a59748740e05fc..9669ed349a0136d55bc18e06562370a4885a6352 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Option/Type/Date.php +++ b/app/code/core/Mage/Catalog/Model/Product/Option/Type/Date.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Option/Type/Default.php b/app/code/core/Mage/Catalog/Model/Product/Option/Type/Default.php index a70d42a3e206d585834783b5653cd1e9bce5fdde..79ea5e5f97045f4acfcddce700ddce075005b297 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Option/Type/Default.php +++ b/app/code/core/Mage/Catalog/Model/Product/Option/Type/Default.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Option/Type/File.php b/app/code/core/Mage/Catalog/Model/Product/Option/Type/File.php index cd760d82490a2afb69e63816a58d91fc3887580e..bb07dc8ac17e9cd62494a90e15fd824fa806d3f6 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Option/Type/File.php +++ b/app/code/core/Mage/Catalog/Model/Product/Option/Type/File.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -415,19 +415,15 @@ class Mage_Catalog_Model_Product_Option_Type_File extends Mage_Catalog_Model_Pro $result = array(); foreach ($errors as $errorCode) { if ($errorCode == Zend_Validate_File_ExcludeExtension::FALSE_EXTENSION) { - $result[] = Mage::helper('Mage_Catalog_Helper_Data')->__("The file '%s' for '%s' has an invalid extension", - $fileInfo['title'], $option->getTitle()); + $result[] = Mage::helper('Mage_Catalog_Helper_Data')->__("The file '%s' for '%s' has an invalid extension", $fileInfo['title'], $option->getTitle()); } elseif ($errorCode == Zend_Validate_File_Extension::FALSE_EXTENSION) { - $result[] = Mage::helper('Mage_Catalog_Helper_Data')->__("The file '%s' for '%s' has an invalid extension", - $fileInfo['title'], $option->getTitle()); + $result[] = Mage::helper('Mage_Catalog_Helper_Data')->__("The file '%s' for '%s' has an invalid extension", $fileInfo['title'], $option->getTitle()); } elseif ($errorCode == Zend_Validate_File_ImageSize::WIDTH_TOO_BIG || $errorCode == Zend_Validate_File_ImageSize::HEIGHT_TOO_BIG) { - $result[] = Mage::helper('Mage_Catalog_Helper_Data')->__("Maximum allowed image size for '%s' is %sx%s px.", - $option->getTitle(), $option->getImageSizeX(), $option->getImageSizeY()); + $result[] = Mage::helper('Mage_Catalog_Helper_Data')->__("Maximum allowed image size for '%s' is %sx%s px.", $option->getTitle(), $option->getImageSizeX(), $option->getImageSizeY()); } elseif ($errorCode == Zend_Validate_File_FilesSize::TOO_BIG) { - $result[] = Mage::helper('Mage_Catalog_Helper_Data')->__("The file '%s' you uploaded is larger than %s Megabytes allowed by server", - $fileInfo['title'], $this->_bytesToMbytes($this->_getUploadMaxFilesize())); + $result[] = Mage::helper('Mage_Catalog_Helper_Data')->__("The file '%s' you uploaded is larger than %s Megabytes allowed by server", $fileInfo['title'], $this->_bytesToMbytes($this->_getUploadMaxFilesize())); } } return $result; @@ -513,7 +509,9 @@ class Mage_Catalog_Model_Product_Option_Type_File extends Mage_Catalog_Model_Pro { $value = $this->_unserializeValue($optionValue); try { - if (isset($value) && isset($value['width']) && isset($value['height']) && $value['width'] > 0 && $value['height'] > 0) { + if (isset($value) && isset($value['width']) && isset($value['height']) + && $value['width'] > 0 && $value['height'] > 0 + ) { $sizes = $value['width'] . ' x ' . $value['height'] . ' ' . Mage::helper('Mage_Catalog_Helper_Data')->__('px.'); } else { $sizes = ''; diff --git a/app/code/core/Mage/Catalog/Model/Product/Option/Type/Select.php b/app/code/core/Mage/Catalog/Model/Product/Option/Type/Select.php index 6629f42eb6c68148c748b2294c695b167dde0350..68e09f0cee4caa14ef1a4dbd99821fa1edaf5ddf 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Option/Type/Select.php +++ b/app/code/core/Mage/Catalog/Model/Product/Option/Type/Select.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Option/Type/Text.php b/app/code/core/Mage/Catalog/Model/Product/Option/Type/Text.php index bed8add17472951fe5dbab830a350c3e5c7365e3..001ba1c7234a8fcf030290ed27da52bf735482b4 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Option/Type/Text.php +++ b/app/code/core/Mage/Catalog/Model/Product/Option/Type/Text.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Option/Value.php b/app/code/core/Mage/Catalog/Model/Product/Option/Value.php index ada97f40eb795d34399c5e1e8919a52903fcafca..b06b79ec3f08e1c32d2798d108a02e220f4bd03e 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Option/Value.php +++ b/app/code/core/Mage/Catalog/Model/Product/Option/Value.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Option/Value/Api.php b/app/code/core/Mage/Catalog/Model/Product/Option/Value/Api.php index 122153f7ab326c7af6955a3f9912735528b8e6ec..1b26ff27d9730a1d8187843fd2e651c558bf165f 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Option/Value/Api.php +++ b/app/code/core/Mage/Catalog/Model/Product/Option/Value/Api.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Option/Value/Api/V2.php b/app/code/core/Mage/Catalog/Model/Product/Option/Value/Api/V2.php index 763f7eacdef9ecb5ca4740cba13e4c9956977195..1bef883999cfe1c33522908209e71cf9d829d838 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Option/Value/Api/V2.php +++ b/app/code/core/Mage/Catalog/Model/Product/Option/Value/Api/V2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Status.php b/app/code/core/Mage/Catalog/Model/Product/Status.php index bab3e4db0e3bf8ad11143d9c7518bd7618373bbd..a2a2e02cf0614d22384252f422257ddf576f8328 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Status.php +++ b/app/code/core/Mage/Catalog/Model/Product/Status.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Type.php b/app/code/core/Mage/Catalog/Model/Product/Type.php index 32708ed5929e392b6ef400dbb1d7b8cd30933e61..2e337bce21e564fc09ef58703a5da4878d255ba9 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Type.php +++ b/app/code/core/Mage/Catalog/Model/Product/Type.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Type/Abstract.php b/app/code/core/Mage/Catalog/Model/Product/Type/Abstract.php index 6ceaeeac128d8839b75ea8c9beed17a0704566e4..c91dfe0ed6bbf31dc59b09dca88d4e96b6e4a12c 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Type/Abstract.php +++ b/app/code/core/Mage/Catalog/Model/Product/Type/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Type/Api.php b/app/code/core/Mage/Catalog/Model/Product/Type/Api.php index 7b15e4be375f1f5dcdf130965e125f63bb5577a6..1fadfd95e73b5d65c366b2f5cf1e9d78f87b4282 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Type/Api.php +++ b/app/code/core/Mage/Catalog/Model/Product/Type/Api.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Type/Api/V2.php b/app/code/core/Mage/Catalog/Model/Product/Type/Api/V2.php index 95f2e733600a97c83b72003e656be0eeb188b510..28d7ac63e020de60d7b57ce0f9168a7f8fc9d634 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Type/Api/V2.php +++ b/app/code/core/Mage/Catalog/Model/Product/Type/Api/V2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Type/Configurable.php b/app/code/core/Mage/Catalog/Model/Product/Type/Configurable.php index 52153b04b968df3c9678da4a6ac54d77f03d6387..f2012a3745f8502d1ccabc07ee4ec4af69db32cd 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Type/Configurable.php +++ b/app/code/core/Mage/Catalog/Model/Product/Type/Configurable.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -389,18 +389,20 @@ class Mage_Catalog_Model_Product_Type_Configurable extends Mage_Catalog_Model_Pr if ($product->getCanSaveConfigurableAttributes()) { $product->canAffectOptions(true); - if ($data = $product->getConfigurableAttributesData()) { - if (!empty($data)) { - foreach ($data as $attribute) { - if (!empty($attribute['values'])) { - $product->setTypeHasOptions(true); - $product->setTypeHasRequiredOptions(true); - break; - } + $data = $product->getConfigurableAttributesData(); + if (!empty($data)) { + foreach ($data as $attribute) { + if (!empty($attribute['values'])) { + $product->setTypeHasOptions(true); + $product->setTypeHasRequiredOptions(true); + break; } } } } + foreach ($this->getConfigurableAttributes($product) as $attribute) { + $product->setData($attribute->getProductAttribute()->getAttributeCode(), null); + } return $this; } diff --git a/app/code/core/Mage/Catalog/Model/Product/Type/Configurable/Attribute.php b/app/code/core/Mage/Catalog/Model/Product/Type/Configurable/Attribute.php index 780d703de0a7c347d612a09a75c192bd043724dd..b1d3c405208cf07df07c8235c008044ea99225c4 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Type/Configurable/Attribute.php +++ b/app/code/core/Mage/Catalog/Model/Product/Type/Configurable/Attribute.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Type/Configurable/Price.php b/app/code/core/Mage/Catalog/Model/Product/Type/Configurable/Price.php index a13b9ccd2f2143d35e72f391615900b0cb621b31..04df156bb2a535a4c37b8cc130c130c56198d182 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Type/Configurable/Price.php +++ b/app/code/core/Mage/Catalog/Model/Product/Type/Configurable/Price.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -46,18 +46,42 @@ class Mage_Catalog_Model_Product_Type_Configurable_Price extends Mage_Catalog_Mo return $product->getCalculatedFinalPrice(); } - $finalPrice = parent::getFinalPrice($qty, $product); + $basePrice = $this->getBasePrice($product, $qty); + $finalPrice = $basePrice; + $product->setFinalPrice($finalPrice); + Mage::dispatchEvent('catalog_product_get_final_price', array('product' => $product, 'qty' => $qty)); + $finalPrice = $product->getData('final_price'); + + $finalPrice += $this->getTotalConfigurableItemsPrice($product, $qty); + $finalPrice += $this->_applyOptionsPrice($product, $qty, $basePrice) - $basePrice; + $finalPrice = max(0, $finalPrice); + + $product->setFinalPrice($finalPrice); + return $finalPrice; + } + + /** + * Get Total price for configurable items + * + * @param Mage_Catalog_Model_Product $product + * @param null|float $qty + * @return float + */ + public function getTotalConfigurableItemsPrice($product, $qty = null) + { + $price = 0.0; + $product->getTypeInstance() - ->setStoreFilter($product->getStore(), $product); + ->setStoreFilter($product->getStore(), $product); $attributes = $product->getTypeInstance() - ->getConfigurableAttributes($product); + ->getConfigurableAttributes($product); $selectedAttributes = array(); if ($product->getCustomOption('attributes')) { $selectedAttributes = unserialize($product->getCustomOption('attributes')->getValue()); } - $basePrice = $finalPrice; + $basePrice = $this->getBasePrice($product, $qty); foreach ($attributes as $attribute) { $attributeId = $attribute->getProductAttribute()->getId(); $value = $this->_getValueByIndex( @@ -65,19 +89,18 @@ class Mage_Catalog_Model_Product_Type_Configurable_Price extends Mage_Catalog_Mo isset($selectedAttributes[$attributeId]) ? $selectedAttributes[$attributeId] : null ); $product->setParentId(true); - if($value) { - if($value['pricing_value'] != 0) { + if ($value) { + if ($value['pricing_value'] != 0) { $product->setConfigurablePrice($this->_calcSelectionPrice($value, $basePrice)); Mage::dispatchEvent( 'catalog_product_type_configurable_price', array('product' => $product) ); - $finalPrice += $product->getConfigurablePrice(); + $price += $product->getConfigurablePrice(); } } } - $product->setFinalPrice($finalPrice); - return max(0, $product->getData('final_price')); + return $price; } /** diff --git a/app/code/core/Mage/Catalog/Model/Product/Type/Grouped.php b/app/code/core/Mage/Catalog/Model/Product/Type/Grouped.php index 26cc0b64858646f3e39c47149424bbdd6fbf0231..370d4d76a791536d36a8b954ed4c5c548cdd4931 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Type/Grouped.php +++ b/app/code/core/Mage/Catalog/Model/Product/Type/Grouped.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Type/Grouped/Price.php b/app/code/core/Mage/Catalog/Model/Product/Type/Grouped/Price.php index 710d83b102c2135419474518e2796b2d81b6d3b8..3420f08668383735e0cfb9f536f8ae9469561abb 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Type/Grouped/Price.php +++ b/app/code/core/Mage/Catalog/Model/Product/Type/Grouped/Price.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Type/Price.php b/app/code/core/Mage/Catalog/Model/Product/Type/Price.php index ae67fa56c924f8304e3b70e83bb9b16236d013e2..9fa5946ee7979fe53424c6ffca9523148287d02b 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Type/Price.php +++ b/app/code/core/Mage/Catalog/Model/Product/Type/Price.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -48,24 +48,39 @@ class Mage_Catalog_Model_Product_Type_Price } /** - * Get product final price + * Get base price with apply Group, Tier, Special prises * - * @param double $qty - * @param Mage_Catalog_Model_Product $product - * @return double + * @param Mage_Catalog_Model_Product $product + * @param float|null $qty + * + * @return float + */ + public function getBasePrice($product, $qty = null) + { + $price = (float)$product->getPrice(); + return min($this->_applyGroupPrice($product, $price), $this->_applyTierPrice($product, $qty, $price), + $this->_applySpecialPrice($product, $price) + ); + } + + + /** + * Retrieve product final price + * + * @param float|null $qty + * @param Mage_Catalog_Model_Product $product + * @return float */ - public function getFinalPrice($qty=null, $product) + public function getFinalPrice($qty = null, $product) { if (is_null($qty) && !is_null($product->getCalculatedFinalPrice())) { return $product->getCalculatedFinalPrice(); } - $finalPrice = $product->getPrice(); - $finalPrice = $this->_applyTierPrice($product, $qty, $finalPrice); - $finalPrice = $this->_applySpecialPrice($product, $finalPrice); + $finalPrice = $this->getBasePrice($product, $qty); $product->setFinalPrice($finalPrice); - Mage::dispatchEvent('catalog_product_get_final_price', array('product'=>$product, 'qty' => $qty)); + Mage::dispatchEvent('catalog_product_get_final_price', array('product' => $product, 'qty' => $qty)); $finalPrice = $product->getData('final_price'); $finalPrice = $this->_applyOptionsPrice($product, $qty, $finalPrice); @@ -80,13 +95,65 @@ class Mage_Catalog_Model_Product_Type_Price return $this->getFinalPrice($childProductQty, $childProduct); } + /** + * Apply group price for product + * + * @param Mage_Catalog_Model_Product $product + * @param float $finalPrice + * @return float + */ + protected function _applyGroupPrice($product, $finalPrice) + { + $groupPrice = $product->getGroupPrice(); + if (is_numeric($groupPrice)) { + $finalPrice = min($finalPrice, $groupPrice); + } + return $finalPrice; + } + + /** + * Get product group price + * + * @param Mage_Catalog_Model_Product $product + * @return float + */ + public function getGroupPrice($product) + { + + $groupPrices = $product->getData('group_price'); + + if (is_null($groupPrices)) { + $attribute = $product->getResource()->getAttribute('group_price'); + if ($attribute) { + $attribute->getBackend()->afterLoad($product); + $groupPrices = $product->getData('group_price'); + } + } + + if (is_null($groupPrices) || !is_array($groupPrices)) { + return $product->getPrice(); + } + + $customerGroup = $this->_getCustomerGroupId($product); + + $matchedPrice = $product->getPrice(); + foreach ($groupPrices as $groupPrice) { + if ($groupPrice['cust_group'] == $customerGroup && $groupPrice['website_price'] < $matchedPrice) { + $matchedPrice = $groupPrice['website_price']; + break; + } + } + + return $matchedPrice; + } + /** * Apply tier price for product if not return price that was before * * @param Mage_Catalog_Model_Product $product - * @param double $qty - * @param double $finalPrice - * @return double + * @param float $qty + * @param float $finalPrice + * @return float */ protected function _applyTierPrice($product, $qty, $finalPrice) { @@ -104,9 +171,9 @@ class Mage_Catalog_Model_Product_Type_Price /** * Get product tier price by qty * - * @param double $qty + * @param float $qty * @param Mage_Catalog_Model_Product $product - * @return double + * @return float */ public function getTierPrice($qty = null, $product) { @@ -197,8 +264,8 @@ class Mage_Catalog_Model_Product_Type_Price * Apply special price for product if not return price that was before * * @param Mage_Catalog_Model_Product $product - * @param double $finalPrice - * @return double + * @param float $finalPrice + * @return float */ protected function _applySpecialPrice($product, $finalPrice) { @@ -220,11 +287,11 @@ class Mage_Catalog_Model_Product_Type_Price } /** - * Get formated by currency tier price + * Get formatted by currency tier price * - * @param double $qty + * @param float $qty * @param Mage_Catalog_Model_Product $product - * @return array || double + * @return array || float */ public function getFormatedTierPrice($qty=null, $product) { @@ -244,10 +311,10 @@ class Mage_Catalog_Model_Product_Type_Price } /** - * Get formated by currency product price + * Get formatted by currency product price * * @param Mage_Catalog_Model_Product $product - * @return array || double + * @return array || float */ public function getFormatedPrice($product) { @@ -259,8 +326,8 @@ class Mage_Catalog_Model_Product_Type_Price * * @param Mage_Catalog_Model_Product $product * @param int $qty - * @param double $finalPrice - * @return double + * @param float $finalPrice + * @return float */ protected function _applyOptionsPrice($product, $qty, $finalPrice) { @@ -268,12 +335,11 @@ class Mage_Catalog_Model_Product_Type_Price $basePrice = $finalPrice; foreach (explode(',', $optionIds->getValue()) as $optionId) { if ($option = $product->getOptionById($optionId)) { - $confItemOption = $product->getCustomOption('option_'.$option->getId()); + $group = $option->groupFactory($option->getType()) ->setOption($option) ->setConfigurationItemOption($confItemOption); - $finalPrice += $group->getOptionPrice($confItemOption->getValue(), $basePrice); } } @@ -355,6 +421,16 @@ class Mage_Catalog_Model_Product_Type_Price * @return bool */ public function isTierPriceFixed() + { + return $this->isGroupPriceFixed(); + } + + /** + * Check is group price value fixed or percent of original price + * + * @return bool + */ + public function isGroupPriceFixed() { return true; } diff --git a/app/code/core/Mage/Catalog/Model/Product/Type/Simple.php b/app/code/core/Mage/Catalog/Model/Product/Type/Simple.php index f527948789d9887794c0ef6968b42ad1d0188fa4..9e8ca639b6bcb2734777327cdf72f6de5d15e5a4 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Type/Simple.php +++ b/app/code/core/Mage/Catalog/Model/Product/Type/Simple.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Type/Virtual.php b/app/code/core/Mage/Catalog/Model/Product/Type/Virtual.php index 54d63646f57145a8a839a168e1596dbbfbf10d2b..1f0d0a4fde3980a9db41a7dfc42ac548767493f5 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Type/Virtual.php +++ b/app/code/core/Mage/Catalog/Model/Product/Type/Virtual.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Url.php b/app/code/core/Mage/Catalog/Model/Product/Url.php index df57627c62ba5bf637749b997bb6956fbe490ba2..5415617cfc760e9ad858bdf88533ce99a9094271 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Url.php +++ b/app/code/core/Mage/Catalog/Model/Product/Url.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Visibility.php b/app/code/core/Mage/Catalog/Model/Product/Visibility.php index 736d69a1dd6c0e2f3826368f19579839dfc5c4c4..02f8e04a92dc9b0695ca4f795bcb749be976bd02 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Visibility.php +++ b/app/code/core/Mage/Catalog/Model/Product/Visibility.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Product/Website.php b/app/code/core/Mage/Catalog/Model/Product/Website.php index 8007f50344686b9ae45bd2e740940f8fbc77ff9f..387ea78f93fbf5ee20d5bedbcf3e877de5f4bc4a 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Website.php +++ b/app/code/core/Mage/Catalog/Model/Product/Website.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Abstract.php b/app/code/core/Mage/Catalog/Model/Resource/Abstract.php index e31f9deca64d96de5d9b6847dd9a5e3bcd70a4e3..25333e81ffb79885fbeb4bfc26b9232a9f8a2c80 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Abstract.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -202,7 +202,7 @@ abstract class Mage_Catalog_Model_Resource_Abstract extends Mage_Eav_Model_Entit if (!$isDefaultStore) { $object->setExistsStoreValueFlag($attributeCode); } - $attribute->getBackend()->setValueId($valueId); + $attribute->getBackend()->setEntityValueId($object, $valueId); } return $this; diff --git a/app/code/core/Mage/Catalog/Model/Resource/Attribute.php b/app/code/core/Mage/Catalog/Model/Resource/Attribute.php index b3903a3e285a0bbef5e3bbe09cc8b27b4aa9d388..b4740bee3a6c660f502fd2683075fea29705191c 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Attribute.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Attribute.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Category.php b/app/code/core/Mage/Catalog/Model/Resource/Category.php index 28956b5f4c96b92e4f5602230068003623282d1e..5648a447a4df9b188f27d031d82d48df3d535d95 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Category.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Category.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Category/Attribute/Collection.php b/app/code/core/Mage/Catalog/Model/Resource/Category/Attribute/Collection.php index 040c1e122bb82034021e57ae1ad42c1ec0ac2d1c..5dcbc06e206355dbcefb1415afa18f4a39841226 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Category/Attribute/Collection.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Category/Attribute/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Category/Attribute/Frontend/Image.php b/app/code/core/Mage/Catalog/Model/Resource/Category/Attribute/Frontend/Image.php index 890af7ec37c6928125ede5e22c57dfb81e1c539a..44787591df8a8b6d2531b19bf8ecd38e9af3b6c9 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Category/Attribute/Frontend/Image.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Category/Attribute/Frontend/Image.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Category/Attribute/Source/Layout.php b/app/code/core/Mage/Catalog/Model/Resource/Category/Attribute/Source/Layout.php index 4d835a53947c8daa0d83b3e2f232502d7d634649..e5ea45593aea2201b2a283baa1aa373176cea5a7 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Category/Attribute/Source/Layout.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Category/Attribute/Source/Layout.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Category/Attribute/Source/Mode.php b/app/code/core/Mage/Catalog/Model/Resource/Category/Attribute/Source/Mode.php index 84816549755d3b2a74baf9f4bca267ccd6e84427..4734621a97033fc9f76d8257fa0c54f6177ec037 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Category/Attribute/Source/Mode.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Category/Attribute/Source/Mode.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Category/Attribute/Source/Page.php b/app/code/core/Mage/Catalog/Model/Resource/Category/Attribute/Source/Page.php index 0beea60c437883bf568633856a427a3204a3b89a..be435f41a2979bdfb9fc4db1a5bcbe1b0c6e0968 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Category/Attribute/Source/Page.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Category/Attribute/Source/Page.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Category/Collection.php b/app/code/core/Mage/Catalog/Model/Resource/Category/Collection.php index 68274fdb1edf5945b94134df65c1925ac49ef897..259bf8e1db944d215ca30b9ef26e231afd6eae6d 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Category/Collection.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Category/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Category/Flat.php b/app/code/core/Mage/Catalog/Model/Resource/Category/Flat.php index 44fb77318b1736f97430089d9c66fc893d4ec13e..1de0b3f75e3c500a56fec462f333bb1e03fa4226 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Category/Flat.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Category/Flat.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Category/Flat/Collection.php b/app/code/core/Mage/Catalog/Model/Resource/Category/Flat/Collection.php index 461c3c563d200231013c4fb19b64d0a79f0df47c..6a25ee9e3ad34160ce1d7edd3ff9d02e6a126153 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Category/Flat/Collection.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Category/Flat/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Category/Indexer/Product.php b/app/code/core/Mage/Catalog/Model/Resource/Category/Indexer/Product.php index 830a4acfb52187ec03226dd8ddca20525aafd375..324551213c5bd4a5fe279da25fbf23969e2dae81 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Category/Indexer/Product.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Category/Indexer/Product.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Category/Tree.php b/app/code/core/Mage/Catalog/Model/Resource/Category/Tree.php index 974c52722aec683b83165fa5d678c34c40f8a7f4..970f31d94253e3ed7ca0a8a76c6c958e94106ba4 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Category/Tree.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Category/Tree.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Collection/Abstract.php b/app/code/core/Mage/Catalog/Model/Resource/Collection/Abstract.php index b891597e0770e592e118b16c054da6646a70e289..7ab9f0097815cfe24bede3903b4ae06e0d9c62ae 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Collection/Abstract.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Collection/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Config.php b/app/code/core/Mage/Catalog/Model/Resource/Config.php index b60fa96ee6a6094e7e9292ac6b1e69116f52758f..194e16e7a0a1dc176e72a75088c1187175898193 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Config.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Config.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Eav/Attribute.php b/app/code/core/Mage/Catalog/Model/Resource/Eav/Attribute.php index 690c74b61bce835e4f388b762e832dc79551f184..25f7667a57fe6403ed92c20f6f56ded93c3a0a55 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Eav/Attribute.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Eav/Attribute.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Helper/Mysql4.php b/app/code/core/Mage/Catalog/Model/Resource/Helper/Mysql4.php index 76d1ea88feae09956f3119059f2d5ff2ee6abe43..69723d77b98726e594aa6646f7e244b3b58a17d7 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Helper/Mysql4.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Helper/Mysql4.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Layer/Filter/Attribute.php b/app/code/core/Mage/Catalog/Model/Resource/Layer/Filter/Attribute.php index a88e042f59862cd071225a2f87132f6f48acb955..2caa16643fd0701203714ac7e3e23646859ca4a0 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Layer/Filter/Attribute.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Layer/Filter/Attribute.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Layer/Filter/Decimal.php b/app/code/core/Mage/Catalog/Model/Resource/Layer/Filter/Decimal.php index 684b2fda4a73159a35bf975f141b1c1f8be0efbe..1ca16bad8d43fb0a0dfb2d5f7b7e274e98c2ae26 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Layer/Filter/Decimal.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Layer/Filter/Decimal.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -71,8 +71,7 @@ class Mage_Catalog_Model_Resource_Layer_Filter_Decimal extends Mage_Core_Model_R $collection->getSelect() ->where("{$tableAlias}.value >= ?", ($range * ($index - 1))) - ->where("{$tableAlias}.value < ?", ($range * $index)) - ->group('e.entity_id'); + ->where("{$tableAlias}.value < ?", ($range * $index)); return $this; } @@ -143,7 +142,7 @@ class Mage_Catalog_Model_Resource_Layer_Filter_Decimal extends Mage_Core_Model_R $select = $this->_getSelect($filter); $adapter = $this->_getReadAdapter(); - $countExpr = new Zend_Db_Expr("COUNT(DISTINCT e.entity_id)"); + $countExpr = new Zend_Db_Expr("COUNT(*)"); $rangeExpr = new Zend_Db_Expr("FLOOR(decimal_index.value / {$range}) + 1"); $select->columns(array( diff --git a/app/code/core/Mage/Catalog/Model/Resource/Layer/Filter/Price.php b/app/code/core/Mage/Catalog/Model/Resource/Layer/Filter/Price.php index 9e8d89826af6c8a80576e1b58e83427046e068c8..a8d04b9fde65ae66194692ffbbeab2673219780f 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Layer/Filter/Price.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Layer/Filter/Price.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -159,7 +159,7 @@ class Mage_Catalog_Model_Resource_Layer_Filter_Price extends Mage_Core_Model_Res 'range' => $rangeExpr, 'count' => $countExpr )); - $select->group($rangeExpr); + $select->group($rangeExpr)->order("$rangeExpr ASC"); return $connection->fetchPairs($select); } @@ -181,7 +181,7 @@ class Mage_Catalog_Model_Resource_Layer_Filter_Price extends Mage_Core_Model_Res $table = $this->_getIndexTableAlias(); $additional = join('', $response->getAdditionalCalculations()); $rate = $filter->getCurrencyRate(); - $priceExpr = new Zend_Db_Expr("(({$table}.min_price {$additional}) * {$rate})"); + $priceExpr = new Zend_Db_Expr("ROUND(({$table}.min_price {$additional}) * {$rate}, 2)"); return array($select, $priceExpr); } @@ -221,13 +221,17 @@ class Mage_Catalog_Model_Resource_Layer_Filter_Price extends Mage_Core_Model_Res $additional = join('', $response->getAdditionalCalculations()); $maxPriceExpr = new Zend_Db_Expr( - "({$table}.min_price {$additional}) * ". $connection->quote($filter->getCurrencyRate()) + "ROUND(({$table}.min_price {$additional}) * " . $connection->quote($filter->getCurrencyRate()) . ", 2)" ); - $select->columns(array($maxPriceExpr)); + $select->columns(array($maxPriceExpr))->order("$maxPriceExpr ASC"); $prices = $connection->fetchCol($select); - $algorithm->setPrices($prices); + if ($filter->getInterval() && count($prices) <= $filter->getIntervalDivisionLimit()) { + $algorithm->setPrices(array()); + } else { + $algorithm->setPrices($prices); + } return $prices; } diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product.php b/app/code/core/Mage/Catalog/Model/Resource/Product.php index 112c5d87b6c15be174f737cfe78e10f5bbc18fee..6d9dc25cb6900778bb0e8c466a05502bdc351f80 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Product.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -630,7 +630,7 @@ class Mage_Catalog_Model_Resource_Product extends Mage_Catalog_Model_Resource_Ab /** * Retrieve product entities info * - * @param null $columns + * @param array|string|null $columns * @return array */ public function getProductEntitiesInfo($columns = null) @@ -641,9 +641,12 @@ class Mage_Catalog_Model_Resource_Product extends Mage_Catalog_Model_Resource_Ab if (empty($columns) || !is_array($columns)) { $columns = $this->_getDefaultAttributes(); } - $select = $this->_getReadAdapter()->select() + + $adapter = $this->_getReadAdapter(); + $select = $adapter->select() ->from($this->getTable('catalog_product_entity'), $columns); - return $this->_getReadAdapter()->fetchAll($select); + + return $adapter->fetchAll($select); } /** @@ -681,4 +684,4 @@ class Mage_Catalog_Model_Resource_Product extends Mage_Catalog_Model_Resource_Ab $images = $read->fetchAll($select); return $images; } -} +} \ No newline at end of file diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Action.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Action.php index 9d9d6ce56dde2903acc65a36593cfa2e46c1424f..90401af50e980e074f4d4d616d731af1f70fa669 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Action.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Action.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Attribute/Backend/Groupprice.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Attribute/Backend/Groupprice.php new file mode 100755 index 0000000000000000000000000000000000000000..1a29638502a28536970db6749d52bcda84bab168 --- /dev/null +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Attribute/Backend/Groupprice.php @@ -0,0 +1,46 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Catalog + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + + +/** + * Catalog product group price backend attribute model + * + * @category Mage + * @package Mage_Catalog + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Catalog_Model_Resource_Product_Attribute_Backend_Groupprice + extends Mage_Catalog_Model_Resource_Product_Attribute_Backend_Groupprice_Abstract +{ + /** + * Initialize connection and define main table + * + */ + protected function _construct() + { + $this->_init('catalog_product_entity_group_price', 'value_id'); + } +} \ No newline at end of file diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Attribute/Backend/Groupprice/Abstract.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Attribute/Backend/Groupprice/Abstract.php new file mode 100644 index 0000000000000000000000000000000000000000..e3786d0e1a3e943ada2303ebfaef7a1f7303b42e --- /dev/null +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Attribute/Backend/Groupprice/Abstract.php @@ -0,0 +1,147 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Catalog + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + + +/** + * Catalog product abstract price backend attribute model with customer group specific + * + * @category Mage + * @package Mage_Catalog + * @author Magento Core Team <core@magentocommerce.com> + */ +abstract class Mage_Catalog_Model_Resource_Product_Attribute_Backend_Groupprice_Abstract + extends Mage_Core_Model_Resource_Db_Abstract +{ + /** + * Load Tier Prices for product + * + * @param int $productId + * @param int $websiteId + * @return Mage_Catalog_Model_Resource_Product_Attribute_Backend_Tierprice + */ + public function loadPriceData($productId, $websiteId = null) + { + $adapter = $this->_getReadAdapter(); + + $columns = array( + 'price_id' => $this->getIdFieldName(), + 'website_id' => 'website_id', + 'all_groups' => 'all_groups', + 'cust_group' => 'customer_group_id', + 'price' => 'value', + ); + + $columns = $this->_loadPriceDataColumns($columns); + + $select = $adapter->select() + ->from($this->getMainTable(), $columns) + ->where('entity_id=?', $productId); + + $this->_loadPriceDataSelect($select); + + if (!is_null($websiteId)) { + if ($websiteId == '0') { + $select->where('website_id = ?', $websiteId); + } else { + $select->where('website_id IN(?)', array(0, $websiteId)); + } + } + + return $adapter->fetchAll($select); + } + + /** + * Load specific sql columns + * + * @param array $columns + * @return array + */ + protected function _loadPriceDataColumns($columns) + { + return $columns; + } + + /** + * Load specific db-select data + * + * @param Varien_Db_Select $select + * @return Varien_Db_Select + */ + protected function _loadPriceDataSelect($select) + { + return $select; + } + + /** + * Delete Tier Prices for product + * + * @param int $productId + * @param int $websiteId + * @param int $priceId + * @return int The number of affected rows + */ + public function deletePriceData($productId, $websiteId = null, $priceId = null) + { + $adapter = $this->_getWriteAdapter(); + + $conds = array( + $adapter->quoteInto('entity_id = ?', $productId) + ); + + if (!is_null($websiteId)) { + $conds[] = $adapter->quoteInto('website_id = ?', $websiteId); + } + + if (!is_null($priceId)) { + $conds[] = $adapter->quoteInto($this->getIdFieldName() . ' = ?', $priceId); + } + + $where = implode(' AND ', $conds); + + return $adapter->delete($this->getMainTable(), $where); + } + + /** + * Save tier price object + * + * @param Varien_Object $priceObject + * @return Mage_Catalog_Model_Resource_Product_Attribute_Backend_Tierprice + */ + public function savePriceData(Varien_Object $priceObject) + { + $adapter = $this->_getWriteAdapter(); + $data = $this->_prepareDataForTable($priceObject, $this->getMainTable()); + + if (!empty($data[$this->getIdFieldName()])) { + $where = $adapter->quoteInto($this->getIdFieldName() . ' = ?', $data[$this->getIdFieldName()]); + unset($data[$this->getIdFieldName()]); + $adapter->update($this->getMainTable(), $data, $where); + } else { + $adapter->insert($this->getMainTable(), $data); + } + return $this; + } +} diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Attribute/Backend/Image.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Attribute/Backend/Image.php index 6ea707808c919fc955bc74e9da597d2fc2e2e2c4..9ab82537d03069d2050fbdf2b3c9fe2e14d6329e 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Attribute/Backend/Image.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Attribute/Backend/Image.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Attribute/Backend/Media.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Attribute/Backend/Media.php index b24c83210226e7c474b8d4b4d1cdec5d1d639b6a..51a256abfed4ea7c08bf3882c7688887ae0f148b 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Attribute/Backend/Media.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Attribute/Backend/Media.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Attribute/Backend/Tierprice.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Attribute/Backend/Tierprice.php index b5d9c69fe5d1fefd081a935df4d6f5feda6ab6e7..f1c316838b6e008c1a4cd6db4cf658bbfa5e2d12 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Attribute/Backend/Tierprice.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Attribute/Backend/Tierprice.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -32,7 +32,8 @@ * @package Mage_Catalog * @author Magento Core Team <core@magentocommerce.com> */ -class Mage_Catalog_Model_Resource_Product_Attribute_Backend_Tierprice extends Mage_Core_Model_Resource_Db_Abstract +class Mage_Catalog_Model_Resource_Product_Attribute_Backend_Tierprice + extends Mage_Catalog_Model_Resource_Product_Attribute_Backend_Groupprice_Abstract { /** * Initialize connection and define main table @@ -44,88 +45,27 @@ class Mage_Catalog_Model_Resource_Product_Attribute_Backend_Tierprice extends Ma } /** - * Load Tier Prices for product + * Add qty column * - * @param int $productId - * @param int $websiteId - * @return Mage_Catalog_Model_Resource_Product_Attribute_Backend_Tierprice + * @param array $columns + * @return array */ - public function loadPriceData($productId, $websiteId = null) + protected function _loadPriceDataColumns($columns) { - $adapter = $this->_getReadAdapter(); - - $columns = array( - 'price_id' => $this->getIdFieldName(), - 'website_id' => 'website_id', - 'all_groups' => 'all_groups', - 'cust_group' => 'customer_group_id', - 'price_qty' => 'qty', - 'price' => 'value', - ); - - $select = $adapter->select() - ->from($this->getMainTable(), $columns) - ->where('entity_id=?', $productId) - ->order('qty'); - - if (!is_null($websiteId)) { - if ($websiteId == '0') { - $select->where('website_id = ?', $websiteId); - } else { - $select->where('website_id IN(?)', array(0, $websiteId)); - } - } - - return $adapter->fetchAll($select); - } - - /** - * Delete Tier Prices for product - * - * @param int $productId - * @param int $websiteId - * @param int $priceId - * @return int The number of affected rows - */ - public function deletePriceData($productId, $websiteId = null, $priceId = null) - { - $adapter = $this->_getWriteAdapter(); - - $conds = array( - $adapter->quoteInto('entity_id = ?', $productId) - ); - - if (!is_null($websiteId)) { - $conds[] = $adapter->quoteInto('website_id = ?', $websiteId); - } - - if (!is_null($priceId)) { - $conds[] = $adapter->quoteInto($this->getIdFieldName() . ' = ?', $priceId); - } - - $where = implode(' AND ', $conds); - - return $adapter->delete($this->getMainTable(), $where); + $columns = parent::_loadPriceDataColumns($columns); + $columns['price_qty'] = 'qty'; + return $columns; } /** - * Save tier price object + * Order by qty * - * @param Varien_Object $priceObject - * @return Mage_Catalog_Model_Resource_Product_Attribute_Backend_Tierprice + * @param Varien_Db_Select $select + * @return Varien_Db_Select */ - public function savePriceData(Varien_Object $priceObject) + protected function _loadPriceDataSelect($select) { - $adapter = $this->_getWriteAdapter(); - $data = $this->_prepareDataForTable($priceObject, $this->getMainTable()); - - if (!empty($data[$this->getIdFieldName()])) { - $where = $adapter->quoteInto($this->getIdFieldName() . ' = ?', $data[$this->getIdFieldName()]); - unset($data[$this->getIdFieldName()]); - $adapter->update($this->getMainTable(), $data, $where); - } else { - $adapter->insert($this->getMainTable(), $data); - } - return $this; + $select->order('qty'); + return $select; } } diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Attribute/Backend/Urlkey.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Attribute/Backend/Urlkey.php index 9a238ead17ddd282300d2b8d2e7442e01a6472f1..1e17780ca2a4d03ab1dc8750bbe54d98c6c287ef 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Attribute/Backend/Urlkey.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Attribute/Backend/Urlkey.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Attribute/Collection.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Attribute/Collection.php index c7cf5fdf8d2eb9ba81eea68d7e7363e760b52019..d00f2b62b978fcf89bc881cba4b7a862495f0a8a 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Attribute/Collection.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Attribute/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -72,9 +72,10 @@ class Mage_Catalog_Model_Resource_Product_Attribute_Collection } /** - * Specify attribute entity type filter + * Specify attribute entity type filter. + * Entity type is defined. * - * @param int $typeId + * @param int $typeId * @return Mage_Catalog_Model_Resource_Product_Attribute_Collection */ public function setEntityTypeFilter($typeId) @@ -173,11 +174,13 @@ class Mage_Catalog_Model_Resource_Product_Attribute_Collection 'additional_table.is_searchable = 1', 'additional_table.is_visible_in_advanced_search = 1', 'additional_table.is_filterable > 0', - 'additional_table.is_filterable_in_search = 1' + 'additional_table.is_filterable_in_search = 1', + 'additional_table.used_for_sort_by = 1' ); if ($addRequiredCodes) { - $conditions[] = $this->getConnection()->quoteInto('main_table.attribute_code IN (?)', array('status', 'visibility')); + $conditions[] = $this->getConnection()->quoteInto('main_table.attribute_code IN (?)', + array('status', 'visibility')); } $this->getSelect()->where(sprintf('(%s)', implode(' OR ', $conditions))); diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Collection.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Collection.php index d1367a705c4f9ab6238926ea56f9530217800d30..b0492af8dd7eabaf0d070ab4115f9c35b817d0b6 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Collection.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -1458,6 +1458,17 @@ class Mage_Catalog_Model_Resource_Product_Collection extends Mage_Catalog_Model_ * @return Mage_Catalog_Model_Resource_Product_Collection */ protected function _productLimitationJoinPrice() + { + return $this->_productLimitationPrice(); + } + + /** + * Join Product Price Table with left-join possibility + * + * @see Mage_Catalog_Model_Resource_Product_Collection::_productLimitationJoinPrice() + * @return Mage_Catalog_Model_Resource_Product_Collection + */ + protected function _productLimitationPrice($joinLeft = false) { $filters = $this->_productLimitationFilters; if (empty($filters['use_price_index'])) { @@ -1480,11 +1491,12 @@ class Mage_Catalog_Model_Resource_Product_Collection extends Mage_Catalog_Model_ $least, 'price_index.min_price'); $colls = array('price', 'tax_class_id', 'final_price', 'minimal_price' => $minimalExpr , 'min_price', 'max_price', 'tier_price'); - $select->join( - array('price_index' => $this->getTable('catalog_product_index_price')), - $joinCond, - $colls - ); + $tableName = array('price_index' => $this->getTable('catalog_product_index_price')); + if ($joinLeft) { + $select->joinLeft($tableName, $joinCond, $colls); + } else { + $select->join($tableName, $joinCond, $colls); + } // Set additional field filters foreach ($this->_priceDataFieldFilters as $filterData) { $select->where(call_user_func_array('sprintf', $filterData)); diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Compare/Item.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Compare/Item.php index b545d410c1ba811209d126af34f7b3828a1e7ad2..6ecf33ad949752d0170fd65486c683a6346aa2be 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Compare/Item.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Compare/Item.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Compare/Item/Collection.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Compare/Item/Collection.php index 38f1b555b4cd11960bdbc68bf672be7b10a832ad..5285c85d9565ba179bb372fb1e853cb8a5db86bd 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Compare/Item/Collection.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Compare/Item/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Flat.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Flat.php index 141a87dfb1e38bf8de2909a4382ff1174bc38e51..77b096d86cbc6e198281487f353b2ac03ba8cd79 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Flat.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Flat.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Flat/Indexer.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Flat/Indexer.php index ebece7e05838c011fd39f7d802397f05722443ef..8fb31af465a6b78498d46be70e2690ca9b9b8e90 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Flat/Indexer.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Flat/Indexer.php @@ -1,5 +1,5 @@ -<?php -/** +<?php +/** * Magento * * NOTICE OF LICENSE @@ -17,1322 +17,1314 @@ * Do not edit or add to this file if you wish to upgrade Magento to newer * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. - * - * @category Mage - * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * + * @category Mage + * @package Mage_Catalog + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - - -/** - * Catalog Product Flat Indexer Resource Model - * - * @category Mage - * @package Mage_Catalog - * @author Magento Core Team <core@magentocommerce.com> - */ -class Mage_Catalog_Model_Resource_Product_Flat_Indexer extends Mage_Index_Model_Resource_Abstract -{ - const XML_NODE_MAX_INDEX_COUNT = 'global/catalog/product/flat/max_index_count'; - const XML_NODE_ATTRIBUTE_NODES = 'global/catalog/product/flat/attribute_nodes'; - - /** - * Attribute codes for flat - * - * @var array - */ - protected $_attributeCodes; - - /** - * Attribute objects for flat cache - * - * @var array - */ - protected $_attributes; - - /** - * Required system attributes for preload - * - * @var array - */ - protected $_systemAttributes = array('status', 'required_options', 'tax_class_id', 'weight'); - - /** - * Eav Catalog_Product Entity Type Id - * - * @var int - */ - protected $_entityTypeId; - - /** - * Flat table columns cache - * - * @var array - */ - protected $_columns; - - /** - * Flat table indexes cache - * - * @var array - */ - protected $_indexes; - - /** - * Product Type Instances cache - * - * @var array - */ - protected $_productTypes; - - /** - * Exists flat tables cache - * - * @var array - */ - protected $_existsFlatTables = array(); - - /** - * Flat tables which were prepared - * - * @var array - */ - protected $_preparedFlatTables = array(); - - /** - * Initialize connection - * - */ - protected function _construct() - { - $this->_init('catalog_product_entity', 'entity_id'); - } - - /** - * Rebuild Catalog Product Flat Data - * - * @param Mage_Core_Model_Store|int $store - * @return Mage_Catalog_Model_Resource_Product_Flat_Indexer - */ - public function rebuild($store = null) - { - if ($store === null) { - foreach (Mage::app()->getStores() as $store) { - $this->rebuild($store->getId()); - } - $flag = $this->getFlatHelper()->getFlag(); - $flag->setIsBuild(true)->save(); - - return $this; - } - - $storeId = (int)Mage::app()->getStore($store)->getId(); - - $this->prepareFlatTable($storeId); - $this->cleanNonWebsiteProducts($storeId); - $this->updateStaticAttributes($storeId); - $this->updateEavAttributes($storeId); - $this->updateEventAttributes($storeId); - $this->updateRelationProducts($storeId); - $this->cleanRelationProducts($storeId); - - return $this; - } - - /** - * Retrieve Catalog Product Flat helper - * - * @return Mage_Catalog_Helper_Product_Flat - */ - public function getFlatHelper() - { - return Mage::helper('Mage_Catalog_Helper_Product_Flat'); - } - - /** - * Retrieve attribute codes using for flat - * - * @return array - */ - public function getAttributeCodes() - { - if ($this->_attributeCodes === null) { - $adapter = $this->_getReadAdapter(); - $this->_attributeCodes = array(); - - $attributeNodes = Mage::getConfig() - ->getNode(self::XML_NODE_ATTRIBUTE_NODES) - ->children(); - foreach ($attributeNodes as $node) { - $attributes = Mage::getConfig()->getNode((string)$node)->asArray(); - $attributes = array_keys($attributes); - $this->_systemAttributes = array_unique(array_merge($attributes, $this->_systemAttributes)); - } - - $bind = array( - 'backend_type' => Mage_Eav_Model_Entity_Attribute_Abstract::TYPE_STATIC, - 'entity_type_id' => $this->getEntityTypeId() - ); - - $select = $adapter->select() - ->from(array('main_table' => $this->getTable('eav_attribute'))) - ->join( - array('additional_table' => $this->getTable('catalog_eav_attribute')), - 'additional_table.attribute_id = main_table.attribute_id' - ) - ->where('main_table.entity_type_id = :entity_type_id'); - $whereCondition = array( - 'main_table.backend_type = :backend_type', - $adapter->quoteInto('additional_table.is_used_for_promo_rules = ?', 1), - $adapter->quoteInto('additional_table.used_in_product_listing = ?', 1), - $adapter->quoteInto('additional_table.used_for_sort_by = ?', 1), - $adapter->quoteInto('main_table.attribute_code IN(?)', $this->_systemAttributes) - ); - if ($this->getFlatHelper()->isAddFilterableAttributes()) { - $whereCondition[] = $adapter->quoteInto('additional_table.is_filterable > ?', 0); - } - - $select->where(implode(' OR ', $whereCondition)); - $attributesData = $adapter->fetchAll($select, $bind); - Mage::getSingleton('Mage_Eav_Model_Config') - ->importAttributesData($this->getEntityType(), $attributesData); - - foreach ($attributesData as $data) { - $this->_attributeCodes[$data['attribute_id']] = $data['attribute_code']; - } - unset($attributesData); - } - - return $this->_attributeCodes; - } - - /** - * Retrieve entity type - * - * @return string - */ - public function getEntityType() - { - return Mage_Catalog_Model_Product::ENTITY; - } - - /** - * Retrieve Catalog Entity Type Id - * - * @return int - */ - public function getEntityTypeId() - { - if ($this->_entityTypeId === null) { - $this->_entityTypeId = Mage::getResourceModel('Mage_Catalog_Model_Resource_Config') - ->getEntityTypeId(); - } - return $this->_entityTypeId; - } - - /** - * Retrieve attribute objects for flat - * - * @return array - */ - public function getAttributes() - { - if ($this->_attributes === null) { - $this->_attributes = array(); - $attributeCodes = $this->getAttributeCodes(); - $entity = Mage::getSingleton('Mage_Eav_Model_Config') - ->getEntityType($this->getEntityType()) - ->getEntity(); - - foreach ($attributeCodes as $attributeCode) { - $attribute = Mage::getSingleton('Mage_Eav_Model_Config') - ->getAttribute($this->getEntityType(), $attributeCode) - ->setEntity($entity); - try { - // check if exists source and backend model. - // To prevent exception when some module was disabled - $attribute->usesSource() && $attribute->getSource(); - $attribute->getBackend(); - $this->_attributes[$attributeCode] = $attribute; - } catch (Exception $e) { - Mage::logException($e); - } - } - } - - return $this->_attributes; - } - - /** - * Retrieve loaded attribute by code - * - * @param string $attributeCode - * @throws Mage_Core_Exception - * @return Mage_Eav_Model_Entity_Attribute - */ - public function getAttribute($attributeCode) - { - $attributes = $this->getAttributes(); - if (!isset($attributes[$attributeCode])) { - $attribute = Mage::getModel('Mage_Catalog_Model_Resource_Eav_Attribute') - ->loadByCode($this->getEntityTypeId(), $attributeCode); - if (!$attribute->getId()) { - Mage::throwException(Mage::helper('Mage_Catalog_Helper_Data')->__('Invalid attribute %s', $attributeCode)); - } - $entity = Mage::getSingleton('Mage_Eav_Model_Config') - ->getEntityType($this->getEntityType()) - ->getEntity(); - $attribute->setEntity($entity); - - return $attribute; - } - - return $attributes[$attributeCode]; - } - - /** - * Retrieve Catalog Product Flat Table name - * - * @param int $storeId - * @return string - */ - public function getFlatTableName($storeId) - { - return sprintf('%s_%s', $this->getTable('catalog_product_flat'), $storeId); - } - - /** - * Retrieve catalog product flat columns array in old format (used before MMDB support) - * - * @return array - */ - protected function _getFlatColumnsOldDefinition() - { - $columns = array(); - $columns['entity_id'] = array( - 'type' => 'int(10)', - 'unsigned' => true, - 'is_null' => false, - 'default' => null, - 'extra' => null - ); - if ($this->getFlatHelper()->isAddChildData()) { - $columns['child_id'] = array( - 'type' => 'int(10)', - 'unsigned' => true, - 'is_null' => true, - 'default' => null, - 'extra' => null - ); - $columns['is_child'] = array( - 'type' => 'tinyint(1)', - 'unsigned' => true, - 'is_null' => false, - 'default' => 0, - 'extra' => null - ); - } - $columns['attribute_set_id'] = array( - 'type' => 'smallint(5)', - 'unsigned' => true, - 'is_null' => false, - 'default' => 0, - 'extra' => null - ); - $columns['type_id'] = array( - 'type' => 'varchar(32)', - 'unsigned' => false, - 'is_null' => false, - 'default' => Mage_Catalog_Model_Product_Type::TYPE_SIMPLE, - 'extra' => null - ); - - return $columns; - } - - /** - * Retrieve catalog product flat columns array in DDL format - * - * @return array - */ - protected function _getFlatColumnsDdlDefinition() - { - $columns = array(); - $columns['entity_id'] = array( - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'length' => null, - 'unsigned' => true, - 'nullable' => false, - 'default' => false, - 'primary' => true, - 'comment' => 'Entity Id' - ); - if ($this->getFlatHelper()->isAddChildData()) { - $columns['child_id'] = array( - 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, - 'length' => null, - 'unsigned' => true, - 'nullable' => true, - 'default' => null, - 'primary' => true, - 'comment' => 'Child Id' - ); - $columns['is_child'] = array( - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'length' => 1, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Checks If Entity Is Child' - ); - } - $columns['attribute_set_id'] = array( - 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, - 'length' => 5, - 'unsigned' => true, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Attribute Set Id' - ); - $columns['type_id'] = array( - 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, - 'length' => 32, - 'unsigned' => false, - 'nullable' => false, - 'default' => Mage_Catalog_Model_Product_Type::TYPE_SIMPLE, - 'comment' => 'Type Id' - ); - - return $columns; - } - - /** - * Retrieve catalog product flat table columns array - * - * @return array - */ - public function getFlatColumns() - { - if ($this->_columns === null) { - if (Mage::helper('Mage_Core_Helper_Data')->useDbCompatibleMode()) { - $this->_columns = $this->_getFlatColumnsOldDefinition(); - } else { - $this->_columns = $this->_getFlatColumnsDdlDefinition(); - } - - foreach ($this->getAttributes() as $attribute) { - /** @var $attribute Mage_Eav_Model_Entity_Attribute_Abstract */ - $columns = $attribute - ->setFlatAddFilterableAttributes($this->getFlatHelper()->isAddFilterableAttributes()) - ->setFlatAddChildData($this->getFlatHelper()->isAddChildData()) - ->getFlatColumns(); - if ($columns !== null) { - $this->_columns = array_merge($this->_columns, $columns); - } - } - - $columnsObject = new Varien_Object(); - $columnsObject->setColumns($this->_columns); - Mage::dispatchEvent('catalog_product_flat_prepare_columns', - array('columns' => $columnsObject) - ); - $this->_columns = $columnsObject->getColumns(); - } - - return $this->_columns; - } - - /** - * Retrieve catalog product flat table indexes array - * - * @return array - */ - public function getFlatIndexes() - { - if ($this->_indexes === null) { - $this->_indexes = array(); - - if ($this->getFlatHelper()->isAddChildData()) { - $this->_indexes['PRIMARY'] = array( - 'type' => Varien_Db_Adapter_Interface::INDEX_TYPE_PRIMARY, - 'fields' => array('entity_id', 'child_id') - ); - $this->_indexes['IDX_CHILD'] = array( - 'type' => Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX, - 'fields' => array('child_id') - ); - $this->_indexes['IDX_IS_CHILD'] = array( - 'type' => Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX, - 'fields' => array('entity_id', 'is_child') - ); - } else { - $this->_indexes['PRIMARY'] = array( - 'type' => Varien_Db_Adapter_Interface::INDEX_TYPE_PRIMARY, - 'fields' => array('entity_id') - ); - } - $this->_indexes['IDX_TYPE_ID'] = array( - 'type' => Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX, - 'fields' => array('type_id') - ); - $this->_indexes['IDX_ATTRIBUTE_SET'] = array( - 'type' => Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX, - 'fields' => array('attribute_set_id') - ); - - foreach ($this->getAttributes() as $attribute) { - /** @var $attribute Mage_Eav_Model_Entity_Attribute */ - $indexes = $attribute - ->setFlatAddFilterableAttributes($this->getFlatHelper()->isAddFilterableAttributes()) - ->setFlatAddChildData($this->getFlatHelper()->isAddChildData()) - ->getFlatIndexes(); - if ($indexes !== null) { - $this->_indexes = array_merge($this->_indexes, $indexes); - } - } - - $indexesObject = new Varien_Object(); - $indexesObject->setIndexes($this->_indexes); - Mage::dispatchEvent('catalog_product_flat_prepare_indexes', array( - 'indexes' => $indexesObject - )); - $this->_indexes = $indexesObject->getIndexes(); - } - - return $this->_indexes; - } - - /** - * Compare Flat style with Describe style columns - * If column a different - return false - * - * @param array $column - * @param array $describe - * @return bool - */ - protected function _compareColumnProperties($column, $describe) - { - return Mage::getResourceHelper('Mage_Catalog')->compareIndexColumnProperties($column, $describe); - } - - /** - * Retrieve UNIQUE HASH for a Table foreign key - * - * @param string $priTableName the target table name - * @param string $priColumnName the target table column name - * @param string $refTableName the reference table name - * @param string $refColumnName the reference table column name - * @return string - */ - public function getFkName($priTableName, $priColumnName, $refTableName, $refColumnName) - { - return Mage::getSingleton('Mage_Core_Model_Resource') - ->getFkName($priTableName, $priColumnName, $refTableName, $refColumnName); - } - - /** - * Prepare flat table for store - * - * @param int $storeId - * @throws Mage_Core_Exception - * @return Mage_Catalog_Model_Resource_Product_Flat_Indexer - */ - public function prepareFlatTable($storeId) - { - if (isset($this->_preparedFlatTables[$storeId])) { - return $this; - } - $adapter = $this->_getWriteAdapter(); - $tableName = $this->getFlatTableName($storeId); - - // Extract columns we need to have in flat table - $columns = $this->getFlatColumns(); - if (Mage::helper('Mage_Core_Helper_Data')->useDbCompatibleMode()) { - /* Convert old format of flat columns to new MMDB format that uses DDL types and definitions */ - foreach ($columns as $key => $column) { - $columns[$key] = Mage::getResourceHelper('Mage_Core')->convertOldColumnDefinition($column); - } - } - - // Extract indexes we need to have in flat table - $indexesNeed = $this->getFlatIndexes(); - - $maxIndex = Mage::getConfig()->getNode(self::XML_NODE_MAX_INDEX_COUNT); - if (count($indexesNeed) > $maxIndex) { - Mage::throwException(Mage::helper('Mage_Catalog_Helper_Data')->__("The Flat Catalog module has a limit of %2\$d filterable and/or sortable attributes. Currently there are %1\$d of them. Please reduce the number of filterable/sortable attributes in order to use this module", count($indexesNeed), $maxIndex)); - } - - // Process indexes to create names for them in MMDB-style and reformat to common index definition - $indexKeys = array(); - $indexProps = array_values($indexesNeed); - $upperPrimaryKey = strtoupper(Varien_Db_Adapter_Interface::INDEX_TYPE_PRIMARY); - foreach ($indexProps as $i => $indexProp) { - $indexName = $adapter->getIndexName($tableName, $indexProp['fields'], $indexProp['type']); - $indexProp['type'] = strtoupper($indexProp['type']); - if ($indexProp['type'] == $upperPrimaryKey) { - $indexKey = $upperPrimaryKey; - } else { - $indexKey = $indexName; - } - - $indexProps[$i] = array( - 'KEY_NAME' => $indexName, - 'COLUMNS_LIST' => $indexProp['fields'], - 'INDEX_TYPE' => strtolower($indexProp['type']) - ); - $indexKeys[$i] = $indexKey; - } - $indexesNeed = array_combine($indexKeys, $indexProps); // Array with index names as keys, except for primary - - // Foreign keys - $foreignEntityKey = $this->getFkName($tableName, 'entity_id', 'catalog_product_entity', 'entity_id'); - $foreignChildKey = $this->getFkName($tableName, 'child_id', 'catalog_product_entity', 'entity_id'); - - // Create table or modify existing one - if (!$this->_isFlatTableExists($storeId)) { - /** @var $table Varien_Db_Ddl_Table */ - $table = $adapter->newTable($tableName); - foreach ($columns as $fieldName => $fieldProp) { - $table->addColumn( - $fieldName, - $fieldProp['type'], - isset($fieldProp['length']) ? $fieldProp['length'] : null, - array( - 'nullable' => isset($fieldProp['nullable']) ? (bool)$fieldProp['nullable'] : false, - 'unsigned' => isset($fieldProp['unsigned']) ? (bool)$fieldProp['unsigned'] : false, - 'default' => isset($fieldProp['default']) ? $fieldProp['default'] : false, - 'primary' => false, - ), - isset($fieldProp['comment']) ? $fieldProp['comment'] : $fieldName - ); - } - - foreach ($indexesNeed as $indexProp) { - $table->addIndex($indexProp['KEY_NAME'], $indexProp['COLUMNS_LIST'], - array('type' => $indexProp['INDEX_TYPE'])); - } - - $table->addForeignKey($foreignEntityKey, - 'entity_id', $this->getTable('catalog_product_entity'), 'entity_id', - Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE); - - if ($this->getFlatHelper()->isAddChildData()) { - $table->addForeignKey($foreignChildKey, - 'child_id', $this->getTable('catalog_product_entity'), 'entity_id', - Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE); - } - $table->setComment("Catalog Product Flat (Store {$storeId})"); - - $adapter->createTable($table); - - $this->_existsFlatTables[$storeId] = true; - } else { - $adapter->resetDdlCache($tableName); - - // Sort columns into added/altered/dropped lists - $describe = $adapter->describeTable($tableName); - $addColumns = array_diff_key($columns, $describe); - $dropColumns = array_diff_key($describe, $columns); - $modifyColumns = array(); - foreach ($columns as $field => $fieldProp) { - if (isset($describe[$field]) && !$this->_compareColumnProperties($fieldProp, $describe[$field])) { - $modifyColumns[$field] = $fieldProp; - } - } - - // Sort indexes into added/dropped lists. Altered indexes are put into both lists. - $addIndexes = array(); - $dropIndexes = array(); - $indexesNow = $adapter->getIndexList($tableName); // Note: primary is always stored under 'PRIMARY' key - $newIndexes = $indexesNeed; - foreach ($indexesNow as $key => $indexNow) { - if (isset($indexesNeed[$key])) { - $indexNeed = $indexesNeed[$key]; - if (($indexNeed['INDEX_TYPE'] != $indexNow['INDEX_TYPE']) - || ($indexNeed['COLUMNS_LIST'] != $indexNow['COLUMNS_LIST'])) { - $dropIndexes[$key] = $indexNow; - $addIndexes[$key] = $indexNeed; - } - unset($newIndexes[$key]); - } else { - $dropIndexes[$key] = $indexNow; - } - } - $addIndexes = $addIndexes + $newIndexes; - - // Compose contstraints - $addConstraints = array(); - $addConstraints[$foreignEntityKey] = array( - 'table_index' => 'entity_id', - 'ref_table' => $this->getTable('catalog_product_entity'), - 'ref_index' => 'entity_id', - 'on_update' => Varien_Db_Ddl_Table::ACTION_CASCADE, - 'on_delete' => Varien_Db_Ddl_Table::ACTION_CASCADE - ); - - // Additional data from childs - $isAddChildData = $this->getFlatHelper()->isAddChildData(); - if (!$isAddChildData && isset($describe['is_child'])) { - $adapter->delete($tableName, array('is_child = ?' => 1)); - $adapter->dropForeignKey($tableName, $foreignChildKey); - } - if ($isAddChildData && !isset($describe['is_child'])) { - $adapter->delete($tableName); - $dropIndexes['PRIMARY'] = $indexesNow['PRIMARY']; - $addIndexes['PRIMARY'] = $indexesNeed['PRIMARY']; - - $addConstraints[$foreignChildKey] = array( - 'table_index' => 'child_id', - 'ref_table' => $this->getTable('catalog_product_entity'), - 'ref_index' => 'entity_id', - 'on_update' => Varien_Db_Ddl_Table::ACTION_CASCADE, - 'on_delete' => Varien_Db_Ddl_Table::ACTION_CASCADE - ); - } - - // Drop constraints - foreach (array_keys($adapter->getForeignKeys($tableName)) as $constraintName) { - $adapter->dropForeignKey($tableName, $constraintName); - } - - // Drop indexes - foreach ($dropIndexes as $indexProp) { - $adapter->dropIndex($tableName, $indexProp['KEY_NAME']); - } - - // Drop columns - foreach (array_keys($dropColumns) as $columnName) { - $adapter->dropColumn($tableName, $columnName); - } - - // Modify columns - foreach ($modifyColumns as $columnName => $columnProp) { - $columnProp = array_change_key_case($columnProp, CASE_UPPER); - if (!isset($columnProp['COMMENT'])) { - $columnProp['COMMENT'] = ucwords(str_replace('_', ' ', $columnName)); - } - $adapter->changeColumn($tableName, $columnName, $columnName, $columnProp); - } - - // Add columns - foreach ($addColumns as $columnName => $columnProp) { - $columnProp = array_change_key_case($columnProp, CASE_UPPER); - if (!isset($columnProp['COMMENT'])) { - $columnProp['COMMENT'] = ucwords(str_replace('_', ' ', $columnName)); - } - $adapter->addColumn($tableName, $columnName, $columnProp); - } - - // Add indexes - foreach ($addIndexes as $indexProp) { - $adapter->addIndex($tableName, $indexProp['KEY_NAME'], $indexProp['COLUMNS_LIST'], - $indexProp['INDEX_TYPE']); - } - - // Add constraints - foreach ($addConstraints as $constraintName => $constraintProp) { - $adapter->addForeignKey($constraintName, $tableName, - $constraintProp['table_index'], - $constraintProp['ref_table'], - $constraintProp['ref_index'], - $constraintProp['on_delete'], - $constraintProp['on_update'] - ); - } - } - - $this->_preparedFlatTables[$storeId] = true; - - return $this; - } - - /** - * Add or Update static attributes - * - * @param int $storeId - * @param int|array $productIds update only product(s) - * @return Mage_Catalog_Model_Resource_Product_Flat_Indexer - */ - public function updateStaticAttributes($storeId, $productIds = null) - { - if (!$this->_isFlatTableExists($storeId)) { - return $this; - } - $adapter = $this->_getWriteAdapter(); - $websiteId = (int)Mage::app()->getStore($storeId)->getWebsite()->getId(); - /* @var $status Mage_Eav_Model_Entity_Attribute */ - $status = $this->getAttribute('status'); - - $fieldList = array('entity_id', 'type_id', 'attribute_set_id'); - $colsList = array('entity_id', 'type_id', 'attribute_set_id'); - if ($this->getFlatHelper()->isAddChildData()) { - $fieldList = array_merge($fieldList, array('child_id', 'is_child')); - $isChild = new Zend_Db_Expr('0'); - $colsList = array_merge($colsList, array('entity_id', $isChild)); - } - - $columns = $this->getFlatColumns(); - $bind = array( - 'website_id' => $websiteId, - 'store_id' => $storeId, - 'entity_type_id' => (int)$status->getEntityTypeId(), - 'attribute_id' => (int)$status->getId() - ); - - $fieldExpr = $adapter->getCheckSql('t2.value_id > 0', 't2.value', 't1.value'); - $select = $this->_getWriteAdapter()->select() - ->from(array('e' => $this->getTable('catalog_product_entity')), $colsList) - ->join( - array('wp' => $this->getTable('catalog_product_website')), - 'e.entity_id = wp.product_id AND wp.website_id = :website_id', - array()) - ->joinLeft( - array('t1' => $status->getBackend()->getTable()), - 'e.entity_id = t1.entity_id', - array()) - ->joinLeft( - array('t2' => $status->getBackend()->getTable()), - 't2.entity_id = t1.entity_id' - . ' AND t1.entity_type_id = t2.entity_type_id' - . ' AND t1.attribute_id = t2.attribute_id' - . ' AND t2.store_id = :store_id', - array()) - ->where('t1.entity_type_id = :entity_type_id') - ->where('t1.attribute_id = :attribute_id') - ->where('t1.store_id = ?', Mage_Core_Model_App::ADMIN_STORE_ID) - ->where("{$fieldExpr} = ?", Mage_Catalog_Model_Product_Status::STATUS_ENABLED); - foreach ($this->getAttributes() as $attributeCode => $attribute) { - /** @var $attribute Mage_Eav_Model_Entity_Attribute */ - if ($attribute->getBackend()->getType() == 'static') { - if (!isset($columns[$attributeCode])) { - continue; - } - $fieldList[] = $attributeCode; - $select->columns($attributeCode, 'e'); - } - } - - if ($productIds !== null) { - $select->where('e.entity_id IN(?)', $productIds); - } - - $sql = $select->insertFromSelect($this->getFlatTableName($storeId), $fieldList); - $adapter->query($sql, $bind); - - return $this; - } - - /** - * Remove non website products - * - * @param int $storeId - * @param int|array $productIds - * @return Mage_Catalog_Model_Resource_Product_Flat_Indexer - */ - public function cleanNonWebsiteProducts($storeId, $productIds = null) - { - if (!$this->_isFlatTableExists($storeId)) { - return $this; - } - - $websiteId = (int)Mage::app()->getStore($storeId)->getWebsite()->getId(); - $adapter = $this->_getWriteAdapter(); - - $joinCondition = array( - 'e.entity_id = wp.product_id', - 'wp.website_id = :website_id' - ); - if ($this->getFlatHelper()->isAddChildData()) { - $joinCondition[] = 'e.child_id = wp.product_id'; - } - $bind = array('website_id' => $websiteId); - $select = $adapter->select() - ->from(array('e' => $this->getFlatTableName($storeId)), null) - ->joinLeft( - array('wp' => $this->getTable('catalog_product_website')), - implode(' AND ', $joinCondition), - array()); - if ($productIds !== null) { - $condition = array( - $adapter->quoteInto('e.entity_id IN(?)', $productIds) - ); - if ($this->getFlatHelper()->isAddChildData()) { - $condition[] = $adapter->quoteInto('e.child_id IN(?)', $productIds); - } - $select->where(implode(' OR ', $condition)); - } - - $sql = $select->deleteFromSelect('e'); - $adapter->query($sql, $bind); - - return $this; - } - - /** - * Update attribute flat data - * - * @param Mage_Eav_Model_Entity_Attribute $attribute - * @param int $storeId - * @param int|array $productIds update only product(s) - * @return Mage_Catalog_Model_Resource_Product_Flat_Indexer - */ - public function updateAttribute($attribute, $storeId, $productIds = null) - { - if (!$this->_isFlatTableExists($storeId)) { - return $this; - } - $adapter = $this->_getWriteAdapter(); - $flatTableName = $this->getFlatTableName($storeId); - $describe = $adapter->describeTable($flatTableName); - - if ($attribute->getBackend()->getType() == 'static') { - if (!isset($describe[$attribute->getAttributeCode()])) { - return $this; - } - - $select = $adapter->select() - ->join( - array('main_table' => $this->getTable('catalog_product_entity')), - 'main_table.entity_id = e.entity_id', - array($attribute->getAttributeCode() => 'main_table.' . $attribute->getAttributeCode()) - ); - if ($this->getFlatHelper()->isAddChildData()) { - $select->where('e.is_child = ?', 0); - } - if ($productIds !== null) { - $select->where('main_table.entity_id IN(?)', $productIds); - } - - $sql = $select->crossUpdateFromSelect(array('e' => $flatTableName)); - $adapter->query($sql); - } else { - $columns = $attribute->getFlatColumns(); - if (!$columns) { - return $this; - } - foreach (array_keys($columns) as $columnName) { - if (!isset($describe[$columnName])) { - return $this; - } - } - - $select = $attribute->getFlatUpdateSelect($storeId); - if ($select instanceof Varien_Db_Select) { - if ($productIds !== null) { - $select->where('e.entity_id IN(?)', $productIds); - } - - $sql = $select->crossUpdateFromSelect(array('e' => $flatTableName)); - $adapter->query($sql); - } - } - - return $this; - } - - /** - * Update non static EAV attributes flat data - * - * @param int $storeId - * @param int|array $productIds update only product(s) - * @return Mage_Catalog_Model_Resource_Product_Flat_Indexer - */ - public function updateEavAttributes($storeId, $productIds = null) - { - if (!$this->_isFlatTableExists($storeId)) { - return $this; - } - - foreach ($this->getAttributes() as $attribute) { - /* @var $attribute Mage_Eav_Model_Entity_Attribute */ - if ($attribute->getBackend()->getType() != 'static') { - $this->updateAttribute($attribute, $storeId, $productIds); - } - } - return $this; - } - - /** - * Update events observer attributes - * - * @param int $storeId - */ - public function updateEventAttributes($storeId = null) - { - Mage::dispatchEvent('catalog_product_flat_rebuild', array( - 'store_id' => $storeId, - 'table' => $this->getFlatTableName($storeId) - )); - } - - /** - * Retrieve Product Type Instances - * as key - type code, value - instance model - * - * @return array - */ - public function getProductTypeInstances() - { - if ($this->_productTypes === null) { - $this->_productTypes = array(); - $productEmulator = new Varien_Object(); - - foreach (array_keys(Mage_Catalog_Model_Product_Type::getTypes()) as $typeId) { - $productEmulator->setTypeId($typeId); - $this->_productTypes[$typeId] = Mage::getSingleton('Mage_Catalog_Model_Product_Type') - ->factory($productEmulator); - } - } - return $this->_productTypes; - } - - /** - * Update relation products - * - * @param int $storeId - * @param int|array $productIds Update child product(s) only - * @return Mage_Catalog_Model_Resource_Product_Flat_Indexer - */ - public function updateRelationProducts($storeId, $productIds = null) - { - if (!$this->getFlatHelper()->isAddChildData() || !$this->_isFlatTableExists($storeId)) { - return $this; - } - - $adapter = $this->_getWriteAdapter(); - - foreach ($this->getProductTypeInstances() as $typeInstance) { - if (!$typeInstance->isComposite()) { - continue; - } - $relation = $typeInstance->getRelationInfo(); - if ($relation - && $relation->getTable() - && $relation->getParentFieldName() - && $relation->getChildFieldName() - ) { - $columns = $this->getFlatColumns(); - $fieldList = array_keys($columns); - unset($columns['entity_id']); - unset($columns['child_id']); - unset($columns['is_child']); - - $select = $adapter->select() - ->from( - array('t' => $this->getTable($relation->getTable())), - array($relation->getParentFieldName(), $relation->getChildFieldName(), new Zend_Db_Expr('1'))) - ->join( - array('e' => $this->getFlatTableName($storeId)), - "e.entity_id = t.{$relation->getChildFieldName()}", - array_keys($columns) - ); - if ($relation->getWhere() !== null) { - $select->where($relation->getWhere()); - } - if ($productIds !== null) { - $cond = array( - $adapter->quoteInto("{$relation->getChildFieldName()} IN(?)", $productIds), - $adapter->quoteInto("{$relation->getParentFieldName()} IN(?)", $productIds) - ); - - $select->where(implode(' OR ', $cond)); - } - $sql = $select->insertFromSelect($this->getFlatTableName($storeId), $fieldList); - $adapter->query($sql); - } - } - - return $this; - } - - /** - * Update children data from parent - * - * @param int $storeId - * @param int|array $productIds - * @return Mage_Catalog_Model_Resource_Product_Flat_Indexer - */ - public function updateChildrenDataFromParent($storeId, $productIds = null) - { - if (!$this->getFlatHelper()->isAddChildData() || !$this->_isFlatTableExists($storeId)) { - return $this; - } - $adapter = $this->_getWriteAdapter(); - - $select = $adapter->select(); - foreach (array_keys($this->getFlatColumns()) as $columnName) { - if ($columnName == 'entity_id' || $columnName == 'child_id' || $columnName == 'is_child') { - continue; - } - $select->columns(array($columnName => new Zend_Db_Expr('t1.' . $columnName))); - } - $select - ->joinLeft( - array('t1' => $this->getFlatTableName($storeId)), - $adapter->quoteInto('t2.child_id = t1.entity_id AND t1.is_child = ?', 0), - array()) - ->where('t2.is_child = ?', 1); - - if ($productIds !== null) { - $select->where('t2.child_id IN(?)', $productIds); - } - - $sql = $select->crossUpdateFromSelect(array('t2' => $this->getFlatTableName($storeId))); - $adapter->query($sql); - - return $this; - } - - /** - * Clean unused relation products - * - * @param int $storeId - * @return Mage_Catalog_Model_Resource_Product_Flat_Indexer - */ - public function cleanRelationProducts($storeId) - { - if (!$this->getFlatHelper()->isAddChildData()) { - return $this; - } - - foreach ($this->getProductTypeInstances() as $typeInstance) { - if (!$typeInstance->isComposite()) { - continue; - } - $adapter = $this->_getWriteAdapter(); - $relation = $typeInstance->getRelationInfo(); - if ($relation - && $relation->getTable() - && $relation->getParentFieldName() - && $relation->getChildFieldName() - ) { - $select = $this->_getWriteAdapter()->select() - ->distinct(true) - ->from( - $this->getTable($relation->getTable()), - "{$relation->getParentFieldName()}" - ); - $joinLeftCond = array( - "e.entity_id = t.{$relation->getParentFieldName()}", - "e.child_id = t.{$relation->getChildFieldName()}" - ); - if ($relation->getWhere() !== null) { - $select->where($relation->getWhere()); - $joinLeftCond[] = $relation->getWhere(); - } - - $entitySelect = new Zend_Db_Expr($select->__toString()); - - $select = $adapter->select() - ->from(array('e' => $this->getFlatTableName($storeId)), null) - ->joinLeft( - array('t' => $this->getTable($relation->getTable())), - implode(' AND ', $joinLeftCond), - array()) - ->where('e.is_child = ?', 1) - ->where('e.entity_id IN(?)', $entitySelect) - ->where("t.{$relation->getChildFieldName()} IS NULL"); - - $sql = $select->deleteFromSelect('e'); - $adapter->query($sql); - } - } - - return $this; - } - - /** - * Remove product data from flat - * - * @param int|array $productIds - * @param int $storeId - * @return Mage_Catalog_Model_Resource_Product_Flat_Indexer - */ - public function removeProduct($productIds, $storeId) - { - if (!$this->_isFlatTableExists($storeId)) { - return $this; - } - $adapter = $this->_getWriteAdapter(); - $cond = array( - $adapter->quoteInto('entity_id IN(?)', $productIds) - ); - if ($this->getFlatHelper()->isAddChildData()) { - $cond[] = $adapter->quoteInto('child_id IN(?)', $productIds); - } - $cond = implode(' OR ', $cond); - $adapter->delete($this->getFlatTableName($storeId), $cond); - - return $this; - } - - /** - * Remove children from parent product - * - * @param int|array $productIds - * @param int $storeId - * @return Mage_Catalog_Model_Resource_Product_Flat_Indexer - */ - public function removeProductChildren($productIds, $storeId) - { - if (!$this->getFlatHelper()->isAddChildData()) { - return $this; - } - $whereExpr = array( - 'entity_id IN(?)' => $productIds, - 'is_child = ?' => 1 - ); - $this->_getWriteAdapter()->delete($this->getFlatTableName($storeId), $whereExpr); - - return $this; - } - - /** - * Update flat data for product - * - * @param int|array $productIds - * @param int $storeId - * @return Mage_Catalog_Model_Resource_Product_Flat_Indexer - */ - public function updateProduct($productIds, $storeId) - { - if (!$this->_isFlatTableExists($storeId)) { - return $this; - } - - $this->saveProduct($productIds, $storeId); - - Mage::dispatchEvent('catalog_product_flat_update_product', array( - 'store_id' => $storeId, - 'table' => $this->getFlatTableName($storeId), - 'product_ids' => $productIds - )); - - return $this; - } - - /** - * Save product(s) data for store - * - * @param int|array $productIds - * @param int $storeId - * @return Mage_Catalog_Model_Resource_Product_Flat_Indexer - */ - public function saveProduct($productIds, $storeId) - { - if (!$this->_isFlatTableExists($storeId)) { - return $this; - } - - $this->updateStaticAttributes($storeId, $productIds); - $this->updateEavAttributes($storeId, $productIds); - - return $this; - } - - /** - * Delete flat table process - * - * @param int $storeId - * @return Mage_Catalog_Model_Resource_Product_Flat_Indexer - */ - public function deleteFlatTable($storeId) - { - if ($this->_isFlatTableExists($storeId)) { - $this->_getWriteAdapter()->dropTable($this->getFlatTableName($storeId)); - } - - return $this; - } - - /** - * Check is flat table for store exists - * - * @param int $storeId - * @return bool - */ - protected function _isFlatTableExists($storeId) - { - if (!isset($this->_existsFlatTables[$storeId])) { - $tableName = $this->getFlatTableName($storeId); - $isTableExists = $this->_getWriteAdapter()->isTableExists($tableName); - - $this->_existsFlatTables[$storeId] = $isTableExists ? true : false; - } - - return $this->_existsFlatTables[$storeId]; - } - - /** - * Retrieve previous key from array by key - * - * @param array $array - * @param mixed $key - * @return mixed - */ - protected function _arrayPrevKey(array $array, $key) - { - $prev = false; - foreach (array_keys($array) as $k) { - if ($k == $key) { - return $prev; - } - $prev = $k; - } - return false; - } - - /** - * Retrieve next key from array by key - * - * @param array $array - * @param mixed $key - * @return mixed - */ - protected function _arrayNextKey(array $array, $key) - { - $next = false; - foreach (array_keys($array) as $k) { - if ($next === true) { - return $k; - } - if ($k == $key) { - $next = true; - } - } - return false; - } - - /** - * Prepare flat tables for all stores - * - * @return Mage_Catalog_Model_Resource_Product_Flat_Indexer - */ - public function prepareFlatTables() - { + */ + + +/** + * Catalog Product Flat Indexer Resource Model + * + * @category Mage + * @package Mage_Catalog + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Catalog_Model_Resource_Product_Flat_Indexer extends Mage_Index_Model_Resource_Abstract +{ + const XML_NODE_MAX_INDEX_COUNT = 'global/catalog/product/flat/max_index_count'; + const XML_NODE_ATTRIBUTE_NODES = 'global/catalog/product/flat/attribute_nodes'; + + /** + * Attribute codes for flat + * + * @var array + */ + protected $_attributeCodes; + + /** + * Attribute objects for flat cache + * + * @var array + */ + protected $_attributes; + + /** + * Required system attributes for preload + * + * @var array + */ + protected $_systemAttributes = array('status', 'required_options', 'tax_class_id', 'weight'); + + /** + * Eav Catalog_Product Entity Type Id + * + * @var int + */ + protected $_entityTypeId; + + /** + * Flat table columns cache + * + * @var array + */ + protected $_columns; + + /** + * Flat table indexes cache + * + * @var array + */ + protected $_indexes; + + /** + * Product Type Instances cache + * + * @var array + */ + protected $_productTypes; + + /** + * Exists flat tables cache + * + * @var array + */ + protected $_existsFlatTables = array(); + + /** + * Flat tables which were prepared + * + * @var array + */ + protected $_preparedFlatTables = array(); + + /** + * Initialize connection + * + */ + protected function _construct() + { + $this->_init('catalog_product_entity', 'entity_id'); + } + + /** + * Rebuild Catalog Product Flat Data + * + * @param Mage_Core_Model_Store|int $store + * @return Mage_Catalog_Model_Resource_Product_Flat_Indexer + */ + public function rebuild($store = null) + { + if ($store === null) { + foreach (Mage::app()->getStores() as $store) { + $this->rebuild($store->getId()); + } + $flag = $this->getFlatHelper()->getFlag(); + $flag->setIsBuild(true)->save(); + + return $this; + } + + $storeId = (int)Mage::app()->getStore($store)->getId(); + + $this->prepareFlatTable($storeId); + $this->cleanNonWebsiteProducts($storeId); + $this->updateStaticAttributes($storeId); + $this->updateEavAttributes($storeId); + $this->updateEventAttributes($storeId); + $this->updateRelationProducts($storeId); + $this->cleanRelationProducts($storeId); + + return $this; + } + + /** + * Retrieve Catalog Product Flat helper + * + * @return Mage_Catalog_Helper_Product_Flat + */ + public function getFlatHelper() + { + return Mage::helper('Mage_Catalog_Helper_Product_Flat'); + } + + /** + * Retrieve attribute codes using for flat + * + * @return array + */ + public function getAttributeCodes() + { + if ($this->_attributeCodes === null) { + $adapter = $this->_getReadAdapter(); + $this->_attributeCodes = array(); + + $attributeNodes = Mage::getConfig() + ->getNode(self::XML_NODE_ATTRIBUTE_NODES) + ->children(); + foreach ($attributeNodes as $node) { + $attributes = Mage::getConfig()->getNode((string)$node)->asArray(); + $attributes = array_keys($attributes); + $this->_systemAttributes = array_unique(array_merge($attributes, $this->_systemAttributes)); + } + + $bind = array( + 'backend_type' => Mage_Eav_Model_Entity_Attribute_Abstract::TYPE_STATIC, + 'entity_type_id' => $this->getEntityTypeId() + ); + + $select = $adapter->select() + ->from(array('main_table' => $this->getTable('eav_attribute'))) + ->join( + array('additional_table' => $this->getTable('catalog_eav_attribute')), + 'additional_table.attribute_id = main_table.attribute_id' + ) + ->where('main_table.entity_type_id = :entity_type_id'); + $whereCondition = array( + 'main_table.backend_type = :backend_type', + $adapter->quoteInto('additional_table.is_used_for_promo_rules = ?', 1), + $adapter->quoteInto('additional_table.used_in_product_listing = ?', 1), + $adapter->quoteInto('additional_table.used_for_sort_by = ?', 1), + $adapter->quoteInto('main_table.attribute_code IN(?)', $this->_systemAttributes) + ); + if ($this->getFlatHelper()->isAddFilterableAttributes()) { + $whereCondition[] = $adapter->quoteInto('additional_table.is_filterable > ?', 0); + } + + $select->where(implode(' OR ', $whereCondition)); + $attributesData = $adapter->fetchAll($select, $bind); + Mage::getSingleton('Mage_Eav_Model_Config') + ->importAttributesData($this->getEntityType(), $attributesData); + + foreach ($attributesData as $data) { + $this->_attributeCodes[$data['attribute_id']] = $data['attribute_code']; + } + unset($attributesData); + } + + return $this->_attributeCodes; + } + + /** + * Retrieve entity type + * + * @return string + */ + public function getEntityType() + { + return Mage_Catalog_Model_Product::ENTITY; + } + + /** + * Retrieve Catalog Entity Type Id + * + * @return int + */ + public function getEntityTypeId() + { + if ($this->_entityTypeId === null) { + $this->_entityTypeId = Mage::getResourceModel('Mage_Catalog_Model_Resource_Config') + ->getEntityTypeId(); + } + return $this->_entityTypeId; + } + + /** + * Retrieve attribute objects for flat + * + * @return array + */ + public function getAttributes() + { + if ($this->_attributes === null) { + $this->_attributes = array(); + $attributeCodes = $this->getAttributeCodes(); + $entity = Mage::getSingleton('Mage_Eav_Model_Config') + ->getEntityType($this->getEntityType()) + ->getEntity(); + + foreach ($attributeCodes as $attributeCode) { + $attribute = Mage::getSingleton('Mage_Eav_Model_Config') + ->getAttribute($this->getEntityType(), $attributeCode) + ->setEntity($entity); + try { + // check if exists source and backend model. + // To prevent exception when some module was disabled + $attribute->usesSource() && $attribute->getSource(); + $attribute->getBackend(); + $this->_attributes[$attributeCode] = $attribute; + } catch (Exception $e) { + Mage::logException($e); + } + } + } + + return $this->_attributes; + } + + /** + * Retrieve loaded attribute by code + * + * @param string $attributeCode + * @throws Mage_Core_Exception + * @return Mage_Eav_Model_Entity_Attribute + */ + public function getAttribute($attributeCode) + { + $attributes = $this->getAttributes(); + if (!isset($attributes[$attributeCode])) { + $attribute = Mage::getModel('Mage_Catalog_Model_Resource_Eav_Attribute') + ->loadByCode($this->getEntityTypeId(), $attributeCode); + if (!$attribute->getId()) { + Mage::throwException(Mage::helper('Mage_Catalog_Helper_Data')->__('Invalid attribute %s', $attributeCode)); + } + $entity = Mage::getSingleton('Mage_Eav_Model_Config') + ->getEntityType($this->getEntityType()) + ->getEntity(); + $attribute->setEntity($entity); + + return $attribute; + } + + return $attributes[$attributeCode]; + } + + /** + * Retrieve Catalog Product Flat Table name + * + * @param int $storeId + * @return string + */ + public function getFlatTableName($storeId) + { + return sprintf('%s_%s', $this->getTable('catalog_product_flat'), $storeId); + } + + /** + * Retrieve catalog product flat columns array in old format (used before MMDB support) + * + * @return array + */ + protected function _getFlatColumnsOldDefinition() + { + $columns = array(); + $columns['entity_id'] = array( + 'type' => 'int(10)', + 'unsigned' => true, + 'is_null' => false, + 'default' => null, + 'extra' => null + ); + if ($this->getFlatHelper()->isAddChildData()) { + $columns['child_id'] = array( + 'type' => 'int(10)', + 'unsigned' => true, + 'is_null' => true, + 'default' => null, + 'extra' => null + ); + $columns['is_child'] = array( + 'type' => 'tinyint(1)', + 'unsigned' => true, + 'is_null' => false, + 'default' => 0, + 'extra' => null + ); + } + $columns['attribute_set_id'] = array( + 'type' => 'smallint(5)', + 'unsigned' => true, + 'is_null' => false, + 'default' => 0, + 'extra' => null + ); + $columns['type_id'] = array( + 'type' => 'varchar(32)', + 'unsigned' => false, + 'is_null' => false, + 'default' => Mage_Catalog_Model_Product_Type::TYPE_SIMPLE, + 'extra' => null + ); + + return $columns; + } + + /** + * Retrieve catalog product flat columns array in DDL format + * + * @return array + */ + protected function _getFlatColumnsDdlDefinition() + { + $columns = array(); + $columns['entity_id'] = array( + 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, + 'length' => null, + 'unsigned' => true, + 'nullable' => false, + 'default' => false, + 'primary' => true, + 'comment' => 'Entity Id' + ); + if ($this->getFlatHelper()->isAddChildData()) { + $columns['child_id'] = array( + 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, + 'length' => null, + 'unsigned' => true, + 'nullable' => true, + 'default' => null, + 'primary' => true, + 'comment' => 'Child Id' + ); + $columns['is_child'] = array( + 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, + 'length' => 1, + 'unsigned' => true, + 'nullable' => false, + 'default' => '0', + 'comment' => 'Checks If Entity Is Child' + ); + } + $columns['attribute_set_id'] = array( + 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, + 'length' => 5, + 'unsigned' => true, + 'nullable' => false, + 'default' => '0', + 'comment' => 'Attribute Set Id' + ); + $columns['type_id'] = array( + 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, + 'length' => 32, + 'unsigned' => false, + 'nullable' => false, + 'default' => Mage_Catalog_Model_Product_Type::TYPE_SIMPLE, + 'comment' => 'Type Id' + ); + + return $columns; + } + + /** + * Retrieve catalog product flat table columns array + * + * @return array + */ + public function getFlatColumns() + { + if ($this->_columns === null) { + if (Mage::helper('Mage_Core_Helper_Data')->useDbCompatibleMode()) { + $this->_columns = $this->_getFlatColumnsOldDefinition(); + } else { + $this->_columns = $this->_getFlatColumnsDdlDefinition(); + } + + foreach ($this->getAttributes() as $attribute) { + /** @var $attribute Mage_Eav_Model_Entity_Attribute_Abstract */ + $columns = $attribute + ->setFlatAddFilterableAttributes($this->getFlatHelper()->isAddFilterableAttributes()) + ->setFlatAddChildData($this->getFlatHelper()->isAddChildData()) + ->getFlatColumns(); + if ($columns !== null) { + $this->_columns = array_merge($this->_columns, $columns); + } + } + + $columnsObject = new Varien_Object(); + $columnsObject->setColumns($this->_columns); + Mage::dispatchEvent('catalog_product_flat_prepare_columns', + array('columns' => $columnsObject) + ); + $this->_columns = $columnsObject->getColumns(); + } + + return $this->_columns; + } + + /** + * Retrieve catalog product flat table indexes array + * + * @return array + */ + public function getFlatIndexes() + { + if ($this->_indexes === null) { + $this->_indexes = array(); + + if ($this->getFlatHelper()->isAddChildData()) { + $this->_indexes['PRIMARY'] = array( + 'type' => Varien_Db_Adapter_Interface::INDEX_TYPE_PRIMARY, + 'fields' => array('entity_id', 'child_id') + ); + $this->_indexes['IDX_CHILD'] = array( + 'type' => Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX, + 'fields' => array('child_id') + ); + $this->_indexes['IDX_IS_CHILD'] = array( + 'type' => Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX, + 'fields' => array('entity_id', 'is_child') + ); + } else { + $this->_indexes['PRIMARY'] = array( + 'type' => Varien_Db_Adapter_Interface::INDEX_TYPE_PRIMARY, + 'fields' => array('entity_id') + ); + } + $this->_indexes['IDX_TYPE_ID'] = array( + 'type' => Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX, + 'fields' => array('type_id') + ); + $this->_indexes['IDX_ATTRIBUTE_SET'] = array( + 'type' => Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX, + 'fields' => array('attribute_set_id') + ); + + foreach ($this->getAttributes() as $attribute) { + /** @var $attribute Mage_Eav_Model_Entity_Attribute */ + $indexes = $attribute + ->setFlatAddFilterableAttributes($this->getFlatHelper()->isAddFilterableAttributes()) + ->setFlatAddChildData($this->getFlatHelper()->isAddChildData()) + ->getFlatIndexes(); + if ($indexes !== null) { + $this->_indexes = array_merge($this->_indexes, $indexes); + } + } + + $indexesObject = new Varien_Object(); + $indexesObject->setIndexes($this->_indexes); + Mage::dispatchEvent('catalog_product_flat_prepare_indexes', array( + 'indexes' => $indexesObject + )); + $this->_indexes = $indexesObject->getIndexes(); + } + + return $this->_indexes; + } + + /** + * Compare Flat style with Describe style columns + * If column a different - return false + * + * @param array $column + * @param array $describe + * @return bool + */ + protected function _compareColumnProperties($column, $describe) + { + return Mage::getResourceHelper('Mage_Catalog')->compareIndexColumnProperties($column, $describe); + } + + /** + * Retrieve UNIQUE HASH for a Table foreign key + * + * @param string $priTableName the target table name + * @param string $priColumnName the target table column name + * @param string $refTableName the reference table name + * @param string $refColumnName the reference table column name + * @return string + */ + public function getFkName($priTableName, $priColumnName, $refTableName, $refColumnName) + { + return Mage::getSingleton('Mage_Core_Model_Resource') + ->getFkName($priTableName, $priColumnName, $refTableName, $refColumnName); + } + + /** + * Prepare flat table for store + * + * @param int $storeId + * @throws Mage_Core_Exception + * @return Mage_Catalog_Model_Resource_Product_Flat_Indexer + */ + public function prepareFlatTable($storeId) + { + if (isset($this->_preparedFlatTables[$storeId])) { + return $this; + } + $adapter = $this->_getWriteAdapter(); + $tableName = $this->getFlatTableName($storeId); + + // Extract columns we need to have in flat table + $columns = $this->getFlatColumns(); + if (Mage::helper('Mage_Core_Helper_Data')->useDbCompatibleMode()) { + /* Convert old format of flat columns to new MMDB format that uses DDL types and definitions */ + foreach ($columns as $key => $column) { + $columns[$key] = Mage::getResourceHelper('Mage_Core')->convertOldColumnDefinition($column); + } + } + + // Extract indexes we need to have in flat table + $indexesNeed = $this->getFlatIndexes(); + + $maxIndex = Mage::getConfig()->getNode(self::XML_NODE_MAX_INDEX_COUNT); + if (count($indexesNeed) > $maxIndex) { + Mage::throwException(Mage::helper('Mage_Catalog_Helper_Data')->__("The Flat Catalog module has a limit of %2\$d filterable and/or sortable attributes. Currently there are %1\$d of them. Please reduce the number of filterable/sortable attributes in order to use this module", count($indexesNeed), $maxIndex)); + } + + // Process indexes to create names for them in MMDB-style and reformat to common index definition + $indexKeys = array(); + $indexProps = array_values($indexesNeed); + $upperPrimaryKey = strtoupper(Varien_Db_Adapter_Interface::INDEX_TYPE_PRIMARY); + foreach ($indexProps as $i => $indexProp) { + $indexName = $adapter->getIndexName($tableName, $indexProp['fields'], $indexProp['type']); + $indexProp['type'] = strtoupper($indexProp['type']); + if ($indexProp['type'] == $upperPrimaryKey) { + $indexKey = $upperPrimaryKey; + } else { + $indexKey = $indexName; + } + + $indexProps[$i] = array( + 'KEY_NAME' => $indexName, + 'COLUMNS_LIST' => $indexProp['fields'], + 'INDEX_TYPE' => strtolower($indexProp['type']) + ); + $indexKeys[$i] = $indexKey; + } + $indexesNeed = array_combine($indexKeys, $indexProps); // Array with index names as keys, except for primary + + // Foreign keys + $foreignEntityKey = $this->getFkName($tableName, 'entity_id', 'catalog_product_entity', 'entity_id'); + $foreignChildKey = $this->getFkName($tableName, 'child_id', 'catalog_product_entity', 'entity_id'); + + // Create table or modify existing one + if (!$this->_isFlatTableExists($storeId)) { + /** @var $table Varien_Db_Ddl_Table */ + $table = $adapter->newTable($tableName); + foreach ($columns as $fieldName => $fieldProp) { + $table->addColumn( + $fieldName, + $fieldProp['type'], + isset($fieldProp['length']) ? $fieldProp['length'] : null, + array( + 'nullable' => isset($fieldProp['nullable']) ? (bool)$fieldProp['nullable'] : false, + 'unsigned' => isset($fieldProp['unsigned']) ? (bool)$fieldProp['unsigned'] : false, + 'default' => isset($fieldProp['default']) ? $fieldProp['default'] : false, + 'primary' => false, + ), + isset($fieldProp['comment']) ? $fieldProp['comment'] : $fieldName + ); + } + + foreach ($indexesNeed as $indexProp) { + $table->addIndex($indexProp['KEY_NAME'], $indexProp['COLUMNS_LIST'], + array('type' => $indexProp['INDEX_TYPE'])); + } + + $table->addForeignKey($foreignEntityKey, + 'entity_id', $this->getTable('catalog_product_entity'), 'entity_id', + Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE); + + if ($this->getFlatHelper()->isAddChildData()) { + $table->addForeignKey($foreignChildKey, + 'child_id', $this->getTable('catalog_product_entity'), 'entity_id', + Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE); + } + $table->setComment("Catalog Product Flat (Store {$storeId})"); + + $adapter->createTable($table); + + $this->_existsFlatTables[$storeId] = true; + } else { + $adapter->resetDdlCache($tableName); + + // Sort columns into added/altered/dropped lists + $describe = $adapter->describeTable($tableName); + $addColumns = array_diff_key($columns, $describe); + $dropColumns = array_diff_key($describe, $columns); + $modifyColumns = array(); + foreach ($columns as $field => $fieldProp) { + if (isset($describe[$field]) && !$this->_compareColumnProperties($fieldProp, $describe[$field])) { + $modifyColumns[$field] = $fieldProp; + } + } + + // Sort indexes into added/dropped lists. Altered indexes are put into both lists. + $addIndexes = array(); + $dropIndexes = array(); + $indexesNow = $adapter->getIndexList($tableName); // Note: primary is always stored under 'PRIMARY' key + $newIndexes = $indexesNeed; + foreach ($indexesNow as $key => $indexNow) { + if (isset($indexesNeed[$key])) { + $indexNeed = $indexesNeed[$key]; + if (($indexNeed['INDEX_TYPE'] != $indexNow['INDEX_TYPE']) + || ($indexNeed['COLUMNS_LIST'] != $indexNow['COLUMNS_LIST'])) { + $dropIndexes[$key] = $indexNow; + $addIndexes[$key] = $indexNeed; + } + unset($newIndexes[$key]); + } else { + $dropIndexes[$key] = $indexNow; + } + } + $addIndexes = $addIndexes + $newIndexes; + + // Compose contstraints + $addConstraints = array(); + $addConstraints[$foreignEntityKey] = array( + 'table_index' => 'entity_id', + 'ref_table' => $this->getTable('catalog_product_entity'), + 'ref_index' => 'entity_id', + 'on_update' => Varien_Db_Ddl_Table::ACTION_CASCADE, + 'on_delete' => Varien_Db_Ddl_Table::ACTION_CASCADE + ); + + // Additional data from childs + $isAddChildData = $this->getFlatHelper()->isAddChildData(); + if (!$isAddChildData && isset($describe['is_child'])) { + $adapter->delete($tableName, array('is_child = ?' => 1)); + $adapter->dropForeignKey($tableName, $foreignChildKey); + } + if ($isAddChildData && !isset($describe['is_child'])) { + $adapter->delete($tableName); + $dropIndexes['PRIMARY'] = $indexesNow['PRIMARY']; + $addIndexes['PRIMARY'] = $indexesNeed['PRIMARY']; + + $addConstraints[$foreignChildKey] = array( + 'table_index' => 'child_id', + 'ref_table' => $this->getTable('catalog_product_entity'), + 'ref_index' => 'entity_id', + 'on_update' => Varien_Db_Ddl_Table::ACTION_CASCADE, + 'on_delete' => Varien_Db_Ddl_Table::ACTION_CASCADE + ); + } + + // Drop constraints + foreach (array_keys($adapter->getForeignKeys($tableName)) as $constraintName) { + $adapter->dropForeignKey($tableName, $constraintName); + } + + // Drop indexes + foreach ($dropIndexes as $indexProp) { + $adapter->dropIndex($tableName, $indexProp['KEY_NAME']); + } + + // Drop columns + foreach (array_keys($dropColumns) as $columnName) { + $adapter->dropColumn($tableName, $columnName); + } + + // Modify columns + foreach ($modifyColumns as $columnName => $columnProp) { + $columnProp = array_change_key_case($columnProp, CASE_UPPER); + if (!isset($columnProp['COMMENT'])) { + $columnProp['COMMENT'] = ucwords(str_replace('_', ' ', $columnName)); + } + $adapter->changeColumn($tableName, $columnName, $columnName, $columnProp); + } + + // Add columns + foreach ($addColumns as $columnName => $columnProp) { + $columnProp = array_change_key_case($columnProp, CASE_UPPER); + if (!isset($columnProp['COMMENT'])) { + $columnProp['COMMENT'] = ucwords(str_replace('_', ' ', $columnName)); + } + $adapter->addColumn($tableName, $columnName, $columnProp); + } + + // Add indexes + foreach ($addIndexes as $indexProp) { + $adapter->addIndex($tableName, $indexProp['KEY_NAME'], $indexProp['COLUMNS_LIST'], + $indexProp['INDEX_TYPE']); + } + + // Add constraints + foreach ($addConstraints as $constraintName => $constraintProp) { + $adapter->addForeignKey($constraintName, $tableName, + $constraintProp['table_index'], + $constraintProp['ref_table'], + $constraintProp['ref_index'], + $constraintProp['on_delete'], + $constraintProp['on_update'] + ); + } + } + + $this->_preparedFlatTables[$storeId] = true; + + return $this; + } + + /** + * Add or Update static attributes + * + * @param int $storeId + * @param int|array $productIds update only product(s) + * @return Mage_Catalog_Model_Resource_Product_Flat_Indexer + */ + public function updateStaticAttributes($storeId, $productIds = null) + { + if (!$this->_isFlatTableExists($storeId)) { + return $this; + } + $adapter = $this->_getWriteAdapter(); + $websiteId = (int)Mage::app()->getStore($storeId)->getWebsite()->getId(); + /* @var $status Mage_Eav_Model_Entity_Attribute */ + $status = $this->getAttribute('status'); + + $fieldList = array('entity_id', 'type_id', 'attribute_set_id'); + $colsList = array('entity_id', 'type_id', 'attribute_set_id'); + if ($this->getFlatHelper()->isAddChildData()) { + $fieldList = array_merge($fieldList, array('child_id', 'is_child')); + $isChild = new Zend_Db_Expr('0'); + $colsList = array_merge($colsList, array('entity_id', $isChild)); + } + + $columns = $this->getFlatColumns(); + $bind = array( + 'website_id' => $websiteId, + 'store_id' => $storeId, + 'entity_type_id' => (int)$status->getEntityTypeId(), + 'attribute_id' => (int)$status->getId() + ); + + $fieldExpr = $adapter->getCheckSql('t2.value_id > 0', 't2.value', 't1.value'); + $select = $this->_getWriteAdapter()->select() + ->from(array('e' => $this->getTable('catalog_product_entity')), $colsList) + ->join( + array('wp' => $this->getTable('catalog_product_website')), + 'e.entity_id = wp.product_id AND wp.website_id = :website_id', + array()) + ->joinLeft( + array('t1' => $status->getBackend()->getTable()), + 'e.entity_id = t1.entity_id', + array()) + ->joinLeft( + array('t2' => $status->getBackend()->getTable()), + 't2.entity_id = t1.entity_id' + . ' AND t1.entity_type_id = t2.entity_type_id' + . ' AND t1.attribute_id = t2.attribute_id' + . ' AND t2.store_id = :store_id', + array()) + ->where('t1.entity_type_id = :entity_type_id') + ->where('t1.attribute_id = :attribute_id') + ->where('t1.store_id = ?', Mage_Core_Model_App::ADMIN_STORE_ID) + ->where("{$fieldExpr} = ?", Mage_Catalog_Model_Product_Status::STATUS_ENABLED); + foreach ($this->getAttributes() as $attributeCode => $attribute) { + /** @var $attribute Mage_Eav_Model_Entity_Attribute */ + if ($attribute->getBackend()->getType() == 'static') { + if (!isset($columns[$attributeCode])) { + continue; + } + $fieldList[] = $attributeCode; + $select->columns($attributeCode, 'e'); + } + } + + if ($productIds !== null) { + $select->where('e.entity_id IN(?)', $productIds); + } + + $sql = $select->insertFromSelect($this->getFlatTableName($storeId), $fieldList); + $adapter->query($sql, $bind); + + return $this; + } + + /** + * Remove non website products + * + * @param int $storeId + * @param int|array $productIds + * @return Mage_Catalog_Model_Resource_Product_Flat_Indexer + */ + public function cleanNonWebsiteProducts($storeId, $productIds = null) + { + if (!$this->_isFlatTableExists($storeId)) { + return $this; + } + + $websiteId = (int)Mage::app()->getStore($storeId)->getWebsite()->getId(); + $adapter = $this->_getWriteAdapter(); + + $joinCondition = array( + 'e.entity_id = wp.product_id', + 'wp.website_id = :website_id' + ); + if ($this->getFlatHelper()->isAddChildData()) { + $joinCondition[] = 'e.child_id = wp.product_id'; + } + $bind = array('website_id' => $websiteId); + $select = $adapter->select() + ->from(array('e' => $this->getFlatTableName($storeId)), null) + ->joinLeft( + array('wp' => $this->getTable('catalog_product_website')), + implode(' AND ', $joinCondition), + array()); + if ($productIds !== null) { + $condition = array( + $adapter->quoteInto('e.entity_id IN(?)', $productIds) + ); + if ($this->getFlatHelper()->isAddChildData()) { + $condition[] = $adapter->quoteInto('e.child_id IN(?)', $productIds); + } + $select->where(implode(' OR ', $condition)); + } + + $sql = $select->deleteFromSelect('e'); + $adapter->query($sql, $bind); + + return $this; + } + + /** + * Update attribute flat data + * + * @param Mage_Eav_Model_Entity_Attribute $attribute + * @param int $storeId + * @param int|array $productIds update only product(s) + * @return Mage_Catalog_Model_Resource_Product_Flat_Indexer + */ + public function updateAttribute($attribute, $storeId, $productIds = null) + { + if (!$this->_isFlatTableExists($storeId)) { + return $this; + } + $adapter = $this->_getWriteAdapter(); + $flatTableName = $this->getFlatTableName($storeId); + $describe = $adapter->describeTable($flatTableName); + + if ($attribute->getBackend()->getType() == 'static') { + if (!isset($describe[$attribute->getAttributeCode()])) { + return $this; + } + + $select = $adapter->select() + ->join( + array('main_table' => $this->getTable('catalog_product_entity')), + 'main_table.entity_id = e.entity_id', + array($attribute->getAttributeCode() => 'main_table.' . $attribute->getAttributeCode()) + ); + if ($this->getFlatHelper()->isAddChildData()) { + $select->where('e.is_child = ?', 0); + } + if ($productIds !== null) { + $select->where('main_table.entity_id IN(?)', $productIds); + } + + $sql = $select->crossUpdateFromSelect(array('e' => $flatTableName)); + $adapter->query($sql); + } else { + $columns = $attribute->getFlatColumns(); + if (!$columns) { + return $this; + } + foreach (array_keys($columns) as $columnName) { + if (!isset($describe[$columnName])) { + return $this; + } + } + + $select = $attribute->getFlatUpdateSelect($storeId); + if ($select instanceof Varien_Db_Select) { + if ($productIds !== null) { + $select->where('e.entity_id IN(?)', $productIds); + } + + $sql = $select->crossUpdateFromSelect(array('e' => $flatTableName)); + $adapter->query($sql); + } + } + + return $this; + } + + /** + * Update non static EAV attributes flat data + * + * @param int $storeId + * @param int|array $productIds update only product(s) + * @return Mage_Catalog_Model_Resource_Product_Flat_Indexer + */ + public function updateEavAttributes($storeId, $productIds = null) + { + if (!$this->_isFlatTableExists($storeId)) { + return $this; + } + + foreach ($this->getAttributes() as $attribute) { + /* @var $attribute Mage_Eav_Model_Entity_Attribute */ + if ($attribute->getBackend()->getType() != 'static') { + $this->updateAttribute($attribute, $storeId, $productIds); + } + } + return $this; + } + + /** + * Update events observer attributes + * + * @param int $storeId + */ + public function updateEventAttributes($storeId = null) + { + Mage::dispatchEvent('catalog_product_flat_rebuild', array( + 'store_id' => $storeId, + 'table' => $this->getFlatTableName($storeId) + )); + } + + /** + * Retrieve Product Type Instances + * as key - type code, value - instance model + * + * @return array + */ + public function getProductTypeInstances() + { + if ($this->_productTypes === null) { + $this->_productTypes = array(); + $productEmulator = new Varien_Object(); + + foreach (array_keys(Mage_Catalog_Model_Product_Type::getTypes()) as $typeId) { + $productEmulator->setTypeId($typeId); + $this->_productTypes[$typeId] = Mage::getSingleton('Mage_Catalog_Model_Product_Type') + ->factory($productEmulator); + } + } + return $this->_productTypes; + } + + /** + * Update relation products + * + * @param int $storeId + * @param int|array $productIds Update child product(s) only + * @return Mage_Catalog_Model_Resource_Product_Flat_Indexer + */ + public function updateRelationProducts($storeId, $productIds = null) + { + if (!$this->getFlatHelper()->isAddChildData() || !$this->_isFlatTableExists($storeId)) { + return $this; + } + + $adapter = $this->_getWriteAdapter(); + + foreach ($this->getProductTypeInstances() as $typeInstance) { + if (!$typeInstance->isComposite()) { + continue; + } + $relation = $typeInstance->getRelationInfo(); + if ($relation + && $relation->getTable() + && $relation->getParentFieldName() + && $relation->getChildFieldName() + ) { + $columns = $this->getFlatColumns(); + $fieldList = array_keys($columns); + unset($columns['entity_id']); + unset($columns['child_id']); + unset($columns['is_child']); + + $select = $adapter->select() + ->from( + array('t' => $this->getTable($relation->getTable())), + array($relation->getParentFieldName(), $relation->getChildFieldName(), new Zend_Db_Expr('1'))) + ->join( + array('e' => $this->getFlatTableName($storeId)), + "e.entity_id = t.{$relation->getChildFieldName()}", + array_keys($columns) + ); + if ($relation->getWhere() !== null) { + $select->where($relation->getWhere()); + } + if ($productIds !== null) { + $cond = array( + $adapter->quoteInto("{$relation->getChildFieldName()} IN(?)", $productIds), + $adapter->quoteInto("{$relation->getParentFieldName()} IN(?)", $productIds) + ); + + $select->where(implode(' OR ', $cond)); + } + $sql = $select->insertFromSelect($this->getFlatTableName($storeId), $fieldList); + $adapter->query($sql); + } + } + + return $this; + } + + /** + * Update children data from parent + * + * @param int $storeId + * @param int|array $productIds + * @return Mage_Catalog_Model_Resource_Product_Flat_Indexer + */ + public function updateChildrenDataFromParent($storeId, $productIds = null) + { + if (!$this->getFlatHelper()->isAddChildData() || !$this->_isFlatTableExists($storeId)) { + return $this; + } + $adapter = $this->_getWriteAdapter(); + + $select = $adapter->select(); + foreach (array_keys($this->getFlatColumns()) as $columnName) { + if ($columnName == 'entity_id' || $columnName == 'child_id' || $columnName == 'is_child') { + continue; + } + $select->columns(array($columnName => new Zend_Db_Expr('t1.' . $columnName))); + } + $select + ->joinLeft( + array('t1' => $this->getFlatTableName($storeId)), + $adapter->quoteInto('t2.child_id = t1.entity_id AND t1.is_child = ?', 0), + array()) + ->where('t2.is_child = ?', 1); + + if ($productIds !== null) { + $select->where('t2.child_id IN(?)', $productIds); + } + + $sql = $select->crossUpdateFromSelect(array('t2' => $this->getFlatTableName($storeId))); + $adapter->query($sql); + + return $this; + } + + /** + * Clean unused relation products + * + * @param int $storeId + * @return Mage_Catalog_Model_Resource_Product_Flat_Indexer + */ + public function cleanRelationProducts($storeId) + { + if (!$this->getFlatHelper()->isAddChildData()) { + return $this; + } + + foreach ($this->getProductTypeInstances() as $typeInstance) { + if (!$typeInstance->isComposite()) { + continue; + } + $adapter = $this->_getWriteAdapter(); + $relation = $typeInstance->getRelationInfo(); + if ($relation + && $relation->getTable() + && $relation->getParentFieldName() + && $relation->getChildFieldName() + ) { + $select = $this->_getWriteAdapter()->select() + ->distinct(true) + ->from( + $this->getTable($relation->getTable()), + "{$relation->getParentFieldName()}" + ); + $joinLeftCond = array( + "e.entity_id = t.{$relation->getParentFieldName()}", + "e.child_id = t.{$relation->getChildFieldName()}" + ); + if ($relation->getWhere() !== null) { + $select->where($relation->getWhere()); + $joinLeftCond[] = $relation->getWhere(); + } + + $entitySelect = new Zend_Db_Expr($select->__toString()); + + $select = $adapter->select() + ->from(array('e' => $this->getFlatTableName($storeId)), null) + ->joinLeft( + array('t' => $this->getTable($relation->getTable())), + implode(' AND ', $joinLeftCond), + array()) + ->where('e.is_child = ?', 1) + ->where('e.entity_id IN(?)', $entitySelect) + ->where("t.{$relation->getChildFieldName()} IS NULL"); + + $sql = $select->deleteFromSelect('e'); + $adapter->query($sql); + } + } + + return $this; + } + + /** + * Remove product data from flat + * + * @param int|array $productIds + * @param int $storeId + * @return Mage_Catalog_Model_Resource_Product_Flat_Indexer + */ + public function removeProduct($productIds, $storeId) + { + if (!$this->_isFlatTableExists($storeId)) { + return $this; + } + $adapter = $this->_getWriteAdapter(); + $cond = array( + $adapter->quoteInto('entity_id IN(?)', $productIds) + ); + if ($this->getFlatHelper()->isAddChildData()) { + $cond[] = $adapter->quoteInto('child_id IN(?)', $productIds); + } + $cond = implode(' OR ', $cond); + $adapter->delete($this->getFlatTableName($storeId), $cond); + + return $this; + } + + /** + * Remove children from parent product + * + * @param int|array $productIds + * @param int $storeId + * @return Mage_Catalog_Model_Resource_Product_Flat_Indexer + */ + public function removeProductChildren($productIds, $storeId) + { + if (!$this->getFlatHelper()->isAddChildData()) { + return $this; + } + $whereExpr = array( + 'entity_id IN(?)' => $productIds, + 'is_child = ?' => 1 + ); + $this->_getWriteAdapter()->delete($this->getFlatTableName($storeId), $whereExpr); + + return $this; + } + + /** + * Update flat data for product + * + * @param int|array $productIds + * @param int $storeId + * @return Mage_Catalog_Model_Resource_Product_Flat_Indexer + */ + public function updateProduct($productIds, $storeId) + { + if (!$this->_isFlatTableExists($storeId)) { + return $this; + } + + $this->saveProduct($productIds, $storeId); + + Mage::dispatchEvent('catalog_product_flat_update_product', array( + 'store_id' => $storeId, + 'table' => $this->getFlatTableName($storeId), + 'product_ids' => $productIds + )); + + return $this; + } + + /** + * Save product(s) data for store + * + * @param int|array $productIds + * @param int $storeId + * @return Mage_Catalog_Model_Resource_Product_Flat_Indexer + */ + public function saveProduct($productIds, $storeId) + { + if (!$this->_isFlatTableExists($storeId)) { + return $this; + } + + $this->updateStaticAttributes($storeId, $productIds); + $this->updateEavAttributes($storeId, $productIds); + + return $this; + } + + /** + * Delete flat table process + * + * @param int $storeId + * @return Mage_Catalog_Model_Resource_Product_Flat_Indexer + */ + public function deleteFlatTable($storeId) + { + if ($this->_isFlatTableExists($storeId)) { + $this->_getWriteAdapter()->dropTable($this->getFlatTableName($storeId)); + } + + return $this; + } + + /** + * Check is flat table for store exists + * + * @param int $storeId + * @return bool + */ + protected function _isFlatTableExists($storeId) + { + if (!isset($this->_existsFlatTables[$storeId])) { + $tableName = $this->getFlatTableName($storeId); + $isTableExists = $this->_getWriteAdapter()->isTableExists($tableName); + + $this->_existsFlatTables[$storeId] = $isTableExists ? true : false; + } + + return $this->_existsFlatTables[$storeId]; + } + + /** + * Retrieve previous key from array by key + * + * @param array $array + * @param mixed $key + * @return mixed + */ + protected function _arrayPrevKey(array $array, $key) + { + $prev = false; + foreach (array_keys($array) as $k) { + if ($k == $key) { + return $prev; + } + $prev = $k; + } + return false; + } + + /** + * Retrieve next key from array by key + * + * @param array $array + * @param mixed $key + * @return mixed + */ + protected function _arrayNextKey(array $array, $key) + { + $next = false; + foreach (array_keys($array) as $k) { + if ($next === true) { + return $k; + } + if ($k == $key) { + $next = true; + } + } + return false; + } + + /** + * Transactional rebuild Catalog Product Flat Data + * + * @return Mage_Catalog_Model_Resource_Product_Flat_Indexer + */ + public function reindexAll() + { foreach (Mage::app()->getStores() as $storeId => $store) { - $this->prepareFlatTable($storeId); - } - return $this; - } - - /** - * Transactional rebuild Catalog Product Flat Data - * - * @return Mage_Catalog_Model_Resource_Product_Flat_Indexer - */ - public function reindexAll() - { - $this->prepareFlatTables(); - $this->beginTransaction(); - try { - $this->rebuild(); - $this->commit(); - } catch (Exception $e) { - $this->rollBack(); - throw $e; - } - return $this; - } -} + $this->prepareFlatTable($storeId); + $this->beginTransaction(); + try { + $this->rebuild($store); + $this->commit(); + } catch (Exception $e) { + $this->rollBack(); + throw $e; + } + } + $flag = $this->getFlatHelper()->getFlag(); + $flag->setIsBuild(true)->save(); + + return $this; + } +} \ No newline at end of file diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Abstract.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Abstract.php index 2cd11ec583d013024d3f29759455f2f603958046..b1742c68d648472bcb3a49174c490d9fd42d8799 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Abstract.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Eav.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Eav.php index 58225ad20cf044537c448954126a123b84a8da71..9b5362f6a1266050bb56ea593834f1e0f6590c4a 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Eav.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Eav.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Eav/Abstract.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Eav/Abstract.php index b78d1a72fb3c23340e684563c8d40d8f61679dc9..8046cf03a9c6ee59cda53edc6ff59028bdc7e073 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Eav/Abstract.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Eav/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Eav/Decimal.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Eav/Decimal.php index d8eeadc217d88fe31473b633d36c93f61476dcb1..5e220a5fb43585fa127d2a13f6a240b6a18da0f5 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Eav/Decimal.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Eav/Decimal.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Eav/Source.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Eav/Source.php index 1349247c98cef6f4cff82cafce7b0905e6d72fe2..26049c32eb926e26d1665cd2516e3af517dc4195 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Eav/Source.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Eav/Source.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -121,6 +121,10 @@ class Mage_Catalog_Model_Resource_Product_Indexer_Eav_Source ) ->where('s.store_id != 0'); + if (!is_null($entityIds)) { + $subSelect->where('d.entity_id IN(?)', $entityIds); + } + /**@var $select Varien_Db_Select*/ $select = $adapter->select() ->from( @@ -144,10 +148,6 @@ class Mage_Catalog_Model_Resource_Product_Indexer_Eav_Source $select->where(Mage::getResourceHelper('Mage_Catalog')->getIsNullNotNullCondition('pis.value', 'pid.value')); - if (!is_null($entityIds)) { - $select->where('pid.entity_id IN(?)', $entityIds); - } - /** * Add additional external limitation */ @@ -290,4 +290,4 @@ class Mage_Catalog_Model_Resource_Product_Indexer_Eav_Source } return $this->getTable('catalog_product_index_eav_tmp'); } -} \ No newline at end of file +} diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price.php index 80c34ad892906be04c98e31f9ae078c0359620c9..e2949d2d0638c5c02d13f134b85cf2091cac30b1 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -169,6 +169,7 @@ class Mage_Catalog_Model_Resource_Product_Indexer_Price extends Mage_Index_Model if ($indexer->getIsComposite()) { $this->_copyRelationIndexData($productId); $this->_prepareTierPriceIndex($productId); + $this->_prepareGroupPriceIndex($productId); $indexer->reindexEntity($productId); } else { $parentIds = $this->getProductParentsByChild($productId); @@ -177,6 +178,7 @@ class Mage_Catalog_Model_Resource_Product_Indexer_Price extends Mage_Index_Model $processIds = array_merge($processIds, array_keys($parentIds)); $this->_copyRelationIndexData(array_keys($parentIds), $productId); $this->_prepareTierPriceIndex($processIds); + $this->_prepareGroupPriceIndex($processIds); $indexer->reindexEntity($productId); $parentByType = array(); @@ -189,6 +191,7 @@ class Mage_Catalog_Model_Resource_Product_Indexer_Price extends Mage_Index_Model } } else { $this->_prepareTierPriceIndex($productId); + $this->_prepareGroupPriceIndex($productId); $indexer->reindexEntity($productId); } } @@ -371,6 +374,7 @@ class Mage_Catalog_Model_Resource_Product_Indexer_Price extends Mage_Index_Model $this->clearTemporaryIndexTable(); $this->_prepareWebsiteDateTable(); $this->_prepareTierPriceIndex(); + $this->_prepareGroupPriceIndex(); $indexers = $this->getTypeIndexers(); foreach ($indexers as $indexer) { @@ -397,6 +401,16 @@ class Mage_Catalog_Model_Resource_Product_Indexer_Price extends Mage_Index_Model return $this->getTable('catalog_product_index_tier_price'); } + /** + * Retrieve table name for product group price index + * + * @return string + */ + protected function _getGroupPriceIndexTable() + { + return $this->getTable('catalog_product_index_group_price'); + } + /** * Prepare tier price index table * @@ -440,6 +454,49 @@ class Mage_Catalog_Model_Resource_Product_Indexer_Price extends Mage_Index_Model return $this; } + /** + * Prepare group price index table + * + * @param int|array $entityIds the entity ids limitation + * @return Mage_Catalog_Model_Resource_Product_Indexer_Price + */ + protected function _prepareGroupPriceIndex($entityIds = null) + { + $write = $this->_getWriteAdapter(); + $table = $this->_getGroupPriceIndexTable(); + $write->delete($table); + + $websiteExpression = $write->getCheckSql('gp.website_id = 0', 'ROUND(gp.value * cwd.rate, 4)', 'gp.value'); + $select = $write->select() + ->from( + array('gp' => $this->getTable('catalog_product_entity_group_price')), + array('entity_id')) + ->join( + array('cg' => $this->getTable('customer_group')), + 'gp.all_groups = 1 OR (gp.all_groups = 0 AND gp.customer_group_id = cg.customer_group_id)', + array('customer_group_id')) + ->join( + array('cw' => $this->getTable('core_website')), + 'gp.website_id = 0 OR gp.website_id = cw.website_id', + array('website_id')) + ->join( + array('cwd' => $this->_getWebsiteDateTable()), + 'cw.website_id = cwd.website_id', + array()) + ->where('cw.website_id != 0') + ->columns(new Zend_Db_Expr("MIN({$websiteExpression})")) + ->group(array('gp.entity_id', 'cg.customer_group_id', 'cw.website_id')); + + if (!empty($entityIds)) { + $select->where('gp.entity_id IN(?)', $entityIds); + } + + $query = $select->insertFromSelect($table); + $write->query($query); + + return $this; + } + /** * Copy relations product index from primary index to temporary index table by parent entity * diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Configurable.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Configurable.php index ef9828635ded3c5837096260557aeff7a024dc9c..9e50d208d5e7867ed9a89f33a164083bfb34a3a0 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Configurable.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Configurable.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -170,20 +170,26 @@ class Mage_Catalog_Model_Resource_Product_Indexer_Price_Configurable ->group(array('l.parent_id', 'i.customer_group_id', 'i.website_id', 'l.product_id')); $priceExpression = $write->getCheckSql('apw.value_id IS NOT NULL', 'apw.pricing_value', 'apd.pricing_value'); - $percenExpr = $write->getCheckSql('apw.value_id IS NOT NULL', 'apw.is_percent', 'apd.is_percent'); + $percentExpr = $write->getCheckSql('apw.value_id IS NOT NULL', 'apw.is_percent', 'apd.is_percent'); $roundExpr = "ROUND(i.price * ({$priceExpression} / 100), 4)"; - $roundPriceExpr = $write->getCheckSql("{$percenExpr} = 1", $roundExpr, $priceExpression); + $roundPriceExpr = $write->getCheckSql("{$percentExpr} = 1", $roundExpr, $priceExpression); $priceColumn = $write->getCheckSql("{$priceExpression} IS NULL", '0', $roundPriceExpr); $priceColumn = new Zend_Db_Expr("SUM({$priceColumn})"); $tierPrice = $priceExpression; - $tierRoundPriceExp = $write->getCheckSql("{$percenExpr} = 1", $roundExpr, $tierPrice); + $tierRoundPriceExp = $write->getCheckSql("{$percentExpr} = 1", $roundExpr, $tierPrice); $tierPriceExp = $write->getCheckSql("{$tierPrice} IS NULL", '0', $tierRoundPriceExp); $tierPriceColumn = $write->getCheckSql("MIN(i.tier_price) IS NOT NULL", "SUM({$tierPriceExp})", 'NULL'); + $groupPrice = $priceExpression; + $groupRoundPriceExp = $write->getCheckSql("{$percentExpr} = 1", $roundExpr, $groupPrice); + $groupPriceExp = $write->getCheckSql("{$groupPrice} IS NULL", '0', $groupRoundPriceExp); + $groupPriceColumn = $write->getCheckSql("MIN(i.group_price) IS NOT NULL", "SUM({$groupPriceExp})", 'NULL'); + $select->columns(array( - 'price' => $priceColumn, - 'tier_price' => $tierPriceColumn + 'price' => $priceColumn, + 'tier_price' => $tierPriceColumn, + 'group_price' => $groupPriceColumn, )); $query = $select->insertFromSelect($coaTable); @@ -192,7 +198,10 @@ class Mage_Catalog_Model_Resource_Product_Indexer_Price_Configurable $select = $write->select() ->from( array($coaTable), - array('parent_id', 'customer_group_id', 'website_id', 'MIN(price)', 'MAX(price)', 'MIN(tier_price)')) + array( + 'parent_id', 'customer_group_id', 'website_id', + 'MIN(price)', 'MAX(price)', 'MIN(tier_price)', 'MIN(group_price)' + )) ->group(array('parent_id', 'customer_group_id', 'website_id')); $query = $select->insertFromSelect($copTable); @@ -206,9 +215,13 @@ class Mage_Catalog_Model_Resource_Product_Indexer_Price_Configurable .' AND i.website_id = io.website_id', array()); $select->columns(array( - 'min_price' => new Zend_Db_Expr('i.min_price + io.min_price'), - 'max_price' => new Zend_Db_Expr('i.max_price + io.max_price'), - 'tier_price' => $write->getCheckSql('i.tier_price IS NOT NULL', 'i.tier_price + io.tier_price', 'NULL'), + 'min_price' => new Zend_Db_Expr('i.min_price + io.min_price'), + 'max_price' => new Zend_Db_Expr('i.max_price + io.max_price'), + 'tier_price' => $write->getCheckSql('i.tier_price IS NOT NULL', 'i.tier_price + io.tier_price', 'NULL'), + 'group_price' => $write->getCheckSql( + 'i.group_price IS NOT NULL', + 'i.group_price + io.group_price', 'NULL' + ), )); $query = $select->crossUpdateFromSelect($table); diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Default.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Default.php index 6c7d929b3bae2210871895dfd0f4216fbe52bcaa..026a59b8b02ba14d46d3d72f96f8cbe95db97faf 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Default.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Default.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -220,6 +220,11 @@ class Mage_Catalog_Model_Resource_Product_Indexer_Price_Default 'tp.entity_id = e.entity_id AND tp.website_id = cw.website_id' . ' AND tp.customer_group_id = cg.customer_group_id', array()) + ->joinLeft( + array('gp' => $this->_getGroupPriceIndexTable()), + 'gp.entity_id = e.entity_id AND gp.website_id = cw.website_id' + . ' AND gp.customer_group_id = cg.customer_group_id', + array()) ->where('e.type_id = ?', $this->getTypeId()); // add enable products limitation @@ -237,6 +242,7 @@ class Mage_Catalog_Model_Resource_Product_Indexer_Price_Default $specialFrom = $this->_addAttributeToSelect($select, 'special_from_date', 'e.entity_id', 'cs.store_id'); $specialTo = $this->_addAttributeToSelect($select, 'special_to_date', 'e.entity_id', 'cs.store_id'); $currentDate = $write->getDatePartSql('cwd.website_date'); + $groupPrice = $write->getCheckSql('gp.price IS NULL', "{$price}", 'gp.price'); $specialFromDate = $write->getDatePartSql($specialFrom); $specialToDate = $write->getDatePartSql($specialTo); @@ -247,14 +253,17 @@ class Mage_Catalog_Model_Resource_Product_Indexer_Price_Default $specialToHas = $write->getCheckSql("{$specialTo} IS NULL", '1', "{$specialToUse}"); $finalPrice = $write->getCheckSql("{$specialFromHas} > 0 AND {$specialToHas} > 0" . " AND {$specialPrice} < {$price}", $specialPrice, $price); + $finalPrice = $write->getCheckSql("{$groupPrice} < {$finalPrice}", $groupPrice, $finalPrice); $select->columns(array( - 'orig_price' => $price, - 'price' => $finalPrice, - 'min_price' => $finalPrice, - 'max_price' => $finalPrice, - 'tier_price' => new Zend_Db_Expr('tp.min_price'), - 'base_tier' => new Zend_Db_Expr('tp.min_price'), + 'orig_price' => $price, + 'price' => $finalPrice, + 'min_price' => $finalPrice, + 'max_price' => $finalPrice, + 'tier_price' => new Zend_Db_Expr('tp.min_price'), + 'base_tier' => new Zend_Db_Expr('tp.min_price'), + 'group_price' => new Zend_Db_Expr('gp.price'), + 'base_group_price' => new Zend_Db_Expr('gp.price'), )); if (!is_null($entityIds)) { @@ -304,7 +313,7 @@ class Mage_Catalog_Model_Resource_Product_Indexer_Price_Default if ($this->useIdxTable()) { return $this->getTable('catalog_product_index_price_opt_agr_idx'); } - return $this->getTable('catalog_product_index_price_opt_agr_idx'); + return $this->getTable('catalog_product_index_price_opt_agr_tmp'); } /** @@ -403,16 +412,22 @@ class Mage_Catalog_Model_Resource_Product_Indexer_Price_Default $tierPriceValue = $write->getCheckSql("MIN(o.is_require) > 0", $tierPriceMin, 0); $tierPrice = $write->getCheckSql("MIN(i.base_tier) IS NOT NULL", $tierPriceValue, "NULL"); + $groupPriceRound = new Zend_Db_Expr("ROUND(i.base_group_price * ({$optPriceValue} / 100), 4)"); + $groupPriceExpr = $write->getCheckSql("{$optPriceType} = 'fixed'", $optPriceValue, $groupPriceRound); + $groupPriceMin = new Zend_Db_Expr("MIN($groupPriceExpr)"); + $groupPriceValue = $write->getCheckSql("MIN(o.is_require) > 0", $groupPriceMin, 0); + $groupPrice = $write->getCheckSql("MIN(i.base_group_price) IS NOT NULL", $groupPriceValue, "NULL"); + $maxPriceRound = new Zend_Db_Expr("ROUND(i.price * ({$optPriceValue} / 100), 4)"); $maxPriceExpr = $write->getCheckSql("{$optPriceType} = 'fixed'", $optPriceValue, $maxPriceRound); - //$tierPriceMin = new Zend_Db_Expr("MIN($tierPriceExpr)"); $maxPrice = $write->getCheckSql("(MIN(o.type)='radio' OR MIN(o.type)='drop_down')", "MAX($maxPriceExpr)", "SUM($maxPriceExpr)"); $select->columns(array( - 'min_price' => $minPrice, - 'max_price' => $maxPrice, - 'tier_price' => $tierPrice + 'min_price' => $minPrice, + 'max_price' => $maxPrice, + 'tier_price' => $tierPrice, + 'group_price' => $groupPrice, )); $query = $select->insertFromSelect($coaTable); @@ -461,10 +476,16 @@ class Mage_Catalog_Model_Resource_Product_Indexer_Price_Default $tierPriceValue = $write->getCheckSql("{$tierPriceExpr} > 0 AND o.is_require > 0", $tierPriceExpr, 0); $tierPrice = $write->getCheckSql("i.base_tier IS NOT NULL", $tierPriceValue, "NULL"); + $groupPriceRound = new Zend_Db_Expr("ROUND(i.base_group_price * ({$optPriceValue} / 100), 4)"); + $groupPriceExpr = $write->getCheckSql("{$optPriceType} = 'fixed'", $optPriceValue, $groupPriceRound); + $groupPriceValue = $write->getCheckSql("{$groupPriceExpr} > 0 AND o.is_require > 0", $groupPriceExpr, 0); + $groupPrice = $write->getCheckSql("i.base_group_price IS NOT NULL", $groupPriceValue, "NULL"); + $select->columns(array( - 'min_price' => $minPrice, - 'max_price' => $maxPrice, - 'tier_price' => $tierPrice + 'min_price' => $minPrice, + 'max_price' => $maxPrice, + 'tier_price' => $tierPrice, + 'group_price' => $groupPrice, )); $query = $select->insertFromSelect($coaTable); @@ -480,6 +501,7 @@ class Mage_Catalog_Model_Resource_Product_Indexer_Price_Default 'min_price' => 'SUM(min_price)', 'max_price' => 'SUM(max_price)', 'tier_price' => 'SUM(tier_price)', + 'group_price' => 'SUM(group_price)', )) ->group(array('entity_id', 'customer_group_id', 'website_id')); $query = $select->insertFromSelect($copTable); @@ -493,9 +515,13 @@ class Mage_Catalog_Model_Resource_Product_Indexer_Price_Default .' AND i.website_id = io.website_id', array()); $select->columns(array( - 'min_price' => new Zend_Db_Expr('i.min_price + io.min_price'), - 'max_price' => new Zend_Db_Expr('i.max_price + io.max_price'), - 'tier_price' => $write->getCheckSql('i.tier_price IS NOT NULL', 'i.tier_price + io.tier_price', 'NULL'), + 'min_price' => new Zend_Db_Expr('i.min_price + io.min_price'), + 'max_price' => new Zend_Db_Expr('i.max_price + io.max_price'), + 'tier_price' => $write->getCheckSql('i.tier_price IS NOT NULL', 'i.tier_price + io.tier_price', 'NULL'), + 'group_price' => $write->getCheckSql( + 'i.group_price IS NOT NULL', + 'i.group_price + io.group_price', 'NULL' + ), )); $query = $select->crossUpdateFromSelect($table); $write->query($query); @@ -522,7 +548,8 @@ class Mage_Catalog_Model_Resource_Product_Indexer_Price_Default 'final_price' => 'price', 'min_price' => 'min_price', 'max_price' => 'max_price', - 'tier_price' => 'tier_price' + 'tier_price' => 'tier_price', + 'group_price' => 'group_price', ); $write = $this->_getWriteAdapter(); @@ -548,6 +575,16 @@ class Mage_Catalog_Model_Resource_Product_Indexer_Price_Default return $this->getTable('catalog_product_index_tier_price'); } + /** + * Retrieve table name for product group price index + * + * @return string + */ + protected function _getGroupPriceIndexTable() + { + return $this->getTable('catalog_product_index_group_price'); + } + /** * Register data required by product type process in event object * diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Grouped.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Grouped.php index bfcac8c95a42e5734884c78b3ab88f9741ab41c3..b8f2671d5ea290cb71b33f4fa128635f2cd40495 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Grouped.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Grouped.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -103,13 +103,14 @@ class Mage_Catalog_Model_Resource_Product_Indexer_Price_Grouped 'i.entity_id = l.linked_product_id AND i.website_id = cw.website_id' . ' AND i.customer_group_id = cg.customer_group_id', array( - 'tax_class_id'=> $this->_getReadAdapter() + 'tax_class_id' => $this->_getReadAdapter() ->getCheckSql('MIN(i.tax_class_id) IS NULL', '0', 'MIN(i.tax_class_id)'), - 'price' => new Zend_Db_Expr('NULL'), - 'final_price' => new Zend_Db_Expr('NULL'), - 'min_price' => new Zend_Db_Expr('MIN(' . $minCheckSql . ')'), - 'max_price' => new Zend_Db_Expr('MAX(' . $maxCheckSql . ')'), - 'tier_price' => new Zend_Db_Expr('NULL') + 'price' => new Zend_Db_Expr('NULL'), + 'final_price' => new Zend_Db_Expr('NULL'), + 'min_price' => new Zend_Db_Expr('MIN(' . $minCheckSql . ')'), + 'max_price' => new Zend_Db_Expr('MAX(' . $maxCheckSql . ')'), + 'tier_price' => new Zend_Db_Expr('NULL'), + 'group_price' => new Zend_Db_Expr('NULL'), )) ->group(array('e.entity_id', 'cg.customer_group_id', 'cw.website_id')) ->where('e.type_id=?', $this->getTypeId()); diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Interface.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Interface.php index f590e1b3b42306654e648932791a6abd5a317066..f0b22210318c99667dde0e87ac0c4ae4d0611b88 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Interface.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Interface.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Link.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Link.php index 011563141f8ff0efea6496cd0f88db7b089c3a75..d8cfafa401ae63227aa42c72cf91627a1576f78f 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Link.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Link.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Link/Collection.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Link/Collection.php index 4e452dba7a328b3fd7bd3f4b7e5c5b37df1f58ea..a382b405d20a58c62a640c4f53f7acf93dbefa1a 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Link/Collection.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Link/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Link/Product/Collection.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Link/Product/Collection.php index ea9de7b0eb7c784ca1d4cd1a416e7c7c44dc6d7c..ac7668d36b34d6fe17922741c167b0dd7da803b7 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Link/Product/Collection.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Link/Product/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Option.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Option.php index bed92f6bb495ebfcf260e3beb4d46313827709d1..f20811bfb83effbc576e22013a31e6aac62f5c79 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Option.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Option.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Option/Collection.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Option/Collection.php index d4531437bf214ff9abfe0878100f7e37cd36fd3c..986ca7aee0c763405eb8461ed5898708e72cc5dd 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Option/Collection.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Option/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Option/Value.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Option/Value.php index b6ea1a68b90373ef13d06909deadae0501a74baa..8dd0bfd44c64eb6e1f30b2544a8ae033113a6e4f 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Option/Value.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Option/Value.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Option/Value/Collection.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Option/Value/Collection.php index 8c1675c1f2dea9d5be4346a13ff5b57a3ed06795..c4186d1e216a8fcd246301312c0c7bb346b4ec4c 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Option/Value/Collection.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Option/Value/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Relation.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Relation.php index a8e6cf6ec449c067c37b2857d017cc3a7a4d2923..0cfe75896943be24a00e33f65666b5f0793226e1 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Relation.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Relation.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Status.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Status.php index 0e6f685568e00871446c02d6884f3237850bb574..668a05500465a55b7f435382a5c17a66876bf1a7 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Status.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Status.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Type/Configurable.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Type/Configurable.php index 4fd38d4662b42b14ab9dedd435906b37e74b7c66..094831d6a873daf2519a0b7eab47cdb437d4ba77 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Type/Configurable.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Type/Configurable.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Type/Configurable/Attribute.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Type/Configurable/Attribute.php index 900cb52653aee3ebf485b02661a45e1a1f12ed34..20ed35f2452900021de9422c55895a5246026bee 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Type/Configurable/Attribute.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Type/Configurable/Attribute.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Type/Configurable/Attribute/Collection.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Type/Configurable/Attribute/Collection.php index 425dbf15649fc5a0b522657c3c2d5b1989082cf1..29d59fa6c1a4d8c6df3c3a96e324b780b32257c8 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Type/Configurable/Attribute/Collection.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Type/Configurable/Attribute/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Type/Configurable/Product/Collection.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Type/Configurable/Product/Collection.php index 59bfba75697c341239032efbdc2601c0c917e39c..c72960147c3a4a705405cc873e1c14552fd56706 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Type/Configurable/Product/Collection.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Type/Configurable/Product/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Website.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Website.php index 9e9dd740ac35f0f4038c92a215b42684c55d3d87..d036d770c17257c1bca69a5c1119c293a02ac4ec 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Website.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Website.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Setup.php b/app/code/core/Mage/Catalog/Model/Resource/Setup.php index 380d987a1dc9d458cce72decded02bc3e3b3b268..29eaf768aeb6e4cb34e1c1ea1629dc52245f15fb 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Setup.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Setup.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -484,7 +484,7 @@ class Mage_Catalog_Model_Resource_Setup extends Mage_Eav_Model_Entity_Setup 'weight' => array( 'type' => 'decimal', 'label' => 'Weight', - 'input' => 'text', + 'input' => 'weight', 'sort_order' => 5, 'apply_to' => Mage_Catalog_Model_Product_Type::TYPE_SIMPLE, ), @@ -576,6 +576,17 @@ class Mage_Catalog_Model_Resource_Setup extends Mage_Eav_Model_Entity_Setup 'sort_order' => 6, 'visible' => false, ), + 'group_price' => array( + 'type' => 'decimal', + 'label' => 'Group Price', + 'input' => 'text', + 'backend' => 'Mage_Catalog_Model_Product_Attribute_Backend_Groupprice', + 'required' => false, + 'sort_order' => 6, + 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_WEBSITE, + 'apply_to' => 'simple,configurable,virtual', + 'group' => 'Prices', + ), 'tier_price' => array( 'type' => 'decimal', 'label' => 'Tier Price', diff --git a/app/code/core/Mage/Catalog/Model/Resource/Url.php b/app/code/core/Mage/Catalog/Model/Resource/Url.php index 08fad62f32b4eb39234c033114da937b134e26db..bdaad52a56bcc5a41819cd0d42303786106f6d62 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Url.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Url.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -173,6 +173,40 @@ class Mage_Catalog_Model_Resource_Url extends Mage_Core_Model_Resource_Db_Abstra return $rewrite; } + /** + * Get last used increment part of rewrite request path + * + * @param string $prefix + * @param string $suffix + * @param int $storeId + * @return int + */ + public function getLastUsedRewriteRequestIncrement($prefix, $suffix, $storeId) + { + $adapter = $this->_getWriteAdapter(); + $requestPathField = new Zend_Db_Expr($adapter->quoteIdentifier('request_path')); + //select increment part of request path and cast expression to integer + $urlIncrementPartExpression = Mage::getResourceHelper('Mage_Eav') + ->getCastToIntExpression($adapter->getSubstringSql( + $requestPathField, + strlen($prefix) + 1, + $adapter->getLengthSql($requestPathField) . ' - ' . strlen($prefix) . ' - ' . strlen($suffix) + )); + $select = $adapter->select() + ->from($this->getMainTable(), new Zend_Db_Expr('MAX(' . $urlIncrementPartExpression . ')')) + ->where('store_id = :store_id') + ->where('request_path LIKE :request_path') + ->where($adapter->prepareSqlCondition('request_path', array( + 'regexp' => '^' . preg_quote($prefix) . '[0-9]*' . preg_quote($suffix) . '$' + ))); + $bind = array( + 'store_id' => (int)$storeId, + 'request_path' => $prefix . '%' . $suffix, + ); + + return (int)$adapter->fetchOne($select, $bind); + } + /** * Validate array of request paths. Return first not used path in case if validations passed * @@ -1310,12 +1344,26 @@ class Mage_Catalog_Model_Resource_Url extends Mage_Core_Model_Resource_Db_Abstra */ public function deleteRewrite($requestPath, $storeId) { - $this->_getWriteAdapter()->delete( - $this->getMainTable(), - array( - 'store_id = ?' => $storeId, - 'request_path = ?' => $requestPath - ) + $this->deleteRewriteRecord($requestPath, $storeId); + } + + /** + * Delete rewrite path record from the database with RP checking. + * + * @param string $requestPath + * @param int $storeId + * @param bool $rp whether check rewrite option to be "Redirect = Permanent" + * @return void + */ + public function deleteRewriteRecord($requestPath, $storeId, $rp = false) + { + $conditions = array( + 'store_id = ?' => $storeId, + 'request_path = ?' => $requestPath, ); + if ($rp) { + $conditions['options = ?'] = 'RP'; + } + $this->_getWriteAdapter()->delete($this->getMainTable(), $conditions); } } diff --git a/app/code/core/Mage/Catalog/Model/Session.php b/app/code/core/Mage/Catalog/Model/Session.php index f36cb475c5994050f3879c2ad1625f9ca4f1aefe..d859a9e2cce95682245ab5de7c8c17e0d3438116 100644 --- a/app/code/core/Mage/Catalog/Model/Session.php +++ b/app/code/core/Mage/Catalog/Model/Session.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/System/Config/Backend/Catalog/Category/Flat.php b/app/code/core/Mage/Catalog/Model/System/Config/Backend/Catalog/Category/Flat.php index af34c4f5e9a07a5ed13b97972f94acd510726e77..849c208d23b586b3365a6e8877b7f08ebdeadafa 100644 --- a/app/code/core/Mage/Catalog/Model/System/Config/Backend/Catalog/Category/Flat.php +++ b/app/code/core/Mage/Catalog/Model/System/Config/Backend/Catalog/Category/Flat.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/System/Config/Backend/Catalog/Product/Flat.php b/app/code/core/Mage/Catalog/Model/System/Config/Backend/Catalog/Product/Flat.php index 3d42873a4ea7c56996035aca92ea729bfd68f19a..d6c75997fef1b068ed1359f7b2337298e325d078 100644 --- a/app/code/core/Mage/Catalog/Model/System/Config/Backend/Catalog/Product/Flat.php +++ b/app/code/core/Mage/Catalog/Model/System/Config/Backend/Catalog/Product/Flat.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/System/Config/Backend/Catalog/Url/Rewrite/Suffix.php b/app/code/core/Mage/Catalog/Model/System/Config/Backend/Catalog/Url/Rewrite/Suffix.php index d5e4ee82e698ff46741555582ce7718fb5ea6f8b..f43f689532f0be9deacd75dd449ebf40929f7e8b 100644 --- a/app/code/core/Mage/Catalog/Model/System/Config/Backend/Catalog/Url/Rewrite/Suffix.php +++ b/app/code/core/Mage/Catalog/Model/System/Config/Backend/Catalog/Url/Rewrite/Suffix.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Template/Filter.php b/app/code/core/Mage/Catalog/Model/Template/Filter.php index 0c1e21708b1252356be5d043ac2c154385b0a43f..5112981988ea350081579cc12222643b111c86a0 100644 --- a/app/code/core/Mage/Catalog/Model/Template/Filter.php +++ b/app/code/core/Mage/Catalog/Model/Template/Filter.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/Model/Url.php b/app/code/core/Mage/Catalog/Model/Url.php index 166619c0653ac90bff2a0f262556a9bdefa52bdf..97d673e2f1a5e896bfe74c3a0d22ff70740f7993 100644 --- a/app/code/core/Mage/Catalog/Model/Url.php +++ b/app/code/core/Mage/Catalog/Model/Url.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -645,11 +645,21 @@ class Mage_Catalog_Model_Url } // match request_url abcdef1234(-12)(.html) pattern $match = array(); - if (!preg_match('#^([0-9a-z/-]+?)(-([0-9]+))?('.preg_quote($suffix).')?$#i', $requestPath, $match)) { + $regularExpression = '#^([0-9a-z/-]+?)(-([0-9]+))?('.preg_quote($suffix).')?$#i'; + if (!preg_match($regularExpression, $requestPath, $match)) { return $this->getUnusedPath($storeId, '-', $idPath); } - $requestPath = $match[1].(isset($match[3])?'-'.($match[3]+1):'-1').(isset($match[4])?$match[4]:''); - return $this->getUnusedPath($storeId, $requestPath, $idPath); + $match[1] = $match[1] . '-'; + $match[4] = isset($match[4]) ? $match[4] : ''; + + $lastRequestPath = $this->getResource() + ->getLastUsedRewriteRequestIncrement($match[1], $match[4], $storeId); + if ($lastRequestPath) { + $match[3] = $lastRequestPath; + } + return $match[1] + . (isset($match[3]) ? ($match[3]+1) : '1') + . $match[4]; } else { return $requestPath; @@ -694,7 +704,6 @@ class Mage_Catalog_Model_Url if (isset($this->_rewrites[$idPath])) { $this->_rewrite = $this->_rewrites[$idPath]; $existingRequestPath = $this->_rewrites[$idPath]->getRequestPath(); - $existingRequestPath = str_replace($suffix, '', $existingRequestPath); } if ($category->getUrlKey() == '') { @@ -715,8 +724,8 @@ class Mage_Catalog_Model_Url true, $category->getStoreId()); $requestPath = $parentPath . $urlKey . $categoryUrlSuffix; - if (isset($existingRequestPath) && $existingRequestPath == $requestPath) { - return $requestPath.$suffix; + if (isset($existingRequestPath) && $existingRequestPath == $requestPath . $suffix) { + return $existingRequestPath; } if ($this->_deleteOldTargetPath($requestPath, $idPath, $storeId)) { @@ -740,7 +749,7 @@ class Mage_Catalog_Model_Url { $finalOldTargetPath = $this->getResource()->findFinalTargetPath($requestPath, $storeId); if ($finalOldTargetPath && $finalOldTargetPath == $idPath) { - $this->getResource()->deleteRewrite($requestPath, $storeId); + $this->getResource()->deleteRewriteRecord($requestPath, $storeId, true); return true; } @@ -788,18 +797,21 @@ class Mage_Catalog_Model_Url if (isset($this->_rewrites[$idPath])) { $this->_rewrite = $this->_rewrites[$idPath]; $existingRequestPath = $this->_rewrites[$idPath]->getRequestPath(); - $existingRequestPath = str_replace($suffix, '', $existingRequestPath); - if ($existingRequestPath == $requestPath) { - return $requestPath.$suffix; + if ($existingRequestPath == $requestPath . $suffix) { + return $existingRequestPath; } + + $existingRequestPath = preg_replace('/' . preg_quote($suffix, '/') . '$/', '', $existingRequestPath); /** * Check if existing request past can be used */ if ($product->getUrlKey() == '' && !empty($requestPath) - && strpos($existingRequestPath, $requestPath) !== false + && strpos($existingRequestPath, $requestPath) === 0 ) { - $existingRequestPath = str_replace($requestPath, '', $existingRequestPath); + $existingRequestPath = preg_replace( + '/^' . preg_quote($requestPath, '/') . '/', '', $existingRequestPath + ); if (preg_match('#^-([0-9]+)$#i', $existingRequestPath)) { return $this->_rewrites[$idPath]->getRequestPath(); } diff --git a/app/code/core/Mage/Catalog/controllers/CategoryController.php b/app/code/core/Mage/Catalog/controllers/CategoryController.php index 8801359ecbcaceaebba956a85d3895f9b46581a9..94f9cd49af6a54c16219176f4a6b6b1e6f040f8e 100644 --- a/app/code/core/Mage/Catalog/controllers/CategoryController.php +++ b/app/code/core/Mage/Catalog/controllers/CategoryController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/controllers/IndexController.php b/app/code/core/Mage/Catalog/controllers/IndexController.php index e62be353722851772b487e631c030f01b2fdabdd..eb7be117fa3befc05de38385e192e024738af554 100644 --- a/app/code/core/Mage/Catalog/controllers/IndexController.php +++ b/app/code/core/Mage/Catalog/controllers/IndexController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/controllers/Product/CompareController.php b/app/code/core/Mage/Catalog/controllers/Product/CompareController.php index 518996a92a81b18261f8216cc8323b5b40775ee5..c37faa4000c3db8baeb559d6ed061186ba5a073d 100644 --- a/app/code/core/Mage/Catalog/controllers/Product/CompareController.php +++ b/app/code/core/Mage/Catalog/controllers/Product/CompareController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/controllers/ProductController.php b/app/code/core/Mage/Catalog/controllers/ProductController.php index c30282ceee87af421bd6836f897a470942f203b5..3ba82f2988db08912ab8000cf58707352697fbd3 100644 --- a/app/code/core/Mage/Catalog/controllers/ProductController.php +++ b/app/code/core/Mage/Catalog/controllers/ProductController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/controllers/Seo/SitemapController.php b/app/code/core/Mage/Catalog/controllers/Seo/SitemapController.php index 5b23b7bf43b910d6b088c90a9c29e0bceded39eb..914ff48adefbf8a345ea631a1e72a5d194cf22a0 100644 --- a/app/code/core/Mage/Catalog/controllers/Seo/SitemapController.php +++ b/app/code/core/Mage/Catalog/controllers/Seo/SitemapController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/data/catalog_setup/data-install-1.6.0.0.php b/app/code/core/Mage/Catalog/data/catalog_setup/data-install-1.6.0.0.php index e386348f7810978ebece45367109d4b6d2e297bb..37fbb8d9d74e50aa451d3b4d4ff15d1c7858ce3c 100644 --- a/app/code/core/Mage/Catalog/data/catalog_setup/data-install-1.6.0.0.php +++ b/app/code/core/Mage/Catalog/data/catalog_setup/data-install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/data/catalog_setup/data-upgrade-1.6.0.0.4-1.6.0.0.5.php b/app/code/core/Mage/Catalog/data/catalog_setup/data-upgrade-1.6.0.0.4-1.6.0.0.5.php index b921169d4ba3312953d7f7345df285586410b98f..afb034af56aac8ecb20f67d9775195c9b4cfd354 100644 --- a/app/code/core/Mage/Catalog/data/catalog_setup/data-upgrade-1.6.0.0.4-1.6.0.0.5.php +++ b/app/code/core/Mage/Catalog/data/catalog_setup/data-upgrade-1.6.0.0.4-1.6.0.0.5.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/data/catalog_setup/data-upgrade-1.6.0.0.8-1.6.0.0.9.php b/app/code/core/Mage/Catalog/data/catalog_setup/data-upgrade-1.6.0.0.8-1.6.0.0.9.php new file mode 100644 index 0000000000000000000000000000000000000000..5d78b85626238f8dc4e5d5651624090205114af6 --- /dev/null +++ b/app/code/core/Mage/Catalog/data/catalog_setup/data-upgrade-1.6.0.0.8-1.6.0.0.9.php @@ -0,0 +1,36 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Catalog + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** @var $installer Mage_Catalog_Model_Resource_Setup */ +$installer = $this; + +/** @var $attribute Mage_Catalog_Model_Resource_Eav_Attribute */ +$attribute = $installer->getAttribute('catalog_product', 'weight'); + +if ($attribute) { + $installer->updateAttribute($attribute['entity_type_id'], $attribute['attribute_id'], + 'frontend_input', $attribute['attribute_code']); +} diff --git a/app/code/core/Mage/Catalog/etc/adminhtml.xml b/app/code/core/Mage/Catalog/etc/adminhtml.xml index 6845e60c0c575d8dc540657e94adcf691f733497..870118d399a154a34a63270ee3d9f4905da5c21f 100644 --- a/app/code/core/Mage/Catalog/etc/adminhtml.xml +++ b/app/code/core/Mage/Catalog/etc/adminhtml.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Catalog/etc/api.xml b/app/code/core/Mage/Catalog/etc/api.xml index cc7a02ae18d7297834f3845d324f12b3fe0d59a7..389b61938a9071faba7315e5c127f65ad61a37fb 100644 --- a/app/code/core/Mage/Catalog/etc/api.xml +++ b/app/code/core/Mage/Catalog/etc/api.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Catalog/etc/config.xml b/app/code/core/Mage/Catalog/etc/config.xml index eaf855261b0f34e697ff5122a9fe9b426cd66e0d..3bd81a75c911f1341a9c94bb9886e4e17fe870ee 100644 --- a/app/code/core/Mage/Catalog/etc/config.xml +++ b/app/code/core/Mage/Catalog/etc/config.xml @@ -21,14 +21,14 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> <config> <modules> <Mage_Catalog> - <version>1.6.0.0.8</version> + <version>1.6.0.0.11</version> </Mage_Catalog> </modules> <global> @@ -392,6 +392,9 @@ <layered_navigation> <price_range_calculation>auto</price_range_calculation> <price_range_step>100</price_range_step> + <price_range_max_intervals>10</price_range_max_intervals> + <one_price_interval>0</one_price_interval> + <interval_division_limit>9</interval_division_limit> </layered_navigation> </catalog> <system> diff --git a/app/code/core/Mage/Catalog/etc/convert.xml b/app/code/core/Mage/Catalog/etc/convert.xml index d661e84f4a87bb79b6b76f8e9204afa8c20279f6..9b6bae2511c21ddd17a1f985f0cddfb24484c283 100644 --- a/app/code/core/Mage/Catalog/etc/convert.xml +++ b/app/code/core/Mage/Catalog/etc/convert.xml @@ -21,30 +21,30 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> <convert version="1.0"> - <container name="catalog_file" type="dataflow/convert_adapter_io"> + <container name="catalog_file" type="Mage_Dataflow_Model_Convert_Adapter_Io"> <var name="path">/tmp</var> <var name="filename">test.xml</var> </container> <profile name="import_products_from_excel_xml"> - <action method="load" type="dataflow/convert_adapter_io"> + <action method="load" type="Mage_Dataflow_Model_Convert_Adapter_Io"> <var name="filename">products.xml</var> </action> - <action method="parse" type="dataflow/convert_parser_xml_excel"> + <action method="parse" type="Mage_Dataflow_Model_Convert_Parser_Xml_Excel"> <var name="single_sheet">Products</var> </action> - <action method="parse" type="catalog/convert_parser_product"/> + <action method="parse" type="Mage_Catalog_Model_Convert_Parser_Product"/> - <action method="validate" type="dataflow/convert_validator_dryrun"/> + <action method="validate" type="Mage_Dataflow_Model_Convert_Validator_Dryrun"/> <action method="save" type="eav/convert_adapter_collection"/> </profile> @@ -54,15 +54,15 @@ <var name="entity_type">catalog/product</var> </action> - <action method="unparse" type="catalog/convert_parser_product"/> + <action method="unparse" type="Mage_Catalog_Model_Convert_Parser_Product"/> - <action method="unparse" type="dataflow/convert_parser_xml_excel"> + <action method="unparse" type="Mage_Dataflow_Model_Convert_Parser_Xml_Excel"> <var name="single_sheet">Products</var> </action> - <action method="validate" type="dataflow/convert_validator_dryrun"/> + <action method="validate" type="Mage_Dataflow_Model_Convert_Validator_Dryrun"/> - <action method="save" type="dataflow/convert_adapter_io"> + <action method="save" type="Mage_Dataflow_Model_Convert_Adapter_Io"> <var name="filename">products.xml</var> </action> </profile> @@ -70,23 +70,23 @@ <profile name="import_catalog"> <action method="load" use="catalog_file"/> - <action method="parse" type="dataflow/convert_parser_xml_excel"/> + <action method="parse" type="Mage_Dataflow_Model_Convert_Parser_Xml_Excel"/> - <action method="save" type="catalog/convert_adapter_catalog"/> + <action method="save" type="Mage_Catalog_Model_Convert_Adapter_Catalog"/> </profile> <profile name="export_catalog"> - <action method="load" type="catalog/convert_adapter_catalog"/> + <action method="load" type="Mage_Catalog_Model_Convert_Adapter_Catalog"/> - <action method="unparse" type="dataflow/convert_parser_xml_excel"/> + <action method="unparse" type="Mage_Dataflow_Model_Convert_Parser_Xml_Excel"/> <action method="save" use="catalog_file"/> </profile> <profile name="export_catalog_to_http"> - <action method="load" type="catalog/convert_adapter_catalog"/> + <action method="load" type="Mage_Catalog_Model_Convert_Adapter_Catalog"/> - <action method="unparse" type="dataflow/convert_parser_xml_excel"/> + <action method="unparse" type="Mage_Dataflow_Model_Convert_Parser_Xml_Excel"/> <action method="save" type="Mage_Dataflow_Model_Convert_Adapter_Http"> <var name="Content-Disposition">attachment; filename=catalog.xml</var> diff --git a/app/code/core/Mage/Catalog/etc/fieldset.xml b/app/code/core/Mage/Catalog/etc/fieldset.xml index 7d7b53e1736430025eacdcac7f7eb2e771bc33f3..9310bb06098d4bcc2ea42cdda6521bd3338e3cd2 100644 --- a/app/code/core/Mage/Catalog/etc/fieldset.xml +++ b/app/code/core/Mage/Catalog/etc/fieldset.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Catalog/etc/system.xml b/app/code/core/Mage/Catalog/etc/system.xml index edee67a3ea456ebf8de05f500ee0e9866de66ecc..80eb337ed88a94fc008701404c6a99c784ba52dd 100644 --- a/app/code/core/Mage/Catalog/etc/system.xml +++ b/app/code/core/Mage/Catalog/etc/system.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> @@ -64,6 +64,7 @@ <label>Products per Page on Grid Allowed Values</label> <comment>Comma-separated.</comment> <frontend_type>text</frontend_type> + <validate>validate-per-page-value-list</validate> <!--<source_model>Mage_Adminhtml_Model_System_Config_Source_Catalog_GridPerPage</source_model>--> <sort_order>2</sort_order> <show_in_default>1</show_in_default> @@ -74,6 +75,7 @@ <label>Products per Page on Grid Default Value</label> <comment>Must be in the allowed values list.</comment> <frontend_type>text</frontend_type> + <validate>validate-per-page-value</validate> <!--<source_model>Mage_Adminhtml_Model_System_Config_Source_Catalog_GridPerPage</source_model>--> <sort_order>3</sort_order> <show_in_default>1</show_in_default> @@ -84,6 +86,7 @@ <label>Products per Page on List Allowed Values</label> <comment>Comma-separated.</comment> <frontend_type>text</frontend_type> + <validate>validate-per-page-value-list</validate> <!--<source_model>Mage_Adminhtml_Model_System_Config_Source_Catalog_GridPerPage</source_model>--> <sort_order>4</sort_order> <show_in_default>1</show_in_default> @@ -94,6 +97,7 @@ <label>Products per Page on List Default Value</label> <comment>Must be in the allowed values list.</comment> <frontend_type>text</frontend_type> + <validate>validate-per-page-value</validate> <!--<source_model>Mage_Adminhtml_Model_System_Config_Source_Catalog_ListPerPage</source_model>--> <sort_order>5</sort_order> <show_in_default>1</show_in_default> @@ -320,12 +324,46 @@ <price_range_step translate="label"> <label>Default Price Navigation Step</label> <frontend_type>text</frontend_type> + <validate>validate-number validate-number-range number-range-0.01-1000000000</validate> <sort_order>2</sort_order> <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> <show_in_store>1</show_in_store> <depends><price_range_calculation>manual</price_range_calculation></depends> </price_range_step> + <price_range_max_intervals translate="label comment"> + <label>Maximum Number of Price Intervals</label> + <comment>Maximum number of price intervals is 100</comment> + <frontend_type>text</frontend_type> + <validate>validate-digits validate-digits-range digits-range-2-100</validate> + <sort_order>3</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>1</show_in_store> + <depends><price_range_calculation>manual</price_range_calculation></depends> + </price_range_max_intervals> + <one_price_interval translate="label comment"> + <label>Display Price Interval as One Price</label> + <comment>This setting will be applied when all prices in the specific price interval are equal.</comment> + <frontend_type>select</frontend_type> + <source_model>Mage_Adminhtml_Model_System_Config_Source_Yesno</source_model> + <sort_order>4</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>1</show_in_store> + <depends><price_range_calculation>auto</price_range_calculation></depends> + </one_price_interval> + <interval_division_limit translate="label comment"> + <label>Interval Division Limit</label> + <comment>Please specify the number of products, that will not be divided into subintervals.</comment> + <frontend_type>text</frontend_type> + <sort_order>5</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>1</show_in_store> + <validate>validate-digits validate-digits-range digits-range-1-10000</validate> + <depends><price_range_calculation>auto</price_range_calculation></depends> + </interval_division_limit> </fields> </layered_navigation> <navigation translate="label"> diff --git a/app/code/core/Mage/Catalog/etc/view.xml b/app/code/core/Mage/Catalog/etc/view.xml index 76a39e60da1234c8a0e79d232f3a8d258efc240b..de0d81c393a7c4ecc8bd2788e27770c35fd85ac2 100644 --- a/app/code/core/Mage/Catalog/etc/view.xml +++ b/app/code/core/Mage/Catalog/etc/view.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Catalog/etc/widget.xml b/app/code/core/Mage/Catalog/etc/widget.xml index 6d6e007177151be9e673f5b371bdd37b72c544e8..62044a87fc79a7aa20ce59df6da6eb065e8dabca 100644 --- a/app/code/core/Mage/Catalog/etc/widget.xml +++ b/app/code/core/Mage/Catalog/etc/widget.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/install-1.6.0.0.php b/app/code/core/Mage/Catalog/sql/catalog_setup/install-1.6.0.0.php index 9ead1befc3ce965eb7253da08552212fa2c0a51d..b3581446854106b08edafcb6057a9c36dfe9c300 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.6.0.0.8-1.6.0.0.9.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.6.0.0.8-1.6.0.0.9.php new file mode 100644 index 0000000000000000000000000000000000000000..6c8b70180976316441e82aab008d3562c03f6706 --- /dev/null +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-1.6.0.0.8-1.6.0.0.9.php @@ -0,0 +1,53 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Catalog + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +$installFile = dirname(__FILE__) . DS . 'upgrade-1.6.0.0.8-1.6.0.0.9.php'; +if (file_exists($installFile)) { + include $installFile; +} + +/** @var $installer Mage_Catalog_Model_Resource_Setup */ +$installer = $this; +/** @var $connection Varien_Db_Adapter_Pdo_Mysql */ +$connection = $installer->getConnection(); +$memoryTables = array( + 'catalog_category_anc_categs_index_tmp', + 'catalog_category_anc_products_index_tmp', + 'catalog_category_product_index_enbl_tmp', + 'catalog_category_product_index_tmp', + 'catalog_product_index_eav_decimal_tmp', + 'catalog_product_index_eav_tmp', + 'catalog_product_index_price_cfg_opt_agr_tmp', + 'catalog_product_index_price_cfg_opt_tmp', + 'catalog_product_index_price_final_tmp', + 'catalog_product_index_price_opt_agr_tmp', + 'catalog_product_index_price_opt_tmp', + 'catalog_product_index_price_tmp', +); + +foreach ($memoryTables as $table) { + $connection->changeTableEngine($installer->getTable($table), Varien_Db_Adapter_Pdo_Mysql::ENGINE_MEMORY); +} diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0-1.6.0.0.1.php b/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0-1.6.0.0.1.php index 6a72f55bfa17275eacdffa01be4324eda0ae035d..6eb029d70c7d52124230bf16a9432016c5fbc66f 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0-1.6.0.0.1.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0-1.6.0.0.1.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.1-1.6.0.0.2.php b/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.1-1.6.0.0.2.php index b86687dafade844a694b9946de7c17a848325f95..0297c8e0643d81d3366828ef9e035bdceebeb22c 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.1-1.6.0.0.2.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.1-1.6.0.0.2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.10-1.6.0.0.11.php b/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.10-1.6.0.0.11.php new file mode 100644 index 0000000000000000000000000000000000000000..05161ad2d0e0bc042bc0dd6b3cfa819f456fb170 --- /dev/null +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.10-1.6.0.0.11.php @@ -0,0 +1,31 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Catalog + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** @var $installer Mage_Catalog_Model_Resource_Setup */ +$installer = $this; + +$attributeId = $this->getAttribute('catalog_product', 'group_price', 'attribute_id'); +$installer->updateAttribute('catalog_product', $attributeId, array(), null, 5); diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.2-1.6.0.0.3.php b/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.2-1.6.0.0.3.php index 1ca57f4d7bc03dc0859467c61584ecf6872c0531..09815b5d601bbfe6968c329e7f934ae9bd11bdbf 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.2-1.6.0.0.3.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.2-1.6.0.0.3.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.3-1.6.0.0.4.php b/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.3-1.6.0.0.4.php index e2c7a5701a0d308d9289bdc2490119835016e811..b6ab94d335eff1dbb9c3d8837a7c768dc1e7369d 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.3-1.6.0.0.4.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.3-1.6.0.0.4.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.4-1.6.0.0.5.php b/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.4-1.6.0.0.5.php index 752f2bbde064f552109ee421003f44a366e9e270..4b2e29796682483b072e58ca34e7e46cc0121c06 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.4-1.6.0.0.5.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.4-1.6.0.0.5.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.5-1.6.0.0.6.php b/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.5-1.6.0.0.6.php index fd578cc350ba604f80d5245b5069af8d16e1dbaf..b3468b6cd58a26a97eb10b32dfe1dc07c34563cd 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.5-1.6.0.0.6.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.5-1.6.0.0.6.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.6-1.6.0.0.7.php b/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.6-1.6.0.0.7.php index 009a51b26caf7b104fd20e3dba3a3d8cd3633a7f..1408a7911fb676759b412cc472d9a3df2289174f 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.6-1.6.0.0.7.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.6-1.6.0.0.7.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.7-1.6.0.0.8.php b/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.7-1.6.0.0.8.php index 3402e5fad6805f95a0ecb01dbba1763de6c89519..8bd9574ff64c384d7b05d8b12a01a8ebae46cc55 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.7-1.6.0.0.8.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.7-1.6.0.0.8.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.9-1.6.0.0.10.php b/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.9-1.6.0.0.10.php new file mode 100644 index 0000000000000000000000000000000000000000..e447c63a6a9f551711e3719953bccdd8fe030cf9 --- /dev/null +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.9-1.6.0.0.10.php @@ -0,0 +1,214 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Catalog + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** @var $installer Mage_Catalog_Model_Resource_Setup */ +$installer = $this; +$connection = $installer->getConnection(); + +/** + * Create table 'catalog_product_entity_group_price' + */ +$table = $installer->getConnection() + ->newTable($installer->getTable('catalog_product_entity_group_price')) + ->addColumn('value_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array( + 'identity' => true, + 'nullable' => false, + 'primary' => true, + ), 'Value ID') + ->addColumn('entity_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array( + 'unsigned' => true, + 'nullable' => false, + 'default' => '0', + ), 'Entity ID') + ->addColumn('all_groups', Varien_Db_Ddl_Table::TYPE_SMALLINT, null, array( + 'unsigned' => true, + 'nullable' => false, + 'default' => '1', + ), 'Is Applicable To All Customer Groups') + ->addColumn('customer_group_id', Varien_Db_Ddl_Table::TYPE_SMALLINT, null, array( + 'unsigned' => true, + 'nullable' => false, + 'default' => '0', + ), 'Customer Group ID') + ->addColumn('value', Varien_Db_Ddl_Table::TYPE_DECIMAL, '12,4', array( + 'nullable' => false, + 'default' => '0.0000', + ), 'Value') + ->addColumn('website_id', Varien_Db_Ddl_Table::TYPE_SMALLINT, null, array( + 'unsigned' => true, + 'nullable' => false, + ), 'Website ID') + ->addIndex( + $installer->getIdxName( + 'catalog_product_entity_group_price', + array('entity_id', 'all_groups', 'customer_group_id', 'website_id'), + Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE + ), + array('entity_id', 'all_groups', 'customer_group_id', 'website_id'), + array('type' => Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE)) + ->addIndex($installer->getIdxName('catalog_product_entity_group_price', array('entity_id')), + array('entity_id')) + ->addIndex($installer->getIdxName('catalog_product_entity_group_price', array('customer_group_id')), + array('customer_group_id')) + ->addIndex($installer->getIdxName('catalog_product_entity_group_price', array('website_id')), + array('website_id')) + ->addForeignKey( + $installer->getFkName( + 'catalog_product_entity_group_price', + 'customer_group_id', + 'customer_group', + 'customer_group_id' + ), + 'customer_group_id', $installer->getTable('customer_group'), 'customer_group_id', + Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE) + ->addForeignKey( + $installer->getFkName( + 'catalog_product_entity_group_price', + 'entity_id', + 'catalog_product_entity', + 'entity_id' + ), + 'entity_id', $installer->getTable('catalog_product_entity'), 'entity_id', + Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE) + ->addForeignKey( + $installer->getFkName( + 'catalog_product_entity_group_price', + 'website_id', + 'core_website', + 'website_id' + ), + 'website_id', $installer->getTable('core_website'), 'website_id', + Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE) + ->setComment('Catalog Product Group Price Attribute Backend Table'); +$installer->getConnection()->createTable($table); + +$installer->addAttribute('catalog_product', 'group_price', array( + 'type' => 'decimal', + 'label' => 'Group Price', + 'input' => 'text', + 'backend' => 'Mage_Catalog_Model_Product_Attribute_Backend_Groupprice', + 'required' => false, + 'sort_order' => 6, + 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_WEBSITE, + 'apply_to' => 'simple,configurable,virtual', + 'group' => 'Prices', +)); + +/** + * Create table 'catalog_product_index_group_price' + */ +$table = $connection + ->newTable($installer->getTable('catalog_product_index_group_price')) + ->addColumn('entity_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array( + 'unsigned' => true, + 'nullable' => false, + 'primary' => true, + ), 'Entity ID') + ->addColumn('customer_group_id', Varien_Db_Ddl_Table::TYPE_SMALLINT, null, array( + 'unsigned' => true, + 'nullable' => false, + 'primary' => true, + ), 'Customer Group ID') + ->addColumn('website_id', Varien_Db_Ddl_Table::TYPE_SMALLINT, null, array( + 'unsigned' => true, + 'nullable' => false, + 'primary' => true, + ), 'Website ID') + ->addColumn('price', Varien_Db_Ddl_Table::TYPE_DECIMAL, '12,4', array( + ), 'Min Price') + ->addIndex($installer->getIdxName('catalog_product_index_group_price', array('customer_group_id')), + array('customer_group_id')) + ->addIndex($installer->getIdxName('catalog_product_index_group_price', array('website_id')), + array('website_id')) + ->addForeignKey( + $installer->getFkName( + 'catalog_product_index_group_price', + 'customer_group_id', + 'customer_group', + 'customer_group_id' + ), + 'customer_group_id', $installer->getTable('customer_group'), 'customer_group_id', + Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE) + ->addForeignKey( + $installer->getFkName( + 'catalog_product_index_group_price', + 'entity_id', + 'catalog_product_entity', + 'entity_id' + ), + 'entity_id', $installer->getTable('catalog_product_entity'), 'entity_id', + Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE) + ->addForeignKey( + $installer->getFkName( + 'catalog_product_index_group_price', + 'website_id', + 'core_website', + 'website_id' + ), + 'website_id', $installer->getTable('core_website'), 'website_id', + Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE) + ->setComment('Catalog Product Group Price Index Table'); +$connection->createTable($table); + +$finalPriceIndexerTables = array( + 'catalog_product_index_price_final_idx', + 'catalog_product_index_price_final_tmp', +); + +$priceIndexerTables = array( + 'catalog_product_index_price_opt_agr_idx', + 'catalog_product_index_price_opt_agr_tmp', + 'catalog_product_index_price_opt_idx', + 'catalog_product_index_price_opt_tmp', + 'catalog_product_index_price_idx', + 'catalog_product_index_price_tmp', + 'catalog_product_index_price_cfg_opt_agr_idx', + 'catalog_product_index_price_cfg_opt_agr_tmp', + 'catalog_product_index_price_cfg_opt_idx', + 'catalog_product_index_price_cfg_opt_tmp', + 'catalog_product_index_price', +); + +foreach ($finalPriceIndexerTables as $table) { + $connection->addColumn($installer->getTable($table), 'group_price', array( + 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, + 'length' => '12,4', + 'comment' => 'Group price', + )); + $connection->addColumn($installer->getTable($table), 'base_group_price', array( + 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, + 'length' => '12,4', + 'comment' => 'Base Group Price', + )); +} + +foreach ($priceIndexerTables as $table) { + $connection->addColumn($installer->getTable($table), 'group_price', array( + 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, + 'length' => '12,4', + 'comment' => 'Group price', + )); +} diff --git a/app/code/core/Mage/Catalog/view/frontend/category/view.phtml b/app/code/core/Mage/Catalog/view/frontend/category/view.phtml index d562afa3c11a7241ade96b3a763be78f6e1c148c..21c074e1fe3540ba4be255f9ece197ad165dfabe 100644 --- a/app/code/core/Mage/Catalog/view/frontend/category/view.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/category/view.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Catalog/view/frontend/category/widget/link/link_block.phtml b/app/code/core/Mage/Catalog/view/frontend/category/widget/link/link_block.phtml index 74c399057b367b4935c8af867201d04481407b41..5ffb7548195c38149f0a42cd83fff2993a95c4b0 100644 --- a/app/code/core/Mage/Catalog/view/frontend/category/widget/link/link_block.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/category/widget/link/link_block.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Catalog/view/frontend/category/widget/link/link_inline.phtml b/app/code/core/Mage/Catalog/view/frontend/category/widget/link/link_inline.phtml index c08c9a37e9c7da8e1a2818ffc1fb26678b2e9d15..60fac35e87f627de679cfa149869a8b890516c89 100644 --- a/app/code/core/Mage/Catalog/view/frontend/category/widget/link/link_inline.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/category/widget/link/link_inline.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Catalog/view/frontend/layer/filter.phtml b/app/code/core/Mage/Catalog/view/frontend/layer/filter.phtml index 012367c077c58b945d76b189acef1ba6c6cd2f72..50977c6b21eb2209ca6c26d5e06b0e2396d8184d 100644 --- a/app/code/core/Mage/Catalog/view/frontend/layer/filter.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/layer/filter.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Catalog/view/frontend/layer/state.phtml b/app/code/core/Mage/Catalog/view/frontend/layer/state.phtml index f6d7a7828c26768415c3e56f40f6ea9b4df59f59..02395ab901fb06beca93cd640c910f92ffb4d510 100644 --- a/app/code/core/Mage/Catalog/view/frontend/layer/state.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/layer/state.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -40,9 +40,14 @@ <li> <a href="<?php echo $_filter->getRemoveUrl() ?>" title="<?php echo $this->__('Remove This Item') ?>" class="btn-remove"><?php echo $this->__('Remove This Item') ?></a> <span class="label"><?php echo $this->__($_filter->getName()) ?>:</span> <?php echo $this->stripTags($_filter->getLabel()) ?> + <?php + $clearLinkUrl = $_filter->getClearLinkUrl(); + if ($clearLinkUrl): + ?> + <div class="actions"><a href="<?php echo $clearLinkUrl ?>"><?php echo $this->escapeHtml($_filter->getFilter()->getClearLinkText()) ?></a></div> + <?php endif; ?> </li> <?php endforeach; ?> </ol> - <div class="actions"><a href="<?php echo $this->getClearUrl() ?>"><?php echo $this->__('Clear All') ?></a></div> </div> <?php endif; ?> diff --git a/app/code/core/Mage/Catalog/view/frontend/layer/view.phtml b/app/code/core/Mage/Catalog/view/frontend/layer/view.phtml index ad6e3c36037d7e26736b9620ab0f2003566750ea..a7eda469aac84e29e2358349dbbd33dce6a684c1 100644 --- a/app/code/core/Mage/Catalog/view/frontend/layer/view.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/layer/view.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -51,6 +51,9 @@ </dl> <script type="text/javascript">decorateDataList('narrow-by-list')</script> <?php endif; ?> + <?php if ($this->getLayer()->getState()->getFilters()): ?> + <div class="actions"><a href="<?php echo $this->getClearUrl() ?>"><?php echo $this->__('Clear All') ?></a></div> + <?php endif; ?> </div> </div> <?php endif; ?> diff --git a/app/code/core/Mage/Catalog/view/frontend/layout.xml b/app/code/core/Mage/Catalog/view/frontend/layout.xml index 398c6e2e55e95916d5caf58f206e13a4fed8d8bc..4109dfe718d64d58a3c3e8251c3eef1050441e76 100644 --- a/app/code/core/Mage/Catalog/view/frontend/layout.xml +++ b/app/code/core/Mage/Catalog/view/frontend/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/Catalog/view/frontend/msrp.js b/app/code/core/Mage/Catalog/view/frontend/msrp.js index 79a7f2c5bbd068f582872ed344aab1379e1a6487..a25b41a90474c11b93e80109f996011df63be315 100644 --- a/app/code/core/Mage/Catalog/view/frontend/msrp.js +++ b/app/code/core/Mage/Catalog/view/frontend/msrp.js @@ -19,7 +19,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ if (!window.Catalog) { diff --git a/app/code/core/Mage/Catalog/view/frontend/msrp.xml b/app/code/core/Mage/Catalog/view/frontend/msrp.xml index 01712bcc628c185d1ef5037e2bd295b7f3ce28c9..06a6442ebba62145252f4ea289e2968a1e009fb1 100644 --- a/app/code/core/Mage/Catalog/view/frontend/msrp.xml +++ b/app/code/core/Mage/Catalog/view/frontend/msrp.xml @@ -21,7 +21,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/Catalog/view/frontend/msrp/popup.phtml b/app/code/core/Mage/Catalog/view/frontend/msrp/popup.phtml index 2b66de76c5ec6f0566f2ea3d2242bd738ccfdff1..07cec3b4b3d4727dffa13a595fe7a3fd456402ec 100644 --- a/app/code/core/Mage/Catalog/view/frontend/msrp/popup.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/msrp/popup.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Catalog/view/frontend/navigation/left.phtml b/app/code/core/Mage/Catalog/view/frontend/navigation/left.phtml index 6581f5781c40330a4006bdbdde57643f9a20aae4..26b5e871736253a87c6ac7aeb4bb97918e34fb69 100644 --- a/app/code/core/Mage/Catalog/view/frontend/navigation/left.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/navigation/left.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/Catalog/view/frontend/navigation/top.phtml b/app/code/core/Mage/Catalog/view/frontend/navigation/top.phtml index f5914a1e089e4b91f9572ee5e21fdb718d92fec3..26bd72708f8e0accdb97534090a1e01c3504edf5 100644 --- a/app/code/core/Mage/Catalog/view/frontend/navigation/top.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/navigation/top.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Catalog/view/frontend/product/compare/list.phtml b/app/code/core/Mage/Catalog/view/frontend/product/compare/list.phtml index a2320c34a7db72c1b29049e6526cf064d999a2bb..94fd7656705db33fdb41e88a9e60ddf0cf749eda 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/compare/list.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/product/compare/list.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /* @var $this Mage_Catalog_Block_Product_Compare_List */ @@ -98,7 +98,9 @@ echo substr($this->getProductAttributeValue($_item, $_attribute),0,10); break; default: ?> - <?php echo $this->helper('Mage_Catalog_Helper_Output')->productAttribute($_item, $this->getProductAttributeValue($_item, $_attribute), $_attribute->getAttributeCode()) ?> + <div class="std"> + <?php echo $this->helper('Mage_Catalog_Helper_Output')->productAttribute($_item, $this->getProductAttributeValue($_item, $_attribute), $_attribute->getAttributeCode()) ?> + </div> <?php break; } ?> </td> diff --git a/app/code/core/Mage/Catalog/view/frontend/product/compare/sidebar.phtml b/app/code/core/Mage/Catalog/view/frontend/product/compare/sidebar.phtml index 2c58d9d28becc5e89f392bbd6f20b314711588ac..5f9aab55d7faccae4cee456cd2f90d45ff6d5fed 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/compare/sidebar.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/product/compare/sidebar.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /* @var $this Mage_Catalog_Block_Product_Compare_Sidebar */ diff --git a/app/code/core/Mage/Catalog/view/frontend/product/gallery.phtml b/app/code/core/Mage/Catalog/view/frontend/product/gallery.phtml index 94cf1e3528dcccbe18860035f76d855fae811214..cc3e65c76bc1350a6df430a3de614fc8d9940952 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/gallery.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/product/gallery.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Catalog/view/frontend/product/list.phtml b/app/code/core/Mage/Catalog/view/frontend/product/list.phtml index cd40f7fb04d07d96f1f2823a536501ad091b7f9e..575deaf044ca1b5b73d186fa75ca5b52075d704e 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/list.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/product/list.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Catalog/view/frontend/product/list/related.phtml b/app/code/core/Mage/Catalog/view/frontend/product/list/related.phtml index 5a1db095cce1b1b1292ccc022dd559af5ad0b7eb..61df743cf284be4560c717e21d5c63db18c6f3fb 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/list/related.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/product/list/related.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Catalog/view/frontend/product/list/toolbar.phtml b/app/code/core/Mage/Catalog/view/frontend/product/list/toolbar.phtml index fb9e2aba884bf8abddabf09a0200dc8b44e9d242..7d1cb5d1c329b45b80c21b63f732c97e257fc692 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/list/toolbar.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/product/list/toolbar.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Catalog/view/frontend/product/list/upsell.phtml b/app/code/core/Mage/Catalog/view/frontend/product/list/upsell.phtml index 7dfc2254d8ef07f55b46d02fdcb4ca30d827a092..370be367d92600d7ac7ea5dd77858bfc0b8bb74b 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/list/upsell.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/product/list/upsell.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Catalog/view/frontend/product/new.phtml b/app/code/core/Mage/Catalog/view/frontend/product/new.phtml index ae59c3e0ef83203ee36ab5b12d6ad8d8b3f22ffa..5e05660ca6bea609b9bda9aa05dd1bbeeb7ee8c1 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/new.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/product/new.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Catalog/view/frontend/product/price.phtml b/app/code/core/Mage/Catalog/view/frontend/product/price.phtml index d7ba09bdfe7fd84bed884e15b3ecaae188c26612..8ba900687ec77ac0e6707b9892c91fa15ab3c325 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/price.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/product/price.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -41,6 +41,7 @@ /* @var $_taxHelper Mage_Tax_Helper_Data */ $_product = $this->getProduct(); + $_storeId = $_product->getStoreId(); $_id = $_product->getId(); $_weeeSeparator = ''; $_simplePricesTax = ($_taxHelper->displayPriceIncludingTax() || $_taxHelper->displayBothPrices()); @@ -55,7 +56,7 @@ <?php $_weeeTaxAttributes = $_weeeHelper->getProductWeeeAttributesForDisplay($_product); ?> <?php endif; ?> <?php $_weeeTaxAmountInclTaxes = $_weeeTaxAmount; ?> - <?php if ($_weeeHelper->isTaxable()): ?> + <?php if ($_weeeHelper->isTaxable() && !$_taxHelper->priceIncludesTax($_storeId)): ?> <?php $_attributes = $_weeeHelper->getProductWeeeAttributesForRenderer($_product, null, null, null, true); ?> <?php $_weeeTaxAmountInclTaxes = $_weeeHelper->getAmountInclTaxes($_attributes); ?> <?php endif; ?> @@ -211,13 +212,13 @@ <p class="special-price"> <span class="price-label"><?php echo $this->__('Special Price:') ?></span> <span class="price-excluding-tax"> - <span class="label"><?php echo $_taxHelper->__('Excl. Tax:') ?></span> + <span class="label"><?php echo $this->helper('Mage_Tax_Helper_Data')->__('Excl. Tax:') ?></span> <span class="price" id="price-excluding-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"> <?php echo $_coreHelper->currency($_finalPrice+$_weeeTaxAmount,true,false) ?> </span> </span> <span class="price-including-tax"> - <span class="label"><?php echo $_taxHelper->__('Incl. Tax:') ?></span> + <span class="label"><?php echo $this->helper('Mage_Tax_Helper_Data')->__('Incl. Tax:') ?></span> <span class="price" id="price-including-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"> <?php echo $_coreHelper->currency($_finalPriceInclTax+$_weeeTaxAmountInclTaxes,true,false) ?> </span> @@ -227,7 +228,7 @@ <p class="special-price"> <span class="price-label"><?php echo $this->__('Special Price:') ?></span> <span class="price" id="product-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"> - <?php echo $_coreHelper->currency($_finalPrice+$_weeeTaxAmount,true,false) ?> + <?php echo $_coreHelper->currency($_finalPrice+$_weeeTaxAmountInclTaxes,true,false) ?> </span> </p> <?php endif; ?> @@ -243,7 +244,7 @@ <p class="special-price"> <span class="price-label"><?php echo $this->__('Special Price:') ?></span> <span class="price-excluding-tax"> - <span class="label"><?php echo $_taxHelper->__('Excl. Tax:') ?></span> + <span class="label"><?php echo $this->helper('Mage_Tax_Helper_Data')->__('Excl. Tax:') ?></span> <span class="price" id="price-excluding-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"> <?php echo $_coreHelper->currency($_finalPrice+$_weeeTaxAmount,true,false) ?> </span> @@ -256,7 +257,7 @@ <?php endforeach; ?> )</span> <span class="price-including-tax"> - <span class="label"><?php echo $_taxHelper->__('Incl. Tax:') ?></span> + <span class="label"><?php echo $this->helper('Mage_Tax_Helper_Data')->__('Incl. Tax:') ?></span> <span class="price" id="price-including-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"> <?php echo $_coreHelper->currency($_finalPriceInclTax+$_weeeTaxAmountInclTaxes,true,false) ?> </span> @@ -273,7 +274,7 @@ <p class="special-price"> <span class="price-label"><?php echo $this->__('Special Price:') ?></span> <span class="price-excluding-tax"> - <span class="label"><?php echo $_taxHelper->__('Excl. Tax:') ?></span> + <span class="label"><?php echo $this->helper('Mage_Tax_Helper_Data')->__('Excl. Tax:') ?></span> <span class="price" id="price-excluding-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"> <?php echo $_coreHelper->currency($_finalPrice+$_weeeTaxAmount,true,false) ?> </span> @@ -303,7 +304,7 @@ <p class="special-price"> <span class="price-label"><?php echo $this->__('Special Price:') ?></span> <span class="price-excluding-tax"> - <span class="label"><?php echo $_taxHelper->__('Excl. Tax:') ?></span> + <span class="label"><?php echo $this->helper('Mage_Tax_Helper_Data')->__('Excl. Tax:') ?></span> <span class="price" id="price-excluding-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"> <?php echo $_coreHelper->currency($_finalPrice,true,false) ?> </span> @@ -332,7 +333,7 @@ <p class="special-price"> <span class="price-label"><?php echo $this->__('Special Price:') ?></span> <span class="price-excluding-tax"> - <span class="label"><?php echo $_taxHelper->__('Excl. Tax:') ?></span> + <span class="label"><?php echo $this->helper('Mage_Tax_Helper_Data')->__('Excl. Tax:') ?></span> <span class="price" id="price-excluding-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"> <?php echo $_coreHelper->currency($_finalPrice,true,false) ?> </span> diff --git a/app/code/core/Mage/Catalog/view/frontend/product/price_msrp.phtml b/app/code/core/Mage/Catalog/view/frontend/product/price_msrp.phtml index 26dc4d8833b80fc972687d0036bb7b876a7bf13a..bb725886798a17dfbd9407147063ec38e0313bdc 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/price_msrp.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/product/price_msrp.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Catalog/view/frontend/product/price_msrp_item.phtml b/app/code/core/Mage/Catalog/view/frontend/product/price_msrp_item.phtml index 6568b923415119eb5e4299d127ab46d829ae4b20..e6222db00f04305a2e7e41380b92b3ddb170c8cc 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/price_msrp_item.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/product/price_msrp_item.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Catalog/view/frontend/product/price_msrp_noform.phtml b/app/code/core/Mage/Catalog/view/frontend/product/price_msrp_noform.phtml index 929229520f85b4bd663f3322e4233bb769269f73..bface0a55155bbf836d9374763146b67485ac354 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/price_msrp_noform.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/product/price_msrp_noform.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Catalog/view/frontend/product/price_msrp_rss.phtml b/app/code/core/Mage/Catalog/view/frontend/product/price_msrp_rss.phtml index ac14f4c123005f7ff3baf11595599f1d029abaac..f0516b5cfe26a53823b67644cc52f48244506ef9 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/price_msrp_rss.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/product/price_msrp_rss.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Catalog/view/frontend/product/view.phtml b/app/code/core/Mage/Catalog/view/frontend/product/view.phtml index 580bf9b879c2bdd72fb53289c118698dfdf34fd6..c732dd6724757bd0f1ead953cceae51da4ac953b 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/view.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/product/view.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/Catalog/view/frontend/product/view/additional.phtml b/app/code/core/Mage/Catalog/view/frontend/product/view/additional.phtml index eade95b3cb7bef5c8321a03a1ed0efde07947ac7..ded93626f71123d0ed391fcf5936df950e4feaa5 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/view/additional.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/product/view/additional.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Catalog/view/frontend/product/view/addto.phtml b/app/code/core/Mage/Catalog/view/frontend/product/view/addto.phtml index 2e1e3b4197dc404bfe2d9213295143b795a82135..3cc816ca913a72f59c7682da9aa6536264f446b8 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/view/addto.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/product/view/addto.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Catalog/view/frontend/product/view/addtocart.phtml b/app/code/core/Mage/Catalog/view/frontend/product/view/addtocart.phtml index 9c3f4394996a6178b2958c7b1d885b5fdf9ea751..747c7ea1957b78281beb19d47c123c1113cdbbfd 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/view/addtocart.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/product/view/addtocart.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Catalog/view/frontend/product/view/attributes.phtml b/app/code/core/Mage/Catalog/view/frontend/product/view/attributes.phtml index 8332d84db511b054176afb8d065b6f4f661b7c4f..dd49710762ff48e7de2d5dd6ff9a40fcf2c6ad23 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/view/attributes.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/product/view/attributes.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/Catalog/view/frontend/product/view/description.phtml b/app/code/core/Mage/Catalog/view/frontend/product/view/description.phtml index dc388d3f68c9b8860afe778a3be6e5b8af763726..7b0f29a4c5b188fc42c63e4198ea680083423800 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/view/description.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/product/view/description.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/Catalog/view/frontend/product/view/media.phtml b/app/code/core/Mage/Catalog/view/frontend/product/view/media.phtml index cd1c56a1206149821fff9b9771e34845f84db1bc..e21f36a949e18dde24945b4e8294d11c4a3b8e5e 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/view/media.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/product/view/media.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/Catalog/view/frontend/product/view/options.phtml b/app/code/core/Mage/Catalog/view/frontend/product/view/options.phtml index ab35faf6cbeec74fb674eb024c1da36d5b321105..67fddcdbe8de1d35495e1f9011d0bcf77a644a4a 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/view/options.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/product/view/options.phtml @@ -20,9 +20,10 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ +/* @var $this Mage_Catalog_Block_Product_View_Options */ ?> <?php $_options = Mage::helper('Mage_Core_Helper_Data')->decorateArray($this->getOptions()) ?> @@ -109,20 +110,20 @@ document.observe("dom:loaded", this.reloadPrice.bind(this)); }, reloadPrice : function(){ - price = new Number(); - oldPrice = new Number(); - config = this.config; - skipIds = []; - $$('.product-custom-option').each(function(element){ + var config = this.config; + var skipIds = []; + $$('body .product-custom-option').each(function(element){ var optionId = 0; element.name.sub(/[0-9]+/, function(match){ - optionId = match[0]; + optionId = parseInt(match[0], 10); }); - if (this.config[optionId]) { + if (config[optionId]) { + var configOptions = config[optionId]; + var curConfig = {price: 0}; if (element.type == 'checkbox' || element.type == 'radio') { if (element.checked) { - if (config[optionId][element.getValue()]['price']) { - price += parseFloat(config[optionId][element.getValue()]['price']); + if (typeof configOptions[element.getValue()] != 'undefined') { + curConfig = configOptions[element.getValue()]; } } } else if(element.hasClassName('datetime-picker') && !skipIds.include(optionId)) { @@ -133,35 +134,42 @@ } }); if (dateSelected) { - price += parseFloat(this.config[optionId]); + curConfig = configOptions; skipIds[optionId] = optionId; } } else if(element.type == 'select-one' || element.type == 'select-multiple') { - if (element.options) { + if ('options' in element) { $A(element.options).each(function(selectOption){ - try { - if (selectOption.selected) { - if (typeof(this.config[optionId][selectOption.value]['oldPrice']) !== undefined) { - price += parseFloat(this.config[optionId][selectOption.value]['price']); - oldPrice += parseFloat(this.config[optionId][selectOption.value]['oldPrice']); - } + if ('selected' in selectOption && selectOption.selected) { + if (typeof(configOptions[selectOption.value]) != 'undefined') { + curConfig = configOptions[selectOption.value]; } - } catch (e) {} + } }); } } else { if (element.getValue().strip() != '') { - price += parseFloat(this.config[optionId]); + curConfig = configOptions; } } + if(element.type == 'select-multiple' && ('options' in element)) { + $A(element.options).each(function(selectOption) { + if (('selected' in selectOption) && typeof(configOptions[selectOption.value]) != 'undefined') { + if (selectOption.selected) { + curConfig = configOptions[selectOption.value]; + } else { + curConfig = {price: 0}; + } + optionsPrice.addCustomPrices(optionId + '-' + selectOption.value, curConfig); + optionsPrice.reload(); + } + }); + } else { + optionsPrice.addCustomPrices(element.id || optionId, curConfig); + optionsPrice.reload(); + } } }); - try { - optionsPrice.changePrice('config', {'price': price, 'oldPrice': oldPrice, 'optionsPriceInclTax': price}); - optionsPrice.reload(); - } catch (e) { - - } } } function validateOptionsCallback(elmId, result){ diff --git a/app/code/core/Mage/Catalog/view/frontend/product/view/options/js.phtml b/app/code/core/Mage/Catalog/view/frontend/product/view/options/js.phtml index 19695b1e1b1ebdd78b33ab895e33c1b1f37d2330..85afcffbe0a503bde951692d0323f11abef24f96 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/view/options/js.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/product/view/options/js.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Catalog/view/frontend/product/view/options/type/date.phtml b/app/code/core/Mage/Catalog/view/frontend/product/view/options/type/date.phtml index 1e46359d2ad230cbc9c40ca0cd0472cde25fcba5..9796705ddfcb4836188b5f8657744b527a0bbc2e 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/view/options/type/date.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/product/view/options/type/date.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Catalog/view/frontend/product/view/options/type/default.phtml b/app/code/core/Mage/Catalog/view/frontend/product/view/options/type/default.phtml index 3754c7a5a7588725a01503d54d292a5041abe2d3..70958aaf2f47687d3644b705c31e583b7c5cefe6 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/view/options/type/default.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/product/view/options/type/default.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Catalog/view/frontend/product/view/options/type/file.phtml b/app/code/core/Mage/Catalog/view/frontend/product/view/options/type/file.phtml index 91019b28556d69b1dced4e2d2f7c11cdd57cd275..9b9f79255e38a757659c54f677554d902d8d03d3 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/view/options/type/file.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/product/view/options/type/file.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Catalog/view/frontend/product/view/options/type/select.phtml b/app/code/core/Mage/Catalog/view/frontend/product/view/options/type/select.phtml index 8256d6f8afe49a326e064b137924d24045b5d193..0f092f81b2d0a2c16732b608e155c9adad6782db 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/view/options/type/select.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/product/view/options/type/select.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Catalog/view/frontend/product/view/options/type/text.phtml b/app/code/core/Mage/Catalog/view/frontend/product/view/options/type/text.phtml index e580eb108a83d8c9bf7a9325ed1403657ded2631..36d28358f8199bf36ed6d85a39ebbc10094934a4 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/view/options/type/text.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/product/view/options/type/text.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Catalog/view/frontend/product/view/options/wrapper.phtml b/app/code/core/Mage/Catalog/view/frontend/product/view/options/wrapper.phtml index 7ed615aeeb4184586d2da5cdd87e9a501f644222..5a2af78ae8c0b2cceab815a7d4b900e2b86353a4 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/view/options/wrapper.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/product/view/options/wrapper.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Catalog/view/frontend/product/view/options/wrapper/bottom.phtml b/app/code/core/Mage/Catalog/view/frontend/product/view/options/wrapper/bottom.phtml index e60da29a9126c7a91e28e3b2dc01fe777571bc4c..9007511245059bb1a7ed9520f1e2d244d1494950 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/view/options/wrapper/bottom.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/product/view/options/wrapper/bottom.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Catalog/view/frontend/product/view/price_clone.phtml b/app/code/core/Mage/Catalog/view/frontend/product/view/price_clone.phtml index 1f22129c7b6f752d55cd08e890d44fd22ab67a87..b77641d050a8db6b92c62f14c68a3d8be653b989 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/view/price_clone.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/product/view/price_clone.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Catalog/view/frontend/product/view/tierprices.phtml b/app/code/core/Mage/Catalog/view/frontend/product/view/tierprices.phtml index 9c49868864c97dc86c0aa6b09416315f45eab5a8..a5b80e96cdfea7b35e46e580733f274e1f5d9ca4 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/view/tierprices.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/product/view/tierprices.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Catalog/view/frontend/product/view/type/default.phtml b/app/code/core/Mage/Catalog/view/frontend/product/view/type/default.phtml index ab82c05408c20159ee2eae7e306da822f1215e3e..508f32f44f27840e88c49ee08a09dab48deb3e6f 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/view/type/default.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/product/view/type/default.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Catalog/view/frontend/product/view/type/grouped.phtml b/app/code/core/Mage/Catalog/view/frontend/product/view/type/grouped.phtml index afb2aeccc717a405fa0f015a7a4076f3a541f39d..2460e242a2ee67c6731e562d108c6b10d960a852 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/view/type/grouped.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/product/view/type/grouped.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/Catalog/view/frontend/product/view/type/options/configurable.phtml b/app/code/core/Mage/Catalog/view/frontend/product/view/type/options/configurable.phtml index dac89a053f8e6c841a607109898bb90b9ba78b03..7162053b4778230ef0bf7781518eff9fa02428a3 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/view/type/options/configurable.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/product/view/type/options/configurable.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Catalog/view/frontend/product/widget/link/link_block.phtml b/app/code/core/Mage/Catalog/view/frontend/product/widget/link/link_block.phtml index d8a1ffaad3f6793e56bc780d691e2e2057ad2168..c4b133b7464ef611bed7e4507b58b3192339950d 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/widget/link/link_block.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/product/widget/link/link_block.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Catalog/view/frontend/product/widget/link/link_inline.phtml b/app/code/core/Mage/Catalog/view/frontend/product/widget/link/link_inline.phtml index 1875524734b4dfc90a577e9f5a86900c2831f176..548a71b071cbce15ef590682a5d913b4ac655978 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/widget/link/link_inline.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/product/widget/link/link_inline.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Catalog/view/frontend/product/widget/new/column/new_default_list.phtml b/app/code/core/Mage/Catalog/view/frontend/product/widget/new/column/new_default_list.phtml index 83f44872d0a594355f975f874f90deb9e80b896e..10fd6a5e7238dfe4e698991a4ab0fd2bad1d79d3 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/widget/new/column/new_default_list.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/product/widget/new/column/new_default_list.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Catalog/view/frontend/product/widget/new/column/new_images_list.phtml b/app/code/core/Mage/Catalog/view/frontend/product/widget/new/column/new_images_list.phtml index 806ddc7470524f07173cc6a49c21ef0492847966..da0e0d5053ed6f56a3f4756cf3c382c82e0952fd 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/widget/new/column/new_images_list.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/product/widget/new/column/new_images_list.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Catalog/view/frontend/product/widget/new/column/new_names_list.phtml b/app/code/core/Mage/Catalog/view/frontend/product/widget/new/column/new_names_list.phtml index e3d6af5fae8dbfe9f1490fc992d50f2e607417a6..b5eb610c2ff3afa8c04b0cb63c8187227ce84eaa 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/widget/new/column/new_names_list.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/product/widget/new/column/new_names_list.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Catalog/view/frontend/product/widget/new/content/new_grid.phtml b/app/code/core/Mage/Catalog/view/frontend/product/widget/new/content/new_grid.phtml index 1adc72c3504d2da5acf7dfb6663138f056364970..4770cf8da447b76454c405d3fea58d7c58afede1 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/widget/new/content/new_grid.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/product/widget/new/content/new_grid.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Catalog/view/frontend/product/widget/new/content/new_list.phtml b/app/code/core/Mage/Catalog/view/frontend/product/widget/new/content/new_list.phtml index ed26427e30b517a478b00086f0847b4d4ec6dc74..8f62d3f9903d6f355fe4cf52a3d8fd85071a1be3 100644 --- a/app/code/core/Mage/Catalog/view/frontend/product/widget/new/content/new_list.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/product/widget/new/content/new_list.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Catalog/view/frontend/rss/product/price.phtml b/app/code/core/Mage/Catalog/view/frontend/rss/product/price.phtml index 3a8e28d1e8733cdfdb2c153b8b35a35f37c0f78e..3c2cd2855c2e4850cb2178cec496ebdc33802b93 100644 --- a/app/code/core/Mage/Catalog/view/frontend/rss/product/price.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/rss/product/price.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Catalog/view/frontend/seo/sitemap.phtml b/app/code/core/Mage/Catalog/view/frontend/seo/sitemap.phtml index 9fe1bf3a0ae29c72cbfc02a0e37032e4466550eb..cd1af1042c9d8f26027b3c89acffc17d9c103fb3 100644 --- a/app/code/core/Mage/Catalog/view/frontend/seo/sitemap.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/seo/sitemap.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -33,7 +33,7 @@ <?php if($_items->getSize()): ?> <ul class="sitemap"> <?php foreach ($_items as $_item): ?> - <li><a href="<?php echo $this->getItemUrl($_item) ?>"><?php echo $_item->getName() ?></a></li> + <li><a href="<?php echo $this->getItemUrl($_item) ?>"><?php echo $this->escapeHtml($_item->getName()) ?></a></li> <?php endforeach; ?> </ul> <?php else: ?> diff --git a/app/code/core/Mage/Catalog/view/frontend/seo/sitemap/container.phtml b/app/code/core/Mage/Catalog/view/frontend/seo/sitemap/container.phtml index a9464a90823aa4ef0290f8bacf1b81629ff3fd86..871a26fb2f572e63fe34146970d17aaf7c02d012 100644 --- a/app/code/core/Mage/Catalog/view/frontend/seo/sitemap/container.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/seo/sitemap/container.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Catalog/view/frontend/seo/tree.phtml b/app/code/core/Mage/Catalog/view/frontend/seo/tree.phtml index d95ec13e25116628bb3199c247922e2eeef35bac..91924777dbe5dda2b5c81ab708501389e16843c7 100644 --- a/app/code/core/Mage/Catalog/view/frontend/seo/tree.phtml +++ b/app/code/core/Mage/Catalog/view/frontend/seo/tree.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Catalog/view/frontend/widgets.css b/app/code/core/Mage/Catalog/view/frontend/widgets.css index 713fade8ced9f89409e7c1680e8f835aafd05be4..3a8bf84e037038583cae39ff276f2cf6e68ab83e 100644 --- a/app/code/core/Mage/Catalog/view/frontend/widgets.css +++ b/app/code/core/Mage/Catalog/view/frontend/widgets.css @@ -19,7 +19,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/CatalogInventory/Block/Adminhtml/Form/Field/Customergroup.php b/app/code/core/Mage/CatalogInventory/Block/Adminhtml/Form/Field/Customergroup.php index 13a67326b3c4c8ed57289103a1b3eca3e0307795..7fa9ef4414dda2c21d32e3cbc39dd12eb93da7a1 100644 --- a/app/code/core/Mage/CatalogInventory/Block/Adminhtml/Form/Field/Customergroup.php +++ b/app/code/core/Mage/CatalogInventory/Block/Adminhtml/Form/Field/Customergroup.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogInventory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogInventory/Block/Adminhtml/Form/Field/Minsaleqty.php b/app/code/core/Mage/CatalogInventory/Block/Adminhtml/Form/Field/Minsaleqty.php index 988e1c25e037debb4be7c76e59f94eef9abb2851..6bc28ac25303adcb38ee387f1de3420400f4ba56 100644 --- a/app/code/core/Mage/CatalogInventory/Block/Adminhtml/Form/Field/Minsaleqty.php +++ b/app/code/core/Mage/CatalogInventory/Block/Adminhtml/Form/Field/Minsaleqty.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogInventory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogInventory/Block/Qtyincrements.php b/app/code/core/Mage/CatalogInventory/Block/Qtyincrements.php index 30ae4b9ba8b8470a93e35276f232d90f78a53f02..9b31c74fb9e2b7aca14ae2c1e2d5773266770e98 100644 --- a/app/code/core/Mage/CatalogInventory/Block/Qtyincrements.php +++ b/app/code/core/Mage/CatalogInventory/Block/Qtyincrements.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogInventory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogInventory/Block/Stockqty/Abstract.php b/app/code/core/Mage/CatalogInventory/Block/Stockqty/Abstract.php index 8eb3caa7eebb88046883d3d6ac6c45b7c0ab5a50..92c2b2ce7feae441d05ad8985b05a9862cd62d5d 100644 --- a/app/code/core/Mage/CatalogInventory/Block/Stockqty/Abstract.php +++ b/app/code/core/Mage/CatalogInventory/Block/Stockqty/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogInventory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogInventory/Block/Stockqty/Composite.php b/app/code/core/Mage/CatalogInventory/Block/Stockqty/Composite.php index fa27818018b10537621dcfd5f5adf2bceaa6a4a3..7764cfa676ba5a7d8c81aa47b1e2241c12f6aea5 100644 --- a/app/code/core/Mage/CatalogInventory/Block/Stockqty/Composite.php +++ b/app/code/core/Mage/CatalogInventory/Block/Stockqty/Composite.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogInventory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogInventory/Block/Stockqty/Default.php b/app/code/core/Mage/CatalogInventory/Block/Stockqty/Default.php index a49c18982271a506026fe45320a3892f1cdb64f5..693b75e9f02e2fb52c8db4bd8a4fe7bd36d36ce5 100644 --- a/app/code/core/Mage/CatalogInventory/Block/Stockqty/Default.php +++ b/app/code/core/Mage/CatalogInventory/Block/Stockqty/Default.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogInventory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogInventory/Block/Stockqty/Type/Configurable.php b/app/code/core/Mage/CatalogInventory/Block/Stockqty/Type/Configurable.php index a03000a891be40982aff530537ecb89855d85201..32030fc96f2a768daa559402096483a32f50a53a 100644 --- a/app/code/core/Mage/CatalogInventory/Block/Stockqty/Type/Configurable.php +++ b/app/code/core/Mage/CatalogInventory/Block/Stockqty/Type/Configurable.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogInventory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogInventory/Block/Stockqty/Type/Grouped.php b/app/code/core/Mage/CatalogInventory/Block/Stockqty/Type/Grouped.php index f1f14a1efa9f4a63c9dee44e95ee431968e8b84c..1b65ed0ef8cbf60d4037c7302b410b5eae5b32c1 100644 --- a/app/code/core/Mage/CatalogInventory/Block/Stockqty/Type/Grouped.php +++ b/app/code/core/Mage/CatalogInventory/Block/Stockqty/Type/Grouped.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogInventory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogInventory/Helper/Data.php b/app/code/core/Mage/CatalogInventory/Helper/Data.php index de1f66b7f63137d9e1262fdf33209048112082ce..e9a6f77a1e61d2fce5fdf229e822c1c5893aa9f5 100644 --- a/app/code/core/Mage/CatalogInventory/Helper/Data.php +++ b/app/code/core/Mage/CatalogInventory/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogInventory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogInventory/Helper/Minsaleqty.php b/app/code/core/Mage/CatalogInventory/Helper/Minsaleqty.php index 4f4d34477dff3c90f350666fa2bcbe51c920a82a..18de40959e1ed1ab845e25bdc76a27667156f93d 100644 --- a/app/code/core/Mage/CatalogInventory/Helper/Minsaleqty.php +++ b/app/code/core/Mage/CatalogInventory/Helper/Minsaleqty.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogInventory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogInventory/Model/Indexer/Stock.php b/app/code/core/Mage/CatalogInventory/Model/Indexer/Stock.php index b369a6876ecad046528dcc78d859e1f1fca464b7..e23df7736a0db84d41229392c6773966a72e3073 100644 --- a/app/code/core/Mage/CatalogInventory/Model/Indexer/Stock.php +++ b/app/code/core/Mage/CatalogInventory/Model/Indexer/Stock.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogInventory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogInventory/Model/Observer.php b/app/code/core/Mage/CatalogInventory/Model/Observer.php index fd2a984f9f00603cb48da24f610002972c6cd320..1d646c5134ec50581fd36109fb3e58b5f69f1496 100644 --- a/app/code/core/Mage/CatalogInventory/Model/Observer.php +++ b/app/code/core/Mage/CatalogInventory/Model/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogInventory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogInventory/Model/Resource/Indexer/Stock.php b/app/code/core/Mage/CatalogInventory/Model/Resource/Indexer/Stock.php index cfd8821ba42bb5d8a6bba58798e989d3c25a1539..d6ee2e5f823fd096f73cb98684446abfd81a63fd 100755 --- a/app/code/core/Mage/CatalogInventory/Model/Resource/Indexer/Stock.php +++ b/app/code/core/Mage/CatalogInventory/Model/Resource/Indexer/Stock.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogInventory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogInventory/Model/Resource/Indexer/Stock/Configurable.php b/app/code/core/Mage/CatalogInventory/Model/Resource/Indexer/Stock/Configurable.php index c3876e8fc83d4a28350904ae22712521c19a1fc5..53b33ca3bbc9d61f84e47aef5cba5c9514c3ba19 100755 --- a/app/code/core/Mage/CatalogInventory/Model/Resource/Indexer/Stock/Configurable.php +++ b/app/code/core/Mage/CatalogInventory/Model/Resource/Indexer/Stock/Configurable.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogInventory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogInventory/Model/Resource/Indexer/Stock/Default.php b/app/code/core/Mage/CatalogInventory/Model/Resource/Indexer/Stock/Default.php index 2b468586db9418d23a98c396bfd1cf69bd7ecd58..1bb04670cb68cf16f6d4c0bca5f7a625c0dda85f 100755 --- a/app/code/core/Mage/CatalogInventory/Model/Resource/Indexer/Stock/Default.php +++ b/app/code/core/Mage/CatalogInventory/Model/Resource/Indexer/Stock/Default.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogInventory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogInventory/Model/Resource/Indexer/Stock/Grouped.php b/app/code/core/Mage/CatalogInventory/Model/Resource/Indexer/Stock/Grouped.php index dbd0d3d32bce9592be39b0d96e6646f1a22dfab5..86a1e1b7f8d0b2f73fdac2c51c1a977f5135f85b 100755 --- a/app/code/core/Mage/CatalogInventory/Model/Resource/Indexer/Stock/Grouped.php +++ b/app/code/core/Mage/CatalogInventory/Model/Resource/Indexer/Stock/Grouped.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogInventory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogInventory/Model/Resource/Indexer/Stock/Interface.php b/app/code/core/Mage/CatalogInventory/Model/Resource/Indexer/Stock/Interface.php index 8447e16d0d71ed8ba398029c45e0051810571d17..47a2bb86df8ddd91166298be90b4e246a5f97d47 100755 --- a/app/code/core/Mage/CatalogInventory/Model/Resource/Indexer/Stock/Interface.php +++ b/app/code/core/Mage/CatalogInventory/Model/Resource/Indexer/Stock/Interface.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogInventory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogInventory/Model/Resource/Stock.php b/app/code/core/Mage/CatalogInventory/Model/Resource/Stock.php index 8a3b33d9806fa69a4de4d053d42cfb29dd7567cc..9eff95199e5c23dd584f39a18b4c8fb6c1e1e42d 100755 --- a/app/code/core/Mage/CatalogInventory/Model/Resource/Stock.php +++ b/app/code/core/Mage/CatalogInventory/Model/Resource/Stock.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogInventory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogInventory/Model/Resource/Stock/Item.php b/app/code/core/Mage/CatalogInventory/Model/Resource/Stock/Item.php index 53d03f519084e8112c9eda95231afdd51277c443..137ced63c98fd89069bb7cd2991a6b913b1cbb1d 100755 --- a/app/code/core/Mage/CatalogInventory/Model/Resource/Stock/Item.php +++ b/app/code/core/Mage/CatalogInventory/Model/Resource/Stock/Item.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogInventory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogInventory/Model/Resource/Stock/Item/Collection.php b/app/code/core/Mage/CatalogInventory/Model/Resource/Stock/Item/Collection.php index ef93d8b338cca403b424824d78ad711d64f6c553..5c1f8704aa7e049718a6d5119bfd41c5ddb8b764 100755 --- a/app/code/core/Mage/CatalogInventory/Model/Resource/Stock/Item/Collection.php +++ b/app/code/core/Mage/CatalogInventory/Model/Resource/Stock/Item/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogInventory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogInventory/Model/Resource/Stock/Status.php b/app/code/core/Mage/CatalogInventory/Model/Resource/Stock/Status.php index e3a3d28395ac95a9d30861231d156eb9dde757e5..69599965246527c046f65d2b9ea70734cf5588c9 100755 --- a/app/code/core/Mage/CatalogInventory/Model/Resource/Stock/Status.php +++ b/app/code/core/Mage/CatalogInventory/Model/Resource/Stock/Status.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogInventory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogInventory/Model/Source/Backorders.php b/app/code/core/Mage/CatalogInventory/Model/Source/Backorders.php index 320d1f4d145329ead6072cc921d2d8c6c1d9a900..1a960597ed6e99da1454c4bd794582eb51f13764 100644 --- a/app/code/core/Mage/CatalogInventory/Model/Source/Backorders.php +++ b/app/code/core/Mage/CatalogInventory/Model/Source/Backorders.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogInventory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogInventory/Model/Source/Stock.php b/app/code/core/Mage/CatalogInventory/Model/Source/Stock.php index 38532358978f7a25961905190fed3310a8eca5ad..55b7959708d5b13fdd7811551ad511a132f4a281 100644 --- a/app/code/core/Mage/CatalogInventory/Model/Source/Stock.php +++ b/app/code/core/Mage/CatalogInventory/Model/Source/Stock.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogInventory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogInventory/Model/Stock.php b/app/code/core/Mage/CatalogInventory/Model/Stock.php index a99862b0ca0c538314904fb3d1d436f6a1a18d05..8789df2ab8f9d137cc5d7785c1d58f539265c9db 100644 --- a/app/code/core/Mage/CatalogInventory/Model/Stock.php +++ b/app/code/core/Mage/CatalogInventory/Model/Stock.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogInventory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogInventory/Model/Stock/Item.php b/app/code/core/Mage/CatalogInventory/Model/Stock/Item.php index 3a5b450cfea64018ae8a98e57124797540a18b72..6efd72ce0ee020db3dac533415c1bacb3ce2a2e7 100644 --- a/app/code/core/Mage/CatalogInventory/Model/Stock/Item.php +++ b/app/code/core/Mage/CatalogInventory/Model/Stock/Item.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogInventory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -269,10 +269,8 @@ class Mage_CatalogInventory_Model_Stock_Item extends Mage_Core_Model_Abstract */ public function getMinQty() { - if ($this->getUseConfigMinQty()) { - return (float) Mage::getStoreConfig(self::XML_PATH_MIN_QTY); - } - return (float) $this->getData('min_qty'); + return (float)($this->getUseConfigMinQty() ? Mage::getStoreConfig(self::XML_PATH_MIN_QTY) + : $this->getData('min_qty')); } /** @@ -304,40 +302,37 @@ class Mage_CatalogInventory_Model_Stock_Item extends Mage_Core_Model_Abstract */ public function getMinSaleQty() { - if ($this->getCustomerGroupId()) { - $customerGroupId = $this->getCustomerGroupId(); - } else if (Mage::app()->getStore()->isAdmin()) { - $customerGroupId = Mage_Customer_Model_Group::CUST_GROUP_ALL; - } else { - $customerGroupId = Mage::getSingleton('Mage_Customer_Model_Session')->getCustomerGroupId(); + $customerGroupId = $this->getCustomerGroupId(); + if (!$customerGroupId) { + $customerGroupId = Mage::app()->getStore()->isAdmin() + ? Mage_Customer_Model_Group::CUST_GROUP_ALL + : Mage::getSingleton('Mage_Customer_Model_Session')->getCustomerGroupId(); } - if (!array_key_exists($customerGroupId, $this->_minSaleQtyCache)) { - if ($this->getUseConfigMinSaleQty()) { - $minSaleQty = Mage::helper('Mage_CatalogInventory_Helper_Minsaleqty')->getConfigValue($customerGroupId); - } else { - $minSaleQty = $this->getData('min_sale_qty'); - } - $minSaleQty = (!empty($minSaleQty) ? (float)$minSaleQty : null); - $this->_minSaleQtyCache[$customerGroupId] = $minSaleQty; + + if (!isset($this->_minSaleQtyCache[$customerGroupId])) { + $minSaleQty = $this->getUseConfigMinSaleQty() + ? Mage::helper('Mage_CatalogInventory_Helper_Minsaleqty')->getConfigValue($customerGroupId) + : $this->getData('min_sale_qty'); + + $this->_minSaleQtyCache[$customerGroupId] = empty($minSaleQty) ? 0 : (float)$minSaleQty; } - return $this->_minSaleQtyCache[$customerGroupId]; + + return $this->_minSaleQtyCache[$customerGroupId] ? $this->_minSaleQtyCache[$customerGroupId] : null; } /** - * Retrieve Maximum Qty Allowed in Shopping Cart data wraper + * Retrieve Maximum Qty Allowed in Shopping Cart data wrapper * * @return float */ public function getMaxSaleQty() { - if ($this->getUseConfigMaxSaleQty()) { - return (float) Mage::getStoreConfig(self::XML_PATH_MAX_SALE_QTY); - } - return (float) $this->getData('max_sale_qty'); + return (float)($this->getUseConfigMaxSaleQty() ? Mage::getStoreConfig(self::XML_PATH_MAX_SALE_QTY) + : $this->getData('max_sale_qty')); } /** - * Retrieve Notify for Quantity Below data wraper + * Retrieve Notify for Quantity Below data wrapper * * @return float */ @@ -462,49 +457,41 @@ class Mage_CatalogInventory_Model_Stock_Item extends Mage_Core_Model_Abstract } /** - * Returns suggested qty increments for the item based on requested qty + * Returns suggested qty that satisfies qty increments and minQty/maxQty/minSaleQty/maxSaleQty conditions + * or original qty if such value does not exist * * @param int|float $qty * @return int|float */ public function suggestQty($qty) { - $origQty = $qty; - $qty = (float) $qty; - - // Maybe some wrong value - if ($qty <= 0) { - return $origQty; - } - // We do not manage stock - if (!$this->getManageStock()) { - return $origQty; + if ($qty <= 0 || !$this->getManageStock()) { + return $qty; } - // No qty increments enabled - $qtyIncrements = $this->getQtyIncrements(); - $qtyIncrements = (int) $qtyIncrements; // Currently only integer increments supported - if (!$qtyIncrements || ($qtyIncrements == 1)) { - return $origQty; + $qtyIncrements = (int)$this->getQtyIncrements(); // Currently only integer increments supported + if ($qtyIncrements < 2) { + return $qty; } - // Fix qty to be integer if needed - if (!$this->getIsQtyDecimal()) { - $qty = (int) $qty; - } + $minQty = max($this->getMinSaleQty(), $qtyIncrements); + $divisibleMin = ceil($minQty / $qtyIncrements) * $qtyIncrements; + + $maxQty = min($this->getQty() - $this->getMinQty(), $this->getMaxSaleQty()); + $divisibleMax = floor($maxQty / $qtyIncrements) * $qtyIncrements; - // Maybe qty is evenly divided - no fixture needed - if ($qty % $qtyIncrements == 0) { + if ($qty < $minQty || $qty > $maxQty || $divisibleMin > $divisibleMax) { + // Do not perform rounding for qty that does not satisfy min/max conditions to not confuse customer return $qty; } - $qty = round($qty / $qtyIncrements) * $qtyIncrements; - if (!$qty) { - // Value was closer to zero, so suggest first lowest minimal increment - $qty = $qtyIncrements; - } - return $qty; + // Suggest value closest to given qty + $closestDivisibleLeft = floor($qty / $qtyIncrements) * $qtyIncrements; + $closestDivisibleRight = $closestDivisibleLeft + $qtyIncrements; + $acceptableLeft = min(max($divisibleMin, $closestDivisibleLeft), $divisibleMax); + $acceptableRight = max(min($divisibleMax, $closestDivisibleRight), $divisibleMin); + return abs($acceptableLeft - $qty) < abs($acceptableRight - $qty) ? $acceptableLeft : $acceptableRight; } /** @@ -523,9 +510,6 @@ class Mage_CatalogInventory_Model_Stock_Item extends Mage_Core_Model_Abstract $result = new Varien_Object(); $result->setHasError(false); - /** @var $_helper Mage_CatalogInventory_Helper_Data */ - $_helper = Mage::helper('Mage_CatalogInventory_Helper_Data'); - if (!is_numeric($qty)) { $qty = Mage::app()->getLocale()->getNumber($qty); } @@ -551,22 +535,22 @@ class Mage_CatalogInventory_Model_Stock_Item extends Mage_Core_Model_Abstract $result->setOrigQty($origQty); } - if ($this->getMinSaleQty() && ($qty) < $this->getMinSaleQty()) { + if ($this->getMinSaleQty() && $qty < $this->getMinSaleQty()) { $result->setHasError(true) ->setMessage( - $_helper->__('The minimum quantity allowed for purchase is %s.', $this->getMinSaleQty() * 1) + Mage::helper('Mage_CatalogInventory_Helper_Data')->__('The minimum quantity allowed for purchase is %s.', $this->getMinSaleQty() * 1) ) - ->setQuoteMessage($_helper->__('Some of the products cannot be ordered in requested quantity.')) + ->setQuoteMessage(Mage::helper('Mage_CatalogInventory_Helper_Data')->__('Some of the products cannot be ordered in requested quantity.')) ->setQuoteMessageIndex('qty'); return $result; } - if ($this->getMaxSaleQty() && ($qty) > $this->getMaxSaleQty()) { + if ($this->getMaxSaleQty() && $qty > $this->getMaxSaleQty()) { $result->setHasError(true) ->setMessage( - $_helper->__('The maximum quantity allowed for purchase is %s.', $this->getMaxSaleQty() * 1) + Mage::helper('Mage_CatalogInventory_Helper_Data')->__('The maximum quantity allowed for purchase is %s.', $this->getMaxSaleQty() * 1) ) - ->setQuoteMessage($_helper->__('Some of the products cannot be ordered in requested quantity.')) + ->setQuoteMessage(Mage::helper('Mage_CatalogInventory_Helper_Data')->__('Some of the products cannot be ordered in requested quantity.')) ->setQuoteMessageIndex('qty'); return $result; } @@ -583,15 +567,15 @@ class Mage_CatalogInventory_Model_Stock_Item extends Mage_Core_Model_Abstract if (!$this->getIsInStock()) { $result->setHasError(true) - ->setMessage($_helper->__('This product is currently out of stock.')) - ->setQuoteMessage($_helper->__('Some of the products are currently out of stock')) + ->setMessage(Mage::helper('Mage_CatalogInventory_Helper_Data')->__('This product is currently out of stock.')) + ->setQuoteMessage(Mage::helper('Mage_CatalogInventory_Helper_Data')->__('Some of the products are currently out of stock')) ->setQuoteMessageIndex('stock'); $result->setItemUseOldQty(true); return $result; } if (!$this->checkQty($summaryQty) || !$this->checkQty($qty)) { - $message = $_helper->__('The requested quantity for "%s" is not available.', $this->getProductName()); + $message = Mage::helper('Mage_CatalogInventory_Helper_Data')->__('The requested quantity for "%s" is not available.', $this->getProductName()); $result->setHasError(true) ->setMessage($message) ->setQuoteMessage($message) @@ -621,16 +605,16 @@ class Mage_CatalogInventory_Model_Stock_Item extends Mage_Core_Model_Abstract if ($this->getBackorders() == Mage_CatalogInventory_Model_Stock::BACKORDERS_YES_NOTIFY) { if (!$this->getIsChildItem()) { $result->setMessage( - $_helper->__('This product is not available in the requested quantity. %s of the items will be backordered.', ($backorderQty * 1)) + Mage::helper('Mage_CatalogInventory_Helper_Data')->__('This product is not available in the requested quantity. %s of the items will be backordered.', ($backorderQty * 1)) ); } else { $result->setMessage( - $_helper->__('"%s" is not available in the requested quantity. %s of the items will be backordered.', $this->getProductName(), ($backorderQty * 1)) + Mage::helper('Mage_CatalogInventory_Helper_Data')->__('"%s" is not available in the requested quantity. %s of the items will be backordered.', $this->getProductName(), ($backorderQty * 1)) ); } } elseif (Mage::app()->getStore()->isAdmin()) { $result->setMessage( - $_helper->__('The requested quantity for "%s" is not available.', $this->getProductName()) + Mage::helper('Mage_CatalogInventory_Helper_Data')->__('The requested quantity for "%s" is not available.', $this->getProductName()) ); } } @@ -786,13 +770,14 @@ class Mage_CatalogInventory_Model_Stock_Item extends Mage_Core_Model_Abstract } /** - * Process stock status index on item after save + * Reindex CatalogInventory save event * * @return Mage_CatalogInventory_Model_Stock_Item */ protected function _afterSave() { parent::_afterSave(); + /** @var $indexer Mage_Index_Model_Indexer */ $indexer = Mage::getSingleton('Mage_Index_Model_Indexer'); if ($this->_processIndexEvents) { diff --git a/app/code/core/Mage/CatalogInventory/Model/Stock/Item/Api.php b/app/code/core/Mage/CatalogInventory/Model/Stock/Item/Api.php index e18f1704b6ef055aa6ee863a43cabdfad3b32bb9..ef5fd81930024cfc2b1f38341426dc9d7512031e 100644 --- a/app/code/core/Mage/CatalogInventory/Model/Stock/Item/Api.php +++ b/app/code/core/Mage/CatalogInventory/Model/Stock/Item/Api.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogInventory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogInventory/Model/Stock/Item/Api/V2.php b/app/code/core/Mage/CatalogInventory/Model/Stock/Item/Api/V2.php index 849ff33765297ef710a0ef9c4b3810ae4fdb102f..f4ecc69e9b990c6bb1775d7bdeba028f503855ac 100644 --- a/app/code/core/Mage/CatalogInventory/Model/Stock/Item/Api/V2.php +++ b/app/code/core/Mage/CatalogInventory/Model/Stock/Item/Api/V2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogInventory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogInventory/Model/Stock/Status.php b/app/code/core/Mage/CatalogInventory/Model/Stock/Status.php index a17abf6dc1a7dc6682df25327a6a83540b4092b2..65f85cfb05c4e74c737785152a953f42917c7dd3 100644 --- a/app/code/core/Mage/CatalogInventory/Model/Stock/Status.php +++ b/app/code/core/Mage/CatalogInventory/Model/Stock/Status.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogInventory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogInventory/Model/System/Config/Backend/Minqty.php b/app/code/core/Mage/CatalogInventory/Model/System/Config/Backend/Minqty.php index e4c5b0e3c23883a9581796e49478dd805649c3f9..74ae128db54f8e5f3aaeeda6229d8151f34d1783 100644 --- a/app/code/core/Mage/CatalogInventory/Model/System/Config/Backend/Minqty.php +++ b/app/code/core/Mage/CatalogInventory/Model/System/Config/Backend/Minqty.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogInventory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogInventory/Model/System/Config/Backend/Minsaleqty.php b/app/code/core/Mage/CatalogInventory/Model/System/Config/Backend/Minsaleqty.php index b5b6a3092e2fcecdfd3e0b11ec884fe6d31f9426..3564060aeb1574a68b26839958796a12e56b5695 100644 --- a/app/code/core/Mage/CatalogInventory/Model/System/Config/Backend/Minsaleqty.php +++ b/app/code/core/Mage/CatalogInventory/Model/System/Config/Backend/Minsaleqty.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogInventory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogInventory/Model/System/Config/Backend/Qtyincrements.php b/app/code/core/Mage/CatalogInventory/Model/System/Config/Backend/Qtyincrements.php index e4609848a77c9eec9ac6a55f1480fb48d40b60d3..86373a28d3aa8835188f75b068f07f90c4f3e352 100644 --- a/app/code/core/Mage/CatalogInventory/Model/System/Config/Backend/Qtyincrements.php +++ b/app/code/core/Mage/CatalogInventory/Model/System/Config/Backend/Qtyincrements.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogInventory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogInventory/etc/adminhtml.xml b/app/code/core/Mage/CatalogInventory/etc/adminhtml.xml index 4e9e10ccb1b9ddb7832c21e920ab01c9d48f6e45..e4da40f01f7c62d9496d2210e83b88c6ff4b4f10 100644 --- a/app/code/core/Mage/CatalogInventory/etc/adminhtml.xml +++ b/app/code/core/Mage/CatalogInventory/etc/adminhtml.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_CatalogInventory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/CatalogInventory/etc/api.xml b/app/code/core/Mage/CatalogInventory/etc/api.xml index 645bbb1fbf2a3c38252381a09af75e14886808d7..cbd45a47d66458ad97ef4c2cb5b181f96bcd1b45 100644 --- a/app/code/core/Mage/CatalogInventory/etc/api.xml +++ b/app/code/core/Mage/CatalogInventory/etc/api.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_CatalogInventory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/CatalogInventory/etc/config.xml b/app/code/core/Mage/CatalogInventory/etc/config.xml index 6f0b4a7724f2a4fb04e3b3f4bf6ecf664ac731de..846e3d9d679a013f4ae101f0f6732e9ff9253bc8 100644 --- a/app/code/core/Mage/CatalogInventory/etc/config.xml +++ b/app/code/core/Mage/CatalogInventory/etc/config.xml @@ -21,14 +21,14 @@ * * @category Mage * @package Mage_CatalogInventory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> <config> <modules> <Mage_CatalogInventory> - <version>1.6.0.0</version> + <version>1.6.0.0.1</version> </Mage_CatalogInventory> </modules> <global> @@ -250,6 +250,16 @@ </Mage_CatalogInventory> </modules> </translate> + <events> + <after_reindex_process_cataloginventory_stock> + <observers> + <cataloginventory> + <class>Mage_CatalogInventory_Model_Observer</class> + <method>reindexProductsMassAction</method> + </cataloginventory> + </observers> + </after_reindex_process_cataloginventory_stock> + </events> </adminhtml> <default> <cataloginventory> diff --git a/app/code/core/Mage/CatalogInventory/etc/system.xml b/app/code/core/Mage/CatalogInventory/etc/system.xml index 61e32a1889ca5c04435b05e889f10115ef17fd95..080c5eae3826bb365ec85e0f640e8d3f0c651758 100644 --- a/app/code/core/Mage/CatalogInventory/etc/system.xml +++ b/app/code/core/Mage/CatalogInventory/etc/system.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_CatalogInventory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/install-1.6.0.0.php b/app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/install-1.6.0.0.php index c64012236d7f484e2bcda1963dfc63a8a0ca0466..117d5423ad7139a980a9171a03c5dbe016d8f1e1 100644 --- a/app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogInventory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-upgrade-1.6.0.0-1.6.0.0.1.php b/app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-upgrade-1.6.0.0-1.6.0.0.1.php new file mode 100644 index 0000000000000000000000000000000000000000..c7ef341fed1fe85af9f472fd5dff1edde96b3fdf --- /dev/null +++ b/app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/mysql4-upgrade-1.6.0.0-1.6.0.0.1.php @@ -0,0 +1,34 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_CatalogInventory + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** @var $installer Mage_Eav_Model_Entity_Setup */ +$installer = $this; +/** @var $connection Varien_Db_Adapter_Pdo_Mysql */ +$connection = $installer->getConnection(); +$connection->changeTableEngine( + $installer->getTable('cataloginventory_stock_status_tmp'), + Varien_Db_Adapter_Pdo_Mysql::ENGINE_MEMORY +); diff --git a/app/code/core/Mage/CatalogInventory/view/frontend/layout.xml b/app/code/core/Mage/CatalogInventory/view/frontend/layout.xml index 97da2064e945e261e040893d0c6e1daa550f163a..2905be1db6261d762339077c6ebaa7300a959090 100644 --- a/app/code/core/Mage/CatalogInventory/view/frontend/layout.xml +++ b/app/code/core/Mage/CatalogInventory/view/frontend/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/CatalogInventory/view/frontend/qtyincrements.phtml b/app/code/core/Mage/CatalogInventory/view/frontend/qtyincrements.phtml index 1934a1f975903c2a3a7d0ab1c01ff4e6c250c846..1b56042f7b67582486191b50b7f33190a5c29e16 100644 --- a/app/code/core/Mage/CatalogInventory/view/frontend/qtyincrements.phtml +++ b/app/code/core/Mage/CatalogInventory/view/frontend/qtyincrements.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/CatalogInventory/view/frontend/stockqty/composite.phtml b/app/code/core/Mage/CatalogInventory/view/frontend/stockqty/composite.phtml index dee5cb1078d68531a90e55032f48bdbb29917e64..2de516c26401741335916e9a420ac5803960cae9 100644 --- a/app/code/core/Mage/CatalogInventory/view/frontend/stockqty/composite.phtml +++ b/app/code/core/Mage/CatalogInventory/view/frontend/stockqty/composite.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/CatalogInventory/view/frontend/stockqty/default.phtml b/app/code/core/Mage/CatalogInventory/view/frontend/stockqty/default.phtml index ba0a3c2d3f8d1d4ffaed30cd0c79845002b7625e..bf6f4977c4a460bae5a190f29c154dd4cbc08917 100644 --- a/app/code/core/Mage/CatalogInventory/view/frontend/stockqty/default.phtml +++ b/app/code/core/Mage/CatalogInventory/view/frontend/stockqty/default.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/CatalogRule/Helper/Data.php b/app/code/core/Mage/CatalogRule/Helper/Data.php index f3237e51ebebe23dcb415ff95fd7739ebd6daab2..9521b57dd1aa270336e48be133177a7fece6e8f3 100644 --- a/app/code/core/Mage/CatalogRule/Helper/Data.php +++ b/app/code/core/Mage/CatalogRule/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogRule/Model/Observer.php b/app/code/core/Mage/CatalogRule/Model/Observer.php index 06a04d687aa65a7c5cc24f1c6169c8ddf90a7ba3..545d6d85527e0a7d43254239b3ceb53831817b76 100644 --- a/app/code/core/Mage/CatalogRule/Model/Observer.php +++ b/app/code/core/Mage/CatalogRule/Model/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -29,6 +29,12 @@ */ class Mage_CatalogRule_Model_Observer { + /** + * Store calculated catalog rules prices for products + * Prices collected per website, customer group, date and product + * + * @var array + */ protected $_rulePrices = array(); /** @@ -50,14 +56,10 @@ class Mage_CatalogRule_Model_Observer ->addFieldToFilter('is_active', 1); foreach ($rules as $rule) { - if (!is_array($rule->getWebsiteIds())) { - $ruleWebsiteIds = (array)explode(',', $rule->getWebsiteIds()); - } else { - $ruleWebsiteIds = $rule->getWebsiteIds(); - } - $websiteIds = array_intersect($productWebsiteIds, $ruleWebsiteIds); + $websiteIds = array_intersect($productWebsiteIds, $rule->getWebsiteIds()); $rule->applyToProduct($product, $websiteIds); } + return $this; } @@ -66,6 +68,7 @@ class Mage_CatalogRule_Model_Observer * Handle cataolg_product_import_after event * * @param Varien_Event_Observer $observer + * * @return Mage_CatalogRule_Model_Observer */ public function applyAllRules($observer) @@ -73,12 +76,15 @@ class Mage_CatalogRule_Model_Observer $resource = Mage::getResourceSingleton('Mage_CatalogRule_Model_Resource_Rule'); $resource->applyAllRulesForDateRange($resource->formatDate(mktime(0,0,0))); Mage::app()->removeCache('catalog_rules_dirty'); + return $this; } /** * Apply catalog price rules to product on frontend * + * @param Varien_Event_Observer $observer + * * @return Mage_CatalogRule_Model_Observer */ public function processFrontFinalPrice($observer) @@ -123,6 +129,8 @@ class Mage_CatalogRule_Model_Observer /** * Apply catalog price rules to product in admin * + * @param Varien_Event_Observer $observer + * * @return Mage_CatalogRule_Model_Observer */ public function processAdminFinalPrice($observer) @@ -157,6 +165,7 @@ class Mage_CatalogRule_Model_Observer $product->setFinalPrice($finalPrice); } } + return $this; } @@ -164,6 +173,7 @@ class Mage_CatalogRule_Model_Observer * Calculate price using catalog price rules of configurable product * * @param Varien_Event_Observer $observer + * * @return Mage_CatalogRule_Model_Observer */ public function catalogProductTypeConfigurablePrice(Varien_Event_Observer $observer) @@ -178,6 +188,7 @@ class Mage_CatalogRule_Model_Observer $product->setConfigurablePrice($productPriceRule); } } + return $this; } @@ -188,14 +199,19 @@ class Mage_CatalogRule_Model_Observer * we should generate data for interval -1 day ... +1 day * * @param Varien_Event_Observer $observer + * * @return Mage_CatalogRule_Model_Observer */ public function dailyCatalogUpdate($observer) { Mage::getResourceSingleton('Mage_CatalogRule_Model_Resource_Rule')->applyAllRulesForDateRange(); + return $this; } + /** + * Clean out calculated catalog rule prices for products + */ public function flushPriceCache() { $this->_rulePrices = array(); @@ -215,7 +231,6 @@ class Mage_CatalogRule_Model_Observer $entityId = $observer->getEvent()->getEntityId(); $customerGroupId = $observer->getEvent()->getCustomerGroupId(); $websiteId = $observer->getEvent()->getWebsiteId(); - $websiteDate = $observer->getEvent()->getWebsiteDate(); $updateFields = $observer->getEvent()->getUpdateFields(); @@ -231,6 +246,7 @@ class Mage_CatalogRule_Model_Observer * If rules were found they will be set to inactive and notice will be add to admin session * * @param string $attributeCode + * * @return Mage_CatalogRule_Model_Observer */ protected function _checkCatalogRulesAvailability($attributeCode) @@ -263,6 +279,7 @@ class Mage_CatalogRule_Model_Observer * Remove catalog attribute condition by attribute code from rule conditions * * @param Mage_CatalogRule_Model_Rule_Condition_Combine $combine + * * @param string $attributeCode */ protected function _removeAttributeFromConditions($combine, $attributeCode) @@ -272,7 +289,7 @@ class Mage_CatalogRule_Model_Observer if ($condition instanceof Mage_CatalogRule_Model_Rule_Condition_Combine) { $this->_removeAttributeFromConditions($condition, $attributeCode); } - if ($condition instanceof Mage_CatalogRule_Model_Rule_Condition_Product) { + if ($condition instanceof Mage_Rule_Model_Condition_Product_Abstract) { if ($condition->getAttribute() == $attributeCode) { unset($conditions[$conditionId]); } @@ -285,6 +302,7 @@ class Mage_CatalogRule_Model_Observer * After save attribute if it is not used for promo rules already check rules for containing this attribute * * @param Varien_Event_Observer $observer + * * @return Mage_CatalogRule_Model_Observer */ public function catalogAttributeSaveAfter(Varien_Event_Observer $observer) diff --git a/app/code/core/Mage/CatalogRule/Model/Resource/Rule.php b/app/code/core/Mage/CatalogRule/Model/Resource/Rule.php index 0e131c2ae615ad33d1df5463b48940d0c2f1e9ac..22db5c346072ed59af8142d1739ef4a8f75883e1 100755 --- a/app/code/core/Mage/CatalogRule/Model/Resource/Rule.php +++ b/app/code/core/Mage/CatalogRule/Model/Resource/Rule.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -32,13 +32,33 @@ * @package Mage_CatalogRule * @author Magento Core Team <core@magentocommerce.com> */ -class Mage_CatalogRule_Model_Resource_Rule extends Mage_Core_Model_Resource_Db_Abstract +class Mage_CatalogRule_Model_Resource_Rule extends Mage_Rule_Model_Resource_Abstract { + /** + * Store number of seconds in a day + */ const SECONDS_IN_DAY = 86400; /** - * Initialize main table and table id field + * Store associated with rule entities information map * + * @var array + */ + protected $_associatedEntitiesMap = array( + 'website' => array( + 'associations_table' => 'catalogrule_website', + 'rule_id_field' => 'rule_id', + 'entity_id_field' => 'website_id' + ), + 'customer_group' => array( + 'associations_table' => 'catalogrule_customer_group', + 'rule_id_field' => 'rule_id', + 'entity_id_field' => 'customer_group_id' + ) + ); + + /** + * Initialize main table and table id field */ protected function _construct() { @@ -46,43 +66,63 @@ class Mage_CatalogRule_Model_Resource_Rule extends Mage_Core_Model_Resource_Db_A } /** - * Prepare object data for saving + * Add customer group ids and website ids to rule data after load * * @param Mage_Core_Model_Abstract $object + * + * @return Mage_CatalogRule_Model_Resource_Rule */ - public function _beforeSave(Mage_Core_Model_Abstract $object) + protected function _afterLoad(Mage_Core_Model_Abstract $object) { - if (!$object->getFromDate()) { - $date = Mage::app()->getLocale()->date(); - $date->setHour(0) - ->setMinute(0) - ->setSecond(0); - $object->setFromDate($date); - } - if ($object->getFromDate() instanceof Zend_Date) { - $object->setFromDate($object->getFromDate()->toString(Varien_Date::DATETIME_INTERNAL_FORMAT)); - } + $object->setData('customer_group_ids', (array)$this->getCustomerGroupIds($object->getId())); + $object->setData('website_ids', (array)$this->getWebsiteIds($object->getId())); - if (!$object->getToDate()) { - $object->setToDate(new Zend_Db_Expr('NULL')); - } else { - if ($object->getToDate() instanceof Zend_Date) { - $object->setToDate($object->getToDate()->toString(Varien_Date::DATETIME_INTERNAL_FORMAT)); + return parent::_afterLoad($object); + } + + /** + * Bind catalog rule to customer group(s) and website(s). + * Update products which are matched for rule. + * + * @param Mage_Core_Model_Abstract $object + * + * @return Mage_CatalogRule_Model_Resource_Rule + */ + protected function _afterSave(Mage_Core_Model_Abstract $object) + { + if ($object->hasWebsiteIds()) { + $websiteIds = $object->getWebsiteIds(); + if (!is_array($websiteIds)) { + $websiteIds = explode(',', (string)$websiteIds); + } + $this->bindRuleToEntity($object->getId(), $websiteIds, 'website'); + } + + if ($object->hasCustomerGroupIds()) { + $customerGroupIds = $object->getCustomerGroupIds(); + if (!is_array($customerGroupIds)) { + $customerGroupIds = explode(',', (string)$customerGroupIds); } + $this->bindRuleToEntity($object->getId(), $customerGroupIds, 'customer_group'); } - parent::_beforeSave($object); + + $this->updateRuleProductData($object); + + parent::_afterSave($object); + return $this; } /** * Update products which are matched for rule * * @param Mage_CatalogRule_Model_Rule $rule + * * @return Mage_CatalogRule_Model_Resource_Rule */ public function updateRuleProductData(Mage_CatalogRule_Model_Rule $rule) { $ruleId = $rule->getId(); - $write = $this->_getWriteAdapter(); + $write = $this->_getWriteAdapter(); $write->beginTransaction(); if ($rule->getProductsFilter()) { @@ -111,16 +151,15 @@ class Mage_CatalogRule_Model_Resource_Rule extends Mage_Core_Model_Resource_Db_A Magento_Profiler::start('__MATCH_PRODUCTS__'); $productIds = $rule->getMatchingProductIds(); Magento_Profiler::stop('__MATCH_PRODUCTS__'); - $customerGroupIds = $rule->getCustomerGroupIds(); - - $fromTime = strtotime($rule->getFromDate()); - $toTime = strtotime($rule->getToDate()); - $toTime = $toTime ? ($toTime + self::SECONDS_IN_DAY - 1) : 0; - $sortOrder = (int)$rule->getSortOrder(); - $actionOperator = $rule->getSimpleAction(); - $actionAmount = $rule->getDiscountAmount(); - $actionStop = $rule->getStopRulesProcessing(); + $customerGroupIds = $rule->getCustomerGroupIds(); + $fromTime = strtotime($rule->getFromDate()); + $toTime = strtotime($rule->getToDate()); + $toTime = $toTime ? ($toTime + self::SECONDS_IN_DAY - 1) : 0; + $sortOrder = (int)$rule->getSortOrder(); + $actionOperator = $rule->getSimpleAction(); + $actionAmount = $rule->getDiscountAmount(); + $actionStop = $rule->getStopRulesProcessing(); $rows = array(); @@ -138,8 +177,8 @@ class Mage_CatalogRule_Model_Resource_Rule extends Mage_Core_Model_Resource_Db_A 'action_operator' => $actionOperator, 'action_amount' => $actionAmount, 'action_stop' => $actionStop, - 'sort_order' => $sortOrder, - ); + 'sort_order' => $sortOrder + ); if (count($rows) == 1000) { $write->insertMultiple($this->getTable('catalogrule_product'), $rows); @@ -151,13 +190,12 @@ class Mage_CatalogRule_Model_Resource_Rule extends Mage_Core_Model_Resource_Db_A if (!empty($rows)) { $write->insertMultiple($this->getTable('catalogrule_product'), $rows); } - - $write->commit(); } catch (Exception $e) { $write->rollback(); throw $e; } + $write->commit(); return $this; } @@ -165,6 +203,7 @@ class Mage_CatalogRule_Model_Resource_Rule extends Mage_Core_Model_Resource_Db_A * Get all product ids matched for rule * * @param int $ruleId + * * @return array */ public function getRuleProductIds($ruleId) @@ -172,6 +211,7 @@ class Mage_CatalogRule_Model_Resource_Rule extends Mage_Core_Model_Resource_Db_A $read = $this->_getReadAdapter(); $select = $read->select()->from($this->getTable('catalogrule_product'), 'product_id') ->where('rule_id=?', $ruleId); + return $read->fetchCol($select); } @@ -181,6 +221,7 @@ class Mage_CatalogRule_Model_Resource_Rule extends Mage_Core_Model_Resource_Db_A * @param int|string $fromDate * @param int|string $toDate * @param int|null $productId + * * @return Mage_CatalogRule_Model_Resource_Rule */ public function removeCatalogPricesForDateRange($fromDate, $toDate, $productId = null) @@ -217,8 +258,9 @@ class Mage_CatalogRule_Model_Resource_Rule extends Mage_Core_Model_Resource_Db_A /** * Delete old price rules data * - * @param unknown_type $date - * @param mixed $productId + * @param string $date + * @param int|null $productId + * * @return Mage_CatalogRule_Model_Resource_Rule */ public function deleteOldData($date, $productId = null) @@ -240,6 +282,7 @@ class Mage_CatalogRule_Model_Resource_Rule extends Mage_Core_Model_Resource_Db_A * @param int $toDate * @param int|null $productId * @param int|null $websiteId + * * @return Zend_Db_Statement_Interface */ protected function _getRuleProductsStmt($fromDate, $toDate, $productId = null, $websiteId = null) @@ -257,8 +300,8 @@ class Mage_CatalogRule_Model_Resource_Rule extends Mage_Core_Model_Resource_Db_A */ $select = $read->select() ->from(array('rp' => $this->getTable('catalogrule_product'))) - ->where($read->quoteInto('rp.from_time=0 or rp.from_time<=?', $toDate) - . ' or ' .$read->quoteInto('rp.to_time=0 or rp.to_time>=?', $fromDate)) + ->where($read->quoteInto('rp.from_time = 0 or rp.from_time <= ?', $toDate) + . ' OR ' . $read->quoteInto('rp.to_time = 0 or rp.to_time >= ?', $fromDate)) ->order(array('rp.website_id', 'rp.customer_group_id', 'rp.product_id', 'rp.sort_order', 'rp.rule_id')); if (!is_null($productId)) { @@ -306,20 +349,20 @@ class Mage_CatalogRule_Model_Resource_Rule extends Mage_Core_Model_Resource_Db_A ); } else { foreach (Mage::app()->getWebsites() as $website) { - $websiteId = $website->getId(); - $defaultGroup = $website->getDefaultGroup(); + $websiteId = $website->getId(); + $defaultGroup = $website->getDefaultGroup(); if ($defaultGroup instanceof Mage_Core_Model_Store_Group) { - $storeId = $defaultGroup->getDefaultStoreId(); + $storeId = $defaultGroup->getDefaultStoreId(); } else { - $storeId = Mage_Core_Model_App::ADMIN_STORE_ID; + $storeId = Mage_Core_Model_App::ADMIN_STORE_ID; } - $tableAlias = 'pp'.$websiteId; - $fieldAlias = 'website_'.$websiteId.'_price'; + $tableAlias = 'pp' . $websiteId; + $fieldAlias = 'website_' . $websiteId . '_price'; $select->joinLeft( array($tableAlias => $priceTable), sprintf($joinCondition, $tableAlias, $storeId), - array($fieldAlias => $tableAlias . '.value') + array($fieldAlias => $tableAlias.'.value') ); } } @@ -335,6 +378,7 @@ class Mage_CatalogRule_Model_Resource_Rule extends Mage_Core_Model_Resource_Db_A * @param int|string|null $fromDate * @param int|string|null $toDate * @param int $productId + * * @return Mage_CatalogRule_Model_Resource_Rule */ public function applyAllRulesForDateRange($fromDate = null, $toDate = null, $productId = null) @@ -492,6 +536,7 @@ class Mage_CatalogRule_Model_Resource_Rule extends Mage_Core_Model_Resource_Db_A * * @param array $ruleData * @param null|array $productData + * * @return float */ protected function _calcRuleProductPrice($ruleData, $productData = null) @@ -519,6 +564,7 @@ class Mage_CatalogRule_Model_Resource_Rule extends Mage_Core_Model_Resource_Db_A * Save rule prices for products to DB * * @param array $arrData + * * @return Mage_CatalogRule_Model_Resource_Rule */ protected function _saveRuleProductPrices($arrData) @@ -527,21 +573,34 @@ class Mage_CatalogRule_Model_Resource_Rule extends Mage_Core_Model_Resource_Db_A return $this; } - foreach ($arrData as $key => $data) { - $productIds[$data['product_id']] = true; // to avoid dupes - $arrData[$key]['rule_date'] = $this->formatDate($data['rule_date'], false); - $arrData[$key]['latest_start_date'] = $this->formatDate($data['latest_start_date'], false); - $arrData[$key]['earliest_end_date'] = $this->formatDate($data['earliest_end_date'], false); - } + $adapter = $this->_getWriteAdapter(); + $productIds = array(); + + $adapter->beginTransaction(); + try { + foreach ($arrData as $key => $data) { + $productIds[$data['product_id']] = true; // to avoid dupes + $arrData[$key]['rule_date'] = $this->formatDate($data['rule_date'], false); + $arrData[$key]['latest_start_date'] = $this->formatDate($data['latest_start_date'], false); + $arrData[$key]['earliest_end_date'] = $this->formatDate($data['earliest_end_date'], false); + } + + foreach ($productIds as $id => $v) { + $adapter->delete($this->getTable('catalogrule_affected_product'), + array("product_id = $id")); + $adapter->insert($this->getTable('catalogrule_affected_product'), + array('product_id' => $id)); + } + + $adapter->insertOnDuplicate($this->getTable('catalogrule_product_price'), $arrData); + + } catch (Exception $e) { + $adapter->rollback(); + throw $e; - foreach ($productIds as $id => $v) { - $this->_getWriteAdapter()->delete($this->getTable('catalogrule_affected_product'), - array("product_id = $id")); - $this->_getWriteAdapter()->insert($this->getTable('catalogrule_affected_product'), - array('product_id' => $id)); } + $adapter->commit(); - $this->_getWriteAdapter()->insertOnDuplicate($this->getTable('catalogrule_product_price'), $arrData); return $this; } @@ -553,7 +612,8 @@ class Mage_CatalogRule_Model_Resource_Rule extends Mage_Core_Model_Resource_Db_A * @param int $wId * @param int $gId * @param int $pId - * @return float | false + * + * @return float|bool */ public function getRulePrice($date, $wId, $gId, $pId) { @@ -566,13 +626,14 @@ class Mage_CatalogRule_Model_Resource_Rule extends Mage_Core_Model_Resource_Db_A } /** - * Return product prices by catalog rule for specific date, website and customer group - * Return product - price pairs + * Retrieve product prices by catalog rule for specific date, website and customer group + * Collect data with product Id => price pairs * * @param int|string $date * @param int $websiteId * @param int $customerGroupId * @param array $productIds + * * @return array */ public function getRulePrices($date, $websiteId, $customerGroupId, $productIds) @@ -619,11 +680,12 @@ class Mage_CatalogRule_Model_Resource_Rule extends Mage_Core_Model_Resource_Db_A } /** - * Get data about product prices for all customer groups + * Retrieve product price data for all customer groups * * @param int|string $date * @param int $wId * @param int $pId + * * @return array */ public function getRulesForProduct($date, $wId, $pId) @@ -634,6 +696,7 @@ class Mage_CatalogRule_Model_Resource_Rule extends Mage_Core_Model_Resource_Db_A ->where('rule_date=?', $this->formatDate($date, false)) ->where('website_id=?', $wId) ->where('product_id=?', $pId); + return $read->fetchAll($select); } @@ -643,6 +706,7 @@ class Mage_CatalogRule_Model_Resource_Rule extends Mage_Core_Model_Resource_Db_A * @param Mage_CatalogRule_Model_Rule $rule * @param Mage_Catalog_Model_Product $product * @param array $websiteIds + * * @return Mage_CatalogRule_Model_Resource_Rule */ public function applyToProduct($rule, $product, $websiteIds) @@ -651,7 +715,7 @@ class Mage_CatalogRule_Model_Resource_Rule extends Mage_Core_Model_Resource_Db_A return $this; } - $ruleId = $rule->getId(); + $ruleId = $rule->getId(); $productId = $product->getId(); $write = $this->_getWriteAdapter(); @@ -671,15 +735,13 @@ class Mage_CatalogRule_Model_Resource_Rule extends Mage_Core_Model_Resource_Db_A } $customerGroupIds = $rule->getCustomerGroupIds(); - - $fromTime = strtotime($rule->getFromDate()); - $toTime = strtotime($rule->getToDate()); - $toTime = $toTime ? $toTime+self::SECONDS_IN_DAY - 1 : 0; - - $sortOrder = (int)$rule->getSortOrder(); - $actionOperator = $rule->getSimpleAction(); - $actionAmount = $rule->getDiscountAmount(); - $actionStop = $rule->getStopRulesProcessing(); + $fromTime = strtotime($rule->getFromDate()); + $toTime = strtotime($rule->getToDate()); + $toTime = $toTime ? $toTime+self::SECONDS_IN_DAY-1 : 0; + $sortOrder = (int)$rule->getSortOrder(); + $actionOperator = $rule->getSimpleAction(); + $actionAmount = $rule->getDiscountAmount(); + $actionStop = $rule->getStopRulesProcessing(); $rows = array(); try { @@ -714,6 +776,7 @@ class Mage_CatalogRule_Model_Resource_Rule extends Mage_Core_Model_Resource_Db_A } $this->applyAllRulesForDateRange(null, null, $product); + $write->commit(); return $this; diff --git a/app/code/core/Mage/CatalogRule/Model/Resource/Rule/Collection.php b/app/code/core/Mage/CatalogRule/Model/Resource/Rule/Collection.php index f0d0dafde4fe2037af0a7f6ff969fabae8decc5a..1f10d0c1260f1e63df03476ed3da0efda44cee95 100755 --- a/app/code/core/Mage/CatalogRule/Model/Resource/Rule/Collection.php +++ b/app/code/core/Mage/CatalogRule/Model/Resource/Rule/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -32,45 +32,27 @@ * @package Mage_CatalogRule * @author Magento Core Team <core@magentocommerce.com> */ -class Mage_CatalogRule_Model_Resource_Rule_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract +class Mage_CatalogRule_Model_Resource_Rule_Collection extends Mage_Rule_Model_Resource_Rule_Collection_Abstract { /** - * Enter description here ... + * Store associated with rule entities information map * + * @var array */ - protected function _construct() - { - $this->_init('Mage_CatalogRule_Model_Rule', 'Mage_CatalogRule_Model_Resource_Rule'); - } + protected $_associatedEntitiesMap = array( + 'website' => array( + 'associations_table' => 'catalogrule_website', + 'rule_id_field' => 'rule_id', + 'entity_id_field' => 'website_id' + ) + ); /** - * Enter description here ... - * + * Set resource model */ - protected function _afterLoad() - { - $this->walk('afterLoad'); - } - - /** - * Filter collection by specified website IDs - * - * @param int|array $websiteIds - * @return Mage_CatalogRule_Model_Resource_Rule_Collection - */ - public function addWebsiteFilter($websiteIds) + protected function _construct() { - if (!is_array($websiteIds)) { - $websiteIds = array($websiteIds); - } - $parts = array(); - foreach ($websiteIds as $websiteId) { - $parts[] = $this->getConnection()->prepareSqlCondition('main_table.website_ids', array('finset' => $websiteId)); - } - if ($parts) { - $this->getSelect()->where(new Zend_Db_Expr(implode(' OR ', $parts))); - } - return $this; + $this->_init('Mage_CatalogRule_Model_Rule', 'Mage_CatalogRule_Model_Resource_Rule'); } /** diff --git a/app/code/core/Mage/CatalogRule/Model/Resource/Rule/Product/Price.php b/app/code/core/Mage/CatalogRule/Model/Resource/Rule/Product/Price.php index 165933e8f13a467303956713503c8723dc9386c2..4906ae1acbd9f05d725f8e08b8c63eb6614a4e86 100755 --- a/app/code/core/Mage/CatalogRule/Model/Resource/Rule/Product/Price.php +++ b/app/code/core/Mage/CatalogRule/Model/Resource/Rule/Product/Price.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogRule/Model/Resource/Rule/Product/Price/Collection.php b/app/code/core/Mage/CatalogRule/Model/Resource/Rule/Product/Price/Collection.php index cdecd461587915b9e1361e2ffbb1075a2cc7b4c5..0ba36610d18191f46132732705d735ac42002d57 100755 --- a/app/code/core/Mage/CatalogRule/Model/Resource/Rule/Product/Price/Collection.php +++ b/app/code/core/Mage/CatalogRule/Model/Resource/Rule/Product/Price/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogRule/Model/Rule.php b/app/code/core/Mage/CatalogRule/Model/Rule.php index d218a7432d6f3ef0d352d43f65b00ecebfa16b2a..0ec31299f4f62f633fac6474452935360ea80702 100644 --- a/app/code/core/Mage/CatalogRule/Model/Rule.php +++ b/app/code/core/Mage/CatalogRule/Model/Rule.php @@ -20,13 +20,13 @@ * * @category Mage * @package Mage_CatalogRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ /** - * Enter description here ... + * Catalog Rule data model * * @method Mage_CatalogRule_Model_Resource_Rule _getResource() * @method Mage_CatalogRule_Model_Resource_Rule getResource() @@ -60,8 +60,11 @@ * @package Mage_CatalogRule * @author Magento Core Team <core@magentocommerce.com> */ -class Mage_CatalogRule_Model_Rule extends Mage_Rule_Model_Rule +class Mage_CatalogRule_Model_Rule extends Mage_Rule_Model_Abstract { + /** + * Related cache types config path + */ const XML_NODE_RELATED_CACHE = 'global/catalogrule/related_cache_types'; /** @@ -81,7 +84,7 @@ class Mage_CatalogRule_Model_Rule extends Mage_Rule_Model_Rule protected $_eventObject = 'rule'; /** - * Matched product ids array + * Store matched product Ids * * @var array */ @@ -94,6 +97,11 @@ class Mage_CatalogRule_Model_Rule extends Mage_Rule_Model_Rule */ protected $_productsFilter = null; + /** + * Store current date at "Y-m-d H:i:s" format + * + * @var string + */ protected $_now; /** @@ -114,106 +122,60 @@ class Mage_CatalogRule_Model_Rule extends Mage_Rule_Model_Rule } /** - * Filtering products that must be checked for matching with rule + * Getter for rule conditions collection * - * @param int|array $productIds + * @return Mage_CatalogRule_Model_Rule_Condition_Combine */ - public function setProductsFilter($productIds) + public function getConditionsInstance() { - $this->_productsFilter = $productIds; + return Mage::getModel('Mage_CatalogRule_Model_Rule_Condition_Combine'); } /** - * Returns products filter + * Getter for rule actions collection * - * @return array|int|null + * @return Mage_CatalogRule_Model_Rule_Action_Collection */ - public function getProductsFilter() - { - return $this->_productsFilter; - } - - public function getConditionsInstance() - { - return Mage::getModel('Mage_CatalogRule_Model_Rule_Condition_Combine'); - } - public function getActionsInstance() { return Mage::getModel('Mage_CatalogRule_Model_Rule_Action_Collection'); } - public function getNow() - { - if (!$this->_now) { - return now(); - } - return $this->_now; - } - - public function setNow($now) - { - $this->_now = $now; - } - - public function toString($format='') - { - $str = Mage::helper('Mage_CatalogRule_Helper_Data')->__("Name: %s", $this->getName()) ."\n" - . Mage::helper('Mage_CatalogRule_Helper_Data')->__("Start at: %s", $this->getStartAt()) ."\n" - . Mage::helper('Mage_CatalogRule_Helper_Data')->__("Expire at: %s", $this->getExpireAt()) ."\n" - . Mage::helper('Mage_CatalogRule_Helper_Data')->__("Customer Registered: %s", $this->getCustomerRegistered()) ."\n" - . Mage::helper('Mage_CatalogRule_Helper_Data')->__("Customer is a New Buyer: %s", $this->getCustomerNewBuyer()) ."\n" - . Mage::helper('Mage_CatalogRule_Helper_Data')->__("Description: %s", $this->getDescription()) ."\n\n" - . $this->getConditions()->toStringRecursive() ."\n\n" - . $this->getActions()->toStringRecursive() ."\n\n"; - return $str; - } - /** - * Returns rule as an array for admin interface - * - * Output example: - * array( - * 'name'=>'Example rule', - * 'conditions'=>{condition_combine::toArray} - * 'actions'=>{action_collection::toArray} - * ) + * Get catalog rule customer group Ids * * @return array */ - public function toArray(array $arrAttributes = array()) + public function getCustomerGroupIds() { - $out = parent::toArray($arrAttributes); - $out['customer_registered'] = $this->getCustomerRegistered(); - $out['customer_new_buyer'] = $this->getCustomerNewBuyer(); - - return $out; + if (!$this->hasCustomerGroupIds()) { + $customerGroupIds = $this->_getResource()->getCustomerGroupIds($this->getId()); + $this->setData('customer_group_ids', (array)$customerGroupIds); + } + return $this->_getData('customer_group_ids'); } /** - * Invalidate related cache types + * Retrieve current date for current rule * - * @return Mage_CatalogRule_Model_Rule + * @return string */ - protected function _invalidateCache() + public function getNow() { - $types = Mage::getConfig()->getNode(self::XML_NODE_RELATED_CACHE); - if ($types) { - $types = $types->asArray(); - Mage::app()->getCacheInstance()->invalidateType(array_keys($types)); + if (!$this->_now) { + return now(); } - return $this; + return $this->_now; } /** - * Process rule related data after rule save + * Set current date for current rule * - * @return Mage_CatalogRule_Model_Rule + * @param string $now */ - protected function _afterSave() + public function setNow($now) { - $this->_getResource()->updateRuleProductData($this); - parent::_afterSave(); + $this->_now = $now; } /** @@ -226,18 +188,14 @@ class Mage_CatalogRule_Model_Rule extends Mage_Rule_Model_Rule if (is_null($this->_productIds)) { $this->_productIds = array(); $this->setCollectedAttributes(array()); - $websiteIds = $this->getWebsiteIds(); - if (!is_array($websiteIds)) { - $websiteIds = explode(',', $websiteIds); - } - if ($websiteIds) { - $productCollection = Mage::getResourceModel('Mage_Catalog_Model_Resource_Product_Collection') - ->addWebsiteFilter($websiteIds); + if ($this->getWebsiteIds()) { + /** @var $productCollection Mage_Catalog_Model_Resource_Product_Collection */ + $productCollection = Mage::getResourceModel('Mage_Catalog_Model_Resource_Product_Collection'); + $productCollection->addWebsiteFilter($this->getWebsiteIds()); if ($this->_productsFilter) { $productCollection->addIdFilter($this->_productsFilter); } - $this->getConditions()->collectValidatedAttributes($productCollection); Mage::getSingleton('Mage_Core_Model_Resource_Iterator')->walk( @@ -274,41 +232,21 @@ class Mage_CatalogRule_Model_Rule extends Mage_Rule_Model_Rule * Apply rule to product * * @param int|Mage_Catalog_Model_Product $product - * @param array $websiteIds + * @param array|null $websiteIds + * * @return void */ - public function applyToProduct($product, $websiteIds=null) + public function applyToProduct($product, $websiteIds = null) { if (is_numeric($product)) { $product = Mage::getModel('Mage_Catalog_Model_Product')->load($product); } if (is_null($websiteIds)) { - $websiteIds = explode(',', $this->getWebsiteIds()); + $websiteIds = $this->getWebsiteIds(); } $this->getResource()->applyToProduct($this, $product, $websiteIds); } - /** - * Get array of assigned customer group ids - * - * @return array - */ - public function getCustomerGroupIds() - { - $ids = $this->getData('customer_group_ids'); - if (($ids && !$this->getCustomerGroupChecked()) || is_string($ids)) { - if (is_string($ids)) { - $ids = explode(',', $ids); - } - - $groupIds = Mage::getModel('Mage_Customer_Model_Group')->getCollection()->getAllIds(); - $ids = array_intersect($ids, $groupIds); - $this->setData('customer_group_ids', $ids); - $this->setCustomerGroupChecked(true); - } - return $ids; - } - /** * Apply all price rules, invalidate related cache and refresh price index * @@ -354,8 +292,8 @@ class Mage_CatalogRule_Model_Rule extends Mage_Rule_Model_Rule /** * Calculate price using catalog price rule of product * - * @param Mage_Catalog_Model_Product $product - * @param float $price + * @param Mage_Catalog_Model_Product $product + * @param float $price * @return float|null */ public function calcProductPriceRule(Mage_Catalog_Model_Product $product, $price) @@ -409,4 +347,75 @@ class Mage_CatalogRule_Model_Rule extends Mage_Rule_Model_Rule } return null; } + + /** + * Filtering products that must be checked for matching with rule + * + * @param int|array $productIds + */ + public function setProductsFilter($productIds) + { + $this->_productsFilter = $productIds; + } + + /** + * Returns products filter + * + * @return array|int|null + */ + public function getProductsFilter() + { + return $this->_productsFilter; + } + + /** + * Invalidate related cache types + * + * @return Mage_CatalogRule_Model_Rule + */ + protected function _invalidateCache() + { + $types = Mage::getConfig()->getNode(self::XML_NODE_RELATED_CACHE); + if ($types) { + $types = $types->asArray(); + Mage::app()->getCacheInstance()->invalidateType(array_keys($types)); + } + return $this; + } + + + + + /** + * @deprecated after 1.11.2.0 + * + * @param string $format + * + * @return string + */ + public function toString($format='') + { + return ''; + } + + /** + * Returns rule as an array for admin interface + * + * @deprecated after 1.11.2.0 + * + * @param array $arrAttributes + * + * Output example: + * array( + * 'name'=>'Example rule', + * 'conditions'=>{condition_combine::toArray} + * 'actions'=>{action_collection::toArray} + * ) + * + * @return array + */ + public function toArray(array $arrAttributes = array()) + { + return parent::toArray($arrAttributes); + } } diff --git a/app/code/core/Mage/CatalogRule/Model/Rule/Action/Collection.php b/app/code/core/Mage/CatalogRule/Model/Rule/Action/Collection.php index a1d245bef8b3bd80f078d4cdaad472d97b0457e7..211d95409285f1e839ac72f03cd9353b30bcf14d 100644 --- a/app/code/core/Mage/CatalogRule/Model/Rule/Action/Collection.php +++ b/app/code/core/Mage/CatalogRule/Model/Rule/Action/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogRule/Model/Rule/Action/Product.php b/app/code/core/Mage/CatalogRule/Model/Rule/Action/Product.php index cbfac100fb47d08ccc7f25692034d18698f127e2..a43538fd9d15160c36b17d0d399f12f67e6272d5 100644 --- a/app/code/core/Mage/CatalogRule/Model/Rule/Action/Product.php +++ b/app/code/core/Mage/CatalogRule/Model/Rule/Action/Product.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogRule/Model/Rule/Condition/Combine.php b/app/code/core/Mage/CatalogRule/Model/Rule/Condition/Combine.php index 4b5c644561a8ec7f8a1e483dab1234ae50797ca2..e7e73be49e398c1d628ce6fda71ad1fcb2750af7 100644 --- a/app/code/core/Mage/CatalogRule/Model/Rule/Condition/Combine.php +++ b/app/code/core/Mage/CatalogRule/Model/Rule/Condition/Combine.php @@ -20,11 +20,13 @@ * * @category Mage * @package Mage_CatalogRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - +/** + * Catalog Rule Combine Condition data model + */ class Mage_CatalogRule_Model_Rule_Condition_Combine extends Mage_Rule_Model_Condition_Combine { public function __construct() diff --git a/app/code/core/Mage/CatalogRule/Model/Rule/Condition/Product.php b/app/code/core/Mage/CatalogRule/Model/Rule/Condition/Product.php index 2cdaa08c3f5b7273db7d1564362d3a4de3cdea56..e1f9bb2c80b8d512537be0ac3af37b62a8e3305b 100644 --- a/app/code/core/Mage/CatalogRule/Model/Rule/Condition/Product.php +++ b/app/code/core/Mage/CatalogRule/Model/Rule/Condition/Product.php @@ -20,488 +20,15 @@ * * @category Mage * @package Mage_CatalogRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -class Mage_CatalogRule_Model_Rule_Condition_Product extends Mage_Rule_Model_Condition_Abstract +/** + * Catalog Rule Product Condition data model + */ +class Mage_CatalogRule_Model_Rule_Condition_Product extends Mage_Rule_Model_Condition_Product_Abstract { - /** - * All attribute values as array in form: - * array( - * [entity_id_1] => array( - * [store_id_1] => store_value_1, - * [store_id_2] => store_value_2, - * ... - * [store_id_n] => store_value_n - * ), - * ... - * ) - * - * Will be set only for not global scope attribute - * - * @var array - */ - protected $_entityAttributeValues = null; - - /** - * Attribute data key that indicates whether it should be used for rules - * - * @var string - */ - protected $_isUsedForRuleProperty = 'is_used_for_promo_rules'; - - /** - * Customize default operator input by type mapper for some types - * - * @return array - */ - public function getDefaultOperatorInputByType() - { - if (null === $this->_defaultOperatorInputByType) { - parent::getDefaultOperatorInputByType(); - /* - * '{}' and '!{}' are left for back-compatibility and equal to '==' and '!=' - */ - $this->_defaultOperatorInputByType['category'] = array('==', '!=', '{}', '!{}', '()', '!()'); - $this->_arrayInputTypes[] = 'category'; - } - return $this->_defaultOperatorInputByType; - } - - /** - * Retrieve attribute object - * - * @return Mage_Catalog_Model_Resource_Eav_Attribute - */ - public function getAttributeObject() - { - try { - $obj = Mage::getSingleton('Mage_Eav_Model_Config') - ->getAttribute(Mage_Catalog_Model_Product::ENTITY, $this->getAttribute()); - } - catch (Exception $e) { - $obj = new Varien_Object(); - $obj->setEntity(Mage::getResourceSingleton('Mage_Catalog_Model_Resource_Product')) - ->setFrontendInput('text'); - } - return $obj; - } - - /** - * Add special attributes - * - * @param array $attributes - */ - protected function _addSpecialAttributes(array &$attributes) - { - $attributes['attribute_set_id'] = Mage::helper('Mage_CatalogRule_Helper_Data')->__('Attribute Set'); - $attributes['category_ids'] = Mage::helper('Mage_CatalogRule_Helper_Data')->__('Category'); - } - - /** - * Load attribute options - * - * @return Mage_CatalogRule_Model_Rule_Condition_Product - */ - public function loadAttributeOptions() - { - $productAttributes = Mage::getResourceSingleton('Mage_Catalog_Model_Resource_Product') - ->loadAllAttributes() - ->getAttributesByCode(); - - $attributes = array(); - foreach ($productAttributes as $attribute) { - /* @var $attribute Mage_Catalog_Model_Resource_Eav_Attribute */ - if (!$attribute->isAllowedForRuleCondition() - || !$attribute->getDataUsingMethod($this->_isUsedForRuleProperty) - ) { - continue; - } - $attributes[$attribute->getAttributeCode()] = $attribute->getFrontendLabel(); - } - - $this->_addSpecialAttributes($attributes); - - asort($attributes); - $this->setAttributeOption($attributes); - - return $this; - } - - /** - * Prepares values options to be used as select options or hashed array - * Result is stored in following keys: - * 'value_select_options' - normal select array: array(array('value' => $value, 'label' => $label), ...) - * 'value_option' - hashed array: array($value => $label, ...), - * - * @return Mage_CatalogRule_Model_Rule_Condition_Product - */ - protected function _prepareValueOptions() - { - // Check that both keys exist. Maybe somehow only one was set not in this routine, but externally. - $selectReady = $this->getData('value_select_options'); - $hashedReady = $this->getData('value_option'); - if ($selectReady && $hashedReady) { - return $this; - } - - // Get array of select options. It will be used as source for hashed options - $selectOptions = null; - if ($this->getAttribute() === 'attribute_set_id') { - $entityTypeId = Mage::getSingleton('Mage_Eav_Model_Config') - ->getEntityType(Mage_Catalog_Model_Product::ENTITY)->getId(); - $selectOptions = Mage::getResourceModel('Mage_Eav_Model_Resource_Entity_Attribute_Set_Collection') - ->setEntityTypeFilter($entityTypeId) - ->load() - ->toOptionArray(); - } else if (is_object($this->getAttributeObject())) { - $attributeObject = $this->getAttributeObject(); - if ($attributeObject->usesSource()) { - if ($attributeObject->getFrontendInput() == 'multiselect') { - $addEmptyOption = false; - } else { - $addEmptyOption = true; - } - $selectOptions = $attributeObject->getSource()->getAllOptions($addEmptyOption); - } - } - - // Set new values only if we really got them - if ($selectOptions !== null) { - // Overwrite only not already existing values - if (!$selectReady) { - $this->setData('value_select_options', $selectOptions); - } - if (!$hashedReady) { - $hashedOptions = array(); - foreach ($selectOptions as $o) { - if (is_array($o['value'])) { - continue; // We cannot use array as index - } - $hashedOptions[$o['value']] = $o['label']; - } - $this->setData('value_option', $hashedOptions); - } - } - - return $this; - } - - /** - * Retrieve value by option - * - * @param mixed $option - * @return string - */ - public function getValueOption($option=null) - { - $this->_prepareValueOptions(); - return $this->getData('value_option'.(!is_null($option) ? '/'.$option : '')); - } - - /** - * Retrieve select option values - * - * @return array - */ - public function getValueSelectOptions() - { - $this->_prepareValueOptions(); - return $this->getData('value_select_options'); - } - - /** - * Retrieve after element HTML - * - * @return string - */ - public function getValueAfterElementHtml() - { - $html = ''; - - switch ($this->getAttribute()) { - case 'sku': case 'category_ids': - $image = Mage::getDesign()->getSkinUrl('images/rule_chooser_trigger.gif'); - break; - } - - if (!empty($image)) { - $html = '<a href="javascript:void(0)" class="rule-chooser-trigger"><img src="' . $image . '" alt="" class="v-middle rule-chooser-trigger" title="' . Mage::helper('Mage_Rule_Helper_Data')->__('Open Chooser') . '" /></a>'; - } - return $html; - } - - /** - * Retrieve attribute element - * - * @return Varien_Form_Element_Abstract - */ - public function getAttributeElement() - { - $element = parent::getAttributeElement(); - $element->setShowAsText(true); - return $element; - } - - /** - * Collect validated attributes - * - * @param Mage_Catalog_Model_Resource_Product_Collection $productCollection - * @return Mage_CatalogRule_Model_Rule_Condition_Product - */ - public function collectValidatedAttributes($productCollection) - { - $attribute = $this->getAttribute(); - if ('category_ids' != $attribute) { - if ($this->getAttributeObject()->isScopeGlobal()) { - $attributes = $this->getRule()->getCollectedAttributes(); - $attributes[$attribute] = true; - $this->getRule()->setCollectedAttributes($attributes); - $productCollection->addAttributeToSelect($attribute, 'left'); - } else { - $this->_entityAttributeValues = $productCollection->getAllAttributeValues($attribute); - } - } - - return $this; - } - - /** - * Retrieve input type - * - * @return string - */ - public function getInputType() - { - if ($this->getAttribute()==='attribute_set_id') { - return 'select'; - } - if (!is_object($this->getAttributeObject())) { - return 'string'; - } - if ($this->getAttributeObject()->getAttributeCode() == 'category_ids') { - return 'category'; - } - switch ($this->getAttributeObject()->getFrontendInput()) { - case 'select': - return 'select'; - - case 'multiselect': - return 'multiselect'; - - case 'date': - return 'date'; - - case 'boolean': - return 'boolean'; - - default: - return 'string'; - } - } - - /** - * Retrieve value element type - * - * @return string - */ - public function getValueElementType() - { - if ($this->getAttribute()==='attribute_set_id') { - return 'select'; - } - if (!is_object($this->getAttributeObject())) { - return 'text'; - } - switch ($this->getAttributeObject()->getFrontendInput()) { - case 'select': - case 'boolean': - return 'select'; - - case 'multiselect': - return 'multiselect'; - - case 'date': - return 'date'; - - default: - return 'text'; - } - } - - /** - * Retrieve value element - * - * @return Varien_Data_Form_Element_Abstract - */ - public function getValueElement() - { - $element = parent::getValueElement(); - if (is_object($this->getAttributeObject())) { - switch ($this->getAttributeObject()->getFrontendInput()) { - case 'date': - $element->setImage(Mage::getDesign()->getSkinUrl('images/grid-cal.gif')); - break; - } - } - - return $element; - } - - /** - * Retrieve value element chooser URL - * - * @return string - */ - public function getValueElementChooserUrl() - { - $url = false; - switch ($this->getAttribute()) { - case 'sku': case 'category_ids': - $url = 'adminhtml/promo_widget/chooser' - .'/attribute/'.$this->getAttribute(); - if ($this->getJsFormObject()) { - $url .= '/form/'.$this->getJsFormObject(); - } - break; - } - return $url!==false ? Mage::helper('Mage_Adminhtml_Helper_Data')->getUrl($url) : ''; - } - - /** - * Retrieve Explicit Apply - * - * @return bool - */ - public function getExplicitApply() - { - switch ($this->getAttribute()) { - case 'sku': case 'category_ids': - return true; - } - if (is_object($this->getAttributeObject())) { - switch ($this->getAttributeObject()->getFrontendInput()) { - case 'date': - return true; - } - } - return false; - } - - /** - * Load array - * - * @param array $arr - * @return Mage_CatalogRule_Model_Rule_Condition_Product - */ - public function loadArray($arr) - { - $this->setAttribute(isset($arr['attribute']) ? $arr['attribute'] : false); - $attribute = $this->getAttributeObject(); - - $isContainsOperator = !empty($arr['operator']) && in_array($arr['operator'], array('{}', '!{}')); - if ($attribute && $attribute->getBackendType() == 'decimal' && !$isContainsOperator) { - if (isset($arr['value'])) { - if (!empty($arr['operator']) - && in_array($arr['operator'], array('!()', '()')) - && false !== strpos($arr['value'], ',')) { - - $tmp = array(); - foreach (explode(',', $arr['value']) as $value) { - $tmp[] = Mage::app()->getLocale()->getNumber($value); - } - $arr['value'] = implode(',', $tmp); - } else { - $arr['value'] = Mage::app()->getLocale()->getNumber($arr['value']); - } - } else { - $arr['value'] = false; - } - $arr['is_value_parsed'] = isset($arr['is_value_parsed']) - ? Mage::app()->getLocale()->getNumber($arr['is_value_parsed']) : false; - } - - return parent::loadArray($arr); - } - - /** - * Validate product attrbute value for condition - * - * @param Varien_Object $object - * @return bool - */ - public function validate(Varien_Object $object) - { - $attrCode = $this->getAttribute(); - - if ('category_ids' == $attrCode) { - return $this->validateAttribute($object->getAvailableInCategories()); - } elseif (! isset($this->_entityAttributeValues[$object->getId()])) { - $attr = $object->getResource()->getAttribute($attrCode); - - if ($attr && $attr->getBackendType() == 'datetime' && !is_int($this->getValue())) { - $this->setValue(strtotime($this->getValue())); - $value = strtotime($object->getData($attrCode)); - return $this->validateAttribute($value); - } - - if ($attr && $attr->getFrontendInput() == 'multiselect') { - $value = $object->getData($attrCode); - $value = strlen($value) ? explode(',', $value) : array(); - return $this->validateAttribute($value); - } - - return parent::validate($object); - } else { - $result = false; // any valid value will set it to TRUE - // remember old attribute state - $oldAttrValue = $object->hasData($attrCode) ? $object->getData($attrCode) : null; - - foreach ($this->_entityAttributeValues[$object->getId()] as $storeId => $value) { - $attr = $object->getResource()->getAttribute($attrCode); - if ($attr && $attr->getBackendType() == 'datetime') { - $value = strtotime($value); - } else if ($attr && $attr->getFrontendInput() == 'multiselect') { - $value = strlen($value) ? explode(',', $value) : array(); - } - - $object->setData($attrCode, $value); - $result |= parent::validate($object); - - if ($result) { - break; - } - } - - if (is_null($oldAttrValue)) { - $object->unsetData($attrCode); - } else { - $object->setData($attrCode, $oldAttrValue); - } - - return (bool) $result; - } - } - - /** - * Correct '==' and '!=' operators - * Categories can't be equal because product is included categories selected by administrator and in their parents - * - * @return string - */ - public function getOperatorForValidate() - { - $op = $this->getOperator(); - if ($this->getInputType() == 'category') { - if ($op == '==') { - $op = '{}'; - } elseif ($op == '!=') { - $op = '!{}'; - } - } - return $op; - } } diff --git a/app/code/core/Mage/CatalogRule/Model/Rule/Product/Price.php b/app/code/core/Mage/CatalogRule/Model/Rule/Product/Price.php index e3ceba5755568bcb21c3d17f72e9cb99483a3d30..fb33573303de16f67a5483ae3e1bceaa02f828a2 100644 --- a/app/code/core/Mage/CatalogRule/Model/Rule/Product/Price.php +++ b/app/code/core/Mage/CatalogRule/Model/Rule/Product/Price.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogRule/etc/adminhtml.xml b/app/code/core/Mage/CatalogRule/etc/adminhtml.xml index 0f0659116c406f8aaf3b0f01f2355658420b4217..94b8a61f8666537e034cffb5cc06c57f27e53fc2 100644 --- a/app/code/core/Mage/CatalogRule/etc/adminhtml.xml +++ b/app/code/core/Mage/CatalogRule/etc/adminhtml.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_CatalogRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/CatalogRule/etc/config.xml b/app/code/core/Mage/CatalogRule/etc/config.xml index b46c1a5bc83e92ad0bcf7d2c306b46a840d65b85..9cf6fd46df091e81d0015002ec02ce49519cb20f 100644 --- a/app/code/core/Mage/CatalogRule/etc/config.xml +++ b/app/code/core/Mage/CatalogRule/etc/config.xml @@ -21,14 +21,14 @@ * * @category Mage * @package Mage_CatalogRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> <config> <modules> <Mage_CatalogRule> - <version>1.6.0.1</version> + <version>1.6.0.2</version> </Mage_CatalogRule> </modules> <global> diff --git a/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/install-1.6.0.0.php b/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/install-1.6.0.0.php index b0ae7618d3cae97a73369fa371d75a539881b073..3d275f1107ec4cd3f5d28c53f6dcc5488f750337 100644 --- a/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/upgrade-1.6.0.0-1.6.0.1.php b/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/upgrade-1.6.0.0-1.6.0.1.php index 4e8bc12a4fe80a210e70582b89dcaad2f6f92979..3b291214c07d42055dc4e321f26dee7be554e737 100644 --- a/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/upgrade-1.6.0.0-1.6.0.1.php +++ b/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/upgrade-1.6.0.0-1.6.0.1.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/upgrade-1.6.0.1-1.6.0.2.php b/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/upgrade-1.6.0.1-1.6.0.2.php new file mode 100644 index 0000000000000000000000000000000000000000..a158896bdb232963c94a9a65d73e59f53f2672ae --- /dev/null +++ b/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/upgrade-1.6.0.1-1.6.0.2.php @@ -0,0 +1,163 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_CatalogRule + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/* @var $installer Mage_Core_Model_Resource_Setup */ +$installer = $this; +$connection = $installer->getConnection(); + +$rulesTable = $installer->getTable('catalogrule'); +$websitesTable = $installer->getTable('core_website'); +$customerGroupsTable = $installer->getTable('customer_group'); +$rulesWebsitesTable = $installer->getTable('catalogrule_website'); +$rulesCustomerGroupsTable = $installer->getTable('catalogrule_customer_group'); + +$installer->startSetup(); +/** + * Create table 'catalogrule_website' if not exists. This table will be used instead of + * column website_ids of main catalog rules table + */ +if (!$connection->isTableExists($rulesWebsitesTable)) { + $table = $connection->newTable($rulesWebsitesTable) + ->addColumn('rule_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array( + 'unsigned' => true, + 'nullable' => false, + 'primary' => true + ), + 'Rule Id' + ) + ->addColumn('website_id', Varien_Db_Ddl_Table::TYPE_SMALLINT, null, array( + 'unsigned' => true, + 'nullable' => false, + 'primary' => true + ), + 'Website Id' + ) + ->addIndex( + $installer->getIdxName('catalogrule_website', array('rule_id')), + array('rule_id') + ) + ->addIndex( + $installer->getIdxName('catalogrule_website', array('website_id')), + array('website_id') + ) + ->addForeignKey($installer->getFkName('catalogrule_website', 'rule_id', 'catalogrule', 'rule_id'), + 'rule_id', $rulesTable, 'rule_id', + Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE + ) + ->addForeignKey($installer->getFkName('catalogrule_website', 'website_id', 'core_website', 'website_id'), + 'website_id', $websitesTable, 'website_id', + Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE + ) + ->setComment('Catalog Rules To Websites Relations'); + + $connection->createTable($table); +} + +/** + * Create table 'catalogrule_customer_group' if not exists. This table will be used instead of + * column customer_group_ids of main catalog rules table + */ +if (!$connection->isTableExists($rulesCustomerGroupsTable)) { + $table = $connection->newTable($rulesCustomerGroupsTable) + ->addColumn('rule_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array( + 'unsigned' => true, + 'nullable' => false, + 'primary' => true + ), + 'Rule Id' + ) + ->addColumn('customer_group_id', Varien_Db_Ddl_Table::TYPE_SMALLINT, null, array( + 'unsigned' => true, + 'nullable' => false, + 'primary' => true + ), + 'Customer Group Id' + ) + ->addIndex( + $installer->getIdxName('catalogrule_customer_group', array('rule_id')), + array('rule_id') + ) + ->addIndex( + $installer->getIdxName('catalogrule_customer_group', array('customer_group_id')), + array('customer_group_id') + ) + ->addForeignKey($installer->getFkName('catalogrule_customer_group', 'rule_id', 'catalogrule', 'rule_id'), + 'rule_id', $rulesTable, 'rule_id', + Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE + ) + ->addForeignKey( + $installer->getFkName('catalogrule_customer_group', 'customer_group_id', + 'customer_group', 'customer_group_id' + ), + 'customer_group_id', $customerGroupsTable, 'customer_group_id', + Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE + ) + ->setComment('Catalog Rules To Customer Groups Relations'); + + $connection->createTable($table); +} + +/** + * Fill out relation table 'catalogrule_website' with website Ids + */ +if ($connection->tableColumnExists($rulesTable, 'website_ids')) { + $select = $connection->select() + ->from(array('sr' => $rulesTable), array('sr.rule_id', 'cw.website_id')) + ->join( + array('cw' => $websitesTable), + $connection->prepareSqlCondition( + 'sr.website_ids', array('finset' => new Zend_Db_Expr('cw.website_id')) + ), + array() + ); + $query = $select->insertFromSelect($rulesWebsitesTable, array('rule_id', 'website_id')); + $connection->query($query); +} + +/** + * Fill out relation table 'catalogrule_customer_group' with customer group Ids + */ +if ($connection->tableColumnExists($rulesTable, 'customer_group_ids')) { + $select = $connection->select() + ->from(array('sr' => $rulesTable), array('sr.rule_id', 'cg.customer_group_id')) + ->join( + array('cg' => $customerGroupsTable), + $connection->prepareSqlCondition( + 'sr.customer_group_ids', array('finset' => new Zend_Db_Expr('cg.customer_group_id')) + ), + array() + ); + $query = $select->insertFromSelect($rulesCustomerGroupsTable, array('rule_id', 'customer_group_id')); + $connection->query($query); +} + +/** + * Eliminate obsolete columns + */ +$connection->dropColumn($rulesTable, 'website_ids'); +$connection->dropColumn($rulesTable, 'customer_group_ids'); + +$installer->endSetup(); diff --git a/app/code/core/Mage/CatalogSearch/Block/Advanced/Form.php b/app/code/core/Mage/CatalogSearch/Block/Advanced/Form.php index 56053346633f9b24e1cd4aab7ff9691f20e76272..a4c41cf77d53df32e0608d4f06405f0e27055b84 100644 --- a/app/code/core/Mage/CatalogSearch/Block/Advanced/Form.php +++ b/app/code/core/Mage/CatalogSearch/Block/Advanced/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogSearch - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -81,6 +81,13 @@ class Mage_CatalogSearch_Block_Advanced_Form extends Mage_Core_Block_Template return $attribute->getFrontendClass(); } + /** + * Retrieve search string for given field from request + * + * @param string $attribute + * @param string $part + * @return mixed|string + */ public function getAttributeValue($attribute, $part=null) { $value = $this->getRequest()->getQuery($attribute->getAttributeCode()); @@ -93,12 +100,14 @@ class Mage_CatalogSearch_Block_Advanced_Form extends Mage_Core_Block_Template } } - if (!is_array($value)) { - $value = htmlspecialchars($value); - } return $value; } + /** + * Retrieve the list of available currencies + * + * @return array + */ public function getAvailableCurrencies() { $currencies = $this->getData('_currencies'); @@ -123,11 +132,22 @@ class Mage_CatalogSearch_Block_Advanced_Form extends Mage_Core_Block_Template return $currencies; } + /** + * Count available currencies + * + * @return int + */ public function getCurrencyCount() { return count($this->getAvailableCurrencies()); } + /** + * Retrieve currency code for attribute + * + * @param $attribute + * @return string + */ public function getCurrency($attribute) { return Mage::app()->getStore()->getCurrentCurrencyCode(); @@ -170,6 +190,12 @@ class Mage_CatalogSearch_Block_Advanced_Form extends Mage_Core_Block_Template return 'string'; } + /** + * Build attribute select element html string + * + * @param $attribute + * @return string + */ public function getAttributeSelectElement($attribute) { $extra = ''; @@ -186,8 +212,6 @@ class Mage_CatalogSearch_Block_Advanced_Form extends Mage_Core_Block_Template array_unshift($options, array('value'=>'', 'label'=>Mage::helper('Mage_CatalogSearch_Helper_Data')->__('All'))); } - - return $this->_getSelectBlock() ->setName($name) ->setId($attribute->getAttributeCode()) @@ -237,6 +261,7 @@ class Mage_CatalogSearch_Block_Advanced_Form extends Mage_Core_Block_Template } return $block; } + /** * Retrieve advanced search model object * @@ -247,11 +272,23 @@ class Mage_CatalogSearch_Block_Advanced_Form extends Mage_Core_Block_Template return Mage::getSingleton('Mage_CatalogSearch_Model_Advanced'); } + /** + * Retrieve search form action string + * + * @return string + */ public function getSearchPostUrl() { return $this->getUrl('*/*/result'); } + /** + * Build date element html string for attribute + * + * @param $attribute + * @param string $part + * @return string + */ public function getDateInput($attribute, $part = 'from') { $name = $attribute->getAttributeCode() . '[' . $part . ']'; diff --git a/app/code/core/Mage/CatalogSearch/Block/Advanced/Result.php b/app/code/core/Mage/CatalogSearch/Block/Advanced/Result.php index d12acf8a7e878e73d3ef0477a949d4f8d77f186b..15ab41f47541d8a4a9ea75fe505f12faa0e845a5 100644 --- a/app/code/core/Mage/CatalogSearch/Block/Advanced/Result.php +++ b/app/code/core/Mage/CatalogSearch/Block/Advanced/Result.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogSearch - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogSearch/Block/Autocomplete.php b/app/code/core/Mage/CatalogSearch/Block/Autocomplete.php index 1f2900547293f74038f85410cddb881af6d305fe..482362ba4022c608519b5c150a8c5994f4df8538 100644 --- a/app/code/core/Mage/CatalogSearch/Block/Autocomplete.php +++ b/app/code/core/Mage/CatalogSearch/Block/Autocomplete.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogSearch - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogSearch/Block/Layer.php b/app/code/core/Mage/CatalogSearch/Block/Layer.php index 8d8f7a391b174b2a989ad68e2c84ab4e51c164a7..51e73ae841379faf3b330a60336a0f8e1eddff82 100644 --- a/app/code/core/Mage/CatalogSearch/Block/Layer.php +++ b/app/code/core/Mage/CatalogSearch/Block/Layer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogSearch - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogSearch/Block/Layer/Filter/Attribute.php b/app/code/core/Mage/CatalogSearch/Block/Layer/Filter/Attribute.php index 9cc0dea12b2c55a2d29fdb29ba9032ca354fb943..35287c3ecaa2ccf813852f13603491e68d4b4163 100644 --- a/app/code/core/Mage/CatalogSearch/Block/Layer/Filter/Attribute.php +++ b/app/code/core/Mage/CatalogSearch/Block/Layer/Filter/Attribute.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogSearch - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogSearch/Block/Result.php b/app/code/core/Mage/CatalogSearch/Block/Result.php index 9f1a62b5f159dff69ad40bbb54a6a5e794a1ba9f..13e6d644c1c2a9ab3b9c5d6967fc99aaf591a8b8 100644 --- a/app/code/core/Mage/CatalogSearch/Block/Result.php +++ b/app/code/core/Mage/CatalogSearch/Block/Result.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogSearch - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogSearch/Block/Term.php b/app/code/core/Mage/CatalogSearch/Block/Term.php index 8b05508a5ca76808bb12f9f5a00e0b3f09c9c541..ad85c9090c55b409cd3e73e38fad03688f91720b 100644 --- a/app/code/core/Mage/CatalogSearch/Block/Term.php +++ b/app/code/core/Mage/CatalogSearch/Block/Term.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogSearch - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogSearch/Helper/Data.php b/app/code/core/Mage/CatalogSearch/Helper/Data.php index 58a890d6a479a2919aef23df49cf684eab3e5b98..f1b7adde523bccc92fca3fb9dad398c01b874f1d 100644 --- a/app/code/core/Mage/CatalogSearch/Helper/Data.php +++ b/app/code/core/Mage/CatalogSearch/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogSearch - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -287,8 +287,9 @@ class Mage_CatalogSearch_Helper_Data extends Mage_Core_Helper_Abstract } $searchType = Mage::getStoreConfig(Mage_CatalogSearch_Model_Fulltext::XML_PATH_CATALOG_SEARCH_TYPE); - if ($searchType != Mage_CatalogSearch_Model_Fulltext::SEARCH_TYPE_COMBINE && - $searchType != Mage_CatalogSearch_Model_Fulltext::SEARCH_TYPE_LIKE) { + if ($searchType != Mage_CatalogSearch_Model_Fulltext::SEARCH_TYPE_COMBINE + && $searchType != Mage_CatalogSearch_Model_Fulltext::SEARCH_TYPE_LIKE + ) { return $this; } @@ -300,14 +301,13 @@ class Mage_CatalogSearch_Helper_Data extends Mage_Core_Helper_Abstract return $this; } - $wordsCut = array_diff($wordsFull, $wordsLike); - $wordsCut = array_map(array($this, 'escapeHtml'), $wordsCut); - $this->addNoteMessage( - $this->__('Maximum words count is %1$s. In your search query was cut next part: %2$s.', - $this->getMaxQueryWords(), - join(' ', $wordsCut) - ) - ); + if (count($wordsFull) > count($wordsLike)) { + $wordsCut = array_diff($wordsFull, $wordsLike); + $wordsCut = array_map(array($this, 'escapeHtml'), $wordsCut); + $this->addNoteMessage( + $this->__('Maximum words count is %1$s. In your search query was cut next part: %2$s.', $this->getMaxQueryWords(), join(' ', $wordsCut)) + ); + } return $this; } diff --git a/app/code/core/Mage/CatalogSearch/Model/Advanced.php b/app/code/core/Mage/CatalogSearch/Model/Advanced.php index 7be303b8d4bdc9de85b52b0ae507f72a08ca6690..b6801c949dde304a281b393a6e38a6a642d92e96 100644 --- a/app/code/core/Mage/CatalogSearch/Model/Advanced.php +++ b/app/code/core/Mage/CatalogSearch/Model/Advanced.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogSearch - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogSearch/Model/Fulltext.php b/app/code/core/Mage/CatalogSearch/Model/Fulltext.php index d954b6efe107b832c2931a2e8fe8cbed4c6081d5..18a4d14460861f6ae4ba8079cc0f9c3dcbc1d8de 100644 --- a/app/code/core/Mage/CatalogSearch/Model/Fulltext.php +++ b/app/code/core/Mage/CatalogSearch/Model/Fulltext.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogSearch - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -61,8 +61,9 @@ class Mage_CatalogSearch_Model_Fulltext extends Mage_Core_Model_Abstract * (1, 2) => Regenerate index for product Id=2 and its store view Id=1 * (null, 2) => Regenerate index for all store views of product Id=2 * - * @param int $storeId Store View Id - * @param int | array $productId Product Entity Id + * @param int|null $storeId Store View Id + * @param int|array|null $productIds Product Entity Id + * * @return Mage_CatalogSearch_Model_Fulltext */ public function rebuildIndex($storeId = null, $productIds = null) @@ -139,11 +140,34 @@ class Mage_CatalogSearch_Model_Fulltext extends Mage_Core_Model_Abstract return Mage::getStoreConfig(self::XML_PATH_CATALOG_SEARCH_TYPE, $storeId); } + + + + + // Deprecated methods + + /** + * Set whether table changes are allowed + * + * @deprecated after 1.6.1.0 + * + * @param bool $value + * @return Mage_CatalogSearch_Model_Fulltext + */ + public function setAllowTableChanges($value = true) + { + $this->_allowTableChanges = $value; + return $this; + } + /** - * Update category'es products indexes + * Update category products indexes + * + * @deprecated after 1.6.2.0 * * @param array $productIds * @param array $categoryIds + * * @return Mage_CatalogSearch_Model_Fulltext */ public function updateCategoryIndex($productIds, $categoryIds) diff --git a/app/code/core/Mage/CatalogSearch/Model/Fulltext/Observer.php b/app/code/core/Mage/CatalogSearch/Model/Fulltext/Observer.php index e7e7dcbf99f0b8b47ef3d2c100e1bd1f507ca075..f8ecdcdf54ccf0e1258ae29a759ed45b970ea118 100644 --- a/app/code/core/Mage/CatalogSearch/Model/Fulltext/Observer.php +++ b/app/code/core/Mage/CatalogSearch/Model/Fulltext/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogSearch - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogSearch/Model/Indexer/Fulltext.php b/app/code/core/Mage/CatalogSearch/Model/Indexer/Fulltext.php index 1842d742d7d394ddddba2235b85454cf30bc2585..c34f2124f1c390564a4c4d6ef792d5946b1d96c9 100644 --- a/app/code/core/Mage/CatalogSearch/Model/Indexer/Fulltext.php +++ b/app/code/core/Mage/CatalogSearch/Model/Indexer/Fulltext.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogSearch - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogSearch/Model/Layer.php b/app/code/core/Mage/CatalogSearch/Model/Layer.php index 623e2c4d8c958482d737f7977e85c57be85ab293..5738780c03f86aecee35ab3ca40a134cb00c5bd0 100644 --- a/app/code/core/Mage/CatalogSearch/Model/Layer.php +++ b/app/code/core/Mage/CatalogSearch/Model/Layer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogSearch - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogSearch/Model/Layer/Filter/Attribute.php b/app/code/core/Mage/CatalogSearch/Model/Layer/Filter/Attribute.php index f7ef2f3de1cd9c3f5d0fd5a37667b214f61ba4ae..6d9b2affd1f5ff643a2d3348a51b444344682113 100644 --- a/app/code/core/Mage/CatalogSearch/Model/Layer/Filter/Attribute.php +++ b/app/code/core/Mage/CatalogSearch/Model/Layer/Filter/Attribute.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogSearch - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogSearch/Model/Query.php b/app/code/core/Mage/CatalogSearch/Model/Query.php index d37a4fde1280f2a9f23594747581e3361f0a402a..e9f24303acd4eb0f3154e26dffd878ca3a409155 100644 --- a/app/code/core/Mage/CatalogSearch/Model/Query.php +++ b/app/code/core/Mage/CatalogSearch/Model/Query.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogSearch - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogSearch/Model/Resource/Advanced.php b/app/code/core/Mage/CatalogSearch/Model/Resource/Advanced.php index dc6901efc4770ea0ded256ede38f72c980b22aff..7f4160515210b90f84769527497c3d1cbdc3e7a7 100755 --- a/app/code/core/Mage/CatalogSearch/Model/Resource/Advanced.php +++ b/app/code/core/Mage/CatalogSearch/Model/Resource/Advanced.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogSearch - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogSearch/Model/Resource/Advanced/Collection.php b/app/code/core/Mage/CatalogSearch/Model/Resource/Advanced/Collection.php index e3e270d572c00f99db46155579cd9d00b97e8253..57fa0fc90b4b5f13cc258012abcb78a224c17154 100755 --- a/app/code/core/Mage/CatalogSearch/Model/Resource/Advanced/Collection.php +++ b/app/code/core/Mage/CatalogSearch/Model/Resource/Advanced/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogSearch - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogSearch/Model/Resource/Fulltext.php b/app/code/core/Mage/CatalogSearch/Model/Resource/Fulltext.php index d05efca0b3d1a8ef78d65079a705f61c2c03bec5..532ad0692877652631b47239518c9c781380e3d7 100755 --- a/app/code/core/Mage/CatalogSearch/Model/Resource/Fulltext.php +++ b/app/code/core/Mage/CatalogSearch/Model/Resource/Fulltext.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogSearch - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -89,22 +89,6 @@ class Mage_CatalogSearch_Model_Resource_Fulltext extends Mage_Core_Model_Resourc return $this->_separator; } - /** - * Update category'es products indexes - * - * @param array $productIds - * @param array $categoryIds - * @return Mage_CatalogSearch_Model_Resource_Fulltext - */ - public function updateCategoryIndex($productIds, $categoryIds) - { - if ($this->_engine && $this->_engine->allowAdvancedIndex()) { - $this->_engine->updateCategoryIndex($productIds, $categoryIds); - } - - return $this; - } - /** * Regenerate search index for store(s) * @@ -138,11 +122,11 @@ class Mage_CatalogSearch_Model_Resource_Fulltext extends Mage_Core_Model_Resourc $this->cleanIndex($storeId, $productIds); // prepare searchable attributes - $staticFields = array(); + $staticFields = array(); foreach ($this->_getSearchableAttributes('static') as $attribute) { $staticFields[] = $attribute->getAttributeCode(); } - $dynamicFields = array( + $dynamicFields = array( 'int' => array_keys($this->_getSearchableAttributes('int')), 'varchar' => array_keys($this->_getSearchableAttributes('varchar')), 'text' => array_keys($this->_getSearchableAttributes('text')), @@ -153,8 +137,8 @@ class Mage_CatalogSearch_Model_Resource_Fulltext extends Mage_Core_Model_Resourc // status and visibility filter $visibility = $this->_getSearchableAttribute('visibility'); $status = $this->_getSearchableAttribute('status'); - $visibilityVals = Mage::getSingleton('Mage_Catalog_Model_Product_Visibility')->getVisibleInSearchIds(); $statusVals = Mage::getSingleton('Mage_Catalog_Model_Product_Status')->getVisibleStatusIds(); + $allowedVisibilityValues = $this->_engine->getAllowedVisibility(); $lastProductId = 0; while (true) { @@ -168,10 +152,10 @@ class Mage_CatalogSearch_Model_Resource_Fulltext extends Mage_Core_Model_Resourc foreach ($products as $productData) { $lastProductId = $productData['entity_id']; $productAttributes[$productData['entity_id']] = $productData['entity_id']; - $productChilds = $this->_getProductChildIds($productData['entity_id'], $productData['type_id']); - $productRelations[$productData['entity_id']] = $productChilds; - if ($productChilds) { - foreach ($productChilds as $productChildId) { + $productChildren = $this->_getProductChildIds($productData['entity_id'], $productData['type_id']); + $productRelations[$productData['entity_id']] = $productChildren; + if ($productChildren) { + foreach ($productChildren as $productChildId) { $productAttributes[$productChildId] = $productChildId; } } @@ -180,30 +164,17 @@ class Mage_CatalogSearch_Model_Resource_Fulltext extends Mage_Core_Model_Resourc $productIndexes = array(); $productAttributes = $this->_getProductAttributes($storeId, $productAttributes, $dynamicFields); foreach ($products as $productData) { - /* - * If using advanced index and there is no required fields - do not add to index. - * Skipping out of stock products if there are no prices for them in catalog_product_index_price table - */ - if ($this->_engine->allowAdvancedIndex() - && (!isset($productData[$this->_engine->getFieldsPrefix() . 'categories'])) - ) { - continue; - } if (!isset($productAttributes[$productData['entity_id']])) { continue; } $productAttr = $productAttributes[$productData['entity_id']]; if (!isset($productAttr[$visibility->getId()]) - || (!in_array($productAttr[$visibility->getId()], $visibilityVals) - && !$this->_engine->allowAdvancedIndex() - ) + || !in_array($productAttr[$visibility->getId()], $allowedVisibilityValues) ) { continue; } - if (!isset($productAttr[$status->getId()]) - || !in_array($productAttr[$status->getId()], $statusVals) - ) { + if (!isset($productAttr[$status->getId()]) || !in_array($productAttr[$status->getId()], $statusVals)) { continue; } @@ -211,8 +182,8 @@ class Mage_CatalogSearch_Model_Resource_Fulltext extends Mage_Core_Model_Resourc $productData['entity_id'] => $productAttr ); - if ($productChilds = $productRelations[$productData['entity_id']]) { - foreach ($productChilds as $productChildId) { + if ($productChildren = $productRelations[$productData['entity_id']]) { + foreach ($productChildren as $productChildId) { if (isset($productAttributes[$productChildId])) { $productIndex[$productChildId] = $productAttributes[$productChildId]; } @@ -245,8 +216,10 @@ class Mage_CatalogSearch_Model_Resource_Fulltext extends Mage_Core_Model_Resourc protected function _getSearchableProducts($storeId, array $staticFields, $productIds = null, $lastProductId = 0, $limit = 100) { - $store = Mage::app()->getStore($storeId); - $select = $this->_getWriteAdapter()->select() + $websiteId = Mage::app()->getStore($storeId)->getWebsiteId(); + $writeAdapter = $this->_getWriteAdapter(); + + $select = $writeAdapter->select() ->useStraightJoin(true) ->from( array('e' => $this->getTable('catalog_product_entity')), @@ -254,17 +227,17 @@ class Mage_CatalogSearch_Model_Resource_Fulltext extends Mage_Core_Model_Resourc ) ->join( array('website' => $this->getTable('catalog_product_website')), - $this->_getWriteAdapter()->quoteInto( + $writeAdapter->quoteInto( 'website.product_id=e.entity_id AND website.website_id=?', - $store->getWebsiteId() + $websiteId ), array() ) ->join( array('stock_status' => $this->getTable('cataloginventory_stock_status')), - $this->_getWriteAdapter()->quoteInto( + $writeAdapter->quoteInto( 'stock_status.product_id=e.entity_id AND stock_status.website_id=?', - $store->getWebsiteId() + $websiteId ), array('in_stock' => 'stock_status') ); @@ -277,12 +250,9 @@ class Mage_CatalogSearch_Model_Resource_Fulltext extends Mage_Core_Model_Resourc ->limit($limit) ->order('e.entity_id'); - $result = $this->_getWriteAdapter()->fetchAll($select); - if ($this->_engine && $this->_engine->allowAdvancedIndex() && count($result) > 0) { - return $this->_engine->addAdvancedIndex($result, $storeId, $productIds); - } else { - return $result; - } + $result = $writeAdapter->fetchAll($select); + + return $result; } /** @@ -313,6 +283,7 @@ class Mage_CatalogSearch_Model_Resource_Fulltext extends Mage_Core_Model_Resourc if ($this->_engine) { $this->_engine->cleanIndex($storeId, $productId); } + return $this; } @@ -361,18 +332,20 @@ class Mage_CatalogSearch_Model_Resource_Fulltext extends Mage_Core_Model_Resourc ->where($mainTableAlias.'.store_id = ?', (int)$query->getStoreId()); if ($searchType == Mage_CatalogSearch_Model_Fulltext::SEARCH_TYPE_FULLTEXT - || $searchType == Mage_CatalogSearch_Model_Fulltext::SEARCH_TYPE_COMBINE) { + || $searchType == Mage_CatalogSearch_Model_Fulltext::SEARCH_TYPE_COMBINE + ) { $bind[':query'] = implode(' ', $preparedTerms[0]); $where = Mage::getResourceHelper('Mage_CatalogSearch') ->chooseFulltext($this->getMainTable(), $mainTableAlias, $select); } + if ($likeCond != '' && $searchType == Mage_CatalogSearch_Model_Fulltext::SEARCH_TYPE_COMBINE) { $where .= ($where ? ' OR ' : '') . $likeCond; - } - if ($likeCond != '' && $searchType == Mage_CatalogSearch_Model_Fulltext::SEARCH_TYPE_LIKE) { + } elseif ($likeCond != '' && $searchType == Mage_CatalogSearch_Model_Fulltext::SEARCH_TYPE_LIKE) { $select->columns(array('relevance' => new Zend_Db_Expr(0))); $where = $likeCond; } + if ($where != '') { $select->where($where); } @@ -400,7 +373,7 @@ class Mage_CatalogSearch_Model_Resource_Fulltext extends Mage_Core_Model_Resourc } /** - * Retrieve Searchable attributes + * Retrieve searchable attributes * * @param string $backendType * @return array @@ -410,13 +383,8 @@ class Mage_CatalogSearch_Model_Resource_Fulltext extends Mage_Core_Model_Resourc if (is_null($this->_searchableAttributes)) { $this->_searchableAttributes = array(); - $entityType = $this->getEavConfig()->getEntityType(Mage_Catalog_Model_Product::ENTITY); - $entity = $entityType->getEntity(); + $productAttributeCollection = Mage::getResourceModel('Mage_Catalog_Model_Resource_Product_Attribute_Collection'); - $productAttributeCollection = Mage::getResourceModel( - 'Mage_Catalog_Model_Resource_Product_Attribute_Collection' - ) - ->setEntityTypeFilter($entityType->getEntityTypeId()); if ($this->_engine && $this->_engine->allowAdvancedIndex()) { $productAttributeCollection->addToIndexFilter(true); } else { @@ -424,16 +392,27 @@ class Mage_CatalogSearch_Model_Resource_Fulltext extends Mage_Core_Model_Resourc } $attributes = $productAttributeCollection->getItems(); + Mage::dispatchEvent('catelogsearch_searchable_attributes_load_after', array( + 'engine' => $this->_engine, + 'attributes' => $attributes + )); + + $entity = $this->getEavConfig() + ->getEntityType(Mage_Catalog_Model_Product::ENTITY) + ->getEntity(); + foreach ($attributes as $attribute) { $attribute->setEntity($entity); - $this->_searchableAttributes[$attribute->getId()] = $attribute; } + + $this->_searchableAttributes = $attributes; } + if (!is_null($backendType)) { $attributes = array(); - foreach ($this->_searchableAttributes as $attribute) { + foreach ($this->_searchableAttributes as $attributeId => $attribute) { if ($attribute->getBackendType() == $backendType) { - $attributes[$attribute->getId()] = $attribute; + $attributes[$attributeId] = $attribute; } } @@ -456,14 +435,14 @@ class Mage_CatalogSearch_Model_Resource_Fulltext extends Mage_Core_Model_Resourc if (isset($attributes[$attribute])) { return $attributes[$attribute]; } - } - elseif (is_string($attribute)) { + } elseif (is_string($attribute)) { foreach ($attributes as $attributeModel) { if ($attributeModel->getAttributeCode() == $attribute) { return $attributeModel; } } } + return $this->getEavConfig()->getAttribute(Mage_Catalog_Model_Product::ENTITY, $attribute); } @@ -587,6 +566,7 @@ class Mage_CatalogSearch_Model_Resource_Fulltext extends Mage_Core_Model_Resourc { $productEmulator = new Varien_Object(); $productEmulator->setIdFieldName('entity_id'); + return $productEmulator; } @@ -623,33 +603,30 @@ class Mage_CatalogSearch_Model_Resource_Fulltext extends Mage_Core_Model_Resourc } } - foreach ($indexData as $attributeData) { + foreach ($indexData as $entityId => $attributeData) { foreach ($attributeData as $attributeId => $attributeValue) { $value = $this->_getAttributeValue($attributeId, $attributeValue, $storeId); if (!is_null($value) && $value !== false) { - $code = $this->_getSearchableAttribute($attributeId)->getAttributeCode(); - //For grouped products - if (isset($index[$code])) { - if (!is_array($index[$code])) { - $index[$code] = array($index[$code]); - } - $index[$code][] = $value; - } - //For other types of products - else { - $index[$code] = $value; + $attributeCode = $this->_getSearchableAttribute($attributeId)->getAttributeCode(); + + if (isset($index[$attributeCode])) { + $index[$attributeCode][$entityId] = $value; + } else { + $index[$attributeCode] = array($entityId => $value); } } } } - $product = $this->_getProductEmulator() - ->setId($productData['entity_id']) - ->setTypeId($productData['type_id']) - ->setStoreId($storeId); - $typeInstance = $this->_getProductTypeInstance($productData['type_id']); - if ($data = $typeInstance->getSearchableData($product)) { - $index['options'] = $data; + if (!$this->_engine->allowAdvancedIndex()) { + $product = $this->_getProductEmulator() + ->setId($productData['entity_id']) + ->setTypeId($productData['type_id']) + ->setStoreId($storeId); + $typeInstance = $this->_getProductTypeInstance($productData['type_id']); + if ($data = $typeInstance->getSearchableData($product)) { + $index['options'] = $data; + } } if (isset($productData['in_stock'])) { @@ -657,10 +634,6 @@ class Mage_CatalogSearch_Model_Resource_Fulltext extends Mage_Core_Model_Resourc } if ($this->_engine) { - if ($this->_engine->allowAdvancedIndex()) { - $index += $this->_engine->addAllowedAdvancedIndexField($productData); - } - return $this->_engine->prepareEntityIndex($index, $this->_separator); } @@ -678,33 +651,50 @@ class Mage_CatalogSearch_Model_Resource_Fulltext extends Mage_Core_Model_Resourc protected function _getAttributeValue($attributeId, $value, $storeId) { $attribute = $this->_getSearchableAttribute($attributeId); - if (!($attribute->getIsSearchable() || - $attribute->getIsVisibleInAdvancedSearch() || - $attribute->getIsFilterable() || - $attribute->getIsFilterableInSearch())) { - return null; + if (!$attribute->getIsSearchable()) { + if ($this->_engine->allowAdvancedIndex()) { + if ($attribute->getAttributeCode() == 'visibility') { + return $value; + } elseif (!($attribute->getIsVisibleInAdvancedSearch() + || $attribute->getIsFilterable() + || $attribute->getIsFilterableInSearch() + || $attribute->getUsedForSortBy()) + ) { + return null; + } + } else { + return null; + } } if ($attribute->usesSource()) { + if ($this->_engine->allowAdvancedIndex()) { + return $value; + } + $attribute->setStoreId($storeId); $value = $attribute->getSource()->getOptionText($value); - } - if ($attribute->getBackendType() == 'datetime') { - $value = $this->_getStoreDate($storeId, $value); - } - $inputType = $attribute->getFrontend()->getInputType(); - if ($inputType == 'price') { - $value = Mage::app()->getStore($storeId)->roundPrice($value); - } + if (is_array($value)) { + $value = implode($this->_separator, $value); + } elseif (empty($value)) { + $inputType = $attribute->getFrontend()->getInputType(); + if ($inputType == 'select' || $inputType == 'multiselect') { + return null; + } + } - if (is_array($value)) { - $value = implode($this->_separator, $value); - } elseif (empty($value) && ($inputType == 'select' || $inputType == 'multiselect')) { - return null; + $value = preg_replace("#\s+#siu", ' ', trim(strip_tags($value))); + } elseif ($attribute->getBackendType() == 'datetime') { + $value = $this->_getStoreDate($storeId, $value); + } else { + $inputType = $attribute->getFrontend()->getInputType(); + if ($inputType == 'price') { + $value = Mage::app()->getStore($storeId)->roundPrice($value); + } } - return preg_replace("#\s+#siu", ' ', trim(strip_tags($value))); + return $value; } /** @@ -720,6 +710,7 @@ class Mage_CatalogSearch_Model_Resource_Fulltext extends Mage_Core_Model_Resourc if ($this->_engine) { $this->_engine->saveEntityIndex($productId, $storeId, $index); } + return $this; } @@ -735,6 +726,7 @@ class Mage_CatalogSearch_Model_Resource_Fulltext extends Mage_Core_Model_Resourc if ($this->_engine) { $this->_engine->saveEntityIndexes($storeId, $productIndexes); } + return $this; } @@ -766,4 +758,24 @@ class Mage_CatalogSearch_Model_Resource_Fulltext extends Mage_Core_Model_Resourc return null; } + + + + + + // Deprecated methods + + /** + * Update category products indexes + * + * deprecated after 1.6.2.0 + * + * @param array $productIds + * @param array $categoryIds + * @return Mage_CatalogSearch_Model_Resource_Fulltext + */ + public function updateCategoryIndex($productIds, $categoryIds) + { + return $this; + } } diff --git a/app/code/core/Mage/CatalogSearch/Model/Resource/Fulltext/Collection.php b/app/code/core/Mage/CatalogSearch/Model/Resource/Fulltext/Collection.php index 945d618fdabe324538ce6c57a589f7a11bee99cf..4a0876f1acd88838ad650a04e62ebb527698c3e0 100755 --- a/app/code/core/Mage/CatalogSearch/Model/Resource/Fulltext/Collection.php +++ b/app/code/core/Mage/CatalogSearch/Model/Resource/Fulltext/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogSearch - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogSearch/Model/Resource/Fulltext/Engine.php b/app/code/core/Mage/CatalogSearch/Model/Resource/Fulltext/Engine.php index 24d1c79aa601662092ac77f1c750b0d876a0803f..ed4f9cef5d9a3a82bba35b588960e39ae66c7623 100755 --- a/app/code/core/Mage/CatalogSearch/Model/Resource/Fulltext/Engine.php +++ b/app/code/core/Mage/CatalogSearch/Model/Resource/Fulltext/Engine.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogSearch - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -72,10 +72,9 @@ class Mage_CatalogSearch_Model_Resource_Fulltext_Engine extends Mage_Core_Model_ */ public function saveEntityIndexes($storeId, $entityIndexes, $entity = 'product') { - $adapter = $this->_getWriteAdapter(); $data = array(); $storeId = (int)$storeId; - foreach ($entityIndexes as $entityId => &$index) { + foreach ($entityIndexes as $entityId => $index) { $data[] = array( 'product_id' => (int)$entityId, 'store_id' => $storeId, @@ -91,6 +90,16 @@ class Mage_CatalogSearch_Model_Resource_Fulltext_Engine extends Mage_Core_Model_ return $this; } + /** + * Retrieve allowed visibility values for current engine + * + * @return array + */ + public function getAllowedVisibility() + { + return Mage::getSingleton('Mage_Catalog_Model_Product_Visibility')->getVisibleInSearchIds(); + } + /** * Define if current search engine supports advanced index * diff --git a/app/code/core/Mage/CatalogSearch/Model/Resource/Helper/Mysql4.php b/app/code/core/Mage/CatalogSearch/Model/Resource/Helper/Mysql4.php index 429a276c7767da2438653a33817141cbe0cec0a1..4659e58315a62dd42f9799d1c67e919f58d3f441 100644 --- a/app/code/core/Mage/CatalogSearch/Model/Resource/Helper/Mysql4.php +++ b/app/code/core/Mage/CatalogSearch/Model/Resource/Helper/Mysql4.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogSearch - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogSearch/Model/Resource/Indexer/Fulltext.php b/app/code/core/Mage/CatalogSearch/Model/Resource/Indexer/Fulltext.php index c30736df4b8e4d05bec8f1cf573c2ed38d5b13a1..1c76213fdf27b3f248ac6e0e430b04895fe47168 100644 --- a/app/code/core/Mage/CatalogSearch/Model/Resource/Indexer/Fulltext.php +++ b/app/code/core/Mage/CatalogSearch/Model/Resource/Indexer/Fulltext.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogSearch - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogSearch/Model/Resource/Query.php b/app/code/core/Mage/CatalogSearch/Model/Resource/Query.php index 2b41954da6f5056f70b23fbc5a39a2637154b19d..e4f845c3fbd533797f024c5eae3f2ee71b49fe2d 100755 --- a/app/code/core/Mage/CatalogSearch/Model/Resource/Query.php +++ b/app/code/core/Mage/CatalogSearch/Model/Resource/Query.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogSearch - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogSearch/Model/Resource/Query/Collection.php b/app/code/core/Mage/CatalogSearch/Model/Resource/Query/Collection.php index 1508d4993daea0813e8cc078ac47ac6743a224be..2bdfecf81f252f90e4685d8755736bf5644a6260 100755 --- a/app/code/core/Mage/CatalogSearch/Model/Resource/Query/Collection.php +++ b/app/code/core/Mage/CatalogSearch/Model/Resource/Query/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogSearch - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogSearch/Model/Resource/Search/Collection.php b/app/code/core/Mage/CatalogSearch/Model/Resource/Search/Collection.php index c8f3c97dbcdd52ba9df26d06df8a1ce86380e527..8fd21589c6484024263e5e4dd45164e2d9bc0f85 100755 --- a/app/code/core/Mage/CatalogSearch/Model/Resource/Search/Collection.php +++ b/app/code/core/Mage/CatalogSearch/Model/Resource/Search/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogSearch - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogSearch/Model/Session.php b/app/code/core/Mage/CatalogSearch/Model/Session.php index 618832dae296278eb2277be8ab679f35fb8869bb..c5dffd0d761bd904a42dd51648a733f55e0d5c21 100644 --- a/app/code/core/Mage/CatalogSearch/Model/Session.php +++ b/app/code/core/Mage/CatalogSearch/Model/Session.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogSearch - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogSearch/Model/System/Config/Backend/Sitemap.php b/app/code/core/Mage/CatalogSearch/Model/System/Config/Backend/Sitemap.php index 6112ae20bce2560a7b3057af684ce4c17d4d4822..81668bc5ba0d3cef5e39ab2c1e41d151baddac4d 100644 --- a/app/code/core/Mage/CatalogSearch/Model/System/Config/Backend/Sitemap.php +++ b/app/code/core/Mage/CatalogSearch/Model/System/Config/Backend/Sitemap.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogSearch - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogSearch/controllers/AdvancedController.php b/app/code/core/Mage/CatalogSearch/controllers/AdvancedController.php index 37ffcab31eac2cedafa2f57916ae88c1f293bcf1..0d85f235767bd8a318e9855e3a5b24420f0c989a 100644 --- a/app/code/core/Mage/CatalogSearch/controllers/AdvancedController.php +++ b/app/code/core/Mage/CatalogSearch/controllers/AdvancedController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogSearch - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogSearch/controllers/AjaxController.php b/app/code/core/Mage/CatalogSearch/controllers/AjaxController.php index 67aeaff046f811aba3971640ab6b54be0764b0af..0999c3cfb3128962a09694b158b01d552c1792d5 100644 --- a/app/code/core/Mage/CatalogSearch/controllers/AjaxController.php +++ b/app/code/core/Mage/CatalogSearch/controllers/AjaxController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogSearch - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogSearch/controllers/ResultController.php b/app/code/core/Mage/CatalogSearch/controllers/ResultController.php index eead9256fc11425b6a7aa138d14cea51acb0a5c5..d6cf15e0fc16a38908b99c23e7404e3b77805e05 100644 --- a/app/code/core/Mage/CatalogSearch/controllers/ResultController.php +++ b/app/code/core/Mage/CatalogSearch/controllers/ResultController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogSearch - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -48,7 +48,7 @@ class Mage_CatalogSearch_ResultController extends Mage_Core_Controller_Front_Act $query->setStoreId(Mage::app()->getStore()->getId()); - if ($query->getQueryText()) { + if ($query->getQueryText() != '') { if (Mage::helper('Mage_CatalogSearch_Helper_Data')->isMinQueryLength()) { $query->setId(0) ->setIsActive(1) diff --git a/app/code/core/Mage/CatalogSearch/controllers/TermController.php b/app/code/core/Mage/CatalogSearch/controllers/TermController.php index 6fb464f2f428adc52d8b804582e93ab91b6d6b98..514a6bb98afe058c647d4f31fe666286198cab41 100644 --- a/app/code/core/Mage/CatalogSearch/controllers/TermController.php +++ b/app/code/core/Mage/CatalogSearch/controllers/TermController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogSearch - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogSearch/etc/adminhtml.xml b/app/code/core/Mage/CatalogSearch/etc/adminhtml.xml index 14b1beb37e88c82099cf24a13bff89e408119ae5..e35d35a25a851280df97e1adc07d46e6f9d30f2f 100644 --- a/app/code/core/Mage/CatalogSearch/etc/adminhtml.xml +++ b/app/code/core/Mage/CatalogSearch/etc/adminhtml.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_CatalogSearch - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/CatalogSearch/etc/config.xml b/app/code/core/Mage/CatalogSearch/etc/config.xml index fa29e4e878ebd75a54cc308977a16d00c57cbfb1..6b14e58457b0d814861b2a4235c3f1fad1c85324 100644 --- a/app/code/core/Mage/CatalogSearch/etc/config.xml +++ b/app/code/core/Mage/CatalogSearch/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_CatalogSearch - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/CatalogSearch/etc/system.xml b/app/code/core/Mage/CatalogSearch/etc/system.xml index 3109ed77b5470c3bfca815c5b4c006f5f3c90344..da257d44b51bc05ee1adab13820623e2c4231457 100644 --- a/app/code/core/Mage/CatalogSearch/etc/system.xml +++ b/app/code/core/Mage/CatalogSearch/etc/system.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_CatalogSearch - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/CatalogSearch/sql/catalogsearch_setup/install-1.6.0.0.php b/app/code/core/Mage/CatalogSearch/sql/catalogsearch_setup/install-1.6.0.0.php index ef2dfc3965ce29c4696cfc2a9cdfe5b579e52578..aa8ae1236c5337e7b1cb1f453a1d8abda3298a24 100644 --- a/app/code/core/Mage/CatalogSearch/sql/catalogsearch_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/CatalogSearch/sql/catalogsearch_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_CatalogSearch - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/CatalogSearch/view/frontend/advanced/form.phtml b/app/code/core/Mage/CatalogSearch/view/frontend/advanced/form.phtml index 2b72fa63e4093517b91b46679026c9d549900579..3e8e85abf13caa8d73a85da26081a3aa16833291 100644 --- a/app/code/core/Mage/CatalogSearch/view/frontend/advanced/form.phtml +++ b/app/code/core/Mage/CatalogSearch/view/frontend/advanced/form.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -31,6 +31,7 @@ * @see Mage_CatalogSearch_Block_Advanced_Form */ ?> +<?php $maxQueryLength= $this->helper('Mage_CatalogSearch_Helper_Data')->getMaxQueryLength();?> <div class="page-title"> <h1><?php echo $this->__('Catalog Advanced Search') ?></h1> </div> @@ -46,16 +47,16 @@ <?php switch($this->getAttributeInputType($_attribute)): case 'number': ?> <div class="input-range"> - <input type="text" name="<?php echo $_code ?>[from]" value="<?php echo $this->escapeHtml($this->getAttributeValue($_attribute, 'from')) ?>" id="<?php echo $_code ?>" title="<?php echo $this->escapeHtml($this->getAttributeLabel($_attribute)) ?>" class="input-text validate-number" /> + <input type="text" name="<?php echo $_code ?>[from]" value="<?php echo $this->escapeHtml($this->getAttributeValue($_attribute, 'from')) ?>" id="<?php echo $_code ?>" title="<?php echo $this->escapeHtml($this->getAttributeLabel($_attribute)) ?>" class="input-text validate-number" maxlength="<?php echo $maxQueryLength;?>" /> <span class="separator">-</span> - <input type="text" name="<?php echo $_code ?>[to]" value="<?php echo $this->escapeHtml($this->getAttributeValue($_attribute, 'to')) ?>" id="<?php echo $_code ?>_to" title="<?php echo $this->escapeHtml($this->getAttributeLabel($_attribute)) ?>" class="input-text validate-number" /> + <input type="text" name="<?php echo $_code ?>[to]" value="<?php echo $this->escapeHtml($this->getAttributeValue($_attribute, 'to')) ?>" id="<?php echo $_code ?>_to" title="<?php echo $this->escapeHtml($this->getAttributeLabel($_attribute)) ?>" class="input-text validate-number" maxlength="<?php echo $maxQueryLength;?>" /> </div> <?php break; case 'price': ?> <div class="input-range"> - <input name="<?php echo $_code ?>[from]" value="<?php echo $this->escapeHtml($this->getAttributeValue($_attribute, 'from')) ?>" id="<?php echo $_code ?>" title="<?php echo $this->escapeHtml($this->getAttributeLabel($_attribute)) ?>" class="input-text validate-number" type="text" /> + <input name="<?php echo $_code ?>[from]" value="<?php echo $this->escapeHtml($this->getAttributeValue($_attribute, 'from')) ?>" id="<?php echo $_code ?>" title="<?php echo $this->escapeHtml($this->getAttributeLabel($_attribute)) ?>" class="input-text validate-number" type="text" maxlength="<?php echo $maxQueryLength;?>" /> <span class="separator">-</span> - <input name="<?php echo $_code ?>[to]" value="<?php echo $this->escapeHtml($this->getAttributeValue($_attribute, 'to')) ?>" id="<?php echo $_code ?>_to" title="<?php echo $this->escapeHtml($this->getAttributeLabel($_attribute)) ?>" class="input-text validate-number" type="text" /> + <input name="<?php echo $_code ?>[to]" value="<?php echo $this->escapeHtml($this->getAttributeValue($_attribute, 'to')) ?>" id="<?php echo $_code ?>_to" title="<?php echo $this->escapeHtml($this->getAttributeLabel($_attribute)) ?>" class="input-text validate-number" type="text" maxlength="<?php echo $maxQueryLength;?>" /> <small>(<?php echo $this->getCurrency($_attribute); ?>)</small> </div> <?php break; @@ -76,7 +77,7 @@ <?php break; default: ?> <div class="input-box"> - <input type="text" name="<?php echo $_code ?>" id="<?php echo $_code ?>" value="<?php echo $this->escapeHtml($this->getAttributeValue($_attribute)) ?>" title="<?php echo $this->escapeHtml($this->getAttributeLabel($_attribute)) ?>" class="input-text <?php echo $this->getAttributeValidationClass($_attribute) ?>" /> + <input type="text" name="<?php echo $_code ?>" id="<?php echo $_code ?>" value="<?php echo $this->escapeHtml($this->getAttributeValue($_attribute)) ?>" title="<?php echo $this->escapeHtml($this->getAttributeLabel($_attribute)) ?>" class="input-text <?php echo $this->getAttributeValidationClass($_attribute) ?>" maxlength="<?php echo $maxQueryLength;?>" /> </div> <?php endswitch; ?> </li> diff --git a/app/code/core/Mage/CatalogSearch/view/frontend/advanced/result.phtml b/app/code/core/Mage/CatalogSearch/view/frontend/advanced/result.phtml index 2c084b73f1a0416501c9be1bc69c4b5f5b084206..d8b08028640b0be28b9e3ac73b82ed9db168fb8e 100644 --- a/app/code/core/Mage/CatalogSearch/view/frontend/advanced/result.phtml +++ b/app/code/core/Mage/CatalogSearch/view/frontend/advanced/result.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/CatalogSearch/view/frontend/form.mini.phtml b/app/code/core/Mage/CatalogSearch/view/frontend/form.mini.phtml index 7aa1d383f99a8f7b2b2d693f0fdeee8a210f7120..55c58d50f7078555a885702016dfca65c1e436bb 100644 --- a/app/code/core/Mage/CatalogSearch/view/frontend/form.mini.phtml +++ b/app/code/core/Mage/CatalogSearch/view/frontend/form.mini.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/CatalogSearch/view/frontend/layout.xml b/app/code/core/Mage/CatalogSearch/view/frontend/layout.xml index 826b331379e4136e722ab0385d62188b8e449b3e..1eeb6d0f8e496b77ce90ed1f76c3ee24f78b1e96 100644 --- a/app/code/core/Mage/CatalogSearch/view/frontend/layout.xml +++ b/app/code/core/Mage/CatalogSearch/view/frontend/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/CatalogSearch/view/frontend/result.phtml b/app/code/core/Mage/CatalogSearch/view/frontend/result.phtml index 99abb41fc109ed5fc4fd8bb585c1a6dfcb5ff57a..07edbd99bb81d8104981cd6120f2b44c15ae65c9 100644 --- a/app/code/core/Mage/CatalogSearch/view/frontend/result.phtml +++ b/app/code/core/Mage/CatalogSearch/view/frontend/result.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/CatalogSearch/view/frontend/term.phtml b/app/code/core/Mage/CatalogSearch/view/frontend/term.phtml index 3724a06b3af24a9423a58be2f67355296138b9ed..311edc6efbba3156ebe0a77002a39043ddf38bd5 100644 --- a/app/code/core/Mage/CatalogSearch/view/frontend/term.phtml +++ b/app/code/core/Mage/CatalogSearch/view/frontend/term.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Centinel/Block/Adminhtml/Validation.php b/app/code/core/Mage/Centinel/Block/Adminhtml/Validation.php index 4979a68fb1b03d0e9b95cab33dc36b25c194d807..eff8637bdc7019a1981d795a859c96028b5d9969 100644 --- a/app/code/core/Mage/Centinel/Block/Adminhtml/Validation.php +++ b/app/code/core/Mage/Centinel/Block/Adminhtml/Validation.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Centinel - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Centinel/Block/Adminhtml/Validation/Form.php b/app/code/core/Mage/Centinel/Block/Adminhtml/Validation/Form.php index a69802a32402aff375cbf8bf1211894a46ba8877..fd8c93b714bb360d5ed6bca5ce3ab639e8857ed3 100644 --- a/app/code/core/Mage/Centinel/Block/Adminhtml/Validation/Form.php +++ b/app/code/core/Mage/Centinel/Block/Adminhtml/Validation/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Centinel - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Centinel/Block/Authentication.php b/app/code/core/Mage/Centinel/Block/Authentication.php index 777190794970b5ec024d438c04e79d5c70b3fd9d..593abb8400160003d83cc8e30786ce94e3c7000a 100644 --- a/app/code/core/Mage/Centinel/Block/Authentication.php +++ b/app/code/core/Mage/Centinel/Block/Authentication.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Centinel - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Centinel/Block/Authentication/Complete.php b/app/code/core/Mage/Centinel/Block/Authentication/Complete.php index 0304134ac43137e22f825a71a10ecd421691906f..df9fac2aec2a32fbc8d9f1dea42e58dd1e37d581 100644 --- a/app/code/core/Mage/Centinel/Block/Authentication/Complete.php +++ b/app/code/core/Mage/Centinel/Block/Authentication/Complete.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Centinel - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Centinel/Block/Authentication/Start.php b/app/code/core/Mage/Centinel/Block/Authentication/Start.php index 6d44192db738b0bce6d7e226964aa2e9b1fb5547..56114b7a0fb6de34558c0050cc596fa011e44a69 100644 --- a/app/code/core/Mage/Centinel/Block/Authentication/Start.php +++ b/app/code/core/Mage/Centinel/Block/Authentication/Start.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Centinel - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Centinel/Block/Logo.php b/app/code/core/Mage/Centinel/Block/Logo.php index 336015af8d7d9ba6f00182484cae27c3c4d92d8d..4b9ca69a4697012e28a010d89159db2b4d6adb28 100644 --- a/app/code/core/Mage/Centinel/Block/Logo.php +++ b/app/code/core/Mage/Centinel/Block/Logo.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Centinel - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Centinel/Helper/Data.php b/app/code/core/Mage/Centinel/Helper/Data.php index ae2b58cd1b2c476eef654abb823a4af95cc8f4e0..8bdc60494ff27b5744b7bfcda29204da3b9fdcd9 100644 --- a/app/code/core/Mage/Centinel/Helper/Data.php +++ b/app/code/core/Mage/Centinel/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Centinel - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Centinel/Model/Api.php b/app/code/core/Mage/Centinel/Model/Api.php index 09ec79f48cd19c1d038e649ee3963ff7513735d5..4a179ca38080eacfe7ff1edb80359a0610051d6b 100644 --- a/app/code/core/Mage/Centinel/Model/Api.php +++ b/app/code/core/Mage/Centinel/Model/Api.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Centinel - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Centinel/Model/Config.php b/app/code/core/Mage/Centinel/Model/Config.php index 6356deec159c52dd31b471b8d83f05e876704ebc..fdd1b36787cb6d4dda9af54729b087fe53534e0d 100644 --- a/app/code/core/Mage/Centinel/Model/Config.php +++ b/app/code/core/Mage/Centinel/Model/Config.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Centinel - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Centinel/Model/Observer.php b/app/code/core/Mage/Centinel/Model/Observer.php index d5083110c9ac62cf59e0675c90ce06ebcf2b0e27..370b80dccc05c6976ae93fa921528a42b65faaec 100644 --- a/app/code/core/Mage/Centinel/Model/Observer.php +++ b/app/code/core/Mage/Centinel/Model/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Centinel - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Centinel/Model/Service.php b/app/code/core/Mage/Centinel/Model/Service.php index e924959694af427b87a3e1117ef6fd6dae9fc814..ea93cc9b7d73e00973c97f61a77c6c3a78525c31 100644 --- a/app/code/core/Mage/Centinel/Model/Service.php +++ b/app/code/core/Mage/Centinel/Model/Service.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Centinel - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Centinel/Model/Session.php b/app/code/core/Mage/Centinel/Model/Session.php index 59943acfd4883eb924b928b070bda0096d8f54fb..4096e0578728c96e3af692d944a16b5315d9679b 100644 --- a/app/code/core/Mage/Centinel/Model/Session.php +++ b/app/code/core/Mage/Centinel/Model/Session.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Centinel - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Centinel/Model/State/Jcb.php b/app/code/core/Mage/Centinel/Model/State/Jcb.php index 0a81840d91ad612a72daee69f187bb839bc2267e..45fb5f967786eb40b46bd2f0ac2bc9fee5268154 100644 --- a/app/code/core/Mage/Centinel/Model/State/Jcb.php +++ b/app/code/core/Mage/Centinel/Model/State/Jcb.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Centinel - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Centinel/Model/State/Mastercard.php b/app/code/core/Mage/Centinel/Model/State/Mastercard.php index a2a6f5a75ee8d5b56e21ab7be14e9c2bd2c0559d..b6a586b9e6c3c8f47b365f82078e14d15d203207 100644 --- a/app/code/core/Mage/Centinel/Model/State/Mastercard.php +++ b/app/code/core/Mage/Centinel/Model/State/Mastercard.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Centinel - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Centinel/Model/State/Visa.php b/app/code/core/Mage/Centinel/Model/State/Visa.php index e4f2b51a0d1b10842c9cc3d7f9e2afbff4762337..080235c3405796363c8106923201f8b4db175d2b 100644 --- a/app/code/core/Mage/Centinel/Model/State/Visa.php +++ b/app/code/core/Mage/Centinel/Model/State/Visa.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Centinel - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Centinel/Model/StateAbstract.php b/app/code/core/Mage/Centinel/Model/StateAbstract.php index b235b128d310a014a629a0237c2ed38947dcfea5..7da0655174d4f5244c12b8d8e595ffaa98e4fed7 100644 --- a/app/code/core/Mage/Centinel/Model/StateAbstract.php +++ b/app/code/core/Mage/Centinel/Model/StateAbstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Centinel - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Centinel/controllers/Adminhtml/Centinel/IndexController.php b/app/code/core/Mage/Centinel/controllers/Adminhtml/Centinel/IndexController.php index ba9915431c6d4ef078632f8b63e628d5c48d4efd..fbd33369be37a4cf0b9465eb48ec3aae3e9729ca 100644 --- a/app/code/core/Mage/Centinel/controllers/Adminhtml/Centinel/IndexController.php +++ b/app/code/core/Mage/Centinel/controllers/Adminhtml/Centinel/IndexController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Centinel - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Centinel/controllers/IndexController.php b/app/code/core/Mage/Centinel/controllers/IndexController.php index 932fab32dfff51fec25fb9af44d7249cd3252448..e624e05c3ebbeff79d111780d3ff6f1bdd248565 100644 --- a/app/code/core/Mage/Centinel/controllers/IndexController.php +++ b/app/code/core/Mage/Centinel/controllers/IndexController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Centinel - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Centinel/etc/config.xml b/app/code/core/Mage/Centinel/etc/config.xml index cccb09ad7fa246c3886a416ff58ce06f2ed09833..42428bcc0a7f6c8d22323ca20f58a90b3def0d44 100644 --- a/app/code/core/Mage/Centinel/etc/config.xml +++ b/app/code/core/Mage/Centinel/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Centinel - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Centinel/etc/system.xml b/app/code/core/Mage/Centinel/etc/system.xml index 9b35ddeb7ed6a3c4b603823bfa96717ed250b4e6..67eec97b25fc023d328d7021bb2524720ea2a765 100644 --- a/app/code/core/Mage/Centinel/etc/system.xml +++ b/app/code/core/Mage/Centinel/etc/system.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Centinel - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Centinel/view/adminhtml/authentication/complete.phtml b/app/code/core/Mage/Centinel/view/adminhtml/authentication/complete.phtml index c7eaa698bc27504bc355fffb960fae3a32859b27..a1d5041761f83089ae9086e9ee13abce4f9e48af 100644 --- a/app/code/core/Mage/Centinel/view/adminhtml/authentication/complete.phtml +++ b/app/code/core/Mage/Centinel/view/adminhtml/authentication/complete.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Centinel/view/adminhtml/authentication/start.phtml b/app/code/core/Mage/Centinel/view/adminhtml/authentication/start.phtml index 7d57ed85cb66879d2a881b9e2c9d56d91097d55a..11b2d86acf974191982932595ea7ce0092dbda83 100644 --- a/app/code/core/Mage/Centinel/view/adminhtml/authentication/start.phtml +++ b/app/code/core/Mage/Centinel/view/adminhtml/authentication/start.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Centinel/view/adminhtml/layout.xml b/app/code/core/Mage/Centinel/view/adminhtml/layout.xml index 68c49300a3d4af6897ba936506a2f84ae3d71286..905bb6d663bb653aae18d85de34df6d5bbeabb18 100644 --- a/app/code/core/Mage/Centinel/view/adminhtml/layout.xml +++ b/app/code/core/Mage/Centinel/view/adminhtml/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/Centinel/view/adminhtml/order_create.js b/app/code/core/Mage/Centinel/view/adminhtml/order_create.js index bcd9d4149a6140bdb22c2408f4719a5c90162e0c..2af500a14583a2f093ed8c5689a6c3214fae045f 100644 --- a/app/code/core/Mage/Centinel/view/adminhtml/order_create.js +++ b/app/code/core/Mage/Centinel/view/adminhtml/order_create.js @@ -19,7 +19,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ var centinelValidator = new Class.create(); diff --git a/app/code/core/Mage/Centinel/view/adminhtml/validation/form.phtml b/app/code/core/Mage/Centinel/view/adminhtml/validation/form.phtml index f572a48bf453a5cd3e82ad87241c2c9012bd7230..afa509dd3fa817286cbf1e70e2c33e7143d5f119 100644 --- a/app/code/core/Mage/Centinel/view/adminhtml/validation/form.phtml +++ b/app/code/core/Mage/Centinel/view/adminhtml/validation/form.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -29,7 +29,7 @@ <iframe frameborder="0" border="0" id="<?php echo $this->getContainerId() ?>" src="" style="display:none;"></iframe> </div> </div> -<button onclick="cardValidator.validate()" class="scalable" type="button"><span><?php echo $this->__('Start/Reset Validation...')?></span></button> +<button onclick="cardValidator.validate()" class="scalable" type="button"><span><span><span><?php echo $this->__('Start/Reset Validation...')?></span></span></span></button> <script type="text/javascript"> //<![CDATA[ cardValidator = new centinelValidator('<?php echo $this->getMethodCode() ?>', '<?php echo $this->getFrameUrl() ?>', '<?php echo $this->getContainerId() ?>'); diff --git a/app/code/core/Mage/Centinel/view/frontend/authentication.phtml b/app/code/core/Mage/Centinel/view/frontend/authentication.phtml index f66a742dbff83ffef8fe7e3b14c2b65184f17204..7b2bd6b98f38287ad250560f75036c90663d041e 100644 --- a/app/code/core/Mage/Centinel/view/frontend/authentication.phtml +++ b/app/code/core/Mage/Centinel/view/frontend/authentication.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Centinel/view/frontend/authentication/complete.phtml b/app/code/core/Mage/Centinel/view/frontend/authentication/complete.phtml index 06cabc1dc7ad4e500ef27bafdfd427e0c18f0874..db7c893b5ddeaf82baa790efd4158d81f13563f8 100644 --- a/app/code/core/Mage/Centinel/view/frontend/authentication/complete.phtml +++ b/app/code/core/Mage/Centinel/view/frontend/authentication/complete.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Centinel/view/frontend/authentication/start.phtml b/app/code/core/Mage/Centinel/view/frontend/authentication/start.phtml index 61621921c0da299a49208f7385294eaaf9ed8c7a..9984105850806b6feb64581f07978d8d8252c014 100644 --- a/app/code/core/Mage/Centinel/view/frontend/authentication/start.phtml +++ b/app/code/core/Mage/Centinel/view/frontend/authentication/start.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Centinel/view/frontend/checkout.js b/app/code/core/Mage/Centinel/view/frontend/checkout.js index 8fcd5802a97e59cdb23fc23dba7d4415f2f27460..4ad90f2fdbc9f071da5951cb944441c9dd693ad0 100644 --- a/app/code/core/Mage/Centinel/view/frontend/checkout.js +++ b/app/code/core/Mage/Centinel/view/frontend/checkout.js @@ -19,7 +19,7 @@ * * @category Mage * @package js - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ var CentinelAuthenticate = Class.create(); diff --git a/app/code/core/Mage/Centinel/view/frontend/layout.xml b/app/code/core/Mage/Centinel/view/frontend/layout.xml index 895722a79a00d796c0e770227228c58233a9152c..17520b97b1998726d6499f87e108f58e9c1df93a 100644 --- a/app/code/core/Mage/Centinel/view/frontend/layout.xml +++ b/app/code/core/Mage/Centinel/view/frontend/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/Centinel/view/frontend/logo.phtml b/app/code/core/Mage/Centinel/view/frontend/logo.phtml index 1f3380574ae6e711854951d9166ede435d309961..4533d21288df661972cc3c83dfbf1c482919ac65 100644 --- a/app/code/core/Mage/Centinel/view/frontend/logo.phtml +++ b/app/code/core/Mage/Centinel/view/frontend/logo.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Checkout/Block/Agreements.php b/app/code/core/Mage/Checkout/Block/Agreements.php index ca7fb40e88076b647eaa4d75513f678af47d8c43..7fb1e0d35ca85e566fe9dd224417204945185302 100644 --- a/app/code/core/Mage/Checkout/Block/Agreements.php +++ b/app/code/core/Mage/Checkout/Block/Agreements.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Checkout_Block_Agreements extends Mage_Core_Block_Template diff --git a/app/code/core/Mage/Checkout/Block/Cart.php b/app/code/core/Mage/Checkout/Block/Cart.php index b7bbcec70b42980e3087f0c5b9b19fe7438261ba..037884f8f6e8ad5f1a106e2eeac09513341fee4c 100644 --- a/app/code/core/Mage/Checkout/Block/Cart.php +++ b/app/code/core/Mage/Checkout/Block/Cart.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Block/Cart/Abstract.php b/app/code/core/Mage/Checkout/Block/Cart/Abstract.php index 9199eb5249604b5f055a3a0e969b3b96f8968c7e..8bec7383196010c37148c402fd9e21e0cefde123 100644 --- a/app/code/core/Mage/Checkout/Block/Cart/Abstract.php +++ b/app/code/core/Mage/Checkout/Block/Cart/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Block/Cart/Coupon.php b/app/code/core/Mage/Checkout/Block/Cart/Coupon.php index 917c9c0c704e9c77083630f935d48c4ba2169f5f..565421bf36a6b98604dad1c9f8694033ba4d3235 100644 --- a/app/code/core/Mage/Checkout/Block/Cart/Coupon.php +++ b/app/code/core/Mage/Checkout/Block/Cart/Coupon.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Block/Cart/Crosssell.php b/app/code/core/Mage/Checkout/Block/Cart/Crosssell.php index ba1d85dce229212ad01c284a062496a91278aa3f..68dbb1da1f04cca1f346ef809ba7b64278ff8c7e 100644 --- a/app/code/core/Mage/Checkout/Block/Cart/Crosssell.php +++ b/app/code/core/Mage/Checkout/Block/Cart/Crosssell.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Block/Cart/Item/Configure.php b/app/code/core/Mage/Checkout/Block/Cart/Item/Configure.php index 4fb4fe0eb044c548e410ae0f93ed2e0ccd7b99f3..014b1a94d4750312c9aa0ada3e5fd1adde3293fc 100644 --- a/app/code/core/Mage/Checkout/Block/Cart/Item/Configure.php +++ b/app/code/core/Mage/Checkout/Block/Cart/Item/Configure.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Block/Cart/Item/Renderer.php b/app/code/core/Mage/Checkout/Block/Cart/Item/Renderer.php index d23b958e73b7ba64a5bdc6000168b79b56d5ad01..426c7d5063f96f57a2ded16fc293aae32a824a7c 100644 --- a/app/code/core/Mage/Checkout/Block/Cart/Item/Renderer.php +++ b/app/code/core/Mage/Checkout/Block/Cart/Item/Renderer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -30,6 +30,9 @@ * @category Mage * @package Mage_Checkout * @author Magento Core Team <core@magentocommerce.com> + * + * @method Mage_Checkout_Block_Cart_Item_Renderer setProductName(string) + * @method Mage_Checkout_Block_Cart_Item_Renderer setDeleteUrl(string) */ class Mage_Checkout_Block_Cart_Item_Renderer extends Mage_Core_Block_Template { @@ -200,6 +203,9 @@ class Mage_Checkout_Block_Cart_Item_Renderer extends Mage_Core_Block_Template */ public function getProductName() { + if ($this->hasProductName()) { + return $this->getData('product_name'); + } return $this->getProduct()->getName(); } @@ -245,7 +251,10 @@ class Mage_Checkout_Block_Cart_Item_Renderer extends Mage_Core_Block_Template */ public function getDeleteUrl() { - $encodedUrl = $this->helper('Mage_Core_Helper_Url')->getEncodedUrl(); + if ($this->hasDeleteUrl()) { + return $this->getData('delete_url'); + } + return $this->getUrl( 'checkout/cart/delete', array( diff --git a/app/code/core/Mage/Checkout/Block/Cart/Item/Renderer/Configurable.php b/app/code/core/Mage/Checkout/Block/Cart/Item/Renderer/Configurable.php index 9b0fde4150855bbef858650e14c9b2b8a2a44bd1..075e730ab95bf2544b648a7b948e86595dd1a100 100644 --- a/app/code/core/Mage/Checkout/Block/Cart/Item/Renderer/Configurable.php +++ b/app/code/core/Mage/Checkout/Block/Cart/Item/Renderer/Configurable.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Block/Cart/Item/Renderer/Grouped.php b/app/code/core/Mage/Checkout/Block/Cart/Item/Renderer/Grouped.php index 436ccc32e9d32b7484d37652d9a18c1bf9065a5c..15cfa1299abda2667ce686e708bb2e18b6e513cf 100644 --- a/app/code/core/Mage/Checkout/Block/Cart/Item/Renderer/Grouped.php +++ b/app/code/core/Mage/Checkout/Block/Cart/Item/Renderer/Grouped.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Block/Cart/Shipping.php b/app/code/core/Mage/Checkout/Block/Cart/Shipping.php index 2632a84629ff065cbb0e2ab187479b6ec81ec469..c546a428ff169ecfd41eb5f9b93214c8d401f535 100644 --- a/app/code/core/Mage/Checkout/Block/Cart/Shipping.php +++ b/app/code/core/Mage/Checkout/Block/Cart/Shipping.php @@ -20,17 +20,37 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Checkout_Block_Cart_Shipping extends Mage_Checkout_Block_Cart_Abstract { + /** + * Available Carriers Instances + * @var null|array + */ protected $_carriers = null; + + /** + * Estimate Rates + * @var array + */ protected $_rates = array(); + + /** + * Address Model + * + * @var array + */ protected $_address = array(); + /** + * Get Estimate Rates + * + * @return array + */ public function getEstimateRates() { if (empty($this->_rates)) { @@ -41,7 +61,7 @@ class Mage_Checkout_Block_Cart_Shipping extends Mage_Checkout_Block_Cart_Abstrac } /** - * Get address model + * Get Address Model * * @return Mage_Sales_Model_Quote_Address */ @@ -53,6 +73,12 @@ class Mage_Checkout_Block_Cart_Shipping extends Mage_Checkout_Block_Cart_Abstrac return $this->_address; } + /** + * Get Carrier Name + * + * @param string $carrierCode + * @return mixed + */ public function getCarrierName($carrierCode) { if ($name = Mage::getStoreConfig('carriers/'.$carrierCode.'/title')) { @@ -61,51 +87,107 @@ class Mage_Checkout_Block_Cart_Shipping extends Mage_Checkout_Block_Cart_Abstrac return $carrierCode; } + /** + * Get Shipping Method + * + * @return string + */ public function getAddressShippingMethod() { return $this->getAddress()->getShippingMethod(); } + /** + * Get Estimate Country Id + * + * @return string + */ public function getEstimateCountryId() { return $this->getAddress()->getCountryId(); } + /** + * Get Estimate Postcode + * + * @return string + */ public function getEstimatePostcode() { return $this->getAddress()->getPostcode(); } + /** + * Get Estimate City + * + * @return string + */ public function getEstimateCity() { return $this->getAddress()->getCity(); } + /** + * Get Estimate Region Id + * + * @return mixed + */ public function getEstimateRegionId() { return $this->getAddress()->getRegionId(); } + /** + * Get Estimate Region + * + * @return string + */ public function getEstimateRegion() { return $this->getAddress()->getRegion(); } + /** + * Show City in Shipping Estimation + * + * @return bool + */ public function getCityActive() { - return (bool)Mage::getStoreConfig('carriers/dhl/active'); + return (bool)Mage::getStoreConfig('carriers/dhl/active') + || (bool)Mage::getStoreConfig('carriers/dhlint/active'); } + /** + * Show State in Shipping Estimation + * + * @return bool + */ public function getStateActive() { - return (bool)Mage::getStoreConfig('carriers/dhl/active') || (bool)Mage::getStoreConfig('carriers/tablerate/active'); + return (bool)Mage::getStoreConfig('carriers/dhl/active') + || (bool)Mage::getStoreConfig('carriers/tablerate/active') + || (bool)Mage::getStoreConfig('carriers/dhlint/active'); } + /** + * Convert price from default currency to current currency + * + * @param float $price + * @return float + */ public function formatPrice($price) { return $this->getQuote()->getStore()->convertPrice($price, true); } + /** + * Get Shipping Price + * + * @param float $price + * @param bool $flag + * @return float + */ public function getShippingPrice($price, $flag) { return $this->formatPrice($this->helper('Mage_Tax_Helper_Data')->getShippingPrice( diff --git a/app/code/core/Mage/Checkout/Block/Cart/Sidebar.php b/app/code/core/Mage/Checkout/Block/Cart/Sidebar.php index 36e3904a50e6e8df717d35552321407fd8b90d9e..64062fe85264b1019bb0cfc0f6838c7cd04c9081 100644 --- a/app/code/core/Mage/Checkout/Block/Cart/Sidebar.php +++ b/app/code/core/Mage/Checkout/Block/Cart/Sidebar.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Block/Cart/Totals.php b/app/code/core/Mage/Checkout/Block/Cart/Totals.php index 9e0a7ae40dad5e1f2965afdc013cf84cc504985b..2fd095f817dc58e4fd4a93a0e212c39902615715 100644 --- a/app/code/core/Mage/Checkout/Block/Cart/Totals.php +++ b/app/code/core/Mage/Checkout/Block/Cart/Totals.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Block/Links.php b/app/code/core/Mage/Checkout/Block/Links.php index 74a297fd80c4438149011ea511cd7a82dc1691d8..33ff38290b9f1b2c40d54c0977143d8adc402392 100644 --- a/app/code/core/Mage/Checkout/Block/Links.php +++ b/app/code/core/Mage/Checkout/Block/Links.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Block/Multishipping/Abstract.php b/app/code/core/Mage/Checkout/Block/Multishipping/Abstract.php index 556439328985d81fdc281cafe1d3177912b82778..30376e67685ef549f36fff22304237e61219387a 100644 --- a/app/code/core/Mage/Checkout/Block/Multishipping/Abstract.php +++ b/app/code/core/Mage/Checkout/Block/Multishipping/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Block/Multishipping/Address/Select.php b/app/code/core/Mage/Checkout/Block/Multishipping/Address/Select.php index 976aa00d0b82324da74d6649df285c9b6d70142f..e1257894ec15d322490b00e556d421b25d3569c9 100644 --- a/app/code/core/Mage/Checkout/Block/Multishipping/Address/Select.php +++ b/app/code/core/Mage/Checkout/Block/Multishipping/Address/Select.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Block/Multishipping/Addresses.php b/app/code/core/Mage/Checkout/Block/Multishipping/Addresses.php index 68e982767b527a8e4d1067bd2956c9ccd865eb56..d52e3f538bfac09adaf72f9974bee24056e88f23 100644 --- a/app/code/core/Mage/Checkout/Block/Multishipping/Addresses.php +++ b/app/code/core/Mage/Checkout/Block/Multishipping/Addresses.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Block/Multishipping/Billing.php b/app/code/core/Mage/Checkout/Block/Multishipping/Billing.php index ce56952bf7b0b9a612ca3a89efd5e51b71b64355..770b7e261eef09550ed691e30a6a0d8fd001a6fd 100644 --- a/app/code/core/Mage/Checkout/Block/Multishipping/Billing.php +++ b/app/code/core/Mage/Checkout/Block/Multishipping/Billing.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Block/Multishipping/Billing/Items.php b/app/code/core/Mage/Checkout/Block/Multishipping/Billing/Items.php index 24783172ce6ab1b2923bb21baa8d30ccebd9f043..bae432c8f5b8d82168d88a90f56b559967e12c14 100644 --- a/app/code/core/Mage/Checkout/Block/Multishipping/Billing/Items.php +++ b/app/code/core/Mage/Checkout/Block/Multishipping/Billing/Items.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Block/Multishipping/Link.php b/app/code/core/Mage/Checkout/Block/Multishipping/Link.php index f574bdeb15213f4cdd94ff55600435bbd2d62e4b..ef2db7b371a5f486ae829453961441f8b542f992 100644 --- a/app/code/core/Mage/Checkout/Block/Multishipping/Link.php +++ b/app/code/core/Mage/Checkout/Block/Multishipping/Link.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Block/Multishipping/Overview.php b/app/code/core/Mage/Checkout/Block/Multishipping/Overview.php index 02829df1190c552d6387a9830ffcfd73d4ccb4d4..1539f285208d1cf79ecaf68d544de0e1eff48f15 100644 --- a/app/code/core/Mage/Checkout/Block/Multishipping/Overview.php +++ b/app/code/core/Mage/Checkout/Block/Multishipping/Overview.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Block/Multishipping/Payment/Info.php b/app/code/core/Mage/Checkout/Block/Multishipping/Payment/Info.php index 227598603c7dd9c8abec016f36b7cd76b71b347b..3f63239bf5f367f800d4293b8ea1d644bfe67f06 100644 --- a/app/code/core/Mage/Checkout/Block/Multishipping/Payment/Info.php +++ b/app/code/core/Mage/Checkout/Block/Multishipping/Payment/Info.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Block/Multishipping/Shipping.php b/app/code/core/Mage/Checkout/Block/Multishipping/Shipping.php index d8bb585067d5d847a55390df077e98dcc57484cc..6dac4136ef2afdc1c7c10bf8aa95d82e81a45cf8 100644 --- a/app/code/core/Mage/Checkout/Block/Multishipping/Shipping.php +++ b/app/code/core/Mage/Checkout/Block/Multishipping/Shipping.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Block/Multishipping/State.php b/app/code/core/Mage/Checkout/Block/Multishipping/State.php index ca2d8f8b5df7343d69f34e550719b4286b0f5fe4..d6f0f61597f15579ef022598dea7ed585b85da72 100644 --- a/app/code/core/Mage/Checkout/Block/Multishipping/State.php +++ b/app/code/core/Mage/Checkout/Block/Multishipping/State.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Block/Multishipping/Success.php b/app/code/core/Mage/Checkout/Block/Multishipping/Success.php index 40b70855f598ffac193bfeef00556821c365f636..fb7acabdccedb46f4d76dc49b0e3085c53b74bbd 100644 --- a/app/code/core/Mage/Checkout/Block/Multishipping/Success.php +++ b/app/code/core/Mage/Checkout/Block/Multishipping/Success.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Block/Onepage.php b/app/code/core/Mage/Checkout/Block/Onepage.php index 7df37c495f70c2c28dded025c4d7e52ea953c9de..c6eeb4437a5137769353a54d94f784d2930c515d 100644 --- a/app/code/core/Mage/Checkout/Block/Onepage.php +++ b/app/code/core/Mage/Checkout/Block/Onepage.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -33,19 +33,24 @@ */ class Mage_Checkout_Block_Onepage extends Mage_Checkout_Block_Onepage_Abstract { + /** + * Get 'one step checkout' step data + * + * @return array + */ public function getSteps() { $steps = array(); + $stepCodes = $this->_getStepCodes(); - if (!$this->isCustomerLoggedIn()) { - $steps['login'] = $this->getCheckout()->getStepData('login'); + if ($this->isCustomerLoggedIn()) { + $stepCodes = array_diff($stepCodes, array('login')); } - $stepCodes = array('billing', 'shipping', 'shipping_method', 'payment', 'review'); - foreach ($stepCodes as $step) { $steps[$step] = $this->getCheckout()->getStepData($step); } + return $steps; } diff --git a/app/code/core/Mage/Checkout/Block/Onepage/Abstract.php b/app/code/core/Mage/Checkout/Block/Onepage/Abstract.php index 7c7d8d0021dc6d2ba1ff15916506c9856aa49410..1e33a2ea0c7ea190ee7c92297ffd24a080c2a3e0 100644 --- a/app/code/core/Mage/Checkout/Block/Onepage/Abstract.php +++ b/app/code/core/Mage/Checkout/Block/Onepage/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -200,6 +200,17 @@ abstract class Mage_Checkout_Block_Onepage_Abstract extends Mage_Core_Block_Temp return $options; } + /** + * Get checkout steps codes + * + * @return array + */ + protected function _getStepCodes() + { + return array('login', 'billing', 'shipping', 'shipping_method', 'payment', 'review'); + } + + /** * Retrieve is allow and show block * diff --git a/app/code/core/Mage/Checkout/Block/Onepage/Billing.php b/app/code/core/Mage/Checkout/Block/Onepage/Billing.php index 48ecf3abc208f88813c6ad08d2789a8156c57e23..8c5d2e102a1ed76dbf59e3c7b347b7695a6b614c 100644 --- a/app/code/core/Mage/Checkout/Block/Onepage/Billing.php +++ b/app/code/core/Mage/Checkout/Block/Onepage/Billing.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Block/Onepage/Failure.php b/app/code/core/Mage/Checkout/Block/Onepage/Failure.php index e27246573a4c4904b38ee8514794977c44f7fe99..65600ec343210c0a6646615833fc05eccc5c172c 100644 --- a/app/code/core/Mage/Checkout/Block/Onepage/Failure.php +++ b/app/code/core/Mage/Checkout/Block/Onepage/Failure.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Block/Onepage/Link.php b/app/code/core/Mage/Checkout/Block/Onepage/Link.php index 66c24e04236ac87d9d04eec5f295f042ae515b4d..608ee1e84d6a0dc9d9a27ef3a186f266e2c32ea7 100644 --- a/app/code/core/Mage/Checkout/Block/Onepage/Link.php +++ b/app/code/core/Mage/Checkout/Block/Onepage/Link.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Block/Onepage/Login.php b/app/code/core/Mage/Checkout/Block/Onepage/Login.php index 73c02c7272418ca9b1b6575fcd18ec72619afb75..44af3f8152fdaa31463c4bde858d6c8f0fb419eb 100644 --- a/app/code/core/Mage/Checkout/Block/Onepage/Login.php +++ b/app/code/core/Mage/Checkout/Block/Onepage/Login.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Block/Onepage/Payment.php b/app/code/core/Mage/Checkout/Block/Onepage/Payment.php index 9015ee6b2ae2002b894347c85187a1d57e84c1dd..021a454e076e9271c0472ab54b30ba9b752fe82a 100644 --- a/app/code/core/Mage/Checkout/Block/Onepage/Payment.php +++ b/app/code/core/Mage/Checkout/Block/Onepage/Payment.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Block/Onepage/Payment/Info.php b/app/code/core/Mage/Checkout/Block/Onepage/Payment/Info.php index 7d17eb336f82c05b32311ec3c54a76ef57127ff4..5594171800251b1e31e36c24e467e02c82b8dda1 100644 --- a/app/code/core/Mage/Checkout/Block/Onepage/Payment/Info.php +++ b/app/code/core/Mage/Checkout/Block/Onepage/Payment/Info.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Block/Onepage/Payment/Methods.php b/app/code/core/Mage/Checkout/Block/Onepage/Payment/Methods.php index ecc5b7ecf7f3f53b1f9628303fc418f3b9f161c1..dda4358eb6b24189551a67b8afcca380c1020603 100644 --- a/app/code/core/Mage/Checkout/Block/Onepage/Payment/Methods.php +++ b/app/code/core/Mage/Checkout/Block/Onepage/Payment/Methods.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Block/Onepage/Progress.php b/app/code/core/Mage/Checkout/Block/Onepage/Progress.php index 54d648d33e1c70a4f8de77c874ed98627d4c4b86..f6f7b6872572f9f2ece9623ba93211773447aa53 100644 --- a/app/code/core/Mage/Checkout/Block/Onepage/Progress.php +++ b/app/code/core/Mage/Checkout/Block/Onepage/Progress.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -69,6 +69,30 @@ class Mage_Checkout_Block_Onepage_Progress extends Mage_Checkout_Block_Onepage_A return $this->getChildHtml('payment_info'); } + /** + * Get is step completed. if is set 'toStep' then all steps after him is not completed. + * + * @param string $currentStep + * @see: Mage_Checkout_Block_Onepage_Abstract::_getStepCodes() for allowed values + * @return bool + */ + public function isStepComplete($currentStep) + { + $stepsRevertIndex = array_flip($this->_getStepCodes()); + + $toStep = $this->getRequest()->getParam('toStep'); + + if (empty($toStep) || !isset($stepsRevertIndex[$currentStep])) { + return $this->getCheckout()->getStepData($currentStep, 'complete'); + } + + if ($stepsRevertIndex[$currentStep] > $stepsRevertIndex[$toStep]) { + return false; + } + + return $this->getCheckout()->getStepData($currentStep, 'complete'); + } + /** * Get quote shipping price including tax * @return float diff --git a/app/code/core/Mage/Checkout/Block/Onepage/Review.php b/app/code/core/Mage/Checkout/Block/Onepage/Review.php index 4c54a036b80f5d1278991c32e76d762054486f19..1c01cd32ebc4094b8b1e95460a743bda481cc67f 100644 --- a/app/code/core/Mage/Checkout/Block/Onepage/Review.php +++ b/app/code/core/Mage/Checkout/Block/Onepage/Review.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Block/Onepage/Review/Info.php b/app/code/core/Mage/Checkout/Block/Onepage/Review/Info.php index 7fe200040fe907b86919081da3aebb581f69b5b9..5ebe7ae8f5e84f7124c2a418f6a72dafc747369e 100644 --- a/app/code/core/Mage/Checkout/Block/Onepage/Review/Info.php +++ b/app/code/core/Mage/Checkout/Block/Onepage/Review/Info.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Block/Onepage/Shipping.php b/app/code/core/Mage/Checkout/Block/Onepage/Shipping.php index 5f3be145df9bf2547837a11264fcfeb44c215275..e54fa416b4d390182b97c5713ed14dd2965d3767 100644 --- a/app/code/core/Mage/Checkout/Block/Onepage/Shipping.php +++ b/app/code/core/Mage/Checkout/Block/Onepage/Shipping.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Block/Onepage/Shipping/Method.php b/app/code/core/Mage/Checkout/Block/Onepage/Shipping/Method.php index 8248ebd70bf8b3ed52abad664435e2cfcc1308af..f08b6a289dbb67b9bb6588d83d023de14c3c463c 100644 --- a/app/code/core/Mage/Checkout/Block/Onepage/Shipping/Method.php +++ b/app/code/core/Mage/Checkout/Block/Onepage/Shipping/Method.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Block/Onepage/Shipping/Method/Additional.php b/app/code/core/Mage/Checkout/Block/Onepage/Shipping/Method/Additional.php index f72c20bea1129d68f16495d475819cc3c6a21d97..a1743fa5ecf3355227c0438e72240ba77d925442 100644 --- a/app/code/core/Mage/Checkout/Block/Onepage/Shipping/Method/Additional.php +++ b/app/code/core/Mage/Checkout/Block/Onepage/Shipping/Method/Additional.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Block/Onepage/Shipping/Method/Available.php b/app/code/core/Mage/Checkout/Block/Onepage/Shipping/Method/Available.php index 1d33eed05c04d607f6f8c3e095b46536272a4908..61f24ae622557a968a01e566757149864c3ff77a 100644 --- a/app/code/core/Mage/Checkout/Block/Onepage/Shipping/Method/Available.php +++ b/app/code/core/Mage/Checkout/Block/Onepage/Shipping/Method/Available.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Block/Onepage/Success.php b/app/code/core/Mage/Checkout/Block/Onepage/Success.php index 9c552ca7c95326dcab6d8ea689f92c0a3c148b50..57a30825a439a66cb3653dd6481bb8b6a14913c3 100644 --- a/app/code/core/Mage/Checkout/Block/Onepage/Success.php +++ b/app/code/core/Mage/Checkout/Block/Onepage/Success.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Block/Success.php b/app/code/core/Mage/Checkout/Block/Success.php index 0971299b282c3c9c8c205f78a89fb2cd4c48d24a..1470638cfba7b1c82d5b815e5dcb8af854dc9d4a 100644 --- a/app/code/core/Mage/Checkout/Block/Success.php +++ b/app/code/core/Mage/Checkout/Block/Success.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Block/Total/Default.php b/app/code/core/Mage/Checkout/Block/Total/Default.php index 3046ab9cd2a6534ab1cc7b0525ea068811f96739..8bcf56fae2d25de058b02cf86dcc8563b647ce08 100644 --- a/app/code/core/Mage/Checkout/Block/Total/Default.php +++ b/app/code/core/Mage/Checkout/Block/Total/Default.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Block/Total/Nominal.php b/app/code/core/Mage/Checkout/Block/Total/Nominal.php index fe45674214c4dba6acf7430b69e0b68764ffebac..35d085e59839c7f043360282bc92e2b6799c913a 100644 --- a/app/code/core/Mage/Checkout/Block/Total/Nominal.php +++ b/app/code/core/Mage/Checkout/Block/Total/Nominal.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Block/Total/Tax.php b/app/code/core/Mage/Checkout/Block/Total/Tax.php index a24afc68f587d6a63fc4402c5b101e6ddc95a57d..96ad047255fbdaccc32497e7d88eba1b686f3c54 100644 --- a/app/code/core/Mage/Checkout/Block/Total/Tax.php +++ b/app/code/core/Mage/Checkout/Block/Total/Tax.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Controller/Action.php b/app/code/core/Mage/Checkout/Controller/Action.php index 29e4713cea4252c0884fbc0fec14f9ea170e5091..244a8f298c5fce0493662939fd55c771e78b404e 100644 --- a/app/code/core/Mage/Checkout/Controller/Action.php +++ b/app/code/core/Mage/Checkout/Controller/Action.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Exception.php b/app/code/core/Mage/Checkout/Exception.php index e0109ff8146f1f7b49f9b9fb725381517480dfc4..478bc5c97c6c19dac4cc7c10b534e0c036ac3f92 100644 --- a/app/code/core/Mage/Checkout/Exception.php +++ b/app/code/core/Mage/Checkout/Exception.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Helper/Cart.php b/app/code/core/Mage/Checkout/Helper/Cart.php index 09c45b4d95362e5a03820abf8258bf36ada9b432..98827b7c4aa782705689b0e5636c6c55d3fa3b25 100644 --- a/app/code/core/Mage/Checkout/Helper/Cart.php +++ b/app/code/core/Mage/Checkout/Helper/Cart.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Helper/Data.php b/app/code/core/Mage/Checkout/Helper/Data.php index 80e090b53d939b8153dbf8bc82b1e9a5e07860ad..896b85656642ac09ff01990d3d042f2473e9860f 100644 --- a/app/code/core/Mage/Checkout/Helper/Data.php +++ b/app/code/core/Mage/Checkout/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Helper/Url.php b/app/code/core/Mage/Checkout/Helper/Url.php index a85d45fc1e16fd4045b6581397f583002cbb2c79..0499e68a4239b11cbc3b257e690867e79e691445 100644 --- a/app/code/core/Mage/Checkout/Helper/Url.php +++ b/app/code/core/Mage/Checkout/Helper/Url.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Model/Agreement.php b/app/code/core/Mage/Checkout/Model/Agreement.php index 6886c1575ee0e7071f36c18abc2ab18cec002ba6..2ad7d68cc8ba1383c505793b1226e6ac31612fdd 100644 --- a/app/code/core/Mage/Checkout/Model/Agreement.php +++ b/app/code/core/Mage/Checkout/Model/Agreement.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Model/Api/Resource.php b/app/code/core/Mage/Checkout/Model/Api/Resource.php index 14a4680f24e182b6e8d2f689093f35e139bd46b6..60a11a254e8016cf260574f584a767019818b2b7 100644 --- a/app/code/core/Mage/Checkout/Model/Api/Resource.php +++ b/app/code/core/Mage/Checkout/Model/Api/Resource.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Model/Api/Resource/Customer.php b/app/code/core/Mage/Checkout/Model/Api/Resource/Customer.php index 6c342e73e6c8e7cd7f44763d7fd3fb0ac8d7b95e..1280cad5e69955384cdcbfe3c81ebb48ae498fd3 100644 --- a/app/code/core/Mage/Checkout/Model/Api/Resource/Customer.php +++ b/app/code/core/Mage/Checkout/Model/Api/Resource/Customer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Model/Api/Resource/Product.php b/app/code/core/Mage/Checkout/Model/Api/Resource/Product.php index ef20a7af59d9760d61e4ee13edb5f838ba3e80c8..da8d6b6379d1f7289c955f57ca3a16e4e10b58d2 100644 --- a/app/code/core/Mage/Checkout/Model/Api/Resource/Product.php +++ b/app/code/core/Mage/Checkout/Model/Api/Resource/Product.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Model/Cart.php b/app/code/core/Mage/Checkout/Model/Cart.php index ac6887a4a1dd5dd54f11ba677334a7be8d83f74f..bb5d4502602ab2e703c82832caa650e78352a546 100644 --- a/app/code/core/Mage/Checkout/Model/Cart.php +++ b/app/code/core/Mage/Checkout/Model/Cart.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -31,7 +31,7 @@ * @package Mage_Checkout * @author Magento Core Team <core@magentocommerce.com> */ -class Mage_Checkout_Model_Cart extends Varien_Object +class Mage_Checkout_Model_Cart extends Varien_Object implements Mage_Checkout_Model_Cart_Interface { protected $_summaryQty = null; protected $_productIds = null; @@ -55,7 +55,7 @@ class Mage_Checkout_Model_Cart extends Varien_Object } /** - * Retrieve custome session model + * Retrieve customer session model * * @return Mage_Customer_Model_Customer */ @@ -103,6 +103,18 @@ class Mage_Checkout_Model_Cart extends Varien_Object return $this->_getData('quote'); } + /** + * Set quote object associated with the cart + * + * @param Mage_Sales_Model_Quote $quote + * @return Mage_Checkout_Model_Cart + */ + public function setQuote(Mage_Sales_Model_Quote $quote) + { + $this->setData('quote', $quote); + return $this; + } + /** * Initialize cart quote state to be able use it on cart page */ @@ -430,17 +442,29 @@ class Mage_Checkout_Model_Cart extends Varien_Object $this->getQuote()->save(); $this->getCheckoutSession()->setQuoteId($this->getQuote()->getId()); /** - * Cart save usually called after chenges with cart items. + * Cart save usually called after changes with cart items. */ Mage::dispatchEvent('checkout_cart_save_after', array('cart'=>$this)); return $this; } + /** + * Save cart (implement interface method) + */ + public function saveQuote() + { + $this->save(); + } + + /** + * Mark all quote items as deleted (empty shopping cart) + * + * @return Mage_Checkout_Model_Cart + */ public function truncate() { - foreach ($this->getQuote()->getItemsCollection() as $item) { - $item->isDeleted(true); - } + $this->getQuote()->removeAllItems(); + return $this; } public function getProductIds() diff --git a/app/code/core/Mage/Checkout/Model/Cart/Api.php b/app/code/core/Mage/Checkout/Model/Cart/Api.php index f500331532349d8b245655bf5f44060ae9d85c03..dd9cd975ac1e4d83c27034e3fbaad48808e8ee18 100644 --- a/app/code/core/Mage/Checkout/Model/Cart/Api.php +++ b/app/code/core/Mage/Checkout/Model/Cart/Api.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Model/Cart/Api/V2.php b/app/code/core/Mage/Checkout/Model/Cart/Api/V2.php index 74b3e829eba7d87184e95fbdba91d89c895a3949..e2a2f62a20f9e36bc24890a84f14e52c588db904 100644 --- a/app/code/core/Mage/Checkout/Model/Cart/Api/V2.php +++ b/app/code/core/Mage/Checkout/Model/Cart/Api/V2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Model/Cart/Coupon/Api.php b/app/code/core/Mage/Checkout/Model/Cart/Coupon/Api.php index 6aad5b9051f4e79819d25ee4b7d489f35e924436..07bc847013f4c449c461d38d32dddc9ae01eadc9 100644 --- a/app/code/core/Mage/Checkout/Model/Cart/Coupon/Api.php +++ b/app/code/core/Mage/Checkout/Model/Cart/Coupon/Api.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Model/Cart/Coupon/Api/V2.php b/app/code/core/Mage/Checkout/Model/Cart/Coupon/Api/V2.php index 979e5216197bc5461e6d7aa44d989fc5ab87d200..2e4d0632bb9478c6f50ce7a358d9e2c3c3c2c708 100644 --- a/app/code/core/Mage/Checkout/Model/Cart/Coupon/Api/V2.php +++ b/app/code/core/Mage/Checkout/Model/Cart/Coupon/Api/V2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Model/Cart/Customer/Api.php b/app/code/core/Mage/Checkout/Model/Cart/Customer/Api.php index 13555c3bb7b33e5224afcb1e72aca1025ca557e9..3cefdbb84c266d5a71e519d7302771bcdb9d0ee6 100644 --- a/app/code/core/Mage/Checkout/Model/Cart/Customer/Api.php +++ b/app/code/core/Mage/Checkout/Model/Cart/Customer/Api.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Model/Cart/Customer/Api/V2.php b/app/code/core/Mage/Checkout/Model/Cart/Customer/Api/V2.php index d53eccf02fd98829c29c14ffdea9f8b2121efb5a..9c01745370106459a1f744b15a1360f6167a8e10 100644 --- a/app/code/core/Mage/Checkout/Model/Cart/Customer/Api/V2.php +++ b/app/code/core/Mage/Checkout/Model/Cart/Customer/Api/V2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Model/Cart/Interface.php b/app/code/core/Mage/Checkout/Model/Cart/Interface.php new file mode 100644 index 0000000000000000000000000000000000000000..12950afa9f0cab70b785006e1ec39603200b677e --- /dev/null +++ b/app/code/core/Mage/Checkout/Model/Cart/Interface.php @@ -0,0 +1,69 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Checkout + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Shopping cart interface + * + * @category Mage + * @package Mage_Checkout + * @author Magento Core Team <core@magentocommerce.com> + */ + +interface Mage_Checkout_Model_Cart_Interface +{ + /** + * Add product to shopping cart (quote) + * + * @param int|Mage_Catalog_Model_Product $productInfo + * @param mixed $requestInfo + * @return Mage_Checkout_Model_Cart_Interface + */ + public function addProduct($productInfo, $requestInfo = null); + + /** + * Save cart + * + * @abstract + * @return Mage_Checkout_Model_Cart_Interface + */ + public function saveQuote(); + + /** + * Associate quote with the cart + * + * @abstract + * @param $quote Mage_Sales_Model_Quote + * @return Mage_Checkout_Model_Cart_Interface + */ + public function setQuote(Mage_Sales_Model_Quote $quote); + + /** + * Get quote object associated with cart + * @abstract + * @return Mage_Sales_Model_Quote + */ + public function getQuote(); +} diff --git a/app/code/core/Mage/Checkout/Model/Cart/Payment/Api.php b/app/code/core/Mage/Checkout/Model/Cart/Payment/Api.php index 3d336f72dc72154f9cc8789dcc9fc7da1b23bda7..cd27f9e88667465d04dd2ad01857d22c9483ebcf 100644 --- a/app/code/core/Mage/Checkout/Model/Cart/Payment/Api.php +++ b/app/code/core/Mage/Checkout/Model/Cart/Payment/Api.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Model/Cart/Payment/Api/V2.php b/app/code/core/Mage/Checkout/Model/Cart/Payment/Api/V2.php index b2bc69e6bc93858026628f6f5969e421f87dd262..535d0656435993728983d76b28a78ea3954254a7 100644 --- a/app/code/core/Mage/Checkout/Model/Cart/Payment/Api/V2.php +++ b/app/code/core/Mage/Checkout/Model/Cart/Payment/Api/V2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Model/Cart/Product/Api.php b/app/code/core/Mage/Checkout/Model/Cart/Product/Api.php index b5b970cec13186325ebe0ad277989b1a2731a0aa..a2afb1c1ab30dea61c929d5781e5fa284b292bd3 100644 --- a/app/code/core/Mage/Checkout/Model/Cart/Product/Api.php +++ b/app/code/core/Mage/Checkout/Model/Cart/Product/Api.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Model/Cart/Product/Api/V2.php b/app/code/core/Mage/Checkout/Model/Cart/Product/Api/V2.php index f3868150185c2ed4cde8f4b0cdebb70c1e0ccd6a..691211f6d976adfcb29d99fb21f4f8020642d4c6 100644 --- a/app/code/core/Mage/Checkout/Model/Cart/Product/Api/V2.php +++ b/app/code/core/Mage/Checkout/Model/Cart/Product/Api/V2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Model/Cart/Shipping/Api.php b/app/code/core/Mage/Checkout/Model/Cart/Shipping/Api.php index a9126b458e8a28801bbaa90cdc402e7665366493..a1d6a828af33f10e83cde3557d8397968fb2ae1a 100644 --- a/app/code/core/Mage/Checkout/Model/Cart/Shipping/Api.php +++ b/app/code/core/Mage/Checkout/Model/Cart/Shipping/Api.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Model/Cart/Shipping/Api/V2.php b/app/code/core/Mage/Checkout/Model/Cart/Shipping/Api/V2.php index e3c5a55628ec4a0fd973e4168425a50cda960a1f..8b715950190777991cc1ec993722a91ad8daa8c1 100644 --- a/app/code/core/Mage/Checkout/Model/Cart/Shipping/Api/V2.php +++ b/app/code/core/Mage/Checkout/Model/Cart/Shipping/Api/V2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Model/Config/Source/Cart/Summary.php b/app/code/core/Mage/Checkout/Model/Config/Source/Cart/Summary.php index e00440b14ebe23c0be361c6dbe49f61ca3534e5e..658a86b573f1c750399ad3f0089f7a880c4b5f4f 100644 --- a/app/code/core/Mage/Checkout/Model/Config/Source/Cart/Summary.php +++ b/app/code/core/Mage/Checkout/Model/Config/Source/Cart/Summary.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Checkout_Model_Config_Source_Cart_Summary diff --git a/app/code/core/Mage/Checkout/Model/Observer.php b/app/code/core/Mage/Checkout/Model/Observer.php index 83d647a87a05e54f6fd5743a3c09fb868e8c9e30..649fadc4c631ce6ed2324773eb1b5e780de415e1 100644 --- a/app/code/core/Mage/Checkout/Model/Observer.php +++ b/app/code/core/Mage/Checkout/Model/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Model/Resource/Agreement.php b/app/code/core/Mage/Checkout/Model/Resource/Agreement.php index a4405d361033f669023e97d22bf8ff51b6f7d05a..0e365acb211f86d482ae33f2285126efc163fcac 100755 --- a/app/code/core/Mage/Checkout/Model/Resource/Agreement.php +++ b/app/code/core/Mage/Checkout/Model/Resource/Agreement.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Model/Resource/Agreement/Collection.php b/app/code/core/Mage/Checkout/Model/Resource/Agreement/Collection.php index 30d3d373006ed85d4970cd7db716c8c698b31a46..3142f129a8b10482eba7f39e16572afb4c73a789 100755 --- a/app/code/core/Mage/Checkout/Model/Resource/Agreement/Collection.php +++ b/app/code/core/Mage/Checkout/Model/Resource/Agreement/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Model/Resource/Cart.php b/app/code/core/Mage/Checkout/Model/Resource/Cart.php index 7690b6ff2413b1452a18f6bc27ffd9149537fd74..8162dc9dd29752ce999eb45447689ae31095bfee 100755 --- a/app/code/core/Mage/Checkout/Model/Resource/Cart.php +++ b/app/code/core/Mage/Checkout/Model/Resource/Cart.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Model/Resource/Setup.php b/app/code/core/Mage/Checkout/Model/Resource/Setup.php index d7f39115bdbdac6d2e6a492477b6aa501c2f81ea..90502145299115edfaec5872e1433fb73c975254 100755 --- a/app/code/core/Mage/Checkout/Model/Resource/Setup.php +++ b/app/code/core/Mage/Checkout/Model/Resource/Setup.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Model/Session.php b/app/code/core/Mage/Checkout/Model/Session.php index e38fa852c98903490ac1b614c6da36239c1ab996..1609f94dd296e086b14f3de77a33f8f5a8bd0245 100644 --- a/app/code/core/Mage/Checkout/Model/Session.php +++ b/app/code/core/Mage/Checkout/Model/Session.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -28,14 +28,20 @@ class Mage_Checkout_Model_Session extends Mage_Core_Model_Session_Abstract { const CHECKOUT_STATE_BEGIN = 'begin'; - protected $_quote = null; + + /** + * Quote instance + * + * @var null|Mage_Sales_Model_Quote + */ + protected $_quote; /** * Customer instance * * @var null|Mage_Customer_Model_Customer */ - protected $_customer = null; + protected $_customer; /** * Whether load only active quote @@ -64,7 +70,7 @@ class Mage_Checkout_Model_Session extends Mage_Core_Model_Session_Abstract /** * Set customer instance * - * @param Mage_Customer_Model_Customer $customer + * @param Mage_Customer_Model_Customer|null $customer * @return Mage_Checkout_Model_Session */ public function setCustomer($customer) @@ -80,7 +86,7 @@ class Mage_Checkout_Model_Session extends Mage_Core_Model_Session_Abstract */ public function hasQuote() { - return !(is_null($this->_quote)); + return isset($this->_quote); } /** @@ -105,10 +111,8 @@ class Mage_Checkout_Model_Session extends Mage_Core_Model_Session_Abstract Mage::dispatchEvent('custom_quote_process', array('checkout_session' => $this)); if ($this->_quote === null) { - $quote = Mage::getModel('Mage_Sales_Model_Quote') - ->setStoreId(Mage::app()->getStore()->getId()); - /** @var $quote Mage_Sales_Model_Quote */ + $quote = Mage::getModel('Mage_Sales_Model_Quote')->setStoreId(Mage::app()->getStore()->getId()); if ($this->getQuoteId()) { if ($this->_loadInactive) { $quote->load($this->getQuoteId()); diff --git a/app/code/core/Mage/Checkout/Model/Type/Abstract.php b/app/code/core/Mage/Checkout/Model/Type/Abstract.php index 396501f2336e9db68c9353da640fef98e14ba059..42c2663cc2650162d6101a6a49361aab3a5e163d 100644 --- a/app/code/core/Mage/Checkout/Model/Type/Abstract.php +++ b/app/code/core/Mage/Checkout/Model/Type/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Model/Type/Multishipping.php b/app/code/core/Mage/Checkout/Model/Type/Multishipping.php index ed197df63421f1607ad02e0a2457e49710dc205d..c40ae2f8dd3a6475f9d3780111fdcba41e67c87f 100644 --- a/app/code/core/Mage/Checkout/Model/Type/Multishipping.php +++ b/app/code/core/Mage/Checkout/Model/Type/Multishipping.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -460,33 +460,32 @@ class Mage_Checkout_Model_Type_Multishipping extends Mage_Checkout_Model_Type_Ab */ protected function _validate() { - $helper = Mage::helper('Mage_Checkout_Helper_Data'); $quote = $this->getQuote(); if (!$quote->getIsMultiShipping()) { - Mage::throwException($helper->__('Invalid checkout type.')); + Mage::throwException(Mage::helper('Mage_Checkout_Helper_Data')->__('Invalid checkout type.')); } /** @var $paymentMethod Mage_Payment_Model_Method_Abstract */ $paymentMethod = $quote->getPayment()->getMethodInstance(); if (!empty($paymentMethod) && !$paymentMethod->isAvailable($quote)) { - Mage::throwException($helper->__('Please specify payment method.')); + Mage::throwException(Mage::helper('Mage_Checkout_Helper_Data')->__('Please specify payment method.')); } $addresses = $quote->getAllShippingAddresses(); foreach ($addresses as $address) { $addressValidation = $address->validate(); if ($addressValidation !== true) { - Mage::throwException($helper->__('Please check shipping addresses information.')); + Mage::throwException(Mage::helper('Mage_Checkout_Helper_Data')->__('Please check shipping addresses information.')); } $method= $address->getShippingMethod(); $rate = $address->getShippingRateByCode($method); if (!$method || !$rate) { - Mage::throwException($helper->__('Please specify shipping methods for all addresses.')); + Mage::throwException(Mage::helper('Mage_Checkout_Helper_Data')->__('Please specify shipping methods for all addresses.')); } } $addressValidation = $quote->getBillingAddress()->validate(); if ($addressValidation !== true) { - Mage::throwException($helper->__('Please check billing address information.')); + Mage::throwException(Mage::helper('Mage_Checkout_Helper_Data')->__('Please check billing address information.')); } return $this; } diff --git a/app/code/core/Mage/Checkout/Model/Type/Multishipping/State.php b/app/code/core/Mage/Checkout/Model/Type/Multishipping/State.php index 29972ad3f9444d8c57b48527bb86be2bb1f3b55d..4892ed577d7d02a31958036995139f6b04a2d70d 100644 --- a/app/code/core/Mage/Checkout/Model/Type/Multishipping/State.php +++ b/app/code/core/Mage/Checkout/Model/Type/Multishipping/State.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/Model/Type/Onepage.php b/app/code/core/Mage/Checkout/Model/Type/Onepage.php index 4710a0083e33d98177335b51ca7e1240c9bd78f6..32cd4d3cacb0913a0fec3c69fc7423d9505fb123 100644 --- a/app/code/core/Mage/Checkout/Model/Type/Onepage.php +++ b/app/code/core/Mage/Checkout/Model/Type/Onepage.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -70,7 +70,7 @@ class Mage_Checkout_Model_Type_Onepage public function __construct() { $this->_helper = Mage::helper('Mage_Checkout_Helper_Data'); - $this->_customerEmailExistsMessage = $this->_helper->__('There is already a customer registered using this email address. Please login using this email address or enter a different email address to register your account.'); + $this->_customerEmailExistsMessage = Mage::helper('Mage_Checkout_Helper_Data')->__('There is already a customer registered using this email address. Please login using this email address or enter a different email address to register your account.'); $this->_checkoutSession = Mage::getSingleton('Mage_Checkout_Model_Session'); $this->_customerSession = Mage::getSingleton('Mage_Customer_Model_Session'); } @@ -102,6 +102,7 @@ class Mage_Checkout_Model_Type_Onepage * Declare checkout quote instance * * @param Mage_Sales_Model_Quote $quote + * @return Mage_Checkout_Model_Type_Onepage */ public function setQuote(Mage_Sales_Model_Quote $quote) { @@ -146,7 +147,7 @@ class Mage_Checkout_Model_Type_Onepage } /* - * want to laod the correct customer information by assiging to address + * want to load the correct customer information by assigning to address * instead of just loading from sales/quote_address */ $customer = $customerSession->getCustomer(); @@ -177,7 +178,7 @@ class Mage_Checkout_Model_Type_Onepage } /** - * Specify chceckout method + * Specify checkout method * * @param string $method * @return array @@ -185,7 +186,7 @@ class Mage_Checkout_Model_Type_Onepage public function saveCheckoutMethod($method) { if (empty($method)) { - return array('error' => -1, 'message' => $this->_helper->__('Invalid data.')); + return array('error' => -1, 'message' => Mage::helper('Mage_Checkout_Helper_Data')->__('Invalid data.')); } $this->getQuote()->setCheckoutMethod($method)->save(); @@ -220,7 +221,7 @@ class Mage_Checkout_Model_Type_Onepage public function saveBilling($data, $customerAddressId) { if (empty($data)) { - return array('error' => -1, 'message' => $this->_helper->__('Invalid data.')); + return array('error' => -1, 'message' => Mage::helper('Mage_Checkout_Helper_Data')->__('Invalid data.')); } $address = $this->getQuote()->getBillingAddress(); @@ -235,7 +236,7 @@ class Mage_Checkout_Model_Type_Onepage if ($customerAddress->getId()) { if ($customerAddress->getCustomerId() != $this->getQuote()->getCustomerId()) { return array('error' => 1, - 'message' => $this->_helper->__('Customer Address is not valid.') + 'message' => Mage::helper('Mage_Checkout_Helper_Data')->__('Customer Address is not valid.') ); } @@ -261,7 +262,7 @@ class Mage_Checkout_Model_Type_Onepage $address->setData($attribute->getAttributeCode(), NULL); } } - + $address->setCustomerAddressId(null); // Additional form data, not fetched by extractData (as it fetches only attributes) $address->setSaveInAddressBook(empty($data['save_in_address_book']) ? 0 : 1); } @@ -289,7 +290,7 @@ class Mage_Checkout_Model_Type_Onepage */ $usingCase = isset($data['use_for_shipping']) ? (int)$data['use_for_shipping'] : 0; - switch($usingCase) { + switch ($usingCase) { case 0: $shipping = $this->getQuote()->getShippingAddress(); $shipping->setSameAsBilling(0); @@ -300,11 +301,14 @@ class Mage_Checkout_Model_Type_Onepage $shipping = $this->getQuote()->getShippingAddress(); $shippingMethod = $shipping->getShippingMethod(); + // Billing address properties that must be always copied to shipping address + $requiredBillingAttributes = array('customer_address_id'); + // don't reset original shipping data, if it was not changed by customer foreach ($shipping->getData() as $shippingKey => $shippingValue) { - if (!is_null($shippingValue) - && !is_null($billing->getData($shippingKey)) - && !isset($data[$shippingKey])) { + if (!is_null($shippingValue) && !is_null($billing->getData($shippingKey)) + && !isset($data[$shippingKey]) && !in_array($shippingKey, $requiredBillingAttributes) + ) { $billing->unsetData($shippingKey); } } @@ -343,8 +347,8 @@ class Mage_Checkout_Model_Type_Onepage */ protected function _validateCustomerData(array $data) { - /* @var $customerForm Mage_Customer_Model_Form */ - $customerForm = Mage::getModel('Mage_Customer_Model_Form'); + /** @var $customerForm Mage_Customer_Model_Form */ + $customerForm = Mage::getModel('Mage_Customer_Model_Form'); $customerForm->setFormCode('checkout_register') ->setIsAjaxRequest(Mage::app()->getRequest()->isAjax()); @@ -380,10 +384,13 @@ class Mage_Checkout_Model_Type_Onepage $customer->setPassword($customerRequest->getParam('customer_password')); $customer->setConfirmation($customerRequest->getParam('confirm_password')); } else { - // emulate customer password for quest + // spoof customer password for guest $password = $customer->generatePassword(); $customer->setPassword($password); $customer->setConfirmation($password); + // set NOT LOGGED IN group id explicitly, + // otherwise copyFieldset('customer_account', 'to_quote') will fill it with default group id value + $customer->setGroupId(Mage_Customer_Model_Group::NOT_LOGGED_IN_ID); } $result = $customer->validate(); @@ -418,7 +425,7 @@ class Mage_Checkout_Model_Type_Onepage public function saveShipping($data, $customerAddressId) { if (empty($data)) { - return array('error' => -1, 'message' => $this->_helper->__('Invalid data.')); + return array('error' => -1, 'message' => Mage::helper('Mage_Checkout_Helper_Data')->__('Invalid data.')); } $address = $this->getQuote()->getShippingAddress(); @@ -433,7 +440,7 @@ class Mage_Checkout_Model_Type_Onepage if ($customerAddress->getId()) { if ($customerAddress->getCustomerId() != $this->getQuote()->getCustomerId()) { return array('error' => 1, - 'message' => $this->_helper->__('Customer Address is not valid.') + 'message' => Mage::helper('Mage_Checkout_Helper_Data')->__('Customer Address is not valid.') ); } @@ -460,6 +467,7 @@ class Mage_Checkout_Model_Type_Onepage } } + $address->setCustomerAddressId(null); // Additional form data, not fetched by extractData (as it fetches only attributes) $address->setSaveInAddressBook(empty($data['save_in_address_book']) ? 0 : 1); $address->setSameAsBilling(empty($data['same_as_billing']) ? 0 : 1); @@ -490,11 +498,11 @@ class Mage_Checkout_Model_Type_Onepage public function saveShippingMethod($shippingMethod) { if (empty($shippingMethod)) { - return array('error' => -1, 'message' => $this->_helper->__('Invalid shipping method.')); + return array('error' => -1, 'message' => Mage::helper('Mage_Checkout_Helper_Data')->__('Invalid shipping method.')); } $rate = $this->getQuote()->getShippingAddress()->getShippingRateByCode($shippingMethod); if (!$rate) { - return array('error' => -1, 'message' => $this->_helper->__('Invalid shipping method.')); + return array('error' => -1, 'message' => Mage::helper('Mage_Checkout_Helper_Data')->__('Invalid shipping method.')); } $this->getQuote()->getShippingAddress() ->setShippingMethod($shippingMethod); @@ -515,7 +523,7 @@ class Mage_Checkout_Model_Type_Onepage public function savePayment($data) { if (empty($data)) { - return array('error' => -1, 'message' => $this->_helper->__('Invalid data.')); + return array('error' => -1, 'message' => Mage::helper('Mage_Checkout_Helper_Data')->__('Invalid data.')); } $quote = $this->getQuote(); if ($quote->isVirtual()) { @@ -546,16 +554,15 @@ class Mage_Checkout_Model_Type_Onepage */ public function validate() { - $helper = Mage::helper('Mage_Checkout_Helper_Data'); $quote = $this->getQuote(); if ($quote->getIsMultiShipping()) { - Mage::throwException($helper->__('Invalid checkout type.')); + Mage::throwException(Mage::helper('Mage_Checkout_Helper_Data')->__('Invalid checkout type.')); } if ($quote->getCheckoutMethod() == self::METHOD_GUEST && !Mage::helper('Mage_Checkout_Helper_Data')->isAllowedGuestCheckout($quote) ) { - Mage::throwException($this->_helper->__('Sorry, guest checkout is not enabled. Please try again or contact store owner.')); + Mage::throwException(Mage::helper('Mage_Checkout_Helper_Data')->__('Sorry, guest checkout is not enabled. Please try again or contact store owner.')); } } diff --git a/app/code/core/Mage/Checkout/controllers/CartController.php b/app/code/core/Mage/Checkout/controllers/CartController.php index d499b754682ec07e9733debae6f2e378c9a7b8c3..1e9d64cf14a78f8116b4b58a41fcee82b70ef564 100644 --- a/app/code/core/Mage/Checkout/controllers/CartController.php +++ b/app/code/core/Mage/Checkout/controllers/CartController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -75,10 +75,12 @@ class Mage_Checkout_CartController extends Mage_Core_Controller_Front_Action { $returnUrl = $this->getRequest()->getParam('return_url'); if ($returnUrl) { - // clear layout messages in case of external url redirect - if ($this->_isUrlInternal($returnUrl)) { - $this->_getSession()->getMessages(true); + + if (!$this->_isUrlInternal($returnUrl)) { + throw new Mage_Exception('External urls redirect to "' . $returnUrl . '" denied!'); } + + $this->_getSession()->getMessages(true); $this->getResponse()->setRedirect($returnUrl); } elseif (!Mage::getStoreConfig('checkout/cart/redirect_to_cart') && !$this->getRequest()->getParam('in_cart') @@ -124,7 +126,13 @@ class Mage_Checkout_CartController extends Mage_Core_Controller_Front_Action $cart->save(); if (!$this->_getQuote()->validateMinimumAmount()) { - $warning = Mage::getStoreConfig('sales/minimum_order/description'); + $minimumAmount = Mage::app()->getLocale()->currency(Mage::app()->getStore()->getCurrentCurrencyCode()) + ->toCurrency(Mage::getStoreConfig('sales/minimum_order/amount')); + + $warning = Mage::getStoreConfig('sales/minimum_order/description') + ? Mage::getStoreConfig('sales/minimum_order/description') + : Mage::helper('Mage_Checkout_Helper_Data')->__('Minimum order amount is %s', $minimumAmount); + $cart->getCheckoutSession()->addNotice($warning); } } @@ -368,9 +376,30 @@ class Mage_Checkout_CartController extends Mage_Core_Controller_Front_Action } /** - * Update shoping cart data action + * Update shopping cart data action */ public function updatePostAction() + { + $updateAction = (string)$this->getRequest()->getParam('update_cart_action'); + + switch ($updateAction) { + case 'empty_cart': + $this->_emptyShoppingCart(); + break; + case 'update_qty': + $this->_updateShoppingCart(); + break; + default: + $this->_updateShoppingCart(); + } + + $this->_goBack(); + } + + /** + * Update customer's shopping cart + */ + protected function _updateShoppingCart() { try { $cartData = $this->getRequest()->getParam('cart'); @@ -399,7 +428,21 @@ class Mage_Checkout_CartController extends Mage_Core_Controller_Front_Action $this->_getSession()->addException($e, $this->__('Cannot update shopping cart.')); Mage::logException($e); } - $this->_goBack(); + } + + /** + * Empty customer's shopping cart + */ + protected function _emptyShoppingCart() + { + try { + $this->_getCart()->truncate()->save(); + $this->_getSession()->setCartWasUpdated(true); + } catch (Mage_Core_Exception $exception) { + $this->_getSession()->addError($exception->getMessage()); + } catch (Exception $exception) { + $this->_getSession()->addException($exception, $this->__('Cannot update shopping cart.')); + } } /** diff --git a/app/code/core/Mage/Checkout/controllers/IndexController.php b/app/code/core/Mage/Checkout/controllers/IndexController.php index 6a5ff01a8d4b41a8146aae4f878ed2f557ab6a8c..19ee4ae45eabdb65fd18917e384a0b8743de14e1 100644 --- a/app/code/core/Mage/Checkout/controllers/IndexController.php +++ b/app/code/core/Mage/Checkout/controllers/IndexController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/controllers/Multishipping/AddressController.php b/app/code/core/Mage/Checkout/controllers/Multishipping/AddressController.php index e5fb2e8c10a391d5b91eff7cce73902032d61a1a..30e74c65a618002afe2e4a2a13e7b88c69bec9d2 100644 --- a/app/code/core/Mage/Checkout/controllers/Multishipping/AddressController.php +++ b/app/code/core/Mage/Checkout/controllers/Multishipping/AddressController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -89,7 +89,7 @@ class Mage_Checkout_Multishipping_AddressController extends Mage_Core_Controller if (count($this->_getCheckout()->getCustomer()->getAddresses()) == 1) { $this->_getCheckout()->reset(); } - $this->_redirect('*/multishipping/'); + $this->_redirect('*/multishipping/addresses'); } public function editShippingAction() diff --git a/app/code/core/Mage/Checkout/controllers/MultishippingController.php b/app/code/core/Mage/Checkout/controllers/MultishippingController.php index dac2a21e4c25d18db24d06d3ad13b1bcdd85fa5a..beddd7fd7e1f86e9c1e7b7da18c518a29dfecdbb 100644 --- a/app/code/core/Mage/Checkout/controllers/MultishippingController.php +++ b/app/code/core/Mage/Checkout/controllers/MultishippingController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/controllers/OnepageController.php b/app/code/core/Mage/Checkout/controllers/OnepageController.php index 85fc2a4f207a25cb99f0f0886b8213d774ce89c9..2c436e9f7acd2d70934388a48db5a09103754f1d 100644 --- a/app/code/core/Mage/Checkout/controllers/OnepageController.php +++ b/app/code/core/Mage/Checkout/controllers/OnepageController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -33,6 +33,9 @@ class Mage_Checkout_OnepageController extends Mage_Checkout_Controller_Action 'review' => '_getReviewHtml', ); + /** @var Mage_Sales_Model_Order */ + protected $_order; + /** * @return Mage_Checkout_OnepageController */ @@ -128,6 +131,7 @@ class Mage_Checkout_OnepageController extends Mage_Checkout_Controller_Action $layout->generateXml(); $layout->generateBlocks(); $output = $layout->getOutput(); + Mage::getSingleton('Mage_Core_Model_Translate_Inline')->processResponseBody($output); return $output; } @@ -167,7 +171,10 @@ class Mage_Checkout_OnepageController extends Mage_Checkout_Controller_Action return; } if (!$quote->validateMinimumAmount()) { - $error = Mage::getStoreConfig('sales/minimum_order/error_message'); + $error = Mage::getStoreConfig('sales/minimum_order/error_message') ? + Mage::getStoreConfig('sales/minimum_order/error_message') : + Mage::helper('Mage_Checkout_Helper_Data')->__('Subtotal must exceed minimum order amount'); + Mage::getSingleton('Mage_Checkout_Model_Session')->addError($error); $this->_redirect('checkout/cart'); return; @@ -442,9 +449,6 @@ class Mage_Checkout_OnepageController extends Mage_Checkout_Controller_Action $this->getResponse()->setBody(Mage::helper('Mage_Core_Helper_Data')->jsonEncode($result)); } - /* @var $_order Mage_Sales_Model_Order */ - protected $_order; - /** * Get Order by quoteId * @@ -506,21 +510,6 @@ class Mage_Checkout_OnepageController extends Mage_Checkout_Controller_Action } $this->getOnepage()->saveOrder(); - $storeId = Mage::app()->getStore()->getId(); - $paymentHelper = Mage::helper("Mage_Payment_Helper_Data"); - $zeroSubTotalPaymentAction = $paymentHelper->getZeroSubTotalPaymentAutomaticInvoice($storeId); - if ($paymentHelper->isZeroSubTotal($storeId) - && $this->_getOrder()->getGrandTotal() == 0 - && $zeroSubTotalPaymentAction == Mage_Payment_Model_Method_Abstract::ACTION_AUTHORIZE_CAPTURE - && $paymentHelper->getZeroSubTotalOrderStatus($storeId) == 'pending') { - $invoice = $this->_initInvoice(); - $invoice->getOrder()->setIsInProcess(true); - $transactionSave = Mage::getModel('Mage_Core_Model_Resource_Transaction') - ->addObject($invoice) - ->addObject($invoice->getOrder()); - $transactionSave->save(); - } - $redirectUrl = $this->getOnepage()->getCheckout()->getRedirectUrl(); $result['success'] = true; $result['error'] = false; diff --git a/app/code/core/Mage/Checkout/etc/adminhtml.xml b/app/code/core/Mage/Checkout/etc/adminhtml.xml index 362ea605569ac79cb6806fe217e1caa635f4e895..78e1cd654b4daf66157d1bf37f0e5bbc8584a559 100644 --- a/app/code/core/Mage/Checkout/etc/adminhtml.xml +++ b/app/code/core/Mage/Checkout/etc/adminhtml.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Checkout/etc/api.xml b/app/code/core/Mage/Checkout/etc/api.xml index 0520c4fe0631d946b3922a2c2464fc4d3be2e4ab..7faa6b2541674eb201d62567472bf9b72c6b8d19 100644 --- a/app/code/core/Mage/Checkout/etc/api.xml +++ b/app/code/core/Mage/Checkout/etc/api.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Checkout/etc/config.xml b/app/code/core/Mage/Checkout/etc/config.xml index a3d5e3836526108427192169bc47d0a503ce5421..86399de8b57cec303d7027f1fafbb20bb8cf5a44 100644 --- a/app/code/core/Mage/Checkout/etc/config.xml +++ b/app/code/core/Mage/Checkout/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Checkout/etc/fieldset.xml b/app/code/core/Mage/Checkout/etc/fieldset.xml index cf4292d197088c0b8ca5ad0e7a5fa8d30148b868..6f659735956022edc4ebd68aed09c5d9c027b85a 100644 --- a/app/code/core/Mage/Checkout/etc/fieldset.xml +++ b/app/code/core/Mage/Checkout/etc/fieldset.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Checkout/etc/system.xml b/app/code/core/Mage/Checkout/etc/system.xml index f830c0d4807ad7021e52b8129f4295dfdacd1bf2..5a4fd7da5e2385c8124db474982be9dc2d522731 100644 --- a/app/code/core/Mage/Checkout/etc/system.xml +++ b/app/code/core/Mage/Checkout/etc/system.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Checkout/etc/translater.xml b/app/code/core/Mage/Checkout/etc/translater.xml new file mode 100644 index 0000000000000000000000000000000000000000..fb4f010a26755b1f766287b0cdecade46c1b0a4f --- /dev/null +++ b/app/code/core/Mage/Checkout/etc/translater.xml @@ -0,0 +1,46 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * 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_AFL.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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Checkout + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<translater> + <!-- opcheckout.js --> + <validate-guest translate="message" module="Mage_Checkout"> + <message>Please choose to register or to checkout as a guest</message> + </validate-guest> + <validate-shipping-methods-not-available translate="message" module="Mage_Checkout"> + <message>Your order cannot be completed at this time as there is no shipping methods available for it. Please make necessary changes in your shipping address.</message> + </validate-shipping-methods-not-available> + <validate-shipping-methods-required translate="message" module="Mage_Checkout"> + <message>Please specify shipping method.</message> + </validate-shipping-methods-required> + <validate-payment-methods-not-available translate="message" module="Mage_Checkout"> + <message>Your order cannot be completed at this time as there is no payment methods available for it.</message> + </validate-payment-methods-not-available> + <validate-shipping-methods-required translate="message" module="Mage_Checkout"> + <message>Please specify payment method.</message> + </validate-shipping-methods-required> + <!-- end opcheckout.js --> +</translater> diff --git a/app/code/core/Mage/Checkout/sql/checkout_setup/install-1.6.0.0.php b/app/code/core/Mage/Checkout/sql/checkout_setup/install-1.6.0.0.php index 9b47aeb736407c8d628e2704e13ebe30bcd60e26..58e0f51ceeed8c9c5f56f559f4dfaf563541d05c 100644 --- a/app/code/core/Mage/Checkout/sql/checkout_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/Checkout/sql/checkout_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Checkout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Checkout/view/frontend/cart.phtml b/app/code/core/Mage/Checkout/view/frontend/cart.phtml index 12073bd4c6f66f7f551a6dd5c3db538f98da053b..cb66d8151586be713e99563ee7263f17c0bdfe3b 100644 --- a/app/code/core/Mage/Checkout/view/frontend/cart.phtml +++ b/app/code/core/Mage/Checkout/view/frontend/cart.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -99,7 +99,8 @@ <?php if($this->getContinueShoppingUrl()): ?> <button type="button" title="<?php echo $this->__('Continue Shopping') ?>" class="button btn-continue" onclick="setLocation('<?php echo $this->getContinueShoppingUrl() ?>')"><span><span><?php echo $this->__('Continue Shopping') ?></span></span></button> <?php endif; ?> - <button type="submit" title="<?php echo $this->__('Update Shopping Cart') ?>" class="button btn-update"><span><span><?php echo $this->__('Update Shopping Cart') ?></span></span></button> + <button type="submit" name="update_cart_action" value="empty_cart" title="<?php echo $this->__('Clear Shopping Cart'); ?>" class="button btn-update"><span><span><?php echo $this->__('Clear Shopping Cart'); ?></span></span></button> + <button type="submit" name="update_cart_action" value="update_qty" title="<?php echo $this->__('Update Shopping Cart'); ?>" class="button btn-update" style="margin-left: 5px;"><span><span><?php echo $this->__('Update Shopping Cart'); ?></span></span></button> </td> </tr> </tfoot> diff --git a/app/code/core/Mage/Checkout/view/frontend/cart/coupon.phtml b/app/code/core/Mage/Checkout/view/frontend/cart/coupon.phtml index da21c9d8b2744ff223b6a56a2bda979bd7b999d8..09019de43b51f2e3917c1f90247e9dd662518984 100644 --- a/app/code/core/Mage/Checkout/view/frontend/cart/coupon.phtml +++ b/app/code/core/Mage/Checkout/view/frontend/cart/coupon.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Checkout/view/frontend/cart/crosssell.phtml b/app/code/core/Mage/Checkout/view/frontend/cart/crosssell.phtml index 1d999135a6e058099daad837edff2d64c812cb80..117f2e83653e90bbdcd36d16e2f37ae27aed1444 100644 --- a/app/code/core/Mage/Checkout/view/frontend/cart/crosssell.phtml +++ b/app/code/core/Mage/Checkout/view/frontend/cart/crosssell.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Checkout/view/frontend/cart/item/configure/updatecart.phtml b/app/code/core/Mage/Checkout/view/frontend/cart/item/configure/updatecart.phtml index a3b673736af2a99d990aa575da2c8731bc53f549..8f587723afc34aacb5d81eb727c92490ae331b38 100644 --- a/app/code/core/Mage/Checkout/view/frontend/cart/item/configure/updatecart.phtml +++ b/app/code/core/Mage/Checkout/view/frontend/cart/item/configure/updatecart.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Checkout/view/frontend/cart/item/default.phtml b/app/code/core/Mage/Checkout/view/frontend/cart/item/default.phtml index 2a8c88a9cec48783efaafbbab1182c31bc5abd82..f3b538d71296f3981f336d4412ee18a6d4cd58a4 100644 --- a/app/code/core/Mage/Checkout/view/frontend/cart/item/default.phtml +++ b/app/code/core/Mage/Checkout/view/frontend/cart/item/default.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -62,7 +62,8 @@ $canApplyMsrp = Mage::helper('Mage_Catalog_Helper_Data')->canApplyMsrp($_item->g <p class="item-msg <?php echo $message['type'] ?>">* <?php echo $message['text'] ?></p> <?php endforeach; ?> <?php endif; ?> - <?php if ($addtInfoBlock = $this->getProductAdditionalInformationBlock()):?> + <?php $addtInfoBlock = $this->getProductAdditionalInformationBlock(); ?> + <?php if ($addtInfoBlock): ?> <?php echo $addtInfoBlock->setItem($_item)->toHtml() ?> <?php endif;?> </td> diff --git a/app/code/core/Mage/Checkout/view/frontend/cart/noItems.phtml b/app/code/core/Mage/Checkout/view/frontend/cart/noItems.phtml index f8f4ad1c4d5072827d0b4cbd1b2be56cd7e41f41..a250788582ecefcb5ccb98c2e1f2952db896b70f 100644 --- a/app/code/core/Mage/Checkout/view/frontend/cart/noItems.phtml +++ b/app/code/core/Mage/Checkout/view/frontend/cart/noItems.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -29,6 +29,8 @@ </div> <div class="cart-empty"> <?php echo $this->getMessagesBlock()->getGroupedHtml() ?> + <?php echo $this->getChildHtml('checkout_cart_empty_widget'); ?> <p><?php echo $this->__('You have no items in your shopping cart.') ?></p> <p><?php echo $this->__('Click <a href="%s">here</a> to continue shopping.', $this->getContinueShoppingUrl()) ?></p> + <?php echo $this->getChildHtml('shopping.cart.table.after'); ?> </div> diff --git a/app/code/core/Mage/Checkout/view/frontend/cart/shipping.phtml b/app/code/core/Mage/Checkout/view/frontend/cart/shipping.phtml index fb93862b838e5ae6873aac6f647d9a8f27d11af7..5a779e9e96f05bca799563d1d33422516b9d68fe 100644 --- a/app/code/core/Mage/Checkout/view/frontend/cart/shipping.phtml +++ b/app/code/core/Mage/Checkout/view/frontend/cart/shipping.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Checkout/view/frontend/cart/sidebar.phtml b/app/code/core/Mage/Checkout/view/frontend/cart/sidebar.phtml index de1403608aeb2084d5bb533ca51e30519531cf00..da9a649fa06c617e27e6c982eb983a245c5a4463 100644 --- a/app/code/core/Mage/Checkout/view/frontend/cart/sidebar.phtml +++ b/app/code/core/Mage/Checkout/view/frontend/cart/sidebar.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/Checkout/view/frontend/cart/sidebar/default.phtml b/app/code/core/Mage/Checkout/view/frontend/cart/sidebar/default.phtml index f435989d080024a261f8e71e004c0b0877d821db..2d15961765c0d3b4abcfdd4b63c8ec72869ba954 100644 --- a/app/code/core/Mage/Checkout/view/frontend/cart/sidebar/default.phtml +++ b/app/code/core/Mage/Checkout/view/frontend/cart/sidebar/default.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Checkout/view/frontend/cart/totals.phtml b/app/code/core/Mage/Checkout/view/frontend/cart/totals.phtml index 408c7729e847eb7bc333ae956229e428b2127d27..08aaa97076aca65e243b3594ed1e9709af424197 100644 --- a/app/code/core/Mage/Checkout/view/frontend/cart/totals.phtml +++ b/app/code/core/Mage/Checkout/view/frontend/cart/totals.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Checkout/view/frontend/layout.xml b/app/code/core/Mage/Checkout/view/frontend/layout.xml index 0326fa3eb189f08e274b5192f3e2fd18497862b7..dd0e7f4545b83d2edf214f7149f9a38e40909eb5 100644 --- a/app/code/core/Mage/Checkout/view/frontend/layout.xml +++ b/app/code/core/Mage/Checkout/view/frontend/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/Checkout/view/frontend/multishipping/address/select.phtml b/app/code/core/Mage/Checkout/view/frontend/multishipping/address/select.phtml index f6839df645db006e864b1788a3d113d9e15ccded..76dce4488e1ccb0351d930db68853bf844d89bcb 100644 --- a/app/code/core/Mage/Checkout/view/frontend/multishipping/address/select.phtml +++ b/app/code/core/Mage/Checkout/view/frontend/multishipping/address/select.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Checkout/view/frontend/multishipping/addresses.phtml b/app/code/core/Mage/Checkout/view/frontend/multishipping/addresses.phtml index 4ea35347acad889f948f097e27e156b840362dab..616ec8afd5f5baebe02e71fa3c6c02d9ff9c370e 100644 --- a/app/code/core/Mage/Checkout/view/frontend/multishipping/addresses.phtml +++ b/app/code/core/Mage/Checkout/view/frontend/multishipping/addresses.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Checkout/view/frontend/multishipping/agreements.phtml b/app/code/core/Mage/Checkout/view/frontend/multishipping/agreements.phtml index 9025997feb350a1f755831ba61af5b9808d8a268..3adf879495f375566cc4ac804fd5d1f689d35d8e 100644 --- a/app/code/core/Mage/Checkout/view/frontend/multishipping/agreements.phtml +++ b/app/code/core/Mage/Checkout/view/frontend/multishipping/agreements.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Checkout/view/frontend/multishipping/billing.phtml b/app/code/core/Mage/Checkout/view/frontend/multishipping/billing.phtml index 6b8bde37ee2bcdd464b8261ae7ff1456482bfebd..49b5bf84e267fa0ef3739e27c40cc6c59327a22b 100644 --- a/app/code/core/Mage/Checkout/view/frontend/multishipping/billing.phtml +++ b/app/code/core/Mage/Checkout/view/frontend/multishipping/billing.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Checkout/view/frontend/multishipping/billing/items.phtml b/app/code/core/Mage/Checkout/view/frontend/multishipping/billing/items.phtml index fa6fa53596efc7323e7a57d631a1dbcd45369194..13cc5b55bbdd0d03dcb416525ab38f322be64b83 100644 --- a/app/code/core/Mage/Checkout/view/frontend/multishipping/billing/items.phtml +++ b/app/code/core/Mage/Checkout/view/frontend/multishipping/billing/items.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Checkout/view/frontend/multishipping/item/default.phtml b/app/code/core/Mage/Checkout/view/frontend/multishipping/item/default.phtml index 043d9f1cc614d54f2de4509f93770a7b3b725363..a8832190076e8efdd9561a9968e08f2a2e60a02c 100644 --- a/app/code/core/Mage/Checkout/view/frontend/multishipping/item/default.phtml +++ b/app/code/core/Mage/Checkout/view/frontend/multishipping/item/default.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Checkout/view/frontend/multishipping/link.phtml b/app/code/core/Mage/Checkout/view/frontend/multishipping/link.phtml index 23038960e3490662a592cd4a3851da86888c2c14..bae988d37ef55442828998bf8943b48c044b068e 100644 --- a/app/code/core/Mage/Checkout/view/frontend/multishipping/link.phtml +++ b/app/code/core/Mage/Checkout/view/frontend/multishipping/link.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Checkout/view/frontend/multishipping/overview.phtml b/app/code/core/Mage/Checkout/view/frontend/multishipping/overview.phtml index 776d715f25e335bdc0051598d64c29d90617fedc..d7da0ab266b38cea0cd7b9cfbc2eb7d3bfc09d84 100644 --- a/app/code/core/Mage/Checkout/view/frontend/multishipping/overview.phtml +++ b/app/code/core/Mage/Checkout/view/frontend/multishipping/overview.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Checkout/view/frontend/multishipping/overview/item.phtml b/app/code/core/Mage/Checkout/view/frontend/multishipping/overview/item.phtml index a185dd8e431ce9f5ec08b37732e22527a88e61c4..a3a4ddd3f0b39d3dcd1b7ca46ffc2471d9fa4280 100644 --- a/app/code/core/Mage/Checkout/view/frontend/multishipping/overview/item.phtml +++ b/app/code/core/Mage/Checkout/view/frontend/multishipping/overview/item.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Checkout/view/frontend/multishipping/payment.js b/app/code/core/Mage/Checkout/view/frontend/multishipping/payment.js index bb00820bc91fcea0f83c33a14edad4f8ba90d3ef..64f40723508673bc7f21f5afc17075a82ea3eb21 100644 --- a/app/code/core/Mage/Checkout/view/frontend/multishipping/payment.js +++ b/app/code/core/Mage/Checkout/view/frontend/multishipping/payment.js @@ -19,7 +19,7 @@ * * @category Varien * @package js - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ var paymentForm = Class.create(); diff --git a/app/code/core/Mage/Checkout/view/frontend/multishipping/shipping.phtml b/app/code/core/Mage/Checkout/view/frontend/multishipping/shipping.phtml index 626f3b7d7e7969544a3a26aa23aa5270eb17becd..84ec7188c4baae83a8cf9f4e120ada63128086e5 100644 --- a/app/code/core/Mage/Checkout/view/frontend/multishipping/shipping.phtml +++ b/app/code/core/Mage/Checkout/view/frontend/multishipping/shipping.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Checkout/view/frontend/multishipping/state.phtml b/app/code/core/Mage/Checkout/view/frontend/multishipping/state.phtml index a4bd5b908c43ef824c735bb68c567a2cfeea9042..cc9dc142de0c3bd71b460af248c607808a5d9250 100644 --- a/app/code/core/Mage/Checkout/view/frontend/multishipping/state.phtml +++ b/app/code/core/Mage/Checkout/view/frontend/multishipping/state.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Checkout/view/frontend/multishipping/success.phtml b/app/code/core/Mage/Checkout/view/frontend/multishipping/success.phtml index 871e850e16dc41fe2add68e35d7b1bb01129bc65..69dc9c2b020c3022424c58e7634c55f3db9edf40 100644 --- a/app/code/core/Mage/Checkout/view/frontend/multishipping/success.phtml +++ b/app/code/core/Mage/Checkout/view/frontend/multishipping/success.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Checkout/view/frontend/onepage.phtml b/app/code/core/Mage/Checkout/view/frontend/onepage.phtml index 69728a038dfef603391fd9d6f13d69a6031b7cb8..d8a6eddc50a1b2786994f9a27295075b9620d462 100644 --- a/app/code/core/Mage/Checkout/view/frontend/onepage.phtml +++ b/app/code/core/Mage/Checkout/view/frontend/onepage.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Checkout/view/frontend/onepage/accordion.js b/app/code/core/Mage/Checkout/view/frontend/onepage/accordion.js index 2c653c1fdac7f5100a3fac9dea5feb1dd8549096..b979dbc7b42973708d026acf09d327b60a286e5e 100644 --- a/app/code/core/Mage/Checkout/view/frontend/onepage/accordion.js +++ b/app/code/core/Mage/Checkout/view/frontend/onepage/accordion.js @@ -19,7 +19,7 @@ * * @category Varien * @package js - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ Accordion = Class.create(); diff --git a/app/code/core/Mage/Checkout/view/frontend/onepage/agreements.phtml b/app/code/core/Mage/Checkout/view/frontend/onepage/agreements.phtml index 0e47b802ee62895412ad8249e429cb43ae1177e3..877819eb11e97f0c7cf206c41c260bfb9c93a16f 100644 --- a/app/code/core/Mage/Checkout/view/frontend/onepage/agreements.phtml +++ b/app/code/core/Mage/Checkout/view/frontend/onepage/agreements.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Checkout/view/frontend/onepage/billing.phtml b/app/code/core/Mage/Checkout/view/frontend/onepage/billing.phtml index ad9c3944a282e3638aa325c0726873fd32faa6c4..751277fc7a2f75ecc74e2a0650f1d6e29b17065a 100644 --- a/app/code/core/Mage/Checkout/view/frontend/onepage/billing.phtml +++ b/app/code/core/Mage/Checkout/view/frontend/onepage/billing.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -69,6 +69,12 @@ </div> </li> <?php endfor ?> + <li class="wide"> + <label for="billing:vat_id"><?php echo $this->__('VAT Number') ?></label> + <div class="input-box"> + <input type="text" id="billing:vat_id" name="billing[vat_id]" value="<?php echo $this->escapeHtml($this->getAddress()->getVatId()) ?>" title="<?php echo $this->__('VAT Number') ?>" class="input-text" /> + </div> + </li> <li class="fields"> <div class="field"> <label for="billing:city" class="required"><em>*</em><?php echo $this->__('City') ?></label> @@ -167,6 +173,7 @@ <?php else:?> <li class="no-display"><input type="hidden" name="billing[save_in_address_book]" value="1" /></li> <?php endif; ?> + <?php echo $this->getChildHtml('form.additional.info'); ?> </ul> </fieldset> </li> diff --git a/app/code/core/Mage/Checkout/view/frontend/onepage/failure.phtml b/app/code/core/Mage/Checkout/view/frontend/onepage/failure.phtml index d39c6629138c087d469f758a740e636ada209077..d222fd1fb720d55c84e12c309ae5f62c3eed277e 100644 --- a/app/code/core/Mage/Checkout/view/frontend/onepage/failure.phtml +++ b/app/code/core/Mage/Checkout/view/frontend/onepage/failure.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Checkout/view/frontend/onepage/link.phtml b/app/code/core/Mage/Checkout/view/frontend/onepage/link.phtml index e600392c2dcf9853bb31fcc17af15b4e753a4c76..433981d60a75b69ed67fe67e0763085524266bfa 100644 --- a/app/code/core/Mage/Checkout/view/frontend/onepage/link.phtml +++ b/app/code/core/Mage/Checkout/view/frontend/onepage/link.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Checkout/view/frontend/onepage/login.phtml b/app/code/core/Mage/Checkout/view/frontend/onepage/login.phtml index 87a6f453c79b8cbc3193c83ff16a4e89b72e5cca..abd259f847362c539bb87ed32e7b27d9f559629b 100644 --- a/app/code/core/Mage/Checkout/view/frontend/onepage/login.phtml +++ b/app/code/core/Mage/Checkout/view/frontend/onepage/login.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -79,6 +79,7 @@ <input type="password" class="input-text required-entry" id="login-password" name="login[password]" /> </div> </li> + <?php echo $this->getChildHtml('form.additional.info'); ?> </ul> </fieldset> </form> diff --git a/app/code/core/Mage/Checkout/view/frontend/onepage/payment.phtml b/app/code/core/Mage/Checkout/view/frontend/onepage/payment.phtml index 133963a6bc2bad2d156bb75728e5ce112638de38..94e51a966ef57c41c8f62c82cf48aaac9e573966 100644 --- a/app/code/core/Mage/Checkout/view/frontend/onepage/payment.phtml +++ b/app/code/core/Mage/Checkout/view/frontend/onepage/payment.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Checkout/view/frontend/onepage/payment/methods.phtml b/app/code/core/Mage/Checkout/view/frontend/onepage/payment/methods.phtml index 733df800739fdfb6f720b73401642cec74de4260..eb8f2ac2cf9707d99631c6f4ea52b45952dd9a4d 100644 --- a/app/code/core/Mage/Checkout/view/frontend/onepage/payment/methods.phtml +++ b/app/code/core/Mage/Checkout/view/frontend/onepage/payment/methods.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Checkout/view/frontend/onepage/progress.phtml b/app/code/core/Mage/Checkout/view/frontend/onepage/progress.phtml index 30fc86d915f0500ffb9a839f86f5ed71afde854c..60d5a71e65bf277a6b33a34431d8c7291bf07cc8 100644 --- a/app/code/core/Mage/Checkout/view/frontend/onepage/progress.phtml +++ b/app/code/core/Mage/Checkout/view/frontend/onepage/progress.phtml @@ -20,9 +20,10 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ +/* @var $this Mage_Checkout_Block_Onepage_Progress */ ?> <div class="block block-progress opc-block-progress"> <div class="block-title"> @@ -31,9 +32,10 @@ <div class="block-content"> <dl> <?php if ($this->getCheckout()->getStepData('billing', 'is_show')): ?> - <?php if($this->getCheckout()->getStepData('billing', 'complete')): ?> + <?php if ($this->isStepComplete('billing')): ?> <dt class="complete"> - <?php echo $this->__('Billing Address') ?> <span class="separator">|</span> <a href="#billing" onclick="checkout.accordion.openSection('opc-billing'); return false;"><?php echo $this->__('Change') ?></a> + <?php echo $this->__('Billing Address') ?> <span class="separator">|</span> + <a href="#billing" onclick="checkout.gotoSection('billing'); return false;"><?php echo $this->__('Change') ?></a> </dt> <dd class="complete"> <address><?php echo $this->getBilling()->format('html') ?></address> @@ -46,9 +48,10 @@ <?php endif; ?> <?php if ($this->getCheckout()->getStepData('shipping', 'is_show')): ?> - <?php if($this->getCheckout()->getStepData('shipping', 'complete')): ?> + <?php if ($this->isStepComplete('shipping')): ?> <dt class="complete"> - <?php echo $this->__('Shipping Address') ?> <span class="separator">|</span> <a href="#payment" onclick="checkout.accordion.openSection('opc-shipping');return false;"><?php echo $this->__('Change') ?></a> + <?php echo $this->__('Shipping Address') ?> <span class="separator">|</span> + <a href="#payment" onclick="checkout.gotoSection('shipping');return false;"><?php echo $this->__('Change') ?></a> </dt> <dd class="complete"> <address><?php echo $this->getShipping()->format('html') ?></address> @@ -61,9 +64,10 @@ <?php endif; ?> <?php if ($this->getCheckout()->getStepData('shipping_method', 'is_show')): ?> - <?php if($this->getCheckout()->getStepData('shipping_method', 'complete')): ?> + <?php if ($this->isStepComplete('shipping_method')): ?> <dt class="complete"> - <?php echo $this->__('Shipping Method') ?> <span class="separator">|</span> <a href="#shipping_method" onclick="checkout.accordion.openSection('opc-shipping_method'); return false;"><?php echo $this->__('Change') ?></a> + <?php echo $this->__('Shipping Method') ?> <span class="separator">|</span> + <a href="#shipping_method" onclick="checkout.gotoSection('shipping_method'); return false;"><?php echo $this->__('Change') ?></a> </dt> <dd class="complete"> <?php if ($this->getShippingMethod()): ?> @@ -92,9 +96,10 @@ <?php endif; ?> <?php if ($this->getCheckout()->getStepData('payment', 'is_show')): ?> - <?php if($this->getCheckout()->getStepData('payment', 'complete')): ?> + <?php if ($this->isStepComplete('payment')): ?> <dt class="complete"> - <?php echo $this->__('Payment Method') ?> <span class="separator">|</span> <a href="#payment" onclick="checkout.accordion.openSection('opc-payment'); return false;"><?php echo $this->__('Change') ?></a> + <?php echo $this->__('Payment Method') ?> <span class="separator">|</span> + <a href="#payment" onclick="checkout.gotoSection('payment'); return false;"><?php echo $this->__('Change') ?></a> </dt> <dd class="complete"> <?php echo $this->getPaymentHtml() ?> diff --git a/app/code/core/Mage/Checkout/view/frontend/onepage/review.phtml b/app/code/core/Mage/Checkout/view/frontend/onepage/review.phtml index 3e552f77a8c345670512c08d5d1eacc4a155370f..a3576c5544a70e7aedf80ba8f1354ace0671e6a9 100644 --- a/app/code/core/Mage/Checkout/view/frontend/onepage/review.phtml +++ b/app/code/core/Mage/Checkout/view/frontend/onepage/review.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Checkout/view/frontend/onepage/review/button.phtml b/app/code/core/Mage/Checkout/view/frontend/onepage/review/button.phtml index 03c38a29485178caf2adc393566897a9a0460708..25ab874645212700dac49115ae6569cc6184f1fb 100644 --- a/app/code/core/Mage/Checkout/view/frontend/onepage/review/button.phtml +++ b/app/code/core/Mage/Checkout/view/frontend/onepage/review/button.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Checkout/view/frontend/onepage/review/info.phtml b/app/code/core/Mage/Checkout/view/frontend/onepage/review/info.phtml index 372f0ab299aacf384eab27679a89e475fd1dd9aa..4ed6474be9dfae5cdaa0d53cf2586604c8fa5f13 100644 --- a/app/code/core/Mage/Checkout/view/frontend/onepage/review/info.phtml +++ b/app/code/core/Mage/Checkout/view/frontend/onepage/review/info.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Checkout/view/frontend/onepage/review/item.phtml b/app/code/core/Mage/Checkout/view/frontend/onepage/review/item.phtml index b4f58355fec0feaac9ab5631c99c2c7940e049ab..2769e48c3b6a9ec0d672d0412b14b6dfc7c986f4 100644 --- a/app/code/core/Mage/Checkout/view/frontend/onepage/review/item.phtml +++ b/app/code/core/Mage/Checkout/view/frontend/onepage/review/item.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Checkout/view/frontend/onepage/review/totals.phtml b/app/code/core/Mage/Checkout/view/frontend/onepage/review/totals.phtml index 33a0d547a5e00e4a1142cf05c55b76f75907208b..645e82dc30377ba730e0bc8a51913c458f840121 100644 --- a/app/code/core/Mage/Checkout/view/frontend/onepage/review/totals.phtml +++ b/app/code/core/Mage/Checkout/view/frontend/onepage/review/totals.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/Checkout/view/frontend/onepage/shipping.phtml b/app/code/core/Mage/Checkout/view/frontend/onepage/shipping.phtml index ab6e75e79f35680af45332ad51ab277d738cc861..8c1e116ab946b256b4dfe39ddf9a9bbb6489c918 100644 --- a/app/code/core/Mage/Checkout/view/frontend/onepage/shipping.phtml +++ b/app/code/core/Mage/Checkout/view/frontend/onepage/shipping.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -68,6 +68,12 @@ </div> </li> <?php endfor ?> + <li class="wide"> + <label for="billing:vat_id"><?php echo $this->__('VAT Number'); ?></label> + <div class="input-box"> + <input type="text" id="shipping:vat_id" name="shipping[vat_id]" value="<?php echo $this->escapeHtml($this->getAddress()->getVatId()); ?>" title="<?php echo $this->__('VAT Number'); ?>" class="input-text" /> + </div> + </li> <li class="fields"> <div class="field"> <label for="shipping:city" class="required"><em>*</em><?php echo $this->__('City') ?></label> diff --git a/app/code/core/Mage/Checkout/view/frontend/onepage/shipping_method.phtml b/app/code/core/Mage/Checkout/view/frontend/onepage/shipping_method.phtml index 0418308d1be2c80aa57ac68a6963e963f8c26a77..cbaaa6a0899adde3df9f0a93356860b372a25623 100644 --- a/app/code/core/Mage/Checkout/view/frontend/onepage/shipping_method.phtml +++ b/app/code/core/Mage/Checkout/view/frontend/onepage/shipping_method.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Checkout/view/frontend/onepage/shipping_method/additional.phtml b/app/code/core/Mage/Checkout/view/frontend/onepage/shipping_method/additional.phtml index 16d4ee0b92c54d1c3634d85776c26d5674403e25..337b33deec076bb93571f6e7f380e546a3370119 100644 --- a/app/code/core/Mage/Checkout/view/frontend/onepage/shipping_method/additional.phtml +++ b/app/code/core/Mage/Checkout/view/frontend/onepage/shipping_method/additional.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Checkout/view/frontend/onepage/shipping_method/available.phtml b/app/code/core/Mage/Checkout/view/frontend/onepage/shipping_method/available.phtml index e40dd339e85bfea4c326f4c33523febc370a00ec..436d9dbc3df0d3c0080791e9e41f4f640d578284 100644 --- a/app/code/core/Mage/Checkout/view/frontend/onepage/shipping_method/available.phtml +++ b/app/code/core/Mage/Checkout/view/frontend/onepage/shipping_method/available.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Checkout/view/frontend/opcheckout.js b/app/code/core/Mage/Checkout/view/frontend/opcheckout.js index ae83e7e2b5e879a5f6aef3e286d14a2b866dce31..d792a8cda8ae7d3cf487b0bdc0c9cda59949783f 100644 --- a/app/code/core/Mage/Checkout/view/frontend/opcheckout.js +++ b/app/code/core/Mage/Checkout/view/frontend/opcheckout.js @@ -19,7 +19,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ var Checkout = Class.create(); @@ -38,17 +38,37 @@ Checkout.prototype = { this.loadWaiting = false; this.steps = ['login', 'billing', 'shipping', 'shipping_method', 'payment', 'review']; - //this.onSetMethod = this.nextStep.bindAsEventListener(this); + this.accordion.sections.each(function(section) { + Event.observe($(section).down('.step-title'), 'click', this._onSectionClick.bindAsEventListener(this)); + }.bind(this)); this.accordion.disallowAccessToNextSections = true; }, + /** + * Section header click handler + * + * @param event + */ + _onSectionClick: function(event) { + var section = $(Event.element(event).up().up()); + if (section.hasClassName('allow')) { + Event.stop(event); + this.gotoSection(section.readAttribute('id').replace('opc-', '')); + return false; + } + }, + ajaxFailure: function(){ location.href = this.failureUrl; }, - reloadProgressBlock: function(){ - var updater = new Ajax.Updater('checkout-progress-wrapper', this.progressUrl, {method: 'get', onFailure: this.ajaxFailure.bind(this)}); + reloadProgressBlock: function(toStep) { + var updater = new Ajax.Updater('checkout-progress-wrapper', this.progressUrl, { + method: 'get', + onFailure: this.ajaxFailure.bind(this), + parameters: toStep ? {toStep: toStep} : null + }); }, reloadReviewBlock: function(){ @@ -90,9 +110,10 @@ Checkout.prototype = { gotoSection: function(section) { - section = $('opc-'+section); - section.addClassName('allow'); - this.accordion.openSection(section); + var sectionElement = $('opc-'+section); + sectionElement.addClassName('allow'); + this.accordion.openSection('opc-'+section); + this.reloadProgressBlock(section); }, setMethod: function(){ @@ -118,6 +139,7 @@ Checkout.prototype = { alert(Translator.translate('Please choose to register or to checkout as a guest')); return false; } + document.body.fire('login:setMethod', {method : this.method}); }, setBilling: function() { @@ -134,7 +156,6 @@ Checkout.prototype = { } // this refreshes the checkout progress column - this.reloadProgressBlock(); // if ($('billing:use_for_shipping') && $('billing:use_for_shipping').checked){ // shipping.syncWithBilling(); @@ -151,21 +172,18 @@ Checkout.prototype = { }, setShipping: function() { - this.reloadProgressBlock(); //this.nextStep(); this.gotoSection('shipping_method'); //this.accordion.openNextSection(true); }, setShippingMethod: function() { - this.reloadProgressBlock(); //this.nextStep(); this.gotoSection('payment'); //this.accordion.openNextSection(true); }, setPayment: function() { - this.reloadProgressBlock(); //this.nextStep(); this.gotoSection('review'); //this.accordion.openNextSection(true); @@ -198,7 +216,6 @@ Checkout.prototype = { } if (response.goto_section) { - this.reloadProgressBlock(); this.gotoSection(response.goto_section); return true; } @@ -308,6 +325,7 @@ Billing.prototype = { resetLoadWaiting: function(transport){ checkout.setLoadWaiting(false); + document.body.fire('billing-request:completed', {transport: transport}); }, /** @@ -877,7 +895,6 @@ Review.prototype = { if (response.goto_section) { checkout.gotoSection(response.goto_section); - checkout.reloadProgressBlock(); } } }, diff --git a/app/code/core/Mage/Checkout/view/frontend/success.phtml b/app/code/core/Mage/Checkout/view/frontend/success.phtml index c34f4bebf65e3411b80dc499b20dda05d9b117d2..bc9ddce297bc0ee3fc4e27dfc7efb26f2c473bdb 100644 --- a/app/code/core/Mage/Checkout/view/frontend/success.phtml +++ b/app/code/core/Mage/Checkout/view/frontend/success.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Checkout/view/frontend/total/default.phtml b/app/code/core/Mage/Checkout/view/frontend/total/default.phtml index d5a397b0cb2cb5788d42f37eb44b137135f45a35..14a47172a4eef41e1c4acd6903b4d0fb9a194196 100644 --- a/app/code/core/Mage/Checkout/view/frontend/total/default.phtml +++ b/app/code/core/Mage/Checkout/view/frontend/total/default.phtml @@ -20,14 +20,14 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> <tr> <th colspan="<?php echo $this->getColspan(); ?>" style="<?php echo $this->getTotal()->getStyle() ?>" class="a-right"> <?php if ($this->getRenderingArea() == $this->getTotal()->getArea()): ?><strong><?php endif; ?> - <?php echo $this->getTotal()->getTitle() ?> + <?php echo $this->escapeHtml($this->getTotal()->getTitle()); ?> <?php if ($this->getRenderingArea() == $this->getTotal()->getArea()): ?></strong><?php endif; ?> </th> <td style="<?php echo $this->getTotal()->getStyle() ?>" class="a-right"> diff --git a/app/code/core/Mage/Checkout/view/frontend/total/nominal.phtml b/app/code/core/Mage/Checkout/view/frontend/total/nominal.phtml index 721a1dfd1a0bc79f44c175323d1ae4b492311f00..2f6387f85be3920a1425d1af8cc71617f797a9d8 100644 --- a/app/code/core/Mage/Checkout/view/frontend/total/nominal.phtml +++ b/app/code/core/Mage/Checkout/view/frontend/total/nominal.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Checkout/view/frontend/total/tax.phtml b/app/code/core/Mage/Checkout/view/frontend/total/tax.phtml index 21f954487c6b7b2dfb529936f191b135f93cdbc2..5a4c01e829196e71b609bab8829e643a91e9217f 100644 --- a/app/code/core/Mage/Checkout/view/frontend/total/tax.phtml +++ b/app/code/core/Mage/Checkout/view/frontend/total/tax.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Cms/Block/Block.php b/app/code/core/Mage/Cms/Block/Block.php index 7abc07bfd8b6f3865dd8bed19066074787a175ef..5b495d26643b9ec658e009d993f76a147b96b10c 100644 --- a/app/code/core/Mage/Cms/Block/Block.php +++ b/app/code/core/Mage/Cms/Block/Block.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Cms - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Cms/Block/Page.php b/app/code/core/Mage/Cms/Block/Page.php index f446f51e98d63a6258c2fe3114941ca6b550be0f..7b768cdf36b1f9fd4e61cb8d21fdb4f7ac751853 100644 --- a/app/code/core/Mage/Cms/Block/Page.php +++ b/app/code/core/Mage/Cms/Block/Page.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Cms - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -98,7 +98,7 @@ class Mage_Cms_Block_Page extends Mage_Core_Block_Abstract $helper = Mage::helper('Mage_Cms_Helper_Data'); $processor = $helper->getPageTemplateProcessor(); $html = $processor->filter($this->getPage()->getContent()); - $html = $this->getMessagesBlock()->getGroupedHtml() . $html; + $html = $this->getMessagesBlock()->toHtml() . $html; return $html; } } diff --git a/app/code/core/Mage/Cms/Block/Widget/Block.php b/app/code/core/Mage/Cms/Block/Widget/Block.php index af8793f7fb0635312aa139c7bdeafabaa1cadb7d..7758942576bddaad403d6daa16efdf95e5214c28 100644 --- a/app/code/core/Mage/Cms/Block/Widget/Block.php +++ b/app/code/core/Mage/Cms/Block/Widget/Block.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Cms - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Cms/Block/Widget/Page/Link.php b/app/code/core/Mage/Cms/Block/Widget/Page/Link.php index 80693ef6f84055265d62abec43a52ecec0f4a14a..30e0107c53c10197c47612286df40c0f0f41b46f 100644 --- a/app/code/core/Mage/Cms/Block/Widget/Page/Link.php +++ b/app/code/core/Mage/Cms/Block/Widget/Page/Link.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Cms - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Cms/Controller/Router.php b/app/code/core/Mage/Cms/Controller/Router.php index d7a73ec0f6abfd2c9d29c4d0a27a411915468206..81698acabcaafa65c451be4cf8c4909c0a6f7886 100644 --- a/app/code/core/Mage/Cms/Controller/Router.php +++ b/app/code/core/Mage/Cms/Controller/Router.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Cms - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Cms/Helper/Data.php b/app/code/core/Mage/Cms/Helper/Data.php index ac81ca9d54513b2fd319b9d72c5e0e7216795543..1cc961b9c13fb92786cf20bfe3c2e1619e0eeac0 100644 --- a/app/code/core/Mage/Cms/Helper/Data.php +++ b/app/code/core/Mage/Cms/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Cms - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Cms/Helper/Page.php b/app/code/core/Mage/Cms/Helper/Page.php index 58866639ec5426e1b5b47118c3b6e469687d81fc..5cb46256381ea0d974347cdc02efbe33afa62e4a 100644 --- a/app/code/core/Mage/Cms/Helper/Page.php +++ b/app/code/core/Mage/Cms/Helper/Page.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Cms - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -120,10 +120,13 @@ class Mage_Cms_Helper_Page extends Mage_Core_Helper_Abstract ->applyTemplate($page->getRootTemplate()); } - foreach (array('Mage_Catalog_Model_Session', 'Mage_Checkout_Model_Session') as $class_name) { - $storage = Mage::getSingleton($class_name); + /* @TODO: Move catalog and checkout storage types to appropriate modules */ + $messageBlock = $action->getLayout()->getMessagesBlock(); + foreach (array('Mage_Catalog_Model_Session', 'Mage_Checkout_Model_Session', 'Mage_Customer_Model_Session') as $storageType) { + $storage = Mage::getSingleton($storageType); if ($storage) { - $action->getLayout()->getMessagesBlock()->addMessages($storage->getMessages(true)); + $messageBlock->addStorageType($storageType); + $messageBlock->addMessages($storage->getMessages(true)); } } diff --git a/app/code/core/Mage/Cms/Helper/Wysiwyg/Images.php b/app/code/core/Mage/Cms/Helper/Wysiwyg/Images.php index 31c1bd13abcdc7cd1579bf723dcdbcc8057e044a..bd56420960ec98993f494df7a31a59663ec5c743 100644 --- a/app/code/core/Mage/Cms/Helper/Wysiwyg/Images.php +++ b/app/code/core/Mage/Cms/Helper/Wysiwyg/Images.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Cms - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Cms/Model/Block.php b/app/code/core/Mage/Cms/Model/Block.php index e325879f23337bd1343590b631483790ee41a5eb..9fec681fec906a0c68758e96b773f611b4304b90 100644 --- a/app/code/core/Mage/Cms/Model/Block.php +++ b/app/code/core/Mage/Cms/Model/Block.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Cms - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Cms/Model/Observer.php b/app/code/core/Mage/Cms/Model/Observer.php index f9dd49f4a454e6356ee458d77a48873a46749011..c3c19c7fbaa4b4895318a373c26a8d913617b074 100644 --- a/app/code/core/Mage/Cms/Model/Observer.php +++ b/app/code/core/Mage/Cms/Model/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Cms - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Cms/Model/Page.php b/app/code/core/Mage/Cms/Model/Page.php index 9cf9a0b9964ae9567614b1b86de6a320382f0674..8dab6fcf054d7aa22579a738820c85ba7ab0edef 100644 --- a/app/code/core/Mage/Cms/Model/Page.php +++ b/app/code/core/Mage/Cms/Model/Page.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Cms - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Cms/Model/Resource/Block.php b/app/code/core/Mage/Cms/Model/Resource/Block.php index c5c4dca637dbdc428b850956d4f8fffdf3ab1180..51e135031feeed2a012d4a9e8d29ab96dff09732 100755 --- a/app/code/core/Mage/Cms/Model/Resource/Block.php +++ b/app/code/core/Mage/Cms/Model/Resource/Block.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Cms - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Cms/Model/Resource/Block/Collection.php b/app/code/core/Mage/Cms/Model/Resource/Block/Collection.php index eba1ff9da7d7e738d48d12f7174ddac180d74b48..9c57f16b39d33f4e97a53a10eda74b31723867a9 100755 --- a/app/code/core/Mage/Cms/Model/Resource/Block/Collection.php +++ b/app/code/core/Mage/Cms/Model/Resource/Block/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Cms - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Cms/Model/Resource/Page.php b/app/code/core/Mage/Cms/Model/Resource/Page.php index cedbb288653c805584d19e7c48d418f1e7c49d74..3d38d8db22e58b2848cdbbb2130f11331f23ac45 100755 --- a/app/code/core/Mage/Cms/Model/Resource/Page.php +++ b/app/code/core/Mage/Cms/Model/Resource/Page.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Cms - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Cms/Model/Resource/Page/Collection.php b/app/code/core/Mage/Cms/Model/Resource/Page/Collection.php index ff4a9f436c3697dd761f645b39dc20f0468fab1f..5ae5edb3f3892a03ae1fcd4733f49cdcdcfa6822 100755 --- a/app/code/core/Mage/Cms/Model/Resource/Page/Collection.php +++ b/app/code/core/Mage/Cms/Model/Resource/Page/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Cms - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Cms/Model/Resource/Page/Service.php b/app/code/core/Mage/Cms/Model/Resource/Page/Service.php index 3e15d79562a0e93fd9a492ef68f7a12e4f1fcde4..35ed0caec3a5910b32ef8f4b5f4ff518795fc7f4 100644 --- a/app/code/core/Mage/Cms/Model/Resource/Page/Service.php +++ b/app/code/core/Mage/Cms/Model/Resource/Page/Service.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Cms - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Cms/Model/Template/Filter.php b/app/code/core/Mage/Cms/Model/Template/Filter.php index fd007a6dde05bd37ac00d7625d9c76040625178a..5afef1756fd2bb1a23946f208c1e8f9745df87e9 100644 --- a/app/code/core/Mage/Cms/Model/Template/Filter.php +++ b/app/code/core/Mage/Cms/Model/Template/Filter.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Cms - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Cms/Model/Wysiwyg/Config.php b/app/code/core/Mage/Cms/Model/Wysiwyg/Config.php index 9a8296cc8739b6e8da008a3d6b5f7f9805dd7e00..3b2d5fa4fe498115bf6e5431621650fd2c33b3d6 100644 --- a/app/code/core/Mage/Cms/Model/Wysiwyg/Config.php +++ b/app/code/core/Mage/Cms/Model/Wysiwyg/Config.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Cms - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Cms/Model/Wysiwyg/Images/Storage.php b/app/code/core/Mage/Cms/Model/Wysiwyg/Images/Storage.php index 748348b86ca9c62db28f026257f92e60aa47b2db..47f4034be23630b5f78a6521e5902bd332d38683 100644 --- a/app/code/core/Mage/Cms/Model/Wysiwyg/Images/Storage.php +++ b/app/code/core/Mage/Cms/Model/Wysiwyg/Images/Storage.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Cms - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Cms/Model/Wysiwyg/Images/Storage/Collection.php b/app/code/core/Mage/Cms/Model/Wysiwyg/Images/Storage/Collection.php index 55dd63109cd9fd1a045d9bc072c9e9160d95abaf..52ac19a20d8c353d7c4f06db4c641f1fbff31165 100644 --- a/app/code/core/Mage/Cms/Model/Wysiwyg/Images/Storage/Collection.php +++ b/app/code/core/Mage/Cms/Model/Wysiwyg/Images/Storage/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Cms - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Cms/controllers/IndexController.php b/app/code/core/Mage/Cms/controllers/IndexController.php index db1d6250d5c5f6b162ff73c1c76e91ee41edad97..764725eed5871b13e240c4ba1f583a0a425d01dd 100644 --- a/app/code/core/Mage/Cms/controllers/IndexController.php +++ b/app/code/core/Mage/Cms/controllers/IndexController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Cms - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Cms/controllers/PageController.php b/app/code/core/Mage/Cms/controllers/PageController.php index bb1819aa8bbe837da3d5b482d2fb806cc26f3d9e..2451979eeb3f064466dffd1c6929c5072be77fb7 100644 --- a/app/code/core/Mage/Cms/controllers/PageController.php +++ b/app/code/core/Mage/Cms/controllers/PageController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Cms - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Cms/data/cms_setup/data-install-1.6.0.0.php b/app/code/core/Mage/Cms/data/cms_setup/data-install-1.6.0.0.php index b7fa099f8b8df246f58f28eaa86ac1128586d248..1dcb908372da7b223540f6dbbd2e4676b331d139 100644 --- a/app/code/core/Mage/Cms/data/cms_setup/data-install-1.6.0.0.php +++ b/app/code/core/Mage/Cms/data/cms_setup/data-install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Cms - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Cms/etc/adminhtml.xml b/app/code/core/Mage/Cms/etc/adminhtml.xml index 9cf677a5c4ffb384ac41f924443371d9a00fa752..8f2220b415dcc3d6766b3e384596f2922a88afde 100644 --- a/app/code/core/Mage/Cms/etc/adminhtml.xml +++ b/app/code/core/Mage/Cms/etc/adminhtml.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Cms - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Cms/etc/config.xml b/app/code/core/Mage/Cms/etc/config.xml index f55b784e63b30c59c7689e7d96a205ff624064bf..431d8766863a12f6845b654efcdda80a01d35e42 100644 --- a/app/code/core/Mage/Cms/etc/config.xml +++ b/app/code/core/Mage/Cms/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Cms - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Cms/etc/system.xml b/app/code/core/Mage/Cms/etc/system.xml index 12147c3922db42339adfa25e134cf13037ffc0a3..031262c0304989ea6cbd955de39de2ebb5ca57a4 100644 --- a/app/code/core/Mage/Cms/etc/system.xml +++ b/app/code/core/Mage/Cms/etc/system.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Cms - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Cms/etc/widget.xml b/app/code/core/Mage/Cms/etc/widget.xml index 49affaa11b50373598822d82063dc7ed338b3123..4ad894955acd17a2a32b91ce940ebc7715e24f29 100644 --- a/app/code/core/Mage/Cms/etc/widget.xml +++ b/app/code/core/Mage/Cms/etc/widget.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Cms - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Cms/sql/cms_setup/install-1.6.0.0.php b/app/code/core/Mage/Cms/sql/cms_setup/install-1.6.0.0.php index 6ae7703ed4ef26c851fe109a12ddb60ab757df54..bdcf84626be62b98c5153d5725b540509bf71da9 100644 --- a/app/code/core/Mage/Cms/sql/cms_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/Cms/sql/cms_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Cms - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Cms/view/frontend/content.phtml b/app/code/core/Mage/Cms/view/frontend/content.phtml index 522a62d4c9383be09aa3500bf87284a88e7408e8..ed722f90307ddedb1b91a995eb97d20779bbf70b 100644 --- a/app/code/core/Mage/Cms/view/frontend/content.phtml +++ b/app/code/core/Mage/Cms/view/frontend/content.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Cms/view/frontend/content_heading.phtml b/app/code/core/Mage/Cms/view/frontend/content_heading.phtml index 080c36e61693a8aa4ce74763d0c731b17be5d611..194ae9533d8e69735042f65cc26eb9594408c2ea 100644 --- a/app/code/core/Mage/Cms/view/frontend/content_heading.phtml +++ b/app/code/core/Mage/Cms/view/frontend/content_heading.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Cms/view/frontend/default/home.phtml b/app/code/core/Mage/Cms/view/frontend/default/home.phtml index f9b37de6e29175491458d917fc3b61d24af96e28..d87c9c3452aaa415625bd3e5a22448da76124024 100644 --- a/app/code/core/Mage/Cms/view/frontend/default/home.phtml +++ b/app/code/core/Mage/Cms/view/frontend/default/home.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Cms/view/frontend/default/no-route.phtml b/app/code/core/Mage/Cms/view/frontend/default/no-route.phtml index c79e2fdd00931fe83f1519a89265b7ecba1fb001..7db45a376f692c48f407ecd0d35e8511a0302ab8 100644 --- a/app/code/core/Mage/Cms/view/frontend/default/no-route.phtml +++ b/app/code/core/Mage/Cms/view/frontend/default/no-route.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Cms/view/frontend/layout.xml b/app/code/core/Mage/Cms/view/frontend/layout.xml index 52e28b764742ddb82bfcdc958993f5087e578bd4..8ccd42c0924f0a267c9b97e3b05de378bfbb0b53 100644 --- a/app/code/core/Mage/Cms/view/frontend/layout.xml +++ b/app/code/core/Mage/Cms/view/frontend/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Cms/view/frontend/meta.phtml b/app/code/core/Mage/Cms/view/frontend/meta.phtml index 6f130a84f4a419f8b39418ec35916ec81f6bbe38..ebfb829621284cafc60b4b09a3f56b3441635019 100644 --- a/app/code/core/Mage/Cms/view/frontend/meta.phtml +++ b/app/code/core/Mage/Cms/view/frontend/meta.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Cms/view/frontend/widget/link/link_block.phtml b/app/code/core/Mage/Cms/view/frontend/widget/link/link_block.phtml index 509a150c15f9662436fe6618e3bcded9e2e94d4b..db3fa85e86dd2127ce48a3d34bb92778385f8b56 100644 --- a/app/code/core/Mage/Cms/view/frontend/widget/link/link_block.phtml +++ b/app/code/core/Mage/Cms/view/frontend/widget/link/link_block.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Cms/view/frontend/widget/link/link_inline.phtml b/app/code/core/Mage/Cms/view/frontend/widget/link/link_inline.phtml index 228ec9978230cce1798fe4855a90a7b699b18951..01f7bdca0805eabb9542ca5b7938158651cab77e 100644 --- a/app/code/core/Mage/Cms/view/frontend/widget/link/link_inline.phtml +++ b/app/code/core/Mage/Cms/view/frontend/widget/link/link_inline.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Cms/view/frontend/widget/static_block/default.phtml b/app/code/core/Mage/Cms/view/frontend/widget/static_block/default.phtml index 331b1b496677535a66998074f155d653a67dfc80..89c12362c6a8a6cd3b8366492da9e9dd36068b76 100644 --- a/app/code/core/Mage/Cms/view/frontend/widget/static_block/default.phtml +++ b/app/code/core/Mage/Cms/view/frontend/widget/static_block/default.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Cms/view/frontend/widgets.css b/app/code/core/Mage/Cms/view/frontend/widgets.css index 3c13fd75797d5165940bc5230a610c6c80f2a124..c21bc5ea889273a60501324ca7253c3ff3ebeae3 100644 --- a/app/code/core/Mage/Cms/view/frontend/widgets.css +++ b/app/code/core/Mage/Cms/view/frontend/widgets.css @@ -19,7 +19,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit.php b/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit.php index 5344aa5c9db26bc6559fed538fba78e076450d56..5bccbde5d7157c6da4106daf93b6fb1851457c08 100644 --- a/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit.php +++ b/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Form.php b/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Form.php index 0e796385ca37d5a88ee55c841539e1ad8eee2c35..a05c44e988e26c4bf67c69b78f3ae5e94a02943e 100644 --- a/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Form.php +++ b/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Abstract.php b/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Abstract.php index 640bfb5add35e3885d8e66aca4cf86b8d602b4f0..486a869adaafb58f6f28804d6f6330ae380e61ac 100644 --- a/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Abstract.php +++ b/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -148,7 +148,7 @@ abstract class Mage_Connect_Block_Adminhtml_Extension_Custom_Edit_Tab_Abstract */ public function getTabLabel() { - return Mage::helper('Mage_Connect_Helper_Data')->__(''); + return ''; } /** @@ -158,7 +158,7 @@ abstract class Mage_Connect_Block_Adminhtml_Extension_Custom_Edit_Tab_Abstract */ public function getTabTitle() { - return Mage::helper('Mage_Connect_Helper_Data')->__(''); + return ''; } public function canShowTab() @@ -170,4 +170,4 @@ abstract class Mage_Connect_Block_Adminhtml_Extension_Custom_Edit_Tab_Abstract { return false; } -} +} \ No newline at end of file diff --git a/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Authors.php b/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Authors.php index a75ad1f66b0983d4060a18bfebbe5914819beb97..c4c3e2568588f2e48e4d64b99d7ecb636dca28fc 100644 --- a/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Authors.php +++ b/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Authors.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Contents.php b/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Contents.php index 8c337936692832d6e9b82cc67a7a7c3b109c2f41..43114314ba80c242ba5f1518377e2a1e023d4e72 100644 --- a/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Contents.php +++ b/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Contents.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Depends.php b/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Depends.php index fb380e93bb4daf8a9a5b0c88e1708cc1dcd2ea58..36669a17ece947444192287e8011c18a464d35cb 100644 --- a/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Depends.php +++ b/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Depends.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Grid.php b/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Grid.php index 30f593ebb54d4de6d26035f66f64da7289047df9..d9298e791db6b8fefe0063d6443278a54ac5ad8e 100644 --- a/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Grid.php +++ b/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Load.php b/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Load.php index 3e25084ee1153e9cd0c27ae6f64bfc8c9170aa35..aa8091a115972f18537820630133aef1c61655e7 100644 --- a/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Load.php +++ b/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Load.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Local.php b/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Local.php index f0e69a3524980154c8a20de03c2d7729fad39de6..1cbfeb823d6436aa2a85129d80ac6b7832081641 100644 --- a/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Local.php +++ b/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Local.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Package.php b/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Package.php index c9928db62134db0d9c4295de266dcdeb06709f20..1a7f32b0b5a20e25d4da844c8b769ba87f8ebcac 100644 --- a/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Package.php +++ b/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Package.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Release.php b/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Release.php index de42bf2b83f9a488d8c81727b4ff027e06b2e7fc..4455bb6f6ef7255e79a473808735946e41b466ad 100644 --- a/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Release.php +++ b/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Release.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tabs.php b/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tabs.php index 6b0b1836b15debab27f6f80ab5c2cc15c16f1263..7d49b657697ced0339477714eb23ba7cb14edca8 100644 --- a/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tabs.php +++ b/app/code/core/Mage/Connect/Block/Adminhtml/Extension/Custom/Edit/Tabs.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Connect/Helper/Data.php b/app/code/core/Mage/Connect/Helper/Data.php index f39d8ab3157fbdb12c872d9ad10e425422d528a9..f03545d2afb854f061f2e2639503089b524c6661 100644 --- a/app/code/core/Mage/Connect/Helper/Data.php +++ b/app/code/core/Mage/Connect/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Connect/Model/Extension.php b/app/code/core/Mage/Connect/Model/Extension.php index 8c18c21fdb1b8d68716ab004fc7379ffb1aa2186..43da0aeff14389fa61b3eb695ec1ba9b72097937 100644 --- a/app/code/core/Mage/Connect/Model/Extension.php +++ b/app/code/core/Mage/Connect/Model/Extension.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Connect/Model/Extension/Collection.php b/app/code/core/Mage/Connect/Model/Extension/Collection.php index 235742cc71ddd936c969190f8027769334285fa1..c1c6994827472727327f1e53e8f0327d52a855ac 100644 --- a/app/code/core/Mage/Connect/Model/Extension/Collection.php +++ b/app/code/core/Mage/Connect/Model/Extension/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Connect/Model/Session.php b/app/code/core/Mage/Connect/Model/Session.php index 2c6d094c3a7132ff83d2915fb0f7c88a4a6a38dc..dcdfc687322061dd874f9af0497deaafcdfa1661 100644 --- a/app/code/core/Mage/Connect/Model/Session.php +++ b/app/code/core/Mage/Connect/Model/Session.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Connect/controllers/Adminhtml/Extension/CustomController.php b/app/code/core/Mage/Connect/controllers/Adminhtml/Extension/CustomController.php index 13798ac6d238659add20fe62ea65356efd5e47cf..ed9140052d9c54504641f59fa3c56244a3a0f478 100644 --- a/app/code/core/Mage/Connect/controllers/Adminhtml/Extension/CustomController.php +++ b/app/code/core/Mage/Connect/controllers/Adminhtml/Extension/CustomController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Connect/controllers/Adminhtml/Extension/LocalController.php b/app/code/core/Mage/Connect/controllers/Adminhtml/Extension/LocalController.php index 50ae9e8154c6e09dd39289e8e5aa89192e18da02..9c38e0bf7bdebc81788f66102d5b39600cd30840 100644 --- a/app/code/core/Mage/Connect/controllers/Adminhtml/Extension/LocalController.php +++ b/app/code/core/Mage/Connect/controllers/Adminhtml/Extension/LocalController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Connect/etc/adminhtml.xml b/app/code/core/Mage/Connect/etc/adminhtml.xml index 73992519f51d9a5eca9c95644bad18adf04531de..c969d6f53c6ad5381ad514f83dbfa706c00a04dc 100644 --- a/app/code/core/Mage/Connect/etc/adminhtml.xml +++ b/app/code/core/Mage/Connect/etc/adminhtml.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Connect/etc/config.xml b/app/code/core/Mage/Connect/etc/config.xml index 2336fd747cf431e7a7208a88daf0da0547776911..1fd7edc0676158c33946740e39a4a4278ec6ef2f 100644 --- a/app/code/core/Mage/Connect/etc/config.xml +++ b/app/code/core/Mage/Connect/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Connect/view/adminhtml/extension/custom/authors.phtml b/app/code/core/Mage/Connect/view/adminhtml/extension/custom/authors.phtml index 11b5fe2d1fcbb8fca673d7a84b8219b77b43655c..cfa36da364aac467cfe395cabdcafc8305294b69 100644 --- a/app/code/core/Mage/Connect/view/adminhtml/extension/custom/authors.phtml +++ b/app/code/core/Mage/Connect/view/adminhtml/extension/custom/authors.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Connect/view/adminhtml/extension/custom/contents.phtml b/app/code/core/Mage/Connect/view/adminhtml/extension/custom/contents.phtml index ac696f372f0755178976ae522b17bde9901256e7..6cd5ff19eca28e9ba7c1fb3b0ce58770033a4d33 100644 --- a/app/code/core/Mage/Connect/view/adminhtml/extension/custom/contents.phtml +++ b/app/code/core/Mage/Connect/view/adminhtml/extension/custom/contents.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Connect/view/adminhtml/extension/custom/depends.phtml b/app/code/core/Mage/Connect/view/adminhtml/extension/custom/depends.phtml index e2a90dbd2c0bfff58f1f19bf88321c4053d0aecb..aeff6e7d7b92d56c30b3d10f0ba742301563abb1 100644 --- a/app/code/core/Mage/Connect/view/adminhtml/extension/custom/depends.phtml +++ b/app/code/core/Mage/Connect/view/adminhtml/extension/custom/depends.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Connect/view/adminhtml/extension/custom/load.phtml b/app/code/core/Mage/Connect/view/adminhtml/extension/custom/load.phtml index 075106f6df44198f5972d8b6440e665962f79b34..ba4d46aa84ffcb9d0f35e7710c43a04d3abe05c6 100644 --- a/app/code/core/Mage/Connect/view/adminhtml/extension/custom/load.phtml +++ b/app/code/core/Mage/Connect/view/adminhtml/extension/custom/load.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Connect/view/adminhtml/extension/custom/package.phtml b/app/code/core/Mage/Connect/view/adminhtml/extension/custom/package.phtml index eb1a12800cf06a2b11747dd778e7317a287d0331..334657e4b0166cce216f10c2083625bacea003df 100644 --- a/app/code/core/Mage/Connect/view/adminhtml/extension/custom/package.phtml +++ b/app/code/core/Mage/Connect/view/adminhtml/extension/custom/package.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Connect/view/adminhtml/extension/custom/release.phtml b/app/code/core/Mage/Connect/view/adminhtml/extension/custom/release.phtml index fbc08a27e9795bb34fa3f0393db8797d6acae3d5..8622603c0c9783e8823127659d10ddeafec62685 100644 --- a/app/code/core/Mage/Connect/view/adminhtml/extension/custom/release.phtml +++ b/app/code/core/Mage/Connect/view/adminhtml/extension/custom/release.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Connect/view/adminhtml/layout.xml b/app/code/core/Mage/Connect/view/adminhtml/layout.xml index bc462124b227845343933d469199ab0b13f2b45b..c15baeb25e7fa2ce52b234d33ee82f5acb1770a9 100644 --- a/app/code/core/Mage/Connect/view/adminhtml/layout.xml +++ b/app/code/core/Mage/Connect/view/adminhtml/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Contacts/Helper/Data.php b/app/code/core/Mage/Contacts/Helper/Data.php index ae94345fb20309b1b69236c6ad40aed02ceb7ccc..36f8a442b08c8a3e85dcb7cf3b3192b054a1592b 100644 --- a/app/code/core/Mage/Contacts/Helper/Data.php +++ b/app/code/core/Mage/Contacts/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Contacts - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Contacts/Model/System/Config/Backend/Links.php b/app/code/core/Mage/Contacts/Model/System/Config/Backend/Links.php index 0cfd7d6885cfc9a7c1363573c9aca8bf4d8bdec0..b4a5bb953173cc8a47c08c6fd3bd685fb50362d2 100644 --- a/app/code/core/Mage/Contacts/Model/System/Config/Backend/Links.php +++ b/app/code/core/Mage/Contacts/Model/System/Config/Backend/Links.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Contacts - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Contacts/controllers/IndexController.php b/app/code/core/Mage/Contacts/controllers/IndexController.php index d7234d7cbef0654a67d48e86a2bed287a2ca1a7d..7e2b5978d938126643ebad7d378aade6bcdeecf1 100644 --- a/app/code/core/Mage/Contacts/controllers/IndexController.php +++ b/app/code/core/Mage/Contacts/controllers/IndexController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Contacts - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Contacts/etc/adminhtml.xml b/app/code/core/Mage/Contacts/etc/adminhtml.xml index e11c3ad0afe8fefe021f82a48c63de7ad685cf57..5b6b5b4197486bebd42203fd7bc50b92e63f7109 100644 --- a/app/code/core/Mage/Contacts/etc/adminhtml.xml +++ b/app/code/core/Mage/Contacts/etc/adminhtml.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Contacts - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Contacts/etc/config.xml b/app/code/core/Mage/Contacts/etc/config.xml index 0f7188cfd7e01236a8f1eb31b6cac356646f0a79..bc06a998a308fbe8ab0e57a2406c49c0ee341e88 100644 --- a/app/code/core/Mage/Contacts/etc/config.xml +++ b/app/code/core/Mage/Contacts/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Contacts - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Contacts/etc/system.xml b/app/code/core/Mage/Contacts/etc/system.xml index 552a499933cccf1cebc48b7a5fd3e884a02d9bba..704dfe3938926c810ce86f47d4a8edb683cb92d3 100644 --- a/app/code/core/Mage/Contacts/etc/system.xml +++ b/app/code/core/Mage/Contacts/etc/system.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Contacts - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Contacts/sql/contacts_setup/install-1.6.0.0.php b/app/code/core/Mage/Contacts/sql/contacts_setup/install-1.6.0.0.php index 2061c930428848bc98f1f63ddfc14f477b1dee6d..787d43990001a48685ec70c8c0b330c2aca6480b 100644 --- a/app/code/core/Mage/Contacts/sql/contacts_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/Contacts/sql/contacts_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Contacts - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Contacts/view/frontend/form.phtml b/app/code/core/Mage/Contacts/view/frontend/form.phtml index 56ba8691d741a519421282d469611f16c944b93a..077b4d0283dd2da713e9456a28228f5d45a8bc20 100644 --- a/app/code/core/Mage/Contacts/view/frontend/form.phtml +++ b/app/code/core/Mage/Contacts/view/frontend/form.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Contacts/view/frontend/layout.xml b/app/code/core/Mage/Contacts/view/frontend/layout.xml index cefe1fa1be852dbf7bd1da2b4e1b3d7ab9b0fc40..6d6d5073f8afe9aaf0e0da0172a7cf64cde1fc95 100644 --- a/app/code/core/Mage/Contacts/view/frontend/layout.xml +++ b/app/code/core/Mage/Contacts/view/frontend/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Core/Block/Abstract.php b/app/code/core/Mage/Core/Block/Abstract.php index 6938e1a62ae6d9555a2fcb760d678afdde9269d6..a86fae89842d554430d9303b3f7da1b50a493d9c 100644 --- a/app/code/core/Mage/Core/Block/Abstract.php +++ b/app/code/core/Mage/Core/Block/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Block/Flush.php b/app/code/core/Mage/Core/Block/Flush.php index 85a61346d847baf3ad402dd519ff109ec4bc4334..3b936a2157b62f1c917c3de044c5de5b380191a9 100644 --- a/app/code/core/Mage/Core/Block/Flush.php +++ b/app/code/core/Mage/Core/Block/Flush.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Block/Html/Calendar.php b/app/code/core/Mage/Core/Block/Html/Calendar.php index bd912c61cb48d927da54688fdf9ce6f4024593de..0b07f84e024011fbb0e3de9937f3114dc07ae0a9 100644 --- a/app/code/core/Mage/Core/Block/Html/Calendar.php +++ b/app/code/core/Mage/Core/Block/Html/Calendar.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Block/Html/Date.php b/app/code/core/Mage/Core/Block/Html/Date.php index 672dd0c1493521b78bbc640a21115ef31e955b05..a782a05b0fc8b27a88ecb7ab0468797bd3fd98c9 100644 --- a/app/code/core/Mage/Core/Block/Html/Date.php +++ b/app/code/core/Mage/Core/Block/Html/Date.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Block/Html/Link.php b/app/code/core/Mage/Core/Block/Html/Link.php index 1bd0c45ad5fa80e32d9cc2fb082007285d524e21..6da9e2828d7a9bf6c7a173af73b9489a88564d8c 100644 --- a/app/code/core/Mage/Core/Block/Html/Link.php +++ b/app/code/core/Mage/Core/Block/Html/Link.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Block/Html/Select.php b/app/code/core/Mage/Core/Block/Html/Select.php index 5e57f5a3376e4f3e03fa2e037f3b8349522d3223..d848348fcaa8ee591ddb727716b46c7d1d4283f6 100644 --- a/app/code/core/Mage/Core/Block/Html/Select.php +++ b/app/code/core/Mage/Core/Block/Html/Select.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Block/Messages.php b/app/code/core/Mage/Core/Block/Messages.php index a6e4a112065741bb9f218e84378467c9f501b026..25889f1e7b0d3d62481d965c6ab0e4e4cbb2839e 100644 --- a/app/code/core/Mage/Core/Block/Messages.php +++ b/app/code/core/Mage/Core/Block/Messages.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Block/Store/Switcher.php b/app/code/core/Mage/Core/Block/Store/Switcher.php index e87daf3afc09bddc872efcee79f8efe34bfd8496..d2390703771ed6eb8078d040c3f1800f299c4ca3 100644 --- a/app/code/core/Mage/Core/Block/Store/Switcher.php +++ b/app/code/core/Mage/Core/Block/Store/Switcher.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Block/Template.php b/app/code/core/Mage/Core/Block/Template.php index 3385ed97f3f585cd23fa86484bd0163d4504e124..7c66af87330f344746c4e506a70c460162a1cc72 100644 --- a/app/code/core/Mage/Core/Block/Template.php +++ b/app/code/core/Mage/Core/Block/Template.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Block/Template/Facade.php b/app/code/core/Mage/Core/Block/Template/Facade.php index edb432b211315f0dd65fbc8ffaf7367a74ce6724..62a5f3ff45ad8b7f4bb5ef99b874fc92536321c8 100644 --- a/app/code/core/Mage/Core/Block/Template/Facade.php +++ b/app/code/core/Mage/Core/Block/Template/Facade.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Block/Template/Smarty.php b/app/code/core/Mage/Core/Block/Template/Smarty.php index e79f94abac1d4a000834305358c734aa68b28652..25ad728896f9eed00423452687a959f8e09609ce 100644 --- a/app/code/core/Mage/Core/Block/Template/Smarty.php +++ b/app/code/core/Mage/Core/Block/Template/Smarty.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Block/Template/Zend.php b/app/code/core/Mage/Core/Block/Template/Zend.php index 01caa23d399658b390b7b6bc1dc0cc4ddd3d683f..ee24aa8ff6a6a14803bb8c717ceeaf4a3762c32e 100644 --- a/app/code/core/Mage/Core/Block/Template/Zend.php +++ b/app/code/core/Mage/Core/Block/Template/Zend.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Block/Text.php b/app/code/core/Mage/Core/Block/Text.php index 2d54b827f024172b11c9e68a3326a7d05ebf38cc..3f96583db501c217782359f6221e3e6329578ca1 100644 --- a/app/code/core/Mage/Core/Block/Text.php +++ b/app/code/core/Mage/Core/Block/Text.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Block/Text/List.php b/app/code/core/Mage/Core/Block/Text/List.php index 77e5ccdd25bea38a16e65db9cd93d6f82bf847aa..47f8c1c2888f9240a7395cadc1ce53f1dd90e687 100644 --- a/app/code/core/Mage/Core/Block/Text/List.php +++ b/app/code/core/Mage/Core/Block/Text/List.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Block/Text/List/Item.php b/app/code/core/Mage/Core/Block/Text/List/Item.php index 6923b8aee2e4060aeab756a984e4ce8763208d13..2c511542a0bb1eb8a43e837eea5fc5a3eef6d8c1 100644 --- a/app/code/core/Mage/Core/Block/Text/List/Item.php +++ b/app/code/core/Mage/Core/Block/Text/List/Item.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Block/Text/List/Link.php b/app/code/core/Mage/Core/Block/Text/List/Link.php index e269121883054df88cb45441c4eef62e7ddf993f..e019907f7a7bac9c5c7cf2b9a13933539444de0f 100644 --- a/app/code/core/Mage/Core/Block/Text/List/Link.php +++ b/app/code/core/Mage/Core/Block/Text/List/Link.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Controller/Front/Action.php b/app/code/core/Mage/Core/Controller/Front/Action.php index 918810b364bc9275183d03a55bc3766332dccbdc..6d3043ca2a416efdb73f425b641e42a3fb453b93 100644 --- a/app/code/core/Mage/Core/Controller/Front/Action.php +++ b/app/code/core/Mage/Core/Controller/Front/Action.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -48,7 +48,7 @@ class Mage_Core_Controller_Front_Action extends Mage_Core_Controller_Varien_Acti protected $_sessionNamespace = 'frontend'; /** - * Predispatch: shoud set layout area + * Predispatch: should set layout area * * @return Mage_Core_Controller_Front_Action */ diff --git a/app/code/core/Mage/Core/Controller/Front/Router.php b/app/code/core/Mage/Core/Controller/Front/Router.php index a47551b1a4597774bb45e4a8537d0413fb89f1a8..8625f59269ba23639e4c2aad82cedcd271d623ab 100644 --- a/app/code/core/Mage/Core/Controller/Front/Router.php +++ b/app/code/core/Mage/Core/Controller/Front/Router.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Controller/Request/Http.php b/app/code/core/Mage/Core/Controller/Request/Http.php index b77dd7beb6a1bbcf17af9d2304c6fea12c6cf497..346aacc495d78aa409e40f5e351d265f75f19adc 100644 --- a/app/code/core/Mage/Core/Controller/Request/Http.php +++ b/app/code/core/Mage/Core/Controller/Request/Http.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Controller/Response/Http.php b/app/code/core/Mage/Core/Controller/Response/Http.php index 0add0659593d3d3d3184ab0cd66e050a0e1f7711..7b0c7a644127bffbf13e849721f65e81fd21fd2a 100644 --- a/app/code/core/Mage/Core/Controller/Response/Http.php +++ b/app/code/core/Mage/Core/Controller/Response/Http.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Controller/Varien/Action.php b/app/code/core/Mage/Core/Controller/Varien/Action.php index d1ba4040dfa90b6465ad8d691f89c3107286561c..e772dbeb048917cf6c7aae765a5f1a8d2235d037 100644 --- a/app/code/core/Mage/Core/Controller/Varien/Action.php +++ b/app/code/core/Mage/Core/Controller/Varien/Action.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -1083,9 +1083,9 @@ abstract class Mage_Core_Controller_Varien_Action ->setHeader('Pragma', 'public', true) ->setHeader('Cache-Control', 'must-revalidate, post-check=0, pre-check=0', true) ->setHeader('Content-type', $contentType, true) - ->setHeader('Content-Length', is_null($contentLength) ? strlen($content) : $contentLength) - ->setHeader('Content-Disposition', 'attachment; filename="'.$fileName.'"') - ->setHeader('Last-Modified', date('r')); + ->setHeader('Content-Length', is_null($contentLength) ? strlen($content) : $contentLength, true) + ->setHeader('Content-Disposition', 'attachment; filename="'.$fileName.'"', true) + ->setHeader('Last-Modified', date('r'), true); if (!is_null($content)) { if ($isFile) { diff --git a/app/code/core/Mage/Core/Controller/Varien/Exception.php b/app/code/core/Mage/Core/Controller/Varien/Exception.php index 958e5e7d1b99afe0bbeb308cbc4f1967a412005c..db2e35317ab8d2cc6933ad14c1094aac8fbe0165 100644 --- a/app/code/core/Mage/Core/Controller/Varien/Exception.php +++ b/app/code/core/Mage/Core/Controller/Varien/Exception.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Controller/Varien/Front.php b/app/code/core/Mage/Core/Controller/Varien/Front.php index a9a19f9782302301daba9d10a85b9da19c6b504d..87f41660c7bcf90c7dfcc27756414c38cb97e78f 100644 --- a/app/code/core/Mage/Core/Controller/Varien/Front.php +++ b/app/code/core/Mage/Core/Controller/Varien/Front.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Controller/Varien/Router/Abstract.php b/app/code/core/Mage/Core/Controller/Varien/Router/Abstract.php index 0a87c469f062d9467d27b10b76344c316ae0ee32..3d305c09f93cbe38f0903aa4c177fc367d4a0de7 100644 --- a/app/code/core/Mage/Core/Controller/Varien/Router/Abstract.php +++ b/app/code/core/Mage/Core/Controller/Varien/Router/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Controller/Varien/Router/Admin.php b/app/code/core/Mage/Core/Controller/Varien/Router/Admin.php index b052fd835f706bcccbedd05903a67ea28fe3117e..46456ec9b5016dbb1291d4348168c3d8f01dad3a 100644 --- a/app/code/core/Mage/Core/Controller/Varien/Router/Admin.php +++ b/app/code/core/Mage/Core/Controller/Varien/Router/Admin.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Controller/Varien/Router/Default.php b/app/code/core/Mage/Core/Controller/Varien/Router/Default.php index 25aa09b8ab20b357d18dd7098513f95e819af9b1..e2eb1973434d2a303cc3d06a679f34d8dc39b2ad 100644 --- a/app/code/core/Mage/Core/Controller/Varien/Router/Default.php +++ b/app/code/core/Mage/Core/Controller/Varien/Router/Default.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php b/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php index 722d897380c71171a9c03d27b0d9bf989103865d..1a1bfca45771d3b1ccf5fa899b45162917c8423e 100644 --- a/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php +++ b/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Exception.php b/app/code/core/Mage/Core/Exception.php index 4d63eb30ed37826888b264316cdd3da8f4aeb984..92d66ac59316af1fccdc3aef991c1e832d189b50 100644 --- a/app/code/core/Mage/Core/Exception.php +++ b/app/code/core/Mage/Core/Exception.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Helper/Abstract.php b/app/code/core/Mage/Core/Helper/Abstract.php index dbb9205de511fd06387ae166b8999ab8a1c8da6e..1e8cc108455e3a9523ce5774dc2f2c970a9511f9 100644 --- a/app/code/core/Mage/Core/Helper/Abstract.php +++ b/app/code/core/Mage/Core/Helper/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -218,6 +218,19 @@ abstract class Mage_Core_Helper_Abstract return $result; } + /** + * Remove html tags, but leave "<" and ">" signs + * + * @param string $html + * @return string + */ + public function removeTags($html) + { + $html = preg_replace("# <(?![/a-z]) | (?<=\s)>(?![a-z]) #exi", "htmlentities('$0')", $html); + $html = strip_tags($html); + return htmlspecialchars_decode($html); + } + /** * Wrapper for standart strip_tags() function with extra functionality for html entities * @@ -262,6 +275,22 @@ abstract class Mage_Core_Helper_Abstract return str_replace($quote, '\\'.$quote, $data); } + /** + * Escape quotes inside html attributes + * Use $addSlashes = false for escaping js that inside html attribute (onClick, onSubmit etc) + * + * @param string $data + * @param bool $addSlashes + * @return string + */ + public function quoteEscape($data, $addSlashes = false) + { + if ($addSlashes === true) { + $data = addslashes($data); + } + return htmlspecialchars($data, ENT_QUOTES, null, false); + } + /** * Retrieve url * @@ -300,7 +329,7 @@ abstract class Mage_Core_Helper_Abstract * base64_encode() for URLs encoding * * @param string $url - * @return string + * @return string */ public function urlEncode($url) { @@ -311,7 +340,7 @@ abstract class Mage_Core_Helper_Abstract * base64_dencode() for URLs dencoding * * @param string $url - * @return string + * @return string */ public function urlDecode($url) { @@ -323,7 +352,7 @@ abstract class Mage_Core_Helper_Abstract * Translate array * * @param array $arr - * @return array + * @return array */ public function translateArray($arr = array()) { diff --git a/app/code/core/Mage/Core/Helper/Data.php b/app/code/core/Mage/Core/Helper/Data.php index f75765471058d7dcdf3034008ef80615f2e0aa47..d6bd6941b080e74c970f40223e1a9809bf48b7f8 100644 --- a/app/code/core/Mage/Core/Helper/Data.php +++ b/app/code/core/Mage/Core/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -48,6 +48,13 @@ class Mage_Core_Helper_Data extends Mage_Core_Helper_Abstract const CHARS_PASSWORD_DIGITS = '23456789'; const CHARS_PASSWORD_SPECIALS = '!$*-.=?@_'; + /** + * Config pathes to merchant country code and merchant VAT number + */ + const XML_PATH_MERCHANT_COUNTRY_CODE = 'general/store_information/merchant_country'; + const XML_PATH_MERCHANT_VAT_NUMBER = 'general/store_information/merchant_vat_number'; + const XML_PATH_EU_COUNTRIES_LIST = 'general/country/eu_countries'; + /** * @var Mage_Core_Model_Encryption */ @@ -527,12 +534,12 @@ class Mage_Core_Helper_Data extends Mage_Core_Helper_Abstract * @param array $array * @param string $rootName * @return SimpleXMLElement - * @throws Exception + * @throws Magento_Exception */ public function assocToXml(array $array, $rootName = '_') { if (empty($rootName) || is_numeric($rootName)) { - throw new Exception('Root element must not be empty or numeric'); + throw new Magento_Exception('Root element must not be empty or numeric'); } $xmlstr = <<<XML @@ -542,7 +549,7 @@ XML; $xml = new SimpleXMLElement($xmlstr); foreach ($array as $key => $value) { if (is_numeric($key)) { - throw new Exception('Array root keys must not be numeric.'); + throw new Magento_Exception('Array root keys must not be numeric.'); } } return self::_assocToXml($array, $rootName, $xml); @@ -555,7 +562,7 @@ XML; * @param string $rootName * @param SimpleXMLElement $xml * @return SimpleXMLElement - * @throws Exception + * @throws Magento_Exception */ private function _assocToXml(array $array, $rootName, SimpleXMLElement &$xml) { @@ -565,7 +572,7 @@ XML; if (!is_array($value)) { if (is_string($key)) { if ($key === $rootName) { - throw new Exception('Associative key must not be the same as its parent associative key.'); + throw new Magento_Exception('Associative key must not be the same as its parent associative key.'); } $hasStringKey = true; $xml->$key = $value; @@ -580,7 +587,7 @@ XML; } } if ($hasNumericKey && $hasStringKey) { - throw new Exception('Associative and numeric keys must not be mixed at one level.'); + throw new Magento_Exception('Associative and numeric keys must not be mixed at one level.'); } return $xml; } @@ -720,4 +727,39 @@ XML; $value = (string) Mage::getConfig()->getNode($path); return (bool) $value; } + + /** + * Retrieve merchant country code + * + * @param Mage_Core_Model_Store|string|int|null $store + * @return string + */ + public function getMerchantCountryCode($store = null) + { + return (string) Mage::getStoreConfig(self::XML_PATH_MERCHANT_COUNTRY_CODE, $store); + } + + /** + * Retrieve merchant VAT number + * + * @param Mage_Core_Model_Store|string|int|null $store + * @return string + */ + public function getMerchantVatNumber($store = null) + { + return (string) Mage::getStoreConfig(self::XML_PATH_MERCHANT_VAT_NUMBER, $store); + } + + /** + * Check whether specified country is in EU countries list + * + * @param string $countryCode + * @param null|int $storeId + * @return bool + */ + public function isCountryInEU($countryCode, $storeId = null) + { + $euCountries = explode(',', Mage::getStoreConfig(self::XML_PATH_EU_COUNTRIES_LIST, $storeId)); + return in_array($countryCode, $euCountries); + } } diff --git a/app/code/core/Mage/Core/Helper/File/Storage.php b/app/code/core/Mage/Core/Helper/File/Storage.php index 35e2e10744e18a05eb4141517c55654a738ba0ef..51d25e0fc38b62b39d14457d2b060450aad9b8ce 100644 --- a/app/code/core/Mage/Core/Helper/File/Storage.php +++ b/app/code/core/Mage/Core/Helper/File/Storage.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Helper/File/Storage/Database.php b/app/code/core/Mage/Core/Helper/File/Storage/Database.php index a29ae7d8a9f329fe3ce87c71147d449b6879e2f5..23819fe2bb3ae07694c574a908dfa7147312f2f3 100644 --- a/app/code/core/Mage/Core/Helper/File/Storage/Database.php +++ b/app/code/core/Mage/Core/Helper/File/Storage/Database.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Helper/Hint.php b/app/code/core/Mage/Core/Helper/Hint.php new file mode 100644 index 0000000000000000000000000000000000000000..19afeeb56741c1437789abad5d26db33039d2425 --- /dev/null +++ b/app/code/core/Mage/Core/Helper/Hint.php @@ -0,0 +1,80 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Core + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Core hint helper + * + * @category Mage + * @package Mage_Core + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Core_Helper_Hint extends Mage_Core_Helper_Abstract +{ + /** + * List of available hints + * + * @var null|array + */ + protected $_availableHints; + + /** + * Retrieve list of available hints as [hint code] => [hint url] + * + * @return array + */ + public function getAvailableHints() + { + if (null === $this->_availableHints) { + $hints = array(); + $config = Mage::getConfig()->getNode('default/hints'); + if ($config) { + foreach ($config->children() as $type => $node) { + if ((string)$node->enabled) { + $hints[$type] = (string)$node->url; + } + } + } + $this->_availableHints = $hints; + } + return $this->_availableHints; + } + + /** + * Get Hint Url by Its Code + * + * @param string $code + * @return null|string + */ + public function getHintByCode($code) + { + $hint = null; + $hints = $this->getAvailableHints(); + if (array_key_exists($code, $hints)) { + $hint = $hints[$code]; + } + return $hint; + } +} diff --git a/app/code/core/Mage/Core/Helper/Http.php b/app/code/core/Mage/Core/Helper/Http.php index fcbbeb242dd894e3387894551cbb08ff0fc30715..7efcc5c6d5bf4c23eeab6dc992c66f832dcca74b 100644 --- a/app/code/core/Mage/Core/Helper/Http.php +++ b/app/code/core/Mage/Core/Helper/Http.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Helper/Js.php b/app/code/core/Mage/Core/Helper/Js.php index 2a3ed3bfbc26d5f86881a232b871ebd0c4b32b8f..5e416ea93c18e8eb9d3cbc17a943e8aad67f7648 100644 --- a/app/code/core/Mage/Core/Helper/Js.php +++ b/app/code/core/Mage/Core/Helper/Js.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -31,6 +31,16 @@ */ class Mage_Core_Helper_Js extends Mage_Core_Helper_Abstract { + /** + * Key for cache + */ + const JAVASCRIPT_TRANSLATE_CONFIG_KEY = 'javascript_translate_config'; + + /** + * Translate file name + */ + const JAVASCRIPT_TRANSLATE_CONFIG_FILENAME = 'translater.xml'; + /** * Array of senteces of JS translations * @@ -38,6 +48,13 @@ class Mage_Core_Helper_Js extends Mage_Core_Helper_Abstract */ protected $_translateData = null; + /** + * Translate config + * + * @var Varien_Simplexml_Config + */ + protected $_config = null; + /** * Retrieve JSON of JS sentences translation * @@ -88,102 +105,16 @@ class Mage_Core_Helper_Js extends Mage_Core_Helper_Abstract */ protected function _getTranslateData() { - if ($this->_translateData ===null) { - $this->_translateData = array( - 'Please select an option.' => $this->__('Please select an option.'), - 'This is a required field.' => $this->__('This is a required field.'), - 'Please enter a valid number in this field.' => $this->__('Please enter a valid number in this field.'), - 'Please use numbers only in this field. Please avoid spaces or other characters such as dots or commas.' => - $this->__('Please use numbers only in this field. Please avoid spaces or other characters such as dots or commas.'), - 'Please use letters only (a-z) in this field.' => $this->__('Please use letters only (a-z) in this field.'), - 'Please use only letters (a-z), numbers (0-9) or underscore(_) in this field, first character should be a letter.' => - $this->__('Please use only letters (a-z), numbers (0-9) or underscore(_) in this field, first character should be a letter.'), - 'Please use only letters (a-z) or numbers (0-9) only in this field. No spaces or other characters are allowed.' => - $this->__('Please use only letters (a-z) or numbers (0-9) only in this field. No spaces or other characters are allowed.'), - 'Please use only letters (a-z) or numbers (0-9) or spaces and # only in this field.' => - $this->__('Please use only letters (a-z) or numbers (0-9) or spaces and # only in this field.'), - 'Please enter a valid phone number. For example (123) 456-7890 or 123-456-7890.' => - $this->__('Please enter a valid phone number. For example (123) 456-7890 or 123-456-7890.'), - 'Please enter a valid date.' => $this->__('Please enter a valid date.'), - 'Please enter a valid email address. For example johndoe@domain.com.' => - $this->__('Please enter a valid email address. For example johndoe@domain.com.'), - 'Please enter 6 or more characters.' => $this->__('Please enter 6 or more characters.'), - 'Please make sure your passwords match.' => $this->__('Please make sure your passwords match.'), - 'Please enter a valid URL. Protocol is required (http://, https:// or ftp://)' => - $this->__('Please enter a valid URL. Protocol is required (http://, https:// or ftp://)'), - 'Please enter a valid URL. For example http://www.example.com or www.example.com' => - $this->__('Please enter a valid URL. For example http://www.example.com or www.example.com'), - 'Please enter a valid social security number. For example 123-45-6789.' => - $this->__('Please enter a valid social security number. For example 123-45-6789.'), - 'Please enter a valid zip code. For example 90602 or 90602-1234.' => - $this->__('Please enter a valid zip code. For example 90602 or 90602-1234.'), - 'Please enter a valid zip code.' => $this->__('Please enter a valid zip code.'), - 'Please use this date format: dd/mm/yyyy. For example 17/03/2006 for the 17th of March, 2006.' => - $this->__('Please use this date format: dd/mm/yyyy. For example 17/03/2006 for the 17th of March, 2006.'), - 'Please enter a valid $ amount. For example $100.00.' => - $this->__('Please enter a valid $ amount. For example $100.00.'), - 'Please select one of the above options.' => $this->__('Please select one of the above options.'), - 'Please select one of the options.' => $this->__('Please select one of the options.'), - 'Please enter a valid number in this field.' => $this->__('Please enter a valid number in this field.'), - 'Please select State/Province.' => $this->__('Please select State/Province.'), - 'Please enter valid password.' => $this->__('Please enter valid password.'), - 'Please enter 6 or more characters. Leading or trailing spaces will be ignored.' => - $this->__('Please enter 6 or more characters. Leading or trailing spaces will be ignored.'), - 'Please use letters only (a-z or A-Z) in this field.' => $this->__('Please use letters only (a-z or A-Z) in this field.'), - 'Please enter a number greater than 0 in this field.' => - $this->__('Please enter a number greater than 0 in this field.'), - 'Please enter a valid credit card number.' => $this->__('Please enter a valid credit card number.'), - 'Please wait, loading...' => $this->__('Please wait, loading...'), - 'Please choose to register or to checkout as a guest' => $this->__('Please choose to register or to checkout as a guest'), - 'Error: Passwords do not match' => $this->__('Error: Passwords do not match'), - 'Your order cannot be completed at this time as there is no shipping methods available for it. Please make necessary changes in your shipping address.' => - $this->__('Your order cannot be completed at this time as there is no shipping methods available for it. Please make necessary changes in your shipping address.'), - 'Please specify shipping method.' => $this->__('Please specify shipping method.'), - 'Your order cannot be completed at this time as there is no payment methods available for it.' => - $this->__('Your order cannot be completed at this time as there is no payment methods available for it.'), - 'Please specify payment method.' => $this->__('Please specify payment method.'), - 'Credit card number does not match credit card type.' => $this->__('Credit card number does not match credit card type.'), - 'Card type does not match credit card number.' => $this->__('Card type does not match credit card number.'), - 'Please enter a valid credit card verification number.' => $this->__('Please enter a valid credit card verification number.'), - 'Please use only letters (a-z or A-Z), numbers (0-9) or underscore(_) in this field, first character should be a letter.' => - $this->__('Please use only letters (a-z or A-Z), numbers (0-9) or underscores (_) in this field, first character must be a letter.'), - 'Please input a valid CSS-length. For example 100px or 77pt or 20em or .5ex or 50%.' => - $this->__('Please input a valid CSS-length. For example 100px or 77pt or 20em or .5ex or 50%.'), - 'Maximum length exceeded.' => $this->__('Maximum length exceeded.'), - 'Your session has been expired, you will be relogged in now.' => $this->__('Your session has been expired, you will be relogged in now.'), - 'Incorrect credit card expiration date.' => $this->__('Incorrect credit card expiration date.'), - 'This date is a required value.' => $this->__('This date is a required value.'), - 'The value is not within the specified range.' => $this->__('The value is not within the specified range.'), - 'Please use only letters (a-z or A-Z) or numbers (0-9) only in this field. No spaces or other characters are allowed.' - => $this->__('Please use only letters (a-z or A-Z) or numbers (0-9) only in this field. No spaces or other characters are allowed.'), - 'Please use only letters (a-z or A-Z) or numbers (0-9) or spaces and # only in this field.' => - $this->__('Please use only letters (a-z or A-Z) or numbers (0-9) or spaces and # only in this field.'), - 'Please enter a valid fax number. For example (123) 456-7890 or 123-456-7890.' => - $this->__('Please enter a valid fax number. For example (123) 456-7890 or 123-456-7890.'), - 'Please use only visible characters and spaces.' => $this->__('Please use only visible characters and spaces.'), - 'Please enter 7 or more characters. Password should contain both numeric and alphabetic characters.' => - $this->__('Please enter 7 or more characters. Password should contain both numeric and alphabetic characters.'), - 'Please enter a valid URL Key. For example "example-page", "example-page.html" or "anotherlevel/example-page".' => - $this->__('Please enter a valid URL Key. For example "example-page", "example-page.html" or "anotherlevel/example-page".'), - 'Please enter a valid XML-identifier. For example something_1, block5, id-4.' => - $this->__('Please enter a valid XML-identifier. For example something_1, block5, id-4.'), - 'Please enter a number 0 or greater in this field.' => $this->__('Please enter a number 0 or greater in this field.'), - 'Text length does not satisfy specified text range.' => $this->__('Text length does not satisfy specified text range.'), - 'Please enter a number lower than 100.' => $this->__('Please enter a number lower than 100.'), - 'Please enter issue number or start date for switch/solo card type.' => - $this->__('Please enter issue number or start date for switch/solo card type.'), - 'Please enter a valid day (1-%d).' => $this->__('Please enter a valid day (1-%d).'), - 'Please enter a valid month (1-12).' => $this->__('Please enter a valid month (1-12).'), - 'Please enter a valid year (1900-%d).' => $this->__('Please enter a valid year (1900-%d).'), - 'Please enter a valid full date' => $this->__('Please enter a valid full date'), - 'Please enter a valid date between %s and %s' => - $this->__('Please enter a valid date between %s and %s'), - 'Please enter a valid date equal to or greater than %s' => - $this->__('Please enter a valid date equal to or greater than %s'), - 'Please enter a valid date less than or equal to %s' => - $this->__('Please enter a valid date less than or equal to %s') - ); - foreach ($this->_translateData as $key=>$value) { + if ($this->_translateData === null) { + $this->_translateData = array(); + + foreach ($this->_getXmlConfig()->getXpath('*/message') as $message) { + $messageText = (string)$message; + $module = $message->getParent()->getAttribute("module"); + $this->_translateData[$messageText] = Mage::helper(empty($module) ? 'Mage_Core' : $module)->__($messageText); + } + + foreach ($this->_translateData as $key => $value) { if ($key == $value) { unset($this->_translateData[$key]); } @@ -192,4 +123,30 @@ class Mage_Core_Helper_Js extends Mage_Core_Helper_Abstract return $this->_translateData; } + /** + * Load config from files and try to cache it + * + * @return Varien_Simplexml_Config + */ + protected function _getXmlConfig() + { + if (is_null($this->_config)) { + $canUsaCache = Mage::app()->useCache('config'); + $cachedXml = Mage::app()->loadCache(self::JAVASCRIPT_TRANSLATE_CONFIG_KEY); + if ($canUsaCache && $cachedXml) { + $xmlConfig = new Varien_Simplexml_Config($cachedXml); + } else { + $xmlConfig = new Varien_Simplexml_Config(); + $xmlConfig->loadString('<?xml version="1.0"?><translater></translater>'); + Mage::getConfig()->loadModulesConfiguration(self::JAVASCRIPT_TRANSLATE_CONFIG_FILENAME, $xmlConfig); + + if ($canUsaCache) { + Mage::app()->saveCache($xmlConfig->getXmlString(), self::JAVASCRIPT_TRANSLATE_CONFIG_KEY, + array(Mage_Core_Model_Config::CACHE_TAG)); + } + } + $this->_config = $xmlConfig; + } + return $this->_config; + } } diff --git a/app/code/core/Mage/Core/Helper/String.php b/app/code/core/Mage/Core/Helper/String.php index 6e9d49b529cb537b123252164f17b7b5180020db..12991d905ae3ed313389a19c7162afa53f141168 100644 --- a/app/code/core/Mage/Core/Helper/String.php +++ b/app/code/core/Mage/Core/Helper/String.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -115,7 +115,8 @@ class Mage_Core_Helper_String extends Mage_Core_Helper_Abstract if ($this->strlen($part) >= $length) { $lastDelimetr = $this->strpos($this->strrev($part), $needle); $tmpNewStr = ''; - $tmpNewStr = $this->substr($this->strrev($part), 0, $lastDelimetr) . $insert . $this->substr($this->strrev($part), $lastDelimetr); + $tmpNewStr = $this->substr($this->strrev($part), 0, $lastDelimetr) + . $insert . $this->substr($this->strrev($part), $lastDelimetr); $newStr .= $this->strrev($tmpNewStr); } else { $newStr .= $part; @@ -264,7 +265,8 @@ class Mage_Core_Helper_String extends Mage_Core_Helper_Abstract */ public function cleanString($string) { - return '"libiconv"' == ICONV_IMPL ? iconv(self::ICONV_CHARSET, self::ICONV_CHARSET . '//IGNORE', $string) : $string; + return '"libiconv"' == ICONV_IMPL ? + iconv(self::ICONV_CHARSET, self::ICONV_CHARSET . '//IGNORE', $string) : $string; } /** @@ -292,7 +294,9 @@ class Mage_Core_Helper_String extends Mage_Core_Helper_Abstract return false; } $oldLocale = setlocale(LC_COLLATE, "0"); - setlocale(LC_COLLATE, Mage::app()->getLocale()->getLocaleCode() . '.UTF8'); + $localeCode = Mage::app()->getLocale()->getLocaleCode(); + // use fallback locale if $localeCode is not available + setlocale(LC_COLLATE, $localeCode . '.UTF8', 'C.UTF-8', 'en_US.utf8'); ksort($sort, SORT_LOCALE_STRING); setlocale(LC_COLLATE, $oldLocale); diff --git a/app/code/core/Mage/Core/Helper/Translate.php b/app/code/core/Mage/Core/Helper/Translate.php index 09cd98ce71dda49ff0e78a49aaf2ebb23e90a966..c57d4fb1a4cd57a25c7fcad0a06582faacb0a78c 100644 --- a/app/code/core/Mage/Core/Helper/Translate.php +++ b/app/code/core/Mage/Core/Helper/Translate.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -51,28 +51,4 @@ class Mage_Core_Helper_Translate extends Mage_Core_Helper_Abstract return $returnType == 'json' ? "{error:true,message:'" . $e->getMessage() . "'}" : false; } } - - /** - * Sets escaping start marker which then processed by inline translation model - * - * @see Mage_Core_Model_Translate_Inline::_escapeInline() - * @param string $escapeChar Char to escape (default = ') - * @return string - */ - public function inlineEscapeStartMarker($escapeChar = "'") - { - $escapeChar = str_replace('"', '\"', $escapeChar); - return "{{escape={$escapeChar}}}"; - } - - /** - * Sets escaping end marker which then processed by inline translation model - * - * @see Mage_Core_Model_Translate_Inline::_escapeInline() - * @return string - */ - public function inlineEscapeEndMarker() - { - return '{{escape}}'; - } } diff --git a/app/code/core/Mage/Core/Helper/Url.php b/app/code/core/Mage/Core/Helper/Url.php index 811b5c49cb29f37d1db664cfade566282ce26492..2fd8608a134a8ebbaf454e0a516b2cd755637ba4 100644 --- a/app/code/core/Mage/Core/Helper/Url.php +++ b/app/code/core/Mage/Core/Helper/Url.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Helper/Url/Rewrite.php b/app/code/core/Mage/Core/Helper/Url/Rewrite.php index aab104c1361d63bd9cce7fc2061165c37576ada0..4974cca38b0a73deca968ca06e4ca16724af5e8d 100644 --- a/app/code/core/Mage/Core/Helper/Url/Rewrite.php +++ b/app/code/core/Mage/Core/Helper/Url/Rewrite.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Abstract.php b/app/code/core/Mage/Core/Model/Abstract.php index f6b367fd143f179aa788820928ce43cb502bf0ca..2b000d5f42e1226102de8bc18f89a54fb6e16eb0 100644 --- a/app/code/core/Mage/Core/Model/Abstract.php +++ b/app/code/core/Mage/Core/Model/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/App.php b/app/code/core/Mage/Core/Model/App.php index 223c656445c2d004872c0082d91b0881c29a3499..eeea0d0b7a4daed74bbcfa745f0dc8fbf2740b5c 100644 --- a/app/code/core/Mage/Core/Model/App.php +++ b/app/code/core/Mage/Core/Model/App.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -40,6 +40,11 @@ class Mage_Core_Model_App const XML_PATH_SKIP_PROCESS_MODULES_UPDATES = 'global/skip_process_modules_updates'; + /** + * if this node set to true, we will ignore Developer Mode for applying updates + */ + const XML_PATH_IGNORE_DEV_MODE = 'global/skip_process_modules_updates_ignore_dev_mode'; + const DEFAULT_ERROR_HANDLER = 'mageCoreErrorHandler'; const DISTRO_LOCALE_CODE = 'en_US'; @@ -438,7 +443,8 @@ class Mage_Core_Model_App return false; } - if (Mage::getIsDeveloperMode()) { + $ignoreDevelopmentMode = (bool)(string)$this->_config->getNode(self::XML_PATH_IGNORE_DEV_MODE); + if (Mage::getIsDeveloperMode() && !$ignoreDevelopmentMode) { return false; } diff --git a/app/code/core/Mage/Core/Model/App/Area.php b/app/code/core/Mage/Core/Model/App/Area.php index 36bfb5fa71ed0aa0459c8f9814e62c542f0e7f96..4f05b88474d45de8ec138b66e903cea7c2de24aa 100644 --- a/app/code/core/Mage/Core/Model/App/Area.php +++ b/app/code/core/Mage/Core/Model/App/Area.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/App/Emulation.php b/app/code/core/Mage/Core/Model/App/Emulation.php index db7f32e66077a4c18c82ddac2b2e2f961c092d27..702af84dbe53c46faa613903356b220fe2d61280 100644 --- a/app/code/core/Mage/Core/Model/App/Emulation.php +++ b/app/code/core/Mage/Core/Model/App/Emulation.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Cache.php b/app/code/core/Mage/Core/Model/Cache.php index a3673b69e577976c5b6192c40505d143d2f6c0aa..882420fa1bf493756243daac0cff4d5580f652a9 100644 --- a/app/code/core/Mage/Core/Model/Cache.php +++ b/app/code/core/Mage/Core/Model/Cache.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -156,12 +156,18 @@ class Mage_Core_Model_Cache } break; case 'memcached': - if (extension_loaded('memcache')) { + if (extension_loaded('memcached')) { if (isset($cacheOptions['memcached'])) { $options = $cacheOptions['memcached']; } $enable2levels = true; - $backendType = 'Varien_Cache_Backend_Memcached'; + $backendType = 'Libmemcached'; + } elseif (extension_loaded('memcache')) { + if (isset($cacheOptions['memcached'])) { + $options = $cacheOptions['memcached']; + } + $enable2levels = true; + $backendType = 'Memcached'; } break; case 'apc': diff --git a/app/code/core/Mage/Core/Model/Calculator.php b/app/code/core/Mage/Core/Model/Calculator.php new file mode 100644 index 0000000000000000000000000000000000000000..cd5ba6f86f9da90d35684c294704bc9dee2a57ab --- /dev/null +++ b/app/code/core/Mage/Core/Model/Calculator.php @@ -0,0 +1,87 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Core + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + + +/** + * Calculations model + * + * @category Mage + * @package Mage_Core + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Core_Model_Calculator +{ + /** + * Delta collected during rounding steps + * + * @var float + */ + protected $_delta = 0.0; + + /** + * Store instance + * + * @var Mage_Core_Model_Store|null + */ + protected $_store = null; + + /** + * Initialize calculator + * + * @param Mage_Core_Model_Store|int $store + */ + public function __construct($store) + { + if (!($store instanceof Mage_Core_Model_Store)) { + $store = Mage::app()->getStore($store); + } + $this->_store = $store; + } + + /** + * Round price considering delta + * + * @param float $price + * @param bool $negative Indicates if we perform addition (true) or subtraction (false) of rounded value + * @return float + */ + public function deltaRound($price, $negative = false) + { + $roundedPrice = $price; + if ($roundedPrice) { + if ($negative) { + $this->_delta = -$this->_delta; + } + $price += $this->_delta; + $roundedPrice = $this->_store->roundPrice($price); + $this->_delta = $price - $roundedPrice; + if ($negative) { + $this->_delta = -$this->_delta; + } + } + return $roundedPrice; + } +} diff --git a/app/code/core/Mage/Core/Model/Config.php b/app/code/core/Mage/Core/Model/Config.php index f22f07cabbcf8e977352a83b238d3331949919fc..0d2a07d524be1f2c07fd2787691820b3ea5bc209 100644 --- a/app/code/core/Mage/Core/Model/Config.php +++ b/app/code/core/Mage/Core/Model/Config.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -865,9 +865,7 @@ class Mage_Core_Model_Config extends Mage_Core_Model_Config_Base foreach ($moduleProp['depends'] as $dependModule => $true) { if (!isset($definedModules[$dependModule])) { Mage::throwException( - Mage::helper('Mage_Core_Helper_Data')->__( - 'Module "%1$s" cannot depend on "%2$s".', $moduleProp['module'], $dependModule - ) + Mage::helper('Mage_Core_Helper_Data')->__('Module "%1$s" cannot depend on "%2$s".', $moduleProp['module'], $dependModule) ); } } diff --git a/app/code/core/Mage/Core/Model/Config/Base.php b/app/code/core/Mage/Core/Model/Config/Base.php index a7a9c1cd01339dcf072f2adce65d98dce6eae38f..bde7a6803b25d1763af659d93f9749c2e192a169 100644 --- a/app/code/core/Mage/Core/Model/Config/Base.php +++ b/app/code/core/Mage/Core/Model/Config/Base.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Config/Data.php b/app/code/core/Mage/Core/Model/Config/Data.php index 333ca643eb24ddecbb8e0e5c9aa2041b6f211e82..c4809e1d1b1c16344e7356e141e746ea2de7660a 100644 --- a/app/code/core/Mage/Core/Model/Config/Data.php +++ b/app/code/core/Mage/Core/Model/Config/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Config/Element.php b/app/code/core/Mage/Core/Model/Config/Element.php index cc94a046fd8e21729aaacc1fc36c1c30a414c966..336bcbf57257ed0b8eb68fa0c32cdf633e665037 100644 --- a/app/code/core/Mage/Core/Model/Config/Element.php +++ b/app/code/core/Mage/Core/Model/Config/Element.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Config/Fieldset.php b/app/code/core/Mage/Core/Model/Config/Fieldset.php index dfc76cbe68508701a54bd0fe39c0c62aa60853ef..a18a1e733149f5dda8c04b77553645d8b17e4c87 100644 --- a/app/code/core/Mage/Core/Model/Config/Fieldset.php +++ b/app/code/core/Mage/Core/Model/Config/Fieldset.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Config/Options.php b/app/code/core/Mage/Core/Model/Config/Options.php index 80a9eb8a603def5604ad94e6fa1291924f7d7dc3..e4526d7a8bc06ec8e6630297357401ce6f095672 100644 --- a/app/code/core/Mage/Core/Model/Config/Options.php +++ b/app/code/core/Mage/Core/Model/Config/Options.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Config/System.php b/app/code/core/Mage/Core/Model/Config/System.php index de76295e98cd0ae69d431970cd367c2e24de7d92..31ed4824d852d54cc8cfc25e885a40271036b901 100644 --- a/app/code/core/Mage/Core/Model/Config/System.php +++ b/app/code/core/Mage/Core/Model/Config/System.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Convert.php b/app/code/core/Mage/Core/Model/Convert.php index 2ad4ae1c4ed9f8e6ae85fccec22e25ca2f378b42..c23b22cd7c166e4233724a133a4fbba5e0cb3eb2 100644 --- a/app/code/core/Mage/Core/Model/Convert.php +++ b/app/code/core/Mage/Core/Model/Convert.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Cookie.php b/app/code/core/Mage/Core/Model/Cookie.php index e949ef9267ab3741e4ec293b6ad1c677a788ac2e..4f82c30fa147a182a6d47c2741fef2b7d225bd9c 100644 --- a/app/code/core/Mage/Core/Model/Cookie.php +++ b/app/code/core/Mage/Core/Model/Cookie.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -198,6 +198,7 @@ class Mage_Core_Model_Cookie * @param string $path * @param string $domain * @param int|bool $secure + * @param bool $httponly * @return Mage_Core_Model_Cookie */ public function set($name, $value, $period = null, $path = null, $domain = null, $secure = null, $httponly = null) diff --git a/app/code/core/Mage/Core/Model/Date.php b/app/code/core/Mage/Core/Model/Date.php index 31924eede6dfe7f96fc9cd43c01cc992ef22d2f1..9edb4618eca7efcafa9fbea0fa102568cb8e82b9 100644 --- a/app/code/core/Mage/Core/Model/Date.php +++ b/app/code/core/Mage/Core/Model/Date.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Design.php b/app/code/core/Mage/Core/Model/Design.php index 6f48f81150578afebe90a55fe6a0eebaed2bc435..a2180364056a736fe157b9a13f4c3213a26ba431 100644 --- a/app/code/core/Mage/Core/Model/Design.php +++ b/app/code/core/Mage/Core/Model/Design.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Design/Backend/Exceptions.php b/app/code/core/Mage/Core/Model/Design/Backend/Exceptions.php index 416dcc3293f6e68f7d2628aa534f18eef2426024..436d2e422b09801988d3f6cce7c7ca47dfc41a3f 100644 --- a/app/code/core/Mage/Core/Model/Design/Backend/Exceptions.php +++ b/app/code/core/Mage/Core/Model/Design/Backend/Exceptions.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Design/Backend/Theme.php b/app/code/core/Mage/Core/Model/Design/Backend/Theme.php index dd98063bab168390e0c1ca45ba0749bcfa260c4a..5a62301c186b2a705ed1dfa735d13eb62a20585f 100644 --- a/app/code/core/Mage/Core/Model/Design/Backend/Theme.php +++ b/app/code/core/Mage/Core/Model/Design/Backend/Theme.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Design/Package.php b/app/code/core/Mage/Core/Model/Design/Package.php index c0b94d759bc3952a461884ad88041bf26dbd2e79..2db16af1342660e638378241e4d291f30ed277e1 100644 --- a/app/code/core/Mage/Core/Model/Design/Package.php +++ b/app/code/core/Mage/Core/Model/Design/Package.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -342,16 +342,17 @@ class Mage_Core_Model_Design_Package * @param string $file * @param array &$params * @return string + * @throws Magento_Exception */ protected function _extractScope($file, array &$params) { if (preg_match('/\.\//', str_replace('\\', '/', $file))) { - throw new Exception("File name '{$file}' is forbidden for security reasons."); + throw new Magento_Exception("File name '{$file}' is forbidden for security reasons."); } if (false !== strpos($file, self::SCOPE_SEPARATOR)) { $file = explode(self::SCOPE_SEPARATOR, $file); if (empty($file[0])) { - throw new Exception('Scope separator "::" can\'n be used without scope identifier.'); + throw new Magento_Exception('Scope separator "::" cannot be used without scope identifier.'); } $params['_module'] = $file[0]; $file = $file[1]; @@ -419,9 +420,11 @@ class Mage_Core_Model_Design_Package } /** - * Design package (optional) themes list getter - * @param string $package - * @return string + * Retrieve the list of themes available in the system. + * Results are grouped by packages themes belong to, if the optional 'package' argument is omitted. + * + * @param string|null $package + * @return array */ public function getThemeList($package = null) { @@ -575,7 +578,7 @@ class Mage_Core_Model_Design_Package * @param string $file * @param bool|null $isSecure * @return string - * @throws Exception + * @throws Magento_Exception */ protected function _getPublicFileUrl($file, $isSecure = null) { @@ -593,7 +596,9 @@ class Mage_Core_Model_Design_Package $url = Mage::getBaseUrl($publicUrlType, $isSecure) . $url; return $url; } - throw new Exception("Cannot build URL for the file '$file' because it does not reside in a public directory."); + throw new Magento_Exception( + "Cannot build URL for the file '$file' because it does not reside in a public directory." + ); } /** @@ -654,6 +659,7 @@ class Mage_Core_Model_Design_Package * @param string $skinFile * @param array $params * @return string + * @throws Magento_Exception */ protected function _publishSkinFile($skinFile, $params) { @@ -661,7 +667,7 @@ class Mage_Core_Model_Design_Package $file = $this->getSkinFile($skinFile, $params); if (!file_exists($file)) { - throw new Exception("Unable to locate skin file: '{$file}'"); + throw new Magento_Exception("Unable to locate skin file '{$file}'."); } if (!$this->_needToPublishFile($file)) { @@ -851,7 +857,7 @@ class Mage_Core_Model_Design_Package * * @param string $filename * @param bool $isRelative flag that identify that filename is relative - * @throw Exception if file can't be canonized + * @throws Magento_Exception if file can't be canonized * @return string|false */ protected function _canonize($filename, $isRelative = false) @@ -872,7 +878,7 @@ class Mage_Core_Model_Design_Package foreach ($parts as $part) { if ('..' === $part) { if (null === array_pop($result)) { - throw new Exception('Invalid file: '.$filename); + throw new Magento_Exception("Invalid file '{$filename}'."); } } elseif ('.' !== $part) { $result[] = $part; @@ -886,7 +892,7 @@ class Mage_Core_Model_Design_Package * * @param array $files list of names relative to the same folder * @param string $contentType - * @throw Exception exception will be triggered if not existing file requested for merge + * @throws Magento_Exception if not existing file requested for merge * @return string */ protected function _mergeFiles($files, $contentType) @@ -920,7 +926,7 @@ class Mage_Core_Model_Design_Package $result = array(); foreach ($filesToMerge as $file) { if (!file_exists($file)) { - throw new Exception("Merging failed: unable to locate file '{$file}'"); + throw new Magento_Exception("Unable to locate file '{$file}' for merging."); } $content = file_get_contents($file); if ($contentType == self::CONTENT_TYPE_CSS) { @@ -941,7 +947,7 @@ class Mage_Core_Model_Design_Package /** * Replace relative URLs in the CSS content with ones shifted by the directories offset * - * @throws Exception + * @throws Magento_Exception * @param string $cssContent * @param string $relativeOffset * @return string @@ -951,7 +957,9 @@ class Mage_Core_Model_Design_Package $relativeUrls = $this->_extractCssRelativeUrls($cssContent); foreach ($relativeUrls as $urlNotation => $fileUrl) { if (strpos($fileUrl, self::SCOPE_SEPARATOR)) { - throw new Exception('URL offset cannot be applied to CSS content that contains scope separator.'); + throw new Magento_Exception( + 'URL offset cannot be applied to CSS content that contains scope separator.' + ); } $fileUrlNew = $this->_canonize($relativeOffset . '/' . $fileUrl, true); $urlNotationNew = str_replace($fileUrl, $fileUrlNew, $urlNotation); @@ -971,7 +979,7 @@ class Mage_Core_Model_Design_Package * pub/skin/frontend/default/default/skin/default/style.css -> img/empty.gif * pub/skin/_merged/hash.css -> ../frontend/default/default/skin/default/img/empty.gif * - * @throws Exception + * @throws Magento_Exception * @param string $originalFile path to original file * @param string $relocationDir path to directory where content will be relocated * @return string @@ -980,7 +988,7 @@ class Mage_Core_Model_Design_Package { $publicDir = Mage::getBaseDir(); if (strpos($originalFile, $publicDir) !== 0 || strpos($relocationDir, $publicDir) !== 0) { - throw new Exception('Offset can be calculated for public resources only.'); + throw new Magento_Exception('Offset can be calculated for public resources only.'); } $offset = ''; while ($relocationDir != $publicDir && strpos($originalFile, $relocationDir) !== 0) { diff --git a/app/code/core/Mage/Core/Model/Design/Source/Design.php b/app/code/core/Mage/Core/Model/Design/Source/Design.php index f7012900fea4d6498ae637ad09ba95345ebdc4de..070fe75b5b02e03b7bb9e23afc74290e70f08d80 100644 --- a/app/code/core/Mage/Core/Model/Design/Source/Design.php +++ b/app/code/core/Mage/Core/Model/Design/Source/Design.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Email.php b/app/code/core/Mage/Core/Model/Email.php index 75a8fe29b9d2aaba9d4cbc69a2ee1525bcd3c608..00b71fd40c43de64be3b34c9eae09dcf291dc992 100644 --- a/app/code/core/Mage/Core/Model/Email.php +++ b/app/code/core/Mage/Core/Model/Email.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Email/Info.php b/app/code/core/Mage/Core/Model/Email/Info.php index 6f05ee4e47afe22534cbb4cecccf829097a2b500..3daa151a2171e71bdfde261598b43c1249dd542d 100644 --- a/app/code/core/Mage/Core/Model/Email/Info.php +++ b/app/code/core/Mage/Core/Model/Email/Info.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Email/Template.php b/app/code/core/Mage/Core/Model/Email/Template.php index c47c3e5442e8732f10499defc6e86652309fb373..5ba293b0e82e8f676135562143f52d57ac5df782 100644 --- a/app/code/core/Mage/Core/Model/Email/Template.php +++ b/app/code/core/Mage/Core/Model/Email/Template.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Email/Template/Filter.php b/app/code/core/Mage/Core/Model/Email/Template/Filter.php index fe0dc93646b26d4bd17d845abdd147cf0b6231b0..dd1e77414dce3792926cda3956b7d6c70bdac77f 100644 --- a/app/code/core/Mage/Core/Model/Email/Template/Filter.php +++ b/app/code/core/Mage/Core/Model/Email/Template/Filter.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Email/Template/Mailer.php b/app/code/core/Mage/Core/Model/Email/Template/Mailer.php index b2b0cca31f73e0ba8778bd53a1a37e798a193d46..82fad31852f51a2989eb56ac8eaa715fe8cdfd9e 100644 --- a/app/code/core/Mage/Core/Model/Email/Template/Mailer.php +++ b/app/code/core/Mage/Core/Model/Email/Template/Mailer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Email/Transport.php b/app/code/core/Mage/Core/Model/Email/Transport.php index 02b6ea5eaa7a163977cf01419a16c7e4eba3cafc..08ff648a607ca3bc66f6b73688f95fbbf54488d8 100644 --- a/app/code/core/Mage/Core/Model/Email/Transport.php +++ b/app/code/core/Mage/Core/Model/Email/Transport.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Encryption.php b/app/code/core/Mage/Core/Model/Encryption.php index 958709610f688806cb43082d690cd0477ebfa18e..f5a1bc6adfa9e612f42f380ef8e9ef9bef7e48bc 100755 --- a/app/code/core/Mage/Core/Model/Encryption.php +++ b/app/code/core/Mage/Core/Model/Encryption.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/File/Storage.php b/app/code/core/Mage/Core/Model/File/Storage.php index e5ac7a85780a7661ca8621e746c6b539a38be4f8..5618da54859322b62606d2960779c218308f82e5 100644 --- a/app/code/core/Mage/Core/Model/File/Storage.php +++ b/app/code/core/Mage/Core/Model/File/Storage.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/File/Storage/Abstract.php b/app/code/core/Mage/Core/Model/File/Storage/Abstract.php index 3ec5b25823e47c6987af40cc9ecde8ba68af7dad..05af013383236b1e6b08f8d6ecf2b5c44dbe812b 100644 --- a/app/code/core/Mage/Core/Model/File/Storage/Abstract.php +++ b/app/code/core/Mage/Core/Model/File/Storage/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/File/Storage/Database.php b/app/code/core/Mage/Core/Model/File/Storage/Database.php index 218de09ba523575c05cba31e0d224d19bd1d228e..d2c337fa68793c2f2c84239034198e4bb5073e46 100644 --- a/app/code/core/Mage/Core/Model/File/Storage/Database.php +++ b/app/code/core/Mage/Core/Model/File/Storage/Database.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/File/Storage/Database/Abstract.php b/app/code/core/Mage/Core/Model/File/Storage/Database/Abstract.php index f4cc067af29d6519c49e7d015c39793ceeefd9ce..b0d130b5681d5be140ba195c4c64bf9a7b4ca7a6 100644 --- a/app/code/core/Mage/Core/Model/File/Storage/Database/Abstract.php +++ b/app/code/core/Mage/Core/Model/File/Storage/Database/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/File/Storage/Directory/Database.php b/app/code/core/Mage/Core/Model/File/Storage/Directory/Database.php index 3175dad922dfea4c244bc3cc3206d75b16c3cf97..38c21979b65d2696f2c8493e67589d7cc67c6235 100644 --- a/app/code/core/Mage/Core/Model/File/Storage/Directory/Database.php +++ b/app/code/core/Mage/Core/Model/File/Storage/Directory/Database.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/File/Storage/File.php b/app/code/core/Mage/Core/Model/File/Storage/File.php index 044435a91fd1b78d206e249bf6c5a947168de648..af91ec03675ddee5d657d8095115c29af3d73835 100644 --- a/app/code/core/Mage/Core/Model/File/Storage/File.php +++ b/app/code/core/Mage/Core/Model/File/Storage/File.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/File/Storage/Flag.php b/app/code/core/Mage/Core/Model/File/Storage/Flag.php index 8dbbca1cd5c261f5dc5305ab378e624773ff238a..e9418815f64aa901ad0f3c9f57ccaeba316c2483 100644 --- a/app/code/core/Mage/Core/Model/File/Storage/Flag.php +++ b/app/code/core/Mage/Core/Model/File/Storage/Flag.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/File/Uploader.php b/app/code/core/Mage/Core/Model/File/Uploader.php index 63ee0d5712ac69981d9a706e6aabd09773654530..1c2d858aceac3edf468913d147ebc5db142f2665 100644 --- a/app/code/core/Mage/Core/Model/File/Uploader.php +++ b/app/code/core/Mage/Core/Model/File/Uploader.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/File/Validator/AvailablePath.php b/app/code/core/Mage/Core/Model/File/Validator/AvailablePath.php index f044d61798d6280da4c937034095abdf6fc1f639..2baba972db44897b2c6e2ded0f18c12e18bdd755 100644 --- a/app/code/core/Mage/Core/Model/File/Validator/AvailablePath.php +++ b/app/code/core/Mage/Core/Model/File/Validator/AvailablePath.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/File/Validator/NotProtectedExtension.php b/app/code/core/Mage/Core/Model/File/Validator/NotProtectedExtension.php index 9095169d711cbd214f61c7951eb6d43f782e68e0..d691ba611a4dabc0039e40b46ed28493764e7c10 100644 --- a/app/code/core/Mage/Core/Model/File/Validator/NotProtectedExtension.php +++ b/app/code/core/Mage/Core/Model/File/Validator/NotProtectedExtension.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -67,11 +67,8 @@ class Mage_Core_Model_File_Validator_NotProtectedExtension extends Zend_Validate protected function _initMessageTemplates() { if (!$this->_messageTemplates) { - /** @var $helper Mage_Core_Helper_Data */ - $helper = Mage::helper('Mage_Core_Helper_Data'); $this->_messageTemplates = array( - self::PROTECTED_EXTENSION => - $helper->__('File with an extension "%value%" is protected and cannot be uploaded'), + self::PROTECTED_EXTENSION => Mage::helper('Mage_Core_Helper_Data')->__('File with an extension "%value%" is protected and cannot be uploaded'), ); } return $this; diff --git a/app/code/core/Mage/Core/Model/Flag.php b/app/code/core/Mage/Core/Model/Flag.php index b33b88b43e01dde65d46daaeaabe7db4128289fd..d20c3093eaa843c70fb21ec065c3dc91037e05aa 100644 --- a/app/code/core/Mage/Core/Model/Flag.php +++ b/app/code/core/Mage/Core/Model/Flag.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Input/Filter/MaliciousCode.php b/app/code/core/Mage/Core/Model/Input/Filter/MaliciousCode.php index d170299d87f3349b0d75942bcb808d1f43632b6f..808a4db7939ec899e66f6296d92631a8510003d2 100644 --- a/app/code/core/Mage/Core/Model/Input/Filter/MaliciousCode.php +++ b/app/code/core/Mage/Core/Model/Input/Filter/MaliciousCode.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Layout.php b/app/code/core/Mage/Core/Model/Layout.php index 1286ae09b8ab815d16a1c24d9784f61260e946dd..43f1b33c2058e863317cd9cd9980d56ce23c7540 100644 --- a/app/code/core/Mage/Core/Model/Layout.php +++ b/app/code/core/Mage/Core/Model/Layout.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -406,7 +406,7 @@ class Mage_Core_Model_Layout extends Varien_Simplexml_Config * Block Factory * * @param string $type - * @param string $blockName + * @param string $name * @param array $attributes * @return Mage_Core_Block_Abstract */ diff --git a/app/code/core/Mage/Core/Model/Layout/Data.php b/app/code/core/Mage/Core/Model/Layout/Data.php index 4e2ab8e3486562f54aa06c2abdaf5a7a812beba4..923a9f539581a21c2629cd41a5913d3296d13f76 100644 --- a/app/code/core/Mage/Core/Model/Layout/Data.php +++ b/app/code/core/Mage/Core/Model/Layout/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Layout/Element.php b/app/code/core/Mage/Core/Model/Layout/Element.php index cb8de940e80919633d69314e189494c709cde283..d9c727ab7bfa5a8177f41d4fe5c78c7392c1759b 100644 --- a/app/code/core/Mage/Core/Model/Layout/Element.php +++ b/app/code/core/Mage/Core/Model/Layout/Element.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Layout/Update.php b/app/code/core/Mage/Core/Model/Layout/Update.php index 6333f49a06df7f4fc6150def1bc5e3903d9e501b..8edf38f82d2475edc8021ee8e7184b6fc411d821 100644 --- a/app/code/core/Mage/Core/Model/Layout/Update.php +++ b/app/code/core/Mage/Core/Model/Layout/Update.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -203,13 +203,14 @@ class Mage_Core_Model_Layout_Update * * @param array|string $handles * @return Mage_Core_Model_Layout_Update + * @throws Magento_Exception */ public function load($handles=array()) { if (is_string($handles)) { $handles = array($handles); } elseif (!is_array($handles)) { - throw Mage::exception('Mage_Core', Mage::helper('Mage_Core_Helper_Data')->__('Invalid layout update handle')); + throw new Magento_Exception('Invalid layout update handle'); } foreach ($handles as $handle) { @@ -259,7 +260,9 @@ class Mage_Core_Model_Layout_Update $storeId = Mage::app()->getStore()->getId(); $elementClass = $this->getElementClass(); $design = Mage::getSingleton('Mage_Core_Model_Design_Package'); - $cacheKey = 'LAYOUT_'.$design->getArea().'_STORE'.$storeId.'_'.$design->getPackageName().'_'.$design->getTheme(); + $cacheKey = 'LAYOUT_' . $design->getArea() . '_STORE' . $storeId . '_' . $design->getPackageName() . '_' + . $design->getTheme('layout'); + $cacheTags = array(self::LAYOUT_GENERAL_CACHE_TAG); if (Mage::app()->useCache('layout') && ($layoutStr = Mage::app()->loadCache($cacheKey))) { $this->_packageLayout = simplexml_load_string($layoutStr, $elementClass); @@ -356,20 +359,27 @@ class Mage_Core_Model_Layout_Update public function fetchDbLayoutUpdates($handle) { - $_profilerKey = 'layout_db_update:' . $handle; + $_profilerKey = 'layout_db_update: '.$handle; Magento_Profiler::start($_profilerKey); - $updateStr = Mage::getResourceModel('Mage_Core_Model_Resource_Layout')->fetchUpdatesByHandle($handle); - if ($updateStr) { - $updateStr = '<update_xml>' . $updateStr . '</update_xml>'; - $updateStr = str_replace($this->_subst['from'], $this->_subst['to'], $updateStr); - $updateXml = simplexml_load_string($updateStr, $this->getElementClass()); - $this->fetchRecursiveUpdates($updateXml); - $this->addUpdate($updateXml->innerXml()); + $updateStr = $this->_getUpdateString($handle); + if (!$updateStr) { + return false; } Magento_Profiler::stop($_profilerKey); return (bool)$updateStr; } + /** + * Get update string + * + * @param string $handle + * @return mixed + */ + protected function _getUpdateString($handle) + { + return Mage::getResourceModel('Mage_Core_Model_Resource_Layout')->fetchUpdatesByHandle($handle); + } + public function fetchRecursiveUpdates($updateXml) { foreach ($updateXml->children() as $child) { @@ -390,6 +400,7 @@ class Mage_Core_Model_Layout_Update * @param string $theme * @param integer|null $storeId * @return Mage_Core_Model_Layout_Element + * @throws Magento_Exception */ public function getFileLayoutUpdatesXml($area, $package, $theme, $storeId = null) { @@ -419,7 +430,9 @@ class Mage_Core_Model_Layout_Update $module = $updateNode->getAttribute('module'); if (!$module) { $updateNodePath = $area . '/layout/updates/' . $updateNode->getName(); - throw new Exception("Layout update instruction '{$updateNodePath}' must specify the module."); + throw new Magento_Exception( + "Layout update instruction '{$updateNodePath}' must specify the module." + ); } if ($module && Mage::getStoreConfigFlag('advanced/modules_disable_output/' . $module, $storeId)) { continue; @@ -430,7 +443,7 @@ class Mage_Core_Model_Layout_Update $layoutParams + array('_module' => $module) ); if (!is_readable($filename)) { - throw new Exception("Layout update file '{$filename}' doesn't exist or isn't readable."); + throw new Magento_Exception("Layout update file '{$filename}' doesn't exist or isn't readable."); } $updateFiles[] = $filename; } diff --git a/app/code/core/Mage/Core/Model/Locale.php b/app/code/core/Mage/Core/Model/Locale.php index b44d99f131fd98d6b8822d0c52fdfc5413a72765..39738d875d9b2efb35688d82db67ea2360aa0fc5 100644 --- a/app/code/core/Mage/Core/Model/Locale.php +++ b/app/code/core/Mage/Core/Model/Locale.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -412,6 +412,18 @@ class Mage_Core_Model_Locale return $this->getTranslation($type, 'date'); } + /** + * Retrieve short date format with 4-digit year + * + * @return string + */ + public function getDateFormatWithLongYear() + { + return preg_replace('/(?<!y)yy(?!y)/', 'yyyy', + $this->getTranslation(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT, 'date')); + } + + /** * Retrieve ISO time format * diff --git a/app/code/core/Mage/Core/Model/Locale/Config.php b/app/code/core/Mage/Core/Model/Locale/Config.php index 195303562f2755bbc6030ccd2ee258114971abf3..56ee499b81e6d2c254edac1c878683386ca2db3a 100644 --- a/app/code/core/Mage/Core/Model/Locale/Config.php +++ b/app/code/core/Mage/Core/Model/Locale/Config.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Core_Model_Locale_Config diff --git a/app/code/core/Mage/Core/Model/Log/Adapter.php b/app/code/core/Mage/Core/Model/Log/Adapter.php index cb562d04b7c27a39bc3384bb3fea3f721f7cefa3..599b53aeb958ac47aca025d7b71cf639d47462b7 100644 --- a/app/code/core/Mage/Core/Model/Log/Adapter.php +++ b/app/code/core/Mage/Core/Model/Log/Adapter.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Message.php b/app/code/core/Mage/Core/Model/Message.php index 67bc773d0f53314eb1020563e1a96d0842146931..6597b1d96603aa3a7aafae6828623ddbdd6d6e1f 100644 --- a/app/code/core/Mage/Core/Model/Message.php +++ b/app/code/core/Mage/Core/Model/Message.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Message/Abstract.php b/app/code/core/Mage/Core/Model/Message/Abstract.php index ff4d3d5f0db0b501b7032e24e76b91fa6ea1cd86..ad581ae4787901df9404666f3a82b1846353f8fb 100644 --- a/app/code/core/Mage/Core/Model/Message/Abstract.php +++ b/app/code/core/Mage/Core/Model/Message/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Message/Collection.php b/app/code/core/Mage/Core/Model/Message/Collection.php index 93dcd7975c93d06bc9615ebac19ab4f2084b34a5..898900f7dbb4125752e9cf8cbc46bce7093b823a 100644 --- a/app/code/core/Mage/Core/Model/Message/Collection.php +++ b/app/code/core/Mage/Core/Model/Message/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Message/Error.php b/app/code/core/Mage/Core/Model/Message/Error.php index f339a5bdd680b02dd4ce24ecc7075d0f8cda12b7..ea61874913091ad7ae54c9ebcf7af97a947db50c 100644 --- a/app/code/core/Mage/Core/Model/Message/Error.php +++ b/app/code/core/Mage/Core/Model/Message/Error.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Message/Notice.php b/app/code/core/Mage/Core/Model/Message/Notice.php index e0c4333b2e710ef00c8e0e4de4ec7d2a2eb455ea..527c530571568f2f05402a658003af1fa172d1fc 100644 --- a/app/code/core/Mage/Core/Model/Message/Notice.php +++ b/app/code/core/Mage/Core/Model/Message/Notice.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Message/Success.php b/app/code/core/Mage/Core/Model/Message/Success.php index bf51fdf5b178153a67a342ff3ddb20152210262b..16b1039cbdc2a8de69c3a2459c0ad8592d4d46ec 100644 --- a/app/code/core/Mage/Core/Model/Message/Success.php +++ b/app/code/core/Mage/Core/Model/Message/Success.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Message/Warning.php b/app/code/core/Mage/Core/Model/Message/Warning.php index ad44e90528d90388b65c9ce7e9eeab7a45a31341..ef1ac3c1f047aa25e8e5b4e0aac6aabd417f4ba1 100644 --- a/app/code/core/Mage/Core/Model/Message/Warning.php +++ b/app/code/core/Mage/Core/Model/Message/Warning.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Observer.php b/app/code/core/Mage/Core/Model/Observer.php index e55d25fa732e126a6825ceee0d378063bafc263c..9ccfe39cad4846cc6714b39eaf861b64704b87b5 100644 --- a/app/code/core/Mage/Core/Model/Observer.php +++ b/app/code/core/Mage/Core/Model/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Resource.php b/app/code/core/Mage/Core/Model/Resource.php index bd5920f71b39eb49e23df69186671ef50d52c341..0f0254cfa09225358bb25090c5d14ce38d69cf46 100644 --- a/app/code/core/Mage/Core/Model/Resource.php +++ b/app/code/core/Mage/Core/Model/Resource.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Resource/Abstract.php b/app/code/core/Mage/Core/Model/Resource/Abstract.php index 21aacc295ff7c73b29e7965534538b3b16c4ff63..a1420239b774c88e24f6e6005fe5eb18e7cc8050 100644 --- a/app/code/core/Mage/Core/Model/Resource/Abstract.php +++ b/app/code/core/Mage/Core/Model/Resource/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Resource/Cache.php b/app/code/core/Mage/Core/Model/Resource/Cache.php index 2daf17c57417da308ef6c5dc125019308999846e..13a55db93523dd5e25692d98e2d4fd8e18634e41 100644 --- a/app/code/core/Mage/Core/Model/Resource/Cache.php +++ b/app/code/core/Mage/Core/Model/Resource/Cache.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Resource/Config.php b/app/code/core/Mage/Core/Model/Resource/Config.php index 1f1c1d2af0707b1f1d21292e2decc51f1d6a3dd8..bd74683cd2fbdd72892b1261403780d564ad17f4 100644 --- a/app/code/core/Mage/Core/Model/Resource/Config.php +++ b/app/code/core/Mage/Core/Model/Resource/Config.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Resource/Config/Data.php b/app/code/core/Mage/Core/Model/Resource/Config/Data.php index 48f5f81fed811fbaf866f836bc81c442b468d292..90633c7ae4f64b305b43ef7d5e462490528fe60b 100644 --- a/app/code/core/Mage/Core/Model/Resource/Config/Data.php +++ b/app/code/core/Mage/Core/Model/Resource/Config/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Resource/Config/Data/Collection.php b/app/code/core/Mage/Core/Model/Resource/Config/Data/Collection.php index a8f48daa2e4ca3b135548304e763141e75ab049e..af987416477d9dce97f5017618dde249cdd2734b 100644 --- a/app/code/core/Mage/Core/Model/Resource/Config/Data/Collection.php +++ b/app/code/core/Mage/Core/Model/Resource/Config/Data/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php b/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php index fa7792cc088dd3e154e47c3b6b6296eb106da93e..c03da80b0c76060d516a974a07a813bc089a856f 100644 --- a/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php +++ b/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Resource/Db/Collection/Abstract.php b/app/code/core/Mage/Core/Model/Resource/Db/Collection/Abstract.php index 5c4def357b1624b699130e07c4d9aef402170fe3..8f60118e3a5764189ae82cb41587409ad1b12dbb 100644 --- a/app/code/core/Mage/Core/Model/Resource/Db/Collection/Abstract.php +++ b/app/code/core/Mage/Core/Model/Resource/Db/Collection/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Resource/Design.php b/app/code/core/Mage/Core/Model/Resource/Design.php index ca93cc537c24d38943fd12e3f2388ab06ec3a62a..d6f85d69ebbb170444d29147d926dcabd079cb34 100644 --- a/app/code/core/Mage/Core/Model/Resource/Design.php +++ b/app/code/core/Mage/Core/Model/Resource/Design.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Resource/Design/Collection.php b/app/code/core/Mage/Core/Model/Resource/Design/Collection.php index aa5ef1341533c866b7039a10b1d38c96e22ca70b..58f5e4ecb3df9386132f4ab0cf20e4cdacfac7a6 100644 --- a/app/code/core/Mage/Core/Model/Resource/Design/Collection.php +++ b/app/code/core/Mage/Core/Model/Resource/Design/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Resource/Email/Template.php b/app/code/core/Mage/Core/Model/Resource/Email/Template.php index 8a7261ca8dfee88700dae3469e5f64793cbda372..22a32c07c9e3086912b9ac27d52100b90369a5d3 100644 --- a/app/code/core/Mage/Core/Model/Resource/Email/Template.php +++ b/app/code/core/Mage/Core/Model/Resource/Email/Template.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Resource/Email/Template/Collection.php b/app/code/core/Mage/Core/Model/Resource/Email/Template/Collection.php index d71665cf7727344347dacdcaca6babb15388653a..626868e32242f8d51eb159f51d67c874f1ae65f8 100644 --- a/app/code/core/Mage/Core/Model/Resource/Email/Template/Collection.php +++ b/app/code/core/Mage/Core/Model/Resource/Email/Template/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Resource/Entity/Abstract.php b/app/code/core/Mage/Core/Model/Resource/Entity/Abstract.php index 2d582e2b9596a0337303dd5e8f503c622a420df6..fb99b53096e32d9161c56d863b343ba8a5894c77 100644 --- a/app/code/core/Mage/Core/Model/Resource/Entity/Abstract.php +++ b/app/code/core/Mage/Core/Model/Resource/Entity/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Resource/Entity/Table.php b/app/code/core/Mage/Core/Model/Resource/Entity/Table.php index 68380e149e0b10597570408b7508b3fe57d8a618..12923593fecb7c3525d77bcf6d033ddbc494edd9 100644 --- a/app/code/core/Mage/Core/Model/Resource/Entity/Table.php +++ b/app/code/core/Mage/Core/Model/Resource/Entity/Table.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Resource/File/Storage/Abstract.php b/app/code/core/Mage/Core/Model/Resource/File/Storage/Abstract.php index 6d0079a666e20fa4f9a30e04d92b6640626e67eb..12477905d2b4c9308c6f628df8f347f8d66d6943 100644 --- a/app/code/core/Mage/Core/Model/Resource/File/Storage/Abstract.php +++ b/app/code/core/Mage/Core/Model/Resource/File/Storage/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Resource/File/Storage/Database.php b/app/code/core/Mage/Core/Model/Resource/File/Storage/Database.php index a2e83e4870a9e21c5b7f20da25392a7ba36ea4ab..8c670c6a1c79413de6888889c44dfcb3f43aceb1 100644 --- a/app/code/core/Mage/Core/Model/Resource/File/Storage/Database.php +++ b/app/code/core/Mage/Core/Model/Resource/File/Storage/Database.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Resource/File/Storage/Directory/Database.php b/app/code/core/Mage/Core/Model/Resource/File/Storage/Directory/Database.php index 435e9e6ac1d95f4bf98c59712f68e7a334503ea5..e5f9caf179b6ba5ef3e45cbc997ee4f612fd0df9 100644 --- a/app/code/core/Mage/Core/Model/Resource/File/Storage/Directory/Database.php +++ b/app/code/core/Mage/Core/Model/Resource/File/Storage/Directory/Database.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Resource/File/Storage/File.php b/app/code/core/Mage/Core/Model/Resource/File/Storage/File.php index de66f3317d157d0cf0647928dbe1d1eaf3bbb41b..4cdb9ae572a3aaf66ef1fa42b02b9f9d8d76139c 100644 --- a/app/code/core/Mage/Core/Model/Resource/File/Storage/File.php +++ b/app/code/core/Mage/Core/Model/Resource/File/Storage/File.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Resource/Flag.php b/app/code/core/Mage/Core/Model/Resource/Flag.php index db019208dd2995f9fc76bd8096470183d1fdcd40..f45639307121a3ab5b4eb958660a2d028bbee387 100644 --- a/app/code/core/Mage/Core/Model/Resource/Flag.php +++ b/app/code/core/Mage/Core/Model/Resource/Flag.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Resource/Helper/Abstract.php b/app/code/core/Mage/Core/Model/Resource/Helper/Abstract.php index 3114e3b636f451e1371d19f9b1d0ae41a631cbde..8a81ea90a7d67d7844554468b8064f8b63a78796 100644 --- a/app/code/core/Mage/Core/Model/Resource/Helper/Abstract.php +++ b/app/code/core/Mage/Core/Model/Resource/Helper/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Resource/Helper/Mysql4.php b/app/code/core/Mage/Core/Model/Resource/Helper/Mysql4.php index 3c97725b6d9a15a57203bf21223c56983e6e2945..d1738d51f952f18cfa897f884d088a7a77b78f9f 100644 --- a/app/code/core/Mage/Core/Model/Resource/Helper/Mysql4.php +++ b/app/code/core/Mage/Core/Model/Resource/Helper/Mysql4.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Resource/Iterator.php b/app/code/core/Mage/Core/Model/Resource/Iterator.php index f056858832c45d6e223639b6e43f8729a17a62df..1c23cca00bc4e2cf9998dfdf871500fc60ccf3be 100644 --- a/app/code/core/Mage/Core/Model/Resource/Iterator.php +++ b/app/code/core/Mage/Core/Model/Resource/Iterator.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Resource/Layout.php b/app/code/core/Mage/Core/Model/Resource/Layout.php index 9eb58cb407ee7ef1dafd1a8a0fc5920e4309891c..d48bef3210e97932639476dd61d017b254262cd6 100644 --- a/app/code/core/Mage/Core/Model/Resource/Layout.php +++ b/app/code/core/Mage/Core/Model/Resource/Layout.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Resource/Resource.php b/app/code/core/Mage/Core/Model/Resource/Resource.php index 61d515b1f397e9fb7e4dee7620510ac0d5a77859..6357835bbf94dcd8d93ad652654e9751b0a693a3 100644 --- a/app/code/core/Mage/Core/Model/Resource/Resource.php +++ b/app/code/core/Mage/Core/Model/Resource/Resource.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Resource/Session.php b/app/code/core/Mage/Core/Model/Resource/Session.php index 6f4cdbc51137cca4eca90aa59278e1f93441473e..139638a02de6fc40b366293f41a275f1c053d78a 100644 --- a/app/code/core/Mage/Core/Model/Resource/Session.php +++ b/app/code/core/Mage/Core/Model/Resource/Session.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Resource/Setup.php b/app/code/core/Mage/Core/Model/Resource/Setup.php index 0022d6fe37f994cea441d2cbec73e5f17be7ac81..ad1cac97480174a8384150e184f34d3f6692fdfa 100644 --- a/app/code/core/Mage/Core/Model/Resource/Setup.php +++ b/app/code/core/Mage/Core/Model/Resource/Setup.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Resource/Setup/Query/Modifier.php b/app/code/core/Mage/Core/Model/Resource/Setup/Query/Modifier.php index 594c84470bd384ca10400cb2d1876645f87a8613..72632af12a2facfa30e8e2a010fb5d14e670b2d1 100644 --- a/app/code/core/Mage/Core/Model/Resource/Setup/Query/Modifier.php +++ b/app/code/core/Mage/Core/Model/Resource/Setup/Query/Modifier.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Resource/Store.php b/app/code/core/Mage/Core/Model/Resource/Store.php index 5764bd8edd701c7fce61ef2ac23c13134a71078f..0621ae1be1d621b55c34b7efd6970d037c4de10b 100644 --- a/app/code/core/Mage/Core/Model/Resource/Store.php +++ b/app/code/core/Mage/Core/Model/Resource/Store.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Resource/Store/Collection.php b/app/code/core/Mage/Core/Model/Resource/Store/Collection.php index ac453de5a7a7ae30a4cdbb1b668f730d19c82da5..f046ab681ed2a4eac88ebe60349ce538c1a423a6 100644 --- a/app/code/core/Mage/Core/Model/Resource/Store/Collection.php +++ b/app/code/core/Mage/Core/Model/Resource/Store/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Resource/Store/Group.php b/app/code/core/Mage/Core/Model/Resource/Store/Group.php index 248e508451b9e0f8f4c3f5518865aa6b10740c1b..d498774b5cf18a93a8b963707cdcc31a5f60e07d 100644 --- a/app/code/core/Mage/Core/Model/Resource/Store/Group.php +++ b/app/code/core/Mage/Core/Model/Resource/Store/Group.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Resource/Store/Group/Collection.php b/app/code/core/Mage/Core/Model/Resource/Store/Group/Collection.php index 28934608186bad2263342e874f00b79cb9e5dd11..9d26576d41c2bcd8e97eb0752dc94c8fef1bf435 100644 --- a/app/code/core/Mage/Core/Model/Resource/Store/Group/Collection.php +++ b/app/code/core/Mage/Core/Model/Resource/Store/Group/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Resource/Transaction.php b/app/code/core/Mage/Core/Model/Resource/Transaction.php index 5fed71dc03e7f3c0ae4a64d8d381ce7e298d75f6..e6ae97ecfa275c4c1253ad8649e51f3e46b9b71e 100644 --- a/app/code/core/Mage/Core/Model/Resource/Transaction.php +++ b/app/code/core/Mage/Core/Model/Resource/Transaction.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Resource/Translate.php b/app/code/core/Mage/Core/Model/Resource/Translate.php index 0771a66ef155d72712406e9aa08d92e5e8671bed..c992017854fe84e7c6e1b60b6eafef1ae0fb33bf 100644 --- a/app/code/core/Mage/Core/Model/Resource/Translate.php +++ b/app/code/core/Mage/Core/Model/Resource/Translate.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Resource/Translate/String.php b/app/code/core/Mage/Core/Model/Resource/Translate/String.php index 1736b8a6fb1a5b65b94ef6f44ea5518df6c161b8..3dd252f900a4ba356b1512546d7a949f0de1a157 100644 --- a/app/code/core/Mage/Core/Model/Resource/Translate/String.php +++ b/app/code/core/Mage/Core/Model/Resource/Translate/String.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Resource/Type/Abstract.php b/app/code/core/Mage/Core/Model/Resource/Type/Abstract.php index fbf1a9142b96e95cacc1151e4137705e03e73507..870f73865b70dec463c5edc67c4799e65d925755 100644 --- a/app/code/core/Mage/Core/Model/Resource/Type/Abstract.php +++ b/app/code/core/Mage/Core/Model/Resource/Type/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Resource/Type/Db.php b/app/code/core/Mage/Core/Model/Resource/Type/Db.php index 67f3430c87d5f0582458fec00f8fbcaf16fe3269..6ebb2af660f52df778b90d4d60c81bc6c1695a24 100644 --- a/app/code/core/Mage/Core/Model/Resource/Type/Db.php +++ b/app/code/core/Mage/Core/Model/Resource/Type/Db.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Resource/Type/Db/Mysqli.php b/app/code/core/Mage/Core/Model/Resource/Type/Db/Mysqli.php index 7f8f28625ce5dc85b526422a8c571401cc792402..e9f4f27e00dca51fd1a2c58d3b44115effb15eae 100644 --- a/app/code/core/Mage/Core/Model/Resource/Type/Db/Mysqli.php +++ b/app/code/core/Mage/Core/Model/Resource/Type/Db/Mysqli.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Resource/Type/Db/Mysqli/Setup.php b/app/code/core/Mage/Core/Model/Resource/Type/Db/Mysqli/Setup.php index ea0444c3fe88d6a979fa7c94b39bd48a65d9b3f5..50e165d90fc8d5542deda9d549731fa2df04b97c 100644 --- a/app/code/core/Mage/Core/Model/Resource/Type/Db/Mysqli/Setup.php +++ b/app/code/core/Mage/Core/Model/Resource/Type/Db/Mysqli/Setup.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Resource/Type/Db/Pdo/Mysql.php b/app/code/core/Mage/Core/Model/Resource/Type/Db/Pdo/Mysql.php index 3b905f2ec51a3d96278dfc5a8424ee807cd9e224..32e99cb1a07fb44342cff77752a4b97e23b5fdd4 100644 --- a/app/code/core/Mage/Core/Model/Resource/Type/Db/Pdo/Mysql.php +++ b/app/code/core/Mage/Core/Model/Resource/Type/Db/Pdo/Mysql.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Resource/Url/Rewrite.php b/app/code/core/Mage/Core/Model/Resource/Url/Rewrite.php index ffec56e6497ed7d309734fab69867a632171ada2..1678109121c84afd44fbdd3856b98f7a5fc3b27e 100644 --- a/app/code/core/Mage/Core/Model/Resource/Url/Rewrite.php +++ b/app/code/core/Mage/Core/Model/Resource/Url/Rewrite.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -147,6 +147,9 @@ class Mage_Core_Model_Resource_Url_Rewrite extends Mage_Core_Model_Resource_Db_A $currentPenalty = null; $foundItem = null; foreach ($items as $item) { + if (!array_key_exists($item['request_path'], $mapPenalty)) { + continue; + } $penalty = $mapPenalty[$item['request_path']] << 1 + ($item['store_id'] ? 0 : 1); if (!$foundItem || $currentPenalty > $penalty) { $foundItem = $item; diff --git a/app/code/core/Mage/Core/Model/Resource/Url/Rewrite/Collection.php b/app/code/core/Mage/Core/Model/Resource/Url/Rewrite/Collection.php index 830ce0beb27f73f9d9488c31686ff0d9cbc20ef9..81798575f37a289602d17e928a1ac5070f9a7483 100644 --- a/app/code/core/Mage/Core/Model/Resource/Url/Rewrite/Collection.php +++ b/app/code/core/Mage/Core/Model/Resource/Url/Rewrite/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Resource/Variable.php b/app/code/core/Mage/Core/Model/Resource/Variable.php index 07e7b19b5967e69d89bece422683238b4d9d48a0..cdb3a5f9700c745a57fb7fea2cb1b340f98c9d69 100644 --- a/app/code/core/Mage/Core/Model/Resource/Variable.php +++ b/app/code/core/Mage/Core/Model/Resource/Variable.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -136,10 +136,9 @@ class Mage_Core_Model_Resource_Variable extends Mage_Core_Model_Resource_Db_Abst */ protected function _addValueToSelect(Zend_Db_Select $select, $storeId = Mage_Core_Model_App::ADMIN_STORE_ID) { - $ifNullPlainValue = $this->_getReadAdapter() - ->getCheckSql('store.plain_value IS NULL', 'def.plain_value', 'store.plain_value'); - $ifNullHtmlValue = $this->_getReadAdapter() - ->getCheckSql('store.html_value IS NULL', 'def.html_value', 'store.html_value'); + $adapter = $this->_getReadAdapter(); + $ifNullPlainValue = $adapter->getCheckSql('store.plain_value IS NULL', 'def.plain_value', 'store.plain_value'); + $ifNullHtmlValue = $adapter->getCheckSql('store.html_value IS NULL', 'def.html_value', 'store.html_value'); $select->joinLeft( array('def' => $this->getTable('core_variable_value')), @@ -147,7 +146,7 @@ class Mage_Core_Model_Resource_Variable extends Mage_Core_Model_Resource_Db_Abst array()) ->joinLeft( array('store' => $this->getTable('core_variable_value')), - 'store.variable_id = def.variable_id AND store.store_id = ' . $storeId, + 'store.variable_id = def.variable_id AND store.store_id = ' . $adapter->quote($storeId), array()) ->columns(array( 'plain_value' => $ifNullPlainValue, @@ -158,4 +157,4 @@ class Mage_Core_Model_Resource_Variable extends Mage_Core_Model_Resource_Db_Abst return $this; } -} +} \ No newline at end of file diff --git a/app/code/core/Mage/Core/Model/Resource/Variable/Collection.php b/app/code/core/Mage/Core/Model/Resource/Variable/Collection.php index b40a7cbc2f0f96664d7e97c713a1783523fe0b31..78a1d2a4d9d9c2d75a51f0125fa68595a90d3bed 100644 --- a/app/code/core/Mage/Core/Model/Resource/Variable/Collection.php +++ b/app/code/core/Mage/Core/Model/Resource/Variable/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Resource/Website.php b/app/code/core/Mage/Core/Model/Resource/Website.php index b55d7459f48bd23d9f2ee5dcd5037dec7888df15..154c284b61ed9f1a995e1d0f9529a8303c35f44d 100644 --- a/app/code/core/Mage/Core/Model/Resource/Website.php +++ b/app/code/core/Mage/Core/Model/Resource/Website.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Resource/Website/Collection.php b/app/code/core/Mage/Core/Model/Resource/Website/Collection.php index 2d14095c239e61a9b22ef5bec11446dcaf701789..aa46a53cd15d0cda7270683c582040f3e06b0123 100644 --- a/app/code/core/Mage/Core/Model/Resource/Website/Collection.php +++ b/app/code/core/Mage/Core/Model/Resource/Website/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Session.php b/app/code/core/Mage/Core/Model/Session.php index a2dd334fef8ee445f3d659d6ff9b670a93e59f86..cd9e1ee452d199b3e3c703271a5cdf7209dda2f7 100644 --- a/app/code/core/Mage/Core/Model/Session.php +++ b/app/code/core/Mage/Core/Model/Session.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Session/Abstract.php b/app/code/core/Mage/Core/Model/Session/Abstract.php index 8cd328e059c9c078b45b52e5c6233a7d35502903..d6581184b03e8c117fbc35a1b3574d4238d7ce81 100644 --- a/app/code/core/Mage/Core/Model/Session/Abstract.php +++ b/app/code/core/Mage/Core/Model/Session/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -220,7 +220,7 @@ class Mage_Core_Model_Session_Abstract extends Mage_Core_Model_Session_Abstract_ } /** - * Not Mage exeption handling + * Not Mage exception handling * * @param Exception $exception * @param string $alternativeText diff --git a/app/code/core/Mage/Core/Model/Session/Abstract/Varien.php b/app/code/core/Mage/Core/Model/Session/Abstract/Varien.php index f11242d70975b5e4f83de1680b7e850a73d8f6a6..f32b59a6ad48f3c032873044b27a2ab097b576bd 100644 --- a/app/code/core/Mage/Core/Model/Session/Abstract/Varien.php +++ b/app/code/core/Mage/Core/Model/Session/Abstract/Varien.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -56,6 +56,10 @@ class Mage_Core_Model_Session_Abstract_Varien extends Varien_Object ini_set('session.save_handler', 'memcache'); session_save_path($this->getSessionSavePath()); break; + case 'memcached': + ini_set('session.save_handler', 'memcached'); + session_save_path($this->getSessionSavePath()); + break; case 'eaccelerator': ini_set('session.save_handler', 'eaccelerator'); break; diff --git a/app/code/core/Mage/Core/Model/Session/Abstract/Zend.php b/app/code/core/Mage/Core/Model/Session/Abstract/Zend.php index dbe28f9dbebc46e30c58765cca1865502c93f930..a2a4d78c2e873151374467dfaaa185debf93b967 100644 --- a/app/code/core/Mage/Core/Model/Session/Abstract/Zend.php +++ b/app/code/core/Mage/Core/Model/Session/Abstract/Zend.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Session/Exception.php b/app/code/core/Mage/Core/Model/Session/Exception.php index f21bee10d6610c0fa275348d575742280387557d..07bfa6537e9b4742c270005aa72f094a078596a8 100644 --- a/app/code/core/Mage/Core/Model/Session/Exception.php +++ b/app/code/core/Mage/Core/Model/Session/Exception.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/ShellAbstract.php b/app/code/core/Mage/Core/Model/ShellAbstract.php index f8fa805363b71aafbdda3cea1b67dab6d8e6c874..bd5101f0a24f6edd1f11c7c6954898d2eeba6695 100644 --- a/app/code/core/Mage/Core/Model/ShellAbstract.php +++ b/app/code/core/Mage/Core/Model/ShellAbstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Shell - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Source/Email/Variables.php b/app/code/core/Mage/Core/Model/Source/Email/Variables.php index bf6b75102134180ea81805caa1ba5fd20ebf6c65..f28ccf54b1ae9ade27c310f21de3d6df93e34e86 100644 --- a/app/code/core/Mage/Core/Model/Source/Email/Variables.php +++ b/app/code/core/Mage/Core/Model/Source/Email/Variables.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -47,59 +47,58 @@ class Mage_Core_Model_Source_Email_Variables */ public function __construct() { - $helper = Mage::helper('Mage_Core_Helper_Data'); $this->_configVariables = array( array( 'value' => Mage_Core_Model_Url::XML_PATH_UNSECURE_URL, - 'label' => $helper->__('Base Unsecure URL') + 'label' => Mage::helper('Mage_Core_Helper_Data')->__('Base Unsecure URL') ), array( 'value' => Mage_Core_Model_Url::XML_PATH_SECURE_URL, - 'label' => $helper->__('Base Secure URL') + 'label' => Mage::helper('Mage_Core_Helper_Data')->__('Base Secure URL') ), array( 'value' => 'trans_email/ident_general/name', - 'label' => $helper->__('General Contact Name') + 'label' => Mage::helper('Mage_Core_Helper_Data')->__('General Contact Name') ), array( 'value' => 'trans_email/ident_general/email', - 'label' => $helper->__('General Contact Email') + 'label' => Mage::helper('Mage_Core_Helper_Data')->__('General Contact Email') ), array( 'value' => 'trans_email/ident_sales/name', - 'label' => $helper->__('Sales Representative Contact Name') + 'label' => Mage::helper('Mage_Core_Helper_Data')->__('Sales Representative Contact Name') ), array( 'value' => 'trans_email/ident_sales/email', - 'label' => $helper->__('Sales Representative Contact Email') + 'label' => Mage::helper('Mage_Core_Helper_Data')->__('Sales Representative Contact Email') ), array( 'value' => 'trans_email/ident_custom1/name', - 'label' => $helper->__('Custom1 Contact Name') + 'label' => Mage::helper('Mage_Core_Helper_Data')->__('Custom1 Contact Name') ), array( 'value' => 'trans_email/ident_custom1/email', - 'label' => $helper->__('Custom1 Contact Email') + 'label' => Mage::helper('Mage_Core_Helper_Data')->__('Custom1 Contact Email') ), array( 'value' => 'trans_email/ident_custom2/name', - 'label' => $helper->__('Custom2 Contact Name') + 'label' => Mage::helper('Mage_Core_Helper_Data')->__('Custom2 Contact Name') ), array( 'value' => 'trans_email/ident_custom2/email', - 'label' => $helper->__('Custom2 Contact Email') + 'label' => Mage::helper('Mage_Core_Helper_Data')->__('Custom2 Contact Email') ), array( 'value' => 'general/store_information/name', - 'label' => $helper->__('Store Name') + 'label' => Mage::helper('Mage_Core_Helper_Data')->__('Store Name') ), array( 'value' => 'general/store_information/phone', - 'label' => $helper->__('Store Contact Telephone') + 'label' => Mage::helper('Mage_Core_Helper_Data')->__('Store Contact Telephone') ), array( 'value' => 'general/store_information/address', - 'label' => $helper->__('Store Contact Address') + 'label' => Mage::helper('Mage_Core_Helper_Data')->__('Store Contact Address') ) ); } diff --git a/app/code/core/Mage/Core/Model/Store.php b/app/code/core/Mage/Core/Model/Store.php index 75eef3bf313c3bfc9f39e02903856e231c2055b0..ed119fb711f9245018d8b2abbf67d6ada83f6603 100644 --- a/app/code/core/Mage/Core/Model/Store.php +++ b/app/code/core/Mage/Core/Model/Store.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -95,10 +95,15 @@ class Mage_Core_Model_Store extends Mage_Core_Model_Abstract */ const COOKIE_NAME = 'store'; + /** + * Cookie currency key + */ + const COOKIE_CURRENCY = 'currency'; + /** * Script name, which returns all the images */ - const MEDIA_REWRITE_SCRIPT = 'get.php/'; + const MEDIA_REWRITE_SCRIPT = 'get.php/'; /** * Cache flag @@ -677,7 +682,8 @@ class Mage_Core_Model_Store extends Mage_Core_Model_Abstract } if (Mage::isInstalled()) { - $secureBaseUrl = $this->getConfig(Mage_Core_Model_Url::XML_PATH_SECURE_URL); + $secureBaseUrl = Mage::getStoreConfig(Mage_Core_Model_Url::XML_PATH_SECURE_URL); + if (!$secureBaseUrl) { return false; } @@ -766,9 +772,9 @@ class Mage_Core_Model_Store extends Mage_Core_Model_Abstract if (in_array($code, $this->getAvailableCurrencyCodes())) { $this->_getSession()->setCurrencyCode($code); if ($code == $this->getDefaultCurrency()) { - Mage::app()->getCookie()->delete('currency', $code); + Mage::app()->getCookie()->delete(self::COOKIE_CURRENCY, $code); } else { - Mage::app()->getCookie()->set('currency', $code); + Mage::app()->getCookie()->set(self::COOKIE_CURRENCY, $code); } } return $this; diff --git a/app/code/core/Mage/Core/Model/Store/Api.php b/app/code/core/Mage/Core/Model/Store/Api.php index 3271c070ad82f944b2bce3eaf2c091258aa3a17c..9420ee59c06e1343cb96f04aafa430968392447a 100644 --- a/app/code/core/Mage/Core/Model/Store/Api.php +++ b/app/code/core/Mage/Core/Model/Store/Api.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Store/Api/V2.php b/app/code/core/Mage/Core/Model/Store/Api/V2.php index c6d1c5dce21f6938798846200df12fabbbc894b6..f202a1a00a211e60157a5f97ee5aec23cb2dabe2 100644 --- a/app/code/core/Mage/Core/Model/Store/Api/V2.php +++ b/app/code/core/Mage/Core/Model/Store/Api/V2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Directory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Store/Exception.php b/app/code/core/Mage/Core/Model/Store/Exception.php index 215e31f2539f33b67f9f41e40a0d9183afccde01..78f2395b08bf10cfdae5188a69bb0ee16302e5e1 100644 --- a/app/code/core/Mage/Core/Model/Store/Exception.php +++ b/app/code/core/Mage/Core/Model/Store/Exception.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Store/Group.php b/app/code/core/Mage/Core/Model/Store/Group.php index 6bad369c33acf951c8b96179950ae4d6f9f01391..58325f75480844cdde36b5b2d3f9e0e2f913c9ec 100644 --- a/app/code/core/Mage/Core/Model/Store/Group.php +++ b/app/code/core/Mage/Core/Model/Store/Group.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -227,6 +227,46 @@ class Mage_Core_Model_Store_Group extends Mage_Core_Model_Abstract return $this->_defaultStore; } + /** + * Get most suitable store by locale + * If no store with given locale is found - default store is returned + * If group has no stores - null is returned + * + * @param string $locale + * @return Mage_Core_Model_Store|null + */ + public function getDefaultStoreByLocale($locale) + { + if ($this->getDefaultStore() && $this->getDefaultStore()->getLocaleCode() == $locale) { + return $this->getDefaultStore(); + } else { + $stores = $this->getStoresByLocale($locale); + if (count($stores)) { + return $stores[0]; + } else { + return $this->getDefaultStore() ? $this->getDefaultStore() : null; + } + } + } + + /** + * Retrieve list of stores with given locale + * + * @param $locale + * @return array + */ + public function getStoresByLocale($locale) + { + $stores = array(); + foreach ($this->getStores() as $store) { + /* @var $store Mage_Core_Model_Store */ + if ($store->getLocaleCode() == $locale) { + array_push($stores, $store); + } + } + return $stores; + } + /** * Set website model * diff --git a/app/code/core/Mage/Core/Model/Template.php b/app/code/core/Mage/Core/Model/Template.php index 896300cb70d48602817367207ed2e96e9cd560f5..63c8f8efa7b95eef96cb65565323201de71ac15c 100644 --- a/app/code/core/Mage/Core/Model/Template.php +++ b/app/code/core/Mage/Core/Model/Template.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -126,7 +126,7 @@ abstract class Mage_Core_Model_Template extends Mage_Core_Model_Abstract public function setDesignConfig(array $config) { if (!isset($config['area']) || !isset($config['store'])) { - throw new Exception(Mage::helper('Mage_Core_Helper_Data')->__('Design config must have area and store.')); + throw new Magento_Exception('Design config must have area and store.'); } $this->getDesignConfig()->setData($config); return $this; diff --git a/app/code/core/Mage/Core/Model/Translate.php b/app/code/core/Mage/Core/Model/Translate.php index 1675e3355fbfdb72d47370e3c23b3c3ad7b158d2..3b48700f4eb92b59d9a418057575e9cfa04f60ba 100644 --- a/app/code/core/Mage/Core/Model/Translate.php +++ b/app/code/core/Mage/Core/Model/Translate.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Translate/Expr.php b/app/code/core/Mage/Core/Model/Translate/Expr.php index 9de35666c68d44537d8b198bc0df98c32c4dc732..b5a785e52d7615031df6eac2cacfd42345ab8d11 100644 --- a/app/code/core/Mage/Core/Model/Translate/Expr.php +++ b/app/code/core/Mage/Core/Model/Translate/Expr.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Translate/Inline.php b/app/code/core/Mage/Core/Model/Translate/Inline.php index 5c0940569f607a7c23f0e579f5fe122f137469d1..60b9a50b6bbdaada22a67ff37153f71891cf2774 100644 --- a/app/code/core/Mage/Core/Model/Translate/Inline.php +++ b/app/code/core/Mage/Core/Model/Translate/Inline.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -69,6 +69,13 @@ class Mage_Core_Model_Translate_Inline */ protected $_isJson = false; + /** + * Get max translate block in same tag + * + * @var int + */ + protected $_maxTranslateBlocks = 7; + /** * List of global tags * @@ -87,7 +94,6 @@ class Mage_Core_Model_Translate_Inline protected $_allowedTagsSimple = array( 'legend' => 'Caption for the fieldset element', 'label' => 'Label for an input element.', - 'option' => 'Drop-down list option', 'button' => 'Push button', 'a' => 'Link label', 'b' => 'Bold text', @@ -108,7 +114,6 @@ class Mage_Core_Model_Translate_Inline 'dd' => 'Item description in a definition list.', 'caption' => 'Table caption', 'th' => 'Header cell in a table', - 'td' => 'Standard cell in a table', 'abbr' => 'Abbreviated phrase', 'acronym' => 'An acronym', 'var' => 'Variable part of a text', @@ -124,7 +129,8 @@ class Mage_Core_Model_Translate_Inline 'h6' => 'Heading level 6', 'p' => 'Paragraph', 'pre' => 'Preformatted text', - 'center' => 'Centered text' + 'center' => 'Centered text', + 'select' => 'List options', ); /** @@ -201,8 +207,7 @@ class Mage_Core_Model_Translate_Inline $this->stripInlineTranslations($part); } } else if (is_string($body)) { - $body = preg_replace('#'.$this->_tokenRegex.'#', '$1', $body); - $body = preg_replace('/{{escape.*?}}/', '', $body); + $body = preg_replace('#' . $this->_tokenRegex . '#', '$1', $body); } return $this; } @@ -229,17 +234,20 @@ class Mage_Core_Model_Translate_Inline } else if (is_string($body)) { $this->_content = $body; - $this->_tagAttributes(); $this->_specialTags(); + $this->_tagAttributes(); $this->_otherText(); $this->_insertInlineScriptsHtml(); - $this->_escapeInline(); + $body = $this->_content; } return $this; } + /** + * Add translate js to body + */ protected function _insertInlineScriptsHtml() { if ($this->_isScriptInserted || stripos($this->_content, '</body>')===false) { @@ -269,7 +277,7 @@ class Mage_Core_Model_Translate_Inline <?php $html = ob_get_clean(); - $this->_content = str_ireplace('</body>', $html.'</body>', $this->_content); + $this->_content = str_ireplace('</body>', $html . '</body>', $this->_content); $this->_isScriptInserted = true; } @@ -286,25 +294,63 @@ class Mage_Core_Model_Translate_Inline } /** - * Escapes quoting inside inline translations. Useful when inline translation is inserted inside a JS string. - * @see Mage_Core_Helper_Translate::inlineTranslateStartMarker() - * @see Mage_Core_Helper_Translate::inlineTranslateEndMarker() - * @return Mage_Core_Model_Translate_Inline + * Get attribute location + * + * @param array $matches + * @param array $options + * @return string */ - protected function _escapeInline() + protected function _getAttributeLocation($matches, $options) { - // {{escape='}}some_javascript_with_'_inside{{escape}} - while (preg_match('/\{\{escape=(.)\}\}(.*?)\{\{escape\}\}/', $this->_content, $matches)) { - // escape double quote character to make it possible to use it inside "" - $charToEscape = str_replace('"', '\\"', $matches[1]); - // preg_replace() used to avoid escaping already escaped quotes - $part = preg_replace("/[^\\\\]{$charToEscape}/", "\\{$charToEscape}", $matches[2]); - // Replace markers+string with the string itself - $this->_content = str_replace($matches[0], $part, $this->_content); + return 'Tag attribute (ALT, TITLE, etc.)'; + } + + /** + * Get tag location + * + * @param array $matches + * @param array $options + * @return string + */ + protected function _getTagLocation($matches, $options) + { + $tagName = strtolower($options['tagName']); + + if (isset($options['tagList'][$tagName])) { + return $options['tagList'][$tagName]; } - return $this; + + return ucfirst($tagName) . ' Text'; } + /** + * Get translate data by regexp + * + * @param string $regexp + * @param string $text + * @param string|array $locationCallback + * @param array $options + * @return array + */ + protected function _getTranslateData($regexp, &$text, $locationCallback, $options = array()) + { + $trArr = array(); + $next = 0; + while (preg_match($regexp, $text, $m, PREG_OFFSET_CAPTURE, $next)) { + $trArr[] = json_encode(array( + 'shown' => $m[1][0], + 'translated' => $m[2][0], + 'original' => $m[3][0], + 'location' => call_user_func($locationCallback, $m, $options), + 'scope' => $m[4][0], + )); + $text = substr_replace($text, $m[1][0], $m[0][1], strlen($m[0][0])); + $next = $m[0][1]; + } + return $trArr; + } + + /** * Prepare tags inline translates * @@ -312,139 +358,192 @@ class Mage_Core_Model_Translate_Inline protected function _tagAttributes() { if ($this->getIsJson()) { - $quotePatern = '\\\\"'; $quoteHtml = '\"'; - $tagEndRegexp = '(\\\\/)?' . '>$'; } else { - $quotePatern = '"'; $quoteHtml = '"'; - $tagEndRegexp = '/?>$'; } $tagMatch = array(); $nextTag = 0; - $tagRegExp = '#<([a-z]+)\s*?[^>]+?((' . $this->_tokenRegex . ')[^/>]*?)+(/?(>))#i'; + $tagRegExp = '#<([a-z]+)\s*?[^>]+?((' . $this->_tokenRegex . ')[^>]*?)+/?>#i'; while (preg_match($tagRegExp, $this->_content, $tagMatch, PREG_OFFSET_CAPTURE, $nextTag)) { $next = 0; $tagHtml = $tagMatch[0][0]; - $trArr = array(); $m = array(); $attrRegExp = '#' . $this->_tokenRegex . '#'; - - while (preg_match($attrRegExp, $tagHtml, $m, PREG_OFFSET_CAPTURE, $next)) { - $trArr[] = '{shown:\''.$this->_escape($m[1][0]) . '\',' - . 'translated:\''.$this->_escape($m[2][0]) . '\',' - . 'original:\''.$this->_escape($m[3][0]) . '\',' - . 'location:\'Tag attribute (ALT, TITLE, etc.)\',' - . 'scope:\''.$this->_escape($m[4][0]) . '\'}'; - $tagHtml = substr_replace($tagHtml, $m[1][0], $m[0][1], strlen($m[0][0])); - $next = $m[0][1]; - } - - $transRegExp = '# translate='.$quotePatern.'\[(.+?)\]'.$quotePatern.'#i'; - if (preg_match($transRegExp, $tagHtml, $m, PREG_OFFSET_CAPTURE)) { - foreach ($trArr as $i => $tr) { - if (strpos($m[1][0], $tr) !== false) { - unset($trArr[$i]); - } + $trArr = $this->_getTranslateData($attrRegExp, $tagHtml, array($this, '_getAttributeLocation')); + if ($trArr) { + $transRegExp = '# translate=' . $quoteHtml . '\[([^'.preg_quote($quoteHtml).']*)]' . $quoteHtml . '#i'; + if (preg_match($transRegExp, $tagHtml, $m)) { + $tagHtml = str_replace($m[0], '', $tagHtml); //remove tra + $trAttr = ' translate=' . $quoteHtml + . htmlspecialchars('[' . $m[1] . ',' . join(',', $trArr) . ']') . $quoteHtml; + } else { + $trAttr = ' translate=' . $quoteHtml + . htmlspecialchars('[' . join(',', $trArr) . ']') . $quoteHtml; } - array_unshift($trArr, $m[1][0]); - $tagHtml = substr_replace($tagHtml, '', $m[0][1], strlen($m[0][0])); + $this->_content = substr_replace($this->_content, $tagHtml, $tagMatch[0][1], strlen($tagMatch[0][0])); } - $trAttr = ' translate=' . $quoteHtml . '[' . join(',', $trArr) . ']' . $quoteHtml; - $tagHtml = preg_replace('#' . $tagEndRegexp . '#', $trAttr . '$0', $tagHtml); + $nextTag = $tagMatch[0][1] + strlen($tagHtml); + } + } - $this->_content = substr_replace($this->_content, $tagHtml, $tagMatch[0][1], - $tagMatch[9][1]+1-$tagMatch[0][1]); - $nextTag = $tagMatch[0][1]; + /** + * Get html quote symbol + * + * @return string + */ + protected function _getHtmlQuote() + { + if ($this->getIsJson()) { + return '\"'; + } else { + return '"'; } } /** * Prepare special tags + */ + protected function _specialTags() { + $this->_translateTags($this->_content, $this->_allowedTagsGlobal, '_applySpecialTagsFormat', false); + $this->_translateTags($this->_content, $this->_allowedTagsSimple, '_applySimpleTagsFormat', true); + } + + /** + * Format translate for special tags + * + * @param string $tagHtml + * @param string $tagName + * @param array $trArr + * @return string + */ + protected function _applySpecialTagsFormat($tagHtml, $tagName, $trArr) + { + return $tagHtml . '<span class="translate-inline-' . $tagName + . '" translate=' + . $this->_getHtmlQuote() + . htmlspecialchars('[' . join(',', $trArr) . ']') + . $this->_getHtmlQuote() . '>' + . strtoupper($tagName) . '</span>'; + } + + /** + * Format translate for simple tags * + * @param string $tagHtml + * @param string $tagName + * @param array $trArr + * @return string */ - protected function _specialTags() + protected function _applySimpleTagsFormat($tagHtml, $tagName, $trArr) + { + return substr($tagHtml, 0, strlen($tagName) + 1) + . ' translate=' + . $this->_getHtmlQuote() . htmlspecialchars( '[' . join(',', $trArr) . ']') + . $this->_getHtmlQuote() + . substr($tagHtml, strlen($tagName) + 1); + } + + /** + * Prepare simple tags + * + * @param string $body + * @param array $tagsList + * @param string|array $formatCallback + * @param bool $isNeedTranslateAttributes + */ + protected function _translateTags(&$body, $tagsList, $formatCallback, $isNeedTranslateAttributes) { if ($this->getIsJson()) { - $quotePatern = '\\\\"'; $quoteHtml = '\"'; } else { - $quotePatern = '"'; $quoteHtml = '"'; } $nextTag = 0; - $location = array_merge($this->_allowedTagsGlobal, $this->_allowedTagsSimple); - $tags = implode('|', array_merge(array_keys($this->_allowedTagsGlobal), - array_keys($this->_allowedTagsSimple))); - $tagRegExp = '#<(' . $tags . ')(\s+[^>]*|)(>)#i'; + $tags = implode('|', array_keys($tagsList)); + $tagRegExp = '#<(' . $tags . ')(\s*[^>]*>)#i'; $tagMatch = array(); - while (preg_match($tagRegExp, $this->_content, $tagMatch, PREG_OFFSET_CAPTURE, $nextTag)) { - $tagClosure = '</'.$tagMatch[1][0].'>'; - $tagClosurePos = stripos($this->_content, $tagClosure, $tagMatch[0][1]); + while (preg_match($tagRegExp, $body, $tagMatch, PREG_OFFSET_CAPTURE, $nextTag)) { + $tagName = strtolower($tagMatch[1][0]); + $tagClosurePos = $this->findEndOfTag($body, $tagName, $tagMatch[0][1]); if ($tagClosurePos === false) { - $tagClosure = '<\/'.$tagMatch[1][0].'>'; - $tagClosurePos = stripos($this->_content, $tagClosure, $tagMatch[0][1]); + $nextTag += strlen($tagMatch[0][0]); + continue; } - $tagLength = $tagClosurePos-$tagMatch[0][1]+strlen($tagClosure); - $next = 0; - $tagHtml = substr($this->_content, $tagMatch[0][1], $tagLength); - $trArr = array(); - $m = array(); - while (preg_match('#'.$this->_tokenRegex.'#i', $tagHtml, $m, PREG_OFFSET_CAPTURE, $next)) { - $trArr[] = '{shown:\''.$this->_escape($m[1][0]).'\',' - .'translated:\''.$this->_escape($m[2][0]).'\',' - .'original:\''.$this->_escape($m[3][0]).'\',' - .'location:\''.$location[strtolower($tagMatch[1][0])].'\',' - .'scope:\''.$this->_escape($m[4][0]).'\'}'; - - $tagHtml = substr_replace($tagHtml, $m[1][0], $m[0][1], strlen($m[0][0])); - $next = $m[0][1]; + $tagLength = $tagClosurePos - $tagMatch[0][1]; + + $tagStartLength = strlen($tagMatch[0][0]); + + $tagHtml = $tagMatch[0][0] ; + $tagEnd = substr($body, $tagMatch[0][1] + $tagStartLength, $tagLength - $tagStartLength); + + if ($isNeedTranslateAttributes + && preg_match_all('#' . $this->_tokenRegex . '#', $tagEnd, $m) + && count($m[0]) > $this->_maxTranslateBlocks + ) { + $this->_translateTags($tagEnd, $tagsList, $formatCallback, $isNeedTranslateAttributes); + } + + if ($isNeedTranslateAttributes) { + $this->_tagAttributes($tagEnd); } + $tagHtml .= $tagEnd; + + $trArr = $this->_getTranslateData( + '#' . $this->_tokenRegex . '#i', + $tagHtml, + array($this, '_getTagLocation'), + array( + 'tagName' => $tagName, + 'tagList' => $tagsList + ) + ); + if (!empty($trArr)) { $trArr = array_unique($trArr); - $tag = strtolower($tagMatch[1][0]); + $tagHtml = call_user_func(array($this, $formatCallback), $tagHtml, $tagName, $trArr); - if (in_array($tag, array_keys($this->_allowedTagsGlobal))) { - $tagHtml .= '<span class="translate-inline-'.$tag - .'" translate='.$quoteHtml.'['.join(',', $trArr).']'.$quoteHtml.'>'.strtoupper($tag).'</span>'; - } - $this->_content = substr_replace($this->_content, $tagHtml, $tagMatch[0][1], $tagLength); - - if (in_array($tag, array_keys($this->_allowedTagsSimple))) { - if (preg_match('# translate='.$quotePatern.'\[(.+?)\]'.$quotePatern.'#i', - $tagMatch[0][0], $m, PREG_OFFSET_CAPTURE) - ) { - foreach ($trArr as $i=>$tr) { - if (strpos($m[1][0], $tr)!==false) { - unset($trArr[$i]); - } - } - array_unshift($trArr, $m[1][0]); - $start = $tagMatch[0][1]+$m[0][1]; - $len = strlen($m[0][0]); - } else { - $start = $tagMatch[2][1]; - $len = 0; - } - - $this->_content = substr_replace($this->_content, - ' translate='.$quoteHtml.'['.join(',', $trArr).']'.$quoteHtml, $start, $len); - } + $body = substr_replace($body, $tagHtml, $tagMatch[0][1], $tagLength); } - - $nextTag = $tagMatch[0][1]+10; + $nextTag = $tagClosurePos; } + } + /** + * Find end of tag + * + * @param $body + * @param $tagName + * @param $from + * @return bool|int return false if end of tag is not found + */ + private function findEndOfTag($body, $tagName, $from) + { + $openTag = '<' . $tagName; + $closeTag = '</' . $tagName; + $end = $from + strlen($openTag); + $length = $end - $from; + while (substr_count($body, $openTag, $from, $length) != substr_count($body, $closeTag, $from, $length)) { + $end = strpos($body, $closeTag, $end + strlen($closeTag) - 1); + if ($end === false) { + return false; + } + $length = $end - $from + strlen($closeTag); + } + if (preg_match('#<\/' . $tagName .'\s*?>#i', $body, $tagMatch, null, $end)) { + return $end + strlen($tagMatch[0]); + } else { + return false; + } } /** * Prepare other text inline translates - * */ protected function _otherText() { @@ -456,22 +555,19 @@ class Mage_Core_Model_Translate_Inline $next = 0; $m = array(); - while (preg_match('#(>|title=\")*('.$this->_tokenRegex.')#', $this->_content, $m, PREG_OFFSET_CAPTURE, $next)) { - if(-1 == $m[1][1])//title was not found - this is not an attribute - { - $tr = '{shown:\''.$this->_escape($m[3][0]).'\',' - .'translated:\''.$this->_escape($m[4][0]).'\',' - .'original:\''.$this->_escape($m[5][0]).'\',' - .'location:\'Text\',' - .'scope:\''.$this->_escape($m[6][0]).'\'}'; - $spanHtml = '<span translate='.$quoteHtml.'['.$tr.']'.$quoteHtml.'>'.$m[3][0].'</span>'; - } - else - { - $spanHtml = $m[3][0]; - } - $this->_content = substr_replace($this->_content, $spanHtml, $m[2][1], strlen($m[2][0]) ); - $next = $m[0][1]; + while (preg_match('#' . $this->_tokenRegex . '#', $this->_content, $m, PREG_OFFSET_CAPTURE, $next)) { + $tr = json_encode(array( + 'shown' => $m[1][0], + 'translated' => $m[2][0], + 'original' => $m[3][0], + 'location' => 'Text', + 'scope' => $m[4][0], + )); + + $spanHtml = '<span translate=' . $quoteHtml . htmlspecialchars('[' . $tr . ']') . $quoteHtml + . '>' . $m[1][0] . '</span>'; + $this->_content = substr_replace($this->_content, $spanHtml, $m[0][1], strlen($m[0][0])); + $next = $m[0][1] + strlen($spanHtml) - 1; } } @@ -498,4 +594,3 @@ class Mage_Core_Model_Translate_Inline return $this; } } - diff --git a/app/code/core/Mage/Core/Model/Translate/String.php b/app/code/core/Mage/Core/Model/Translate/String.php index 9dcdfdea7228ad79e8444696a84bd39018e68123..31087b657fd5fa2982a3282d203f44a2d2c04dd6 100644 --- a/app/code/core/Mage/Core/Model/Translate/String.php +++ b/app/code/core/Mage/Core/Model/Translate/String.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Url.php b/app/code/core/Mage/Core/Model/Url.php index 792c38c327bc1a3a1bee3ff44f5bbbc588fd01b0..ea8f81f6310e12aa1cf6111230240c5a83e654ae 100644 --- a/app/code/core/Mage/Core/Model/Url.php +++ b/app/code/core/Mage/Core/Model/Url.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Url/Rewrite.php b/app/code/core/Mage/Core/Model/Url/Rewrite.php index e162909a8925ae9bdb532a3b77c095d1e77fcae1..54f2c08e0c1673a6a7b05e87b7a0bdb159bd6443 100644 --- a/app/code/core/Mage/Core/Model/Url/Rewrite.php +++ b/app/code/core/Mage/Core/Model/Url/Rewrite.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Variable.php b/app/code/core/Mage/Core/Model/Variable.php index 9e5ec842c44506003afdaa3136881094810fa240..90a96116b84bb0cbd50d1fb198ac93eeefafecc5 100644 --- a/app/code/core/Mage/Core/Model/Variable.php +++ b/app/code/core/Mage/Core/Model/Variable.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Variable/Config.php b/app/code/core/Mage/Core/Model/Variable/Config.php index fe3423764c9f89baea5dad501c348429905497cd..3bbb732ab951df70544a91e028c64d4ab31da1c2 100644 --- a/app/code/core/Mage/Core/Model/Variable/Config.php +++ b/app/code/core/Mage/Core/Model/Variable/Config.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Variable/Observer.php b/app/code/core/Mage/Core/Model/Variable/Observer.php index a5152d46d5d1fcc8526625f9c7f09630a32650d6..a9143cefe12e21b4404d10b0a16bf8931e9dff4c 100644 --- a/app/code/core/Mage/Core/Model/Variable/Observer.php +++ b/app/code/core/Mage/Core/Model/Variable/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/Model/Website.php b/app/code/core/Mage/Core/Model/Website.php index 4800d212a6f68950fd0d994514124764e3d44650..18678a829a330242cd54ab9971baf33468510e33 100644 --- a/app/code/core/Mage/Core/Model/Website.php +++ b/app/code/core/Mage/Core/Model/Website.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/controllers/AjaxController.php b/app/code/core/Mage/Core/controllers/AjaxController.php index 8136add001a12b6dd3e53228dc3c18fbffce860a..2ec414fedbe92c11d44ec0700574a1c344e3a9c7 100644 --- a/app/code/core/Mage/Core/controllers/AjaxController.php +++ b/app/code/core/Mage/Core/controllers/AjaxController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/controllers/IndexController.php b/app/code/core/Mage/Core/controllers/IndexController.php index 13f2111037447f73eb0ce176620ca82c1eaf3442..ae0a7de8abe409947f9a764ef8d013a9007c74b2 100644 --- a/app/code/core/Mage/Core/controllers/IndexController.php +++ b/app/code/core/Mage/Core/controllers/IndexController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/etc/api.xml b/app/code/core/Mage/Core/etc/api.xml index 03b9c7c12798b6905e05035886e972bc3fc0566b..072430dae9f41282227ed0cd9bcbbb94c1b98c85 100644 --- a/app/code/core/Mage/Core/etc/api.xml +++ b/app/code/core/Mage/Core/etc/api.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Core/etc/config.xml b/app/code/core/Mage/Core/etc/config.xml index 599c37a8e830b290d1a0ca07bd614f1075705bf4..113756251afa5e15698ee085eebaed3e75b2c3b2 100644 --- a/app/code/core/Mage/Core/etc/config.xml +++ b/app/code/core/Mage/Core/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> @@ -297,6 +297,9 @@ </security> </admin> <general> + <country> + <eu_countries>AT,BE,BG,CY,CZ,DK,EE,FI,FR,DE,GR,HU,IE,IT,LV,LT,LU,MT,NL,PL,PT,RO,SK,SI,ES,SE,GB</eu_countries> + </country> <locale> <firstday>0</firstday> <weekend>0,6</weekend> diff --git a/app/code/core/Mage/Core/etc/system.xml b/app/code/core/Mage/Core/etc/system.xml index 23708253bbf966829df5b5bb81f97d70d3b72e55..3cfe32059a6cb5bb7844619db830794565a9b770 100644 --- a/app/code/core/Mage/Core/etc/system.xml +++ b/app/code/core/Mage/Core/etc/system.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> @@ -571,6 +571,15 @@ <show_in_website>1</show_in_website> <show_in_store>1</show_in_store> </default> + <eu_countries translate="label"> + <label>European Union Countries</label> + <frontend_type>multiselect</frontend_type> + <source_model>Mage_Adminhtml_Model_System_Config_Source_Country</source_model> + <sort_order>30</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>0</show_in_website> + <show_in_store>0</show_in_store> + </eu_countries> </fields> </country> <locale translate="label"> @@ -645,6 +654,25 @@ <show_in_website>1</show_in_website> <show_in_store>1</show_in_store> </phone> + <merchant_country translate="label"> + <label>Country</label> + <frontend_type>select</frontend_type> + <source_model>Mage_Adminhtml_Model_System_Config_Source_Country</source_model> + <sort_order>25</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>1</show_in_store> + <can_be_empty>1</can_be_empty> + </merchant_country> + <merchant_vat_number translate="label"> + <label>VAT Number</label> + <frontend_type>text</frontend_type> + <sort_order>27</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>1</show_in_store> + <can_be_empty>1</can_be_empty> + </merchant_vat_number> <address translate="label"> <label>Store Contact Address</label> <frontend_type>textarea</frontend_type> diff --git a/app/code/core/Mage/Core/etc/translater.xml b/app/code/core/Mage/Core/etc/translater.xml new file mode 100644 index 0000000000000000000000000000000000000000..237bd08c4c2b2f42e24b4686b26a5cba106aea3f --- /dev/null +++ b/app/code/core/Mage/Core/etc/translater.xml @@ -0,0 +1,205 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * 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_AFL.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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Core + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<translater> + <!-- validation.js --> + <validate-no-html-tags translate="message" module="Mage_Core"> + <message>HTML tags are not allowed</message> + </validate-no-html-tags> + <validate-select translate="message" module="Mage_Core"> + <message>Please select an option.</message> + </validate-select> + <required-entry translate="message" module="Mage_Core"> + <message>This is a required field.</message> + </required-entry> + <validate-number translate="message" module="Mage_Core"> + <message>Please enter a valid number in this field.</message> + </validate-number> + <validate-number-range translate="message" module="Mage_Core"> + <message>The value is not within the specified range.</message> + </validate-number-range> + <validate-digits translate="message" module="Mage_Core"> + <message>Please use numbers only in this field. Please avoid spaces or other characters such as dots or commas.</message> + </validate-digits> + <validate-digits-range translate="message" module="Mage_Core"> + <message>The value is not within the specified range.</message> + </validate-digits-range> + <validate-alpha translate="message" module="Mage_Core"> + <message>Please use letters only (a-z or A-Z) in this field.</message> + </validate-alpha> + <validate-code translate="message" module="Mage_Core"> + <message>Please use only letters (a-z), numbers (0-9) or underscore(_) in this field, first character should be a letter.</message> + </validate-code> + <validate-alphanum translate="message" module="Mage_Core"> + <message>Please use only letters (a-z or A-Z) or numbers (0-9) only in this field. No spaces or other characters are allowed.</message> + </validate-alphanum> + <validate-street translate="message" module="Mage_Core"> + <message>Please use only letters (a-z or A-Z) or numbers (0-9) or spaces and # only in this field.</message> + </validate-street> + <validate-phone-strict translate="message" module="Mage_Core"> + <message>Please enter a valid phone number. For example (123) 456-7890 or 123-456-7890.</message> + </validate-phone-strict> + <validate-phone-lax translate="message" module="Mage_Core"> + <message>Please enter a valid phone number. For example (123) 456-7890 or 123-456-7890.</message> + </validate-phone-lax> + <validate-fax translate="message" module="Mage_Core"> + <message>Please enter a valid fax number. For example (123) 456-7890 or 123-456-7890.</message> + </validate-fax> + <validate-date translate="message" module="Mage_Core"> + <message>Please enter a valid date.</message> + </validate-date> + <validate-email translate="message" module="Mage_Core"> + <message>Please enter a valid email address. For example johndoe@domain.com.</message> + </validate-email> + <validate-email-sender translate="message" module="Mage_Core"> + <message>Please use only visible characters and spaces.</message> + </validate-email-sender> + <validate-password translate="message" module="Mage_Core"> + <message>Please enter 6 or more characters. Leading or trailing spaces will be ignored.</message> + </validate-password> + <validate-admin-password translate="message" module="Mage_Core"> + <message>Please enter 7 or more characters. Password should contain both numeric and alphabetic characters.</message> + </validate-admin-password> + <validate-cpassword translate="message" module="Mage_Core"> + <message>Please make sure your passwords match.</message> + </validate-cpassword> + <validate-url translate="message" module="Mage_Core"> + <message>Please enter a valid URL. Protocol is required (http://, https:// or ftp://)</message> + </validate-url> + <validate-clean-url translate="message" module="Mage_Core"> + <message>Please enter a valid URL. For example http://www.example.com or www.example.com</message> + </validate-clean-url> + <validate-identifier translate="message" module="Mage_Core"> + <message>Please enter a valid URL Key. For example "example-page", "example-page.html" or "anotherlevel/example-page".</message> + </validate-identifier> + <validate-xml-identifier translate="message" module="Mage_Core"> + <message>Please enter a valid XML-identifier. For example something_1, block5, id-4.</message> + </validate-xml-identifier> + <validate-ssn translate="message" module="Mage_Core"> + <message>Please enter a valid social security number. For example 123-45-6789.</message> + </validate-ssn> + <validate-zip translate="message" module="Mage_Core"> + <message>Please enter a valid zip code. For example 90602 or 90602-1234.</message> + </validate-zip> + <validate-zip-international translate="message" module="Mage_Core"> + <message>Please enter a valid zip code.</message> + </validate-zip-international> + <validate-date-au translate="message" module="Mage_Core"> + <message>Please use this date format: dd/mm/yyyy. For example 17/03/2006 for the 17th of March, 2006.</message> + </validate-date-au> + <validate-currency-dollar translate="message" module="Mage_Core"> + <message>Please enter a valid $ amount. For example $100.00.</message> + </validate-currency-dollar> + <validate-one-required translate="message" module="Mage_Core"> + <message>Please select one of the above options.</message> + </validate-one-required> + <validate-one-required-by-name translate="message" module="Mage_Core"> + <message>Please select one of the options.</message> + </validate-one-required-by-name> + <validate-not-negative-number translate="message" module="Mage_Core"> + <message>Please enter a valid number in this field.</message> + </validate-not-negative-number> + <validate-state translate="message" module="Mage_Core"> + <message>Please select State/Province.</message> + </validate-state> + <validate-new-password translate="message" module="Mage_Core"> + <message>Please enter 6 or more characters. Leading or trailing spaces will be ignored.</message> + </validate-new-password> + <validate-greater-than-zero translate="message" module="Mage_Core"> + <message>Please enter a number greater than 0 in this field.</message> + </validate-greater-than-zero> + <validate-zero-or-greater translate="message" module="Mage_Core"> + <message>Please enter a number 0 or greater in this field.</message> + </validate-zero-or-greater> + <validate-cc-number translate="message" module="Mage_Core"> + <message>Please enter a valid credit card number.</message> + </validate-cc-number> + <validate-cc-type translate="message" module="Mage_Core"> + <message>Credit card number does not match credit card type.</message> + </validate-cc-type> + <validate-cc-type-select translate="message" module="Mage_Core"> + <message>Card type does not match credit card number.</message> + </validate-cc-type-select> + <validate-cc-exp translate="message" module="Mage_Core"> + <message>Incorrect credit card expiration date.</message> + </validate-cc-exp> + <validate-cc-cvn translate="message" module="Mage_Core"> + <message>Please enter a valid credit card verification number.</message> + </validate-cc-cvn> + <validate-data translate="message" module="Mage_Core"> + <message>Please use only letters (a-z or A-Z), numbers (0-9) or underscore(_) in this field, first character should be a letter.</message> + </validate-data> + <validate-css-length translate="message" module="Mage_Core"> + <message>Please input a valid CSS-length. For example 100px or 77pt or 20em or .5ex or 50%.</message> + </validate-css-length> + <validate-length translate="message" module="Mage_Core"> + <message>Text length does not satisfy specified text range.</message> + </validate-length> + <validate-percents translate="message" module="Mage_Core"> + <message>Please enter a number lower than 100.</message> + </validate-percents> + <required-file translate="message" module="Mage_Core"> + <message>Please select a file</message> + </required-file> + <validate-cc-ukss translate="message" module="Mage_Core"> + <message>Please enter issue number or start date for switch/solo card type.</message> + </validate-cc-ukss> + <!-- end validation.js --> + + <!-- rules.js --> + <loading translate="message" module="Mage_Core"> + <message>Please wait, loading...</message> + </loading> + <!-- end rules.js --> + + <!-- js.js --> + <validate-date-required translate="message" module="Mage_Core"> + <message>This date is a required value.</message> + </validate-date-required> + <validate-date-day translate="message" module="Mage_Core"> + <message>Please enter a valid day (1-%d).</message> + </validate-date-day> + <validate-date-month translate="message" module="Mage_Core"> + <message>Please enter a valid month (1-12).</message> + </validate-date-month> + <validate-date-year translate="message" module="Mage_Core"> + <message>Please enter a valid year (1900-%d).</message> + </validate-date-year> + <validate-date-full-date translate="message" module="Mage_Core"> + <message>Please enter a valid full date</message> + </validate-date-full-date> + <validate-date-date-between translate="message" module="Mage_Core"> + <message>Please enter a valid date between %s and %s</message> + </validate-date-date-between> + <validate-date-greater translate="message" module="Mage_Core"> + <message>Please enter a valid date equal to or greater than %s</message> + </validate-date-greater> + <validate-date-less translate="message" module="Mage_Core"> + <message>Please enter a valid date less than or equal to %s</message> + </validate-date-less> + <!-- end js.js --> +</translater> diff --git a/app/code/core/Mage/Core/functions.php b/app/code/core/Mage/Core/functions.php index b33d1c2b8ecc8521f958b4cedc3e99e401d26096..5b9d33b27e268d8cf2149c7c98089417c5e7a193 100644 --- a/app/code/core/Mage/Core/functions.php +++ b/app/code/core/Mage/Core/functions.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/sql/core_setup/install-1.6.0.0.php b/app/code/core/Mage/Core/sql/core_setup/install-1.6.0.0.php index c0468d2db8a7c55fddf0f0fa497ef6a86f86ff39..d4d64150f22549091f7e2adae47d7dde7da243d6 100644 --- a/app/code/core/Mage/Core/sql/core_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/Core/sql/core_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/sql/core_setup/upgrade-1.6.0.1-1.6.0.2.php b/app/code/core/Mage/Core/sql/core_setup/upgrade-1.6.0.1-1.6.0.2.php index e2df43f0bf83d4db7d674182c9fe242e85f88b35..cfcb1d92839b6c57a27295fe907f6fb378f7497e 100644 --- a/app/code/core/Mage/Core/sql/core_setup/upgrade-1.6.0.1-1.6.0.2.php +++ b/app/code/core/Mage/Core/sql/core_setup/upgrade-1.6.0.1-1.6.0.2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Core/view/frontend/formkey.phtml b/app/code/core/Mage/Core/view/frontend/formkey.phtml index cf6fc11693fd21adda10df8339d2e07af2791e85..446ccce0bdbd8b30bb496ee75499ef30fa2474b5 100644 --- a/app/code/core/Mage/Core/view/frontend/formkey.phtml +++ b/app/code/core/Mage/Core/view/frontend/formkey.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Core/view/frontend/layout.xml b/app/code/core/Mage/Core/view/frontend/layout.xml index 9933f095c6850983ea921c9cb14abe28e648482e..f34c4a6e50715bc524a781a493d86b363386db80 100644 --- a/app/code/core/Mage/Core/view/frontend/layout.xml +++ b/app/code/core/Mage/Core/view/frontend/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/Core/view/frontend/link.phtml b/app/code/core/Mage/Core/view/frontend/link.phtml index 0df23c3f6f751d9fa776e24fe55063911e29d134..4ca552b74e01608eb7799891d4929ded7f9aa488 100644 --- a/app/code/core/Mage/Core/view/frontend/link.phtml +++ b/app/code/core/Mage/Core/view/frontend/link.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Core/view/frontend/messages.phtml b/app/code/core/Mage/Core/view/frontend/messages.phtml index c89ebe2197d016d9391889a81f3a841a3cbe0add..06b2384f068e85bc30eb553842a9ef75cf16fa45 100644 --- a/app/code/core/Mage/Core/view/frontend/messages.phtml +++ b/app/code/core/Mage/Core/view/frontend/messages.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Cron/Exception.php b/app/code/core/Mage/Cron/Exception.php index 4e4ed73371393f0b2b6148fefbb9595657e8cd1c..15d27f92f9f90d466ade083e9aacb799a69003fc 100644 --- a/app/code/core/Mage/Cron/Exception.php +++ b/app/code/core/Mage/Cron/Exception.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Cron - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Cron/Helper/Data.php b/app/code/core/Mage/Cron/Helper/Data.php index d5649c2de6d418f5049cce1645bcd4a9135d3b95..e4a690370afdc57e390e5aea4af0562184a80cb5 100644 --- a/app/code/core/Mage/Cron/Helper/Data.php +++ b/app/code/core/Mage/Cron/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Cron - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Cron/Model/Observer.php b/app/code/core/Mage/Cron/Model/Observer.php index ee7fec05c24c721de47cc3977ee6fbe5fa7baab7..785214ca0a0fee25ab8a52ea68759cf6cbafcb01 100644 --- a/app/code/core/Mage/Cron/Model/Observer.php +++ b/app/code/core/Mage/Cron/Model/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Cron - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Cron/Model/Resource/Schedule.php b/app/code/core/Mage/Cron/Model/Resource/Schedule.php index 59c9e47476db35cf5fccf0489a40027007e5e6d4..95cbaa735735176ecf748ad93a53b603ceb8bd51 100755 --- a/app/code/core/Mage/Cron/Model/Resource/Schedule.php +++ b/app/code/core/Mage/Cron/Model/Resource/Schedule.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Cron - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Cron/Model/Resource/Schedule/Collection.php b/app/code/core/Mage/Cron/Model/Resource/Schedule/Collection.php index edb81e865057745434c4442b6b13fa229d26a48f..7ecaea0841cc5d91482e358c3a49ca105dc359ea 100755 --- a/app/code/core/Mage/Cron/Model/Resource/Schedule/Collection.php +++ b/app/code/core/Mage/Cron/Model/Resource/Schedule/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Cron - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Cron/Model/Schedule.php b/app/code/core/Mage/Cron/Model/Schedule.php index 66adc629f0446c4fd6319e964ca7863e960816ed..def18b506496c1f749946f3f3a535e8ea65addc6 100644 --- a/app/code/core/Mage/Cron/Model/Schedule.php +++ b/app/code/core/Mage/Cron/Model/Schedule.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Cron - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Cron/etc/config.xml b/app/code/core/Mage/Cron/etc/config.xml index 8c5302f7f5dfe40ab661ad875bc461b2b05eab93..640e816d295ba0d1300922e2bf4b862ae27f2b53 100644 --- a/app/code/core/Mage/Cron/etc/config.xml +++ b/app/code/core/Mage/Cron/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Cron - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Cron/etc/system.xml b/app/code/core/Mage/Cron/etc/system.xml index 2d55f25be0482f1751172128eabe1ad293c06751..217cb8ddaabf374e439ba2e7539dfafb00602dbb 100644 --- a/app/code/core/Mage/Cron/etc/system.xml +++ b/app/code/core/Mage/Cron/etc/system.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Cron - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Cron/sql/cron_setup/install-1.6.0.0.php b/app/code/core/Mage/Cron/sql/cron_setup/install-1.6.0.0.php index 2548a567c122908ddf9d8642a62519ecfd774444..8f4bfab21ad1220973626d073620e1fb1a2575ba 100644 --- a/app/code/core/Mage/Cron/sql/cron_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/Cron/sql/cron_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Cron - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Block/Account/Dashboard.php b/app/code/core/Mage/Customer/Block/Account/Dashboard.php index 3d5863a32d6dce529ad6750b5dfa31d9be46a10b..8ddfa2624adff51f814654d37cfeabc42ceef939 100644 --- a/app/code/core/Mage/Customer/Block/Account/Dashboard.php +++ b/app/code/core/Mage/Customer/Block/Account/Dashboard.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Block/Account/Dashboard/Address.php b/app/code/core/Mage/Customer/Block/Account/Dashboard/Address.php index 90fd691b568b23f355fb860c0f5319b7a522eeb4..a2dd76bc2dd515b06414f0656120edaddab242d8 100644 --- a/app/code/core/Mage/Customer/Block/Account/Dashboard/Address.php +++ b/app/code/core/Mage/Customer/Block/Account/Dashboard/Address.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Block/Account/Dashboard/Block.php b/app/code/core/Mage/Customer/Block/Account/Dashboard/Block.php index f518a2ddb5e074df28ae081a4354ae24188aae9a..8095a53cd4af9b2a5c32dba8e82e28a1dc8e0bc3 100644 --- a/app/code/core/Mage/Customer/Block/Account/Dashboard/Block.php +++ b/app/code/core/Mage/Customer/Block/Account/Dashboard/Block.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Block/Account/Dashboard/Hello.php b/app/code/core/Mage/Customer/Block/Account/Dashboard/Hello.php index 1b51d61361fdb0efbf07256cfd5579ca7ab1a1a2..e4049124b16083306ecbbe92a54a3067cd646ba7 100644 --- a/app/code/core/Mage/Customer/Block/Account/Dashboard/Hello.php +++ b/app/code/core/Mage/Customer/Block/Account/Dashboard/Hello.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Block/Account/Dashboard/Info.php b/app/code/core/Mage/Customer/Block/Account/Dashboard/Info.php index 4388b998070cf8a136370b84887762e1e36bf88d..96e88273d617d6cf948bb3abd95d29dfdccd013b 100644 --- a/app/code/core/Mage/Customer/Block/Account/Dashboard/Info.php +++ b/app/code/core/Mage/Customer/Block/Account/Dashboard/Info.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Block/Account/Dashboard/Newsletter.php b/app/code/core/Mage/Customer/Block/Account/Dashboard/Newsletter.php index a8e3a71ef05f097312f93607b530274984412587..0dd4ddb4fd5061d2bbae193170987bdfffaecb55 100644 --- a/app/code/core/Mage/Customer/Block/Account/Dashboard/Newsletter.php +++ b/app/code/core/Mage/Customer/Block/Account/Dashboard/Newsletter.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Block/Account/Dashboard/Sidebar.php b/app/code/core/Mage/Customer/Block/Account/Dashboard/Sidebar.php index ef91ad66580badcdda6782b4ff7e151f8e2a2a00..29da83fdab050c2c72302b1e65d2978428c0f888 100644 --- a/app/code/core/Mage/Customer/Block/Account/Dashboard/Sidebar.php +++ b/app/code/core/Mage/Customer/Block/Account/Dashboard/Sidebar.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Block/Account/Forgotpassword.php b/app/code/core/Mage/Customer/Block/Account/Forgotpassword.php index d1e18c6d0d9433077ef3d220897cb28bd7f47567..f5544b6eefede0548ade1c4582c8b4778cb57343 100644 --- a/app/code/core/Mage/Customer/Block/Account/Forgotpassword.php +++ b/app/code/core/Mage/Customer/Block/Account/Forgotpassword.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Block/Account/Navigation.php b/app/code/core/Mage/Customer/Block/Account/Navigation.php index 14b514dc890e43efd517291988ef45b568838528..2a5e403a31ee37df9dca68501c616cbcd548f3ed 100644 --- a/app/code/core/Mage/Customer/Block/Account/Navigation.php +++ b/app/code/core/Mage/Customer/Block/Account/Navigation.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Block/Account/Resetpassword.php b/app/code/core/Mage/Customer/Block/Account/Resetpassword.php index fa36efb1b0e37b600fd3c99b1129b5fb3408162f..81624358ecd75a1182ab0db7b0bdbe9ba886417a 100644 --- a/app/code/core/Mage/Customer/Block/Account/Resetpassword.php +++ b/app/code/core/Mage/Customer/Block/Account/Resetpassword.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Block/Address/Book.php b/app/code/core/Mage/Customer/Block/Address/Book.php index a5413b9be1dbeba33229c4690c9b21a4b149c226..171ff8c0704039d75796437eaa57f47aa89d98b2 100644 --- a/app/code/core/Mage/Customer/Block/Address/Book.php +++ b/app/code/core/Mage/Customer/Block/Address/Book.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Block/Address/Edit.php b/app/code/core/Mage/Customer/Block/Address/Edit.php index 56a664a0191b88bd7a7f65bb828e8e87dc8ed80a..66df2191424a96b860f8f3b42fd2a93773151245 100644 --- a/app/code/core/Mage/Customer/Block/Address/Edit.php +++ b/app/code/core/Mage/Customer/Block/Address/Edit.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Block/Address/Renderer/Default.php b/app/code/core/Mage/Customer/Block/Address/Renderer/Default.php index 9ad4514613c76e16539cc9bc3853f1e992d79523..209b8247fd4120de51340cb1253b674e9b84421c 100644 --- a/app/code/core/Mage/Customer/Block/Address/Renderer/Default.php +++ b/app/code/core/Mage/Customer/Block/Address/Renderer/Default.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Block/Address/Renderer/Interface.php b/app/code/core/Mage/Customer/Block/Address/Renderer/Interface.php index 826c103970acb09c786c68b628af3f9475ffdc60..8306a7e6c31336fa2810af8588e28ac2b2255240 100644 --- a/app/code/core/Mage/Customer/Block/Address/Renderer/Interface.php +++ b/app/code/core/Mage/Customer/Block/Address/Renderer/Interface.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Block/Form/Edit.php b/app/code/core/Mage/Customer/Block/Form/Edit.php index f09e6ad0233e4a745f332ca6bacd828ab399d9f0..1bc26c3c8542af0a3f345ac2a1da4e761d7d7bf9 100644 --- a/app/code/core/Mage/Customer/Block/Form/Edit.php +++ b/app/code/core/Mage/Customer/Block/Form/Edit.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Block/Form/Login.php b/app/code/core/Mage/Customer/Block/Form/Login.php index 9edcacee0d855770ae21d0d8cff8fa1daeac24c9..cfa301714a3c171d4003200687fe6c978affdbf4 100644 --- a/app/code/core/Mage/Customer/Block/Form/Login.php +++ b/app/code/core/Mage/Customer/Block/Form/Login.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Block/Form/Register.php b/app/code/core/Mage/Customer/Block/Form/Register.php index f6a0c3388b416861ca48009a2b0690e874599b30..4f27b70621c13ab3e0be8a81df611daba5f961d1 100644 --- a/app/code/core/Mage/Customer/Block/Form/Register.php +++ b/app/code/core/Mage/Customer/Block/Form/Register.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Block/Newsletter.php b/app/code/core/Mage/Customer/Block/Newsletter.php index c2538434e3517248510b017d12ec5eaa2c45df19..1a5a994fe132bae409f5ccb7b1de829acdcb17cc 100644 --- a/app/code/core/Mage/Customer/Block/Newsletter.php +++ b/app/code/core/Mage/Customer/Block/Newsletter.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Block/Widget/Abstract.php b/app/code/core/Mage/Customer/Block/Widget/Abstract.php index 94f4fab2504aaf9203dba604b14a030d8a93679b..72ae707d345908cf4f4d24dda5ebeec8907aab85 100644 --- a/app/code/core/Mage/Customer/Block/Widget/Abstract.php +++ b/app/code/core/Mage/Customer/Block/Widget/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Block/Widget/Dob.php b/app/code/core/Mage/Customer/Block/Widget/Dob.php index be41977fd1a18d1bac7e9fde2b6c4e139c1c5831..b96d092e78a5b4d9661052b7fdc9b828c3fb16ab 100644 --- a/app/code/core/Mage/Customer/Block/Widget/Dob.php +++ b/app/code/core/Mage/Customer/Block/Widget/Dob.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Block/Widget/Gender.php b/app/code/core/Mage/Customer/Block/Widget/Gender.php index fd5597a9d34d893ca8ae40f3c433fdc2b0954d45..a593de6b61b55b90be9c5f48a015524920594ff3 100644 --- a/app/code/core/Mage/Customer/Block/Widget/Gender.php +++ b/app/code/core/Mage/Customer/Block/Widget/Gender.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Block/Widget/Name.php b/app/code/core/Mage/Customer/Block/Widget/Name.php index 0112b47cf7c327598634ab57f92095b9bc18e65f..74fb010cee2fe5175d3e1200df354f6a64ae6a31 100644 --- a/app/code/core/Mage/Customer/Block/Widget/Name.php +++ b/app/code/core/Mage/Customer/Block/Widget/Name.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -95,6 +95,16 @@ class Mage_Customer_Block_Widget_Name extends Mage_Customer_Block_Widget_Abstrac return (bool)$this->_getAttribute('middlename')->getIsVisible(); } + /** + * Define if middlename attribute is required + * + * @return bool + */ + public function isMiddlenameRequired() + { + return (bool)$this->_getAttribute('middlename')->getIsRequired(); + } + /** * Define if suffix attribute can be shown * diff --git a/app/code/core/Mage/Customer/Block/Widget/Taxvat.php b/app/code/core/Mage/Customer/Block/Widget/Taxvat.php index 2a0dde4b73987b488429dd95a57c90dfbc87b465..cd956b6a7cd5597162717e28fc348f4c69108a9a 100644 --- a/app/code/core/Mage/Customer/Block/Widget/Taxvat.php +++ b/app/code/core/Mage/Customer/Block/Widget/Taxvat.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Exception.php b/app/code/core/Mage/Customer/Exception.php index 60763500c25ce46d0e62b221e399e55e00a3b2cf..71c17eef4f392aefc66b19d88b7acf6dd72c4bbb 100644 --- a/app/code/core/Mage/Customer/Exception.php +++ b/app/code/core/Mage/Customer/Exception.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Helper/Address.php b/app/code/core/Mage/Customer/Helper/Address.php index bc98e583f1bfd15adce7695b834d1aaf270617ce..40be96a4c62e6c6c7490030a73a9dd755e87892d 100644 --- a/app/code/core/Mage/Customer/Helper/Address.php +++ b/app/code/core/Mage/Customer/Helper/Address.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -31,6 +31,14 @@ */ class Mage_Customer_Helper_Address extends Mage_Core_Helper_Abstract { + /** + * VAT Validation parameters XML paths + */ + const XML_PATH_VIV_DISABLE_AUTO_ASSIGN_DEFAULT = 'customer/create_account/viv_disable_auto_group_assign_default'; + const XML_PATH_VIV_ON_EACH_TRANSACTION = 'customer/create_account/viv_on_each_transaction'; + const XML_PATH_VAT_VALIDATION_ENABLED = 'customer/create_account/auto_group_assign'; + const XML_PATH_VIV_TAX_CALCULATION_ADDRESS_TYPE = 'customer/create_account/tax_calculation_address_type'; + /** * Array of Customer Address Attributes * @@ -200,4 +208,47 @@ class Mage_Customer_Helper_Address extends Mage_Core_Helper_Abstract return $lines; } + + /** + * Check whether VAT ID validation is enabled + * + * @param Mage_Core_Model_Store|string|int $store + * @return bool + */ + public function isVatValidationEnabled($store = null) + { + return (bool)Mage::getStoreConfig(self::XML_PATH_VAT_VALIDATION_ENABLED, $store); + } + + /** + * Retrieve disable auto group assign default value + * + * @return bool + */ + public function getDisableAutoGroupAssignDefaultValue() + { + return (bool)Mage::getStoreConfig(self::XML_PATH_VIV_DISABLE_AUTO_ASSIGN_DEFAULT); + } + + /** + * Retrieve 'validate on each transaction' value + * + * @param Mage_Core_Model_Store|string|int $store + * @return bool + */ + public function getValidateOnEachTransaction($store = null) + { + return (bool)Mage::getStoreConfig(self::XML_PATH_VIV_ON_EACH_TRANSACTION, $store); + } + + /** + * Retrieve customer address type on which tax calculation must be based + * + * @param Mage_Core_Model_Store|string|int|null $store + * @return string + */ + public function getTaxCalculationAddressType($store = null) + { + return (string)Mage::getStoreConfig(self::XML_PATH_VIV_TAX_CALCULATION_ADDRESS_TYPE, $store); + } } diff --git a/app/code/core/Mage/Customer/Helper/Data.php b/app/code/core/Mage/Customer/Helper/Data.php index 0f547117b2f700733342010a4c05148f2328d064..06a5e391e53f6763122779b17fa4c3a790522253 100644 --- a/app/code/core/Mage/Customer/Helper/Data.php +++ b/app/code/core/Mage/Customer/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -44,12 +44,44 @@ class Mage_Customer_Helper_Data extends Mage_Core_Helper_Abstract */ const XML_PATH_CUSTOMER_STARTUP_REDIRECT_TO_DASHBOARD = 'customer/startup/redirect_dashboard'; + /** + * Config pathes to VAT related customer groups + */ + const XML_PATH_CUSTOMER_VIV_INTRA_UNION_GROUP = 'customer/create_account/viv_intra_union_group'; + const XML_PATH_CUSTOMER_VIV_DOMESTIC_GROUP = 'customer/create_account/viv_domestic_group'; + const XML_PATH_CUSTOMER_VIV_INVALID_GROUP = 'customer/create_account/viv_invalid_group'; + const XML_PATH_CUSTOMER_VIV_ERROR_GROUP = 'customer/create_account/viv_error_group'; + + /** + * Config path to option that enables/disables automatic group assignment based on VAT + */ + const XML_PATH_CUSTOMER_VIV_GROUP_AUTO_ASSIGN = 'customer/create_account/viv_disable_auto_group_assign_default'; + + /** + * Config path to support email + */ + const XML_PATH_SUPPORT_EMAIL = 'trans_email/ident_support/email'; + + /** + * WSDL of VAT validation service + * + */ + const VAT_VALIDATION_WSDL_URL = 'http://ec.europa.eu/taxation_customs/vies/services/checkVatService?wsdl'; + /** * Configuration path to expiration period of reset password link */ const XML_PATH_CUSTOMER_RESET_PASSWORD_LINK_EXPIRATION_PERIOD = 'default/customer/password/reset_link_expiration_period'; + /** + * VAT class constants + */ + const VAT_CLASS_DOMESTIC = 'domestic'; + const VAT_CLASS_INTRA_UNION = 'intra_union'; + const VAT_CLASS_INVALID = 'invalid'; + const VAT_CLASS_ERROR = 'error'; + /** * Customer groups collection * @@ -346,4 +378,228 @@ class Mage_Customer_Helper_Data extends Mage_Core_Helper_Abstract { return (int) Mage::getConfig()->getNode(self::XML_PATH_CUSTOMER_RESET_PASSWORD_LINK_EXPIRATION_PERIOD); } + + /** + * Get default customer group id + * + * @param Mage_Core_Model_Store|string|int $store + * @return int + */ + public function getDefaultCustomerGroupId($store = null) + { + return (int)Mage::getStoreConfig(Mage_Customer_Model_Group::XML_PATH_DEFAULT_ID, $store); + } + + /** + * Retrieve customer group ID based on his VAT number + * + * @param string $customerCountryCode + * @param Varien_Object $vatValidationResult + * @param Mage_Core_Model_Store|string|int $store + * @return null|int + */ + public function getCustomerGroupIdBasedOnVatNumber($customerCountryCode, $vatValidationResult, $store = null) + { + $groupId = null; + + $vatClass = $this->getCustomerVatClass($customerCountryCode, $vatValidationResult, $store); + + $vatClassToGroupXmlPathMap = array( + self::VAT_CLASS_DOMESTIC => self::XML_PATH_CUSTOMER_VIV_DOMESTIC_GROUP, + self::VAT_CLASS_INTRA_UNION => self::XML_PATH_CUSTOMER_VIV_INTRA_UNION_GROUP, + self::VAT_CLASS_INVALID => self::XML_PATH_CUSTOMER_VIV_INVALID_GROUP, + self::VAT_CLASS_ERROR => self::XML_PATH_CUSTOMER_VIV_ERROR_GROUP + ); + + if (isset($vatClassToGroupXmlPathMap[$vatClass])) { + $groupId = (int)Mage::getStoreConfig($vatClassToGroupXmlPathMap[$vatClass], $store); + } + + return $groupId; + } + + /** + * Send request to VAT validation service and return validation result + * + * @param string $countryCode + * @param string $vatNumber + * @param string $requesterCountryCode + * @param string $requesterVatNumber + * + * @return Varien_Object + */ + public function checkVatNumber($countryCode, $vatNumber, $requesterCountryCode = '', $requesterVatNumber = '') + { + // Default response + $gatewayResponse = new Varien_Object(array( + 'is_valid' => false, + 'request_date' => '', + 'request_identifier' => '', + 'request_success' => false + )); + + if (!extension_loaded('soap')) { + Mage::logException(Mage::exception('Mage_Core', + Mage::helper('Mage_Core_Helper_Data')->__('PHP SOAP extension is required.'))); + return $gatewayResponse; + } + + if (!$this->canCheckVatNumber($countryCode, $vatNumber, $requesterCountryCode, $requesterVatNumber)) { + return $gatewayResponse; + } + + try { + $soapClient = $this->_createVatNumberValidationSoapClient(); + + $requestParams = array(); + $requestParams['countryCode'] = $countryCode; + $requestParams['vatNumber'] = $vatNumber; + $requestParams['requesterCountryCode'] = $requesterCountryCode; + $requestParams['requesterVatNumber'] = $requesterVatNumber; + + // Send request to service + $result = $soapClient->checkVatApprox($requestParams); + + $gatewayResponse->setIsValid((boolean) $result->valid); + $gatewayResponse->setRequestDate((string) $result->requestDate); + $gatewayResponse->setRequestIdentifier((string) $result->requestIdentifier); + $gatewayResponse->setRequestSuccess(true); + } catch (Exception $exception) { + $gatewayResponse->setIsValid(false); + $gatewayResponse->setRequestDate(''); + $gatewayResponse->setRequestIdentifier(''); + } + + return $gatewayResponse; + } + + /** + * Check if parameters are valid to send to VAT validation service + * + * @param string $countryCode + * @param string $vatNumber + * @param string $requesterCountryCode + * @param string $requesterVatNumber + * + * @return boolean + */ + public function canCheckVatNumber($countryCode, $vatNumber, $requesterCountryCode, $requesterVatNumber) + { + $result = true; + /** @var $coreHelper Mage_Core_Helper_Data */ + $coreHelper = Mage::helper('Mage_Core_Helper_Data'); + + if (!is_string($countryCode) + || !is_string($vatNumber) + || !is_string($requesterCountryCode) + || !is_string($requesterVatNumber) + || empty($countryCode) + || !$coreHelper->isCountryInEU($countryCode) + || empty($vatNumber) + || (empty($requesterCountryCode) && !empty($requesterVatNumber)) + || (!empty($requesterCountryCode) && empty($requesterVatNumber)) + || (!empty($requesterCountryCode) && !$coreHelper->isCountryInEU($requesterCountryCode)) + ) { + $result = false; + } + + return $result; + } + + /** + * Get VAT class + * + * @param string $customerCountryCode + * @param Varien_Object $vatValidationResult + * @param Mage_Core_Model_Store|string|int|null $store + * @return null|string + */ + public function getCustomerVatClass($customerCountryCode, $vatValidationResult, $store = null) + { + $vatClass = null; + + $isVatNumberValid = $vatValidationResult->getIsValid(); + + if (is_string($customerCountryCode) + && !empty($customerCountryCode) + && $customerCountryCode === Mage::helper('Mage_Core_Helper_Data')->getMerchantCountryCode($store) + && $isVatNumberValid + ) { + $vatClass = self::VAT_CLASS_DOMESTIC; + } elseif ($isVatNumberValid) { + $vatClass = self::VAT_CLASS_INTRA_UNION; + } else { + $vatClass = self::VAT_CLASS_INVALID; + } + + if (!$vatValidationResult->getRequestSuccess()) { + $vatClass = self::VAT_CLASS_ERROR; + } + + return $vatClass; + } + + /** + * Get validation message that will be displayed to user by VAT validation result object + * + * @param Mage_Customer_Model_Address $customerAddress + * @param bool $customerGroupAutoAssignDisabled + * @param Varien_Object $validationResult + * @return Varien_Object + */ + public function getVatValidationUserMessage($customerAddress, $customerGroupAutoAssignDisabled, $validationResult) + { + $message = ''; + $isError = true; + $customerVatClass = $this->getCustomerVatClass($customerAddress->getCountryId(), $validationResult); + $groupAutoAssignDisabled = Mage::getStoreConfigFlag(self::XML_PATH_CUSTOMER_VIV_GROUP_AUTO_ASSIGN); + + $willChargeTaxMessage = $this->__('You will be charged tax.'); + $willNotChargeTaxMessage = $this->__('You will not be charged tax.'); + + if ($validationResult->getIsValid()) { + $message = $this->__('Your VAT ID was successfully validated.'); + $isError = false; + + if (!$groupAutoAssignDisabled && !$customerGroupAutoAssignDisabled) { + $message .= ' ' . ($customerVatClass == self::VAT_CLASS_DOMESTIC + ? $willChargeTaxMessage + : $willNotChargeTaxMessage); + } + } else if ($validationResult->getRequestSuccess()) { + $message = sprintf( + $this->__('The VAT ID entered (%s) is not a valid VAT ID.') . ' ', + $this->escapeHtml($customerAddress->getVatId()) + ); + if (!$groupAutoAssignDisabled && !$customerGroupAutoAssignDisabled) { + $message .= $willChargeTaxMessage; + } + } + else { + $contactUsMessage = sprintf($this->__('If you believe this is an error, please contact us at %s'), + Mage::getStoreConfig(self::XML_PATH_SUPPORT_EMAIL)); + + $message = $this->__('Your Tax ID cannot be validated.') . ' ' + . (!$groupAutoAssignDisabled && !$customerGroupAutoAssignDisabled + ? $willChargeTaxMessage . ' ' : '') + . $contactUsMessage; + } + + $validationMessageEnvelope = new Varien_Object(); + $validationMessageEnvelope->setMessage($message); + $validationMessageEnvelope->setIsError($isError); + + return $validationMessageEnvelope; + } + + /** + * Create SOAP client based on VAT validation service WSDL + * + * @param boolean $trace + * @return SoapClient + */ + protected function _createVatNumberValidationSoapClient($trace = false) + { + return new SoapClient(self::VAT_VALIDATION_WSDL_URL, array('trace' => $trace)); + } } diff --git a/app/code/core/Mage/Customer/Model/Address.php b/app/code/core/Mage/Customer/Model/Address.php index a835f1e0dd5ef048e1caf3acb95227a6131d4ac3..3ae8acc40c5511ae92e291d78ce42417d85715a8 100644 --- a/app/code/core/Mage/Customer/Model/Address.php +++ b/app/code/core/Mage/Customer/Model/Address.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -150,7 +150,7 @@ class Mage_Customer_Model_Address extends Mage_Customer_Model_Address_Abstract } return $entityTypeId; } - + /** * Return Region ID * @@ -160,7 +160,7 @@ class Mage_Customer_Model_Address extends Mage_Customer_Model_Address_Abstract { return (int)$this->getData('region_id'); } - + /** * Set Region ID. $regionId is automatically converted to integer * diff --git a/app/code/core/Mage/Customer/Model/Address/Abstract.php b/app/code/core/Mage/Customer/Model/Address/Abstract.php index e5e9b2aa892803107b639f7f96244f67c97fa572..4f821bf64de46a7d4b8c14458bf017b32d04bc0c 100644 --- a/app/code/core/Mage/Customer/Model/Address/Abstract.php +++ b/app/code/core/Mage/Customer/Model/Address/Abstract.php @@ -20,19 +20,39 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ /** * Address abstract model * - * @author Magento Core Team <core@magentocommerce.com> + * @category Mage + * @package Mage_Customer + * @author Magento Core Team <core@magentocommerce.com> */ class Mage_Customer_Model_Address_Abstract extends Mage_Core_Model_Abstract { + /** + * Possible customer address types + */ + const TYPE_BILLING = 'billing'; + const TYPE_SHIPPING = 'shipping'; + + /** + * Prefix of model events + * + * @var string + */ protected $_eventPrefix = 'customer_address'; + + /** + * Name of event object + * + * @var string + */ protected $_eventObject = 'customer_address'; + /** * Directory country models * @@ -231,7 +251,10 @@ class Mage_Customer_Model_Address_Abstract extends Mage_Core_Model_Abstract $this->setData('region_id', $region); $this->unsRegion(); } else { - $regionModel = Mage::getModel('Mage_Directory_Model_Region')->loadByCode($this->getRegionCode(), $this->getCountryId()); + $regionModel = Mage::getModel('Mage_Directory_Model_Region')->loadByCode( + $this->getRegionCode(), + $this->getCountryId() + ); $this->setData('region_id', $regionModel->getId()); } } @@ -256,7 +279,9 @@ class Mage_Customer_Model_Address_Abstract extends Mage_Core_Model_Abstract public function getCountryModel() { if(!isset(self::$_countryModels[$this->getCountryId()])) { - self::$_countryModels[$this->getCountryId()] = Mage::getModel('Mage_Directory_Model_Country')->load($this->getCountryId()); + self::$_countryModels[$this->getCountryId()] = Mage::getModel('Mage_Directory_Model_Country')->load( + $this->getCountryId() + ); } return self::$_countryModels[$this->getCountryId()]; @@ -315,40 +340,41 @@ class Mage_Customer_Model_Address_Abstract extends Mage_Core_Model_Abstract public function validate() { $errors = array(); - $helper = Mage::helper('Mage_Customer_Helper_Data'); $this->implodeStreetAddress(); if (!Zend_Validate::is($this->getFirstname(), 'NotEmpty')) { - $errors[] = $helper->__('Please enter the first name.'); + $errors[] = Mage::helper('Mage_Customer_Helper_Data')->__('Please enter the first name.'); } if (!Zend_Validate::is($this->getLastname(), 'NotEmpty')) { - $errors[] = $helper->__('Please enter the last name.'); + $errors[] = Mage::helper('Mage_Customer_Helper_Data')->__('Please enter the last name.'); } if (!Zend_Validate::is($this->getStreet(1), 'NotEmpty')) { - $errors[] = $helper->__('Please enter the street.'); + $errors[] = Mage::helper('Mage_Customer_Helper_Data')->__('Please enter the street.'); } if (!Zend_Validate::is($this->getCity(), 'NotEmpty')) { - $errors[] = $helper->__('Please enter the city.'); + $errors[] = Mage::helper('Mage_Customer_Helper_Data')->__('Please enter the city.'); } if (!Zend_Validate::is($this->getTelephone(), 'NotEmpty')) { - $errors[] = $helper->__('Please enter the telephone number.'); + $errors[] = Mage::helper('Mage_Customer_Helper_Data')->__('Please enter the telephone number.'); } $_havingOptionalZip = Mage::helper('Mage_Directory_Helper_Data')->getCountriesWithOptionalZip(); - if (!in_array($this->getCountryId(), $_havingOptionalZip) && !Zend_Validate::is($this->getPostcode(), 'NotEmpty')) { - $errors[] = $helper->__('Please enter the zip/postal code.'); + if (!in_array($this->getCountryId(), $_havingOptionalZip) + && !Zend_Validate::is($this->getPostcode(), 'NotEmpty') + ) { + $errors[] = Mage::helper('Mage_Customer_Helper_Data')->__('Please enter the zip/postal code.'); } if (!Zend_Validate::is($this->getCountryId(), 'NotEmpty')) { - $errors[] = $helper->__('Please enter the country.'); + $errors[] = Mage::helper('Mage_Customer_Helper_Data')->__('Please enter the country.'); } if ($this->getCountryModel()->getRegionCollection()->getSize() && !Zend_Validate::is($this->getRegionId(), 'NotEmpty')) { - $errors[] = $helper->__('Please enter the state/province.'); + $errors[] = Mage::helper('Mage_Customer_Helper_Data')->__('Please enter the state/province.'); } if (empty($errors) || $this->getShouldIgnoreValidation()) { diff --git a/app/code/core/Mage/Customer/Model/Address/Api.php b/app/code/core/Mage/Customer/Model/Address/Api.php index 9da91d3f5e01a04bae222aaa5ecaffab01d1186f..52c4187ae3c27bb50e4e0fae1b4e79ffbba4f74c 100644 --- a/app/code/core/Mage/Customer/Model/Address/Api.php +++ b/app/code/core/Mage/Customer/Model/Address/Api.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Address/Api/V2.php b/app/code/core/Mage/Customer/Model/Address/Api/V2.php index 4c8edcfdb7facea35df407fe3fa09da1255294c9..63c71adc9511c54cd0a2c2baafeffd04dbfa2008 100644 --- a/app/code/core/Mage/Customer/Model/Address/Api/V2.php +++ b/app/code/core/Mage/Customer/Model/Address/Api/V2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Address/Config.php b/app/code/core/Mage/Customer/Model/Address/Config.php index abaface57449181378be4f50b5dec57e39888711..afac7ad187260830f1d1ca6ba45ddd1f54aeb0cf 100644 --- a/app/code/core/Mage/Customer/Model/Address/Config.php +++ b/app/code/core/Mage/Customer/Model/Address/Config.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Api/Resource.php b/app/code/core/Mage/Customer/Model/Api/Resource.php index b6a52df146412d55050174875eb64b8b94a5db8e..cf92c36b9335316c49ec0d2840e14ca8843cb7c1 100644 --- a/app/code/core/Mage/Customer/Model/Api/Resource.php +++ b/app/code/core/Mage/Customer/Model/Api/Resource.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Attribute.php b/app/code/core/Mage/Customer/Model/Attribute.php index df2321d914cb2ab6fe4887103e83353b8c1ebb2e..2645b51444fd324c4adcf5e6943e3c02fbc33fa9 100644 --- a/app/code/core/Mage/Customer/Model/Attribute.php +++ b/app/code/core/Mage/Customer/Model/Attribute.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Attribute/Backend/Data/Boolean.php b/app/code/core/Mage/Customer/Model/Attribute/Backend/Data/Boolean.php new file mode 100644 index 0000000000000000000000000000000000000000..59365d76a1d46c8a5a368640f3fcc26ebc9442ff --- /dev/null +++ b/app/code/core/Mage/Customer/Model/Attribute/Backend/Data/Boolean.php @@ -0,0 +1,52 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Customer + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + + +/** + * Boolean customer attribute backend model + * + * @category Mage + * @package Mage_Customer + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Customer_Model_Attribute_Backend_Data_Boolean + extends Mage_Eav_Model_Entity_Attribute_Backend_Abstract +{ + /** + * Prepare data before attribute save + * + * @param Mage_Customer_Model_Customer $customer + * @return Mage_Customer_Model_Attribute_Backend_Data_Boolean + */ + public function beforeSave($customer) + { + $attributeName = $this->getAttribute()->getName(); + $inputValue = $customer->getData($attributeName); + $sanitizedValue = (!empty($inputValue)) ? '1' : '0'; + $customer->setData($attributeName, $sanitizedValue); + return $this; + } +} diff --git a/app/code/core/Mage/Customer/Model/Attribute/Data.php b/app/code/core/Mage/Customer/Model/Attribute/Data.php index feffe7322c37c0047f8ee3dc6b679fdc76418284..5101f1f99567010aef48bb1a910ee188a3e8904f 100644 --- a/app/code/core/Mage/Customer/Model/Attribute/Data.php +++ b/app/code/core/Mage/Customer/Model/Attribute/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Attribute/Data/Abstract.php b/app/code/core/Mage/Customer/Model/Attribute/Data/Abstract.php index 7280af9d26724441168c069ea2b6507362f88b0b..7493f14ab1b99a9c89f0e573176b150ca595666e 100644 --- a/app/code/core/Mage/Customer/Model/Attribute/Data/Abstract.php +++ b/app/code/core/Mage/Customer/Model/Attribute/Data/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Attribute/Data/Boolean.php b/app/code/core/Mage/Customer/Model/Attribute/Data/Boolean.php index a7b092f3fe964614ea907aa1209987d759f4c3a6..650ade21d9dd3fe3321afc9bba2b1a18a8ee24b0 100644 --- a/app/code/core/Mage/Customer/Model/Attribute/Data/Boolean.php +++ b/app/code/core/Mage/Customer/Model/Attribute/Data/Boolean.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Attribute/Data/Date.php b/app/code/core/Mage/Customer/Model/Attribute/Data/Date.php index d7835299ae9699bc6d2f57756558d92a85de293b..3452abad31881d1cff143b30e96a518fb19a488a 100644 --- a/app/code/core/Mage/Customer/Model/Attribute/Data/Date.php +++ b/app/code/core/Mage/Customer/Model/Attribute/Data/Date.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Attribute/Data/File.php b/app/code/core/Mage/Customer/Model/Attribute/Data/File.php index 2eef4f7ea3f8df82bc3639b38955ecfff172c324..efbded70ed2457d0344725d5b9f328d3678efd3e 100644 --- a/app/code/core/Mage/Customer/Model/Attribute/Data/File.php +++ b/app/code/core/Mage/Customer/Model/Attribute/Data/File.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Attribute/Data/Hidden.php b/app/code/core/Mage/Customer/Model/Attribute/Data/Hidden.php index 69330a9ec4dfe590ecdf677266da2c7867f7decc..67fac25a2c99d507e0118bd40c708ff7d93e9c34 100644 --- a/app/code/core/Mage/Customer/Model/Attribute/Data/Hidden.php +++ b/app/code/core/Mage/Customer/Model/Attribute/Data/Hidden.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Attribute/Data/Image.php b/app/code/core/Mage/Customer/Model/Attribute/Data/Image.php index b56aa20683272592c2089d50c3551494f6e4330b..efa7ab8116e618ad2479d5b426457272eaf87743 100644 --- a/app/code/core/Mage/Customer/Model/Attribute/Data/Image.php +++ b/app/code/core/Mage/Customer/Model/Attribute/Data/Image.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Attribute/Data/Multiline.php b/app/code/core/Mage/Customer/Model/Attribute/Data/Multiline.php index 91c1cb963735b664fa8f6ff94b39f601fadf4ba5..d45ed771df388dd45abf7b409c7e3af20d0ee63a 100644 --- a/app/code/core/Mage/Customer/Model/Attribute/Data/Multiline.php +++ b/app/code/core/Mage/Customer/Model/Attribute/Data/Multiline.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Attribute/Data/Multiselect.php b/app/code/core/Mage/Customer/Model/Attribute/Data/Multiselect.php index c6b87fdbccd51efdf0f87aa76ed4c124e5203c2a..55788d58307a84e33b7a98a9c204b92ad6c6035a 100644 --- a/app/code/core/Mage/Customer/Model/Attribute/Data/Multiselect.php +++ b/app/code/core/Mage/Customer/Model/Attribute/Data/Multiselect.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Attribute/Data/Postcode.php b/app/code/core/Mage/Customer/Model/Attribute/Data/Postcode.php index f1aa4f34e9918a8a59db246e350f6c1f66210e19..6cd72e8feee36c447943ee5befd3eea6b687726c 100644 --- a/app/code/core/Mage/Customer/Model/Attribute/Data/Postcode.php +++ b/app/code/core/Mage/Customer/Model/Attribute/Data/Postcode.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Attribute/Data/Select.php b/app/code/core/Mage/Customer/Model/Attribute/Data/Select.php index fa38e70e679a1e110b654c6ac5891095ac39903e..49403867a926a0bce39f8de2020eebfa16c45c60 100644 --- a/app/code/core/Mage/Customer/Model/Attribute/Data/Select.php +++ b/app/code/core/Mage/Customer/Model/Attribute/Data/Select.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Attribute/Data/Text.php b/app/code/core/Mage/Customer/Model/Attribute/Data/Text.php index 92371ed47f81d4bccfbec05d84649a38fa0018f4..ecdd3b9bb5dc2ebe88172a9753cad4b67ff910a2 100644 --- a/app/code/core/Mage/Customer/Model/Attribute/Data/Text.php +++ b/app/code/core/Mage/Customer/Model/Attribute/Data/Text.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Attribute/Data/Textarea.php b/app/code/core/Mage/Customer/Model/Attribute/Data/Textarea.php index 3e5aa120ebbf28d514d12c698897ff9c9b6fe076..9a2aebdbda89f48be562a6f8fcb966e28e949b1c 100644 --- a/app/code/core/Mage/Customer/Model/Attribute/Data/Textarea.php +++ b/app/code/core/Mage/Customer/Model/Attribute/Data/Textarea.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Config/Share.php b/app/code/core/Mage/Customer/Model/Config/Share.php index e32401cfe233f3b14f866703ba1f49752a9ed19b..70c08ebf4ef435d178283637a990a7d235066b21 100644 --- a/app/code/core/Mage/Customer/Model/Config/Share.php +++ b/app/code/core/Mage/Customer/Model/Config/Share.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Convert/Adapter/Customer.php b/app/code/core/Mage/Customer/Model/Convert/Adapter/Customer.php index acca8a222a0f79ac7601f5245811b668f9a6ee75..5f961aa7ca359f01610346bfa21f2d71ecffe7d3 100644 --- a/app/code/core/Mage/Customer/Model/Convert/Adapter/Customer.php +++ b/app/code/core/Mage/Customer/Model/Convert/Adapter/Customer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Convert/Parser/Customer.php b/app/code/core/Mage/Customer/Model/Convert/Parser/Customer.php index 4fdb0053fe1293e19a0d65c9d9a163a921b86718..d38a747b38a14a7796afc5216d941d9548bf919e 100644 --- a/app/code/core/Mage/Customer/Model/Convert/Parser/Customer.php +++ b/app/code/core/Mage/Customer/Model/Convert/Parser/Customer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Customer.php b/app/code/core/Mage/Customer/Model/Customer.php index 3c401788bf1f5f5183e8555ddc3746e6e4272966..77c1806627fc3f1f289fbf828f2c781eec14864a 100644 --- a/app/code/core/Mage/Customer/Model/Customer.php +++ b/app/code/core/Mage/Customer/Model/Customer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -777,43 +777,42 @@ class Mage_Customer_Model_Customer extends Mage_Core_Model_Abstract public function validate() { $errors = array(); - $customerHelper = Mage::helper('Mage_Customer_Helper_Data'); if (!Zend_Validate::is( trim($this->getFirstname()) , 'NotEmpty')) { - $errors[] = $customerHelper->__('The first name cannot be empty.'); + $errors[] = Mage::helper('Mage_Customer_Helper_Data')->__('The first name cannot be empty.'); } if (!Zend_Validate::is( trim($this->getLastname()) , 'NotEmpty')) { - $errors[] = $customerHelper->__('The last name cannot be empty.'); + $errors[] = Mage::helper('Mage_Customer_Helper_Data')->__('The last name cannot be empty.'); } if (!Zend_Validate::is($this->getEmail(), 'EmailAddress')) { - $errors[] = $customerHelper->__('Invalid email address "%s".', $this->getEmail()); + $errors[] = Mage::helper('Mage_Customer_Helper_Data')->__('Invalid email address "%s".', $this->getEmail()); } $password = $this->getPassword(); if (!$this->getId() && !Zend_Validate::is($password , 'NotEmpty')) { - $errors[] = $customerHelper->__('The password cannot be empty.'); + $errors[] = Mage::helper('Mage_Customer_Helper_Data')->__('The password cannot be empty.'); } if (strlen($password) && !Zend_Validate::is($password, 'StringLength', array(6))) { - $errors[] = $customerHelper->__('The minimum password length is %s', 6); + $errors[] = Mage::helper('Mage_Customer_Helper_Data')->__('The minimum password length is %s', 6); } $confirmation = $this->getConfirmation(); if ($password != $confirmation) { - $errors[] = $customerHelper->__('Please make sure your passwords match.'); + $errors[] = Mage::helper('Mage_Customer_Helper_Data')->__('Please make sure your passwords match.'); } $entityType = Mage::getSingleton('Mage_Eav_Model_Config')->getEntityType('customer'); $attribute = Mage::getModel('Mage_Customer_Model_Attribute')->loadByCode($entityType, 'dob'); if ($attribute->getIsRequired() && '' == trim($this->getDob())) { - $errors[] = $customerHelper->__('The Date of Birth is required.'); + $errors[] = Mage::helper('Mage_Customer_Helper_Data')->__('The Date of Birth is required.'); } $attribute = Mage::getModel('Mage_Customer_Model_Attribute')->loadByCode($entityType, 'taxvat'); if ($attribute->getIsRequired() && '' == trim($this->getTaxvat())) { - $errors[] = $customerHelper->__('The TAX/VAT number is required.'); + $errors[] = Mage::helper('Mage_Customer_Helper_Data')->__('The TAX/VAT number is required.'); } $attribute = Mage::getModel('Mage_Customer_Model_Attribute')->loadByCode($entityType, 'gender'); if ($attribute->getIsRequired() && '' == trim($this->getGender())) { - $errors[] = $customerHelper->__('Gender is required.'); + $errors[] = Mage::helper('Mage_Customer_Helper_Data')->__('Gender is required.'); } if (empty($errors)) { @@ -831,7 +830,6 @@ class Mage_Customer_Model_Customer extends Mage_Core_Model_Abstract public function importFromTextArray(array $row) { $this->resetErrors(); - $hlp = Mage::helper('Mage_Customer_Helper_Data'); $line = $row['i']; $row = $row['row']; @@ -840,7 +838,7 @@ class Mage_Customer_Model_Customer extends Mage_Core_Model_Abstract $website = Mage::getModel('Mage_Core_Model_Website')->load($row['website_code'], 'code'); if (!$website->getId()) { - $this->addError($hlp->__('Invalid website, skipping the record, line: %s', $line)); + $this->addError(Mage::helper('Mage_Customer_Helper_Data')->__('Invalid website, skipping the record, line: %s', $line)); } else { $row['website_id'] = $website->getWebsiteId(); @@ -849,18 +847,18 @@ class Mage_Customer_Model_Customer extends Mage_Core_Model_Abstract // Validate Email if (empty($row['email'])) { - $this->addError($hlp->__('Missing email, skipping the record, line: %s', $line)); + $this->addError(Mage::helper('Mage_Customer_Helper_Data')->__('Missing email, skipping the record, line: %s', $line)); } else { $this->loadByEmail($row['email']); } if (empty($row['entity_id'])) { if ($this->getData('entity_id')) { - $this->addError($hlp->__('The customer email (%s) already exists, skipping the record, line: %s', $row['email'], $line)); + $this->addError(Mage::helper('Mage_Customer_Helper_Data')->__('The customer email (%s) already exists, skipping the record, line: %s', $row['email'], $line)); } } else { if ($row['entity_id'] != $this->getData('entity_id')) { - $this->addError($hlp->__('The customer ID and email did not match, skipping the record, line: %s', $line)); + $this->addError(Mage::helper('Mage_Customer_Helper_Data')->__('The customer ID and email did not match, skipping the record, line: %s', $line)); } else { $this->unsetData(); $this->load($row['entity_id']); @@ -872,7 +870,7 @@ class Mage_Customer_Model_Customer extends Mage_Core_Model_Abstract } if (empty($row['website_code'])) { - $this->addError($hlp->__('Missing website, skipping the record, line: %s', $line)); + $this->addError(Mage::helper('Mage_Customer_Helper_Data')->__('Missing website, skipping the record, line: %s', $line)); } if (empty($row['group'])) { @@ -880,10 +878,10 @@ class Mage_Customer_Model_Customer extends Mage_Core_Model_Abstract } if (empty($row['firstname'])) { - $this->addError($hlp->__('Missing first name, skipping the record, line: %s', $line)); + $this->addError(Mage::helper('Mage_Customer_Helper_Data')->__('Missing first name, skipping the record, line: %s', $line)); } if (empty($row['lastname'])) { - $this->addError($hlp->__('Missing last name, skipping the record, line: %s', $line)); + $this->addError(Mage::helper('Mage_Customer_Helper_Data')->__('Missing last name, skipping the record, line: %s', $line)); } if (!empty($row['password_new'])) { @@ -904,7 +902,7 @@ class Mage_Customer_Model_Customer extends Mage_Core_Model_Abstract } if (!$this->validateAddress($row, 'billing')) { - $this->printError($hlp->__('Invalid billing address for (%s)', $row['email']), $line); + $this->printError(Mage::helper('Mage_Customer_Helper_Data')->__('Invalid billing address for (%s)', $row['email']), $line); } else { // Handling billing address $billingAddress = $this->getPrimaryBillingAddress(); @@ -945,7 +943,7 @@ class Mage_Customer_Model_Customer extends Mage_Core_Model_Abstract } if (!$this->validateAddress($row, 'shipping')) { - $this->printError($hlp->__('Invalid shipping address for (%s)', $row['email']), $line); + $this->printError(Mage::helper('Mage_Customer_Helper_Data')->__('Invalid shipping address for (%s)', $row['email']), $line); } else { // Handling shipping address $shippingAddress = $this->getPrimaryShippingAddress(); @@ -1288,7 +1286,7 @@ class Mage_Customer_Model_Customer extends Mage_Core_Model_Abstract $tokenExpirationPeriod = Mage::helper('Mage_Customer_Helper_Data')->getResetPasswordLinkExpirationPeriod(); - $currentDate = Varien_Date::now(true); + $currentDate = Varien_Date::now(); $currentTimestamp = Varien_Date::toTimestamp($currentDate); $tokenTimestamp = Varien_Date::toTimestamp($resetPasswordLinkTokenCreatedAt); if ($tokenTimestamp > $currentTimestamp) { diff --git a/app/code/core/Mage/Customer/Model/Customer/Api.php b/app/code/core/Mage/Customer/Model/Customer/Api.php index 915ce3e41cdf93bb393a365c3c15211fe1c33106..5ebae45d27cbf6b61f29d3e29ebf7f53847e416b 100644 --- a/app/code/core/Mage/Customer/Model/Customer/Api.php +++ b/app/code/core/Mage/Customer/Model/Customer/Api.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Customer/Api/V2.php b/app/code/core/Mage/Customer/Model/Customer/Api/V2.php index f74dee3869afe179ed5f7650d771d6b41e8f391e..c03a2cb2b2ed6aa7945f7ca738c20b47d9213acf 100644 --- a/app/code/core/Mage/Customer/Model/Customer/Api/V2.php +++ b/app/code/core/Mage/Customer/Model/Customer/Api/V2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Customer/Attribute/Backend/Billing.php b/app/code/core/Mage/Customer/Model/Customer/Attribute/Backend/Billing.php index d509f11d312e12e0981e1dde8613f5d12f48f14a..d5b69040f5c4db5077971654b6640a13dadef813 100644 --- a/app/code/core/Mage/Customer/Model/Customer/Attribute/Backend/Billing.php +++ b/app/code/core/Mage/Customer/Model/Customer/Attribute/Backend/Billing.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Customer/Attribute/Backend/Password.php b/app/code/core/Mage/Customer/Model/Customer/Attribute/Backend/Password.php index 3a5da05e9485f18f33c6f12e9a360c204bd35c6d..9606231bc9f63d1bc18419ae7b096e2b4aea5d22 100644 --- a/app/code/core/Mage/Customer/Model/Customer/Attribute/Backend/Password.php +++ b/app/code/core/Mage/Customer/Model/Customer/Attribute/Backend/Password.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Customer/Attribute/Backend/Shipping.php b/app/code/core/Mage/Customer/Model/Customer/Attribute/Backend/Shipping.php index 3a0197102d29add730cd7672680a8cc6571d3b70..68281940a3c92b6e9eaf24ce93c478147da7bea3 100644 --- a/app/code/core/Mage/Customer/Model/Customer/Attribute/Backend/Shipping.php +++ b/app/code/core/Mage/Customer/Model/Customer/Attribute/Backend/Shipping.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Customer/Attribute/Backend/Store.php b/app/code/core/Mage/Customer/Model/Customer/Attribute/Backend/Store.php index 057ca7567b1416a2ed7ef98ba18d12326b304661..2e99517f5cd582db6bee37d66d2a2a0b7229135b 100644 --- a/app/code/core/Mage/Customer/Model/Customer/Attribute/Backend/Store.php +++ b/app/code/core/Mage/Customer/Model/Customer/Attribute/Backend/Store.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Customer/Attribute/Backend/Website.php b/app/code/core/Mage/Customer/Model/Customer/Attribute/Backend/Website.php index 0f190f6f05c1c25017d5a8e3b9c82346499d204a..36764d3f1fbc9a4e391198d0c0e7c6272f902f2f 100644 --- a/app/code/core/Mage/Customer/Model/Customer/Attribute/Backend/Website.php +++ b/app/code/core/Mage/Customer/Model/Customer/Attribute/Backend/Website.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Customer/Attribute/Source/Group.php b/app/code/core/Mage/Customer/Model/Customer/Attribute/Source/Group.php index c2792ef7e44da1eb0fcbbc6445d6be216d3ddc34..24e44b17111296bfbc95d4ab5b335e2d0903519a 100644 --- a/app/code/core/Mage/Customer/Model/Customer/Attribute/Source/Group.php +++ b/app/code/core/Mage/Customer/Model/Customer/Attribute/Source/Group.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Customer/Attribute/Source/Store.php b/app/code/core/Mage/Customer/Model/Customer/Attribute/Source/Store.php index 01928868b42dba8be8b1c6721f6e969f1005affe..3ecf7d3ee3ecfe345f93bc89850ae166c318deb3 100644 --- a/app/code/core/Mage/Customer/Model/Customer/Attribute/Source/Store.php +++ b/app/code/core/Mage/Customer/Model/Customer/Attribute/Source/Store.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Customer/Attribute/Source/Website.php b/app/code/core/Mage/Customer/Model/Customer/Attribute/Source/Website.php index 7f9f9476c22b0b9b3d12e572f722c03580188710..4f40fcaf88acb72d2bb585709607ef6151f0c5d8 100644 --- a/app/code/core/Mage/Customer/Model/Customer/Attribute/Source/Website.php +++ b/app/code/core/Mage/Customer/Model/Customer/Attribute/Source/Website.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Form.php b/app/code/core/Mage/Customer/Model/Form.php index 357793e7c5f85986d85ab4db59b3c17927b83e5c..4af3efae9846c65b3b67b6c2f3d736deddfcecb6 100644 --- a/app/code/core/Mage/Customer/Model/Form.php +++ b/app/code/core/Mage/Customer/Model/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Group.php b/app/code/core/Mage/Customer/Model/Group.php index d5f8c3ff1efde3f28483c76643534326a621e67e..4640991b009e9ebac84e01b06f85035ba4362fb2 100644 --- a/app/code/core/Mage/Customer/Model/Group.php +++ b/app/code/core/Mage/Customer/Model/Group.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Group/Api.php b/app/code/core/Mage/Customer/Model/Group/Api.php index 3c45d0d1458b9ad60d9c311a56f0819937a2b2df..cce518fcc4bf2db1cdc6444e8a05f17bcbcea6bb 100644 --- a/app/code/core/Mage/Customer/Model/Group/Api.php +++ b/app/code/core/Mage/Customer/Model/Group/Api.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Group/Api/V2.php b/app/code/core/Mage/Customer/Model/Group/Api/V2.php index 7aec13a97291cc3f0fe5e9ff6305a23085847c6b..d1b5c56156674bb6e182aacc512a84e3f9b1add3 100644 --- a/app/code/core/Mage/Customer/Model/Group/Api/V2.php +++ b/app/code/core/Mage/Customer/Model/Group/Api/V2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Observer.php b/app/code/core/Mage/Customer/Model/Observer.php index 5f427499d077f8ed1fdf9421169c2e1333488aff..5e4badac60fa6d880f78115a364f8f856555e617 100644 --- a/app/code/core/Mage/Customer/Model/Observer.php +++ b/app/code/core/Mage/Customer/Model/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -31,11 +31,191 @@ */ class Mage_Customer_Model_Observer { + /** + * VAT ID validation processed flag code + */ + const VIV_PROCESSED_FLAG = 'viv_after_address_save_processed'; + + /** + * VAT ID validation currently saved address flag + */ + const VIV_CURRENTLY_SAVED_ADDRESS = 'currently_saved_address'; + + /** + * Check whether specified billing address is default for its customer + * + * @param Mage_Customer_Model_Address $address + * @return bool + */ + protected function _isDefaultBilling($address) + { + return ($address->getId() && $address->getId() == $address->getCustomer()->getDefaultBilling()) + || $address->getIsPrimaryBilling() || $address->getIsDefaultBilling(); + } + + /** + * Check whether specified shipping address is default for its customer + * + * @param Mage_Customer_Model_Address $address + * @return bool + */ + protected function _isDefaultShipping($address) + { + return ($address->getId() && $address->getId() == $address->getCustomer()->getDefaultShipping()) + || $address->getIsPrimaryShipping() || $address->getIsDefaultShipping(); + } + + /** + * Check whether specified address should be processed in after_save event handler + * + * @param Mage_Customer_Model_Address $address + * @return bool + */ + protected function _canProcessAddress($address) + { + if ($address->getForceProcess()) { + return true; + } + + if (Mage::registry(self::VIV_CURRENTLY_SAVED_ADDRESS) != $address->getId()) { + return false; + } + + $configAddressType = Mage::helper('Mage_Customer_Helper_Address')->getTaxCalculationAddressType(); + if ($configAddressType == Mage_Customer_Model_Address_Abstract::TYPE_SHIPPING) { + return $this->_isDefaultShipping($address); + } + return $this->_isDefaultBilling($address); + } + + /** + * Before load layout event handler + * + * @param Varien_Event_Observer $observer + */ public function beforeLoadLayout($observer) { $loggedIn = Mage::getSingleton('Mage_Customer_Model_Session')->isLoggedIn(); $observer->getEvent()->getLayout()->getUpdate() - ->addHandle('customer_logged_'.($loggedIn?'in':'out')); + ->addHandle('customer_logged_' . ($loggedIn ? 'in' : 'out')); + } + + /** + * Address before save event handler + * + * @param Varien_Event_Observer $observer + */ + public function beforeAddressSave($observer) + { + if (Mage::registry(self::VIV_CURRENTLY_SAVED_ADDRESS)) { + Mage::unregister(self::VIV_CURRENTLY_SAVED_ADDRESS); + } + + /** @var $customerAddress Mage_Customer_Model_Address */ + $customerAddress = $observer->getCustomerAddress(); + if ($customerAddress->getId()) { + Mage::register(self::VIV_CURRENTLY_SAVED_ADDRESS, $customerAddress->getId()); + } else { + $configAddressType = Mage::helper('Mage_Customer_Helper_Address')->getTaxCalculationAddressType(); + + $forceProcess = ($configAddressType == Mage_Customer_Model_Address_Abstract::TYPE_SHIPPING) + ? $customerAddress->getIsDefaultShipping() : $customerAddress->getIsDefaultBilling(); + + if ($forceProcess) { + $customerAddress->setForceProcess(true); + } else { + Mage::register(self::VIV_CURRENTLY_SAVED_ADDRESS, 'new_address'); + } + } + } + + /** + * Address after save event handler + * + * @param Varien_Event_Observer $observer + */ + public function afterAddressSave($observer) + { + /** @var $customerAddress Mage_Customer_Model_Address */ + $customerAddress = $observer->getCustomerAddress(); + $customer = $customerAddress->getCustomer(); + + if (!Mage::helper('Mage_Customer_Helper_Address')->isVatValidationEnabled($customer->getStore()) + || Mage::registry(self::VIV_PROCESSED_FLAG) + || !$this->_canProcessAddress($customerAddress) + ) { + return; + } + + try { + Mage::register(self::VIV_PROCESSED_FLAG, true); + + /** @var $customerHelper Mage_Customer_Helper_Data */ + $customerHelper = Mage::helper('Mage_Customer_Helper_Data'); + + if ($customerAddress->getVatId() == '' + || !Mage::helper('Mage_Core_Helper_Data')->isCountryInEU($customerAddress->getCountry())) + { + $defaultGroupId = $customerHelper->getDefaultCustomerGroupId($customer->getStore()); + + if (!$customer->getDisableAutoGroupChange() && $customer->getGroupId() != $defaultGroupId) { + $customer->setGroupId($defaultGroupId); + $customer->save(); + } + } else { + + $result = $customerHelper->checkVatNumber( + $customerAddress->getCountryId(), + $customerAddress->getVatId() + ); + + $newGroupId = $customerHelper->getCustomerGroupIdBasedOnVatNumber( + $customerAddress->getCountryId(), $result, $customer->getStore() + ); + + if (!$customer->getDisableAutoGroupChange() && $customer->getGroupId() != $newGroupId) { + $customer->setGroupId($newGroupId); + $customer->save(); + } + + if (!Mage::app()->getStore()->isAdmin()) { + $validationMessage = Mage::helper('Mage_Customer_Helper_Data')->getVatValidationUserMessage($customerAddress, + $customer->getDisableAutoGroupChange(), $result); + + if (!$validationMessage->getIsError()) { + Mage::getSingleton('Mage_Customer_Model_Session')->addSuccess($validationMessage->getMessage()); + } else { + Mage::getSingleton('Mage_Customer_Model_Session')->addError($validationMessage->getMessage()); + } + } + } + } catch (Exception $e) { + Mage::register(self::VIV_PROCESSED_FLAG, false, true); + } + } + + /** + * Revert emulated customer group_id + * + * @param Varien_Event_Observer $observer + */ + public function quoteSubmitAfter($observer) + { + /** @var $customer Mage_Customer_Model_Customer */ + $customer = $observer->getQuote()->getCustomer(); + + if (!Mage::helper('Mage_Customer_Helper_Address')->isVatValidationEnabled($customer->getStore())) { + return; + } + + if (!$customer->getId()) { + return; + } + + $customer->setGroupId( + $customer->getOrigData('group_id') + ); + $customer->save(); } } diff --git a/app/code/core/Mage/Customer/Model/Resource/Address.php b/app/code/core/Mage/Customer/Model/Resource/Address.php index f4a6aae8315634685a4aacd2f14f7ea6e1d89637..94792af110e69dc3a630da08686a96becabc3db6 100755 --- a/app/code/core/Mage/Customer/Model/Resource/Address.php +++ b/app/code/core/Mage/Customer/Model/Resource/Address.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Resource/Address/Attribute/Backend/Region.php b/app/code/core/Mage/Customer/Model/Resource/Address/Attribute/Backend/Region.php index 7fde0a065d8e38e6713cd75bba22db3e34c04730..a225c2506b0074e22d6b8f415af45bdd74775398 100755 --- a/app/code/core/Mage/Customer/Model/Resource/Address/Attribute/Backend/Region.php +++ b/app/code/core/Mage/Customer/Model/Resource/Address/Attribute/Backend/Region.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Resource/Address/Attribute/Backend/Street.php b/app/code/core/Mage/Customer/Model/Resource/Address/Attribute/Backend/Street.php index 7ba4dab0e762faabb62993de1a406abb507e0222..3549843e9dfceb148b6f78c6da93104c4bdf7f97 100755 --- a/app/code/core/Mage/Customer/Model/Resource/Address/Attribute/Backend/Street.php +++ b/app/code/core/Mage/Customer/Model/Resource/Address/Attribute/Backend/Street.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Resource/Address/Attribute/Collection.php b/app/code/core/Mage/Customer/Model/Resource/Address/Attribute/Collection.php index 006de12587476099bf2fb3ac6efed5b2ddedd4c3..49123f0472838f76181e034799b957313edf88bd 100755 --- a/app/code/core/Mage/Customer/Model/Resource/Address/Attribute/Collection.php +++ b/app/code/core/Mage/Customer/Model/Resource/Address/Attribute/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Resource/Address/Attribute/Source/Country.php b/app/code/core/Mage/Customer/Model/Resource/Address/Attribute/Source/Country.php index cc8aceab75a351716d3459a8bf33c3f04f704b05..55408eb0b16a8eb092535a671bcdd53b48b51ee5 100755 --- a/app/code/core/Mage/Customer/Model/Resource/Address/Attribute/Source/Country.php +++ b/app/code/core/Mage/Customer/Model/Resource/Address/Attribute/Source/Country.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Resource/Address/Attribute/Source/Region.php b/app/code/core/Mage/Customer/Model/Resource/Address/Attribute/Source/Region.php index 32ecf308498eac4f65221d936214709ab2552bc0..924a6c8c51a41eb1aad8912523f28777e346c162 100755 --- a/app/code/core/Mage/Customer/Model/Resource/Address/Attribute/Source/Region.php +++ b/app/code/core/Mage/Customer/Model/Resource/Address/Attribute/Source/Region.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Resource/Address/Collection.php b/app/code/core/Mage/Customer/Model/Resource/Address/Collection.php index c765879b2405e635d0d0f0b3ff5c6f99e86a63a0..e01c512cd6ce1ca49059fc11d195274b1de49b98 100755 --- a/app/code/core/Mage/Customer/Model/Resource/Address/Collection.php +++ b/app/code/core/Mage/Customer/Model/Resource/Address/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Resource/Attribute.php b/app/code/core/Mage/Customer/Model/Resource/Attribute.php index baa892731bdb977d7ef41d67c10fc288d5de852d..d99ba11691735f8f885ccba0a5e86f84f87b4636 100755 --- a/app/code/core/Mage/Customer/Model/Resource/Attribute.php +++ b/app/code/core/Mage/Customer/Model/Resource/Attribute.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Resource/Attribute/Collection.php b/app/code/core/Mage/Customer/Model/Resource/Attribute/Collection.php index 1f3695203889f2a3908eae91e59d48b49f9343f9..9aadd89b5993326fe42bc58080f353c24aba04d0 100755 --- a/app/code/core/Mage/Customer/Model/Resource/Attribute/Collection.php +++ b/app/code/core/Mage/Customer/Model/Resource/Attribute/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Resource/Customer.php b/app/code/core/Mage/Customer/Model/Resource/Customer.php index 1156ee5b6407fcfe09a23da45bcef52844a8bf71..5970df456382d4e83aa361e824501d5c3b181674 100755 --- a/app/code/core/Mage/Customer/Model/Resource/Customer.php +++ b/app/code/core/Mage/Customer/Model/Resource/Customer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -325,7 +325,7 @@ class Mage_Customer_Model_Resource_Customer extends Mage_Eav_Model_Entity_Abstra public function changeResetPasswordLinkToken(Mage_Customer_Model_Customer $customer, $newResetPasswordLinkToken) { if (is_string($newResetPasswordLinkToken) && !empty($newResetPasswordLinkToken)) { $customer->setRpToken($newResetPasswordLinkToken); - $currentDate = Varien_Date::now(true); + $currentDate = Varien_Date::now(); $customer->setRpTokenCreatedAt($currentDate); $this->saveAttribute($customer, 'rp_token'); $this->saveAttribute($customer, 'rp_token_created_at'); diff --git a/app/code/core/Mage/Customer/Model/Resource/Customer/Collection.php b/app/code/core/Mage/Customer/Model/Resource/Customer/Collection.php index 4b921c5a663105bfce67f8dae3c73ca3283a53f6..1b2d7dded28de3e875c39c50d4986c41388e983b 100755 --- a/app/code/core/Mage/Customer/Model/Resource/Customer/Collection.php +++ b/app/code/core/Mage/Customer/Model/Resource/Customer/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -80,26 +80,29 @@ class Mage_Customer_Model_Resource_Customer_Collection extends Mage_Eav_Model_En if (isset($fields['prefix'])) { $concatenate[] = $adapter->getCheckSql( '{{prefix}} IS NOT NULL AND {{prefix}} != \'\'', - 'LTRIM(RTRIM({{prefix}}))', + $adapter->getConcatSql(array('LTRIM(RTRIM({{prefix}}))', '\' \'')), '\'\''); } $concatenate[] = 'LTRIM(RTRIM({{firstname}}))'; + $concatenate[] = '\' \''; if (isset($fields['middlename'])) { $concatenate[] = $adapter->getCheckSql( '{{middlename}} IS NOT NULL AND {{middlename}} != \'\'', - 'LTRIM(RTRIM({{middlename}}))', + $adapter->getConcatSql(array('LTRIM(RTRIM({{middlename}}))', '\' \'')), '\'\''); } $concatenate[] = 'LTRIM(RTRIM({{lastname}}))'; if (isset($fields['suffix'])) { $concatenate[] = $adapter - ->getCheckSql('{{suffix}} IS NOT NULL AND {{suffix}} != \'\'', "LTRIM(RTRIM({{suffix}}))", "''"); + ->getCheckSql('{{suffix}} IS NOT NULL AND {{suffix}} != \'\'', + $adapter->getConcatSql(array('\' \'', 'LTRIM(RTRIM({{suffix}}))')), + '\'\''); } - $nameExpr = $adapter->getConcatSql($concatenate, ' '); + $nameExpr = $adapter->getConcatSql($concatenate); $this->addExpressionAttributeToSelect('name', $nameExpr, $fields); - + return $this; } diff --git a/app/code/core/Mage/Customer/Model/Resource/Form/Attribute.php b/app/code/core/Mage/Customer/Model/Resource/Form/Attribute.php index b3486fd8d5cc0cfb7770789d71875d6be15a9e69..4d4ebd0f0680379656abc19235916a3df247ad76 100755 --- a/app/code/core/Mage/Customer/Model/Resource/Form/Attribute.php +++ b/app/code/core/Mage/Customer/Model/Resource/Form/Attribute.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Resource/Form/Attribute/Collection.php b/app/code/core/Mage/Customer/Model/Resource/Form/Attribute/Collection.php index 7e02a2ebb9db38a4d24a36e45ec75cce2a74b5ab..a0f50e4347351864c6ffa12a9a2037cb8f0e0893 100755 --- a/app/code/core/Mage/Customer/Model/Resource/Form/Attribute/Collection.php +++ b/app/code/core/Mage/Customer/Model/Resource/Form/Attribute/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Resource/Group.php b/app/code/core/Mage/Customer/Model/Resource/Group.php index 87ebf7d6fc90afaca8e15da416bf988546e20089..12f42eff75d39101b88c0b142ea3bbaad34cffa1 100755 --- a/app/code/core/Mage/Customer/Model/Resource/Group.php +++ b/app/code/core/Mage/Customer/Model/Resource/Group.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -85,8 +85,7 @@ class Mage_Customer_Model_Resource_Group extends Mage_Core_Model_Resource_Db_Abs ->addAttributeToFilter('group_id', $group->getId()) ->load(); foreach ($customerCollection as $customer) { - $defaultGroupId = Mage::getStoreConfig(Mage_Customer_Model_Group::XML_PATH_DEFAULT_ID, - $customer->getStoreId()); + $defaultGroupId = Mage::helper('Mage_Customer_Helper_Data')->getDefaultCustomerGroupId($customer->getStoreId()); $customer->setGroupId($defaultGroupId); $customer->save(); } diff --git a/app/code/core/Mage/Customer/Model/Resource/Group/Collection.php b/app/code/core/Mage/Customer/Model/Resource/Group/Collection.php index f0854ff9085e74a25d29f6d0661c7744e59fc31e..052c0a865cae28d4b622b538ad6c38005dd094bd 100755 --- a/app/code/core/Mage/Customer/Model/Resource/Group/Collection.php +++ b/app/code/core/Mage/Customer/Model/Resource/Group/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Resource/Setup.php b/app/code/core/Mage/Customer/Model/Resource/Setup.php index 8879624c10d689dfca812f410f06ce39eca85b7b..8f3b95b4cb6a529fb2da4e8b844759cd3453ccc1 100755 --- a/app/code/core/Mage/Customer/Model/Resource/Setup.php +++ b/app/code/core/Mage/Customer/Model/Resource/Setup.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/Model/Session.php b/app/code/core/Mage/Customer/Model/Session.php index f04e7bbc485d7d958f662b78ae1fc43be4d39f51..4e588e43c5d4790eb71565f3036eee86833bd5dc 100644 --- a/app/code/core/Mage/Customer/Model/Session.php +++ b/app/code/core/Mage/Customer/Model/Session.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -100,7 +100,7 @@ class Mage_Customer_Model_Session extends Mage_Core_Model_Session_Abstract } /** - * Retrieve costomer model object + * Retrieve customer model object * * @return Mage_Customer_Model_Customer */ @@ -168,13 +168,14 @@ class Mage_Customer_Model_Session extends Mage_Core_Model_Session_Abstract if ($this->getData('customer_group_id')) { return $this->getData('customer_group_id'); } - return $this->isLoggedIn() && $this->getCustomer() - ? $this->getCustomer()->getGroupId() - : Mage_Customer_Model_Group::NOT_LOGGED_IN_ID; + if ($this->isLoggedIn() && $this->getCustomer()) { + return $this->getCustomer()->getGroupId(); + } + return Mage_Customer_Model_Group::NOT_LOGGED_IN_ID; } /** - * Checking custommer loggin status + * Checking customer login status * * @return bool */ diff --git a/app/code/core/Mage/Customer/controllers/AccountController.php b/app/code/core/Mage/Customer/controllers/AccountController.php index a9741fa982eaec7f540768eaabd417212d42512b..33c386b07647174c6844b182851397247b41c511 100644 --- a/app/code/core/Mage/Customer/controllers/AccountController.php +++ b/app/code/core/Mage/Customer/controllers/AccountController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -392,6 +392,19 @@ class Mage_Customer_AccountController extends Mage_Core_Controller_Front_Action $this->_getSession()->addSuccess( $this->__('Thank you for registering with %s.', Mage::app()->getStore()->getFrontendName()) ); + if ($this->_isVatValidationEnabled()) { + // Show corresponding VAT message to customer + $configAddressType = Mage::helper('Mage_Customer_Helper_Address')->getTaxCalculationAddressType(); + $userPrompt = ''; + switch ($configAddressType) { + case Mage_Customer_Model_Address_Abstract::TYPE_SHIPPING: + $userPrompt = $this->__('If you are a registered VAT customer, please click <a href="%s">here</a> to enter you shipping address for proper VAT calculation', Mage::getUrl('customer/address/edit')); + break; + default: + $userPrompt = $this->__('If you are a registered VAT customer, please click <a href="%s">here</a> to enter you billing address for proper VAT calculation', Mage::getUrl('customer/address/edit')); + } + $this->_getSession()->addSuccess($userPrompt); + } $customer->sendNewAccountEmail( $isJustConfirmed ? 'confirmed' : 'registered', @@ -819,4 +832,15 @@ class Mage_Customer_AccountController extends Mage_Core_Controller_Front_Action $data = $this->_filterDates($data, array('dob')); return $data; } + + /** + * Check whether VAT ID validation is enabled + * + * @param Mage_Core_Model_Store|string|int $store + * @return bool + */ + protected function _isVatValidationEnabled($store = null) + { + return Mage::helper('Mage_Customer_Helper_Address')->isVatValidationEnabled($store); + } } diff --git a/app/code/core/Mage/Customer/controllers/AddressController.php b/app/code/core/Mage/Customer/controllers/AddressController.php index 7db340398f32b09d8f31972104270ca29134b597..54c4a6d6d0857e7fb3e7df56920b0346ce159a5f 100644 --- a/app/code/core/Mage/Customer/controllers/AddressController.php +++ b/app/code/core/Mage/Customer/controllers/AddressController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/controllers/ReviewController.php b/app/code/core/Mage/Customer/controllers/ReviewController.php index 5f3880bd9bd7da3360cb136f9b4117bf574074b3..e1980501f392c29a4a781e9b74d535e08c077e37 100644 --- a/app/code/core/Mage/Customer/controllers/ReviewController.php +++ b/app/code/core/Mage/Customer/controllers/ReviewController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/data/customer_setup/data-upgrade-1.6.1.0-1.6.2.0.php b/app/code/core/Mage/Customer/data/customer_setup/data-upgrade-1.6.1.0-1.6.2.0.php new file mode 100644 index 0000000000000000000000000000000000000000..910684b3cee594e513e702789e3f776404c1a183 --- /dev/null +++ b/app/code/core/Mage/Customer/data/customer_setup/data-upgrade-1.6.1.0-1.6.2.0.php @@ -0,0 +1,43 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Customer + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/* @var $installer Mage_Customer_Model_Entity_Setup */ +$installer = $this; + +$disableAGCAttribute = Mage::getSingleton('Mage_Eav_Model_Config') + ->getAttribute('customer', 'disable_auto_group_change'); +$disableAGCAttribute->setData('used_in_forms', array( + 'adminhtml_customer' +)); +$disableAGCAttribute->save(); + +$vatAttribute = Mage::getSingleton('Mage_Eav_Model_Config')->getAttribute('customer_address', 'vat_id'); +$vatAttribute->setData('used_in_forms', array( + 'adminhtml_customer_address', + 'customer_address_edit', + 'customer_register_address' +)); +$vatAttribute->save(); diff --git a/app/code/core/Mage/Customer/etc/adminhtml.xml b/app/code/core/Mage/Customer/etc/adminhtml.xml index 025d2e12fb5d397d8733a5b95ebbf9a2b58b13c3..f028fb122d06ef3d32f53504d0022f1fe82a5d03 100644 --- a/app/code/core/Mage/Customer/etc/adminhtml.xml +++ b/app/code/core/Mage/Customer/etc/adminhtml.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Customer/etc/api.xml b/app/code/core/Mage/Customer/etc/api.xml index e61d8d0f36bda3bd91902393250be4a2bf17b5ba..564836de9b3d2188c1d6a76cd74d850e24f7f0e5 100644 --- a/app/code/core/Mage/Customer/etc/api.xml +++ b/app/code/core/Mage/Customer/etc/api.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Customer/etc/config.xml b/app/code/core/Mage/Customer/etc/config.xml index 7c62fbf5854dd08f2d96b508c4dc110c1a49d3eb..b1ac678539a05341159df4b77b68814e22cbf7cf 100644 --- a/app/code/core/Mage/Customer/etc/config.xml +++ b/app/code/core/Mage/Customer/etc/config.xml @@ -21,14 +21,14 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> <config> <modules> <Mage_Customer> - <version>1.6.1.0</version> + <version>1.6.2.0.1</version> </Mage_Customer> </modules> <global> @@ -91,6 +91,24 @@ </customer_password_remind_email_template> </email> </template> + <events> + <customer_address_save_before> + <observers> + <customer_address_before_save_viv_observer> + <class>Mage_Customer_Model_Observer</class> + <method>beforeAddressSave</method> + </customer_address_before_save_viv_observer> + </observers> + </customer_address_save_before> + <customer_address_save_after> + <observers> + <customer_addres_after_save_viv_observer> + <class>Mage_Customer_Model_Observer</class> + <method>afterAddressSave</method> + </customer_addres_after_save_viv_observer> + </observers> + </customer_address_save_after> + </events> </global> <adminhtml> <translate> @@ -116,6 +134,14 @@ </customer_is_logged_in_observer> </observers> </controller_action_layout_load_before> + <sales_model_service_quote_submit_after> + <observers> + <restore_customer_group_id> + <class>Mage_Customer_Model_Observer</class> + <method>quoteSubmitAfter</method> + </restore_customer_group_id> + </observers> + </sales_model_service_quote_submit_after> </events> <routers> <customer> @@ -151,6 +177,7 @@ <create_account> <confirm>0</confirm> <default_group>1</default_group> + <tax_calculation_address_type>billing</tax_calculation_address_type> <email_domain>example.com</email_domain> <email_identity>general</email_identity> <email_template>customer_create_account_email_template</email_template> @@ -190,7 +217,8 @@ {{if city}}{{var city}}, {{/if}}{{if region}}{{var region}}, {{/if}}{{if postcode}}{{var postcode}}{{/if}} {{var country}} T: {{var telephone}} -{{depend fax}}F: {{var fax}}{{/depend}}</text> +{{depend fax}}F: {{var fax}}{{/depend}} +{{depend vat_id}}VAT: {{var vat_id}}{{/depend}}</text> <oneline>{{depend prefix}}{{var prefix}} {{/depend}}{{var firstname}} {{depend middlename}}{{var middlename}} {{/depend}}{{var lastname}}{{depend suffix}} {{var suffix}}{{/depend}}, {{var street}}, {{var city}}, {{var region}} {{var postcode}}, {{var country}}</oneline> <html>{{depend prefix}}{{var prefix}} {{/depend}}{{var firstname}} {{depend middlename}}{{var middlename}} {{/depend}}{{var lastname}}{{depend suffix}} {{var suffix}}{{/depend}}<br/> {{depend company}}{{var company}}<br />{{/depend}} @@ -201,7 +229,8 @@ T: {{var telephone}} {{if city}}{{var city}}, {{/if}}{{if region}}{{var region}}, {{/if}}{{if postcode}}{{var postcode}}{{/if}}<br/> {{var country}}<br/> {{depend telephone}}T: {{var telephone}}{{/depend}} -{{depend fax}}<br/>F: {{var fax}}{{/depend}}</html> +{{depend fax}}<br/>F: {{var fax}}{{/depend}} +{{depend vat_id}}<br/>VAT: {{var vat_id}}{{/depend}}</html> <pdf>{{depend prefix}}{{var prefix}} {{/depend}}{{var firstname}} {{depend middlename}}{{var middlename}} {{/depend}}{{var lastname}}{{depend suffix}} {{var suffix}}{{/depend}}| {{depend company}}{{var company}}|{{/depend}} {{if street1}}{{var street1}} @@ -213,8 +242,9 @@ T: {{var telephone}} {{if region}}{{var region}}, {{/if}}{{if postcode}}{{var postcode}}{{/if}}| {{var country}}| {{depend telephone}}T: {{var telephone}}{{/depend}}| -{{depend fax}}<br/>F: {{var fax}}{{/depend}}|</pdf> - <js_template>#{prefix} #{firstname} #{middlename} #{lastname} #{suffix}<br/>#{company}<br/>#{street0}<br/>#{street1}<br/>#{street2}<br/>#{street3}<br/>#{city}, #{region}, #{postcode}<br/>#{country_id}<br/>T: #{telephone}<br/>F: #{fax}</js_template> +{{depend fax}}<br/>F: {{var fax}}{{/depend}}| +{{depend vat_id}}<br/>VAT: {{var vat_id}}{{/depend}}|</pdf> + <js_template>#{prefix} #{firstname} #{middlename} #{lastname} #{suffix}<br/>#{company}<br/>#{street0}<br/>#{street1}<br/>#{street2}<br/>#{street3}<br/>#{city}, #{region}, #{postcode}<br/>#{country_id}<br/>T: #{telephone}<br/>F: #{fax}<br/>VAT: #{vat_id}</js_template> </address_templates> </customer> </default> diff --git a/app/code/core/Mage/Customer/etc/fieldset.xml b/app/code/core/Mage/Customer/etc/fieldset.xml index 3d644070c602d2d31c4a4822fb0c4e762b1aa733..b847f590d285e68c61cc00a10955c4adcf104368 100644 --- a/app/code/core/Mage/Customer/etc/fieldset.xml +++ b/app/code/core/Mage/Customer/etc/fieldset.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> @@ -77,6 +77,79 @@ <update>1</update> </gender> </customer_account> + <customer_address> + <vat_id> + <to_quote_address>*</to_quote_address> + </vat_id> + <vat_is_valid> + <to_quote_address>*</to_quote_address> + </vat_is_valid> + <vat_request_id> + <to_quote_address>*</to_quote_address> + </vat_request_id> + <vat_request_date> + <to_quote_address>*</to_quote_address> + </vat_request_date> + <vat_request_success> + <to_quote_address>*</to_quote_address> + </vat_request_success> + </customer_address> + <sales_convert_order_address> + <vat_id> + <to_quote_address>*</to_quote_address> + </vat_id> + <vat_is_valid> + <to_quote_address>*</to_quote_address> + </vat_is_valid> + <vat_request_id> + <to_quote_address>*</to_quote_address> + </vat_request_id> + <vat_request_date> + <to_quote_address>*</to_quote_address> + </vat_request_date> + <vat_request_success> + <to_quote_address>*</to_quote_address> + </vat_request_success> + </sales_convert_order_address> + <sales_convert_quote_address> + <vat_id> + <to_order_address>*</to_order_address> + <to_customer_address>*</to_customer_address> + </vat_id> + <vat_is_valid> + <to_order_address>*</to_order_address> + <to_customer_address>*</to_customer_address> + </vat_is_valid> + <vat_request_id> + <to_order_address>*</to_order_address> + <to_customer_address>*</to_customer_address> + </vat_request_id> + <vat_request_date> + <to_order_address>*</to_order_address> + <to_customer_address>*</to_customer_address> + </vat_request_date> + <vat_request_success> + <to_order_address>*</to_order_address> + <to_customer_address>*</to_customer_address> + </vat_request_success> + </sales_convert_quote_address> + <sales_copy_order_billing_address> + <vat_id> + <to_order>*</to_order> + </vat_id> + <vat_is_valid> + <to_order>*</to_order> + </vat_is_valid> + <vat_request_id> + <to_order>*</to_order> + </vat_request_id> + <vat_request_date> + <to_order>*</to_order> + </vat_request_date> + <vat_request_success> + <to_order>*</to_order> + </vat_request_success> + </sales_copy_order_billing_address> </fieldsets> </global> <admin> diff --git a/app/code/core/Mage/Customer/etc/system.xml b/app/code/core/Mage/Customer/etc/system.xml index 198b4538bbdf204383ecfb6843fcad74b974aeac..bf28717454ac96d61eb4c29f2a5ffae587bb5874 100644 --- a/app/code/core/Mage/Customer/etc/system.xml +++ b/app/code/core/Mage/Customer/etc/system.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> @@ -88,19 +88,97 @@ <show_in_website>1</show_in_website> <show_in_store>1</show_in_store> <fields> + <auto_group_assign translate="label"> + <label>Enable Automatic Assignment to Customer Group</label> + <frontend_type>select</frontend_type> + <source_model>Mage_Adminhtml_Model_System_Config_Source_Yesno</source_model> + <sort_order>10</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>1</show_in_store> + </auto_group_assign> + <tax_calculation_address_type translate="label"> + <label>Tax Calculation Based on</label> + <frontend_type>select</frontend_type> + <source_model>Mage_Adminhtml_Model_System_Config_Source_Customer_Address_Type</source_model> + <sort_order>10</sort_order> + <depends><auto_group_assign>1</auto_group_assign></depends> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>1</show_in_store> + </tax_calculation_address_type> <default_group translate="label"> <label>Default Group</label> <frontend_type>select</frontend_type> <source_model>Mage_Adminhtml_Model_System_Config_Source_Customer_Group</source_model> - <sort_order>1</sort_order> + <sort_order>20</sort_order> <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> <show_in_store>1</show_in_store> </default_group> + <viv_domestic_group translate="label"> + <label>Group for Valid VAT ID - Domestic</label> + <frontend_type>select</frontend_type> + <source_model>Mage_Adminhtml_Model_System_Config_Source_Customer_Group</source_model> + <sort_order>30</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>1</show_in_store> + <depends><auto_group_assign>1</auto_group_assign></depends> + </viv_domestic_group> + <viv_intra_union_group translate="label"> + <label>Group for Valid VAT ID - Intra-Union</label> + <frontend_type>select</frontend_type> + <source_model>Mage_Adminhtml_Model_System_Config_Source_Customer_Group</source_model> + <sort_order>40</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>1</show_in_store> + <depends><auto_group_assign>1</auto_group_assign></depends> + </viv_intra_union_group> + <viv_invalid_group translate="label"> + <label>Group for Invalid VAT ID</label> + <frontend_type>select</frontend_type> + <source_model>Mage_Adminhtml_Model_System_Config_Source_Customer_Group</source_model> + <sort_order>50</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>1</show_in_store> + <depends><auto_group_assign>1</auto_group_assign></depends> + </viv_invalid_group> + <viv_error_group translate="label"> + <label>Validation Error Group</label> + <frontend_type>select</frontend_type> + <source_model>Mage_Adminhtml_Model_System_Config_Source_Customer_Group</source_model> + <sort_order>55</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>1</show_in_store> + <depends><auto_group_assign>1</auto_group_assign></depends> + </viv_error_group> + <viv_on_each_transaction translate="label"> + <label>Validate on Each Transaction</label> + <frontend_type>select</frontend_type> + <source_model>Mage_Adminhtml_Model_System_Config_Source_Yesno</source_model> + <sort_order>56</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>1</show_in_store> + <depends><auto_group_assign>1</auto_group_assign></depends> + </viv_on_each_transaction> + <viv_disable_auto_group_assign_default translate="label"> + <label>Default Value for Disable Automatic Group Changes Based on VAT ID</label> + <frontend_type>select</frontend_type> + <source_model>Mage_Adminhtml_Model_System_Config_Source_Yesno</source_model> + <sort_order>57</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>0</show_in_website> + <show_in_store>0</show_in_store> + </viv_disable_auto_group_assign_default> <email_domain translate="label"> <label>Default Email Domain</label> <frontend_type>text</frontend_type> - <sort_order>2</sort_order> + <sort_order>60</sort_order> <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> <show_in_store>1</show_in_store> @@ -109,7 +187,7 @@ <label>Default Welcome Email</label> <frontend_type>select</frontend_type> <source_model>Mage_Adminhtml_Model_System_Config_Source_Email_Template</source_model> - <sort_order>3</sort_order> + <sort_order>70</sort_order> <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> <show_in_store>1</show_in_store> @@ -118,7 +196,7 @@ <label>Email Sender</label> <frontend_type>select</frontend_type> <source_model>Mage_Adminhtml_Model_System_Config_Source_Email_Identity</source_model> - <sort_order>4</sort_order> + <sort_order>80</sort_order> <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> <show_in_store>1</show_in_store> @@ -127,7 +205,7 @@ <label>Require Emails Confirmation</label> <frontend_type>select</frontend_type> <source_model>Mage_Adminhtml_Model_System_Config_Source_Yesno</source_model> - <sort_order>5</sort_order> + <sort_order>90</sort_order> <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> <show_in_store>0</show_in_store> @@ -136,7 +214,7 @@ <label>Confirmation Link Email</label> <frontend_type>select</frontend_type> <source_model>Mage_Adminhtml_Model_System_Config_Source_Email_Template</source_model> - <sort_order>6</sort_order> + <sort_order>100</sort_order> <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> <show_in_store>1</show_in_store> @@ -146,7 +224,7 @@ <comment>This email will be sent instead of default welcome email, after account confirmation.</comment> <frontend_type>select</frontend_type> <source_model>Mage_Adminhtml_Model_System_Config_Source_Email_Template</source_model> - <sort_order>7</sort_order> + <sort_order>110</sort_order> <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> <show_in_store>1</show_in_store> @@ -155,7 +233,7 @@ <label>Generate Human-Friendly Customer ID</label> <frontend_type>select</frontend_type> <source_model>Mage_Adminhtml_Model_System_Config_Source_Yesno</source_model> - <sort_order>8</sort_order> + <sort_order>120</sort_order> <show_in_default>1</show_in_default> <show_in_website>0</show_in_website> <show_in_store>0</show_in_store> @@ -377,5 +455,32 @@ </address_templates> </groups> </customer> + <general> + <groups> + <country> + <fields> + <eu_countries> + <backend_model>Mage_Adminhtml_Model_System_Config_Backend_Customer_GroupAutoAssign</backend_model> + </eu_countries> + </fields> + </country> + <store_information> + <fields> + <merchant_country> + <backend_model>Mage_Adminhtml_Model_System_Config_Backend_Customer_GroupAutoAssign</backend_model> + </merchant_country> + <validate_vat_number translate="button_label"> + <label></label> + <button_label>Validate VAT Number</button_label> + <frontend_model>Mage_Adminhtml_Block_Customer_System_Config_Validatevat</frontend_model> + <sort_order>28</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>1</show_in_store> + </validate_vat_number> + </fields> + </store_information> + </groups> + </general> </sections> </config> diff --git a/app/code/core/Mage/Customer/sql/customer_setup/install-1.6.0.0.php b/app/code/core/Mage/Customer/sql/customer_setup/install-1.6.0.0.php index dc9286dd267f29a9b0a21731d28331cf7cb0292f..e7093c67ebee85955e02eff6152bb4d82ff100dd 100644 --- a/app/code/core/Mage/Customer/sql/customer_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/Customer/sql/customer_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.6.0.0-1.6.1.0.php b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.6.0.0-1.6.1.0.php index df8407c5cb8cc2c40b63d6c4f5533b8b15019e20..061191ebf5ee2c89b58e4b0f9d2d27f1d82fd2a7 100644 --- a/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.6.0.0-1.6.1.0.php +++ b/app/code/core/Mage/Customer/sql/customer_setup/mysql4-upgrade-1.6.0.0-1.6.1.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/sql/customer_setup/upgrade-1.6.0.0-1.6.1.0.php b/app/code/core/Mage/Customer/sql/customer_setup/upgrade-1.6.0.0-1.6.1.0.php index df8407c5cb8cc2c40b63d6c4f5533b8b15019e20..061191ebf5ee2c89b58e4b0f9d2d27f1d82fd2a7 100644 --- a/app/code/core/Mage/Customer/sql/customer_setup/upgrade-1.6.0.0-1.6.1.0.php +++ b/app/code/core/Mage/Customer/sql/customer_setup/upgrade-1.6.0.0-1.6.1.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Customer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Customer/sql/customer_setup/upgrade-1.6.1.0-1.6.2.0.php b/app/code/core/Mage/Customer/sql/customer_setup/upgrade-1.6.1.0-1.6.2.0.php new file mode 100644 index 0000000000000000000000000000000000000000..c2bd1385abe45dbd21baa528b3985a7dd2f15fe9 --- /dev/null +++ b/app/code/core/Mage/Customer/sql/customer_setup/upgrade-1.6.1.0-1.6.2.0.php @@ -0,0 +1,78 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Customer + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/* @var $installer Mage_Customer_Model_Entity_Setup */ +$installer = $this; + +$disableAGCAttributeCode = 'disable_auto_group_change'; + +$installer->addAttribute('customer', $disableAGCAttributeCode, array( + 'type' => 'static', + 'label' => 'Disable automatic group change', + 'input' => 'boolean', + 'backend' => 'Mage_Customer_Model_Attribute_Backend_Data_Boolean', + 'position' => 28, + 'required' => false +)); + +$attributesInfo = array( + 'vat_id' => array( + 'label' => 'VAT number', + 'type' => 'varchar', + 'input' => 'text', + 'position' => 140, + 'visible' => true, + 'required' => false + ), + 'vat_is_valid' => array( + 'label' => 'VAT number validity', + 'visible' => false, + 'required' => false, + 'type' => 'int' + ), + 'vat_request_id' => array( + 'label' => 'VAT number validation request ID', + 'type' => 'varchar', + 'visible' => false, + 'required' => false + ), + 'vat_request_date' => array( + 'label' => 'VAT number validation request date', + 'type' => 'varchar', + 'visible' => false, + 'required' => false + ), + 'vat_request_success' => array( + 'label' => 'VAT number validation request success', + 'visible' => false, + 'required' => false, + 'type' => 'int' + ) +); + +foreach ($attributesInfo as $attributeCode => $attributeParams) { + $installer->addAttribute('customer_address', $attributeCode, $attributeParams); +} diff --git a/app/code/core/Mage/Customer/sql/customer_setup/upgrade-1.6.2.0-1.6.2.0.1.php b/app/code/core/Mage/Customer/sql/customer_setup/upgrade-1.6.2.0-1.6.2.0.1.php new file mode 100644 index 0000000000000000000000000000000000000000..e767ca8d2aaab1d6344d01a7778af0b7fd3c2486 --- /dev/null +++ b/app/code/core/Mage/Customer/sql/customer_setup/upgrade-1.6.2.0-1.6.2.0.1.php @@ -0,0 +1,36 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Customer + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** @var $installer Mage_Customer_Model_Entity_Setup */ +$installer = $this; + +$installer->getConnection()->addColumn($installer->getTable('customer_entity'), 'disable_auto_group_change', array( + 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, + 'unsigned' => true, + 'nullable' => false, + 'default' => '0', + 'comment' => 'Disable automatic group change' +)); diff --git a/app/code/core/Mage/Customer/view/frontend/account/dashboard.phtml b/app/code/core/Mage/Customer/view/frontend/account/dashboard.phtml index 964b96cdb0fd7aed6b66762b7a5cfa6997ad397c..f958ad156523a68fdc71c0d06d76b71fd6ae64c1 100644 --- a/app/code/core/Mage/Customer/view/frontend/account/dashboard.phtml +++ b/app/code/core/Mage/Customer/view/frontend/account/dashboard.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Customer/view/frontend/account/dashboard/address.phtml b/app/code/core/Mage/Customer/view/frontend/account/dashboard/address.phtml index 7d9371e7aa7ef52d093e39b91a41b86196757633..1944edcdb61fe2ec91e448f76286987eb81c4890 100644 --- a/app/code/core/Mage/Customer/view/frontend/account/dashboard/address.phtml +++ b/app/code/core/Mage/Customer/view/frontend/account/dashboard/address.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Customer/view/frontend/account/dashboard/hello.phtml b/app/code/core/Mage/Customer/view/frontend/account/dashboard/hello.phtml index b3241870e8c3d920e6b57bd05ea3c2e3a5a7b612..fc82d91f1275fa1a03f6c66692980fdf87b2b906 100644 --- a/app/code/core/Mage/Customer/view/frontend/account/dashboard/hello.phtml +++ b/app/code/core/Mage/Customer/view/frontend/account/dashboard/hello.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Customer/view/frontend/account/dashboard/info.phtml b/app/code/core/Mage/Customer/view/frontend/account/dashboard/info.phtml index bdf565cf7d9abd7bf20168cb732d54713d6ce305..ea1be57aea7f06fb03e4996a699cf34b8fa6a9ef 100644 --- a/app/code/core/Mage/Customer/view/frontend/account/dashboard/info.phtml +++ b/app/code/core/Mage/Customer/view/frontend/account/dashboard/info.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Customer/view/frontend/account/dashboard/newsletter.phtml b/app/code/core/Mage/Customer/view/frontend/account/dashboard/newsletter.phtml index 09ceb3540eed26f61236771725876f25be9bd1f8..093b2fae3ca1b7b54c0b45fdf97e3a97c49bcf8f 100644 --- a/app/code/core/Mage/Customer/view/frontend/account/dashboard/newsletter.phtml +++ b/app/code/core/Mage/Customer/view/frontend/account/dashboard/newsletter.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Customer/view/frontend/account/link/back.phtml b/app/code/core/Mage/Customer/view/frontend/account/link/back.phtml index c2991b0d8c7e25038f3c7cdf01a72ef6940c99c5..e383466d62f9b62b360654a917f340bdd23e4965 100644 --- a/app/code/core/Mage/Customer/view/frontend/account/link/back.phtml +++ b/app/code/core/Mage/Customer/view/frontend/account/link/back.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Customer/view/frontend/account/navigation.phtml b/app/code/core/Mage/Customer/view/frontend/account/navigation.phtml index 30783df0577e95588d522268ba9533bf189f910a..801afb293331568946e59d8d7da26db50f921df1 100644 --- a/app/code/core/Mage/Customer/view/frontend/account/navigation.phtml +++ b/app/code/core/Mage/Customer/view/frontend/account/navigation.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Customer/view/frontend/address.phtml b/app/code/core/Mage/Customer/view/frontend/address.phtml index 64d4544e1161700b9bd936cfc7e84fe65c51200a..6ea3e9b2851733d13b97fcc772970ce7d3f10bb3 100644 --- a/app/code/core/Mage/Customer/view/frontend/address.phtml +++ b/app/code/core/Mage/Customer/view/frontend/address.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Customer/view/frontend/address/book.phtml b/app/code/core/Mage/Customer/view/frontend/address/book.phtml index db3aaf4e347358d1336a2033b80736c583513565..e7eb477d800c5aa39043e317ff357860f0a00548 100644 --- a/app/code/core/Mage/Customer/view/frontend/address/book.phtml +++ b/app/code/core/Mage/Customer/view/frontend/address/book.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Customer/view/frontend/address/edit.phtml b/app/code/core/Mage/Customer/view/frontend/address/edit.phtml index b767330dbd52173b7de95fb334ea931093539974..9bb383d7048ebec1d0a956bfddac60125e622cc5 100644 --- a/app/code/core/Mage/Customer/view/frontend/address/edit.phtml +++ b/app/code/core/Mage/Customer/view/frontend/address/edit.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -85,6 +85,12 @@ </div> </li> <?php endfor ?> + <li class="wide"> + <label for="vat_id"><?php echo $this->__('VAT Number') ?></label> + <div class="input-box"> + <input type="text" name="vat_id" value="<?php echo $this->escapeHtml($this->getAddress()->getVatId()) ?>" title="<?php echo $this->__('VAT Number') ?>" id="vat_id" class="input-text" /> + </div> + </li> <li class="fields"> <div class="field"> <label for="city" class="required"><em>*</em><?php echo $this->__('City') ?></label> diff --git a/app/code/core/Mage/Customer/view/frontend/balance.phtml b/app/code/core/Mage/Customer/view/frontend/balance.phtml index b26db3dd35334e18e1264f7a54fef10ccf069813..0e7bada0fe73c8cd7c6dbbf699231f8ce9ebc6c9 100644 --- a/app/code/core/Mage/Customer/view/frontend/balance.phtml +++ b/app/code/core/Mage/Customer/view/frontend/balance.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Customer/view/frontend/form/address.phtml b/app/code/core/Mage/Customer/view/frontend/form/address.phtml index 1b082ebd4b0196daada5fe3d98ad7d89c9980047..9207b46cf6d3462e2044a058ae1f39a761a6ee90 100644 --- a/app/code/core/Mage/Customer/view/frontend/form/address.phtml +++ b/app/code/core/Mage/Customer/view/frontend/form/address.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Customer/view/frontend/form/changepassword.phtml b/app/code/core/Mage/Customer/view/frontend/form/changepassword.phtml index 6e12abfa220825e491aa705b9026ee5fc3527008..301cdd60826f9ae1e737a8658206ce4c0f1a5717 100644 --- a/app/code/core/Mage/Customer/view/frontend/form/changepassword.phtml +++ b/app/code/core/Mage/Customer/view/frontend/form/changepassword.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Customer/view/frontend/form/confirmation.phtml b/app/code/core/Mage/Customer/view/frontend/form/confirmation.phtml index 912b7049678b4a117249c8eaf9fb10f1bf36cf49..e66aa956d80710b550d71b3b31c74b1c8c248c5b 100644 --- a/app/code/core/Mage/Customer/view/frontend/form/confirmation.phtml +++ b/app/code/core/Mage/Customer/view/frontend/form/confirmation.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Customer/view/frontend/form/edit.phtml b/app/code/core/Mage/Customer/view/frontend/form/edit.phtml index 05e77cf0ed32c6a7f9e778bce520bb7a54905375..5649e9eda57c106c9a6f3074ac851851a3cde847 100644 --- a/app/code/core/Mage/Customer/view/frontend/form/edit.phtml +++ b/app/code/core/Mage/Customer/view/frontend/form/edit.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Customer/view/frontend/form/forgotpassword.phtml b/app/code/core/Mage/Customer/view/frontend/form/forgotpassword.phtml index a23378f77ca723840c4b76a280a9ac7c3ff48899..3e5257fcc437db6af14177b7e7ae2251ecfa0630 100644 --- a/app/code/core/Mage/Customer/view/frontend/form/forgotpassword.phtml +++ b/app/code/core/Mage/Customer/view/frontend/form/forgotpassword.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -39,6 +39,7 @@ <input type="text" name="email" alt="email" id="email_address" class="input-text required-entry validate-email" value="<?php echo $this->escapeHtml($this->getEmailValue()) ?>" /> </div> </li> + <?php echo $this->getChildHtml('form.additional.info'); ?> </ul> </div> <div class="buttons-set"> diff --git a/app/code/core/Mage/Customer/view/frontend/form/login.phtml b/app/code/core/Mage/Customer/view/frontend/form/login.phtml index 98fe4cbd2057fc74e777bc710876cf450ad11028..551b64438903c667408693aacd63303dbcd63a55 100644 --- a/app/code/core/Mage/Customer/view/frontend/form/login.phtml +++ b/app/code/core/Mage/Customer/view/frontend/form/login.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -61,6 +61,7 @@ <input type="password" name="login[password]" class="input-text required-entry validate-password" id="pass" title="<?php echo $this->__('Password') ?>" /> </div> </li> + <?php echo $this->getChildHtml('form.additional.info'); ?> </ul> <p class="required"><?php echo $this->__('* Required Fields') ?></p> </div> diff --git a/app/code/core/Mage/Customer/view/frontend/form/mini.login.phtml b/app/code/core/Mage/Customer/view/frontend/form/mini.login.phtml index 39bae03899306ad426d6764fb8cc6908f19d6eeb..5669854ba6da4e1ddc2b042c794759143f6750ae 100644 --- a/app/code/core/Mage/Customer/view/frontend/form/mini.login.phtml +++ b/app/code/core/Mage/Customer/view/frontend/form/mini.login.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Customer/view/frontend/form/newsletter.phtml b/app/code/core/Mage/Customer/view/frontend/form/newsletter.phtml index 35f2f8f1646c8ab165ac2bcb16ccfaa2f82d1518..57c419cbf06a013a0014bedbb19023b3f5508513 100644 --- a/app/code/core/Mage/Customer/view/frontend/form/newsletter.phtml +++ b/app/code/core/Mage/Customer/view/frontend/form/newsletter.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Customer/view/frontend/form/register.phtml b/app/code/core/Mage/Customer/view/frontend/form/register.phtml index 962a41f31a7029ebfa096fc69e627788f7076fde..9d5caae53194d622a2d38c7b3419db2a97f6d139 100644 --- a/app/code/core/Mage/Customer/view/frontend/form/register.phtml +++ b/app/code/core/Mage/Customer/view/frontend/form/register.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -164,6 +164,7 @@ </div> </div> </li> + <?php echo $this->getChildHtml('form.additional.info'); ?> </ul> </div> <div class="buttons-set"> diff --git a/app/code/core/Mage/Customer/view/frontend/form/resetforgottenpassword.phtml b/app/code/core/Mage/Customer/view/frontend/form/resetforgottenpassword.phtml index df4b72e7ab52c816f41049c8dedf6f97315ccd78..a33ea0d400988431a5a55df02ef3f79b100f9909 100644 --- a/app/code/core/Mage/Customer/view/frontend/form/resetforgottenpassword.phtml +++ b/app/code/core/Mage/Customer/view/frontend/form/resetforgottenpassword.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Customer/view/frontend/layout.xml b/app/code/core/Mage/Customer/view/frontend/layout.xml index 04941ba9ae99bd9d09e1823f868c2a3158dc515d..c0f902196748db30f14c46b6260f0b4c679ea29a 100644 --- a/app/code/core/Mage/Customer/view/frontend/layout.xml +++ b/app/code/core/Mage/Customer/view/frontend/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ @@ -91,7 +91,7 @@ Layout for customer login page <action method="setTemplate"><template>1column.phtml</template></action> </reference> <reference name="content"> - <block type="Mage_Customer_Block_Form_Login" name="customer_form_login" template="form/login.phtml"/> + <block type="Mage_Customer_Block_Form_Login" name="customer_form_login" template="form/login.phtml" /> </reference> </customer_account_login> @@ -148,7 +148,7 @@ New customer registration <action method="setHeaderTitle" translate="title" module="Mage_Customer"><title>Password forgotten</title></action> </reference> <reference name="content"> - <block type="Mage_Customer_Block_Account_Forgotpassword" name="forgotPassword" template="form/forgotpassword.phtml"/> + <block type="Mage_Customer_Block_Account_Forgotpassword" name="forgotPassword" template="form/forgotpassword.phtml" /> </reference> </customer_account_forgotpassword> @@ -289,4 +289,4 @@ Customer account address edit page </reference> </customer_address_form> -</layout> +</layout> \ No newline at end of file diff --git a/app/code/core/Mage/Customer/view/frontend/logout.phtml b/app/code/core/Mage/Customer/view/frontend/logout.phtml index dfd5495acdee38abc545a83d1bb14a6a26bb15bd..581863ff851fa83ccccf91c3bb9e41b6182ff28e 100644 --- a/app/code/core/Mage/Customer/view/frontend/logout.phtml +++ b/app/code/core/Mage/Customer/view/frontend/logout.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Customer/view/frontend/widget/dob.phtml b/app/code/core/Mage/Customer/view/frontend/widget/dob.phtml index 1838884b5c386083eed4d9022911e951ffd0fadb..05c2f8aeb91e238273206c21a52164deb00f9eba 100644 --- a/app/code/core/Mage/Customer/view/frontend/widget/dob.phtml +++ b/app/code/core/Mage/Customer/view/frontend/widget/dob.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/Customer/view/frontend/widget/gender.phtml b/app/code/core/Mage/Customer/view/frontend/widget/gender.phtml index a39f2e89a155f84aff7daafe937aa22c39f3e5cf..e4195d0deaf6e20c9b311239e0311129ba3c3e1e 100644 --- a/app/code/core/Mage/Customer/view/frontend/widget/gender.phtml +++ b/app/code/core/Mage/Customer/view/frontend/widget/gender.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Customer/view/frontend/widget/name.phtml b/app/code/core/Mage/Customer/view/frontend/widget/name.phtml index d0819505d68a0c9ac47694b969ac52766bb65fbc..3f3ae6272f2b3c0ea7f4fddbd90aae9c1892e177 100644 --- a/app/code/core/Mage/Customer/view/frontend/widget/name.phtml +++ b/app/code/core/Mage/Customer/view/frontend/widget/name.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ @@ -43,7 +43,7 @@ For checkout/onepage/shipping.phtml: ->toHtml() ?> */ /** - * @var Mage_Customer_Block_Widget_Name $this + * @var $this Mage_Customer_Block_Widget_Name */ ?> <div class="<?php echo $this->getContainerClassName()?>"> @@ -70,10 +70,11 @@ For checkout/onepage/shipping.phtml: </div> </div> <?php if ($this->showMiddlename()): ?> +<?php $isMiddlenameRequired = $this->isMiddlenameRequired(); ?> <div class="field name-middlename"> - <label for="<?php echo $this->getFieldId('middlename')?>"><?php echo $this->getStoreLabel('middlename') ?></label> + <label for="<?php echo $this->getFieldId('middlename')?>"<?php echo $isMiddlenameRequired ? ' class="required"' : '' ?>><?php echo $isMiddlenameRequired ? '<em>*</em>' : '' ?><?php echo $this->getStoreLabel('middlename') ?></label> <div class="input-box"> - <input type="text" id="<?php echo $this->getFieldId('middlename')?>" name="<?php echo $this->getFieldName('middlename')?>" value="<?php echo $this->escapeHtml($this->getObject()->getMiddlename()) ?>" title="<?php echo $this->getStoreLabel('middlename') ?>" class="input-text" <?php echo $this->getFieldParams() ?> /> + <input type="text" id="<?php echo $this->getFieldId('middlename')?>" name="<?php echo $this->getFieldName('middlename')?>" value="<?php echo $this->escapeHtml($this->getObject()->getMiddlename()) ?>" title="<?php echo $this->getStoreLabel('middlename') ?>" class="input-text<?php echo $isMiddlenameRequired ? ' required-entry' : '' ?>" <?php echo $this->getFieldParams() ?> /> </div> </div> <?php endif; ?> diff --git a/app/code/core/Mage/Customer/view/frontend/widget/taxvat.phtml b/app/code/core/Mage/Customer/view/frontend/widget/taxvat.phtml index ec326b954418123247702c141857f8239dfdc90f..fd7c5226c49abc4a592d5c1cc16cb3bb540a8357 100644 --- a/app/code/core/Mage/Customer/view/frontend/widget/taxvat.phtml +++ b/app/code/core/Mage/Customer/view/frontend/widget/taxvat.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Dataflow/Helper/Data.php b/app/code/core/Mage/Dataflow/Helper/Data.php index 6b812afa7bb49bdfc8c1d5111e016c4dc248de31..017d1cb9dc96e431609ed1b9aaf9cd22ad5f0b68 100644 --- a/app/code/core/Mage/Dataflow/Helper/Data.php +++ b/app/code/core/Mage/Dataflow/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Batch.php b/app/code/core/Mage/Dataflow/Model/Batch.php index 06e5adebea8f25cef1b7a9275524adb565be6fb4..21f24c671d6f7349dd6bddd91ed4d147c27a3559 100644 --- a/app/code/core/Mage/Dataflow/Model/Batch.php +++ b/app/code/core/Mage/Dataflow/Model/Batch.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Batch/Abstract.php b/app/code/core/Mage/Dataflow/Model/Batch/Abstract.php index ffbc7213986ce4b195fe13bab3e7a7269e635da8..27e928dc0ba31f6bf9e7bc362dde1b4ec0207ce5 100644 --- a/app/code/core/Mage/Dataflow/Model/Batch/Abstract.php +++ b/app/code/core/Mage/Dataflow/Model/Batch/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Batch/Export.php b/app/code/core/Mage/Dataflow/Model/Batch/Export.php index a6d920ff3a90e696f16c3779b03bef0511447771..5b47cec7f44ea34408b0f0a27d24c8bac155785e 100644 --- a/app/code/core/Mage/Dataflow/Model/Batch/Export.php +++ b/app/code/core/Mage/Dataflow/Model/Batch/Export.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Batch/Import.php b/app/code/core/Mage/Dataflow/Model/Batch/Import.php index f781531d7f78e7af2565e53b9f40c37c42363ecf..dcc2eab7e83f93e58211768992e5fa50f3e6d7cc 100644 --- a/app/code/core/Mage/Dataflow/Model/Batch/Import.php +++ b/app/code/core/Mage/Dataflow/Model/Batch/Import.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Batch/Io.php b/app/code/core/Mage/Dataflow/Model/Batch/Io.php index fa8230e16e73e37a5b323bd2fb35c37e5ed2becf..9f4e301f98755938e4c65e2fe63920adbca3d97b 100644 --- a/app/code/core/Mage/Dataflow/Model/Batch/Io.php +++ b/app/code/core/Mage/Dataflow/Model/Batch/Io.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Convert.php b/app/code/core/Mage/Dataflow/Model/Convert.php index 550761878c66ba90284a9f48b5b8c14c95ead503..b698c83c1584a63452e761a8c3816141f60c3a75 100644 --- a/app/code/core/Mage/Dataflow/Model/Convert.php +++ b/app/code/core/Mage/Dataflow/Model/Convert.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Convert/Action.php b/app/code/core/Mage/Dataflow/Model/Convert/Action.php index 716261f6253c75106f4aba817351a255ae35eb7a..036b33b749f87a5791fb2592698c90ce1fce5281 100644 --- a/app/code/core/Mage/Dataflow/Model/Convert/Action.php +++ b/app/code/core/Mage/Dataflow/Model/Convert/Action.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Convert/Action/Abstract.php b/app/code/core/Mage/Dataflow/Model/Convert/Action/Abstract.php index 794a9c303b7aad9206eaf4fb20bca0019f18a663..4a226296c74b49f50774461ccf18b8ad9bde5a48 100644 --- a/app/code/core/Mage/Dataflow/Model/Convert/Action/Abstract.php +++ b/app/code/core/Mage/Dataflow/Model/Convert/Action/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Convert/Action/Interface.php b/app/code/core/Mage/Dataflow/Model/Convert/Action/Interface.php index 7be7af332487ea2458c4b3d8aaabcd7020f59bb7..c0c4b39eff6737845abb6d319aa77d14a6a09065 100644 --- a/app/code/core/Mage/Dataflow/Model/Convert/Action/Interface.php +++ b/app/code/core/Mage/Dataflow/Model/Convert/Action/Interface.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Convert/Adapter/Abstract.php b/app/code/core/Mage/Dataflow/Model/Convert/Adapter/Abstract.php index 09ef1bd5c4702e292fe7188988ab0b51b3168041..22cf1f3bab096043ab101fd90d1f785aa26bd881 100644 --- a/app/code/core/Mage/Dataflow/Model/Convert/Adapter/Abstract.php +++ b/app/code/core/Mage/Dataflow/Model/Convert/Adapter/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Convert/Adapter/Db/Table.php b/app/code/core/Mage/Dataflow/Model/Convert/Adapter/Db/Table.php index 24e8730f8045d43f43623ca3ab94da43ea061d86..8d9e0d0fcd278ef8d49bf011d8ab48a6fde74dec 100644 --- a/app/code/core/Mage/Dataflow/Model/Convert/Adapter/Db/Table.php +++ b/app/code/core/Mage/Dataflow/Model/Convert/Adapter/Db/Table.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Convert/Adapter/Http.php b/app/code/core/Mage/Dataflow/Model/Convert/Adapter/Http.php index 395b34bcf8ea0d66604943a19a07c03172fb8f2c..2fea77ca193078fa79c2ceb2c982d254db97705a 100644 --- a/app/code/core/Mage/Dataflow/Model/Convert/Adapter/Http.php +++ b/app/code/core/Mage/Dataflow/Model/Convert/Adapter/Http.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Convert/Adapter/Http/Curl.php b/app/code/core/Mage/Dataflow/Model/Convert/Adapter/Http/Curl.php index a9475f2efc908051217c362c85ba1f819d0da43d..1a82e42b991063e57b0aea661b079c93d2a11106 100644 --- a/app/code/core/Mage/Dataflow/Model/Convert/Adapter/Http/Curl.php +++ b/app/code/core/Mage/Dataflow/Model/Convert/Adapter/Http/Curl.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Convert/Adapter/Interface.php b/app/code/core/Mage/Dataflow/Model/Convert/Adapter/Interface.php index d1882f3731b8587722b3e9f537f7f089fff52b65..ca19b665c170115e4e34ef1dd16070905e40f376 100644 --- a/app/code/core/Mage/Dataflow/Model/Convert/Adapter/Interface.php +++ b/app/code/core/Mage/Dataflow/Model/Convert/Adapter/Interface.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Convert/Adapter/Io.php b/app/code/core/Mage/Dataflow/Model/Convert/Adapter/Io.php index b2390c1cecd6ea7eedc5f181f933f7b0b075d6b1..cf2c71ebb1bfca0aefadedb15ad5028a72e21e4a 100644 --- a/app/code/core/Mage/Dataflow/Model/Convert/Adapter/Io.php +++ b/app/code/core/Mage/Dataflow/Model/Convert/Adapter/Io.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Convert/Adapter/Soap.php b/app/code/core/Mage/Dataflow/Model/Convert/Adapter/Soap.php index b214f41f2e60b586f24619cb394cc992d08dc5d4..5f03a703e89db2633ae281caa3203128251e1d5e 100644 --- a/app/code/core/Mage/Dataflow/Model/Convert/Adapter/Soap.php +++ b/app/code/core/Mage/Dataflow/Model/Convert/Adapter/Soap.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Convert/Adapter/Std.php b/app/code/core/Mage/Dataflow/Model/Convert/Adapter/Std.php index cc1932786d9e4b0d3fd7a72740298cc904dfb889..a868afb4ad2e38a33cd33ca2a6b25c64a44af6cb 100644 --- a/app/code/core/Mage/Dataflow/Model/Convert/Adapter/Std.php +++ b/app/code/core/Mage/Dataflow/Model/Convert/Adapter/Std.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Convert/Adapter/Zend/Cache.php b/app/code/core/Mage/Dataflow/Model/Convert/Adapter/Zend/Cache.php index aba25aa978663a22c4242698e652af39d12e474f..957af7b15c1764d6a037ea30162b65d609ec8df6 100644 --- a/app/code/core/Mage/Dataflow/Model/Convert/Adapter/Zend/Cache.php +++ b/app/code/core/Mage/Dataflow/Model/Convert/Adapter/Zend/Cache.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Convert/Adapter/Zend/Db.php b/app/code/core/Mage/Dataflow/Model/Convert/Adapter/Zend/Db.php index 1e69f8ce66d1ed45bf80ecda43ded7495f9ab677..316cdf4d06fc1b222c91a8e8d759c3bd303178d8 100644 --- a/app/code/core/Mage/Dataflow/Model/Convert/Adapter/Zend/Db.php +++ b/app/code/core/Mage/Dataflow/Model/Convert/Adapter/Zend/Db.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Convert/Container/Abstract.php b/app/code/core/Mage/Dataflow/Model/Convert/Container/Abstract.php index 2b7c454d3d0fb5561670b4ac30dc020ba04f503d..39bf5b26314634dc385076afd514948f2f5f9913 100644 --- a/app/code/core/Mage/Dataflow/Model/Convert/Container/Abstract.php +++ b/app/code/core/Mage/Dataflow/Model/Convert/Container/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Convert/Container/Collection.php b/app/code/core/Mage/Dataflow/Model/Convert/Container/Collection.php index e1c8f41bde02df499e28d89192504cc2fe64719d..74b783f0dc0ddef8d96e1f8fc427a9f3ccac22f9 100644 --- a/app/code/core/Mage/Dataflow/Model/Convert/Container/Collection.php +++ b/app/code/core/Mage/Dataflow/Model/Convert/Container/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Convert/Container/Generic.php b/app/code/core/Mage/Dataflow/Model/Convert/Container/Generic.php index 1b3ff6432ca9b79ce54b289edd85a5afc1f3618a..f54f98438a61784849e85a82ee7bbeeb94a8e3d3 100644 --- a/app/code/core/Mage/Dataflow/Model/Convert/Container/Generic.php +++ b/app/code/core/Mage/Dataflow/Model/Convert/Container/Generic.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Convert/Container/Interface.php b/app/code/core/Mage/Dataflow/Model/Convert/Container/Interface.php index c395b5ed02711bd860993e572b5d1742c0c081ef..10d45a8589c72952556c4c15e7adb345c66b5e1e 100644 --- a/app/code/core/Mage/Dataflow/Model/Convert/Container/Interface.php +++ b/app/code/core/Mage/Dataflow/Model/Convert/Container/Interface.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Convert/Exception.php b/app/code/core/Mage/Dataflow/Model/Convert/Exception.php index b2307a6b7f77a7a711ff8fc500086b1fc96aef66..0d4b0b9a989f5dc89b8be4adc431a7fcfb019842 100644 --- a/app/code/core/Mage/Dataflow/Model/Convert/Exception.php +++ b/app/code/core/Mage/Dataflow/Model/Convert/Exception.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Convert/Iterator/Interface.php b/app/code/core/Mage/Dataflow/Model/Convert/Iterator/Interface.php index f8e68a7e0e70f4f1ae2067aee5b1bfd945dd8a03..2fd0e1b21d2f55994724f9d51429b7d05a4abd3b 100644 --- a/app/code/core/Mage/Dataflow/Model/Convert/Iterator/Interface.php +++ b/app/code/core/Mage/Dataflow/Model/Convert/Iterator/Interface.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Convert/Mapper/Abstract.php b/app/code/core/Mage/Dataflow/Model/Convert/Mapper/Abstract.php index a85df3906aa7d14f789348fe8be0b2fa707957ff..93c1e29ca609fe8b568bd381682ffd055e63cf8d 100644 --- a/app/code/core/Mage/Dataflow/Model/Convert/Mapper/Abstract.php +++ b/app/code/core/Mage/Dataflow/Model/Convert/Mapper/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Convert/Mapper/Column.php b/app/code/core/Mage/Dataflow/Model/Convert/Mapper/Column.php index 62ef5e89ccadf4953fb0c3d3ea1d2d62e24ef679..7e82e9923e767a4d9a54823b338878b05be1bef5 100644 --- a/app/code/core/Mage/Dataflow/Model/Convert/Mapper/Column.php +++ b/app/code/core/Mage/Dataflow/Model/Convert/Mapper/Column.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Convert/Mapper/Interface.php b/app/code/core/Mage/Dataflow/Model/Convert/Mapper/Interface.php index 74429e292315c4c4359a79f5536505f042a9105f..d768a329573e590f3ca101ac2260b5a74a051631 100644 --- a/app/code/core/Mage/Dataflow/Model/Convert/Mapper/Interface.php +++ b/app/code/core/Mage/Dataflow/Model/Convert/Mapper/Interface.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Convert/Parser/Abstract.php b/app/code/core/Mage/Dataflow/Model/Convert/Parser/Abstract.php index 7a77614db8e5cde9237515e4077ad162acc8202d..d8fcf577bbf6b949e19f6998c359ceb8dacf953c 100644 --- a/app/code/core/Mage/Dataflow/Model/Convert/Parser/Abstract.php +++ b/app/code/core/Mage/Dataflow/Model/Convert/Parser/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Convert/Parser/Csv.php b/app/code/core/Mage/Dataflow/Model/Convert/Parser/Csv.php index add1038970669c8690e90a112121d77efa81d35d..620d516d409f9614b8afdb228d983daab559a7cf 100644 --- a/app/code/core/Mage/Dataflow/Model/Convert/Parser/Csv.php +++ b/app/code/core/Mage/Dataflow/Model/Convert/Parser/Csv.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Convert/Parser/Interface.php b/app/code/core/Mage/Dataflow/Model/Convert/Parser/Interface.php index 506718692f87155d8b96deb94406eaca68cca965..03614ec13f96d105fcfb2d215edc4f398fe99434 100644 --- a/app/code/core/Mage/Dataflow/Model/Convert/Parser/Interface.php +++ b/app/code/core/Mage/Dataflow/Model/Convert/Parser/Interface.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Convert/Parser/Serialize.php b/app/code/core/Mage/Dataflow/Model/Convert/Parser/Serialize.php index 76abced338ad8062406d43c081605dc595c515dc..bec6768591ecb5fd1b8ffd0c5481bf9198ed91be 100644 --- a/app/code/core/Mage/Dataflow/Model/Convert/Parser/Serialize.php +++ b/app/code/core/Mage/Dataflow/Model/Convert/Parser/Serialize.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Convert/Parser/Xml/Excel.php b/app/code/core/Mage/Dataflow/Model/Convert/Parser/Xml/Excel.php index a2797312c8d9de283d22ffadcc7535ca3f5ce54c..476335c51a2482308cb323177a485b693d245b92 100644 --- a/app/code/core/Mage/Dataflow/Model/Convert/Parser/Xml/Excel.php +++ b/app/code/core/Mage/Dataflow/Model/Convert/Parser/Xml/Excel.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Convert/Profile.php b/app/code/core/Mage/Dataflow/Model/Convert/Profile.php index 03339b35660386654ebb6a71fcfc3eac52cd78a3..3cb78c2296238afd65ac77ef8338caeeeb6d4892 100644 --- a/app/code/core/Mage/Dataflow/Model/Convert/Profile.php +++ b/app/code/core/Mage/Dataflow/Model/Convert/Profile.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Convert/Profile/Abstract.php b/app/code/core/Mage/Dataflow/Model/Convert/Profile/Abstract.php index ad99effbc1aee141411739c1c9cbe5b0fdc52433..ee11a250ef9cf8673a7d608e0f7c0d1312f866eb 100644 --- a/app/code/core/Mage/Dataflow/Model/Convert/Profile/Abstract.php +++ b/app/code/core/Mage/Dataflow/Model/Convert/Profile/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Convert/Profile/Collection.php b/app/code/core/Mage/Dataflow/Model/Convert/Profile/Collection.php index a59c4dbb9819735cf54cd65a44402e9cfe034378..cb9a605ea09bdd96b56819a0d5dae1b0c20e3ab6 100644 --- a/app/code/core/Mage/Dataflow/Model/Convert/Profile/Collection.php +++ b/app/code/core/Mage/Dataflow/Model/Convert/Profile/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Convert/Profile/Interface.php b/app/code/core/Mage/Dataflow/Model/Convert/Profile/Interface.php index 6eccbc2cfa5998c8be49ba3566dbadb9b43886f5..5f1960b4f5a0135d40d0b162e6e3188eee5f2d62 100644 --- a/app/code/core/Mage/Dataflow/Model/Convert/Profile/Interface.php +++ b/app/code/core/Mage/Dataflow/Model/Convert/Profile/Interface.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Convert/Validator/Abstract.php b/app/code/core/Mage/Dataflow/Model/Convert/Validator/Abstract.php index 19075d59d26ab8847ee79d7da6fc1ac3825b2cb3..5ff5596ec593925d2449b5ffeeeb7ae3b34899c1 100644 --- a/app/code/core/Mage/Dataflow/Model/Convert/Validator/Abstract.php +++ b/app/code/core/Mage/Dataflow/Model/Convert/Validator/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Convert/Validator/Column.php b/app/code/core/Mage/Dataflow/Model/Convert/Validator/Column.php index 8ae9b7aba7ce6bd5f99ca6769ddd070b9d18a144..d4f38c9ea456ecb20542edd7841c1d4a77b6f157 100644 --- a/app/code/core/Mage/Dataflow/Model/Convert/Validator/Column.php +++ b/app/code/core/Mage/Dataflow/Model/Convert/Validator/Column.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Convert/Validator/Dryrun.php b/app/code/core/Mage/Dataflow/Model/Convert/Validator/Dryrun.php index 0d34687a944c9d66b2ba3bcd8c307d2d06c3e1b0..fca6194d91d8661bd958a033a29222f3d653dc19 100644 --- a/app/code/core/Mage/Dataflow/Model/Convert/Validator/Dryrun.php +++ b/app/code/core/Mage/Dataflow/Model/Convert/Validator/Dryrun.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Convert/Validator/Interface.php b/app/code/core/Mage/Dataflow/Model/Convert/Validator/Interface.php index 30fb32f1af1201b9223f2eb278b5461913b99541..5b054ee4265853e42db94161c6162729018ce4fb 100644 --- a/app/code/core/Mage/Dataflow/Model/Convert/Validator/Interface.php +++ b/app/code/core/Mage/Dataflow/Model/Convert/Validator/Interface.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Import.php b/app/code/core/Mage/Dataflow/Model/Import.php index d4a794d5a3a43895f0302f491aff439c8247377e..e598eeb1dac5e6b7a780b9586046cae10c148e5d 100644 --- a/app/code/core/Mage/Dataflow/Model/Import.php +++ b/app/code/core/Mage/Dataflow/Model/Import.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Profile.php b/app/code/core/Mage/Dataflow/Model/Profile.php index 3308cdac23d7dab55c369d3740181e9f8afe31ac..cd6881fca66fa41ae1eacd03b5f563c1f1c04e1d 100644 --- a/app/code/core/Mage/Dataflow/Model/Profile.php +++ b/app/code/core/Mage/Dataflow/Model/Profile.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -80,7 +80,7 @@ class Mage_Dataflow_Model_Profile extends Mage_Core_Model_Abstract $actionsXML = $this->getData('actions_xml'); if (strlen($actionsXML) < 0 && @simplexml_load_string('<data>' . $actionsXML . '</data>', null, LIBXML_NOERROR) === false) { - Mage::throwException(Mage::helper("Mage_Dataflow_Helper_Data")->__("Actions XML is not valid.")); + Mage::throwException(Mage::helper('Mage_Dataflow_Helper_Data')->__("Actions XML is not valid.")); } if (is_array($this->getGuiData())) { @@ -120,7 +120,7 @@ class Mage_Dataflow_Model_Profile extends Mage_Core_Model_Abstract } if ($this->_getResource()->isProfileExists($this->getName(), $this->getId())) { - Mage::throwException(Mage::helper("Mage_Dataflow_Helper_Data")->__("Profile with the same name already exists.")); + Mage::throwException(Mage::helper('Mage_Dataflow_Helper_Data')->__("Profile with the same name already exists.")); } } @@ -421,4 +421,4 @@ echo "<xmp>" . $xml . "</xmp>"; die;*/ return $this; } -} +} \ No newline at end of file diff --git a/app/code/core/Mage/Dataflow/Model/Profile/History.php b/app/code/core/Mage/Dataflow/Model/Profile/History.php index d5fdc4d575633edb995b8f3ce31b0ffe341993d1..23ae325983eaca172fab68506a487400817ab15c 100644 --- a/app/code/core/Mage/Dataflow/Model/Profile/History.php +++ b/app/code/core/Mage/Dataflow/Model/Profile/History.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Resource/Batch.php b/app/code/core/Mage/Dataflow/Model/Resource/Batch.php index bb2495453925f7e2a8656cc8019b017390b409ae..572f2a30d8631410e61a24aad67f26c9ce62ba95 100755 --- a/app/code/core/Mage/Dataflow/Model/Resource/Batch.php +++ b/app/code/core/Mage/Dataflow/Model/Resource/Batch.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Resource/Batch/Abstract.php b/app/code/core/Mage/Dataflow/Model/Resource/Batch/Abstract.php index c65b9be3614d38fb5889bef6490805ab3b59c27f..e9a9055a02bd2b7bb9fa69ff4e43fbb70686a14c 100755 --- a/app/code/core/Mage/Dataflow/Model/Resource/Batch/Abstract.php +++ b/app/code/core/Mage/Dataflow/Model/Resource/Batch/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Resource/Batch/Collection.php b/app/code/core/Mage/Dataflow/Model/Resource/Batch/Collection.php index b80c6730314e75cdc09f8f045da1f3886fbaf34a..04a6f73a79688e081e783990f7a7c4cd3518753d 100755 --- a/app/code/core/Mage/Dataflow/Model/Resource/Batch/Collection.php +++ b/app/code/core/Mage/Dataflow/Model/Resource/Batch/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Resource/Batch/Export.php b/app/code/core/Mage/Dataflow/Model/Resource/Batch/Export.php index 7c0176a28cea3d190bf9435c8bff7e64a49dd338..24da65f0b0f2c10b669d5db2726305e147df8dbf 100755 --- a/app/code/core/Mage/Dataflow/Model/Resource/Batch/Export.php +++ b/app/code/core/Mage/Dataflow/Model/Resource/Batch/Export.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Resource/Batch/Import.php b/app/code/core/Mage/Dataflow/Model/Resource/Batch/Import.php index 549292d213c2060c2959f54ea7770166be3d0dd4..1148bf710436933d6c53adee63d4fd2357733dc7 100755 --- a/app/code/core/Mage/Dataflow/Model/Resource/Batch/Import.php +++ b/app/code/core/Mage/Dataflow/Model/Resource/Batch/Import.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Resource/Import.php b/app/code/core/Mage/Dataflow/Model/Resource/Import.php index abf21f2f62d3e8f63d32956bdec1f71c5605238b..6ccdf497a08a55a4c524cd2f684af59fccc02bed 100755 --- a/app/code/core/Mage/Dataflow/Model/Resource/Import.php +++ b/app/code/core/Mage/Dataflow/Model/Resource/Import.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Resource/Import/Collection.php b/app/code/core/Mage/Dataflow/Model/Resource/Import/Collection.php index c591471938acef30e86485b636dee8b75cce4365..8c036c7f45e3c1921b7564099712f21d08fee662 100755 --- a/app/code/core/Mage/Dataflow/Model/Resource/Import/Collection.php +++ b/app/code/core/Mage/Dataflow/Model/Resource/Import/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Resource/Profile.php b/app/code/core/Mage/Dataflow/Model/Resource/Profile.php index 0ad3bdb5c75aa5286b2652801891e036463a4400..43f2d55db31c865808812c033ca91849043bc6ca 100755 --- a/app/code/core/Mage/Dataflow/Model/Resource/Profile.php +++ b/app/code/core/Mage/Dataflow/Model/Resource/Profile.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Resource/Profile/Collection.php b/app/code/core/Mage/Dataflow/Model/Resource/Profile/Collection.php index 158b87e0325832bc3fe217906bf17878b9fe7498..35672f632b23d679397ded24c1a872c6cb6b9990 100755 --- a/app/code/core/Mage/Dataflow/Model/Resource/Profile/Collection.php +++ b/app/code/core/Mage/Dataflow/Model/Resource/Profile/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Resource/Profile/History.php b/app/code/core/Mage/Dataflow/Model/Resource/Profile/History.php index fba1769928c762f1e2b0f8ca91b9499f06fac907..670fa7ec9691b494159f7e9d209b5ca9fa5936fa 100755 --- a/app/code/core/Mage/Dataflow/Model/Resource/Profile/History.php +++ b/app/code/core/Mage/Dataflow/Model/Resource/Profile/History.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Resource/Profile/History/Collection.php b/app/code/core/Mage/Dataflow/Model/Resource/Profile/History/Collection.php index 9ab0d8249c2efc77320a38daa7f7976fc2f227d0..5cee5feb1bbbebf40b6973a94df5c67869e78ca5 100755 --- a/app/code/core/Mage/Dataflow/Model/Resource/Profile/History/Collection.php +++ b/app/code/core/Mage/Dataflow/Model/Resource/Profile/History/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Resource/Session.php b/app/code/core/Mage/Dataflow/Model/Resource/Session.php index a47e3cc563e4f8d13c93b47f0bf259696e47e628..2de657574f2e162c97f42a4032af434d5f5242a4 100755 --- a/app/code/core/Mage/Dataflow/Model/Resource/Session.php +++ b/app/code/core/Mage/Dataflow/Model/Resource/Session.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Session.php b/app/code/core/Mage/Dataflow/Model/Session.php index d7bb3869fe0bedd83ac94c3e24e306c61b893c2a..c474189c8725a275c9b4a3917aaf2e48125da947 100644 --- a/app/code/core/Mage/Dataflow/Model/Session.php +++ b/app/code/core/Mage/Dataflow/Model/Session.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/Model/Session/Parser/Csv.php b/app/code/core/Mage/Dataflow/Model/Session/Parser/Csv.php index f8a2d23d8f809e7586d92ae45ec4f79a8cbd1173..8de19fe5d4926744f988496cd74b4625dd7d1d32 100644 --- a/app/code/core/Mage/Dataflow/Model/Session/Parser/Csv.php +++ b/app/code/core/Mage/Dataflow/Model/Session/Parser/Csv.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/data/dataflow_setup/data-install-1.6.0.0.php b/app/code/core/Mage/Dataflow/data/dataflow_setup/data-install-1.6.0.0.php index 8432bcd1c7bdcf233fd8e716ae5a7316baad1a22..ec2dc7a84f1c6dbd873c72674d71906c8492c969 100644 --- a/app/code/core/Mage/Dataflow/data/dataflow_setup/data-install-1.6.0.0.php +++ b/app/code/core/Mage/Dataflow/data/dataflow_setup/data-install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Dataflow/etc/config.xml b/app/code/core/Mage/Dataflow/etc/config.xml index caf51f856de442eee9b4dc98e13654666b2031e1..3b2c732cfc857cf31ea39367864aed0e260eb502 100644 --- a/app/code/core/Mage/Dataflow/etc/config.xml +++ b/app/code/core/Mage/Dataflow/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Dataflow/sql/dataflow_setup/install-1.6.0.0.php b/app/code/core/Mage/Dataflow/sql/dataflow_setup/install-1.6.0.0.php index b94315b5ccc5cf5b9ff0678696f30a807ccbceb0..a6e3c9d22f8218d99389763e4134575394a3630b 100644 --- a/app/code/core/Mage/Dataflow/sql/dataflow_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/Dataflow/sql/dataflow_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Dataflow - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Directory/Block/Adminhtml/Frontend/Currency/Base.php b/app/code/core/Mage/Directory/Block/Adminhtml/Frontend/Currency/Base.php index ce2acb57a4ef96e29071f4f79d8bfd2533a766b4..204004028347b41700cc7a6e3beba314908ace07 100644 --- a/app/code/core/Mage/Directory/Block/Adminhtml/Frontend/Currency/Base.php +++ b/app/code/core/Mage/Directory/Block/Adminhtml/Frontend/Currency/Base.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Directory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Directory/Block/Adminhtml/Frontend/Region/Updater.php b/app/code/core/Mage/Directory/Block/Adminhtml/Frontend/Region/Updater.php index 2cb7e82b0179861422aa4d3087400bf35ad5b4fb..adbf5b5e77ffd76aaeb7018857148a85d26db709 100644 --- a/app/code/core/Mage/Directory/Block/Adminhtml/Frontend/Region/Updater.php +++ b/app/code/core/Mage/Directory/Block/Adminhtml/Frontend/Region/Updater.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Directory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Directory/Block/Currency.php b/app/code/core/Mage/Directory/Block/Currency.php index 55e97c143f268a1addaaf3f8b95cb1786c29fdb8..77abc85f527cd9cc9a5203528c16cea9c4bdf684 100644 --- a/app/code/core/Mage/Directory/Block/Currency.php +++ b/app/code/core/Mage/Directory/Block/Currency.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Directory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Directory/Block/Data.php b/app/code/core/Mage/Directory/Block/Data.php index e87c57181a31d2809001af018b10d37a3e410a95..b7af654372cfbdba551c75bfdbf3b47b784fa780 100644 --- a/app/code/core/Mage/Directory/Block/Data.php +++ b/app/code/core/Mage/Directory/Block/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Directory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Directory/Exception.php b/app/code/core/Mage/Directory/Exception.php index a3c0c6041a4cc790612281fd899859a4803d9b83..abf8a46b1736f7833d94447d07379facabb25f37 100644 --- a/app/code/core/Mage/Directory/Exception.php +++ b/app/code/core/Mage/Directory/Exception.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Directory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Directory/Helper/Data.php b/app/code/core/Mage/Directory/Helper/Data.php index 1e1d91ce71a43a4260a5c7253ca412e236ca7ef3..bde0ab462c885ae1b9a1d50bb2693189d19d5999 100644 --- a/app/code/core/Mage/Directory/Helper/Data.php +++ b/app/code/core/Mage/Directory/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Directory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Directory/Helper/Url.php b/app/code/core/Mage/Directory/Helper/Url.php index f96074d16f22358cb4cb0e3b93e278c422dda226..b1f2f1fcc8e408d93089854499667ab652c736bc 100644 --- a/app/code/core/Mage/Directory/Helper/Url.php +++ b/app/code/core/Mage/Directory/Helper/Url.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Directory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Directory/Model/Country.php b/app/code/core/Mage/Directory/Model/Country.php index ae84d5a1bf4a20c98584b70e8b76374e205232a9..612d267df72d2cdef05b652f08926b0dfa262078 100644 --- a/app/code/core/Mage/Directory/Model/Country.php +++ b/app/code/core/Mage/Directory/Model/Country.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Directory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Directory/Model/Country/Api.php b/app/code/core/Mage/Directory/Model/Country/Api.php index 9d70167ace59e15ba7f9a1c4009d3e919c213746..c08b0850dfa7317d822e84cf970be912198e4d56 100644 --- a/app/code/core/Mage/Directory/Model/Country/Api.php +++ b/app/code/core/Mage/Directory/Model/Country/Api.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Directory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Directory/Model/Country/Api/V2.php b/app/code/core/Mage/Directory/Model/Country/Api/V2.php index 1b24dfd16b2db5027c9ce730e2bbd96cc2f79e8d..4723d03b3e66f6810afe74c469cd964560c9a818 100644 --- a/app/code/core/Mage/Directory/Model/Country/Api/V2.php +++ b/app/code/core/Mage/Directory/Model/Country/Api/V2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Directory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Directory/Model/Country/Format.php b/app/code/core/Mage/Directory/Model/Country/Format.php index 8740906f8d0eec5d8ac8351ddbf8c3a9623ec5ef..abcf6bcd1651281da1fcbdec22af0723f7a73907 100644 --- a/app/code/core/Mage/Directory/Model/Country/Format.php +++ b/app/code/core/Mage/Directory/Model/Country/Format.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Directory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Directory/Model/Currency.php b/app/code/core/Mage/Directory/Model/Currency.php index ee8bfc0ab858fd70ce4bc18ac6650378e24191dd..a27a45712cf07210eee1296ff168f69f5fd29798 100644 --- a/app/code/core/Mage/Directory/Model/Currency.php +++ b/app/code/core/Mage/Directory/Model/Currency.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Directory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Directory/Model/Currency/Filter.php b/app/code/core/Mage/Directory/Model/Currency/Filter.php index 9a69a520f6f1dfc212db4aa5b61e7558aa7c1e83..ba92435ab87b550fe7cece1ba198bb7a5f8c7504 100644 --- a/app/code/core/Mage/Directory/Model/Currency/Filter.php +++ b/app/code/core/Mage/Directory/Model/Currency/Filter.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Directory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Directory/Model/Currency/Import/Abstract.php b/app/code/core/Mage/Directory/Model/Currency/Import/Abstract.php index 0e5f9ef0a0e25e20ea34eccec18b7e9407d6191e..8a7f3176d112b2c4cf14f1989ea78c721f0f7e45 100644 --- a/app/code/core/Mage/Directory/Model/Currency/Import/Abstract.php +++ b/app/code/core/Mage/Directory/Model/Currency/Import/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Directory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Directory/Model/Currency/Import/Webservicex.php b/app/code/core/Mage/Directory/Model/Currency/Import/Webservicex.php index 52f9eb580f5eb42a6ac599dd56184c2c25589e16..de14f2c515d3e9bd260621999ed0ff7629214a53 100644 --- a/app/code/core/Mage/Directory/Model/Currency/Import/Webservicex.php +++ b/app/code/core/Mage/Directory/Model/Currency/Import/Webservicex.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Directory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Directory/Model/Observer.php b/app/code/core/Mage/Directory/Model/Observer.php index 08eb4d1e7d5ac5bba83829967c96d54581c6e246..eec432a18e45a05fcd8237d2a544f3c09e95858d 100644 --- a/app/code/core/Mage/Directory/Model/Observer.php +++ b/app/code/core/Mage/Directory/Model/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Directory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Directory/Model/Region.php b/app/code/core/Mage/Directory/Model/Region.php index 8d9ac90daa09d7d674e69be450ef6e2954336c6a..96da1d434ff9527380d776e886e9dbd4259b10f9 100644 --- a/app/code/core/Mage/Directory/Model/Region.php +++ b/app/code/core/Mage/Directory/Model/Region.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Directory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Directory/Model/Region/Api.php b/app/code/core/Mage/Directory/Model/Region/Api.php index 70bcc5b5bbbf969f33f1e0003a7f5f3ea716ee94..747e49e82c6a4c5d3e005435d8de5e058625ddfe 100644 --- a/app/code/core/Mage/Directory/Model/Region/Api.php +++ b/app/code/core/Mage/Directory/Model/Region/Api.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Directory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Directory/Model/Region/Api/V2.php b/app/code/core/Mage/Directory/Model/Region/Api/V2.php index a6dae41a97082b25325f0d8abd5bb4a7ea7d4002..2a87944578e1c2d6282b2aff106b2709e1f3b957 100644 --- a/app/code/core/Mage/Directory/Model/Region/Api/V2.php +++ b/app/code/core/Mage/Directory/Model/Region/Api/V2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Directory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Directory/Model/Resource/Country.php b/app/code/core/Mage/Directory/Model/Resource/Country.php index b703ddb6e092e428ddcb502c10fec271a0ef0b18..5c3f79638edc8e4b9b9b82fbc41c7d22dc67ee0e 100755 --- a/app/code/core/Mage/Directory/Model/Resource/Country.php +++ b/app/code/core/Mage/Directory/Model/Resource/Country.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Directory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Directory/Model/Resource/Country/Collection.php b/app/code/core/Mage/Directory/Model/Resource/Country/Collection.php index 55f7f1573936f54ebd585cf5d85b649301ffcf85..961b12aef911f596adf9671e1f4ab5b91f94f90e 100755 --- a/app/code/core/Mage/Directory/Model/Resource/Country/Collection.php +++ b/app/code/core/Mage/Directory/Model/Resource/Country/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Directory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Directory/Model/Resource/Country/Format.php b/app/code/core/Mage/Directory/Model/Resource/Country/Format.php index 5c4efb52e59c3d72aaba24afdb82155a9b2d5889..347fd054d19818ba6df4171bea0f8e2ec9001a44 100755 --- a/app/code/core/Mage/Directory/Model/Resource/Country/Format.php +++ b/app/code/core/Mage/Directory/Model/Resource/Country/Format.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Directory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Directory/Model/Resource/Country/Format/Collection.php b/app/code/core/Mage/Directory/Model/Resource/Country/Format/Collection.php index 5a137eb3aa6606fd928e097ced907107f73d5193..a85a0e5dd10392ea098cefeb654627a0f70b1367 100755 --- a/app/code/core/Mage/Directory/Model/Resource/Country/Format/Collection.php +++ b/app/code/core/Mage/Directory/Model/Resource/Country/Format/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Directory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Directory/Model/Resource/Currency.php b/app/code/core/Mage/Directory/Model/Resource/Currency.php index 2454a814eab01fcd6c71a25078805652e96b4d87..277bd744e8eea0669017c68cc5bc923b77d423c4 100755 --- a/app/code/core/Mage/Directory/Model/Resource/Currency.php +++ b/app/code/core/Mage/Directory/Model/Resource/Currency.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Directory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Directory/Model/Resource/Region.php b/app/code/core/Mage/Directory/Model/Resource/Region.php index 96213226659cde402b2b2feb7c43f0032c08a7e0..6a25c65ff1e235a4458e88236ec712935cfef381 100755 --- a/app/code/core/Mage/Directory/Model/Resource/Region.php +++ b/app/code/core/Mage/Directory/Model/Resource/Region.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Directory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Directory/Model/Resource/Region/Collection.php b/app/code/core/Mage/Directory/Model/Resource/Region/Collection.php index 1165bb95f00829b4adbd1c2af0ff8d05db753e00..a4c06dcdff5b601efc3138c2ed03ad7346cc5064 100755 --- a/app/code/core/Mage/Directory/Model/Resource/Region/Collection.php +++ b/app/code/core/Mage/Directory/Model/Resource/Region/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Directory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -58,6 +58,9 @@ class Mage_Directory_Model_Resource_Region_Collection extends Mage_Core_Model_Re $this->_countryTable = $this->getTable('directory_country'); $this->_regionNameTable = $this->getTable('directory_country_region_name'); + + $this->addOrder('name', Varien_Data_Collection::SORT_ORDER_ASC); + $this->addOrder('default_name', Varien_Data_Collection::SORT_ORDER_ASC); } /** diff --git a/app/code/core/Mage/Directory/controllers/CurrencyController.php b/app/code/core/Mage/Directory/controllers/CurrencyController.php index 47c05da21793bbbdbe363255e8fc3966274ee841..9b877ed40653c10af2681a02aea499714bae090f 100644 --- a/app/code/core/Mage/Directory/controllers/CurrencyController.php +++ b/app/code/core/Mage/Directory/controllers/CurrencyController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Directory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Directory/data/directory_setup/data-install-1.6.0.0.php b/app/code/core/Mage/Directory/data/directory_setup/data-install-1.6.0.0.php index a7e86071e7d1caa339b04e049ccc4e21a7adc402..da97929c75d3d70ec2529c1819a18c1436de48c2 100644 --- a/app/code/core/Mage/Directory/data/directory_setup/data-install-1.6.0.0.php +++ b/app/code/core/Mage/Directory/data/directory_setup/data-install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Directory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Directory/etc/api.xml b/app/code/core/Mage/Directory/etc/api.xml index 6bfc7df02a4b9f8e1ac493353b9f93093dc3d072..98c6b2ef1da3937c6c2622866afb549db0c007d3 100644 --- a/app/code/core/Mage/Directory/etc/api.xml +++ b/app/code/core/Mage/Directory/etc/api.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Directory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Directory/etc/config.xml b/app/code/core/Mage/Directory/etc/config.xml index f92ec5adca25f25f411bbcede68778a8fdf2935c..475d636ce8163761991cea83d87557698af94a85 100644 --- a/app/code/core/Mage/Directory/etc/config.xml +++ b/app/code/core/Mage/Directory/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Directory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Directory/etc/system.xml b/app/code/core/Mage/Directory/etc/system.xml index c0c623e9855913ec7a6137f9153097c610b5137c..6052b9c2fbcf037936f74828008f9b8af57562fd 100644 --- a/app/code/core/Mage/Directory/etc/system.xml +++ b/app/code/core/Mage/Directory/etc/system.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Directory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Directory/sql/directory_setup/install-1.6.0.0.php b/app/code/core/Mage/Directory/sql/directory_setup/install-1.6.0.0.php index 723e2876ddb832d5eb9fd75b69648807868853ec..a2aa091154a35fb4ba2528b7a5b791e5139b337c 100644 --- a/app/code/core/Mage/Directory/sql/directory_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/Directory/sql/directory_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Directory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Directory/view/adminhtml/js/optional_zip_countries.phtml b/app/code/core/Mage/Directory/view/adminhtml/js/optional_zip_countries.phtml index 1c27a39fea03e02cdab275a471c67795820900d1..3200c05589dbdf68e911db670a716754a453cc33 100644 --- a/app/code/core/Mage/Directory/view/adminhtml/js/optional_zip_countries.phtml +++ b/app/code/core/Mage/Directory/view/adminhtml/js/optional_zip_countries.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Directory/view/frontend/currency.phtml b/app/code/core/Mage/Directory/view/frontend/currency.phtml index 7b519a4da1b253df8173874caaadc0400fa0a2e3..993d06bbc777ace8cbbb0ff63d1e04dd26bb23cb 100644 --- a/app/code/core/Mage/Directory/view/frontend/currency.phtml +++ b/app/code/core/Mage/Directory/view/frontend/currency.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Directory/view/frontend/currency/switch.phtml b/app/code/core/Mage/Directory/view/frontend/currency/switch.phtml index 2246907782d4dcadf78ebc5fbfad619a52e70e9a..895f2289c5763bfb7fc4303693adcb25dc07a682 100644 --- a/app/code/core/Mage/Directory/view/frontend/currency/switch.phtml +++ b/app/code/core/Mage/Directory/view/frontend/currency/switch.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Directory/view/frontend/js/optional_zip_countries.phtml b/app/code/core/Mage/Directory/view/frontend/js/optional_zip_countries.phtml index 1bb41c6084852b8f02d55046fb211467273c4d2b..91d4102ea1b9a21b14f4bf905378cf253aac59ba 100644 --- a/app/code/core/Mage/Directory/view/frontend/js/optional_zip_countries.phtml +++ b/app/code/core/Mage/Directory/view/frontend/js/optional_zip_countries.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Directory/view/frontend/layout.xml b/app/code/core/Mage/Directory/view/frontend/layout.xml index 5639f7cb710064a0c09fbb5063b9644ab499845f..77bee91967bd2e5fe3cd33afa0bd383b7d104de1 100644 --- a/app/code/core/Mage/Directory/view/frontend/layout.xml +++ b/app/code/core/Mage/Directory/view/frontend/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Downloadable.php b/app/code/core/Mage/Downloadable/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Downloadable.php index c3e17e6ba67785e28b31fe7178df9f113494387c..d840434a014751e2b72dca53c83138bd4509f591 100644 --- a/app/code/core/Mage/Downloadable/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Downloadable.php +++ b/app/code/core/Mage/Downloadable/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Downloadable.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable.php b/app/code/core/Mage/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable.php index 9966fffc9c48d6801dd164dc4139bd2f7dca500b..bda3e303366c68550ccbceba868c489f00bff7a6 100644 --- a/app/code/core/Mage/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable.php +++ b/app/code/core/Mage/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Links.php b/app/code/core/Mage/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Links.php index 897ad054087dcb4a53d3bcbcc25b2bb4983cb4cc..d8e2a9c9edc7d95f7241dab1d8e2106844b123fc 100644 --- a/app/code/core/Mage/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Links.php +++ b/app/code/core/Mage/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Links.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Samples.php b/app/code/core/Mage/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Samples.php index 86307cf217c4e2537201f83b8084ab2661a09607..4a0b9059fb0130aa196a29bc6a883025f3cdafd1 100644 --- a/app/code/core/Mage/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Samples.php +++ b/app/code/core/Mage/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Samples.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/Block/Adminhtml/Sales/Items/Column/Downloadable/Name.php b/app/code/core/Mage/Downloadable/Block/Adminhtml/Sales/Items/Column/Downloadable/Name.php index 847e0353763eb064a4b903ced06a5a4c90f199f5..840cf77d0e121d99a02c4007882065377fd2461b 100644 --- a/app/code/core/Mage/Downloadable/Block/Adminhtml/Sales/Items/Column/Downloadable/Name.php +++ b/app/code/core/Mage/Downloadable/Block/Adminhtml/Sales/Items/Column/Downloadable/Name.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/Block/Catalog/Product/Links.php b/app/code/core/Mage/Downloadable/Block/Catalog/Product/Links.php index ce234944c02fe2e23bf170887664ab60fa120b16..0d55b3c8d9113d9bd8ccaba62141af7e0d0faeb2 100644 --- a/app/code/core/Mage/Downloadable/Block/Catalog/Product/Links.php +++ b/app/code/core/Mage/Downloadable/Block/Catalog/Product/Links.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/Block/Catalog/Product/Samples.php b/app/code/core/Mage/Downloadable/Block/Catalog/Product/Samples.php index 061d2127cbdc069ed7ea26c3a74a6919d6e73c99..4fac33c2dbdf0a3b4a30689dc5827275bae64aab 100644 --- a/app/code/core/Mage/Downloadable/Block/Catalog/Product/Samples.php +++ b/app/code/core/Mage/Downloadable/Block/Catalog/Product/Samples.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/Block/Catalog/Product/View/Type.php b/app/code/core/Mage/Downloadable/Block/Catalog/Product/View/Type.php index 3573fb01c99e30a8893d4bd937a0826dc409df8c..c108b55823735f7d7262ff79566e964d51ae76fe 100644 --- a/app/code/core/Mage/Downloadable/Block/Catalog/Product/View/Type.php +++ b/app/code/core/Mage/Downloadable/Block/Catalog/Product/View/Type.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/Block/Checkout/Cart/Item/Renderer.php b/app/code/core/Mage/Downloadable/Block/Checkout/Cart/Item/Renderer.php index 992b3860266b890e8959d1ed94f6f4f4db433096..3d7190c8ea402c62fc99fa0cd5183fb1abdf4f61 100644 --- a/app/code/core/Mage/Downloadable/Block/Checkout/Cart/Item/Renderer.php +++ b/app/code/core/Mage/Downloadable/Block/Checkout/Cart/Item/Renderer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/Block/Checkout/Success.php b/app/code/core/Mage/Downloadable/Block/Checkout/Success.php index bccf613b19c7ab756ec4c1062488875076798ffd..2f91ac17913d901b182bad8e35c88e3cc8189aeb 100644 --- a/app/code/core/Mage/Downloadable/Block/Checkout/Success.php +++ b/app/code/core/Mage/Downloadable/Block/Checkout/Success.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/Block/Customer/Products/List.php b/app/code/core/Mage/Downloadable/Block/Customer/Products/List.php index a24ba9a2423b2110fc6fd5a321a7aa57b089d29b..ca03b5d1267a8a2b6ef2011b65fb4a10d347b7ee 100644 --- a/app/code/core/Mage/Downloadable/Block/Customer/Products/List.php +++ b/app/code/core/Mage/Downloadable/Block/Customer/Products/List.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/Block/Sales/Order/Email/Items/Downloadable.php b/app/code/core/Mage/Downloadable/Block/Sales/Order/Email/Items/Downloadable.php index 6d83953110d4d7660b9c97491aa6d3cd5615fe73..ae93a7167b0ecdd995a5bd4382d4f5dcbff4121e 100644 --- a/app/code/core/Mage/Downloadable/Block/Sales/Order/Email/Items/Downloadable.php +++ b/app/code/core/Mage/Downloadable/Block/Sales/Order/Email/Items/Downloadable.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/Block/Sales/Order/Email/Items/Order/Downloadable.php b/app/code/core/Mage/Downloadable/Block/Sales/Order/Email/Items/Order/Downloadable.php index eab9c8c9f1dcc3dccdde93bd5f101e4c26d1236f..9af9f63dd7911841b05fb0dd2bf2d4d02ed919c2 100644 --- a/app/code/core/Mage/Downloadable/Block/Sales/Order/Email/Items/Order/Downloadable.php +++ b/app/code/core/Mage/Downloadable/Block/Sales/Order/Email/Items/Order/Downloadable.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/Block/Sales/Order/Item/Renderer/Downloadable.php b/app/code/core/Mage/Downloadable/Block/Sales/Order/Item/Renderer/Downloadable.php index 841915519eb719e4d7bc0ad0e91d66371736dd2b..10736244bd64c69f9b25e24d0c0a820e0dbe8eb0 100644 --- a/app/code/core/Mage/Downloadable/Block/Sales/Order/Item/Renderer/Downloadable.php +++ b/app/code/core/Mage/Downloadable/Block/Sales/Order/Item/Renderer/Downloadable.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/Helper/Catalog/Product/Configuration.php b/app/code/core/Mage/Downloadable/Helper/Catalog/Product/Configuration.php index 6bd7039bd7d410d7539f2fffd70423222165227d..0ef56ac2cbf39df9cb74e6cae5e55c5bef9c585b 100644 --- a/app/code/core/Mage/Downloadable/Helper/Catalog/Product/Configuration.php +++ b/app/code/core/Mage/Downloadable/Helper/Catalog/Product/Configuration.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/Helper/Data.php b/app/code/core/Mage/Downloadable/Helper/Data.php index 39070908d728abbd03139afe4940ca043008eb69..4221c8fc22cd6db225902119244d67e6c2b14d75 100644 --- a/app/code/core/Mage/Downloadable/Helper/Data.php +++ b/app/code/core/Mage/Downloadable/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/Helper/Download.php b/app/code/core/Mage/Downloadable/Helper/Download.php index 7a688083ca4376337cd89e0391077f1ba7cde7c3..2879bb7d6939cd987a9a20cc460afcb87169c87e 100644 --- a/app/code/core/Mage/Downloadable/Helper/Download.php +++ b/app/code/core/Mage/Downloadable/Helper/Download.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/Helper/File.php b/app/code/core/Mage/Downloadable/Helper/File.php index 92750763a4c3ba21158e12cf52c74dc65053378c..3931fa784d22b7d06e229ed4b833d9464f5f37e8 100644 --- a/app/code/core/Mage/Downloadable/Helper/File.php +++ b/app/code/core/Mage/Downloadable/Helper/File.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/Model/Link.php b/app/code/core/Mage/Downloadable/Model/Link.php index 70c86fa383635502171b274a6844971e88ac1ae7..30b5e07e7bfd8555d548711eba4424d1e2f8754c 100644 --- a/app/code/core/Mage/Downloadable/Model/Link.php +++ b/app/code/core/Mage/Downloadable/Model/Link.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/Model/Link/Api.php b/app/code/core/Mage/Downloadable/Model/Link/Api.php index 77d25d678721b459e345087d4a1abac423b8c49a..ede56b74891035bd34d3b92f5f7a0b042a523b41 100644 --- a/app/code/core/Mage/Downloadable/Model/Link/Api.php +++ b/app/code/core/Mage/Downloadable/Model/Link/Api.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/Model/Link/Api/Uploader.php b/app/code/core/Mage/Downloadable/Model/Link/Api/Uploader.php index 5751f8dac675344160981cdd9361fcdfcb32d4ba..7f6481c622c9d76b6cba7fbf923b2945b509cc93 100644 --- a/app/code/core/Mage/Downloadable/Model/Link/Api/Uploader.php +++ b/app/code/core/Mage/Downloadable/Model/Link/Api/Uploader.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/Model/Link/Api/V2.php b/app/code/core/Mage/Downloadable/Model/Link/Api/V2.php index 7b9eb1dcbb25606fbd788d271c2a770e742f71df..7e98c4ac40c2b702e12b0bd9f04b802009272a46 100644 --- a/app/code/core/Mage/Downloadable/Model/Link/Api/V2.php +++ b/app/code/core/Mage/Downloadable/Model/Link/Api/V2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/Model/Link/Api/Validator.php b/app/code/core/Mage/Downloadable/Model/Link/Api/Validator.php index 3684a6d5bdd84c3d1971463c6de03d7e33c46150..ad1f7b3ca721f1ba3a06e679c39704b699f80cdf 100644 --- a/app/code/core/Mage/Downloadable/Model/Link/Api/Validator.php +++ b/app/code/core/Mage/Downloadable/Model/Link/Api/Validator.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/Model/Link/Purchased.php b/app/code/core/Mage/Downloadable/Model/Link/Purchased.php index f10eef0dbd3a24386bf145cf9c31e3447333586a..32c31370a3d2b43584c673fd7a26ab5be6e80591 100644 --- a/app/code/core/Mage/Downloadable/Model/Link/Purchased.php +++ b/app/code/core/Mage/Downloadable/Model/Link/Purchased.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/Model/Link/Purchased/Item.php b/app/code/core/Mage/Downloadable/Model/Link/Purchased/Item.php index f272c7f1c7782b0e7277bbc6f3b47547630d1550..2429bc67e192592b963c73fca75fb841850c35b7 100644 --- a/app/code/core/Mage/Downloadable/Model/Link/Purchased/Item.php +++ b/app/code/core/Mage/Downloadable/Model/Link/Purchased/Item.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/Model/Observer.php b/app/code/core/Mage/Downloadable/Model/Observer.php index e88b893254287400dbcd73609b7f6b727c90419a..c09e6f7f32e482f729e4ffcb5fe4d90d62eb6171 100644 --- a/app/code/core/Mage/Downloadable/Model/Observer.php +++ b/app/code/core/Mage/Downloadable/Model/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -215,6 +215,12 @@ class Mage_Downloadable_Model_Observer if ($item->getProductType() == Mage_Downloadable_Model_Product_Type::TYPE_DOWNLOADABLE || $item->getRealProductType() == Mage_Downloadable_Model_Product_Type::TYPE_DOWNLOADABLE ) { + if ($item->getStatusId() == Mage_Sales_Model_Order_Item::STATUS_BACKORDERED && + $orderItemStatusToEnable == Mage_Sales_Model_Order_Item::STATUS_PENDING && + !in_array(Mage_Sales_Model_Order_Item::STATUS_BACKORDERED, $availableStatuses, true) ) { + $availableStatuses[] = Mage_Sales_Model_Order_Item::STATUS_BACKORDERED; + } + if (in_array($item->getStatusId(), $availableStatuses)) { $downloadableItemsStatuses[$item->getId()] = $linkStatuses['avail']; } diff --git a/app/code/core/Mage/Downloadable/Model/Product/Price.php b/app/code/core/Mage/Downloadable/Model/Product/Price.php index aed3ae4f0c88e5cdb89135666e12ec3d06bbf123..867293f0c7b2e10fc8bc1a25182e9a350375bc4b 100644 --- a/app/code/core/Mage/Downloadable/Model/Product/Price.php +++ b/app/code/core/Mage/Downloadable/Model/Product/Price.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/Model/Product/Type.php b/app/code/core/Mage/Downloadable/Model/Product/Type.php index fad619f5b615e4a6f3808d14452fff99b304910f..2fef12ad5cf661447979293cb7a8e473fca0a3f1 100644 --- a/app/code/core/Mage/Downloadable/Model/Product/Type.php +++ b/app/code/core/Mage/Downloadable/Model/Product/Type.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -402,11 +402,6 @@ class Mage_Downloadable_Model_Product_Type extends Mage_Catalog_Model_Product_Ty } } - /* - * After "Downloadable Information" tab was made non-ajax we should - * set this flag "true" to force saving of 'required_options' attribute - */ - $product->setCanSaveCustomOptions(true); $product->setTypeHasOptions($linksExist); $product->setLinksExist($linksExist); } diff --git a/app/code/core/Mage/Downloadable/Model/Resource/Indexer/Price.php b/app/code/core/Mage/Downloadable/Model/Resource/Indexer/Price.php index 7ef15e31bca7a3732822405ff81d3bcdcb5f67cf..cba973c81c4bd7922de55baf422fbdf3242335c5 100755 --- a/app/code/core/Mage/Downloadable/Model/Resource/Indexer/Price.php +++ b/app/code/core/Mage/Downloadable/Model/Resource/Indexer/Price.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -146,6 +146,7 @@ class Mage_Downloadable_Model_Resource_Indexer_Price extends Mage_Catalog_Model_ $write->query($query); $ifTierPrice = $write->getCheckSql('i.tier_price IS NOT NULL', '(i.tier_price + id.min_price)', 'NULL'); + $ifGroupPrice = $write->getCheckSql('i.group_price IS NOT NULL', '(i.group_price + id.min_price)', 'NULL'); $select = $write->select() ->join( @@ -154,9 +155,10 @@ class Mage_Downloadable_Model_Resource_Indexer_Price extends Mage_Catalog_Model_ .' AND i.website_id = id.website_id', array()) ->columns(array( - 'min_price' => new Zend_Db_Expr('i.min_price + id.min_price'), - 'max_price' => new Zend_Db_Expr('i.max_price + id.max_price'), - 'tier_price' => new Zend_Db_Expr($ifTierPrice) + 'min_price' => new Zend_Db_Expr('i.min_price + id.min_price'), + 'max_price' => new Zend_Db_Expr('i.max_price + id.max_price'), + 'tier_price' => new Zend_Db_Expr($ifTierPrice), + 'group_price' => new Zend_Db_Expr($ifGroupPrice), )); $query = $select->crossUpdateFromSelect(array('i' => $this->_getDefaultFinalPriceTable())); diff --git a/app/code/core/Mage/Downloadable/Model/Resource/Link.php b/app/code/core/Mage/Downloadable/Model/Resource/Link.php index 265c72333cff36ec61b02c5d4f820f8820afe93a..22f9efb0eede4a4841eed9a4f14dfb965583fe76 100755 --- a/app/code/core/Mage/Downloadable/Model/Resource/Link.php +++ b/app/code/core/Mage/Downloadable/Model/Resource/Link.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/Model/Resource/Link/Collection.php b/app/code/core/Mage/Downloadable/Model/Resource/Link/Collection.php index 357e909cd7bf2d3c30d396f776d29eb1a3b37d53..63cc0edfc54badd6f46950e5371f393a7940aa45 100755 --- a/app/code/core/Mage/Downloadable/Model/Resource/Link/Collection.php +++ b/app/code/core/Mage/Downloadable/Model/Resource/Link/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/Model/Resource/Link/Purchased.php b/app/code/core/Mage/Downloadable/Model/Resource/Link/Purchased.php index 1d20600e4983d0da6162fc6f1c60d558cf4a9b90..cebea252ef493603e703fcda916e3c80f368cfc0 100755 --- a/app/code/core/Mage/Downloadable/Model/Resource/Link/Purchased.php +++ b/app/code/core/Mage/Downloadable/Model/Resource/Link/Purchased.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/Model/Resource/Link/Purchased/Collection.php b/app/code/core/Mage/Downloadable/Model/Resource/Link/Purchased/Collection.php index a4c3e9d43fff824195047ce8c250e1c6335cc257..add4d53e7657b6f11c3d3a96fd16d2cfd09cd98a 100755 --- a/app/code/core/Mage/Downloadable/Model/Resource/Link/Purchased/Collection.php +++ b/app/code/core/Mage/Downloadable/Model/Resource/Link/Purchased/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/Model/Resource/Link/Purchased/Item.php b/app/code/core/Mage/Downloadable/Model/Resource/Link/Purchased/Item.php index 921659f2ccdd49b204faea4d7ee04803e736d251..b1bb4175dfa7593a727cb66c672de05921f4dd7b 100755 --- a/app/code/core/Mage/Downloadable/Model/Resource/Link/Purchased/Item.php +++ b/app/code/core/Mage/Downloadable/Model/Resource/Link/Purchased/Item.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/Model/Resource/Link/Purchased/Item/Collection.php b/app/code/core/Mage/Downloadable/Model/Resource/Link/Purchased/Item/Collection.php index 3310eaf457c2cfb3a93e14b0a554ff1fafcf52fa..e24e73000efc838e2e6cd7ccfc4423bb8521e2f7 100755 --- a/app/code/core/Mage/Downloadable/Model/Resource/Link/Purchased/Item/Collection.php +++ b/app/code/core/Mage/Downloadable/Model/Resource/Link/Purchased/Item/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/Model/Resource/Sample.php b/app/code/core/Mage/Downloadable/Model/Resource/Sample.php index 6267bd6a37037713d0d456c78ef23945eab7e775..92a8a95a7740c457c6bea7e40eb0da669c97f350 100755 --- a/app/code/core/Mage/Downloadable/Model/Resource/Sample.php +++ b/app/code/core/Mage/Downloadable/Model/Resource/Sample.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/Model/Resource/Sample/Collection.php b/app/code/core/Mage/Downloadable/Model/Resource/Sample/Collection.php index d69daeea676bc20b2560d08e7bdc52cffccb630d..1b1c30beae21793b10ef74b21ef1480b1dc7913b 100755 --- a/app/code/core/Mage/Downloadable/Model/Resource/Sample/Collection.php +++ b/app/code/core/Mage/Downloadable/Model/Resource/Sample/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/Model/Sales/Order/Pdf/Items/Abstract.php b/app/code/core/Mage/Downloadable/Model/Sales/Order/Pdf/Items/Abstract.php index a95c43d0812ff594cbbae0a26faa5c83a8f312e1..3bcff0b53335564074590d64954a41056ed4a016 100644 --- a/app/code/core/Mage/Downloadable/Model/Sales/Order/Pdf/Items/Abstract.php +++ b/app/code/core/Mage/Downloadable/Model/Sales/Order/Pdf/Items/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/Model/Sales/Order/Pdf/Items/Creditmemo.php b/app/code/core/Mage/Downloadable/Model/Sales/Order/Pdf/Items/Creditmemo.php index 9142e7084e228ea33342a76c115d9b596bc4b7a3..3bf500ec89d971c1757d6f0cf0e40231be3b68ad 100644 --- a/app/code/core/Mage/Downloadable/Model/Sales/Order/Pdf/Items/Creditmemo.php +++ b/app/code/core/Mage/Downloadable/Model/Sales/Order/Pdf/Items/Creditmemo.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -32,7 +32,8 @@ * @package Mage_Downloadable * @author Magento Core Team <core@magentocommerce.com> */ -class Mage_Downloadable_Model_Sales_Order_Pdf_Items_Creditmemo extends Mage_Downloadable_Model_Sales_Order_Pdf_Items_Abstract +class Mage_Downloadable_Model_Sales_Order_Pdf_Items_Creditmemo + extends Mage_Downloadable_Model_Sales_Order_Pdf_Items_Abstract { /** * Draw item line @@ -66,13 +67,29 @@ class Mage_Downloadable_Model_Sales_Order_Pdf_Items_Creditmemo extends Mage_Down $x += 100; // draw Total (ex) - $lines[0][] = array( - 'text' => $order->formatPriceTxt($item->getRowTotal()), - 'feed' => $x, - 'font' => 'bold', - 'align' => 'right', - 'width' => 50, - ); + $i = 0; + $prices = $this->getItemPricesForDisplay(); + foreach ($prices as $priceData){ + if (isset($priceData['label'])) { + // draw Subtotal label + $lines[$i][] = array( + 'text' => $priceData['label'], + 'feed' => $x, + 'align' => 'right', + 'width' => 50, + ); + $i++; + } + // draw Subtotal + $lines[$i][] = array( + 'text' => $priceData['subtotal'], + 'feed' => $x, + 'font' => 'bold', + 'align' => 'right', + 'width' => 50, + ); + $i++; + } $x += 50; // draw Discount @@ -106,8 +123,10 @@ class Mage_Downloadable_Model_Sales_Order_Pdf_Items_Creditmemo extends Mage_Down $x += 45; // draw Subtotal + $subtotal = $item->getRowTotal() + + $item->getTaxAmount() + $item->getHiddenTaxAmount() - $item->getDiscountAmount(); $lines[0][] = array( - 'text' => $order->formatPriceTxt($item->getRowTotal() + $item->getTaxAmount() - $item->getDiscountAmount()), + 'text' => $order->formatPriceTxt($subtotal), 'feed' => $rightBound, 'font' => 'bold', 'align' => 'right' diff --git a/app/code/core/Mage/Downloadable/Model/Sales/Order/Pdf/Items/Invoice.php b/app/code/core/Mage/Downloadable/Model/Sales/Order/Pdf/Items/Invoice.php index 473a8ade0a78d7d45ba4c9ee906fee05b991af5d..c3f5edbe59b22d3bc9f218f601bb6a6e3209f005 100644 --- a/app/code/core/Mage/Downloadable/Model/Sales/Order/Pdf/Items/Invoice.php +++ b/app/code/core/Mage/Downloadable/Model/Sales/Order/Pdf/Items/Invoice.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -32,7 +32,8 @@ * @package Mage_Downloadable * @author Magento Core Team <core@magentocommerce.com> */ -class Mage_Downloadable_Model_Sales_Order_Pdf_Items_Invoice extends Mage_Downloadable_Model_Sales_Order_Pdf_Items_Abstract +class Mage_Downloadable_Model_Sales_Order_Pdf_Items_Invoice + extends Mage_Downloadable_Model_Sales_Order_Pdf_Items_Abstract { /** * Draw item line @@ -65,13 +66,41 @@ class Mage_Downloadable_Model_Sales_Order_Pdf_Items_Invoice extends Mage_Downloa 'feed' => 435 ); - // draw Price - $lines[0][] = array( - 'text' => $order->formatPriceTxt($item->getPrice()), - 'feed' => 395, - 'font' => 'bold', - 'align' => 'right' - ); + // draw item Prices + $i = 0; + $prices = $this->getItemPricesForDisplay(); + foreach ($prices as $priceData){ + if (isset($priceData['label'])) { + // draw Price label + $lines[$i][] = array( + 'text' => $priceData['label'], + 'feed' => 395, + 'align' => 'right' + ); + // draw Subtotal label + $lines[$i][] = array( + 'text' => $priceData['label'], + 'feed' => 565, + 'align' => 'right' + ); + $i++; + } + // draw Price + $lines[$i][] = array( + 'text' => $priceData['price'], + 'feed' => 395, + 'font' => 'bold', + 'align' => 'right' + ); + // draw Subtotal + $lines[$i][] = array( + 'text' => $priceData['subtotal'], + 'feed' => 565, + 'font' => 'bold', + 'align' => 'right' + ); + $i++; + } // draw Tax $lines[0][] = array( @@ -81,14 +110,6 @@ class Mage_Downloadable_Model_Sales_Order_Pdf_Items_Invoice extends Mage_Downloa 'align' => 'right' ); - // draw Subtotal - $lines[0][] = array( - 'text' => $order->formatPriceTxt($item->getRowTotal()), - 'feed' => 565, - 'font' => 'bold', - 'align' => 'right' - ); - // custom options $options = $this->getItemOptions(); if ($options) { @@ -101,7 +122,11 @@ class Mage_Downloadable_Model_Sales_Order_Pdf_Items_Invoice extends Mage_Downloa ); if ($option['value']) { - $_printValue = isset($option['print_value']) ? $option['print_value'] : strip_tags($option['value']); + if (isset($option['print_value'])) { + $_printValue = $option['print_value']; + } else { + $_printValue = strip_tags($option['value']); + } $values = explode(', ', $_printValue); foreach ($values as $value) { $lines[][] = array( diff --git a/app/code/core/Mage/Downloadable/Model/Sample.php b/app/code/core/Mage/Downloadable/Model/Sample.php index adbaa04a5b88eee342c2d997bcb28b718c1af4da..4ac53dbb6d04e100a79e16445dd51c8499eb5bbe 100644 --- a/app/code/core/Mage/Downloadable/Model/Sample.php +++ b/app/code/core/Mage/Downloadable/Model/Sample.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/Model/System/Config/Source/Contentdisposition.php b/app/code/core/Mage/Downloadable/Model/System/Config/Source/Contentdisposition.php index 9b95f95e92b15b8166038e595f925f3550771281..d7eae6969d3dd089310d3d1d033077855269623b 100644 --- a/app/code/core/Mage/Downloadable/Model/System/Config/Source/Contentdisposition.php +++ b/app/code/core/Mage/Downloadable/Model/System/Config/Source/Contentdisposition.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/Model/System/Config/Source/Orderitemstatus.php b/app/code/core/Mage/Downloadable/Model/System/Config/Source/Orderitemstatus.php index e403f6cd519d9d355098797a8ecc0a6b65ec3959..d357b6a57cab63fd51e86105ca104d01d54610ac 100644 --- a/app/code/core/Mage/Downloadable/Model/System/Config/Source/Orderitemstatus.php +++ b/app/code/core/Mage/Downloadable/Model/System/Config/Source/Orderitemstatus.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/controllers/Adminhtml/Downloadable/FileController.php b/app/code/core/Mage/Downloadable/controllers/Adminhtml/Downloadable/FileController.php index 189eb2611af4d18ccc80eb5e0ae9872eb5013e67..b8a7e29d3ff7b9e182637fa6ef63f677ed082406 100644 --- a/app/code/core/Mage/Downloadable/controllers/Adminhtml/Downloadable/FileController.php +++ b/app/code/core/Mage/Downloadable/controllers/Adminhtml/Downloadable/FileController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -55,6 +55,12 @@ class Mage_Downloadable_Adminhtml_Downloadable_FileController extends Mage_Admin $uploader->setFilesDispersion(true); $result = $uploader->save($tmpPath); + /** + * Workaround for prototype 1.7 methods "isJSON", "evalJSON" on Windows OS + */ + $result['tmp_name'] = str_replace(DS, "/", $result['tmp_name']); + $result['path'] = str_replace(DS, "/", $result['path']); + if (isset($result['file'])) { $fullPath = rtrim($tmpPath, DS) . DS . ltrim($result['file'], DS); Mage::helper('Mage_Core_Helper_File_Storage_Database')->saveFile($fullPath); diff --git a/app/code/core/Mage/Downloadable/controllers/Adminhtml/Downloadable/Product/EditController.php b/app/code/core/Mage/Downloadable/controllers/Adminhtml/Downloadable/Product/EditController.php index 3f6e9a315b3730552e345bf38b20e4618d3a8981..5f510c6500ddd220a1516e6a52bfbdc8dd1f5702 100644 --- a/app/code/core/Mage/Downloadable/controllers/Adminhtml/Downloadable/Product/EditController.php +++ b/app/code/core/Mage/Downloadable/controllers/Adminhtml/Downloadable/Product/EditController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/controllers/CustomerController.php b/app/code/core/Mage/Downloadable/controllers/CustomerController.php index 1d184273b4c5719e8e3a36e571836350eedb73d9..ed1b7471f3ba07c1b0ba056c094f957a473ed29d 100644 --- a/app/code/core/Mage/Downloadable/controllers/CustomerController.php +++ b/app/code/core/Mage/Downloadable/controllers/CustomerController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/controllers/DownloadController.php b/app/code/core/Mage/Downloadable/controllers/DownloadController.php index 37d1a2f3696a3534f8819aaf5cb7dda59a88e9df..f74772f0f73d309e0cc0dc1099128a90ef8a8db8 100644 --- a/app/code/core/Mage/Downloadable/controllers/DownloadController.php +++ b/app/code/core/Mage/Downloadable/controllers/DownloadController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -164,10 +164,7 @@ class Mage_Downloadable_DownloadController extends Mage_Core_Controller_Front_Ac if (!$customerId) { $product = Mage::getModel('Mage_Catalog_Model_Product')->load($linkPurchasedItem->getProductId()); if ($product->getId()) { - $notice = Mage::helper('Mage_Downloadable_Helper_Data')->__( - 'Please log in to download your product or purchase <a href="%s">%s</a>.', - $product->getProductUrl(), $product->getName() - ); + $notice = Mage::helper('Mage_Downloadable_Helper_Data')->__('Please log in to download your product or purchase <a href="%s">%s</a>.', $product->getProductUrl(), $product->getName()); } else { $notice = Mage::helper('Mage_Downloadable_Helper_Data')->__('Please log in to download your product.'); } @@ -231,4 +228,4 @@ class Mage_Downloadable_DownloadController extends Mage_Core_Controller_Front_Ac return $this->_redirect('*/customer/products'); } -} +} \ No newline at end of file diff --git a/app/code/core/Mage/Downloadable/data/downloadable_setup/data-install-1.6.0.0.php b/app/code/core/Mage/Downloadable/data/downloadable_setup/data-install-1.6.0.0.php index 07bac6f538c159fb03e4823c84ffa2d327633223..eb64f202b2717c1f0ab8c77dce3afd2bbdc8b731 100644 --- a/app/code/core/Mage/Downloadable/data/downloadable_setup/data-install-1.6.0.0.php +++ b/app/code/core/Mage/Downloadable/data/downloadable_setup/data-install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ /** @var $installer Mage_Downloadable_Model_Resource_Setup */ diff --git a/app/code/core/Mage/Downloadable/etc/adminhtml.xml b/app/code/core/Mage/Downloadable/etc/adminhtml.xml index 237f9721526f2fe74f878154041d292880ba274e..1a316cc5436912a903aa5b3b90e83cb663b8f98e 100644 --- a/app/code/core/Mage/Downloadable/etc/adminhtml.xml +++ b/app/code/core/Mage/Downloadable/etc/adminhtml.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> @@ -45,4 +45,18 @@ </admin> </resources> </acl> + <menu> + <report> + <children> + <products> + <children> + <downloads translate="title" module="Mage_Reports"> + <title>Downloads</title> + <action>adminhtml/report_product/downloads</action> + </downloads> + </children> + </products> + </children> + </report> + </menu> </config> diff --git a/app/code/core/Mage/Downloadable/etc/api.xml b/app/code/core/Mage/Downloadable/etc/api.xml index 66a27bdf7a1ad78ebcc8540018eb5e3f8021fb4c..a073fc0de20293e8c325d344e4d3139cf79a5549 100644 --- a/app/code/core/Mage/Downloadable/etc/api.xml +++ b/app/code/core/Mage/Downloadable/etc/api.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Downloadable/etc/config.xml b/app/code/core/Mage/Downloadable/etc/config.xml index 05ea48c50e21cedfe487573e259dd73ea6df497c..b5724a1e927432729df77685721d1be43e19f1ac 100644 --- a/app/code/core/Mage/Downloadable/etc/config.xml +++ b/app/code/core/Mage/Downloadable/etc/config.xml @@ -21,14 +21,14 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> <config> <modules> <Mage_Downloadable> - <version>1.6.0.0.1</version> + <version>1.6.0.0.2</version> </Mage_Downloadable> </modules> <global> diff --git a/app/code/core/Mage/Downloadable/etc/fieldset.xml b/app/code/core/Mage/Downloadable/etc/fieldset.xml index 4f247c3f1b1eb276d335d5d53a5db562bff77e04..7d4d12d6b9d829970e744c7cccb66e22d45d3c3d 100644 --- a/app/code/core/Mage/Downloadable/etc/fieldset.xml +++ b/app/code/core/Mage/Downloadable/etc/fieldset.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Downloadable/etc/system.xml b/app/code/core/Mage/Downloadable/etc/system.xml index 31d9350a85270211b90df949570a2cd76135e0c5..0709e5d5fbc197da36f155803500445e5f6be89b 100644 --- a/app/code/core/Mage/Downloadable/etc/system.xml +++ b/app/code/core/Mage/Downloadable/etc/system.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Downloadable/sql/downloadable_setup/install-1.6.0.0.php b/app/code/core/Mage/Downloadable/sql/downloadable_setup/install-1.6.0.0.php index 4d02bf6cc208ac7dbf9cdeaab7011cb77e309880..3628119b82b9bb88dc871082e9edc9bd5bc88071 100644 --- a/app/code/core/Mage/Downloadable/sql/downloadable_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/Downloadable/sql/downloadable_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-1.6.0.0.1-1.6.0.0.2.php b/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-1.6.0.0.1-1.6.0.0.2.php new file mode 100644 index 0000000000000000000000000000000000000000..300dca17387aeea68fa3520a3be96cd6e5e6640d --- /dev/null +++ b/app/code/core/Mage/Downloadable/sql/downloadable_setup/mysql4-upgrade-1.6.0.0.1-1.6.0.0.2.php @@ -0,0 +1,38 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Downloadable + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +$installFile = dirname(__FILE__) . DS . 'upgrade-1.6.0.0.1-1.6.0.0.2.php'; +if (file_exists($installFile)) { + include $installFile; +} + +/** @var $installer Mage_Catalog_Model_Resource_Setup */ +$installer = $this; +/** @var $connection Varien_Db_Adapter_Pdo_Mysql */ +$connection = $installer->getConnection(); +$connection->changeTableEngine( + $installer->getTable('catalog_product_index_price_downlod_tmp'), + Varien_Db_Adapter_Pdo_Mysql::ENGINE_MEMORY +); diff --git a/app/code/core/Mage/Downloadable/sql/downloadable_setup/upgrade-1.6.0.0-1.6.0.0.1.php b/app/code/core/Mage/Downloadable/sql/downloadable_setup/upgrade-1.6.0.0-1.6.0.0.1.php index c3d97a24ef4f989dbacbb364ead601aca5cf38e5..05aa852dfe1d1bc8adf56047972338a864267506 100644 --- a/app/code/core/Mage/Downloadable/sql/downloadable_setup/upgrade-1.6.0.0-1.6.0.0.1.php +++ b/app/code/core/Mage/Downloadable/sql/downloadable_setup/upgrade-1.6.0.0-1.6.0.0.1.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/sql/downloadable_setup/upgrade-1.6.0.0.1-1.6.0.0.2.php b/app/code/core/Mage/Downloadable/sql/downloadable_setup/upgrade-1.6.0.0.1-1.6.0.0.2.php new file mode 100644 index 0000000000000000000000000000000000000000..375fcf54844289d2f98a0b02bf0898d90afb4aa3 --- /dev/null +++ b/app/code/core/Mage/Downloadable/sql/downloadable_setup/upgrade-1.6.0.0.1-1.6.0.0.2.php @@ -0,0 +1,34 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Downloadable + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** @var $installer Mage_Catalog_Model_Resource_Setup */ +$installer = $this; + +$applyTo = explode(',', $installer->getAttribute(Mage_Catalog_Model_Product::ENTITY, 'group_price', 'apply_to')); +if (!in_array(Mage_Downloadable_Model_Product_Type::TYPE_DOWNLOADABLE, $applyTo)) { + $applyTo[] = Mage_Downloadable_Model_Product_Type::TYPE_DOWNLOADABLE; + $installer->updateAttribute(Mage_Catalog_Model_Product::ENTITY, 'group_price', 'apply_to', implode(',', $applyTo)); +} diff --git a/app/code/core/Mage/Downloadable/view/adminhtml/layout.xml b/app/code/core/Mage/Downloadable/view/adminhtml/layout.xml index f8a9bba567c083b655bc01761e31e71cb1fa194b..bb39cfaec0859d767ce41d22bcf57588454f6511 100644 --- a/app/code/core/Mage/Downloadable/view/adminhtml/layout.xml +++ b/app/code/core/Mage/Downloadable/view/adminhtml/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Downloadable/view/adminhtml/product/composite/fieldset/downloadable.phtml b/app/code/core/Mage/Downloadable/view/adminhtml/product/composite/fieldset/downloadable.phtml index b43b5fd90d530e75cfd87d00bd3a782f7532c794..8577ee3aa56153062677670c810f40f06f2ad9b2 100644 --- a/app/code/core/Mage/Downloadable/view/adminhtml/product/composite/fieldset/downloadable.phtml +++ b/app/code/core/Mage/Downloadable/view/adminhtml/product/composite/fieldset/downloadable.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Downloadable/view/adminhtml/product/edit/downloadable.phtml b/app/code/core/Mage/Downloadable/view/adminhtml/product/edit/downloadable.phtml index 0fa88510e66f2421dd962726060cc437fc5a62d3..e2f150b3d8f17d42c32aa4d85a0617bdfb42e774 100644 --- a/app/code/core/Mage/Downloadable/view/adminhtml/product/edit/downloadable.phtml +++ b/app/code/core/Mage/Downloadable/view/adminhtml/product/edit/downloadable.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Downloadable/view/adminhtml/product/edit/downloadable/links.phtml b/app/code/core/Mage/Downloadable/view/adminhtml/product/edit/downloadable/links.phtml index 779d0d4a98d445df53dd52a0b5cad1cd16acfd2a..b6b2d32ab3a5f423a204c9ab602c228b5cd9ee99 100644 --- a/app/code/core/Mage/Downloadable/view/adminhtml/product/edit/downloadable/links.phtml +++ b/app/code/core/Mage/Downloadable/view/adminhtml/product/edit/downloadable/links.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -185,7 +185,7 @@ var linkTemplate = '<tr>'+ '</td>'+ '<td class="a-center"><input type="text" name="downloadable[link][{{id}}][sort_order]" value="{{sort_order}}" class="input-text sort" /></td>'+ '<td>'+ - '<button id="downloadable_link_{{id}}_delete_button" type="button" class="scalable delete icon-btn delete-link-item"><span><?php echo Mage::helper('Mage_Downloadable_Helper_Data')->__('Delete'); ?></span></button>'+ + '<button id="downloadable_link_{{id}}_delete_button" type="button" class="scalable delete icon-btn delete-link-item"><span><span><span><?php echo Mage::helper('Mage_Downloadable_Helper_Data')->__('Delete'); ?></span></span></span></button>'+ '</td>'+ '</tr>'; diff --git a/app/code/core/Mage/Downloadable/view/adminhtml/product/edit/downloadable/samples.phtml b/app/code/core/Mage/Downloadable/view/adminhtml/product/edit/downloadable/samples.phtml index fbcd4423068d0901677b5c936c6b40fd08701604..c98af1124ca980cac0b8147dde5e1dc7076fac8e 100644 --- a/app/code/core/Mage/Downloadable/view/adminhtml/product/edit/downloadable/samples.phtml +++ b/app/code/core/Mage/Downloadable/view/adminhtml/product/edit/downloadable/samples.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -114,7 +114,7 @@ var sampleTemplate = '<tr>'+ '</td>'+ '<td class="a-center"><input type="text" name="downloadable[sample][{{id}}][sort_order]" value="{{sort_order}}" class="input-text sort" /></td>'+ '<td>'+ - '<button type="button" class="scalable delete icon-btn delete-sample-item"><span>Delete</span></button>'+ + '<button type="button" class="scalable delete icon-btn delete-sample-item"><span><span><span>Delete</span></span></span></button>'+ '</td>'+ '</tr>'; var sampleItems = { diff --git a/app/code/core/Mage/Downloadable/view/adminhtml/sales/items/column/downloadable/creditmemo/name.phtml b/app/code/core/Mage/Downloadable/view/adminhtml/sales/items/column/downloadable/creditmemo/name.phtml index 1a6dd5876d83a78e8384bb12800a46f1e30322cf..a16752d3117bac1a77303ff3e0ea3fde6103d193 100644 --- a/app/code/core/Mage/Downloadable/view/adminhtml/sales/items/column/downloadable/creditmemo/name.phtml +++ b/app/code/core/Mage/Downloadable/view/adminhtml/sales/items/column/downloadable/creditmemo/name.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Downloadable/view/adminhtml/sales/items/column/downloadable/invoice/name.phtml b/app/code/core/Mage/Downloadable/view/adminhtml/sales/items/column/downloadable/invoice/name.phtml index 842162bb61d1d1c3d317b36200b70dc49f70a2ec..5560fc0105bf390d52aee7f085c5c1f18d8429bb 100644 --- a/app/code/core/Mage/Downloadable/view/adminhtml/sales/items/column/downloadable/invoice/name.phtml +++ b/app/code/core/Mage/Downloadable/view/adminhtml/sales/items/column/downloadable/invoice/name.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Downloadable/view/adminhtml/sales/items/column/downloadable/name.phtml b/app/code/core/Mage/Downloadable/view/adminhtml/sales/items/column/downloadable/name.phtml index 5cbcc45b3ec6b148102b39ba2804459ac8a136c3..a8a491aa7363a81253745c2f54bd4c1eb6a9b15a 100644 --- a/app/code/core/Mage/Downloadable/view/adminhtml/sales/items/column/downloadable/name.phtml +++ b/app/code/core/Mage/Downloadable/view/adminhtml/sales/items/column/downloadable/name.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Downloadable/view/adminhtml/sales/order/creditmemo/create/items/renderer/downloadable.phtml b/app/code/core/Mage/Downloadable/view/adminhtml/sales/order/creditmemo/create/items/renderer/downloadable.phtml index 05155c84db4016183e8e33acb1a780424f932a41..71e12eec562aacb4a6d35313b91ebb09445c3fbf 100644 --- a/app/code/core/Mage/Downloadable/view/adminhtml/sales/order/creditmemo/create/items/renderer/downloadable.phtml +++ b/app/code/core/Mage/Downloadable/view/adminhtml/sales/order/creditmemo/create/items/renderer/downloadable.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Downloadable/view/adminhtml/sales/order/creditmemo/view/items/renderer/downloadable.phtml b/app/code/core/Mage/Downloadable/view/adminhtml/sales/order/creditmemo/view/items/renderer/downloadable.phtml index 869e7330851b4a147debd2f6c8caf89656baf52f..12b8887674f1eb079236c14a80157368d90f731a 100644 --- a/app/code/core/Mage/Downloadable/view/adminhtml/sales/order/creditmemo/view/items/renderer/downloadable.phtml +++ b/app/code/core/Mage/Downloadable/view/adminhtml/sales/order/creditmemo/view/items/renderer/downloadable.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Downloadable/view/adminhtml/sales/order/invoice/create/items/renderer/downloadable.phtml b/app/code/core/Mage/Downloadable/view/adminhtml/sales/order/invoice/create/items/renderer/downloadable.phtml index 76cb666b7154159bdd1d952f2117da52809f4a15..2636b6ae8f2599117f564a627b6ca246c4c7084d 100644 --- a/app/code/core/Mage/Downloadable/view/adminhtml/sales/order/invoice/create/items/renderer/downloadable.phtml +++ b/app/code/core/Mage/Downloadable/view/adminhtml/sales/order/invoice/create/items/renderer/downloadable.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Downloadable/view/adminhtml/sales/order/invoice/view/items/renderer/downloadable.phtml b/app/code/core/Mage/Downloadable/view/adminhtml/sales/order/invoice/view/items/renderer/downloadable.phtml index 8961bfc6e6ca1c5628a4a6e6ca265d59579a5031..ed8ffb1dcbc986bbdc9a7612cfdc00f840c8175a 100644 --- a/app/code/core/Mage/Downloadable/view/adminhtml/sales/order/invoice/view/items/renderer/downloadable.phtml +++ b/app/code/core/Mage/Downloadable/view/adminhtml/sales/order/invoice/view/items/renderer/downloadable.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Downloadable/view/adminhtml/sales/order/view/items/renderer/downloadable.phtml b/app/code/core/Mage/Downloadable/view/adminhtml/sales/order/view/items/renderer/downloadable.phtml index e33a76e9727423ca0541c611a95150cb87831994..250292ef716777b21711e590b1c8f16bcbe51471 100644 --- a/app/code/core/Mage/Downloadable/view/adminhtml/sales/order/view/items/renderer/downloadable.phtml +++ b/app/code/core/Mage/Downloadable/view/adminhtml/sales/order/view/items/renderer/downloadable.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Downloadable/view/frontend/catalog/product/links.phtml b/app/code/core/Mage/Downloadable/view/frontend/catalog/product/links.phtml index 3abc3e9b67f3aac4897e25bb45f5037773171c63..1990633d59b1921e4ed151e7563c62a2adf64760 100644 --- a/app/code/core/Mage/Downloadable/view/frontend/catalog/product/links.phtml +++ b/app/code/core/Mage/Downloadable/view/frontend/catalog/product/links.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Downloadable/view/frontend/catalog/product/samples.phtml b/app/code/core/Mage/Downloadable/view/frontend/catalog/product/samples.phtml index 62c4385b795a95ab893e6e328e2caf8c3ba9ff6a..8a7393f0dfaae92e784aa7c151316ed7d12e4f39 100644 --- a/app/code/core/Mage/Downloadable/view/frontend/catalog/product/samples.phtml +++ b/app/code/core/Mage/Downloadable/view/frontend/catalog/product/samples.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/view/frontend/catalog/product/type.phtml b/app/code/core/Mage/Downloadable/view/frontend/catalog/product/type.phtml index 569eeedf9b0734b792ddfcafa8f7168e583f05ef..b381c98cc6de4f27c7e36292e255a2349c246f41 100644 --- a/app/code/core/Mage/Downloadable/view/frontend/catalog/product/type.phtml +++ b/app/code/core/Mage/Downloadable/view/frontend/catalog/product/type.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/view/frontend/checkout/cart/item/default.phtml b/app/code/core/Mage/Downloadable/view/frontend/checkout/cart/item/default.phtml index b2d8d952000ba12626e8983c08979a70b43260c3..054f55de883e60a9d1c9cc99cffc0557b48cce6b 100644 --- a/app/code/core/Mage/Downloadable/view/frontend/checkout/cart/item/default.phtml +++ b/app/code/core/Mage/Downloadable/view/frontend/checkout/cart/item/default.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Downloadable/view/frontend/checkout/multishipping/item/downloadable.phtml b/app/code/core/Mage/Downloadable/view/frontend/checkout/multishipping/item/downloadable.phtml index d25914d34ee0009c07fb65a2f3605d2f255ec037..73ffac959658b12c5972443b59e1fb6a81d896d6 100644 --- a/app/code/core/Mage/Downloadable/view/frontend/checkout/multishipping/item/downloadable.phtml +++ b/app/code/core/Mage/Downloadable/view/frontend/checkout/multishipping/item/downloadable.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Downloadable/view/frontend/checkout/onepage/review/item.phtml b/app/code/core/Mage/Downloadable/view/frontend/checkout/onepage/review/item.phtml index 725759a904549b5d5f2da2c4eeb4071805676457..5f85113c65eef081106c1ceffcaa6e0abe8f17ea 100644 --- a/app/code/core/Mage/Downloadable/view/frontend/checkout/onepage/review/item.phtml +++ b/app/code/core/Mage/Downloadable/view/frontend/checkout/onepage/review/item.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Downloadable/view/frontend/checkout/success.phtml b/app/code/core/Mage/Downloadable/view/frontend/checkout/success.phtml index c4b3ddefb330708f35a86899a86f1afadcbb604d..9fc74f1183a46d81bc2c1d262eaa30a9945b702c 100644 --- a/app/code/core/Mage/Downloadable/view/frontend/checkout/success.phtml +++ b/app/code/core/Mage/Downloadable/view/frontend/checkout/success.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Downloadable/view/frontend/customer/products/list.phtml b/app/code/core/Mage/Downloadable/view/frontend/customer/products/list.phtml index fa54a338945d0a10841a703adb37f18175dc10a5..50321115c240a0ff81588c0c635c8ca77b0ec0ce 100644 --- a/app/code/core/Mage/Downloadable/view/frontend/customer/products/list.phtml +++ b/app/code/core/Mage/Downloadable/view/frontend/customer/products/list.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Downloadable/view/frontend/email/order/items/creditmemo/downloadable.phtml b/app/code/core/Mage/Downloadable/view/frontend/email/order/items/creditmemo/downloadable.phtml index b1590cfb53ada766fa30c8a482be572cdbe9f081..729904f0a65d1778af67f7d3924fc2f71bf3be99 100644 --- a/app/code/core/Mage/Downloadable/view/frontend/email/order/items/creditmemo/downloadable.phtml +++ b/app/code/core/Mage/Downloadable/view/frontend/email/order/items/creditmemo/downloadable.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Downloadable/view/frontend/email/order/items/invoice/downloadable.phtml b/app/code/core/Mage/Downloadable/view/frontend/email/order/items/invoice/downloadable.phtml index 6b637e0ec21493dd0360b918fe4d997b7e80142a..fb31c2be86c664a0fb9781a93d2de02fca41b93b 100644 --- a/app/code/core/Mage/Downloadable/view/frontend/email/order/items/invoice/downloadable.phtml +++ b/app/code/core/Mage/Downloadable/view/frontend/email/order/items/invoice/downloadable.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Downloadable/view/frontend/email/order/items/order/downloadable.phtml b/app/code/core/Mage/Downloadable/view/frontend/email/order/items/order/downloadable.phtml index 8f62710a05559729d1d83bd36823a0dbeac4886e..43208909395b43db56203e1442f44e9fba9bf53c 100644 --- a/app/code/core/Mage/Downloadable/view/frontend/email/order/items/order/downloadable.phtml +++ b/app/code/core/Mage/Downloadable/view/frontend/email/order/items/order/downloadable.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Downloadable/view/frontend/layout.xml b/app/code/core/Mage/Downloadable/view/frontend/layout.xml index ea9e62656434395e0a9c21e42ed1da5874c42584..b20276835639e194c179b341dd6f2378a3c86800 100644 --- a/app/code/core/Mage/Downloadable/view/frontend/layout.xml +++ b/app/code/core/Mage/Downloadable/view/frontend/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/Downloadable/view/frontend/sales/order/creditmemo/items/renderer/downloadable.phtml b/app/code/core/Mage/Downloadable/view/frontend/sales/order/creditmemo/items/renderer/downloadable.phtml index 9e3097c3a820a30be60cc1ca8a2a161d914f333c..69ba041487546d602681ae8ba853784e09949f36 100644 --- a/app/code/core/Mage/Downloadable/view/frontend/sales/order/creditmemo/items/renderer/downloadable.phtml +++ b/app/code/core/Mage/Downloadable/view/frontend/sales/order/creditmemo/items/renderer/downloadable.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Downloadable/view/frontend/sales/order/invoice/items/renderer/downloadable.phtml b/app/code/core/Mage/Downloadable/view/frontend/sales/order/invoice/items/renderer/downloadable.phtml index ffea05d9a9a6ee0811b73d86550a18dfdbc4eab4..906456c28a10176fdd274c1f9a9883a459a8ed3b 100644 --- a/app/code/core/Mage/Downloadable/view/frontend/sales/order/invoice/items/renderer/downloadable.phtml +++ b/app/code/core/Mage/Downloadable/view/frontend/sales/order/invoice/items/renderer/downloadable.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Downloadable/view/frontend/sales/order/items/renderer/downloadable.phtml b/app/code/core/Mage/Downloadable/view/frontend/sales/order/items/renderer/downloadable.phtml index c03156964c0d8f058554f445da98ba523c2e3f70..c2887e0b25956894773bbc1febebb2a85654279a 100644 --- a/app/code/core/Mage/Downloadable/view/frontend/sales/order/items/renderer/downloadable.phtml +++ b/app/code/core/Mage/Downloadable/view/frontend/sales/order/items/renderer/downloadable.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Eav/Block/Adminhtml/Attribute/Edit/Js.php b/app/code/core/Mage/Eav/Block/Adminhtml/Attribute/Edit/Js.php index 9d0fecaf41389d2a46064f1a29f8b239326b7e14..e4950b2b243927371256364c1aab6b226d4e38e0 100644 --- a/app/code/core/Mage/Eav/Block/Adminhtml/Attribute/Edit/Js.php +++ b/app/code/core/Mage/Eav/Block/Adminhtml/Attribute/Edit/Js.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Block/Adminhtml/Attribute/Edit/Main/Abstract.php b/app/code/core/Mage/Eav/Block/Adminhtml/Attribute/Edit/Main/Abstract.php index 60322d71216335fc6be5c32b942139fb0102cfad..35ced5eddc68a5b900892002aab4f7dfc0f55cf9 100644 --- a/app/code/core/Mage/Eav/Block/Adminhtml/Attribute/Edit/Main/Abstract.php +++ b/app/code/core/Mage/Eav/Block/Adminhtml/Attribute/Edit/Main/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -84,8 +84,7 @@ abstract class Mage_Eav_Block_Adminhtml_Attribute_Edit_Main_Abstract extends Mag 'name' => 'attribute_code', 'label' => Mage::helper('Mage_Eav_Helper_Data')->__('Attribute Code'), 'title' => Mage::helper('Mage_Eav_Helper_Data')->__('Attribute Code'), - 'note' => Mage::helper('Mage_Eav_Helper_Data')->__('For internal use. Must be unique with no spaces. Maximum length of attribute code must be less then %s symbols', - Mage_Eav_Model_Entity_Attribute::ATTRIBUTE_CODE_MAX_LENGTH), + 'note' => Mage::helper('Mage_Eav_Helper_Data')->__('For internal use. Must be unique with no spaces. Maximum length of attribute code must be less then %s symbols', Mage_Eav_Model_Entity_Attribute::ATTRIBUTE_CODE_MAX_LENGTH), 'class' => $validateClass, 'required' => true, )); @@ -221,4 +220,4 @@ abstract class Mage_Eav_Block_Adminhtml_Attribute_Edit_Main_Abstract extends Mag return $html.$jsScripts; } -} +} \ No newline at end of file diff --git a/app/code/core/Mage/Eav/Block/Adminhtml/Attribute/Edit/Options/Abstract.php b/app/code/core/Mage/Eav/Block/Adminhtml/Attribute/Edit/Options/Abstract.php index d1bf6ad9ad7678c0968ff425b2b94e329c4af9a1..2ea3858095f45f460ae852cad86e3ea2d0d5fb92 100644 --- a/app/code/core/Mage/Eav/Block/Adminhtml/Attribute/Edit/Options/Abstract.php +++ b/app/code/core/Mage/Eav/Block/Adminhtml/Attribute/Edit/Options/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Block/Adminhtml/Attribute/Grid/Abstract.php b/app/code/core/Mage/Eav/Block/Adminhtml/Attribute/Grid/Abstract.php index 02c8e5f03a6eca2e18a9e092b90a9560410e784e..0aabf96202e5ce0a7c0b6d9940fd39baeb0224e8 100644 --- a/app/code/core/Mage/Eav/Block/Adminhtml/Attribute/Grid/Abstract.php +++ b/app/code/core/Mage/Eav/Block/Adminhtml/Attribute/Grid/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Exception.php b/app/code/core/Mage/Eav/Exception.php index 7792d9e7cd3a83d2b3fd39a84743a03f55480179..7784d2acb945cb69d37f0d5e1e446e21274d8aa0 100644 --- a/app/code/core/Mage/Eav/Exception.php +++ b/app/code/core/Mage/Eav/Exception.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Helper/Data.php b/app/code/core/Mage/Eav/Helper/Data.php index 5087b4c87632964ed21642d1ddc95bdf9932a536..108daeecc1364d759ec7fa6fec8fcbe1539dfbf2 100644 --- a/app/code/core/Mage/Eav/Helper/Data.php +++ b/app/code/core/Mage/Eav/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Adminhtml/System/Config/Source/Inputtype.php b/app/code/core/Mage/Eav/Model/Adminhtml/System/Config/Source/Inputtype.php index 2aac705c16b6518f799926f6e591b98977d7142a..3d290dc7c57b7b0c0cdb2239e611bd664fd43ad0 100644 --- a/app/code/core/Mage/Eav/Model/Adminhtml/System/Config/Source/Inputtype.php +++ b/app/code/core/Mage/Eav/Model/Adminhtml/System/Config/Source/Inputtype.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Eav_Model_Adminhtml_System_Config_Source_Inputtype diff --git a/app/code/core/Mage/Eav/Model/Adminhtml/System/Config/Source/Inputtype/Validator.php b/app/code/core/Mage/Eav/Model/Adminhtml/System/Config/Source/Inputtype/Validator.php index 5d8c75f4d057d11a0fb7bd85f4c4fdc52d0acf7f..87c77fe90fac1f9894a485e2d9db7111694c5555 100644 --- a/app/code/core/Mage/Eav/Model/Adminhtml/System/Config/Source/Inputtype/Validator.php +++ b/app/code/core/Mage/Eav/Model/Adminhtml/System/Config/Source/Inputtype/Validator.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Attribute.php b/app/code/core/Mage/Eav/Model/Attribute.php index 6f15a705bcce43273cb14b8a44b78105b395f3bc..c5824b5ad27757f14cd361977acbc8b0ac3dd065 100644 --- a/app/code/core/Mage/Eav/Model/Attribute.php +++ b/app/code/core/Mage/Eav/Model/Attribute.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Attribute/Data.php b/app/code/core/Mage/Eav/Model/Attribute/Data.php index 608649220b60b3275c4c66ea7be1c0e04f8d9ec2..858a47fbfaff3db6dff8946b99212b6701226b39 100644 --- a/app/code/core/Mage/Eav/Model/Attribute/Data.php +++ b/app/code/core/Mage/Eav/Model/Attribute/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Attribute/Data/Abstract.php b/app/code/core/Mage/Eav/Model/Attribute/Data/Abstract.php index 5a5511631933292f496dd43e10437f2f9fd3544d..6fca8fc639e6b8246acbb98eaafa7fda220837cb 100644 --- a/app/code/core/Mage/Eav/Model/Attribute/Data/Abstract.php +++ b/app/code/core/Mage/Eav/Model/Attribute/Data/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Attribute/Data/Boolean.php b/app/code/core/Mage/Eav/Model/Attribute/Data/Boolean.php index c1d34404dc7288abf21ac97132234c54fd2f92d0..03d4d75263e30f45f867f0bc23f8f0b39da2fef1 100644 --- a/app/code/core/Mage/Eav/Model/Attribute/Data/Boolean.php +++ b/app/code/core/Mage/Eav/Model/Attribute/Data/Boolean.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Attribute/Data/Date.php b/app/code/core/Mage/Eav/Model/Attribute/Data/Date.php index 873f1827657a5a02216cefbb36d1d7eaf2e583f6..58d39a0d3c5406afe13092a159bbc0db12afad7b 100644 --- a/app/code/core/Mage/Eav/Model/Attribute/Data/Date.php +++ b/app/code/core/Mage/Eav/Model/Attribute/Data/Date.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -83,21 +83,11 @@ class Mage_Eav_Model_Attribute_Data_Date extends Mage_Eav_Model_Attribute_Data_A || (!empty($validateRules['date_range_max']) && (strtotime($value) > $validateRules['date_range_max'])) ) { if (!empty($validateRules['date_range_min']) && !empty($validateRules['date_range_max'])) { - $errors[] = Mage::helper('Mage_Customer_Helper_Data')->__('Please enter a valid date between %s and %s at %s.', - date('d/m/Y', $validateRules['date_range_min']), - date('d/m/Y', $validateRules['date_range_max']), - $label - ); + $errors[] = Mage::helper('Mage_Customer_Helper_Data')->__('Please enter a valid date between %s and %s at %s.', date('d/m/Y', $validateRules['date_range_min']), date('d/m/Y', $validateRules['date_range_max']), $label); } elseif (!empty($validateRules['date_range_min'])) { - $errors[] = Mage::helper('Mage_Customer_Helper_Data')->__('Please enter a valid date equal to or greater than %s at %s.', - date('d/m/Y', $validateRules['date_range_min']), - $label - ); + $errors[] = Mage::helper('Mage_Customer_Helper_Data')->__('Please enter a valid date equal to or greater than %s at %s.', date('d/m/Y', $validateRules['date_range_min']), $label); } elseif (!empty($validateRules['date_range_max'])) { - $errors[] = Mage::helper('Mage_Customer_Helper_Data')->__('Please enter a valid date less than or equal to %s at %s.', - date('d/m/Y', $validateRules['date_range_max']), - $label - ); + $errors[] = Mage::helper('Mage_Customer_Helper_Data')->__('Please enter a valid date less than or equal to %s at %s.', date('d/m/Y', $validateRules['date_range_max']), $label); } } diff --git a/app/code/core/Mage/Eav/Model/Attribute/Data/File.php b/app/code/core/Mage/Eav/Model/Attribute/Data/File.php index b5390162004aa0c07b7c1a5eb8ae81f070b26a5c..c088bf89f400172187bd57105a29fd4a8e9049d3 100644 --- a/app/code/core/Mage/Eav/Model/Attribute/Data/File.php +++ b/app/code/core/Mage/Eav/Model/Attribute/Data/File.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Attribute/Data/Hidden.php b/app/code/core/Mage/Eav/Model/Attribute/Data/Hidden.php index 7bf90918015e2a1f6638179a2866c171e426af52..50735437d0310d7225b949cea6bb95481ba8ea9a 100644 --- a/app/code/core/Mage/Eav/Model/Attribute/Data/Hidden.php +++ b/app/code/core/Mage/Eav/Model/Attribute/Data/Hidden.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Attribute/Data/Image.php b/app/code/core/Mage/Eav/Model/Attribute/Data/Image.php index 0a59b32b53adece7c4aecd07e310acc4ddcd1e02..7c641ca7aeebcc34096961180d1d2c7c0fa775e6 100644 --- a/app/code/core/Mage/Eav/Model/Attribute/Data/Image.php +++ b/app/code/core/Mage/Eav/Model/Attribute/Data/Image.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Attribute/Data/Multiline.php b/app/code/core/Mage/Eav/Model/Attribute/Data/Multiline.php index f9ff2362745877040dd7cde1b9b2fd505b7a5952..b54f532c3da2b5ad151006be1382832b2955fa87 100644 --- a/app/code/core/Mage/Eav/Model/Attribute/Data/Multiline.php +++ b/app/code/core/Mage/Eav/Model/Attribute/Data/Multiline.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Attribute/Data/Multiselect.php b/app/code/core/Mage/Eav/Model/Attribute/Data/Multiselect.php index 9d615f458897393aaae6e2933c876bd958cc2bc4..259764975232a9deb217532555a7497c3802eefd 100644 --- a/app/code/core/Mage/Eav/Model/Attribute/Data/Multiselect.php +++ b/app/code/core/Mage/Eav/Model/Attribute/Data/Multiselect.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Attribute/Data/Select.php b/app/code/core/Mage/Eav/Model/Attribute/Data/Select.php index b914b6baf9ab664c8c741e84ce63734fccf04993..675ca38bfa9e427b5d4ff4ea6f51384b944f5584 100644 --- a/app/code/core/Mage/Eav/Model/Attribute/Data/Select.php +++ b/app/code/core/Mage/Eav/Model/Attribute/Data/Select.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Attribute/Data/Text.php b/app/code/core/Mage/Eav/Model/Attribute/Data/Text.php index a8130fdc02a1c90cb7466be726bd7fad383eade5..c48ed5932025ff5a85abfc34c2b329f7c04bc0fc 100644 --- a/app/code/core/Mage/Eav/Model/Attribute/Data/Text.php +++ b/app/code/core/Mage/Eav/Model/Attribute/Data/Text.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Attribute/Data/Textarea.php b/app/code/core/Mage/Eav/Model/Attribute/Data/Textarea.php index 18e17505fa20ea14b0613252ab42254e498cf78e..bcc02692d388d40c73fe3237d498a22d612ef4e4 100644 --- a/app/code/core/Mage/Eav/Model/Attribute/Data/Textarea.php +++ b/app/code/core/Mage/Eav/Model/Attribute/Data/Textarea.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Config.php b/app/code/core/Mage/Eav/Model/Config.php index a040c7378c560c6ce45135f2eb94264956a312cc..48b5463ebf0d849f8474c86786f3d6f080aff8a9 100644 --- a/app/code/core/Mage/Eav/Model/Config.php +++ b/app/code/core/Mage/Eav/Model/Config.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Convert/Adapter/Entity.php b/app/code/core/Mage/Eav/Model/Convert/Adapter/Entity.php index f8903c0cb0ad9ceea2c75fb2a6dae19262b0df54..46c46f274710e7976028caeeb8edfb2114f3d9e8 100644 --- a/app/code/core/Mage/Eav/Model/Convert/Adapter/Entity.php +++ b/app/code/core/Mage/Eav/Model/Convert/Adapter/Entity.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Convert/Adapter/Grid.php b/app/code/core/Mage/Eav/Model/Convert/Adapter/Grid.php index a3c5bf00436f13652d54a4daf63b0c458f2133b2..21950413ee546652b83455f5db89bdd8412c008b 100644 --- a/app/code/core/Mage/Eav/Model/Convert/Adapter/Grid.php +++ b/app/code/core/Mage/Eav/Model/Convert/Adapter/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Convert/Parser/Abstract.php b/app/code/core/Mage/Eav/Model/Convert/Parser/Abstract.php index 903837e938c96bb5b3422ab16944508d83c35a84..64cca5ddadcaef35bb1c1ece588ec5a3ddcc34b5 100644 --- a/app/code/core/Mage/Eav/Model/Convert/Parser/Abstract.php +++ b/app/code/core/Mage/Eav/Model/Convert/Parser/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Entity.php b/app/code/core/Mage/Eav/Model/Entity.php index 2fcec28d972db31277345625aa42f80b32f96270..8adf262b1f6c091d8e2b760270c56f687fb109d2 100644 --- a/app/code/core/Mage/Eav/Model/Entity.php +++ b/app/code/core/Mage/Eav/Model/Entity.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Entity/Abstract.php b/app/code/core/Mage/Eav/Model/Entity/Abstract.php index 215f4714efb9898cae3944f561894c4679a943e5..a246587a682ec9dd888073a28122e291d8723a0a 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Abstract.php +++ b/app/code/core/Mage/Eav/Model/Entity/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -1074,7 +1074,7 @@ abstract class Mage_Eav_Model_Entity_Abstract extends Mage_Core_Model_Resource_A if ($attribute) { $attributeCode = $attribute->getAttributeCode(); $object->setData($attributeCode, $valueRow['value']); - $attribute->getBackend()->setValueId($valueRow['value_id']); + $attribute->getBackend()->setEntityValueId($object, $valueRow['value_id']); } return $this; @@ -1213,11 +1213,11 @@ abstract class Mage_Eav_Model_Entity_Abstract extends Mage_Core_Model_Resource_A if ($this->_isAttributeValueEmpty($attribute, $v)) { $delete[$attribute->getBackend()->getTable()][] = array( 'attribute_id' => $attrId, - 'value_id' => $attribute->getBackend()->getValueId() + 'value_id' => $attribute->getBackend()->getEntityValueId($newObject) ); } elseif ($v !== $origData[$k]) { $update[$attrId] = array( - 'value_id' => $attribute->getBackend()->getValueId(), + 'value_id' => $attribute->getBackend()->getEntityValueId($newObject), 'value' => $v, ); } diff --git a/app/code/core/Mage/Eav/Model/Entity/Attribute.php b/app/code/core/Mage/Eav/Model/Entity/Attribute.php index 2825fdba99c2848394e4c64814af09208cbd7909..498b603b9e841f7ac8c6c72121c57fcccc19ea9a 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Attribute.php +++ b/app/code/core/Mage/Eav/Model/Entity/Attribute.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Entity/Attribute/Abstract.php b/app/code/core/Mage/Eav/Model/Entity/Attribute/Abstract.php index 25b23744ab3dca367a4430a1b72bcfb48a4624f4..495626093bd452ffbf7ff3761f4a15c287ffba96 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Attribute/Abstract.php +++ b/app/code/core/Mage/Eav/Model/Entity/Attribute/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Abstract.php b/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Abstract.php index 2971511cc1be101f3295ea622ca59dcc03568ea8..fdeb8038d6dc1065415d548faedb23b1a4040708 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Abstract.php +++ b/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -32,7 +32,8 @@ * @package Mage_Eav * @author Magento Core Team <core@magentocommerce.com> */ -abstract class Mage_Eav_Model_Entity_Attribute_Backend_Abstract implements Mage_Eav_Model_Entity_Attribute_Backend_Interface +abstract class Mage_Eav_Model_Entity_Attribute_Backend_Abstract + implements Mage_Eav_Model_Entity_Attribute_Backend_Interface { /** * Reference to the attribute instance @@ -48,6 +49,13 @@ abstract class Mage_Eav_Model_Entity_Attribute_Backend_Abstract implements Mage_ */ protected $_valueId; + /** + * PK value_ids for each loaded entity + * + * @var array + */ + protected $_valueIds = array(); + /** * Table name for this attribute * @@ -164,7 +172,24 @@ abstract class Mage_Eav_Model_Entity_Attribute_Backend_Abstract implements Mage_ } /** - * Retreive value id + * Set entity value id + * + * @param Varien_Object $entity + * @param int $valueId + * @return Mage_Eav_Model_Entity_Attribute_Backend_Abstract + */ + public function setEntityValueId($entity, $valueId) + { + if (!$entity || !$entity->getId()) { + return $this->setValueId($valueId); + } + + $this->_valueIds[$entity->getId()] = $valueId; + return $this; + } + + /** + * Retrieve value id * * @return int */ @@ -174,7 +199,22 @@ abstract class Mage_Eav_Model_Entity_Attribute_Backend_Abstract implements Mage_ } /** - * Retreive default value + * Get entity value id + * + * @param Varien_Object $entity + * @return int + */ + public function getEntityValueId($entity) + { + if (!$entity || !$entity->getId() || !array_key_exists($entity->getId(), $this->_valueIds)) { + return $this->getValueId(); + } + + return $this->_valueIds[$entity->getId()]; + } + + /** + * Retrieve default value * * @return mixed */ diff --git a/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Array.php b/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Array.php index bdc2056445b3a1dc5fe83fec50fe3fd0276458ac..ea532dea51fa05b2a0266e63837af27e24c5148b 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Array.php +++ b/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Array.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Datetime.php b/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Datetime.php index f30ed4d7552d8bb714b133b3ca42b65100147fce..d7c8a49dbe5f94f987ce3f6d801162645834292d 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Datetime.php +++ b/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Datetime.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Default.php b/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Default.php index c883557e7a0d742d29232bef88b39c4726b4f00b..5678e432e354dbcfe18aaa5dc91cbd652f18ecf2 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Default.php +++ b/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Default.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Increment.php b/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Increment.php index fe792813c4e59314d8a2a7dd1ccf2b78af5e7152..7078d08af7b307ea20f1ea3e548d9b771ca15df4 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Increment.php +++ b/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Increment.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Interface.php b/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Interface.php index 32f2863c1818ef1d0ef1c03c3a37aec256a855f4..6d8f90667a13ad81f786a1acc829ba5ce22d6dac 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Interface.php +++ b/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Interface.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -45,4 +45,19 @@ interface Mage_Eav_Model_Entity_Attribute_Backend_Interface public function afterSave($object); public function beforeDelete($object); public function afterDelete($object); + + /** + * Get entity value id + * + * @param Varien_Object $entity + */ + public function getEntityValueId($entity); + + /** + * Set entity value id + * + * @param Varien_Object $entity + * @param int $valueId + */ + public function setEntityValueId($entity, $valueId); } diff --git a/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Serialized.php b/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Serialized.php index 2d8474cfb34e060bfb343f6c283acfa5d27ba6ba..e2e689f5a26dec60010566e4cd3ac926a7b5d617 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Serialized.php +++ b/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Serialized.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Store.php b/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Store.php index 7cc60a8750b6d0c75a954442f4703de4c43e720d..f6edd877a94b19a9f8779f7657e0bfd023f4b3ed 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Store.php +++ b/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Store.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Time/Created.php b/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Time/Created.php index e960ce23dc9561c6fb079c1c150cdbbf2e5d0373..29a141338ba23d5a3c724d6ceff9cfb11be96b13 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Time/Created.php +++ b/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Time/Created.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Time/Updated.php b/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Time/Updated.php index 3233ff83220a3e6c288450ab0ba380231d0b01de..0c3b06395ffbf9547f11523ec8547e352ed13937 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Time/Updated.php +++ b/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Time/Updated.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Entity/Attribute/Exception.php b/app/code/core/Mage/Eav/Model/Entity/Attribute/Exception.php index 1c7dc0dde96eb8f7669907cda359c82e07653aae..17298c96255d12370260bf2dba61fbd3d170b541 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Attribute/Exception.php +++ b/app/code/core/Mage/Eav/Model/Entity/Attribute/Exception.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Entity/Attribute/Frontend/Abstract.php b/app/code/core/Mage/Eav/Model/Entity/Attribute/Frontend/Abstract.php index b8368a585021fcc1ddcbbb6d9fb5af8c9cd7938a..5998e01e95876716a1a970fe9e451e3403b16157 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Attribute/Frontend/Abstract.php +++ b/app/code/core/Mage/Eav/Model/Entity/Attribute/Frontend/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Entity/Attribute/Frontend/Datetime.php b/app/code/core/Mage/Eav/Model/Entity/Attribute/Frontend/Datetime.php index 0e63a1c92bd2fe33634f1d69bffa0244b7cd2f3e..7b9e8c88dabbd22ddb6a3e5267dfbfac4aa57e57 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Attribute/Frontend/Datetime.php +++ b/app/code/core/Mage/Eav/Model/Entity/Attribute/Frontend/Datetime.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Entity/Attribute/Frontend/Default.php b/app/code/core/Mage/Eav/Model/Entity/Attribute/Frontend/Default.php index 5d07cf217b2d8a8d9beabd8eb813d999268a19cb..38a62fa94055b452efca1a392e51d6dd772a0e15 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Attribute/Frontend/Default.php +++ b/app/code/core/Mage/Eav/Model/Entity/Attribute/Frontend/Default.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Entity/Attribute/Frontend/Interface.php b/app/code/core/Mage/Eav/Model/Entity/Attribute/Frontend/Interface.php index 28a6507934065f71fb789059eb89e8f6f7cf153e..f9bba5102cbe0622c8c99da70b5346127187f46d 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Attribute/Frontend/Interface.php +++ b/app/code/core/Mage/Eav/Model/Entity/Attribute/Frontend/Interface.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Entity/Attribute/Group.php b/app/code/core/Mage/Eav/Model/Entity/Attribute/Group.php index 3cd6edf0d63ea5ad51f47bd800eef34459280512..09430d4d7d4bedc1e6e7f0f68786c782204d6f78 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Attribute/Group.php +++ b/app/code/core/Mage/Eav/Model/Entity/Attribute/Group.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Entity/Attribute/Interface.php b/app/code/core/Mage/Eav/Model/Entity/Attribute/Interface.php index e855040aa4c630c3fd212a735ef9bd6c9ca31243..27d0feed939a7d615f0b4d0f64421f65160bbbca 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Attribute/Interface.php +++ b/app/code/core/Mage/Eav/Model/Entity/Attribute/Interface.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Entity/Attribute/Option.php b/app/code/core/Mage/Eav/Model/Entity/Attribute/Option.php index 7d56c0fbcc17313286f7e3c32262a7a627ad7b29..25cb8d40d0d79a2a53a8fa28709dca5499e6b159 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Attribute/Option.php +++ b/app/code/core/Mage/Eav/Model/Entity/Attribute/Option.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Entity/Attribute/Set.php b/app/code/core/Mage/Eav/Model/Entity/Attribute/Set.php index 1222b2e4e1db4140ededa0ec55e3ca770127ee65..fae6b3a1ad007771e1f8fa34287a0390d206fc34 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Attribute/Set.php +++ b/app/code/core/Mage/Eav/Model/Entity/Attribute/Set.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -43,6 +43,12 @@ */ class Mage_Eav_Model_Entity_Attribute_Set extends Mage_Core_Model_Abstract { + /** + * Prefix of model events names + * @var string + */ + protected $_eventPrefix = 'eav_entity_attribute_set'; + /** * Initialize resource model * diff --git a/app/code/core/Mage/Eav/Model/Entity/Attribute/Source/Abstract.php b/app/code/core/Mage/Eav/Model/Entity/Attribute/Source/Abstract.php index 33cce81deabf7a8d5eff2453e528f2495358b99d..51ca14f3adfe690d39fa2199ac769d856b290d29 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Attribute/Source/Abstract.php +++ b/app/code/core/Mage/Eav/Model/Entity/Attribute/Source/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -74,8 +74,8 @@ abstract class Mage_Eav_Model_Entity_Attribute_Source_Abstract /** * Get a text for option value * - * @param string|integer $value - * @return string + * @param string|integer $value + * @return string|bool */ public function getOptionText($value) { diff --git a/app/code/core/Mage/Eav/Model/Entity/Attribute/Source/Boolean.php b/app/code/core/Mage/Eav/Model/Entity/Attribute/Source/Boolean.php index 752420bddbda0fb7fd4fe64ba247b6ba75e690d2..94f3d18d6704e1866dae0162970778ff36920972 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Attribute/Source/Boolean.php +++ b/app/code/core/Mage/Eav/Model/Entity/Attribute/Source/Boolean.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Entity/Attribute/Source/Config.php b/app/code/core/Mage/Eav/Model/Entity/Attribute/Source/Config.php index 5e1ded8324a54c44f7fcb2995fb5432d98190866..aea52b272343284541462bc6472f27ab3ae70c4b 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Attribute/Source/Config.php +++ b/app/code/core/Mage/Eav/Model/Entity/Attribute/Source/Config.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Entity/Attribute/Source/Interface.php b/app/code/core/Mage/Eav/Model/Entity/Attribute/Source/Interface.php index 26a648fdde2fa0c12547925205eca8ec739b56a2..fb17a3c79020272ea6bc1c553e1121b47d68374f 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Attribute/Source/Interface.php +++ b/app/code/core/Mage/Eav/Model/Entity/Attribute/Source/Interface.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Entity/Attribute/Source/Store.php b/app/code/core/Mage/Eav/Model/Entity/Attribute/Source/Store.php index 78d891099c0794582c52e472e13fb6f15a7279a7..749d45fedd1cd03f228e7bc8ae0706f86dc67b11 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Attribute/Source/Store.php +++ b/app/code/core/Mage/Eav/Model/Entity/Attribute/Source/Store.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Entity/Attribute/Source/Table.php b/app/code/core/Mage/Eav/Model/Entity/Attribute/Source/Table.php index 5f433cef4b867e819770e5254896d4a844abd862..d7fc393b65ec19b86f347642b1735953fbf0d194 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Attribute/Source/Table.php +++ b/app/code/core/Mage/Eav/Model/Entity/Attribute/Source/Table.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Entity/Collection.php b/app/code/core/Mage/Eav/Model/Entity/Collection.php index 465a6b99c3428df2c43fe896952e150e7ff06849..007095af3bbae4ccd7e1a3e69aefd049c065f1df 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Collection.php +++ b/app/code/core/Mage/Eav/Model/Entity/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Entity/Collection/Abstract.php b/app/code/core/Mage/Eav/Model/Entity/Collection/Abstract.php index d8d0a88e28a181fd24228fdb9f06df6d1ac02d63..3a720d006f31b385972a1c72c0f64fd32fd75528 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Collection/Abstract.php +++ b/app/code/core/Mage/Eav/Model/Entity/Collection/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Entity/Increment/Abstract.php b/app/code/core/Mage/Eav/Model/Entity/Increment/Abstract.php index 9a55e8b371d5b708415c680383b478463647d7d9..b4328a9b17699771686dec2ba28c2e557a5c0635 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Increment/Abstract.php +++ b/app/code/core/Mage/Eav/Model/Entity/Increment/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Entity/Increment/Alphanum.php b/app/code/core/Mage/Eav/Model/Entity/Increment/Alphanum.php index 3da551c0fc3ba3693be8d99d2a924e17d45d1f7e..63d63f77b366bb3b8691af6261608118198fbed5 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Increment/Alphanum.php +++ b/app/code/core/Mage/Eav/Model/Entity/Increment/Alphanum.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Entity/Increment/Interface.php b/app/code/core/Mage/Eav/Model/Entity/Increment/Interface.php index 0b93c64b65fedb03bcb18790e276b5d2376c428f..e190c60d453dfa2300367c0e3cd0320041a37868 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Increment/Interface.php +++ b/app/code/core/Mage/Eav/Model/Entity/Increment/Interface.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Entity/Increment/Numeric.php b/app/code/core/Mage/Eav/Model/Entity/Increment/Numeric.php index 679c4d46db776a9c88d28e63421997a68d906af1..d4cfd0ba292bdf8b62b05686c80cea783c5ea6e9 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Increment/Numeric.php +++ b/app/code/core/Mage/Eav/Model/Entity/Increment/Numeric.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Entity/Interface.php b/app/code/core/Mage/Eav/Model/Entity/Interface.php index f469e3992dcca2c61d0b4b273c4fe54ea3dbc715..92323ee2d7bd7d49ed6291165a8f696c8f601c95 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Interface.php +++ b/app/code/core/Mage/Eav/Model/Entity/Interface.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Entity/Setup.php b/app/code/core/Mage/Eav/Model/Entity/Setup.php index 849d135811155fa3804c1ce3748d257aaa1011ba..4c237911c689aa03cd4ae8224ba104eaeb71b08e 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Setup.php +++ b/app/code/core/Mage/Eav/Model/Entity/Setup.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -1296,8 +1296,8 @@ class Mage_Eav_Model_Entity_Setup extends Mage_Core_Model_Resource_Setup foreach ($types as $type => $fieldType) { $eavTableName = array($baseTableName, $type); - $eavTable = $connection - ->newTable($this->getTable($eavTableName)) + $eavTable = $connection->newTable($this->getTable($eavTableName)); + $eavTable ->addColumn('value_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array( 'identity' => true, 'nullable' => false, @@ -1333,11 +1333,15 @@ class Mage_Eav_Model_Entity_Setup extends Mage_Core_Model_Resource_Setup ->addIndex($this->getIdxName($eavTableName, array('store_id')), array('store_id')) ->addIndex($this->getIdxName($eavTableName, array('entity_id')), - array('entity_id')) - ->addIndex($this->getIdxName($eavTableName, array('attribute_id', 'value')), - array('attribute_id', 'value')) - ->addIndex($this->getIdxName($eavTableName, array('entity_type_id', 'value')), - array('entity_type_id', 'value')) + array('entity_id')); + if ($type !== 'text') { + $eavTable->addIndex($this->getIdxName($eavTableName, array('attribute_id', 'value')), + array('attribute_id', 'value')); + $eavTable->addIndex($this->getIdxName($eavTableName, array('entity_type_id', 'value')), + array('entity_type_id', 'value')); + } + + $eavTable ->addForeignKey($this->getFkName($eavTableName, 'entity_id', $baseTableName, 'entity_id'), 'entity_id', $this->getTable($baseTableName), 'entity_id', Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE) diff --git a/app/code/core/Mage/Eav/Model/Entity/Store.php b/app/code/core/Mage/Eav/Model/Entity/Store.php index b059d462293aa495624de6d1f5fb5fa3ea5006e8..99a60ecdf1065d2c2d534a9290d58085f3114fd3 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Store.php +++ b/app/code/core/Mage/Eav/Model/Entity/Store.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Entity/Type.php b/app/code/core/Mage/Eav/Model/Entity/Type.php index 20bed90fbcc908e97d2ec843803ab8b7713e9177..239763b7fb08ac8f9066f4f66ddf9f1d5a93df92 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Type.php +++ b/app/code/core/Mage/Eav/Model/Entity/Type.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Form.php b/app/code/core/Mage/Eav/Model/Form.php index f6255311c7ffe5de8fdbcf62630da7c6adb1d253..a9200550d4149b533db62bd412c1e863381a685d 100644 --- a/app/code/core/Mage/Eav/Model/Form.php +++ b/app/code/core/Mage/Eav/Model/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Form/Element.php b/app/code/core/Mage/Eav/Model/Form/Element.php index c5b94775639cc4bbc0e0143e4a44d17c06d5e703..226accd722cfdf6f3f8816be06f31ad0550b8008 100644 --- a/app/code/core/Mage/Eav/Model/Form/Element.php +++ b/app/code/core/Mage/Eav/Model/Form/Element.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Form/Fieldset.php b/app/code/core/Mage/Eav/Model/Form/Fieldset.php index a4255c617e87861ce58e0ca3ec45e4cae6998f6f..83dff440879d284f4ffd3ef815bb3122de33feb9 100644 --- a/app/code/core/Mage/Eav/Model/Form/Fieldset.php +++ b/app/code/core/Mage/Eav/Model/Form/Fieldset.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Form/Type.php b/app/code/core/Mage/Eav/Model/Form/Type.php index 62befe767e93be9570c72eca256f78bb2c2d7d5f..b4104b5a7ba86bb4a5e1c194c4dd21d3ae6a95bd 100644 --- a/app/code/core/Mage/Eav/Model/Form/Type.php +++ b/app/code/core/Mage/Eav/Model/Form/Type.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Resource/Attribute.php b/app/code/core/Mage/Eav/Model/Resource/Attribute.php index 8f66606ab0047cc5cfd9836501ca53011b8b8891..e291b79f28fd4fb985bf76944a028b42a0dde226 100755 --- a/app/code/core/Mage/Eav/Model/Resource/Attribute.php +++ b/app/code/core/Mage/Eav/Model/Resource/Attribute.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Resource/Attribute/Collection.php b/app/code/core/Mage/Eav/Model/Resource/Attribute/Collection.php index a1a902800def83d42c6b6656da42fb843b498525..36097797f32bdacaad2ef26ab02a4a13b1d89789 100755 --- a/app/code/core/Mage/Eav/Model/Resource/Attribute/Collection.php +++ b/app/code/core/Mage/Eav/Model/Resource/Attribute/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -187,10 +187,10 @@ abstract class Mage_Eav_Model_Resource_Attribute_Collection } /** - * Specify attribute entity type filter - * Entity type is defined + * Specify attribute entity type filter. + * Entity type is defined. * - * @param mixed $type + * @param int $type * @return Mage_Eav_Model_Resource_Attribute_Collection */ public function setEntityTypeFilter($type) diff --git a/app/code/core/Mage/Eav/Model/Resource/Config.php b/app/code/core/Mage/Eav/Model/Resource/Config.php index e59f7eba5dd45076748b1b4d11bc71d71a72d2bb..f1f67acd7e6f6a578d9240d62ac9f705cd464774 100755 --- a/app/code/core/Mage/Eav/Model/Resource/Config.php +++ b/app/code/core/Mage/Eav/Model/Resource/Config.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute.php b/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute.php index 19f924534a06e1be612aebacd4e87a23251edf00..b9934fa1e5d115da526e8df745a44a3661bcbdba 100755 --- a/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute.php +++ b/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute/Collection.php b/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute/Collection.php index a115d4dc978ef364dc32ba43aa27022ff982a3d7..3131702ad950ba8f77ca1ca67a9ca6f8ce5734bc 100755 --- a/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute/Collection.php +++ b/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute/Group.php b/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute/Group.php index dbdcd4be107f8327c1825d021a02f882346a5ba2..ad643e2e079c5afc6b8d889ee7e9a520552a31f9 100755 --- a/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute/Group.php +++ b/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute/Group.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute/Group/Collection.php b/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute/Group/Collection.php index 3010d2ca1b0baf2fdf35715109eadcca2bf65ad8..d17de2a0c870ca45a8fdf0b036a857f83b52518a 100755 --- a/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute/Group/Collection.php +++ b/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute/Group/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute/Option.php b/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute/Option.php index 18648c559e092ef1e33cc8ee5f4c7df2795cc965..1d15ae8b0f8f5d6a51e887e657caca28e68fe209 100755 --- a/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute/Option.php +++ b/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute/Option.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute/Option/Collection.php b/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute/Option/Collection.php index 978e088cbe997db80fa6b16d92a432c63befd909..22f5f3f6814cd2b3bb05ef4aa16c5d796edcfe93 100755 --- a/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute/Option/Collection.php +++ b/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute/Option/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute/Set.php b/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute/Set.php index b4d7e86c0761787e7ca518eea11c3a7fe1b9a11c..eb43771212e932bbfd48a67938df1bd415295cd3 100755 --- a/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute/Set.php +++ b/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute/Set.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute/Set/Collection.php b/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute/Set/Collection.php index c21cfc9c1529e46a424f39b53e4e4a615129eb18..b33344dc4784fc10b4f5eeeac8221bd2f16eb178 100755 --- a/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute/Set/Collection.php +++ b/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute/Set/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Resource/Entity/Store.php b/app/code/core/Mage/Eav/Model/Resource/Entity/Store.php index 9b5d8ee31a381fb2077e3cabb18d2a083dfe0716..0c5a3bfad10d89a0cdb204e5ce150dbc1dcfd2bc 100755 --- a/app/code/core/Mage/Eav/Model/Resource/Entity/Store.php +++ b/app/code/core/Mage/Eav/Model/Resource/Entity/Store.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Resource/Entity/Type.php b/app/code/core/Mage/Eav/Model/Resource/Entity/Type.php index c44fcb02827ff154c00ecfc0517ca471c31f5ce2..c0881631fd9287f80cb4e68d939d3eb349fc5d1e 100755 --- a/app/code/core/Mage/Eav/Model/Resource/Entity/Type.php +++ b/app/code/core/Mage/Eav/Model/Resource/Entity/Type.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Resource/Entity/Type/Collection.php b/app/code/core/Mage/Eav/Model/Resource/Entity/Type/Collection.php index 15ae5d9a1f7368c289a3638171be8bc54b3160a4..3d7d4fce189ca2eadea83bb9a2f456b25eb63048 100755 --- a/app/code/core/Mage/Eav/Model/Resource/Entity/Type/Collection.php +++ b/app/code/core/Mage/Eav/Model/Resource/Entity/Type/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Resource/Form/Attribute.php b/app/code/core/Mage/Eav/Model/Resource/Form/Attribute.php index 1b579304a682665c63ec019aa929a5ce0c8bb08a..2f15ba09e82a1cdf5eb4273f5532579f3cfeaf97 100755 --- a/app/code/core/Mage/Eav/Model/Resource/Form/Attribute.php +++ b/app/code/core/Mage/Eav/Model/Resource/Form/Attribute.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Resource/Form/Attribute/Collection.php b/app/code/core/Mage/Eav/Model/Resource/Form/Attribute/Collection.php index 5b9d75b42dd8030d40eb9051fd2303b5d20486d1..23ea584571d9e10d68efe24b65617718ca068070 100755 --- a/app/code/core/Mage/Eav/Model/Resource/Form/Attribute/Collection.php +++ b/app/code/core/Mage/Eav/Model/Resource/Form/Attribute/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Resource/Form/Element.php b/app/code/core/Mage/Eav/Model/Resource/Form/Element.php index 09256c41889b6e2eae480c96b22a08239937ed0b..25fd43fa58f555e7295a07350f048b98460eff46 100755 --- a/app/code/core/Mage/Eav/Model/Resource/Form/Element.php +++ b/app/code/core/Mage/Eav/Model/Resource/Form/Element.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Resource/Form/Element/Collection.php b/app/code/core/Mage/Eav/Model/Resource/Form/Element/Collection.php index d810e00b44c92d05dceb997425f2580cb2a6ddc4..fdf4222cb0286f5a0ff8123545a0abfa7ff558b3 100755 --- a/app/code/core/Mage/Eav/Model/Resource/Form/Element/Collection.php +++ b/app/code/core/Mage/Eav/Model/Resource/Form/Element/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Resource/Form/Fieldset.php b/app/code/core/Mage/Eav/Model/Resource/Form/Fieldset.php index c78429cc62d6c74c7aa1818397cdeeaf35840add..739f66e894cd6ba78abbe59da75fe7a0f25dabb6 100755 --- a/app/code/core/Mage/Eav/Model/Resource/Form/Fieldset.php +++ b/app/code/core/Mage/Eav/Model/Resource/Form/Fieldset.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Resource/Form/Fieldset/Collection.php b/app/code/core/Mage/Eav/Model/Resource/Form/Fieldset/Collection.php index b7d310ea7cd7d959c3f65936472c78f8279f0497..c5733e49b605f0b78ec2b63197463eee7146ff69 100755 --- a/app/code/core/Mage/Eav/Model/Resource/Form/Fieldset/Collection.php +++ b/app/code/core/Mage/Eav/Model/Resource/Form/Fieldset/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Resource/Form/Type.php b/app/code/core/Mage/Eav/Model/Resource/Form/Type.php index e6b7288aca42a5174b7d28f9aad239a9aa4d02a0..64606aed889c98f347162bfd73da82f7bde3ca89 100755 --- a/app/code/core/Mage/Eav/Model/Resource/Form/Type.php +++ b/app/code/core/Mage/Eav/Model/Resource/Form/Type.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Resource/Form/Type/Collection.php b/app/code/core/Mage/Eav/Model/Resource/Form/Type/Collection.php index f1b0a923736e26e7d59c76784a50914952afa909..50da39b0ed31eae65f46d38e71ac5493560b199a 100755 --- a/app/code/core/Mage/Eav/Model/Resource/Form/Type/Collection.php +++ b/app/code/core/Mage/Eav/Model/Resource/Form/Type/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/Model/Resource/Helper/Mysql4.php b/app/code/core/Mage/Eav/Model/Resource/Helper/Mysql4.php index a652c6839afe21518bdad4755a6364dadf9cbd6f..e328656a8989929341504ad2ff5356ea94425ee4 100644 --- a/app/code/core/Mage/Eav/Model/Resource/Helper/Mysql4.php +++ b/app/code/core/Mage/Eav/Model/Resource/Helper/Mysql4.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/etc/config.xml b/app/code/core/Mage/Eav/etc/config.xml index c4a928fe16d2976718dd6a0c0481f440835839a7..03a08a7643d0f3d6956dba485bbd063e68130e87 100644 --- a/app/code/core/Mage/Eav/etc/config.xml +++ b/app/code/core/Mage/Eav/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Eav/sql/eav_setup/install-1.6.0.0.php b/app/code/core/Mage/Eav/sql/eav_setup/install-1.6.0.0.php index f493488eaa66d59d37ca05b55ce73151100b2142..132aa12359a89c5a4cd912dc934a97fad3b1ad5a 100644 --- a/app/code/core/Mage/Eav/sql/eav_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/Eav/sql/eav_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Eav - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Eav/view/adminhtml/attribute/edit/js.phtml b/app/code/core/Mage/Eav/view/adminhtml/attribute/edit/js.phtml index 2acd065758f7c7846dc7d29aa3976e6abf1cda16..06b9fcb86a249705cbf2cb1f1e7e4d7ef9474497 100644 --- a/app/code/core/Mage/Eav/view/adminhtml/attribute/edit/js.phtml +++ b/app/code/core/Mage/Eav/view/adminhtml/attribute/edit/js.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/GiftMessage/Block/Adminhtml/Product/Helper/Form/Config.php b/app/code/core/Mage/GiftMessage/Block/Adminhtml/Product/Helper/Form/Config.php index fbec821c35094d3a7b0d3ef399ddb8198c3d9bd6..e63e3f77115dc0b386eaf3aa40e4c8da6cf807c5 100644 --- a/app/code/core/Mage/GiftMessage/Block/Adminhtml/Product/Helper/Form/Config.php +++ b/app/code/core/Mage/GiftMessage/Block/Adminhtml/Product/Helper/Form/Config.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GiftMessage - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GiftMessage/Block/Adminhtml/Sales/Order/Create/Form.php b/app/code/core/Mage/GiftMessage/Block/Adminhtml/Sales/Order/Create/Form.php index 4493cf2c94d4d6643918a014dfa4d7fa50070474..9d62b1e59112e61e9366d10a0f7b66e03e6ee943 100644 --- a/app/code/core/Mage/GiftMessage/Block/Adminhtml/Sales/Order/Create/Form.php +++ b/app/code/core/Mage/GiftMessage/Block/Adminhtml/Sales/Order/Create/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GiftMessage - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GiftMessage/Block/Adminhtml/Sales/Order/Create/Giftoptions.php b/app/code/core/Mage/GiftMessage/Block/Adminhtml/Sales/Order/Create/Giftoptions.php index aa68d28548c88b2b096d227bea7ea70d5578536d..1b33f576b6497b96640edbf02da37a4d527baddf 100644 --- a/app/code/core/Mage/GiftMessage/Block/Adminhtml/Sales/Order/Create/Giftoptions.php +++ b/app/code/core/Mage/GiftMessage/Block/Adminhtml/Sales/Order/Create/Giftoptions.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GiftMessage - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GiftMessage/Block/Adminhtml/Sales/Order/Create/Items.php b/app/code/core/Mage/GiftMessage/Block/Adminhtml/Sales/Order/Create/Items.php index 1283d4bc49df126403f0ddc0c63398b55a474996..dcc5bb8c7bdeb9c88724493cbe51fbebc8d99802 100644 --- a/app/code/core/Mage/GiftMessage/Block/Adminhtml/Sales/Order/Create/Items.php +++ b/app/code/core/Mage/GiftMessage/Block/Adminhtml/Sales/Order/Create/Items.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GiftMessage - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GiftMessage/Block/Adminhtml/Sales/Order/View/Form.php b/app/code/core/Mage/GiftMessage/Block/Adminhtml/Sales/Order/View/Form.php index a3ddbe355b957adca5d67b1d071989c9228552b7..5c821418001e5b064c61d9a7bdd1142648f653a2 100644 --- a/app/code/core/Mage/GiftMessage/Block/Adminhtml/Sales/Order/View/Form.php +++ b/app/code/core/Mage/GiftMessage/Block/Adminhtml/Sales/Order/View/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GiftMessage - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GiftMessage/Block/Adminhtml/Sales/Order/View/Giftoptions.php b/app/code/core/Mage/GiftMessage/Block/Adminhtml/Sales/Order/View/Giftoptions.php index 1ae7f4cde2dc6fa0915b740e135a5de227f6bcb4..86e57804acd19f197febbb94298504a77c4046d5 100644 --- a/app/code/core/Mage/GiftMessage/Block/Adminhtml/Sales/Order/View/Giftoptions.php +++ b/app/code/core/Mage/GiftMessage/Block/Adminhtml/Sales/Order/View/Giftoptions.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GiftMessage - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GiftMessage/Block/Adminhtml/Sales/Order/View/Items.php b/app/code/core/Mage/GiftMessage/Block/Adminhtml/Sales/Order/View/Items.php index 8c5b7c05eb79c755a0a202b993639e99f37cdb5a..1c073ddf215c454d22b5597d32787fde057cee0a 100644 --- a/app/code/core/Mage/GiftMessage/Block/Adminhtml/Sales/Order/View/Items.php +++ b/app/code/core/Mage/GiftMessage/Block/Adminhtml/Sales/Order/View/Items.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GiftMessage - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GiftMessage/Block/Message/Inline.php b/app/code/core/Mage/GiftMessage/Block/Message/Inline.php index 390876f4a490c028f6c9f2ca03dd496072fa4cd0..152aaeb3719549ea9054e41467dc924bfe2354f3 100644 --- a/app/code/core/Mage/GiftMessage/Block/Message/Inline.php +++ b/app/code/core/Mage/GiftMessage/Block/Message/Inline.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GiftMessage - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GiftMessage/Helper/Data.php b/app/code/core/Mage/GiftMessage/Helper/Data.php index db5be0b396ad3b2d99ea11a0b893d165287521d2..302035c415b884f8454cc1bab9c8083408db83f2 100644 --- a/app/code/core/Mage/GiftMessage/Helper/Data.php +++ b/app/code/core/Mage/GiftMessage/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GiftMessage - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GiftMessage/Helper/Message.php b/app/code/core/Mage/GiftMessage/Helper/Message.php index 8135313b37b64bc3c34a7acf167f5b4e0da64d2b..486a09d2829b502c707668a51c00298560811c6e 100644 --- a/app/code/core/Mage/GiftMessage/Helper/Message.php +++ b/app/code/core/Mage/GiftMessage/Helper/Message.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GiftMessage - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GiftMessage/Helper/Url.php b/app/code/core/Mage/GiftMessage/Helper/Url.php index 60f7cd9301539ac6bd4b8c4d10dfe1b18fdfbe1e..347b89c8e890b34ad0355bc122d13a40fdbd1497 100644 --- a/app/code/core/Mage/GiftMessage/Helper/Url.php +++ b/app/code/core/Mage/GiftMessage/Helper/Url.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GiftMessage - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GiftMessage/Model/Api.php b/app/code/core/Mage/GiftMessage/Model/Api.php index d8c6998eb2bb767482a73c2bfbc527628e83cbd2..e6c2b2f2f4aab240f66976d0a8fd4efb141b2f04 100644 --- a/app/code/core/Mage/GiftMessage/Model/Api.php +++ b/app/code/core/Mage/GiftMessage/Model/Api.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GiftMessage - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GiftMessage/Model/Api/V2.php b/app/code/core/Mage/GiftMessage/Model/Api/V2.php index 62c9d32216eb8d3aa186a6e386ad8b6e93372aae..f90d06a1a25c67482287b449237fcdd8c641574f 100644 --- a/app/code/core/Mage/GiftMessage/Model/Api/V2.php +++ b/app/code/core/Mage/GiftMessage/Model/Api/V2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GiftMessage - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GiftMessage/Model/Message.php b/app/code/core/Mage/GiftMessage/Model/Message.php index 36bed7d9b22f2eec885e07e281efd49a107f8ba5..b18812a8620b3e100cd9c7b0c8616151aded3754 100644 --- a/app/code/core/Mage/GiftMessage/Model/Message.php +++ b/app/code/core/Mage/GiftMessage/Model/Message.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GiftMessage - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GiftMessage/Model/Observer.php b/app/code/core/Mage/GiftMessage/Model/Observer.php index 6874b52e2e35f1124ca6e4885cabe159e8d837c4..1f82727a9c82903f2f3de81def3a25f857138003 100644 --- a/app/code/core/Mage/GiftMessage/Model/Observer.php +++ b/app/code/core/Mage/GiftMessage/Model/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GiftMessage - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GiftMessage/Model/Resource/Message.php b/app/code/core/Mage/GiftMessage/Model/Resource/Message.php index b40d03c129c3088e518d895bc110114eba48e92f..13a0137ee98cc5608bc26aaffb538a72eff68913 100755 --- a/app/code/core/Mage/GiftMessage/Model/Resource/Message.php +++ b/app/code/core/Mage/GiftMessage/Model/Resource/Message.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GiftMessage - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GiftMessage/Model/Resource/Message/Collection.php b/app/code/core/Mage/GiftMessage/Model/Resource/Message/Collection.php index 9c9264ee9ac6ad938c0c876676a6f6c36bfbe5cb..e76924483d5c87a13e043c8a73d8ed4fd315432c 100755 --- a/app/code/core/Mage/GiftMessage/Model/Resource/Message/Collection.php +++ b/app/code/core/Mage/GiftMessage/Model/Resource/Message/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GiftMessage - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GiftMessage/Model/Resource/Setup.php b/app/code/core/Mage/GiftMessage/Model/Resource/Setup.php index f5f4560d6422f9ff10b27459dbf3ec544aa81430..b75bed35cc2a2a99f7dceb6bf10db6c24be0b5b6 100755 --- a/app/code/core/Mage/GiftMessage/Model/Resource/Setup.php +++ b/app/code/core/Mage/GiftMessage/Model/Resource/Setup.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GiftMessage - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GiftMessage/etc/api.xml b/app/code/core/Mage/GiftMessage/etc/api.xml index 638ff941c9ff81fdd08421384ff0e3e19d73cc7f..0363221dce2fa1c0185562f7ca27046e5fec1000 100644 --- a/app/code/core/Mage/GiftMessage/etc/api.xml +++ b/app/code/core/Mage/GiftMessage/etc/api.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_GiftMessage - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/GiftMessage/etc/config.xml b/app/code/core/Mage/GiftMessage/etc/config.xml index 1c72c6915e0a7b3ecbd35e3e96d331a83eda2007..ae3e9fada05ae9ee294209dfefbf3bd1714d1b21 100644 --- a/app/code/core/Mage/GiftMessage/etc/config.xml +++ b/app/code/core/Mage/GiftMessage/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_GiftMessage - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/GiftMessage/etc/system.xml b/app/code/core/Mage/GiftMessage/etc/system.xml index 25e7fba7662a7df9ec3352c4b70b5caad7357806..f3fd8de93c0e95f5e60ba9f6cb1b58fb4c50449d 100644 --- a/app/code/core/Mage/GiftMessage/etc/system.xml +++ b/app/code/core/Mage/GiftMessage/etc/system.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_GiftMessage - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/GiftMessage/sql/giftmessage_setup/install-1.6.0.0.php b/app/code/core/Mage/GiftMessage/sql/giftmessage_setup/install-1.6.0.0.php index feb3008dc24ab3762950dc7866abb6770ea82ecc..721477018c14e723265d0a1d83bdcdb3d0ac02b5 100644 --- a/app/code/core/Mage/GiftMessage/sql/giftmessage_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/GiftMessage/sql/giftmessage_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GiftMessage - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GiftMessage/view/adminhtml/form.phtml b/app/code/core/Mage/GiftMessage/view/adminhtml/form.phtml index 740b651c4493fbb7f45a8525bb6eecc3f60a4e90..b5a2de4221ffec5c2d9b5e9a78733a80cd0c1876 100644 --- a/app/code/core/Mage/GiftMessage/view/adminhtml/form.phtml +++ b/app/code/core/Mage/GiftMessage/view/adminhtml/form.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/GiftMessage/view/adminhtml/giftoptionsform.phtml b/app/code/core/Mage/GiftMessage/view/adminhtml/giftoptionsform.phtml index 3b899780534a7f71ebeae1d6a138c223961cc236..57d211cdc6d3582f04b4018de648c17eadb7ddfe 100644 --- a/app/code/core/Mage/GiftMessage/view/adminhtml/giftoptionsform.phtml +++ b/app/code/core/Mage/GiftMessage/view/adminhtml/giftoptionsform.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/GiftMessage/view/adminhtml/helper.phtml b/app/code/core/Mage/GiftMessage/view/adminhtml/helper.phtml index 55abca1d776182c420f4899486901a068572f6a7..62e53886cb27067e39a0cd43ac978b470729be27 100644 --- a/app/code/core/Mage/GiftMessage/view/adminhtml/helper.phtml +++ b/app/code/core/Mage/GiftMessage/view/adminhtml/helper.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/GiftMessage/view/adminhtml/layout.xml b/app/code/core/Mage/GiftMessage/view/adminhtml/layout.xml index b8b559a0c74e9b8c6a5add2460e5a0771134504b..d487fd3e5f95a36a10b96165b636e4190b7c2696 100644 --- a/app/code/core/Mage/GiftMessage/view/adminhtml/layout.xml +++ b/app/code/core/Mage/GiftMessage/view/adminhtml/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/GiftMessage/view/adminhtml/popup.phtml b/app/code/core/Mage/GiftMessage/view/adminhtml/popup.phtml index 0bce6a970876bf5499b13bcbb1964ed091c6f0ac..7c9e0386770c71e80b1a137b800018eea886fa4f 100644 --- a/app/code/core/Mage/GiftMessage/view/adminhtml/popup.phtml +++ b/app/code/core/Mage/GiftMessage/view/adminhtml/popup.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -37,8 +37,8 @@ <?php echo $this->getChildHtml();?> </div> <div class="buttons-set a-right"> - <button type="button" class="scalable" id="gift_options_cancel_button"><span><?php echo Mage::helper('Mage_GiftMessage_Helper_Data')->__('Cancel'); ?></span></button> - <button type="button" class="scalable" id="gift_options_ok_button"><span><?php echo Mage::helper('Mage_GiftMessage_Helper_Data')->__('OK'); ?></span></button> + <button type="button" class="scalable" id="gift_options_cancel_button"><span><span><span><?php echo Mage::helper('Mage_GiftMessage_Helper_Data')->__('Cancel'); ?></span></span></span></button> + <button type="button" class="scalable" id="gift_options_ok_button"><span><span><span><?php echo Mage::helper('Mage_GiftMessage_Helper_Data')->__('OK'); ?></span></span></span></button> </div> </div> </div> diff --git a/app/code/core/Mage/GiftMessage/view/adminhtml/sales/order/create/giftoptions.phtml b/app/code/core/Mage/GiftMessage/view/adminhtml/sales/order/create/giftoptions.phtml index f1f160b557945b8f65ce8956cfbca1ca7dd51349..34e6a1aa117c142e2fbca65d157e803c8ac2b3c2 100644 --- a/app/code/core/Mage/GiftMessage/view/adminhtml/sales/order/create/giftoptions.phtml +++ b/app/code/core/Mage/GiftMessage/view/adminhtml/sales/order/create/giftoptions.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/GiftMessage/view/adminhtml/sales/order/create/items.phtml b/app/code/core/Mage/GiftMessage/view/adminhtml/sales/order/create/items.phtml index a09e365317eb903cc0b1f165b03bba2dc360a088..b68eda9fdd6a6bff90782aee3b711cb7b62b3bc7 100644 --- a/app/code/core/Mage/GiftMessage/view/adminhtml/sales/order/create/items.phtml +++ b/app/code/core/Mage/GiftMessage/view/adminhtml/sales/order/create/items.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/GiftMessage/view/adminhtml/sales/order/view/giftoptions.phtml b/app/code/core/Mage/GiftMessage/view/adminhtml/sales/order/view/giftoptions.phtml index 8d74bfe6c91088b09dd1a7189e7ad3da079f0c41..0531d9385c87419157ac447652efa898ffed1e14 100644 --- a/app/code/core/Mage/GiftMessage/view/adminhtml/sales/order/view/giftoptions.phtml +++ b/app/code/core/Mage/GiftMessage/view/adminhtml/sales/order/view/giftoptions.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/GiftMessage/view/adminhtml/sales/order/view/items.phtml b/app/code/core/Mage/GiftMessage/view/adminhtml/sales/order/view/items.phtml index 34b1e6fdd03c090a242a21a5cc366ace58f06363..5212bea1379a54f81192dfd709c7865b51825480 100644 --- a/app/code/core/Mage/GiftMessage/view/adminhtml/sales/order/view/items.phtml +++ b/app/code/core/Mage/GiftMessage/view/adminhtml/sales/order/view/items.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/GiftMessage/view/frontend/inline.phtml b/app/code/core/Mage/GiftMessage/view/frontend/inline.phtml index 1c5362f871205982fda797bd3576168dec65fc2d..e4b362e21acc44d25745eb180dd064d10c6d7cd0 100644 --- a/app/code/core/Mage/GiftMessage/view/frontend/inline.phtml +++ b/app/code/core/Mage/GiftMessage/view/frontend/inline.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/GoogleAnalytics/Block/Ga.php b/app/code/core/Mage/GoogleAnalytics/Block/Ga.php index 2b5e41b15970402ae7e58a4630a530a26de8af9e..b3222cd3cf0f8bbbdac9b5d1e80d44f5b6d35346 100644 --- a/app/code/core/Mage/GoogleAnalytics/Block/Ga.php +++ b/app/code/core/Mage/GoogleAnalytics/Block/Ga.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleAnalytics - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleAnalytics/Helper/Data.php b/app/code/core/Mage/GoogleAnalytics/Helper/Data.php index bc988e3b115bede34dbcec89e775dd068f01acac..0c7c044b082babdf70dc2349246951971e501c56 100644 --- a/app/code/core/Mage/GoogleAnalytics/Helper/Data.php +++ b/app/code/core/Mage/GoogleAnalytics/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleAnalytics - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleAnalytics/Model/Observer.php b/app/code/core/Mage/GoogleAnalytics/Model/Observer.php index bfa7623235f8997b32667c6e0be123cf4e84590f..a227e3856d5b7a65655e34d2cf14053dc80726eb 100644 --- a/app/code/core/Mage/GoogleAnalytics/Model/Observer.php +++ b/app/code/core/Mage/GoogleAnalytics/Model/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleAnalytics - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleAnalytics/etc/adminhtml.xml b/app/code/core/Mage/GoogleAnalytics/etc/adminhtml.xml index dcde4d20aa9dfb24a626794544ff76f83ddcc892..ccd25751f238e3ea5eff30bb30f188f404014bf4 100644 --- a/app/code/core/Mage/GoogleAnalytics/etc/adminhtml.xml +++ b/app/code/core/Mage/GoogleAnalytics/etc/adminhtml.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_GoogleAnalytics - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/GoogleAnalytics/etc/config.xml b/app/code/core/Mage/GoogleAnalytics/etc/config.xml index 7ddfe805fe8c091666e7739d566fa4a85ef032e6..7a172ae45c9d9f3691eec1618d09613b0973551f 100644 --- a/app/code/core/Mage/GoogleAnalytics/etc/config.xml +++ b/app/code/core/Mage/GoogleAnalytics/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_GoogleAnalytics - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/GoogleAnalytics/etc/system.xml b/app/code/core/Mage/GoogleAnalytics/etc/system.xml index 16b486eb81438ec09333c18809dbb9926bc0c3b0..1c225eed5081c7e34aac8382931edbeb01c39d88 100644 --- a/app/code/core/Mage/GoogleAnalytics/etc/system.xml +++ b/app/code/core/Mage/GoogleAnalytics/etc/system.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_GoogleAnalytics - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/GoogleAnalytics/view/frontend/ga.phtml b/app/code/core/Mage/GoogleAnalytics/view/frontend/ga.phtml index c1bd50fcb80ac5c926f14fb16ef3bd9631b66b0e..e9f935c425d44ce5650043fe3ee7a3e101a008eb 100644 --- a/app/code/core/Mage/GoogleAnalytics/view/frontend/ga.phtml +++ b/app/code/core/Mage/GoogleAnalytics/view/frontend/ga.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/GoogleAnalytics/view/frontend/layout.xml b/app/code/core/Mage/GoogleAnalytics/view/frontend/layout.xml index 1208bbc8a8c7ceacd8ad9d9feaf7e9bc4c306b04..afd85b58dbe7906983cbbebc4e9c94f9d4caca96 100644 --- a/app/code/core/Mage/GoogleAnalytics/view/frontend/layout.xml +++ b/app/code/core/Mage/GoogleAnalytics/view/frontend/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/GoogleCheckout/Block/Adminhtml/Shipping/Applicable/Countries.php b/app/code/core/Mage/GoogleCheckout/Block/Adminhtml/Shipping/Applicable/Countries.php index 44c8143f27647f8a77b50301bf6512f6ae00c0ea..576e03ff8aeaad6b4e32c3ad2a6f160cac8406fe 100644 --- a/app/code/core/Mage/GoogleCheckout/Block/Adminhtml/Shipping/Applicable/Countries.php +++ b/app/code/core/Mage/GoogleCheckout/Block/Adminhtml/Shipping/Applicable/Countries.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleCheckout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleCheckout/Block/Adminhtml/Shipping/Merchant.php b/app/code/core/Mage/GoogleCheckout/Block/Adminhtml/Shipping/Merchant.php index a873bef4825e172f89368fbf6b4f85b5905c1d86..b2bdf61092fa83595cf7e57bcf13477b42133a0c 100644 --- a/app/code/core/Mage/GoogleCheckout/Block/Adminhtml/Shipping/Merchant.php +++ b/app/code/core/Mage/GoogleCheckout/Block/Adminhtml/Shipping/Merchant.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleCheckout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleCheckout/Block/Form.php b/app/code/core/Mage/GoogleCheckout/Block/Form.php index 3cfde4b2fddb92ea7d043075e4020deec4426366..18a8b241d64f0b364d330b9f4b0b814eeacb348b 100644 --- a/app/code/core/Mage/GoogleCheckout/Block/Form.php +++ b/app/code/core/Mage/GoogleCheckout/Block/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleCheckout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleCheckout/Block/Link.php b/app/code/core/Mage/GoogleCheckout/Block/Link.php index a42816fb4d61707a32b49c03dd1c2a5509b6ca59..94edf92edb06827636c7223fd7665e8916cb34a0 100644 --- a/app/code/core/Mage/GoogleCheckout/Block/Link.php +++ b/app/code/core/Mage/GoogleCheckout/Block/Link.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleCheckout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleCheckout/Block/Redirect.php b/app/code/core/Mage/GoogleCheckout/Block/Redirect.php index 71f735f5915fe8fd6d198a027414976e3459c8c5..f9b65758f5322890368d5ba3af1ec9a546c0ac5e 100644 --- a/app/code/core/Mage/GoogleCheckout/Block/Redirect.php +++ b/app/code/core/Mage/GoogleCheckout/Block/Redirect.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleCheckout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleCheckout/Exception.php b/app/code/core/Mage/GoogleCheckout/Exception.php index 4eac7748c14cca993777b886b6b06056d4d40405..208c1dcc8df2dddad9cfa5d60366cf72a0152ac7 100644 --- a/app/code/core/Mage/GoogleCheckout/Exception.php +++ b/app/code/core/Mage/GoogleCheckout/Exception.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleCheckout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleCheckout/Helper/Data.php b/app/code/core/Mage/GoogleCheckout/Helper/Data.php index 674a4c29338d269a1228b31c2cad08b77f745ac9..d422bd2ed40683e45dffac30fd756b9d73bcd51a 100644 --- a/app/code/core/Mage/GoogleCheckout/Helper/Data.php +++ b/app/code/core/Mage/GoogleCheckout/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleCheckout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleCheckout/Model/Api.php b/app/code/core/Mage/GoogleCheckout/Model/Api.php index 612096adca404dfa7b0b2b33c2b8b4ae39b1bee8..6de48f17e7bb9faad43f8e6467be939381e21497 100644 --- a/app/code/core/Mage/GoogleCheckout/Model/Api.php +++ b/app/code/core/Mage/GoogleCheckout/Model/Api.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleCheckout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleCheckout/Model/Api/Debug.php b/app/code/core/Mage/GoogleCheckout/Model/Api/Debug.php index 2404ff7e9bc0c8592e29c1793d4e5ae3faf795e8..d1a984c064761a12fe6c751dbb27f4c0b7319679 100644 --- a/app/code/core/Mage/GoogleCheckout/Model/Api/Debug.php +++ b/app/code/core/Mage/GoogleCheckout/Model/Api/Debug.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleCheckout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleCheckout/Model/Api/Xml/Abstract.php b/app/code/core/Mage/GoogleCheckout/Model/Api/Xml/Abstract.php index 1cd55dd7f66b958ebe8aeb83c0b50981c1ed7b5b..b10ff30e0f6e7138653e932b8fa157b82e46c84f 100644 --- a/app/code/core/Mage/GoogleCheckout/Model/Api/Xml/Abstract.php +++ b/app/code/core/Mage/GoogleCheckout/Model/Api/Xml/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleCheckout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleCheckout/Model/Api/Xml/Calculate.php b/app/code/core/Mage/GoogleCheckout/Model/Api/Xml/Calculate.php index c8f9a92fb4c1e44961a3cd9e2b3af8cb1c9b14be..5cf439b2260816c29793530aebf6e246b4269e31 100644 --- a/app/code/core/Mage/GoogleCheckout/Model/Api/Xml/Calculate.php +++ b/app/code/core/Mage/GoogleCheckout/Model/Api/Xml/Calculate.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleCheckout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleCheckout/Model/Api/Xml/Callback.php b/app/code/core/Mage/GoogleCheckout/Model/Api/Xml/Callback.php index 4d5126ce994c7e76b9a9e8146d6d5b50d754920e..403ade7355ccecb1bf89eee3f4d42cb0b5e675bf 100644 --- a/app/code/core/Mage/GoogleCheckout/Model/Api/Xml/Callback.php +++ b/app/code/core/Mage/GoogleCheckout/Model/Api/Xml/Callback.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleCheckout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -679,10 +679,7 @@ class Mage_GoogleCheckout_Model_Api_Xml_Callback extends Mage_GoogleCheckout_Mod if (null !== ($shipping = $this->getData($prefix . 'carrier-calculated-shipping-adjustment'))) { $method = 'googlecheckout_carrier'; } else if (null !== ($shipping = $this->getData($prefix . 'merchant-calculated-shipping-adjustment'))) { - $method = $this->_getShippingMethodByName($shipping['shipping-name']['VALUE']); - if ($method === false) { - $method = 'googlecheckout_merchant'; - } + $method = 'googlecheckout_merchant'; } else if (null !== ($shipping = $this->getData($prefix . 'flat-rate-shipping-adjustment'))) { $method = 'googlecheckout_flatrate'; } else if (null !== ($shipping = $this->getData($prefix . 'pickup-shipping-adjustment'))) { diff --git a/app/code/core/Mage/GoogleCheckout/Model/Api/Xml/Checkout.php b/app/code/core/Mage/GoogleCheckout/Model/Api/Xml/Checkout.php index 9171e3e274ddb94e876b62ff868e874a577fdd05..45a8254ca57a09e3ba33b6ffabc83db1ab683ad2 100644 --- a/app/code/core/Mage/GoogleCheckout/Model/Api/Xml/Checkout.php +++ b/app/code/core/Mage/GoogleCheckout/Model/Api/Xml/Checkout.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleCheckout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -889,10 +889,7 @@ EOT; { $customerGroup = $this->getQuote()->getCustomerGroupId(); if (!$customerGroup) { - $customerGroup = Mage::getStoreConfig( - Mage_Customer_Model_Group::XML_PATH_DEFAULT_ID, - $this->getQuote()->getStoreId() - ); + $customerGroup = Mage::helper('Mage_Customer_Helper_Data')->getDefaultCustomerGroupId($this->getQuote()->getStoreId()); } return Mage::getModel('Mage_Customer_Model_Group')->load($customerGroup)->getTaxClassId(); } diff --git a/app/code/core/Mage/GoogleCheckout/Model/Api/Xml/Order.php b/app/code/core/Mage/GoogleCheckout/Model/Api/Xml/Order.php index 00e5c458531000f67e4e49eac157544eef18529b..bc2a651d03b7e745d4df4d4d6fe297df8d255698 100644 --- a/app/code/core/Mage/GoogleCheckout/Model/Api/Xml/Order.php +++ b/app/code/core/Mage/GoogleCheckout/Model/Api/Xml/Order.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleCheckout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleCheckout/Model/Notification.php b/app/code/core/Mage/GoogleCheckout/Model/Notification.php index 24f5d10caddb0bed37b4deb4fb92a57743d74431..dd59405f76ceb4e39bec46eb24a8cd44c5857f6c 100644 --- a/app/code/core/Mage/GoogleCheckout/Model/Notification.php +++ b/app/code/core/Mage/GoogleCheckout/Model/Notification.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleCheckout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleCheckout/Model/Observer.php b/app/code/core/Mage/GoogleCheckout/Model/Observer.php index 5c7b9c04ec7fc51bf299feb0d2b3253eecd3b1c2..ce7b29765a459d5040c1a6396020b0b2ac33c193 100644 --- a/app/code/core/Mage/GoogleCheckout/Model/Observer.php +++ b/app/code/core/Mage/GoogleCheckout/Model/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleCheckout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -38,8 +38,20 @@ class Mage_GoogleCheckout_Model_Observer $track = $observer->getEvent()->getTrack(); $order = $track->getShipment()->getOrder(); + $shippingMethod = $order->getShippingMethod(); // String in format of 'carrier_method' + if (!$shippingMethod) { + return; + } - if ($order->getShippingMethod()!='googlecheckout_carrier') { + // Process only Google Checkout internal methods + /* @var $gcCarrier Mage_GoogleCheckout_Model_Shipping */ + $gcCarrier = Mage::getModel('Mage_GoogleCheckout_Model_Shipping'); + list($carrierCode, $methodCode) = explode('_', $shippingMethod); + if ($gcCarrier->getCarrierCode() != $carrierCode) { + return; + } + $internalMethods = $gcCarrier->getInternallyAllowedMethods(); + if (!isset($internalMethods[$methodCode])) { return; } diff --git a/app/code/core/Mage/GoogleCheckout/Model/Payment.php b/app/code/core/Mage/GoogleCheckout/Model/Payment.php index ce71eb4f785cc7e6092255f34b9dce05c7dcd1da..26a9746c71730ad01e23033fd1f9acb2a24d11b8 100644 --- a/app/code/core/Mage/GoogleCheckout/Model/Payment.php +++ b/app/code/core/Mage/GoogleCheckout/Model/Payment.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleCheckout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -59,7 +59,7 @@ class Mage_GoogleCheckout_Model_Payment extends Mage_Payment_Model_Method_Abstra /** * Return Order Place Redirect URL * - * @return string Order Redirect URL + * @return string Order Redirect URL */ public function getOrderPlaceRedirectUrl() { @@ -114,21 +114,15 @@ class Mage_GoogleCheckout_Model_Payment extends Mage_Payment_Model_Method_Abstra /** * Refund money * - * @param Varien_Object $invoicePayment + * @param Varien_Object $payment + * @param float $amount + * * @return Mage_GoogleCheckout_Model_Payment */ - //public function refund(Varien_Object $payment, $amount) public function refund(Varien_Object $payment, $amount) { - $hlp = Mage::helper('Mage_GoogleCheckout_Helper_Data'); - -// foreach ($payment->getCreditMemo()->getCommentsCollection() as $comment) { -// $this->setReason($hlp->__('See Comments')); -// $this->setComment($comment->getComment()); -// } - - $reason = $this->getReason() ? $this->getReason() : $hlp->__('No Reason'); - $comment = $this->getComment() ? $this->getComment() : $hlp->__('No Comment'); + $reason = $this->getReason() ? $this->getReason() : Mage::helper('Mage_GoogleCheckout_Helper_Data')->__('No Reason'); + $comment = $this->getComment() ? $this->getComment() : Mage::helper('Mage_GoogleCheckout_Helper_Data')->__('No Comment'); $api = Mage::getModel('Mage_GoogleCheckout_Model_Api')->setStoreId($payment->getOrder()->getStoreId()); $api->refund($payment->getOrder()->getExtOrderId(), $amount, $reason, $comment); @@ -146,15 +140,15 @@ class Mage_GoogleCheckout_Model_Payment extends Mage_Payment_Model_Method_Abstra /** * Void payment * - * @param Varien_Object $invoicePayment - * @return Mage_GoogleCheckout_Model_Payment + * @param Varien_Object $payment + * + * @return Mage_GoogleCheckout_Model_Payment */ public function cancel(Varien_Object $payment) { if (!$payment->getOrder()->getBeingCanceledFromGoogleApi()) { - $hlp = Mage::helper('Mage_GoogleCheckout_Helper_Data'); - $reason = $this->getReason() ? $this->getReason() : $hlp->__('Unknown Reason'); - $comment = $this->getComment() ? $this->getComment() : $hlp->__('No Comment'); + $reason = $this->getReason() ? $this->getReason() : Mage::helper('Mage_GoogleCheckout_Helper_Data')->__('Unknown Reason'); + $comment = $this->getComment() ? $this->getComment() : Mage::helper('Mage_GoogleCheckout_Helper_Data')->__('No Comment'); $api = Mage::getModel('Mage_GoogleCheckout_Model_Api')->setStoreId($payment->getOrder()->getStoreId()); $api->cancel($payment->getOrder()->getExtOrderId(), $reason, $comment); @@ -164,10 +158,11 @@ class Mage_GoogleCheckout_Model_Payment extends Mage_Payment_Model_Method_Abstra } /** - * Retrieve information from payment configuration. - * Rewrited because of custom node for checkout settings + * Retrieve information from payment configuration + * + * @param string $field + * @param int|string|null|Mage_Core_Model_Store $storeId * - * @param string $field * @return mixed */ public function getConfigData($field, $storeId = null) @@ -176,6 +171,7 @@ class Mage_GoogleCheckout_Model_Payment extends Mage_Payment_Model_Method_Abstra $storeId = $this->getStore(); } $path = 'google/checkout/' . $field; + return Mage::getStoreConfig($path, $storeId); } diff --git a/app/code/core/Mage/GoogleCheckout/Model/Resource/Api/Debug.php b/app/code/core/Mage/GoogleCheckout/Model/Resource/Api/Debug.php index 0f24f4e50ddd6a8095d1f2ca247c64ca647be687..1366b9036b6775dae0ef731a53615a7a8529a548 100755 --- a/app/code/core/Mage/GoogleCheckout/Model/Resource/Api/Debug.php +++ b/app/code/core/Mage/GoogleCheckout/Model/Resource/Api/Debug.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleCheckout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleCheckout/Model/Resource/Api/Debug/Collection.php b/app/code/core/Mage/GoogleCheckout/Model/Resource/Api/Debug/Collection.php index 64938f725d9d9196bab5d1ad359c1fb2b3bd0a04..165994d9d785e50bd60eac3b6d682a3ff69493ec 100755 --- a/app/code/core/Mage/GoogleCheckout/Model/Resource/Api/Debug/Collection.php +++ b/app/code/core/Mage/GoogleCheckout/Model/Resource/Api/Debug/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleCheckout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleCheckout/Model/Resource/Notification.php b/app/code/core/Mage/GoogleCheckout/Model/Resource/Notification.php index 69dd547e909d000700b1d8f5eb2ddc585dbe5138..b5e95ac00ee1db031ffd282bd8125ddc7f85ec0b 100755 --- a/app/code/core/Mage/GoogleCheckout/Model/Resource/Notification.php +++ b/app/code/core/Mage/GoogleCheckout/Model/Resource/Notification.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleCheckout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleCheckout/Model/Resource/Setup.php b/app/code/core/Mage/GoogleCheckout/Model/Resource/Setup.php index ec0fddd8bff67f68af32060016bab0ad086bfa9f..9f48d4288a46b31973a00f6b8b93bcedf24b81d4 100755 --- a/app/code/core/Mage/GoogleCheckout/Model/Resource/Setup.php +++ b/app/code/core/Mage/GoogleCheckout/Model/Resource/Setup.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleCheckout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleCheckout/Model/Shipping.php b/app/code/core/Mage/GoogleCheckout/Model/Shipping.php index c29aeb6f7b1b49ca5c1beb4d422cba5dd9bb69ae..e6c8516671fe94df03e5fabe76e12dfdc6317408 100644 --- a/app/code/core/Mage/GoogleCheckout/Model/Shipping.php +++ b/app/code/core/Mage/GoogleCheckout/Model/Shipping.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleCheckout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleCheckout/Model/Source/Checkout/Image.php b/app/code/core/Mage/GoogleCheckout/Model/Source/Checkout/Image.php index 477d336bce6a0bce9dd3f299c4c059ce4d50d981..daa4901d439fc3491a1b84c618cadcffca3b2e2f 100644 --- a/app/code/core/Mage/GoogleCheckout/Model/Source/Checkout/Image.php +++ b/app/code/core/Mage/GoogleCheckout/Model/Source/Checkout/Image.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleCheckout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleCheckout/Model/Source/Locale.php b/app/code/core/Mage/GoogleCheckout/Model/Source/Locale.php index 43edb5c08f2bcd2937f423b58d527ee93c403034..61ec727477dc7f37e9026f35fa9e4d0d3b567fe8 100644 --- a/app/code/core/Mage/GoogleCheckout/Model/Source/Locale.php +++ b/app/code/core/Mage/GoogleCheckout/Model/Source/Locale.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleCheckout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleCheckout/Model/Source/Shipping/Carrier.php b/app/code/core/Mage/GoogleCheckout/Model/Source/Shipping/Carrier.php index fc4531e8cd47fdad450a49397af7dfcc570f04b9..014e93405801d1e24c0d694109dba086c785b865 100644 --- a/app/code/core/Mage/GoogleCheckout/Model/Source/Shipping/Carrier.php +++ b/app/code/core/Mage/GoogleCheckout/Model/Source/Shipping/Carrier.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleCheckout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -29,31 +29,30 @@ class Mage_GoogleCheckout_Model_Source_Shipping_Carrier { public function toOptionArray() { - $hlp = Mage::helper('Mage_GoogleCheckout_Helper_Data'); return array( - array('label' => $hlp->__('FedEx'), 'value' => array( - array('label' => $hlp->__('Ground'), 'value' => 'FedEx/Ground'), - array('label' => $hlp->__('Home Delivery'), 'value' => 'FedEx/Home Delivery'), - array('label' => $hlp->__('Express Saver'), 'value' => 'FedEx/Express Saver'), - array('label' => $hlp->__('First Overnight'), 'value' => 'FedEx/First Overnight'), - array('label' => $hlp->__('Priority Overnight'), 'value' => 'FedEx/Priority Overnight'), - array('label' => $hlp->__('Standard Overnight'), 'value' => 'FedEx/Standard Overnight'), - array('label' => $hlp->__('2Day'), 'value' => 'FedEx/2Day'), + array('label' => Mage::helper('Mage_GoogleCheckout_Helper_Data')->__('FedEx'), 'value' => array( + array('label' => Mage::helper('Mage_GoogleCheckout_Helper_Data')->__('Ground'), 'value' => 'FedEx/Ground'), + array('label' => Mage::helper('Mage_GoogleCheckout_Helper_Data')->__('Home Delivery'), 'value' => 'FedEx/Home Delivery'), + array('label' => Mage::helper('Mage_GoogleCheckout_Helper_Data')->__('Express Saver'), 'value' => 'FedEx/Express Saver'), + array('label' => Mage::helper('Mage_GoogleCheckout_Helper_Data')->__('First Overnight'), 'value' => 'FedEx/First Overnight'), + array('label' => Mage::helper('Mage_GoogleCheckout_Helper_Data')->__('Priority Overnight'), 'value' => 'FedEx/Priority Overnight'), + array('label' => Mage::helper('Mage_GoogleCheckout_Helper_Data')->__('Standard Overnight'), 'value' => 'FedEx/Standard Overnight'), + array('label' => Mage::helper('Mage_GoogleCheckout_Helper_Data')->__('2Day'), 'value' => 'FedEx/2Day'), )), - array('label' => $hlp->__('UPS'), 'value' => array( - array('label' => $hlp->__('Next Day Air'), 'value' => 'UPS/Next Day Air'), - array('label' => $hlp->__('Next Day Air Early AM'), 'value' => 'UPS/Next Day Air Early AM'), - array('label' => $hlp->__('Next Day Air Saver'), 'value' => 'UPS/Next Day Air Saver'), - array('label' => $hlp->__('2nd Day Air'), 'value' => 'UPS/2nd Day Air'), - array('label' => $hlp->__('2nd Day Air AM'), 'value' => 'UPS/2nd Day Air AM'), - array('label' => $hlp->__('3 Day Select'), 'value' => 'UPS/3 Day Select'), - array('label' => $hlp->__('Ground'), 'value' => 'UPS/Ground'), + array('label' => Mage::helper('Mage_GoogleCheckout_Helper_Data')->__('UPS'), 'value' => array( + array('label' => Mage::helper('Mage_GoogleCheckout_Helper_Data')->__('Next Day Air'), 'value' => 'UPS/Next Day Air'), + array('label' => Mage::helper('Mage_GoogleCheckout_Helper_Data')->__('Next Day Air Early AM'), 'value' => 'UPS/Next Day Air Early AM'), + array('label' => Mage::helper('Mage_GoogleCheckout_Helper_Data')->__('Next Day Air Saver'), 'value' => 'UPS/Next Day Air Saver'), + array('label' => Mage::helper('Mage_GoogleCheckout_Helper_Data')->__('2nd Day Air'), 'value' => 'UPS/2nd Day Air'), + array('label' => Mage::helper('Mage_GoogleCheckout_Helper_Data')->__('2nd Day Air AM'), 'value' => 'UPS/2nd Day Air AM'), + array('label' => Mage::helper('Mage_GoogleCheckout_Helper_Data')->__('3 Day Select'), 'value' => 'UPS/3 Day Select'), + array('label' => Mage::helper('Mage_GoogleCheckout_Helper_Data')->__('Ground'), 'value' => 'UPS/Ground'), )), - array('label' => $hlp->__('USPS'), 'value' => array( - array('label' => $hlp->__('Express Mail'), 'value' => 'USPS/Express Mail'), - array('label' => $hlp->__('Priority Mail'), 'value' => 'USPS/Priority Mail'), - array('label' => $hlp->__('Parcel Post'), 'value' => 'USPS/Parcel Post'), - array('label' => $hlp->__('Media Mail'), 'value' => 'USPS/Media Mail'), + array('label' => Mage::helper('Mage_GoogleCheckout_Helper_Data')->__('USPS'), 'value' => array( + array('label' => Mage::helper('Mage_GoogleCheckout_Helper_Data')->__('Express Mail'), 'value' => 'USPS/Express Mail'), + array('label' => Mage::helper('Mage_GoogleCheckout_Helper_Data')->__('Priority Mail'), 'value' => 'USPS/Priority Mail'), + array('label' => Mage::helper('Mage_GoogleCheckout_Helper_Data')->__('Parcel Post'), 'value' => 'USPS/Parcel Post'), + array('label' => Mage::helper('Mage_GoogleCheckout_Helper_Data')->__('Media Mail'), 'value' => 'USPS/Media Mail'), )), ); } diff --git a/app/code/core/Mage/GoogleCheckout/Model/Source/Shipping/Category.php b/app/code/core/Mage/GoogleCheckout/Model/Source/Shipping/Category.php index a411f8e1f341355214d3d98464742ac5f132148e..b4271ba320176c21b13a5babc93af35aa7e80e65 100644 --- a/app/code/core/Mage/GoogleCheckout/Model/Source/Shipping/Category.php +++ b/app/code/core/Mage/GoogleCheckout/Model/Source/Shipping/Category.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleCheckout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -29,10 +29,9 @@ class Mage_GoogleCheckout_Model_Source_Shipping_Category { public function toOptionArray() { - $hlp = Mage::helper('Mage_GoogleCheckout_Helper_Data'); return array( - array('value' => 'COMMERCIAL', 'label' => $hlp->__('Commercial')), - array('value' => 'RESIDENTIAL', 'label' => $hlp->__('Residential')), + array('value' => 'COMMERCIAL', 'label' => Mage::helper('Mage_GoogleCheckout_Helper_Data')->__('Commercial')), + array('value' => 'RESIDENTIAL', 'label' => Mage::helper('Mage_GoogleCheckout_Helper_Data')->__('Residential')), ); } } diff --git a/app/code/core/Mage/GoogleCheckout/Model/Source/Shipping/Units.php b/app/code/core/Mage/GoogleCheckout/Model/Source/Shipping/Units.php index 9f8e45d1042eac4778cb6c12ecfa6d0701294115..2eddc3825fad20abc95152fe5c1cba775e2a3305 100644 --- a/app/code/core/Mage/GoogleCheckout/Model/Source/Shipping/Units.php +++ b/app/code/core/Mage/GoogleCheckout/Model/Source/Shipping/Units.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleCheckout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -29,9 +29,8 @@ class Mage_GoogleCheckout_Model_Source_Shipping_Units { public function toOptionArray() { - $hlp = Mage::helper('Mage_GoogleCheckout_Helper_Data'); return array( - array('value' => 'IN', 'label' => $hlp->__('Inches')), + array('value' => 'IN', 'label' => Mage::helper('Mage_GoogleCheckout_Helper_Data')->__('Inches')), ); } } diff --git a/app/code/core/Mage/GoogleCheckout/Model/Source/Shipping/Virtual/Method.php b/app/code/core/Mage/GoogleCheckout/Model/Source/Shipping/Virtual/Method.php index dfb5a0935a1d53b60bc4de84649b2473e5e6e054..f47649e16ae03b772902b01ff371bbc7546f1a1d 100644 --- a/app/code/core/Mage/GoogleCheckout/Model/Source/Shipping/Virtual/Method.php +++ b/app/code/core/Mage/GoogleCheckout/Model/Source/Shipping/Virtual/Method.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleCheckout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -29,11 +29,10 @@ class Mage_GoogleCheckout_Model_Source_Shipping_Virtual_Method { public function toOptionArray() { - $hlp = Mage::helper('Mage_GoogleCheckout_Helper_Data'); return array( - array('value' => 'email', 'label' => $hlp->__('Email delivery')), - // array('value'=>'key_url', 'label'=>$hlp->__('Key/URL delivery')), - // array('value'=>'description_based', 'label'=>$hlp->__('Description-based delivery')), + array('value' => 'email', 'label' => Mage::helper('Mage_GoogleCheckout_Helper_Data')->__('Email delivery')), + // array('value'=>'key_url', 'label'=> Mage::helper('Mage_GoogleCheckout_Helper_Data')->__('Key/URL delivery')), + // array('value'=>'description_based', 'label'=> Mage::helper('Mage_GoogleCheckout_Helper_Data')->__('Description-based delivery')) ); } } diff --git a/app/code/core/Mage/GoogleCheckout/Model/Source/Shipping/Virtual/Schedule.php b/app/code/core/Mage/GoogleCheckout/Model/Source/Shipping/Virtual/Schedule.php index 90c5ca0c6edb11a41aac0a5133094c21932d0926..c5c55bbe8d154fda3c706e034ac517c2c49e52ea 100644 --- a/app/code/core/Mage/GoogleCheckout/Model/Source/Shipping/Virtual/Schedule.php +++ b/app/code/core/Mage/GoogleCheckout/Model/Source/Shipping/Virtual/Schedule.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleCheckout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -29,10 +29,9 @@ class Mage_GoogleCheckout_Model_Source_Shipping_Virtual_Schedule { public function toOptionArray() { - $hlp = Mage::helper('Mage_GoogleCheckout_Helper_Data'); return array( - array('value' => 'OPTIMISTIC', 'label' => $hlp->__('Optimistic')), - array('value' => 'PESSIMISTIC', 'label' => $hlp->__('Pessimistic')), + array('value' => 'OPTIMISTIC', 'label' => Mage::helper('Mage_GoogleCheckout_Helper_Data')->__('Optimistic')), + array('value' => 'PESSIMISTIC', 'label' => Mage::helper('Mage_GoogleCheckout_Helper_Data')->__('Pessimistic')), ); } } diff --git a/app/code/core/Mage/GoogleCheckout/controllers/ApiController.php b/app/code/core/Mage/GoogleCheckout/controllers/ApiController.php index c90ce6b0b371c629a41ea1f771ee54b5fee662ad..655b37d4fed0acf5fb44fb54382055336460c554 100644 --- a/app/code/core/Mage/GoogleCheckout/controllers/ApiController.php +++ b/app/code/core/Mage/GoogleCheckout/controllers/ApiController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleCheckout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleCheckout/controllers/RedirectController.php b/app/code/core/Mage/GoogleCheckout/controllers/RedirectController.php index 340b437b6a8b60444a2dd146e3faef494b986523..82faa14ff01f8f00f1297fe560e315a19d8ca8bc 100644 --- a/app/code/core/Mage/GoogleCheckout/controllers/RedirectController.php +++ b/app/code/core/Mage/GoogleCheckout/controllers/RedirectController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleCheckout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleCheckout/etc/adminhtml.xml b/app/code/core/Mage/GoogleCheckout/etc/adminhtml.xml index 02ef7509ed04297af5940a589583c37d9b5dd6a9..a519c218b401aab59206a13a0c038e0e4ca83761 100644 --- a/app/code/core/Mage/GoogleCheckout/etc/adminhtml.xml +++ b/app/code/core/Mage/GoogleCheckout/etc/adminhtml.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_GoogleCheckout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/GoogleCheckout/etc/config.xml b/app/code/core/Mage/GoogleCheckout/etc/config.xml index 93835a5a5e2e6d616598d7e2a01dc1449bc616ce..4760de94abd0b2c8edd1391afc2a7f29e50d0cff 100644 --- a/app/code/core/Mage/GoogleCheckout/etc/config.xml +++ b/app/code/core/Mage/GoogleCheckout/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_GoogleCheckout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/GoogleCheckout/etc/system.xml b/app/code/core/Mage/GoogleCheckout/etc/system.xml index 62f3fdfb4172cc3125cd545a612a4d37d57e196b..8ca1c73c0d4f2da583866707a66a4d30e5fc19bb 100644 --- a/app/code/core/Mage/GoogleCheckout/etc/system.xml +++ b/app/code/core/Mage/GoogleCheckout/etc/system.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_GoogleCheckout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/GoogleCheckout/sql/googlecheckout_setup/install-1.6.0.0.php b/app/code/core/Mage/GoogleCheckout/sql/googlecheckout_setup/install-1.6.0.0.php index d850163da40d886c158a0d14899297db002f39eb..cb55afc74dfca2df310517f85eaa67414e3efa9f 100644 --- a/app/code/core/Mage/GoogleCheckout/sql/googlecheckout_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/GoogleCheckout/sql/googlecheckout_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleCheckout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleCheckout/sql/googlecheckout_setup/upgrade-1.6.0.0-1.6.0.1.php b/app/code/core/Mage/GoogleCheckout/sql/googlecheckout_setup/upgrade-1.6.0.0-1.6.0.1.php index 4799c84e4b2c2f5d8c7818fa561b560d03df7db7..658cc33c69a1365fcc8cc679c5cc2c89e470a0b9 100644 --- a/app/code/core/Mage/GoogleCheckout/sql/googlecheckout_setup/upgrade-1.6.0.0-1.6.0.1.php +++ b/app/code/core/Mage/GoogleCheckout/sql/googlecheckout_setup/upgrade-1.6.0.0-1.6.0.1.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleCheckout - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleCheckout/view/frontend/form.phtml b/app/code/core/Mage/GoogleCheckout/view/frontend/form.phtml index 870a7f07f30ff1f7c1159b0c95f587e3a04d3139..be561d9e1dd48aa690f55e25bfc0133a34b98dcb 100644 --- a/app/code/core/Mage/GoogleCheckout/view/frontend/form.phtml +++ b/app/code/core/Mage/GoogleCheckout/view/frontend/form.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/GoogleCheckout/view/frontend/layout.xml b/app/code/core/Mage/GoogleCheckout/view/frontend/layout.xml index 70bd4c94d20551ed4c96f769e1398826e49dc694..d1a5e6dd6f6424b2dd86102e722d991f77e0ded7 100644 --- a/app/code/core/Mage/GoogleCheckout/view/frontend/layout.xml +++ b/app/code/core/Mage/GoogleCheckout/view/frontend/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/GoogleCheckout/view/frontend/link.phtml b/app/code/core/Mage/GoogleCheckout/view/frontend/link.phtml index 06d6a48d13ccf0e5ed247b27083706748eec5e58..46d60a0469dc4bfa97cc1946389f9a8d7c83ae12 100644 --- a/app/code/core/Mage/GoogleCheckout/view/frontend/link.phtml +++ b/app/code/core/Mage/GoogleCheckout/view/frontend/link.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/GoogleOptimizer/Block/Adminhtml/Catalog/Category/Edit/Tab/Googleoptimizer.php b/app/code/core/Mage/GoogleOptimizer/Block/Adminhtml/Catalog/Category/Edit/Tab/Googleoptimizer.php index b5ea526d959fabae1c4176fbb8d034f2a477e8a5..4c96f6552f9c50817dc378fcc8f706764c6f60cf 100644 --- a/app/code/core/Mage/GoogleOptimizer/Block/Adminhtml/Catalog/Category/Edit/Tab/Googleoptimizer.php +++ b/app/code/core/Mage/GoogleOptimizer/Block/Adminhtml/Catalog/Category/Edit/Tab/Googleoptimizer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleOptimizer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleOptimizer/Block/Adminhtml/Catalog/Form/Renderer/Import.php b/app/code/core/Mage/GoogleOptimizer/Block/Adminhtml/Catalog/Form/Renderer/Import.php index 3072e7f5af5cace76d7fd1aa869dd564f896c4d2..9b5c4372f96e01cc9bede6e0b9201bb4d3fd3fde 100644 --- a/app/code/core/Mage/GoogleOptimizer/Block/Adminhtml/Catalog/Form/Renderer/Import.php +++ b/app/code/core/Mage/GoogleOptimizer/Block/Adminhtml/Catalog/Form/Renderer/Import.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleOptimizer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleOptimizer/Block/Adminhtml/Catalog/Product/Edit/Tab/Googleoptimizer.php b/app/code/core/Mage/GoogleOptimizer/Block/Adminhtml/Catalog/Product/Edit/Tab/Googleoptimizer.php index 5b26c8948bc55cfd716249f84cd58809ef368729..72a4bc53721174c3676f8ac9b25df418f13e335b 100644 --- a/app/code/core/Mage/GoogleOptimizer/Block/Adminhtml/Catalog/Product/Edit/Tab/Googleoptimizer.php +++ b/app/code/core/Mage/GoogleOptimizer/Block/Adminhtml/Catalog/Product/Edit/Tab/Googleoptimizer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleOptimizer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleOptimizer/Block/Adminhtml/Cms/Page/Edit/Enable.php b/app/code/core/Mage/GoogleOptimizer/Block/Adminhtml/Cms/Page/Edit/Enable.php index 1f579512f736112a904ddc2335642d7a093ce55c..1bd44a05b793cb45147393dcd6306fefceb64e69 100644 --- a/app/code/core/Mage/GoogleOptimizer/Block/Adminhtml/Cms/Page/Edit/Enable.php +++ b/app/code/core/Mage/GoogleOptimizer/Block/Adminhtml/Cms/Page/Edit/Enable.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleOptimizer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleOptimizer/Block/Adminhtml/Cms/Page/Edit/Renderer/Conversion.php b/app/code/core/Mage/GoogleOptimizer/Block/Adminhtml/Cms/Page/Edit/Renderer/Conversion.php index 13e9124602ebd652bf4952e9d66b6aeae5af2f92..f5f8669637ab0bda6cb7f3020bfa01dbda56faab 100644 --- a/app/code/core/Mage/GoogleOptimizer/Block/Adminhtml/Cms/Page/Edit/Renderer/Conversion.php +++ b/app/code/core/Mage/GoogleOptimizer/Block/Adminhtml/Cms/Page/Edit/Renderer/Conversion.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleOptimizer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleOptimizer/Block/Adminhtml/Cms/Page/Edit/Tab/Googleoptimizer.php b/app/code/core/Mage/GoogleOptimizer/Block/Adminhtml/Cms/Page/Edit/Tab/Googleoptimizer.php index dc594b46b10cdf660e08e51dd54e8e7b801c7203..7baef19296c4464c6ffd1834933bfb1ccb0a4f47 100644 --- a/app/code/core/Mage/GoogleOptimizer/Block/Adminhtml/Cms/Page/Edit/Tab/Googleoptimizer.php +++ b/app/code/core/Mage/GoogleOptimizer/Block/Adminhtml/Cms/Page/Edit/Tab/Googleoptimizer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleOptimizer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleOptimizer/Block/Code.php b/app/code/core/Mage/GoogleOptimizer/Block/Code.php index 7f42340cf21811a1dae023f59fba89e365ff56fb..9c2c4b667f866b4949467d93cb53bf83a2fb32e9 100644 --- a/app/code/core/Mage/GoogleOptimizer/Block/Code.php +++ b/app/code/core/Mage/GoogleOptimizer/Block/Code.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleOptimizer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleOptimizer/Block/Code/Category.php b/app/code/core/Mage/GoogleOptimizer/Block/Code/Category.php index d9a6c54ab5510f778de624dbbd584809bc68c83f..aa5b89bfe1887e60e9f6760edda4ab2874de8975 100644 --- a/app/code/core/Mage/GoogleOptimizer/Block/Code/Category.php +++ b/app/code/core/Mage/GoogleOptimizer/Block/Code/Category.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleOptimizer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleOptimizer/Block/Code/Conversion.php b/app/code/core/Mage/GoogleOptimizer/Block/Code/Conversion.php index 9e080ede0f152a78258449ca50894800d30735ae..40d99663196ba19d50d613d7344e8b3cbcbeb24f 100644 --- a/app/code/core/Mage/GoogleOptimizer/Block/Code/Conversion.php +++ b/app/code/core/Mage/GoogleOptimizer/Block/Code/Conversion.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleOptimizer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleOptimizer/Block/Code/Page.php b/app/code/core/Mage/GoogleOptimizer/Block/Code/Page.php index f61fddf58f29b1da126761f5ff906a76d8fd36bb..0be2641581b2b5155e2996fda13c60aec5a40f8e 100644 --- a/app/code/core/Mage/GoogleOptimizer/Block/Code/Page.php +++ b/app/code/core/Mage/GoogleOptimizer/Block/Code/Page.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleOptimizer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleOptimizer/Block/Code/Product.php b/app/code/core/Mage/GoogleOptimizer/Block/Code/Product.php index 5ba6892fa3d11d34df5c8e025415c78638853bc6..419713de7a16705a47e03445e9a44dbb64f1bd4a 100644 --- a/app/code/core/Mage/GoogleOptimizer/Block/Code/Product.php +++ b/app/code/core/Mage/GoogleOptimizer/Block/Code/Product.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleOptimizer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleOptimizer/Block/Js.php b/app/code/core/Mage/GoogleOptimizer/Block/Js.php index c05909cccaf7d4700d25e3a6057dbaf89b287bda..00266209c4dd19aaa71cc0eb9356433d9b387ed7 100644 --- a/app/code/core/Mage/GoogleOptimizer/Block/Js.php +++ b/app/code/core/Mage/GoogleOptimizer/Block/Js.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleOptimizer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleOptimizer/Helper/Data.php b/app/code/core/Mage/GoogleOptimizer/Helper/Data.php index fd9139f2b4643e41d10224f7f45f3aeaa38cd27f..d438498ea2ce2b3680dbc2664bc88632039df1ad 100644 --- a/app/code/core/Mage/GoogleOptimizer/Helper/Data.php +++ b/app/code/core/Mage/GoogleOptimizer/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleOptimizer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleOptimizer/Model/Adminhtml/System/Config/Source/Googleoptimizer/Conversionpages.php b/app/code/core/Mage/GoogleOptimizer/Model/Adminhtml/System/Config/Source/Googleoptimizer/Conversionpages.php index f15df514fc87a79085a1666d3466cd4172b8ceca..01661c81b1ce67c6053d269d28912f9f5cf17507 100644 --- a/app/code/core/Mage/GoogleOptimizer/Model/Adminhtml/System/Config/Source/Googleoptimizer/Conversionpages.php +++ b/app/code/core/Mage/GoogleOptimizer/Model/Adminhtml/System/Config/Source/Googleoptimizer/Conversionpages.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleOptimizer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleOptimizer/Model/Code.php b/app/code/core/Mage/GoogleOptimizer/Model/Code.php index d58c230aba599e64d47c71da861ddadbf5693a64..87b4dd7fdd3e9e799de7b478869d0442c0cb0433 100644 --- a/app/code/core/Mage/GoogleOptimizer/Model/Code.php +++ b/app/code/core/Mage/GoogleOptimizer/Model/Code.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleOptimizer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleOptimizer/Model/Code/Category.php b/app/code/core/Mage/GoogleOptimizer/Model/Code/Category.php index 3240a51d6bc55dbc0b73634b0e15a8aa5c2f9ca0..a192794b4095377e0b43b159af2fe68084adc17c 100644 --- a/app/code/core/Mage/GoogleOptimizer/Model/Code/Category.php +++ b/app/code/core/Mage/GoogleOptimizer/Model/Code/Category.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleOptimizer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleOptimizer/Model/Code/Page.php b/app/code/core/Mage/GoogleOptimizer/Model/Code/Page.php index a9a1da973f066047a9043b27e0e079fa8ec232ca..48170645ef99597ce68fbacddc383249dcedecd4 100644 --- a/app/code/core/Mage/GoogleOptimizer/Model/Code/Page.php +++ b/app/code/core/Mage/GoogleOptimizer/Model/Code/Page.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleOptimizer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleOptimizer/Model/Code/Product.php b/app/code/core/Mage/GoogleOptimizer/Model/Code/Product.php index 05b5b67278ff94c210978a126f1b0db84f4f02a4..1048a0793a3bed11fbd074a65314a47431b99f9f 100644 --- a/app/code/core/Mage/GoogleOptimizer/Model/Code/Product.php +++ b/app/code/core/Mage/GoogleOptimizer/Model/Code/Product.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleOptimizer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleOptimizer/Model/Observer.php b/app/code/core/Mage/GoogleOptimizer/Model/Observer.php index e51cbb0036013290a37730d2d5d1e80b573b3685..e9685678d0cefa5cd3aec05b282046ceccdcbac3 100644 --- a/app/code/core/Mage/GoogleOptimizer/Model/Observer.php +++ b/app/code/core/Mage/GoogleOptimizer/Model/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleOptimizer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleOptimizer/Model/Resource/Code.php b/app/code/core/Mage/GoogleOptimizer/Model/Resource/Code.php index 2f33e0c4775407a559f895e50a62ae9c322aa8af..9dc49e3b29e228248387cef7daadde23e119faf4 100755 --- a/app/code/core/Mage/GoogleOptimizer/Model/Resource/Code.php +++ b/app/code/core/Mage/GoogleOptimizer/Model/Resource/Code.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleOptimizer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleOptimizer/Model/Resource/Code/Collection.php b/app/code/core/Mage/GoogleOptimizer/Model/Resource/Code/Collection.php index c58b9fcb56a79dde349a63f9775e0d39af391f67..954a2e72dfa79a23887960b1d3807eeef9e826c9 100755 --- a/app/code/core/Mage/GoogleOptimizer/Model/Resource/Code/Collection.php +++ b/app/code/core/Mage/GoogleOptimizer/Model/Resource/Code/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleOptimizer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleOptimizer/controllers/Adminhtml/Googleoptimizer/IndexController.php b/app/code/core/Mage/GoogleOptimizer/controllers/Adminhtml/Googleoptimizer/IndexController.php index a9b49b8e21d89f520f68340c27615837f5e4905e..830a1b6b12c68a70d574ead88d82c7082170a840 100755 --- a/app/code/core/Mage/GoogleOptimizer/controllers/Adminhtml/Googleoptimizer/IndexController.php +++ b/app/code/core/Mage/GoogleOptimizer/controllers/Adminhtml/Googleoptimizer/IndexController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleOptimizer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleOptimizer/etc/config.xml b/app/code/core/Mage/GoogleOptimizer/etc/config.xml index 2c8bb3349ccd15e313c6eca6a43ae657f046db85..49af1652ac6d776ef34d0fbc4e4340346937ac60 100644 --- a/app/code/core/Mage/GoogleOptimizer/etc/config.xml +++ b/app/code/core/Mage/GoogleOptimizer/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_GoogleOptimizer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/GoogleOptimizer/etc/system.xml b/app/code/core/Mage/GoogleOptimizer/etc/system.xml index 1f41724157f8d964b2d0fd8538083f4f0d23b18a..e7eca6794c35cde486cd590b0ffadf42b7f091eb 100644 --- a/app/code/core/Mage/GoogleOptimizer/etc/system.xml +++ b/app/code/core/Mage/GoogleOptimizer/etc/system.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_GoogleOptimizer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/GoogleOptimizer/sql/googleoptimizer_setup/install-1.6.0.0.php b/app/code/core/Mage/GoogleOptimizer/sql/googleoptimizer_setup/install-1.6.0.0.php index a0c9e7901a64651ce5813b604c3c276853a79205..989a72706d606e2383cb795cf229eda390d11f51 100644 --- a/app/code/core/Mage/GoogleOptimizer/sql/googleoptimizer_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/GoogleOptimizer/sql/googleoptimizer_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleOptimizer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleOptimizer/view/adminhtml/catalog/form/renderer/import.phtml b/app/code/core/Mage/GoogleOptimizer/view/adminhtml/catalog/form/renderer/import.phtml index 10c59b6a67b9a733ed96e73c955563ef3bbb21a7..e7120c90f701deca5a3c0164c42ab6019a390d0b 100644 --- a/app/code/core/Mage/GoogleOptimizer/view/adminhtml/catalog/form/renderer/import.phtml +++ b/app/code/core/Mage/GoogleOptimizer/view/adminhtml/catalog/form/renderer/import.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/GoogleOptimizer/view/adminhtml/cms/edit/renderer/conversion.phtml b/app/code/core/Mage/GoogleOptimizer/view/adminhtml/cms/edit/renderer/conversion.phtml index 9202bc5efc92f80169e108b355caaa5af224912e..b4e7ab340aefe1a71cba99c0e76c922a57d4bdbe 100644 --- a/app/code/core/Mage/GoogleOptimizer/view/adminhtml/cms/edit/renderer/conversion.phtml +++ b/app/code/core/Mage/GoogleOptimizer/view/adminhtml/cms/edit/renderer/conversion.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/GoogleOptimizer/view/adminhtml/js.phtml b/app/code/core/Mage/GoogleOptimizer/view/adminhtml/js.phtml index 82f52d1b1e3e6cd60b533175e5e7ebc77983ada8..5ea10532eeb81578a007efe5bc1f8b6fb9d4867c 100644 --- a/app/code/core/Mage/GoogleOptimizer/view/adminhtml/js.phtml +++ b/app/code/core/Mage/GoogleOptimizer/view/adminhtml/js.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/GoogleOptimizer/view/adminhtml/layout.xml b/app/code/core/Mage/GoogleOptimizer/view/adminhtml/layout.xml index cc86084cb0ce9d0355ee204c79d94a91da1b2d7e..9cb3c1acbd3ee73710cdc8a2c8814cd538dd05fe 100644 --- a/app/code/core/Mage/GoogleOptimizer/view/adminhtml/layout.xml +++ b/app/code/core/Mage/GoogleOptimizer/view/adminhtml/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/GoogleOptimizer/view/frontend/layout.xml b/app/code/core/Mage/GoogleOptimizer/view/frontend/layout.xml index 793cabed4971c5ebf712a1f83b90c26434e638b0..2bc1db6b5839aa159e92fa84f782ec5796cbc30e 100644 --- a/app/code/core/Mage/GoogleOptimizer/view/frontend/layout.xml +++ b/app/code/core/Mage/GoogleOptimizer/view/frontend/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Captcha.php b/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Captcha.php index cf731c46e42d8d00e270c97b2768d78bf2080983..522d4e8b4c115ad464b4b407941a2b3dc282ae03 100644 --- a/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Captcha.php +++ b/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Captcha.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Items.php b/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Items.php index 6a333f85d07cb0664859bf6514d7984d4e068107..25cfca23b8f1cd44502782f09b50034db1104ff0 100644 --- a/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Items.php +++ b/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Items.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Items/Item.php b/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Items/Item.php index 1f59e2e40f1fea38eda413f391cbe9bf4ba7a09e..df99a251c7a392b27729d86a191a0fa1022cc46e 100644 --- a/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Items/Item.php +++ b/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Items/Item.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Items/Product.php b/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Items/Product.php index 13cf52738992b381fca1345be3f82c55005b4c88..237a115bab666c602ff95b9011a830b1ebb234f6 100644 --- a/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Items/Product.php +++ b/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Items/Product.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Items/Renderer/Id.php b/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Items/Renderer/Id.php index 28bff1c9aa586f9062f07451059783c23a08ee35..ea1ba785c7d01aae63bf2b77ec8a5371be5a900c 100644 --- a/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Items/Renderer/Id.php +++ b/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Items/Renderer/Id.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Store/Switcher.php b/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Store/Switcher.php index 0ee7e7f85d2d38136d4532ca04d17bb0da0e2e66..8fd28c76f0e22efa0b8ef7e4417ab202ef94ea24 100644 --- a/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Store/Switcher.php +++ b/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Store/Switcher.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Types.php b/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Types.php index 750e68049db0fd7cce91780fbfcad80526b9b11f..a0f51ffa872295ad4681a87eeb6d813b30d6ece4 100644 --- a/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Types.php +++ b/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Types.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Types/Edit.php b/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Types/Edit.php index 420f3aea059f25da5bf3d3b6509fb328bb9ae2ee..44d8b933b8f52d1716cef100cc023a84bcb251ae 100644 --- a/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Types/Edit.php +++ b/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Types/Edit.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Types/Edit/Attributes.php b/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Types/Edit/Attributes.php index a3c442bb9ede7d27bfe8793a0b7f3740e185ce2c..b14c7e71336e29d81c2c8df4bffc51440286fe76 100644 --- a/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Types/Edit/Attributes.php +++ b/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Types/Edit/Attributes.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Types/Edit/Form.php b/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Types/Edit/Form.php index fe3e405ecd339dc8d2c0575ce3154f4723ab7935..271de87a6c5b155e53cebe5720db381181538a4b 100644 --- a/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Types/Edit/Form.php +++ b/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Types/Edit/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Types/Edit/Select.php b/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Types/Edit/Select.php index 45216c4938ffee0dd7ff921bab7fa7849be0f04c..f3fbde5af28a4b1849d2888cc4328f60f33c5951 100644 --- a/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Types/Edit/Select.php +++ b/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Types/Edit/Select.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Types/Grid.php b/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Types/Grid.php index ab4dad96400be9256938c7eddf5d44356bf658e9..49f597589dfb434b6512ea222ac44d8b032b4735 100644 --- a/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Types/Grid.php +++ b/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Types/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Types/Renderer/Country.php b/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Types/Renderer/Country.php index d624213343d8bfe79b8c5f009480c41b2bce5d52..4ff1c27940cf75c5ffe2d710dc18339bd01cb3b6 100644 --- a/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Types/Renderer/Country.php +++ b/app/code/core/Mage/GoogleShopping/Block/Adminhtml/Types/Renderer/Country.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Helper/Category.php b/app/code/core/Mage/GoogleShopping/Helper/Category.php index f5fb2ae65b8e87f298ffc3def0a62ebac1a85f69..5d1694c1b3fe20d3c021470e9559197b8eba9f9a 100644 --- a/app/code/core/Mage/GoogleShopping/Helper/Category.php +++ b/app/code/core/Mage/GoogleShopping/Helper/Category.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -73,4 +73,4 @@ class Mage_GoogleShopping_Helper_Category . '</a>' ); } -} +} \ No newline at end of file diff --git a/app/code/core/Mage/GoogleShopping/Helper/Data.php b/app/code/core/Mage/GoogleShopping/Helper/Data.php index 86a64b426ac6562011961826145863c9256f5701..03fe4f5cdb1f580493b8c8de521b4de2550f2022 100644 --- a/app/code/core/Mage/GoogleShopping/Helper/Data.php +++ b/app/code/core/Mage/GoogleShopping/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Helper/Price.php b/app/code/core/Mage/GoogleShopping/Helper/Price.php index a94e10057dd86b331ed46084b1876972818d4932..e136f262058fb040bb7ed79efad1d292cef40ee4 100644 --- a/app/code/core/Mage/GoogleShopping/Helper/Price.php +++ b/app/code/core/Mage/GoogleShopping/Helper/Price.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -116,4 +116,4 @@ class Mage_GoogleShopping_Helper_Price return $product->getPrice(); } } -} +} \ No newline at end of file diff --git a/app/code/core/Mage/GoogleShopping/Helper/Product.php b/app/code/core/Mage/GoogleShopping/Helper/Product.php index 3290efbf7f901f88e2b1e5fd2b2c364a409079cd..26536c0cb7c08068b83149f2719c54c5377857a2 100644 --- a/app/code/core/Mage/GoogleShopping/Helper/Product.php +++ b/app/code/core/Mage/GoogleShopping/Helper/Product.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Model/Attribute.php b/app/code/core/Mage/GoogleShopping/Model/Attribute.php index 184f0de1f9182ca589fef6aec9fd2ac6ec734463..131c55398ea69f577052b658078363765c4a5d58 100644 --- a/app/code/core/Mage/GoogleShopping/Model/Attribute.php +++ b/app/code/core/Mage/GoogleShopping/Model/Attribute.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Model/Attribute/Availability.php b/app/code/core/Mage/GoogleShopping/Model/Attribute/Availability.php index fe97f5b4135cd56ad757060169167cd64ea41ec1..7d807c24cbf6a6a0c83bc242c7418f7fe42c9898 100644 --- a/app/code/core/Mage/GoogleShopping/Model/Attribute/Availability.php +++ b/app/code/core/Mage/GoogleShopping/Model/Attribute/Availability.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Model/Attribute/Condition.php b/app/code/core/Mage/GoogleShopping/Model/Attribute/Condition.php index fe8fd8b660508bea37de805cf56cf5eed8c3089a..b535b918a94c5252566a06d82ce7978757cd6776 100644 --- a/app/code/core/Mage/GoogleShopping/Model/Attribute/Condition.php +++ b/app/code/core/Mage/GoogleShopping/Model/Attribute/Condition.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Model/Attribute/Content.php b/app/code/core/Mage/GoogleShopping/Model/Attribute/Content.php index 9e572f00da43b14404630eb5a8570fd856ac2d61..1343bd6f266735c856b6ce9a0034ddfbf1c67aff 100644 --- a/app/code/core/Mage/GoogleShopping/Model/Attribute/Content.php +++ b/app/code/core/Mage/GoogleShopping/Model/Attribute/Content.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Model/Attribute/ContentLanguage.php b/app/code/core/Mage/GoogleShopping/Model/Attribute/ContentLanguage.php index a10c2f165f8aa7838566c58d18012fe3633ef506..2eab1d31c793d9b17e1c1a2fb418ccaa117245f0 100644 --- a/app/code/core/Mage/GoogleShopping/Model/Attribute/ContentLanguage.php +++ b/app/code/core/Mage/GoogleShopping/Model/Attribute/ContentLanguage.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Model/Attribute/Default.php b/app/code/core/Mage/GoogleShopping/Model/Attribute/Default.php index 08e8c8a7b470bb7c218950114adf63da4ac0a9c0..5b1071b776c5d207a841b69dbc6811c420c8b57e 100644 --- a/app/code/core/Mage/GoogleShopping/Model/Attribute/Default.php +++ b/app/code/core/Mage/GoogleShopping/Model/Attribute/Default.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -132,10 +132,9 @@ class Mage_GoogleShopping_Model_Attribute_Default extends Mage_GoogleShopping_Mo protected function _setAttribute($entry, $name, $type = self::ATTRIBUTE_TYPE_TEXT, $value = '', $unit = null) { if (is_object($value) || ((string)$value != $value)) { - Mage::throwException(Mage::helper('Mage_GoogleShopping_Helper_Data')->__( - 'The attribute "%s" has incorrect type for Google Shopping. The product with this attribute hasn\'t been updated in Google Content.', - $name - )); + Mage::throwException( + Mage::helper('Mage_GoogleShopping_Helper_Data')->__('The attribute "%s" has incorrect type for Google Shopping. The product with this attribute hasn\'t been updated in Google Content.', $name) + ); } $attribute = $entry->getContentAttributeByName($name); if ($attribute instanceof Varien_Gdata_Gshopping_Extension_Attribute) { diff --git a/app/code/core/Mage/GoogleShopping/Model/Attribute/Destinations.php b/app/code/core/Mage/GoogleShopping/Model/Attribute/Destinations.php index af27c6fbccd79058281c7948d8390ea232065adb..51cf1ba5e997957e0862f3c136c28694d1e1cf53 100644 --- a/app/code/core/Mage/GoogleShopping/Model/Attribute/Destinations.php +++ b/app/code/core/Mage/GoogleShopping/Model/Attribute/Destinations.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Model/Attribute/GoogleProductCategory.php b/app/code/core/Mage/GoogleShopping/Model/Attribute/GoogleProductCategory.php index a2fa49a6d7938b0f0a5c2c437c54faa74c076426..cf3f3604984f7c77fc920307e2f1dbcbc3e9627e 100644 --- a/app/code/core/Mage/GoogleShopping/Model/Attribute/GoogleProductCategory.php +++ b/app/code/core/Mage/GoogleShopping/Model/Attribute/GoogleProductCategory.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Model/Attribute/Id.php b/app/code/core/Mage/GoogleShopping/Model/Attribute/Id.php index 16c06964d4d00306f2e130fecc03e1542b27840f..d597b84fc9da84d833ed45f21f455a94fed5964f 100644 --- a/app/code/core/Mage/GoogleShopping/Model/Attribute/Id.php +++ b/app/code/core/Mage/GoogleShopping/Model/Attribute/Id.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Model/Attribute/ImageLink.php b/app/code/core/Mage/GoogleShopping/Model/Attribute/ImageLink.php index 455c022a8234041f809ddfd582e0fb711dc3af5c..0174bfc53d41c7fbaedd9fe180f9dd5da3fc250a 100644 --- a/app/code/core/Mage/GoogleShopping/Model/Attribute/ImageLink.php +++ b/app/code/core/Mage/GoogleShopping/Model/Attribute/ImageLink.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Model/Attribute/Link.php b/app/code/core/Mage/GoogleShopping/Model/Attribute/Link.php index 2dfe3374e0c3483b67164b0a7905bce63812329a..fe22ba4db070b2a3893daae614a586bc84223d64 100644 --- a/app/code/core/Mage/GoogleShopping/Model/Attribute/Link.php +++ b/app/code/core/Mage/GoogleShopping/Model/Attribute/Link.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Model/Attribute/Price.php b/app/code/core/Mage/GoogleShopping/Model/Attribute/Price.php index 678bd4cd20b85fc118232eabee037c551cbfed20..af7f1da09f126fa76d71fa22c1d8a156524f9ee8 100644 --- a/app/code/core/Mage/GoogleShopping/Model/Attribute/Price.php +++ b/app/code/core/Mage/GoogleShopping/Model/Attribute/Price.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -43,7 +43,9 @@ class Mage_GoogleShopping_Model_Attribute_Price extends Mage_GoogleShopping_Mode public function convertAttribute($product, $entry) { $product->setWebsiteId(Mage::app()->getStore($product->getStoreId())->getWebsiteId()); - $product->setCustomerGroupId(Mage::getStoreConfig('customer/create_account/default_group', $product->getStoreId())); + $product->setCustomerGroupId( + Mage::getStoreConfig(Mage_Customer_Model_Group::XML_PATH_DEFAULT_ID, $product->getStoreId()) + ); $store = Mage::app()->getStore($product->getStoreId()); $targetCountry = Mage::getSingleton('Mage_GoogleShopping_Model_Config')->getTargetCountry($product->getStoreId()); @@ -93,7 +95,9 @@ class Mage_GoogleShopping_Model_Attribute_Price extends Mage_GoogleShopping_Mode $effectiveDate = $this->getGroupAttributeSalePriceEffectiveDate(); if (!is_null($effectiveDate)) { - $effectiveDate->setGroupAttributeSalePriceEffectiveDateFrom($this->getGroupAttributeSalePriceEffectiveDateFrom()) + $effectiveDate->setGroupAttributeSalePriceEffectiveDateFrom( + $this->getGroupAttributeSalePriceEffectiveDateFrom() + ) ->setGroupAttributeSalePriceEffectiveDateTo($this->getGroupAttributeSalePriceEffectiveDateTo()) ->convertAttribute($product, $entry); } diff --git a/app/code/core/Mage/GoogleShopping/Model/Attribute/ProductType.php b/app/code/core/Mage/GoogleShopping/Model/Attribute/ProductType.php index 538c3a9f92227ff7df12c2465621ea40744cde56..fb66b9d01e43996614602a56203b02b5712303b5 100644 --- a/app/code/core/Mage/GoogleShopping/Model/Attribute/ProductType.php +++ b/app/code/core/Mage/GoogleShopping/Model/Attribute/ProductType.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Model/Attribute/Quantity.php b/app/code/core/Mage/GoogleShopping/Model/Attribute/Quantity.php index 42c7824741ef3b28054012021a5c96e01f75a61e..11ab66d6ac3a26e6505ca10612269af5c0627382 100644 --- a/app/code/core/Mage/GoogleShopping/Model/Attribute/Quantity.php +++ b/app/code/core/Mage/GoogleShopping/Model/Attribute/Quantity.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Model/Attribute/SalePriceEffectiveDate.php b/app/code/core/Mage/GoogleShopping/Model/Attribute/SalePriceEffectiveDate.php index d84f4a478aaf4b136bd20190b9a526354385f8d3..5f4230091b5b82984d73067f9686be543dd18d19 100644 --- a/app/code/core/Mage/GoogleShopping/Model/Attribute/SalePriceEffectiveDate.php +++ b/app/code/core/Mage/GoogleShopping/Model/Attribute/SalePriceEffectiveDate.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Model/Attribute/ShippingWeight.php b/app/code/core/Mage/GoogleShopping/Model/Attribute/ShippingWeight.php index 4b68f3e2bd38f62b793713cbea6836ae56290338..e63705b718cdcdbbcb27f4f3a53e03da687821da 100644 --- a/app/code/core/Mage/GoogleShopping/Model/Attribute/ShippingWeight.php +++ b/app/code/core/Mage/GoogleShopping/Model/Attribute/ShippingWeight.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Model/Attribute/TargetCountry.php b/app/code/core/Mage/GoogleShopping/Model/Attribute/TargetCountry.php index ede7f73589bfdb58eb0d165618b5808d934335f5..7e824dc25e451f2a2d6172774019b01e3a82849a 100644 --- a/app/code/core/Mage/GoogleShopping/Model/Attribute/TargetCountry.php +++ b/app/code/core/Mage/GoogleShopping/Model/Attribute/TargetCountry.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Model/Attribute/Tax.php b/app/code/core/Mage/GoogleShopping/Model/Attribute/Tax.php index d5dda478aba1cfccad57a36b0b56b02b910d7209..2f5fc5bb10c455bbdc41dac51fa45fc2eb4cd3c0 100644 --- a/app/code/core/Mage/GoogleShopping/Model/Attribute/Tax.php +++ b/app/code/core/Mage/GoogleShopping/Model/Attribute/Tax.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Model/Attribute/Title.php b/app/code/core/Mage/GoogleShopping/Model/Attribute/Title.php index cec63db8d573cb6278ebb90b969c67142e9e71a5..ea062499d7587d5cf4160b9f49aa79c86d887887 100644 --- a/app/code/core/Mage/GoogleShopping/Model/Attribute/Title.php +++ b/app/code/core/Mage/GoogleShopping/Model/Attribute/Title.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Model/Config.php b/app/code/core/Mage/GoogleShopping/Model/Config.php index 7a3867c445d300b4d5a77b64ff2e289b1fff8a21..7fbcd8961e0e7d97e11b3f4641eedb5ef8c5c93c 100644 --- a/app/code/core/Mage/GoogleShopping/Model/Config.php +++ b/app/code/core/Mage/GoogleShopping/Model/Config.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Model/Item.php b/app/code/core/Mage/GoogleShopping/Model/Item.php index f31d169ae0aaaf97c842659a9cd2ac866a7e6acf..fbde2e46e687dc57b7444f7a3745c74bb19be811 100644 --- a/app/code/core/Mage/GoogleShopping/Model/Item.php +++ b/app/code/core/Mage/GoogleShopping/Model/Item.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Model/MassOperations.php b/app/code/core/Mage/GoogleShopping/Model/MassOperations.php index 8be6cd11541f025e38b8772ef4e8ed368b8e3d85..a1c74dc8e1c98de2548639e60c0f6e92fdcffb2f 100644 --- a/app/code/core/Mage/GoogleShopping/Model/MassOperations.php +++ b/app/code/core/Mage/GoogleShopping/Model/MassOperations.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -84,10 +84,7 @@ class Mage_GoogleShopping_Model_MassOperations } catch (Zend_Db_Statement_Exception $e) { if ($e->getCode() == self::ERROR_CODE_SQL_UNIQUE_INDEX) { $this->_getSession()->addError( - Mage::helper('Mage_GoogleShopping_Helper_Data')->__("The Google Content item for product '%s' (in '%s' store) has already exist.", - $product->getName(), - Mage::app()->getStore($product->getStoreId())->getName() - ) + Mage::helper('Mage_GoogleShopping_Helper_Data')->__("The Google Content item for product '%s' (in '%s' store) has already exist.", $product->getName(), Mage::app()->getStore($product->getStoreId())->getName()) ); } else { $this->_getSession()->addError($e->getMessage()); diff --git a/app/code/core/Mage/GoogleShopping/Model/Observer.php b/app/code/core/Mage/GoogleShopping/Model/Observer.php index 5a7b0e405c696a73824266ba167f9589d632c2f4..4d758bea7bbde7696ffd041a14f8edf5d1f32b92 100644 --- a/app/code/core/Mage/GoogleShopping/Model/Observer.php +++ b/app/code/core/Mage/GoogleShopping/Model/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Model/Resource/Attribute.php b/app/code/core/Mage/GoogleShopping/Model/Resource/Attribute.php index 5a4efc1ebc459d4b7d825ee978d9c2558260bab2..f9a9524e368d53884626be2ba528d7e5bd98384f 100644 --- a/app/code/core/Mage/GoogleShopping/Model/Resource/Attribute.php +++ b/app/code/core/Mage/GoogleShopping/Model/Resource/Attribute.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Model/Resource/Attribute/Collection.php b/app/code/core/Mage/GoogleShopping/Model/Resource/Attribute/Collection.php index a29e8f4d75cd0a3fcbd8bada87f91db3ce782ff8..12fc96c8e2ff07f33ef0792dcec3f1f2c101e71b 100644 --- a/app/code/core/Mage/GoogleShopping/Model/Resource/Attribute/Collection.php +++ b/app/code/core/Mage/GoogleShopping/Model/Resource/Attribute/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Model/Resource/Item.php b/app/code/core/Mage/GoogleShopping/Model/Resource/Item.php index 49b566a95b7286f96e9255760496eefc78b81201..cbb49a20d9e572122a185a65e230c98610f06232 100644 --- a/app/code/core/Mage/GoogleShopping/Model/Resource/Item.php +++ b/app/code/core/Mage/GoogleShopping/Model/Resource/Item.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Model/Resource/Item/Collection.php b/app/code/core/Mage/GoogleShopping/Model/Resource/Item/Collection.php index 1893b9ed9739c0970ff5fb795947309b92e821b5..1196731ce7294205322616ce93548fcef606de3e 100644 --- a/app/code/core/Mage/GoogleShopping/Model/Resource/Item/Collection.php +++ b/app/code/core/Mage/GoogleShopping/Model/Resource/Item/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Model/Resource/Type.php b/app/code/core/Mage/GoogleShopping/Model/Resource/Type.php index c531e0cab3d1c13d77729a840f8ad9f08645b95e..8b4ab1632e9cfb172df59dcb2548bee48e52531d 100644 --- a/app/code/core/Mage/GoogleShopping/Model/Resource/Type.php +++ b/app/code/core/Mage/GoogleShopping/Model/Resource/Type.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Model/Resource/Type/Collection.php b/app/code/core/Mage/GoogleShopping/Model/Resource/Type/Collection.php index 4dd5e0da90533e6e49604f1ff378d5958ffc1d36..77719ce24f0d5e9ead4d075a6a27815763fb9121 100644 --- a/app/code/core/Mage/GoogleShopping/Model/Resource/Type/Collection.php +++ b/app/code/core/Mage/GoogleShopping/Model/Resource/Type/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -51,6 +51,18 @@ class Mage_GoogleShopping_Model_Resource_Type_Collection extends Mage_Core_Model return $this; } + /** + * Get SQL for get record count + * + * @return Varien_Db_Select + */ + public function getSelectCountSql() + { + $this->_renderFilters(); + $paginatorAdapter = new Zend_Paginator_Adapter_DbSelect($this->getSelect()); + return $paginatorAdapter->getCountSelect(); + } + /** * Add total count of Items for each type * diff --git a/app/code/core/Mage/GoogleShopping/Model/Service.php b/app/code/core/Mage/GoogleShopping/Model/Service.php index 6892a3b2f8cfa0622fe94a61dd61f1582e352dec..1442d9e9730c4459270600af03c1f344de912a8a 100644 --- a/app/code/core/Mage/GoogleShopping/Model/Service.php +++ b/app/code/core/Mage/GoogleShopping/Model/Service.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Model/Service/Item.php b/app/code/core/Mage/GoogleShopping/Model/Service/Item.php index 8711ac0b834bbe40fd9386772b8a7cbe58cb84a4..393755664ed8d6daacf3fa98751433012cc7fd49 100644 --- a/app/code/core/Mage/GoogleShopping/Model/Service/Item.php +++ b/app/code/core/Mage/GoogleShopping/Model/Service/Item.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Model/Source/Accounttype.php b/app/code/core/Mage/GoogleShopping/Model/Source/Accounttype.php index 7fc607bbf64f10d9692228fe02e0716a2a7136c7..c25e8f96a846f05c050d18d78bfaeefebfa777fc 100644 --- a/app/code/core/Mage/GoogleShopping/Model/Source/Accounttype.php +++ b/app/code/core/Mage/GoogleShopping/Model/Source/Accounttype.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Model/Source/Authtype.php b/app/code/core/Mage/GoogleShopping/Model/Source/Authtype.php index 26c4299c0da4f2deaceddc0dda25059a5cfbad4c..517b96f6d2e04f8c8f8fc41e1fc360b0601f84b0 100644 --- a/app/code/core/Mage/GoogleShopping/Model/Source/Authtype.php +++ b/app/code/core/Mage/GoogleShopping/Model/Source/Authtype.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Model/Source/Country.php b/app/code/core/Mage/GoogleShopping/Model/Source/Country.php index a5058bbf6568d2164b14536ebec4e35c783c177e..7e6b85eb060499b4221fd1460097ae4c327aabb2 100644 --- a/app/code/core/Mage/GoogleShopping/Model/Source/Country.php +++ b/app/code/core/Mage/GoogleShopping/Model/Source/Country.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Model/Source/Destinationstates.php b/app/code/core/Mage/GoogleShopping/Model/Source/Destinationstates.php index c06643cad5cb116c10ce7260c579826198c4fbcc..9002864f34badd37a947d124a4d134b28cc98652 100644 --- a/app/code/core/Mage/GoogleShopping/Model/Source/Destinationstates.php +++ b/app/code/core/Mage/GoogleShopping/Model/Source/Destinationstates.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Model/Source/Statuses.php b/app/code/core/Mage/GoogleShopping/Model/Source/Statuses.php index e645ba4fdf1090fa4e30db8e3a98076495669ed1..68abc7ff1b4c9978b59089832c2772d5e34e8968 100644 --- a/app/code/core/Mage/GoogleShopping/Model/Source/Statuses.php +++ b/app/code/core/Mage/GoogleShopping/Model/Source/Statuses.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/Model/Type.php b/app/code/core/Mage/GoogleShopping/Model/Type.php index 8fd819a3864446e12f35338d8e71f4c03321e421..0ee2f7d6841e54f432b35ab3d836798cc01fab5a 100644 --- a/app/code/core/Mage/GoogleShopping/Model/Type.php +++ b/app/code/core/Mage/GoogleShopping/Model/Type.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/controllers/Adminhtml/Googleshopping/ItemsController.php b/app/code/core/Mage/GoogleShopping/controllers/Adminhtml/Googleshopping/ItemsController.php index ef23e768c133152acd8ff55f01a93181f6745aba..8f25a9496519ca9b9d94b80a05fc7157bd877e5a 100644 --- a/app/code/core/Mage/GoogleShopping/controllers/Adminhtml/Googleshopping/ItemsController.php +++ b/app/code/core/Mage/GoogleShopping/controllers/Adminhtml/Googleshopping/ItemsController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -76,7 +76,7 @@ class Mage_GoogleShopping_Adminhtml_Googleshopping_ItemsController extends Mage_ if (!$this->_getConfig()->isValidDefaultCurrencyCode($this->_getStore()->getId())) { $_countryInfo = $this->_getConfig()->getTargetCountryInfo($this->_getStore()->getId()); $this->_getSession()->addNotice( - $this->__("The store's currency should be set to %s for %s in system configuration. Otherwise item prices won't be correct in Google Content.", $_countryInfo['currency_name'], $_countryInfo['name']) + Mage::helper('Mage_GoogleShopping_Helper_Data')->__("The store's currency should be set to %s for %s in system configuration. Otherwise item prices won't be correct in Google Content.", $_countryInfo['currency_name'], $_countryInfo['name']) ); } diff --git a/app/code/core/Mage/GoogleShopping/controllers/Adminhtml/Googleshopping/SelectionController.php b/app/code/core/Mage/GoogleShopping/controllers/Adminhtml/Googleshopping/SelectionController.php index dc4481b4ffb8528961f633c0699ae50404335edb..746b654d25284bddd8a062198553e2c512667890 100644 --- a/app/code/core/Mage/GoogleShopping/controllers/Adminhtml/Googleshopping/SelectionController.php +++ b/app/code/core/Mage/GoogleShopping/controllers/Adminhtml/Googleshopping/SelectionController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/controllers/Adminhtml/Googleshopping/TypesController.php b/app/code/core/Mage/GoogleShopping/controllers/Adminhtml/Googleshopping/TypesController.php index ff4110600fface59c58730ca04a691d8364aaa04..91ed72a76815bbb211c15b7f3e3135e64a14e73f 100644 --- a/app/code/core/Mage/GoogleShopping/controllers/Adminhtml/Googleshopping/TypesController.php +++ b/app/code/core/Mage/GoogleShopping/controllers/Adminhtml/Googleshopping/TypesController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/data/googleshopping_setup/data-install-1.6.0.0.php b/app/code/core/Mage/GoogleShopping/data/googleshopping_setup/data-install-1.6.0.0.php index 8eb4479cb40937a96139e59a98e6dd80b238311e..663b498c7f1fb99c4a1e9e87c8ad90204c18660c 100644 --- a/app/code/core/Mage/GoogleShopping/data/googleshopping_setup/data-install-1.6.0.0.php +++ b/app/code/core/Mage/GoogleShopping/data/googleshopping_setup/data-install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/etc/adminhtml.xml b/app/code/core/Mage/GoogleShopping/etc/adminhtml.xml index 1e45eedeec26fef4810733559404e17906b9fdbb..1232cea22b275d35568005085b571eaa0464989b 100644 --- a/app/code/core/Mage/GoogleShopping/etc/adminhtml.xml +++ b/app/code/core/Mage/GoogleShopping/etc/adminhtml.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/GoogleShopping/etc/config.xml b/app/code/core/Mage/GoogleShopping/etc/config.xml index 366567af591e5361d31a74a9c6441172d11a42bd..c596e2de190a32e20b0eb0bac9a8c1c90c98090e 100644 --- a/app/code/core/Mage/GoogleShopping/etc/config.xml +++ b/app/code/core/Mage/GoogleShopping/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/GoogleShopping/etc/system.xml b/app/code/core/Mage/GoogleShopping/etc/system.xml index 370ef26ba6cad8dd02314925eba415ccb33d0f7b..e88018be96d1cd43b3cd4a56daffd5972487f312 100644 --- a/app/code/core/Mage/GoogleShopping/etc/system.xml +++ b/app/code/core/Mage/GoogleShopping/etc/system.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/GoogleShopping/sql/googleshopping_setup/install-1.6.0.0.php b/app/code/core/Mage/GoogleShopping/sql/googleshopping_setup/install-1.6.0.0.php index b1bac37278f065759612f863d1165b9b32628512..904aaee0d2542d8e8b5739403fd7678ccbcf2c61 100644 --- a/app/code/core/Mage/GoogleShopping/sql/googleshopping_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/GoogleShopping/sql/googleshopping_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/sql/googleshopping_setup/upgrade-1.6.0.0-1.6.0.0.1.php b/app/code/core/Mage/GoogleShopping/sql/googleshopping_setup/upgrade-1.6.0.0-1.6.0.0.1.php index 5115d89e9e17ab152f6671277916a300174cdad4..b964c45e86023903e6b6203f56bb0eb1f8220bd7 100644 --- a/app/code/core/Mage/GoogleShopping/sql/googleshopping_setup/upgrade-1.6.0.0-1.6.0.0.1.php +++ b/app/code/core/Mage/GoogleShopping/sql/googleshopping_setup/upgrade-1.6.0.0-1.6.0.0.1.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/GoogleShopping/view/adminhtml/captcha.phtml b/app/code/core/Mage/GoogleShopping/view/adminhtml/captcha.phtml index 9b0239ef3c940af668a38656de08c83920552fc2..382396575b601103464c07028b534e98c9213d61 100644 --- a/app/code/core/Mage/GoogleShopping/view/adminhtml/captcha.phtml +++ b/app/code/core/Mage/GoogleShopping/view/adminhtml/captcha.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/GoogleShopping/view/adminhtml/items.phtml b/app/code/core/Mage/GoogleShopping/view/adminhtml/items.phtml index 7999ef33b750915dcdbf710659f40fbb10f2a88e..74ea839fe82e9e1a3ec28a04ba24c4edb70175f6 100644 --- a/app/code/core/Mage/GoogleShopping/view/adminhtml/items.phtml +++ b/app/code/core/Mage/GoogleShopping/view/adminhtml/items.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/GoogleShopping/view/adminhtml/types/edit.phtml b/app/code/core/Mage/GoogleShopping/view/adminhtml/types/edit.phtml index bce32d11093294601590d079a27d38edac481dd3..a0a6af89686a0b8fa7eb9936c5ffbf5c927427e5 100644 --- a/app/code/core/Mage/GoogleShopping/view/adminhtml/types/edit.phtml +++ b/app/code/core/Mage/GoogleShopping/view/adminhtml/types/edit.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/GoogleShopping/view/adminhtml/types/edit/attributes.phtml b/app/code/core/Mage/GoogleShopping/view/adminhtml/types/edit/attributes.phtml index 49cfa7a92480ca82166491db94e3fb936c6af60f..f5bcddd268ccd055cc824a92317865f7d6a42bfa 100644 --- a/app/code/core/Mage/GoogleShopping/view/adminhtml/types/edit/attributes.phtml +++ b/app/code/core/Mage/GoogleShopping/view/adminhtml/types/edit/attributes.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/GoogleShopping/view/adminhtml/types/edit/select.phtml b/app/code/core/Mage/GoogleShopping/view/adminhtml/types/edit/select.phtml index abf2239a721a662cc7da8b36aa273e63b2acfbe1..4fbb60956ab297921ea4f90b3275154fde96e0f9 100644 --- a/app/code/core/Mage/GoogleShopping/view/adminhtml/types/edit/select.phtml +++ b/app/code/core/Mage/GoogleShopping/view/adminhtml/types/edit/select.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/ImportExport/Block/Adminhtml/Export/Edit.php b/app/code/core/Mage/ImportExport/Block/Adminhtml/Export/Edit.php index 1b17b85d18c96f7da8f5f8876f0fea2165529494..2bc2459e6421406441931874a1cc74e0e8fefc58 100644 --- a/app/code/core/Mage/ImportExport/Block/Adminhtml/Export/Edit.php +++ b/app/code/core/Mage/ImportExport/Block/Adminhtml/Export/Edit.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ImportExport/Block/Adminhtml/Export/Edit/Form.php b/app/code/core/Mage/ImportExport/Block/Adminhtml/Export/Edit/Form.php index 319510517b10fb529dc186ebdbc7657a40b0e463..dca9b6a9c4d21b990979554ffd0ca6db9eb49a08 100644 --- a/app/code/core/Mage/ImportExport/Block/Adminhtml/Export/Edit/Form.php +++ b/app/code/core/Mage/ImportExport/Block/Adminhtml/Export/Edit/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ImportExport/Block/Adminhtml/Export/Filter.php b/app/code/core/Mage/ImportExport/Block/Adminhtml/Export/Filter.php index 40e39fb7fc278ba4a8803bc0236e11b366c80181..d7d259953e439e81cf6e1f0b3cf41589f1d9cb8a 100644 --- a/app/code/core/Mage/ImportExport/Block/Adminhtml/Export/Filter.php +++ b/app/code/core/Mage/ImportExport/Block/Adminhtml/Export/Filter.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -72,9 +72,8 @@ class Mage_ImportExport_Block_Adminhtml_Export_Filter extends Mage_Adminhtml_Blo $dateBlock = new Mage_Core_Block_Html_Date(array( 'name' => $this->getFilterElementName($attribute->getAttributeCode()) . '[]', 'id' => $this->getFilterElementId($attribute->getAttributeCode()), - 'class' => 'input-text', + 'class' => 'input-text input-text-range-date', 'format' => Mage::app()->getLocale()->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT), - 'extra_params' => 'style="width:85px !important"', 'image' => $this->getSkinUrl('images/grid-cal.gif') )); $fromValue = null; @@ -101,7 +100,7 @@ class Mage_ImportExport_Block_Adminhtml_Export_Filter extends Mage_Adminhtml_Blo protected function _getInputHtmlWithValue(Mage_Eav_Model_Entity_Attribute $attribute, $value) { $html = '<input type="text" name="' . $this->getFilterElementName($attribute->getAttributeCode()) - . '" class="input-text" style="width:274px;"'; + . '" class="input-text input-text-export-filter"'; if ($value) { $html .= ' value="' . $this->_helper->escapeHtml($value) . '"'; } @@ -134,9 +133,8 @@ class Mage_ImportExport_Block_Adminhtml_Export_Filter extends Mage_Adminhtml_Blo $selectBlock = new Mage_Core_Block_Html_Select(array( 'name' => $this->getFilterElementName($attribute->getAttributeCode()). '[]', 'id' => $this->getFilterElementId($attribute->getAttributeCode()), - 'class' => 'multiselect', + 'class' => 'multiselect multiselect-export-filter', 'extra_params' => 'multiple="multiple" size="' . ($size > 5 ? 5 : ($size < 2 ? 2 : $size)) - . '" style="width:280px"' )); return $selectBlock->setOptions($options) ->setValue($value) @@ -164,11 +162,11 @@ class Mage_ImportExport_Block_Adminhtml_Export_Filter extends Mage_Adminhtml_Blo } return '<strong>' . $this->_helper->__('From') . ':</strong> ' - . '<input type="text" name="' . $name . '[]" class="input-text"' - . ' value="' . $fromValue . '" style="width:100px;"/> ' + . '<input type="text" name="' . $name . '[]" class="input-text input-text-range"' + . ' value="' . $fromValue . '"/> ' . '<strong>' . $this->_helper->__('To') . ':</strong> <input type="text" name="' . $name - . '[]" class="input-text" style="width:100px;" value="' . $toValue . '" />'; + . '[]" class="input-text input-text-range" value="' . $toValue . '" />'; } /** @@ -201,8 +199,7 @@ class Mage_ImportExport_Block_Adminhtml_Export_Filter extends Mage_Adminhtml_Blo $selectBlock = new Mage_Core_Block_Html_Select(array( 'name' => $this->getFilterElementName($attribute->getAttributeCode()), 'id' => $this->getFilterElementId($attribute->getAttributeCode()), - 'class' => 'select', - 'extra_params' => 'style="width:280px"' + 'class' => 'select select-export-filter' )); return $selectBlock->setOptions($options) ->setValue($value) diff --git a/app/code/core/Mage/ImportExport/Block/Adminhtml/Import/Edit.php b/app/code/core/Mage/ImportExport/Block/Adminhtml/Import/Edit.php index eedd38546118af5a1676e03ba7ada88637e2f1ec..830eb2b01dde9ac348decac1c2da807db009d6a8 100644 --- a/app/code/core/Mage/ImportExport/Block/Adminhtml/Import/Edit.php +++ b/app/code/core/Mage/ImportExport/Block/Adminhtml/Import/Edit.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ImportExport/Block/Adminhtml/Import/Edit/Form.php b/app/code/core/Mage/ImportExport/Block/Adminhtml/Import/Edit/Form.php index 1b819a44a6ed376f5c59fab124575af1342d72ab..c0ecefb189dc899aeea841748d2fbd5342546afe 100644 --- a/app/code/core/Mage/ImportExport/Block/Adminhtml/Import/Edit/Form.php +++ b/app/code/core/Mage/ImportExport/Block/Adminhtml/Import/Edit/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ImportExport/Block/Adminhtml/Import/Frame/Result.php b/app/code/core/Mage/ImportExport/Block/Adminhtml/Import/Frame/Result.php index d47edc2afe95105875cad070aa925cf6a6881979..5c6459670d238e5fe978fde721c5d99116b3ab67 100644 --- a/app/code/core/Mage/ImportExport/Block/Adminhtml/Import/Frame/Result.php +++ b/app/code/core/Mage/ImportExport/Block/Adminhtml/Import/Frame/Result.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -150,7 +150,7 @@ class Mage_ImportExport_Block_Adminhtml_Import_Frame_Result extends Mage_Adminht { return ' <button onclick="editForm.startImport(\'' . $this->getImportStartUrl() . '\', \'' . Mage_ImportExport_Model_Import::FIELD_NAME_SOURCE_FILE . '\');" class="scalable save"' - . ' type="button"><span>' . $this->__('Import') . '</span></button>'; + . ' type="button"><span><span><span>' . $this->__('Import') . '</span></span></span></button>'; } /** diff --git a/app/code/core/Mage/ImportExport/Helper/Data.php b/app/code/core/Mage/ImportExport/Helper/Data.php index 4b13bf6e7de27b5a2fef5b4c61a570afb88a4001..e75a9455d40945f591c9a5f8dd47bba4dc08562c 100644 --- a/app/code/core/Mage/ImportExport/Helper/Data.php +++ b/app/code/core/Mage/ImportExport/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ImportExport/Model/Abstract.php b/app/code/core/Mage/ImportExport/Model/Abstract.php index 2a8e4f6fc8c9c1569706e27517767ab166b58d55..46800b5ad1310bd9566991285e3f0b242d02f7cb 100644 --- a/app/code/core/Mage/ImportExport/Model/Abstract.php +++ b/app/code/core/Mage/ImportExport/Model/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ImportExport/Model/Config.php b/app/code/core/Mage/ImportExport/Model/Config.php index 5bd0d989c888686e969a54f9ca83718dad9650fe..445660307098ea04c0b56ce835611db98e95e72b 100644 --- a/app/code/core/Mage/ImportExport/Model/Config.php +++ b/app/code/core/Mage/ImportExport/Model/Config.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ImportExport/Model/Export.php b/app/code/core/Mage/ImportExport/Model/Export.php index 7fcd655fdc0ceca54b370c48ffe566a8048d1b8a..eaa88162f32439bac8f586493c7adc45013d0766 100644 --- a/app/code/core/Mage/ImportExport/Model/Export.php +++ b/app/code/core/Mage/ImportExport/Model/Export.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ImportExport/Model/Export/Adapter/Abstract.php b/app/code/core/Mage/ImportExport/Model/Export/Adapter/Abstract.php index 1edb0c41394c27bffb33bc6519f50c6ff2d8d11b..53e9e04b47e3e1f3360c43808e5b3d0c4f44570c 100644 --- a/app/code/core/Mage/ImportExport/Model/Export/Adapter/Abstract.php +++ b/app/code/core/Mage/ImportExport/Model/Export/Adapter/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ImportExport/Model/Export/Adapter/Csv.php b/app/code/core/Mage/ImportExport/Model/Export/Adapter/Csv.php index f3735fcd6ef79d7d6b5b94ca986c6fbe0f500a27..56b05418639f5bb352627ef89ff3156199c5b499 100644 --- a/app/code/core/Mage/ImportExport/Model/Export/Adapter/Csv.php +++ b/app/code/core/Mage/ImportExport/Model/Export/Adapter/Csv.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ImportExport/Model/Export/Entity/Abstract.php b/app/code/core/Mage/ImportExport/Model/Export/Entity/Abstract.php index dab1c69af9e81bc8431f4fe0be3027af5763fe6f..8b697754de6953c43910c3235ae80557922bac8d 100644 --- a/app/code/core/Mage/ImportExport/Model/Export/Entity/Abstract.php +++ b/app/code/core/Mage/ImportExport/Model/Export/Entity/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ImportExport/Model/Export/Entity/Customer.php b/app/code/core/Mage/ImportExport/Model/Export/Entity/Customer.php index 5f6b6e0be9811721373a6dc35eb45fba2d4c36f5..fb3573368706a375e3a52b6204168e2aa2ae724f 100644 --- a/app/code/core/Mage/ImportExport/Model/Export/Entity/Customer.php +++ b/app/code/core/Mage/ImportExport/Model/Export/Entity/Customer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ImportExport/Model/Export/Entity/Product.php b/app/code/core/Mage/ImportExport/Model/Export/Entity/Product.php index a6a0bd7678779efea0528e1d345b77c3d199d4b7..a44b4b8d7896ff5f32ff21ccb602c1cc49851cde 100644 --- a/app/code/core/Mage/ImportExport/Model/Export/Entity/Product.php +++ b/app/code/core/Mage/ImportExport/Model/Export/Entity/Product.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -250,6 +250,39 @@ class Mage_ImportExport_Model_Export_Entity_Product extends Mage_ImportExport_Mo return $rowTierPrices; } + /** + * Prepare products group prices + * + * @param array $productIds + * @return array + */ + protected function _prepareGroupPrices(array $productIds) + { + if (empty($productIds)) { + return array(); + } + $resource = Mage::getSingleton('Mage_Core_Model_Resource'); + $select = $this->_connection->select() + ->from($resource->getTableName('catalog_product_entity_group_price')) + ->where('entity_id IN(?)', $productIds); + + $rowGroupPrices = array(); + $statement = $this->_connection->query($select); + while ($groupRow = $statement->fetch()) { + $rowGroupPrices[$groupRow['entity_id']][] = array( + '_group_price_customer_group' => $groupRow['all_groups'] + ? self::VALUE_ALL + : $groupRow['customer_group_id'], + '_group_price_website' => (0 == $groupRow['website_id']) + ? self::VALUE_ALL + : $this->_websiteIdToCode[$groupRow['website_id']], + '_group_price_price' => $groupRow['value'] + ); + } + + return $rowGroupPrices; + } + /** * Prepare products media gallery * @@ -443,6 +476,7 @@ class Mage_ImportExport_Model_Export_Entity_Product extends Mage_ImportExport_Mo $rowCategories = array(); $rowWebsites = array(); $rowTierPrices = array(); + $rowGroupPrices = array(); $rowMultiselects = array(); $mediaGalery = array(); @@ -466,8 +500,9 @@ class Mage_ImportExport_Model_Export_Entity_Product extends Mage_ImportExport_Mo if ($defaultStoreId == $storeId) { $collection->addCategoryIds()->addWebsiteNamesToResult(); - // tier price data getting only once + // tier and group price data getting only once $rowTierPrices = $this->_prepareTierPrices($collection->getAllIds()); + $rowGroupPrices = $this->_prepareGroupPrices($collection->getAllIds()); // getting media gallery data $mediaGalery = $this->_prepareMediaGallery($collection->getAllIds()); @@ -684,6 +719,7 @@ class Mage_ImportExport_Model_Export_Entity_Product extends Mage_ImportExport_Mo '_associated_sku', '_associated_default_qty', '_associated_position' ), array('_tier_price_website', '_tier_price_customer_group', '_tier_price_qty', '_tier_price_price'), + array('_group_price_website', '_group_price_customer_group', '_group_price_price'), array( '_media_attribute_id', '_media_image', @@ -728,6 +764,9 @@ class Mage_ImportExport_Model_Export_Entity_Product extends Mage_ImportExport_Mo if (!empty($rowTierPrices[$productId])) { $dataRow = array_merge($dataRow, array_shift($rowTierPrices[$productId])); } + if (!empty($rowGroupPrices[$productId])) { + $dataRow = array_merge($dataRow, array_shift($rowGroupPrices[$productId])); + } if (!empty($mediaGalery[$productId])) { $dataRow = array_merge($dataRow, array_shift($mediaGalery[$productId])); } @@ -775,6 +814,9 @@ class Mage_ImportExport_Model_Export_Entity_Product extends Mage_ImportExport_Mo if (!empty($rowTierPrices[$productId])) { $additionalRowsCount = max($additionalRowsCount, count($rowTierPrices[$productId])); } + if (!empty($rowGroupPrices[$productId])) { + $additionalRowsCount = max($additionalRowsCount, count($rowGroupPrices[$productId])); + } if (!empty($mediaGalery[$productId])) { $additionalRowsCount = max($additionalRowsCount, count($mediaGalery[$productId])); } @@ -804,6 +846,9 @@ class Mage_ImportExport_Model_Export_Entity_Product extends Mage_ImportExport_Mo if (!empty($rowTierPrices[$productId])) { $dataRow = array_merge($dataRow, array_shift($rowTierPrices[$productId])); } + if (!empty($rowGroupPrices[$productId])) { + $dataRow = array_merge($dataRow, array_shift($rowGroupPrices[$productId])); + } if (!empty($mediaGalery[$productId])) { $dataRow = array_merge($dataRow, array_shift($mediaGalery[$productId])); } diff --git a/app/code/core/Mage/ImportExport/Model/Export/Entity/Product/Type/Abstract.php b/app/code/core/Mage/ImportExport/Model/Export/Entity/Product/Type/Abstract.php index c460bc169c7c75a6cdf837b562787f24b114feae..ff7deea410c1fa61ae203be67f5675d2172070b3 100644 --- a/app/code/core/Mage/ImportExport/Model/Export/Entity/Product/Type/Abstract.php +++ b/app/code/core/Mage/ImportExport/Model/Export/Entity/Product/Type/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ImportExport/Model/Export/Entity/Product/Type/Configurable.php b/app/code/core/Mage/ImportExport/Model/Export/Entity/Product/Type/Configurable.php index e78478c9cb2f0ea1427845f31ff55a3236247216..2244a1c132615b83f4b2649d7df303d0a6671161 100644 --- a/app/code/core/Mage/ImportExport/Model/Export/Entity/Product/Type/Configurable.php +++ b/app/code/core/Mage/ImportExport/Model/Export/Entity/Product/Type/Configurable.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ImportExport/Model/Export/Entity/Product/Type/Grouped.php b/app/code/core/Mage/ImportExport/Model/Export/Entity/Product/Type/Grouped.php index 1619047ba686ed7e5ba9705cf1293c6a6b2829e1..105d51b110a46ba35a0f42e26f25f0822262d4df 100644 --- a/app/code/core/Mage/ImportExport/Model/Export/Entity/Product/Type/Grouped.php +++ b/app/code/core/Mage/ImportExport/Model/Export/Entity/Product/Type/Grouped.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ImportExport/Model/Export/Entity/Product/Type/Simple.php b/app/code/core/Mage/ImportExport/Model/Export/Entity/Product/Type/Simple.php index 61063f6a7f04e1e4c3b8dd84287ed73ed3ca7b71..9c05b66c5d955e20fb1351e188e6fc4ada790853 100644 --- a/app/code/core/Mage/ImportExport/Model/Export/Entity/Product/Type/Simple.php +++ b/app/code/core/Mage/ImportExport/Model/Export/Entity/Product/Type/Simple.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -51,5 +51,12 @@ class Mage_ImportExport_Model_Export_Entity_Product_Type_Simple * * @var array */ - protected $_disabledAttrs = array('old_id', 'recurring_profile', 'is_recurring', 'tier_price', 'category_ids'); + protected $_disabledAttrs = array( + 'old_id', + 'recurring_profile', + 'is_recurring', + 'tier_price', + 'group_price', + 'category_ids' + ); } diff --git a/app/code/core/Mage/ImportExport/Model/Import.php b/app/code/core/Mage/ImportExport/Model/Import.php index 70ed53a8098a1accb947a63c8b95f85799a8dec7..bb57c009e75d4b157ca9a935adf5334fd6539b2e 100644 --- a/app/code/core/Mage/ImportExport/Model/Import.php +++ b/app/code/core/Mage/ImportExport/Model/Import.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ImportExport/Model/Import/Adapter.php b/app/code/core/Mage/ImportExport/Model/Import/Adapter.php index a121385cd392e786537f46808aabdb4e4f1ed386..b24cb36e93cffdb5ad5812723c0518d45f6f92a8 100644 --- a/app/code/core/Mage/ImportExport/Model/Import/Adapter.php +++ b/app/code/core/Mage/ImportExport/Model/Import/Adapter.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ImportExport/Model/Import/Adapter/Abstract.php b/app/code/core/Mage/ImportExport/Model/Import/Adapter/Abstract.php index 67c0c0146001af4fd3502682161b7616b437ffdc..c17ef9f99cef8afab7e0ed922ac774faec7d198f 100644 --- a/app/code/core/Mage/ImportExport/Model/Import/Adapter/Abstract.php +++ b/app/code/core/Mage/ImportExport/Model/Import/Adapter/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ImportExport/Model/Import/Adapter/Csv.php b/app/code/core/Mage/ImportExport/Model/Import/Adapter/Csv.php index 77eda2290f4ce91db473e4566182cbd5ebba0455..3186ae0d97769152669644400456f3ebe58c2648 100644 --- a/app/code/core/Mage/ImportExport/Model/Import/Adapter/Csv.php +++ b/app/code/core/Mage/ImportExport/Model/Import/Adapter/Csv.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ImportExport/Model/Import/Entity/Abstract.php b/app/code/core/Mage/ImportExport/Model/Import/Entity/Abstract.php index 9dadc2b9ddf95701e05c439904796f539cb967a3..ae932acb0702bbde2bd2f8caafe19370b781b89e 100644 --- a/app/code/core/Mage/ImportExport/Model/Import/Entity/Abstract.php +++ b/app/code/core/Mage/ImportExport/Model/Import/Entity/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -560,8 +560,8 @@ abstract class Mage_ImportExport_Model_Import_Entity_Abstract break; case 'datetime': $val = trim($rowData[$attrCode]); - $valid = strtotime($val) - || preg_match('/^\d{2}.\d{2}.\d{2,4}(?:\s+\d{1,2}.\d{1,2}(?:.\d{1,2})?)?$/', $val); + $valid = strtotime($val) !== false + || preg_match('/^\d{2}.\d{2}.\d{2,4}(?:\s+\d{1,2}.\d{1,2}(?:.\d{1,2})?)?$/', $val); break; case 'text': $val = Mage::helper('Mage_Core_Helper_String')->cleanString($rowData[$attrCode]); diff --git a/app/code/core/Mage/ImportExport/Model/Import/Entity/Customer.php b/app/code/core/Mage/ImportExport/Model/Import/Entity/Customer.php index f0addf246e59e0df51211a3d484a42ac2c6e1df1..664958b2aa951e0eae8852ceee434f9f692d3f84 100644 --- a/app/code/core/Mage/ImportExport/Model/Import/Entity/Customer.php +++ b/app/code/core/Mage/ImportExport/Model/Import/Entity/Customer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ImportExport/Model/Import/Entity/Customer/Address.php b/app/code/core/Mage/ImportExport/Model/Import/Entity/Customer/Address.php index 81af5d7907a506481d556db376fcff1fcb4adba9..b7bf80c1e07413f32b0699b13f6b5de81fe9b9c6 100644 --- a/app/code/core/Mage/ImportExport/Model/Import/Entity/Customer/Address.php +++ b/app/code/core/Mage/ImportExport/Model/Import/Entity/Customer/Address.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ImportExport/Model/Import/Entity/Product.php b/app/code/core/Mage/ImportExport/Model/Import/Entity/Product.php index ce1f0a08aa85eca7a300f16b28828e84cd66f73c..0487c6bf100e387a488eee75af80a9b1fc431cd8 100644 --- a/app/code/core/Mage/ImportExport/Model/Import/Entity/Product.php +++ b/app/code/core/Mage/ImportExport/Model/Import/Entity/Product.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -88,6 +88,9 @@ class Mage_ImportExport_Model_Import_Entity_Product extends Mage_ImportExport_Mo const ERROR_INVALID_TIER_PRICE_SITE = 'tierPriceWebsiteInvalid'; const ERROR_INVALID_TIER_PRICE_GROUP = 'tierPriceGroupInvalid'; const ERROR_TIER_DATA_INCOMPLETE = 'tierPriceDataIsIncomplete'; + const ERROR_INVALID_GROUP_PRICE_SITE = 'groupPriceWebsiteInvalid'; + const ERROR_INVALID_GROUP_PRICE_GROUP = 'groupPriceGroupInvalid'; + const ERROR_GROUP_PRICE_DATA_INCOMPLETE = 'groupPriceDataIsIncomplete'; const ERROR_SKU_NOT_FOUND_FOR_DELETE = 'skuNotFoundToDelete'; const ERROR_SUPER_PRODUCTS_SKU_NOT_FOUND = 'superProductsSkuNotFound'; @@ -210,6 +213,7 @@ class Mage_ImportExport_Model_Import_Entity_Product extends Mage_ImportExport_Mo protected $_particularAttributes = array( '_store', '_attribute_set', '_type', '_category', '_product_websites', '_tier_price_website', '_tier_price_customer_group', '_tier_price_qty', '_tier_price_price', '_links_related_sku', + '_group_price_website', '_group_price_customer_group', '_group_price_price', '_links_related_position', '_links_crosssell_sku', '_links_crosssell_position', '_links_upsell_sku', '_links_upsell_position', '_custom_option_store', '_custom_option_type', '_custom_option_title', '_custom_option_is_required', '_custom_option_price', '_custom_option_sku', '_custom_option_max_characters', @@ -539,7 +543,7 @@ class Mage_ImportExport_Model_Import_Entity_Product extends Mage_ImportExport_Mo } /** - * Check tier orice data validity. + * Check tier price data validity. * * @param array $rowData * @param int $rowNum @@ -575,6 +579,40 @@ class Mage_ImportExport_Model_Import_Entity_Product extends Mage_ImportExport_Mo return true; } + /** + * Check group price data validity. + * + * @param array $rowData + * @param int $rowNum + * @return bool + */ + protected function _isGroupPriceValid(array $rowData, $rowNum) + { + if ((isset($rowData['_group_price_website']) && strlen($rowData['_group_price_website'])) + || (isset($rowData['_group_price_customer_group']) && strlen($rowData['_group_price_customer_group'])) + || (isset($rowData['_group_price_price']) && strlen($rowData['_group_price_price'])) + ) { + if (!isset($rowData['_group_price_website']) || !isset($rowData['_group_price_customer_group']) + || !strlen($rowData['_group_price_website']) || !strlen($rowData['_group_price_customer_group']) + || !strlen($rowData['_group_price_price']) + ) { + $this->addRowError(self::ERROR_GROUP_PRICE_DATA_INCOMPLETE, $rowNum); + return false; + } elseif ($rowData['_group_price_website'] != self::VALUE_ALL + && !isset($this->_websiteCodeToId[$rowData['_group_price_website']]) + ) { + $this->addRowError(self::ERROR_INVALID_GROUP_PRICE_SITE, $rowNum); + return false; + } elseif ($rowData['_group_price_customer_group'] != self::VALUE_ALL + && !isset($this->_customerGroups[$rowData['_group_price_customer_group']]) + ) { + $this->addRowError(self::ERROR_INVALID_GROUP_PRICE_GROUP, $rowNum); + return false; + } + } + return true; + } + /** * Check super products SKU * @@ -1081,6 +1119,7 @@ class Mage_ImportExport_Model_Import_Entity_Product extends Mage_ImportExport_Mo $websites = array(); $categories = array(); $tierPrices = array(); + $groupPrices = array(); $mediaGallery = array(); $uploadedGalleryFiles = array(); $previousType = null; @@ -1135,12 +1174,22 @@ class Mage_ImportExport_Model_Import_Entity_Product extends Mage_ImportExport_Mo if (!empty($rowData['_tier_price_website'])) { // 4. Tier prices phase $tierPrices[$rowSku][] = array( 'all_groups' => $rowData['_tier_price_customer_group'] == self::VALUE_ALL, - 'customer_group_id' => $rowData['_tier_price_customer_group'] == self::VALUE_ALL ? - 0 : $rowData['_tier_price_customer_group'], + 'customer_group_id' => ($rowData['_tier_price_customer_group'] == self::VALUE_ALL) + ? 0 : $rowData['_tier_price_customer_group'], 'qty' => $rowData['_tier_price_qty'], 'value' => $rowData['_tier_price_price'], - 'website_id' => self::VALUE_ALL == $rowData['_tier_price_website'] || $priceIsGlobal ? - 0 : $this->_websiteCodeToId[$rowData['_tier_price_website']] + 'website_id' => (self::VALUE_ALL == $rowData['_tier_price_website'] || $priceIsGlobal) + ? 0 : $this->_websiteCodeToId[$rowData['_tier_price_website']] + ); + } + if (!empty($rowData['_group_price_website'])) { // 5. Group prices phase + $groupPrices[$rowSku][] = array( + 'all_groups' => $rowData['_group_price_customer_group'] == self::VALUE_ALL, + 'customer_group_id' => ($rowData['_group_price_customer_group'] == self::VALUE_ALL) + ? 0 : $rowData['_group_price_customer_group'], + 'value' => $rowData['_group_price_price'], + 'website_id' => (self::VALUE_ALL == $rowData['_group_price_website'] || $priceIsGlobal) + ? 0 : $this->_websiteCodeToId[$rowData['_group_price_website']] ); } foreach ($this->_imagesArrayKeys as $imageCol) { @@ -1230,6 +1279,7 @@ class Mage_ImportExport_Model_Import_Entity_Product extends Mage_ImportExport_Mo ->_saveProductWebsites($websites) ->_saveProductCategories($categories) ->_saveProductTierPrices($tierPrices) + ->_saveProductGroupPrices($groupPrices) ->_saveMediaGallery($mediaGallery) ->_saveProductAttributes($attributes); } @@ -1276,6 +1326,46 @@ class Mage_ImportExport_Model_Import_Entity_Product extends Mage_ImportExport_Mo return $this; } + /** + * Save product group prices. + * + * @param array $groupPriceData + * @return Mage_ImportExport_Model_Import_Entity_Product + */ + protected function _saveProductGroupPrices(array $groupPriceData) + { + static $tableName = null; + + if (!$tableName) { + $tableName = Mage::getModel('Mage_ImportExport_Model_Import_Proxy_Product_Resource') + ->getTable('catalog_product_entity_group_price'); + } + if ($groupPriceData) { + $groupPriceIn = array(); + $delProductId = array(); + + foreach ($groupPriceData as $delSku => $groupPriceRows) { + $productId = $this->_newSku[$delSku]['entity_id']; + $delProductId[] = $productId; + + foreach ($groupPriceRows as $row) { + $row['entity_id'] = $productId; + $groupPriceIn[] = $row; + } + } + if (Mage_ImportExport_Model_Import::BEHAVIOR_APPEND != $this->getBehavior()) { + $this->_connection->delete( + $tableName, + $this->_connection->quoteInto('entity_id IN (?)', $delProductId) + ); + } + if ($groupPriceIn) { + $this->_connection->insertOnDuplicate($tableName, $groupPriceIn, array('value')); + } + } + return $this; + } + /** * Returns an object for upload a media files */ @@ -1489,14 +1579,22 @@ class Mage_ImportExport_Model_Import_Entity_Product extends Mage_ImportExport_Mo continue; } - $row = array_merge( - $defaultStockData, - array_intersect_key($rowData, $defaultStockData) - ); $row['product_id'] = $this->_newSku[$rowData[self::COL_SKU]]['entity_id']; $row['stock_id'] = 1; + /** @var $stockItem Mage_CatalogInventory_Model_Stock_Item */ - $stockItem = Mage::getModel('Mage_CatalogInventory_Model_Stock_Item', $row); + $stockItem = Mage::getModel('Mage_CatalogInventory_Model_Stock_Item'); + $stockItem->loadByProduct($row['product_id']); + $existStockData = $stockItem->getData(); + + $row = array_merge( + $defaultStockData, + array_intersect_key($existStockData, $defaultStockData), + array_intersect_key($rowData, $defaultStockData), + $row + ); + + $stockItem->setData($row); if ($helper->isQty($this->_newSku[$rowData[self::COL_SKU]]['type_id'])) { if ($stockItem->verifyNotification()) { @@ -1642,6 +1740,7 @@ class Mage_ImportExport_Model_Import_Entity_Product extends Mage_ImportExport_Mo $this->_isProductWebsiteValid($rowData, $rowNum); $this->_isProductCategoryValid($rowData, $rowNum); $this->_isTierPriceValid($rowData, $rowNum); + $this->_isGroupPriceValid($rowData, $rowNum); $this->_isSuperProductsSkuValid($rowData, $rowNum); if (self::SCOPE_DEFAULT == $rowScope) { // SKU is specified, row is SCOPE_DEFAULT, new product block begins diff --git a/app/code/core/Mage/ImportExport/Model/Import/Entity/Product/Type/Abstract.php b/app/code/core/Mage/ImportExport/Model/Import/Entity/Product/Type/Abstract.php index cd2c873b38d4b3d56b8d7f4813111c84c1ca29bf..3f6f1b8b8303f021cfe7f0bbd819ce3cb9a291ed 100644 --- a/app/code/core/Mage/ImportExport/Model/Import/Entity/Product/Type/Abstract.php +++ b/app/code/core/Mage/ImportExport/Model/Import/Entity/Product/Type/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ImportExport/Model/Import/Entity/Product/Type/Configurable.php b/app/code/core/Mage/ImportExport/Model/Import/Entity/Product/Type/Configurable.php index df291eda30df11473272714212115ad9e725dcd7..8e726bf5dccd436b9f355eaf8741fddbfaf54e23 100644 --- a/app/code/core/Mage/ImportExport/Model/Import/Entity/Product/Type/Configurable.php +++ b/app/code/core/Mage/ImportExport/Model/Import/Entity/Product/Type/Configurable.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ImportExport/Model/Import/Entity/Product/Type/Grouped.php b/app/code/core/Mage/ImportExport/Model/Import/Entity/Product/Type/Grouped.php index a806bd14e863d00290ff1a034deebc7a4c01f8f7..2c9b572bee857535b249dbd1280d8b94c04236a5 100644 --- a/app/code/core/Mage/ImportExport/Model/Import/Entity/Product/Type/Grouped.php +++ b/app/code/core/Mage/ImportExport/Model/Import/Entity/Product/Type/Grouped.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ImportExport/Model/Import/Entity/Product/Type/Simple.php b/app/code/core/Mage/ImportExport/Model/Import/Entity/Product/Type/Simple.php index 952d0a297edfbf7f8c4a1dbfcc9ea830ee9bdec1..f976f9e78116817f2467173b5764eeb331e0c3be 100644 --- a/app/code/core/Mage/ImportExport/Model/Import/Entity/Product/Type/Simple.php +++ b/app/code/core/Mage/ImportExport/Model/Import/Entity/Product/Type/Simple.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ImportExport/Model/Import/Proxy/Product.php b/app/code/core/Mage/ImportExport/Model/Import/Proxy/Product.php index 643c380c8cba6cae2720963465adaccf25d59d08..8b61bb4b9882e018a9dfe5bad0f043e12e9d8581 100644 --- a/app/code/core/Mage/ImportExport/Model/Import/Proxy/Product.php +++ b/app/code/core/Mage/ImportExport/Model/Import/Proxy/Product.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ImportExport/Model/Import/Proxy/Product/Resource.php b/app/code/core/Mage/ImportExport/Model/Import/Proxy/Product/Resource.php index c1f7bf1a9836d2a1682cb94b5cac3c58374f2e80..3801e0adbf243c4dd1f67dea71e7aae2b4735d10 100644 --- a/app/code/core/Mage/ImportExport/Model/Import/Proxy/Product/Resource.php +++ b/app/code/core/Mage/ImportExport/Model/Import/Proxy/Product/Resource.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ImportExport/Model/Import/Uploader.php b/app/code/core/Mage/ImportExport/Model/Import/Uploader.php index 043b74bdb2b6b6fd4a603e4cbf0d18772904dbc8..8e68c8a93a60dd66c01bddca69c3e54efad442de 100644 --- a/app/code/core/Mage/ImportExport/Model/Import/Uploader.php +++ b/app/code/core/Mage/ImportExport/Model/Import/Uploader.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ImportExport/Model/Resource/Helper/Mysql4.php b/app/code/core/Mage/ImportExport/Model/Resource/Helper/Mysql4.php index d05cbfadc4da53875dd70227a5722062ff61f139..78a4679955b8ac8377ba6ec64b69ed04b515473e 100644 --- a/app/code/core/Mage/ImportExport/Model/Resource/Helper/Mysql4.php +++ b/app/code/core/Mage/ImportExport/Model/Resource/Helper/Mysql4.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ImportExport/Model/Resource/Import/Data.php b/app/code/core/Mage/ImportExport/Model/Resource/Import/Data.php index a93c267a455d469911c957c411daf17d443570a8..721d8dda9f3fd18dc05e98da185c4ceb77886197 100644 --- a/app/code/core/Mage/ImportExport/Model/Resource/Import/Data.php +++ b/app/code/core/Mage/ImportExport/Model/Resource/Import/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ImportExport/Model/Resource/Setup.php b/app/code/core/Mage/ImportExport/Model/Resource/Setup.php index 15962428febb3a92fe0bb7acd3031ccb0176d72a..b848513f25ee03423c0c642198373c76867f902a 100644 --- a/app/code/core/Mage/ImportExport/Model/Resource/Setup.php +++ b/app/code/core/Mage/ImportExport/Model/Resource/Setup.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ImportExport/Model/Source/Export/Entity.php b/app/code/core/Mage/ImportExport/Model/Source/Export/Entity.php index a15166668d6b563671d43a4911bc521f5791b523..d6c0c642e739ec72d5acf37f74fe2b0f0c571205 100644 --- a/app/code/core/Mage/ImportExport/Model/Source/Export/Entity.php +++ b/app/code/core/Mage/ImportExport/Model/Source/Export/Entity.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ImportExport/Model/Source/Export/Format.php b/app/code/core/Mage/ImportExport/Model/Source/Export/Format.php index d50ee0917e6c4cd7f3bb433c3d97b5d1aa320ecd..20ac1a5ecc460dd730544bda223c6751ec3f872b 100644 --- a/app/code/core/Mage/ImportExport/Model/Source/Export/Format.php +++ b/app/code/core/Mage/ImportExport/Model/Source/Export/Format.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ImportExport/Model/Source/Import/Behavior.php b/app/code/core/Mage/ImportExport/Model/Source/Import/Behavior.php index 65bfee45234f4b95bd17c775cc616645177ba3e8..4459c24a577a8443aae8dabfca3c5c5ac74fc441 100644 --- a/app/code/core/Mage/ImportExport/Model/Source/Import/Behavior.php +++ b/app/code/core/Mage/ImportExport/Model/Source/Import/Behavior.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ImportExport/Model/Source/Import/Entity.php b/app/code/core/Mage/ImportExport/Model/Source/Import/Entity.php index 78af736ea7a215faa705079e669f013650f6f10f..1396aaf09b4d8aa32f93c2d75df1d97168fa9290 100644 --- a/app/code/core/Mage/ImportExport/Model/Source/Import/Entity.php +++ b/app/code/core/Mage/ImportExport/Model/Source/Import/Entity.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ImportExport/controllers/Adminhtml/ExportController.php b/app/code/core/Mage/ImportExport/controllers/Adminhtml/ExportController.php index c05be7fe84c7624b78154f768fee8345d368401a..3be90ca2465d89ea689b9db005039acf7f9ce4d3 100644 --- a/app/code/core/Mage/ImportExport/controllers/Adminhtml/ExportController.php +++ b/app/code/core/Mage/ImportExport/controllers/Adminhtml/ExportController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ImportExport/controllers/Adminhtml/ImportController.php b/app/code/core/Mage/ImportExport/controllers/Adminhtml/ImportController.php index 19a9fb2715378de62684b08ff30a6f074d73bc56..527c87705ea420fc150cfadabff4ee8b7428e5a8 100644 --- a/app/code/core/Mage/ImportExport/controllers/Adminhtml/ImportController.php +++ b/app/code/core/Mage/ImportExport/controllers/Adminhtml/ImportController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ImportExport/etc/adminhtml.xml b/app/code/core/Mage/ImportExport/etc/adminhtml.xml index 535563e3715b456e212757d31f56a92d407a8e0c..bd47e5fe2681eda348dbfc05e42f0992253fe0dc 100644 --- a/app/code/core/Mage/ImportExport/etc/adminhtml.xml +++ b/app/code/core/Mage/ImportExport/etc/adminhtml.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/ImportExport/etc/config.xml b/app/code/core/Mage/ImportExport/etc/config.xml index 5b4b4fe8f303505f1ef49bac07f8d04113daa158..ac72c6491caaf0ce7dcd7297b2bbb1eece2d0953 100644 --- a/app/code/core/Mage/ImportExport/etc/config.xml +++ b/app/code/core/Mage/ImportExport/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/ImportExport/sql/importexport_setup/install-1.6.0.0.php b/app/code/core/Mage/ImportExport/sql/importexport_setup/install-1.6.0.0.php index ca9576dd3b770c092a8ad51b578b39d81dca9fde..e2b4edd1f8d888ac79a83590963647e660a1f065 100644 --- a/app/code/core/Mage/ImportExport/sql/importexport_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/ImportExport/sql/importexport_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ImportExport/sql/importexport_setup/mysql4-upgrade-1.6.0.1-1.6.0.2.php b/app/code/core/Mage/ImportExport/sql/importexport_setup/mysql4-upgrade-1.6.0.1-1.6.0.2.php index 2249fc8165cd6ad9e8d8d9e10207a39ec3fc8170..1b0b0820c11e74b257c384c37aa460e657e36436 100644 --- a/app/code/core/Mage/ImportExport/sql/importexport_setup/mysql4-upgrade-1.6.0.1-1.6.0.2.php +++ b/app/code/core/Mage/ImportExport/sql/importexport_setup/mysql4-upgrade-1.6.0.1-1.6.0.2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ImportExport/view/adminhtml/busy.phtml b/app/code/core/Mage/ImportExport/view/adminhtml/busy.phtml index 456a88f946be9702669b39af72f634b5ed6531d0..f15abae09f8cee48ebb3d8c37319b49053ed6f6f 100644 --- a/app/code/core/Mage/ImportExport/view/adminhtml/busy.phtml +++ b/app/code/core/Mage/ImportExport/view/adminhtml/busy.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/ImportExport/view/adminhtml/export/form/after.phtml b/app/code/core/Mage/ImportExport/view/adminhtml/export/form/after.phtml index 45be74974103d2a426e93cec9ee4668fbd6ed0c3..f04348a965e558a20f131d547e7343cf65bee682 100644 --- a/app/code/core/Mage/ImportExport/view/adminhtml/export/form/after.phtml +++ b/app/code/core/Mage/ImportExport/view/adminhtml/export/form/after.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -33,7 +33,7 @@ <div id="export_filter_grid_container" class="fieldset"><!-- --></div> </form> <div class="a-right"> - <button class="scalable" type="button" onclick="getFile();"><span><?php echo $this->__('Continue') ?></span></button> + <button class="scalable" type="button" onclick="getFile();"><span><span><span><?php echo $this->__('Continue') ?></span></span></span></button> </div> </div> <script type="text/javascript"> diff --git a/app/code/core/Mage/ImportExport/view/adminhtml/export/form/before.phtml b/app/code/core/Mage/ImportExport/view/adminhtml/export/form/before.phtml index 9aa705bcf71361b754b17c3c48cb6dddd1f91dd1..f98ad8011f021ea637329b642bb1cc0c3406fc06 100644 --- a/app/code/core/Mage/ImportExport/view/adminhtml/export/form/before.phtml +++ b/app/code/core/Mage/ImportExport/view/adminhtml/export/form/before.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -37,11 +37,13 @@ var url = "<?php echo $this->getUrl('*/*/getFilter') ?>"; url += ((url.slice(-1) != '/') ? '/' : '') + 'entity/' + $F('entity'); - new Ajax.Updater ('export_filter_grid_container', url, { + new Ajax.Request(url, { method: 'post', //parameters: $(this.formId).serialize(), evalScripts: true, - onComplete: function(){ + onComplete: function(transport) { + var responseText = transport.responseText.replace(/>\s+</g, '><'); + $('export_filter_grid_container').update(responseText); $('export_filter_container').show(); } }); diff --git a/app/code/core/Mage/ImportExport/view/adminhtml/import/form/after.phtml b/app/code/core/Mage/ImportExport/view/adminhtml/import/form/after.phtml index 64816a00ebafe9d87fde33774ea91cee2c24cd34..e8b8329fb25657414f97047069b31ae65a0e6184 100644 --- a/app/code/core/Mage/ImportExport/view/adminhtml/import/form/after.phtml +++ b/app/code/core/Mage/ImportExport/view/adminhtml/import/form/after.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/ImportExport/view/adminhtml/import/form/before.phtml b/app/code/core/Mage/ImportExport/view/adminhtml/import/form/before.phtml index 7c4ee95464e5e690c0f82848120ef8b02932ff90..c29b9aa9e8273e5b0dcd1b275ffd09acdb2ed97a 100644 --- a/app/code/core/Mage/ImportExport/view/adminhtml/import/form/before.phtml +++ b/app/code/core/Mage/ImportExport/view/adminhtml/import/form/before.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/ImportExport/view/adminhtml/import/frame/result.phtml b/app/code/core/Mage/ImportExport/view/adminhtml/import/frame/result.phtml index b57c31253f14ae3d23509de238950f90727ec1b5..1f42546c80c0d46bee43815a5d8d718e4a6330bb 100644 --- a/app/code/core/Mage/ImportExport/view/adminhtml/import/frame/result.phtml +++ b/app/code/core/Mage/ImportExport/view/adminhtml/import/frame/result.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/ImportExport/view/adminhtml/layout.xml b/app/code/core/Mage/ImportExport/view/adminhtml/layout.xml index 08ca3580837e2c47307c44bc8ef66b9a20a13793..ce1e3f50ba699a6fe1e4823ab9da89e8e2248c35 100644 --- a/app/code/core/Mage/ImportExport/view/adminhtml/layout.xml +++ b/app/code/core/Mage/ImportExport/view/adminhtml/layout.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Index/Block/Adminhtml/Notifications.php b/app/code/core/Mage/Index/Block/Adminhtml/Notifications.php index 6dad93a0fb7168289ed182a762dbf876e8c3ff54..821351086f2cbed8975b8c1deb911e5bf33c7151 100644 --- a/app/code/core/Mage/Index/Block/Adminhtml/Notifications.php +++ b/app/code/core/Mage/Index/Block/Adminhtml/Notifications.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Index - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Index/Block/Adminhtml/Process.php b/app/code/core/Mage/Index/Block/Adminhtml/Process.php index d0308f347da13f0e50e9b2934b4f374e994d4958..384240a090d0569cb6b3499206c8636ad0b47bf6 100644 --- a/app/code/core/Mage/Index/Block/Adminhtml/Process.php +++ b/app/code/core/Mage/Index/Block/Adminhtml/Process.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Index - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Index/Block/Adminhtml/Process/Edit.php b/app/code/core/Mage/Index/Block/Adminhtml/Process/Edit.php index 1d8901fa64512f3d1e50cdd77f9203271c3bb2a2..b5f8449533920076bcff83ac60c460ccfe484da5 100644 --- a/app/code/core/Mage/Index/Block/Adminhtml/Process/Edit.php +++ b/app/code/core/Mage/Index/Block/Adminhtml/Process/Edit.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Index - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Index/Block/Adminhtml/Process/Edit/Form.php b/app/code/core/Mage/Index/Block/Adminhtml/Process/Edit/Form.php index eb19e299516364ae2d5271b3a0293f1f7c070ad2..0dde07ca2fa93ac66146a3852e779b652496406e 100644 --- a/app/code/core/Mage/Index/Block/Adminhtml/Process/Edit/Form.php +++ b/app/code/core/Mage/Index/Block/Adminhtml/Process/Edit/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Index - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Index/Block/Adminhtml/Process/Edit/Tab/Main.php b/app/code/core/Mage/Index/Block/Adminhtml/Process/Edit/Tab/Main.php index 1f4806efa96828aca291018ced718aad7b907681..dec5597b53c3fbdf576107cc25a59098fcad035a 100644 --- a/app/code/core/Mage/Index/Block/Adminhtml/Process/Edit/Tab/Main.php +++ b/app/code/core/Mage/Index/Block/Adminhtml/Process/Edit/Tab/Main.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Index - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Index/Block/Adminhtml/Process/Edit/Tabs.php b/app/code/core/Mage/Index/Block/Adminhtml/Process/Edit/Tabs.php index d6d18ca7242f6aab64e17e4f306ba2583ead2594..5da7eea7568959ecde58ebccdd12731bedda4d70 100644 --- a/app/code/core/Mage/Index/Block/Adminhtml/Process/Edit/Tabs.php +++ b/app/code/core/Mage/Index/Block/Adminhtml/Process/Edit/Tabs.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Index - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Index/Block/Adminhtml/Process/Grid.php b/app/code/core/Mage/Index/Block/Adminhtml/Process/Grid.php index 59e3900ed8802e194f431ed7875d7e2c23175999..999be42e127caeaeebbc65c72f0b21498f183bce 100644 --- a/app/code/core/Mage/Index/Block/Adminhtml/Process/Grid.php +++ b/app/code/core/Mage/Index/Block/Adminhtml/Process/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Index - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Index/Block/Adminhtml/Process/Grid/Massaction.php b/app/code/core/Mage/Index/Block/Adminhtml/Process/Grid/Massaction.php index 6250266a1953afc8c83faa5d73f9f0e00e2116cf..c712c91a7c7c9fc6c46590417fc692df9c01819c 100644 --- a/app/code/core/Mage/Index/Block/Adminhtml/Process/Grid/Massaction.php +++ b/app/code/core/Mage/Index/Block/Adminhtml/Process/Grid/Massaction.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Index - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Index/Helper/Data.php b/app/code/core/Mage/Index/Helper/Data.php index f9f8cb3798923bca909470772d0a629a2bdcb179..45b90c801ebef6574134473854e03b3f11543752 100644 --- a/app/code/core/Mage/Index/Helper/Data.php +++ b/app/code/core/Mage/Index/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Index - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Index/Model/Event.php b/app/code/core/Mage/Index/Model/Event.php index 35a0095ac47df677f005e3c50ce50f9b7cc4b161..5030fd645eb9419f8b306eaed795a6b850e0f74b 100644 --- a/app/code/core/Mage/Index/Model/Event.php +++ b/app/code/core/Mage/Index/Model/Event.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Index - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -117,14 +117,10 @@ class Mage_Index_Model_Event extends Mage_Core_Model_Abstract public function resetData() { if ($this->_dataNamespace) { - $data = $this->getOldData(false); - $data[$this->_dataNamespace] = null; - $this->setOldData($data); $data = $this->getNewData(false); $data[$this->_dataNamespace] = null; $this->setNewData($data); } else { - $this->setOldData(array()); $this->setNewData(array()); } return $this; @@ -152,6 +148,37 @@ class Mage_Index_Model_Event extends Mage_Core_Model_Abstract return $this->_processIds; } + /** + * Merge new data + * + * @param array $previous + * @param mixed $current + * @return array + */ + protected function _mergeNewDataRecursive($previous, $current) + { + if (!is_array($current)) { + if (!is_null($current)) { + $previous[] = $current; + } + return $previous; + } + + foreach ($previous as $key => $value) { + if (array_key_exists($key, $current) && !is_null($current[$key]) && is_array($previous[$key])) { + if (!is_string($key) || is_array($current[$key])) { + $current[$key] = $this->_mergeNewDataRecursive($previous[$key], $current[$key]); + } + } elseif (!array_key_exists($key, $current) || is_null($current[$key])) { + $current[$key] = $previous[$key]; + } elseif (!is_array($previous[$key]) && !is_string($key)) { + $current[] = $previous[$key]; + } + } + + return $current; + } + /** * Merge previous event data to object. * Used for events duplicated protection @@ -165,40 +192,61 @@ class Mage_Index_Model_Event extends Mage_Core_Model_Abstract $this->setId($data['event_id']); $this->setCreatedAt($data['created_at']); } - if (!empty($data['old_data'])) { - $this->setOldData($data['old_data']); - } + if (!empty($data['new_data'])) { $previousNewData = unserialize($data['new_data']); $currentNewData = $this->getNewData(false); - $currentNewData = array_merge($previousNewData, $currentNewData); + $currentNewData = $this->_mergeNewDataRecursive($previousNewData, $currentNewData); $this->setNewData(serialize($currentNewData)); } return $this; } + /** + * Clean new data, unset data for done processes + * + * @return Mage_Index_Model_Event + */ + public function cleanNewData() + { + $processIds = $this->getProcessIds(); + if (!is_array($processIds) || empty($processIds)) { + return $this; + } + + $newData = $this->getNewData(false); + foreach ($processIds as $processId => $processStatus) { + if ($processStatus == Mage_Index_Model_Process::EVENT_STATUS_DONE) { + $process = Mage::getSingleton('Mage_Index_Model_Indexer')->getProcessById($processId); + if ($process) { + $namespace = get_class($process->getIndexer()); + if (array_key_exists($namespace, $newData)) { + unset($newData[$namespace]); + } + } + } + } + $this->setNewData(serialize($newData)); + + return $this; + } + /** * Get event old data array * + * @deprecated since 1.6.2.0 + * @param bool $useNamespace * @return array */ public function getOldData($useNamespace = true) { - $data = $this->_getData('old_data'); - if (is_string($data)) { - $data = unserialize($data); - } elseif (empty($data) || !is_array($data)) { - $data = array(); - } - if ($useNamespace && $this->_dataNamespace) { - return isset($data[$this->_dataNamespace]) ? $data[$this->_dataNamespace] : array(); - } - return $data; + return array(); } /** * Get event new data array * + * @param bool $useNamespace * @return array */ public function getNewData($useNamespace = true) @@ -218,26 +266,13 @@ class Mage_Index_Model_Event extends Mage_Core_Model_Abstract /** * Add new values to old data array (overwrite if value with same key exist) * + * @deprecated since 1.6.2.0 * @param array | string $data * @param null | mixed $value * @return Mage_Index_Model_Event */ public function addOldData($key, $value=null) { - $oldData = $this->getOldData(false); - if (!is_array($key)) { - $key = array($key => $value); - } - - if ($this->_dataNamespace) { - if (!isset($oldData[$this->_dataNamespace])) { - $oldData[$this->_dataNamespace] = array(); - } - $oldData[$this->_dataNamespace] = array_merge($oldData[$this->_dataNamespace], $key); - } else { - $oldData = array_merge($oldData, $key); - } - $this->setOldData($oldData); return $this; } @@ -295,9 +330,7 @@ class Mage_Index_Model_Event extends Mage_Core_Model_Abstract */ protected function _beforeSave() { - $oldData = $this->getOldData(false); $newData = $this->getNewData(false); - $this->setOldData(serialize($oldData)); $this->setNewData(serialize($newData)); if (!$this->hasCreatedAt()) { $this->setCreatedAt($this->_getResource()->formatDate(time(), true)); diff --git a/app/code/core/Mage/Index/Model/Indexer.php b/app/code/core/Mage/Index/Model/Indexer.php index 52e49f3e075f08adf4fbab3794890690e865094c..cf9b71bc238be24e5df1c16136ea96db2d54c122 100644 --- a/app/code/core/Mage/Index/Model/Indexer.php +++ b/app/code/core/Mage/Index/Model/Indexer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Index - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -203,26 +203,37 @@ class Mage_Index_Model_Indexer */ protected function _runAll($method, $args) { + $checkLocks = $method != 'register'; $processed = array(); foreach ($this->_processesCollection as $process) { $code = $process->getIndexerCode(); if (in_array($code, $processed)) { continue; } + $hasLocks = false; if ($process->getDepends()) { foreach ($process->getDepends() as $processCode) { $dependProcess = $this->getProcessByCode($processCode); if ($dependProcess && !in_array($processCode, $processed)) { - call_user_func_array(array($dependProcess, $method), $args); - $processed[] = $processCode; + if ($checkLocks && $dependProcess->isLocked()) { + $hasLocks = true; + } else { + call_user_func_array(array($dependProcess, $method), $args); + if ($checkLocks && $dependProcess->getMode() == Mage_Index_Model_Process::MODE_MANUAL) { + $hasLocks = true; + } else { + $processed[] = $processCode; + } + } } } } - call_user_func_array(array($process, $method), $args); - - $processed[] = $code; + if (!$hasLocks) { + call_user_func_array(array($process, $method), $args); + $processed[] = $code; + } } } @@ -242,4 +253,4 @@ class Mage_Index_Model_Indexer } return $eventName; } -} +} \ No newline at end of file diff --git a/app/code/core/Mage/Index/Model/Indexer/Abstract.php b/app/code/core/Mage/Index/Model/Indexer/Abstract.php index edd5adf4d889dd55d4772ec5f9397371a3ad57fc..04b5b0a0fa3d19fb8ded3b85e7d4dea3b44ba5a3 100644 --- a/app/code/core/Mage/Index/Model/Indexer/Abstract.php +++ b/app/code/core/Mage/Index/Model/Indexer/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Index - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Index/Model/Observer.php b/app/code/core/Mage/Index/Model/Observer.php index 2d1d49095f1f0c0da467160566839c07c1afd955..f452948337fb77d009c94f7475701c718c3c5eee 100644 --- a/app/code/core/Mage/Index/Model/Observer.php +++ b/app/code/core/Mage/Index/Model/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Index - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Index/Model/Process.php b/app/code/core/Mage/Index/Model/Process.php index 4c115df66489ff8de2c88dab959ca11519ba2a6b..d806783d7001cc4273348e9be7289afa694b4b67 100644 --- a/app/code/core/Mage/Index/Model/Process.php +++ b/app/code/core/Mage/Index/Model/Process.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Index - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -128,6 +128,9 @@ class Mage_Index_Model_Process extends Mage_Core_Model_Abstract $this->getIndexer()->register($event); $event->addProcessId($this->getId()); $this->_resetEventNamespace($event); + if ($this->getMode() == self::MODE_MANUAL) { + $this->_getResource()->updateStatus($this, self::STATUS_REQUIRE_REINDEX); + } } return $this; @@ -179,7 +182,9 @@ class Mage_Index_Model_Process extends Mage_Core_Model_Abstract /** @var $eventResource Mage_Index_Model_Resource_Event */ $eventResource = Mage::getResourceSingleton('Mage_Index_Model_Resource_Event'); - if ($eventsCollection->count() > 0 && $processStatus == self::STATUS_PENDING) { + if ($eventsCollection->count() > 0 && $processStatus == self::STATUS_PENDING + || $this->getForcePartialReindex() + ) { $this->_getResource()->beginTransaction(); try { $this->_processEventsCollection($eventsCollection, false); @@ -221,6 +226,11 @@ class Mage_Index_Model_Process extends Mage_Core_Model_Abstract return $this; } + /** @var $eventResource Mage_Index_Model_Resource_Event */ + $eventResource = Mage::getResourceSingleton('Mage_Index_Model_Resource_Event'); + $unprocessedEvents = $eventResource->getUnprocessedEvents($this); + $this->setForcePartialReindex(count($unprocessedEvents) > 0 && $this->getStatus() == self::STATUS_PENDING); + if ($this->getDepends()) { $indexer = Mage::getSingleton('Mage_Index_Model_Indexer'); foreach ($this->getDepends() as $code) { @@ -482,6 +492,10 @@ class Mage_Index_Model_Process extends Mage_Core_Model_Abstract */ public function changeStatus($status) { + Mage::dispatchEvent('index_process_change_status', array( + 'process' => $this, + 'status' => $status + )); $this->_getResource()->updateStatus($this, $status); return $this; } @@ -588,4 +602,4 @@ class Mage_Index_Model_Process extends Mage_Core_Model_Abstract $eventsCollection->addProcessFilter($this, self::EVENT_STATUS_NEW); return $eventsCollection; } -} \ No newline at end of file +} diff --git a/app/code/core/Mage/Index/Model/Resource/Abstract.php b/app/code/core/Mage/Index/Model/Resource/Abstract.php index 2f8f5124ae2c42efcca437b4aa80393d2f451bf1..a000c6eee43dfb3d0022c88989a1f18511817bda 100755 --- a/app/code/core/Mage/Index/Model/Resource/Abstract.php +++ b/app/code/core/Mage/Index/Model/Resource/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Index - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Index/Model/Resource/Event.php b/app/code/core/Mage/Index/Model/Resource/Event.php index 8a4f02399d0b07e3b4b6be1f1c9b3846bb028d1d..e81901e42a807f7559ee05cac04b8cff00ceeecf 100755 --- a/app/code/core/Mage/Index/Model/Resource/Event.php +++ b/app/code/core/Mage/Index/Model/Resource/Event.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Index - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -67,6 +67,7 @@ class Mage_Index_Model_Resource_Event extends Mage_Core_Model_Resource_Db_Abstra $object->mergePreviousData($data); } } + $object->cleanNewData(); return parent::_beforeSave($object); } @@ -85,7 +86,7 @@ class Mage_Index_Model_Resource_Event extends Mage_Core_Model_Resource_Db_Abstra $this->_getWriteAdapter()->delete($processTable); } else { foreach ($processIds as $processId => $processStatus) { - if (is_null($processStatus)) { + if (is_null($processStatus) || $processStatus == Mage_Index_Model_Process::EVENT_STATUS_DONE) { $this->_getWriteAdapter()->delete($processTable, array( 'process_id = ?' => $processId, 'event_id = ?' => $object->getId(), diff --git a/app/code/core/Mage/Index/Model/Resource/Event/Collection.php b/app/code/core/Mage/Index/Model/Resource/Event/Collection.php index ac4e0ded60280c474bfc3876e64b2069ab52e4df..59da762e5bd918ea5ade64bb04ae74aedd5d16c2 100755 --- a/app/code/core/Mage/Index/Model/Resource/Event/Collection.php +++ b/app/code/core/Mage/Index/Model/Resource/Event/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Index - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Index/Model/Resource/Process.php b/app/code/core/Mage/Index/Model/Resource/Process.php index 0644644638fc783498f7c35ba7626192a112b256..d7143333a1a9dad14f5bf096b2506921340fd042 100755 --- a/app/code/core/Mage/Index/Model/Resource/Process.php +++ b/app/code/core/Mage/Index/Model/Resource/Process.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Index - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -162,4 +162,14 @@ class Mage_Index_Model_Resource_Process extends Mage_Core_Model_Resource_Db_Abst $this->_updateProcessData($process->getId(), array('ended_at' => $this->formatDate(time()))); return $this; } + + /** + * Whether transaction is already started + * + * @return bool + */ + public function isInTransaction() + { + return $this->_getWriteAdapter()->getTransactionLevel() > 0; + } } diff --git a/app/code/core/Mage/Index/Model/Resource/Process/Collection.php b/app/code/core/Mage/Index/Model/Resource/Process/Collection.php index 1f7147ef6772e23e5203bc214d3ff401a9acf818..5feff1617c7043f8ec89482496b81c54f6a46fe1 100755 --- a/app/code/core/Mage/Index/Model/Resource/Process/Collection.php +++ b/app/code/core/Mage/Index/Model/Resource/Process/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Index - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Index/Model/Resource/Setup.php b/app/code/core/Mage/Index/Model/Resource/Setup.php index 7f9d3febb244bc5421a24739d684ef0897597b93..8c5ab70e870a4e9fe8393d5c19ae3cda31c90825 100755 --- a/app/code/core/Mage/Index/Model/Resource/Setup.php +++ b/app/code/core/Mage/Index/Model/Resource/Setup.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Index - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Index/Model/Shell.php b/app/code/core/Mage/Index/Model/Shell.php index f6e294f1d4c5f17bf49047808e4919dbb839c2aa..8045bf996e77b7980db71e551de434ccd7c54367 100644 --- a/app/code/core/Mage/Index/Model/Shell.php +++ b/app/code/core/Mage/Index/Model/Shell.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Index - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Index/controllers/Adminhtml/ProcessController.php b/app/code/core/Mage/Index/controllers/Adminhtml/ProcessController.php index 5322b2fd47b20fe1f1537f053f5c3498df002acc..44dc2dc2702bd20082ec945a66a1803a792c9bf9 100644 --- a/app/code/core/Mage/Index/controllers/Adminhtml/ProcessController.php +++ b/app/code/core/Mage/Index/controllers/Adminhtml/ProcessController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Index - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Index_Adminhtml_ProcessController extends Mage_Adminhtml_Controller_Action diff --git a/app/code/core/Mage/Index/etc/adminhtml.xml b/app/code/core/Mage/Index/etc/adminhtml.xml index 29af5eae1a9950dea02222e957f33e84d3881453..9f93bebfb69a2544eb6dadacda39ce653f753f0d 100644 --- a/app/code/core/Mage/Index/etc/adminhtml.xml +++ b/app/code/core/Mage/Index/etc/adminhtml.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Index - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Index/etc/config.xml b/app/code/core/Mage/Index/etc/config.xml index 61c674cb83f9ccc036fd9e381d190817a0f941a0..c442c6ff3d5a55f2f9bcd1247b316236539b4c57 100644 --- a/app/code/core/Mage/Index/etc/config.xml +++ b/app/code/core/Mage/Index/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Index - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Index/sql/index_setup/install-1.6.0.0.php b/app/code/core/Mage/Index/sql/index_setup/install-1.6.0.0.php index 6c85ae79cdb80789d1933e16f342a71ec70e1e22..c8a542879ea14ab9c245dfc75d3058b9a2330432 100644 --- a/app/code/core/Mage/Index/sql/index_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/Index/sql/index_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Index - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Index/view/adminhtml/layout.xml b/app/code/core/Mage/Index/view/adminhtml/layout.xml index 46cfbecca29e7512c021b8f3c81444a9e9cc8606..09db0740ed7bfe4dd2f16a999590f635d69345ac 100644 --- a/app/code/core/Mage/Index/view/adminhtml/layout.xml +++ b/app/code/core/Mage/Index/view/adminhtml/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Index/view/adminhtml/notifications.phtml b/app/code/core/Mage/Index/view/adminhtml/notifications.phtml index 66a559f16f7f00d511f6bb1eb9d473bfed8d600e..a2f790bb0c7cd915733b477866b59eb632757095 100644 --- a/app/code/core/Mage/Index/view/adminhtml/notifications.phtml +++ b/app/code/core/Mage/Index/view/adminhtml/notifications.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Install/Block/Abstract.php b/app/code/core/Mage/Install/Block/Abstract.php index f65cc7910760b0f0c85412d74e6aa3f25a59beb4..f99ddb47d8f67e29260f5161d284c33ecc0295fd 100644 --- a/app/code/core/Mage/Install/Block/Abstract.php +++ b/app/code/core/Mage/Install/Block/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Install - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Install/Block/Admin.php b/app/code/core/Mage/Install/Block/Admin.php index a8c7f2b8053f403de6ca37d3bbbe37b542790d83..c005839ab8ba8a44bab40b448ebfa6fbeb0fb44f 100644 --- a/app/code/core/Mage/Install/Block/Admin.php +++ b/app/code/core/Mage/Install/Block/Admin.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Install - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Install/Block/Begin.php b/app/code/core/Mage/Install/Block/Begin.php index 869ccbf006cb212881a1d63584257af1158f1c9f..3c5e405876577e85a468c614bc6a3c6976b1d65d 100644 --- a/app/code/core/Mage/Install/Block/Begin.php +++ b/app/code/core/Mage/Install/Block/Begin.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Install - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Install/Block/Config.php b/app/code/core/Mage/Install/Block/Config.php index 682c5a6f7c629e33be670381f9576d050d434c65..e547f1afad6061e86e07ffa4c78da7a967657b65 100644 --- a/app/code/core/Mage/Install/Block/Config.php +++ b/app/code/core/Mage/Install/Block/Config.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Install - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Install/Block/Db/Main.php b/app/code/core/Mage/Install/Block/Db/Main.php index e00f701999c5824f9966aa9e8950b24da7eda3f6..25ac906f507385dcf3ee3c0be9465d280934c09e 100644 --- a/app/code/core/Mage/Install/Block/Db/Main.php +++ b/app/code/core/Mage/Install/Block/Db/Main.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Install - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Install/Block/Db/Type.php b/app/code/core/Mage/Install/Block/Db/Type.php index d9c351a9ab1456fdbadbf3c966852b5c1f4127d4..d46f5cb4a393b1da2d2b97cd762c5362a65ea43e 100644 --- a/app/code/core/Mage/Install/Block/Db/Type.php +++ b/app/code/core/Mage/Install/Block/Db/Type.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Install - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Install/Block/Db/Type/Mysql4.php b/app/code/core/Mage/Install/Block/Db/Type/Mysql4.php index c0afd264deabbc22f89388788b0df7f7be865d40..0690dc55c205a23a35c5af7866f39abe3b00aea6 100644 --- a/app/code/core/Mage/Install/Block/Db/Type/Mysql4.php +++ b/app/code/core/Mage/Install/Block/Db/Type/Mysql4.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Install - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Install/Block/Download.php b/app/code/core/Mage/Install/Block/Download.php index b8223dc8c0a752d8be54574fbb65688f38bc33cc..c09d1c33719a3f9989418eba57a542ecd5006824 100644 --- a/app/code/core/Mage/Install/Block/Download.php +++ b/app/code/core/Mage/Install/Block/Download.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Install - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Install/Block/End.php b/app/code/core/Mage/Install/Block/End.php index 53d07105abca24b0ff815d289dc6f89073986d71..783bcbc46e2ad50834518b62af465b3a783d6c93 100644 --- a/app/code/core/Mage/Install/Block/End.php +++ b/app/code/core/Mage/Install/Block/End.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Install - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Install/Block/Locale.php b/app/code/core/Mage/Install/Block/Locale.php index 88cecd8ca5ef6c3cbf6fc53bf10c6325d03c2481..6ca9ef7ce9180b8e426e21f3ffc36e651002431e 100644 --- a/app/code/core/Mage/Install/Block/Locale.php +++ b/app/code/core/Mage/Install/Block/Locale.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Install - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Install/Block/State.php b/app/code/core/Mage/Install/Block/State.php index f7482604f23250fde2194555c06b5288df767450..fd2f6ac3465fad3a3e5bdd14bc74c5a39ce8e7d8 100644 --- a/app/code/core/Mage/Install/Block/State.php +++ b/app/code/core/Mage/Install/Block/State.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Install - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Install/Controller/Action.php b/app/code/core/Mage/Install/Controller/Action.php index 26927c7ade364a2b82cb08f635dae98e393a6d3f..641c5f776b17bffdf895eaeefdc365b1adaf9166 100644 --- a/app/code/core/Mage/Install/Controller/Action.php +++ b/app/code/core/Mage/Install/Controller/Action.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Install - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Install/Helper/Data.php b/app/code/core/Mage/Install/Helper/Data.php index cfe36d60943a3303356b79fcc40902e0c8fb8e94..b70f8a373069b05afa3f25e0814d2de23290d198 100644 --- a/app/code/core/Mage/Install/Helper/Data.php +++ b/app/code/core/Mage/Install/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Install - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Install/Model/Config.php b/app/code/core/Mage/Install/Model/Config.php index 5ea19a7c997f1eb279d5f3db830c4f5f4720bb59..4ac9d76c94eed25dbfc903613e506ee7eb846ce5 100644 --- a/app/code/core/Mage/Install/Model/Config.php +++ b/app/code/core/Mage/Install/Model/Config.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Install - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Install/Model/Installer.php b/app/code/core/Mage/Install/Model/Installer.php index 307b7bd34bb6962156c43bfe8d9710a7f95bd0e1..54bea9db62157a5d490222641502eebbf8da4e35 100644 --- a/app/code/core/Mage/Install/Model/Installer.php +++ b/app/code/core/Mage/Install/Model/Installer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Install - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Install/Model/Installer/Abstract.php b/app/code/core/Mage/Install/Model/Installer/Abstract.php index 99dca32a5f0953e4bdf1e1ee3fbd4a29ec25c8b8..57d4cf0d59f27168ae3d7ebc0c8bb19af9d48cde 100644 --- a/app/code/core/Mage/Install/Model/Installer/Abstract.php +++ b/app/code/core/Mage/Install/Model/Installer/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Install - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Install/Model/Installer/Config.php b/app/code/core/Mage/Install/Model/Installer/Config.php index e968384989b42d56c17e176eb83151319ea7fa38..ec33d451af5bc33de48cc47117650d2fbffbf29e 100644 --- a/app/code/core/Mage/Install/Model/Installer/Config.php +++ b/app/code/core/Mage/Install/Model/Installer/Config.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Install - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Install/Model/Installer/Console.php b/app/code/core/Mage/Install/Model/Installer/Console.php index eec8b204b6ef43b5b7527f5584f38c9b8dcba6a2..15cca540727a4c6c3da606cbd7ae240f03b9342d 100644 --- a/app/code/core/Mage/Install/Model/Installer/Console.php +++ b/app/code/core/Mage/Install/Model/Installer/Console.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Install - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Install/Model/Installer/Data.php b/app/code/core/Mage/Install/Model/Installer/Data.php index 0efb75fd656efcd9af375bcaf29095aa83c6826a..e01190aca276f3bec2d03bd0e1db410b0379f6c1 100644 --- a/app/code/core/Mage/Install/Model/Installer/Data.php +++ b/app/code/core/Mage/Install/Model/Installer/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Install - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Install/Model/Installer/Db.php b/app/code/core/Mage/Install/Model/Installer/Db.php index 0a764a64beefccf64a6cc1e1f5323837aaa3cf35..e56049b877a1da4f1d581e72c1c90a55a2cd9b2d 100644 --- a/app/code/core/Mage/Install/Model/Installer/Db.php +++ b/app/code/core/Mage/Install/Model/Installer/Db.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Install - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -67,8 +67,8 @@ class Mage_Install_Model_Installer_Db extends Mage_Install_Model_Installer_Abstr } } if (!empty($absenteeExtensions)) { - Mage::throwException(Mage::helper('Mage_Install_Helper_Data')->__('PHP Extensions "%s" must be loaded.', - implode(',', $absenteeExtensions)) + Mage::throwException( + Mage::helper('Mage_Install_Helper_Data')->__('PHP Extensions "%s" must be loaded.', implode(',', $absenteeExtensions)) ); } @@ -78,14 +78,16 @@ class Mage_Install_Model_Installer_Db extends Mage_Install_Model_Installer_Abstr // check DB server version if (version_compare($version, $requiredVersion) == -1) { - Mage::throwException(Mage::helper('Mage_Install_Helper_Data')->__('The database server version ' - . 'does not match system requirements (required: %s, actual: %s).', $requiredVersion, $version)); + Mage::throwException( + Mage::helper('Mage_Install_Helper_Data')->__('The database server version doesn\'t match system requirements (required: %s, actual: %s).', $requiredVersion, $version) + ); } // check InnoDB support if (!$resource->supportEngine()) { - Mage::throwException(Mage::helper('Mage_Install_Helper_Data')->__('Database server does not support ' - . 'the InnoDB storage engine.')); + Mage::throwException( + Mage::helper('Mage_Install_Helper_Data')->__('Database server does not support the InnoDB storage engine.') + ); } // TODO: check user roles @@ -121,8 +123,8 @@ class Mage_Install_Model_Installer_Db extends Mage_Install_Model_Installer_Abstr if ($data['db_prefix'] != '') { if (!preg_match('/^[a-z]+[a-z0-9_]*$/', $data['db_prefix'])) { Mage::throwException( - Mage::helper('Mage_Install_Helper_Data')->__('The table prefix should contain only letters (a-z), ' - . 'numbers (0-9) or underscores (_), the first character should be a letter.')); + Mage::helper('Mage_Install_Helper_Data')->__('The table prefix should contain only letters (a-z), numbers (0-9) or underscores (_), the first character should be a letter.') + ); } } //set default db model @@ -158,7 +160,9 @@ class Mage_Install_Model_Installer_Db extends Mage_Install_Model_Installer_Abstr if (!isset($this->_dbResource)) { $resource = Mage::getSingleton("Mage_Install_Model_Installer_Db_" . ucfirst($model)); if (!$resource) { - Mage::throwException(Mage::helper('Mage_Install_Helper_Data')->__(sprintf('Installer does not exist for %s database type', $model))); + Mage::throwException( + Mage::helper('Mage_Install_Helper_Data')->__('Installer does not exist for %s database type', $model) + ); } $this->_dbResource = $resource; } diff --git a/app/code/core/Mage/Install/Model/Installer/Db/Abstract.php b/app/code/core/Mage/Install/Model/Installer/Db/Abstract.php index 1e360215ce18e1ee5f0bf17ccd6d7db5e967aa43..9b8fdc09c7344b39dff1bc87a7f9d593c6c8bbbe 100644 --- a/app/code/core/Mage/Install/Model/Installer/Db/Abstract.php +++ b/app/code/core/Mage/Install/Model/Installer/Db/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Install - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Install/Model/Installer/Db/Mysql4.php b/app/code/core/Mage/Install/Model/Installer/Db/Mysql4.php index 4ef7e60068bd763c5d7e58d48413f1e1b50c8d1a..bc482b5d0ff55ce7a2a604a042f75160b2f94cb5 100644 --- a/app/code/core/Mage/Install/Model/Installer/Db/Mysql4.php +++ b/app/code/core/Mage/Install/Model/Installer/Db/Mysql4.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Install - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Install/Model/Installer/Env.php b/app/code/core/Mage/Install/Model/Installer/Env.php index 84e1322087c1d71aa0e6f1185414c837a3affa8e..e55707cd4f56403b0524192dba1af485edfe805b 100644 --- a/app/code/core/Mage/Install/Model/Installer/Env.php +++ b/app/code/core/Mage/Install/Model/Installer/Env.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Install - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Install/Model/Installer/Filesystem.php b/app/code/core/Mage/Install/Model/Installer/Filesystem.php index b2885de08d1e69b56605e0991b35063928a368c9..f811edfedcfec8189e1045878354423dc8eba3b9 100644 --- a/app/code/core/Mage/Install/Model/Installer/Filesystem.php +++ b/app/code/core/Mage/Install/Model/Installer/Filesystem.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Install - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Install/Model/Installer/Pear.php b/app/code/core/Mage/Install/Model/Installer/Pear.php index 36afd78e67521079e1de134670e2354b80c07b87..3710c56efbca9a304d70ddace0c9c0df14fc97b1 100644 --- a/app/code/core/Mage/Install/Model/Installer/Pear.php +++ b/app/code/core/Mage/Install/Model/Installer/Pear.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Install - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Install/Model/Observer.php b/app/code/core/Mage/Install/Model/Observer.php index 67300d4951625b3b835f9f63f8c858568051f00c..e2cac5bec746dd5052102acd7985ecefa21e0f85 100644 --- a/app/code/core/Mage/Install/Model/Observer.php +++ b/app/code/core/Mage/Install/Model/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Install - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Install/Model/Session.php b/app/code/core/Mage/Install/Model/Session.php index 1911d3822c58c50d43122988bb88dbe6e967312e..d96f67e9b636c132da541b140f571f1d8e1b80ad 100644 --- a/app/code/core/Mage/Install/Model/Session.php +++ b/app/code/core/Mage/Install/Model/Session.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Install - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Install/Model/Wizard.php b/app/code/core/Mage/Install/Model/Wizard.php index e53bd8459574bd568e0a5ea15ad289edf57b1a8e..dcc70866c1ca4411bfc6885e5099f45ec451ea9d 100644 --- a/app/code/core/Mage/Install/Model/Wizard.php +++ b/app/code/core/Mage/Install/Model/Wizard.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Install - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Install/controllers/IndexController.php b/app/code/core/Mage/Install/controllers/IndexController.php index 08d8fb20eb5c253be6cb4b90f6f23f68fdaaf68b..e4c04a0da160fe56bb31b0bc373f09ed13b14d9f 100644 --- a/app/code/core/Mage/Install/controllers/IndexController.php +++ b/app/code/core/Mage/Install/controllers/IndexController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Install - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Install/controllers/WizardController.php b/app/code/core/Mage/Install/controllers/WizardController.php index 1fd8422ad5844ac6c163a056fca475e035311c39..60adb2d8a00cc67862ddfdd6bd59959877a0c7b1 100644 --- a/app/code/core/Mage/Install/controllers/WizardController.php +++ b/app/code/core/Mage/Install/controllers/WizardController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Install - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Install/etc/config.xml b/app/code/core/Mage/Install/etc/config.xml index 15969398938534403dbf3cc28124481ca201c0e2..5d052f2591271573dac26b3352f0596393b91fea 100644 --- a/app/code/core/Mage/Install/etc/config.xml +++ b/app/code/core/Mage/Install/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Install - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Install/etc/install.xml b/app/code/core/Mage/Install/etc/install.xml index 17dedf6e1e40d0ce5d002ba92d33a29fd01a25da..06f11e22b7ebd82ea1a841e3b66c11e35024b1ca 100644 --- a/app/code/core/Mage/Install/etc/install.xml +++ b/app/code/core/Mage/Install/etc/install.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Install - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Install/view/install/begin.phtml b/app/code/core/Mage/Install/view/install/begin.phtml index 306d43c11b2974bf659d1c364695bd9c7fdbfb4c..211fe00ae1f0fef65f7a6922bb48bd78afa3dccb 100644 --- a/app/code/core/Mage/Install/view/install/begin.phtml +++ b/app/code/core/Mage/Install/view/install/begin.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/Install/view/install/config.phtml b/app/code/core/Mage/Install/view/install/config.phtml index 6d0e7a2d3c6b3c626e5135dfb7bece86978d168a..374e93bc25914daf955e38974a6d55d5f2eb3366 100644 --- a/app/code/core/Mage/Install/view/install/config.phtml +++ b/app/code/core/Mage/Install/view/install/config.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ @@ -99,9 +99,6 @@ <li> <input type="checkbox" name="config[use_secure_admin]" id="use_secure_admin" value="1" <?php if($this->getFormData()->getUseSecureAdmin()): ?>checked="checked"<?php endif; ?> /> <label for="use_secure_admin"><?php echo $this->__('Run admin interface with SSL') ?></label><br /> - <!--<p style="margin-top:4px; line-height:1.3em; color:#666;"> - <small><?php echo $this->__('') ?></small> - </p>--> </li> <li> <input type="checkbox" name="skip_url_validation" id="skip_url_validation" value="1" <?php if($this->getSkipUrlValidation()): ?>checked="checked"<?php endif; ?> /> diff --git a/app/code/core/Mage/Install/view/install/create_admin.phtml b/app/code/core/Mage/Install/view/install/create_admin.phtml index 61df414140c33a420ca5d58dc097b1c2f30750da..670b0c533f92da2514ff172befc5a0992238279e 100644 --- a/app/code/core/Mage/Install/view/install/create_admin.phtml +++ b/app/code/core/Mage/Install/view/install/create_admin.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/Install/view/install/db/main.phtml b/app/code/core/Mage/Install/view/install/db/main.phtml index c40468fcd3a89cecf2e6b91978abdb2b16f7908b..6efb2448c67e563bc5c097fd6a5e31b8d4666fbc 100644 --- a/app/code/core/Mage/Install/view/install/db/main.phtml +++ b/app/code/core/Mage/Install/view/install/db/main.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/Install/view/install/db/mysql4.phtml b/app/code/core/Mage/Install/view/install/db/mysql4.phtml index 9b3c6fd147fce5fb7e7aceab03d16000b2f252db..6f3aedf4bd314d3d8961ebd171d87d879e714215 100644 --- a/app/code/core/Mage/Install/view/install/db/mysql4.phtml +++ b/app/code/core/Mage/Install/view/install/db/mysql4.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/Install/view/install/download.phtml b/app/code/core/Mage/Install/view/install/download.phtml index 5582ef84fc9f775882d7ae8816a6258d2839ff61..dc59b24615b207915688f71acf5e5ea31b36566b 100644 --- a/app/code/core/Mage/Install/view/install/download.phtml +++ b/app/code/core/Mage/Install/view/install/download.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/Install/view/install/end.phtml b/app/code/core/Mage/Install/view/install/end.phtml index b00b7ae3f2a94c4c3449f332e6a2f5b3fb37a617..bba70ff0728b157ba8717109cd2da5e75c21321f 100644 --- a/app/code/core/Mage/Install/view/install/end.phtml +++ b/app/code/core/Mage/Install/view/install/end.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/Install/view/install/layout.xml b/app/code/core/Mage/Install/view/install/layout.xml index d670ef68933ef6a48e924c49374bc79ef212905b..c3ca1bc4c44c5d559a21c743aa3ad48c4d0e5ee7 100644 --- a/app/code/core/Mage/Install/view/install/layout.xml +++ b/app/code/core/Mage/Install/view/install/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/Install/view/install/locale.phtml b/app/code/core/Mage/Install/view/install/locale.phtml index 850ecd958ca4cd3d91ea59e9cbf0d755f4a051b3..a29c749315ad0c45fd183c501492c9540cc8a9f7 100644 --- a/app/code/core/Mage/Install/view/install/locale.phtml +++ b/app/code/core/Mage/Install/view/install/locale.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/Install/view/install/page.phtml b/app/code/core/Mage/Install/view/install/page.phtml index e9602d055fa27617fb0c63d5d91701f031616f5b..af921d7d9bc93313234723acf64686f52269a7bb 100644 --- a/app/code/core/Mage/Install/view/install/page.phtml +++ b/app/code/core/Mage/Install/view/install/page.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Install/view/install/state.phtml b/app/code/core/Mage/Install/view/install/state.phtml index 842203c6c006850f6b50cbd5a4665ff84174f60c..a596d614e85bb6b5b4e709071d71c46c4f9f2fd1 100644 --- a/app/code/core/Mage/Install/view/install/state.phtml +++ b/app/code/core/Mage/Install/view/install/state.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Log/Helper/Data.php b/app/code/core/Mage/Log/Helper/Data.php index 3e373039a1510b2eae5ba0f1fd2b1d279f77790f..cfc6dd24f44294f4e5046d9f2a51239d7341969d 100644 --- a/app/code/core/Mage/Log/Helper/Data.php +++ b/app/code/core/Mage/Log/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Log - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Log/Model/Aggregation.php b/app/code/core/Mage/Log/Model/Aggregation.php index 3b9c1c6d6cd8a23c2879961231c8302203c94234..b0280c8662755851f1e58101fd4817e6f4c66fa8 100644 --- a/app/code/core/Mage/Log/Model/Aggregation.php +++ b/app/code/core/Mage/Log/Model/Aggregation.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Log - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Log/Model/Cron.php b/app/code/core/Mage/Log/Model/Cron.php index 29ad84fc1cc295b9c0ad087e5de409b59ff443cd..411544b5ba3ba22b1c0e08c7c3e2309152e84ca4 100644 --- a/app/code/core/Mage/Log/Model/Cron.php +++ b/app/code/core/Mage/Log/Model/Cron.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Log - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Log/Model/Customer.php b/app/code/core/Mage/Log/Model/Customer.php index dce045652b848fc08b2f8bf0290506d83be5f691..420c5a80de3e3e6c9bf893898bb309697196d03c 100644 --- a/app/code/core/Mage/Log/Model/Customer.php +++ b/app/code/core/Mage/Log/Model/Customer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Log - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Log/Model/Log.php b/app/code/core/Mage/Log/Model/Log.php index dd24e26bbfe2880d4c88e584b68ccb3cf9b3641e..ad4f138020578f551d00c84ecece5551dae4e195 100644 --- a/app/code/core/Mage/Log/Model/Log.php +++ b/app/code/core/Mage/Log/Model/Log.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Log - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Log/Model/Resource/Aggregation.php b/app/code/core/Mage/Log/Model/Resource/Aggregation.php index cb6bfb79703929ba346a46c7c283ff823f66b64a..a1b2e44facbbd3cb420ee88df3e03ad721c35387 100644 --- a/app/code/core/Mage/Log/Model/Resource/Aggregation.php +++ b/app/code/core/Mage/Log/Model/Resource/Aggregation.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Log - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Log/Model/Resource/Customer.php b/app/code/core/Mage/Log/Model/Resource/Customer.php index 4bc99c61da025a9aae623f351bd93910bf39a4c7..571cd87e058127ff3d26ef26252743bd9f1884cf 100755 --- a/app/code/core/Mage/Log/Model/Resource/Customer.php +++ b/app/code/core/Mage/Log/Model/Resource/Customer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Log - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Log/Model/Resource/Helper/Mysql4.php b/app/code/core/Mage/Log/Model/Resource/Helper/Mysql4.php index 92ab41e634149602eb5a88b9dd2b9da31979eef9..0a455e8190fc13e908d9bccd38d4fff442726512 100644 --- a/app/code/core/Mage/Log/Model/Resource/Helper/Mysql4.php +++ b/app/code/core/Mage/Log/Model/Resource/Helper/Mysql4.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Log - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Log/Model/Resource/Log.php b/app/code/core/Mage/Log/Model/Resource/Log.php index e72fd89f3a3a07437c88b4aae0cd1799e7009ac6..9f2da7d1ca4cef2113c52c423ca1109229135c49 100755 --- a/app/code/core/Mage/Log/Model/Resource/Log.php +++ b/app/code/core/Mage/Log/Model/Resource/Log.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Log - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Log/Model/Resource/Shell.php b/app/code/core/Mage/Log/Model/Resource/Shell.php index 885eba63339849a7b92e0aee06efa3ebb83b470a..159127da5a3714bbe1deb3809f8e4a1eb70e9952 100644 --- a/app/code/core/Mage/Log/Model/Resource/Shell.php +++ b/app/code/core/Mage/Log/Model/Resource/Shell.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Log - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Log/Model/Resource/Visitor.php b/app/code/core/Mage/Log/Model/Resource/Visitor.php index 401eae93cb3a5746b63800604a4c0b760f750e65..36d8810a5295cd5dc2dc8f40c100c49e1f60b1f6 100755 --- a/app/code/core/Mage/Log/Model/Resource/Visitor.php +++ b/app/code/core/Mage/Log/Model/Resource/Visitor.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Log - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -119,6 +119,26 @@ class Mage_Log_Model_Resource_Visitor extends Mage_Core_Model_Resource_Db_Abstra return $this; } + /** + * Perform actions after object load + * + * @param Varien_Object $object + * @return Mage_Core_Model_Resource_Db_Abstract + */ + protected function _afterLoad(Mage_Core_Model_Abstract $object) + { + parent::_afterLoad($object); + // Add information about quote to visitor + $adapter = $this->_getReadAdapter(); + $select = $adapter->select()->from($this->getTable('log_quote'), 'quote_id') + ->where('visitor_id = ?', $object->getId())->limit(1); + $result = $adapter->query($select)->fetch(); + if (isset($result['quote_id'])) { + $object->setQuoteId((int) $result['quote_id']); + } + return $this; + } + /** * Saving visitor information * diff --git a/app/code/core/Mage/Log/Model/Resource/Visitor/Collection.php b/app/code/core/Mage/Log/Model/Resource/Visitor/Collection.php index 3773a74e3dc7e6e9c1acbb19dab12a88557bf14e..a85eef3527065c2c4d7c6e89251c963f62933cbc 100755 --- a/app/code/core/Mage/Log/Model/Resource/Visitor/Collection.php +++ b/app/code/core/Mage/Log/Model/Resource/Visitor/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Log - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Log/Model/Resource/Visitor/Online.php b/app/code/core/Mage/Log/Model/Resource/Visitor/Online.php index 42b0dad48070d01ad0a80ff6a823bbe4995264c6..4eaa15dfba1705096d714b1e68a487d2a5206ccf 100755 --- a/app/code/core/Mage/Log/Model/Resource/Visitor/Online.php +++ b/app/code/core/Mage/Log/Model/Resource/Visitor/Online.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Log - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Log/Model/Resource/Visitor/Online/Collection.php b/app/code/core/Mage/Log/Model/Resource/Visitor/Online/Collection.php index 4c2c099b5571623a6ca0047308497f41e1b6adf2..262cb34a6aae1afc29e5062d4d6325f8190397c4 100755 --- a/app/code/core/Mage/Log/Model/Resource/Visitor/Online/Collection.php +++ b/app/code/core/Mage/Log/Model/Resource/Visitor/Online/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Log - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Log/Model/Shell.php b/app/code/core/Mage/Log/Model/Shell.php index 79ff31f79d81dcd8203020167c6dca69bdba3428..7818becdbc3c892282d4cb08e952ec711c7b6176 100644 --- a/app/code/core/Mage/Log/Model/Shell.php +++ b/app/code/core/Mage/Log/Model/Shell.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Log - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Log/Model/Visitor.php b/app/code/core/Mage/Log/Model/Visitor.php index 8fbfcfac0f89e49e603ae8eda7af08aa07789fe1..896a5d64fb829006a42696f49385b7db8f887c38 100644 --- a/app/code/core/Mage/Log/Model/Visitor.php +++ b/app/code/core/Mage/Log/Model/Visitor.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Log - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Log/Model/Visitor/Online.php b/app/code/core/Mage/Log/Model/Visitor/Online.php index c1400093160d0cd3e526aa75ac409edad052b687..c36233816d9b9fe147d7e357d1b394b4b07f0302 100644 --- a/app/code/core/Mage/Log/Model/Visitor/Online.php +++ b/app/code/core/Mage/Log/Model/Visitor/Online.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Log - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Log/data/log_setup/data-install-1.6.0.0.php b/app/code/core/Mage/Log/data/log_setup/data-install-1.6.0.0.php index b847d09f21219945b41157cd496d341654ad83d4..b0f458aed2d2bea501fdb41c4960d4984c3a6ac3 100644 --- a/app/code/core/Mage/Log/data/log_setup/data-install-1.6.0.0.php +++ b/app/code/core/Mage/Log/data/log_setup/data-install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Log - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Log/etc/config.xml b/app/code/core/Mage/Log/etc/config.xml index dd25e4c50ca802ccce1adfd911071b65b412fdba..86383e00eba84e4a4ea936fa950a6efa6b7f2d07 100644 --- a/app/code/core/Mage/Log/etc/config.xml +++ b/app/code/core/Mage/Log/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Log - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Log/etc/system.xml b/app/code/core/Mage/Log/etc/system.xml index ccfdb1fced139b667d8402eacd7ec0fb4967c7c1..8dc7e2a6289617988cbadecd4bbec40a4a422ba3 100644 --- a/app/code/core/Mage/Log/etc/system.xml +++ b/app/code/core/Mage/Log/etc/system.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Log - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Log/sql/log_setup/install-1.6.0.0.php b/app/code/core/Mage/Log/sql/log_setup/install-1.6.0.0.php index 347e0bb651681d12419a117f905864e6e27283af..dcd8acd2db8ea1661f00401d68a365671e358011 100644 --- a/app/code/core/Mage/Log/sql/log_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/Log/sql/log_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Log - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Media/Helper/Data.php b/app/code/core/Mage/Media/Helper/Data.php index b5613f0f048d8789ff8b4d1cf2f9caafea7e60a0..7680cc3f6fe0af2e14eae177b38b30624c426504 100644 --- a/app/code/core/Mage/Media/Helper/Data.php +++ b/app/code/core/Mage/Media/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Media - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Media/Model/File/Image.php b/app/code/core/Mage/Media/Model/File/Image.php index 8ad2108f38d755f452c7db25f635b4a87a4bf666..b8b0cd83a4fb91f67cd55c7b4a2c1ddc0240fbe5 100644 --- a/app/code/core/Mage/Media/Model/File/Image.php +++ b/app/code/core/Mage/Media/Model/File/Image.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Media - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Media/Model/Image.php b/app/code/core/Mage/Media/Model/Image.php index 6de54ea89c0095b291815065b140db1add369d3a..e6e08d1e6058d63b6434aca4493de6b82f6c5a99 100644 --- a/app/code/core/Mage/Media/Model/Image.php +++ b/app/code/core/Mage/Media/Model/Image.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Media - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Media/Model/Image/Config/Interface.php b/app/code/core/Mage/Media/Model/Image/Config/Interface.php index 8b5fac849cb8c75a651986ca4d88265eedf0349a..2efb2e44ad53d31bc5941bbef0a72a4cb1e0b7fb 100644 --- a/app/code/core/Mage/Media/Model/Image/Config/Interface.php +++ b/app/code/core/Mage/Media/Model/Image/Config/Interface.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Media - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Media/etc/config.xml b/app/code/core/Mage/Media/etc/config.xml index 2cd94b6800302f2f0f3c015a4bf6be3eeb5dd653..b8320ec95b7df9ec78d6b9fb47115da06e1a3664 100644 --- a/app/code/core/Mage/Media/etc/config.xml +++ b/app/code/core/Mage/Media/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Media - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Newsletter/Block/Subscribe.php b/app/code/core/Mage/Newsletter/Block/Subscribe.php index 7143466c448d57e21dbebe45f23fcf234ea86304..2aa18880be43397c9ed89bc879ff7b1aa477fc0e 100644 --- a/app/code/core/Mage/Newsletter/Block/Subscribe.php +++ b/app/code/core/Mage/Newsletter/Block/Subscribe.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Newsletter - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Newsletter/Helper/Data.php b/app/code/core/Mage/Newsletter/Helper/Data.php index b04aa7812c57985e0b227b42666e711ade56f9f4..40de3527d6032b3f382b07df811374c83a3e040e 100644 --- a/app/code/core/Mage/Newsletter/Helper/Data.php +++ b/app/code/core/Mage/Newsletter/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Newsletter - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Newsletter/Model/Message.php b/app/code/core/Mage/Newsletter/Model/Message.php index b5b00aafdca1d9c252585d47b68769ae56ef6d5c..0a4928fb598380711851715e3dce17e65afe62fe 100644 --- a/app/code/core/Mage/Newsletter/Model/Message.php +++ b/app/code/core/Mage/Newsletter/Model/Message.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Newsletter - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Newsletter/Model/Observer.php b/app/code/core/Mage/Newsletter/Model/Observer.php index d86abf46eb33f72b6078a4ba7d0f44b1907830be..2ec75112e2d6c427ae05ad82800b8a7cc7ea5a74 100644 --- a/app/code/core/Mage/Newsletter/Model/Observer.php +++ b/app/code/core/Mage/Newsletter/Model/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Newsletter - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Newsletter/Model/Problem.php b/app/code/core/Mage/Newsletter/Model/Problem.php index bcb2beddeb99d878bdb4b1ebf8afad1229b1399f..2b83a30c5dbfe963de0b55afa0ba951445bad23f 100644 --- a/app/code/core/Mage/Newsletter/Model/Problem.php +++ b/app/code/core/Mage/Newsletter/Model/Problem.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Newsletter - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Newsletter/Model/Queue.php b/app/code/core/Mage/Newsletter/Model/Queue.php index 241777fdb867ec10319316c1be1f455ac521218d..cc8026988c36912897a75b6050568e5c85c5544d 100644 --- a/app/code/core/Mage/Newsletter/Model/Queue.php +++ b/app/code/core/Mage/Newsletter/Model/Queue.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Newsletter - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Newsletter/Model/Resource/Problem.php b/app/code/core/Mage/Newsletter/Model/Resource/Problem.php index a449564b74aec8be1b45da9eb5b43d2d77aca472..a4f9d16bd98197767e1d291ea3306bbedc362aff 100755 --- a/app/code/core/Mage/Newsletter/Model/Resource/Problem.php +++ b/app/code/core/Mage/Newsletter/Model/Resource/Problem.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Newsletter - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Newsletter/Model/Resource/Problem/Collection.php b/app/code/core/Mage/Newsletter/Model/Resource/Problem/Collection.php index a06892ae4b578369fbfc3c1e4e1bcbba34c9ee1b..7c2d01895a004eed46e4b850b8996ec0edbeb724 100755 --- a/app/code/core/Mage/Newsletter/Model/Resource/Problem/Collection.php +++ b/app/code/core/Mage/Newsletter/Model/Resource/Problem/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Newsletter - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -68,6 +68,7 @@ class Mage_Newsletter_Model_Resource_Problem_Collection extends Mage_Core_Model_ 'main_table.subscriber_id = subscriber.subscriber_id', array('subscriber_email','customer_id','subscriber_status') ); + $this->addFilterToMap('subscriber_id', 'main_table.subscriber_id'); $this->_subscribersInfoJoinedFlag = true; return $this; @@ -84,7 +85,7 @@ class Mage_Newsletter_Model_Resource_Problem_Collection extends Mage_Core_Model_ 'main_table.queue_id = queue.queue_id', array('queue_start_at', 'queue_finish_at') ) - ->joinLeft(array('template'=>$this->getTable('newsletter_template')), 'main_table.queue_id = queue.queue_id', + ->joinLeft(array('template'=>$this->getTable('newsletter_template')), 'queue.template_id = template.template_id', array('template_subject','template_code','template_sender_name','template_sender_email') ); return $this; diff --git a/app/code/core/Mage/Newsletter/Model/Resource/Queue.php b/app/code/core/Mage/Newsletter/Model/Resource/Queue.php index 546a9c16666bd83c57d2e6420b33b2a3e9aec66b..c0fd9fb5b66ec01357caa83ea664e609088bb42b 100755 --- a/app/code/core/Mage/Newsletter/Model/Resource/Queue.php +++ b/app/code/core/Mage/Newsletter/Model/Resource/Queue.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Newsletter - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Newsletter/Model/Resource/Queue/Collection.php b/app/code/core/Mage/Newsletter/Model/Resource/Queue/Collection.php index f3f18f2d793291be014729974d1eb407130c66e6..075a4a337b45ecb778fbee5bb1f9f6027a3028e2 100755 --- a/app/code/core/Mage/Newsletter/Model/Resource/Queue/Collection.php +++ b/app/code/core/Mage/Newsletter/Model/Resource/Queue/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Newsletter - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Newsletter/Model/Resource/Subscriber.php b/app/code/core/Mage/Newsletter/Model/Resource/Subscriber.php index 3526dadc0742cfeb720ed8c40a326e278e948679..acf2b5a738166cf1e46db16dbf4ee63bfdbc7641 100755 --- a/app/code/core/Mage/Newsletter/Model/Resource/Subscriber.php +++ b/app/code/core/Mage/Newsletter/Model/Resource/Subscriber.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Newsletter - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Newsletter/Model/Resource/Subscriber/Collection.php b/app/code/core/Mage/Newsletter/Model/Resource/Subscriber/Collection.php index c19d9ff80c0b5ccdd046cf47ed5de77f9b4d324f..f5b65bc96501ee9a2bf93c3db876a37bd01bcdd1 100755 --- a/app/code/core/Mage/Newsletter/Model/Resource/Subscriber/Collection.php +++ b/app/code/core/Mage/Newsletter/Model/Resource/Subscriber/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Newsletter - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Newsletter/Model/Resource/Template.php b/app/code/core/Mage/Newsletter/Model/Resource/Template.php index 6eeff3b77716f989fde61f97e90b5eb097fb5635..73fda5b1f78bd172258bc9549ea35bb612d230f7 100755 --- a/app/code/core/Mage/Newsletter/Model/Resource/Template.php +++ b/app/code/core/Mage/Newsletter/Model/Resource/Template.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Newsletter - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Newsletter/Model/Resource/Template/Collection.php b/app/code/core/Mage/Newsletter/Model/Resource/Template/Collection.php index 88543b56b496501958615e483a780ec0a6c36de4..924200ac7570b735266d8a713841b1ba6c8b5fd4 100755 --- a/app/code/core/Mage/Newsletter/Model/Resource/Template/Collection.php +++ b/app/code/core/Mage/Newsletter/Model/Resource/Template/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Newsletter - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Newsletter/Model/Session.php b/app/code/core/Mage/Newsletter/Model/Session.php index 83b889bd057561d1f718b7b18872f94fab5c4a7c..3f9826b9d38647cd00a9dc1edfd5b52fc3dc329a 100644 --- a/app/code/core/Mage/Newsletter/Model/Session.php +++ b/app/code/core/Mage/Newsletter/Model/Session.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Newsletter - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Newsletter/Model/Subscriber.php b/app/code/core/Mage/Newsletter/Model/Subscriber.php index 41aafc82ab3b3944639860145635fc4a4525624c..e03dae5ea323c3283a7a47dd0be82d7c5785dfec 100644 --- a/app/code/core/Mage/Newsletter/Model/Subscriber.php +++ b/app/code/core/Mage/Newsletter/Model/Subscriber.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Newsletter - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Newsletter/Model/Template.php b/app/code/core/Mage/Newsletter/Model/Template.php index 1701432ad227a8df0dade7c844b4b5f8c19f8581..d9cf4df6a70a2d0bd01aa4ce55931b5dbc2209ea 100644 --- a/app/code/core/Mage/Newsletter/Model/Template.php +++ b/app/code/core/Mage/Newsletter/Model/Template.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Newsletter - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Newsletter/Model/Template/Filter.php b/app/code/core/Mage/Newsletter/Model/Template/Filter.php index 88835a00755e9ea8b4588025c9ef39b39ac82ba0..7bef97a92b65d20e8a5ad33624002d82686b4a2f 100644 --- a/app/code/core/Mage/Newsletter/Model/Template/Filter.php +++ b/app/code/core/Mage/Newsletter/Model/Template/Filter.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Newsletter - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Newsletter/controllers/ManageController.php b/app/code/core/Mage/Newsletter/controllers/ManageController.php index 3d4a2a858d4f4bebeeb2cead16eacb0047b7209a..18afa268efcf29531fb10f561265fbc77c115775 100644 --- a/app/code/core/Mage/Newsletter/controllers/ManageController.php +++ b/app/code/core/Mage/Newsletter/controllers/ManageController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Newsletter - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Newsletter/controllers/SubscriberController.php b/app/code/core/Mage/Newsletter/controllers/SubscriberController.php index f7dccd5952bb42bb44db62304b07d1d1015db60b..caaeea77453e0ca19adba314435e7b1f4b22055c 100644 --- a/app/code/core/Mage/Newsletter/controllers/SubscriberController.php +++ b/app/code/core/Mage/Newsletter/controllers/SubscriberController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Newsletter - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Newsletter/data/newsletter_setup/data-upgrade-1.6.0.0-1.6.0.1.php b/app/code/core/Mage/Newsletter/data/newsletter_setup/data-upgrade-1.6.0.0-1.6.0.1.php index 004d5fc704f6db5d3d69a19efe5fd649c7e3493b..180453d08d135fc0a38414818d3e0d8b381be0f3 100644 --- a/app/code/core/Mage/Newsletter/data/newsletter_setup/data-upgrade-1.6.0.0-1.6.0.1.php +++ b/app/code/core/Mage/Newsletter/data/newsletter_setup/data-upgrade-1.6.0.0-1.6.0.1.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Newsletter - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Newsletter/etc/adminhtml.xml b/app/code/core/Mage/Newsletter/etc/adminhtml.xml index 21a763f152f29cb7af459633b06fc350e0df5b1b..e0cf764ca7ccea238b2da7d660655a726c642295 100644 --- a/app/code/core/Mage/Newsletter/etc/adminhtml.xml +++ b/app/code/core/Mage/Newsletter/etc/adminhtml.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Newsletter - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Newsletter/etc/config.xml b/app/code/core/Mage/Newsletter/etc/config.xml index f8faef0820aae87ed9a8b4e670eabe32d815b2e7..7dd987c964799ad13bd53ca69745ed28f4825067 100644 --- a/app/code/core/Mage/Newsletter/etc/config.xml +++ b/app/code/core/Mage/Newsletter/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Newsletter - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Newsletter/etc/system.xml b/app/code/core/Mage/Newsletter/etc/system.xml index d1360f2954de5f5951e8d66bce8b250f2fb4f252..3cd2bc00cd5ea539dbf63299dcf8617fec19666d 100644 --- a/app/code/core/Mage/Newsletter/etc/system.xml +++ b/app/code/core/Mage/Newsletter/etc/system.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Newsletter - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Newsletter/sql/newsletter_setup/install-1.6.0.0.php b/app/code/core/Mage/Newsletter/sql/newsletter_setup/install-1.6.0.0.php index e648071119f68f02933843ee832dc83a3597ed3e..159380f4ece743191e1994a70907f7c6f6bb72e9 100644 --- a/app/code/core/Mage/Newsletter/sql/newsletter_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/Newsletter/sql/newsletter_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Newsletter - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Newsletter/view/frontend/layout.xml b/app/code/core/Mage/Newsletter/view/frontend/layout.xml index 67959520685a531dd495c452e170cdb756824445..54347b1d54c4bb631381af8ef252e2fca086644b 100644 --- a/app/code/core/Mage/Newsletter/view/frontend/layout.xml +++ b/app/code/core/Mage/Newsletter/view/frontend/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/Newsletter/view/frontend/subscribe.phtml b/app/code/core/Mage/Newsletter/view/frontend/subscribe.phtml index 85e42a5872d6a740dec872ca83544eacec57205e..ad7e75db5cfbde951253e03c9a78a27d15f0ee90 100644 --- a/app/code/core/Mage/Newsletter/view/frontend/subscribe.phtml +++ b/app/code/core/Mage/Newsletter/view/frontend/subscribe.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -30,8 +30,9 @@ </div> <form action="<?php echo $this->getFormActionUrl() ?>" method="post" id="newsletter-validate-detail"> <div class="block-content"> - <div class="form-subscribe-header"><?php echo $this->__('Sign up for our newsletter') ?></div> - <label for="newsletter"><?php echo $this->__('Sign Up for Our Newsletter:') ?></label> + <div class="form-subscribe-header"> + <label for="newsletter"><?php echo $this->__('Sign Up for Our Newsletter:') ?></label> + </div> <div class="input-box"> <input type="text" name="email" id="newsletter" title="<?php echo $this->__('Sign up for our newsletter') ?>" class="input-text required-entry validate-email" /> </div> diff --git a/app/code/core/Mage/Ogone/Block/Form.php b/app/code/core/Mage/Ogone/Block/Form.php index dc271ee8a224941758978f77cf8dc07b559a7392..3b96c85de891f5dfcf2726f44c88d5ca1943c721 100644 --- a/app/code/core/Mage/Ogone/Block/Form.php +++ b/app/code/core/Mage/Ogone/Block/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Ogone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Ogone/Block/Info.php b/app/code/core/Mage/Ogone/Block/Info.php index 54a75669aa6eaa6dbfa863afc8344f15b4233d44..8564f680ed2f6947aaafa188fe9063df0a8a67d2 100644 --- a/app/code/core/Mage/Ogone/Block/Info.php +++ b/app/code/core/Mage/Ogone/Block/Info.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Ogone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Ogone/Block/Paypage.php b/app/code/core/Mage/Ogone/Block/Paypage.php index ee479c761ff2a423925ea386b5c8b275e5744683..15737becbf655841f374c787e5acefa3056a5140 100644 --- a/app/code/core/Mage/Ogone/Block/Paypage.php +++ b/app/code/core/Mage/Ogone/Block/Paypage.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Ogone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Ogone/Block/Placeform.php b/app/code/core/Mage/Ogone/Block/Placeform.php index 50820e12d7a02871f01314b58534aef68aa058dd..b590463ffb8d8a47698c17e272e35ff6f93fc515 100644 --- a/app/code/core/Mage/Ogone/Block/Placeform.php +++ b/app/code/core/Mage/Ogone/Block/Placeform.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Ogone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Ogone/Helper/Data.php b/app/code/core/Mage/Ogone/Helper/Data.php index c5f92a181a178887c5a9645cb0775f4f162d3d5a..9be7b890097a9df16258e8b64a8cef1a4d19c8bd 100644 --- a/app/code/core/Mage/Ogone/Helper/Data.php +++ b/app/code/core/Mage/Ogone/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Ogone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Ogone/Model/Api.php b/app/code/core/Mage/Ogone/Model/Api.php index c3816c7f8fbbaa409f7c83d33e3751152468f660..f0ace41387b23c00dc53dd0352e90c7f9477a411 100644 --- a/app/code/core/Mage/Ogone/Model/Api.php +++ b/app/code/core/Mage/Ogone/Model/Api.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Ogone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Ogone/Model/Config.php b/app/code/core/Mage/Ogone/Model/Config.php index 9a953d6d9a3d69f2f1d1d8f31fdb7b4abd1b9ad9..7e4ac7330a5f13c40c350a15f2d6219dfa309c8d 100644 --- a/app/code/core/Mage/Ogone/Model/Config.php +++ b/app/code/core/Mage/Ogone/Model/Config.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Ogone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Ogone/Model/Source/PaymentAction.php b/app/code/core/Mage/Ogone/Model/Source/PaymentAction.php index 840ca7f5b9eff72ce0bf4a3e671ac334fc4d63ed..5538ffef8c169ea5a3d73a25242a80619e130e61 100644 --- a/app/code/core/Mage/Ogone/Model/Source/PaymentAction.php +++ b/app/code/core/Mage/Ogone/Model/Source/PaymentAction.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Ogone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Ogone/Model/Source/Pmlist.php b/app/code/core/Mage/Ogone/Model/Source/Pmlist.php index ccd55378fdc86c08d0e55dcbd2898edde70156fb..514206c79849b2ac23f6c5e57885932e2a018ef3 100644 --- a/app/code/core/Mage/Ogone/Model/Source/Pmlist.php +++ b/app/code/core/Mage/Ogone/Model/Source/Pmlist.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Ogone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Ogone/Model/Source/Template.php b/app/code/core/Mage/Ogone/Model/Source/Template.php index fa930e833930abce131877fd1f4fb8ae7ee6b099..53f74b7d2e77fc17bc25481e2bb59ae9de8d7c87 100644 --- a/app/code/core/Mage/Ogone/Model/Source/Template.php +++ b/app/code/core/Mage/Ogone/Model/Source/Template.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Ogone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Ogone/controllers/ApiController.php b/app/code/core/Mage/Ogone/controllers/ApiController.php index b9aa8906adb6a4669d4955cbe474a049509c98e3..bafd6ebc66b2cc9486a5ecb503cc8c881d1ad9bb 100644 --- a/app/code/core/Mage/Ogone/controllers/ApiController.php +++ b/app/code/core/Mage/Ogone/controllers/ApiController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Ogone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Ogone/etc/config.xml b/app/code/core/Mage/Ogone/etc/config.xml index a30de63ede65e23ea4a152bacce376600fa591ba..9051e3f6f0d60ee2f64e149b130160f317581ec2 100644 --- a/app/code/core/Mage/Ogone/etc/config.xml +++ b/app/code/core/Mage/Ogone/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Ogone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Ogone/etc/system.xml b/app/code/core/Mage/Ogone/etc/system.xml index 542ec407e5bb82dd9b466f06d7b2f56598bdb375..d6fbf5c9998ea21e4c7bde50393a4972d21a7c4d 100644 --- a/app/code/core/Mage/Ogone/etc/system.xml +++ b/app/code/core/Mage/Ogone/etc/system.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Ogone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Ogone/sql/ogone_setup/install-1.6.0.0.php b/app/code/core/Mage/Ogone/sql/ogone_setup/install-1.6.0.0.php index 4a606f26403aa591f58be252ee739f164ba81d38..cb7821cbdfad50f0baa76e04c85b4730d273c3ac 100644 --- a/app/code/core/Mage/Ogone/sql/ogone_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/Ogone/sql/ogone_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Ogone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Ogone/view/adminhtml/info.phtml b/app/code/core/Mage/Ogone/view/adminhtml/info.phtml index 7a3f1f3188641c62516c89e09ceaa9a5fa3d5fcb..904c92db534f641cdb2745b91765e7777c10fb1e 100644 --- a/app/code/core/Mage/Ogone/view/adminhtml/info.phtml +++ b/app/code/core/Mage/Ogone/view/adminhtml/info.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Ogone/view/frontend/form.phtml b/app/code/core/Mage/Ogone/view/frontend/form.phtml index 734e6c91971b9bf2a6c5fbc1a2f12123b66ef910..8518ad5e50b9d71340e3991004e40e3946f632a2 100644 --- a/app/code/core/Mage/Ogone/view/frontend/form.phtml +++ b/app/code/core/Mage/Ogone/view/frontend/form.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Ogone/view/frontend/info.phtml b/app/code/core/Mage/Ogone/view/frontend/info.phtml index 83f3d7a85585771df5cbfaff7e28b3854bb04e75..37e54380119adaa1f09bcd8a836a0d046dac8155 100644 --- a/app/code/core/Mage/Ogone/view/frontend/info.phtml +++ b/app/code/core/Mage/Ogone/view/frontend/info.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Ogone/view/frontend/layout.xml b/app/code/core/Mage/Ogone/view/frontend/layout.xml index 4fd76cddca3eb35dfac3c43cac36847a91ea6a86..a986cb1d4d1b93cbacef67fff08eb98924a31039 100644 --- a/app/code/core/Mage/Ogone/view/frontend/layout.xml +++ b/app/code/core/Mage/Ogone/view/frontend/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Ogone/view/frontend/paypage.phtml b/app/code/core/Mage/Ogone/view/frontend/paypage.phtml index 95ca8bcd79c2e5a4251bb48b53c41f2735ce356c..37c7a22afe5d873af87cb189674703bdba25ba61 100644 --- a/app/code/core/Mage/Ogone/view/frontend/paypage.phtml +++ b/app/code/core/Mage/Ogone/view/frontend/paypage.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Ogone/view/frontend/placeform.phtml b/app/code/core/Mage/Ogone/view/frontend/placeform.phtml index 5bddedbd71c3c65d996784d75355e6b6ec1e4bda..43ac372968ab2f4a7bb1c4f38a9244a6475fc95f 100644 --- a/app/code/core/Mage/Ogone/view/frontend/placeform.phtml +++ b/app/code/core/Mage/Ogone/view/frontend/placeform.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Page/Block/Html.php b/app/code/core/Mage/Page/Block/Html.php index 812d42e32f2ee2bde76b099eb31665f19b7fa5e2..ce9aa43ba1bf847186596e93b0e20e6ee74cc78e 100644 --- a/app/code/core/Mage/Page/Block/Html.php +++ b/app/code/core/Mage/Page/Block/Html.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Page - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Page/Block/Html/Breadcrumbs.php b/app/code/core/Mage/Page/Block/Html/Breadcrumbs.php index 759a53f0c8578429be1711a55aa8d1075c3499d7..1ceaae6fe43a6de6b2cc09263f2966bd7fa0f792 100644 --- a/app/code/core/Mage/Page/Block/Html/Breadcrumbs.php +++ b/app/code/core/Mage/Page/Block/Html/Breadcrumbs.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Page - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Page/Block/Html/Footer.php b/app/code/core/Mage/Page/Block/Html/Footer.php index 24f7ef1c768b8afd683c0be9c59020cb120aa4f4..5019ee7a0b80f7b788fd16dc23b2a1545bf05c4c 100644 --- a/app/code/core/Mage/Page/Block/Html/Footer.php +++ b/app/code/core/Mage/Page/Block/Html/Footer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Page - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Page/Block/Html/Head.php b/app/code/core/Mage/Page/Block/Html/Head.php index b4bb83d0829ec167a1f8dfc9dbebc6fd5bc6e74d..63af96bc7ec383a8c9702d7307bcb836b958a876 100644 --- a/app/code/core/Mage/Page/Block/Html/Head.php +++ b/app/code/core/Mage/Page/Block/Html/Head.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Page - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -130,11 +130,12 @@ class Mage_Page_Block_Html_Head extends Mage_Core_Block_Template * @param string|null $if * @param string|null $cond * @return Mage_Page_Block_Html_Head + * @throws Magento_Exception */ protected function _addItem($type, $name, $params = '', $if = null, $cond = null) { if (empty($name)) { - throw new Exception('File name must be not empty.'); + throw new Magento_Exception('File name must be not empty.'); } $this->_data['items'][$type . '/' . $name] = array( 'type' => $type, diff --git a/app/code/core/Mage/Page/Block/Html/Header.php b/app/code/core/Mage/Page/Block/Html/Header.php index 95da2941e3131f2057d865a9d9604d8d060c1f78..682f9acdd3bf6ef86aa7eb73a597a1465e24c1a9 100644 --- a/app/code/core/Mage/Page/Block/Html/Header.php +++ b/app/code/core/Mage/Page/Block/Html/Header.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Page - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Page/Block/Html/Notices.php b/app/code/core/Mage/Page/Block/Html/Notices.php index 07eb0bd995a8d88698e93b307069eb7a6431b98a..264164938f6c1655169bb08ff2cf4efab7045c64 100644 --- a/app/code/core/Mage/Page/Block/Html/Notices.php +++ b/app/code/core/Mage/Page/Block/Html/Notices.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Page - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Page/Block/Html/Pager.php b/app/code/core/Mage/Page/Block/Html/Pager.php index 31854ab5fa1d499a0b6bd9b44da315f7466a17cc..e5ef5d0d1fe8eaea5a42b576fb9bfffe41950e0e 100644 --- a/app/code/core/Mage/Page/Block/Html/Pager.php +++ b/app/code/core/Mage/Page/Block/Html/Pager.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Page - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Page/Block/Html/Welcome.php b/app/code/core/Mage/Page/Block/Html/Welcome.php index 661e15dd8ef196c663049a5c45522dcde7730e5a..35a42db4c282a4ab6a497c8ab53796e990cfe89c 100644 --- a/app/code/core/Mage/Page/Block/Html/Welcome.php +++ b/app/code/core/Mage/Page/Block/Html/Welcome.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Page - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Page/Block/Html/Wrapper.php b/app/code/core/Mage/Page/Block/Html/Wrapper.php index 1364c8c580aba73ebf402f001d52bb15bae089c4..a0ce0fa440048aac5fbe21eebbfe518884bcf13f 100644 --- a/app/code/core/Mage/Page/Block/Html/Wrapper.php +++ b/app/code/core/Mage/Page/Block/Html/Wrapper.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Page - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Page/Block/Js/Cookie.php b/app/code/core/Mage/Page/Block/Js/Cookie.php index e7591637a057d69b4866710aefad547e032febe7..5d789ff7394dc5e8660dd0bb849e2595cc98131a 100644 --- a/app/code/core/Mage/Page/Block/Js/Cookie.php +++ b/app/code/core/Mage/Page/Block/Js/Cookie.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Page - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Page/Block/Js/Translate.php b/app/code/core/Mage/Page/Block/Js/Translate.php index 13f378eb23d3acb8d724ec15c5aeba1aff1f9489..b9da1ec39cf04cc6995fb0711a7c34248ebb1eb6 100644 --- a/app/code/core/Mage/Page/Block/Js/Translate.php +++ b/app/code/core/Mage/Page/Block/Js/Translate.php @@ -20,18 +20,19 @@ * * @category Mage * @package Mage_Page - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - + /** * Js translation block * + * @deprecated since 1.7.0.0 (used in adminhtml/default/default/layout/main.xml) * @author Magento Core Team <core@magentocommerce.com> */ class Mage_Page_Block_Js_Translate extends Mage_Core_Block_Template { - public function __construct() + public function __construct() { parent::__construct(); } diff --git a/app/code/core/Mage/Page/Block/Redirect.php b/app/code/core/Mage/Page/Block/Redirect.php index 487b25bb6f34e15cd1000297301605e553f01233..905a31730e89e6954a67eaf9559c69a9e0b08b87 100644 --- a/app/code/core/Mage/Page/Block/Redirect.php +++ b/app/code/core/Mage/Page/Block/Redirect.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Page - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Page/Block/Switch.php b/app/code/core/Mage/Page/Block/Switch.php index 57e30964588f837dd608e501f044fb4f539f84f8..461795ebd0bc4352f8b6c2d0eb6c71926a177e16 100644 --- a/app/code/core/Mage/Page/Block/Switch.php +++ b/app/code/core/Mage/Page/Block/Switch.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Page - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -92,6 +92,11 @@ class Mage_Page_Block_Switch extends Mage_Core_Block_Template return $this->getData('raw_stores'); } + /** + * Retrieve list of store groups with default urls set + * + * @return array + */ public function getGroups() { if (!$this->hasData('groups')) { @@ -101,6 +106,7 @@ class Mage_Page_Block_Switch extends Mage_Core_Block_Template $groups = array(); $localeCode = Mage::getStoreConfig('general/locale/code'); foreach ($rawGroups as $group) { + /* @var $group Mage_Core_Model_Store_Group */ if (!isset($rawStores[$group->getId()])) { continue; } @@ -108,16 +114,9 @@ class Mage_Page_Block_Switch extends Mage_Core_Block_Template $groups[] = $group; continue; } - $store = false; - foreach ($rawStores[$group->getId()] as $s) { - if ($s->getLocaleCode() == $localeCode) { - $store = $s; - break; - } - } - if (!$store && isset($rawStores[$group->getId()][$group->getDefaultStoreId()])) { - $store = $rawStores[$group->getId()][$group->getDefaultStoreId()]; - } + + $store = $group->getDefaultStoreByLocale($localeCode); + if ($store) { $group->setHomeUrl($store->getHomeUrl()); $groups[] = $group; diff --git a/app/code/core/Mage/Page/Block/Template/Container.php b/app/code/core/Mage/Page/Block/Template/Container.php index 3a45c4c7d306fc3fad4c60e668cdcb9849aa0df1..7b8afad9fd37fc5ed3505bf14cbc5bf9a9a0d968 100644 --- a/app/code/core/Mage/Page/Block/Template/Container.php +++ b/app/code/core/Mage/Page/Block/Template/Container.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Page - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Page/Block/Template/Links.php b/app/code/core/Mage/Page/Block/Template/Links.php index 804d1b33112b1d30403f95907d67fb0676d8a098..06a7dce20fdb0bcf1ed518beb2ad9d0f3a307864 100644 --- a/app/code/core/Mage/Page/Block/Template/Links.php +++ b/app/code/core/Mage/Page/Block/Template/Links.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Page - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Page/Block/Template/Links/Block.php b/app/code/core/Mage/Page/Block/Template/Links/Block.php index b822c3b67855b8ec2108b3163dd7f49ff212f506..346bdb83f47e073dea08203596c99f8ef3471fd7 100644 --- a/app/code/core/Mage/Page/Block/Template/Links/Block.php +++ b/app/code/core/Mage/Page/Block/Template/Links/Block.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Page - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Page/Helper/Data.php b/app/code/core/Mage/Page/Helper/Data.php index 92305f92e302119b9812f89a165e3b9a8b828a48..94b44a116464df9a0d86598f24636c91b94e424f 100644 --- a/app/code/core/Mage/Page/Helper/Data.php +++ b/app/code/core/Mage/Page/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Page - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Page/Helper/Html.php b/app/code/core/Mage/Page/Helper/Html.php index 235e337d75196b6b47b605d4028b30b565fc237e..20fd3e26fd732b805f6b4754eb876521dfd64208 100644 --- a/app/code/core/Mage/Page/Helper/Html.php +++ b/app/code/core/Mage/Page/Helper/Html.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Page - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Page/Helper/Layout.php b/app/code/core/Mage/Page/Helper/Layout.php index 839875ed5594412a5cbe23627e7e312d60f29d42..f8dd96e456f3b3adc5e1df9000db44ec4ed8bdaf 100644 --- a/app/code/core/Mage/Page/Helper/Layout.php +++ b/app/code/core/Mage/Page/Helper/Layout.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Page - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Page/Model/Config.php b/app/code/core/Mage/Page/Model/Config.php index 7d61f4c2fe0df41882d28ae68adf359232745288..763e87d66ac8adf8445e0faeb7ff2684c53d06b1 100644 --- a/app/code/core/Mage/Page/Model/Config.php +++ b/app/code/core/Mage/Page/Model/Config.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Page - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Page/Model/Source/Layout.php b/app/code/core/Mage/Page/Model/Source/Layout.php index b56667a09466d559da13bf8ae359b3f953abc143..9fe4a470f4ecc8f1a599452753d3d7c52daab486 100644 --- a/app/code/core/Mage/Page/Model/Source/Layout.php +++ b/app/code/core/Mage/Page/Model/Source/Layout.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Page - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Page/etc/config.xml b/app/code/core/Mage/Page/etc/config.xml index 822e3ba479f14a965e8bb14ee291f6be5994bc76..38d449428609e919ddcf810734779e066a19ca85 100644 --- a/app/code/core/Mage/Page/etc/config.xml +++ b/app/code/core/Mage/Page/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Page - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Page/etc/system.xml b/app/code/core/Mage/Page/etc/system.xml index 308e5f080265267408919ded3d34c45c93038234..7340a949dd390ddf64f81588c9f94d35830913ce 100644 --- a/app/code/core/Mage/Page/etc/system.xml +++ b/app/code/core/Mage/Page/etc/system.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Page - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Page/view/frontend/1column.phtml b/app/code/core/Mage/Page/view/frontend/1column.phtml index cda8615755f0b5972f16aead05e6ce43e77e3dce..b511083634f209b440323e0986760189811fab40 100644 --- a/app/code/core/Mage/Page/view/frontend/1column.phtml +++ b/app/code/core/Mage/Page/view/frontend/1column.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Page/view/frontend/2columns-left.phtml b/app/code/core/Mage/Page/view/frontend/2columns-left.phtml index 56cf49060a1f4acfd6f5bb8a17230fdfc1a310de..b2d41a3041d20b71b67cdc643b089e58465dc54d 100644 --- a/app/code/core/Mage/Page/view/frontend/2columns-left.phtml +++ b/app/code/core/Mage/Page/view/frontend/2columns-left.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Page/view/frontend/2columns-right.phtml b/app/code/core/Mage/Page/view/frontend/2columns-right.phtml index 3affd93d9bbb4c5e8d125ce717f396f23773356c..b872ee66d8192440bb8773c5a47bf0352f17f079 100644 --- a/app/code/core/Mage/Page/view/frontend/2columns-right.phtml +++ b/app/code/core/Mage/Page/view/frontend/2columns-right.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Page/view/frontend/3columns.phtml b/app/code/core/Mage/Page/view/frontend/3columns.phtml index e963227e07996a9d23c85cb47e3e95a4bac1e63f..54da9f7d85a3a9ad34c4f9b859ea14c897c0c1c1 100644 --- a/app/code/core/Mage/Page/view/frontend/3columns.phtml +++ b/app/code/core/Mage/Page/view/frontend/3columns.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Page/view/frontend/callouts/left_col.phtml b/app/code/core/Mage/Page/view/frontend/callouts/left_col.phtml index 5248e8bfb44243b0f2e01f2bf429803887a9d241..8f8202d9e3b3d37597b96274cd2b7303634be618 100644 --- a/app/code/core/Mage/Page/view/frontend/callouts/left_col.phtml +++ b/app/code/core/Mage/Page/view/frontend/callouts/left_col.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Page/view/frontend/callouts/right_col.phtml b/app/code/core/Mage/Page/view/frontend/callouts/right_col.phtml index 5248e8bfb44243b0f2e01f2bf429803887a9d241..8f8202d9e3b3d37597b96274cd2b7303634be618 100644 --- a/app/code/core/Mage/Page/view/frontend/callouts/right_col.phtml +++ b/app/code/core/Mage/Page/view/frontend/callouts/right_col.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Page/view/frontend/empty.phtml b/app/code/core/Mage/Page/view/frontend/empty.phtml index 00ff2170761ab0a40473e6d18bca9239fa392903..825a1a43a4a65b64eeacc63bc7bd62f2ada3c1ec 100644 --- a/app/code/core/Mage/Page/view/frontend/empty.phtml +++ b/app/code/core/Mage/Page/view/frontend/empty.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Page/view/frontend/html/breadcrumbs.phtml b/app/code/core/Mage/Page/view/frontend/html/breadcrumbs.phtml index c4123cc8599e2a87434e083ec0adafee0e784e58..a3305450710dbc28016d62cb6c336f6a7ecfcc3e 100644 --- a/app/code/core/Mage/Page/view/frontend/html/breadcrumbs.phtml +++ b/app/code/core/Mage/Page/view/frontend/html/breadcrumbs.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Page/view/frontend/html/footer.phtml b/app/code/core/Mage/Page/view/frontend/html/footer.phtml index a5c6881b719f64aad83721b4a3c82b2b3c389c25..e059aacc712fa2596701931d0a59d0f8388993a5 100644 --- a/app/code/core/Mage/Page/view/frontend/html/footer.phtml +++ b/app/code/core/Mage/Page/view/frontend/html/footer.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Page/view/frontend/html/head.phtml b/app/code/core/Mage/Page/view/frontend/html/head.phtml index 9abe28405ee1c46e91004d9f43845f7fc467613e..5f94808debf34abe2d9927abbca0cf2407917241 100644 --- a/app/code/core/Mage/Page/view/frontend/html/head.phtml +++ b/app/code/core/Mage/Page/view/frontend/html/head.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Page/view/frontend/html/header.phtml b/app/code/core/Mage/Page/view/frontend/html/header.phtml index 59620fed12a80335eb9c0f29893be5eb0aea73f3..8ce9d6a7594b5407ed0fc5ea133036030e4187e7 100644 --- a/app/code/core/Mage/Page/view/frontend/html/header.phtml +++ b/app/code/core/Mage/Page/view/frontend/html/header.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /** diff --git a/app/code/core/Mage/Page/view/frontend/html/notices.phtml b/app/code/core/Mage/Page/view/frontend/html/notices.phtml index 975aec9c2e2e8f0d17e27ac6ca3caf35a1f13de3..e84cab4896396f725a8df441228b2a4833badb19 100644 --- a/app/code/core/Mage/Page/view/frontend/html/notices.phtml +++ b/app/code/core/Mage/Page/view/frontend/html/notices.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -33,7 +33,7 @@ <noscript> <div class="noscript"> <div class="noscript-inner"> - <p><strong><?php echo $this->__('JavaScript seem to be disabled in your browser.'); ?></strong></p> + <p><strong><?php echo $this->__('JavaScript seems to be disabled in your browser.'); ?></strong></p> <p><?php echo $this->__('You must have JavaScript enabled in your browser to utilize the functionality of this website.'); ?></p> </div> </div> diff --git a/app/code/core/Mage/Page/view/frontend/html/pager.phtml b/app/code/core/Mage/Page/view/frontend/html/pager.phtml index f131eed5fbbc9b9853635f9cd163a7cbef7ae70e..7d14bb5e0dfa9db3b238bff366b4691f220b6ad9 100644 --- a/app/code/core/Mage/Page/view/frontend/html/pager.phtml +++ b/app/code/core/Mage/Page/view/frontend/html/pager.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Page/view/frontend/js/calendar.phtml b/app/code/core/Mage/Page/view/frontend/js/calendar.phtml index 2af7ed839bd910f8c7b855a5340b3c0a393e4d4f..67dd2936d99c43981669d3ad67bcce49396b4b67 100644 --- a/app/code/core/Mage/Page/view/frontend/js/calendar.phtml +++ b/app/code/core/Mage/Page/view/frontend/js/calendar.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Page/view/frontend/js/cookie.phtml b/app/code/core/Mage/Page/view/frontend/js/cookie.phtml index e75d91f6e31c03c920a870c345f8b30839fd0e3c..afa950064845152956ad90802b6cb5f8aa0834e6 100644 --- a/app/code/core/Mage/Page/view/frontend/js/cookie.phtml +++ b/app/code/core/Mage/Page/view/frontend/js/cookie.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Page/view/frontend/js/cookies.js b/app/code/core/Mage/Page/view/frontend/js/cookies.js index 26a204701a4b0c68dd09ec90f56fd828215080bc..f9dbc7aff560087feb4b6c1474bf50020cc5c207 100644 --- a/app/code/core/Mage/Page/view/frontend/js/cookies.js +++ b/app/code/core/Mage/Page/view/frontend/js/cookies.js @@ -19,7 +19,7 @@ * * @category Mage * @package js - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ // old school cookie functions grabbed off the web diff --git a/app/code/core/Mage/Page/view/frontend/layout.xml b/app/code/core/Mage/Page/view/frontend/layout.xml index cffaf77b00724a8c2c9a8fcdcb36ee8c25c16aa6..caac86bd29791f0c7be88028047cafee99e72d96 100644 --- a/app/code/core/Mage/Page/view/frontend/layout.xml +++ b/app/code/core/Mage/Page/view/frontend/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Page/view/frontend/menu.js b/app/code/core/Mage/Page/view/frontend/menu.js index 331b0a944f772763c03975f3b897b2cb176fabec..4aa72cb2fac7f71272fb5225d0911349276b1933 100644 --- a/app/code/core/Mage/Page/view/frontend/menu.js +++ b/app/code/core/Mage/Page/view/frontend/menu.js @@ -19,7 +19,7 @@ * * @category Varien * @package js - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/Page/view/frontend/popup.phtml b/app/code/core/Mage/Page/view/frontend/popup.phtml index 51e2141bf2ec40e3e5600fe0175b5bdfe2c6f692..7fe7c89f284e5fa856345cf2c59d29d5a5a4dceb 100644 --- a/app/code/core/Mage/Page/view/frontend/popup.phtml +++ b/app/code/core/Mage/Page/view/frontend/popup.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Page/view/frontend/print.phtml b/app/code/core/Mage/Page/view/frontend/print.phtml index 65bf14a75e23c865158a55c3fe69faa26ba2619c..b14d04ab12e40240f4c5620e13880b6240ec8fc1 100644 --- a/app/code/core/Mage/Page/view/frontend/print.phtml +++ b/app/code/core/Mage/Page/view/frontend/print.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Page/view/frontend/redirect.phtml b/app/code/core/Mage/Page/view/frontend/redirect.phtml index fa65e416e70f9ad85f80f795acca5a28372bd38f..1abe5a9c5ff5b2e191daf474b98154cf36d429f4 100644 --- a/app/code/core/Mage/Page/view/frontend/redirect.phtml +++ b/app/code/core/Mage/Page/view/frontend/redirect.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Page/view/frontend/switch/flags.phtml b/app/code/core/Mage/Page/view/frontend/switch/flags.phtml index a9386a0a44c1f26157ecf2198242215cbd982455..512fd4d4badeaf19b4ce1c1e14120872b6a5df56 100644 --- a/app/code/core/Mage/Page/view/frontend/switch/flags.phtml +++ b/app/code/core/Mage/Page/view/frontend/switch/flags.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Page/view/frontend/switch/languages.phtml b/app/code/core/Mage/Page/view/frontend/switch/languages.phtml index 6feacc888a135c745801f3e1058c4db775e09a14..a20e8e6d8322654c27bff9b9386105752a97b4d2 100644 --- a/app/code/core/Mage/Page/view/frontend/switch/languages.phtml +++ b/app/code/core/Mage/Page/view/frontend/switch/languages.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Page/view/frontend/switch/stores.phtml b/app/code/core/Mage/Page/view/frontend/switch/stores.phtml index 32768dc744a3d42e08a537d34bf55ab93d60bf6b..12e9c6225d8139ae1e6c9f8249bc4c3497130957 100644 --- a/app/code/core/Mage/Page/view/frontend/switch/stores.phtml +++ b/app/code/core/Mage/Page/view/frontend/switch/stores.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Page/view/frontend/template/container.phtml b/app/code/core/Mage/Page/view/frontend/template/container.phtml index a86bdc57dda26382f5647041fa8bcc0cfe82b21c..1a18786899fb613c5770330c972c0fea07228376 100644 --- a/app/code/core/Mage/Page/view/frontend/template/container.phtml +++ b/app/code/core/Mage/Page/view/frontend/template/container.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Page/view/frontend/template/links.phtml b/app/code/core/Mage/Page/view/frontend/template/links.phtml index 2799d77f676d11fe5107b065c823457621f88f27..78c141726ba0552e017dbf00b7530ea83c6b0922 100644 --- a/app/code/core/Mage/Page/view/frontend/template/links.phtml +++ b/app/code/core/Mage/Page/view/frontend/template/links.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Page/view/frontend/template/linksblock.phtml b/app/code/core/Mage/Page/view/frontend/template/linksblock.phtml index 825a3697ec0f295da457d3d6556c47f5282bcb9b..e80b8195e150495d8ccee195fb0794778c082acd 100644 --- a/app/code/core/Mage/Page/view/frontend/template/linksblock.phtml +++ b/app/code/core/Mage/Page/view/frontend/template/linksblock.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/PageCache/Block/Adminhtml/Cache/Additional.php b/app/code/core/Mage/PageCache/Block/Adminhtml/Cache/Additional.php index 4fa43694df46659fa55d1aac70e718becfdb4a16..ebc877857b16fcbf296694242e584d0f41a300cd 100644 --- a/app/code/core/Mage/PageCache/Block/Adminhtml/Cache/Additional.php +++ b/app/code/core/Mage/PageCache/Block/Adminhtml/Cache/Additional.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_PageCache - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/PageCache/Helper/Data.php b/app/code/core/Mage/PageCache/Helper/Data.php index 9f1581d571e145c9205e75c9836b81444f0fb40c..218a44b575bc2712ea7a11eb4dcf96a2c5994d02 100644 --- a/app/code/core/Mage/PageCache/Helper/Data.php +++ b/app/code/core/Mage/PageCache/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_PageCache - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/PageCache/Model/Control/Interface.php b/app/code/core/Mage/PageCache/Model/Control/Interface.php index e3dc6c4d6881cc86b2274920378197db599ab6c7..c540b494e02be6c929ea6c0fcd5b3fd7744a421b 100644 --- a/app/code/core/Mage/PageCache/Model/Control/Interface.php +++ b/app/code/core/Mage/PageCache/Model/Control/Interface.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_PageCache - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/PageCache/Model/Control/Zend.php b/app/code/core/Mage/PageCache/Model/Control/Zend.php index 9df13fbd5bdf5d5b2db245d692cb87c5cb12495c..6825dd5e4a6650e347d537987b91cb9366102e1a 100644 --- a/app/code/core/Mage/PageCache/Model/Control/Zend.php +++ b/app/code/core/Mage/PageCache/Model/Control/Zend.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_PageCache - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/PageCache/Model/Observer.php b/app/code/core/Mage/PageCache/Model/Observer.php index 49c6cf3890a000706aa3b3d15d76e8802ab797be..22e40c545374891f898478fe1621ab555da69ecd 100644 --- a/app/code/core/Mage/PageCache/Model/Observer.php +++ b/app/code/core/Mage/PageCache/Model/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_PageCache - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/PageCache/Model/System/Config/Source/Controls.php b/app/code/core/Mage/PageCache/Model/System/Config/Source/Controls.php index 219c183b3f6ff486e2468aab73a23a580e83a0c3..3de03f087cc5cacb4b0aedd4b3dd926324e80fdd 100644 --- a/app/code/core/Mage/PageCache/Model/System/Config/Source/Controls.php +++ b/app/code/core/Mage/PageCache/Model/System/Config/Source/Controls.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_PageCache - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/PageCache/controllers/Adminhtml/PageCacheController.php b/app/code/core/Mage/PageCache/controllers/Adminhtml/PageCacheController.php index 93f5c9a9161e9dc5e9f83987ebbf57294010c0ae..09bf254c85aa8e916071d6082531f833430924cf 100644 --- a/app/code/core/Mage/PageCache/controllers/Adminhtml/PageCacheController.php +++ b/app/code/core/Mage/PageCache/controllers/Adminhtml/PageCacheController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_PageCache - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/PageCache/etc/adminhtml.xml b/app/code/core/Mage/PageCache/etc/adminhtml.xml index cbc2b595010dc769e330714258fe7320889e0724..66ff55a2eacbfa735a9cef46e6cead34a24a2eec 100644 --- a/app/code/core/Mage/PageCache/etc/adminhtml.xml +++ b/app/code/core/Mage/PageCache/etc/adminhtml.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_PageCache - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/PageCache/etc/config.xml b/app/code/core/Mage/PageCache/etc/config.xml index 86722040887bf87a6f8e66aa42026d2480c49f5f..5ae7aee961ef11fdc4de7b86038b1fd22086b746 100644 --- a/app/code/core/Mage/PageCache/etc/config.xml +++ b/app/code/core/Mage/PageCache/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_PageCache - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/PageCache/etc/system.xml b/app/code/core/Mage/PageCache/etc/system.xml index 46cbe3eca88acc4a3c38bcaca500559239a0e5b1..d1fe46e68a86e24b9d5fcb03814cc3843d92b564 100644 --- a/app/code/core/Mage/PageCache/etc/system.xml +++ b/app/code/core/Mage/PageCache/etc/system.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_PageCache - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/PageCache/view/adminhtml/cache/additional.phtml b/app/code/core/Mage/PageCache/view/adminhtml/cache/additional.phtml index ad43b4086fb0728b538fb85d1a9d68349aefbf76..fcbf4f76cc72c55f74360c7f6c5a55ee8b54df99 100644 --- a/app/code/core/Mage/PageCache/view/adminhtml/cache/additional.phtml +++ b/app/code/core/Mage/PageCache/view/adminhtml/cache/additional.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/PageCache/view/adminhtml/layout.xml b/app/code/core/Mage/PageCache/view/adminhtml/layout.xml index 26f969ec432ce9f4f6a644f8bce65f8365e349ad..d8d3f399b5e0962c6980ed9179e2e68c2185e19f 100644 --- a/app/code/core/Mage/PageCache/view/adminhtml/layout.xml +++ b/app/code/core/Mage/PageCache/view/adminhtml/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/PageCache/view/frontend/cookie.phtml b/app/code/core/Mage/PageCache/view/frontend/cookie.phtml index 12b31b7d8628b95e4878c9f60ea723b8aaf3b61d..bcc8dd747d7dfd1bd7e664f3634936b8a7f699b3 100644 --- a/app/code/core/Mage/PageCache/view/frontend/cookie.phtml +++ b/app/code/core/Mage/PageCache/view/frontend/cookie.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/PageCache/view/frontend/layout.xml b/app/code/core/Mage/PageCache/view/frontend/layout.xml index 9c4a95fa8a5bf41173fde4b3ebd6f74987b0d22d..5bb019f729a5a6192fba0f36e99dc11f65d630fe 100644 --- a/app/code/core/Mage/PageCache/view/frontend/layout.xml +++ b/app/code/core/Mage/PageCache/view/frontend/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/Paygate/Block/Authorizenet/Form/Cc.php b/app/code/core/Mage/Paygate/Block/Authorizenet/Form/Cc.php index 5f232451f67190a36d633277aa9d3c19ecb03e5d..611dfffce3b95214575f1066f29ea17f53032d90 100644 --- a/app/code/core/Mage/Paygate/Block/Authorizenet/Form/Cc.php +++ b/app/code/core/Mage/Paygate/Block/Authorizenet/Form/Cc.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paygate - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paygate/Block/Authorizenet/Info/Cc.php b/app/code/core/Mage/Paygate/Block/Authorizenet/Info/Cc.php index afa8e26ace9c89d063c3fa09d7c663b67b16166b..757532ca779cfe3872b4210a7332a2e1a7c23b26 100644 --- a/app/code/core/Mage/Paygate/Block/Authorizenet/Info/Cc.php +++ b/app/code/core/Mage/Paygate/Block/Authorizenet/Info/Cc.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paygate - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paygate/Helper/Data.php b/app/code/core/Mage/Paygate/Helper/Data.php index 19bab1007ce017c2028bfe2dbcde4961bdfe2a4c..7b6111d05373b8ef7108316a7649abadb22a1264 100644 --- a/app/code/core/Mage/Paygate/Helper/Data.php +++ b/app/code/core/Mage/Paygate/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paygate - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -51,9 +51,9 @@ class Mage_Paygate_Helper_Data extends Mage_Core_Helper_Abstract * @param string $exception * @return bool|string */ - public function getTransactionMessage( - $payment, $requestType, $lastTransactionId, $card, $amount = false, $exception = false) - { + public function getTransactionMessage($payment, $requestType, $lastTransactionId, $card, $amount = false, + $exception = false + ) { return $this->getExtendedTransactionMessage( $payment, $requestType, $lastTransactionId, $card, $amount, $exception ); @@ -72,8 +72,8 @@ class Mage_Paygate_Helper_Data extends Mage_Core_Helper_Abstract * @return bool|string */ public function getExtendedTransactionMessage($payment, $requestType, $lastTransactionId, $card, $amount = false, - $exception = false, $additionalMessage = false) - { + $exception = false, $additionalMessage = false + ) { $operation = $this->_getOperation($requestType); if (!$operation) { diff --git a/app/code/core/Mage/Paygate/Model/Authorizenet.php b/app/code/core/Mage/Paygate/Model/Authorizenet.php index 38bd8eb4b74a06f7c657521de971c6b8f9fdd133..7a880e4467fc9317f365b319af3f6c80e5ebb209 100644 --- a/app/code/core/Mage/Paygate/Model/Authorizenet.php +++ b/app/code/core/Mage/Paygate/Model/Authorizenet.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paygate - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -831,8 +831,9 @@ class Mage_Paygate_Model_Authorizenet extends Mage_Payment_Model_Method_Cc break; case self::RESPONSE_CODE_DECLINED: case self::RESPONSE_CODE_ERROR: - if ($result->getResponseReasonCode() == self::RESPONSE_REASON_CODE_NOT_FOUND && - $this->_isTransactionExpired($realAuthTransactionId)) { + if ($result->getResponseReasonCode() == self::RESPONSE_REASON_CODE_NOT_FOUND + && $this->_isTransactionExpired($realAuthTransactionId) + ) { $voidTransactionId = $realAuthTransactionId . '-void'; return $this->_addTransaction( $payment, diff --git a/app/code/core/Mage/Paygate/Model/Authorizenet/Cards.php b/app/code/core/Mage/Paygate/Model/Authorizenet/Cards.php index 5ef38690507bf3a540e9e3d9c15ad4066283c0e4..2c8013407424a39582680d35916bc12f60cfb4a3 100644 --- a/app/code/core/Mage/Paygate/Model/Authorizenet/Cards.php +++ b/app/code/core/Mage/Paygate/Model/Authorizenet/Cards.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paygate - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paygate/Model/Authorizenet/Debug.php b/app/code/core/Mage/Paygate/Model/Authorizenet/Debug.php index 7683f89fa39f0ca0a0f8faea89c00bda73812a1c..13211b8260684a1b6b894b4969316f7e08ad26fb 100644 --- a/app/code/core/Mage/Paygate/Model/Authorizenet/Debug.php +++ b/app/code/core/Mage/Paygate/Model/Authorizenet/Debug.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paygate - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paygate/Model/Authorizenet/Request.php b/app/code/core/Mage/Paygate/Model/Authorizenet/Request.php index a787417a655fb606c22c8ba4880faa820763c67a..511f349f9c3d92cde74b331dd4ad00cf9a5b48f1 100644 --- a/app/code/core/Mage/Paygate/Model/Authorizenet/Request.php +++ b/app/code/core/Mage/Paygate/Model/Authorizenet/Request.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paygate - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paygate/Model/Authorizenet/Result.php b/app/code/core/Mage/Paygate/Model/Authorizenet/Result.php index 56760c94f217107a46ff69d33be8408d6f53f425..db0f641cd79b1ce2183a5f3062778818330db2b7 100644 --- a/app/code/core/Mage/Paygate/Model/Authorizenet/Result.php +++ b/app/code/core/Mage/Paygate/Model/Authorizenet/Result.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paygate - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paygate/Model/Authorizenet/Source/Cctype.php b/app/code/core/Mage/Paygate/Model/Authorizenet/Source/Cctype.php index aeeabc688e7e037d53ec889840a7adc5d41d17ee..8595c9ac49ccf9b626e856eb165d5fa4a466600e 100644 --- a/app/code/core/Mage/Paygate/Model/Authorizenet/Source/Cctype.php +++ b/app/code/core/Mage/Paygate/Model/Authorizenet/Source/Cctype.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paygate - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paygate/Model/Authorizenet/Source/PaymentAction.php b/app/code/core/Mage/Paygate/Model/Authorizenet/Source/PaymentAction.php index 121687e566918b6831d0f998712f899376e3af21..12db82b150f10745e357b107a9149c195e4ddbc2 100644 --- a/app/code/core/Mage/Paygate/Model/Authorizenet/Source/PaymentAction.php +++ b/app/code/core/Mage/Paygate/Model/Authorizenet/Source/PaymentAction.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paygate - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paygate/Model/Resource/Authorizenet/Debug.php b/app/code/core/Mage/Paygate/Model/Resource/Authorizenet/Debug.php index e51550cb288811f5817c88f33ef791934d6268e6..a15c971905c63d7f78f0e54fed984d48d55f2607 100755 --- a/app/code/core/Mage/Paygate/Model/Resource/Authorizenet/Debug.php +++ b/app/code/core/Mage/Paygate/Model/Resource/Authorizenet/Debug.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paygate - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paygate/Model/Resource/Authorizenet/Debug/Collection.php b/app/code/core/Mage/Paygate/Model/Resource/Authorizenet/Debug/Collection.php index c0a77c0152bb0ebcca7928a9704bb5da53aa14a9..1b9a90d25950b7f63caecce1f00b524ca0d7393f 100755 --- a/app/code/core/Mage/Paygate/Model/Resource/Authorizenet/Debug/Collection.php +++ b/app/code/core/Mage/Paygate/Model/Resource/Authorizenet/Debug/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paygate - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paygate/controllers/Adminhtml/Paygate/Authorizenet/PaymentController.php b/app/code/core/Mage/Paygate/controllers/Adminhtml/Paygate/Authorizenet/PaymentController.php index 91f37cc60da5a13cee372d5bbc1cec445601b875..696d5cfb3a655ed0e207a12fcaa96769dbe01335 100644 --- a/app/code/core/Mage/Paygate/controllers/Adminhtml/Paygate/Authorizenet/PaymentController.php +++ b/app/code/core/Mage/Paygate/controllers/Adminhtml/Paygate/Authorizenet/PaymentController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paygate - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paygate/controllers/Authorizenet/PaymentController.php b/app/code/core/Mage/Paygate/controllers/Authorizenet/PaymentController.php index 61b2e2814f43d9af70d232e7640e1244747248c9..a033d5c7f416a10f48fa8525f7643577948dc243 100644 --- a/app/code/core/Mage/Paygate/controllers/Authorizenet/PaymentController.php +++ b/app/code/core/Mage/Paygate/controllers/Authorizenet/PaymentController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paygate - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paygate/etc/config.xml b/app/code/core/Mage/Paygate/etc/config.xml index 6e4c79a5de6784f6d4245412461e9b46a252c8b0..61e126202636a3278af70527c0f402cd1080c1bb 100644 --- a/app/code/core/Mage/Paygate/etc/config.xml +++ b/app/code/core/Mage/Paygate/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Paygate - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Paygate/etc/system.xml b/app/code/core/Mage/Paygate/etc/system.xml index 8cf3449f82d81a2eef159c9163976cb50b3a4324..7facb044f7fa242051b137726186ab723f1def78 100644 --- a/app/code/core/Mage/Paygate/etc/system.xml +++ b/app/code/core/Mage/Paygate/etc/system.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Paygate - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Paygate/sql/paygate_setup/install-1.6.0.0.php b/app/code/core/Mage/Paygate/sql/paygate_setup/install-1.6.0.0.php index 6fe485336911acb95472f975c00726e2896a2557..c8bb5e7e5825f1a29fca324f28e33e63458ea0ef 100644 --- a/app/code/core/Mage/Paygate/sql/paygate_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/Paygate/sql/paygate_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paygate - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paygate/view/adminhtml/form/cc.phtml b/app/code/core/Mage/Paygate/view/adminhtml/form/cc.phtml index 10be8c1838c80b54bc67e90e5e7a2902a1f1ea75..c146b5577cd3e34a1fbc8847457a47a1f8851636 100644 --- a/app/code/core/Mage/Paygate/view/adminhtml/form/cc.phtml +++ b/app/code/core/Mage/Paygate/view/adminhtml/form/cc.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Paygate/view/adminhtml/info/cc.phtml b/app/code/core/Mage/Paygate/view/adminhtml/info/cc.phtml index eb703c20aa9cb2958705036c17204c846e708dbd..099c8e843fb9e63a03aae6a00a3df85e89df4804 100644 --- a/app/code/core/Mage/Paygate/view/adminhtml/info/cc.phtml +++ b/app/code/core/Mage/Paygate/view/adminhtml/info/cc.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Paygate/view/adminhtml/info/pdf.phtml b/app/code/core/Mage/Paygate/view/adminhtml/info/pdf.phtml index 6efe244ce94bd07bdf23721f13f3675631a5c36e..65e631d8687fe8abb4889b303d78401dd3dd1de7 100644 --- a/app/code/core/Mage/Paygate/view/adminhtml/info/pdf.phtml +++ b/app/code/core/Mage/Paygate/view/adminhtml/info/pdf.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Paygate/view/frontend/form/cc.phtml b/app/code/core/Mage/Paygate/view/frontend/form/cc.phtml index cd980f857a5844fdc91d065bfa86ba6f12b47acc..3cbe429207826280473fa2a4ccc2035715601147 100644 --- a/app/code/core/Mage/Paygate/view/frontend/form/cc.phtml +++ b/app/code/core/Mage/Paygate/view/frontend/form/cc.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Paygate/view/frontend/info/cc.phtml b/app/code/core/Mage/Paygate/view/frontend/info/cc.phtml index 4d3023623705e283854298246714319deadefeec..27a956caa18e425f8b5832dbbd4c1f02d690e09f 100644 --- a/app/code/core/Mage/Paygate/view/frontend/info/cc.phtml +++ b/app/code/core/Mage/Paygate/view/frontend/info/cc.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Payment/Block/Catalog/Product/View/Profile.php b/app/code/core/Mage/Payment/Block/Catalog/Product/View/Profile.php index eac525091fa59d0a7dba5cd57711f0505f6c3ed2..81f0cc196d2e25a704fe44f864967e4e9db5e89e 100644 --- a/app/code/core/Mage/Payment/Block/Catalog/Product/View/Profile.php +++ b/app/code/core/Mage/Payment/Block/Catalog/Product/View/Profile.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Payment - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Payment/Block/Form.php b/app/code/core/Mage/Payment/Block/Form.php index 92ad4b08dc4337a48fcbe5f6bedf444faf31b968..f7f98c0e18046aab0a69a6a25e4049c076a6e8b1 100644 --- a/app/code/core/Mage/Payment/Block/Form.php +++ b/app/code/core/Mage/Payment/Block/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Payment - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Payment/Block/Form/Cc.php b/app/code/core/Mage/Payment/Block/Form/Cc.php index 51467821bf8e3138199958366bc4cb02865a216a..c96935172549df3128993b3b2d8930203fd2d65f 100644 --- a/app/code/core/Mage/Payment/Block/Form/Cc.php +++ b/app/code/core/Mage/Payment/Block/Form/Cc.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Payment - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Payment/Block/Form/Ccsave.php b/app/code/core/Mage/Payment/Block/Form/Ccsave.php index 27480612ac63c332c15675b93cc643820fad3be5..feecb322499609ec87322e2ac8bfbebbdbe9a22a 100644 --- a/app/code/core/Mage/Payment/Block/Form/Ccsave.php +++ b/app/code/core/Mage/Payment/Block/Form/Ccsave.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Payment - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Payment/Block/Form/Checkmo.php b/app/code/core/Mage/Payment/Block/Form/Checkmo.php index ea7db7d96f1a43216123fcdbe6cc1eae1efe7a1a..a6ed9932b515536456f0d00963c58094379a322a 100644 --- a/app/code/core/Mage/Payment/Block/Form/Checkmo.php +++ b/app/code/core/Mage/Payment/Block/Form/Checkmo.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Payment - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Payment/Block/Form/Container.php b/app/code/core/Mage/Payment/Block/Form/Container.php index 1d8c56a0c30087a42b6bcc17963f578762e9692b..c23bf915b89d3610140298896679e83a5b1cc1c1 100644 --- a/app/code/core/Mage/Payment/Block/Form/Container.php +++ b/app/code/core/Mage/Payment/Block/Form/Container.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Payment - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Payment/Block/Form/Purchaseorder.php b/app/code/core/Mage/Payment/Block/Form/Purchaseorder.php index 8cffc52f5be370481befeb535e070405f099b477..42515370bb2cc9cf5e19bb699a3edcd1811254a1 100644 --- a/app/code/core/Mage/Payment/Block/Form/Purchaseorder.php +++ b/app/code/core/Mage/Payment/Block/Form/Purchaseorder.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Payment - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Payment/Block/Info.php b/app/code/core/Mage/Payment/Block/Info.php index af2905c69dd81f800425a6638b080ecbd3b34d33..0e2798dd291ce574c17b0fcae40107a3a2c95233 100644 --- a/app/code/core/Mage/Payment/Block/Info.php +++ b/app/code/core/Mage/Payment/Block/Info.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Payment - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Payment/Block/Info/Cc.php b/app/code/core/Mage/Payment/Block/Info/Cc.php index b8397dd9818a6cb65d5c5f8c0ce3904ea1c898cf..55c7da0fb610fd64bf4d3e4c13fde760af9b8593 100644 --- a/app/code/core/Mage/Payment/Block/Info/Cc.php +++ b/app/code/core/Mage/Payment/Block/Info/Cc.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Payment - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Payment/Block/Info/Ccsave.php b/app/code/core/Mage/Payment/Block/Info/Ccsave.php index 860586fd8b38fd77b7d931196528d62dfcdb3693..afdf070d483e0365442337ed298e5546e815a8a6 100644 --- a/app/code/core/Mage/Payment/Block/Info/Ccsave.php +++ b/app/code/core/Mage/Payment/Block/Info/Ccsave.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Payment - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Payment/Block/Info/Checkmo.php b/app/code/core/Mage/Payment/Block/Info/Checkmo.php index fe03a1b70b9d8652a51efaf11f3dc9d55924be9c..dc6d4d152dc5376b2c4b2fffde78b5d0b76dbc7b 100644 --- a/app/code/core/Mage/Payment/Block/Info/Checkmo.php +++ b/app/code/core/Mage/Payment/Block/Info/Checkmo.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Payment - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Payment/Block/Info/Container.php b/app/code/core/Mage/Payment/Block/Info/Container.php index 22cbd065f5d6fb446828af7f512a634eba23abbe..fecebf76a7f0a0fbdec6140d4c059fd286e1bede 100644 --- a/app/code/core/Mage/Payment/Block/Info/Container.php +++ b/app/code/core/Mage/Payment/Block/Info/Container.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Payment - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Payment/Block/Info/Purchaseorder.php b/app/code/core/Mage/Payment/Block/Info/Purchaseorder.php index 994eda155eeee4ab3ad29f2b7fbde0fd45b074e3..5939258439fca32b7b9cade4401fecbb036fe87d 100644 --- a/app/code/core/Mage/Payment/Block/Info/Purchaseorder.php +++ b/app/code/core/Mage/Payment/Block/Info/Purchaseorder.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Payment - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Payment/Exception.php b/app/code/core/Mage/Payment/Exception.php index af6dfc129b3470e1590dc762ea0cef9748bbe2ce..cc2b017fef77bc48a3125ff0af2e6686ae6c5a5a 100644 --- a/app/code/core/Mage/Payment/Exception.php +++ b/app/code/core/Mage/Payment/Exception.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Payment - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Payment/Helper/Data.php b/app/code/core/Mage/Payment/Helper/Data.php index 0c54dcc9b913db506706356021bbc7cf90892abb..b2e6a3a97b036c85f683f7e972cb6bc09cf94693 100644 --- a/app/code/core/Mage/Payment/Helper/Data.php +++ b/app/code/core/Mage/Payment/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Payment - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Payment/Model/Billing/Agreement/MethodInterface.php b/app/code/core/Mage/Payment/Model/Billing/Agreement/MethodInterface.php index 9d02c9b7bfd9f2bdbed77b37fc45bfa081eb520d..fc49d1b44ed5a6d6bcc92078861f38b9674236ba 100644 --- a/app/code/core/Mage/Payment/Model/Billing/Agreement/MethodInterface.php +++ b/app/code/core/Mage/Payment/Model/Billing/Agreement/MethodInterface.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Payment - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Payment/Model/Billing/AgreementAbstract.php b/app/code/core/Mage/Payment/Model/Billing/AgreementAbstract.php index 0ac8af3e6acf43e0085ac5bcc074cf4c127220a0..6c1e4dd2ef4c77d8d4c85cca43066bd8d0e6759c 100644 --- a/app/code/core/Mage/Payment/Model/Billing/AgreementAbstract.php +++ b/app/code/core/Mage/Payment/Model/Billing/AgreementAbstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Payment - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Payment/Model/Config.php b/app/code/core/Mage/Payment/Model/Config.php index 960fcbe5b503989b8f07c630020c1742c804ca28..73bceb0f344e7b29d6c6981cae9c8f1eada43c9f 100644 --- a/app/code/core/Mage/Payment/Model/Config.php +++ b/app/code/core/Mage/Payment/Model/Config.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Payment - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Payment/Model/Info.php b/app/code/core/Mage/Payment/Model/Info.php index 1a855487927f12f96eec7ae557b44b3f21a92f69..2ea4a0e8fc6f9d390ce90340dc548679f95f907a 100644 --- a/app/code/core/Mage/Payment/Model/Info.php +++ b/app/code/core/Mage/Payment/Model/Info.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Payment - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Payment/Model/Info/Exception.php b/app/code/core/Mage/Payment/Model/Info/Exception.php index 1f1888328ba4829ad9c517f48eb5c218af2b6636..6293c7eafd3841f317992ecd87f0de197ea6293f 100644 --- a/app/code/core/Mage/Payment/Model/Info/Exception.php +++ b/app/code/core/Mage/Payment/Model/Info/Exception.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Payment - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Payment/Model/Method/Abstract.php b/app/code/core/Mage/Payment/Model/Method/Abstract.php index f05c673e147a5e1115c85bf0f49647ccb080963a..e99303ba86be601aa1e737d56d314c8ce63cc166 100644 --- a/app/code/core/Mage/Payment/Model/Method/Abstract.php +++ b/app/code/core/Mage/Payment/Model/Method/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Payment - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -297,7 +297,8 @@ abstract class Mage_Payment_Model_Method_Abstract extends Varien_Object */ public function canManageRecurringProfiles() { - return $this->_canManageRecurringProfiles && ($this instanceof Mage_Payment_Model_Recurring_Profile_MethodInterface); + return $this->_canManageRecurringProfiles + && ($this instanceof Mage_Payment_Model_Recurring_Profile_MethodInterface); } /** @@ -318,7 +319,7 @@ abstract class Mage_Payment_Model_Method_Abstract extends Varien_Object public function getCode() { if (empty($this->_code)) { - Mage::throwException($this->_getHelper()->__('Cannot retrieve the payment method code.')); + Mage::throwException(Mage::helper('Mage_Payment_Helper_Data')->__('Cannot retrieve the payment method code.')); } return $this->_code; } @@ -352,7 +353,7 @@ abstract class Mage_Payment_Model_Method_Abstract extends Varien_Object { $instance = $this->getData('info_instance'); if (!($instance instanceof Mage_Payment_Model_Info)) { - Mage::throwException($this->_getHelper()->__('Cannot retrieve the payment information object instance.')); + Mage::throwException(Mage::helper('Mage_Payment_Helper_Data')->__('Cannot retrieve the payment information object instance.')); } return $instance; } @@ -360,13 +361,12 @@ abstract class Mage_Payment_Model_Method_Abstract extends Varien_Object /** * Validate payment method information object * - * @param Varien_Object $info - * @return Mage_Payment_Model_Abstract + * @return Mage_Payment_Model_Abstract */ public function validate() { /** - * to validate paymene method is allowed for billing country or not + * to validate payment method is allowed for billing country or not */ $paymentInfo = $this->getInfoInstance(); if ($paymentInfo instanceof Mage_Sales_Model_Order_Payment) { @@ -375,51 +375,55 @@ abstract class Mage_Payment_Model_Method_Abstract extends Varien_Object $billingCountry = $paymentInfo->getQuote()->getBillingAddress()->getCountryId(); } if (!$this->canUseForCountry($billingCountry)) { - Mage::throwException($this->_getHelper()->__('Selected payment type is not allowed for billing country.')); + Mage::throwException(Mage::helper('Mage_Payment_Helper_Data')->__('Selected payment type is not allowed for billing country.')); } return $this; } /** - * Order + * Order payment abstract method + * + * @param Varien_Object $payment + * @param float $amount * - * @param Varien_Object $orderPayment - * @return Mage_Payment_Model_Abstract + * @return Mage_Payment_Model_Abstract */ public function order(Varien_Object $payment, $amount) { if (!$this->canOrder()) { - Mage::throwException($this->_getHelper()->__('Order action is not available.')); + Mage::throwException(Mage::helper('Mage_Payment_Helper_Data')->__('Order action is not available.')); } return $this; } /** - * Authorize + * Authorize payment abstract method * - * @param Varien_Object $orderPayment + * @param Varien_Object $payment * @param float $amount - * @return Mage_Payment_Model_Abstract + * + * @return Mage_Payment_Model_Abstract */ public function authorize(Varien_Object $payment, $amount) { if (!$this->canAuthorize()) { - Mage::throwException($this->_getHelper()->__('Authorize action is not available.')); + Mage::throwException(Mage::helper('Mage_Payment_Helper_Data')->__('Authorize action is not available.')); } return $this; } /** - * Capture payment + * Capture payment abstract method * - * @param Varien_Object $orderPayment + * @param Varien_Object $payment * @param float $amount - * @return Mage_Payment_Model_Abstract + * + * @return Mage_Payment_Model_Abstract */ public function capture(Varien_Object $payment, $amount) { if (!$this->canCapture()) { - Mage::throwException($this->_getHelper()->__('Capture action is not available.')); + Mage::throwException(Mage::helper('Mage_Payment_Helper_Data')->__('Capture action is not available.')); } return $this; @@ -456,16 +460,17 @@ abstract class Mage_Payment_Model_Method_Abstract extends Varien_Object } /** - * Refund money + * Refund specified amount for payment * - * @param Varien_Object $invoicePayment + * @param Varien_Object $payment * @param float $amount - * @return Mage_Payment_Model_Abstract + * + * @return Mage_Payment_Model_Abstract */ public function refund(Varien_Object $payment, $amount) { if (!$this->canRefund()) { - Mage::throwException($this->_getHelper()->__('Refund action is not available.')); + Mage::throwException(Mage::helper('Mage_Payment_Helper_Data')->__('Refund action is not available.')); } return $this; } @@ -483,10 +488,11 @@ abstract class Mage_Payment_Model_Method_Abstract extends Varien_Object } /** - * Cancel payment (GoogleCheckout) + * Cancel payment abstract method + * + * @param Varien_Object $payment * - * @param Varien_Object $invoicePayment - * @return Mage_Payment_Model_Abstract + * @return Mage_Payment_Model_Abstract */ public function cancel(Varien_Object $payment) { @@ -494,15 +500,16 @@ abstract class Mage_Payment_Model_Method_Abstract extends Varien_Object } /** - * Void payment + * Void payment abstract method + * + * @param Varien_Object $payment * - * @param Varien_Object $invoicePayment - * @return Mage_Payment_Model_Abstract + * @return Mage_Payment_Model_Abstract */ public function void(Varien_Object $payment) { if (!$this->canVoid($payment)) { - Mage::throwException($this->_getHelper()->__('Void action is not available.')); + Mage::throwException(Mage::helper('Mage_Payment_Helper_Data')->__('Void action is not available.')); } return $this; } @@ -511,7 +518,7 @@ abstract class Mage_Payment_Model_Method_Abstract extends Varien_Object * Whether this method can accept or deny payment * * @param Mage_Payment_Model_Info $payment - * @param bool $soft + * * @return bool */ public function canReviewPayment(Mage_Payment_Model_Info $payment) @@ -562,8 +569,10 @@ abstract class Mage_Payment_Model_Method_Abstract extends Varien_Object /** * Retrieve information from payment configuration * - * @param string $field - * @return mixed + * @param string $field + * @param int|string|null|Mage_Core_Model_Store $storeId + * + * @return mixed */ public function getConfigData($field, $storeId = null) { @@ -603,8 +612,11 @@ abstract class Mage_Payment_Model_Method_Abstract extends Varien_Object /** * Check whether payment method can be used + * * TODO: payment method instance is not supposed to know about quote - * @param Mage_Sales_Model_Quote + * + * @param Mage_Sales_Model_Quote $quote + * * @return bool */ public function isAvailable($quote = null) @@ -630,10 +642,12 @@ abstract class Mage_Payment_Model_Method_Abstract extends Varien_Object /** * Method that will be executed instead of authorize or capture - * if flag isInitilizeNeeded set to true + * if flag isInitializeNeeded set to true * - * @param string $paymentAction - * @return Mage_Payment_Model_Abstract + * @param string $paymentAction + * @param object $stateObject + * + * @return Mage_Payment_Model_Abstract */ public function initialize($paymentAction, $stateObject) { @@ -641,7 +655,7 @@ abstract class Mage_Payment_Model_Method_Abstract extends Varien_Object } /** - * Get config peyment action url + * Get config payment action url * Used to universalize payment actions when processing payment place * * @return string diff --git a/app/code/core/Mage/Payment/Model/Method/Cc.php b/app/code/core/Mage/Payment/Model/Method/Cc.php index 86ef1c3fe94439c128bcb92512948f46d7a3f94b..e7f68a3fadf24e9570e2827a48ca013175f5160f 100644 --- a/app/code/core/Mage/Payment/Model/Method/Cc.php +++ b/app/code/core/Mage/Payment/Model/Method/Cc.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Payment - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -107,14 +107,29 @@ class Mage_Payment_Model_Method_Cc extends Mage_Payment_Model_Method_Abstract $ccType = 'OT'; $ccTypeRegExpList = array( //Solo, Switch or Maestro. International safe - //'SS' => '/^((6759[0-9]{12})|(6334|6767[0-9]{12})|(6334|6767[0-9]{14,15})|(5018|5020|5038|6304|6759|6761|6763[0-9]{12,19})|(49[013][1356][0-9]{12})|(633[34][0-9]{12})|(633110[0-9]{10})|(564182[0-9]{10}))([0-9]{2,3})?$/', // Maestro / Solo - 'SO' => '/(^(6334)[5-9](\d{11}$|\d{13,14}$))|(^(6767)(\d{12}$|\d{14,15}$))/', // Solo only - 'SM' => '/(^(5[0678])\d{11,18}$)|(^(6[^05])\d{11,18}$)|(^(601)[^1]\d{9,16}$)|(^(6011)\d{9,11}$)|(^(6011)\d{13,16}$)|(^(65)\d{11,13}$)|(^(65)\d{15,18}$)|(^(49030)[2-9](\d{10}$|\d{12,13}$))|(^(49033)[5-9](\d{10}$|\d{12,13}$))|(^(49110)[1-2](\d{10}$|\d{12,13}$))|(^(49117)[4-9](\d{10}$|\d{12,13}$))|(^(49118)[0-2](\d{10}$|\d{12,13}$))|(^(4936)(\d{12}$|\d{14,15}$))/', - 'VI' => '/^4[0-9]{12}([0-9]{3})?$/', // Visa - 'MC' => '/^5[1-5][0-9]{14}$/', // Master Card - 'AE' => '/^3[47][0-9]{13}$/', // American Express - 'DI' => '/^6011[0-9]{12}$/', // Discovery - 'JCB' => '/^(3[0-9]{15}|(2131|1800)[0-9]{11})$/', // JCB + /* + // Maestro / Solo + 'SS' => '/^((6759[0-9]{12})|(6334|6767[0-9]{12})|(6334|6767[0-9]{14,15})' + . '|(5018|5020|5038|6304|6759|6761|6763[0-9]{12,19})|(49[013][1356][0-9]{12})' + . '|(633[34][0-9]{12})|(633110[0-9]{10})|(564182[0-9]{10}))([0-9]{2,3})?$/', + */ + // Solo only + 'SO' => '/(^(6334)[5-9](\d{11}$|\d{13,14}$))|(^(6767)(\d{12}$|\d{14,15}$))/', + 'SM' => '/(^(5[0678])\d{11,18}$)|(^(6[^05])\d{11,18}$)|(^(601)[^1]\d{9,16}$)|(^(6011)\d{9,11}$)' + . '|(^(6011)\d{13,16}$)|(^(65)\d{11,13}$)|(^(65)\d{15,18}$)' + . '|(^(49030)[2-9](\d{10}$|\d{12,13}$))|(^(49033)[5-9](\d{10}$|\d{12,13}$))' + . '|(^(49110)[1-2](\d{10}$|\d{12,13}$))|(^(49117)[4-9](\d{10}$|\d{12,13}$))' + . '|(^(49118)[0-2](\d{10}$|\d{12,13}$))|(^(4936)(\d{12}$|\d{14,15}$))/', + // Visa + 'VI' => '/^4[0-9]{12}([0-9]{3})?$/', + // Master Card + 'MC' => '/^5[1-5][0-9]{14}$/', + // American Express + 'AE' => '/^3[47][0-9]{13}$/', + // Discovery + 'DI' => '/^6011[0-9]{12}$/', + // JCB + 'JCB' => '/^(3[0-9]{15}|(2131|1800)[0-9]{11})$/' ); foreach ($ccTypeRegExpList as $ccTypeMatch=>$ccTypeRegExp) { @@ -125,19 +140,16 @@ class Mage_Payment_Model_Method_Cc extends Mage_Payment_Model_Method_Abstract } if (!$this->OtherCcType($info->getCcType()) && $ccType!=$info->getCcType()) { - $errorCode = 'ccsave_cc_type,ccsave_cc_number'; - $errorMsg = $this->_getHelper()->__('Credit card number mismatch with credit card type.'); + $errorMsg = Mage::helper('Mage_Payment_Helper_Data')->__('Credit card number mismatch with credit card type.'); } } else { - $errorCode = 'ccsave_cc_number'; - $errorMsg = $this->_getHelper()->__('Invalid Credit Card Number'); + $errorMsg = Mage::helper('Mage_Payment_Helper_Data')->__('Invalid Credit Card Number'); } } else { - $errorCode = 'ccsave_cc_type'; - $errorMsg = $this->_getHelper()->__('Credit card type is not allowed for this payment method.'); + $errorMsg = Mage::helper('Mage_Payment_Helper_Data')->__('Credit card type is not allowed for this payment method.'); } //validate credit card verification number @@ -145,18 +157,16 @@ class Mage_Payment_Model_Method_Cc extends Mage_Payment_Model_Method_Abstract $verifcationRegEx = $this->getVerificationRegEx(); $regExp = isset($verifcationRegEx[$info->getCcType()]) ? $verifcationRegEx[$info->getCcType()] : ''; if (!$info->getCcCid() || !$regExp || !preg_match($regExp ,$info->getCcCid())){ - $errorMsg = $this->_getHelper()->__('Please enter a valid credit card verification number.'); + $errorMsg = Mage::helper('Mage_Payment_Helper_Data')->__('Please enter a valid credit card verification number.'); } } if ($ccType != 'SS' && !$this->_validateExpDate($info->getCcExpYear(), $info->getCcExpMonth())) { - $errorCode = 'ccsave_expiration,ccsave_expiration_yr'; - $errorMsg = $this->_getHelper()->__('Incorrect credit card expiration date.'); + $errorMsg = Mage::helper('Mage_Payment_Helper_Data')->__('Incorrect credit card expiration date.'); } if($errorMsg){ Mage::throwException($errorMsg); - //throw Mage::exception('Mage_Payment', $errorMsg, $errorCode); } //This must be after all validation conditions @@ -195,7 +205,9 @@ class Mage_Payment_Model_Method_Cc extends Mage_Payment_Model_Method_Abstract protected function _validateExpDate($expYear, $expMonth) { $date = Mage::app()->getLocale()->date(); - if (!$expYear || !$expMonth || ($date->compareYear($expYear)==1) || ($date->compareYear($expYear) == 0 && ($date->compareMonth($expMonth)==1 ) )) { + if (!$expYear || !$expMonth || ($date->compareYear($expYear) == 1) + || ($date->compareYear($expYear) == 0 && ($date->compareMonth($expMonth) == 1)) + ) { return false; } return true; diff --git a/app/code/core/Mage/Payment/Model/Method/Ccsave.php b/app/code/core/Mage/Payment/Model/Method/Ccsave.php index a0fa8c069007e180800e8df7a9e915e7a745051c..4d8460dd14bd2ffaf6d26411115dd1162f2bc9a9 100644 --- a/app/code/core/Mage/Payment/Model/Method/Ccsave.php +++ b/app/code/core/Mage/Payment/Model/Method/Ccsave.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Payment - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Payment/Model/Method/Checkmo.php b/app/code/core/Mage/Payment/Model/Method/Checkmo.php index 71c01681782ff9be9d13444998f7f1b81c29e9d6..f865236d16f3a3227695349a8985dcaa59ab3500 100644 --- a/app/code/core/Mage/Payment/Model/Method/Checkmo.php +++ b/app/code/core/Mage/Payment/Model/Method/Checkmo.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Payment - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Payment/Model/Method/Free.php b/app/code/core/Mage/Payment/Model/Method/Free.php index 0ca45647aa913c335e00471e325cfc0ba27f2115..a1aada4d731f776ade15ef3d656686d22bc1e16a 100644 --- a/app/code/core/Mage/Payment/Model/Method/Free.php +++ b/app/code/core/Mage/Payment/Model/Method/Free.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Payment - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -74,7 +74,7 @@ class Mage_Payment_Model_Method_Free extends Mage_Payment_Model_Method_Abstract public function getConfigPaymentAction() { if ('pending' == $this->getConfigData('order_status')) { - return Mage_Payment_Model_Method_Abstract::ACTION_AUTHORIZE; + return null; // do nothing if status pending } return parent::getConfigPaymentAction(); } diff --git a/app/code/core/Mage/Payment/Model/Method/Purchaseorder.php b/app/code/core/Mage/Payment/Model/Method/Purchaseorder.php index 487558bfe53fa52d2d4ccc279b19a2b072cbdf2b..c45d33217fc4d1611f5e9ae3ea570cd96ade3c16 100644 --- a/app/code/core/Mage/Payment/Model/Method/Purchaseorder.php +++ b/app/code/core/Mage/Payment/Model/Method/Purchaseorder.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Payment - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Payment/Model/Observer.php b/app/code/core/Mage/Payment/Model/Observer.php index e49dcdf4c32880fef2d8b8befe1da348fd8d2754..196f43b25743f6527234cff56602a074d08880d4 100644 --- a/app/code/core/Mage/Payment/Model/Observer.php +++ b/app/code/core/Mage/Payment/Model/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Payment - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Payment/Model/Paygate/Result.php b/app/code/core/Mage/Payment/Model/Paygate/Result.php index dcd7cdbbd214e56c35ad3f5ce87b30e21d029f69..545fd02c14de89ea07ae6723262410cb16fe2731 100644 --- a/app/code/core/Mage/Payment/Model/Paygate/Result.php +++ b/app/code/core/Mage/Payment/Model/Paygate/Result.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Payment - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Payment/Model/Recurring/Profile.php b/app/code/core/Mage/Payment/Model/Recurring/Profile.php index e68bb188b2b47968db24f09fba6ea4c2787a3087..28c9a5e175e7f94425b58dc9585df148acf6d1a7 100644 --- a/app/code/core/Mage/Payment/Model/Recurring/Profile.php +++ b/app/code/core/Mage/Payment/Model/Recurring/Profile.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Payment - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Payment/Model/Recurring/Profile/MethodInterface.php b/app/code/core/Mage/Payment/Model/Recurring/Profile/MethodInterface.php index b5674fb8eba5cd9e270233d4a302aa29113890fe..d4dd6261342a5d3fa72bc1f5fa3fe321fb4debf7 100644 --- a/app/code/core/Mage/Payment/Model/Recurring/Profile/MethodInterface.php +++ b/app/code/core/Mage/Payment/Model/Recurring/Profile/MethodInterface.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Payment - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Payment/Model/Source/Cctype.php b/app/code/core/Mage/Payment/Model/Source/Cctype.php index 5bfc82eeb2ca9907fe7c1b7beaff4187aff3d79a..6b8b81d82f03c2e509440cc8ab9848edad0bd1d4 100644 --- a/app/code/core/Mage/Payment/Model/Source/Cctype.php +++ b/app/code/core/Mage/Payment/Model/Source/Cctype.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Payment - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Payment/Model/Source/Invoice.php b/app/code/core/Mage/Payment/Model/Source/Invoice.php index bff33047682c4ac7432db9ca30a9790b31232528..4c8e3c6369dada888993074e9bb4abde2464525f 100644 --- a/app/code/core/Mage/Payment/Model/Source/Invoice.php +++ b/app/code/core/Mage/Payment/Model/Source/Invoice.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Payment - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Payment/etc/adminhtml.xml b/app/code/core/Mage/Payment/etc/adminhtml.xml index 0569e7bfafbead1bf7a8e61d6fb0629e24b441e4..ce1975b700c70cae02741bf457c2109daacccf2a 100644 --- a/app/code/core/Mage/Payment/etc/adminhtml.xml +++ b/app/code/core/Mage/Payment/etc/adminhtml.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Payment - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Payment/etc/config.xml b/app/code/core/Mage/Payment/etc/config.xml index bb81014fcc9dcc1ae691d32a396518b19da79788..d551c11c7e0228b55c13487d3bcdaa046f732d9e 100644 --- a/app/code/core/Mage/Payment/etc/config.xml +++ b/app/code/core/Mage/Payment/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Payment - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Payment/etc/system.xml b/app/code/core/Mage/Payment/etc/system.xml index 8f5888d2a00ad55859aa28e44e7f0ca20916fa61..0684816261d59c6d20d508c61d036a0c720c03f6 100644 --- a/app/code/core/Mage/Payment/etc/system.xml +++ b/app/code/core/Mage/Payment/etc/system.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Payment - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> @@ -79,6 +79,7 @@ <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> <show_in_store>0</show_in_store> + <frontend_class>validate-number</frontend_class> </sort_order> <title translate="label"> <label>Title</label> @@ -202,6 +203,7 @@ <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> <show_in_store>0</show_in_store> + <frontend_class>validate-number</frontend_class> </sort_order> <title translate="label"> <label>Title</label> @@ -299,6 +301,9 @@ <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> <show_in_store>0</show_in_store> + <depends> + <order_status separator=",">processing,processed_ogone</order_status> + </depends> </payment_action> <sort_order translate="label"> <label>Sort Order</label> @@ -307,6 +312,7 @@ <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> <show_in_store>0</show_in_store> + <frontend_class>validate-number</frontend_class> </sort_order> <title translate="label"> <label>Title</label> @@ -390,6 +396,7 @@ <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> <show_in_store>0</show_in_store> + <frontend_class>validate-number</frontend_class> </sort_order> <title translate="label"> <label>Title</label> diff --git a/app/code/core/Mage/Payment/view/adminhtml/form/cc.phtml b/app/code/core/Mage/Payment/view/adminhtml/form/cc.phtml index 36f011831d938be6733b38247008b447a2e65afd..a2eb2b94fccdce415d877f2402ffc81347eedb24 100644 --- a/app/code/core/Mage/Payment/view/adminhtml/form/cc.phtml +++ b/app/code/core/Mage/Payment/view/adminhtml/form/cc.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Payment/view/adminhtml/form/ccsave.phtml b/app/code/core/Mage/Payment/view/adminhtml/form/ccsave.phtml index 6ee545bb20d3db96ab1be98f5f92ac27ce39e369..798bf7426bfaf54fe2ccf36767ea155721f0779b 100644 --- a/app/code/core/Mage/Payment/view/adminhtml/form/ccsave.phtml +++ b/app/code/core/Mage/Payment/view/adminhtml/form/ccsave.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Payment/view/adminhtml/form/checkmo.phtml b/app/code/core/Mage/Payment/view/adminhtml/form/checkmo.phtml index 5309aa254bef4b68ccf3a1d5753024f5ee5e313a..3eb4e00f4bee53c612b5e348554ac79050e52e1a 100644 --- a/app/code/core/Mage/Payment/view/adminhtml/form/checkmo.phtml +++ b/app/code/core/Mage/Payment/view/adminhtml/form/checkmo.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Payment/view/adminhtml/form/purchaseorder.phtml b/app/code/core/Mage/Payment/view/adminhtml/form/purchaseorder.phtml index 3f8a72f979f3e759902ba2d7c9290d9994ce7e27..2f91b5e560125d66f7031bbc4b554668bf451e42 100644 --- a/app/code/core/Mage/Payment/view/adminhtml/form/purchaseorder.phtml +++ b/app/code/core/Mage/Payment/view/adminhtml/form/purchaseorder.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Payment/view/adminhtml/info/checkmo.phtml b/app/code/core/Mage/Payment/view/adminhtml/info/checkmo.phtml index c1afd92f19b141670e03c95f3afadcb165995d6c..f452e9f3405c6b4c2a3156e92d1e94f75fa16e71 100644 --- a/app/code/core/Mage/Payment/view/adminhtml/info/checkmo.phtml +++ b/app/code/core/Mage/Payment/view/adminhtml/info/checkmo.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Payment/view/adminhtml/info/default.phtml b/app/code/core/Mage/Payment/view/adminhtml/info/default.phtml index ca93bcb49764628db8744073aca730486397332f..07992a60d4076d33af4fb9c1425d190b76e0d95b 100644 --- a/app/code/core/Mage/Payment/view/adminhtml/info/default.phtml +++ b/app/code/core/Mage/Payment/view/adminhtml/info/default.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Payment/view/adminhtml/info/pdf/checkmo.phtml b/app/code/core/Mage/Payment/view/adminhtml/info/pdf/checkmo.phtml index 35f848e6da796d6bdff66ce33447f20b0aa7327f..e86a3fe9318e5c8cc6a80fa73ee85b547a4fc75a 100644 --- a/app/code/core/Mage/Payment/view/adminhtml/info/pdf/checkmo.phtml +++ b/app/code/core/Mage/Payment/view/adminhtml/info/pdf/checkmo.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Payment/view/adminhtml/info/pdf/default.phtml b/app/code/core/Mage/Payment/view/adminhtml/info/pdf/default.phtml index a9eee2f310137e4073d70fbf0f0c471f10998ed8..1b738ed9fb47208af26bc1a35792f1d6db2e0979 100644 --- a/app/code/core/Mage/Payment/view/adminhtml/info/pdf/default.phtml +++ b/app/code/core/Mage/Payment/view/adminhtml/info/pdf/default.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Payment/view/adminhtml/info/pdf/purchaseorder.phtml b/app/code/core/Mage/Payment/view/adminhtml/info/pdf/purchaseorder.phtml index 1b40a5c0ef08b266863ccb37661386c6c318e87c..d06132e1bb441d82e9cc6986f91332bdd8070481 100644 --- a/app/code/core/Mage/Payment/view/adminhtml/info/pdf/purchaseorder.phtml +++ b/app/code/core/Mage/Payment/view/adminhtml/info/pdf/purchaseorder.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Payment/view/adminhtml/info/purchaseorder.phtml b/app/code/core/Mage/Payment/view/adminhtml/info/purchaseorder.phtml index b6d6fc2c196f648d11fcf2dd6c97401319840e95..e00b266be19a1ae0976f61df8c0bf1118a285c9c 100644 --- a/app/code/core/Mage/Payment/view/adminhtml/info/purchaseorder.phtml +++ b/app/code/core/Mage/Payment/view/adminhtml/info/purchaseorder.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Payment/view/frontend/catalog/product/view/profile/options.phtml b/app/code/core/Mage/Payment/view/frontend/catalog/product/view/profile/options.phtml index d4b6466d5aa084e66886a5c5a8d892b27e94401c..af0daeb359d7dc4f8bd0ac817d40ad771b8f907c 100644 --- a/app/code/core/Mage/Payment/view/frontend/catalog/product/view/profile/options.phtml +++ b/app/code/core/Mage/Payment/view/frontend/catalog/product/view/profile/options.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Payment/view/frontend/catalog/product/view/profile/schedule.phtml b/app/code/core/Mage/Payment/view/frontend/catalog/product/view/profile/schedule.phtml index 59d3b8f4abce7820b1a770db60e7100aef8eadd8..8998c3f3e7250d7fe04b2e909869c77848786f99 100644 --- a/app/code/core/Mage/Payment/view/frontend/catalog/product/view/profile/schedule.phtml +++ b/app/code/core/Mage/Payment/view/frontend/catalog/product/view/profile/schedule.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Payment/view/frontend/form/cc.phtml b/app/code/core/Mage/Payment/view/frontend/form/cc.phtml index d4208de0b6418851c985aff6adc5c2f77cc9b0b9..45451c2c0c3adbbbff7550f6adadeb2cd28bdf31 100644 --- a/app/code/core/Mage/Payment/view/frontend/form/cc.phtml +++ b/app/code/core/Mage/Payment/view/frontend/form/cc.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Payment/view/frontend/form/ccsave.phtml b/app/code/core/Mage/Payment/view/frontend/form/ccsave.phtml index d714237d67cb99eb866b10a826b7594074192e31..830c92c95b2acb5705c50a0d32be972861cbd7d6 100644 --- a/app/code/core/Mage/Payment/view/frontend/form/ccsave.phtml +++ b/app/code/core/Mage/Payment/view/frontend/form/ccsave.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Payment/view/frontend/form/checkmo.phtml b/app/code/core/Mage/Payment/view/frontend/form/checkmo.phtml index d03d5c4c39b6dd579bdaa9777f124626798e1fae..ea551af06136f5daf5c7e51af1e8d25f39c5c1d1 100644 --- a/app/code/core/Mage/Payment/view/frontend/form/checkmo.phtml +++ b/app/code/core/Mage/Payment/view/frontend/form/checkmo.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Payment/view/frontend/form/purchaseorder.phtml b/app/code/core/Mage/Payment/view/frontend/form/purchaseorder.phtml index 132b0bca9f15b2b33da69bcf145099127ee21f16..af44aa7818bb26122e419d706599d300ce61cfd3 100644 --- a/app/code/core/Mage/Payment/view/frontend/form/purchaseorder.phtml +++ b/app/code/core/Mage/Payment/view/frontend/form/purchaseorder.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Payment/view/frontend/info/checkmo.phtml b/app/code/core/Mage/Payment/view/frontend/info/checkmo.phtml index 64b5d8cb2ad42008b429ca0b2d6ecc311e0b5875..8cca6ba7c5a56c9dc1629c1cfefce6dd34814fe4 100644 --- a/app/code/core/Mage/Payment/view/frontend/info/checkmo.phtml +++ b/app/code/core/Mage/Payment/view/frontend/info/checkmo.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Payment/view/frontend/info/default.phtml b/app/code/core/Mage/Payment/view/frontend/info/default.phtml index a76f630371f2306232ffd35df66f9f371af37ed2..b2eed7cf2048da0198327d7bf4c4b8c4412eb144 100644 --- a/app/code/core/Mage/Payment/view/frontend/info/default.phtml +++ b/app/code/core/Mage/Payment/view/frontend/info/default.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Payment/view/frontend/info/purchaseorder.phtml b/app/code/core/Mage/Payment/view/frontend/info/purchaseorder.phtml index 00384bc5c361b6f453c21cf3bdfdaf205d15c7fe..f440775abdaf81860dbcadcc647f25abc83c6770 100644 --- a/app/code/core/Mage/Payment/view/frontend/info/purchaseorder.phtml +++ b/app/code/core/Mage/Payment/view/frontend/info/purchaseorder.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Payment/view/frontend/layout.xml b/app/code/core/Mage/Payment/view/frontend/layout.xml index eab4518a4e586b777cc81988119ce03591293f29..d3583d738db23034a397e3756c3857038ca7edf0 100644 --- a/app/code/core/Mage/Payment/view/frontend/layout.xml +++ b/app/code/core/Mage/Payment/view/frontend/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Block/Adminhtml/Settlement/Details.php b/app/code/core/Mage/Paypal/Block/Adminhtml/Settlement/Details.php index 4cea0c64aadf7948ce4ca235b675df241ca57c0e..91d104f14026af17bbf77b22943afd9ec1fe92f9 100644 --- a/app/code/core/Mage/Paypal/Block/Adminhtml/Settlement/Details.php +++ b/app/code/core/Mage/Paypal/Block/Adminhtml/Settlement/Details.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Block/Adminhtml/Settlement/Details/Form.php b/app/code/core/Mage/Paypal/Block/Adminhtml/Settlement/Details/Form.php index cf8992484d13daa7be21109e17d8a227c29c7433..03389c15eb7732ed2ba02090ec70772c9a0f8536 100644 --- a/app/code/core/Mage/Paypal/Block/Adminhtml/Settlement/Details/Form.php +++ b/app/code/core/Mage/Paypal/Block/Adminhtml/Settlement/Details/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Block/Adminhtml/Settlement/Report.php b/app/code/core/Mage/Paypal/Block/Adminhtml/Settlement/Report.php index 32cce82b1d0aafa4f9bbf3a95150ca765f5f8762..99705a99029bc3cb11dfa0bc926a010932ac4e76 100644 --- a/app/code/core/Mage/Paypal/Block/Adminhtml/Settlement/Report.php +++ b/app/code/core/Mage/Paypal/Block/Adminhtml/Settlement/Report.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Block/Adminhtml/Settlement/Report/Grid.php b/app/code/core/Mage/Paypal/Block/Adminhtml/Settlement/Report/Grid.php index c036872654b096fe1fb447c8b69fa9c7e8cdcfc2..f5b620cb082c4a4004db59e8b8d2dcd7c236bd0f 100644 --- a/app/code/core/Mage/Paypal/Block/Adminhtml/Settlement/Report/Grid.php +++ b/app/code/core/Mage/Paypal/Block/Adminhtml/Settlement/Report/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Block/Adminhtml/System/Config/ApiWizard.php b/app/code/core/Mage/Paypal/Block/Adminhtml/System/Config/ApiWizard.php index 86e2743e8aa665978e6316f09d695a8032ecd3d7..8b7d4d9192adb4cf5d8ddd04c95aca55800724cb 100644 --- a/app/code/core/Mage/Paypal/Block/Adminhtml/System/Config/ApiWizard.php +++ b/app/code/core/Mage/Paypal/Block/Adminhtml/System/Config/ApiWizard.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Block/Adminhtml/System/Config/Fieldset/Global.php b/app/code/core/Mage/Paypal/Block/Adminhtml/System/Config/Fieldset/Global.php index 230073c772009a09af37eb5a9c73cd7ac452a814..d5b7d674acb3522e5b58fea650d45257f2d053cc 100644 --- a/app/code/core/Mage/Paypal/Block/Adminhtml/System/Config/Fieldset/Global.php +++ b/app/code/core/Mage/Paypal/Block/Adminhtml/System/Config/Fieldset/Global.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Block/Adminhtml/System/Config/Fieldset/Hint.php b/app/code/core/Mage/Paypal/Block/Adminhtml/System/Config/Fieldset/Hint.php index 33b9d66fd069fece66c35995bc67f00facdc43b8..bdfc9c65a9d0a24b84c399a7f636ca45dbaac2e8 100644 --- a/app/code/core/Mage/Paypal/Block/Adminhtml/System/Config/Fieldset/Hint.php +++ b/app/code/core/Mage/Paypal/Block/Adminhtml/System/Config/Fieldset/Hint.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Block/Adminhtml/System/Config/Fieldset/Store.php b/app/code/core/Mage/Paypal/Block/Adminhtml/System/Config/Fieldset/Store.php index 8f7296bb7ab986beeb2981f56fc4e945c64e1786..c379fafd20876b56427392983f2dbc2687066d09 100644 --- a/app/code/core/Mage/Paypal/Block/Adminhtml/System/Config/Fieldset/Store.php +++ b/app/code/core/Mage/Paypal/Block/Adminhtml/System/Config/Fieldset/Store.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Block/Adminhtml/System/Config/Payflowlink/Advanced.php b/app/code/core/Mage/Paypal/Block/Adminhtml/System/Config/Payflowlink/Advanced.php index 1c17289759d54e22fde00f7791a6e832e6cd0af3..c7bf5cd25c2f934a02eaaf77f92c7f33b5fcd308 100644 --- a/app/code/core/Mage/Paypal/Block/Adminhtml/System/Config/Payflowlink/Advanced.php +++ b/app/code/core/Mage/Paypal/Block/Adminhtml/System/Config/Payflowlink/Advanced.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Block/Adminhtml/System/Config/Payflowlink/Info.php b/app/code/core/Mage/Paypal/Block/Adminhtml/System/Config/Payflowlink/Info.php index d2f3ed2e6df529375d6fdab5e1c199f4c4dcbc84..86cbee19c4b0d5db9cf5ebadbc63af2bf5b5469a 100644 --- a/app/code/core/Mage/Paypal/Block/Adminhtml/System/Config/Payflowlink/Info.php +++ b/app/code/core/Mage/Paypal/Block/Adminhtml/System/Config/Payflowlink/Info.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Block/Express/Form.php b/app/code/core/Mage/Paypal/Block/Express/Form.php index a4a90e3d25d3b5dd084b80623fa94cb518fd4e13..e04569a0d7a6aa914a68ad8c04ad6afb46294686 100644 --- a/app/code/core/Mage/Paypal/Block/Express/Form.php +++ b/app/code/core/Mage/Paypal/Block/Express/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Block/Express/Review.php b/app/code/core/Mage/Paypal/Block/Express/Review.php index d50e90a3436f165b5056bc7609ac7cd431e83fb3..6b34e898c3bc165464a2a0662fe1e42cd642efe7 100644 --- a/app/code/core/Mage/Paypal/Block/Express/Review.php +++ b/app/code/core/Mage/Paypal/Block/Express/Review.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Block/Express/Review/Details.php b/app/code/core/Mage/Paypal/Block/Express/Review/Details.php index b92efcef59285e9687564cfcb430d21df9579ae7..f1b699b310d2ab40cb5831a0b3bef3d107a654b6 100644 --- a/app/code/core/Mage/Paypal/Block/Express/Review/Details.php +++ b/app/code/core/Mage/Paypal/Block/Express/Review/Details.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Block/Express/Shortcut.php b/app/code/core/Mage/Paypal/Block/Express/Shortcut.php index cb630539fe0b5b6ad9e0675d269858876355162e..1126e6584c8e6e2424f1925e47ec39d7ee61206f 100644 --- a/app/code/core/Mage/Paypal/Block/Express/Shortcut.php +++ b/app/code/core/Mage/Paypal/Block/Express/Shortcut.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Block/Hosted/Pro/Form.php b/app/code/core/Mage/Paypal/Block/Hosted/Pro/Form.php index f27380c9d14158ae494a045fea736efcf1966261..8db12c228a6e0b8dacfdd6311d6722e37081471f 100644 --- a/app/code/core/Mage/Paypal/Block/Hosted/Pro/Form.php +++ b/app/code/core/Mage/Paypal/Block/Hosted/Pro/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Block/Hosted/Pro/Iframe.php b/app/code/core/Mage/Paypal/Block/Hosted/Pro/Iframe.php index 393cde8c65c7345eaf0c497a6bcb15f2fcaf0911..e0c2f4d22a5408ea25e6f374a3459117541e8580 100644 --- a/app/code/core/Mage/Paypal/Block/Hosted/Pro/Iframe.php +++ b/app/code/core/Mage/Paypal/Block/Hosted/Pro/Iframe.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Block/Hosted/Pro/Info.php b/app/code/core/Mage/Paypal/Block/Hosted/Pro/Info.php index 5b33cf228d1c30b270aae7e12eb3ac9f9bfea48e..7e47b5a508944d2b63444bc714752c410b40588a 100644 --- a/app/code/core/Mage/Paypal/Block/Hosted/Pro/Info.php +++ b/app/code/core/Mage/Paypal/Block/Hosted/Pro/Info.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Block/Iframe.php b/app/code/core/Mage/Paypal/Block/Iframe.php index 1fe3498c50cb6843a11adf65ede87c79ee4ce8c9..59fef66f1db052d1a7bdb9c26778285a26418e71 100644 --- a/app/code/core/Mage/Paypal/Block/Iframe.php +++ b/app/code/core/Mage/Paypal/Block/Iframe.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -75,8 +75,9 @@ class Mage_Paypal_Block_Iframe extends Mage_Payment_Block_Form ->getMethod(); if (in_array($paymentCode, $this->helper('Mage_Paypal_Helper_Hss')->getHssMethods())) { $this->_paymentMethodCode = $paymentCode; + $template_path = str_replace('_', '', $paymentCode); + $this->setTemplate("{$template_path}/iframe.phtml"); } - $this->setTemplate('hss/iframe.phtml'); } /** diff --git a/app/code/core/Mage/Paypal/Block/Logo.php b/app/code/core/Mage/Paypal/Block/Logo.php index b086e8f2e4cfde783ded8b87d6f2d72e4505ea2f..3ba06a4396dc50dbf65a1763095dfd1b681c296a 100644 --- a/app/code/core/Mage/Paypal/Block/Logo.php +++ b/app/code/core/Mage/Paypal/Block/Logo.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Block/Payflow/Advanced/Form.php b/app/code/core/Mage/Paypal/Block/Payflow/Advanced/Form.php index 27a31936a92448930fd8a38a77e5d9346c92b17d..13712586020889ae9f1014be59cdebf3e7b3dbb7 100644 --- a/app/code/core/Mage/Paypal/Block/Payflow/Advanced/Form.php +++ b/app/code/core/Mage/Paypal/Block/Payflow/Advanced/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -41,7 +41,7 @@ class Mage_Paypal_Block_Payflow_Advanced_Form extends Mage_Paypal_Block_Payflow_ protected function _construct() { parent::_construct(); - $this->setTemplate('payflowadvanced/iframe.phtml'); + $this->setTemplate('payflowadvanced/info.phtml'); } /** diff --git a/app/code/core/Mage/Paypal/Block/Payflow/Advanced/Iframe.php b/app/code/core/Mage/Paypal/Block/Payflow/Advanced/Iframe.php index bc60efb38f1ec778149ee450d0a289b01b357007..bc67b7220d55f58e3576ea0fd8ddbf98a8f2c490 100644 --- a/app/code/core/Mage/Paypal/Block/Payflow/Advanced/Iframe.php +++ b/app/code/core/Mage/Paypal/Block/Payflow/Advanced/Iframe.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -33,6 +33,15 @@ */ class Mage_Paypal_Block_Payflow_Advanced_Iframe extends Mage_Paypal_Block_Payflow_Link_Iframe { + /** + * Set payment method code + */ + protected function _construct() + { + parent::_construct(); + $this->_paymentMethodCode = Mage_Paypal_Model_Config::METHOD_PAYFLOWADVANCED; + } + /** * Get frame action URL * diff --git a/app/code/core/Mage/Paypal/Block/Payflow/Advanced/Info.php b/app/code/core/Mage/Paypal/Block/Payflow/Advanced/Info.php index 0fa276f768d7d073e9894e5d65dd4f358a7a0f65..0b2ac3cf7baf5e8949148318cd1fffe22f91c1e8 100644 --- a/app/code/core/Mage/Paypal/Block/Payflow/Advanced/Info.php +++ b/app/code/core/Mage/Paypal/Block/Payflow/Advanced/Info.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Block/Payflow/Advanced/Review.php b/app/code/core/Mage/Paypal/Block/Payflow/Advanced/Review.php index 4e6058ff09c62b4e8f90e796e2d48244e0fe5986..ec5f015ea62b1c98a7710edb3ff2e1f9922bfe48 100644 --- a/app/code/core/Mage/Paypal/Block/Payflow/Advanced/Review.php +++ b/app/code/core/Mage/Paypal/Block/Payflow/Advanced/Review.php @@ -20,13 +20,14 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ /** * Paypal Payflow Advanced Express Onepage checkout block * + * @deprecated since 1.6.2.0 * @category Mage * @package Mage_Paypal * @author Magento Core Team <core@magentocommerce.com> diff --git a/app/code/core/Mage/Paypal/Block/Payflow/Link/Form.php b/app/code/core/Mage/Paypal/Block/Payflow/Link/Form.php index fbb4d27981d30edbb819e398aff1933db44f8ba6..055f990c4325d8760f1f9daabd909bebf7c7cd5d 100644 --- a/app/code/core/Mage/Paypal/Block/Payflow/Link/Form.php +++ b/app/code/core/Mage/Paypal/Block/Payflow/Link/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -41,7 +41,7 @@ class Mage_Paypal_Block_Payflow_Link_Form extends Mage_Payment_Block_Form protected function _construct() { parent::_construct(); - $this->setTemplate('payflowlink/iframe.phtml'); + $this->setTemplate('payflowlink/info.phtml'); } /** diff --git a/app/code/core/Mage/Paypal/Block/Payflow/Link/Iframe.php b/app/code/core/Mage/Paypal/Block/Payflow/Link/Iframe.php index 61c58aca5c8df0156a337a2c3397024ff10b7443..7c1477429274dc20d66457dab05e700527b08447 100644 --- a/app/code/core/Mage/Paypal/Block/Payflow/Link/Iframe.php +++ b/app/code/core/Mage/Paypal/Block/Payflow/Link/Iframe.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -31,8 +31,17 @@ * @package Mage_Paypal * @author Magento Core Team <core@magentocommerce.com> */ -class Mage_Paypal_Block_Payflow_Link_Iframe extends Mage_Payment_Block_Form +class Mage_Paypal_Block_Payflow_Link_Iframe extends Mage_Paypal_Block_Iframe { + /** + * Set payment method code + */ + protected function _construct() + { + parent::_construct(); + $this->_paymentMethodCode = Mage_Paypal_Model_Config::METHOD_PAYFLOWLINK; + } + /** * Get frame action URL * @@ -50,7 +59,7 @@ class Mage_Paypal_Block_Payflow_Link_Iframe extends Mage_Payment_Block_Form */ public function getSecureToken() { - return $this->_getSalesDocument() + return $this->_getOrder() ->getPayment() ->getAdditionalInformation('secure_token'); } @@ -62,7 +71,7 @@ class Mage_Paypal_Block_Payflow_Link_Iframe extends Mage_Payment_Block_Form */ public function getSecureTokenId() { - return $this->_getSalesDocument() + return $this->_getOrder() ->getPayment() ->getAdditionalInformation('secure_token_id'); } @@ -85,18 +94,8 @@ class Mage_Paypal_Block_Payflow_Link_Iframe extends Mage_Payment_Block_Form public function isTestMode() { $mode = Mage::helper('Mage_Payment_Helper_Data') - ->getMethodInstance(Mage_Paypal_Model_Config::METHOD_PAYFLOWLINK) + ->getMethodInstance($this->_paymentMethodCode) ->getConfigData('sandbox_flag'); return (bool) $mode; } - - /** - * Get sales document object - * - * @return Mage_Sales_Model_Order|Mage_Sales_Model_Quote - */ - protected function _getSalesDocument() - { - return Mage::getSingleton('Mage_Checkout_Model_Session')->getQuote(); - } } diff --git a/app/code/core/Mage/Paypal/Block/Payflow/Link/Info.php b/app/code/core/Mage/Paypal/Block/Payflow/Link/Info.php index e521d4b1f8fd10c3788ee7e2b6ce150fc30c6df5..16dbfd873b35db856737b450e5bd07fe4ac25ee8 100644 --- a/app/code/core/Mage/Paypal/Block/Payflow/Link/Info.php +++ b/app/code/core/Mage/Paypal/Block/Payflow/Link/Info.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Block/Payflow/Link/Review.php b/app/code/core/Mage/Paypal/Block/Payflow/Link/Review.php index b8fb86aaa54cfcd31f460d0b7c8adc4c0b1a07a8..12c7648422233442bddf5f79433ded5280e7ca2c 100644 --- a/app/code/core/Mage/Paypal/Block/Payflow/Link/Review.php +++ b/app/code/core/Mage/Paypal/Block/Payflow/Link/Review.php @@ -20,13 +20,14 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ /** * Paypal PayflowLink Express Onepage checkout block * + * @deprecated since 1.6.2.0 * @category Mage * @package Mage_Paypal * @author Magento Core Team <core@magentocommerce.com> @@ -41,11 +42,6 @@ class Mage_Paypal_Block_Payflow_Link_Review extends Mage_Paypal_Block_Express_Re */ protected function _beforeToHtml() { - parent::_beforeToHtml(); - $this->setPlaceOrderUrl($this->getUrl("*/*/placeOrder")); - $this->setEditUrl(); - $this->setSuccessUrl($this->getUrl("checkout/onepage/success")); - $this->setUseAjax(true); - return $this; + return parent::_beforeToHtml(); } } diff --git a/app/code/core/Mage/Paypal/Block/Payment/Info.php b/app/code/core/Mage/Paypal/Block/Payment/Info.php index 0297519d815f7b4d5378f4eb168dfd20b8f8129f..a75ccd8d8979d91d56b297fff5d44156e22e9809 100644 --- a/app/code/core/Mage/Paypal/Block/Payment/Info.php +++ b/app/code/core/Mage/Paypal/Block/Payment/Info.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Block/Standard/Form.php b/app/code/core/Mage/Paypal/Block/Standard/Form.php index 47d3cf578be1e45ee64b8f427d5f50450fbaa321..b72265e0ad3ae40ac4dc720898f4c61065b3f584 100644 --- a/app/code/core/Mage/Paypal/Block/Standard/Form.php +++ b/app/code/core/Mage/Paypal/Block/Standard/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Block/Standard/Redirect.php b/app/code/core/Mage/Paypal/Block/Standard/Redirect.php index 25da18f4f740dc6a69506411b35424b1abbbb68a..a4b90608e13f6084115a3d9ee6fc758035f29d1f 100644 --- a/app/code/core/Mage/Paypal/Block/Standard/Redirect.php +++ b/app/code/core/Mage/Paypal/Block/Standard/Redirect.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Paypal_Block_Standard_Redirect extends Mage_Core_Block_Abstract diff --git a/app/code/core/Mage/Paypal/Controller/Express/Abstract.php b/app/code/core/Mage/Paypal/Controller/Express/Abstract.php index 4d844a7d9eeeba2c5d3c803c01f6aa86353c1fcd..b457722dad007a66bdc418ae75dbd84d0ee44be2 100644 --- a/app/code/core/Mage/Paypal/Controller/Express/Abstract.php +++ b/app/code/core/Mage/Paypal/Controller/Express/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -69,7 +69,7 @@ abstract class Mage_Paypal_Controller_Express_Abstract extends Mage_Core_Control $customer = Mage::getSingleton('Mage_Customer_Model_Session')->getCustomer(); if ($customer && $customer->getId()) { $this->_checkout->setCustomerWithAddressChange( - $customer, null, $this->_getQuote()->getShippingAddress() + $customer, $this->_getQuote()->getBillingAddress(), $this->_getQuote()->getShippingAddress() ); } diff --git a/app/code/core/Mage/Paypal/Exception.php b/app/code/core/Mage/Paypal/Exception.php index de8ed4c19c02e53282a8bebebbec8ffd14e5dde4..07af9449294aad494af2c041cd10d97186da1684 100644 --- a/app/code/core/Mage/Paypal/Exception.php +++ b/app/code/core/Mage/Paypal/Exception.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Helper/Data.php b/app/code/core/Mage/Paypal/Helper/Data.php index df6948f4070555ca63611ae99ae161f8bee191a1..8a9674fd66f9d20f3cf7042465e351c163f31294 100644 --- a/app/code/core/Mage/Paypal/Helper/Data.php +++ b/app/code/core/Mage/Paypal/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Helper/Hss.php b/app/code/core/Mage/Paypal/Helper/Hss.php index 665c085a52527f3f06f02dae307f9abdac15168f..970f64894a31722cbd7ed0307223ffb8bba5dddf 100644 --- a/app/code/core/Mage/Paypal/Helper/Hss.php +++ b/app/code/core/Mage/Paypal/Helper/Hss.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -35,7 +35,9 @@ class Mage_Paypal_Helper_Hss extends Mage_Core_Helper_Abstract * @var array */ protected $_hssMethods = array( - Mage_Paypal_Model_Config::METHOD_HOSTEDPRO + Mage_Paypal_Model_Config::METHOD_HOSTEDPRO, + Mage_Paypal_Model_Config::METHOD_PAYFLOWLINK, + Mage_Paypal_Model_Config::METHOD_PAYFLOWADVANCED ); /** diff --git a/app/code/core/Mage/Paypal/Model/Api/Abstract.php b/app/code/core/Mage/Paypal/Model/Api/Abstract.php index dc716ec05c04ff2a5411c6e85b2504f6693cb1d8..08317b1da8455be7cc5f13deeec314f5a18deada 100644 --- a/app/code/core/Mage/Paypal/Model/Api/Abstract.php +++ b/app/code/core/Mage/Paypal/Model/Api/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Model/Api/Nvp.php b/app/code/core/Mage/Paypal/Model/Api/Nvp.php index 7b832911e9b213af1d8469f542e1e8090f771d5a..6fb28c1ca81a17afaee46597b398bd5b8eeace6c 100644 --- a/app/code/core/Mage/Paypal/Model/Api/Nvp.php +++ b/app/code/core/Mage/Paypal/Model/Api/Nvp.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Model/Api/Standard.php b/app/code/core/Mage/Paypal/Model/Api/Standard.php index e6d5f95a4d3df6c6fa0448ccce69477b3541f57b..8b969955de9218592b2846c72dc36942438f50e3 100644 --- a/app/code/core/Mage/Paypal/Model/Api/Standard.php +++ b/app/code/core/Mage/Paypal/Model/Api/Standard.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Model/Cart.php b/app/code/core/Mage/Paypal/Model/Cart.php index a8a715911fdeaaf83356f18561d8b1b3d72bd409..d15d127421de7429c99e34812a2da096b56a66d4 100644 --- a/app/code/core/Mage/Paypal/Model/Cart.php +++ b/app/code/core/Mage/Paypal/Model/Cart.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Model/Cert.php b/app/code/core/Mage/Paypal/Model/Cert.php index ac567b4467b28fc58b5839015d191709dc0f9ba2..93e1860ae15ff9a361c6a923a6b0c2fe63976168 100644 --- a/app/code/core/Mage/Paypal/Model/Cert.php +++ b/app/code/core/Mage/Paypal/Model/Cert.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Model/Config.php b/app/code/core/Mage/Paypal/Model/Config.php index 82ff3fdec6f4f2a46a0b2afb291d7dca9782249b..c39453906cb87cc07ef76267c3a959e50819c53a 100644 --- a/app/code/core/Mage/Paypal/Model/Config.php +++ b/app/code/core/Mage/Paypal/Model/Config.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -98,6 +98,8 @@ class Mage_Paypal_Model_Config /** * Authorization amounts for Account Verification + * + * @deprecated since 1.6.2.0 * @var int */ const AUTHORIZATION_AMOUNT_ZERO = 0; @@ -873,16 +875,12 @@ class Mage_Paypal_Model_Config /** * Returns array of possible Authorization Amounts for Account Verification * + * @deprecated since 1.6.2.0 * @return array */ public function getAuthorizationAmounts() { - $authorizationAmount = array( - self::AUTHORIZATION_AMOUNT_ZERO => Mage::helper('Mage_Paypal_Helper_Data')->__('$0 Auth'), - self::AUTHORIZATION_AMOUNT_ONE => Mage::helper('Mage_Paypal_Helper_Data')->__('$1 Auth'), - self::AUTHORIZATION_AMOUNT_FULL => Mage::helper('Mage_Paypal_Helper_Data')->__('Full Auth'), - ); - return $authorizationAmount; + return array(); } /** @@ -1367,4 +1365,3 @@ class Mage_Paypal_Model_Config return Mage::getModel('Mage_Paypal_Model_Cert')->loadByWebsite($websiteId, false)->getCertPath(); } } - diff --git a/app/code/core/Mage/Paypal/Model/Direct.php b/app/code/core/Mage/Paypal/Model/Direct.php index 404987a5c073246ef032b3369dd66e3159595011..1477bd1af2558b3311e47d7461b865aad13762ef 100644 --- a/app/code/core/Mage/Paypal/Model/Direct.php +++ b/app/code/core/Mage/Paypal/Model/Direct.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Model/Express.php b/app/code/core/Mage/Paypal/Model/Express.php index 908c5ec54f3d56b0e023a4bdbc3590c1226c11e1..aeb16f459acaddce539c87bbf956438af0abb00f 100644 --- a/app/code/core/Mage/Paypal/Model/Express.php +++ b/app/code/core/Mage/Paypal/Model/Express.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Model/Express/Checkout.php b/app/code/core/Mage/Paypal/Model/Express/Checkout.php index 33eec398a38452fa24c903de085889bd5ca79b65..6f4c68f93477fee5d778c37c60d6dcd1b4c5f7f1 100644 --- a/app/code/core/Mage/Paypal/Model/Express/Checkout.php +++ b/app/code/core/Mage/Paypal/Model/Express/Checkout.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Model/Hostedpro.php b/app/code/core/Mage/Paypal/Model/Hostedpro.php index 620ccd5630f8cb27eb28f88d87f6e67269f441ed..e0751acba013397a3a91340a00341e60a640b8f3 100644 --- a/app/code/core/Mage/Paypal/Model/Hostedpro.php +++ b/app/code/core/Mage/Paypal/Model/Hostedpro.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Model/Hostedpro/Request.php b/app/code/core/Mage/Paypal/Model/Hostedpro/Request.php index f6e5748f863276db2b6b2ea1b82ea2cfb1adab53..4095234d0d13406d2dc68021b9141099a4bf04cf 100644 --- a/app/code/core/Mage/Paypal/Model/Hostedpro/Request.php +++ b/app/code/core/Mage/Paypal/Model/Hostedpro/Request.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Model/Info.php b/app/code/core/Mage/Paypal/Model/Info.php index be2f8bdd6646ebc365dc05d4510206405bc6c163..eb958cbf087434a4986634769ba2ad1f89fa5da7 100644 --- a/app/code/core/Mage/Paypal/Model/Info.php +++ b/app/code/core/Mage/Paypal/Model/Info.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Model/Ipn.php b/app/code/core/Mage/Paypal/Model/Ipn.php index 97d43ca5455ce065b15ea71286587a25388711cd..5bf09da9eaa853ee853952b5b58e70a5489cf451 100644 --- a/app/code/core/Mage/Paypal/Model/Ipn.php +++ b/app/code/core/Mage/Paypal/Model/Ipn.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -170,7 +170,12 @@ class Mage_Paypal_Model_Ipn $id = $this->_request['invoice']; $this->_order = Mage::getModel('Mage_Sales_Model_Order')->loadByIncrementId($id); if (!$this->_order->getId()) { - throw new Exception(sprintf('Wrong order ID: "%s".', $id)); + $this->_debugData['exception'] = sprintf('Wrong order ID: "%s".', $id); + $this->_debug(); + Mage::app()->getResponse() + ->setHeader('HTTP/1.1','503 Service Unavailable') + ->sendResponse(); + exit; } // re-initialize config with the method code and store id $methodCode = $this->_order->getPayment()->getMethod(); diff --git a/app/code/core/Mage/Paypal/Model/Method/Agreement.php b/app/code/core/Mage/Paypal/Model/Method/Agreement.php index 55401cede69bbb15e9847562b4ad31e000568e43..bb856218e81c7a413e9bf426d4418f61caae1682 100644 --- a/app/code/core/Mage/Paypal/Model/Method/Agreement.php +++ b/app/code/core/Mage/Paypal/Model/Method/Agreement.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Model/Observer.php b/app/code/core/Mage/Paypal/Model/Observer.php index 239a75e3ff6a4d6eb2b7306b7f86c472b09d008a..e067a44832bc975cd9478da629586df6c743256d 100644 --- a/app/code/core/Mage/Paypal/Model/Observer.php +++ b/app/code/core/Mage/Paypal/Model/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -57,35 +57,12 @@ class Mage_Paypal_Model_Observer /** * Clean unfinished transaction * + * @deprecated since 1.6.2.0 * @return Mage_Paypal_Model_Observer */ public function cleanTransactions() { - /** @var $date Mage_Core_Model_Date */ - $date = Mage::getModel('Mage_Core_Model_Date'); - $createdBefore = strtotime('-1 hour', $date->timestamp()); - - /** @var $collection Mage_Paypal_Model_Resource_Payment_Transaction_Collection */ - $collection = Mage::getModel('Mage_Paypal_Model_Payment_Transaction')->getCollection(); - $collection->addCreatedBeforeFilter($date->gmtDate(null, $createdBefore)); - - /** @var $method Mage_Paypal_Model_Payflowlink */ - $method = Mage::helper('Mage_Payment_Helper_Data')->getMethodInstance(Mage_Paypal_Model_Config::METHOD_PAYFLOWLINK); - - /** @var $item Mage_Paypal_Model_Payment_Transaction */ - foreach ($collection as $item) { - try { - $method->void(new Varien_Object(array( - 'transaction_id' => $item->getTxnId(), - 'store' => $item->getAdditionalInformation('store_id') - ))); - $item->delete(); - } catch (Mage_Paypal_Exception $e) { - $item->delete(); - } catch (Exception $e) { - Mage::logException($e); - } - } + return $this; } /** diff --git a/app/code/core/Mage/Paypal/Model/Payflow/Request.php b/app/code/core/Mage/Paypal/Model/Payflow/Request.php index 28ba1695ee199e7753343f28f632f60618b73ccb..2a0023ad86c4d1f14590adfad8395ace129c8b70 100644 --- a/app/code/core/Mage/Paypal/Model/Payflow/Request.php +++ b/app/code/core/Mage/Paypal/Model/Payflow/Request.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Model/Payflowadvanced.php b/app/code/core/Mage/Paypal/Model/Payflowadvanced.php index 55f57e694a75e767abde39501ade9736cd8165b6..1a2ca8f6ec5c7f9b4400984d7a5c437c7e81b1ff 100644 --- a/app/code/core/Mage/Paypal/Model/Payflowadvanced.php +++ b/app/code/core/Mage/Paypal/Model/Payflowadvanced.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -54,32 +54,4 @@ class Mage_Paypal_Model_Payflowadvanced extends Mage_Paypal_Model_Payflowlink * @var string */ protected $_infoBlockType = 'Mage_Paypal_Block_Payflow_Advanced_Info'; - - /** - * Instantiate state and set it to state object - * PayflowAdvanced should always use full authorization amount - * - * @param string $paymentAction - * @param Varien_Object $stateObject - * @return Mage_Paypal_Model_Payflowadvanced - */ - public function initialize($paymentAction, $stateObject) - { - $payment = $this->getInfoInstance(); - - $salesDocument = $payment->getOrder(); - if (!$salesDocument) { - $salesDocument = $payment->getQuote(); - $amount = $salesDocument->getBaseGrandTotal(); - } else { - $amount = $salesDocument->getBaseTotalDue(); - } - - $this->_initialize($payment, $amount); - - $payment->setAdditionalInformation('authorization_amount', - Mage_Paypal_Model_Config::AUTHORIZATION_AMOUNT_FULL); - - return $this; - } } diff --git a/app/code/core/Mage/Paypal/Model/Payflowlink.php b/app/code/core/Mage/Paypal/Model/Payflowlink.php index dac5c16f9f5157e3187020284f74f48dc1d3c9c2..41fa0e48e042985f0a38d89e20a49a6f3e6b3753 100644 --- a/app/code/core/Mage/Paypal/Model/Payflowlink.php +++ b/app/code/core/Mage/Paypal/Model/Payflowlink.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -47,6 +47,7 @@ class Mage_Paypal_Model_Payflowlink extends Mage_Paypal_Model_Payflowpro */ protected $_canUseInternal = false; protected $_canUseForMultishipping = false; + protected $_isInitializeNeeded = true; /** * Request & response model @@ -66,12 +67,6 @@ class Mage_Paypal_Model_Payflowlink extends Mage_Paypal_Model_Payflowpro */ const RESPONSE_ERROR_MSG = 'Payment error. %s was not found.'; - /** - * Quote Changed Error message - * @var string - */ - const SHOPPING_CART_CHANGED_ERROR_MSG = 'Shopping cart contents has been changed.'; - /** * Key for storing secure hash in additional information of payment model * @@ -113,207 +108,29 @@ class Mage_Paypal_Model_Payflowlink extends Mage_Paypal_Model_Payflowpro */ public function initialize($paymentAction, $stateObject) { - $payment = $this->getInfoInstance(); - - $salesDocument = $payment->getOrder(); - if (!$salesDocument) { - $salesDocument = $payment->getQuote(); - $amount = $salesDocument->getBaseGrandTotal(); - } else { - $amount = $salesDocument->getBaseTotalDue(); - } - //create reference transaction if Verification Authorization Amount set to $0 or $1 - $authorizationAmount = $this->getConfigData('authorization_amount', $salesDocument->getStoreId()); - switch ($authorizationAmount) { - case Mage_Paypal_Model_Config::AUTHORIZATION_AMOUNT_FULL: - $this->_initialize($payment, $amount); - break; - case Mage_Paypal_Model_Config::AUTHORIZATION_AMOUNT_ONE: - $this->_initialize($payment, 1); + switch ($paymentAction) { + case Mage_Paypal_Model_Config::PAYMENT_ACTION_AUTH: + case Mage_Paypal_Model_Config::PAYMENT_ACTION_SALE: + $payment = $this->getInfoInstance(); + $order = $payment->getOrder(); + $order->setCanSendNewEmailFlag(false); + $payment->setAmountAuthorized($order->getTotalDue()); + $payment->setBaseAmountAuthorized($order->getBaseTotalDue()); + $this->_generateSecureSilentPostHash($payment); + $request = $this->_buildTokenRequest($payment); + $response = $this->_postRequest($request); + $this->_processTokenErrors($response, $payment); + + $order = $payment->getOrder(); + $order->setCanSendNewEmailFlag(false); + + $stateObject->setState(Mage_Sales_Model_Order::STATE_PENDING_PAYMENT); + $stateObject->setStatus('pending_payment'); + $stateObject->setIsNotified(false); break; - case Mage_Paypal_Model_Config::AUTHORIZATION_AMOUNT_ZERO: - try { - $this->_initialize($payment, 0); - } catch (Mage_Paypal_Exception $e) { - $authorizationAmount = Mage_Paypal_Model_Config::AUTHORIZATION_AMOUNT_ONE; - $this->_initialize($payment, 1); - } + default: break; } - $payment->setAdditionalInformation('authorization_amount', $authorizationAmount); - - return $this; - } - - /** - * Add transaction with correct transaction Id - * - * @param Varien_Object $payment - * @param string $txnId - * @return void - */ - protected function _addTransaction($payment, $txnId) - { - $previousTxnId = $payment->getTransactionId(); - $payment->setTransactionId($txnId); - $payment->addTransaction(Mage_Sales_Model_Order_Payment_Transaction::TYPE_AUTH); - $payment->setTransactionId($previousTxnId); - } - /** - * Initialize request - * - * @param Varien_Object $payment - * @param $amount - * @return Mage_Paypal_Model_Payflowlink - */ - protected function _initialize(Varien_Object $payment, $amount) - { - $this->_generateSecureSilentPostHash($payment); - $request = $this->_buildTokenRequest($payment, $amount); - $response = $this->_postRequest($request); - $this->_processTokenErrors($response, $payment); - return $this; - } - - /** - * Check whether order review has enough data to initialize - * - * @param $token - * @throws Mage_Core_Exception - */ - public function prepareOrderReview($token = null) - { - } - - /** - * Authorize payment - * - * @param Mage_Sales_Model_Order_Payment | Mage_Sales_Model_Quote_Payment $payment - * @param mixed $amount - * @return Mage_Paypal_Model_Payflowlink - */ - public function authorize(Varien_Object $payment, $amount) - { - $txnId = $payment->getAdditionalInformation('authorization_id'); - /** @var $transaction Mage_Paypal_Model_Payment_Transaction */ - $transaction = Mage::getModel('Mage_Paypal_Model_Payment_Transaction'); - $transaction->loadByTxnId($txnId); - - $payment->setTransactionId($txnId)->setIsTransactionClosed(0); - if ($payment->getAdditionalInformation('paypal_fraud_filters') !== null) { - $payment->setIsTransactionPending(true); - $payment->setIsFraudDetected(true); - } - - if ($transaction->getId() && $payment->getAdditionalInformation('authorization_amount') != - Mage_Paypal_Model_Config::AUTHORIZATION_AMOUNT_FULL - ) { - $this->_addTransaction($payment, $txnId); - } - - $this->_authorize($payment, $amount, $transaction, $txnId); - if ($payment->getAdditionalInformation('authorization_amount') != - Mage_Paypal_Model_Config::AUTHORIZATION_AMOUNT_FULL - ) { - $payment->setParentTransactionId($txnId); - parent::authorize($payment, $amount); - if ($payment->getTransactionId()) { - $payment->setAdditionalInformation('authorization_id', $payment->getTransactionId()); - } - } - - $transaction->delete(); - return $this; - } - - /** - * Additional authorization logic for Account Verification - * - * @param Varien_Object $payment - * @param mixed $amount - * @param Mage_Paypal_Model_Payment_Transaction $transaction - * @param string $txnId - * @return Mage_Paypal_Model_Payflowlink - */ - protected function _authorize(Varien_Object $payment, $amount, $transaction, $txnId) - { - $authorizationAmount = $payment->getAdditionalInformation('authorization_amount'); - if ($authorizationAmount == Mage_Paypal_Model_Config::AUTHORIZATION_AMOUNT_ONE) { - $payment->setParentTransactionId($txnId); - $this->void($payment); - } elseif ($authorizationAmount == Mage_Paypal_Model_Config::AUTHORIZATION_AMOUNT_FULL) { - $this->_checkTransaction($transaction, $amount); - } - return $this; - } - - /** - * Capture payment - * - * @param Mage_Sales_Model_Order_Payment | Mage_Sales_Model_Quote_Payment $payment - * @param mixed $amount - * @return Mage_Paypal_Model_Payflowlink - */ - public function capture(Varien_Object $payment, $amount) - { - $removePaypalTransaction = false; - /** @var $transaction Mage_Paypal_Model_Payment_Transaction */ - $transaction = Mage::getModel('Mage_Paypal_Model_Payment_Transaction'); - $txnId = $payment->getAdditionalInformation('authorization_id'); - $transaction->loadByTxnId($txnId); - if ($transaction->getId()) { - $removePaypalTransaction = true; - $this->_authorize($payment, $amount, $transaction, $txnId); - - $this->_addTransaction($payment, $txnId); - - // Handle case when order is placed via 'Pay With PayPal' button of Payflowlink iFrame - if (!$payment->getAdditionalInformation('express_checkout_token')) { - $payment->setReferenceTransactionId($payment->getAdditionalInformation('authorization_id')); - } - } - - $payment->setParentTransactionId($txnId); - - $payment->setRequestAmount(round($amount,2)); - parent::capture($payment, $amount); - - if ($removePaypalTransaction) { - $transaction->delete(); - } - - return $this; - } - - /** - * Void payment - * - * @param Varien_Object $payment - * @return Mage_Paypal_Model_Payflowlink - */ - public function void(Varien_Object $payment) - { - /** @var $payment Mage_Sales_Model_Quote_Payment */ - if ($payment instanceof Mage_Sales_Model_Order_Payment) { - parent::void($payment); - $payment->addTransaction(Mage_Sales_Model_Order_Payment_Transaction::TYPE_VOID); - return $this; - } elseif ($payment instanceof Mage_Sales_Model_Quote_Payment) { - $this->setStore($payment->getQuote()->getStoreId()); - } else { - if ($payment->getStore()) { - $this->setStore($payment->getStore()); - } - } - - $request = $this->_buildBasicRequest($payment); - $request->setTrxtype(self::TRXTYPE_DELAYED_VOID); - - $request->setOrigid($payment->getTransactionId()); - $response = $this->_postRequest($request); - $this->_processErrors($response); - - return $this; } /** @@ -359,49 +176,63 @@ class Mage_Paypal_Model_Payflowlink extends Mage_Paypal_Model_Payflowpro $this->setResponseData($responseData); - $document = $this->_getDocumentFromResponse(); - if ($document) { - $this->_process($document); + if ($order = $this->_getOrderFromResponse()) { + $this->_processOrder($order); } } /** - * Operate with order or quote using information from silent post + * Operate with order using information from silent post * - * @param Varien_Object $document + * @param Mage_Sales_Model_Order $order */ - protected function _process(Varien_Object $document) + protected function _processOrder(Mage_Sales_Model_Order $order) { $response = $this->getResponse(); - $payment = $document->getPayment(); + $payment = $order->getPayment(); + $payment->setTransactionId($response->getPnref()) + ->setIsTransactionClosed(0); + $canSendNewOrderEmail = true; if ($response->getResult() == self::RESPONSE_CODE_FRAUDSERVICE_FILTER || $response->getResult() == self::RESPONSE_CODE_DECLINED_BY_FILTER ) { - $fraudMessage = $this->_getFraudMessage() ? $response->getFraudMessage() : $response->getRespmsg(); - $payment->setAdditionalInformation('paypal_fraud_filters', $fraudMessage); + $canSendNewOrderEmail = false; + $fraudMessage = $this->_getFraudMessage() ? + $response->getFraudMessage() : $response->getRespmsg(); + $payment->setIsTransactionPending(true) + ->setIsFraudDetected(true) + ->setAdditionalInformation('paypal_fraud_filters', $fraudMessage); } if ($response->getAvsdata() && strstr(substr($response->getAvsdata(), 0, 2), 'N')) { $payment->setAdditionalInformation('paypal_avs_code', substr($response->getAvsdata(), 0, 2)); } - if ($response->getCvv2match() && $response->getCvv2match() != 'Y') { $payment->setAdditionalInformation('paypal_cvv2_match', $response->getCvv2match()); } - $payment->setAdditionalInformation('authorization_id', $response->getPnref()); - - /** @var $transaction Mage_Paypal_Model_Payment_Transaction */ - $transaction = Mage::getModel('Mage_Paypal_Model_Payment_Transaction'); - $transaction->setTxnId($response->getPnref()); - - $transaction->setAdditionalInformation('amt', $response->getAmt()); - $transaction->setAdditionalInformation('store_id', $document->getStoreId()); + switch ($response->getType()){ + case self::TRXTYPE_AUTH_ONLY: + $payment->registerAuthorizationNotification($payment->getBaseAmountAuthorized()); + break; + case self::TRXTYPE_SALE: + $payment->registerCaptureNotification($payment->getBaseAmountAuthorized()); + break; + } + $order->save(); - $document->setIsChanged(1); - $document->save(); - $transaction->save(); + try { + if ($canSendNewOrderEmail) { + $order->sendNewOrderEmail(); + } + Mage::getModel('Mage_Sales_Model_Quote') + ->load($order->getQuoteId()) + ->setIsActive(false) + ->save(); + } catch (Exception $e) { + Mage::throwException(Mage::helper('Mage_Paypal_Helper_Data')->__('Can not send new order email.')); + } } /** @@ -420,58 +251,49 @@ class Mage_Paypal_Model_Payflowlink extends Mage_Paypal_Model_Payflowpro return false; } - /** - * Check Transaction - * - * @param Mage_Paypal_Model_Payment_Transaction $transaction - * @param mixed $amount - * @return Mage_Paypal_Model_Payflowlink - */ - protected function _checkTransaction($transaction, $amount) - { - if (!$transaction->getId()) { - Mage::throwException(Mage::helper('Mage_Paypal_Helper_Data')->__(self::SHOPPING_CART_CHANGED_ERROR_MSG)); - } - - $authorizedAmt = $transaction->getAdditionalInformation('amt'); - - if (!$authorizedAmt || $amount > $authorizedAmt) { - Mage::throwException(Mage::helper('Mage_Paypal_Helper_Data')->__(self::SHOPPING_CART_CHANGED_ERROR_MSG)); - } - return $this; - } - /** * Check response from Payflow gateway. * - * @return Mage_Sales_Model_Abstract in case of validation passed + * @return Mage_Sales_Model_Order in case of validation passed * @throws Mage_Core_Exception in other cases */ - protected function _getDocumentFromResponse() + protected function _getOrderFromResponse() { $response = $this->getResponse(); - $salesDocument = Mage::getModel('Mage_Sales_Model_Quote')->load($response->getPonum()); - $salesDocument->getPayment()->setMethod($this->_code); + $order = Mage::getModel('Mage_Sales_Model_Order') + ->loadByIncrementId($response->getInvnum()); - if ($this->_getSecureSilentPostHash($salesDocument->getPayment()) != $response->getUser2() - || $this->_code != $salesDocument->getPayment()->getMethodInstance()->getCode()) { + if ($this->_getSecureSilentPostHash($order->getPayment()) != $response->getUser2() + || $this->_code != $order->getPayment()->getMethodInstance()->getCode() + ) { return false; } - if ($response->getResult() != self::RESPONSE_CODE_FRAUDSERVICE_FILTER && - $response->getResult() != self::RESPONSE_CODE_DECLINED_BY_FILTER && - $response->getResult() != self::RESPONSE_CODE_APPROVED + if ($response->getResult() != self::RESPONSE_CODE_FRAUDSERVICE_FILTER + && $response->getResult() != self::RESPONSE_CODE_DECLINED_BY_FILTER + && $response->getResult() != self::RESPONSE_CODE_APPROVED ) { + if ($order->getState() != Mage_Sales_Model_Order::STATE_CANCELED) { + $order->registerCancellation($response->getRespmsg())->save(); + } Mage::throwException($response->getRespmsg()); } - $fetchData = $this->fetchTransactionInfo($salesDocument->getPayment(), $response->getPnref()); - if (!isset($fetchData['custref']) || $fetchData['custref'] != $salesDocument->getReservedOrderId()) { - Mage::throwException($this->_formatStr(self::RESPONSE_ERROR_MSG, 'Transaction error')); + $amountCompared = ($response->getAmt() == $order->getPayment()->getBaseAmountAuthorized()) ? true : false; + if (!$order->getId() + || $order->getState() != Mage_Sales_Model_Order::STATE_PENDING_PAYMENT + || !$amountCompared + ) { + Mage::throwException($this->_formatStr(self::RESPONSE_ERROR_MSG, 'Order')); + } + + $fetchData = $this->fetchTransactionInfo($order->getPayment(), $response->getPnref()); + if (!isset($fetchData['custref']) || $fetchData['custref'] != $order->getIncrementId()) { + Mage::throwException($this->_formatStr(self::RESPONSE_ERROR_MSG, 'Transaction')); } - return $salesDocument; + return $order; } /** @@ -480,42 +302,29 @@ class Mage_Paypal_Model_Payflowlink extends Mage_Paypal_Model_Payflowpro * @param Mage_Sales_Model_Order_Payment $payment * @return Varien_Object */ - protected function _buildTokenRequest(Varien_Object $payment, $amount) + protected function _buildTokenRequest(Mage_Sales_Model_Order_Payment $payment) { - $orderId = null; - $fullAmount = $payment->getAdditionalInformation('authorization_amount'); - - $salesDocument = $payment->getOrder(); - if (!$salesDocument) { - $salesDocument = $payment->getQuote(); - if (!$salesDocument->getReservedOrderId()) { - $salesDocument->reserveOrderId(); - } - $orderId = $salesDocument->getReservedOrderId(); - } else { - $orderId = $salesDocument->getIncrementId(); - } - $request = $this->_buildBasicRequest($payment); - if (empty($salesDocument)) { - return $request; - } - $request->setCreatesecuretoken('Y') ->setSecuretokenid($this->_generateSecureTokenId()) ->setTrxtype($this->_getTrxTokenType()) - ->setAmt($this->_formatStr('%.2F', $amount)) - ->setCurrency($salesDocument->getBaseCurrencyCode()) - ->setInvnum($orderId) - ->setCustref($orderId) - ->setPonum($salesDocument->getId()); - if ($fullAmount != Mage_Paypal_Model_Config::AUTHORIZATION_AMOUNT_FULL) { - $request->setSubtotal($this->_formatStr('%.2F', $salesDocument->getBaseSubtotal())) - ->setTaxamt($this->_formatStr('%.2F', $salesDocument->getBaseTaxAmount())) - ->setFreightamt($this->_formatStr('%.2F', $salesDocument->getBaseShippingAmount())); + ->setAmt($this->_formatStr('%.2F', $payment->getOrder()->getBaseTotalDue())) + ->setCurrency($payment->getOrder()->getBaseCurrencyCode()) + ->setInvnum($payment->getOrder()->getIncrementId()) + ->setCustref($payment->getOrder()->getIncrementId()) + ->setPonum($payment->getOrder()->getId()); + //This is PaPal issue with taxes and shipping + //->setSubtotal($this->_formatStr('%.2F', $payment->getOrder()->getBaseSubtotal())) + //->setTaxamt($this->_formatStr('%.2F', $payment->getOrder()->getBaseTaxAmount())) + //->setFreightamt($this->_formatStr('%.2F', $payment->getOrder()->getBaseShippingAmount())); + + + $order = $payment->getOrder(); + if (empty($order)) { + return $request; } - $billing = $salesDocument->getBillingAddress(); + $billing = $order->getBillingAddress(); if (!empty($billing)) { $request->setFirstname($billing->getFirstname()) ->setLastname($billing->getLastname()) @@ -524,9 +333,9 @@ class Mage_Paypal_Model_Payflowlink extends Mage_Paypal_Model_Payflowpro ->setState($billing->getRegionCode()) ->setZip($billing->getPostcode()) ->setCountry($billing->getCountry()) - ->setEmail($salesDocument->getCustomerEmail()); + ->setEmail($order->getCustomerEmail()); } - $shipping = $salesDocument->getShippingAddress(); + $shipping = $order->getShippingAddress(); if (!empty($shipping)) { $this->_applyCountryWorkarounds($shipping); $request->setShiptofirstname($shipping->getFirstname()) @@ -538,7 +347,7 @@ class Mage_Paypal_Model_Payflowlink extends Mage_Paypal_Model_Payflowpro ->setShiptocountry($shipping->getCountry()); } //pass store Id to request - $request->setUser1($salesDocument->getStoreId()) + $request->setUser1($order->getStoreId()) ->setUser2($this->_getSecureSilentPostHash($payment)); return $request; @@ -576,25 +385,6 @@ class Mage_Paypal_Model_Payflowlink extends Mage_Paypal_Model_Payflowpro ->setPwd($this->getConfigData('pwd', $this->_getStoreId())) ->setVerbosity($this->getConfigData('verbosity', $this->_getStoreId())) ->setTender(self::TENDER_CC); - if ($payment->getRequestAmount() > 0) { - $request->setAmt(round($payment->getRequestAmount(),2)); - } - return $request; - } - - /** - * Return request object with information for 'authorization' or 'sale' action - * - * @param Mage_Sales_Model_Order_Payment $payment - * @param float $amount - * @return Varien_Object - */ - protected function _buildPlaceRequest(Varien_Object $payment, $amount) - { - $request = $this->_buildBasicRequest($payment); - $request->setAmt(round($amount,2)); - $request->setCurrency($payment->getOrder()->getBaseCurrencyCode()); - return $request; } @@ -605,7 +395,12 @@ class Mage_Paypal_Model_Payflowlink extends Mage_Paypal_Model_Payflowpro */ protected function _getTrxTokenType() { - return self::TRXTYPE_AUTH_ONLY; + switch ($this->getConfigData('payment_action')) { + case Mage_Paypal_Model_Config::PAYMENT_ACTION_AUTH: + return self::TRXTYPE_AUTH_ONLY; + case Mage_Paypal_Model_Config::PAYMENT_ACTION_SALE: + return self::TRXTYPE_SALE; + } } /** @@ -640,9 +435,7 @@ class Mage_Paypal_Model_Payflowlink extends Mage_Paypal_Model_Payflowpro */ protected function _processTokenErrors($response, $payment) { - if ($response->getResult() == self::RESPONSE_CODE_INVALID_AMOUNT) { - throw new Mage_Paypal_Exception(Mage::helper('Mage_Paypal_Helper_Data')->__('Invalid Amount')); - } elseif (!$response->getSecuretoken() && + if (!$response->getSecuretoken() && $response->getResult() != self::RESPONSE_CODE_APPROVED && $response->getResult() != self::RESPONSE_CODE_FRAUDSERVICE_FILTER) { Mage::throwException($response->getRespmsg()); @@ -677,21 +470,88 @@ class Mage_Paypal_Model_Payflowlink extends Mage_Paypal_Model_Payflowpro } /** - * Set reference transaction data into request + * Add transaction with correct transaction Id + * + * @deprecated since 1.6.2.0 + * @param Varien_Object $payment + * @param string $txnId + * @return void + */ + protected function _addTransaction($payment, $txnId) + { + } + + /** + * Initialize request * + * @deprecated since 1.6.2.0 * @param Varien_Object $payment - * @param Varien_Object $request + * @param $amount * @return Mage_Paypal_Model_Payflowlink */ - protected function _setReferenceTransaction(Varien_Object $payment, $request) + protected function _initialize(Varien_Object $payment, $amount) { - if ($payment->getParentTransactionId()) { - $request->setOrigid($payment->getParentTransactionId()); + return $this; + } - $request->unsAcct(); - $request->unsExpdate(); - $request->unsCvv2(); - } + /** + * Check whether order review has enough data to initialize + * + * @deprecated since 1.6.2.0 + * @param $token + * @throws Mage_Core_Exception + */ + public function prepareOrderReview($token = null) + { + } + + /** + * Additional authorization logic for Account Verification + * + * @deprecated since 1.6.2.0 + * @param Varien_Object $payment + * @param mixed $amount + * @param Mage_Paypal_Model_Payment_Transaction $transaction + * @param string $txnId + * @return Mage_Paypal_Model_Payflowlink + */ + protected function _authorize(Varien_Object $payment, $amount, $transaction, $txnId) + { + return $this; + } + + /** + * Operate with order or quote using information from silent post + * + * @deprecated since 1.6.2.0 + * @param Varien_Object $document + */ + protected function _process(Varien_Object $document) + { + } + + /** + * Check Transaction + * + * @deprecated since 1.6.2.0 + * @param Mage_Paypal_Model_Payment_Transaction $transaction + * @param mixed $amount + * @return Mage_Paypal_Model_Payflowlink + */ + protected function _checkTransaction($transaction, $amount) + { return $this; } + + /** + * Check response from Payflow gateway. + * + * @deprecated since 1.6.2.0 + * @return Mage_Sales_Model_Abstract in case of validation passed + * @throws Mage_Core_Exception in other cases + */ + protected function _getDocumentFromResponse() + { + return null; + } } diff --git a/app/code/core/Mage/Paypal/Model/Payflowpro.php b/app/code/core/Mage/Paypal/Model/Payflowpro.php index bfd177d7364e7c8bff91ac09750f94524d3f5493..b8776356d6eee8272af8eb0b021ace0422ff3db6 100644 --- a/app/code/core/Mage/Paypal/Model/Payflowpro.php +++ b/app/code/core/Mage/Paypal/Model/Payflowpro.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Model/Payment/Transaction.php b/app/code/core/Mage/Paypal/Model/Payment/Transaction.php index 1d806ac227914ab1a540a92ec3352d8ca5ffc11e..2b9b985a1f35abb095c39d014a80c18d534ab13c 100644 --- a/app/code/core/Mage/Paypal/Model/Payment/Transaction.php +++ b/app/code/core/Mage/Paypal/Model/Payment/Transaction.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Model/Pro.php b/app/code/core/Mage/Paypal/Model/Pro.php index 4e8f70d99fce63dce0778bac57793894c9360d3b..062a9f04f543706eb8e9af61ab94a0e9b3ca724b 100644 --- a/app/code/core/Mage/Paypal/Model/Pro.php +++ b/app/code/core/Mage/Paypal/Model/Pro.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Model/Report/Settlement.php b/app/code/core/Mage/Paypal/Model/Report/Settlement.php index c008d10accfeb0f44c3eefe82bfcbe1a2f66ad19..49d4f5adf3f4cfaa742860c8d578ea053f6cc006 100644 --- a/app/code/core/Mage/Paypal/Model/Report/Settlement.php +++ b/app/code/core/Mage/Paypal/Model/Report/Settlement.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Model/Report/Settlement/Row.php b/app/code/core/Mage/Paypal/Model/Report/Settlement/Row.php index bcfa815d1bf73586fed78337066e11db70469691..87678dfd08343898fcf66e3a6044205e9b4fcc67 100644 --- a/app/code/core/Mage/Paypal/Model/Report/Settlement/Row.php +++ b/app/code/core/Mage/Paypal/Model/Report/Settlement/Row.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Model/Resource/Cert.php b/app/code/core/Mage/Paypal/Model/Resource/Cert.php index a24ed60384a9cc5b76d224fc32626be87df88223..dd7df39d763d8bad5b579fe3c7cc0be81d3a8af6 100644 --- a/app/code/core/Mage/Paypal/Model/Resource/Cert.php +++ b/app/code/core/Mage/Paypal/Model/Resource/Cert.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Model/Resource/Payment/Transaction.php b/app/code/core/Mage/Paypal/Model/Resource/Payment/Transaction.php index d0e9effb00962a276dad94e8ce9cc5c01d4ac17d..530451b73fb74ee095e30500542b26c28e57e61d 100644 --- a/app/code/core/Mage/Paypal/Model/Resource/Payment/Transaction.php +++ b/app/code/core/Mage/Paypal/Model/Resource/Payment/Transaction.php @@ -20,13 +20,14 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ /** * Paypal transaction resource model * + * @deprecated since 1.6.2.0 * @category Mage * @package Mage_Paypal * @author Magento Core Team <core@magentocommerce.com> diff --git a/app/code/core/Mage/Paypal/Model/Resource/Payment/Transaction/Collection.php b/app/code/core/Mage/Paypal/Model/Resource/Payment/Transaction/Collection.php index 8b9c86ef2118f965971b04f33b8906e4110d4f7f..61bf8cefbf621f2b51734fec6ed0cf27de7758dc 100644 --- a/app/code/core/Mage/Paypal/Model/Resource/Payment/Transaction/Collection.php +++ b/app/code/core/Mage/Paypal/Model/Resource/Payment/Transaction/Collection.php @@ -20,13 +20,14 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ /** * Payment transactions collection * + * @deprecated since 1.6.2.0 * @category Mage * @package Mage_Paypal * @author Magento Core Team <core@magentocommerce.com> diff --git a/app/code/core/Mage/Paypal/Model/Resource/Report/Settlement.php b/app/code/core/Mage/Paypal/Model/Resource/Report/Settlement.php index 7f8e24b716681ee8b28faddc5eab83573641638d..c37ef615d375d75f1f227eb1d6ce043d67c18382 100755 --- a/app/code/core/Mage/Paypal/Model/Resource/Report/Settlement.php +++ b/app/code/core/Mage/Paypal/Model/Resource/Report/Settlement.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Model/Resource/Report/Settlement/Row.php b/app/code/core/Mage/Paypal/Model/Resource/Report/Settlement/Row.php index f9583eeea0830ba545e457058d60a33664fca6db..f15f919c5dd428dc0e2b11bc98753a085932e626 100755 --- a/app/code/core/Mage/Paypal/Model/Resource/Report/Settlement/Row.php +++ b/app/code/core/Mage/Paypal/Model/Resource/Report/Settlement/Row.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Model/Resource/Report/Settlement/Row/Collection.php b/app/code/core/Mage/Paypal/Model/Resource/Report/Settlement/Row/Collection.php index 234213bb99cde612e83ed47df97dc4c2ef853d27..0b1f8dc6c5a719b4e0750bae66e3891f2ac4bef1 100755 --- a/app/code/core/Mage/Paypal/Model/Resource/Report/Settlement/Row/Collection.php +++ b/app/code/core/Mage/Paypal/Model/Resource/Report/Settlement/Row/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Model/Resource/Setup.php b/app/code/core/Mage/Paypal/Model/Resource/Setup.php index 861cac4263b1623f1fd91f63b4d8bfaff9aa0df1..c9b945e2ac6dab73f3ffa9add6bd2d3b53c8c249 100755 --- a/app/code/core/Mage/Paypal/Model/Resource/Setup.php +++ b/app/code/core/Mage/Paypal/Model/Resource/Setup.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Model/Session.php b/app/code/core/Mage/Paypal/Model/Session.php index 8c7e72778309526872f4a75c63c9ea2528e430d5..e762fd3e0a6fc73399b0e8cf0ebdb8ecf487ec88 100644 --- a/app/code/core/Mage/Paypal/Model/Session.php +++ b/app/code/core/Mage/Paypal/Model/Session.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Model/Standard.php b/app/code/core/Mage/Paypal/Model/Standard.php index 54c4ed4c40a0644a3927691083faf93b127c43f8..f69f389bc243157d08fe037dd9d36ccd85c16098 100644 --- a/app/code/core/Mage/Paypal/Model/Standard.php +++ b/app/code/core/Mage/Paypal/Model/Standard.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Model/System/Config/Backend/Cert.php b/app/code/core/Mage/Paypal/Model/System/Config/Backend/Cert.php index beb4206ea07c76d4ad1940071ee12cc3572c105a..5b5dd0cdae9170db7e22bf845d69f71cabf3ede2 100644 --- a/app/code/core/Mage/Paypal/Model/System/Config/Backend/Cert.php +++ b/app/code/core/Mage/Paypal/Model/System/Config/Backend/Cert.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Model/System/Config/Backend/Cron.php b/app/code/core/Mage/Paypal/Model/System/Config/Backend/Cron.php index 36490595bdc3e7f53f0800b531f534be3e16cc46..532fe4931b79edf36949094c3dca81815e4a9c5f 100644 --- a/app/code/core/Mage/Paypal/Model/System/Config/Backend/Cron.php +++ b/app/code/core/Mage/Paypal/Model/System/Config/Backend/Cron.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Model/System/Config/Backend/MerchantCountry.php b/app/code/core/Mage/Paypal/Model/System/Config/Backend/MerchantCountry.php index 9a33e743a76c9bddbe64d59bcbd2eb3a0bd42d05..442410179d2b94e42e23572cd74ea436186541e1 100644 --- a/app/code/core/Mage/Paypal/Model/System/Config/Backend/MerchantCountry.php +++ b/app/code/core/Mage/Paypal/Model/System/Config/Backend/MerchantCountry.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Model/System/Config/Source/AuthorizationAmounts.php b/app/code/core/Mage/Paypal/Model/System/Config/Source/AuthorizationAmounts.php index 0aa5e8635f5f2fe58b3719857f6123bb6c3cd271..5b45191acecf1b33d1f9670143bf04aa4c6802a5 100644 --- a/app/code/core/Mage/Paypal/Model/System/Config/Source/AuthorizationAmounts.php +++ b/app/code/core/Mage/Paypal/Model/System/Config/Source/AuthorizationAmounts.php @@ -20,12 +20,17 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ /** * Source model for available Authorization Amounts for Account Verification + * + * @deprecated since 1.6.2.0 + * @category Mage + * @package Mage_Paypal + * @author Magento Core Team <core@magentocommerce.com> */ class Mage_Paypal_Model_System_Config_Source_AuthorizationAmounts { @@ -36,8 +41,6 @@ class Mage_Paypal_Model_System_Config_Source_AuthorizationAmounts */ public function toOptionArray() { - /** @var $configModel Mage_Paypal_Model_Config */ - $configModel = Mage::getModel('Mage_Paypal_Model_Config'); - return $configModel->getAuthorizationAmounts(); + return array(); } } diff --git a/app/code/core/Mage/Paypal/Model/System/Config/Source/BuyerCountry.php b/app/code/core/Mage/Paypal/Model/System/Config/Source/BuyerCountry.php index e6d1e4b79754d1103ec1ad89a4b3520662fdde5c..52ed48a9a8315e878c68848543d2d377c3fe5757 100644 --- a/app/code/core/Mage/Paypal/Model/System/Config/Source/BuyerCountry.php +++ b/app/code/core/Mage/Paypal/Model/System/Config/Source/BuyerCountry.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Model/System/Config/Source/FetchingSchedule.php b/app/code/core/Mage/Paypal/Model/System/Config/Source/FetchingSchedule.php index 91869a062eb23974ddcfe050fb34fc29a794aecc..a7bc2607d207ee896f559dbeac1e5177766e6690 100644 --- a/app/code/core/Mage/Paypal/Model/System/Config/Source/FetchingSchedule.php +++ b/app/code/core/Mage/Paypal/Model/System/Config/Source/FetchingSchedule.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Model/System/Config/Source/Logo.php b/app/code/core/Mage/Paypal/Model/System/Config/Source/Logo.php index 0f2b640471b68d358254aab64e095990dc76e12a..e4217ab8727a750317c21e3f0997d7b37748f329 100644 --- a/app/code/core/Mage/Paypal/Model/System/Config/Source/Logo.php +++ b/app/code/core/Mage/Paypal/Model/System/Config/Source/Logo.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Model/System/Config/Source/MerchantCountry.php b/app/code/core/Mage/Paypal/Model/System/Config/Source/MerchantCountry.php index bf688eb5641910095d43f86a6db61f54a8bfa9ef..0a203f98e3273b549ac24d1ef6f1450fa6e78aec 100644 --- a/app/code/core/Mage/Paypal/Model/System/Config/Source/MerchantCountry.php +++ b/app/code/core/Mage/Paypal/Model/System/Config/Source/MerchantCountry.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Model/System/Config/Source/PaymentActions.php b/app/code/core/Mage/Paypal/Model/System/Config/Source/PaymentActions.php index d51bcd39de0c021d08f180d23e0a3924aee90039..e421a3540ea5f0cd755471f10d5c22079102658f 100644 --- a/app/code/core/Mage/Paypal/Model/System/Config/Source/PaymentActions.php +++ b/app/code/core/Mage/Paypal/Model/System/Config/Source/PaymentActions.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/Model/System/Config/Source/PaymentActions/Express.php b/app/code/core/Mage/Paypal/Model/System/Config/Source/PaymentActions/Express.php index ba1fa0d8dd80d7ddcaa663e97dd31db461b7386c..41729f3c20033c1dba01ef3ed60d65571d24144c 100644 --- a/app/code/core/Mage/Paypal/Model/System/Config/Source/PaymentActions/Express.php +++ b/app/code/core/Mage/Paypal/Model/System/Config/Source/PaymentActions/Express.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/controllers/Adminhtml/Paypal/ReportsController.php b/app/code/core/Mage/Paypal/controllers/Adminhtml/Paypal/ReportsController.php index c9fb5112d1dad78843df68be5cb3aba8b2151bc9..734af430bf5f11522bc4188445f095b050908b6c 100644 --- a/app/code/core/Mage/Paypal/controllers/Adminhtml/Paypal/ReportsController.php +++ b/app/code/core/Mage/Paypal/controllers/Adminhtml/Paypal/ReportsController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/controllers/ExpressController.php b/app/code/core/Mage/Paypal/controllers/ExpressController.php index 87c64bf74ca4003bba4369175f481d61a803d1fa..0f940ddb5f3a386b3d30202bfc41c9b2129b20cb 100644 --- a/app/code/core/Mage/Paypal/controllers/ExpressController.php +++ b/app/code/core/Mage/Paypal/controllers/ExpressController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/controllers/HostedproController.php b/app/code/core/Mage/Paypal/controllers/HostedproController.php index 61495fa3a33270d2610d041dcf565b7c6ee89436..d9f366c57fcb74daae064a1ba619de1d9a78ca0f 100644 --- a/app/code/core/Mage/Paypal/controllers/HostedproController.php +++ b/app/code/core/Mage/Paypal/controllers/HostedproController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/controllers/IpnController.php b/app/code/core/Mage/Paypal/controllers/IpnController.php index 29fc18d77d0ff119728522e330f975f1414aeb15..5acb4667cb25afda19a5c4db471e8a72fdcaabfa 100644 --- a/app/code/core/Mage/Paypal/controllers/IpnController.php +++ b/app/code/core/Mage/Paypal/controllers/IpnController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/controllers/PayflowController.php b/app/code/core/Mage/Paypal/controllers/PayflowController.php index 9b78d7e92a9f6d89888c46bc6b3cfba9f62185a5..4083f236dab6423c6411cca00c01fcb8a95f6ce1 100644 --- a/app/code/core/Mage/Paypal/controllers/PayflowController.php +++ b/app/code/core/Mage/Paypal/controllers/PayflowController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -31,29 +31,8 @@ * @package Mage_Paypal * @author Magento Core Team <core@magentocommerce.com> */ -class Mage_Paypal_PayflowController extends Mage_Paypal_Controller_Express_Abstract +class Mage_Paypal_PayflowController extends Mage_Core_Controller_Front_Action { - /** - * Config mode type - * - * @var string - */ - protected $_configType = 'Mage_Paypal_Model_Config'; - - /** - * Config method type - * - * @var string - */ - protected $_configMethod = Mage_Paypal_Model_Config::METHOD_PAYFLOWLINK; - - /** - * Checkout mode type - * - * @var string - */ - protected $_checkoutType = 'paypal/payflowlink'; - /** * When a customer cancel payment from payflow gateway. */ @@ -71,43 +50,56 @@ class Mage_Paypal_PayflowController extends Mage_Paypal_Controller_Express_Abstr */ public function returnUrlAction() { - $errorMsg = ''; - $session = $this->_getCheckout(); $quote = $session->getQuote(); - /** @var $payment Mage_Sales_Model_Quote_Payment */ - $payment = $quote->getPayment(); - $gotoSection = 'payment'; - if ($payment->getAdditionalInformation('authorization_id')) { - $gotoSection = 'review'; - } else { - $gotoSection = 'payment'; - $errorMsg = $this->__('Payment has been declined. Please try again.'); - } + $redirectBlock = $this->_getIframeBlock() + ->setTemplate('paypal/payflowlink/redirect.phtml'); - $checkToken = $this->getRequest()->getParam('TOKEN'); - if ($checkToken) { - $payment->setAdditionalInformation('express_checkout_token', $checkToken)->save(); - Mage::getSingleton('Mage_Paypal_Model_Session')->setExpressCheckoutToken($checkToken); - $this->_redirect('*/*/review'); - return; - } + $session = $this->_getCheckout(); + if ($session->getLastRealOrderId()) { + $order = Mage::getModel('Mage_Sales_Model_Order')->loadByIncrementId($session->getLastRealOrderId()); - $redirectBlock = $this->_getIframeBlock() - ->setTemplate('payflowlink/redirect.phtml'); + if ($order && $order->getIncrementId() == $session->getLastRealOrderId()) { + $allowedOrderStates = array( + Mage_Sales_Model_Order::STATE_PROCESSING, + Mage_Sales_Model_Order::STATE_COMPLETE + ); + if (in_array($order->getState(), $allowedOrderStates)) { + $session->unsLastRealOrderId(); + $redirectBlock->setGotoSuccessPage(true); + } else { + $gotoSection = $this->_cancelPayment(strval($this->getRequest()->getParam('RESPMSG'))); + $redirectBlock->setGotoSection($gotoSection); + $redirectBlock->setErrorMsg($this->__('Payment has been declined. Please try again.')); + } + } + } - $redirectBlock->setErrorMsg($errorMsg); - $redirectBlock->setGotoSection($gotoSection); $this->getResponse()->setBody($redirectBlock->toHtml()); } /** - * When a customer return to website from payflow gateway. + * Submit transaction to Payflow getaway into iframe */ - public function placeOrderAction() + public function formAction() { - $session = $this->_getCheckout(); - $quote = $session->getQuote(); - $quote->collectTotals(); - $this->_forward('saveOrder', 'onepage', 'checkout'); + $this->getResponse() + ->setBody($this->_getIframeBlock()->toHtml()); + } + + /** + * Get response from PayPal by silent post method + */ + public function silentPostAction() + { + $data = $this->getRequest()->getPost(); + if (isset($data['INVNUM'])) { + /** @var $paymentModel Mage_Paypal_Model_Payflowlink */ + $paymentModel = Mage::getModel('Mage_Paypal_Model_Payflowlink'); + try { + $paymentModel->process($data); + } catch (Exception $e) { + Mage::logException($e); + } + } } /** @@ -146,55 +138,6 @@ class Mage_Paypal_PayflowController extends Mage_Paypal_Controller_Express_Abstr return $gotoSection; } - /** - * Submit transaction to Payflow getaway into iframe - */ - public function formAction() - { - $quote = $this->_getCheckout()->getQuote(); - $payment = $quote->getPayment(); - - try { - $method = Mage::helper('Mage_Payment_Helper_Data') - ->getMethodInstance(Mage_Paypal_Model_Config::METHOD_PAYFLOWLINK); - $method->setData('info_instance', $payment); - $method->initialize($method->getConfigData('payment_action'), new Varien_Object()); - - $quote->save(); - } catch (Mage_Core_Exception $e) { - $this->loadLayout('paypal_payflow_link_iframe'); - - $block = $this->getLayout()->getBlock('payflow.link.info'); - $block->setErrorMessage($e->getMessage()); - - $this->getResponse()->setBody( - $block->toHtml() - ); - return; - } catch (Exception $e) { - Mage::logException($e); - } - $this->getResponse() - ->setBody($this->_getIframeBlock()->toHtml()); - } - - /** - * Get response from PayPal by silent post method - */ - public function silentPostAction() - { - $data = $this->getRequest()->getPost(); - if (isset($data['INVNUM'])) { - /** @var $paymentModel Mage_Paypal_Model_Payflowlink */ - $paymentModel = Mage::getModel('Mage_Paypal_Model_Payflowlink'); - try { - $paymentModel->process($data); - } catch (Exception $e) { - Mage::logException($e); - } - } - } - /** * Get frontend checkout session object * @@ -216,4 +159,4 @@ class Mage_Paypal_PayflowController extends Mage_Paypal_Controller_Express_Abstr return $this->getLayout() ->getBlock('payflow.link.iframe'); } -} \ No newline at end of file +} diff --git a/app/code/core/Mage/Paypal/controllers/PayflowadvancedController.php b/app/code/core/Mage/Paypal/controllers/PayflowadvancedController.php index d1b7d255d86906f04c1fc89096e941c0312237ba..9b129006d6264b0254707d09ef6f79fbecafbd79 100644 --- a/app/code/core/Mage/Paypal/controllers/PayflowadvancedController.php +++ b/app/code/core/Mage/Paypal/controllers/PayflowadvancedController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -33,27 +33,6 @@ */ class Mage_Paypal_PayflowadvancedController extends Mage_Paypal_Controller_Express_Abstract { - /** - * Config mode type - * - * @var string - */ - protected $_configType = 'paypal/config'; - - /** - * Config method type - * - * @var string - */ - protected $_configMethod = Mage_Paypal_Model_Config::METHOD_PAYFLOWADVANCED; - - /** - * Checkout mode type - * - * @var string - */ - protected $_checkoutType = 'paypal/payflowadvanced'; - /** * When a customer cancel payment from payflow gateway. * @@ -75,46 +54,60 @@ class Mage_Paypal_PayflowadvancedController extends Mage_Paypal_Controller_Expre */ public function returnUrlAction() { - $errorMsg = ''; + $redirectBlock = $this->_getIframeBlock() + ->setTemplate('paypal/payflowadvanced/redirect.phtml'); + $session = $this->_getCheckout(); - $quote = $session->getQuote(); - /** @var $payment Mage_Sales_Model_Quote_Payment */ - $payment = $quote->getPayment(); - $gotoSection = 'payment'; - if ($payment->getAdditionalInformation('authorization_id')) { - $gotoSection = 'review'; - } else { - $gotoSection = 'payment'; - $errorMsg = $this->__('Payment has been declined. Please try again.'); - } + if ($session->getLastRealOrderId()) { + $order = Mage::getModel('Mage_Sales_Model_Order')->loadByIncrementId($session->getLastRealOrderId()); - $checkToken = $this->getRequest()->getParam('TOKEN'); - if ($checkToken) { - $payment->setAdditionalInformation('express_checkout_token', $checkToken)->save(); - Mage::getSingleton('Mage_Paypal_Model_Session')->setExpressCheckoutToken($checkToken); - $this->_redirect('*/*/review'); - return; + if ($order && $order->getIncrementId() == $session->getLastRealOrderId()) { + $allowedOrderStates = array( + Mage_Sales_Model_Order::STATE_PROCESSING, + Mage_Sales_Model_Order::STATE_COMPLETE + ); + if (in_array($order->getState(), $allowedOrderStates)) { + $session->unsLastRealOrderId(); + $redirectBlock->setGotoSuccessPage(true); + } else { + $gotoSection = $this->_cancelPayment(strval($this->getRequest()->getParam('RESPMSG'))); + $redirectBlock->setGotoSection($gotoSection); + $redirectBlock->setErrorMsg($this->__('Payment has been declined. Please try again.')); + } + } } - $redirectBlock = $this->_getIframeBlock() - ->setTemplate('payflowadvanced/redirect.phtml'); - - $redirectBlock->setErrorMsg($errorMsg); - $redirectBlock->setGotoSection($gotoSection); $this->getResponse()->setBody($redirectBlock->toHtml()); } /** - * When a customer return to website from payflow gateway. + * Submit transaction to Payflow getaway into iframe * * @return void */ - public function placeOrderAction() + public function formAction() { - $session = $this->_getCheckout(); - $quote = $session->getQuote(); - $quote->collectTotals(); - $this->_forward('saveOrder', 'onepage', 'checkout'); + $this->getResponse() + ->setBody($this->_getIframeBlock()->toHtml()); + } + + /** + * Get response from PayPal by silent post method + * + * @return void + */ + public function silentPostAction() + { + $data = $this->getRequest()->getPost(); + if (isset($data['INVNUM'])) { + /** @var $paymentModel Mage_Paypal_Model_Payflowadvanced */ + $paymentModel = Mage::getModel('Mage_Paypal_Model_Payflowadvanced'); + try { + $paymentModel->process($data); + } catch (Exception $e) { + Mage::logException($e); + } + } } /** @@ -153,58 +146,6 @@ class Mage_Paypal_PayflowadvancedController extends Mage_Paypal_Controller_Expre return $gotoSection; } - /** - * Submit transaction to Payflow getaway into iframe - * - * @return void - */ - public function formAction() - { - $quote = $this->_getCheckout()->getQuote(); - $payment = $quote->getPayment(); - - try { - $method = Mage::helper('Mage_Payment_Helper_Data')->getMethodInstance($this->_configMethod); - $method->setData('info_instance', $payment); - $method->initialize($method->getConfigData('payment_action'), new Varien_Object()); - - $quote->save(); - } catch (Mage_Core_Exception $e) { - $this->loadLayout('paypal_payflow_advanced_iframe'); - - $block = $this->getLayout()->getBlock('payflow.advanced.info'); - $block->setErrorMessage($e->getMessage()); - - $this->getResponse()->setBody( - $block->toHtml() - ); - return; - } catch (Exception $e) { - Mage::logException($e); - } - $this->getResponse() - ->setBody($this->_getIframeBlock()->toHtml()); - } - - /** - * Get response from PayPal by silent post method - * - * @return void - */ - public function silentPostAction() - { - $data = $this->getRequest()->getPost(); - if (isset($data['INVNUM'])) { - /** @var $paymentModel Mage_Paypal_Model_Payflowadvanced */ - $paymentModel = Mage::getModel('Mage_Paypal_Model_Payflowadvanced'); - try { - $paymentModel->process($data); - } catch (Exception $e) { - Mage::logException($e); - } - } - } - /** * Get frontend checkout session object * @@ -226,4 +167,4 @@ class Mage_Paypal_PayflowadvancedController extends Mage_Paypal_Controller_Expre return $this->getLayout() ->getBlock('payflow.advanced.iframe'); } -} \ No newline at end of file +} diff --git a/app/code/core/Mage/Paypal/controllers/StandardController.php b/app/code/core/Mage/Paypal/controllers/StandardController.php index 084b9dbba56cb22e8c74ec2a9a5809b55141724f..2a3d13e21df900a6cc223e95ca5d677f11c521ed 100644 --- a/app/code/core/Mage/Paypal/controllers/StandardController.php +++ b/app/code/core/Mage/Paypal/controllers/StandardController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/etc/adminhtml.xml b/app/code/core/Mage/Paypal/etc/adminhtml.xml index fb57830a40e22517ed60ae53b4d7d2f531ae17a4..d5b67ed94ae0c5a8ad66da57d7d82bc9eaa2e781 100644 --- a/app/code/core/Mage/Paypal/etc/adminhtml.xml +++ b/app/code/core/Mage/Paypal/etc/adminhtml.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Paypal/etc/config.xml b/app/code/core/Mage/Paypal/etc/config.xml index 32346c13286cc4afd02db894dae5a69089cf3305..92c4afa0530a8f3c876de685d1785fd7e58b76f8 100644 --- a/app/code/core/Mage/Paypal/etc/config.xml +++ b/app/code/core/Mage/Paypal/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> @@ -261,14 +261,6 @@ <model>Mage_Paypal_Model_Observer::fetchReports</model> </run> </paypal_fetch_settlement_reports> - <paypal_payment_transaction_clean> - <schedule> - <cron_expr>*/15 * * * *</cron_expr> - </schedule> - <run> - <model>Mage_Paypal_Model_Observer::cleanTransactions</model> - </run> - </paypal_payment_transaction_clean> </jobs> </crontab> <admin> diff --git a/app/code/core/Mage/Paypal/etc/system.xml b/app/code/core/Mage/Paypal/etc/system.xml index 28ef8ee1e9e6c68223b6b71738f114ec3a64ecdd..00b1abf1693f9d65ed44da9649cebb052a330c80 100644 --- a/app/code/core/Mage/Paypal/etc/system.xml +++ b/app/code/core/Mage/Paypal/etc/system.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> @@ -382,6 +382,7 @@ <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> <show_in_store>1</show_in_store> + <frontend_class>validate-number</frontend_class> </sort_order> <payment_action translate="label"> <label>Payment Action</label> @@ -557,6 +558,7 @@ <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> <show_in_store>1</show_in_store> + <frontend_class>validate-number</frontend_class> </sort_order> <payment_action translate="label"> <label>Payment Action</label> @@ -654,6 +656,7 @@ <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> <show_in_store>1</show_in_store> + <frontend_class>validate-number</frontend_class> </sort_order> <payment_action translate="label"> <label>Payment Action</label> @@ -803,6 +806,7 @@ <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> <show_in_store>1</show_in_store> + <frontend_class>validate-number</frontend_class> </sort_order> <payment_action translate="label"> <label>Payment Action</label> @@ -890,6 +894,7 @@ <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> <show_in_store>1</show_in_store> + <frontend_class>validate-number</frontend_class> </sort_order> <payment_action translate="label"> <label>Payment Action</label> @@ -1107,6 +1112,7 @@ <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> <show_in_store>1</show_in_store> + <frontend_class>validate-number</frontend_class> </sort_order> <payment_action translate="label"> <label>Payment Action</label> @@ -1313,6 +1319,7 @@ <sort_order>10</sort_order> <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> + <frontend_class>validate-number</frontend_class> </sort_order> <payment_action translate="label"> <label>Payment Action</label> @@ -1589,6 +1596,7 @@ <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> <show_in_store>1</show_in_store> + <frontend_class>validate-number</frontend_class> </sort_order> <payment_action translate="label"> <label>Payment Action</label> @@ -1599,16 +1607,6 @@ <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> </payment_action> - <authorization_amount translate="label"> - <label>Verification Authorization Amount</label> - <comment><![CDATA[<a id="PayFlowLinkLearnMore" href="#">Learn More</a>]]></comment> - <config_path>payment/payflow_link/authorization_amount</config_path> - <frontend_type>select</frontend_type> - <source_model>Mage_Paypal_Model_System_Config_Source_AuthorizationAmounts</source_model> - <sort_order>15</sort_order> - <show_in_default>1</show_in_default> - <show_in_website>1</show_in_website> - </authorization_amount> <allowspecific translate="label"> <label>Payment Applicable From</label> <config_path>payment/payflow_link/allowspecific</config_path> @@ -1718,7 +1716,7 @@ </payflow_link> <payflow_advanced translate="label"> - <label>PayPal Paymets Advanced</label> + <label>PayPal Payments Advanced</label> <frontend_type>text</frontend_type> <sort_order>90</sort_order> <show_in_default>1</show_in_default> @@ -1750,6 +1748,7 @@ <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> <show_in_store>1</show_in_store> + <frontend_class>validate-number</frontend_class> </sort_order> <payment_action translate="label"> <label>Payment Action</label> @@ -1894,6 +1893,7 @@ <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> <show_in_store>1</show_in_store> + <frontend_class>validate-number</frontend_class> </sort_order> <payment_action translate="label"> <label>Payment Action</label> diff --git a/app/code/core/Mage/Paypal/sql/paypal_setup/install-1.6.0.0.php b/app/code/core/Mage/Paypal/sql/paypal_setup/install-1.6.0.0.php index 7d9607b479d54ee14923afe1632bc57a653aaa8e..a48575c1e6c64c010eb68059d26b3e713f25b48f 100644 --- a/app/code/core/Mage/Paypal/sql/paypal_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/Paypal/sql/paypal_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/sql/paypal_setup/upgrade-1.6.0.0-1.6.0.1.php b/app/code/core/Mage/Paypal/sql/paypal_setup/upgrade-1.6.0.0-1.6.0.1.php index 2b365d61da1ef404ecbf66c4ef31d3c5cad470e8..2a72d3e38090140b20e679b65fc4d398efda6e21 100644 --- a/app/code/core/Mage/Paypal/sql/paypal_setup/upgrade-1.6.0.0-1.6.0.1.php +++ b/app/code/core/Mage/Paypal/sql/paypal_setup/upgrade-1.6.0.0-1.6.0.1.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/sql/paypal_setup/upgrade-1.6.0.1-1.6.0.2.php b/app/code/core/Mage/Paypal/sql/paypal_setup/upgrade-1.6.0.1-1.6.0.2.php index cd2d420d4cfd8ace677d6a4a641512bff5dc1168..7533b8807698e882280e2a84a4eeffb46a7065a3 100644 --- a/app/code/core/Mage/Paypal/sql/paypal_setup/upgrade-1.6.0.1-1.6.0.2.php +++ b/app/code/core/Mage/Paypal/sql/paypal_setup/upgrade-1.6.0.1-1.6.0.2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Paypal - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Paypal/view/adminhtml/boxes.css b/app/code/core/Mage/Paypal/view/adminhtml/boxes.css index a5e78a00653c563809290d46e429639f4e132107..7c13c60dd3fb8143831afc1efe4933125c8f5e34 100644 --- a/app/code/core/Mage/Paypal/view/adminhtml/boxes.css +++ b/app/code/core/Mage/Paypal/view/adminhtml/boxes.css @@ -19,7 +19,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ .paypal-payment-notice { background:url(logo.gif) no-repeat 5px center #eaf0ee; border:1px solid #ccc; margin-bottom:10px; padding:10px 5px 5px 115px; } diff --git a/app/code/core/Mage/Paypal/view/adminhtml/layout.xml b/app/code/core/Mage/Paypal/view/adminhtml/layout.xml index 0f6bc806c9a6a1d4bbcb2ec8de2f315fc8818cc9..436b356085ab12f15453a089cfc5a0868854cc22 100644 --- a/app/code/core/Mage/Paypal/view/adminhtml/layout.xml +++ b/app/code/core/Mage/Paypal/view/adminhtml/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/Paypal/view/adminhtml/system/config/api_wizard.phtml b/app/code/core/Mage/Paypal/view/adminhtml/system/config/api_wizard.phtml index 292c3a0bb4e0a72fa7c152db685026c7bd51249d..57f79cc3c2afadf4a307d828659b1eb7d2b8b85a 100644 --- a/app/code/core/Mage/Paypal/view/adminhtml/system/config/api_wizard.phtml +++ b/app/code/core/Mage/Paypal/view/adminhtml/system/config/api_wizard.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -33,12 +33,12 @@ <tr> <td> <button style="" onclick="javascript:window.open('<?php echo $this->getButtonUrl()?>', 'apiwizard','toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, ,left=100, top=100, width=380, height=470'); return false;" class="scalable" type="button" id="<?php echo $this->getHtmlId() ?>"> - <span><?php echo $this->escapeHtml($this->getButtonLabel()); ?></span> + <span><span><span><?php echo $this->escapeHtml($this->getButtonLabel()); ?></span></span></span> </button> </td> <td> <button style="" onclick="javascript:window.open('<?php echo $this->getSandboxButtonUrl()?>', 'apiwizard','toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, ,left=100, top=100, width=380, height=470'); return false;" class="scalable" type="button" id="<?php echo $this->getSandboxHtmlId() ?>"> - <span><?php echo $this->escapeHtml($this->getSandboxButtonLabel()); ?></span> + <span><span><span><?php echo $this->escapeHtml($this->getSandboxButtonLabel()); ?></span></span></span> </button> </td> </tr> diff --git a/app/code/core/Mage/Paypal/view/adminhtml/system/config/fieldset/global.phtml b/app/code/core/Mage/Paypal/view/adminhtml/system/config/fieldset/global.phtml index 4be6da726799c4197bea21c998e168b3371ba70d..e72622c8e2b435fe4c39d8e31c8898c783c49926 100644 --- a/app/code/core/Mage/Paypal/view/adminhtml/system/config/fieldset/global.phtml +++ b/app/code/core/Mage/Paypal/view/adminhtml/system/config/fieldset/global.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Paypal/view/adminhtml/system/config/fieldset/hint.phtml b/app/code/core/Mage/Paypal/view/adminhtml/system/config/fieldset/hint.phtml index 0d24af45e6fdb162f27bc8148fc2cb343c8bb7d4..fedcd1064b3fcf94e8d39e41d2973bafdda202b6 100644 --- a/app/code/core/Mage/Paypal/view/adminhtml/system/config/fieldset/hint.phtml +++ b/app/code/core/Mage/Paypal/view/adminhtml/system/config/fieldset/hint.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Paypal/view/adminhtml/system/config/fieldset/store.phtml b/app/code/core/Mage/Paypal/view/adminhtml/system/config/fieldset/store.phtml index 5c770061ea7c37098264c37b04f0644d58923f19..4633bfde60d732768e4e2aa7a1cb8d5fb55ce852 100644 --- a/app/code/core/Mage/Paypal/view/adminhtml/system/config/fieldset/store.phtml +++ b/app/code/core/Mage/Paypal/view/adminhtml/system/config/fieldset/store.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Paypal/view/adminhtml/system/config/payflowlink/advanced.phtml b/app/code/core/Mage/Paypal/view/adminhtml/system/config/payflowlink/advanced.phtml index a4b1332450de2e55aa6447e0bebeaa895eb4dcb1..da0c3df77f6811ed882f7cb0837a5f62b72c4da6 100644 --- a/app/code/core/Mage/Paypal/view/adminhtml/system/config/payflowlink/advanced.phtml +++ b/app/code/core/Mage/Paypal/view/adminhtml/system/config/payflowlink/advanced.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ @@ -44,6 +44,12 @@ <li> Under Display <span style="text-decoration: underline">Options on Payment Page</span>, enter the following: <ul style="list-style:lower-roman;padding:0 2em;"> + <li> + <span style="text-decoration: underline">Cancel URL</span>:<br /> + <a href="<?php echo $this->getFrontendUrl('paypal/payflowadvanced/cancelPayment') ?>" onclick="return false;"> + <?php echo $this->getFrontendUrl('paypal/payflowadvanced/cancelPayment') ?> + </a> + </li> <li> <span style="text-decoration: underline">Error URL</span>:<br /> <a href="<?php echo $this->getFrontendUrl('paypal/payflowadvanced/returnUrl') ?>" onclick="return false;"> diff --git a/app/code/core/Mage/Paypal/view/adminhtml/system/config/payflowlink/info.phtml b/app/code/core/Mage/Paypal/view/adminhtml/system/config/payflowlink/info.phtml index 258d36f633c44df1b17cbd0869f8c5c96593ad58..2e3a0574f27a06da688facb4f137f47fcccbcded 100644 --- a/app/code/core/Mage/Paypal/view/adminhtml/system/config/payflowlink/info.phtml +++ b/app/code/core/Mage/Paypal/view/adminhtml/system/config/payflowlink/info.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -45,6 +45,12 @@ <li> Under Display <span style="text-decoration: underline">Options on Payment Page</span>, enter the following: <ul style="list-style:lower-roman;padding:0 2em;"> + <li> + <span style="text-decoration: underline">Cancel URL</span>:<br /> + <a href="<?php echo $this->getFrontendUrl('paypal/payflow/cancelPayment') ?>" onclick="return false;"> + <?php echo $this->getFrontendUrl('paypal/payflow/cancelPayment') ?> + </a> + </li> <li> <span style="text-decoration: underline">Error URL</span>:<br /> <a href="<?php echo $this->getFrontendUrl('paypal/payflow/returnUrl') ?>" onclick="return false;"> @@ -95,27 +101,3 @@ </ul> </div> </div> -<div id="PayFlowLinkLearnMoreText" style="display:none"> - <?php echo $this->__('When using Payflow Link in Magento, a payment authorization transaction must be performed after the shopper enters their credit card information on the Payment page of checkout. If a full authorization is performed for the entire dollar amount of the transaction, then in some cases, the transaction amount might be reserved on the shopper\'s credit card for up to 30 days, even if they abandon their cart. This is not an ideal customer experience. Using this advanced setting in Magento, you can configure key details of this authorization.') ?> - - <ul style="list-style:disc; padding-left:2em;"> - <li> - <?php echo $this->__('Select $0 Auth if your credit card processor supports $0 Auth capability and Reference Transactions, or if you are unsure what to select. This setting provides the best experience for shoppers.') ?> - </li> - <li> - <?php echo $this->__('Select Full Auth if you want to minimize your credit card processing fees, or if your credit card processor does not permit reference transactions. Please note that in some cases, shoppers who abandon your cart late in the process may find that there is a payment authorization outstanding from your company, which will go away on its own in a few days/weeks. This authorization can be reversal by voiding it, however, there is no guarantee the card-issuing bank will accept this request.') ?> - </li> - </ul> -</div> -<script type="text/javascript"> -//<![CDATA[ - document.observe("dom:loaded", function() { - $('row_paypal_payflow_link_authorization_amount').insert({after:'<tr id="PayFlowLinkLearnMoreRow"><td colspan="4"><tr>'}); - $('PayFlowLinkLearnMoreRow').down().insert({top:$('PayFlowLinkLearnMoreText')}); - $('PayFlowLinkLearnMore').observe('click', function(event){ - $('PayFlowLinkLearnMoreText').toggle(); - event.stop(); - }); - }); -//]]> -</script> diff --git a/app/code/core/Mage/Paypal/view/frontend/express/review.phtml b/app/code/core/Mage/Paypal/view/frontend/express/review.phtml index 8844d19c2b24b8e737906d80bab871dcb6cfab31..2c5493471147c2532ad0332ae4f5383a8b93e52b 100644 --- a/app/code/core/Mage/Paypal/view/frontend/express/review.phtml +++ b/app/code/core/Mage/Paypal/view/frontend/express/review.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Paypal/view/frontend/express/review/details.phtml b/app/code/core/Mage/Paypal/view/frontend/express/review/details.phtml index 85c4f223c68e8baf2c900078ccf6ff223643a543..210c56f83eb88d70e85cd426960674ab0ca056ff 100644 --- a/app/code/core/Mage/Paypal/view/frontend/express/review/details.phtml +++ b/app/code/core/Mage/Paypal/view/frontend/express/review/details.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/Paypal/view/frontend/express/shortcut.phtml b/app/code/core/Mage/Paypal/view/frontend/express/shortcut.phtml index d6d53b27101be90ac2d643147a46b0686892eb87..2648cdb86fdd2e4f630ae9f01f0f0a0e95850c44 100644 --- a/app/code/core/Mage/Paypal/view/frontend/express/shortcut.phtml +++ b/app/code/core/Mage/Paypal/view/frontend/express/shortcut.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Paypal/view/frontend/hss/form.phtml b/app/code/core/Mage/Paypal/view/frontend/hss/form.phtml index 513d9d3a5481f1ad5f277149b9dd5f8514b91d52..2567d7659b770f886c3af3439a88409fa722d522 100644 --- a/app/code/core/Mage/Paypal/view/frontend/hss/form.phtml +++ b/app/code/core/Mage/Paypal/view/frontend/hss/form.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/Paypal/view/frontend/hss/iframe.phtml b/app/code/core/Mage/Paypal/view/frontend/hss/iframe.phtml index 1746f4502e8b5865881d5fd7412275c66e3d4536..3bf2e229d507e8c6473f04a8e553f95cbddf545d 100644 --- a/app/code/core/Mage/Paypal/view/frontend/hss/iframe.phtml +++ b/app/code/core/Mage/Paypal/view/frontend/hss/iframe.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/Paypal/view/frontend/hss/info.phtml b/app/code/core/Mage/Paypal/view/frontend/hss/info.phtml index bcc14191a706449c0246273c6ad1d7f28b7eb872..ac8abc841df9c95e6b8b50a4288adf25a7e88268 100644 --- a/app/code/core/Mage/Paypal/view/frontend/hss/info.phtml +++ b/app/code/core/Mage/Paypal/view/frontend/hss/info.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/Paypal/view/frontend/hss/js.phtml b/app/code/core/Mage/Paypal/view/frontend/hss/js.phtml index e5ba7a3a85fb8b83fa4e221074c0001abdcd8a25..c3457797afbe5a5a6651198f3a385825e8951acf 100644 --- a/app/code/core/Mage/Paypal/view/frontend/hss/js.phtml +++ b/app/code/core/Mage/Paypal/view/frontend/hss/js.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/Paypal/view/frontend/hss/redirect.phtml b/app/code/core/Mage/Paypal/view/frontend/hss/redirect.phtml index a1b7983356c546739b178d2734c0f61f19b0ef65..37aff5c332de34eef2887c058685b789029c9be1 100644 --- a/app/code/core/Mage/Paypal/view/frontend/hss/redirect.phtml +++ b/app/code/core/Mage/Paypal/view/frontend/hss/redirect.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ @@ -32,6 +32,9 @@ <head> <script type="text/javascript"> //<![CDATA[ +if (window.top == window.self) { + window.location = "<?php echo $this->getUrl('checkout/cart') ?>"; +} <?php if ($this->getGotoSection()): ?> for (var s = 0; s < window.top.checkout.steps.length; s++) { if (window.top.checkout.steps[s] == '<?php echo $this->getGotoSection() ?>') { diff --git a/app/code/core/Mage/Paypal/view/frontend/hss/review/button.phtml b/app/code/core/Mage/Paypal/view/frontend/hss/review/button.phtml index 0ccca06a005bebe37053c9554e72c67df35aedf6..d4e0d8d7cb8e8653332ebc08f28ffc231f6e5966 100644 --- a/app/code/core/Mage/Paypal/view/frontend/hss/review/button.phtml +++ b/app/code/core/Mage/Paypal/view/frontend/hss/review/button.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Paypal/view/frontend/layout.xml b/app/code/core/Mage/Paypal/view/frontend/layout.xml index 4868f6acad0a310223ac6cc04064593e8023a4c1..73f8165498f3014f4f573011b31ec2f2bb462cf0 100644 --- a/app/code/core/Mage/Paypal/view/frontend/layout.xml +++ b/app/code/core/Mage/Paypal/view/frontend/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ @@ -77,56 +77,6 @@ </block> </paypal_express_review_details> - <paypal_payflow_review translate="label"> - <label>Order Review Form</label> - <remove name="right"/> - <remove name="left"/> - - <reference name="root"> - <action method="setTemplate"><template>1column.phtml</template></action> - </reference> - <reference name="content"> - <block type="Mage_Paypal_Block_Payflow_Link_Review" name="paypal.express.review" template="express/review.phtml"> - <block type="Mage_Paypal_Block_Express_Review_Details" name="paypal.express.review.details" as="details" template="express/review/details.phtml"> - <action method="addItemRender"><type>default</type><block>Mage_Checkout_Block_Cart_Item_Renderer</block><template>onepage/review/item.phtml</template></action> - <action method="addItemRender"><type>grouped</type><block>Mage_Checkout_Block_Cart_Item_Renderer_Grouped</block><template>onepage/review/item.phtml</template></action> - <action method="addItemRender"><type>configurable</type><block>Mage_Checkout_Block_Cart_Item_Renderer_Configurable</block><template>onepage/review/item.phtml</template></action> - <block type="Mage_Checkout_Block_Cart_Totals" name="paypal.express.review.details.totals" as="totals" template="onepage/review/totals.phtml"/> - </block> - <block type="Mage_Checkout_Block_Agreements" name="paypal.express.review.details.agreements" as="agreements" template="onepage/agreements.phtml"/> - </block> - </reference> - <reference name="head"> - <action method="addJs"><file>Mage_Paypal::review.js</file></action> - </reference> - <block type="Mage_Core_Block_Text_List" name="additional.product.info" /> - </paypal_payflow_review> - - <paypal_payflowadvanced_review translate="label"> - <label>Order Review Form</label> - <remove name="right"/> - <remove name="left"/> - - <reference name="root"> - <action method="setTemplate"><template>1column.phtml</template></action> - </reference> - <reference name="content"> - <block type="Mage_Paypal_Block_Payflow_Advanced_Review" name="paypal.express.review" template="express/review.phtml"> - <block type="Mage_Paypal_Block_Express_Review_Details" name="paypal.express.review.details" as="details" template="express/review/details.phtml"> - <action method="addItemRender"><type>default</type><block>Mage_Checkout_Block_Cart_Item_Renderer</block><template>onepage/review/item.phtml</template></action> - <action method="addItemRender"><type>grouped</type><block>Mage_Checkout_Block_Cart_Item_Renderer_Grouped</block><template>onepage/review/item.phtml</template></action> - <action method="addItemRender"><type>configurable</type><block>Mage_Checkout_Block_Cart_Item_Renderer_Configurable</block><template>onepage/review/item.phtml</template></action> - <block type="Mage_Checkout_Block_Cart_Totals" name="paypal.express.review.details.totals" as="totals" template="onepage/review/totals.phtml"/> - </block> - <block type="Mage_Checkout_Block_Agreements" name="paypal.express.review.details.agreements" as="agreements" template="onepage/agreements.phtml"/> - </block> - </reference> - <reference name="head"> - <action method="addJs"><file>Mage_Paypal::review.js</file></action> - </reference> - <block type="Mage_Core_Block_Text_List" name="additional.product.info" /> - </paypal_payflowadvanced_review> - <!-- Available logo types can be assigned with action="setLogoType": - wePrefer_150x60 @@ -228,12 +178,10 @@ Available logo types can be assigned with action="setLogoType": <paypal_payflow_link_iframe> <block type="Mage_Paypal_Block_Payflow_Link_Iframe" name="payflow.link.iframe" template="payflowlink/form.phtml" /> - <block type="Mage_Paypal_Block_Payflow_Link_Info" name="payflow.link.info" template="payflowlink/info.phtml" /> </paypal_payflow_link_iframe> <paypal_payflow_advanced_iframe> <block type="Mage_Paypal_Block_Payflow_Advanced_Iframe" name="payflow.advanced.iframe" template="payflowadvanced/form.phtml" /> - <block type="Mage_Paypal_Block_Payflow_Advanced_Info" name="payflow.advanced.info" template="payflowadvanced/info.phtml" /> </paypal_payflow_advanced_iframe> <paypal_hosted_pro_iframe> diff --git a/app/code/core/Mage/Paypal/view/frontend/partner/logo.phtml b/app/code/core/Mage/Paypal/view/frontend/partner/logo.phtml index f84a1448598992b829bf70dbbcc5e788c9cc698b..628315262e25506f49db526c875b24509bb49877 100644 --- a/app/code/core/Mage/Paypal/view/frontend/partner/logo.phtml +++ b/app/code/core/Mage/Paypal/view/frontend/partner/logo.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Paypal/view/frontend/payflowadvanced/form.phtml b/app/code/core/Mage/Paypal/view/frontend/payflowadvanced/form.phtml index 0a412e3f9c4ad4569d9e3d3bd2d485b5db8fe3ac..4dfaade34894d1f67b239f358892b7e27b75bc45 100644 --- a/app/code/core/Mage/Paypal/view/frontend/payflowadvanced/form.phtml +++ b/app/code/core/Mage/Paypal/view/frontend/payflowadvanced/form.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/Paypal/view/frontend/payflowadvanced/iframe.phtml b/app/code/core/Mage/Paypal/view/frontend/payflowadvanced/iframe.phtml index 97dafa9f517a1b4a7d712b56476d0f5876e93e5c..100bea56a24fad3584c3bf4bead7b0152a02c039 100644 --- a/app/code/core/Mage/Paypal/view/frontend/payflowadvanced/iframe.phtml +++ b/app/code/core/Mage/Paypal/view/frontend/payflowadvanced/iframe.phtml @@ -20,100 +20,29 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /** @var $this Mage_Paypal_Block_Payflow_Advanced_Form */ ?> -<?php $_code = $this->getMethodCode() ?> -<div id="payment_form_<?php echo $_code ?>" style="display:none;"> -<div id="iframe-warning" class="warning-message" style="display:none;"> +<div id="iframe-warning" class="warning-message"> <?php echo $this->__('Please do not refresh the page until you complete payment.') ?> </div> - +<iframe id="payflow-advanced-iframe" style="display:none;" scrolling="no" frameborder="0" border="0" src="<?php echo $this->getFrameActionUrl() ?>" height="610" width="570"></iframe> <script type="text/javascript"> //<![CDATA[ -var PayflowAdvanced = Class.create(); -PayflowAdvanced.prototype = { - stepName: 'payment', - loadingText: ' <?php echo $this->__('Loading payment information...') ?> ', - loadingDefaultText: '', - buttonContinue: '', - pleaseWaitBox: '', - pleaseWaitBoxTextNode: '', - initialize: function(){ - this.buttonContinue = $(this.stepName + '-buttons-container').select('button').first(); - this.pleaseWaitBox = $(this.stepName + '-please-wait'); - - if (Prototype.Browser.IE) { - this.pleaseWaitBoxTextNode = this.pleaseWaitBox.childNodes[1]; - } else { - this.pleaseWaitBoxTextNode = this.pleaseWaitBox.childNodes[2]; - } - - this.loadingDefaultText = this.pleaseWaitBoxTextNode.nodeValue; - }, - showFrame: function(){ - if (!$('payflow-advanced-iframe')) { - this.showLoading(); - checkout.setLoadWaiting(this.stepName); - var payflowAdvancedIframe = '<iframe id="payflow-advanced-iframe" style="display:none;" scrolling="no" frameborder="0" border="0" ' - + 'src="<?php echo $this->getFrameActionUrl() ?>" height="610" width="570"></iframe>'; - $('payment_form_<?php echo $_code ?>').insert({bottom:payflowAdvancedIframe}); - $('payflow-advanced-iframe').observe('load', function(){ - if (!$('payflow-advanced-iframe').visible()) { - $('payflow-advanced-iframe').show(); - $('iframe-warning').show(); - } - payflowAdvanced.setSpinnerDefaultText(); - checkout.setLoadWaiting(false, true); - $(payflowAdvanced.buttonContinue).addClassName('disabled'); - - window.name = '<?php echo Mage::getBaseUrl(); ?>'; - }); - } else { - $(this.buttonContinue).addClassName('disabled'); - checkout.setLoadWaiting(this.stepName); - checkout.setLoadWaiting(false, true); - } - }, - hideFrame: function(){ - checkout.setLoadWaiting(this.stepName); - checkout.setLoadWaiting(false); - $(this.buttonContinue).removeClassName('disabled'); - }, - setSpinnerText: function(text){ - if (!text) { - text = this.loadingText; - } - this.pleaseWaitBoxTextNode.nodeValue = text; - }, - setSpinnerDefaultText: function(){ - this.pleaseWaitBoxTextNode.nodeValue = this.loadingDefaultText; - }, - showLoading: function(){ - this.setSpinnerText(); - $(this.buttonContinue).addClassName('disabled'); - checkout.setLoadWaiting(this.stepName); - } -} -var payflowAdvanced; - -Event.observe($('payment_form_<?php echo $_code ?>'), 'payment-method:switched', function(event){ - if (!window.payflowAdvanced) { - window.payflowAdvanced = new PayflowAdvanced(); - } - if (!payflowAdvanced) { - payflowAdvanced = window.payflowAdvanced; - } - payflowAdvanced.showFrame(); +var headers = $$('#' + checkout.accordion.container.readAttribute('id') + ' .section'); +headers.each(function(header) { + header.removeClassName('allow'); }); -Event.observe($('payment_form_<?php echo $_code ?>'), 'payment-method:switched-off', function(event){ - payflowAdvanced.hideFrame(); +$('payflow-advanced-iframe').observe('load', function(){ + $('payflow-advanced-iframe').show(); + $('iframe-warning').show(); + checkout.loadWaiting = 'review'; + checkout.setLoadWaiting(false); + if (checkout.accordion.currentSection == 'opc-review') { + $('checkout-review-submit').hide(); + } }); -if ($('p_method_payflow_advanced').checked) { - $('payment_form_<?php echo $_code ?>').fire('payment-method:switched', {method_code : '<?php echo $_code ?>'}); -} //]]> </script> -</div> diff --git a/app/code/core/Mage/Paypal/view/frontend/payflowadvanced/info.phtml b/app/code/core/Mage/Paypal/view/frontend/payflowadvanced/info.phtml index 9b3bf8306082c82db29604a672f5d1895257a22a..5c7a437bb11e3e8131f0b464b0e59dc74ffbe218 100644 --- a/app/code/core/Mage/Paypal/view/frontend/payflowadvanced/info.phtml +++ b/app/code/core/Mage/Paypal/view/frontend/payflowadvanced/info.phtml @@ -20,22 +20,16 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /** - * @var $this Mage_Paypal_Block_Payflow_Advanced_Info + * @var $this Mage_Paypal_Block_Payflow_Advanced_Form */ ?> -<html> -<head></head> -<body> -<script type="text/javascript"> - var errorMessage = '<?php echo $this->getErrorMessage() ?>'; - if (errorMessage) { - alert(errorMessage); - } -</script> -</body> -</html> +<ul id="payment_form_<?php echo $this->getMethodCode() ?>" style="display:none" class="form-list"> + <li> + <?php echo $this->__('You will be required to enter your payment details after you place an order.') ?> + </li> +</ul> diff --git a/app/code/core/Mage/Paypal/view/frontend/payflowadvanced/redirect.phtml b/app/code/core/Mage/Paypal/view/frontend/payflowadvanced/redirect.phtml index 654b5f047151ffe95287dfff82fc405c3458087d..1b01f8db6e98c6c801e1b6abfe7f2753557fb951 100644 --- a/app/code/core/Mage/Paypal/view/frontend/payflowadvanced/redirect.phtml +++ b/app/code/core/Mage/Paypal/view/frontend/payflowadvanced/redirect.phtml @@ -20,66 +20,49 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ + /** - * @var $this Mage_Paypal_Block_Iframe + * @var $this Mage_Paypal_Block_Payflow_Advanced_Iframe */ ?> <html> <head> <script type="text/javascript"> //<![CDATA[ - function allowCheckoutSteps(allow) - { - var window_top = window.top; - for (var s = 0; s < window_top.checkout.steps.length; s++) { - if (window_top.checkout.steps[s] == '<?php echo $this->getGotoSection() ?>') { - break; - } - if (window_top.document.getElementById('opc-' + window_top.checkout.steps[s])) { - if (allow) { - window_top.document.getElementById('opc-' + window_top.checkout.steps[s]).addClassName('allow'); - } else { - window_top.document.getElementById('opc-' + window_top.checkout.steps[s]).removeClassName('allow'); - } - } - } + if (window.top == window.self) { + window.location = "<?php echo $this->getUrl('checkout/cart') ?>"; } -if (window.top==window.self) { - window.location = "<?php echo $this->getUrl('checkout/cart') ?>"; -} -var window_name = '<?php echo Mage::getBaseUrl(); ?>'; -var window_top = window.top; -var allowed_domain = false; -try{ - allowed_domain = window_name == window_top.name -}catch(e){ - allowed_domain = false; -} -<?php if ($this->getErrorMsg()): ?> - alert('<?php echo $this->getErrorMsg() ?>'); - if (allowed_domain) { - window_top.payflowAdvanced.showLoading(); + var window_top = window.top; +<?php if ($this->getGotoSection()): ?> + var checkout_steps; + + try{ + checkout_steps = window.top.checkout.steps + }catch(e){ + window_top.location="<?php echo $this->getUrl('checkout/cart') ?>"; } - window.location = "<?php echo $this->getUrl('paypal/payflowadvanced/form') ?>"; -<?php else: ?> - if (allowed_domain) { - <?php if ($this->getGotoSection()): ?> - allowCheckoutSteps(true); - <?php if ($this->getGotoSection() == 'review'): ?> - allowCheckoutSteps(false); - window_top.payment.save(); - <?php else : ?> - window_top.checkout.gotoSection("<?php echo $this->getGotoSection() ?>"); - <?php endif; ?> - <?php else : ?> - window_top.location="<?php echo $this->getUrl('checkout/cart') ?>"; - <?php endif; ?> - } else { - alert('<?php echo $this->jsQuoteEscape($this->__('Wrong configuration of Payment Method'));?>'); + + for (var s = 0; s < checkout_steps.length; s++) { + if (checkout_steps[s] == '<?php echo $this->getGotoSection() ?>') { + break; + } + if (window_top.document.getElementById('opc-' + checkout_steps[s])) { + window_top.document.getElementById('opc-' + checkout_steps[s]).addClassName('allow'); + } } + window_top.checkout.gotoSection("<?php echo $this->getGotoSection() ?>"); + window_top.document.getElementById('checkout-review-submit').show(); + window_top.document.getElementById('iframe-warning').hide(); + <?php if ($this->getErrorMsg()): ?> + alert('<?php echo $this->getErrorMsg() ?>'); + <?php endif; ?> +<?php elseif ($this->getGotoSuccessPage()) : ?> + window_top.location="<?php echo $this->getUrl('checkout/onepage/success') ?>"; +<?php else : ?> + window_top.location="<?php echo $this->getUrl('checkout/cart') ?>"; <?php endif; ?> //]]> </script> diff --git a/app/code/core/Mage/Paypal/view/frontend/payflowlink/form.phtml b/app/code/core/Mage/Paypal/view/frontend/payflowlink/form.phtml index 513d9d3a5481f1ad5f277149b9dd5f8514b91d52..2567d7659b770f886c3af3439a88409fa722d522 100644 --- a/app/code/core/Mage/Paypal/view/frontend/payflowlink/form.phtml +++ b/app/code/core/Mage/Paypal/view/frontend/payflowlink/form.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/Paypal/view/frontend/payflowlink/iframe.phtml b/app/code/core/Mage/Paypal/view/frontend/payflowlink/iframe.phtml index e77f2c25f87da9c9c6616986a57b0856ddc49206..3156003c7a2893223890cd445dae2d7f1d6670fc 100644 --- a/app/code/core/Mage/Paypal/view/frontend/payflowlink/iframe.phtml +++ b/app/code/core/Mage/Paypal/view/frontend/payflowlink/iframe.phtml @@ -20,100 +20,29 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /** @var $this Mage_Paypal_Block_Payflow_Link_Form */ ?> -<?php $_code=$this->getMethodCode() ?> -<div id="payment_form_<?php echo $_code ?>" style="display:none;"> -<div id="iframe-warning" class="warning-message" style="display:none;"> +<div id="iframe-warning" class="warning-message"> <?php echo $this->__('Please do not refresh the page until you complete payment.') ?> </div> - +<iframe id="payflow-link-iframe" style="display:none;" scrolling="no" frameborder="0" border="0" src="<?php echo $this->getFrameActionUrl() ?>" height="610" width="570"></iframe> <script type="text/javascript"> //<![CDATA[ -var PayflowLink = Class.create(); -PayflowLink.prototype = { - stepName: 'payment', - loadingText: ' <?php echo $this->__('Loading payment information...') ?> ', - loadingDefaultText: '', - buttonContinue: '', - pleaseWaitBox: '', - pleaseWaitBoxTextNode: '', - initialize: function(){ - this.buttonContinue = $(this.stepName + '-buttons-container').select('button').first(); - this.pleaseWaitBox = $(this.stepName + '-please-wait'); - - if (Prototype.Browser.IE) { - this.pleaseWaitBoxTextNode = this.pleaseWaitBox.childNodes[1]; - } else { - this.pleaseWaitBoxTextNode = this.pleaseWaitBox.childNodes[2]; - } - - this.loadingDefaultText = this.pleaseWaitBoxTextNode.nodeValue; - }, - showFrame: function(){ - if (!$('payflow-link-iframe')) { - this.showLoading(); - checkout.setLoadWaiting(this.stepName); - var payflowLinkIframe = '<iframe id="payflow-link-iframe" style="display:none;" scrolling="no" frameborder="0" border="0" ' - + 'src="<?php echo $this->getFrameActionUrl() ?>" height="610" width="570"></iframe>'; - $('payment_form_<?php echo $_code ?>').insert({bottom:payflowLinkIframe}); - $('payflow-link-iframe').observe('load', function(){ - if (!$('payflow-link-iframe').visible()) { - $('payflow-link-iframe').show(); - $('iframe-warning').show(); - } - payflowLink.setSpinnerDefaultText(); - checkout.setLoadWaiting(false, true); - $(payflowLink.buttonContinue).addClassName('disabled'); - - window.name = '<?php echo Mage::getBaseUrl(); ?>'; - }); - } else { - $(this.buttonContinue).addClassName('disabled'); - checkout.setLoadWaiting(this.stepName); - checkout.setLoadWaiting(false, true); - } - }, - hideFrame: function(){ - checkout.setLoadWaiting(this.stepName); - checkout.setLoadWaiting(false); - $(this.buttonContinue).removeClassName('disabled'); - }, - setSpinnerText: function(text){ - if (!text) { - text = this.loadingText; - } - this.pleaseWaitBoxTextNode.nodeValue = text; - }, - setSpinnerDefaultText: function(){ - this.pleaseWaitBoxTextNode.nodeValue = this.loadingDefaultText; - }, - showLoading: function(){ - this.setSpinnerText(); - $(this.buttonContinue).addClassName('disabled'); - checkout.setLoadWaiting(this.stepName); - } -} -var payflowLink; - -Event.observe($('payment_form_<?php echo $_code ?>'), 'payment-method:switched', function(event){ - if (!window.payflowLink) { - window.payflowLink = new PayflowLink(); - } - if (!payflowLink) { - payflowLink = window.payflowLink; - } - payflowLink.showFrame(); +var headers = $$('#' + checkout.accordion.container.readAttribute('id') + ' .section'); +headers.each(function(header) { + header.removeClassName('allow'); }); -Event.observe($('payment_form_<?php echo $_code ?>'), 'payment-method:switched-off', function(event){ - payflowLink.hideFrame(); +$('payflow-link-iframe').observe('load', function(){ + $('payflow-link-iframe').show(); + $('iframe-warning').show(); + checkout.loadWaiting = 'review'; + checkout.setLoadWaiting(false); + if (checkout.accordion.currentSection == 'opc-review') { + $('checkout-review-submit').hide(); + } }); -if ($('p_method_payflow_link').checked) { - $('payment_form_<?php echo $_code ?>').fire('payment-method:switched', {method_code : '<?php echo $_code ?>'}); -} //]]> </script> -</div> diff --git a/app/code/core/Mage/Paypal/view/frontend/payflowlink/info.phtml b/app/code/core/Mage/Paypal/view/frontend/payflowlink/info.phtml index 26bcb98cc13a6899240ae0ec02d6c8fcbb31d6c4..00f72ad74f8e6392214dd5f40ea394d6d698ba58 100644 --- a/app/code/core/Mage/Paypal/view/frontend/payflowlink/info.phtml +++ b/app/code/core/Mage/Paypal/view/frontend/payflowlink/info.phtml @@ -20,22 +20,16 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /** - * @var $this Mage_Paypal_Block_Payflow_Link_Info + * @var $this Mage_Paypal_Block_Payflow_Link_Form */ ?> -<html> -<head></head> -<body> -<script type="text/javascript"> - var errorMessage = '<?php echo $this->getErrorMessage() ?>'; - if (errorMessage) { - alert(errorMessage); - } -</script> -</body> -</html> +<ul id="payment_form_<?php echo $this->getMethodCode() ?>" style="display:none" class="form-list"> + <li> + <?php echo $this->__('You will be required to enter your payment details after you place an order.') ?> + </li> +</ul> diff --git a/app/code/core/Mage/Paypal/view/frontend/payflowlink/redirect.phtml b/app/code/core/Mage/Paypal/view/frontend/payflowlink/redirect.phtml index 5cc0c5f6331005abfbeb5f351647f39c1f1738d1..fbc11ac9950e0859b8606996134cb5c84fe80746 100644 --- a/app/code/core/Mage/Paypal/view/frontend/payflowlink/redirect.phtml +++ b/app/code/core/Mage/Paypal/view/frontend/payflowlink/redirect.phtml @@ -20,66 +20,49 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ + /** - * @var $this Mage_Paypal_Block_Iframe + * @var $this Mage_Paypal_Block_Payflow_Link_Iframe */ ?> <html> <head> <script type="text/javascript"> //<![CDATA[ - function allowCheckoutSteps(allow) - { - var window_top = window.top; - for (var s = 0; s < window_top.checkout.steps.length; s++) { - if (window_top.checkout.steps[s] == '<?php echo $this->getGotoSection() ?>') { - break; - } - if (window_top.document.getElementById('opc-' + window_top.checkout.steps[s])) { - if (allow) { - window_top.document.getElementById('opc-' + window_top.checkout.steps[s]).addClassName('allow'); - } else { - window_top.document.getElementById('opc-' + window_top.checkout.steps[s]).removeClassName('allow'); - } - } - } + if (window.top == window.self) { + window.location = "<?php echo $this->getUrl('checkout/cart') ?>"; } -if (window.top==window.self) { - window.location = "<?php echo $this->getUrl('checkout/cart') ?>"; -} -var window_name = '<?php echo Mage::getBaseUrl(); ?>'; -var window_top = window.top; -var allowed_domain = false; -try{ - allowed_domain = window_name == window_top.name -}catch(e){ - allowed_domain = false; -} -<?php if ($this->getErrorMsg()): ?> - alert('<?php echo $this->getErrorMsg() ?>'); - if (allowed_domain) { - window_top.payflowLink.showLoading(); + var window_top = window.top; +<?php if ($this->getGotoSection()): ?> + var checkout_steps; + + try{ + checkout_steps = window.top.checkout.steps + }catch(e){ + window_top.location="<?php echo $this->getUrl('checkout/cart') ?>"; } - window.location = "<?php echo $this->getUrl('paypal/payflow/form') ?>"; -<?php else: ?> - if (allowed_domain) { - <?php if ($this->getGotoSection()): ?> - allowCheckoutSteps(true); - <?php if ($this->getGotoSection() == 'review'): ?> - allowCheckoutSteps(false); - window_top.payment.save(); - <?php else : ?> - window_top.checkout.gotoSection("<?php echo $this->getGotoSection() ?>"); - <?php endif; ?> - <?php else : ?> - window_top.location="<?php echo $this->getUrl('checkout/cart') ?>"; - <?php endif; ?> - } else { - alert('<?php echo $this->jsQuoteEscape($this->__('Wrong configuration of Payment Method')) ;?>'); + + for (var s = 0; s < checkout_steps.length; s++) { + if (checkout_steps[s] == '<?php echo $this->getGotoSection() ?>') { + break; + } + if (window_top.document.getElementById('opc-' + checkout_steps[s])) { + window_top.document.getElementById('opc-' + checkout_steps[s]).addClassName('allow'); + } } + window_top.checkout.gotoSection("<?php echo $this->getGotoSection() ?>"); + window_top.document.getElementById('checkout-review-submit').show(); + window_top.document.getElementById('iframe-warning').hide(); + <?php if ($this->getErrorMsg()): ?> + alert('<?php echo $this->getErrorMsg() ?>'); + <?php endif; ?> +<?php elseif ($this->getGotoSuccessPage()) : ?> + window_top.location="<?php echo $this->getUrl('checkout/onepage/success') ?>"; +<?php else : ?> + window_top.location="<?php echo $this->getUrl('checkout/cart') ?>"; <?php endif; ?> //]]> </script> diff --git a/app/code/core/Mage/Paypal/view/frontend/payment/mark.phtml b/app/code/core/Mage/Paypal/view/frontend/payment/mark.phtml index 1c16cc4d69a23e78327ee30dae331d9e79fdc5fe..da7afe8809a02210196f917f27e507101140897c 100644 --- a/app/code/core/Mage/Paypal/view/frontend/payment/mark.phtml +++ b/app/code/core/Mage/Paypal/view/frontend/payment/mark.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Paypal/view/frontend/payment/redirect.phtml b/app/code/core/Mage/Paypal/view/frontend/payment/redirect.phtml index 29198e83c619ce5b2d51b9b15ad44f7e57d1697d..93362d07bba75d3c95c99835ddb1b39052262289 100644 --- a/app/code/core/Mage/Paypal/view/frontend/payment/redirect.phtml +++ b/app/code/core/Mage/Paypal/view/frontend/payment/redirect.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Paypal/view/frontend/review.js b/app/code/core/Mage/Paypal/view/frontend/review.js index 8b308dc5b6bff19e79d2cca5c9c123cc199dcf38..2fdf46c3a719a3a770e52fad04b8fda0f3bcf5bb 100644 --- a/app/code/core/Mage/Paypal/view/frontend/review.js +++ b/app/code/core/Mage/Paypal/view/frontend/review.js @@ -19,7 +19,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/PaypalUk/Block/Express/Form.php b/app/code/core/Mage/PaypalUk/Block/Express/Form.php index 199e02e618a018a31490f93c84e529cab5290008..bea0dae6114f12e2af81b7b811de54a59b856c0f 100644 --- a/app/code/core/Mage/PaypalUk/Block/Express/Form.php +++ b/app/code/core/Mage/PaypalUk/Block/Express/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_PaypalUk - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/PaypalUk/Block/Express/Shortcut.php b/app/code/core/Mage/PaypalUk/Block/Express/Shortcut.php index 119754eda16b0efdfd1c23d2b60ba93b47e7fd07..fef56af7d571f008b81b160378e220bf67497b33 100644 --- a/app/code/core/Mage/PaypalUk/Block/Express/Shortcut.php +++ b/app/code/core/Mage/PaypalUk/Block/Express/Shortcut.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_PaypalUk - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/PaypalUk/Helper/Data.php b/app/code/core/Mage/PaypalUk/Helper/Data.php index 347bb5411c736e795cac70dc7eee8aea26431b4d..9c5c7a8d8f0284f7908ff456387bb13af467c587 100644 --- a/app/code/core/Mage/PaypalUk/Helper/Data.php +++ b/app/code/core/Mage/PaypalUk/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_PaypalUk - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/PaypalUk/Model/Api/Nvp.php b/app/code/core/Mage/PaypalUk/Model/Api/Nvp.php index c59f3e8de6c139f3211c14384bdedb9d2a25ef10..1c447af357a6ad5b723fa392bede64cb3d1a0cdd 100644 --- a/app/code/core/Mage/PaypalUk/Model/Api/Nvp.php +++ b/app/code/core/Mage/PaypalUk/Model/Api/Nvp.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_PaypalUk - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -85,61 +85,61 @@ class Mage_PaypalUk_Model_Api_Nvp extends Mage_Paypal_Model_Api_Nvp */ protected $_globalMap = array( // each call - 'PARTNER' => 'partner', - 'VENDOR' => 'vendor', - 'USER' => 'user', - 'PWD' => 'password', - 'BUTTONSOURCE' => 'build_notation_code', - 'TENDER' => 'tender', + 'PARTNER' => 'partner', + 'VENDOR' => 'vendor', + 'USER' => 'user', + 'PWD' => 'password', + 'BUTTONSOURCE' => 'build_notation_code', + 'TENDER' => 'tender', // commands - 'RETURNURL' => 'return_url', - 'CANCELURL' => 'cancel_url', - 'INVNUM' => 'inv_num', - 'TOKEN' => 'token', + 'RETURNURL' => 'return_url', + 'CANCELURL' => 'cancel_url', + 'INVNUM' => 'inv_num', + 'TOKEN' => 'token', 'CORRELATIONID' => 'correlation_id', - 'CUSTIP' => 'ip_address', - 'NOTIFYURL' => 'notify_url', - 'NOTE' => 'note', + 'CUSTIP' => 'ip_address', + 'NOTIFYURL' => 'notify_url', + 'NOTE' => 'note', // style settings - 'PAGESTYLE' => 'page_style', - 'HDRIMG' => 'hdrimg', + 'PAGESTYLE' => 'page_style', + 'HDRIMG' => 'hdrimg', 'HDRBORDERCOLOR' => 'hdrbordercolor', - 'HDRBACKCOLOR' => 'hdrbackcolor', - 'PAYFLOWCOLOR' => 'payflowcolor', - 'LOCALECODE' => 'locale_code', + 'HDRBACKCOLOR' => 'hdrbackcolor', + 'PAYFLOWCOLOR' => 'payflowcolor', + 'LOCALECODE' => 'locale_code', // transaction info - 'PPREF' => 'paypal_transaction_id',//We need to store paypal trx id for correct IPN working - 'PNREF' => 'transaction_id', - 'ORIGID' => 'authorization_id', - 'CAPTURECOMPLETE' => 'complete_type', - 'AMT' => 'amount', - 'AVSADDR' => 'address_verification', - 'AVSZIP' => 'postcode_verification', + 'PPREF' => 'paypal_transaction_id', //We need to store paypal trx id for correct IPN working + 'PNREF' => 'transaction_id', + 'ORIGID' => 'authorization_id', + 'CAPTURECOMPLETE' => 'complete_type', + 'AMT' => 'amount', + 'AVSADDR' => 'address_verification', + 'AVSZIP' => 'postcode_verification', // payment/billing info - 'CURRENCY' => 'currency_code', + 'CURRENCY' => 'currency_code', 'PENDINGREASON' => 'pending_reason', 'PAYERID' => 'payer_id', 'PAYERSTATUS' => 'payer_status', - 'EMAIL' => 'email', + 'EMAIL' => 'email', // backwards compatibility - 'FIRSTNAME' => 'firstname', - 'LASTNAME' => 'lastname', + 'FIRSTNAME' => 'firstname', + 'LASTNAME' => 'lastname', // paypal direct credit card information - 'ACCT' => 'credit_card_number', - 'EXPDATE' => 'credit_card_expiration_date', - 'CVV2' => 'credit_card_cvv2', - 'CARDSTART' => 'maestro_solo_issue_date', // MMYY, including leading zero - 'CARDISSUE' => 'maestro_solo_issue_number', - 'CVV2MATCH' => 'cvv2_check_result', + 'ACCT' => 'credit_card_number', + 'EXPDATE' => 'credit_card_expiration_date', + 'CVV2' => 'credit_card_cvv2', + 'CARDSTART' => 'maestro_solo_issue_date', // MMYY, including leading zero + 'CARDISSUE' => 'maestro_solo_issue_number', + 'CVV2MATCH' => 'cvv2_check_result', // cardinal centinel 'AUTHSTATUS3DS' => 'centinel_authstatus', 'MPIVENDOR3DS' => 'centinel_mpivendor', - 'CAVV' => 'centinel_cavv', - 'ECI' => 'centinel_eci', - 'XID' => 'centinel_xid', - 'VPAS' => 'centinel_vpas_result', + 'CAVV' => 'centinel_cavv', + 'ECI' => 'centinel_eci', + 'XID' => 'centinel_xid', + 'VPAS' => 'centinel_vpas_result', 'ECISUBMITTED3DS' => 'centinel_eci_result', ); @@ -163,6 +163,7 @@ class Mage_PaypalUk_Model_Api_Nvp extends Mage_Paypal_Model_Api_Nvp 'AMT', 'CUSTIP', 'INVNUM', 'CARDISSUE', 'CARDSTART', 'AUTHSTATUS3DS', 'MPIVENDOR3DS', 'CAVV', 'ECI', 'XID',//cardinal centinel params + 'TAXAMT', 'FREIGHTAMT' ); protected $_doDirectPaymentResponse = array( 'PNREF', 'PPREF', 'CORRELATIONID', 'CVV2MATCH', 'AVSADDR', 'AVSZIP', 'PENDINGREASON' @@ -299,7 +300,11 @@ class Mage_PaypalUk_Model_Api_Nvp extends Mage_Paypal_Model_Api_Nvp * * @var array */ - protected $_lineItemTotalExportMap = array(); + protected $_lineItemTotalExportMap = array( + Mage_Paypal_Model_Cart::TOTAL_TAX => 'TAXAMT', + Mage_Paypal_Model_Cart::TOTAL_SHIPPING => 'FREIGHTAMT', + ); + protected $_lineItemExportItemsFormat = array( 'name' => 'L_NAME%d', 'qty' => 'L_QTY%d', diff --git a/app/code/core/Mage/PaypalUk/Model/Direct.php b/app/code/core/Mage/PaypalUk/Model/Direct.php index 2f9097f1b883249558dfa135d79a969df9619760..325956d842f8394aa3aa03a42d040fc2cafa9097 100644 --- a/app/code/core/Mage/PaypalUk/Model/Direct.php +++ b/app/code/core/Mage/PaypalUk/Model/Direct.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_PaypalUk - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/PaypalUk/Model/Express.php b/app/code/core/Mage/PaypalUk/Model/Express.php index 87df733a801744a2fdd8d2d3f44945666823dc0d..64383eb90ce0a4961e11d289c884756775f32728 100644 --- a/app/code/core/Mage/PaypalUk/Model/Express.php +++ b/app/code/core/Mage/PaypalUk/Model/Express.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_PaypalUk - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/PaypalUk/Model/Express/Checkout.php b/app/code/core/Mage/PaypalUk/Model/Express/Checkout.php index 8a0ed78c7f88e28db98e1dc26e04e8be7b6edfd5..e06cdca4523a378814d0e4cbc94945496e4eb32d 100644 --- a/app/code/core/Mage/PaypalUk/Model/Express/Checkout.php +++ b/app/code/core/Mage/PaypalUk/Model/Express/Checkout.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_PaypalUk - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/PaypalUk/Model/Pro.php b/app/code/core/Mage/PaypalUk/Model/Pro.php index eeeef6da4c0bb6beb07523d5415bcf18dc34aca2..bfd680eec04a4c6a41870cdefc24e20d5ce3b036 100644 --- a/app/code/core/Mage/PaypalUk/Model/Pro.php +++ b/app/code/core/Mage/PaypalUk/Model/Pro.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_PaypalUk - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/PaypalUk/Model/Session.php b/app/code/core/Mage/PaypalUk/Model/Session.php index 327b7024294a386f5fa69bb683a77bd6f53391cc..e4e8f51446ace0d25a4208ae905e3b6e4ae971c5 100644 --- a/app/code/core/Mage/PaypalUk/Model/Session.php +++ b/app/code/core/Mage/PaypalUk/Model/Session.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_PaypalUk - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/PaypalUk/controllers/ExpressController.php b/app/code/core/Mage/PaypalUk/controllers/ExpressController.php index cb7a04d0fbfda0356642ba73125390bbcff6e34e..5bd8dc644ecccd00afdad590bf4b86b79c691b84 100644 --- a/app/code/core/Mage/PaypalUk/controllers/ExpressController.php +++ b/app/code/core/Mage/PaypalUk/controllers/ExpressController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_PaypalUk - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/PaypalUk/etc/config.xml b/app/code/core/Mage/PaypalUk/etc/config.xml index d3374b9a03b5ae30760de98e1eac971027fbe6fa..434f2cece1c072921fe635c2fce9ed6ecebf311c 100644 --- a/app/code/core/Mage/PaypalUk/etc/config.xml +++ b/app/code/core/Mage/PaypalUk/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_PaypalUk - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/PaypalUk/sql/paypaluk_setup/install-1.6.0.0.php b/app/code/core/Mage/PaypalUk/sql/paypaluk_setup/install-1.6.0.0.php index 0689c15811af2c85f469ab4519720ccf132d00a9..f974f2264af46b3c3576e3df62552f9de92af9da 100644 --- a/app/code/core/Mage/PaypalUk/sql/paypaluk_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/PaypalUk/sql/paypaluk_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_PaypalUk - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/PaypalUk/view/frontend/layout.xml b/app/code/core/Mage/PaypalUk/view/frontend/layout.xml index 5ee8435d778772211da2e065af394c7ac89d39c3..8fa647dc79e828b2d0a8c4088acdf02e97db83a8 100644 --- a/app/code/core/Mage/PaypalUk/view/frontend/layout.xml +++ b/app/code/core/Mage/PaypalUk/view/frontend/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/Persistent/Block/Form/Remember.php b/app/code/core/Mage/Persistent/Block/Form/Remember.php index da87deb601b1c16fade35a652c0825b0a489c25a..fd5fedba47e0341cfb4a4f35ac3bbf37cbe4a991 100644 --- a/app/code/core/Mage/Persistent/Block/Form/Remember.php +++ b/app/code/core/Mage/Persistent/Block/Form/Remember.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Persistent - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Persistent/Block/Header/Additional.php b/app/code/core/Mage/Persistent/Block/Header/Additional.php index 028086f454b291d95135f18ff5a91232ae4a951d..3732630aae76029c3115737906175801fcd41335 100644 --- a/app/code/core/Mage/Persistent/Block/Header/Additional.php +++ b/app/code/core/Mage/Persistent/Block/Header/Additional.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Persistent - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Persistent/Helper/Data.php b/app/code/core/Mage/Persistent/Helper/Data.php index e7bc5f7ab7aa6140664a6ee9daa4c2a26f9366e9..2ddb5e92feac88583ec746e1fe45667e969ad938 100644 --- a/app/code/core/Mage/Persistent/Helper/Data.php +++ b/app/code/core/Mage/Persistent/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Persistent - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Persistent/Helper/Session.php b/app/code/core/Mage/Persistent/Helper/Session.php index df58f5c8039de4119f9fb8a2264aea8110eae6ff..18256e7bff14a5c55a3623e0815081aba60d2408 100644 --- a/app/code/core/Mage/Persistent/Helper/Session.php +++ b/app/code/core/Mage/Persistent/Helper/Session.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Persistent - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -37,23 +37,23 @@ class Mage_Persistent_Helper_Session extends Mage_Core_Helper_Data /** * Instance of Session Model * - * @var Mage_Persistent_Model_Session + * @var null|Mage_Persistent_Model_Session */ - protected $_sessionModel = null; + protected $_sessionModel; /** * Persistent customer * - * @var Mage_Customer_Model_Customer + * @var null|Mage_Customer_Model_Customer */ - protected $_customer = null; + protected $_customer; /** * Is "Remember Me" checked * - * @var bool + * @var null|bool */ - protected $_isRememberMeChecked = null; + protected $_isRememberMeChecked; /** * Get Session model @@ -88,7 +88,7 @@ class Mage_Persistent_Helper_Session extends Mage_Core_Helper_Data */ public function isPersistent() { - return (bool)$this->getSession()->getId() && Mage::helper('Mage_Persistent_Helper_Data')->isEnabled(); + return $this->getSession()->getId() && Mage::helper('Mage_Persistent_Helper_Data')->isEnabled(); } /** diff --git a/app/code/core/Mage/Persistent/Model/Observer.php b/app/code/core/Mage/Persistent/Model/Observer.php index e8d3a31b51e332a6affd19e402766d93888621d1..75d7ff2068deca717d396351d0f2b12699797ae4 100644 --- a/app/code/core/Mage/Persistent/Model/Observer.php +++ b/app/code/core/Mage/Persistent/Model/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Persistent - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -299,8 +299,7 @@ class Mage_Persistent_Model_Observer { /** @var $customerSession Mage_Customer_Model_Session */ $customerSession = Mage::getSingleton('Mage_Customer_Model_Session'); - $customerSession->setCustomerId(null) - ->setCustomerGroupId(null); + $customerSession->setCustomerId(null)->setCustomerGroupId(null); if (Mage::app()->getRequest()->getParam('context') != 'checkout') { $this->_expirePersistentSession(); @@ -325,8 +324,7 @@ class Mage_Persistent_Model_Observer /** @var $customerSession Mage_Customer_Model_Session */ $customerSession = Mage::getSingleton('Mage_Customer_Model_Session'); if (!$customerSession->isLoggedIn()) { - $customerSession->setCustomerId(null) - ->setCustomerGroupId(null); + $customerSession->setCustomerId(null)->setCustomerGroupId(null); } $this->setQuoteGuest(); @@ -502,6 +500,8 @@ class Mage_Persistent_Model_Observer && !$this->_isPersistent() && !$customerSession->isLoggedIn() && Mage::getSingleton('Mage_Checkout_Model_Session')->getQuoteId() + && !($observer->getControllerAction() instanceof Mage_Checkout_OnepageController) + // persistent session does not expire on onepage checkout page to not spoil customer group id ) { Mage::dispatchEvent('persistent_session_expired'); $this->_expirePersistentSession(); diff --git a/app/code/core/Mage/Persistent/Model/Observer/Session.php b/app/code/core/Mage/Persistent/Model/Observer/Session.php index f84599273e499de6d21f0f031c17b5b9a18b6252..0571e43dffda8d3214f2a928949d82ec73ead10d 100644 --- a/app/code/core/Mage/Persistent/Model/Observer/Session.php +++ b/app/code/core/Mage/Persistent/Model/Observer/Session.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Persistent - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Persistent/Model/Persistent/Config.php b/app/code/core/Mage/Persistent/Model/Persistent/Config.php index 4f85b8da0846571499f0376978d551641cea85a2..04be60a875c3b5b23b602da04c1b4239d1d4cde9 100644 --- a/app/code/core/Mage/Persistent/Model/Persistent/Config.php +++ b/app/code/core/Mage/Persistent/Model/Persistent/Config.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Persistent - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Persistent/Model/Resource/Session.php b/app/code/core/Mage/Persistent/Model/Resource/Session.php index a2ac749d90faa91a58bc7e5abe7cc206129f8c26..d308fb83f4437b3013df953406ca2120604e036f 100644 --- a/app/code/core/Mage/Persistent/Model/Resource/Session.php +++ b/app/code/core/Mage/Persistent/Model/Resource/Session.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Persistent - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -61,7 +61,10 @@ class Mage_Persistent_Model_Resource_Session extends Mage_Core_Model_Resource_Db { $select = parent::_getLoadSelect($field, $value, $object); if (!$object->getLoadExpired()) { - $select->where('updated_at >= ?', $object->getExpiredBefore()); + $select->join( + array('customer' => $this->getTable('customer_entity')), + 'customer.entity_id = persistent_session.customer_id' + )->where('persistent_session.updated_at >= ?', $object->getExpiredBefore()); } return $select; diff --git a/app/code/core/Mage/Persistent/Model/Session.php b/app/code/core/Mage/Persistent/Model/Session.php index c235f7e125585f7c6417038fc51c8aadbf6983fd..8cff9ed6af3ffb07118c1d1873cd5dfb1c739d0b 100644 --- a/app/code/core/Mage/Persistent/Model/Session.php +++ b/app/code/core/Mage/Persistent/Model/Session.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Persistent - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Persistent/controllers/IndexController.php b/app/code/core/Mage/Persistent/controllers/IndexController.php index 2ebafa6ef3ed4fac269f4c764445faf152b4af2e..e50192159742d5dd76012d9768957fd5e472e592 100644 --- a/app/code/core/Mage/Persistent/controllers/IndexController.php +++ b/app/code/core/Mage/Persistent/controllers/IndexController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Persistent - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Persistent/etc/adminhtml.xml b/app/code/core/Mage/Persistent/etc/adminhtml.xml index 5ccdc32bc49f386773946e80fd6d8fc01507f976..7aeb3491c685ad688437da075dd4812c311ee498 100644 --- a/app/code/core/Mage/Persistent/etc/adminhtml.xml +++ b/app/code/core/Mage/Persistent/etc/adminhtml.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Persistent - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Persistent/etc/config.xml b/app/code/core/Mage/Persistent/etc/config.xml index adb22ff00943e7c348863d6bb358ef8be93c5862..99392349cf7a047797299f24f045efe9080a89a4 100644 --- a/app/code/core/Mage/Persistent/etc/config.xml +++ b/app/code/core/Mage/Persistent/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Persistent - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Persistent/etc/persistent.xml b/app/code/core/Mage/Persistent/etc/persistent.xml index a59670c68ff4472699a198ceaa854b1673c9b35b..60846b683fe23ce34c35694f6d807b28f1c1b446 100644 --- a/app/code/core/Mage/Persistent/etc/persistent.xml +++ b/app/code/core/Mage/Persistent/etc/persistent.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Persistent - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Persistent/etc/system.xml b/app/code/core/Mage/Persistent/etc/system.xml index 6ddca53a84195caa1f7cfd01f36c39dd073aafc5..5f715beaba762e737bdedb1e22e25321472221df 100644 --- a/app/code/core/Mage/Persistent/etc/system.xml +++ b/app/code/core/Mage/Persistent/etc/system.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Persistent - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Persistent/sql/persistent_setup/install-1.0.0.0.php b/app/code/core/Mage/Persistent/sql/persistent_setup/install-1.0.0.0.php index 342cb44575d46679abbd2eef861920a611a89507..b0f12af6cd0e4fb8a7c1b5734cd0158e9a12d3b7 100644 --- a/app/code/core/Mage/Persistent/sql/persistent_setup/install-1.0.0.0.php +++ b/app/code/core/Mage/Persistent/sql/persistent_setup/install-1.0.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Persistent - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Persistent/view/frontend/checkout/onepage/billing.phtml b/app/code/core/Mage/Persistent/view/frontend/checkout/onepage/billing.phtml index 854b359aa9f01b8d2da1c627a612329c1f9a93bd..7094709660cb28066e6aa1433b1989c69414d723 100644 --- a/app/code/core/Mage/Persistent/view/frontend/checkout/onepage/billing.phtml +++ b/app/code/core/Mage/Persistent/view/frontend/checkout/onepage/billing.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /** @var Mage_Checkout_Block_Onepage_Billing $this */ @@ -70,6 +70,12 @@ </div> </li> <?php endfor ?> + <li class="wide"> + <label for="billing:vat_id"><?php echo $this->__('VAT Number') ?></label> + <div class="input-box"> + <input type="text" id="billing:vat_id" name="billing[vat_id]" value="<?php echo $this->escapeHtml($this->getAddress()->getVatId()) ?>" title="<?php echo $this->__('VAT Number') ?>" class="input-text" /> + </div> + </li> <li class="fields"> <div class="field"> <label for="billing:city" class="required"><em>*</em><?php echo $this->__('City') ?></label> @@ -166,6 +172,7 @@ <?php else:?> <li class="no-display"><input type="hidden" name="billing[save_in_address_book]" value="1" /></li> <?php endif; ?> + <?php echo $this->getChildHtml('form.additional.info'); ?> </ul> <?php echo $this->getChildHtml('persistent.remember.me.tooltip'); ?> </fieldset> diff --git a/app/code/core/Mage/Persistent/view/frontend/checkout/onepage/login.phtml b/app/code/core/Mage/Persistent/view/frontend/checkout/onepage/login.phtml index cee555445c4cba1c9a131021a6a1026b9a0b393f..6e9e703c64616d6a92bf45cfe5df78eb13693cb0 100644 --- a/app/code/core/Mage/Persistent/view/frontend/checkout/onepage/login.phtml +++ b/app/code/core/Mage/Persistent/view/frontend/checkout/onepage/login.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -87,6 +87,7 @@ <input type="password" class="input-text required-entry" id="login-password" name="login[password]" /> </div> </li> + <?php echo $this->getChildHtml('form.additional.info'); ?> <?php echo $this->getChildHtml('persistent.remember.me'); ?> </ul> <input name="context" type="hidden" value="checkout" /> diff --git a/app/code/core/Mage/Persistent/view/frontend/customer/form/login.phtml b/app/code/core/Mage/Persistent/view/frontend/customer/form/login.phtml index 35b6a02b6ee2fd5a963c4bf9645d7ed3689b5a88..b1c3f552cf0d2c2d7d3b4bd59315931cea95a3a0 100644 --- a/app/code/core/Mage/Persistent/view/frontend/customer/form/login.phtml +++ b/app/code/core/Mage/Persistent/view/frontend/customer/form/login.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -62,6 +62,7 @@ <input type="password" name="login[password]" class="input-text required-entry validate-password" id="pass" title="<?php echo $this->__('Password') ?>" /> </div> </li> + <?php echo $this->getChildHtml('form.additional.info'); ?> <?php echo $this->getChildHtml('persistent.remember.me'); ?> </ul> <?php echo $this->getChildHtml('persistent.remember.me.tooltip'); ?> diff --git a/app/code/core/Mage/Persistent/view/frontend/customer/form/register.phtml b/app/code/core/Mage/Persistent/view/frontend/customer/form/register.phtml index f36b3d457721dc3b4d23cd7b8bed40ae7b151cc1..52c5342c04a856abc7887018671f26c3d2d3c355 100644 --- a/app/code/core/Mage/Persistent/view/frontend/customer/form/register.phtml +++ b/app/code/core/Mage/Persistent/view/frontend/customer/form/register.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -165,6 +165,7 @@ </div> </div> </li> + <?php echo $this->getChildHtml('form.additional.info'); ?> <?php echo $this->getChildHtml('persistent.remember.me'); ?> </ul> <?php echo $this->getChildHtml('persistent.remember.me.tooltip'); ?> diff --git a/app/code/core/Mage/Persistent/view/frontend/layout.xml b/app/code/core/Mage/Persistent/view/frontend/layout.xml index 09aac8c75b2346bbe7f610a4eed6c7dca4a90bab..c326592c90c49692f6cec4358f98a031f3c8abac 100644 --- a/app/code/core/Mage/Persistent/view/frontend/layout.xml +++ b/app/code/core/Mage/Persistent/view/frontend/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/Persistent/view/frontend/remember_me.phtml b/app/code/core/Mage/Persistent/view/frontend/remember_me.phtml index 8f5b309b7130e92876ccd92378a8dc995a3b51a8..9b821229c55f9c61c38bb32211749ad6db94548f 100644 --- a/app/code/core/Mage/Persistent/view/frontend/remember_me.phtml +++ b/app/code/core/Mage/Persistent/view/frontend/remember_me.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Persistent/view/frontend/remember_me_tooltip.phtml b/app/code/core/Mage/Persistent/view/frontend/remember_me_tooltip.phtml index bcb46ccd23f9a8f6dfcdc574a97c17ff327c068c..fa796e3c0d361c13425da5176aef2a8b15ffc73e 100644 --- a/app/code/core/Mage/Persistent/view/frontend/remember_me_tooltip.phtml +++ b/app/code/core/Mage/Persistent/view/frontend/remember_me_tooltip.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Poll/Block/ActivePoll.php b/app/code/core/Mage/Poll/Block/ActivePoll.php index 1bfecd1b81b3231467711ba68daca6d67f200d19..40937c32ecd3b6a3df74db46411fb4fe31473551 100755 --- a/app/code/core/Mage/Poll/Block/ActivePoll.php +++ b/app/code/core/Mage/Poll/Block/ActivePoll.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Poll - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Poll/Helper/Data.php b/app/code/core/Mage/Poll/Helper/Data.php index 44d9c973598abcbe3fd3f07230e5c79e2b35b3eb..a0b915e64f735da792321dc69310fcd9feb20639 100644 --- a/app/code/core/Mage/Poll/Helper/Data.php +++ b/app/code/core/Mage/Poll/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Poll - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Poll/Model/Poll.php b/app/code/core/Mage/Poll/Model/Poll.php index 922ff7a1d34d1d45f6c6193ebbb27cd4b7e5540b..c7d3409bf4668c8f335c4e5604d7568cd762c8c3 100644 --- a/app/code/core/Mage/Poll/Model/Poll.php +++ b/app/code/core/Mage/Poll/Model/Poll.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Poll - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Poll/Model/Poll/Answer.php b/app/code/core/Mage/Poll/Model/Poll/Answer.php index a9180c1919960314e03ea0e93deaca3b3aa303f1..0767dc5b418fdeb8ab0c5687a27dd7103ceae9d9 100644 --- a/app/code/core/Mage/Poll/Model/Poll/Answer.php +++ b/app/code/core/Mage/Poll/Model/Poll/Answer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Poll - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Poll/Model/Poll/Vote.php b/app/code/core/Mage/Poll/Model/Poll/Vote.php index 6e3045fbed38948a32937336d527b19ac5e031aa..87d545fc3ea29915f8a7fcae815768d992871278 100644 --- a/app/code/core/Mage/Poll/Model/Poll/Vote.php +++ b/app/code/core/Mage/Poll/Model/Poll/Vote.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Poll - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Poll/Model/Resource/Poll.php b/app/code/core/Mage/Poll/Model/Resource/Poll.php index a91eca5a66501e32ba1ed3da1816c343ad26ef5e..acc1cc433f2e86b6f6c5244fe636ec92a04d842d 100755 --- a/app/code/core/Mage/Poll/Model/Resource/Poll.php +++ b/app/code/core/Mage/Poll/Model/Resource/Poll.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Poll - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Poll/Model/Resource/Poll/Answer.php b/app/code/core/Mage/Poll/Model/Resource/Poll/Answer.php index d020e9275a43116ec849ee9db9bade825b592ffa..7bfd60b8397c443b7101da927f88c106c5a7304c 100755 --- a/app/code/core/Mage/Poll/Model/Resource/Poll/Answer.php +++ b/app/code/core/Mage/Poll/Model/Resource/Poll/Answer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Poll - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Poll/Model/Resource/Poll/Answer/Collection.php b/app/code/core/Mage/Poll/Model/Resource/Poll/Answer/Collection.php index 7140e7d87173055b6ed322e954ccd12cb09e35fe..914969359892fe499e48cb13ff1a73c8df2f6dd6 100755 --- a/app/code/core/Mage/Poll/Model/Resource/Poll/Answer/Collection.php +++ b/app/code/core/Mage/Poll/Model/Resource/Poll/Answer/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Poll - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Poll/Model/Resource/Poll/Collection.php b/app/code/core/Mage/Poll/Model/Resource/Poll/Collection.php index 8ef2aebd5f9c737cb9d06119b635ae144903ea63..86774ea5640277da8bd4ad13ce12d9af1bd36e41 100755 --- a/app/code/core/Mage/Poll/Model/Resource/Poll/Collection.php +++ b/app/code/core/Mage/Poll/Model/Resource/Poll/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Poll - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Poll/Model/Resource/Poll/Vote.php b/app/code/core/Mage/Poll/Model/Resource/Poll/Vote.php index 422ac77945dc9d8aba595c810f556da0017a4393..ae669cca02d1efdfafbcd0e70a21bb8f03a5de61 100755 --- a/app/code/core/Mage/Poll/Model/Resource/Poll/Vote.php +++ b/app/code/core/Mage/Poll/Model/Resource/Poll/Vote.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Poll - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Poll/controllers/VoteController.php b/app/code/core/Mage/Poll/controllers/VoteController.php index 6f21cbf78ea7e1e99b4e0bcc00dbe7b8de796213..7cf9fd44ff18898c4c8f404cd131d80b24876f27 100644 --- a/app/code/core/Mage/Poll/controllers/VoteController.php +++ b/app/code/core/Mage/Poll/controllers/VoteController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Poll - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Poll/data/poll_setup/data-install-1.6.0.0.php b/app/code/core/Mage/Poll/data/poll_setup/data-install-1.6.0.0.php index ccf376e406693b696a81f37936261407323e66c1..cae80f3a9b093720bed2872c99084fc09fc74c56 100644 --- a/app/code/core/Mage/Poll/data/poll_setup/data-install-1.6.0.0.php +++ b/app/code/core/Mage/Poll/data/poll_setup/data-install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Poll - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Poll/etc/adminhtml.xml b/app/code/core/Mage/Poll/etc/adminhtml.xml index f950a2f69880cd463df998c51ddaae84d4d94755..0a1bbc1e82e2c1f656339d46e801ec2a520cdd70 100644 --- a/app/code/core/Mage/Poll/etc/adminhtml.xml +++ b/app/code/core/Mage/Poll/etc/adminhtml.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Poll - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Poll/etc/config.xml b/app/code/core/Mage/Poll/etc/config.xml index aba9bab9faa962308e3d4b240f4962757ae86491..74529904f2f5f5dae353a0c1c73b4b67ee57b93c 100644 --- a/app/code/core/Mage/Poll/etc/config.xml +++ b/app/code/core/Mage/Poll/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Poll - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Poll/etc/system.xml b/app/code/core/Mage/Poll/etc/system.xml index 247e62aed4a2a3fafa974dd63b5fee8af12da39a..358736f9edf837f92d831762b3212ec587e32145 100644 --- a/app/code/core/Mage/Poll/etc/system.xml +++ b/app/code/core/Mage/Poll/etc/system.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Poll - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Poll/sql/poll_setup/install-1.6.0.0.php b/app/code/core/Mage/Poll/sql/poll_setup/install-1.6.0.0.php index 68000ec8272db432c7db15fa8b10588c0fdebadd..a7d22648be94461c26c7ea0b12ad059c23551f25 100644 --- a/app/code/core/Mage/Poll/sql/poll_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/Poll/sql/poll_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Poll - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Poll/view/frontend/active.phtml b/app/code/core/Mage/Poll/view/frontend/active.phtml index 3bbfd4b134e4565ca816a7d1a741cf9de2c4723e..f54ef112ec9174624671189189a3b15535ca3943 100644 --- a/app/code/core/Mage/Poll/view/frontend/active.phtml +++ b/app/code/core/Mage/Poll/view/frontend/active.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Poll/view/frontend/layout.xml b/app/code/core/Mage/Poll/view/frontend/layout.xml index 3ba15ef7a44257f02744441902f683f02dc69d9b..44c01dc1f4c02fc0ca248129735e4c66645bcded 100644 --- a/app/code/core/Mage/Poll/view/frontend/layout.xml +++ b/app/code/core/Mage/Poll/view/frontend/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/Poll/view/frontend/result.phtml b/app/code/core/Mage/Poll/view/frontend/result.phtml index c2229d7348b57ad3e413ea97f5152f835cfcc514..e1b9c095e4c6cadad8a9145dc5cdd76bd56996f5 100644 --- a/app/code/core/Mage/Poll/view/frontend/result.phtml +++ b/app/code/core/Mage/Poll/view/frontend/result.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/ProductAlert/Block/Email/Abstract.php b/app/code/core/Mage/ProductAlert/Block/Email/Abstract.php index b6ff4b950e61b1041012dc7e58779919e686d078..5dc880d06957e356fb21953197271f4b8712b21a 100644 --- a/app/code/core/Mage/ProductAlert/Block/Email/Abstract.php +++ b/app/code/core/Mage/ProductAlert/Block/Email/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ProductAlert - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ProductAlert/Block/Email/Price.php b/app/code/core/Mage/ProductAlert/Block/Email/Price.php index 622c849c90987e72c1be5e92c48816e74e0edd1c..44a4b9ff811666457fb1c9d78402b515ff3effef 100644 --- a/app/code/core/Mage/ProductAlert/Block/Email/Price.php +++ b/app/code/core/Mage/ProductAlert/Block/Email/Price.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ProductAlert - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ProductAlert/Block/Email/Stock.php b/app/code/core/Mage/ProductAlert/Block/Email/Stock.php index 1f78e9ee8923a0206ca12fe88870a8804692cb5c..6b7121d07ae432c1d7616f4f7cc69bf8d0b587d6 100644 --- a/app/code/core/Mage/ProductAlert/Block/Email/Stock.php +++ b/app/code/core/Mage/ProductAlert/Block/Email/Stock.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ProductAlert - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ProductAlert/Block/Product/View.php b/app/code/core/Mage/ProductAlert/Block/Product/View.php index b6f8969d6e82f45bb584b7320035383a4ad61c3c..fabe2868c7717b11f3d5e9bab2391017930d0713 100644 --- a/app/code/core/Mage/ProductAlert/Block/Product/View.php +++ b/app/code/core/Mage/ProductAlert/Block/Product/View.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ProductAlert - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ProductAlert/Helper/Data.php b/app/code/core/Mage/ProductAlert/Helper/Data.php index cad126a22417af9979e8dfa638f3b55bb8b71bd6..690fca27d0c546583354b4ceac704518f197e8fd 100644 --- a/app/code/core/Mage/ProductAlert/Helper/Data.php +++ b/app/code/core/Mage/ProductAlert/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ProductAlert - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -34,11 +34,38 @@ */ class Mage_ProductAlert_Helper_Data extends Mage_Core_Helper_Url { + /** + * Current product instance (override registry one) + * + * @var null|Mage_Catalog_Model_Product + */ + protected $_product = null; + + /** + * Get current product instance + * + * @return Mage_Catalog_Model_Product + */ public function getProduct() { + if (!is_null($this->_product)) { + return $this->_product; + } return Mage::registry('product'); } + /** + * Set current product instance + * + * @param Mage_Catalog_Model_Product $product + * @return Mage_ProductAlert_Helper_Data + */ + public function setProduct($product) + { + $this->_product = $product; + return $this; + } + public function getCustomer() { return Mage::getSingleton('Mage_Customer_Model_Session'); diff --git a/app/code/core/Mage/ProductAlert/Model/Email.php b/app/code/core/Mage/ProductAlert/Model/Email.php index a64898bff447560a9143839cf860f15b629a8bf3..1e6d0dd309f319c6ee6f92aeda9f51f36e20be5f 100644 --- a/app/code/core/Mage/ProductAlert/Model/Email.php +++ b/app/code/core/Mage/ProductAlert/Model/Email.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ProductAlert - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ProductAlert/Model/Observer.php b/app/code/core/Mage/ProductAlert/Model/Observer.php index d303680c58b35164698af126b32cf9aac7bdf83b..65e5b6c1e34250adda00a2cca9fb64b558558fad 100644 --- a/app/code/core/Mage/ProductAlert/Model/Observer.php +++ b/app/code/core/Mage/ProductAlert/Model/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ProductAlert - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ProductAlert/Model/Price.php b/app/code/core/Mage/ProductAlert/Model/Price.php index 836b2b66be8b70d40459ec1adf6106df9515bd82..7ef817fa53994ae4ef72a65b8ab5d1a195f7f9c1 100644 --- a/app/code/core/Mage/ProductAlert/Model/Price.php +++ b/app/code/core/Mage/ProductAlert/Model/Price.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ProductAlert - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ProductAlert/Model/Resource/Abstract.php b/app/code/core/Mage/ProductAlert/Model/Resource/Abstract.php index d09ed0894c2ea45ffa956c19cb995fbc851816c6..e44885b06d9ba3c577d3c174e8f7576081e707f9 100644 --- a/app/code/core/Mage/ProductAlert/Model/Resource/Abstract.php +++ b/app/code/core/Mage/ProductAlert/Model/Resource/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ProductAlert - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ProductAlert/Model/Resource/Price.php b/app/code/core/Mage/ProductAlert/Model/Resource/Price.php index 823ca6836902023291965638e3d39797d6aefc40..eb7be8428dde01f6fa1a3e67c90548aca74dd676 100755 --- a/app/code/core/Mage/ProductAlert/Model/Resource/Price.php +++ b/app/code/core/Mage/ProductAlert/Model/Resource/Price.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ProductAlert - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ProductAlert/Model/Resource/Price/Collection.php b/app/code/core/Mage/ProductAlert/Model/Resource/Price/Collection.php index 07e123cd7e2d4943692209c4bfc1a76256f0e266..192eb458f0321bb0ea1ff72f029664e0bdb3b23f 100755 --- a/app/code/core/Mage/ProductAlert/Model/Resource/Price/Collection.php +++ b/app/code/core/Mage/ProductAlert/Model/Resource/Price/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ProductAlert - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ProductAlert/Model/Resource/Price/Customer/Collection.php b/app/code/core/Mage/ProductAlert/Model/Resource/Price/Customer/Collection.php index 31d799f0185223821a5062e2b99438f119a7eddc..e85beacefda396c8338b68c0c919e099823b5240 100755 --- a/app/code/core/Mage/ProductAlert/Model/Resource/Price/Customer/Collection.php +++ b/app/code/core/Mage/ProductAlert/Model/Resource/Price/Customer/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ProductAlert - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ProductAlert/Model/Resource/Stock.php b/app/code/core/Mage/ProductAlert/Model/Resource/Stock.php index 99d997de84cb91581cde7e8d5bc36710b6733893..7afdd421c5c72144b0c47f9177b536e3638c9bff 100755 --- a/app/code/core/Mage/ProductAlert/Model/Resource/Stock.php +++ b/app/code/core/Mage/ProductAlert/Model/Resource/Stock.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ProductAlert - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ProductAlert/Model/Resource/Stock/Collection.php b/app/code/core/Mage/ProductAlert/Model/Resource/Stock/Collection.php index ebe4e3ddd3e157d3124d88c911ae33ba7e5619e5..ea31c0c85a876d32f591342a4ba6f3807aa74469 100755 --- a/app/code/core/Mage/ProductAlert/Model/Resource/Stock/Collection.php +++ b/app/code/core/Mage/ProductAlert/Model/Resource/Stock/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ProductAlert - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ProductAlert/Model/Resource/Stock/Customer/Collection.php b/app/code/core/Mage/ProductAlert/Model/Resource/Stock/Customer/Collection.php index e963f39af65a38a92ecdece26de982f7db34587d..e6c551ab8b86ca468f3e6ded5701bcca97281136 100755 --- a/app/code/core/Mage/ProductAlert/Model/Resource/Stock/Customer/Collection.php +++ b/app/code/core/Mage/ProductAlert/Model/Resource/Stock/Customer/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ProductAlert - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ProductAlert/Model/Stock.php b/app/code/core/Mage/ProductAlert/Model/Stock.php index 41bb588aad804bd7a249a072e0a3f1796a659fe2..b92aa06acc5d54bb771c98455feca8fc2a4f9ca2 100644 --- a/app/code/core/Mage/ProductAlert/Model/Stock.php +++ b/app/code/core/Mage/ProductAlert/Model/Stock.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ProductAlert - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ProductAlert/controllers/AddController.php b/app/code/core/Mage/ProductAlert/controllers/AddController.php index eeabb9baaf1f73a36f1ec6693bd00e4e9d54fbdf..8cc72c2637ca0bdd45fcb5e106f0899b13fb0bbb 100644 --- a/app/code/core/Mage/ProductAlert/controllers/AddController.php +++ b/app/code/core/Mage/ProductAlert/controllers/AddController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ProductAlert - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -66,7 +66,11 @@ class Mage_ProductAlert_AddController extends Mage_Core_Controller_Front_Action if (!$product->getId()) { /* @var $product Mage_Catalog_Model_Product */ $session->addError($this->__('Not enough parameters.')); - $this->_redirectUrl($backUrl); + if ($this->_isUrlInternal($backUrl)) { + $this->_redirectUrl($backUrl); + } else { + $this->_redirect('/'); + } return ; } diff --git a/app/code/core/Mage/ProductAlert/controllers/UnsubscribeController.php b/app/code/core/Mage/ProductAlert/controllers/UnsubscribeController.php index e3da6eb42c4b1c6e73652847c29c651f2bfea760..036499c8d7bef9ab42c7b2728eb33f0ec0042d9b 100644 --- a/app/code/core/Mage/ProductAlert/controllers/UnsubscribeController.php +++ b/app/code/core/Mage/ProductAlert/controllers/UnsubscribeController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ProductAlert - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ProductAlert/etc/config.xml b/app/code/core/Mage/ProductAlert/etc/config.xml index ecf02ac3733e161f064b7e5f41dfe0b5912f11b9..2552ebe7400a8c17f7edb169c4b330d62db2060c 100644 --- a/app/code/core/Mage/ProductAlert/etc/config.xml +++ b/app/code/core/Mage/ProductAlert/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_ProductAlert - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/ProductAlert/etc/system.xml b/app/code/core/Mage/ProductAlert/etc/system.xml index 4fdaabb6b3895bec43444f96ac05731abe4baa1f..b9b801e8d2669fe84b70b865612be46311966da6 100644 --- a/app/code/core/Mage/ProductAlert/etc/system.xml +++ b/app/code/core/Mage/ProductAlert/etc/system.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_ProductAlert - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/ProductAlert/sql/productalert_setup/install-1.6.0.0.php b/app/code/core/Mage/ProductAlert/sql/productalert_setup/install-1.6.0.0.php index 16aaf0bf0a895d360f500796fdece674c3122f4d..415676cd736b5d0ba8ff1c81dec0d9bb69952930 100644 --- a/app/code/core/Mage/ProductAlert/sql/productalert_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/ProductAlert/sql/productalert_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ProductAlert - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/ProductAlert/view/frontend/email/price.phtml b/app/code/core/Mage/ProductAlert/view/frontend/email/price.phtml index 680800d485b07a03e90bc85756732789a69840a9..6f8a305636417f07488308c4dab268bf759cf929 100644 --- a/app/code/core/Mage/ProductAlert/view/frontend/email/price.phtml +++ b/app/code/core/Mage/ProductAlert/view/frontend/email/price.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/ProductAlert/view/frontend/email/stock.phtml b/app/code/core/Mage/ProductAlert/view/frontend/email/stock.phtml index b2566d282c52619d8c19d7cbda0d0ffba7b6f4a7..0ab1595952276198c2e6ceef7caa89270213956c 100644 --- a/app/code/core/Mage/ProductAlert/view/frontend/email/stock.phtml +++ b/app/code/core/Mage/ProductAlert/view/frontend/email/stock.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/ProductAlert/view/frontend/layout.xml b/app/code/core/Mage/ProductAlert/view/frontend/layout.xml index 0f0399c0cca4ee61144f3fbe363d0d2e684ae1c6..369319f454c8de8a5f93f09e3b59ed80b5fa635a 100644 --- a/app/code/core/Mage/ProductAlert/view/frontend/layout.xml +++ b/app/code/core/Mage/ProductAlert/view/frontend/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/ProductAlert/view/frontend/product/view.phtml b/app/code/core/Mage/ProductAlert/view/frontend/product/view.phtml index 1f502d865e7e91e5ac62ec6fe6bb60a2dd848f32..c28dcb44f88f767416663f15bed058c1cbbde3bd 100644 --- a/app/code/core/Mage/ProductAlert/view/frontend/product/view.phtml +++ b/app/code/core/Mage/ProductAlert/view/frontend/product/view.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Rating/Block/Entity/Detailed.php b/app/code/core/Mage/Rating/Block/Entity/Detailed.php index 66f389323f8c8efe5f6811d53b091f9db250033f..74d73afdd2ea822aac4903b42f647bd8787b829c 100644 --- a/app/code/core/Mage/Rating/Block/Entity/Detailed.php +++ b/app/code/core/Mage/Rating/Block/Entity/Detailed.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rating - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rating/Helper/Data.php b/app/code/core/Mage/Rating/Helper/Data.php index a71b6c275616f611ac6bfeaf9bb5a80685b5f560..1c4e894cbca8b4f6f29a07f69b302e85a56e1f8e 100644 --- a/app/code/core/Mage/Rating/Helper/Data.php +++ b/app/code/core/Mage/Rating/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rating - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rating/Model/Observer.php b/app/code/core/Mage/Rating/Model/Observer.php index de2c51b5f5c9c94e83156f550f4890cc1723b436..e3aa81d9742dc84b62d7a6b0c608f7516f3dd871 100644 --- a/app/code/core/Mage/Rating/Model/Observer.php +++ b/app/code/core/Mage/Rating/Model/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rating - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rating/Model/Rating.php b/app/code/core/Mage/Rating/Model/Rating.php index 333b93e4bec5c6b71315fa221cd9214a0b8a0889..aec5ef9c29ef56e4f470a0562ed505bd66c99738 100644 --- a/app/code/core/Mage/Rating/Model/Rating.php +++ b/app/code/core/Mage/Rating/Model/Rating.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rating - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rating/Model/Rating/Entity.php b/app/code/core/Mage/Rating/Model/Rating/Entity.php index 447a09d0fed1b2c4ef9257bb4f7800eeb83de5dc..6c4dc2bff8324de66232d9e1ab6e10a4537639aa 100644 --- a/app/code/core/Mage/Rating/Model/Rating/Entity.php +++ b/app/code/core/Mage/Rating/Model/Rating/Entity.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rating - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rating/Model/Rating/Option.php b/app/code/core/Mage/Rating/Model/Rating/Option.php index 939afac17275292ed48d3bf52b06d84de73b847c..042226aec5edc9233e811de98c781cb0677793ba 100644 --- a/app/code/core/Mage/Rating/Model/Rating/Option.php +++ b/app/code/core/Mage/Rating/Model/Rating/Option.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rating - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rating/Model/Rating/Option/Vote.php b/app/code/core/Mage/Rating/Model/Rating/Option/Vote.php index 4807f2dc6e1dfb5bc80962a1b2b710a9df9cd998..13e04d216c78e6dc5c2c1cb15c7abc27b3cd261d 100644 --- a/app/code/core/Mage/Rating/Model/Rating/Option/Vote.php +++ b/app/code/core/Mage/Rating/Model/Rating/Option/Vote.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rating - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rating/Model/Resource/Rating.php b/app/code/core/Mage/Rating/Model/Resource/Rating.php index 6752b305784587e083ff35ffe601ff92cd46fad9..b2f164c1fe1e3542f0b3a1a9b2906056b237c6f7 100755 --- a/app/code/core/Mage/Rating/Model/Resource/Rating.php +++ b/app/code/core/Mage/Rating/Model/Resource/Rating.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rating - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rating/Model/Resource/Rating/Collection.php b/app/code/core/Mage/Rating/Model/Resource/Rating/Collection.php index 12566eda6965dd2a869faf7f6ccdbab3cd20545f..7786852f078458616acdae585e5b6200d979f82e 100755 --- a/app/code/core/Mage/Rating/Model/Resource/Rating/Collection.php +++ b/app/code/core/Mage/Rating/Model/Resource/Rating/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rating - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rating/Model/Resource/Rating/Entity.php b/app/code/core/Mage/Rating/Model/Resource/Rating/Entity.php index a84c23f9a8beb5cd84f4c554fdabf6ebacc9a9bf..1b48176f5bd34404cc85bf7fbc05704664aca93a 100755 --- a/app/code/core/Mage/Rating/Model/Resource/Rating/Entity.php +++ b/app/code/core/Mage/Rating/Model/Resource/Rating/Entity.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rating - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rating/Model/Resource/Rating/Option.php b/app/code/core/Mage/Rating/Model/Resource/Rating/Option.php index e71fda1615a03d350f0c18f609e1e1898abd0f87..b11f3a497048629ce87b0a3334c8a2b80bf941de 100755 --- a/app/code/core/Mage/Rating/Model/Resource/Rating/Option.php +++ b/app/code/core/Mage/Rating/Model/Resource/Rating/Option.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rating - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rating/Model/Resource/Rating/Option/Collection.php b/app/code/core/Mage/Rating/Model/Resource/Rating/Option/Collection.php index b027beacd6013e6bacd600e0073c73b2c25c9b39..f4ad412a8e8b30cfcf7498cc054cb143c3bcd180 100755 --- a/app/code/core/Mage/Rating/Model/Resource/Rating/Option/Collection.php +++ b/app/code/core/Mage/Rating/Model/Resource/Rating/Option/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rating - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rating/Model/Resource/Rating/Option/Vote.php b/app/code/core/Mage/Rating/Model/Resource/Rating/Option/Vote.php index 82217277e5a9e9e0d186e5dfd43f79e74007a129..2d3be94a10c796a27d553592cc60f6344008cfbb 100755 --- a/app/code/core/Mage/Rating/Model/Resource/Rating/Option/Vote.php +++ b/app/code/core/Mage/Rating/Model/Resource/Rating/Option/Vote.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rating - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rating/Model/Resource/Rating/Option/Vote/Collection.php b/app/code/core/Mage/Rating/Model/Resource/Rating/Option/Vote/Collection.php index 13afd075c28f96333124e14ce4b78088d824058f..54d71ddb620c5c48e54cbcafc488f3ac1bc159ef 100755 --- a/app/code/core/Mage/Rating/Model/Resource/Rating/Option/Vote/Collection.php +++ b/app/code/core/Mage/Rating/Model/Resource/Rating/Option/Vote/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rating - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rating/data/rating_setup/data-install-1.6.0.0.php b/app/code/core/Mage/Rating/data/rating_setup/data-install-1.6.0.0.php index 09b8cad32f2970b773fda5007b32b3ec22dd879d..31ddee9077683f883aacb053baf6a8af9cffd7f3 100644 --- a/app/code/core/Mage/Rating/data/rating_setup/data-install-1.6.0.0.php +++ b/app/code/core/Mage/Rating/data/rating_setup/data-install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rating - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rating/etc/adminhtml.xml b/app/code/core/Mage/Rating/etc/adminhtml.xml index 9a3f92b53b2b6462eee03f6ed42790037cb5c15f..b90406640b1ab3d5b50a87044f83a448dc819e5b 100644 --- a/app/code/core/Mage/Rating/etc/adminhtml.xml +++ b/app/code/core/Mage/Rating/etc/adminhtml.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Rating - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Rating/etc/config.xml b/app/code/core/Mage/Rating/etc/config.xml index e17357aa9a297d673b4e7460fd8bd257801ef3d0..111a431a6f9a630898c06dc9e0f230e17c45b846 100644 --- a/app/code/core/Mage/Rating/etc/config.xml +++ b/app/code/core/Mage/Rating/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Rating - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Rating/sql/rating_setup/install-1.6.0.0.php b/app/code/core/Mage/Rating/sql/rating_setup/install-1.6.0.0.php index 12a98e35b86d72936c422c3cad86bfd6d4efa839..574d69f54e8ad3d3daac2036adacbcb6068598ba 100644 --- a/app/code/core/Mage/Rating/sql/rating_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/Rating/sql/rating_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rating - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rating/view/frontend/detailed.phtml b/app/code/core/Mage/Rating/view/frontend/detailed.phtml index 9acff8d8968d4dc5398314517af7176a77f098b3..f813ad07cf31117b92c7f3d8a49fd2ab60587d5d 100644 --- a/app/code/core/Mage/Rating/view/frontend/detailed.phtml +++ b/app/code/core/Mage/Rating/view/frontend/detailed.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Rating/view/frontend/empty.phtml b/app/code/core/Mage/Rating/view/frontend/empty.phtml index 4ef3ac05cc0bb66350458da7ec741ebb1e6f3e12..f61cce5ea1b08a3814211f0657f1b873bea0a03c 100644 --- a/app/code/core/Mage/Rating/view/frontend/empty.phtml +++ b/app/code/core/Mage/Rating/view/frontend/empty.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Reports/Block/Product/Abstract.php b/app/code/core/Mage/Reports/Block/Product/Abstract.php index 8860c41aa2051d87560dc0a23f9bc1bd947f5d2f..56ab21443bff7af57daf9d00d8fe6387f19d7047 100644 --- a/app/code/core/Mage/Reports/Block/Product/Abstract.php +++ b/app/code/core/Mage/Reports/Block/Product/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Block/Product/Compared.php b/app/code/core/Mage/Reports/Block/Product/Compared.php index abd5c7b5dcacba8bb1d6c60b20d1c2b26dae6969..4c5e5b54148161c87a411e9b10001e4ba3c77a2d 100644 --- a/app/code/core/Mage/Reports/Block/Product/Compared.php +++ b/app/code/core/Mage/Reports/Block/Product/Compared.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Block/Product/Viewed.php b/app/code/core/Mage/Reports/Block/Product/Viewed.php index c09553aee9732b4790fb575dfbc46b9d348e953a..5ff979fbd80212ee99a4eb2f55fd1afd500a37e8 100644 --- a/app/code/core/Mage/Reports/Block/Product/Viewed.php +++ b/app/code/core/Mage/Reports/Block/Product/Viewed.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Block/Product/Widget/Compared.php b/app/code/core/Mage/Reports/Block/Product/Widget/Compared.php index 899733dc2b1cecf927488c92f6f652f3febb9091..1717a33f6e404afc4c823f989daf5aca2b1042bf 100644 --- a/app/code/core/Mage/Reports/Block/Product/Widget/Compared.php +++ b/app/code/core/Mage/Reports/Block/Product/Widget/Compared.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Block/Product/Widget/Viewed.php b/app/code/core/Mage/Reports/Block/Product/Widget/Viewed.php index 3a983d3ef6a34470c6792d860fcfe1d5e66d2261..9afd18002fc56867e2e9530f8e0f8a9b6446b073 100644 --- a/app/code/core/Mage/Reports/Block/Product/Widget/Viewed.php +++ b/app/code/core/Mage/Reports/Block/Product/Widget/Viewed.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Exception.php b/app/code/core/Mage/Reports/Exception.php index bea573e35adb1ad80a163ed456f205a188ad121b..9696c56c882eb1ce8ea14cdae803cfeb70583aa1 100644 --- a/app/code/core/Mage/Reports/Exception.php +++ b/app/code/core/Mage/Reports/Exception.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Helper/Data.php b/app/code/core/Mage/Reports/Helper/Data.php index 4b6cc23784b6b53b46411b09a364917544ced9a3..7021a7a828a703330bb8fd1df3e17d1644504d42 100644 --- a/app/code/core/Mage/Reports/Helper/Data.php +++ b/app/code/core/Mage/Reports/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Config.php b/app/code/core/Mage/Reports/Model/Config.php index 64d8993a4a653881336c2e4a73e01b5058d3632d..93c5e25e24c5dce9f88e1b3383e2ed6dfef8b63a 100644 --- a/app/code/core/Mage/Reports/Model/Config.php +++ b/app/code/core/Mage/Reports/Model/Config.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Event.php b/app/code/core/Mage/Reports/Model/Event.php index 493ac93f989bdb54f0bac56d91016e6a987d7696..0b1544b4b7ec38e5efae8041e61272d3380be6a6 100644 --- a/app/code/core/Mage/Reports/Model/Event.php +++ b/app/code/core/Mage/Reports/Model/Event.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Event/Observer.php b/app/code/core/Mage/Reports/Model/Event/Observer.php index 1249d763669afb7a3d0f7c3f233aae571f739b03..d5a5ea207a98863305919485093328af74c8c50f 100644 --- a/app/code/core/Mage/Reports/Model/Event/Observer.php +++ b/app/code/core/Mage/Reports/Model/Event/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Event/Type.php b/app/code/core/Mage/Reports/Model/Event/Type.php index 378fe2e2437d18b9e5b4802314ac27251205a55e..757e307250fa4d2db69a39b5ce7e8c84b955eee5 100644 --- a/app/code/core/Mage/Reports/Model/Event/Type.php +++ b/app/code/core/Mage/Reports/Model/Event/Type.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Flag.php b/app/code/core/Mage/Reports/Model/Flag.php index fe2fad95f93a7a5451b00961c5ee6c04f7f3ebd5..891d1fdc36f3f563357a3984aafd01ec4a784e3f 100644 --- a/app/code/core/Mage/Reports/Model/Flag.php +++ b/app/code/core/Mage/Reports/Model/Flag.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -41,6 +41,7 @@ class Mage_Reports_Model_Flag extends Mage_Core_Model_Flag const REPORT_REFUNDED_FLAG_CODE = 'report_refunded_aggregated'; const REPORT_COUPONS_FLAG_CODE = 'report_coupons_aggregated'; const REPORT_BESTSELLERS_FLAG_CODE = 'report_bestsellers_aggregated'; + const REPORT_PRODUCT_VIEWED_FLAG_CODE = 'report_product_viewed_aggregated'; /** * Setter for flag code diff --git a/app/code/core/Mage/Reports/Model/Grouped/Collection.php b/app/code/core/Mage/Reports/Model/Grouped/Collection.php index 5503174b1dc85e02da1c3601101636b42b122545..1852b2c5ba50594ccb0b7edf8105ce57c11670ba 100644 --- a/app/code/core/Mage/Reports/Model/Grouped/Collection.php +++ b/app/code/core/Mage/Reports/Model/Grouped/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Reports_Model_Grouped_Collection diff --git a/app/code/core/Mage/Reports/Model/Product/Index/Abstract.php b/app/code/core/Mage/Reports/Model/Product/Index/Abstract.php index 261d86c337b7d05aa5f4065e267a30944e13ab12..f82ebdc4ec2f87ad68a718bdf1536bdcbcf31b0b 100644 --- a/app/code/core/Mage/Reports/Model/Product/Index/Abstract.php +++ b/app/code/core/Mage/Reports/Model/Product/Index/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Product/Index/Compared.php b/app/code/core/Mage/Reports/Model/Product/Index/Compared.php index 2afc71b8e1be335fb5df361a5c8aa215e128d47c..176bde8f294d562ac2bcb0f4818d293ffda1de68 100644 --- a/app/code/core/Mage/Reports/Model/Product/Index/Compared.php +++ b/app/code/core/Mage/Reports/Model/Product/Index/Compared.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Product/Index/Viewed.php b/app/code/core/Mage/Reports/Model/Product/Index/Viewed.php index cc5cb69a37ef065a5783d4a3c6988d55d35d1261..79ba3614ad7cf8aee33917cb654a151bfb8a294f 100644 --- a/app/code/core/Mage/Reports/Model/Product/Index/Viewed.php +++ b/app/code/core/Mage/Reports/Model/Product/Index/Viewed.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Report.php b/app/code/core/Mage/Reports/Model/Report.php index 8644f5373095c029fc2e5800231a7efafd4c0885..5f6ae7c015b01b3e3ddef1713bdf192583b56d63 100644 --- a/app/code/core/Mage/Reports/Model/Report.php +++ b/app/code/core/Mage/Reports/Model/Report.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Resource/Accounts/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Accounts/Collection.php index 143c50fbc6e5ad8d7a07827f377187e40e5122f7..d91f7826f03bf46384db3da83f4808791a23def1 100755 --- a/app/code/core/Mage/Reports/Model/Resource/Accounts/Collection.php +++ b/app/code/core/Mage/Reports/Model/Resource/Accounts/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Resource/Customer/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Customer/Collection.php index c7b44eb6256e9c535c4cb530aae5961544dbff39..14532fa86cbe3a0b555c81f0c7918ae8735c9b58 100755 --- a/app/code/core/Mage/Reports/Model/Resource/Customer/Collection.php +++ b/app/code/core/Mage/Reports/Model/Resource/Customer/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Resource/Customer/Orders/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Customer/Orders/Collection.php index c5c42ceb889189b9de2c26a944d76aff1bcd093e..dc2e763e10791ee276efc15e49414462dd165b44 100755 --- a/app/code/core/Mage/Reports/Model/Resource/Customer/Orders/Collection.php +++ b/app/code/core/Mage/Reports/Model/Resource/Customer/Orders/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Resource/Customer/Totals/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Customer/Totals/Collection.php index d7c9045eb95fa80e82ead6b1de361ce677af9dfb..f42e1e628dd65c951ef263d6bd26c24aa88405ef 100755 --- a/app/code/core/Mage/Reports/Model/Resource/Customer/Totals/Collection.php +++ b/app/code/core/Mage/Reports/Model/Resource/Customer/Totals/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Resource/Entity/Summary/Collection/Abstract.php b/app/code/core/Mage/Reports/Model/Resource/Entity/Summary/Collection/Abstract.php index 9bdd82060e5e7d55451864a497a5369dc6a06d0a..acb791253feccb154928ffbf6d63b93e53eed090 100755 --- a/app/code/core/Mage/Reports/Model/Resource/Entity/Summary/Collection/Abstract.php +++ b/app/code/core/Mage/Reports/Model/Resource/Entity/Summary/Collection/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Resource/Event.php b/app/code/core/Mage/Reports/Model/Resource/Event.php index dc6c35223cab72abe6b78a2201ec74e6e661b081..eb0755219f0c174664df4b3f04bce909bf344a5e 100755 --- a/app/code/core/Mage/Reports/Model/Resource/Event.php +++ b/app/code/core/Mage/Reports/Model/Resource/Event.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Resource/Event/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Event/Collection.php index dac9d073b450e07443770924de5d734b2d7a3047..20bfbadc802aad6b0a43da7cea1e525ed414dff5 100755 --- a/app/code/core/Mage/Reports/Model/Resource/Event/Collection.php +++ b/app/code/core/Mage/Reports/Model/Resource/Event/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Resource/Event/Type.php b/app/code/core/Mage/Reports/Model/Resource/Event/Type.php index f9aeee042fd429b7a85de42ceff3e03952107bf1..d40b4ffbc8acaf88cea9a9aa1f98ce25bf59a6bc 100755 --- a/app/code/core/Mage/Reports/Model/Resource/Event/Type.php +++ b/app/code/core/Mage/Reports/Model/Resource/Event/Type.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Resource/Event/Type/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Event/Type/Collection.php index c13989f34f07b6dd8cafdadb2144cd10e3b57769..64a147ebda8b92116a5c4178afa420ee1a0d687c 100755 --- a/app/code/core/Mage/Reports/Model/Resource/Event/Type/Collection.php +++ b/app/code/core/Mage/Reports/Model/Resource/Event/Type/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Resource/Helper/Interface.php b/app/code/core/Mage/Reports/Model/Resource/Helper/Interface.php new file mode 100644 index 0000000000000000000000000000000000000000..a4fa36f108f1e61054dac413d829682793c11a66 --- /dev/null +++ b/app/code/core/Mage/Reports/Model/Resource/Helper/Interface.php @@ -0,0 +1,51 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Reports + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Reports resource helper interface + */ +interface Mage_Reports_Model_Resource_Helper_Interface +{ + /** + * Merge Index data + * + * @param string $mainTable + * @param array $data + * @return string + */ + public function mergeVisitorProductIndex($mainTable, $data, $matchFields); + + /** + * Update rating position + * + * @param string $type day|month|year + * @param string $column + * @param string $mainTable + * @param string $aggregationTable + * @return Mage_Core_Model_Resource_Helper_Abstract + */ + public function updateReportRatingPos($type, $column, $mainTable, $aggregationTable); +} diff --git a/app/code/core/Mage/Reports/Model/Resource/Helper/Mysql4.php b/app/code/core/Mage/Reports/Model/Resource/Helper/Mysql4.php index cbd353c44d431eada9660721c3bbbdceac2af55a..b16f776ade92b355a64d76f49467dd6382afd1e0 100644 --- a/app/code/core/Mage/Reports/Model/Resource/Helper/Mysql4.php +++ b/app/code/core/Mage/Reports/Model/Resource/Helper/Mysql4.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -33,6 +33,7 @@ * @author Magento Core Team <core@magentocommerce.com> */ class Mage_Reports_Model_Resource_Helper_Mysql4 extends Mage_Core_Model_Resource_Helper_Mysql4 + implements Mage_Reports_Model_Resource_Helper_Interface { /** @@ -48,4 +49,71 @@ class Mage_Reports_Model_Resource_Helper_Mysql4 extends Mage_Core_Model_Resource return $result; } + /** + * Update rating position + * + * @param string $type day|month|year + * @param string $column + * @param string $mainTable + * @param string $aggregationTable + * @return Mage_Core_Model_Resource_Helper_Mysql4 + */ + public function updateReportRatingPos($type, $column, $mainTable, $aggregationTable) { + $adapter = $this->_getWriteAdapter(); + $periodSubSelect = $adapter->select(); + $ratingSubSelect = $adapter->select(); + $ratingSelect = $adapter->select(); + + switch ($type) { + case 'year': + $periodCol = $adapter->getDateFormatSql('t.period', '%Y-01-01'); + break; + case 'month': + $periodCol = $adapter->getDateFormatSql('t.period', '%Y-%m-01'); + break; + default: + $periodCol = 't.period'; + break; + } + + $columns = array( + 'period' => 't.period', + 'store_id' => 't.store_id', + 'product_id' => 't.product_id', + 'product_name' => 't.product_name', + 'product_price' => 't.product_price', + ); + + if ($type == 'day') { + $columns['id'] = 't.id'; // to speed-up insert on duplicate key update + } + + $cols = array_keys($columns); + $cols['total_qty'] = new Zend_Db_Expr('SUM(t.' . $column . ')'); + $periodSubSelect->from(array('t' => $mainTable), $cols) + ->group(array('t.store_id', $periodCol, 't.product_id')) + ->order(array('t.store_id', $periodCol, 'total_qty DESC')); + + $cols = $columns; + $cols[$column] = 't.total_qty'; + $cols['rating_pos'] = new Zend_Db_Expr( + "(@pos := IF(t.`store_id` <> @prevStoreId OR {$periodCol} <> @prevPeriod, 1, @pos+1))"); + $cols['prevStoreId'] = new Zend_Db_Expr('(@prevStoreId := t.`store_id`)'); + $cols['prevPeriod'] = new Zend_Db_Expr("(@prevPeriod := {$periodCol})"); + $ratingSubSelect->from($periodSubSelect, $cols); + + $cols = $columns; + $cols['period'] = $periodCol; + $cols[$column] = 't.' . $column; + $cols['rating_pos'] = 't.rating_pos'; + $ratingSelect->from($ratingSubSelect, $cols); + + $sql = $ratingSelect->insertFromSelect($aggregationTable, array_keys($cols)); + $adapter->query("SET @pos = 0, @prevStoreId = -1, @prevPeriod = '0000-00-00'"); + + $adapter->query($sql); + + return $this; + } + } diff --git a/app/code/core/Mage/Reports/Model/Resource/Order/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Order/Collection.php index 7745d2587d20980e9b54cd1234c8dfcb94750055..f7f5bfc1e269c2d587d736672dc1cff1d9559546 100755 --- a/app/code/core/Mage/Reports/Model/Resource/Order/Collection.php +++ b/app/code/core/Mage/Reports/Model/Resource/Order/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Resource/Product/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Product/Collection.php index c700907d5d4a6a5905f93552f4d6f4ba55196a4d..73fb5bbd114c1e15eef346584ff7b2262b7bc8d3 100755 --- a/app/code/core/Mage/Reports/Model/Resource/Product/Collection.php +++ b/app/code/core/Mage/Reports/Model/Resource/Product/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Resource/Product/Downloads/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Product/Downloads/Collection.php index 7d9316671cb9a12211c3967b501a4fcee844e0e2..c312cfa8bbe057f245750328705994bab8ba3f95 100755 --- a/app/code/core/Mage/Reports/Model/Resource/Product/Downloads/Collection.php +++ b/app/code/core/Mage/Reports/Model/Resource/Product/Downloads/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Resource/Product/Index/Abstract.php b/app/code/core/Mage/Reports/Model/Resource/Product/Index/Abstract.php index 9e13008f89bba8e6c17bd13ae085be3865c468e2..d3664df3ab64127f117b583e3f7a7a169b90c385 100755 --- a/app/code/core/Mage/Reports/Model/Resource/Product/Index/Abstract.php +++ b/app/code/core/Mage/Reports/Model/Resource/Product/Index/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Resource/Product/Index/Collection/Abstract.php b/app/code/core/Mage/Reports/Model/Resource/Product/Index/Collection/Abstract.php index f890264a79ebf7661f5ac527a2a2913e078c2d90..5f2bb29c7d901297d138c01405d02ecb6d6a775e 100755 --- a/app/code/core/Mage/Reports/Model/Resource/Product/Index/Collection/Abstract.php +++ b/app/code/core/Mage/Reports/Model/Resource/Product/Index/Collection/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Resource/Product/Index/Compared.php b/app/code/core/Mage/Reports/Model/Resource/Product/Index/Compared.php index c6e6e9ae2227ea4c05f65efb4aeef768bb26e07e..83c612fe2d43c400acfb6ea0ca41bd83d8324e75 100755 --- a/app/code/core/Mage/Reports/Model/Resource/Product/Index/Compared.php +++ b/app/code/core/Mage/Reports/Model/Resource/Product/Index/Compared.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Resource/Product/Index/Compared/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Product/Index/Compared/Collection.php index 416595751e260b8e5eafda7a970823125b069e1f..7eac32a367dab689bc1c76c01d29cc7c3ba61a43 100755 --- a/app/code/core/Mage/Reports/Model/Resource/Product/Index/Compared/Collection.php +++ b/app/code/core/Mage/Reports/Model/Resource/Product/Index/Compared/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Resource/Product/Index/Viewed.php b/app/code/core/Mage/Reports/Model/Resource/Product/Index/Viewed.php index 2366ce0bc75fb051250655266652a0001ae685eb..f32b82f990a0197c147cdd4101251984aa53caa9 100755 --- a/app/code/core/Mage/Reports/Model/Resource/Product/Index/Viewed.php +++ b/app/code/core/Mage/Reports/Model/Resource/Product/Index/Viewed.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Resource/Product/Index/Viewed/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Product/Index/Viewed/Collection.php index 26ffcabbfaea1d2c50de09691b357429bb2e463a..6dfb31d327a708d1a26e73755d926d0f57224b51 100755 --- a/app/code/core/Mage/Reports/Model/Resource/Product/Index/Viewed/Collection.php +++ b/app/code/core/Mage/Reports/Model/Resource/Product/Index/Viewed/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Resource/Product/Lowstock/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Product/Lowstock/Collection.php index 350ecbd390d6b3493bf3863c76b2d1da99f6609b..8a72c9277d5f8672b819b1a5a7ae558c915a862e 100755 --- a/app/code/core/Mage/Reports/Model/Resource/Product/Lowstock/Collection.php +++ b/app/code/core/Mage/Reports/Model/Resource/Product/Lowstock/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Resource/Product/Ordered/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Product/Ordered/Collection.php index 840fec7365ce242714a6b59eae4d9b429a753e04..698ea3653ade28d32958b0205d973a4f6983d097 100755 --- a/app/code/core/Mage/Reports/Model/Resource/Product/Ordered/Collection.php +++ b/app/code/core/Mage/Reports/Model/Resource/Product/Ordered/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Resource/Product/Sold/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Product/Sold/Collection.php index a0cc06164aefde4ddae8274d092b80b936f6ea1a..680243556f4bc4c9f096c3b61ae8631da17edfd7 100755 --- a/app/code/core/Mage/Reports/Model/Resource/Product/Sold/Collection.php +++ b/app/code/core/Mage/Reports/Model/Resource/Product/Sold/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Resource/Product/Viewed/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Product/Viewed/Collection.php index 6c7476732bce0067b273c5878b1fd87b42314406..d6ec47e4e777971e8226c84089378b6f7b42cc14 100755 --- a/app/code/core/Mage/Reports/Model/Resource/Product/Viewed/Collection.php +++ b/app/code/core/Mage/Reports/Model/Resource/Product/Viewed/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Resource/Quote/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Quote/Collection.php index 027c2c25052dc500c414d5d07eaf244d0591d68f..e44d93a02c81d5eaaea0342b8d94cf39a573e3d0 100755 --- a/app/code/core/Mage/Reports/Model/Resource/Quote/Collection.php +++ b/app/code/core/Mage/Reports/Model/Resource/Quote/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Resource/Report/Abstract.php b/app/code/core/Mage/Reports/Model/Resource/Report/Abstract.php index 6949d944eede409d4e8048470798e661692e014b..f719943f620b6c12cf09ac124ae3f5ecb023a8ae 100755 --- a/app/code/core/Mage/Reports/Model/Resource/Report/Abstract.php +++ b/app/code/core/Mage/Reports/Model/Resource/Report/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -368,7 +368,7 @@ abstract class Mage_Reports_Model_Resource_Report_Abstract extends Mage_Core_Mod foreach ($periods as $offset => $timestamps) { $subParts = array(); foreach ($timestamps as $ts) { - $subParts[] = "($column between '{$ts['from']}' and '{$ts['to']}')"; + $subParts[] = "($column between {$ts['from']} and {$ts['to']})"; } $then = $this->_getWriteAdapter() @@ -393,16 +393,17 @@ abstract class Mage_Reports_Model_Resource_Report_Abstract extends Mage_Core_Mod $tzTransitions = array(); try { if (!empty($from)) { - $from = new Zend_Date($from, 'Y-m-d H:i:s'); + $from = new Zend_Date($from, Varien_Date::DATETIME_INTERNAL_FORMAT); $from = $from->getTimestamp(); } - $to = new Zend_Date($to); - $nextPeriod = $to->toString('c'); + $to = new Zend_Date($to, Varien_Date::DATETIME_INTERNAL_FORMAT); + $nextPeriod = $this->_getWriteAdapter()->formatDate($to->toString(Varien_Date::DATETIME_INTERNAL_FORMAT)); $to = $to->getTimestamp(); $dtz = new DateTimeZone($timezone); $transitions = $dtz->getTransitions(); + $dateTimeObject = new Zend_Date('c'); for ($i = count($transitions) - 1; $i >= 0; $i--) { $tr = $transitions[$i]; @@ -410,6 +411,9 @@ abstract class Mage_Reports_Model_Resource_Report_Abstract extends Mage_Core_Mod continue; } + $dateTimeObject->set($tr['time']); + $tr['time'] = $this->_getWriteAdapter() + ->formatDate($dateTimeObject->toString(Varien_Date::DATETIME_INTERNAL_FORMAT)); $tzTransitions[$tr['offset']][] = array('from' => $tr['time'], 'to' => $nextPeriod); if (!empty($from) && $tr['ts'] < $from) { diff --git a/app/code/core/Mage/Reports/Model/Resource/Report/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Report/Collection.php index 2658baf7547d6faea14108377a4a133aa3e01bb5..9bbd170563bc4211c9c0be8fec8e54ca184c983f 100755 --- a/app/code/core/Mage/Reports/Model/Resource/Report/Collection.php +++ b/app/code/core/Mage/Reports/Model/Resource/Report/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Resource/Report/Collection/Abstract.php b/app/code/core/Mage/Reports/Model/Resource/Report/Collection/Abstract.php new file mode 100644 index 0000000000000000000000000000000000000000..9244b4a3606d4c6b8fba16df27c1a13c8aedd2c2 --- /dev/null +++ b/app/code/core/Mage/Reports/Model/Resource/Report/Collection/Abstract.php @@ -0,0 +1,287 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Reports + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + + +/** + * Report collection abstract model + * + * @category Mage + * @package Mage_Reports + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Reports_Model_Resource_Report_Collection_Abstract extends Mage_Core_Model_Resource_Db_Collection_Abstract +{ + /** + * From date + * + * @var string + */ + protected $_from = null; + + /** + * To date + * + * @var string + */ + protected $_to = null; + + /** + * Period + * + * @var string + */ + protected $_period = null; + + /** + * Store ids + * + * @var int|array + */ + protected $_storesIds = 0; + + /** + * Does filters should be applied + * + * @var bool + */ + protected $_applyFilters = true; + + /** + * Is totals + * + * @var bool + */ + protected $_isTotals = false; + + /** + * Is subtotals + * + * @var bool + */ + protected $_isSubTotals = false; + + /** + * Aggregated columns + * + * @var array + */ + protected $_aggregatedColumns = array(); + + /** + * Set array of columns that should be aggregated + * + * @param array $columns + * @return Mage_Sales_Model_Resource_Report_Collection_Abstract + */ + public function setAggregatedColumns(array $columns) + { + $this->_aggregatedColumns = $columns; + return $this; + } + + /** + * Retrieve array of columns that should be aggregated + * + * @return array + */ + public function getAggregatedColumns() + { + return $this->_aggregatedColumns; + } + + /** + * Set date range + * + * @param mixed $from + * @param mixed $to + * @return Mage_Sales_Model_Resource_Report_Collection_Abstract + */ + public function setDateRange($from = null, $to = null) + { + $this->_from = $from; + $this->_to = $to; + return $this; + } + + /** + * Set period + * + * @param string $period + * @return Mage_Sales_Model_Resource_Report_Collection_Abstract + */ + public function setPeriod($period) + { + $this->_period = $period; + return $this; + } + + /** + * Apply date range filter + * + * @return Mage_Sales_Model_Resource_Report_Collection_Abstract + */ + protected function _applyDateRangeFilter() + { + // Remember that field PERIOD is a DATE(YYYY-MM-DD) in all databases + if ($this->_from !== null) { + $this->getSelect()->where('period >= ?', $this->_from); + } + if ($this->_to !== null) { + $this->getSelect()->where('period <= ?', $this->_to); + } + + return $this; + } + + /** + * Set store ids + * + * @param mixed $storeIds (null, int|string, array, array may contain null) + * @return Mage_Sales_Model_Resource_Report_Collection_Abstract + */ + public function addStoreFilter($storeIds) + { + $this->_storesIds = $storeIds; + return $this; + } + + /** + * Apply stores filter to select object + * + * @param Zend_Db_Select $select + * @return Mage_Sales_Model_Resource_Report_Collection_Abstract + */ + protected function _applyStoresFilterToSelect(Zend_Db_Select $select) + { + $nullCheck = false; + $storeIds = $this->_storesIds; + + if (!is_array($storeIds)) { + $storeIds = array($storeIds); + } + + $storeIds = array_unique($storeIds); + + if ($index = array_search(null, $storeIds)) { + unset($storeIds[$index]); + $nullCheck = true; + } + + $storeIds[0] = ($storeIds[0] == '') ? 0 : $storeIds[0]; + + if ($nullCheck) { + $select->where('store_id IN(?) OR store_id IS NULL', $storeIds); + } else { + $select->where('store_id IN(?)', $storeIds); + } + + return $this; + } + + /** + * Apply stores filter + * + * @return Mage_Sales_Model_Resource_Report_Collection_Abstract + */ + protected function _applyStoresFilter() + { + return $this->_applyStoresFilterToSelect($this->getSelect()); + } + + /** + * Set apply filters flag + * + * @param boolean $flag + * @return Mage_Sales_Model_Resource_Report_Collection_Abstract + */ + public function setApplyFilters($flag) + { + $this->_applyFilters = $flag; + return $this; + } + + /** + * Getter/Setter for isTotals + * + * @param null|boolean $flag + * @return Mage_Sales_Model_Resource_Report_Collection_Abstract + */ + public function isTotals($flag = null) + { + if (is_null($flag)) { + return $this->_isTotals; + } + $this->_isTotals = $flag; + return $this; + } + + /** + * Getter/Setter for isSubTotals + * + * @param null|boolean $flag + * @return Mage_Sales_Model_Resource_Report_Collection_Abstract + */ + public function isSubTotals($flag = null) + { + if (is_null($flag)) { + return $this->_isSubTotals; + } + $this->_isSubTotals = $flag; + return $this; + } + + /** + * Custom filters application ability + * + * @return Mage_Reports_Model_Resource_Report_Collection_Abstract + */ + protected function _applyCustomFilter() + { + return $this; + } + + /** + * Load data + * Redeclare parent load method just for adding method _beforeLoad + * + * @param bool $printQuery + * @param bool $logQuery + * @return Mage_Sales_Model_Resource_Report_Collection_Abstract + */ + public function load($printQuery = false, $logQuery = false) + { + if ($this->isLoaded()) { + return $this; + } + $this->_initSelect(); + if ($this->_applyFilters) { + $this->_applyDateRangeFilter(); + $this->_applyStoresFilter(); + $this->_applyCustomFilter(); + } + return parent::load($printQuery, $logQuery); + } +} diff --git a/app/code/core/Mage/Reports/Model/Resource/Report/Product/Viewed.php b/app/code/core/Mage/Reports/Model/Resource/Report/Product/Viewed.php new file mode 100644 index 0000000000000000000000000000000000000000..f9ea9587a2d9627c47fe974e0cd3dcf3c974a6a6 --- /dev/null +++ b/app/code/core/Mage/Reports/Model/Resource/Report/Product/Viewed.php @@ -0,0 +1,212 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Reports + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + + +/** + * Most viewed product report aggregate resource model + * + * @category Mage + * @package Mage_Reports + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Reports_Model_Resource_Report_Product_Viewed extends Mage_Sales_Model_Resource_Report_Abstract +{ + const AGGREGATION_DAILY = 'reports_viewed_aggregated_daily'; + const AGGREGATION_MONTHLY = 'reports_viewed_aggregated_monthly'; + const AGGREGATION_YEARLY = 'reports_viewed_aggregated_yearly'; + + /** + * Model initialization + * + */ + protected function _construct() + { + $this->_init(self::AGGREGATION_DAILY, 'id'); + } + + /** + * Aggregate products view data + * + * @param mixed $from + * @param mixed $to + * @return Mage_Sales_Model_Resource_Report_Bestsellers + */ + public function aggregate($from = null, $to = null) + { + $mainTable = $this->getMainTable(); + $adapter = $this->_getWriteAdapter(); + + // convert input dates to UTC to be comparable with DATETIME fields in DB + $from = $this->_dateToUtc($from); + $to = $this->_dateToUtc($to); + + $this->_checkDates($from, $to); + + if ($from !== null || $to !== null) { + $subSelect = $this->_getTableDateRangeSelect( + $this->getTable('report_event'), + 'logged_at', 'logged_at', $from, $to + ); + } else { + $subSelect = null; + } + $this->_clearTableByDateRange($mainTable, $from, $to, $subSelect); + // convert dates from UTC to current admin timezone + $periodExpr = $adapter->getDatePartSql( + $this->getStoreTZOffsetQuery( + array('source_table' => $this->getTable('report_event')), + 'source_table.logged_at', $from, $to + ) + ); + + $helper = Mage::getResourceHelper('Mage_Core'); + $select = $adapter->select(); + + $select->group(array( + $periodExpr, + 'source_table.store_id', + 'source_table.object_id' + )); + + $viewsNumExpr = new Zend_Db_Expr('COUNT(source_table.event_id)'); + + $columns = array( + 'period' => $periodExpr, + 'store_id' => 'source_table.store_id', + 'product_id' => 'source_table.object_id', + 'product_name' => new Zend_Db_Expr( + sprintf('MIN(%s)', + $adapter->getIfNullSql('product_name.value','product_default_name.value') + ) + ), + 'product_price' => new Zend_Db_Expr( + sprintf('%s', + $helper->prepareColumn( + sprintf('MIN(%s)', + $adapter->getIfNullSql( + $adapter->getIfNullSql('product_price.value','product_default_price.value'), 0) + ), + $select->getPart(Zend_Db_Select::GROUP) + ) + ) + ), + 'views_num' => $viewsNumExpr + ); + + $select + ->from( + array( + 'source_table' => $this->getTable('report_event')), + $columns) + ->where('source_table.event_type_id = ?', Mage_Reports_Model_Event::EVENT_PRODUCT_VIEW); + + /** @var Mage_Catalog_Model_Resource_Product $product */ + $product = Mage::getResourceSingleton('Mage_Catalog_Model_Resource_Product'); + + $select->joinInner( + array( + 'product' => $this->getTable('catalog_product_entity')), + 'product.entity_id = source_table.object_id', + array() + ); + + // join product attributes Name & Price + $nameAttribute = $product->getAttribute('name'); + $joinExprProductName = array( + 'product_name.entity_id = product.entity_id', + 'product_name.store_id = source_table.store_id', + $adapter->quoteInto('product_name.attribute_id = ?', $nameAttribute->getAttributeId()) + ); + $joinExprProductName = implode(' AND ', $joinExprProductName); + $joinExprProductDefaultName = array( + 'product_default_name.entity_id = product.entity_id', + 'product_default_name.store_id = 0', + $adapter->quoteInto('product_default_name.attribute_id = ?', $nameAttribute->getAttributeId()) + ); + $joinExprProductDefaultName = implode(' AND ', $joinExprProductDefaultName); + $select->joinLeft( + array( + 'product_name' => $nameAttribute->getBackend()->getTable()), + $joinExprProductName, + array() + ) + ->joinLeft( + array( + 'product_default_name' => $nameAttribute->getBackend()->getTable()), + $joinExprProductDefaultName, + array() + ); + $priceAttribute = $product->getAttribute('price'); + $joinExprProductPrice = array( + 'product_price.entity_id = product.entity_id', + 'product_price.store_id = source_table.store_id', + $adapter->quoteInto('product_price.attribute_id = ?', $priceAttribute->getAttributeId()) + ); + $joinExprProductPrice = implode(' AND ', $joinExprProductPrice); + + $joinExprProductDefPrice = array( + 'product_default_price.entity_id = product.entity_id', + 'product_default_price.store_id = 0', + $adapter->quoteInto('product_default_price.attribute_id = ?', $priceAttribute->getAttributeId()) + ); + $joinExprProductDefPrice = implode(' AND ', $joinExprProductDefPrice); + $select->joinLeft( + array('product_price' => $priceAttribute->getBackend()->getTable()), + $joinExprProductPrice, + array() + ) + ->joinLeft( + array('product_default_price' => $priceAttribute->getBackend()->getTable()), + $joinExprProductDefPrice, + array() + ); + + $havingPart = array($adapter->prepareSqlCondition($viewsNumExpr, array('gt' => 0))); + if (!is_null($subSelect)) { + $subSelectHavingPart = $this->_makeConditionFromDateRangeSelect($subSelect, 'period'); + if ($subSelectHavingPart) { + $havingPart[] = '(' . $subSelectHavingPart . ')'; + } + } + $select->having(implode(' AND ', $havingPart)); + + $select->useStraightJoin(); + $insertQuery = $helper->getInsertFromSelectUsingAnalytic($select, $this->getMainTable(), + array_keys($columns)); + $adapter->query($insertQuery); + + Mage::getResourceHelper('Mage_Reports') + ->updateReportRatingPos('day', 'views_num', $mainTable, $this->getTable(self::AGGREGATION_DAILY)); + Mage::getResourceHelper('Mage_Reports') + ->updateReportRatingPos('month', 'views_num', $mainTable, $this->getTable(self::AGGREGATION_MONTHLY)); + Mage::getResourceHelper('Mage_Reports') + ->updateReportRatingPos('year', 'views_num', $mainTable, $this->getTable(self::AGGREGATION_YEARLY)); + + $this->_setFlagData(Mage_Reports_Model_Flag::REPORT_PRODUCT_VIEWED_FLAG_CODE); + + return $this; + } +} diff --git a/app/code/core/Mage/Reports/Model/Resource/Report/Product/Viewed/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Report/Product/Viewed/Collection.php new file mode 100644 index 0000000000000000000000000000000000000000..2aaafdc15a1be4fdb2660bb5ddc9d194095d97b9 --- /dev/null +++ b/app/code/core/Mage/Reports/Model/Resource/Report/Product/Viewed/Collection.php @@ -0,0 +1,367 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Reports + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + + +/** + * Report most viewed collection + */ +class Mage_Reports_Model_Resource_Report_Product_Viewed_Collection + extends Mage_Reports_Model_Resource_Report_Collection_Abstract +{ + /** + * Rating limit + * + * @var int + */ + protected $_ratingLimit = 5; + + /** + * Selected columns + * + * @var array + */ + protected $_selectedColumns = array(); + + /** + * Initialize custom resource model + * + */ + public function __construct() + { + parent::_construct(); + $this->setModel('Mage_Adminhtml_Model_Report_Item'); + $this->_resource = Mage::getResourceModel('Mage_Sales_Model_Resource_Report') + ->init(Mage_Reports_Model_Resource_Report_Product_Viewed::AGGREGATION_DAILY); + $this->setConnection($this->getResource()->getReadConnection()); + // overwrite default behaviour + $this->_applyFilters = false; + } + + /** + * Retrieve selected columns + * + * @return array + */ + protected function _getSelectedColumns() + { + $adapter = $this->getConnection(); + + if (!$this->_selectedColumns) { + if ($this->isTotals()) { + $this->_selectedColumns = $this->getAggregatedColumns(); + } else { + $this->_selectedColumns = array( + 'period' => sprintf('MAX(%s)', $adapter->getDateFormatSql('period', '%Y-%m-%d')), + 'views_num' => 'SUM(views_num)', + 'product_id' => 'product_id', + 'product_name' => 'MAX(product_name)', + 'product_price' => 'MAX(product_price)', + ); + if ('year' == $this->_period) { + $this->_selectedColumns['period'] = $adapter->getDateFormatSql('period', '%Y'); + } elseif ('month' == $this->_period) { + $this->_selectedColumns['period'] = $adapter->getDateFormatSql('period', '%Y-%m'); + } + } + } + return $this->_selectedColumns; + } + + /** + * Make select object for date boundary + * + * @param mixed $from + * @param mixed $to + * @return Zend_Db_Select + */ + protected function _makeBoundarySelect($from, $to) + { + $adapter = $this->getConnection(); + $cols = $this->_getSelectedColumns(); + $cols['views_num'] = 'SUM(views_num)'; + $select = $adapter->select() + ->from($this->getResource()->getMainTable(), $cols) + ->where('period >= ?', $from) + ->where('period <= ?', $to) + ->group('product_id') + ->order('views_num DESC') + ->limit($this->_ratingLimit); + + $this->_applyStoresFilterToSelect($select); + + return $select; + } + + /** + * Init collection select + * + * @return Mage_Reports_Model_Resource_Report_Product_Viewed_Collection + */ + protected function _initSelect() + { + $select = $this->getSelect(); + + // if grouping by product, not by period + if (!$this->_period) { + $cols = $this->_getSelectedColumns(); + $cols['views_num'] = 'SUM(views_num)'; + if ($this->_from || $this->_to) { + $mainTable = $this->getTable(Mage_Reports_Model_Resource_Report_Product_Viewed::AGGREGATION_DAILY); + $select->from($mainTable, $cols); + } else { + $mainTable = $this->getTable(Mage_Reports_Model_Resource_Report_Product_Viewed::AGGREGATION_YEARLY); + $select->from($mainTable, $cols); + } + + //exclude removed products + $subSelect = $this->getConnection()->select(); + $subSelect->from(array('existed_products' => $this->getTable('catalog_product_entity')), new Zend_Db_Expr('1)')); + + $select->exists($subSelect, $mainTable . '.product_id = existed_products.entity_id') + ->group('product_id') + ->order('views_num ' . Varien_Db_Select::SQL_DESC) + ->limit($this->_ratingLimit); + + return $this; + } + + if ('year' == $this->_period) { + $mainTable = $this->getTable(Mage_Reports_Model_Resource_Report_Product_Viewed::AGGREGATION_YEARLY); + $select->from($mainTable, $this->_getSelectedColumns()); + } elseif ('month' == $this->_period) { + $mainTable = $this->getTable(Mage_Reports_Model_Resource_Report_Product_Viewed::AGGREGATION_MONTHLY); + $select->from($mainTable, $this->_getSelectedColumns()); + } else { + $mainTable = $this->getTable(Mage_Reports_Model_Resource_Report_Product_Viewed::AGGREGATION_DAILY); + $select->from($mainTable, $this->_getSelectedColumns()); + } + if (!$this->isTotals()) { + $select->group(array('period', 'product_id')); + } + $select->where('rating_pos <= ?', $this->_ratingLimit); + + return $this; + } + + /** + * Get SQL for get record count + * + * @return Varien_Db_Select + */ + public function getSelectCountSql() + { + $this->_renderFilters(); + $select = clone $this->getSelect(); + $select->reset(Zend_Db_Select::ORDER); + return $this->getConnection()->select()->from($select, 'COUNT(*)'); + } + + /** + * Set ids for store restrictions + * + * @param array $storeIds + * @return Mage_Reports_Model_Resource_Report_Product_Viewed_Collection + */ + public function addStoreRestrictions($storeIds) + { + if (!is_array($storeIds)) { + $storeIds = array($storeIds); + } + $currentStoreIds = $this->_storesIds; + if (isset($currentStoreIds) && $currentStoreIds != Mage_Core_Model_App::ADMIN_STORE_ID + && $currentStoreIds != array(Mage_Core_Model_App::ADMIN_STORE_ID)) { + if (!is_array($currentStoreIds)) { + $currentStoreIds = array($currentStoreIds); + } + $this->_storesIds = array_intersect($currentStoreIds, $storeIds); + } else { + $this->_storesIds = $storeIds; + } + + return $this; + } + + /** + * Redeclare parent method for applying filters after parent method + * but before adding unions and calculating totals + * + * @return Mage_Reports_Model_Resource_Report_Product_Viewed_Collection + */ + protected function _beforeLoad() + { + parent::_beforeLoad(); + + $this->_applyStoresFilter(); + + if ($this->_period) { + $selectUnions = array(); + + // apply date boundaries (before calling $this->_applyDateRangeFilter()) + $dtFormat = Varien_Date::DATE_INTERNAL_FORMAT; + $periodFrom = (!is_null($this->_from) ? new Zend_Date($this->_from, $dtFormat) : null); + $periodTo = (!is_null($this->_to) ? new Zend_Date($this->_to, $dtFormat) : null); + if ('year' == $this->_period) { + + if ($periodFrom) { + // not the first day of the year + if ($periodFrom->toValue(Zend_Date::MONTH) != 1 || $periodFrom->toValue(Zend_Date::DAY) != 1) { + $dtFrom = $periodFrom->getDate(); + // last day of the year + $dtTo = $periodFrom->getDate()->setMonth(12)->setDay(31); + if (!$periodTo || $dtTo->isEarlier($periodTo)) { + $selectUnions[] = $this->_makeBoundarySelect( + $dtFrom->toString($dtFormat), + $dtTo->toString($dtFormat) + ); + + // first day of the next year + $this->_from = $periodFrom->getDate() + ->addYear(1) + ->setMonth(1) + ->setDay(1) + ->toString($dtFormat); + } + } + } + + if ($periodTo) { + // not the last day of the year + if ($periodTo->toValue(Zend_Date::MONTH) != 12 || $periodTo->toValue(Zend_Date::DAY) != 31) { + $dtFrom = $periodTo->getDate()->setMonth(1)->setDay(1); // first day of the year + $dtTo = $periodTo->getDate(); + if (!$periodFrom || $dtFrom->isLater($periodFrom)) { + $selectUnions[] = $this->_makeBoundarySelect( + $dtFrom->toString($dtFormat), + $dtTo->toString($dtFormat) + ); + + // last day of the previous year + $this->_to = $periodTo->getDate() + ->subYear(1) + ->setMonth(12) + ->setDay(31) + ->toString($dtFormat); + } + } + } + + if ($periodFrom && $periodTo) { + // the same year + if ($periodFrom->toValue(Zend_Date::YEAR) == $periodTo->toValue(Zend_Date::YEAR)) { + $dtFrom = $periodFrom->getDate(); + $dtTo = $periodTo->getDate(); + $selectUnions[] = $this->_makeBoundarySelect( + $dtFrom->toString($dtFormat), + $dtTo->toString($dtFormat) + ); + + $this->getSelect()->where('1<>1'); + } + } + + } + else if ('month' == $this->_period) { + if ($periodFrom) { + // not the first day of the month + if ($periodFrom->toValue(Zend_Date::DAY) != 1) { + $dtFrom = $periodFrom->getDate(); + // last day of the month + $dtTo = $periodFrom->getDate()->addMonth(1)->setDay(1)->subDay(1); + if (!$periodTo || $dtTo->isEarlier($periodTo)) { + $selectUnions[] = $this->_makeBoundarySelect( + $dtFrom->toString($dtFormat), + $dtTo->toString($dtFormat) + ); + + // first day of the next month + $this->_from = $periodFrom->getDate()->addMonth(1)->setDay(1)->toString($dtFormat); + } + } + } + + if ($periodTo) { + // not the last day of the month + if ($periodTo->toValue(Zend_Date::DAY) != $periodTo->toValue(Zend_Date::MONTH_DAYS)) { + $dtFrom = $periodTo->getDate()->setDay(1); // first day of the month + $dtTo = $periodTo->getDate(); + if (!$periodFrom || $dtFrom->isLater($periodFrom)) { + $selectUnions[] = $this->_makeBoundarySelect( + $dtFrom->toString($dtFormat), + $dtTo->toString($dtFormat) + ); + + // last day of the previous month + $this->_to = $periodTo->getDate()->setDay(1)->subDay(1)->toString($dtFormat); + } + } + } + + if ($periodFrom && $periodTo) { + // the same month + if ($periodFrom->toValue(Zend_Date::YEAR) == $periodTo->toValue(Zend_Date::YEAR) + && $periodFrom->toValue(Zend_Date::MONTH) == $periodTo->toValue(Zend_Date::MONTH) + ) { + $dtFrom = $periodFrom->getDate(); + $dtTo = $periodTo->getDate(); + $selectUnions[] = $this->_makeBoundarySelect( + $dtFrom->toString($dtFormat), + $dtTo->toString($dtFormat) + ); + + $this->getSelect()->where('1<>1'); + } + } + + } + + $this->_applyDateRangeFilter(); + + // add unions to select + if ($selectUnions) { + $unionParts = array(); + $cloneSelect = clone $this->getSelect(); + $helper = Mage::getResourceHelper('Mage_Core'); + $unionParts[] = '(' . $cloneSelect . ')'; + foreach ($selectUnions as $union) { + $query = $helper->getQueryUsingAnalyticFunction($union); + $unionParts[] = '(' . $query . ')'; + } + $this->getSelect()->reset()->union($unionParts, Zend_Db_Select::SQL_UNION_ALL); + } + + if ($this->isTotals()) { + // calculate total + $cloneSelect = clone $this->getSelect(); + $this->getSelect()->reset()->from($cloneSelect, $this->getAggregatedColumns()); + } else { + // add sorting + $this->getSelect()->order(array('period ASC', 'views_num DESC')); + } + } + + return $this; + } +} diff --git a/app/code/core/Mage/Reports/Model/Resource/Review/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Review/Collection.php index 791ff8f8f7eef57d728304e71ab2a39eb5f4fa85..5e0bc7c879048682898b54c40afc36d1afa45108 100755 --- a/app/code/core/Mage/Reports/Model/Resource/Review/Collection.php +++ b/app/code/core/Mage/Reports/Model/Resource/Review/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Resource/Review/Customer/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Review/Customer/Collection.php index 4a1a94af450bec94317af171337e3416da934982..748158eb65a8a60201bb2c283ae29919c383b54c 100755 --- a/app/code/core/Mage/Reports/Model/Resource/Review/Customer/Collection.php +++ b/app/code/core/Mage/Reports/Model/Resource/Review/Customer/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Resource/Review/Product/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Review/Product/Collection.php index 7097f23f68f3ef777302214125755f6f027cff55..a1cb50c04dc5f5c11472e10afb7fe03bf98ab4d5 100755 --- a/app/code/core/Mage/Reports/Model/Resource/Review/Product/Collection.php +++ b/app/code/core/Mage/Reports/Model/Resource/Review/Product/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Resource/Shopcart/Product/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Shopcart/Product/Collection.php index b07208dc890a60f885f4f02614f64028640610ec..158ea0244385a6155658a69ee27f4689a84875a0 100755 --- a/app/code/core/Mage/Reports/Model/Resource/Shopcart/Product/Collection.php +++ b/app/code/core/Mage/Reports/Model/Resource/Shopcart/Product/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Resource/Tag/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Tag/Collection.php index 014919f3f0f01133018516a5d545a82c42c2acd8..8a4952f035846614941e8ee4b0c54289078f19dc 100755 --- a/app/code/core/Mage/Reports/Model/Resource/Tag/Collection.php +++ b/app/code/core/Mage/Reports/Model/Resource/Tag/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -45,12 +45,13 @@ class Mage_Reports_Model_Resource_Tag_Collection extends Mage_Tag_Model_Resource $select = $this->getSelect() ->joinLeft( array('tr' => $this->getTable('tag_relation')), - 'main_table.tag_id = tr.tag_id', + 'main_table.tag_id = tr.tag_id AND tr.active = 1', array('popularity' => 'COUNT(tr.tag_id)') ); if (!empty($storeIds)) { $select->where('tr.store_id IN(?)', $storeIds); } + $select->group('main_table.tag_id'); /** @@ -60,4 +61,4 @@ class Mage_Reports_Model_Resource_Tag_Collection extends Mage_Tag_Model_Resource return $this; } -} +} \ No newline at end of file diff --git a/app/code/core/Mage/Reports/Model/Resource/Tag/Customer/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Tag/Customer/Collection.php index 9c9ede3b600cba8628c54d41480e76f97db9a874..863d21f60d4a1f9b0ef7bcb235b6f1513a6f34ad 100755 --- a/app/code/core/Mage/Reports/Model/Resource/Tag/Customer/Collection.php +++ b/app/code/core/Mage/Reports/Model/Resource/Tag/Customer/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Resource/Tag/Product/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Tag/Product/Collection.php index 1204d969fcad229880c0c8b4fafeda3948ba87bf..f9431bb6bc61415cfb0ad274108deab2ac2eac56 100755 --- a/app/code/core/Mage/Reports/Model/Resource/Tag/Product/Collection.php +++ b/app/code/core/Mage/Reports/Model/Resource/Tag/Product/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Resource/Wishlist/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Wishlist/Collection.php index d9bec50eb755a542efc122690a6a08879feb4baa..1756da5c003ca5731f6cfb23fbe700feae8f0a1c 100755 --- a/app/code/core/Mage/Reports/Model/Resource/Wishlist/Collection.php +++ b/app/code/core/Mage/Reports/Model/Resource/Wishlist/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Resource/Wishlist/Product/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Wishlist/Product/Collection.php index ff3c9283425a8b12452c6645ccda757abd9d1237..8a36447fac66fee96e9779e89ec6771513771dac 100755 --- a/app/code/core/Mage/Reports/Model/Resource/Wishlist/Product/Collection.php +++ b/app/code/core/Mage/Reports/Model/Resource/Wishlist/Product/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Session.php b/app/code/core/Mage/Reports/Model/Session.php index 6f948c7e04ba95d4d1c0ec05ca436b18b4a011e0..e82cd808437c8a4db7afdaa590000eac9ba012e0 100644 --- a/app/code/core/Mage/Reports/Model/Session.php +++ b/app/code/core/Mage/Reports/Model/Session.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Test.php b/app/code/core/Mage/Reports/Model/Test.php index a77e8495878221415decf2c79b2b1b49a18197fa..426b6a643f1c0013f1bd9377640fbb77e7b891f8 100644 --- a/app/code/core/Mage/Reports/Model/Test.php +++ b/app/code/core/Mage/Reports/Model/Test.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/Model/Totals.php b/app/code/core/Mage/Reports/Model/Totals.php index 0610f6a108f59430162f63ac7b62ca79dd972477..cc4e54290c7af27e79548c4e8ec33066d6caf921 100644 --- a/app/code/core/Mage/Reports/Model/Totals.php +++ b/app/code/core/Mage/Reports/Model/Totals.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/data/reports_setup/data-install-1.6.0.0.php b/app/code/core/Mage/Reports/data/reports_setup/data-install-1.6.0.0.php index a74cb2a6b9870dd20c1d38f9e2f3b47fab611f81..082e0c83caad66292c60356581496e9f406b5046 100644 --- a/app/code/core/Mage/Reports/data/reports_setup/data-install-1.6.0.0.php +++ b/app/code/core/Mage/Reports/data/reports_setup/data-install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_ - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/etc/adminhtml.xml b/app/code/core/Mage/Reports/etc/adminhtml.xml index 83997ad047e2495cad032bb6ffa77d5125295dda..3c36e1df78412f3946b550575b8e2fad1c2bb357 100644 --- a/app/code/core/Mage/Reports/etc/adminhtml.xml +++ b/app/code/core/Mage/Reports/etc/adminhtml.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> @@ -99,10 +99,6 @@ <title>Low stock</title> <action>adminhtml/report_product/lowstock</action> </lowstock> - <downloads translate="title" module="Mage_Reports"> - <title>Downloads</title> - <action>adminhtml/report_product/downloads</action> - </downloads> </children> </products> <customers translate="title" module="Mage_Reports"> diff --git a/app/code/core/Mage/Reports/etc/config.xml b/app/code/core/Mage/Reports/etc/config.xml index 9d6468a87756a0665df98d243767c56fc7527ef5..032244dba293f66949d1bdf3f2fb1465ff34a115 100644 --- a/app/code/core/Mage/Reports/etc/config.xml +++ b/app/code/core/Mage/Reports/etc/config.xml @@ -21,14 +21,14 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> <config> <modules> <Mage_Reports> - <version>1.6.0.0</version> + <version>1.6.0.0.1</version> </Mage_Reports> </modules> <global> @@ -176,4 +176,4 @@ </dashboard> </reports> </default> -</config> +</config> \ No newline at end of file diff --git a/app/code/core/Mage/Reports/etc/system.xml b/app/code/core/Mage/Reports/etc/system.xml index b6e100d6500c06094cc1126b7f03007ef89d43ee..e1a5c5ce0515a116a492c370777bf1d646512a0a 100644 --- a/app/code/core/Mage/Reports/etc/system.xml +++ b/app/code/core/Mage/Reports/etc/system.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Reports/etc/widget.xml b/app/code/core/Mage/Reports/etc/widget.xml index 7a01663b192c43ebd8c08e59743a76f9ca32f16d..994c5b1ff3b8344ecba025f02eec58bf39ec7d71 100644 --- a/app/code/core/Mage/Reports/etc/widget.xml +++ b/app/code/core/Mage/Reports/etc/widget.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Reports/sql/reports_setup/install-1.6.0.0.php b/app/code/core/Mage/Reports/sql/reports_setup/install-1.6.0.0.php index 3db7ec7c8c51b61c89c98c00a90477b03dedc859..4c3d2f7ecc44c1445356ce163b07e642a9e86d5c 100644 --- a/app/code/core/Mage/Reports/sql/reports_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/Reports/sql/reports_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/sql/reports_setup/mysql4-install-1.6.0.0.php b/app/code/core/Mage/Reports/sql/reports_setup/mysql4-install-1.6.0.0.php index d282606b2233e67bf8b9e1ae53d4886dc52b33d3..b7b91df07775cbca4c1cc6cbe01906c1e2a15c82 100644 --- a/app/code/core/Mage/Reports/sql/reports_setup/mysql4-install-1.6.0.0.php +++ b/app/code/core/Mage/Reports/sql/reports_setup/mysql4-install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Reports - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Reports/sql/reports_setup/upgrade-1.6.0.0-1.6.0.0.1.php b/app/code/core/Mage/Reports/sql/reports_setup/upgrade-1.6.0.0-1.6.0.0.1.php new file mode 100644 index 0000000000000000000000000000000000000000..f21eb3bbce39eeb6c0958e3f77cd4db7119ce593 --- /dev/null +++ b/app/code/core/Mage/Reports/sql/reports_setup/upgrade-1.6.0.0-1.6.0.0.1.php @@ -0,0 +1,99 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Reports + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** @var $installer Mage_Core_Model_Resource_Setup */ +$installer = $this; +/* + * Prepare database for tables install + */ +$installer->startSetup(); + +$aggregationTables = array( + Mage_Reports_Model_Resource_Report_Product_Viewed::AGGREGATION_DAILY, + Mage_Reports_Model_Resource_Report_Product_Viewed::AGGREGATION_MONTHLY, + Mage_Reports_Model_Resource_Report_Product_Viewed::AGGREGATION_YEARLY, +); +$aggregationTableComments = array( + 'Most Viewed Products Aggregated Daily', + 'Most Viewed Products Aggregated Monthly', + 'Most Viewed Products Aggregated Yearly', +); + +for ($i = 0; $i < 3; ++$i) { + $table = $installer->getConnection() + ->newTable($installer->getTable($aggregationTables[$i])) + ->addColumn('id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array( + 'identity' => true, + 'unsigned' => true, + 'nullable' => false, + 'primary' => true, + ), 'Id') + ->addColumn('period', Varien_Db_Ddl_Table::TYPE_DATE, null, array( + ), 'Period') + ->addColumn('store_id', Varien_Db_Ddl_Table::TYPE_SMALLINT, null, array( + 'unsigned' => true, + ), 'Store Id') + ->addColumn('product_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array( + 'unsigned' => true, + ), 'Product Id') + ->addColumn('product_name', Varien_Db_Ddl_Table::TYPE_TEXT, 255, array( + 'nullable' => true, + ), 'Product Name') + ->addColumn('product_price', Varien_Db_Ddl_Table::TYPE_DECIMAL, '12,4', array( + 'nullable' => false, + 'default' => '0.0000', + ), 'Product Price') + ->addColumn('views_num', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array( + 'nullable' => false, + 'default' => '0', + ), 'Number of Views') + ->addColumn('rating_pos', Varien_Db_Ddl_Table::TYPE_SMALLINT, null, array( + 'unsigned' => true, + 'nullable' => false, + 'default' => '0', + ), 'Rating Pos') + ->addIndex( + $installer->getIdxName( + $aggregationTables[$i], + array('period', 'store_id', 'product_id'), + Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE + ), + array('period', 'store_id', 'product_id'), array('type' => Varien_Db_Adapter_Interface::INDEX_TYPE_UNIQUE)) + ->addIndex($installer->getIdxName($aggregationTables[$i], array('store_id')), array('store_id')) + ->addIndex($installer->getIdxName($aggregationTables[$i], array('product_id')), array('product_id')) + ->addForeignKey( + $installer->getFkName($aggregationTables[$i], 'store_id', 'core_store', 'store_id'), + 'store_id', $installer->getTable('core_store'), 'store_id', + Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE) + ->addForeignKey( + $installer->getFkName($aggregationTables[$i], 'product_id', 'catalog_product_entity', 'entity_id'), + 'product_id', $installer->getTable('catalog_product_entity'), 'entity_id', + Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE) + ->setComment($aggregationTableComments[$i]); + $installer->getConnection()->createTable($table); +} + +$installer->endSetup(); diff --git a/app/code/core/Mage/Reports/view/frontend/home_product_compared.phtml b/app/code/core/Mage/Reports/view/frontend/home_product_compared.phtml index 2bd1355a09fc86052683457286d4d17d9c543502..33f6b178e0b918f06e90f24a2e743ebfdfeaee74 100644 --- a/app/code/core/Mage/Reports/view/frontend/home_product_compared.phtml +++ b/app/code/core/Mage/Reports/view/frontend/home_product_compared.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /* @var $this Mage_Reports_Block_Product_Compared */ diff --git a/app/code/core/Mage/Reports/view/frontend/home_product_viewed.phtml b/app/code/core/Mage/Reports/view/frontend/home_product_viewed.phtml index 6f478fde0a364cfcff03c82316baba5c61083df4..8f964afaca544007f8955f92e6bd61c0dae3a110 100644 --- a/app/code/core/Mage/Reports/view/frontend/home_product_viewed.phtml +++ b/app/code/core/Mage/Reports/view/frontend/home_product_viewed.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /* @var $this Mage_Reports_Block_Product_Viewed */ diff --git a/app/code/core/Mage/Reports/view/frontend/layout.xml b/app/code/core/Mage/Reports/view/frontend/layout.xml index 8e1c785450a111830987b6b98515a765faa0ea12..e40939379c62855da50b5b9a32d565e50969bb3a 100644 --- a/app/code/core/Mage/Reports/view/frontend/layout.xml +++ b/app/code/core/Mage/Reports/view/frontend/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/Reports/view/frontend/product_compared.phtml b/app/code/core/Mage/Reports/view/frontend/product_compared.phtml index ab75a110606540fbd2f29b8086d6e41948be36d6..5c7cdd278434f5a281d53761d5a84f5c380a0c1d 100644 --- a/app/code/core/Mage/Reports/view/frontend/product_compared.phtml +++ b/app/code/core/Mage/Reports/view/frontend/product_compared.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /* @var $this Mage_Reports_Block_Product_Compared */ diff --git a/app/code/core/Mage/Reports/view/frontend/product_viewed.phtml b/app/code/core/Mage/Reports/view/frontend/product_viewed.phtml index cd2e237b9f109f956e6256b6d34b7aa4929a55e3..eba5f4e1a74d19d76d853abdb2dc7e6c4f814320 100644 --- a/app/code/core/Mage/Reports/view/frontend/product_viewed.phtml +++ b/app/code/core/Mage/Reports/view/frontend/product_viewed.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /* @var $this Mage_Reports_Block_Product_Viewed */ diff --git a/app/code/core/Mage/Reports/view/frontend/widget/compared/column/compared_default_list.phtml b/app/code/core/Mage/Reports/view/frontend/widget/compared/column/compared_default_list.phtml index 2c0eacde7335806c22bc74fbcb62e328fd91849f..cd6d5d77b0743674182b6ba38513f5128c117bd4 100644 --- a/app/code/core/Mage/Reports/view/frontend/widget/compared/column/compared_default_list.phtml +++ b/app/code/core/Mage/Reports/view/frontend/widget/compared/column/compared_default_list.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Reports/view/frontend/widget/compared/column/compared_images_list.phtml b/app/code/core/Mage/Reports/view/frontend/widget/compared/column/compared_images_list.phtml index 72973eaf2670c47520c2a4bb2f88b9e2f04a29e4..57b4acd3007853830622d9ee276eb842a8f84982 100644 --- a/app/code/core/Mage/Reports/view/frontend/widget/compared/column/compared_images_list.phtml +++ b/app/code/core/Mage/Reports/view/frontend/widget/compared/column/compared_images_list.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Reports/view/frontend/widget/compared/column/compared_names_list.phtml b/app/code/core/Mage/Reports/view/frontend/widget/compared/column/compared_names_list.phtml index 0590e06fe822b6a8d90ec20f28a56eba85183bcd..4c19842a433de71a47cbb2478d111d00c9431694 100644 --- a/app/code/core/Mage/Reports/view/frontend/widget/compared/column/compared_names_list.phtml +++ b/app/code/core/Mage/Reports/view/frontend/widget/compared/column/compared_names_list.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Reports/view/frontend/widget/compared/content/compared_grid.phtml b/app/code/core/Mage/Reports/view/frontend/widget/compared/content/compared_grid.phtml index efc80f1c3d573c7fe33aeb0ee03638c0cd9d5cbd..acd525284bfa40e897313b96ce6334bc7f107e8f 100644 --- a/app/code/core/Mage/Reports/view/frontend/widget/compared/content/compared_grid.phtml +++ b/app/code/core/Mage/Reports/view/frontend/widget/compared/content/compared_grid.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Reports/view/frontend/widget/compared/content/compared_list.phtml b/app/code/core/Mage/Reports/view/frontend/widget/compared/content/compared_list.phtml index 7e28a76e1a59fd135b2b3c58c020ca0b274e1937..cb6ca0be249e5b1f5f7adeb8db531da8865ea7bd 100644 --- a/app/code/core/Mage/Reports/view/frontend/widget/compared/content/compared_list.phtml +++ b/app/code/core/Mage/Reports/view/frontend/widget/compared/content/compared_list.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Reports/view/frontend/widget/viewed/column/viewed_default_list.phtml b/app/code/core/Mage/Reports/view/frontend/widget/viewed/column/viewed_default_list.phtml index 1e4e129de1fd153bc648c528f14c1326dc6b785c..eaa4a639f64c768cacbf65b669f14742421f461c 100644 --- a/app/code/core/Mage/Reports/view/frontend/widget/viewed/column/viewed_default_list.phtml +++ b/app/code/core/Mage/Reports/view/frontend/widget/viewed/column/viewed_default_list.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Reports/view/frontend/widget/viewed/column/viewed_images_list.phtml b/app/code/core/Mage/Reports/view/frontend/widget/viewed/column/viewed_images_list.phtml index 65bca1a495a7b3198c76bc0f7851ed7ee38cc7bf..4763a286389a1a38bb5f5dffc58338509b074889 100644 --- a/app/code/core/Mage/Reports/view/frontend/widget/viewed/column/viewed_images_list.phtml +++ b/app/code/core/Mage/Reports/view/frontend/widget/viewed/column/viewed_images_list.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Reports/view/frontend/widget/viewed/column/viewed_names_list.phtml b/app/code/core/Mage/Reports/view/frontend/widget/viewed/column/viewed_names_list.phtml index ac17828bda354b9585907d8d0c3d9a0a33dd0004..cdf9bf7d00da04e05f145d6d0fa9b86f66e40dfb 100644 --- a/app/code/core/Mage/Reports/view/frontend/widget/viewed/column/viewed_names_list.phtml +++ b/app/code/core/Mage/Reports/view/frontend/widget/viewed/column/viewed_names_list.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Reports/view/frontend/widget/viewed/content/viewed_grid.phtml b/app/code/core/Mage/Reports/view/frontend/widget/viewed/content/viewed_grid.phtml index a6af6642a0b108e88a9d9463a292eaefedf445c9..ae15772247833a16749f9fb8571c82957b509df2 100644 --- a/app/code/core/Mage/Reports/view/frontend/widget/viewed/content/viewed_grid.phtml +++ b/app/code/core/Mage/Reports/view/frontend/widget/viewed/content/viewed_grid.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Reports/view/frontend/widget/viewed/content/viewed_list.phtml b/app/code/core/Mage/Reports/view/frontend/widget/viewed/content/viewed_list.phtml index c5abbbb78977acad54a235d62db1ac90602a30dd..bb5d032706266be6f4101879dbfe2a44194f6b80 100644 --- a/app/code/core/Mage/Reports/view/frontend/widget/viewed/content/viewed_list.phtml +++ b/app/code/core/Mage/Reports/view/frontend/widget/viewed/content/viewed_list.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Reports/view/frontend/widgets.css b/app/code/core/Mage/Reports/view/frontend/widgets.css index 11e2d7a50c5a142fa859e066e0b724b8b4bcee4d..d0eaa2687aaa33aa1fa38c42f9372e1a78f6d7ff 100644 --- a/app/code/core/Mage/Reports/view/frontend/widgets.css +++ b/app/code/core/Mage/Reports/view/frontend/widgets.css @@ -19,7 +19,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/Review/Block/Customer/List.php b/app/code/core/Mage/Review/Block/Customer/List.php index 3b90a678e3cf0069708d6c182cfc4f47e99ae6c2..5d5fef483072faf36367edcc2baa00aa2fe9b0c7 100644 --- a/app/code/core/Mage/Review/Block/Customer/List.php +++ b/app/code/core/Mage/Review/Block/Customer/List.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Review - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -34,9 +34,16 @@ */ class Mage_Review_Block_Customer_List extends Mage_Customer_Block_Account_Dashboard { - + /** + * Product reviews collection + * + * @var Mage_Review_Model_Resource_Review_Product_Collection + */ protected $_collection; + /** + * Initializes collection + */ protected function _construct() { $this->_collection = Mage::getModel('Mage_Review_Model_Review')->getProductCollection(); @@ -46,50 +53,94 @@ class Mage_Review_Block_Customer_List extends Mage_Customer_Block_Account_Dashbo ->setDateOrder(); } + /** + * Gets collection items count + * + * @return int + */ public function count() { return $this->_collection->getSize(); } + /** + * Get html code for toolbar + * + * @return string + */ public function getToolbarHtml() { return $this->getChildHtml('toolbar'); } + /** + * Initializes toolbar + * + * @return Mage_Core_Block_Abstract + */ protected function _prepareLayout() { $toolbar = $this->getLayout()->createBlock('Mage_Page_Block_Html_Pager', 'customer_review_list.toolbar') - ->setCollection($this->_getCollection()); + ->setCollection($this->getCollection()); $this->setChild('toolbar', $toolbar); return parent::_prepareLayout(); } + /** + * Get collection + * + * @return Mage_Review_Model_Resource_Review_Product_Collection + */ protected function _getCollection() { return $this->_collection; } + /** + * Get collection + * + * @return Mage_Review_Model_Resource_Review_Product_Collection + */ public function getCollection() { return $this->_getCollection(); } + /** + * Get review link + * + * @return string + */ public function getReviewLink() { return Mage::getUrl('review/customer/view/'); } + /** + * Get product link + * + * @return string + */ public function getProductLink() { return Mage::getUrl('catalog/product/view/'); } + /** + * Format date in short format + * + * @param $date + * @return string + */ public function dateFormat($date) { return $this->formatDate($date, Mage_Core_Model_Locale::FORMAT_TYPE_SHORT); } + /** + * @return Mage_Core_Block_Abstract + */ protected function _beforeToHtml() { $this->_getCollection() @@ -97,5 +148,4 @@ class Mage_Review_Block_Customer_List extends Mage_Customer_Block_Account_Dashbo ->addReviewSummary(); return parent::_beforeToHtml(); } - } diff --git a/app/code/core/Mage/Review/Block/Customer/Recent.php b/app/code/core/Mage/Review/Block/Customer/Recent.php index 5303bca99f4afba09772636bb7d7dc816c34d909..44a2cff79512c6f07165f17510904090bed80a27 100644 --- a/app/code/core/Mage/Review/Block/Customer/Recent.php +++ b/app/code/core/Mage/Review/Block/Customer/Recent.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Review - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Review/Block/Customer/View.php b/app/code/core/Mage/Review/Block/Customer/View.php index 67a5292f568d25fe15730b5f391d242e598cd2cf..33c2e3f955fd70bea01295f15f63a0b775d35ccc 100644 --- a/app/code/core/Mage/Review/Block/Customer/View.php +++ b/app/code/core/Mage/Review/Block/Customer/View.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Review - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Review/Block/Form.php b/app/code/core/Mage/Review/Block/Form.php index 77900eae3e2d03854901554fbfda084d3dd002f8..f81d3f988fee11e8a77241c37eec8cf0ff0a1015 100644 --- a/app/code/core/Mage/Review/Block/Form.php +++ b/app/code/core/Mage/Review/Block/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Review - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Review/Block/Helper.php b/app/code/core/Mage/Review/Block/Helper.php index 66ac57ef385703bb419c42f738e880884bd87a60..10434a493db9389db24bb72727bb75aab59741c0 100644 --- a/app/code/core/Mage/Review/Block/Helper.php +++ b/app/code/core/Mage/Review/Block/Helper.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Review - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Review/Block/Product/View.php b/app/code/core/Mage/Review/Block/Product/View.php index 3ca37b6340663a4d29a296ac8557654e0e6e8821..a0fff8bdda2a0c415251eda941af082a918b974d 100644 --- a/app/code/core/Mage/Review/Block/Product/View.php +++ b/app/code/core/Mage/Review/Block/Product/View.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Review - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Review/Block/Product/View/List.php b/app/code/core/Mage/Review/Block/Product/View/List.php index b0e83ba17c33d02d115a4e1730b22702827876f4..10d5eecda005c263ae411a424a53185cfd0f075e 100644 --- a/app/code/core/Mage/Review/Block/Product/View/List.php +++ b/app/code/core/Mage/Review/Block/Product/View/List.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Review - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Review/Block/View.php b/app/code/core/Mage/Review/Block/View.php index afff936d81e2f826dad12493392a578e2efe2bb7..f400142a33b886589628da5993e44ec590d9098a 100644 --- a/app/code/core/Mage/Review/Block/View.php +++ b/app/code/core/Mage/Review/Block/View.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Review - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Review/Helper/Data.php b/app/code/core/Mage/Review/Helper/Data.php index 91449213c348e70a37801d26fb0a85899bc2bf24..9c72fb0015bf7b8d7ce8b5766b3c8cf20a393100 100644 --- a/app/code/core/Mage/Review/Helper/Data.php +++ b/app/code/core/Mage/Review/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Review - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Review/Model/Observer.php b/app/code/core/Mage/Review/Model/Observer.php index 2981eaf01f5991d6dedba9ca468db1b83824bc2f..6ba4b22a05abf830bec1800fd02be6e3c65ec232 100644 --- a/app/code/core/Mage/Review/Model/Observer.php +++ b/app/code/core/Mage/Review/Model/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Review - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Review/Model/Resource/Review.php b/app/code/core/Mage/Review/Model/Resource/Review.php index 90ad2fa2c3f9b8e9a66366598e1e537a2706a61f..125843351ed60117ca7a4bc766e0fd5bffe9ac42 100755 --- a/app/code/core/Mage/Review/Model/Resource/Review.php +++ b/app/code/core/Mage/Review/Model/Resource/Review.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Review - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Review/Model/Resource/Review/Collection.php b/app/code/core/Mage/Review/Model/Resource/Review/Collection.php index 3e3f0a0f35f3ac2f46b291d10969b41777752765..9b74203965875d700829d3daf380b978fcece75c 100755 --- a/app/code/core/Mage/Review/Model/Resource/Review/Collection.php +++ b/app/code/core/Mage/Review/Model/Resource/Review/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Review - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Review/Model/Resource/Review/Product/Collection.php b/app/code/core/Mage/Review/Model/Resource/Review/Product/Collection.php index d3bfa95bab90f287b271a17ec7442aa9bad6030a..fb9bb73248790bdba1ba3955353308841e679b35 100755 --- a/app/code/core/Mage/Review/Model/Resource/Review/Product/Collection.php +++ b/app/code/core/Mage/Review/Model/Resource/Review/Product/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Review - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -318,8 +318,9 @@ class Mage_Review_Model_Resource_Review_Product_Collection extends Mage_Catalog_ public function getSelectCountSql() { $select = parent::getSelectCountSql(); - - $select->reset(Zend_Db_Select::HAVING); + $select->reset(Zend_Db_Select::COLUMNS) + ->columns('COUNT(e.entity_id)') + ->reset(Zend_Db_Select::HAVING); return $select; } diff --git a/app/code/core/Mage/Review/Model/Resource/Review/Status.php b/app/code/core/Mage/Review/Model/Resource/Review/Status.php index f52aebc0a111f9d4a89745aa05d01a78aa1ff50e..407169541ed03f0ca0398094e979dd2a78b896d0 100644 --- a/app/code/core/Mage/Review/Model/Resource/Review/Status.php +++ b/app/code/core/Mage/Review/Model/Resource/Review/Status.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Review - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Review/Model/Resource/Review/Status/Collection.php b/app/code/core/Mage/Review/Model/Resource/Review/Status/Collection.php index 816aa9e48db2a6aae712ac5b66b7575ee2dab14c..567a792153e21e0f1670623247c714a57d4eee74 100755 --- a/app/code/core/Mage/Review/Model/Resource/Review/Status/Collection.php +++ b/app/code/core/Mage/Review/Model/Resource/Review/Status/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Review - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Review/Model/Resource/Review/Summary.php b/app/code/core/Mage/Review/Model/Resource/Review/Summary.php index 1786ea67f9d1cf8f5f25260693208398dbe6935a..6982544b99d36052dd802c335d8848eda1e26cd9 100755 --- a/app/code/core/Mage/Review/Model/Resource/Review/Summary.php +++ b/app/code/core/Mage/Review/Model/Resource/Review/Summary.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Review - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Review/Model/Resource/Review/Summary/Collection.php b/app/code/core/Mage/Review/Model/Resource/Review/Summary/Collection.php index c2389d31e91b3f064a1bbb6c6d28ba63ec733ec7..040cedb308271e16d06676b7570821a3333e84f7 100755 --- a/app/code/core/Mage/Review/Model/Resource/Review/Summary/Collection.php +++ b/app/code/core/Mage/Review/Model/Resource/Review/Summary/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Review - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Review/Model/Review.php b/app/code/core/Mage/Review/Model/Review.php index 0727b2e1ae02efff03e31e012ac4c5449f8dd9d1..a8594e245d992f5a7d6701c6156f943cfd78cc66 100644 --- a/app/code/core/Mage/Review/Model/Review.php +++ b/app/code/core/Mage/Review/Model/Review.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Review - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -113,18 +113,16 @@ class Mage_Review_Model_Review extends Mage_Core_Model_Abstract { $errors = array(); - $helper = Mage::helper('Mage_Customer_Helper_Data'); - if (!Zend_Validate::is($this->getTitle(), 'NotEmpty')) { - $errors[] = $helper->__('Review summary can\'t be empty'); + $errors[] = Mage::helper('Mage_Review_Helper_Data')->__('Review summary can\'t be empty'); } if (!Zend_Validate::is($this->getNickname(), 'NotEmpty')) { - $errors[] = $helper->__('Nickname can\'t be empty'); + $errors[] = Mage::helper('Mage_Review_Helper_Data')->__('Nickname can\'t be empty'); } if (!Zend_Validate::is($this->getDetail(), 'NotEmpty')) { - $errors[] = $helper->__('Review can\'t be empty'); + $errors[] = Mage::helper('Mage_Review_Helper_Data')->__('Review can\'t be empty'); } if (empty($errors)) { diff --git a/app/code/core/Mage/Review/Model/Review/Status.php b/app/code/core/Mage/Review/Model/Review/Status.php index f9a3f2f9dc6771f778c3ba4c5a79f9522d9c7d68..831a90d06bf11102abd72d48421401ef350a318d 100644 --- a/app/code/core/Mage/Review/Model/Review/Status.php +++ b/app/code/core/Mage/Review/Model/Review/Status.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Review - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Review/Model/Review/Summary.php b/app/code/core/Mage/Review/Model/Review/Summary.php index 3962d49d92b99e2e0fada427c3f0e4aaf6ae7db4..d97085a7f4f35db75c662c7913736846b0d45dee 100644 --- a/app/code/core/Mage/Review/Model/Review/Summary.php +++ b/app/code/core/Mage/Review/Model/Review/Summary.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Review - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Review/Model/Session.php b/app/code/core/Mage/Review/Model/Session.php index 0225f8b7695e30932ff4b099bc9b4e94263e334f..bc46d9626b157687ab30fad95283d5eec8fcb588 100644 --- a/app/code/core/Mage/Review/Model/Session.php +++ b/app/code/core/Mage/Review/Model/Session.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Review - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Review/controllers/CustomerController.php b/app/code/core/Mage/Review/controllers/CustomerController.php index b6d80e65acba53085c34856f836fd98c2af035a0..c5243aaf45d6a96dade1b53f046775d52e03f0ef 100644 --- a/app/code/core/Mage/Review/controllers/CustomerController.php +++ b/app/code/core/Mage/Review/controllers/CustomerController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Review - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Review/controllers/ProductController.php b/app/code/core/Mage/Review/controllers/ProductController.php index da5142e2befe58ba236d8d7b146db8e4fe80e01f..726ebd3d57317ecb8c8d4413fe406571e58dad9c 100644 --- a/app/code/core/Mage/Review/controllers/ProductController.php +++ b/app/code/core/Mage/Review/controllers/ProductController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Review - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -75,6 +75,9 @@ class Mage_Review_ProductController extends Mage_Core_Controller_Front_Action $productId = (int) $this->getRequest()->getParam('id'); $product = $this->_loadProduct($productId); + if (!$product) { + return false; + } if ($categoryId) { $category = Mage::getModel('Mage_Catalog_Model_Category')->load($categoryId); @@ -83,7 +86,10 @@ class Mage_Review_ProductController extends Mage_Core_Controller_Front_Action try { Mage::dispatchEvent('review_controller_product_init', array('product'=>$product)); - Mage::dispatchEvent('review_controller_product_init_after', array('product'=>$product, 'controller_action' => $this)); + Mage::dispatchEvent('review_controller_product_init_after', array( + 'product' => $product, + 'controller_action' => $this + )); } catch (Mage_Core_Exception $e) { Mage::logException($e); return false; diff --git a/app/code/core/Mage/Review/data/review_setup/data-install-1.6.0.0.php b/app/code/core/Mage/Review/data/review_setup/data-install-1.6.0.0.php index c3c7bcad8fcddd47ebd393c50092b1940d8003f5..cc07852900c164147116ed6da7272486751f8414 100644 --- a/app/code/core/Mage/Review/data/review_setup/data-install-1.6.0.0.php +++ b/app/code/core/Mage/Review/data/review_setup/data-install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Review - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Review/etc/adminhtml.xml b/app/code/core/Mage/Review/etc/adminhtml.xml index b4ddb90864d6b9a9a2309f0e538ac8be068b5254..37899f53e701384f4658275280ab69e3ce1f1dda 100644 --- a/app/code/core/Mage/Review/etc/adminhtml.xml +++ b/app/code/core/Mage/Review/etc/adminhtml.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Review - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Review/etc/config.xml b/app/code/core/Mage/Review/etc/config.xml index 12e40cfa90f23cdb053527585466da1eab95ef7d..2693c92f6269660dc75459abc3a5a33e0bb6e44b 100644 --- a/app/code/core/Mage/Review/etc/config.xml +++ b/app/code/core/Mage/Review/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Review - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Review/etc/system.xml b/app/code/core/Mage/Review/etc/system.xml index 6d39a1fd91853982dad4881fcf660fd930c056ac..5db7c578392044e0cac5a47651708592988084a6 100644 --- a/app/code/core/Mage/Review/etc/system.xml +++ b/app/code/core/Mage/Review/etc/system.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Review - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Review/sql/review_setup/install-1.6.0.0.php b/app/code/core/Mage/Review/sql/review_setup/install-1.6.0.0.php index 8b78769afdb8a4c3fa623ee6998fb6d1a36a84b0..e2748bc3a0349a359df62ee770124a1efac5f908 100644 --- a/app/code/core/Mage/Review/sql/review_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/Review/sql/review_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Review - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Review/view/frontend/customer/list.phtml b/app/code/core/Mage/Review/view/frontend/customer/list.phtml index 7f14bbb026c09b963e5b2fb823791f0a3cb055e1..09ad5b4a022ad561117eefabfa2eb6971a9106e7 100644 --- a/app/code/core/Mage/Review/view/frontend/customer/list.phtml +++ b/app/code/core/Mage/Review/view/frontend/customer/list.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Review/view/frontend/customer/recent.phtml b/app/code/core/Mage/Review/view/frontend/customer/recent.phtml index 4a2eea63e714a8b1f2f2badc1decdfbbcecd3b41..af87fc6d94cbcbbca246a66db30de9d4a7069ac3 100644 --- a/app/code/core/Mage/Review/view/frontend/customer/recent.phtml +++ b/app/code/core/Mage/Review/view/frontend/customer/recent.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Review/view/frontend/customer/view.phtml b/app/code/core/Mage/Review/view/frontend/customer/view.phtml index cc239510258a5b91e99e09ec77edb76ead682961..47dbeead40749ee3e7ecef1e229308de38ff4b56 100644 --- a/app/code/core/Mage/Review/view/frontend/customer/view.phtml +++ b/app/code/core/Mage/Review/view/frontend/customer/view.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Review/view/frontend/form.phtml b/app/code/core/Mage/Review/view/frontend/form.phtml index 71ab783c0d66edc1444d5d2af3c61ad93d888393..39f3bf7c1df745a4188fe08d9ecc3daac496fee0 100644 --- a/app/code/core/Mage/Review/view/frontend/form.phtml +++ b/app/code/core/Mage/Review/view/frontend/form.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Review/view/frontend/helper/summary.phtml b/app/code/core/Mage/Review/view/frontend/helper/summary.phtml index 2b92b8732963ba03b51dbca682c1ad632d47e8e7..b3a081d4796dd947f44697c383cb049553c3b989 100644 --- a/app/code/core/Mage/Review/view/frontend/helper/summary.phtml +++ b/app/code/core/Mage/Review/view/frontend/helper/summary.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Review/view/frontend/helper/summary_short.phtml b/app/code/core/Mage/Review/view/frontend/helper/summary_short.phtml index bc3f32a9a74770b1b394537ee6d302639934343d..f422e5caeb0d8399b51bcdb25337a9460a642992 100644 --- a/app/code/core/Mage/Review/view/frontend/helper/summary_short.phtml +++ b/app/code/core/Mage/Review/view/frontend/helper/summary_short.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Review/view/frontend/layout.xml b/app/code/core/Mage/Review/view/frontend/layout.xml index 15c914c421ce9afb0cdf82a46606642583547ee9..d40063a043612de47d52ac8d37cfaf907c2985eb 100644 --- a/app/code/core/Mage/Review/view/frontend/layout.xml +++ b/app/code/core/Mage/Review/view/frontend/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/Review/view/frontend/product/view/count.phtml b/app/code/core/Mage/Review/view/frontend/product/view/count.phtml index be80b8caa11b226400315e23662d624a64cc5ac8..6213dc383d5993cb50ac660161e9c9065f22aadd 100644 --- a/app/code/core/Mage/Review/view/frontend/product/view/count.phtml +++ b/app/code/core/Mage/Review/view/frontend/product/view/count.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Review/view/frontend/product/view/list.phtml b/app/code/core/Mage/Review/view/frontend/product/view/list.phtml index 5ad605c3af049e106a5c84c56c96e09c35c051a5..b8b92b4d5fa571ea442937ccdb4c51cff1e5c950 100644 --- a/app/code/core/Mage/Review/view/frontend/product/view/list.phtml +++ b/app/code/core/Mage/Review/view/frontend/product/view/list.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Review/view/frontend/product/view/other.phtml b/app/code/core/Mage/Review/view/frontend/product/view/other.phtml index 734278eab0e47423adfc95d71b00eb83ad7b7ba8..95c89cdf59228432d883a8757f5da2d84f23412d 100644 --- a/app/code/core/Mage/Review/view/frontend/product/view/other.phtml +++ b/app/code/core/Mage/Review/view/frontend/product/view/other.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Review/view/frontend/view.phtml b/app/code/core/Mage/Review/view/frontend/view.phtml index f5a8a095f2df8635283fc2190583fcad43d86f88..53ef297709639eb6623fe5c766ab4c083ff7e4bc 100644 --- a/app/code/core/Mage/Review/view/frontend/view.phtml +++ b/app/code/core/Mage/Review/view/frontend/view.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Rss/Block/Abstract.php b/app/code/core/Mage/Rss/Block/Abstract.php index bd7af50d2e108a5e40342292462fce2e30cade88..58db571a6611f9a5d310a29c942742faced834c5 100644 --- a/app/code/core/Mage/Rss/Block/Abstract.php +++ b/app/code/core/Mage/Rss/Block/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rss - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Rss_Block_Abstract extends Mage_Core_Block_Template diff --git a/app/code/core/Mage/Rss/Block/Catalog/Abstract.php b/app/code/core/Mage/Rss/Block/Catalog/Abstract.php index 9592da839d26e89c8be0973a22129f69e98f65a3..bf55a29ff072b5cc88f9e1ca412ad40431e7aaa7 100644 --- a/app/code/core/Mage/Rss/Block/Catalog/Abstract.php +++ b/app/code/core/Mage/Rss/Block/Catalog/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rss - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Rss_Block_Catalog_Abstract extends Mage_Rss_Block_Abstract diff --git a/app/code/core/Mage/Rss/Block/Catalog/Category.php b/app/code/core/Mage/Rss/Block/Catalog/Category.php index 013e3880d523c1ce309b54060a4775f67acb3657..5e5de1091ad931c90c0484205dc32ccd504ed375 100644 --- a/app/code/core/Mage/Rss/Block/Catalog/Category.php +++ b/app/code/core/Mage/Rss/Block/Catalog/Category.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rss - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rss/Block/Catalog/New.php b/app/code/core/Mage/Rss/Block/Catalog/New.php index e3e2d87fe158e0fab1fdf002c9d26be8c0bbd0b3..d7aee895318d5d9da404c76e27a1f307d7830de6 100644 --- a/app/code/core/Mage/Rss/Block/Catalog/New.php +++ b/app/code/core/Mage/Rss/Block/Catalog/New.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rss - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -65,20 +65,31 @@ getFinalPrice() - used in shopping cart calculations */ $product = Mage::getModel('Mage_Catalog_Model_Product'); - $todayDate = $product->getResource()->formatDate(time()); + + $todayStartOfDayDate = Mage::app()->getLocale()->date() + ->setTime('00:00:00') + ->toString(Varien_Date::DATETIME_INTERNAL_FORMAT); + + $todayEndOfDayDate = Mage::app()->getLocale()->date() + ->setTime('23:59:59') + ->toString(Varien_Date::DATETIME_INTERNAL_FORMAT); $products = $product->getCollection() ->setStoreId($storeId) ->addStoreFilter() - - ->addAttributeToFilter('news_from_date', array('date'=>true, 'to'=> $todayDate)) + ->addAttributeToFilter('news_from_date', array('or' => array( + 0 => array('date' => true, 'to' => $todayEndOfDayDate), + 1 => array('is' => new Zend_Db_Expr('null'))) + ), 'left') + ->addAttributeToFilter('news_to_date', array('or' => array( + 0 => array('date' => true, 'from' => $todayStartOfDayDate), + 1 => array('is' => new Zend_Db_Expr('null'))) + ), 'left') ->addAttributeToFilter( array( - array('attribute'=>'news_to_date', 'date'=>true, 'from'=>$todayDate), - array('attribute'=>'news_to_date', 'is' => new Zend_Db_Expr('null')) - ), - '', - 'left' + array('attribute' => 'news_from_date', 'is' => new Zend_Db_Expr('not null')), + array('attribute' => 'news_to_date', 'is' => new Zend_Db_Expr('not null')) + ) ) ->addAttributeToSort('news_from_date','desc') ->addAttributeToSelect(array('name', 'short_description', 'description', 'thumbnail'), 'inner') @@ -151,4 +162,4 @@ getFinalPrice() - used in shopping cart calculations ); $rssObj->_addEntry($data); } -} +} \ No newline at end of file diff --git a/app/code/core/Mage/Rss/Block/Catalog/NotifyStock.php b/app/code/core/Mage/Rss/Block/Catalog/NotifyStock.php index 961981a33b26ac3084cd91f38737a045d6bc8674..4c0a72170136731bcb2c12509411646c7ce67ef5 100644 --- a/app/code/core/Mage/Rss/Block/Catalog/NotifyStock.php +++ b/app/code/core/Mage/Rss/Block/Catalog/NotifyStock.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rss - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -64,9 +64,7 @@ class Mage_Rss_Block_Catalog_NotifyStock extends Mage_Rss_Block_Abstract protected function _toHtml() { $newUrl = Mage::getUrl('rss/catalog/notifystock'); - /* @var $helper Mage_Rss_Helper_Data */ - $helper = Mage::helper('Mage_Rss_Helper_Data'); - $title = $helper->__('Low Stock Products'); + $title = Mage::helper('Mage_Rss_Helper_Data')->__('Low Stock Products'); $rssObj = Mage::getModel('Mage_Rss_Model_Rss'); $data = array( @@ -81,7 +79,7 @@ class Mage_Rss_Block_Catalog_NotifyStock extends Mage_Rss_Block_Abstract Mage_CatalogInventory_Model_Stock_Item::XML_PATH_MANAGE_STOCK); $globalNotifyStockQty = (float) Mage::getStoreConfig( Mage_CatalogInventory_Model_Stock_Item::XML_PATH_NOTIFY_STOCK_QTY); - $helper->disableFlat(); + Mage::helper('Mage_Rss_Helper_Data')->disableFlat(); /* @var $product Mage_Catalog_Model_Product */ $product = Mage::getModel('Mage_Catalog_Model_Product'); /* @var $collection Mage_Catalog_Model_Resource_Product_Collection */ diff --git a/app/code/core/Mage/Rss/Block/Catalog/Review.php b/app/code/core/Mage/Rss/Block/Catalog/Review.php index 79f8a2e3b4a896cac3f2467a67bbd829bed099c0..80ff79fcbd93e68d708f81a2e3cbdc9147d94cee 100644 --- a/app/code/core/Mage/Rss/Block/Catalog/Review.php +++ b/app/code/core/Mage/Rss/Block/Catalog/Review.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rss - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -64,10 +64,8 @@ class Mage_Rss_Block_Catalog_Review extends Mage_Rss_Block_Abstract protected function _toHtml() { $newUrl = Mage::getUrl('rss/catalog/review'); - /* @var $helper Mage_Rss_Helper_Data */ - $helper = Mage::helper('Mage_Rss_Helper_Data'); - $title = $helper->__('Pending product review(s)'); - $helper->disableFlat(); + $title = Mage::helper('Mage_Rss_Helper_Data')->__('Pending product review(s)'); + Mage::helper('Mage_Rss_Helper_Data')->disableFlat(); $rssObj = Mage::getModel('Mage_Rss_Model_Rss'); $data = array( diff --git a/app/code/core/Mage/Rss/Block/Catalog/Salesrule.php b/app/code/core/Mage/Rss/Block/Catalog/Salesrule.php index 60c96b402a418a31de7a79d89a5e3d4824cafc5d..826ffe7daa2beb416c673ac297999f4051157413 100644 --- a/app/code/core/Mage/Rss/Block/Catalog/Salesrule.php +++ b/app/code/core/Mage/Rss/Block/Catalog/Salesrule.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rss - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -42,44 +42,41 @@ class Mage_Rss_Block_Catalog_Salesrule extends Mage_Rss_Block_Abstract $this->setCacheLifetime(600); } - + /** + * Generate RSS XML with sales rules data + * + * @return string + */ protected function _toHtml() { - //store id is store view id - $storeId = $this->_getStoreId(); - $websiteId = Mage::app()->getStore($storeId)->getWebsiteId(); - //customer group id - $custGroup = $this->_getCustomerGroupId(); - - $newurl = Mage::getUrl('rss/catalog/salesrule'); - $title = Mage::helper('Mage_Rss_Helper_Data')->__('%s - Discounts and Coupons',Mage::app()->getStore($storeId)->getName()); - $lang = Mage::getStoreConfig('general/locale/code'); - - $rssObj = Mage::getModel('Mage_Rss_Model_Rss'); - $data = array('title' => $title, - 'description' => $title, - 'link' => $newurl, - 'charset' => 'UTF-8', - 'language' => $lang - ); - $rssObj->_addHeader($data); + $storeId = $this->_getStoreId(); + $websiteId = Mage::app()->getStore($storeId)->getWebsiteId(); + $customerGroup = $this->_getCustomerGroupId(); + $now = date('Y-m-d'); + $url = Mage::getUrl(''); + $newUrl = Mage::getUrl('rss/catalog/salesrule'); + $lang = Mage::getStoreConfig('general/locale/code'); + $title = Mage::helper('Mage_Rss_Helper_Data')->__('%s - Discounts and Coupons',Mage::app()->getStore($storeId)->getName()); - $now = date('Y-m-d'); - $_saleRule = Mage::getModel('Mage_SalesRule_Model_Rule'); + /** @var $rssObject Mage_Rss_Model_Rss */ + $rssObject = Mage::getModel('Mage_Rss_Model_Rss'); + /** @var $collection Mage_SalesRule_Model_Resource_Rule_Collection */ + $collection = Mage::getModel('Mage_SalesRule_Model_Rule')->getResourceCollection(); - $collection = $_saleRule->getResourceCollection() - ->addFieldToFilter('from_date', array('date'=>true, 'to' => $now)) - ->addFieldToFilter('website_ids',array('finset' => $websiteId)) - ->addFieldToFilter('customer_group_ids', array('finset' => $custGroup)) - ->addFieldToFilter('is_rss',1) - ->addFieldToFilter('is_active',1) - ->setOrder('from_date','desc'); + $data = array( + 'title' => $title, + 'description' => $title, + 'link' => $newUrl, + 'charset' => 'UTF-8', + 'language' => $lang + ); + $rssObject->_addHeader($data); - $collection->getSelect()->where('to_date is null or to_date>=?', $now); + $collection->addWebsiteGroupDateFilter($websiteId, $customerGroup, $now) + ->addFieldToFilter('is_rss', 1) + ->setOrder('from_date','desc'); $collection->load(); - $url = Mage::getUrl(''); - foreach ($collection as $sr) { $description = '<table><tr>'. '<td style="text-decoration:none;">'.$sr->getDescription(). @@ -89,12 +86,13 @@ class Mage_Rss_Block_Catalog_Salesrule extends Mage_Rss_Block_Abstract '</td>'. '</tr></table>'; $data = array( - 'title' => $sr->getName(), - 'description' => $description, - 'link' => $url - ); - $rssObj->_addEntry($data); + 'title' => $sr->getName(), + 'description' => $description, + 'link' => $url + ); + $rssObject->_addEntry($data); } - return $rssObj->createRssXml(); + + return $rssObject->createRssXml(); } } diff --git a/app/code/core/Mage/Rss/Block/Catalog/Special.php b/app/code/core/Mage/Rss/Block/Catalog/Special.php index c76eb044d70de90b01e846040b2cd87ca53aa6a3..c6f4e68c92b8b82109d7eea0e98868492a8133df 100644 --- a/app/code/core/Mage/Rss/Block/Catalog/Special.php +++ b/app/code/core/Mage/Rss/Block/Catalog/Special.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rss - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rss/Block/Catalog/Tag.php b/app/code/core/Mage/Rss/Block/Catalog/Tag.php index 4cdb59ea6344797c948b1390f943d41b266d88e8..3eb8e8b134c8be58ab0eda5d2b5d9193583dfa02 100644 --- a/app/code/core/Mage/Rss/Block/Catalog/Tag.php +++ b/app/code/core/Mage/Rss/Block/Catalog/Tag.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rss - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rss/Block/List.php b/app/code/core/Mage/Rss/Block/List.php index 4a59062602c4a178681935b3b5ee545f127a9351..96991844beb7a3a5cce5236bc524f7c18c14692b 100644 --- a/app/code/core/Mage/Rss/Block/List.php +++ b/app/code/core/Mage/Rss/Block/List.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rss - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rss/Block/Order/Details.php b/app/code/core/Mage/Rss/Block/Order/Details.php index 9f4d77d3f899df03abe645298bc31001568d50b1..a4cdbe8fef539e815e996d78a107d5ac7e94edc2 100644 --- a/app/code/core/Mage/Rss/Block/Order/Details.php +++ b/app/code/core/Mage/Rss/Block/Order/Details.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rss - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Rss_Block_Order_Details extends Mage_Core_Block_Template diff --git a/app/code/core/Mage/Rss/Block/Order/New.php b/app/code/core/Mage/Rss/Block/Order/New.php index 69c43a5ab87d2e584f9a236a3b6c59a949e41494..eda9fe8567b67993e500461fa71783b3dfc27526 100644 --- a/app/code/core/Mage/Rss/Block/Order/New.php +++ b/app/code/core/Mage/Rss/Block/Order/New.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rss - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rss/Block/Order/Status.php b/app/code/core/Mage/Rss/Block/Order/Status.php index 3aa629b25ce5f2391e3a08a82b27b2fb647d610d..f354554dbdff1e28b1daec50b973dd157293b370 100644 --- a/app/code/core/Mage/Rss/Block/Order/Status.php +++ b/app/code/core/Mage/Rss/Block/Order/Status.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rss - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rss/Block/Wishlist.php b/app/code/core/Mage/Rss/Block/Wishlist.php index 78a7412eaeb574513567a5c3d8ceb4db40af137a..4c0a8936962155f70654e5c662560dfee422d444 100644 --- a/app/code/core/Mage/Rss/Block/Wishlist.php +++ b/app/code/core/Mage/Rss/Block/Wishlist.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rss - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rss/Helper/Catalog.php b/app/code/core/Mage/Rss/Helper/Catalog.php index a0241346cded489d47bd788c69ac7d79a25f648f..cd22bf7f00d7b8792b7c2abe8aab7d5f6f881ccc 100644 --- a/app/code/core/Mage/Rss/Helper/Catalog.php +++ b/app/code/core/Mage/Rss/Helper/Catalog.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rss - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rss/Helper/Data.php b/app/code/core/Mage/Rss/Helper/Data.php index 180fdaafb6ca3847eac61437373789e67eafdc6b..8f517dd8200bdedaef341a97e63856ea09f0a730 100644 --- a/app/code/core/Mage/Rss/Helper/Data.php +++ b/app/code/core/Mage/Rss/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rss - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rss/Helper/Order.php b/app/code/core/Mage/Rss/Helper/Order.php index 34fa58ee133adaa0d8e91543f4317e948482089e..3561b3bbfd36169e4c74617322230e5d9409268b 100644 --- a/app/code/core/Mage/Rss/Helper/Order.php +++ b/app/code/core/Mage/Rss/Helper/Order.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rss - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rss/Model/Observer.php b/app/code/core/Mage/Rss/Model/Observer.php index 60c5493b70ca9f8804e07be5854ebfd44d48b7dd..ed78507fbc397f0da5f1511fb1c7eb81b1e623d4 100644 --- a/app/code/core/Mage/Rss/Model/Observer.php +++ b/app/code/core/Mage/Rss/Model/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rss - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rss/Model/Resource/Order.php b/app/code/core/Mage/Rss/Model/Resource/Order.php index 0af44bddff62b9dd9f4cb0ad47b9ff59768aea2e..23c9df1918fa74b6a1f116a6c9eae8e76219a2d1 100755 --- a/app/code/core/Mage/Rss/Model/Resource/Order.php +++ b/app/code/core/Mage/Rss/Model/Resource/Order.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rss - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rss/Model/Rss.php b/app/code/core/Mage/Rss/Model/Rss.php index 0015116bb2f6296f862cba9ee1c5393a00477fc6..e886c5515d7f4ebb10baad3779411989e9083b33 100644 --- a/app/code/core/Mage/Rss/Model/Rss.php +++ b/app/code/core/Mage/Rss/Model/Rss.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rss - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rss/Model/Session.php b/app/code/core/Mage/Rss/Model/Session.php index ee64e5af7bf2f36d63b153d713c42f5f313bf4b2..d3a90f80f448dbe75525fdceebbcb44d395ce978 100644 --- a/app/code/core/Mage/Rss/Model/Session.php +++ b/app/code/core/Mage/Rss/Model/Session.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rss - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rss/Model/System/Config/Backend/Links.php b/app/code/core/Mage/Rss/Model/System/Config/Backend/Links.php index 83166bbdff860fd9dcef4973cbf03146f4f747ae..3c4ea2c09a3540e9a2812d6eadce50f4e2b39f0d 100644 --- a/app/code/core/Mage/Rss/Model/System/Config/Backend/Links.php +++ b/app/code/core/Mage/Rss/Model/System/Config/Backend/Links.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rss - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rss/controllers/CatalogController.php b/app/code/core/Mage/Rss/controllers/CatalogController.php index a8e6cf29d22f1bb7ea39cc878680582a57cccc8c..59cc01ea9af35d0a6e399a0dd8103f7621e27be7 100644 --- a/app/code/core/Mage/Rss/controllers/CatalogController.php +++ b/app/code/core/Mage/Rss/controllers/CatalogController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rss - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rss/controllers/IndexController.php b/app/code/core/Mage/Rss/controllers/IndexController.php index de10f10198530232bc2d29ae13423b7d3548db4a..bb89b7d8cba0846976dbfc0941001cb76efb9448 100644 --- a/app/code/core/Mage/Rss/controllers/IndexController.php +++ b/app/code/core/Mage/Rss/controllers/IndexController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rss - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rss/controllers/OrderController.php b/app/code/core/Mage/Rss/controllers/OrderController.php index 1ee08828618c02930a9d8b60c18d9cca732a139f..ad6b3d942043cc8c219262f4f6ada4340fb8d5f0 100644 --- a/app/code/core/Mage/Rss/controllers/OrderController.php +++ b/app/code/core/Mage/Rss/controllers/OrderController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rss - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rss/etc/adminhtml.xml b/app/code/core/Mage/Rss/etc/adminhtml.xml index 14eef386b76a087f3114926eae4c82deb59036c7..9dbafb9e366e597160fe82b40689e75c6d8b8bdd 100644 --- a/app/code/core/Mage/Rss/etc/adminhtml.xml +++ b/app/code/core/Mage/Rss/etc/adminhtml.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Rss - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Rss/etc/config.xml b/app/code/core/Mage/Rss/etc/config.xml index 95d04e58b81e8ca12d22170cd57418115dfa1505..ad97992cd722c4bdabbff07054ca95900c221063 100644 --- a/app/code/core/Mage/Rss/etc/config.xml +++ b/app/code/core/Mage/Rss/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Rss - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> @@ -54,22 +54,22 @@ </adminhtml> <frontend> <events> - <sales_order_item_save_after> + <sales_order_save_after> <observers> <notifystock> <class>Mage_Rss_Model_Observer</class> <method>salesOrderItemSaveAfterNotifyStock</method> </notifystock> </observers> - </sales_order_item_save_after> - <sales_order_item_save_after> + </sales_order_save_after> + <sales_order_save_after> <observers> <ordernew> <class>Mage_Rss_Model_Observer</class> <method>salesOrderItemSaveAfterOrderNew</method> </ordernew> </observers> - </sales_order_item_save_after> + </sales_order_save_after> </events> <translate> <modules> diff --git a/app/code/core/Mage/Rss/etc/system.xml b/app/code/core/Mage/Rss/etc/system.xml index 0cd4ccdfa950e56ad818cc89bb652363d26b30de..e3648571c69d8999b8edd6f3219e1ac9d22f8d29 100644 --- a/app/code/core/Mage/Rss/etc/system.xml +++ b/app/code/core/Mage/Rss/etc/system.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Rss - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Rss/view/adminhtml/layout.xml b/app/code/core/Mage/Rss/view/adminhtml/layout.xml index 05536a7d706e3e1ddde2114912808f518e73d143..c4c7f21619c25ffbc8f13a80f81eb6b94a6eaf00 100644 --- a/app/code/core/Mage/Rss/view/adminhtml/layout.xml +++ b/app/code/core/Mage/Rss/view/adminhtml/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Rss/view/frontend/layout.xml b/app/code/core/Mage/Rss/view/frontend/layout.xml index b610155a6158127ed3cb5e4dd4592d1cef7a0ace..4ea01610c94c72a86157292b637a312c5bd00759 100644 --- a/app/code/core/Mage/Rss/view/frontend/layout.xml +++ b/app/code/core/Mage/Rss/view/frontend/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Rss/view/frontend/list.phtml b/app/code/core/Mage/Rss/view/frontend/list.phtml index fd5fcbb54a53b7e00349944037f5144eb8fa6510..6ff2c1f437ead36ff55281d73cdea90c7664a469 100644 --- a/app/code/core/Mage/Rss/view/frontend/list.phtml +++ b/app/code/core/Mage/Rss/view/frontend/list.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Rss/view/frontend/nofeed.phtml b/app/code/core/Mage/Rss/view/frontend/nofeed.phtml index a34bd3ebb0c4e7ae1fb4fcea10540aeb676a3c69..72d0fa26742a6aa9d7170eaaa909f9096a015c66 100644 --- a/app/code/core/Mage/Rss/view/frontend/nofeed.phtml +++ b/app/code/core/Mage/Rss/view/frontend/nofeed.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Rss/view/frontend/order/details.phtml b/app/code/core/Mage/Rss/view/frontend/order/details.phtml index 8c0b9920c6c70e63bf70191a37beac0a3fc951a8..45cecd63d48871593c3a1f4da18810eb027fc0b2 100644 --- a/app/code/core/Mage/Rss/view/frontend/order/details.phtml +++ b/app/code/core/Mage/Rss/view/frontend/order/details.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /* diff --git a/app/code/core/Mage/Rule/Block/Actions.php b/app/code/core/Mage/Rule/Block/Actions.php index ea0a56ad62919f15c70eb02f80c656c587a743c0..0078e62c0c06ec15854a2ae6e55687ab241bf50f 100644 --- a/app/code/core/Mage/Rule/Block/Actions.php +++ b/app/code/core/Mage/Rule/Block/Actions.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rule/Block/Conditions.php b/app/code/core/Mage/Rule/Block/Conditions.php index 678e1ef62d6432504b4d1239862aec8f6c31df26..548c34fd6ef6aa1416827fea90746c6a7ef96906 100644 --- a/app/code/core/Mage/Rule/Block/Conditions.php +++ b/app/code/core/Mage/Rule/Block/Conditions.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rule/Block/Editable.php b/app/code/core/Mage/Rule/Block/Editable.php index 6dbbca10a234729b4b25e5d593f08a0c0e87fd0a..fad69543aed3ae06195b2f797ab282c5d91cd928 100644 --- a/app/code/core/Mage/Rule/Block/Editable.php +++ b/app/code/core/Mage/Rule/Block/Editable.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rule/Block/Newchild.php b/app/code/core/Mage/Rule/Block/Newchild.php index cf77582f7896740e2ac7c17628b27143edeb1638..0dce976a564d0d4345e160af1d0b201b33dc8235 100644 --- a/app/code/core/Mage/Rule/Block/Newchild.php +++ b/app/code/core/Mage/Rule/Block/Newchild.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rule/Block/Rule.php b/app/code/core/Mage/Rule/Block/Rule.php index 4b8abbe9871474d23acb201d1804ea2c2127a8cf..7ed3f924712ec03c63f2875ec0851df56c1e0526 100644 --- a/app/code/core/Mage/Rule/Block/Rule.php +++ b/app/code/core/Mage/Rule/Block/Rule.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rule/Helper/Data.php b/app/code/core/Mage/Rule/Helper/Data.php index 3f1ff71ddd59c0c79cfb61c1a4b47ce9077d6e1a..603b18120196d6ed02172950f6d85c3070edd763 100644 --- a/app/code/core/Mage/Rule/Helper/Data.php +++ b/app/code/core/Mage/Rule/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rule/Model/Abstract.php b/app/code/core/Mage/Rule/Model/Abstract.php new file mode 100644 index 0000000000000000000000000000000000000000..6dbc467331d641ff34b54406a1ae469704af7a43 --- /dev/null +++ b/app/code/core/Mage/Rule/Model/Abstract.php @@ -0,0 +1,502 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Rule + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Abstract Rule entity data model + * + * @category Mage + * @package Mage_Rule + * @author Magento Core Team <core@magentocommerce.com> + */ +abstract class Mage_Rule_Model_Abstract extends Mage_Core_Model_Abstract +{ + /** + * Store rule combine conditions model + * + * @var Mage_Rule_Model_Condition_Combine + */ + protected $_conditions; + + /** + * Store rule actions model + * + * @var Mage_Rule_Model_Action_Collection + */ + protected $_actions; + + /** + * Store rule form instance + * + * @var Varien_Data_Form + */ + protected $_form; + + /** + * Is model can be deleted flag + * + * @var bool + */ + protected $_isDeleteable = true; + + /** + * Is model readonly + * + * @var bool + */ + protected $_isReadonly = false; + + /** + * Getter for rule combine conditions instance + * + * @return Mage_Rule_Model_Condition_Combine + */ + abstract public function getConditionsInstance(); + + /** + * Getter for rule actions collection instance + * + * @return Mage_Rule_Model_Action_Collection + */ + abstract public function getActionsInstance(); + + /** + * Prepare rule conditions and actions + * + * @return Mage_Rule_Model_Abstract + */ + protected function _afterLoad() + { + parent::_afterLoad(); + + // Load rule conditions if it is applicable + if ($this->hasConditionsSerialized()) { + $conditions = $this->getConditionsSerialized(); + if (!empty($conditions)) { + $conditions = unserialize($conditions); + if (is_array($conditions) && !empty($conditions)) { + $this->getConditions()->loadArray($conditions); + } + } + } + + // Load rule actions if it is applicable + if ($this->hasActionsSerialized()) { + $actions = $this->getActionsSerialized(); + if (!empty($actions)) { + $actions = unserialize($actions); + if (is_array($actions) && !empty($actions)) { + $this->getActions()->loadArray($actions); + } + } + } + + return $this; + } + + /** + * Prepare data before saving + * + * @return Mage_Rule_Model_Abstract + */ + protected function _beforeSave() + { + // Check if discount amount not negative + if ($this->hasDiscountAmount()) { + if ((int)$this->getDiscountAmount() < 0) { + Mage::throwException(Mage::helper('Mage_Rule_Helper_Data')->__('Invalid discount amount.')); + } + } + + // Serialize conditions + if ($this->getConditions()) { + $this->setConditionsSerialized(serialize($this->getConditions()->asArray())); + $this->unsConditions(); + } + + // Serialize actions + if ($this->getActions()) { + $this->setActionsSerialized(serialize($this->getActions()->asArray())); + $this->unsActions(); + } + + /** + * Prepare website Ids if applicable and if they were set as string in comma separated format. + * Backwards compatibility. + */ + if ($this->hasWebsiteIds()) { + $websiteIds = $this->getWebsiteIds(); + if (is_string($websiteIds) && !empty($websiteIds)) { + $this->setWebsiteIds(explode(',', $websiteIds)); + } + } + + /** + * Prepare customer group Ids if applicable and if they were set as string in comma separated format. + * Backwards compatibility. + */ + if ($this->hasCustomerGroupIds()) { + $groupIds = $this->getCustomerGroupIds(); + if (is_string($groupIds) && !empty($groupIds)) { + $this->setCustomerGroupIds(explode(',', $groupIds)); + } + } + + parent::_beforeSave(); + return $this; + } + + /** + * Set rule combine conditions model + * + * @param Mage_Rule_Model_Condition_Combine $conditions + * + * @return Mage_Rule_Model_Abstract + */ + public function setConditions($conditions) + { + $this->_conditions = $conditions; + return $this; + } + + /** + * Retrieve rule combine conditions model + * + * @return Mage_Rule_Model_Condition_Combine + */ + public function getConditions() + { + if (empty($this->_conditions)) { + $this->_resetConditions(); + } + return $this->_conditions; + } + + /** + * Set rule actions model + * + * @param Mage_Rule_Model_Action_Collection $actions + * + * @return Mage_Rule_Model_Abstract + */ + public function setActions($actions) + { + $this->_actions = $actions; + return $this; + } + + /** + * Retrieve rule actions model + * + * @return Mage_Rule_Model_Action_Collection + */ + public function getActions() + { + if (!$this->_actions) { + $this->_resetActions(); + } + return $this->_actions; + } + + /** + * Reset rule combine conditions + * + * @param null|Mage_Rule_Model_Condition_Combine $conditions + * + * @return Mage_Rule_Model_Abstract + */ + protected function _resetConditions($conditions = null) + { + if (is_null($conditions)) { + $conditions = $this->getConditionsInstance(); + } + $conditions->setRule($this)->setId('1')->setPrefix('conditions'); + $this->setConditions($conditions); + + return $this; + } + + /** + * Reset rule actions + * + * @param null|Mage_Rule_Model_Action_Collection $actions + * + * @return Mage_Rule_Model_Abstract + */ + protected function _resetActions($actions = null) + { + if (is_null($actions)) { + $actions = $this->getActionsInstance(); + } + $actions->setRule($this)->setId('1')->setPrefix('actions'); + $this->setActions($actions); + + return $this; + } + + /** + * Rule form getter + * + * @return Varien_Data_Form + */ + public function getForm() + { + if (!$this->_form) { + $this->_form = new Varien_Data_Form(); + } + return $this->_form; + } + + /** + * Initialize rule model data from array + * + * @param array $data + * + * @return Mage_Rule_Model_Abstract + */ + public function loadPost(array $data) + { + $arr = $this->_convertFlatToRecursive($data); + if (isset($arr['conditions'])) { + $this->getConditions()->setConditions(array())->loadArray($arr['conditions'][1]); + } + if (isset($arr['actions'])) { + $this->getActions()->setActions(array())->loadArray($arr['actions'][1], 'actions'); + } + + return $this; + } + + /** + * Set specified data to current rule. + * Set conditions and actions recursively. + * Convert dates into Zend_Date. + * + * @param array $data + * + * @return array + */ + protected function _convertFlatToRecursive(array $data) + { + $arr = array(); + foreach ($data as $key => $value) { + if (($key === 'conditions' || $key === 'actions') && is_array($value)) { + foreach ($value as $id=>$data) { + $path = explode('--', $id); + $node =& $arr; + for ($i=0, $l=sizeof($path); $i<$l; $i++) { + if (!isset($node[$key][$path[$i]])) { + $node[$key][$path[$i]] = array(); + } + $node =& $node[$key][$path[$i]]; + } + foreach ($data as $k => $v) { + $node[$k] = $v; + } + } + } else { + /** + * Convert dates into Zend_Date + */ + if (in_array($key, array('from_date', 'to_date')) && $value) { + $value = Mage::app()->getLocale()->date( + $value, + Varien_Date::DATE_INTERNAL_FORMAT, + null, + false + ); + } + $this->setData($key, $value); + } + } + + return $arr; + } + + /** + * Validate rule conditions to determine if rule can run + * + * @param Varien_Object $object + * + * @return bool + */ + public function validate(Varien_Object $object) + { + return $this->getConditions()->validate($object); + } + + /** + * Validate rule data + * + * @param Varien_Object $object + * + * @return bool|array - return true if validation passed successfully. Array with errors description otherwise + */ + public function validateData(Varien_Object $object) + { + $result = array(); + $fromDate = $toDate = null; + + if ($object->hasFromDate() && $object->hasToDate()) { + $fromDate = $object->getFromDate(); + $toDate = $object->getToDate(); + } + + if ($fromDate && $toDate) { + $fromDate = new Zend_Date($fromDate, Varien_Date::DATE_INTERNAL_FORMAT); + $toDate = new Zend_Date($toDate, Varien_Date::DATE_INTERNAL_FORMAT); + + if ($fromDate->compare($toDate) === 1) { + $result[] = Mage::helper('Mage_Rule_Helper_Data')->__('End Date must be greater than Start Date.'); + } + } + + if ($object->hasWebsiteIds()) { + $websiteIds = $object->getWebsiteIds(); + if (empty($websiteIds)) { + $result[] = Mage::helper('Mage_Rule_Helper_Data')->__('Websites must be specified.'); + } + } + if ($object->hasCustomerGroupIds()) { + $customerGroupIds = $object->getCustomerGroupIds(); + if (empty($customerGroupIds)) { + $result[] = Mage::helper('Mage_Rule_Helper_Data')->__('Customer Groups must be specified.'); + } + } + + return !empty($result) ? $result : true; + } + + /** + * Check availability to delete rule + * + * @return bool + */ + public function isDeleteable() + { + return $this->_isDeleteable; + } + + /** + * Set is rule can be deleted flag + * + * @param bool $value + * + * @return Mage_Rule_Model_Abstract + */ + public function setIsDeleteable($value) + { + $this->_isDeleteable = (bool) $value; + return $this; + } + + /** + * Check if rule is readonly + * + * @return bool + */ + public function isReadonly() + { + return $this->_isReadonly; + } + + /** + * Set is readonly flag to rule + * + * @param bool $value + * + * @return Mage_Rule_Model_Abstract + */ + public function setIsReadonly($value) + { + $this->_isReadonly = (bool) $value; + return $this; + } + + /** + * Get rule associated website Ids + * + * @return array + */ + public function getWebsiteIds() + { + if (!$this->hasWebsiteIds()) { + $websiteIds = $this->_getResource()->getWebsiteIds($this->getId()); + $this->setData('website_ids', (array)$websiteIds); + } + return $this->_getData('website_ids'); + } + + + + + /** + * @deprecated since 1.7.0.0 + * + * @param string $format + * + * @return string + */ + public function asString($format='') + { + return ''; + } + + /** + * @deprecated since 1.7.0.0 + * + * @return string + */ + public function asHtml() + { + return ''; + } + + /** + * Returns rule as an array for admin interface + * + * @deprecated since 1.7.0.0 + * + * @param array $arrAttributes + * + * @return array + */ + public function asArray(array $arrAttributes = array()) + { + return array(); + } + + /** + * Combine website ids to string + * + * @deprecated since 1.7.0.0 + * + * @return Mage_Rule_Model_Abstract + */ + protected function _prepareWebsiteIds() + { + return $this; + } +} diff --git a/app/code/core/Mage/Rule/Model/Action/Abstract.php b/app/code/core/Mage/Rule/Model/Action/Abstract.php index 9893024bcc8484afb7e1add24e03f66e9644571a..cf33aef4fb71693e509170967dd225bf10f604e3 100644 --- a/app/code/core/Mage/Rule/Model/Action/Abstract.php +++ b/app/code/core/Mage/Rule/Model/Action/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -61,7 +61,6 @@ abstract class Mage_Rule_Model_Action_Abstract extends Varien_Object implements public function asXml() { - extract($this->toArray()); $xml = "<type>".$this->getType()."</type>" ."<attribute>".$this->getAttribute()."</attribute>" ."<operator>".$this->getOperator()."</operator>" @@ -219,7 +218,8 @@ abstract class Mage_Rule_Model_Action_Abstract extends Varien_Object implements public function getRemoveLinkHtml() { $src = Mage::getDesign()->getSkinUrl('images/rule_component_remove.gif'); - $html = '<span class="rule-param"><a href="javascript:void(0)" class="rule-param-remove"><img src="'.$src.'" alt="" class="v-middle" /></a></span>'; + $html = '<span class="rule-param"><a href="javascript:void(0)" class="rule-param-remove"><img src="' + . $src . '" alt="" class="v-middle" /></a></span>'; return $html; } diff --git a/app/code/core/Mage/Rule/Model/Action/Collection.php b/app/code/core/Mage/Rule/Model/Action/Collection.php index 782f19fb66517e32cf407e67e893cf47676fadce..f654277de507e1c4030be169f16e17ed89a0632f 100644 --- a/app/code/core/Mage/Rule/Model/Action/Collection.php +++ b/app/code/core/Mage/Rule/Model/Action/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rule/Model/Action/Interface.php b/app/code/core/Mage/Rule/Model/Action/Interface.php index 6710f98f0ba5951b8a4bb093e72c1eb89f6c072e..d65a3c8d33e42d3d8b21bc1008c5bfd0e7ddd513 100644 --- a/app/code/core/Mage/Rule/Model/Action/Interface.php +++ b/app/code/core/Mage/Rule/Model/Action/Interface.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rule/Model/Condition/Abstract.php b/app/code/core/Mage/Rule/Model/Condition/Abstract.php index df3d1b41bbfc4d8519d33bfaa0d389898918e874..e231bc1a62f9412d7763f46306404de4a9f19378 100644 --- a/app/code/core/Mage/Rule/Model/Condition/Abstract.php +++ b/app/code/core/Mage/Rule/Model/Condition/Abstract.php @@ -20,14 +20,17 @@ * * @category Mage * @package Mage_Rule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ /** - * Abstract class for quote rule condition + * Abstract Rule condition data model * + * @category Mage + * @package Mage_Rule + * @author Magento Core Team <core@magentocommerce.com> */ abstract class Mage_Rule_Model_Condition_Abstract extends Varien_Object @@ -333,6 +336,11 @@ abstract class Mage_Rule_Model_Condition_Abstract return $value; } + /** + * Get inherited conditions selectors + * + * @return array + */ public function getNewChildSelectOptions() { return array( diff --git a/app/code/core/Mage/Rule/Model/Condition/Combine.php b/app/code/core/Mage/Rule/Model/Condition/Combine.php index c9acb1d10eca488cd9e224e3dca23607fdd4e821..eeaa9280e8ac3b792e31e5bd712ed79d9ab1f4ec 100644 --- a/app/code/core/Mage/Rule/Model/Condition/Combine.php +++ b/app/code/core/Mage/Rule/Model/Condition/Combine.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -235,11 +235,8 @@ class Mage_Rule_Model_Condition_Combine extends Mage_Rule_Model_Condition_Abstra public function asHtml() { $html = $this->getTypeElement()->getHtml(). - Mage::helper('Mage_Rule_Helper_Data')->__("If %s of these conditions are %s:", - $this->getAggregatorElement()->getHtml(), - $this->getValueElement()->getHtml() - ); - if ($this->getId()!='1') { + Mage::helper('Mage_Rule_Helper_Data')->__('If %s of these conditions are %s:', $this->getAggregatorElement()->getHtml(), $this->getValueElement()->getHtml()); + if ($this->getId() != '1') { $html.= $this->getRemoveLinkHtml(); } return $html; diff --git a/app/code/core/Mage/Rule/Model/Condition/Interface.php b/app/code/core/Mage/Rule/Model/Condition/Interface.php index d73bd79c1aabfb289fdabd0de986d7bafdd4fb05..c3c449616d25e925fbf2a25180a260b33e8e9e61 100644 --- a/app/code/core/Mage/Rule/Model/Condition/Interface.php +++ b/app/code/core/Mage/Rule/Model/Condition/Interface.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rule/Model/Condition/Product/Abstract.php b/app/code/core/Mage/Rule/Model/Condition/Product/Abstract.php new file mode 100644 index 0000000000000000000000000000000000000000..43a460c06eb90924021a5606a6b3e01c667e1168 --- /dev/null +++ b/app/code/core/Mage/Rule/Model/Condition/Product/Abstract.php @@ -0,0 +1,513 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Rule + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Abstract Rule product condition data model + * + * @category Mage + * @package Mage_Rule + * @author Magento Core Team <core@magentocommerce.com> + */ +abstract class Mage_Rule_Model_Condition_Product_Abstract extends Mage_Rule_Model_Condition_Abstract +{ + /** + * All attribute values as array in form: + * array( + * [entity_id_1] => array( + * [store_id_1] => store_value_1, + * [store_id_2] => store_value_2, + * ... + * [store_id_n] => store_value_n + * ), + * ... + * ) + * + * Will be set only for not global scope attribute + * + * @var array + */ + protected $_entityAttributeValues = null; + + /** + * Attribute data key that indicates whether it should be used for rules + * + * @var string + */ + protected $_isUsedForRuleProperty = 'is_used_for_promo_rules'; + + /** + * Customize default operator input by type mapper for some types + * + * @return array + */ + public function getDefaultOperatorInputByType() + { + if (null === $this->_defaultOperatorInputByType) { + parent::getDefaultOperatorInputByType(); + /* + * '{}' and '!{}' are left for back-compatibility and equal to '==' and '!=' + */ + $this->_defaultOperatorInputByType['category'] = array('==', '!=', '{}', '!{}', '()', '!()'); + $this->_arrayInputTypes[] = 'category'; + } + return $this->_defaultOperatorInputByType; + } + + /** + * Retrieve attribute object + * + * @return Mage_Catalog_Model_Resource_Eav_Attribute + */ + public function getAttributeObject() + { + try { + $obj = Mage::getSingleton('Mage_Eav_Model_Config') + ->getAttribute(Mage_Catalog_Model_Product::ENTITY, $this->getAttribute()); + } + catch (Exception $e) { + $obj = new Varien_Object(); + $obj->setEntity(Mage::getResourceSingleton('Mage_Catalog_Model_Product')) + ->setFrontendInput('text'); + } + return $obj; + } + + /** + * Add special attributes + * + * @param array $attributes + */ + protected function _addSpecialAttributes(array &$attributes) + { + $attributes['attribute_set_id'] = Mage::helper('Mage_CatalogRule_Helper_Data')->__('Attribute Set'); + $attributes['category_ids'] = Mage::helper('Mage_CatalogRule_Helper_Data')->__('Category'); + } + + /** + * Load attribute options + * + * @return Mage_CatalogRule_Model_Rule_Condition_Product + */ + public function loadAttributeOptions() + { + $productAttributes = Mage::getResourceSingleton('Mage_Catalog_Model_Resource_Product') + ->loadAllAttributes() + ->getAttributesByCode(); + + $attributes = array(); + foreach ($productAttributes as $attribute) { + /* @var $attribute Mage_Catalog_Model_Resource_Eav_Attribute */ + if (!$attribute->isAllowedForRuleCondition() + || !$attribute->getDataUsingMethod($this->_isUsedForRuleProperty) + ) { + continue; + } + $attributes[$attribute->getAttributeCode()] = $attribute->getFrontendLabel(); + } + + $this->_addSpecialAttributes($attributes); + + asort($attributes); + $this->setAttributeOption($attributes); + + return $this; + } + + /** + * Prepares values options to be used as select options or hashed array + * Result is stored in following keys: + * 'value_select_options' - normal select array: array(array('value' => $value, 'label' => $label), ...) + * 'value_option' - hashed array: array($value => $label, ...), + * + * @return Mage_CatalogRule_Model_Rule_Condition_Product + */ + protected function _prepareValueOptions() + { + // Check that both keys exist. Maybe somehow only one was set not in this routine, but externally. + $selectReady = $this->getData('value_select_options'); + $hashedReady = $this->getData('value_option'); + if ($selectReady && $hashedReady) { + return $this; + } + + // Get array of select options. It will be used as source for hashed options + $selectOptions = null; + if ($this->getAttribute() === 'attribute_set_id') { + $entityTypeId = Mage::getSingleton('Mage_Eav_Model_Config') + ->getEntityType(Mage_Catalog_Model_Product::ENTITY)->getId(); + $selectOptions = Mage::getResourceModel('Mage_Eav_Model_Resource_Entity_Attribute_Set_Collection') + ->setEntityTypeFilter($entityTypeId) + ->load() + ->toOptionArray(); + } else if (is_object($this->getAttributeObject())) { + $attributeObject = $this->getAttributeObject(); + if ($attributeObject->usesSource()) { + if ($attributeObject->getFrontendInput() == 'multiselect') { + $addEmptyOption = false; + } else { + $addEmptyOption = true; + } + $selectOptions = $attributeObject->getSource()->getAllOptions($addEmptyOption); + } + } + + // Set new values only if we really got them + if ($selectOptions !== null) { + // Overwrite only not already existing values + if (!$selectReady) { + $this->setData('value_select_options', $selectOptions); + } + if (!$hashedReady) { + $hashedOptions = array(); + foreach ($selectOptions as $o) { + if (is_array($o['value'])) { + continue; // We cannot use array as index + } + $hashedOptions[$o['value']] = $o['label']; + } + $this->setData('value_option', $hashedOptions); + } + } + + return $this; + } + + /** + * Retrieve value by option + * + * @param mixed $option + * @return string + */ + public function getValueOption($option=null) + { + $this->_prepareValueOptions(); + return $this->getData('value_option'.(!is_null($option) ? '/'.$option : '')); + } + + /** + * Retrieve select option values + * + * @return array + */ + public function getValueSelectOptions() + { + $this->_prepareValueOptions(); + return $this->getData('value_select_options'); + } + + /** + * Retrieve after element HTML + * + * @return string + */ + public function getValueAfterElementHtml() + { + $html = ''; + + switch ($this->getAttribute()) { + case 'sku': case 'category_ids': + $image = Mage::getDesign()->getSkinUrl('images/rule_chooser_trigger.gif'); + break; + } + + if (!empty($image)) { + $html = '<a href="javascript:void(0)" class="rule-chooser-trigger"><img src="' . $image . '" alt="" class="v-middle rule-chooser-trigger" title="' . Mage::helper('Mage_Rule_Helper_Data')->__('Open Chooser') . '" /></a>'; + } + return $html; + } + + /** + * Retrieve attribute element + * + * @return Varien_Form_Element_Abstract + */ + public function getAttributeElement() + { + $element = parent::getAttributeElement(); + $element->setShowAsText(true); + return $element; + } + + /** + * Collect validated attributes + * + * @param Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection $productCollection + * @return Mage_CatalogRule_Model_Rule_Condition_Product + */ + public function collectValidatedAttributes($productCollection) + { + $attribute = $this->getAttribute(); + if ('category_ids' != $attribute) { + if ($this->getAttributeObject()->isScopeGlobal()) { + $attributes = $this->getRule()->getCollectedAttributes(); + $attributes[$attribute] = true; + $this->getRule()->setCollectedAttributes($attributes); + $productCollection->addAttributeToSelect($attribute, 'left'); + } else { + $this->_entityAttributeValues = $productCollection->getAllAttributeValues($attribute); + } + } + + return $this; + } + + /** + * Retrieve input type + * + * @return string + */ + public function getInputType() + { + if ($this->getAttribute()==='attribute_set_id') { + return 'select'; + } + if (!is_object($this->getAttributeObject())) { + return 'string'; + } + if ($this->getAttributeObject()->getAttributeCode() == 'category_ids') { + return 'category'; + } + switch ($this->getAttributeObject()->getFrontendInput()) { + case 'select': + return 'select'; + + case 'multiselect': + return 'multiselect'; + + case 'date': + return 'date'; + + case 'boolean': + return 'boolean'; + + default: + return 'string'; + } + } + + /** + * Retrieve value element type + * + * @return string + */ + public function getValueElementType() + { + if ($this->getAttribute()==='attribute_set_id') { + return 'select'; + } + if (!is_object($this->getAttributeObject())) { + return 'text'; + } + switch ($this->getAttributeObject()->getFrontendInput()) { + case 'select': + case 'boolean': + return 'select'; + + case 'multiselect': + return 'multiselect'; + + case 'date': + return 'date'; + + default: + return 'text'; + } + } + + /** + * Retrieve value element + * + * @return Varien_Data_Form_Element_Abstract + */ + public function getValueElement() + { + $element = parent::getValueElement(); + if (is_object($this->getAttributeObject())) { + switch ($this->getAttributeObject()->getFrontendInput()) { + case 'date': + $element->setImage(Mage::getDesign()->getSkinUrl('images/grid-cal.gif')); + break; + } + } + + return $element; + } + + /** + * Retrieve value element chooser URL + * + * @return string + */ + public function getValueElementChooserUrl() + { + $url = false; + switch ($this->getAttribute()) { + case 'sku': case 'category_ids': + $url = 'adminhtml/promo_widget/chooser' + .'/attribute/'.$this->getAttribute(); + if ($this->getJsFormObject()) { + $url .= '/form/'.$this->getJsFormObject(); + } + break; + } + return $url!==false ? Mage::helper('Mage_Adminhtml_Helper_Data')->getUrl($url) : ''; + } + + /** + * Retrieve Explicit Apply + * + * @return bool + */ + public function getExplicitApply() + { + switch ($this->getAttribute()) { + case 'sku': case 'category_ids': + return true; + } + if (is_object($this->getAttributeObject())) { + switch ($this->getAttributeObject()->getFrontendInput()) { + case 'date': + return true; + } + } + return false; + } + + /** + * Load array + * + * @param array $arr + * @return Mage_CatalogRule_Model_Rule_Condition_Product + */ + public function loadArray($arr) + { + $this->setAttribute(isset($arr['attribute']) ? $arr['attribute'] : false); + $attribute = $this->getAttributeObject(); + + $isContainsOperator = !empty($arr['operator']) && in_array($arr['operator'], array('{}', '!{}')); + if ($attribute && $attribute->getBackendType() == 'decimal' && !$isContainsOperator) { + if (isset($arr['value'])) { + if (!empty($arr['operator']) + && in_array($arr['operator'], array('!()', '()')) + && false !== strpos($arr['value'], ',')) { + + $tmp = array(); + foreach (explode(',', $arr['value']) as $value) { + $tmp[] = Mage::app()->getLocale()->getNumber($value); + } + $arr['value'] = implode(',', $tmp); + } else { + $arr['value'] = Mage::app()->getLocale()->getNumber($arr['value']); + } + } else { + $arr['value'] = false; + } + $arr['is_value_parsed'] = isset($arr['is_value_parsed']) + ? Mage::app()->getLocale()->getNumber($arr['is_value_parsed']) : false; + } + + return parent::loadArray($arr); + } + + /** + * Validate product attrbute value for condition + * + * @param Varien_Object $object + * @return bool + */ + public function validate(Varien_Object $object) + { + $attrCode = $this->getAttribute(); + + if ('category_ids' == $attrCode) { + return $this->validateAttribute($object->getAvailableInCategories()); + } elseif (! isset($this->_entityAttributeValues[$object->getId()])) { + $attr = $object->getResource()->getAttribute($attrCode); + + if ($attr && $attr->getBackendType() == 'datetime' && !is_int($this->getValue())) { + $this->setValue(strtotime($this->getValue())); + $value = strtotime($object->getData($attrCode)); + return $this->validateAttribute($value); + } + + if ($attr && $attr->getFrontendInput() == 'multiselect') { + $value = $object->getData($attrCode); + $value = strlen($value) ? explode(',', $value) : array(); + return $this->validateAttribute($value); + } + + return parent::validate($object); + } else { + $result = false; // any valid value will set it to TRUE + // remember old attribute state + $oldAttrValue = $object->hasData($attrCode) ? $object->getData($attrCode) : null; + + foreach ($this->_entityAttributeValues[$object->getId()] as $storeId => $value) { + $attr = $object->getResource()->getAttribute($attrCode); + if ($attr && $attr->getBackendType() == 'datetime') { + $value = strtotime($value); + } else if ($attr && $attr->getFrontendInput() == 'multiselect') { + $value = strlen($value) ? explode(',', $value) : array(); + } + + $object->setData($attrCode, $value); + $result |= parent::validate($object); + + if ($result) { + break; + } + } + + if (is_null($oldAttrValue)) { + $object->unsetData($attrCode); + } else { + $object->setData($attrCode, $oldAttrValue); + } + + return (bool) $result; + } + } + + /** + * Correct '==' and '!=' operators + * Categories can't be equal because product is included categories selected by administrator and in their parents + * + * @return string + */ + public function getOperatorForValidate() + { + $op = $this->getOperator(); + if ($this->getInputType() == 'category') { + if ($op == '==') { + $op = '{}'; + } elseif ($op == '!=') { + $op = '!{}'; + } + } + + return $op; + } +} diff --git a/app/code/core/Mage/Rule/Model/Renderer/Actions.php b/app/code/core/Mage/Rule/Model/Renderer/Actions.php index 33d429a9177bc69ca68428ad5e9fabe14686632a..b2a4f0e1873cbd037838dce14b395f3d64d868af 100644 --- a/app/code/core/Mage/Rule/Model/Renderer/Actions.php +++ b/app/code/core/Mage/Rule/Model/Renderer/Actions.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rule/Model/Renderer/Conditions.php b/app/code/core/Mage/Rule/Model/Renderer/Conditions.php index 6eea670f1fc701ea6c9dc0efddddaea8f1ce95e0..396a1749fb5aeca05de2817640546ecd36658674 100644 --- a/app/code/core/Mage/Rule/Model/Renderer/Conditions.php +++ b/app/code/core/Mage/Rule/Model/Renderer/Conditions.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Rule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Rule/Model/Resource/Abstract.php b/app/code/core/Mage/Rule/Model/Resource/Abstract.php new file mode 100644 index 0000000000000000000000000000000000000000..d422f2acefc2de0a507e0db4473364c0ddcfdd15 --- /dev/null +++ b/app/code/core/Mage/Rule/Model/Resource/Abstract.php @@ -0,0 +1,250 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Rule + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Abstract Rule entity resource model + * + * @category Mage + * @package Mage_Rule + * @author Magento Core Team <core@magentocommerce.com> + */ +abstract class Mage_Rule_Model_Resource_Abstract extends Mage_Core_Model_Resource_Db_Abstract +{ + /** + * Store associated with rule entities information map + * + * Example: + * array( + * 'entity_type1' => array( + * 'associations_table' => 'table_name', + * 'rule_id_field' => 'rule_id', + * 'entity_id_field' => 'entity_id' + * ), + * 'entity_type2' => array( + * 'associations_table' => 'table_name', + * 'rule_id_field' => 'rule_id', + * 'entity_id_field' => 'entity_id' + * ) + * .... + * ) + * + * @var array + */ + protected $_associatedEntitiesMap = array(); + + /** + * Prepare rule's active "from" and "to" dates + * + * @param Mage_Core_Model_Abstract $object + * + * @return Mage_Rule_Model_Resource_Abstract + */ + public function _beforeSave(Mage_Core_Model_Abstract $object) + { + if ($object->getFromDate() instanceof Zend_Date) { + $object->setFromDate($object->getFromDate()->toString(Varien_Date::DATETIME_INTERNAL_FORMAT)); + } else { + $object->setFromDate(null); + } + + if ($object->getToDate() instanceof Zend_Date) { + $object->setToDate($object->getToDate()->toString(Varien_Date::DATETIME_INTERNAL_FORMAT)); + } else { + $object->setToDate(null); + } + + parent::_beforeSave($object); + return $this; + } + + /** + * Bind specified rules to entities + * + * @param array|int|string $ruleIds + * @param array|int|string $entityIds + * @param string $entityType + * + * @return Mage_Rule_Model_Resource_Abstract + */ + public function bindRuleToEntity($ruleIds, $entityIds, $entityType) + { + if (empty($ruleIds) || empty($entityIds)) { + return $this; + } + $adapter = $this->_getWriteAdapter(); + $entityInfo = $this->_getAssociatedEntityInfo($entityType); + + if (!is_array($ruleIds)) { + $ruleIds = array((int) $ruleIds); + } + if (!is_array($entityIds)) { + $entityIds = array((int) $entityIds); + } + + $data = array(); + $count = 0; + + $adapter->beginTransaction(); + + try { + foreach ($ruleIds as $ruleId) { + foreach ($entityIds as $entityId) { + $data[] = array( + $entityInfo['entity_id_field'] => $entityId, + $entityInfo['rule_id_field'] => $ruleId + ); + $count++; + if (($count % 1000) == 0) { + $adapter->insertOnDuplicate( + $this->getTable($entityInfo['associations_table']), + $data, + array($entityInfo['rule_id_field']) + ); + $data = array(); + } + } + } + if (!empty($data)) { + $adapter->insertOnDuplicate( + $this->getTable($entityInfo['associations_table']), + $data, + array($entityInfo['rule_id_field']) + ); + } + + $adapter->delete($this->getTable($entityInfo['associations_table']), + $adapter->quoteInto($entityInfo['rule_id_field'] . ' IN (?) AND ', $ruleIds) . + $adapter->quoteInto($entityInfo['entity_id_field'] . ' NOT IN (?)', $entityIds) + ); + } catch (Exception $e) { + $adapter->rollback(); + throw $e; + + } + + $adapter->commit(); + + return $this; + } + + /** + * Unbind specified rules from entities + * + * @param array|int|string $ruleIds + * @param array|int|string $entityIds + * @param string $entityType + * + * @return Mage_Rule_Model_Resource_Abstract + */ + public function unbindRuleFromEntity($ruleIds = array(), $entityIds = array(), $entityType) + { + $writeAdapter = $this->_getWriteAdapter(); + $entityInfo = $this->_getAssociatedEntityInfo($entityType); + + if (!is_array($entityIds)) { + $entityIds = array((int) $entityIds); + } + if (!is_array($ruleIds)) { + $ruleIds = array((int) $ruleIds); + } + + $where = array(); + if (!empty($ruleIds)) { + $where[] = $writeAdapter->quoteInto($entityInfo['rule_id_field'] . ' IN (?)', $ruleIds); + } + if (!empty($entityIds)) { + $where[] = $writeAdapter->quoteInto($entityInfo['entity_id_field'] . ' IN (?)', $entityIds); + } + + $writeAdapter->delete($this->getTable($entityInfo['associations_table']), implode(' AND ', $where)); + + return $this; + } + + /** + * Retrieve rule's associated entity Ids by entity type + * + * @param int $ruleId + * @param string $entityType + * + * @return array + */ + public function getAssociatedEntityIds($ruleId, $entityType) + { + $entityInfo = $this->_getAssociatedEntityInfo($entityType); + + $select = $this->_getReadAdapter()->select() + ->from($this->getTable($entityInfo['associations_table']), array($entityInfo['entity_id_field'])) + ->where($entityInfo['rule_id_field'] . ' = ?', $ruleId); + + return $this->_getReadAdapter()->fetchCol($select); + } + + /** + * Retrieve website ids of specified rule + * + * @param int $ruleId + * @return array + */ + public function getWebsiteIds($ruleId) + { + return $this->getAssociatedEntityIds($ruleId, 'website'); + } + + /** + * Retrieve customer group ids of specified rule + * + * @param int $ruleId + * @return array + */ + public function getCustomerGroupIds($ruleId) + { + return $this->getAssociatedEntityIds($ruleId, 'customer_group'); + } + + /** + * Retrieve correspondent entity information (associations table name, columns names) + * of rule's associated entity by specified entity type + * + * @param string $entityType + * + * @return array + */ + protected function _getAssociatedEntityInfo($entityType) + { + if (isset($this->_associatedEntitiesMap[$entityType])) { + return $this->_associatedEntitiesMap[$entityType]; + } + + $e = Mage::exception( + 'Mage_Core', + Mage::helper('Mage_Rule_Helper_Data')->__( + 'There is no information about associated entity type "%s".', $entityType + ) + ); + throw $e; + } +} diff --git a/app/code/core/Mage/Rule/Model/Resource/Rule/Collection/Abstract.php b/app/code/core/Mage/Rule/Model/Resource/Rule/Collection/Abstract.php new file mode 100644 index 0000000000000000000000000000000000000000..3f75cf4f3d72c483c92b3c7d6abc909af5055b30 --- /dev/null +++ b/app/code/core/Mage/Rule/Model/Resource/Rule/Collection/Abstract.php @@ -0,0 +1,236 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Rule + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Abstract Rule entity resource collection model + * + * @category Mage + * @package Mage_Rule + * @author Magento Core Team <core@magentocommerce.com> + */ +abstract class Mage_Rule_Model_Resource_Rule_Collection_Abstract extends Mage_Core_Model_Resource_Db_Collection_Abstract +{ + /** + * Store associated with rule entities information map + * + * Example: + * array( + * 'entity_type1' => array( + * 'associations_table' => 'table_name', + * 'rule_id_field' => 'rule_id', + * 'entity_id_field' => 'entity_id' + * ), + * 'entity_type2' => array( + * 'associations_table' => 'table_name', + * 'rule_id_field' => 'rule_id', + * 'entity_id_field' => 'entity_id' + * ) + * .... + * ) + * + * @var array + */ + protected $_associatedEntitiesMap = array(); + + /** + * Quote rule environment + * + * @deprecated after 1.6.1.0 + * + * @var Mage_Rule_Model_Environment + */ + protected $_env; + + /** + * Add website ids to rules data + * + * @return Mage_Rule_Model_Resource_Rule_Collection_Abstract + */ + protected function _afterLoad() + { + parent::_afterLoad(); + if ($this->getFlag('add_websites_to_result') && $this->_items) { + /** @var Mage_Rule_Model_Abstract $item */ + foreach ($this->_items as $item) { + $item->afterLoad(); + } + } + + return $this; + } + + /** + * Init flag for adding rule website ids to collection result + * + * @param bool|null $flag + * + * @return Mage_Rule_Model_Resource_Rule_Collection_Abstract + */ + public function addWebsitesToResult($flag = null) + { + $flag = ($flag === null) ? true : $flag; + $this->setFlag('add_websites_to_result', $flag); + return $this; + } + + /** + * Limit rules collection by specific websites + * + * @param int|array|Mage_Core_Model_Website $websiteId + * + * @return Mage_Rule_Model_Resource_Rule_Collection_Abstract + */ + public function addWebsiteFilter($websiteId) + { + $entityInfo = $this->_getAssociatedEntityInfo('website'); + if (!$this->getFlag('is_website_table_joined')) { + $this->setFlag('is_website_table_joined', true); + $this->getSelect()->joinInner( + array('website' => $this->getTable($entityInfo['associations_table'])), + 'main_table.' . $entityInfo['rule_id_field'] . ' = website.' . $entityInfo['rule_id_field'], + array() + ); + } + + if ($websiteId instanceof Mage_Core_Model_Website) { + $websiteId = $websiteId->getId(); + } + $this->getSelect()->where('website.' . $entityInfo['entity_id_field'] . ' IN (?)', $websiteId); + + return $this; + } + + /** + * Provide support for website id filter + * + * @param string $field + * @param mixed $condition + * + * @return Mage_Rule_Model_Resource_Rule_Collection_Abstract + */ + public function addFieldToFilter($field, $condition = null) + { + if ($field == 'website_ids') { + return $this->addWebsiteFilter($condition); + } + + parent::addFieldToFilter($field, $condition); + return $this; + } + + /** + * Filter collection to only active or inactive rules + * + * @param int $isActive + * + * @return Mage_Rule_Model_Resource_Rule_Collection_Abstract + */ + public function addIsActiveFilter($isActive = 1) + { + if (!$this->getFlag('is_active_filter')) { + $this->addFieldToFilter('is_active', (int)$isActive ? 1 : 0); + $this->setFlag('is_active_filter', true); + } + return $this; + } + + /** + * Retrieve correspondent entity information (associations table name, columns names) + * of rule's associated entity by specified entity type + * + * @param string $entityType + * + * @return array + */ + protected function _getAssociatedEntityInfo($entityType) + { + if (isset($this->_associatedEntitiesMap[$entityType])) { + return $this->_associatedEntitiesMap[$entityType]; + } + + $e = Mage::exception( + 'Mage_Core', + Mage::helper('Mage_Rule_Helper_Data')->__( + 'There is no information about associated entity type "%s".', $entityType + ) + ); + throw $e; + } + + + + + + /** + * Set environment for all rules in collection + * + * @deprecated after 1.6.2.0 + * + * @param Mage_Rule_Model_Environment $env + * @return Mage_Rule_Model_Resource_Rule_Collection_Abstract + */ + public function setEnv(Mage_Rule_Model_Environment $env = null) + { + $this->_env = $env; + return $this; + } + + /** + * Retrieve environment for the rules in collection + * + * @deprecated after 1.6.2.0 + * + * @return Mage_Rule_Model_Resource_Rule_Collection_Abstract + */ + public function getEnv() + { + return $this->_env; + } + + /** + * Set filter for the collection based on the environment + * + * @deprecated after 1.6.2.0 + * + * @return Mage_Rule_Model_Resource_Rule_Collection_Abstract + */ + public function setActiveFilter() + { + return $this; + } + + /** + * Process the quote with all the rules in collection + * + * @deprecated after 1.6.2.0 + * + * @return Mage_Rule_Model_Resource_Rule_Collection_Abstract + */ + public function process() + { + return $this; + } +} diff --git a/app/code/core/Mage/Rule/Model/Rule.php b/app/code/core/Mage/Rule/Model/Rule.php index 80b57bbccbcfbcb50de126b9281df6c8806c6b99..4f5808efbd906046a167d02732951242274e014f 100644 --- a/app/code/core/Mage/Rule/Model/Rule.php +++ b/app/code/core/Mage/Rule/Model/Rule.php @@ -20,351 +20,38 @@ * * @category Mage * @package Mage_Rule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ /** - * Abstract promotion rule model + * Abstract Rule entity data model * - * The class is supposed to have name "Mage_Rule_Model_RuleAbstract", - * but the old name has been retained for backwards compatibility purposes. - * Also the architecture of abstract model doesn't allow to make the _construct() method abstract + * @deprecated since 1.7.0.0 use Mage_Rule_Model_Abstract instead + * + * @category Mage + * @package Mage_Rule + * @author Magento Core Team <core@magentocommerce.com> */ -abstract class Mage_Rule_Model_Rule extends Mage_Core_Model_Abstract +class Mage_Rule_Model_Rule extends Mage_Rule_Model_Abstract { - protected $_conditions; - protected $_actions; - protected $_form; - - /** - * Is model deleteable - * - * @var boolean - */ - protected $_isDeleteable = true; - /** - * Is model readonly + * Getter for rule combine conditions instance * - * @var boolean + * @return Mage_Rule_Model_Condition_Combine */ - protected $_isReadonly = false; - public function getConditionsInstance() { return Mage::getModel('Mage_Rule_Model_Condition_Combine'); } - public function _resetConditions($conditions=null) - { - if (is_null($conditions)) { - $conditions = $this->getConditionsInstance(); - } - $conditions->setRule($this)->setId('1')->setPrefix('conditions'); - $this->setConditions($conditions); - - return $this; - } - - public function setConditions($conditions) - { - $this->_conditions = $conditions; - return $this; - } - /** - * Retrieve Condition model + * Getter for rule actions collection instance * - * @return Mage_SalesRule_Model_Rule_Condition_Combine - */ - public function getConditions() - { - if (empty($this->_conditions)) { - $this->_resetConditions(); - } - return $this->_conditions; - } - - /** * @return Mage_Rule_Model_Action_Collection */ public function getActionsInstance() { return Mage::getModel('Mage_Rule_Model_Action_Collection'); } - - /** - * @param Mage_Rule_Model_Action_Collection $actions - * @return Mage_Rule_Model_Rule - */ - public function _resetActions($actions = null) - { - if (is_null($actions)) { - $actions = $this->getActionsInstance(); - } - $actions->setRule($this)->setId('1')->setPrefix('actions'); - $this->setActions($actions); - - return $this; - } - - public function setActions($actions) - { - $this->_actions = $actions; - return $this; - } - - public function getActions() - { - if (!$this->_actions) { - $this->_resetActions(); - } - return $this->_actions; - } - - public function getForm() - { - if (!$this->_form) { - $this->_form = new Varien_Data_Form(); - } - return $this->_form; - } - - public function asString($format='') - { - $str = Mage::helper('Mage_Rule_Helper_Data')->__("Name: %s", $this->getName()) ."\n" - . Mage::helper('Mage_Rule_Helper_Data')->__("Start at: %s", $this->getStartAt()) ."\n" - . Mage::helper('Mage_Rule_Helper_Data')->__("Expire at: %s", $this->getExpireAt()) ."\n" - . Mage::helper('Mage_Rule_Helper_Data')->__("Description: %s", $this->getDescription()) ."\n\n" - . $this->getConditions()->asStringRecursive() ."\n\n" - . $this->getActions()->asStringRecursive() ."\n\n"; - return $str; - } - - public function asHtml() - { - $str = Mage::helper('Mage_Rule_Helper_Data')->__("Name: %s", $this->getName()) ."<br/>" - . Mage::helper('Mage_Rule_Helper_Data')->__("Start at: %s", $this->getStartAt()) ."<br/>" - . Mage::helper('Mage_Rule_Helper_Data')->__("Expire at: %s", $this->getExpireAt()) ."<br/>" - . Mage::helper('Mage_Rule_Helper_Data')->__("Description: %s", $this->getDescription()) .'<br/>' - . '<ul class="rule-conditions">'.$this->getConditions()->asHtmlRecursive().'</ul>' - . '<ul class="rule-actions">'.$this->getActions()->asHtmlRecursive()."</ul>"; - return $str; - } - - public function loadPost(array $rule) - { - $arr = $this->_convertFlatToRecursive($rule); - if (isset($arr['conditions'])) { - $this->getConditions()->setConditions(array())->loadArray($arr['conditions'][1]); - } - if (isset($arr['actions'])) { - $this->getActions()->setActions(array())->loadArray($arr['actions'][1]); - } - - return $this; - } - - protected function _convertFlatToRecursive(array $rule) - { - $arr = array(); - foreach ($rule as $key=>$value) { - if (($key==='conditions' || $key==='actions') && is_array($value)) { - foreach ($value as $id=>$data) { - $path = explode('--', $id); - $node =& $arr; - for ($i=0, $l=sizeof($path); $i<$l; $i++) { - if (!isset($node[$key][$path[$i]])) { - $node[$key][$path[$i]] = array(); - } - $node =& $node[$key][$path[$i]]; - } - foreach ($data as $k=>$v) { - $node[$k] = $v; - } - } - } else { - /** - * convert dates into Zend_Date - */ - if (in_array($key, array('from_date', 'to_date')) && $value) { - $value = Mage::app()->getLocale()->date( - $value, - Varien_Date::DATE_INTERNAL_FORMAT, - null, - false - ); - } - $this->setData($key, $value); - } - } - return $arr; - } - - /** - * Returns rule as an array for admin interface - * - * Output example: - * array( - * 'name'=>'Example rule', - * 'conditions'=>{condition_combine::asArray} - * 'actions'=>{action_collection::asArray} - * ) - * - * @return array - */ - public function asArray(array $arrAttributes = array()) - { - $out = array( - 'name'=>$this->getName(), - 'start_at'=>$this->getStartAt(), - 'expire_at'=>$this->getExpireAt(), - 'description'=>$this->getDescription(), - 'conditions'=>$this->getConditions()->asArray(), - 'actions'=>$this->getActions()->asArray(), - ); - - return $out; - } - - public function validate(Varien_Object $object) - { - return $this->getConditions()->validate($object); - } - - public function afterLoad() - { - $this->_afterLoad(); - } - - protected function _afterLoad() - { - parent::_afterLoad(); - $conditionsArr = unserialize($this->getConditionsSerialized()); - if (!empty($conditionsArr) && is_array($conditionsArr)) { - $this->getConditions()->loadArray($conditionsArr); - } - - $actionsArr = unserialize($this->getActionsSerialized()); - if (!empty($actionsArr) && is_array($actionsArr)) { - $this->getActions()->loadArray($actionsArr); - } - - $websiteIds = $this->_getData('website_ids'); - if (is_string($websiteIds)) { - $this->setWebsiteIds(explode(',', $websiteIds)); - } - $groupIds = $this->getCustomerGroupIds(); - if (is_string($groupIds)) { - $this->setCustomerGroupIds(explode(',', $groupIds)); - } - } - - /** - * Prepare data before saving - * - * @return Mage_Rule_Model_Rule - */ - protected function _beforeSave() - { - // check if discount amount > 0 - if ((int)$this->getDiscountAmount() < 0) { - Mage::throwException(Mage::helper('Mage_Rule_Helper_Data')->__('Invalid discount amount.')); - } - - - if ($this->getConditions()) { - $this->setConditionsSerialized(serialize($this->getConditions()->asArray())); - $this->unsConditions(); - } - if ($this->getActions()) { - $this->setActionsSerialized(serialize($this->getActions()->asArray())); - $this->unsActions(); - } - - $this->_prepareWebsiteIds(); - - if (is_array($this->getCustomerGroupIds())) { - $this->setCustomerGroupIds(join(',', $this->getCustomerGroupIds())); - } - parent::_beforeSave(); - } - - /** - * Combain website ids to string - * - * @return Mage_Rule_Model_Rule - */ - protected function _prepareWebsiteIds() - { - if (is_array($this->getWebsiteIds())) { - $this->setWebsiteIds(join(',', $this->getWebsiteIds())); - } - return $this; - } - - /** - * Check availabitlity to delete model - * - * @return boolean - */ - public function isDeleteable() - { - return $this->_isDeleteable; - } - - /** - * Set is deleteable flag - * - * @param boolean $flag - * @return Mage_Rule_Model_Rule - */ - public function setIsDeleteable($flag) - { - $this->_isDeleteable = (bool) $flag; - return $this; - } - - - /** - * Checks model is readonly - * - * @return boolean - */ - public function isReadonly() - { - return $this->_isReadonly; - } - - /** - * Set is readonly flag - * - * @param boolean $value - * @return Mage_Rule_Model_Rule - */ - public function setIsReadonly($value) - { - $this->_isReadonly = (boolean) $value; - return $this; - } - - /** - * Validates data for rule - * @param Varien_Object $object - * @returns boolean|array - returns true if validation passed successfully. Array with error - * description otherwise - */ - public function validateData(Varien_Object $object) - { - if ($object->getData('from_date') && $object->getData('to_date')) { - $dateStart = new Zend_Date($object->getData('from_date'), Varien_Date::DATE_INTERNAL_FORMAT); - $dateEnd = new Zend_Date($object->getData('to_date'), Varien_Date::DATE_INTERNAL_FORMAT); - - if ($dateStart->compare($dateEnd)===1) { - return array(Mage::helper('Mage_Rule_Helper_Data')->__("End Date should be greater than Start Date")); - } - } - return true; - } } diff --git a/app/code/core/Mage/Rule/etc/config.xml b/app/code/core/Mage/Rule/etc/config.xml index d8ed058085679ca5251b65fdba2fa12a943709c7..608a24871cb4416eb39ef9cb776a5a18119f96ea 100644 --- a/app/code/core/Mage/Rule/etc/config.xml +++ b/app/code/core/Mage/Rule/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Rule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Sales/Block/Adminhtml/Billing/Agreement.php b/app/code/core/Mage/Sales/Block/Adminhtml/Billing/Agreement.php index 56a9c0b93819284c7ff6ca6dccb8e2f189005279..6d5f7d3c1ecec807e67a6a05e669f988d0dae132 100644 --- a/app/code/core/Mage/Sales/Block/Adminhtml/Billing/Agreement.php +++ b/app/code/core/Mage/Sales/Block/Adminhtml/Billing/Agreement.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Adminhtml/Billing/Agreement/Grid.php b/app/code/core/Mage/Sales/Block/Adminhtml/Billing/Agreement/Grid.php index 3f73a882536f25fdbe6515b62dae791ae4321a35..8d9d81c2c334f25e3de21175695771ffe3806c97 100644 --- a/app/code/core/Mage/Sales/Block/Adminhtml/Billing/Agreement/Grid.php +++ b/app/code/core/Mage/Sales/Block/Adminhtml/Billing/Agreement/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Adminhtml/Billing/Agreement/View.php b/app/code/core/Mage/Sales/Block/Adminhtml/Billing/Agreement/View.php index 77a381aee6c98a6f9073e0a7f9d8b5a9e4457547..6c19f1d9c5d5bcfa432f4e2e3809743c610ac446 100644 --- a/app/code/core/Mage/Sales/Block/Adminhtml/Billing/Agreement/View.php +++ b/app/code/core/Mage/Sales/Block/Adminhtml/Billing/Agreement/View.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Adminhtml/Billing/Agreement/View/Form.php b/app/code/core/Mage/Sales/Block/Adminhtml/Billing/Agreement/View/Form.php index d19d5a78ea18f82c82ca7be73cfac7495017c8d6..ae2d58fb7ad08a12d0cb20f42268a83cd68ae0b4 100644 --- a/app/code/core/Mage/Sales/Block/Adminhtml/Billing/Agreement/View/Form.php +++ b/app/code/core/Mage/Sales/Block/Adminhtml/Billing/Agreement/View/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Adminhtml/Billing/Agreement/View/Tab/Info.php b/app/code/core/Mage/Sales/Block/Adminhtml/Billing/Agreement/View/Tab/Info.php index 184ee9551dc16083f64befe3856837844938cd09..2b66be0c6ce218934c02caa3e0c60c7669ef38d3 100644 --- a/app/code/core/Mage/Sales/Block/Adminhtml/Billing/Agreement/View/Tab/Info.php +++ b/app/code/core/Mage/Sales/Block/Adminhtml/Billing/Agreement/View/Tab/Info.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Adminhtml/Billing/Agreement/View/Tab/Orders.php b/app/code/core/Mage/Sales/Block/Adminhtml/Billing/Agreement/View/Tab/Orders.php index 2e49be3df52c5d2e5826119cdae4787528003c31..1c0e4747d2ecabeea87adc2f48af0570840199ba 100644 --- a/app/code/core/Mage/Sales/Block/Adminhtml/Billing/Agreement/View/Tab/Orders.php +++ b/app/code/core/Mage/Sales/Block/Adminhtml/Billing/Agreement/View/Tab/Orders.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Adminhtml/Billing/Agreement/View/Tabs.php b/app/code/core/Mage/Sales/Block/Adminhtml/Billing/Agreement/View/Tabs.php index e85b2d86701660d6f985f919113ffb22fbbee5a3..4abbd3a90762507bc83f2cd3ced9f01fc568f5f2 100644 --- a/app/code/core/Mage/Sales/Block/Adminhtml/Billing/Agreement/View/Tabs.php +++ b/app/code/core/Mage/Sales/Block/Adminhtml/Billing/Agreement/View/Tabs.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Adminhtml/Customer/Edit/Tab/Agreement.php b/app/code/core/Mage/Sales/Block/Adminhtml/Customer/Edit/Tab/Agreement.php index 2ae6cd002584f0dfa4bf10edf27be81bfa3c9780..7722572bb2fd5a3661e86b4093223ab7b993faf0 100644 --- a/app/code/core/Mage/Sales/Block/Adminhtml/Customer/Edit/Tab/Agreement.php +++ b/app/code/core/Mage/Sales/Block/Adminhtml/Customer/Edit/Tab/Agreement.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Adminhtml/Customer/Edit/Tab/Recurring/Profile.php b/app/code/core/Mage/Sales/Block/Adminhtml/Customer/Edit/Tab/Recurring/Profile.php index 149018883d2e20aab6eb10e2c72217c6638f593e..a93f6598017c1520ddb92853cb527a945df6cc12 100644 --- a/app/code/core/Mage/Sales/Block/Adminhtml/Customer/Edit/Tab/Recurring/Profile.php +++ b/app/code/core/Mage/Sales/Block/Adminhtml/Customer/Edit/Tab/Recurring/Profile.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Adminhtml/Recurring/Profile.php b/app/code/core/Mage/Sales/Block/Adminhtml/Recurring/Profile.php index afe91b590ad41c7963d7af342db95121d9d4e660..6a23fc39317e4f11117de1a9422c4e88d5d59e18 100644 --- a/app/code/core/Mage/Sales/Block/Adminhtml/Recurring/Profile.php +++ b/app/code/core/Mage/Sales/Block/Adminhtml/Recurring/Profile.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Adminhtml/Recurring/Profile/Edit/Form.php b/app/code/core/Mage/Sales/Block/Adminhtml/Recurring/Profile/Edit/Form.php index 87993f5cd24f212445142f840c07989bef16b27c..fdb0615e52e6fb57ddf63c7517a0d3403bc2a65f 100644 --- a/app/code/core/Mage/Sales/Block/Adminhtml/Recurring/Profile/Edit/Form.php +++ b/app/code/core/Mage/Sales/Block/Adminhtml/Recurring/Profile/Edit/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Adminhtml/Recurring/Profile/Grid.php b/app/code/core/Mage/Sales/Block/Adminhtml/Recurring/Profile/Grid.php index bed29390cbd8dfc3a643d92cf0e66f54f0aa12e2..d479afa3d6b9ebc95164d0c261aa37b28e858a1e 100644 --- a/app/code/core/Mage/Sales/Block/Adminhtml/Recurring/Profile/Grid.php +++ b/app/code/core/Mage/Sales/Block/Adminhtml/Recurring/Profile/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Adminhtml/Recurring/Profile/View.php b/app/code/core/Mage/Sales/Block/Adminhtml/Recurring/Profile/View.php index 8c9a7e44d98d4f23409da91e3c19dc498965be51..f34e1f496143a1ef3a690eccfdc080755560417d 100644 --- a/app/code/core/Mage/Sales/Block/Adminhtml/Recurring/Profile/View.php +++ b/app/code/core/Mage/Sales/Block/Adminhtml/Recurring/Profile/View.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Adminhtml/Recurring/Profile/View/Getawayinfo.php b/app/code/core/Mage/Sales/Block/Adminhtml/Recurring/Profile/View/Getawayinfo.php index 15f83688b7cb3b6830b0473cc87a45c2b281d012..7b958b32cd69b5afbedacf4d95d9695121cbbae2 100644 --- a/app/code/core/Mage/Sales/Block/Adminhtml/Recurring/Profile/View/Getawayinfo.php +++ b/app/code/core/Mage/Sales/Block/Adminhtml/Recurring/Profile/View/Getawayinfo.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Adminhtml/Recurring/Profile/View/Info.php b/app/code/core/Mage/Sales/Block/Adminhtml/Recurring/Profile/View/Info.php index 30488a7b1f01ab5881d34181e420a221a3a08c74..fb5c4f3e6d17a2bed2c0c535f4dab2d4cc1ee4d1 100644 --- a/app/code/core/Mage/Sales/Block/Adminhtml/Recurring/Profile/View/Info.php +++ b/app/code/core/Mage/Sales/Block/Adminhtml/Recurring/Profile/View/Info.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Adminhtml/Recurring/Profile/View/Items.php b/app/code/core/Mage/Sales/Block/Adminhtml/Recurring/Profile/View/Items.php index 57e84933c43e0ec94f5fbd5bb2276cb0dbf782ed..84043ea9488a43c24e4a071424d068c36e9a28ab 100644 --- a/app/code/core/Mage/Sales/Block/Adminhtml/Recurring/Profile/View/Items.php +++ b/app/code/core/Mage/Sales/Block/Adminhtml/Recurring/Profile/View/Items.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Adminhtml/Recurring/Profile/View/Tab/Info.php b/app/code/core/Mage/Sales/Block/Adminhtml/Recurring/Profile/View/Tab/Info.php index 408ff2a7ddb65b402d6187b565c2534a6c39cccc..1996a069e0d1eae0c1ebd486cf1869b99d974a3b 100644 --- a/app/code/core/Mage/Sales/Block/Adminhtml/Recurring/Profile/View/Tab/Info.php +++ b/app/code/core/Mage/Sales/Block/Adminhtml/Recurring/Profile/View/Tab/Info.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Adminhtml/Recurring/Profile/View/Tab/Orders.php b/app/code/core/Mage/Sales/Block/Adminhtml/Recurring/Profile/View/Tab/Orders.php index 90b71a9d330180a93592ef501fdbb9987af68911..826cb87eb77688cc3d47c91f61bb3548a9e495c8 100644 --- a/app/code/core/Mage/Sales/Block/Adminhtml/Recurring/Profile/View/Tab/Orders.php +++ b/app/code/core/Mage/Sales/Block/Adminhtml/Recurring/Profile/View/Tab/Orders.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Adminhtml/Report/Filter/Form.php b/app/code/core/Mage/Sales/Block/Adminhtml/Report/Filter/Form.php index 93412e03ec8c2e298f2a5d1599a162d958c61ebe..5149606ba5faf3c97fdf6a57e76d8fadfcfa9e0a 100644 --- a/app/code/core/Mage/Sales/Block/Adminhtml/Report/Filter/Form.php +++ b/app/code/core/Mage/Sales/Block/Adminhtml/Report/Filter/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Adminhtml/Report/Filter/Form/Coupon.php b/app/code/core/Mage/Sales/Block/Adminhtml/Report/Filter/Form/Coupon.php new file mode 100644 index 0000000000000000000000000000000000000000..11e5d826cd3a5d8f04b65b045794529c32c3481e --- /dev/null +++ b/app/code/core/Mage/Sales/Block/Adminhtml/Report/Filter/Form/Coupon.php @@ -0,0 +1,89 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Sales + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Sales Adminhtml report filter form for coupons report + * + * @category Mage + * @package Mage_Sales + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Sales_Block_Adminhtml_Report_Filter_Form_Coupon extends Mage_Sales_Block_Adminhtml_Report_Filter_Form +{ + /** + * Prepare form + * + * @return Mage_Sales_Block_Adminhtml_Report_Filter_Form_Coupon + */ + protected function _prepareForm() + { + parent::_prepareForm(); + + $form = $this->getForm(); + $htmlIdPrefix = $form->getHtmlIdPrefix(); + + /** @var Varien_Data_Form_Element_Fieldset $fieldset */ + $fieldset = $this->getForm()->getElement('base_fieldset'); + + if (is_object($fieldset) && $fieldset instanceof Varien_Data_Form_Element_Fieldset) { + + $fieldset->addField('price_rule_type', 'select', array( + 'name' => 'price_rule_type', + 'options' => array( + Mage::helper('Mage_Reports_Helper_Data')->__('Any'), + Mage::helper('Mage_Reports_Helper_Data')->__('Specified') + ), + 'label' => Mage::helper('Mage_Reports_Helper_Data')->__('Shopping Cart Price Rule'), + )); + + $rulesList = Mage::getResourceModel('Mage_SalesRule_Model_Resource_Report_Rule')->getUniqRulesNamesList(); + + $rulesListOptions = array(); + + foreach ($rulesList as $key => $ruleName) { + $rulesListOptions[] = array( + 'label' => $ruleName, + 'value' => $key, + 'title' => $ruleName + ); + } + + $fieldset->addField('rules_list', 'multiselect', array( + 'name' => 'rules_list', + 'values' => $rulesListOptions, + 'display' => 'none' + ), 'price_rule_type'); + + $this->setChild('form_after', $this->getLayout()->createBlock('Mage_Adminhtml_Block_Widget_Form_Element_Dependence') + ->addFieldMap($htmlIdPrefix . 'price_rule_type', 'price_rule_type') + ->addFieldMap($htmlIdPrefix . 'rules_list', 'rules_list') + ->addFieldDependence('rules_list', 'price_rule_type', '1') + ); + } + + return $this; + } +} diff --git a/app/code/core/Mage/Sales/Block/Adminhtml/Report/Filter/Form/Order.php b/app/code/core/Mage/Sales/Block/Adminhtml/Report/Filter/Form/Order.php index f464a1e002a993a8e8a9fb12fa73b4ae0804dcb8..45a4c1b0bd2f89b6325db2826a6e669240dcf3a3 100644 --- a/app/code/core/Mage/Sales/Block/Adminhtml/Report/Filter/Form/Order.php +++ b/app/code/core/Mage/Sales/Block/Adminhtml/Report/Filter/Form/Order.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Billing/Agreement/View.php b/app/code/core/Mage/Sales/Block/Billing/Agreement/View.php index 99a74141957388a50bddf52051b0cefe6cc523a7..2f1058b621b2284a85adc5a4d49ce120767c6c15 100644 --- a/app/code/core/Mage/Sales/Block/Billing/Agreement/View.php +++ b/app/code/core/Mage/Sales/Block/Billing/Agreement/View.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Billing/Agreements.php b/app/code/core/Mage/Sales/Block/Billing/Agreements.php index 5bddb5e5bbedd34b4184d46acf1309f6f1eb0f82..5b2482d0786e04dcfc67b44048985f4185afc710 100644 --- a/app/code/core/Mage/Sales/Block/Billing/Agreements.php +++ b/app/code/core/Mage/Sales/Block/Billing/Agreements.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Guest/Links.php b/app/code/core/Mage/Sales/Block/Guest/Links.php index b07835787faf62877a1f810bb2aa7fd4fbcc28f9..552d9d792085bb2a391446f02fee800069db5510 100644 --- a/app/code/core/Mage/Sales/Block/Guest/Links.php +++ b/app/code/core/Mage/Sales/Block/Guest/Links.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Items/Abstract.php b/app/code/core/Mage/Sales/Block/Items/Abstract.php index 390f0d4f12930a2da5bd3696e2d019ef2572e6c7..334e16dc906a26c58f92c2b38139266520e303ed 100644 --- a/app/code/core/Mage/Sales/Block/Items/Abstract.php +++ b/app/code/core/Mage/Sales/Block/Items/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Order/Comments.php b/app/code/core/Mage/Sales/Block/Order/Comments.php index 923de53fe18e4e8e50c3a4cacb7a26a059160f71..ee4f16906b72ae028707cab24ca4e51aeabacc79 100644 --- a/app/code/core/Mage/Sales/Block/Order/Comments.php +++ b/app/code/core/Mage/Sales/Block/Order/Comments.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Sales_Block_Order_Comments extends Mage_Core_Block_Template diff --git a/app/code/core/Mage/Sales/Block/Order/Creditmemo.php b/app/code/core/Mage/Sales/Block/Order/Creditmemo.php index c4e4f35831e04aa94168e064799d641102c04ca0..51401effa7022905ff1468c55cbf4f993c3b837a 100644 --- a/app/code/core/Mage/Sales/Block/Order/Creditmemo.php +++ b/app/code/core/Mage/Sales/Block/Order/Creditmemo.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Order/Creditmemo/Items.php b/app/code/core/Mage/Sales/Block/Order/Creditmemo/Items.php index f7957e641fcd236a744a0cf35ab0d03ae368b3cc..f7d59ff4e82d9ebbde42d21479aca553fc2fb2ef 100644 --- a/app/code/core/Mage/Sales/Block/Order/Creditmemo/Items.php +++ b/app/code/core/Mage/Sales/Block/Order/Creditmemo/Items.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Order/Creditmemo/Totals.php b/app/code/core/Mage/Sales/Block/Order/Creditmemo/Totals.php index 63786743d26b3f5da559577f181c724f65639656..eec15716ae12f864b70d3f4be6a2996bdab577fc 100644 --- a/app/code/core/Mage/Sales/Block/Order/Creditmemo/Totals.php +++ b/app/code/core/Mage/Sales/Block/Order/Creditmemo/Totals.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Sales_Block_Order_Creditmemo_Totals extends Mage_Sales_Block_Order_Totals diff --git a/app/code/core/Mage/Sales/Block/Order/Email/Creditmemo/Items.php b/app/code/core/Mage/Sales/Block/Order/Email/Creditmemo/Items.php index b73c865c6a3520704ae87a35962a4776ef63e2ad..f1c414266598045e4113412bec46dc976f470b83 100644 --- a/app/code/core/Mage/Sales/Block/Order/Email/Creditmemo/Items.php +++ b/app/code/core/Mage/Sales/Block/Order/Email/Creditmemo/Items.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Order/Email/Invoice/Items.php b/app/code/core/Mage/Sales/Block/Order/Email/Invoice/Items.php index 06dce456914cc6c438f15b45df350953f919d3eb..44af5855474064489f23597611eafe4430c1cd17 100644 --- a/app/code/core/Mage/Sales/Block/Order/Email/Invoice/Items.php +++ b/app/code/core/Mage/Sales/Block/Order/Email/Invoice/Items.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Order/Email/Items.php b/app/code/core/Mage/Sales/Block/Order/Email/Items.php index 9b7e8f0b0067c97b5a1624f49b3254d7cd0ce77c..a2660a7ad09d5ba7d5de5ee0c322f6949ac45546 100644 --- a/app/code/core/Mage/Sales/Block/Order/Email/Items.php +++ b/app/code/core/Mage/Sales/Block/Order/Email/Items.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Order/Email/Items/Default.php b/app/code/core/Mage/Sales/Block/Order/Email/Items/Default.php index ad66d65104e5a5b2368a45249283ce1a31c3dc4d..36bc964f5f6c9ef0b91114d40617ae44cec132a3 100644 --- a/app/code/core/Mage/Sales/Block/Order/Email/Items/Default.php +++ b/app/code/core/Mage/Sales/Block/Order/Email/Items/Default.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Order/Email/Items/Order/Default.php b/app/code/core/Mage/Sales/Block/Order/Email/Items/Order/Default.php index 195e260271ff58f98d5acad4aa1ef2f0eb1c7edd..a3cf2af4cea7aae6d6f82fdd86e06ad992c16219 100644 --- a/app/code/core/Mage/Sales/Block/Order/Email/Items/Order/Default.php +++ b/app/code/core/Mage/Sales/Block/Order/Email/Items/Order/Default.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Order/Email/Items/Order/Grouped.php b/app/code/core/Mage/Sales/Block/Order/Email/Items/Order/Grouped.php index f428016dc68156d6a4bc3406172d54239cd8e7ae..1c6dcf7563ee484974c52e41bd1c63627d718fc0 100644 --- a/app/code/core/Mage/Sales/Block/Order/Email/Items/Order/Grouped.php +++ b/app/code/core/Mage/Sales/Block/Order/Email/Items/Order/Grouped.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Order/Email/Shipment/Items.php b/app/code/core/Mage/Sales/Block/Order/Email/Shipment/Items.php index 9250f29f6bc78a94e4f7f29aee1447f1220e9e53..9b681a77635db115dd8d5d17e117d10abeab1103 100644 --- a/app/code/core/Mage/Sales/Block/Order/Email/Shipment/Items.php +++ b/app/code/core/Mage/Sales/Block/Order/Email/Shipment/Items.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Order/History.php b/app/code/core/Mage/Sales/Block/Order/History.php index 4860ef9cadcf83ea044c282471b7bc2eacd9ca9e..e117af685db31dbbfbe68a03e5b316716fcbac7c 100644 --- a/app/code/core/Mage/Sales/Block/Order/History.php +++ b/app/code/core/Mage/Sales/Block/Order/History.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Order/Info.php b/app/code/core/Mage/Sales/Block/Order/Info.php index 4d1d02d62d2b6892d4056fad8dd5a2d0bf4f530c..039432c166eff18db2c38c814b8b20f1ef87b938 100644 --- a/app/code/core/Mage/Sales/Block/Order/Info.php +++ b/app/code/core/Mage/Sales/Block/Order/Info.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Order/Info/Buttons.php b/app/code/core/Mage/Sales/Block/Order/Info/Buttons.php index b83a8b72a0d9f4d4aa183ea8b778c6d5206e32cc..4b2db55f071355663a1cd133f26839dc55a46e05 100644 --- a/app/code/core/Mage/Sales/Block/Order/Info/Buttons.php +++ b/app/code/core/Mage/Sales/Block/Order/Info/Buttons.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Order/Invoice.php b/app/code/core/Mage/Sales/Block/Order/Invoice.php index 3f646c619d8747d4ae3b4282312968cd5532cb1c..edf4c6083a22dc3b6ed2e4c3c3fea573552574af 100644 --- a/app/code/core/Mage/Sales/Block/Order/Invoice.php +++ b/app/code/core/Mage/Sales/Block/Order/Invoice.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Order/Invoice/Items.php b/app/code/core/Mage/Sales/Block/Order/Invoice/Items.php index 1236919d3a5e04b9e70eff038e1249f12b819348..e1b6e9c0bd6dd4f6aacc073676b6ff603dde1239 100644 --- a/app/code/core/Mage/Sales/Block/Order/Invoice/Items.php +++ b/app/code/core/Mage/Sales/Block/Order/Invoice/Items.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Order/Invoice/Totals.php b/app/code/core/Mage/Sales/Block/Order/Invoice/Totals.php index 9ce722c101c1b24024169df344cb2eac340918ba..dc1d42276d3eac363eb638572928bba5e5da6b4e 100644 --- a/app/code/core/Mage/Sales/Block/Order/Invoice/Totals.php +++ b/app/code/core/Mage/Sales/Block/Order/Invoice/Totals.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Sales_Block_Order_Invoice_Totals extends Mage_Sales_Block_Order_Totals diff --git a/app/code/core/Mage/Sales/Block/Order/Item/Renderer/Default.php b/app/code/core/Mage/Sales/Block/Order/Item/Renderer/Default.php index a9a54a19b51f2e213e3686d4889c66b5e0f99ffe..f0c9436ecb544dc2ef780088a407c00f130bdc62 100644 --- a/app/code/core/Mage/Sales/Block/Order/Item/Renderer/Default.php +++ b/app/code/core/Mage/Sales/Block/Order/Item/Renderer/Default.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Order/Item/Renderer/Grouped.php b/app/code/core/Mage/Sales/Block/Order/Item/Renderer/Grouped.php index 479141996cedb84e4035150e1b706373881841e1..519bfed9847a34ad33719d9c94324d64f232a9d1 100644 --- a/app/code/core/Mage/Sales/Block/Order/Item/Renderer/Grouped.php +++ b/app/code/core/Mage/Sales/Block/Order/Item/Renderer/Grouped.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Order/Items.php b/app/code/core/Mage/Sales/Block/Order/Items.php index 688e756e33d7ec05441ee326793835609b703543..9d08b56732c674878a039b568f95e871a45f04fa 100644 --- a/app/code/core/Mage/Sales/Block/Order/Items.php +++ b/app/code/core/Mage/Sales/Block/Order/Items.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Order/Print.php b/app/code/core/Mage/Sales/Block/Order/Print.php index 15c1a45e47e1cbc2224296b94b366933305e1cc2..4a0c24bb290377a23ebc07026f38fcf55e36d200 100644 --- a/app/code/core/Mage/Sales/Block/Order/Print.php +++ b/app/code/core/Mage/Sales/Block/Order/Print.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Order/Print/Creditmemo.php b/app/code/core/Mage/Sales/Block/Order/Print/Creditmemo.php index 33ab6efe2909624c6060b6ab58ce35df411c8411..015208c16ee8ae643a4e4db48afffdf01e12f5bf 100644 --- a/app/code/core/Mage/Sales/Block/Order/Print/Creditmemo.php +++ b/app/code/core/Mage/Sales/Block/Order/Print/Creditmemo.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Order/Print/Invoice.php b/app/code/core/Mage/Sales/Block/Order/Print/Invoice.php index dc7548b581249461bdd80518929ffd6a6d689f7f..ef5c636e6b890e611b976cf4fe84b68de33d0825 100644 --- a/app/code/core/Mage/Sales/Block/Order/Print/Invoice.php +++ b/app/code/core/Mage/Sales/Block/Order/Print/Invoice.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Order/Print/Shipment.php b/app/code/core/Mage/Sales/Block/Order/Print/Shipment.php index bb6d557593fa9591b5f868d81995f566b973e481..6922802c6bec805c72385709b66accc318949098 100644 --- a/app/code/core/Mage/Sales/Block/Order/Print/Shipment.php +++ b/app/code/core/Mage/Sales/Block/Order/Print/Shipment.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Order/Recent.php b/app/code/core/Mage/Sales/Block/Order/Recent.php index e58c68aa033f5b4fd99a1ebfd2933036cabf4919..2b6b5b3a3fe63100c9d8f86629df401a910b62d4 100644 --- a/app/code/core/Mage/Sales/Block/Order/Recent.php +++ b/app/code/core/Mage/Sales/Block/Order/Recent.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Order/Shipment.php b/app/code/core/Mage/Sales/Block/Order/Shipment.php index f4678dec4e140d949ab5dd366a2281bb07cce6f4..e8de43684fe9a49fccf384c58536b443aaf3466e 100644 --- a/app/code/core/Mage/Sales/Block/Order/Shipment.php +++ b/app/code/core/Mage/Sales/Block/Order/Shipment.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Order/Shipment/Items.php b/app/code/core/Mage/Sales/Block/Order/Shipment/Items.php index a7c2c15770e9563bff2cfafd34cc37472e45b8f5..62e82a733fbbad8acfb6b64b58b26d424d6e7607 100644 --- a/app/code/core/Mage/Sales/Block/Order/Shipment/Items.php +++ b/app/code/core/Mage/Sales/Block/Order/Shipment/Items.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Order/Totals.php b/app/code/core/Mage/Sales/Block/Order/Totals.php index 9517876a956134c6866bc34bac512dbdbed5d94b..26c9e6d28c527e67929754307c469a9a7c64773d 100644 --- a/app/code/core/Mage/Sales/Block/Order/Totals.php +++ b/app/code/core/Mage/Sales/Block/Order/Totals.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Sales_Block_Order_Totals extends Mage_Core_Block_Template diff --git a/app/code/core/Mage/Sales/Block/Order/View.php b/app/code/core/Mage/Sales/Block/Order/View.php index d7c41096f34c0bbce4696bc012eb3e165cb3196f..7e0eb5c7c5cee3d2df99838c4a6859a27d6c7aee 100644 --- a/app/code/core/Mage/Sales/Block/Order/View.php +++ b/app/code/core/Mage/Sales/Block/Order/View.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Payment/Form/Billing/Agreement.php b/app/code/core/Mage/Sales/Block/Payment/Form/Billing/Agreement.php index 7768b6f23c9baa614936b09ab28fd79a5a9afa89..aba53e8a16f3281c4d653b7cb0ce8c51aeab16fd 100644 --- a/app/code/core/Mage/Sales/Block/Payment/Form/Billing/Agreement.php +++ b/app/code/core/Mage/Sales/Block/Payment/Form/Billing/Agreement.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Payment/Info/Billing/Agreement.php b/app/code/core/Mage/Sales/Block/Payment/Info/Billing/Agreement.php index 7c352ccfbfa537c2937474447133173240051546..b64bc9e0b11211fae3ea593faf6248b3903bbb6d 100644 --- a/app/code/core/Mage/Sales/Block/Payment/Info/Billing/Agreement.php +++ b/app/code/core/Mage/Sales/Block/Payment/Info/Billing/Agreement.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Recurring/Profile/View.php b/app/code/core/Mage/Sales/Block/Recurring/Profile/View.php index 9dfd1e9e6bfd568a215cd4456b16e713c3f80b70..86132518e817575c49594e2691e968c93cdab0cd 100644 --- a/app/code/core/Mage/Sales/Block/Recurring/Profile/View.php +++ b/app/code/core/Mage/Sales/Block/Recurring/Profile/View.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Recurring/Profiles.php b/app/code/core/Mage/Sales/Block/Recurring/Profiles.php index a6f41be9c72f65087b844cc03f0ce9a5998a50b9..b394fb6fc50cee5418a5c5b23e7063df0e707fe6 100644 --- a/app/code/core/Mage/Sales/Block/Recurring/Profiles.php +++ b/app/code/core/Mage/Sales/Block/Recurring/Profiles.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Block/Reorder/Sidebar.php b/app/code/core/Mage/Sales/Block/Reorder/Sidebar.php index 028adf7afbc3e471bbf9e63c7fe91714a7bc5261..92181614edd8d94ac9e92956bacc2c71cbc534e8 100644 --- a/app/code/core/Mage/Sales/Block/Reorder/Sidebar.php +++ b/app/code/core/Mage/Sales/Block/Reorder/Sidebar.php @@ -20,13 +20,15 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ /** * Sales order view block * + * @method int|null getCustomerId() + * * @category Mage * @package Mage_Sales * @author Magento Core Team <core@magentocommerce.com> @@ -40,7 +42,7 @@ class Mage_Sales_Block_Reorder_Sidebar extends Mage_Core_Block_Template { parent::__construct(); - if (Mage::getSingleton('Mage_Customer_Model_Session')->isLoggedIn()) { + if ($this->_getCustomerSession()->isLoggedIn()) { $this->setTemplate('order/history.phtml'); $this->initOrders(); } @@ -53,7 +55,7 @@ class Mage_Sales_Block_Reorder_Sidebar extends Mage_Core_Block_Template public function initOrders() { $customerId = $this->getCustomerId() ? $this->getCustomerId() - : Mage::getSingleton('Mage_Customer_Model_Session')->getCustomer()->getId(); + : $this->_getCustomerSession()->getCustomer()->getId(); $orders = Mage::getResourceModel('Mage_Sales_Model_Resource_Order_Collection') ->addAttributeToFilter('customer_id', $customerId) @@ -118,7 +120,7 @@ class Mage_Sales_Block_Reorder_Sidebar extends Mage_Core_Block_Template /** * Last order getter * - * @return Mage_Sales_Model_Order | false + * @return Mage_Sales_Model_Order|false */ public function getLastOrder() { @@ -128,13 +130,23 @@ class Mage_Sales_Block_Reorder_Sidebar extends Mage_Core_Block_Template return false; } + /** + * Render "My Orders" sidebar block + * + * @return string + */ protected function _toHtml() { - if (Mage::helper('Mage_Sales_Helper_Reorder')->isAllow() - && (Mage::getSingleton('Mage_Customer_Model_Session')->isLoggedIn() || $this->getCustomerId()) - ) { - return parent::_toHtml(); - } - return ''; + return $this->_getCustomerSession()->isLoggedIn() || $this->getCustomerId() ? parent::_toHtml() : ''; + } + + /** + * Retrieve customer session instance + * + * @return Mage_Customer_Model_Session + */ + protected function _getCustomerSession() + { + return Mage::getSingleton('Mage_Customer_Model_Session'); } } diff --git a/app/code/core/Mage/Sales/Block/Widget/Guest/Form.php b/app/code/core/Mage/Sales/Block/Widget/Guest/Form.php index 449d13037b6252c61906b13de1269979e05849b1..cd28e303b24c5bfec3fc83c291d8b74c47fb2701 100644 --- a/app/code/core/Mage/Sales/Block/Widget/Guest/Form.php +++ b/app/code/core/Mage/Sales/Block/Widget/Guest/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Controller/Abstract.php b/app/code/core/Mage/Sales/Controller/Abstract.php index 1a2c80495255a501212324c9f1e5b63ebb77c497..4cae6fa5b2fdbf27f9a2bef194d35ee9d3286f29 100644 --- a/app/code/core/Mage/Sales/Controller/Abstract.php +++ b/app/code/core/Mage/Sales/Controller/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Cms - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Exception.php b/app/code/core/Mage/Sales/Exception.php index f59927a937ca7ce3ed844f58c5c2c3f6d578577c..2877ce5434fdeb74001374c2dfd670321d6e6b5b 100644 --- a/app/code/core/Mage/Sales/Exception.php +++ b/app/code/core/Mage/Sales/Exception.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Helper/Data.php b/app/code/core/Mage/Sales/Helper/Data.php index b0d3bdd2258866b4a69df67e2d37361ca67b61a6..db92c4a45a4cccec0b69e27e50823f27c9e14fba 100644 --- a/app/code/core/Mage/Sales/Helper/Data.php +++ b/app/code/core/Mage/Sales/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Helper/Guest.php b/app/code/core/Mage/Sales/Helper/Guest.php index 560160e4ac629960c7bbf5f5c5fd31ea0f679781..2481823649551661581143744b7d96e4efabbd18 100644 --- a/app/code/core/Mage/Sales/Helper/Guest.php +++ b/app/code/core/Mage/Sales/Helper/Guest.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Helper/Reorder.php b/app/code/core/Mage/Sales/Helper/Reorder.php index 80a767cfd4170908d0803312b7848f49a0c93281..82e19ec2f2baac305e58b639319ad98d735c5dbc 100644 --- a/app/code/core/Mage/Sales/Helper/Reorder.php +++ b/app/code/core/Mage/Sales/Helper/Reorder.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Abstract.php b/app/code/core/Mage/Sales/Model/Abstract.php index c98cda0f12fdd0d961e5490d3f50b10465a58044..c56d934e133e03529be1f2c3ea89fcd373b828e2 100644 --- a/app/code/core/Mage/Sales/Model/Abstract.php +++ b/app/code/core/Mage/Sales/Model/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Api/Resource.php b/app/code/core/Mage/Sales/Model/Api/Resource.php index d04b5b9cfa0f9e1b98a30879dd1dee4be381f6be..0711cd893c42bd9dc931057d982f8d30dac874a6 100644 --- a/app/code/core/Mage/Sales/Model/Api/Resource.php +++ b/app/code/core/Mage/Sales/Model/Api/Resource.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Billing/Agreement.php b/app/code/core/Mage/Sales/Model/Billing/Agreement.php index 022ef6d1b50c4888fcde1de02ef37e72157edad4..fe7d14eb81ae54cafad1ecdd43888233052b1819 100644 --- a/app/code/core/Mage/Sales/Model/Billing/Agreement.php +++ b/app/code/core/Mage/Sales/Model/Billing/Agreement.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Config.php b/app/code/core/Mage/Sales/Model/Config.php index dfe3a211b4de6d335d1bf2447091384b0bb4572d..5e1cbbbe697e7bf828d4bddd97f9b684f5470dc1 100644 --- a/app/code/core/Mage/Sales/Model/Config.php +++ b/app/code/core/Mage/Sales/Model/Config.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Convert/Order.php b/app/code/core/Mage/Sales/Model/Convert/Order.php index d0883f03bc3a8b5153ce3dd8a4e6305aac00d4b6..5991fb74dadbd1b6ea8ba0ea237a565aa560156f 100644 --- a/app/code/core/Mage/Sales/Model/Convert/Order.php +++ b/app/code/core/Mage/Sales/Model/Convert/Order.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Convert/Quote.php b/app/code/core/Mage/Sales/Model/Convert/Quote.php index e236ebfeef6e8874cfc7ddd45f1a5d676a9e4175..22b8e2b7998174118e0e984160b725e7d1466bf4 100644 --- a/app/code/core/Mage/Sales/Model/Convert/Quote.php +++ b/app/code/core/Mage/Sales/Model/Convert/Quote.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Email/Template.php b/app/code/core/Mage/Sales/Model/Email/Template.php index b870d3605995db7570a542be950e71349318a768..ae86621edebfe6714c99476a4e3c0a7b8b0684e4 100644 --- a/app/code/core/Mage/Sales/Model/Email/Template.php +++ b/app/code/core/Mage/Sales/Model/Email/Template.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Observer.php b/app/code/core/Mage/Sales/Model/Observer.php index cc3b8291b2620864eb763dbfb9e290c0a855ac0b..4488b5a2861355e6344945992f65a2a5c256e120 100644 --- a/app/code/core/Mage/Sales/Model/Observer.php +++ b/app/code/core/Mage/Sales/Model/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -334,5 +334,187 @@ class Mage_Sales_Model_Observer $quote->setCanApplyMsrp($canApplyMsrp); } -} + /** + * Add VAT validation request date and identifier to order comments + * + * @param Varien_Event_Observer $observer + * @return null + */ + public function addVatRequestParamsOrderComment(Varien_Event_Observer $observer) + { + /** @var $orderInstance Mage_Sales_Model_Order */ + $orderInstance = $observer->getOrder(); + /** @var $orderAddress Mage_Sales_Model_Order_Address */ + $orderAddress = $this->_getVatRequiredSalesAddress($orderInstance); + if (!($orderAddress instanceof Mage_Sales_Model_Order_Address)) { + return; + } + + $vatRequestId = $orderAddress->getVatRequestId(); + $vatRequestDate = $orderAddress->getVatRequestDate(); + if (is_string($vatRequestId) && !empty($vatRequestId) && is_string($vatRequestDate) + && !empty($vatRequestDate) + ) { + $orderHistoryComment = Mage::helper('Mage_Customer_Helper_Data')->__('VAT Request Identifier') + . ': ' . $vatRequestId . '<br />' . Mage::helper('Mage_Customer_Helper_Data')->__('VAT Request Date') + . ': ' . $vatRequestDate; + $orderInstance->addStatusHistoryComment($orderHistoryComment, false); + } + } + + /** + * Retrieve sales address (order or quote) on which tax calculation must be based + * + * @param Mage_Core_Model_Abstract $salesModel + * @param Mage_Core_Model_Store|string|int|null $store + * @return Mage_Customer_Model_Address_Abstract|null + */ + protected function _getVatRequiredSalesAddress($salesModel, $store = null) + { + $configAddressType = Mage::helper('Mage_Customer_Helper_Address')->getTaxCalculationAddressType($store); + $requiredAddress = null; + switch ($configAddressType) { + case Mage_Customer_Model_Address_Abstract::TYPE_SHIPPING: + $requiredAddress = $salesModel->getShippingAddress(); + break; + default: + $requiredAddress = $salesModel->getBillingAddress(); + } + return $requiredAddress; + } + + /** + * Retrieve customer address (default billing or default shipping) ID on which tax calculation must be based + * + * @param Mage_Customer_Model_Customer $customer + * @param Mage_Core_Model_Store|string|int|null $store + * @return int|string + */ + protected function _getVatRequiredCustomerAddress(Mage_Customer_Model_Customer $customer, $store = null) + { + $configAddressType = Mage::helper('Mage_Customer_Helper_Address')->getTaxCalculationAddressType($store); + $requiredAddress = null; + switch ($configAddressType) { + case Mage_Customer_Model_Address_Abstract::TYPE_SHIPPING: + $requiredAddress = $customer->getDefaultShipping(); + break; + default: + $requiredAddress = $customer->getDefaultBilling(); + } + return $requiredAddress; + } + + /** + * Handle customer VAT number if needed on collect_totals_before event of quote address + * + * @param Varien_Event_Observer $observer + */ + public function changeQuoteCustomerGroupId(Varien_Event_Observer $observer) + { + /** @var $addressHelper Mage_Customer_Helper_Address */ + $addressHelper = Mage::helper('Mage_Customer_Helper_Address'); + + $quoteAddress = $observer->getQuoteAddress(); + $quoteInstance = $quoteAddress->getQuote(); + $customerInstance = $quoteInstance->getCustomer(); + + $storeId = $customerInstance->getStore(); + + $configAddressType = Mage::helper('Mage_Customer_Helper_Address')->getTaxCalculationAddressType($storeId); + + // When VAT is based on billing address then Magento have to handle only billing addresses + $additionalBillingAddressCondition = ($configAddressType == Mage_Customer_Model_Address_Abstract::TYPE_BILLING) + ? $configAddressType != $quoteAddress->getAddressType() : false; + // Handle only addresses that corresponds to VAT configuration + if (!$addressHelper->isVatValidationEnabled($storeId) || $additionalBillingAddressCondition) { + return; + } + + /** @var $customerHelper Mage_Customer_Helper_Data */ + $customerHelper = Mage::helper('Mage_Customer_Helper_Data'); + + $customerAddressId = $quoteAddress->getCustomerAddressId(); + $customerDefaultAddressId = $this->_getVatRequiredCustomerAddress($customerInstance, $storeId); + + $customerCountryCode = $quoteAddress->getCountryId(); + $customerVatNumber = $quoteAddress->getVatId(); + + if (empty($customerVatNumber) || !Mage::helper('Mage_Core_Helper_Data')->isCountryInEU($customerCountryCode)) { + $groupId = ($customerInstance->getId()) ? $customerHelper->getDefaultCustomerGroupId($storeId) + : Mage_Customer_Model_Group::NOT_LOGGED_IN_ID; + + $quoteAddress->setPrevQuoteCustomerGroupId($quoteInstance->getCustomerGroupId()); + $customerInstance->setGroupId($groupId); + $quoteInstance->setCustomerGroupId($groupId); + + return; + } + + /** @var $coreHelper Mage_Core_Helper_Data */ + $coreHelper = Mage::helper('Mage_Core_Helper_Data'); + $merchantCountryCode = $coreHelper->getMerchantCountryCode(); + $merchantVatNumber = $coreHelper->getMerchantVatNumber(); + + $gatewayResponse = null; + if ($addressHelper->getValidateOnEachTransaction($storeId) + || $customerCountryCode != $quoteAddress->getValidatedCountryCode() + || $customerVatNumber != $quoteAddress->getValidatedVatNumber() + ) { + // Send request to gateway + $gatewayResponse = $customerHelper->checkVatNumber( + $customerCountryCode, + $customerVatNumber, + ($merchantVatNumber !== '') ? $merchantCountryCode : '', + $merchantVatNumber + ); + + // Store validation results in corresponding quote address + $quoteAddress->setVatIsValid((int)$gatewayResponse->getIsValid()) + ->setVatRequestId($gatewayResponse->getRequestIdentifier()) + ->setVatRequestDate($gatewayResponse->getRequestDate()) + ->setVatRequestSuccess($gatewayResponse->getRequestSuccess()) + ->setValidatedVatNumber($customerVatNumber) + ->setValidatedCountryCode($customerCountryCode) + ->save(); + } else { + // Restore validation results from corresponding quote address + $gatewayResponse = new Varien_Object(array( + 'is_valid' => (int)$quoteAddress->getVatIsValid(), + 'request_identifier' => (string)$quoteAddress->getVatRequestId(), + 'request_date' => (string)$quoteAddress->getVatRequestDate(), + 'request_success' => (boolean)$quoteAddress->getVatRequestSuccess() + )); + } + + if ($customerAddressId != $customerDefaultAddressId || is_null($customerDefaultAddressId)) { + $groupId = $customerHelper->getCustomerGroupIdBasedOnVatNumber( + $customerCountryCode, $gatewayResponse, $customerInstance->getStore() + ); + + if ($groupId) { + $quoteAddress->setPrevQuoteCustomerGroupId($quoteInstance->getCustomerGroupId()); + $customerInstance->setGroupId($groupId); + $quoteInstance->setCustomerGroupId($groupId); + } + } + } + + /** + * Restore initial customer group ID in quote if needed on collect_totals_after event of quote address + * + * @param Varien_Event_Observer $observer + */ + public function restoreQuoteCustomerGroupId($observer) + { + $quoteAddress = $observer->getQuoteAddress(); + $configAddressType = Mage::helper('Mage_Customer_Helper_Address')->getTaxCalculationAddressType(); + // Restore initial customer group ID in quote only if VAT is calculated based on shipping address + if ($quoteAddress->hasPrevQuoteCustomerGroupId() + && $configAddressType == Mage_Customer_Model_Address_Abstract::TYPE_SHIPPING + ) { + $quoteAddress->getQuote()->setCustomerGroupId($quoteAddress->getPrevQuoteCustomerGroupId()); + $quoteAddress->unsPrevQuoteCustomerGroupId(); + } + } +} diff --git a/app/code/core/Mage/Sales/Model/Order.php b/app/code/core/Mage/Sales/Model/Order.php index f3829557e37e4057b07bc5fb87538bf8ebfc1910..146e20357fcbdb54f07f106f2c6d92344005a07f 100644 --- a/app/code/core/Mage/Sales/Model/Order.php +++ b/app/code/core/Mage/Sales/Model/Order.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Order/Address.php b/app/code/core/Mage/Sales/Model/Order/Address.php index ea1ec4719cb35fb4d396b95e8b8e5c10ecc10e06..56d5a29b1df90cbdf08019c5a971d8a4472049f9 100644 --- a/app/code/core/Mage/Sales/Model/Order/Address.php +++ b/app/code/core/Mage/Sales/Model/Order/Address.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Order/Api.php b/app/code/core/Mage/Sales/Model/Order/Api.php index 8811993797bea813a7a4808a9aa6b8320e9f8529..634be825ad69975b5346223f828a7b4e99245b29 100644 --- a/app/code/core/Mage/Sales/Model/Order/Api.php +++ b/app/code/core/Mage/Sales/Model/Order/Api.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Order/Api/V2.php b/app/code/core/Mage/Sales/Model/Order/Api/V2.php index e466d8f4055e2902a47fb76fa39d221d7900f175..ae653b6250e2d3b5aaee196ad25ba21aca64ae34 100644 --- a/app/code/core/Mage/Sales/Model/Order/Api/V2.php +++ b/app/code/core/Mage/Sales/Model/Order/Api/V2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Order/Config.php b/app/code/core/Mage/Sales/Model/Order/Config.php index c1f4da98af106e344d1f1312f4bdb56437e9c48d..271a7fa2e72aee7fca28dd1e7ee8079c512993f2 100644 --- a/app/code/core/Mage/Sales/Model/Order/Config.php +++ b/app/code/core/Mage/Sales/Model/Order/Config.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -142,7 +142,11 @@ class Mage_Sales_Model_Order_Config extends Mage_Core_Model_Config_Base */ public function getStateStatuses($state, $addLabels = true) { - $key = $state . $addLabels; + if (is_array($state)) { + $key = implode("|", $state) . $addLabels; + } else { + $key = $state . $addLabels; + } if (isset($this->_stateStatuses[$key])) { return $this->_stateStatuses[$key]; } diff --git a/app/code/core/Mage/Sales/Model/Order/Creditmemo.php b/app/code/core/Mage/Sales/Model/Order/Creditmemo.php index 7e49795c2f5ecc46829a8ce9fee84599ee76ac44..5f3eba4b2c3e18dc80f32189d02dd744dcbd9097 100644 --- a/app/code/core/Mage/Sales/Model/Order/Creditmemo.php +++ b/app/code/core/Mage/Sales/Model/Order/Creditmemo.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -158,6 +158,13 @@ class Mage_Sales_Model_Order_Creditmemo extends Mage_Sales_Model_Abstract protected $_order; protected $_comments; + /** + * Calculator instances for delta rounding of prices + * + * @var array + */ + protected $_calculators = array(); + protected $_eventPrefix = 'sales_order_creditmemo'; protected $_eventObject = 'creditmemo'; @@ -312,6 +319,25 @@ class Mage_Sales_Model_Order_Creditmemo extends Mage_Sales_Model_Abstract return $this; } + /** + * Round price considering delta + * + * @param float $price + * @param string $type + * @param bool $negative Indicates if we perform addition (true) or subtraction (false) of rounded value + * @return float + */ + public function roundPrice($price, $type = 'regular', $negative = false) + { + if ($price) { + if (!isset($this->_calculators[$type])) { + $this->_calculators[$type] = Mage::getModel('Mage_Core_Model_Calculator', $this->getStore()); + } + $price = $this->_calculators[$type]->deltaRound($price, $negative); + } + return $price; + } + public function canRefund() { if ($this->getState() != self::STATE_CANCELED @@ -377,9 +403,7 @@ class Mage_Sales_Model_Order_Creditmemo extends Mage_Sales_Model_Abstract $baseAvailableRefund = $this->getOrder()->getBaseTotalPaid()- $this->getOrder()->getBaseTotalRefunded(); Mage::throwException( - Mage::helper('Mage_Sales_Helper_Data')->__('Maximum amount available to refund is %s', - $this->getOrder()->formatBasePrice($baseAvailableRefund) - ) + Mage::helper('Mage_Sales_Helper_Data')->__('Maximum amount available to refund is %s', $this->getOrder()->formatBasePrice($baseAvailableRefund)) ); } $order = $this->getOrder(); diff --git a/app/code/core/Mage/Sales/Model/Order/Creditmemo/Api.php b/app/code/core/Mage/Sales/Model/Order/Creditmemo/Api.php index 16a907171efac9ca05c2cbd4d69e799e0a5b1d2c..93a1e39c819104a0c02a82c53a135e68c49cb3bd 100644 --- a/app/code/core/Mage/Sales/Model/Order/Creditmemo/Api.php +++ b/app/code/core/Mage/Sales/Model/Order/Creditmemo/Api.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Order/Creditmemo/Api/V2.php b/app/code/core/Mage/Sales/Model/Order/Creditmemo/Api/V2.php index 98db2fbd531cbffab9b7bae377b5ede3592f42f3..8e27f8079566e03a0ec6c36562ec63ab03afdd22 100644 --- a/app/code/core/Mage/Sales/Model/Order/Creditmemo/Api/V2.php +++ b/app/code/core/Mage/Sales/Model/Order/Creditmemo/Api/V2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Order/Creditmemo/Comment.php b/app/code/core/Mage/Sales/Model/Order/Creditmemo/Comment.php index 1741b2357a3300268ea70d190ce1003f50ca7339..ead95635abf1358b3e16fcf43012545bdec2c0dd 100644 --- a/app/code/core/Mage/Sales/Model/Order/Creditmemo/Comment.php +++ b/app/code/core/Mage/Sales/Model/Order/Creditmemo/Comment.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Order/Creditmemo/Config.php b/app/code/core/Mage/Sales/Model/Order/Creditmemo/Config.php index 59a036f7b61a8829f081f6f7ee0a74376813b4b3..6b374a8d853e3b30f3d62f3c46b4289398f57b5f 100644 --- a/app/code/core/Mage/Sales/Model/Order/Creditmemo/Config.php +++ b/app/code/core/Mage/Sales/Model/Order/Creditmemo/Config.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Order/Creditmemo/Item.php b/app/code/core/Mage/Sales/Model/Order/Creditmemo/Item.php index 1ad9a061c615b1b6c023b512119faf962a857198..f061b885832287e26d217aab144d9839f2ab4136 100644 --- a/app/code/core/Mage/Sales/Model/Order/Creditmemo/Item.php +++ b/app/code/core/Mage/Sales/Model/Order/Creditmemo/Item.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -202,17 +202,18 @@ class Mage_Sales_Model_Order_Creditmemo_Item extends Mage_Core_Model_Abstract */ public function register() { - $this->getOrderItem()->setQtyRefunded( - $this->getOrderItem()->getQtyRefunded() + $this->getQty() - ); - $this->getOrderItem()->setTaxRefunded( - $this->getOrderItem()->getTaxRefunded() - + $this->getOrderItem()->getBaseTaxAmount() * $this->getQty() / $this->getOrderItem()->getQtyOrdered() - ); - $this->getOrderItem()->setHiddenTaxRefunded( - $this->getOrderItem()->getHiddenTaxRefunded() - + $this->getOrderItem()->getHiddenTaxAmount() * $this->getQty() / $this->getOrderItem()->getQtyOrdered() - ); + $orderItem = $this->getOrderItem(); + + $orderItem->setQtyRefunded($orderItem->getQtyRefunded() + $this->getQty()); + $orderItem->setTaxRefunded($orderItem->getTaxRefunded() + $this->getTaxAmount()); + $orderItem->setBaseTaxRefunded($orderItem->getBaseTaxRefunded() + $this->getBaseTaxAmount()); + $orderItem->setHiddenTaxRefunded($orderItem->getHiddenTaxRefunded() + $this->getHiddenTaxAmount()); + $orderItem->setBaseHiddenTaxRefunded($orderItem->getBaseHiddenTaxRefunded() + $this->getBaseHiddenTaxAmount()); + $orderItem->setAmountRefunded($orderItem->getAmountRefunded() + $this->getRowTotal()); + $orderItem->setBaseAmountRefunded($orderItem->getBaseAmountRefunded() + $this->getBaseRowTotal()); + $orderItem->setDiscountRefunded($orderItem->getDiscountRefunded() + $this->getDiscountAmount()); + $orderItem->setBaseDiscountRefunded($orderItem->getBaseDiscountRefunded() + $this->getBaseDiscountAmount()); + return $this; } @@ -239,24 +240,31 @@ class Mage_Sales_Model_Order_Creditmemo_Item extends Mage_Core_Model_Abstract */ public function calcRowTotal() { - $store = $this->getCreditmemo()->getStore(); - $orderItem = $this->getOrderItem(); - $orderItemQty = $orderItem->getQtyOrdered(); - - $rowTotal = $orderItem->getRowTotal(); - $baseRowTotal = $orderItem->getBaseRowTotal(); - $rowTotalInclTax = $orderItem->getRowTotalInclTax(); - $baseRowTotalInclTax= $orderItem->getBaseRowTotalInclTax(); + $creditmemo = $this->getCreditmemo(); + $orderItem = $this->getOrderItem(); + $orderItemQtyInvoiced = $orderItem->getQtyInvoiced(); - $rowTotal = $rowTotal/$orderItemQty*$this->getQty(); - $baseRowTotal = $baseRowTotal/$orderItemQty*$this->getQty(); + $rowTotal = $orderItem->getRowInvoiced() - $orderItem->getAmountRefunded(); + $baseRowTotal = $orderItem->getBaseRowInvoiced() - $orderItem->getBaseAmountRefunded(); + $rowTotalInclTax = $orderItem->getRowTotalInclTax(); + $baseRowTotalInclTax = $orderItem->getBaseRowTotalInclTax(); - $this->setRowTotal($store->roundPrice($rowTotal)); - $this->setBaseRowTotal($store->roundPrice($baseRowTotal)); + if (!$this->isLast()) { + $availableQty = $orderItemQtyInvoiced - $orderItem->getQtyRefunded(); + $rowTotal = $creditmemo->roundPrice($rowTotal / $availableQty * $this->getQty()); + $baseRowTotal = $creditmemo->roundPrice($baseRowTotal / $availableQty * $this->getQty(), 'base'); + } + $this->setRowTotal($rowTotal); + $this->setBaseRowTotal($baseRowTotal); if ($rowTotalInclTax && $baseRowTotalInclTax) { - $this->setRowTotalInclTax($store->roundPrice($rowTotalInclTax/$orderItemQty*$this->getQty())); - $this->setBaseRowTotalInclTax($store->roundPrice($baseRowTotalInclTax/$orderItemQty*$this->getQty())); + $orderItemQty = $orderItem->getQtyOrdered(); + $this->setRowTotalInclTax( + $creditmemo->roundPrice($rowTotalInclTax / $orderItemQty * $this->getQty(), 'including') + ); + $this->setBaseRowTotalInclTax( + $creditmemo->roundPrice($baseRowTotalInclTax / $orderItemQty * $this->getQty(), 'including_base') + ); } return $this; } diff --git a/app/code/core/Mage/Sales/Model/Order/Creditmemo/Total/Abstract.php b/app/code/core/Mage/Sales/Model/Order/Creditmemo/Total/Abstract.php index 729331da1fa4de6581c74846523eff3d2c65e828..dcdc0b41e61980326f569c191d34be7b6fb65c88 100644 --- a/app/code/core/Mage/Sales/Model/Order/Creditmemo/Total/Abstract.php +++ b/app/code/core/Mage/Sales/Model/Order/Creditmemo/Total/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Order/Creditmemo/Total/Cost.php b/app/code/core/Mage/Sales/Model/Order/Creditmemo/Total/Cost.php index a837336140e8c1789e5b99a787c6b97eb319dbd5..68bd101becf76e8bcd90cc4ce0094e1eaaf023c3 100644 --- a/app/code/core/Mage/Sales/Model/Order/Creditmemo/Total/Cost.php +++ b/app/code/core/Mage/Sales/Model/Order/Creditmemo/Total/Cost.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Order/Creditmemo/Total/Discount.php b/app/code/core/Mage/Sales/Model/Order/Creditmemo/Total/Discount.php index ea2209cf8160e5826e236f0d9a5918243e9b9a49..476e8d704e6b84513966580c2da49fc6ea8f8ac1 100644 --- a/app/code/core/Mage/Sales/Model/Order/Creditmemo/Total/Discount.php +++ b/app/code/core/Mage/Sales/Model/Order/Creditmemo/Total/Discount.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -49,20 +49,30 @@ class Mage_Sales_Model_Order_Creditmemo_Total_Discount extends Mage_Sales_Model_ $baseTotalDiscountAmount = $baseTotalDiscountAmount + $baseShippingDiscount; } + /** @var $item Mage_Sales_Model_Order_Invoice_Item */ foreach ($creditmemo->getAllItems() as $item) { - if ($item->getOrderItem()->isDummy()) { + $orderItem = $item->getOrderItem(); + + if ($orderItem->isDummy()) { continue; } - $orderItemDiscount = (float) $item->getOrderItem()->getDiscountAmount(); - $baseOrderItemDiscount = (float) $item->getOrderItem()->getBaseDiscountAmount(); - $orderItemQty = $item->getOrderItem()->getQtyOrdered(); - if ($orderItemDiscount && $orderItemQty) { - $discount = $orderItemDiscount*$item->getQty()/$orderItemQty; - $baseDiscount = $baseOrderItemDiscount*$item->getQty()/$orderItemQty; + $orderItemDiscount = (float) $orderItem->getDiscountInvoiced(); + $baseOrderItemDiscount = (float) $orderItem->getBaseDiscountInvoiced(); + $orderItemQty = $orderItem->getQtyInvoiced(); - $discount = $creditmemo->getStore()->roundPrice($discount); - $baseDiscount = $creditmemo->getStore()->roundPrice($baseDiscount); + if ($orderItemDiscount && $orderItemQty) { + $discount = $orderItemDiscount - $orderItem->getDiscountRefunded(); + $baseDiscount = $baseOrderItemDiscount - $orderItem->getBaseDiscountRefunded(); + if (!$item->isLast()) { + $availableQty = $orderItemQty - $orderItem->getQtyRefunded(); + $discount = $creditmemo->roundPrice( + $discount / $availableQty * $item->getQty(), 'regular', true + ); + $baseDiscount = $creditmemo->roundPrice( + $baseDiscount / $availableQty * $item->getQty(), 'base', true + ); + } $item->setDiscountAmount($discount); $item->setBaseDiscountAmount($baseDiscount); diff --git a/app/code/core/Mage/Sales/Model/Order/Creditmemo/Total/Grand.php b/app/code/core/Mage/Sales/Model/Order/Creditmemo/Total/Grand.php index 539c97a712068d5d3dadf82388ef49865ed29dfb..6a3077a7836dd0f9003aa0be5ac74d552c815498 100644 --- a/app/code/core/Mage/Sales/Model/Order/Creditmemo/Total/Grand.php +++ b/app/code/core/Mage/Sales/Model/Order/Creditmemo/Total/Grand.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Order/Creditmemo/Total/Shipping.php b/app/code/core/Mage/Sales/Model/Order/Creditmemo/Total/Shipping.php index 7e791e08e450eafb398c7accce699441df7d19f1..f033d87de22016a8cc9660c8d0bbfe9e7c956314 100644 --- a/app/code/core/Mage/Sales/Model/Order/Creditmemo/Total/Shipping.php +++ b/app/code/core/Mage/Sales/Model/Order/Creditmemo/Total/Shipping.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Order/Creditmemo/Total/Subtotal.php b/app/code/core/Mage/Sales/Model/Order/Creditmemo/Total/Subtotal.php index d1c80ca878411e2e56841bd5c7887e23cc7076a9..542a38f6b950de0a6a2c70ccc055eb2613f2ef02 100644 --- a/app/code/core/Mage/Sales/Model/Order/Creditmemo/Total/Subtotal.php +++ b/app/code/core/Mage/Sales/Model/Order/Creditmemo/Total/Subtotal.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -41,12 +41,12 @@ class Mage_Sales_Model_Order_Creditmemo_Total_Subtotal extends Mage_Sales_Model_ $baseSubtotalInclTax = 0; foreach ($creditmemo->getAllItems() as $item) { - $item->calcRowTotal(); - if ($item->getOrderItem()->isDummy()) { continue; } + $item->calcRowTotal(); + $subtotal += $item->getRowTotal(); $baseSubtotal += $item->getBaseRowTotal(); $subtotalInclTax+= $item->getRowTotalInclTax(); diff --git a/app/code/core/Mage/Sales/Model/Order/Creditmemo/Total/Tax.php b/app/code/core/Mage/Sales/Model/Order/Creditmemo/Total/Tax.php index 991088668447f439f45aa016c512298cf6ec4274..be08fdd1b11833f489ff871feafec6f13c938a46 100644 --- a/app/code/core/Mage/Sales/Model/Order/Creditmemo/Total/Tax.php +++ b/app/code/core/Mage/Sales/Model/Order/Creditmemo/Total/Tax.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -38,49 +38,38 @@ class Mage_Sales_Model_Order_Creditmemo_Total_Tax extends Mage_Sales_Model_Order $order = $creditmemo->getOrder(); + /** @var $item Mage_Sales_Model_Order_Creditmemo_Item */ foreach ($creditmemo->getAllItems() as $item) { - if ($item->getOrderItem()->isDummy()) { + $orderItem = $item->getOrderItem(); + if ($orderItem->isDummy()) { continue; } - $orderItem = $item->getOrderItem(); - $orderItemTax = $item->getOrderItem()->getTaxAmount(); - $baseOrderItemTax = $item->getOrderItem()->getBaseTaxAmount(); - $orderItemQty = $item->getOrderItem()->getQtyOrdered(); + $orderItemTax = $orderItem->getTaxInvoiced(); + $baseOrderItemTax = $orderItem->getBaseTaxInvoiced(); + $orderItemQty = $orderItem->getQtyInvoiced(); if ($orderItemTax && $orderItemQty) { /** * Check item tax amount */ - - if ($item->isLast()) { - $tax = $orderItemTax - $item->getOrderItem()->getTaxRefunded() - - $item->getOrderItem()->getTaxCanceled(); - $baseTax = $baseOrderItemTax - $item->getOrderItem()->getTaxRefunded() - - $item->getOrderItem()->getTaxCanceled(); - $hiddenTax = $orderItem->getHiddenTaxAmount() - $orderItem->getHiddenTaxRefunded() - - $item->getOrderItem()->getHiddenTaxCanceled(); - $baseHiddenTax = $orderItem->getBaseHiddenTaxAmount() - $orderItem->getBaseHiddenTaxRefunded() - - $item->getOrderItem()->getHiddenTaxCanceled(); - - } - else { - $tax = $orderItemTax*$item->getQty()/$orderItemQty; - $baseTax = $baseOrderItemTax*$item->getQty()/$orderItemQty; - $hiddenTax = $orderItem->getHiddenTaxAmount()*$item->getQty()/$orderItemQty; - $baseHiddenTax = $orderItem->getBaseHiddenTaxAmount()*$item->getQty()/$orderItemQty; - - $tax = $creditmemo->getStore()->roundPrice($tax); - $baseTax = $creditmemo->getStore()->roundPrice($baseTax); - $hiddenTax = $creditmemo->getStore()->roundPrice($hiddenTax); - $baseHiddenTax = $creditmemo->getStore()->roundPrice($baseHiddenTax); + $tax = $orderItemTax - $orderItem->getTaxRefunded(); + $baseTax = $baseOrderItemTax - $orderItem->getTaxRefunded(); + $hiddenTax = $orderItem->getHiddenTaxAmount() - $orderItem->getHiddenTaxRefunded(); + $baseHiddenTax = $orderItem->getBaseHiddenTaxAmount() - $orderItem->getBaseHiddenTaxRefunded(); + if (!$item->isLast()) { + $availableQty = $orderItemQty - $orderItem->getQtyRefunded(); + $tax = $creditmemo->roundPrice($tax / $availableQty * $item->getQty()); + $baseTax = $creditmemo->roundPrice($baseTax / $availableQty * $item->getQty(), 'base'); + $hiddenTax = $creditmemo->roundPrice($hiddenTax / $availableQty * $item->getQty()); + $baseHiddenTax = $creditmemo->roundPrice($baseHiddenTax / $availableQty * $item->getQty(), 'base'); } + $item->setTaxAmount($tax); $item->setBaseTaxAmount($baseTax); $item->setHiddenTaxAmount($hiddenTax); $item->setBaseHiddenTaxAmount($baseHiddenTax); - $totalTax += $tax; $baseTotalTax += $baseTax; $totalHiddenTax += $hiddenTax; @@ -98,12 +87,12 @@ class Mage_Sales_Model_Order_Creditmemo_Total_Tax extends Mage_Sales_Model_Order $baseTotalHiddenTax += $invoice->getBaseShippingHiddenTaxAmnt()*$taxFactor; $shippingHiddenTaxAmount = $invoice->getShippingHiddenTaxAmount()*$taxFactor; $baseShippingHiddenTaxAmount = $invoice->getBaseShippingHiddenTaxAmnt()*$taxFactor; - $shippingTaxAmount = $creditmemo->getStore()->roundPrice($shippingTaxAmount); - $baseShippingTaxAmount = $creditmemo->getStore()->roundPrice($baseShippingTaxAmount); - $totalHiddenTax = $creditmemo->getStore()->roundPrice($totalHiddenTax); - $baseTotalHiddenTax = $creditmemo->getStore()->roundPrice($baseTotalHiddenTax); - $shippingHiddenTaxAmount = $creditmemo->getStore()->roundPrice($shippingHiddenTaxAmount); - $baseShippingHiddenTaxAmount = $creditmemo->getStore()->roundPrice($baseShippingHiddenTaxAmount); + $shippingTaxAmount = $creditmemo->roundPrice($shippingTaxAmount); + $baseShippingTaxAmount = $creditmemo->roundPrice($baseShippingTaxAmount, 'base'); + $totalHiddenTax = $creditmemo->roundPrice($totalHiddenTax); + $baseTotalHiddenTax = $creditmemo->roundPrice($baseTotalHiddenTax, 'base'); + $shippingHiddenTaxAmount = $creditmemo->roundPrice($shippingHiddenTaxAmount); + $baseShippingHiddenTaxAmount = $creditmemo->roundPrice($baseShippingHiddenTaxAmount, 'base'); $totalTax += $shippingTaxAmount; $baseTotalTax += $baseShippingTaxAmount; } @@ -130,10 +119,10 @@ class Mage_Sales_Model_Order_Creditmemo_Total_Tax extends Mage_Sales_Model_Order $baseShippingTaxAmount = $order->getBaseShippingTaxAmount()*$basePart; $shippingHiddenTaxAmount = $order->getShippingHiddenTaxAmount()*$part; $baseShippingHiddenTaxAmount= $order->getBaseShippingHiddenTaxAmnt()*$basePart; - $shippingTaxAmount = $creditmemo->getStore()->roundPrice($shippingTaxAmount); - $baseShippingTaxAmount = $creditmemo->getStore()->roundPrice($baseShippingTaxAmount); - $shippingHiddenTaxAmount = $creditmemo->getStore()->roundPrice($shippingHiddenTaxAmount); - $baseShippingHiddenTaxAmount= $creditmemo->getStore()->roundPrice($baseShippingHiddenTaxAmount); + $shippingTaxAmount = $creditmemo->roundPrice($shippingTaxAmount); + $baseShippingTaxAmount = $creditmemo->roundPrice($baseShippingTaxAmount, 'base'); + $shippingHiddenTaxAmount = $creditmemo->roundPrice($shippingHiddenTaxAmount); + $baseShippingHiddenTaxAmount= $creditmemo->roundPrice($baseShippingHiddenTaxAmount, 'base'); } elseif ($shippingDelta == $creditmemo->getBaseShippingAmount()) { $shippingTaxAmount = $order->getShippingTaxAmount() - $order->getShippingTaxRefunded(); $baseShippingTaxAmount = $order->getBaseShippingTaxAmount() - $order->getBaseShippingTaxRefunded(); @@ -174,4 +163,4 @@ class Mage_Sales_Model_Order_Creditmemo_Total_Tax extends Mage_Sales_Model_Order $creditmemo->setBaseGrandTotal($creditmemo->getBaseGrandTotal() + $baseTotalTax + $baseTotalHiddenTax); return $this; } -} +} \ No newline at end of file diff --git a/app/code/core/Mage/Sales/Model/Order/Invoice.php b/app/code/core/Mage/Sales/Model/Order/Invoice.php index d7525c0a2e53ab082e2bbf7cf83c7182b81ee861..38056cd9b1bc81e01adab030217c609d0fb1d957 100644 --- a/app/code/core/Mage/Sales/Model/Order/Invoice.php +++ b/app/code/core/Mage/Sales/Model/Order/Invoice.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -158,6 +158,13 @@ class Mage_Sales_Model_Order_Invoice extends Mage_Sales_Model_Abstract protected $_comments; protected $_order; + /** + * Calculator instances for delta rounding of prices + * + * @var array + */ + protected $_rounders = array(); + protected $_saveBeforeDestruct = false; protected $_eventPrefix = 'sales_order_invoice'; @@ -482,6 +489,25 @@ class Mage_Sales_Model_Order_Invoice extends Mage_Sales_Model_Abstract return $this; } + /** + * Round price considering delta + * + * @param float $price + * @param string $type + * @param bool $negative Indicates if we perform addition (true) or subtraction (false) of rounded value + * @return float + */ + public function roundPrice($price, $type = 'regular', $negative = false) + { + if ($price) { + if (!isset($this->_rounders[$type])) { + $this->_rounders[$type] = Mage::getModel('Mage_Core_Model_Calculator', $this->getStore()); + } + $price = $this->_rounders[$type]->deltaRound($price, $negative); + } + return $price; + } + /** * Get invoice items collection * diff --git a/app/code/core/Mage/Sales/Model/Order/Invoice/Api.php b/app/code/core/Mage/Sales/Model/Order/Invoice/Api.php index fab2130137469e43b4ab74baa00f29726d1ef2ee..2e2360ca73da53ae58fa76638d38658035023330 100644 --- a/app/code/core/Mage/Sales/Model/Order/Invoice/Api.php +++ b/app/code/core/Mage/Sales/Model/Order/Invoice/Api.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Order/Invoice/Api/V2.php b/app/code/core/Mage/Sales/Model/Order/Invoice/Api/V2.php index 2a9beee6d7ce55d1a7f5bb7833929fd4fe9c6721..dbf5b6f628ebd23fc2786b5d94d7e0490884f722 100644 --- a/app/code/core/Mage/Sales/Model/Order/Invoice/Api/V2.php +++ b/app/code/core/Mage/Sales/Model/Order/Invoice/Api/V2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Order/Invoice/Comment.php b/app/code/core/Mage/Sales/Model/Order/Invoice/Comment.php index 1bba00f10a1087e36176c8507f2e0c4cd749807a..15d79d182335a1ac246ceb24062211b2fa4b066c 100644 --- a/app/code/core/Mage/Sales/Model/Order/Invoice/Comment.php +++ b/app/code/core/Mage/Sales/Model/Order/Invoice/Comment.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Order/Invoice/Config.php b/app/code/core/Mage/Sales/Model/Order/Invoice/Config.php index 1050ff63fda3893dad7c4bae5e9c5a918a1074a7..98ec1dba7f8171ced626b503f4a2266e333edb3d 100644 --- a/app/code/core/Mage/Sales/Model/Order/Invoice/Config.php +++ b/app/code/core/Mage/Sales/Model/Order/Invoice/Config.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Order/Invoice/Item.php b/app/code/core/Mage/Sales/Model/Order/Invoice/Item.php index 7aa1aed98fd6c792dab326313d82fdd692a04191..756e59b7c16a5b5e180b2b45d398ea153fb3ac6c 100644 --- a/app/code/core/Mage/Sales/Model/Order/Invoice/Item.php +++ b/app/code/core/Mage/Sales/Model/Order/Invoice/Item.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -253,24 +253,27 @@ class Mage_Sales_Model_Order_Invoice_Item extends Mage_Core_Model_Abstract */ public function calcRowTotal() { - $store = $this->getInvoice()->getStore(); + $invoice = $this->getInvoice(); $orderItem = $this->getOrderItem(); $orderItemQty = $orderItem->getQtyOrdered(); - $rowTotal = $orderItem->getRowTotal(); - $baseRowTotal = $orderItem->getBaseRowTotal(); - $rowTotalInclTax = $orderItem->getRowTotalInclTax(); - $baseRowTotalInclTax= $orderItem->getBaseRowTotalInclTax(); + $rowTotal = $orderItem->getRowTotal() - $orderItem->getRowInvoiced(); + $baseRowTotal = $orderItem->getBaseRowTotal() - $orderItem->getBaseRowInvoiced(); + $rowTotalInclTax = $orderItem->getRowTotalInclTax(); + $baseRowTotalInclTax = $orderItem->getBaseRowTotalInclTax(); - $rowTotal = $rowTotal/$orderItemQty*$this->getQty(); - $baseRowTotal = $baseRowTotal/$orderItemQty*$this->getQty(); + if (!$this->isLast()) { + $availableQty = $orderItemQty - $orderItem->getQtyInvoiced(); + $rowTotal = $invoice->roundPrice($rowTotal / $availableQty * $this->getQty()); + $baseRowTotal = $invoice->roundPrice($baseRowTotal / $availableQty * $this->getQty(), 'base'); + } - $this->setRowTotal($store->roundPrice($rowTotal)); - $this->setBaseRowTotal($store->roundPrice($baseRowTotal)); + $this->setRowTotal($rowTotal); + $this->setBaseRowTotal($baseRowTotal); if ($rowTotalInclTax && $baseRowTotalInclTax) { - $this->setRowTotalInclTax($store->roundPrice($rowTotalInclTax/$orderItemQty*$this->getQty())); - $this->setBaseRowTotalInclTax($store->roundPrice($baseRowTotalInclTax/$orderItemQty*$this->getQty())); + $this->setRowTotalInclTax($invoice->roundPrice($rowTotalInclTax / $orderItemQty * $this->getQty(), 'including')); + $this->setBaseRowTotalInclTax($invoice->roundPrice($baseRowTotalInclTax / $orderItemQty * $this->getQty(), 'including_base')); } return $this; } diff --git a/app/code/core/Mage/Sales/Model/Order/Invoice/Total/Abstract.php b/app/code/core/Mage/Sales/Model/Order/Invoice/Total/Abstract.php index dfca69d0472a6b74ebb3a57c1c5331abe4115201..b06ae622f271fce02f0955d173f1424ee8903a8a 100644 --- a/app/code/core/Mage/Sales/Model/Order/Invoice/Total/Abstract.php +++ b/app/code/core/Mage/Sales/Model/Order/Invoice/Total/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Order/Invoice/Total/Cost.php b/app/code/core/Mage/Sales/Model/Order/Invoice/Total/Cost.php index 230b1d8c40cb7ea654a70e2961b0791d2b521edf..7ad780b3de30655319970f6d3dcd075263c1ff48 100644 --- a/app/code/core/Mage/Sales/Model/Order/Invoice/Total/Cost.php +++ b/app/code/core/Mage/Sales/Model/Order/Invoice/Total/Cost.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Order/Invoice/Total/Discount.php b/app/code/core/Mage/Sales/Model/Order/Invoice/Total/Discount.php index 4d6f531b3cb8388f3578fa8557b93599addd73a8..5b0068531df68ee4dfd3995c7c5446f4a2babf42 100644 --- a/app/code/core/Mage/Sales/Model/Order/Invoice/Total/Discount.php +++ b/app/code/core/Mage/Sales/Model/Order/Invoice/Total/Discount.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -52,6 +52,7 @@ class Mage_Sales_Model_Order_Invoice_Total_Discount extends Mage_Sales_Model_Ord $baseTotalDiscountAmount = $baseTotalDiscountAmount + $invoice->getOrder()->getBaseShippingDiscountAmount(); } + /** @var $item Mage_Sales_Model_Order_Invoice_Item */ foreach ($invoice->getAllItems() as $item) { if ($item->getOrderItem()->isDummy()) { continue; @@ -65,16 +66,12 @@ class Mage_Sales_Model_Order_Invoice_Total_Discount extends Mage_Sales_Model_Ord /** * Resolve rounding problems */ - if ($item->isLast()) { - $discount = $orderItemDiscount - $orderItem->getDiscountInvoiced(); - $baseDiscount = $baseOrderItemDiscount - $orderItem->getBaseDiscountInvoiced(); - } - else { - $discount = $orderItemDiscount*$item->getQty()/$orderItemQty; - $baseDiscount = $baseOrderItemDiscount*$item->getQty()/$orderItemQty; - - $discount = $invoice->getStore()->roundPrice($discount); - $baseDiscount = $invoice->getStore()->roundPrice($baseDiscount); + $discount = $orderItemDiscount - $orderItem->getDiscountInvoiced(); + $baseDiscount = $baseOrderItemDiscount - $orderItem->getBaseDiscountInvoiced(); + if (!$item->isLast()) { + $activeQty = $orderItemQty - $orderItem->getQtyInvoiced(); + $discount = $invoice->roundPrice($discount / $activeQty * $item->getQty(), 'regular', true); + $baseDiscount = $invoice->roundPrice($baseDiscount / $activeQty * $item->getQty(), 'base', true); } $item->setDiscountAmount($discount); diff --git a/app/code/core/Mage/Sales/Model/Order/Invoice/Total/Grand.php b/app/code/core/Mage/Sales/Model/Order/Invoice/Total/Grand.php index c8e754d82f92848e03924eddb2f0d3a78af5ac34..33b5b207d3f9d74970cd0a70c7e506484d25d736 100644 --- a/app/code/core/Mage/Sales/Model/Order/Invoice/Total/Grand.php +++ b/app/code/core/Mage/Sales/Model/Order/Invoice/Total/Grand.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Order/Invoice/Total/Shipping.php b/app/code/core/Mage/Sales/Model/Order/Invoice/Total/Shipping.php index 371e58fac5aa0e5dea4995731985fc48d793ddc6..8ccba86065c7b9347c6837e1a95b973a39f82040 100644 --- a/app/code/core/Mage/Sales/Model/Order/Invoice/Total/Shipping.php +++ b/app/code/core/Mage/Sales/Model/Order/Invoice/Total/Shipping.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Order/Invoice/Total/Subtotal.php b/app/code/core/Mage/Sales/Model/Order/Invoice/Total/Subtotal.php index 0ed5d0affa5d4b98ebfa9aaf271e0499b0e383f4..168ee5296729c8373431f4856a18ff79ada118ba 100644 --- a/app/code/core/Mage/Sales/Model/Order/Invoice/Total/Subtotal.php +++ b/app/code/core/Mage/Sales/Model/Order/Invoice/Total/Subtotal.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -43,12 +43,12 @@ class Mage_Sales_Model_Order_Invoice_Total_Subtotal extends Mage_Sales_Model_Ord $order = $invoice->getOrder(); foreach ($invoice->getAllItems() as $item) { - $item->calcRowTotal(); - if ($item->getOrderItem()->isDummy()) { continue; } + $item->calcRowTotal(); + $subtotal += $item->getRowTotal(); $baseSubtotal += $item->getBaseRowTotal(); $subtotalInclTax+= $item->getRowTotalInclTax(); @@ -56,11 +56,30 @@ class Mage_Sales_Model_Order_Invoice_Total_Subtotal extends Mage_Sales_Model_Ord } $allowedSubtotal = $order->getSubtotal() - $order->getSubtotalInvoiced(); - $baseAllowedSubtotal = $order->getBaseSubtotal() -$order->getBaseSubtotalInvoiced(); + $baseAllowedSubtotal = $order->getBaseSubtotal() - $order->getBaseSubtotalInvoiced(); $allowedSubtotalInclTax = $allowedSubtotal + $order->getHiddenTaxAmount() - + $order->getTaxAmount() - $order->getTaxInvoiced() - $order->getShippingTaxAmount(); + + $order->getTaxAmount() - $order->getTaxInvoiced() - $order->getHiddenTaxInvoiced(); $baseAllowedSubtotalInclTax = $baseAllowedSubtotal + $order->getBaseHiddenTaxAmount() - + $order->getBaseTaxAmount() - $order->getBaseTaxInvoiced() - $order->getBaseShippingTaxAmount(); + + $order->getBaseTaxAmount() - $order->getBaseTaxInvoiced() - $order->getBaseHiddenTaxInvoiced(); + + /** + * Check if shipping tax calculation is included to current invoice. + */ + $includeShippingTax = true; + foreach ($invoice->getOrder()->getInvoiceCollection() as $previousInvoice) { + if ($previousInvoice->getShippingAmount() && !$previousInvoice->isCanceled()) { + $includeShippingTax = false; + break; + } + } + + if ($includeShippingTax) { + $allowedSubtotalInclTax -= $order->getShippingTaxAmount(); + $baseAllowedSubtotalInclTax -= $order->getBaseShippingTaxAmount(); + } else { + $allowedSubtotalInclTax += $order->getShippingHiddenTaxAmount(); + $baseAllowedSubtotalInclTax += $order->getBaseShippingHiddenTaxAmount(); + } if ($invoice->isLast()) { $subtotal = $allowedSubtotal; diff --git a/app/code/core/Mage/Sales/Model/Order/Invoice/Total/Tax.php b/app/code/core/Mage/Sales/Model/Order/Invoice/Total/Tax.php index ca1a695d35da68473e484f164368c518350ea836..f9ddf5ba48251ee0e5db014b6939ed553169c53f 100644 --- a/app/code/core/Mage/Sales/Model/Order/Invoice/Total/Tax.php +++ b/app/code/core/Mage/Sales/Model/Order/Invoice/Total/Tax.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -31,6 +31,7 @@ class Mage_Sales_Model_Order_Invoice_Total_Tax extends Mage_Sales_Model_Order_In * Collect invoice tax amount * * @param Mage_Sales_Model_Order_Invoice $invoice + * @return Mage_Sales_Model_Order_Invoice_Total_Tax */ public function collect(Mage_Sales_Model_Order_Invoice $invoice) { @@ -40,6 +41,8 @@ class Mage_Sales_Model_Order_Invoice_Total_Tax extends Mage_Sales_Model_Order_In $baseTotalHiddenTax = 0; $order = $invoice->getOrder(); + + /** @var $item Mage_Sales_Model_Order_Invoice_Item */ foreach ($invoice->getAllItems() as $item) { $orderItem = $item->getOrderItem(); $orderItemQty = $orderItem->getQtyOrdered(); @@ -52,21 +55,16 @@ class Mage_Sales_Model_Order_Invoice_Total_Tax extends Mage_Sales_Model_Order_In /** * Resolve rounding problems */ - if ($item->isLast()) { - $tax = $orderItem->getTaxAmount() - $orderItem->getTaxInvoiced(); - $baseTax = $orderItem->getBaseTaxAmount() - $orderItem->getBaseTaxInvoiced(); - $hiddenTax = $orderItem->getHiddenTaxAmount() - $orderItem->getHiddenTaxInvoiced(); - $baseHiddenTax = $orderItem->getBaseHiddenTaxAmount() - $orderItem->getBaseHiddenTaxInvoiced(); - } else { - $tax = $orderItem->getTaxAmount()*$item->getQty()/$orderItemQty; - $baseTax = $orderItem->getBaseTaxAmount()*$item->getQty()/$orderItemQty; - $hiddenTax = $orderItem->getHiddenTaxAmount()*$item->getQty()/$orderItemQty; - $baseHiddenTax = $orderItem->getBaseHiddenTaxAmount()*$item->getQty()/$orderItemQty; - - $tax = $invoice->getStore()->roundPrice($tax); - $baseTax = $invoice->getStore()->roundPrice($baseTax); - $hiddenTax = $invoice->getStore()->roundPrice($hiddenTax); - $baseHiddenTax = $invoice->getStore()->roundPrice($baseHiddenTax); + $tax = $orderItem->getTaxAmount() - $orderItem->getTaxInvoiced(); + $baseTax = $orderItem->getBaseTaxAmount() - $orderItem->getBaseTaxInvoiced(); + $hiddenTax = $orderItem->getHiddenTaxAmount() - $orderItem->getHiddenTaxInvoiced(); + $baseHiddenTax = $orderItem->getBaseHiddenTaxAmount() - $orderItem->getBaseHiddenTaxInvoiced(); + if (!$item->isLast()) { + $availableQty = $orderItemQty - $orderItem->getQtyInvoiced(); + $tax = $invoice->roundPrice($tax / $availableQty * $item->getQty()); + $baseTax = $invoice->roundPrice($baseTax / $availableQty * $item->getQty(), 'base'); + $hiddenTax = $invoice->roundPrice($hiddenTax / $availableQty * $item->getQty()); + $baseHiddenTax = $invoice->roundPrice($baseHiddenTax / $availableQty * $item->getQty(), 'base'); } $item->setTaxAmount($tax); @@ -124,12 +122,13 @@ class Mage_Sales_Model_Order_Invoice_Total_Tax extends Mage_Sales_Model_Order_In /** * Check if shipping tax calculation can be included to current invoice * @param Mage_Sales_Model_Order_Invoice $invoice + * @return boolean */ protected function _canIncludeShipping($invoice) { $includeShippingTax = true; /** - * Check shipping amount in previus invoices + * Check shipping amount in previous invoices */ foreach ($invoice->getOrder()->getInvoiceCollection() as $previusInvoice) { if ($previusInvoice->getShippingAmount() && !$previusInvoice->isCanceled()) { diff --git a/app/code/core/Mage/Sales/Model/Order/Item.php b/app/code/core/Mage/Sales/Model/Order/Item.php index 1fc0206978f3f7cacb28b51080cdbeae0a9aba9f..317328a224f23bd7a60e97e3472b85594e4d54ed 100644 --- a/app/code/core/Mage/Sales/Model/Order/Item.php +++ b/app/code/core/Mage/Sales/Model/Order/Item.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -180,6 +180,12 @@ * @method Mage_Sales_Model_Order_Item setHiddenTaxCanceled(float $value) * @method float getTaxRefunded() * @method Mage_Sales_Model_Order_Item setTaxRefunded(float $value) + * @method float getBaseTaxRefunded() + * @method Mage_Sales_Model_Order_Item setBaseTaxRefunded(float $value) + * @method float getDiscountRefunded() + * @method Mage_Sales_Model_Order_Item setDiscountRefunded(float $value) + * @method float getBaseDiscountRefunded() + * @method Mage_Sales_Model_Order_Item setBaseDiscountRefunded(float $value) * * @category Mage * @package Mage_Sales diff --git a/app/code/core/Mage/Sales/Model/Order/Payment.php b/app/code/core/Mage/Sales/Model/Order/Payment.php index 08389031e61409d8872f160c36c5d13115928348..05ee291116f3bb48be308c37444732800fa12bae 100644 --- a/app/code/core/Mage/Sales/Model/Order/Payment.php +++ b/app/code/core/Mage/Sales/Model/Order/Payment.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -1010,11 +1010,6 @@ class Mage_Sales_Model_Order_Payment extends Mage_Payment_Model_Info if ($isOnline) { // invoke authorization on gateway $this->getMethodInstance()->setStore($order->getStoreId())->authorize($this, $amount); - } else { - $message = Mage::helper('Mage_Sales_Helper_Data')->__( - 'Registered notification about authorized amount of %s.', - $this->_formatPrice($amount) - ); } // similar logic of "payment review" order as in capturing @@ -1551,4 +1546,4 @@ class Mage_Sales_Model_Order_Payment extends Mage_Payment_Model_Info } return false; } -} +} \ No newline at end of file diff --git a/app/code/core/Mage/Sales/Model/Order/Payment/Transaction.php b/app/code/core/Mage/Sales/Model/Order/Payment/Transaction.php index a44ffd2006d2b9fde9fb947af4e7561f4a906cf7..b3aaf5c4dfa50f435281338dbc6d046762a37aeb 100644 --- a/app/code/core/Mage/Sales/Model/Order/Payment/Transaction.php +++ b/app/code/core/Mage/Sales/Model/Order/Payment/Transaction.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Order/Pdf/Abstract.php b/app/code/core/Mage/Sales/Model/Order/Pdf/Abstract.php index 13757a292e819a3b217b9ba82c3c8c7aa22babf6..5fe6c0d968b78a721837b20643277fab47f96d0b 100644 --- a/app/code/core/Mage/Sales/Model/Order/Pdf/Abstract.php +++ b/app/code/core/Mage/Sales/Model/Order/Pdf/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -728,6 +728,10 @@ abstract class Mage_Sales_Model_Order_Pdf_Abstract extends Varien_Object $lineSpacing = !empty($column['height']) ? $column['height'] : $height; $top = 0; foreach ($column['text'] as $part) { + if ($this->y - $lineSpacing < 15) { + $page = $this->newPage($pageSettings); + } + $feed = $column['feed']; $textAlign = empty($column['align']) ? 'left' : $column['align']; $width = empty($column['width']) ? 0 : $column['width']; diff --git a/app/code/core/Mage/Sales/Model/Order/Pdf/Creditmemo.php b/app/code/core/Mage/Sales/Model/Order/Pdf/Creditmemo.php index e1833692e04b5c980d7b142b1908ceef3a362693..b6acea77defb28ed171d58b4cfcdeed96da47a39 100644 --- a/app/code/core/Mage/Sales/Model/Order/Pdf/Creditmemo.php +++ b/app/code/core/Mage/Sales/Model/Order/Pdf/Creditmemo.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Order/Pdf/Invoice.php b/app/code/core/Mage/Sales/Model/Order/Pdf/Invoice.php index 03ad15eb8d37928edf773801a87d760500550ea9..db1600c6247eac1177a47889ed7c9f04ce511635 100644 --- a/app/code/core/Mage/Sales/Model/Order/Pdf/Invoice.php +++ b/app/code/core/Mage/Sales/Model/Order/Pdf/Invoice.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Abstract.php b/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Abstract.php index 9347c92ca906bdca71cd5e41fa850b4ef0203f4f..adceb806e83cddb839779013da049280a1ebfa6f 100644 --- a/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Abstract.php +++ b/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -226,6 +226,48 @@ abstract class Mage_Sales_Model_Order_Pdf_Items_Abstract extends Mage_Core_Model } } + /** + * Get array of arrays with item prices information for display in PDF + * array( + * $index => array( + * 'label' => $label, + * 'price' => $price, + * 'subtotal' => $subtotal + * ) + * ) + * @return array + */ + public function getItemPricesForDisplay() + { + $order = $this->getOrder(); + $item = $this->getItem(); + if (Mage::helper('Mage_Tax_Helper_Data')->displaySalesBothPrices()) { + $prices = array( + array( + 'label' => Mage::helper('Mage_Tax_Helper_Data')->__('Excl. Tax') . ':', + 'price' => $order->formatPriceTxt($item->getPrice()), + 'subtotal' => $order->formatPriceTxt($item->getRowTotal()) + ), + array( + 'label' => Mage::helper('Mage_Tax_Helper_Data')->__('Incl. Tax') . ':', + 'price' => $order->formatPriceTxt($item->getPriceInclTax()), + 'subtotal' => $order->formatPriceTxt($item->getRowTotalInclTax()) + ), + ); + } elseif (Mage::helper('Mage_Tax_Helper_Data')->displaySalesPriceInclTax()) { + $prices = array(array( + 'price' => $order->formatPriceTxt($item->getPriceInclTax()), + 'subtotal' => $order->formatPriceTxt($item->getRowTotalInclTax()), + )); + } else { + $prices = array(array( + 'price' => $order->formatPriceTxt($item->getPrice()), + 'subtotal' => $order->formatPriceTxt($item->getRowTotal()), + )); + } + return $prices; + } + public function getItemOptions() { $result = array(); if ($options = $this->getItem()->getOrderItem()->getProductOptions()) { diff --git a/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Creditmemo/Default.php b/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Creditmemo/Default.php index 15217ef432f9a19332bd2a16a575ba8f90232c2e..8f22c37fddb320cd838e1965a7cd928b6669ae32 100644 --- a/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Creditmemo/Default.php +++ b/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Creditmemo/Default.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -62,13 +62,29 @@ class Mage_Sales_Model_Order_Pdf_Items_Creditmemo_Default extends Mage_Sales_Mod $x += 100; // draw Total (ex) - $lines[0][] = array( - 'text' => $order->formatPriceTxt($item->getRowTotal()), - 'feed' => $x, - 'font' => 'bold', - 'align' => 'right', - 'width' => 50, - ); + $i = 0; + $prices = $this->getItemPricesForDisplay(); + foreach ($prices as $priceData){ + if (isset($priceData['label'])) { + // draw Subtotal label + $lines[$i][] = array( + 'text' => $priceData['label'], + 'feed' => $x, + 'align' => 'right', + 'width' => 50, + ); + $i++; + } + // draw Subtotal + $lines[$i][] = array( + 'text' => $priceData['subtotal'], + 'feed' => $x, + 'font' => 'bold', + 'align' => 'right', + 'width' => 50, + ); + $i++; + } $x += 50; // draw Discount @@ -102,8 +118,10 @@ class Mage_Sales_Model_Order_Pdf_Items_Creditmemo_Default extends Mage_Sales_Mod $x += 45; // draw Subtotal + $subtotal = $item->getRowTotal() + + $item->getTaxAmount() + $item->getHiddenTaxAmount() - $item->getDiscountAmount(); $lines[0][] = array( - 'text' => $order->formatPriceTxt($item->getRowTotal() + $item->getTaxAmount() - $item->getDiscountAmount()), + 'text' => $order->formatPriceTxt($subtotal), 'feed' => $rightBound, 'font' => 'bold', 'align' => 'right' diff --git a/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Creditmemo/Grouped.php b/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Creditmemo/Grouped.php index 82e3baaf29331aafec4449ea2f11130cd3367b77..2133347a7e86fda947b75b50c56f1a13b378f576 100644 --- a/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Creditmemo/Grouped.php +++ b/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Creditmemo/Grouped.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Invoice/Default.php b/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Invoice/Default.php index 12f32fcbab8125558826a9de4a129b598840811f..9a836eb47ca486877363a98cec82245a5cb42e3f 100644 --- a/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Invoice/Default.php +++ b/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Invoice/Default.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -65,13 +65,41 @@ class Mage_Sales_Model_Order_Pdf_Items_Invoice_Default extends Mage_Sales_Model_ 'feed' => 435 ); - // draw Price - $lines[0][] = array( - 'text' => $order->formatPriceTxt($item->getPrice()), - 'feed' => 395, - 'font' => 'bold', - 'align' => 'right' - ); + // draw item Prices + $i = 0; + $prices = $this->getItemPricesForDisplay(); + foreach ($prices as $priceData){ + if (isset($priceData['label'])) { + // draw Price label + $lines[$i][] = array( + 'text' => $priceData['label'], + 'feed' => 395, + 'align' => 'right' + ); + // draw Subtotal label + $lines[$i][] = array( + 'text' => $priceData['label'], + 'feed' => 565, + 'align' => 'right' + ); + $i++; + } + // draw Price + $lines[$i][] = array( + 'text' => $priceData['price'], + 'feed' => 395, + 'font' => 'bold', + 'align' => 'right' + ); + // draw Subtotal + $lines[$i][] = array( + 'text' => $priceData['subtotal'], + 'feed' => 565, + 'font' => 'bold', + 'align' => 'right' + ); + $i++; + } // draw Tax $lines[0][] = array( @@ -81,14 +109,6 @@ class Mage_Sales_Model_Order_Pdf_Items_Invoice_Default extends Mage_Sales_Model_ 'align' => 'right' ); - // draw Subtotal - $lines[0][] = array( - 'text' => $order->formatPriceTxt($item->getRowTotal()), - 'feed' => 565, - 'font' => 'bold', - 'align' => 'right' - ); - // custom options $options = $this->getItemOptions(); if ($options) { @@ -101,7 +121,11 @@ class Mage_Sales_Model_Order_Pdf_Items_Invoice_Default extends Mage_Sales_Model_ ); if ($option['value']) { - $_printValue = isset($option['print_value']) ? $option['print_value'] : strip_tags($option['value']); + if (isset($option['print_value'])) { + $_printValue = $option['print_value']; + } else { + $_printValue = strip_tags($option['value']); + } $values = explode(', ', $_printValue); foreach ($values as $value) { $lines[][] = array( diff --git a/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Invoice/Grouped.php b/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Invoice/Grouped.php index c77cd27ceb802fd43a94ad2efad83f7f7c6157c9..71d764fe76a1e53d35138840e29bb4b8a5209330 100644 --- a/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Invoice/Grouped.php +++ b/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Invoice/Grouped.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Shipment/Default.php b/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Shipment/Default.php index ce9c9e8d49c0dfa5e32c8c06649c59bb6a1de21b..fadd9ecaa33a877f2070969316cd533478d2f9d8 100644 --- a/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Shipment/Default.php +++ b/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Shipment/Default.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Order/Pdf/Shipment.php b/app/code/core/Mage/Sales/Model/Order/Pdf/Shipment.php index a252060498d13faed1e9128855ed5fd897a5002b..e9c3b2f1ba6e8eb1031c2bff132766316b3d4eeb 100644 --- a/app/code/core/Mage/Sales/Model/Order/Pdf/Shipment.php +++ b/app/code/core/Mage/Sales/Model/Order/Pdf/Shipment.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Order/Pdf/Shipment/Packaging.php b/app/code/core/Mage/Sales/Model/Order/Pdf/Shipment/Packaging.php index 0713a9e2b2682b0f37d7963fa90352d5626a79c5..9ab66985130dd5028675939a7b6a219d3e0a2057 100644 --- a/app/code/core/Mage/Sales/Model/Order/Pdf/Shipment/Packaging.php +++ b/app/code/core/Mage/Sales/Model/Order/Pdf/Shipment/Packaging.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Order/Pdf/Total/Default.php b/app/code/core/Mage/Sales/Model/Order/Pdf/Total/Default.php index 9bb28073d178c7169051b036773e96913774d6fb..d96c93747e143d7c9136064215e158a752037b53 100644 --- a/app/code/core/Mage/Sales/Model/Order/Pdf/Total/Default.php +++ b/app/code/core/Mage/Sales/Model/Order/Pdf/Total/Default.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Order/Shipment.php b/app/code/core/Mage/Sales/Model/Order/Shipment.php index 54e6530db1aba84656e785c8492ae84bc5fe807a..e60b0b111a5b02e27e4e4c6f88f1f655510257c3 100644 --- a/app/code/core/Mage/Sales/Model/Order/Shipment.php +++ b/app/code/core/Mage/Sales/Model/Order/Shipment.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Order/Shipment/Api.php b/app/code/core/Mage/Sales/Model/Order/Shipment/Api.php index 67b38ce9444048cf288f385764af1acbddf67c08..b796bd675146cde05eb0fa965cd9bb403e750d02 100644 --- a/app/code/core/Mage/Sales/Model/Order/Shipment/Api.php +++ b/app/code/core/Mage/Sales/Model/Order/Shipment/Api.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Order/Shipment/Api/V2.php b/app/code/core/Mage/Sales/Model/Order/Shipment/Api/V2.php index 7399ab791b89e3150a8b24fde60cb9dd4c925dac..6db22ff465ab8a7db2eff6c40d90b3dc44689add 100644 --- a/app/code/core/Mage/Sales/Model/Order/Shipment/Api/V2.php +++ b/app/code/core/Mage/Sales/Model/Order/Shipment/Api/V2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Order/Shipment/Comment.php b/app/code/core/Mage/Sales/Model/Order/Shipment/Comment.php index 628c1cefd075bf44f3773003c6d5cd7a78089d21..2a66f20052009a1c1c76cc65afda5b0d250036d6 100644 --- a/app/code/core/Mage/Sales/Model/Order/Shipment/Comment.php +++ b/app/code/core/Mage/Sales/Model/Order/Shipment/Comment.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Order/Shipment/Item.php b/app/code/core/Mage/Sales/Model/Order/Shipment/Item.php index b7f971e89d6676de964201383024123dba8ce17a..90ffbfe6336bf60e7d9b7b69ca6149543f02d81c 100644 --- a/app/code/core/Mage/Sales/Model/Order/Shipment/Item.php +++ b/app/code/core/Mage/Sales/Model/Order/Shipment/Item.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Order/Shipment/Track.php b/app/code/core/Mage/Sales/Model/Order/Shipment/Track.php index c515a62da095f13f2c56214a4224bdb92a103892..0e192427e418da66edf418254d032d350e034c9d 100644 --- a/app/code/core/Mage/Sales/Model/Order/Shipment/Track.php +++ b/app/code/core/Mage/Sales/Model/Order/Shipment/Track.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Order/Status.php b/app/code/core/Mage/Sales/Model/Order/Status.php index 655dbb3f000bbb685b8266a907dcfc24b2c97817..066b27dc5c8aa49995e5ac069b07c827496d4793 100644 --- a/app/code/core/Mage/Sales/Model/Order/Status.php +++ b/app/code/core/Mage/Sales/Model/Order/Status.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Order/Status/History.php b/app/code/core/Mage/Sales/Model/Order/Status/History.php index a1e93ff75827b0751d99ef4554ac0f459874b67b..8ba9400ac38665e6ea4a36bd88e61704f860a2da 100644 --- a/app/code/core/Mage/Sales/Model/Order/Status/History.php +++ b/app/code/core/Mage/Sales/Model/Order/Status/History.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Order/Tax.php b/app/code/core/Mage/Sales/Model/Order/Tax.php index ba4a6039ae99e02e92cd4deda43c7a56f9752760..a2b63b9268b0f4fa5dadea226114983aa27b4dca 100644 --- a/app/code/core/Mage/Sales/Model/Order/Tax.php +++ b/app/code/core/Mage/Sales/Model/Order/Tax.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Order/Total.php b/app/code/core/Mage/Sales/Model/Order/Total.php index a82ac34539c717cb754eb84651c51b5095a2101d..59d79d47740c5a0db1d8cdfa781c947430da250c 100644 --- a/app/code/core/Mage/Sales/Model/Order/Total.php +++ b/app/code/core/Mage/Sales/Model/Order/Total.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Payment/Method/Billing/AgreementAbstract.php b/app/code/core/Mage/Sales/Model/Payment/Method/Billing/AgreementAbstract.php index dcd08e26d289e0a2e5916232afc214beb28a9cb1..d54959b06c0f499ca7ed43edfd37ee5e2af85c28 100644 --- a/app/code/core/Mage/Sales/Model/Payment/Method/Billing/AgreementAbstract.php +++ b/app/code/core/Mage/Sales/Model/Payment/Method/Billing/AgreementAbstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Quote.php b/app/code/core/Mage/Sales/Model/Quote.php index 51abdcffbe2455ca4616bfc4916f88e9cd4a0cb1..1a4f80357537cc3194baf0e5398dff2daa2e0dbc 100644 --- a/app/code/core/Mage/Sales/Model/Quote.php +++ b/app/code/core/Mage/Sales/Model/Quote.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -69,8 +69,8 @@ * @method float getBaseGrandTotal() * @method Mage_Sales_Model_Quote setBaseGrandTotal(float $value) * @method Mage_Sales_Model_Quote setCheckoutMethod(string $value) - * @method int getCustomerId() - * @method Mage_Sales_Model_Quote setCustomerId(int $value) + * @method int|null getCustomerId() + * @method Mage_Sales_Model_Quote setCustomerId(int|null $value) * @method Mage_Sales_Model_Quote setCustomerTaxClassId(int $value) * @method Mage_Sales_Model_Quote setCustomerGroupId(int $value) * @method string getCustomerEmail() @@ -129,6 +129,8 @@ * @method Mage_Sales_Model_Quote setExtShippingInfo(string $value) * @method int getGiftMessageId() * @method Mage_Sales_Model_Quote setGiftMessageId(int $value) + * @method bool|null getIsPersistent() + * @method Mage_Sales_Model_Quote setIsPersistent(bool $value) * * @category Mage * @package Mage_Sales @@ -176,6 +178,13 @@ class Mage_Sales_Model_Quote extends Mage_Core_Model_Abstract */ protected $_errorInfoGroups = array(); + /** + * Whether quote should not be saved + * + * @var bool + */ + protected $_preventSaving = false; + /** * Init resource model */ @@ -448,9 +457,10 @@ class Mage_Sales_Model_Quote extends Mage_Core_Model_Abstract */ public function getCustomerGroupId() { - if ($this->getCustomerId()) { - return ($this->getData('customer_group_id')) ? $this->getData('customer_group_id') - : $this->getCustomer()->getGroupId(); + if ($this->hasData('customer_group_id')) { + return $this->getData('customer_group_id'); + } else if ($this->getCustomerId()) { + return $this->getCustomer()->getGroupId(); } else { return Mage_Customer_Model_Group::NOT_LOGGED_IN_ID; } @@ -460,7 +470,7 @@ class Mage_Sales_Model_Quote extends Mage_Core_Model_Abstract { /* * tax class can vary at any time. so instead of using the value from session, - * we need to retrieve from db everytime to get the correct tax class + * we need to retrieve from db every time to get the correct tax class */ //if (!$this->getData('customer_group_id') && !$this->getData('customer_tax_class_id')) { $classId = Mage::getModel('Mage_Customer_Model_Group')->getTaxClassId($this->getCustomerGroupId()); @@ -671,6 +681,9 @@ class Mage_Sales_Model_Quote extends Mage_Core_Model_Abstract */ public function getItemsCollection($useCache = true) { + if ($this->hasItemsCollection()) { + return $this->getData('items_collection'); + } if (is_null($this->_items)) { $this->_items = Mage::getModel('Mage_Sales_Model_Quote_Item')->getCollection(); $this->_items->setQuote($this); @@ -798,6 +811,19 @@ class Mage_Sales_Model_Quote extends Mage_Core_Model_Abstract return $this; } + /** + * Mark all quote items as deleted (empty quote) + * + * @return Mage_Sales_Model_Quote + */ + public function removeAllItems() + { + foreach ($this->getItemsCollection() as $item) { + $item->isDeleted(true); + } + return $this; + } + /** * Adding new item to quote * @@ -1191,12 +1217,7 @@ class Mage_Sales_Model_Quote extends Mage_Core_Model_Abstract if ($this->getTotalsCollectedFlag()) { return $this; } - Mage::dispatchEvent( - $this->_eventPrefix . '_collect_totals_before', - array( - $this->_eventObject=>$this - ) - ); + Mage::dispatchEvent($this->_eventPrefix . '_collect_totals_before', array($this->_eventObject => $this)); $this->setSubtotal(0); $this->setBaseSubtotal(0); @@ -1261,10 +1282,7 @@ class Mage_Sales_Model_Quote extends Mage_Core_Model_Abstract $this->setData('trigger_recollect', 0); $this->_validateCouponCode(); - Mage::dispatchEvent( - $this->_eventPrefix . '_collect_totals_after', - array($this->_eventObject => $this) - ); + Mage::dispatchEvent($this->_eventPrefix . '_collect_totals_after', array($this->_eventObject => $this)); $this->setTotalsCollectedFlag(true); return $this; @@ -1332,6 +1350,11 @@ class Mage_Sales_Model_Quote extends Mage_Core_Model_Abstract return $this; } + /** + * Retrieve current quote messages + * + * @return array + */ public function getMessages() { $messages = $this->getData('messages'); @@ -1342,6 +1365,23 @@ class Mage_Sales_Model_Quote extends Mage_Core_Model_Abstract return $messages; } + /** + * Retrieve current quote errors + * + * @return array + */ + public function getErrors() + { + $errors = array(); + foreach ($this->getMessages() as $message) { + /* @var $error Mage_Core_Model_Message_Abstract */ + if ($message->getType() == Mage_Core_Model_Message::ERROR) { + array_push($errors, $message); + } + } + return $errors; + } + /** * Sets flag, whether this quote has some error associated with it. * @@ -1789,4 +1829,28 @@ class Mage_Sales_Model_Quote extends Mage_Core_Model_Abstract } return $this->_getData('checkout_method'); } + + /** + * Prevent quote from saving + * + * @return Mage_Sales_Model_Quote + */ + public function preventSaving() + { + $this->_preventSaving = true; + return $this; + } + + /** + * Save quote with prevention checking + * + * @return Mage_Sales_Model_Quote + */ + public function save() + { + if ($this->_preventSaving) { + return $this; + } + return parent::save(); + } } diff --git a/app/code/core/Mage/Sales/Model/Quote/Address.php b/app/code/core/Mage/Sales/Model/Quote/Address.php index 1a406efd8bdf953467e1c10552fb94a28f51ac30..95122606b284bc735434351e7eb8b3d29fef9411 100644 --- a/app/code/core/Mage/Sales/Model/Quote/Address.php +++ b/app/code/core/Mage/Sales/Model/Quote/Address.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -139,12 +139,21 @@ */ class Mage_Sales_Model_Quote_Address extends Mage_Customer_Model_Address_Abstract { - const TYPE_BILLING = 'billing'; - const TYPE_SHIPPING = 'shipping'; const RATES_FETCH = 1; const RATES_RECALCULATE = 2; + /** + * Prefix of model events + * + * @var string + */ protected $_eventPrefix = 'sales_quote_address'; + + /** + * Name of event object + * + * @var string + */ protected $_eventObject = 'quote_address'; /** @@ -863,6 +872,8 @@ class Mage_Sales_Model_Quote_Address extends Mage_Customer_Model_Address_Abstrac $request->setPackageCurrency($this->getQuote()->getStore()->getCurrentCurrency()); $request->setLimitCarrier($this->getLimitCarrier()); + $request->setBaseSubtotalInclTax($this->getBaseSubtotalInclTax()); + $result = Mage::getModel('Mage_Shipping_Model_Shipping')->collectRates($request)->getResult(); $found = false; @@ -919,9 +930,11 @@ class Mage_Sales_Model_Quote_Address extends Mage_Customer_Model_Address_Abstrac */ public function collectTotals() { + Mage::dispatchEvent($this->_eventPrefix . '_collect_totals_before', array($this->_eventObject => $this)); foreach ($this->getTotalCollector()->getCollectors() as $model) { $model->collect($this); } + Mage::dispatchEvent($this->_eventPrefix . '_collect_totals_after', array($this->_eventObject => $this)); return $this; } diff --git a/app/code/core/Mage/Sales/Model/Quote/Address/Item.php b/app/code/core/Mage/Sales/Model/Quote/Address/Item.php index b1ffaf9b4fd63b814263a28f64f8ec05cc8e111e..7f4e17a950f44c01388d72f66892cc5ca947bb7f 100644 --- a/app/code/core/Mage/Sales/Model/Quote/Address/Item.php +++ b/app/code/core/Mage/Sales/Model/Quote/Address/Item.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Quote/Address/Rate.php b/app/code/core/Mage/Sales/Model/Quote/Address/Rate.php index 9e6ba1b6c57d87db3e4e730d0ce2f92c1bc34b4d..f0061cba6969b13cd3243b372ee049c92987ca5c 100644 --- a/app/code/core/Mage/Sales/Model/Quote/Address/Rate.php +++ b/app/code/core/Mage/Sales/Model/Quote/Address/Rate.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Quote/Address/Total.php b/app/code/core/Mage/Sales/Model/Quote/Address/Total.php index 1d8696b1da22867adc0214db3cafff81c82ec7c2..78a93be93a9cd7ca65b536e84342d8888c4a6747 100644 --- a/app/code/core/Mage/Sales/Model/Quote/Address/Total.php +++ b/app/code/core/Mage/Sales/Model/Quote/Address/Total.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Quote/Address/Total/Abstract.php b/app/code/core/Mage/Sales/Model/Quote/Address/Total/Abstract.php index 7df1a568fbf8600b5cef6718ed2d3b9eb938a0b5..627ecf0a3d034e12ef6da370e0d4ca4190886d80 100644 --- a/app/code/core/Mage/Sales/Model/Quote/Address/Total/Abstract.php +++ b/app/code/core/Mage/Sales/Model/Quote/Address/Total/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Quote/Address/Total/Collector.php b/app/code/core/Mage/Sales/Model/Quote/Address/Total/Collector.php index 5addc9b32b2986f26c6a58899a3f18110d44598d..03522620f6ac2cf2509764923f9260ec4e5d281a 100644 --- a/app/code/core/Mage/Sales/Model/Quote/Address/Total/Collector.php +++ b/app/code/core/Mage/Sales/Model/Quote/Address/Total/Collector.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Quote/Address/Total/Custbalance.php b/app/code/core/Mage/Sales/Model/Quote/Address/Total/Custbalance.php index aa62d63bacadea3d20357e036b6deab706c59d68..ef6642722fe8b6e2a8bd16df1ed5f86656149a6d 100644 --- a/app/code/core/Mage/Sales/Model/Quote/Address/Total/Custbalance.php +++ b/app/code/core/Mage/Sales/Model/Quote/Address/Total/Custbalance.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Quote/Address/Total/Discount.php b/app/code/core/Mage/Sales/Model/Quote/Address/Total/Discount.php index 8fbe4474d10a777bf9169820b8147806f1f043cf..53708d91918ac7fd2f06dfa8463cd7bdcc954ac6 100644 --- a/app/code/core/Mage/Sales/Model/Quote/Address/Total/Discount.php +++ b/app/code/core/Mage/Sales/Model/Quote/Address/Total/Discount.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -139,7 +139,8 @@ class Mage_Sales_Model_Quote_Address_Total_Discount extends Mage_Sales_Model_Quo $amount = $address->getDiscountAmount(); if ($amount!=0) { $title = Mage::helper('Mage_Sales_Helper_Data')->__('Discount'); - if ($code = $address->getCouponCode()) { + $code = $address->getCouponCode(); + if (strlen($code)) { $title = Mage::helper('Mage_Sales_Helper_Data')->__('Discount (%s)', $code); } $address->addTotal(array( @@ -151,4 +152,4 @@ class Mage_Sales_Model_Quote_Address_Total_Discount extends Mage_Sales_Model_Quo return $this; } -} +} \ No newline at end of file diff --git a/app/code/core/Mage/Sales/Model/Quote/Address/Total/Grand.php b/app/code/core/Mage/Sales/Model/Quote/Address/Total/Grand.php index 311523ac100d057d9c5808be8501171ee31a8e47..5dee569a357ca4d4197b8d6dd0f69dc82a28af3e 100644 --- a/app/code/core/Mage/Sales/Model/Quote/Address/Total/Grand.php +++ b/app/code/core/Mage/Sales/Model/Quote/Address/Total/Grand.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -47,7 +47,7 @@ class Mage_Sales_Model_Quote_Address_Total_Grand extends Mage_Sales_Model_Quote_ } /** - * Add grand total information to adderess + * Add grand total information to address * * @param Mage_Sales_Model_Quote_Address $address * @return Mage_Sales_Model_Quote_Address_Total_Grand diff --git a/app/code/core/Mage/Sales/Model/Quote/Address/Total/Msrp.php b/app/code/core/Mage/Sales/Model/Quote/Address/Total/Msrp.php index 3ccc1ea8be4028b6b7295596b3067e888e06de63..b3c57029f0eb6bb1424f9908c974cee9712a4672 100644 --- a/app/code/core/Mage/Sales/Model/Quote/Address/Total/Msrp.php +++ b/app/code/core/Mage/Sales/Model/Quote/Address/Total/Msrp.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Quote/Address/Total/Nominal.php b/app/code/core/Mage/Sales/Model/Quote/Address/Total/Nominal.php index d140fa62e993c0d1854990baee2ca991059a5dea..6a1b292b44931d2d28288ecec1cdecd11f19eba1 100644 --- a/app/code/core/Mage/Sales/Model/Quote/Address/Total/Nominal.php +++ b/app/code/core/Mage/Sales/Model/Quote/Address/Total/Nominal.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Quote/Address/Total/Nominal/Collector.php b/app/code/core/Mage/Sales/Model/Quote/Address/Total/Nominal/Collector.php index c96a0b3622c6b0a8e8f2e73ef0db91738155e17e..f9b5188e901a9b66717200520304e78c25649ee0 100644 --- a/app/code/core/Mage/Sales/Model/Quote/Address/Total/Nominal/Collector.php +++ b/app/code/core/Mage/Sales/Model/Quote/Address/Total/Nominal/Collector.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Quote/Address/Total/Nominal/Recurring/Initial.php b/app/code/core/Mage/Sales/Model/Quote/Address/Total/Nominal/Recurring/Initial.php index de77181d3e42b175398afc7165cc2fedb1f7c924..d733d05780ec1de86d0f3ccce4dc59aa71d03191 100644 --- a/app/code/core/Mage/Sales/Model/Quote/Address/Total/Nominal/Recurring/Initial.php +++ b/app/code/core/Mage/Sales/Model/Quote/Address/Total/Nominal/Recurring/Initial.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Quote/Address/Total/Nominal/Recurring/Trial.php b/app/code/core/Mage/Sales/Model/Quote/Address/Total/Nominal/Recurring/Trial.php index 4f8b2f6cc862fd1453e777831ab9ef63ac67ade1..73f8dd6147e3bdf46a27613e05283accc2894d9d 100644 --- a/app/code/core/Mage/Sales/Model/Quote/Address/Total/Nominal/Recurring/Trial.php +++ b/app/code/core/Mage/Sales/Model/Quote/Address/Total/Nominal/Recurring/Trial.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Quote/Address/Total/Nominal/RecurringAbstract.php b/app/code/core/Mage/Sales/Model/Quote/Address/Total/Nominal/RecurringAbstract.php index ac0c77b096db455df2af1712b04c50529185b5a9..820a27e08ef16b2b39068f72f47aa6231f7d8471 100644 --- a/app/code/core/Mage/Sales/Model/Quote/Address/Total/Nominal/RecurringAbstract.php +++ b/app/code/core/Mage/Sales/Model/Quote/Address/Total/Nominal/RecurringAbstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Quote/Address/Total/Nominal/Shipping.php b/app/code/core/Mage/Sales/Model/Quote/Address/Total/Nominal/Shipping.php index 0434115440a32f7aeaf0e83f014724cfab0422e0..16b91ef64f3049f86de68095fbcc813c05f32d9a 100644 --- a/app/code/core/Mage/Sales/Model/Quote/Address/Total/Nominal/Shipping.php +++ b/app/code/core/Mage/Sales/Model/Quote/Address/Total/Nominal/Shipping.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Quote/Address/Total/Nominal/Subtotal.php b/app/code/core/Mage/Sales/Model/Quote/Address/Total/Nominal/Subtotal.php index 5d14bba158c730acc7a331ebbbb46d3ca89dfd51..389b7348131c6dcc2e072b98b92dd41872a09354 100644 --- a/app/code/core/Mage/Sales/Model/Quote/Address/Total/Nominal/Subtotal.php +++ b/app/code/core/Mage/Sales/Model/Quote/Address/Total/Nominal/Subtotal.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Quote/Address/Total/Shipping.php b/app/code/core/Mage/Sales/Model/Quote/Address/Total/Shipping.php index 79ee7c6544fde1d25e7945ba81e41cf8c4aa1c39..c0534c1b355c22bef5fa20d9c311521098ff4471 100644 --- a/app/code/core/Mage/Sales/Model/Quote/Address/Total/Shipping.php +++ b/app/code/core/Mage/Sales/Model/Quote/Address/Total/Shipping.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Quote/Address/Total/Subtotal.php b/app/code/core/Mage/Sales/Model/Quote/Address/Total/Subtotal.php index 472e92e02179eb6c7d64bcb04f8e50d9b812d7f5..d00f98994b5fc504c0e30effe2c78eccc4516d82 100644 --- a/app/code/core/Mage/Sales/Model/Quote/Address/Total/Subtotal.php +++ b/app/code/core/Mage/Sales/Model/Quote/Address/Total/Subtotal.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Quote/Address/Total/Tax.php b/app/code/core/Mage/Sales/Model/Quote/Address/Total/Tax.php index ebb4da0436296c0fe560173b01b7762ae743aab7..e2cb1b2d550141bc2fde9ddf145011c5ae17264f 100644 --- a/app/code/core/Mage/Sales/Model/Quote/Address/Total/Tax.php +++ b/app/code/core/Mage/Sales/Model/Quote/Address/Total/Tax.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Quote/Config.php b/app/code/core/Mage/Sales/Model/Quote/Config.php index f1842a6b13bf2804e12b9f4fbf8f6a0de03fd25d..6a0d60b0f70fb3956721281f47eac60b664c85bd 100644 --- a/app/code/core/Mage/Sales/Model/Quote/Config.php +++ b/app/code/core/Mage/Sales/Model/Quote/Config.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Quote/Item.php b/app/code/core/Mage/Sales/Model/Quote/Item.php index 3f49aedafcb951f78c33583990bbc8ab0473fed1..9528b56bda75c557c39f43dc467673d26c0d0196 100644 --- a/app/code/core/Mage/Sales/Model/Quote/Item.php +++ b/app/code/core/Mage/Sales/Model/Quote/Item.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Quote/Item/Abstract.php b/app/code/core/Mage/Sales/Model/Quote/Item/Abstract.php index 2d16052a0530bca09da4754cf57a1384b7ba56b7..878a967f39f6b592672bc9c4573a002f6d8ed227 100644 --- a/app/code/core/Mage/Sales/Model/Quote/Item/Abstract.php +++ b/app/code/core/Mage/Sales/Model/Quote/Item/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Quote/Item/Option.php b/app/code/core/Mage/Sales/Model/Quote/Item/Option.php index e6c42935e54dd894095803ecebe0932864b8ca4c..daf61417f65045c7decd3241cfe06d0c559b11f6 100644 --- a/app/code/core/Mage/Sales/Model/Quote/Item/Option.php +++ b/app/code/core/Mage/Sales/Model/Quote/Item/Option.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Quote/Payment.php b/app/code/core/Mage/Sales/Model/Quote/Payment.php index e0345599e7d43a509575dd7a0ca99d2c16a431e5..4f495a56b2de90bd081d034fa460911792ac7940 100644 --- a/app/code/core/Mage/Sales/Model/Quote/Payment.php +++ b/app/code/core/Mage/Sales/Model/Quote/Payment.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Recurring/Profile.php b/app/code/core/Mage/Sales/Model/Recurring/Profile.php index 2df45417021f2b4e93e14257a82dbb8277057920..d3e041aca8bc19c27f2bd8d8432dd753b0995208 100644 --- a/app/code/core/Mage/Sales/Model/Recurring/Profile.php +++ b/app/code/core/Mage/Sales/Model/Recurring/Profile.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Abstract.php b/app/code/core/Mage/Sales/Model/Resource/Abstract.php index 3856210933121523f30517cf3f36b8b22b77fc9a..92f0533ea4756ec42f0eed0fc2aaf126472beb38 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Abstract.php +++ b/app/code/core/Mage/Sales/Model/Resource/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Billing/Agreement.php b/app/code/core/Mage/Sales/Model/Resource/Billing/Agreement.php index e71f02d1b2d43b57a0434548202ab516ea83195d..245bfbbd4114af36b6957651955458c1720f2ce5 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Billing/Agreement.php +++ b/app/code/core/Mage/Sales/Model/Resource/Billing/Agreement.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Billing/Agreement/Collection.php b/app/code/core/Mage/Sales/Model/Resource/Billing/Agreement/Collection.php index 0ef3dc51da445dab5a0349fbb7c100b5b84f1359..c5527a7740861c6cc859580d7aa33253a4ff3c2f 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Billing/Agreement/Collection.php +++ b/app/code/core/Mage/Sales/Model/Resource/Billing/Agreement/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Collection/Abstract.php b/app/code/core/Mage/Sales/Model/Resource/Collection/Abstract.php index 43c359af75f221094abab84427e47833a38fd6b6..4f2495f80c73fb40ad1d5199a83857562e55ea9f 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Collection/Abstract.php +++ b/app/code/core/Mage/Sales/Model/Resource/Collection/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Helper/Interface.php b/app/code/core/Mage/Sales/Model/Resource/Helper/Interface.php new file mode 100644 index 0000000000000000000000000000000000000000..a28425f702d02cc3deb577fcae08b2f16bacc677 --- /dev/null +++ b/app/code/core/Mage/Sales/Model/Resource/Helper/Interface.php @@ -0,0 +1,49 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Sales + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + + +/** + * Sales resource helper interface + * + * @category Mage + * @package Mage_Sales + * @author Magento Core Team <core@magentocommerce.com> + */ +interface Mage_Sales_Model_Resource_Helper_Interface +{ + /** + * Update rating position + * + * @param string $aggregation One of Mage_Sales_Model_Resource_Report_Bestsellers::AGGREGATION_XXX constants + * @param array $aggregationAliases + * @param string $mainTable + * @param string $aggregationTable + * @return Mage_Sales_Model_Resource_Helper_Abstract + */ + public function getBestsellersReportUpdateRatingPos($aggregation, $aggregationAliases, + $mainTable, $aggregationTable + ); +} diff --git a/app/code/core/Mage/Sales/Model/Resource/Helper/Mysql4.php b/app/code/core/Mage/Sales/Model/Resource/Helper/Mysql4.php index e52f9b3af3b3d729fd61acc79b30f2e3b0c05c11..8c6711a8bfef506dc05bbb44503c0d5276017951 100644 --- a/app/code/core/Mage/Sales/Model/Resource/Helper/Mysql4.php +++ b/app/code/core/Mage/Sales/Model/Resource/Helper/Mysql4.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -33,6 +33,7 @@ * @author Magento Core Team <core@magentocommerce.com> */ class Mage_Sales_Model_Resource_Helper_Mysql4 extends Mage_Core_Model_Resource_Helper_Mysql4 + implements Mage_Sales_Model_Resource_Helper_Interface { /** * Update rating position @@ -46,55 +47,20 @@ class Mage_Sales_Model_Resource_Helper_Mysql4 extends Mage_Core_Model_Resource_H public function getBestsellersReportUpdateRatingPos($aggregation, $aggregationAliases, $mainTable, $aggregationTable ) { - $adapter = $this->_getWriteAdapter(); - $periodSubSelect = $adapter->select(); - $ratingSubSelect = $adapter->select(); - $ratingSelect = $adapter->select(); + /** @var $reportsResourceHelper Mage_Reports_Model_Resource_Helper_Interface */ + $reportsResourceHelper = Mage::getResourceHelper('Mage_Reports'); - $periodCol = 't.period'; if ($aggregation == $aggregationAliases['monthly']) { - $periodCol = $adapter->getDateFormatSql('t.period', '%Y-%m-01'); + $reportsResourceHelper + ->updateReportRatingPos('month', 'qty_ordered', $mainTable, $aggregationTable); } elseif ($aggregation == $aggregationAliases['yearly']) { - $periodCol = $adapter->getDateFormatSql('t.period', '%Y-01-01'); + $reportsResourceHelper + ->updateReportRatingPos('year', 'qty_ordered', $mainTable, $aggregationTable); + } else { + $reportsResourceHelper + ->updateReportRatingPos('day', 'qty_ordered', $mainTable, $aggregationTable); } - $columns = array( - 'period' => 't.period', - 'store_id' => 't.store_id', - 'product_id' => 't.product_id', - 'product_name' => 't.product_name', - 'product_price' => 't.product_price', - ); - - if ($aggregation == $aggregationAliases['daily']) { - $columns['id'] = 't.id'; // to speed-up insert on duplicate key update - } - - $cols = array_keys($columns); - $cols['total_qty_ordered'] = new Zend_Db_Expr('SUM(t.qty_ordered)'); - $periodSubSelect->from(array('t' => $mainTable), $cols) - ->group(array('t.store_id', $periodCol, 't.product_id')) - ->order(array('t.store_id', $periodCol, 'total_qty_ordered DESC')); - - $cols = $columns; - $cols['qty_ordered'] = 't.total_qty_ordered'; - $cols['rating_pos'] = new Zend_Db_Expr( - "(@pos := IF(t.`store_id` <> @prevStoreId OR {$periodCol} <> @prevPeriod, 1, @pos+1))"); - $cols['prevStoreId'] = new Zend_Db_Expr('(@prevStoreId := t.`store_id`)'); - $cols['prevPeriod'] = new Zend_Db_Expr("(@prevPeriod := {$periodCol})"); - $ratingSubSelect->from($periodSubSelect, $cols); - - $cols = $columns; - $cols['period'] = $periodCol; // important! - $cols['qty_ordered'] = 't.qty_ordered'; - $cols['rating_pos'] = 't.rating_pos'; - $ratingSelect->from($ratingSubSelect, $cols); - - $sql = $ratingSelect->insertFromSelect($aggregationTable, array_keys($cols)); - $adapter->query("SET @pos = 0, @prevStoreId = -1, @prevPeriod = '0000-00-00'"); - - $adapter->query($sql); - return $this; } } diff --git a/app/code/core/Mage/Sales/Model/Resource/Order.php b/app/code/core/Mage/Sales/Model/Resource/Order.php index 919bdaa63f29546042743e694ea10be08a300b17..33ac33181a81f2aa894efaa9c93577e048ac195d 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Abstract.php b/app/code/core/Mage/Sales/Model/Resource/Order/Abstract.php index da40d3a520b9fb0f9e790fba6d5e374b5341dd3e..911645a4d8ea19ca87ee9f62c76793d9c9cc99ae 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Abstract.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -392,7 +392,7 @@ abstract class Mage_Sales_Model_Resource_Order_Abstract extends Mage_Sales_Model { if ($object->getId() && !empty($data)) { $table = $this->getMainTable(); - $this->_getWriteAdapter()->update($table, $data, + $this->_getWriteAdapter()->update($table, $data, array($this->getIdFieldName() . '=?' => (int) $object->getId()) ); $object->addData($data); @@ -427,4 +427,31 @@ abstract class Mage_Sales_Model_Resource_Order_Abstract extends Mage_Sales_Model return $this; } + + /** + * Update grid table on entity update + * + * @param string $field + * @param int $entityId + * @return int + */ + public function updateOnRelatedRecordChanged($field, $entityId) + { + $adapter = $this->_getWriteAdapter(); + $column = array(); + $select = $adapter->select() + ->from(array('main_table' => $this->getMainTable()), $column) + ->where('main_table.' . $field .' = ?', $entityId); + $this->joinVirtualGridColumnsToSelect('main_table', $select, $column); + $fieldsToUpdate = $adapter->fetchRow($select); + if ($fieldsToUpdate) { + return $adapter->update( + $this->getGridTable(), + $fieldsToUpdate, + $adapter->quoteInto($this->getGridTable() . '.' . $field . ' = ?', $entityId) + ); + } + return 0; + } } + diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Address.php b/app/code/core/Mage/Sales/Model/Resource/Order/Address.php index c6a4eecd2334a2c3db4cda3d059036cb0e3abf7c..23d1ad427cd051f4b1858a6836bee5d16d15f6ae 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Address.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Address.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -72,4 +72,33 @@ class Mage_Sales_Model_Resource_Order_Address extends Mage_Sales_Model_Resource_ asort($attributes); return $attributes; } + + /** + * Update related grid table after object save + * + * @param Varien_Object $object + * @return Mage_Core_Model_Resource_Db_Abstract + */ + protected function _afterSave(Mage_Core_Model_Abstract $object) + { + $resource = parent::_afterSave($object); + if ($object->hasDataChanges() && $object->getOrder()) { + $gridList = array( + 'Mage_Sales_Model_Resource_Order' => 'entity_id', + 'Mage_Sales_Model_Resource_Order_Invoice' => 'order_id', + 'Mage_Sales_Model_Resource_Order_Shipment' => 'order_id', + 'Mage_Sales_Model_Resource_Order_Creditmemo' => 'order_id' + ); + + // update grid table after grid update + foreach ($gridList as $gridResource => $field) { + Mage::getResourceModel($gridResource)->updateOnRelatedRecordChanged( + $field, + $object->getParentId() + ); + } + } + + return $resource; + } } diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Address/Collection.php b/app/code/core/Mage/Sales/Model/Resource/Order/Address/Collection.php index 70fc65560b115f564f96b5d4b3fc8256ec148899..bf2b42ae76e124eed39b5e77f6745d0264443308 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Address/Collection.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Address/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Attribute/Backend/Billing.php b/app/code/core/Mage/Sales/Model/Resource/Order/Attribute/Backend/Billing.php index 96f42196983989dece90668c74bc1ddb3f20f93d..03acfd47d63f9b3c3907ca346edb3ecc36495c42 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Attribute/Backend/Billing.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Attribute/Backend/Billing.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Attribute/Backend/Child.php b/app/code/core/Mage/Sales/Model/Resource/Order/Attribute/Backend/Child.php index 15857d1d5fb6e10748227ac2596a30fa00ba8f7b..7dd3a5890f6db451e672fe768150bb7f84ba020c 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Attribute/Backend/Child.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Attribute/Backend/Child.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Attribute/Backend/Parent.php b/app/code/core/Mage/Sales/Model/Resource/Order/Attribute/Backend/Parent.php index c16d381a0ac1769167399add0b050d9b90468279..52c8e42c9eb910f130628ed26312b59cc5c698dd 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Attribute/Backend/Parent.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Attribute/Backend/Parent.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Attribute/Backend/Shipping.php b/app/code/core/Mage/Sales/Model/Resource/Order/Attribute/Backend/Shipping.php index 73740a6320af685811f95e1e2e535bc7348936e9..94d6b784582a70067da4cc0b2208beddef7c7a85 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Attribute/Backend/Shipping.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Attribute/Backend/Shipping.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Collection.php b/app/code/core/Mage/Sales/Model/Resource/Order/Collection.php index fc205ef919aff28542964479279bbca16303face..e34c6c463198d476f2ada9b3cf3e2f43f4943311 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Collection.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Collection/Abstract.php b/app/code/core/Mage/Sales/Model/Resource/Order/Collection/Abstract.php index c1ebe82a65b3e9773749d5415607eedd918215cd..404fef86cba40e946a7845f75a33e615047fecd0 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Collection/Abstract.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Collection/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Comment/Collection/Abstract.php b/app/code/core/Mage/Sales/Model/Resource/Order/Comment/Collection/Abstract.php index 22f912d2a6a09588e31b492c1e81230394e6085c..f0948caff63126a5310911eb1f6b12ed21e6f80a 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Comment/Collection/Abstract.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Comment/Collection/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Creditmemo.php b/app/code/core/Mage/Sales/Model/Resource/Order/Creditmemo.php index 069c1927d21444b86df6e950ac8f83b66b576f20..94ef89730b4d1b38fd785e4ac6c2d60d65be4b5b 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Creditmemo.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Creditmemo.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Creditmemo/Attribute/Backend/Child.php b/app/code/core/Mage/Sales/Model/Resource/Order/Creditmemo/Attribute/Backend/Child.php index 3fa14d97bc7772bb19c62a57ef1be0306095cd9d..fbfefb82fbc8c428c4b74e134b990e65501adf1d 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Creditmemo/Attribute/Backend/Child.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Creditmemo/Attribute/Backend/Child.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Creditmemo/Attribute/Backend/Parent.php b/app/code/core/Mage/Sales/Model/Resource/Order/Creditmemo/Attribute/Backend/Parent.php index dd1394370bed655fce5afa55b8c4fbe51cd7b1bc..a5e9bdfbdd8350c176b4b42b33bb0b6c8ff9e7ff 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Creditmemo/Attribute/Backend/Parent.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Creditmemo/Attribute/Backend/Parent.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Creditmemo/Collection.php b/app/code/core/Mage/Sales/Model/Resource/Order/Creditmemo/Collection.php index 76d1624a6a930b908314d3f1421eae1bcc81ee59..d01bdb3f0f47841c9f60106d763b68315b78bfba 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Creditmemo/Collection.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Creditmemo/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Creditmemo/Comment.php b/app/code/core/Mage/Sales/Model/Resource/Order/Creditmemo/Comment.php index fae71a8e664ea40493d6c6d18712183ca2d9f745..b00d5a08da21df94ecf1b27d6e259eb581423bd7 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Creditmemo/Comment.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Creditmemo/Comment.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Creditmemo/Comment/Collection.php b/app/code/core/Mage/Sales/Model/Resource/Order/Creditmemo/Comment/Collection.php index 7d14d8528be32148cfce243d7fc2c53643ae555c..0fb640064e78a5f4d75429cb63d4a57d85231eb9 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Creditmemo/Comment/Collection.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Creditmemo/Comment/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Creditmemo/Grid/Collection.php b/app/code/core/Mage/Sales/Model/Resource/Order/Creditmemo/Grid/Collection.php index 2ad7ebc83c7bcbc39e1a68b46782fb6f166a4b9c..088196b12d06b9646efd84ac063a60018d762eb3 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Creditmemo/Grid/Collection.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Creditmemo/Grid/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Creditmemo/Item.php b/app/code/core/Mage/Sales/Model/Resource/Order/Creditmemo/Item.php index 9cd1bf22de93ee690edb94f53ef02a14faadd23b..1c096be462d08bc5aa420f5deea18018ed2937f6 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Creditmemo/Item.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Creditmemo/Item.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Creditmemo/Item/Collection.php b/app/code/core/Mage/Sales/Model/Resource/Order/Creditmemo/Item/Collection.php index 2611c16926a6f2277866efce876ca21df4963a4e..ac59c7a1aaeb45513402810f52f0e8c552058492 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Creditmemo/Item/Collection.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Creditmemo/Item/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Grid/Collection.php b/app/code/core/Mage/Sales/Model/Resource/Order/Grid/Collection.php index 2173ae40b80839667b3af646d8be48f0fd929c5d..0a3a68e6e7c51bca73ee997a8fa832cf486fb887 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Grid/Collection.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Grid/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Invoice.php b/app/code/core/Mage/Sales/Model/Resource/Order/Invoice.php index ad56688351435fa56a9f973e230340c76c0c4f4e..00690b8abce371ed771e957f8ecf863c08921133 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Invoice.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Invoice.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Invoice/Attribute/Backend/Child.php b/app/code/core/Mage/Sales/Model/Resource/Order/Invoice/Attribute/Backend/Child.php index 4a3fb853299cb7a38b5f2084a17df242805a20dc..b8eb11d90a878e9912f772a5b4351136299f9df4 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Invoice/Attribute/Backend/Child.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Invoice/Attribute/Backend/Child.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Invoice/Attribute/Backend/Item.php b/app/code/core/Mage/Sales/Model/Resource/Order/Invoice/Attribute/Backend/Item.php index d77e31aeda6686ca50425176a643ae8cdcf402fc..07240a4526063123f44ab4c4b43c69ddca3e25b8 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Invoice/Attribute/Backend/Item.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Invoice/Attribute/Backend/Item.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Invoice/Attribute/Backend/Order.php b/app/code/core/Mage/Sales/Model/Resource/Order/Invoice/Attribute/Backend/Order.php index b522931dc6d818c2a7a361bfa0641c739446e351..33707831e3d937e8976e5c228f5fcc220e6cfc28 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Invoice/Attribute/Backend/Order.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Invoice/Attribute/Backend/Order.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Invoice/Attribute/Backend/Parent.php b/app/code/core/Mage/Sales/Model/Resource/Order/Invoice/Attribute/Backend/Parent.php index 67a9d092224aa093ce1fb6c4608905cba066b938..ca9c52df5e3646926c96bc5695efeae39ff71747 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Invoice/Attribute/Backend/Parent.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Invoice/Attribute/Backend/Parent.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Invoice/Collection.php b/app/code/core/Mage/Sales/Model/Resource/Order/Invoice/Collection.php index 3e05e99080641947269ff6bdd3fa4b1d49d2aa5f..a171bac342eeb46a502a618d3424bb640ab86f8e 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Invoice/Collection.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Invoice/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Invoice/Comment.php b/app/code/core/Mage/Sales/Model/Resource/Order/Invoice/Comment.php index f79c3702795d51b522477a6ddb69c357d67e168e..3b836a5930a99dd70bbeb84a3aea7c3983714fc2 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Invoice/Comment.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Invoice/Comment.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Invoice/Comment/Collection.php b/app/code/core/Mage/Sales/Model/Resource/Order/Invoice/Comment/Collection.php index 8bf0cef5ef5408cd5554272a97d20703e0205347..979fcfb06b80080b41d5ba65e25a96cba5cd91dd 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Invoice/Comment/Collection.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Invoice/Comment/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Invoice/Grid/Collection.php b/app/code/core/Mage/Sales/Model/Resource/Order/Invoice/Grid/Collection.php index 96b3119e5dee57b0433ca4182011d4b2f9767820..0c935319a62c7b138b8fbbcc7e666c59b0f910d1 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Invoice/Grid/Collection.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Invoice/Grid/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Invoice/Item.php b/app/code/core/Mage/Sales/Model/Resource/Order/Invoice/Item.php index 029adea10376d70e00070ddb79fda973c8dc25c8..352eb9aac0168f253d122279ed04ccade6bad184 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Invoice/Item.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Invoice/Item.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Invoice/Item/Collection.php b/app/code/core/Mage/Sales/Model/Resource/Order/Invoice/Item/Collection.php index 5ac293c3d2023ce9281e2976f2f1477a0d1b4fd6..548a5efe45a0328846c20eaa858b40193ca98985 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Invoice/Item/Collection.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Invoice/Item/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Item.php b/app/code/core/Mage/Sales/Model/Resource/Order/Item.php index 04081c89ed3d8807b83731497bd4a33bf06fd8a7..dafb887689a74d9ab7acb2db65ab4ae9983ff89c 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Item.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Item.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Item/Collection.php b/app/code/core/Mage/Sales/Model/Resource/Order/Item/Collection.php index d05b4c6935ba64dfb87a39f4e1dce40a4fa4ce92..33c593814b20da7d167e05e3f3e82fc250e95e5a 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Item/Collection.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Item/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Payment.php b/app/code/core/Mage/Sales/Model/Resource/Order/Payment.php index 7e66006408c6561236815bf1b8a208f7f7dea6e6..afe2144ae75407f122d2ef4e95bddb12b16b16f5 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Payment.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Payment.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Payment/Collection.php b/app/code/core/Mage/Sales/Model/Resource/Order/Payment/Collection.php index 4357e3e01ab9d12be87cceab54f20e75853d383d..cec4dda9ddd4856a47e50785c9969d8deac9a5dd 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Payment/Collection.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Payment/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Payment/Transaction.php b/app/code/core/Mage/Sales/Model/Resource/Order/Payment/Transaction.php index f4787446e78f451fddc8e9cd233dbcffe76a8feb..3c98b88aadc56409be6514d41e72044f35ddf480 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Payment/Transaction.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Payment/Transaction.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Payment/Transaction/Collection.php b/app/code/core/Mage/Sales/Model/Resource/Order/Payment/Transaction/Collection.php index 6bd30365869ca1209ad0afebb73125dd94721f43..c5b52f8c4ed8ec0ceb09dce3a97eaed7833df119 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Payment/Transaction/Collection.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Payment/Transaction/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Shipment.php b/app/code/core/Mage/Sales/Model/Resource/Order/Shipment.php index be6dbe3e8ed19f9384b506f7626fd1009add0763..3f8bdf0fedf857091796c6cada9e4fba5e7e04a4 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Shipment.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Shipment.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Shipment/Attribute/Backend/Child.php b/app/code/core/Mage/Sales/Model/Resource/Order/Shipment/Attribute/Backend/Child.php index 260908e1ac1e401571e9e1eb07ad9bde486ea5e6..a27fd5c3b93650af8ed1ad50dadb0720ffe8554f 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Shipment/Attribute/Backend/Child.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Shipment/Attribute/Backend/Child.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Shipment/Attribute/Backend/Parent.php b/app/code/core/Mage/Sales/Model/Resource/Order/Shipment/Attribute/Backend/Parent.php index e78baebaf8e8f45f48bd4a48779823df6d3adeef..91378d670acdfcc3e87b251df2bc4eb344880a30 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Shipment/Attribute/Backend/Parent.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Shipment/Attribute/Backend/Parent.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Shipment/Collection.php b/app/code/core/Mage/Sales/Model/Resource/Order/Shipment/Collection.php index 6aedbcd7400f70568568c12564608f3e0ecbbe8f..ee785b9928340fcbf4938cad456356a576f5acab 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Shipment/Collection.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Shipment/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Shipment/Comment.php b/app/code/core/Mage/Sales/Model/Resource/Order/Shipment/Comment.php index c864a76917913a9bdddb5edc93e05a75406d7c0e..9e71f5869a0c49d8b9f442656470defe8480670c 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Shipment/Comment.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Shipment/Comment.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Shipment/Comment/Collection.php b/app/code/core/Mage/Sales/Model/Resource/Order/Shipment/Comment/Collection.php index 102d8e60574999c466aa43100a3d2b9e5ebde686..cd0a5391b58fea91efae32857f3a9ae1401d4064 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Shipment/Comment/Collection.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Shipment/Comment/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Shipment/Grid/Collection.php b/app/code/core/Mage/Sales/Model/Resource/Order/Shipment/Grid/Collection.php index dcfe40923c08eb7969db0df6b26e69f711e3d823..13b374580dcbd636a38de2da825382560e6e22f7 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Shipment/Grid/Collection.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Shipment/Grid/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Shipment/Item.php b/app/code/core/Mage/Sales/Model/Resource/Order/Shipment/Item.php index 64dae9fc7c39fce695c6a31210231ebac594bc3f..68b8928f7a8541bfa12256c9cbf1c13327f23e26 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Shipment/Item.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Shipment/Item.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Shipment/Item/Collection.php b/app/code/core/Mage/Sales/Model/Resource/Order/Shipment/Item/Collection.php index 7af2dd8f177133d8566802187f558f5b7a2dd862..66f1d036e207f723f86c6e208aaf82ebe7d74857 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Shipment/Item/Collection.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Shipment/Item/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Shipment/Track.php b/app/code/core/Mage/Sales/Model/Resource/Order/Shipment/Track.php index 635afedb4b5b3deaff871229e72de9d0067ea074..0c32fc18a1384af8bcd5380fb5cabfee24179442 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Shipment/Track.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Shipment/Track.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Shipment/Track/Collection.php b/app/code/core/Mage/Sales/Model/Resource/Order/Shipment/Track/Collection.php index b49ec79591bb703248afca3efdda2ed9f1de1608..fc04a0f04cd82a09d0350e8eecb218a4b89ba855 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Shipment/Track/Collection.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Shipment/Track/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Status.php b/app/code/core/Mage/Sales/Model/Resource/Order/Status.php index 6db8d35a451778e09adf5442cdab975b84fd9417..19627ad251fa3982ab28404200b8f1b369818585 100644 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Status.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Status.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Status/Collection.php b/app/code/core/Mage/Sales/Model/Resource/Order/Status/Collection.php index 35da2472bd58e36ff69b10a2c14079c2692ef13e..940acc67df0fd8938e0a4f5b80deff8302392f20 100644 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Status/Collection.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Status/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Status/History.php b/app/code/core/Mage/Sales/Model/Resource/Order/Status/History.php index 7d3191c265bd0a27f18b4fb05301e125e7938b08..a1ed0534cdbfef7382f673eae8d50ddfa3e2168f 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Status/History.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Status/History.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Status/History/Collection.php b/app/code/core/Mage/Sales/Model/Resource/Order/Status/History/Collection.php index 5e89960a7ebcc48b48ac0b10ce5d85def978cbdb..173dc67352a9dc1c420fd1c3465075ed31a0767c 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Status/History/Collection.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Status/History/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Tax.php b/app/code/core/Mage/Sales/Model/Resource/Order/Tax.php index 5c2110edf1dfae1359116377a4a34fd7f4139e82..d29eb231577f7925afd79d822185825f49151acd 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Tax.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Tax.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Tax/Collection.php b/app/code/core/Mage/Sales/Model/Resource/Order/Tax/Collection.php index f34efdc2219813e151cebf3f187d7c01d935d882..231c54c3e109c2f2f929f31f6bbf6dd270622418 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Tax/Collection.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Tax/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Quote.php b/app/code/core/Mage/Sales/Model/Resource/Quote.php index 798fbcc157b9670f7c8a049c938f36cf59ba73f1..0720547245ccdd97f270fd3de37e7f00bd5fe29d 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Quote.php +++ b/app/code/core/Mage/Sales/Model/Resource/Quote.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Quote/Address.php b/app/code/core/Mage/Sales/Model/Resource/Quote/Address.php index 8fbecd4fb311a533135f8b37d43df9ad2cc3d123..e297a66b391c3daa0406f14f5d05ba48ae4e63c2 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Quote/Address.php +++ b/app/code/core/Mage/Sales/Model/Resource/Quote/Address.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Attribute/Backend.php b/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Attribute/Backend.php index 56dbb43236989cf09039fa91c3e3d1ea95178844..3f4c02a9f2b4eb4b5f57aaf3384ea49c9a24bb57 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Attribute/Backend.php +++ b/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Attribute/Backend.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Attribute/Backend/Child.php b/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Attribute/Backend/Child.php index cdb00856ed5c03e7498055bf17da33fffcf45bea..10a9ca141dad76ae1b8d48ef59aabd9a945c1d7e 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Attribute/Backend/Child.php +++ b/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Attribute/Backend/Child.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Attribute/Backend/Parent.php b/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Attribute/Backend/Parent.php index 445ed2e4a6cd44da937204892fae99eabf8ff9f6..957c159d7e7674df67dfda9e2e0ec5a12d1d5277 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Attribute/Backend/Parent.php +++ b/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Attribute/Backend/Parent.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Attribute/Backend/Region.php b/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Attribute/Backend/Region.php index 54dca8e16791e846a1a11ee29c655d1aaaa9df09..cc7d5f816702e3e69c9c1b5bdebb643795493a7f 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Attribute/Backend/Region.php +++ b/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Attribute/Backend/Region.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Attribute/Frontend.php b/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Attribute/Frontend.php index 20640c9558eff7bc46d874d10a5b5dbd1ce34c0a..d6f4ebc8fb51063d6d98c51af353988a34e85c4d 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Attribute/Frontend.php +++ b/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Attribute/Frontend.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Attribute/Frontend/Custbalance.php b/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Attribute/Frontend/Custbalance.php index 284ef7ee3f571a9d7dd452171b5f1fc4e1551d9c..62b443ee3db0652c9aa56f8acdcd92b3d108e50e 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Attribute/Frontend/Custbalance.php +++ b/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Attribute/Frontend/Custbalance.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Attribute/Frontend/Discount.php b/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Attribute/Frontend/Discount.php index 3614a63f7e4065d15d81801ad13c4a5d6dba7273..9240862fbf830e4216bc42bb70bff763dc91c6c1 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Attribute/Frontend/Discount.php +++ b/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Attribute/Frontend/Discount.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -46,8 +46,9 @@ class Mage_Sales_Model_Resource_Quote_Address_Attribute_Frontend_Discount $amount = $address->getDiscountAmount(); if ($amount != 0) { $title = Mage::helper('Mage_Sales_Helper_Data')->__('Discount'); - if ($address->getQuote()->getCouponCode()) { - $title .= sprintf(' (%s)', $address->getQuote()->getCouponCode()); + $couponCode = $address->getQuote()->getCouponCode(); + if (strlen($couponCode)) { + $title .= sprintf(' (%s)', $couponCode); } $address->addTotal(array( 'code' => 'discount', @@ -57,4 +58,4 @@ class Mage_Sales_Model_Resource_Quote_Address_Attribute_Frontend_Discount } return $this; } -} +} \ No newline at end of file diff --git a/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Attribute/Frontend/Grand.php b/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Attribute/Frontend/Grand.php index 0ac8e3ab1bf5422c7226f4ebf35e04da6cf07e32..6dc097f923202f09c39ab5392fb354c6db0b650d 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Attribute/Frontend/Grand.php +++ b/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Attribute/Frontend/Grand.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Attribute/Frontend/Shipping.php b/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Attribute/Frontend/Shipping.php index 34f0c16bf404fdda61239825a2f9cbcdfccfbe8c..b14519652098440e740f1643791e6eb84b8dbdd5 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Attribute/Frontend/Shipping.php +++ b/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Attribute/Frontend/Shipping.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Attribute/Frontend/Subtotal.php b/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Attribute/Frontend/Subtotal.php index 63bd897edc1c7f9df98be9f704cf9b2d744c9dea..f7a9d1161f8d7209210ea24ea58b763c6e7c462a 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Attribute/Frontend/Subtotal.php +++ b/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Attribute/Frontend/Subtotal.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Attribute/Frontend/Tax.php b/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Attribute/Frontend/Tax.php index da66589d2b9acd5fcb630fae1fa5b00a1b7cec21..34ef984dc6b416fa2698c8ecf185d529e538049b 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Attribute/Frontend/Tax.php +++ b/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Attribute/Frontend/Tax.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Collection.php b/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Collection.php index d45252c9535c07a30460527a5aaf7ec28193002b..481dc0928d1e263e013bc6a3a43ffe42c5ef3dda 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Collection.php +++ b/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Item.php b/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Item.php index d4b65fccf0a02816115284c9cc0290f158c31e8a..f0402c8805968353b9697dbace35ec5a182bbb8f 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Item.php +++ b/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Item.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Item/Collection.php b/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Item/Collection.php index 851dd542bb4b1497ae87813ace00c64232a822d9..2e712e4ead6a9876617256bda77343cd6894340c 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Item/Collection.php +++ b/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Item/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Rate.php b/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Rate.php index d09d25db014d9c525f47390800bbc1468c7de262..0b569861f1a3c4fcbb669d91ac12199070af9709 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Rate.php +++ b/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Rate.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Rate/Collection.php b/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Rate/Collection.php index b0f627fd855094a0de229467c4673aeac1a54663..beed2f8882e23fea316b39ccb69ca2404759a3e3 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Rate/Collection.php +++ b/app/code/core/Mage/Sales/Model/Resource/Quote/Address/Rate/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Quote/Collection.php b/app/code/core/Mage/Sales/Model/Resource/Quote/Collection.php index a5928b3137ab2e46248a60a4e344ff933ead039e..3398e0c536c4ccc5b865fb2b7a6c685c31c8652c 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Quote/Collection.php +++ b/app/code/core/Mage/Sales/Model/Resource/Quote/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Quote/Item.php b/app/code/core/Mage/Sales/Model/Resource/Quote/Item.php index a89129a8020cc4152c50a6fe85026e71ed4aaa7f..b9555fbf7ac6360ee366e3a327cca4b783735c00 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Quote/Item.php +++ b/app/code/core/Mage/Sales/Model/Resource/Quote/Item.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Quote/Item/Collection.php b/app/code/core/Mage/Sales/Model/Resource/Quote/Item/Collection.php index 4c94607c384bec41a754d3163b179011a5961b0e..feff8e26f61b3563624b2078e47cdc0bdc022685 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Quote/Item/Collection.php +++ b/app/code/core/Mage/Sales/Model/Resource/Quote/Item/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Quote/Item/Option.php b/app/code/core/Mage/Sales/Model/Resource/Quote/Item/Option.php index ff6533156a4ab05b09aec4f8a89d9b789a113ec5..7d52f42d8315f9b6250b67dcb58efa76ab3e15ca 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Quote/Item/Option.php +++ b/app/code/core/Mage/Sales/Model/Resource/Quote/Item/Option.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Quote/Item/Option/Collection.php b/app/code/core/Mage/Sales/Model/Resource/Quote/Item/Option/Collection.php index 6dd0832735df99863741c687a9d53457a1e0aa51..adecbcb3cae646df463eb0870d78ed137fce8839 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Quote/Item/Option/Collection.php +++ b/app/code/core/Mage/Sales/Model/Resource/Quote/Item/Option/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Quote/Payment.php b/app/code/core/Mage/Sales/Model/Resource/Quote/Payment.php index 25670eda367f4d36027269c7cd0861cdb47ba203..c741ef65bc8f9035dcbadcb14728da833c0ceebd 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Quote/Payment.php +++ b/app/code/core/Mage/Sales/Model/Resource/Quote/Payment.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Quote/Payment/Collection.php b/app/code/core/Mage/Sales/Model/Resource/Quote/Payment/Collection.php index 06eb61110589ac74ab8173edb9c08415cb3579fb..2b2229db0549f7254f855b90cb91a9df580d6cd0 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Quote/Payment/Collection.php +++ b/app/code/core/Mage/Sales/Model/Resource/Quote/Payment/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Recurring/Profile.php b/app/code/core/Mage/Sales/Model/Resource/Recurring/Profile.php index b00d6662058e0338dd9bb1555290f7a6e915be3f..3c25b1e1b0cb032bf8cb6629b2dc8ed3d00a3f36 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Recurring/Profile.php +++ b/app/code/core/Mage/Sales/Model/Resource/Recurring/Profile.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Recurring/Profile/Collection.php b/app/code/core/Mage/Sales/Model/Resource/Recurring/Profile/Collection.php index db7aa7ebefada6441721e7f29973d631e65285b1..876c615fb2cc59d0b2c1f3dc6f1fd6002e3bbaa0 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Recurring/Profile/Collection.php +++ b/app/code/core/Mage/Sales/Model/Resource/Recurring/Profile/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Report.php b/app/code/core/Mage/Sales/Model/Resource/Report.php index e010dc4d64d7dd43ec3dff2327586179fdd3ff75..d6b45d204d3d2a0a91015570f781384e62097cf5 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Report.php +++ b/app/code/core/Mage/Sales/Model/Resource/Report.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Report/Abstract.php b/app/code/core/Mage/Sales/Model/Resource/Report/Abstract.php index 1db59e0a596b13b3e0d395c204a3af42deb1cad9..a7659657429678dc0eee9202b75d6c602ad4d657 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Report/Abstract.php +++ b/app/code/core/Mage/Sales/Model/Resource/Report/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Report/Bestsellers.php b/app/code/core/Mage/Sales/Model/Resource/Report/Bestsellers.php index a45b4cda6e6f853188fe6d746bdf354d3f63c7b1..1f5bc45a75a95b91275f28a6ec1889e4a432df2d 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Report/Bestsellers.php +++ b/app/code/core/Mage/Sales/Model/Resource/Report/Bestsellers.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Report/Bestsellers/Collection.php b/app/code/core/Mage/Sales/Model/Resource/Report/Bestsellers/Collection.php index 54489b2952403da79a2696b730694a068f70aa6d..03c40dd6d24d4470c04da88bb3eef5a8e18c7382 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Report/Bestsellers/Collection.php +++ b/app/code/core/Mage/Sales/Model/Resource/Report/Bestsellers/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -111,7 +111,7 @@ class Mage_Sales_Model_Resource_Report_Bestsellers_Collection ->where('period >= ?', $from) ->where('period <= ?', $to) ->group('product_id') - ->order('qty_ordered') + ->order('qty_ordered DESC') ->limit($this->_ratingLimit); $this->_applyStoresFilterToSelect($sel); @@ -219,7 +219,6 @@ class Mage_Sales_Model_Resource_Report_Bestsellers_Collection parent::_beforeLoad(); $this->_applyStoresFilter(); - $this->_applyDateRangeFilter(); if ($this->_period) { // @@ -343,6 +342,8 @@ class Mage_Sales_Model_Resource_Report_Bestsellers_Collection } + $this->_applyDateRangeFilter(); + // add unions to select if ($selectUnions) { $unionParts = array(); diff --git a/app/code/core/Mage/Sales/Model/Resource/Report/Collection/Abstract.php b/app/code/core/Mage/Sales/Model/Resource/Report/Collection/Abstract.php index 94a2add2cafffcda251d3fed50322727d7fef4a5..156695746a33ec6b68d4c98fdab533a06727171c 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Report/Collection/Abstract.php +++ b/app/code/core/Mage/Sales/Model/Resource/Report/Collection/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -32,22 +32,9 @@ * @package Mage_Sales * @author Magento Core Team <core@magentocommerce.com> */ -class Mage_Sales_Model_Resource_Report_Collection_Abstract extends Mage_Core_Model_Resource_Db_Collection_Abstract +class Mage_Sales_Model_Resource_Report_Collection_Abstract + extends Mage_Reports_Model_Resource_Report_Collection_Abstract { - /** - * From date - * - * @var string - */ - protected $_from = null; - - /** - * To date - * - * @var string - */ - protected $_to = null; - /** * Order status * @@ -55,169 +42,6 @@ class Mage_Sales_Model_Resource_Report_Collection_Abstract extends Mage_Core_Mod */ protected $_orderStatus = null; - /** - * Period - * - * @var string - */ - protected $_period = null; - - /** - * Store ids - * - * @var int|array - */ - protected $_storesIds = 0; - - /** - * Does filters should be applied - * - * @var bool - */ - protected $_applyFilters = true; - - /** - * Is totals - * - * @var bool - */ - protected $_isTotals = false; - - /** - * Is subtotals - * - * @var bool - */ - protected $_isSubTotals = false; - - /** - * Aggregated columns - * - * @var array - */ - protected $_aggregatedColumns = array(); - - /** - * Set array of columns that should be aggregated - * - * @param array $columns - * @return Mage_Sales_Model_Resource_Report_Collection_Abstract - */ - public function setAggregatedColumns(array $columns) - { - $this->_aggregatedColumns = $columns; - return $this; - } - - /** - * Retrieve array of columns that should be aggregated - * - * @return array - */ - public function getAggregatedColumns() - { - return $this->_aggregatedColumns; - } - - /** - * Set date range - * - * @param mixed $from - * @param mixed $to - * @return Mage_Sales_Model_Resource_Report_Collection_Abstract - */ - public function setDateRange($from = null, $to = null) - { - $this->_from = $from; - $this->_to = $to; - return $this; - } - - /** - * Set period - * - * @param string $period - * @return Mage_Sales_Model_Resource_Report_Collection_Abstract - */ - public function setPeriod($period) - { - $this->_period = $period; - return $this; - } - - /** - * Apply date range filter - * - * @return Mage_Sales_Model_Resource_Report_Collection_Abstract - */ - protected function _applyDateRangeFilter() - { - // Remember that field PERIOD is a DATE(YYYY-MM-DD) in all databases - if ($this->_from !== null) { - $this->getSelect()->where('period >= ?', $this->_from); - } - if ($this->_to !== null) { - $this->getSelect()->where('period <= ?', $this->_to); - } - - return $this; - } - - /** - * Set store ids - * - * @param mixed $storeIds (null, int|string, array, array may contain null) - * @return Mage_Sales_Model_Resource_Report_Collection_Abstract - */ - public function addStoreFilter($storeIds) - { - $this->_storesIds = $storeIds; - return $this; - } - - /** - * Apply stores filter to select object - * - * @param Zend_Db_Select $select - * @return Mage_Sales_Model_Resource_Report_Collection_Abstract - */ - protected function _applyStoresFilterToSelect(Zend_Db_Select $select) - { - $nullCheck = false; - $storeIds = $this->_storesIds; - - if (!is_array($storeIds)) { - $storeIds = array($storeIds); - } - - $storeIds = array_unique($storeIds); - - if ($index = array_search(null, $storeIds)) { - unset($storeIds[$index]); - $nullCheck = true; - } - - $storeIds[0] = ($storeIds[0] == '') ? 0 : $storeIds[0]; - - if ($nullCheck) { - $select->where('store_id IN(?) OR store_id IS NULL', $storeIds); - } else { - $select->where('store_id IN(?)', $storeIds); - } - - return $this; - } - - /** - * Apply stores filter - * - * @return Mage_Sales_Model_Resource_Report_Collection_Abstract - */ - protected function _applyStoresFilter() - { - return $this->_applyStoresFilterToSelect($this->getSelect()); - } - /** * Set status filter * @@ -249,66 +73,12 @@ class Mage_Sales_Model_Resource_Report_Collection_Abstract extends Mage_Core_Mod } /** - * Set apply filters flag - * - * @param boolean $flag - * @return Mage_Sales_Model_Resource_Report_Collection_Abstract - */ - public function setApplyFilters($flag) - { - $this->_applyFilters = $flag; - return $this; - } - - /** - * Getter/Setter for isTotals - * - * @param null|boolean $flag - * @return Mage_Sales_Model_Resource_Report_Collection_Abstract - */ - public function isTotals($flag = null) - { - if (is_null($flag)) { - return $this->_isTotals; - } - $this->_isTotals = $flag; - return $this; - } - - /** - * Getter/Setter for isSubTotals + * Order status filter is custom for this collection * - * @param null|boolean $flag * @return Mage_Sales_Model_Resource_Report_Collection_Abstract */ - public function isSubTotals($flag = null) + protected function _applyCustomFilter() { - if (is_null($flag)) { - return $this->_isSubTotals; - } - $this->_isSubTotals = $flag; - return $this; - } - - /** - * Load data - * Redeclare parent load method just for adding method _beforeLoad - * - * @param bool $printQuery - * @param bool $logQuery - * @return Mage_Sales_Model_Resource_Report_Collection_Abstract - */ - public function load($printQuery = false, $logQuery = false) - { - if ($this->isLoaded()) { - return $this; - } - $this->_initSelect(); - if ($this->_applyFilters) { - $this->_applyDateRangeFilter(); - $this->_applyStoresFilter(); - $this->_applyOrderStatusFilter(); - } - return parent::load($printQuery, $logQuery); + return $this->_applyOrderStatusFilter(); } -} +} \ No newline at end of file diff --git a/app/code/core/Mage/Sales/Model/Resource/Report/Invoiced.php b/app/code/core/Mage/Sales/Model/Resource/Report/Invoiced.php index 391abe6bb195193ce1cd583ce07a6b9bc4cb015f..f08a97e1f5943533cde8189c1830c8f4a11e8057 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Report/Invoiced.php +++ b/app/code/core/Mage/Sales/Model/Resource/Report/Invoiced.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Report/Invoiced/Collection/Invoiced.php b/app/code/core/Mage/Sales/Model/Resource/Report/Invoiced/Collection/Invoiced.php index 03c444b6eb9f155b96e8ec16e8f55d1ecd843242..3a6ccc7184f0a2afe8b9fb267b12bb6b6f02dcc5 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Report/Invoiced/Collection/Invoiced.php +++ b/app/code/core/Mage/Sales/Model/Resource/Report/Invoiced/Collection/Invoiced.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Report/Invoiced/Collection/Order.php b/app/code/core/Mage/Sales/Model/Resource/Report/Invoiced/Collection/Order.php index 43bcf72b8ba174efcc1039cfc47c8c34d52c8821..89efb2296ad0ff837b4ecae183bfbb2c9a4ebcfd 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Report/Invoiced/Collection/Order.php +++ b/app/code/core/Mage/Sales/Model/Resource/Report/Invoiced/Collection/Order.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Report/Order.php b/app/code/core/Mage/Sales/Model/Resource/Report/Order.php index cb8b8f3548759dc67ea13e71beb284e87021f913..22537437612d542408801923d92bbaacbe26d2a9 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Report/Order.php +++ b/app/code/core/Mage/Sales/Model/Resource/Report/Order.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Report/Order/Collection.php b/app/code/core/Mage/Sales/Model/Resource/Report/Order/Collection.php index 4ba1054caa61262ad66e0948c3886ac07524e72c..2c94f4f92b3a59ede3f7398c28dcffd2cb0b8ac4 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Report/Order/Collection.php +++ b/app/code/core/Mage/Sales/Model/Resource/Report/Order/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Report/Order/Createdat.php b/app/code/core/Mage/Sales/Model/Resource/Report/Order/Createdat.php index 15c814c3288944b9b6c8ae78f2e2ac2b4ad0682e..ab12e77f8338832a664046edf358c8645bf7d23d 100644 --- a/app/code/core/Mage/Sales/Model/Resource/Report/Order/Createdat.php +++ b/app/code/core/Mage/Sales/Model/Resource/Report/Order/Createdat.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Report/Order/Updatedat.php b/app/code/core/Mage/Sales/Model/Resource/Report/Order/Updatedat.php index 6b7f4b73290141fe82af331b45a1ae6b95b5fa58..dd975b8a58766a3d1e7770a2f02ce0d63a81e3f6 100644 --- a/app/code/core/Mage/Sales/Model/Resource/Report/Order/Updatedat.php +++ b/app/code/core/Mage/Sales/Model/Resource/Report/Order/Updatedat.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Report/Order/Updatedat/Collection.php b/app/code/core/Mage/Sales/Model/Resource/Report/Order/Updatedat/Collection.php index abed4a43a5a5f62afd9a8d41cd884ae74987d04c..0f223b98c3300117492123d367eded60452ebb68 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Report/Order/Updatedat/Collection.php +++ b/app/code/core/Mage/Sales/Model/Resource/Report/Order/Updatedat/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Report/Refunded.php b/app/code/core/Mage/Sales/Model/Resource/Report/Refunded.php index a52c19f01ea60a3155042cd6da626ed3dfa21ea6..0b43b13d3ac8cf1d447bce06cc4c179c3728a52f 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Report/Refunded.php +++ b/app/code/core/Mage/Sales/Model/Resource/Report/Refunded.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Report/Refunded/Collection/Order.php b/app/code/core/Mage/Sales/Model/Resource/Report/Refunded/Collection/Order.php index 997e16b79916c172d32e607a3cc4f11fc21a1eff..eb07e4600c489448fa0dd666cf26deb65c0c1e40 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Report/Refunded/Collection/Order.php +++ b/app/code/core/Mage/Sales/Model/Resource/Report/Refunded/Collection/Order.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Report/Refunded/Collection/Refunded.php b/app/code/core/Mage/Sales/Model/Resource/Report/Refunded/Collection/Refunded.php index 1b673ff61766c9ef97db93a7435cad51e440f4a1..c6d804bb64e1a670d09c5ad49725ef34971456a3 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Report/Refunded/Collection/Refunded.php +++ b/app/code/core/Mage/Sales/Model/Resource/Report/Refunded/Collection/Refunded.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Report/Shipping.php b/app/code/core/Mage/Sales/Model/Resource/Report/Shipping.php index 263014be56d5445d6de21818cf5715280cda1754..1499ab27d394740c341f14b370c63ec5f4dbfe3e 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Report/Shipping.php +++ b/app/code/core/Mage/Sales/Model/Resource/Report/Shipping.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Report/Shipping/Collection/Order.php b/app/code/core/Mage/Sales/Model/Resource/Report/Shipping/Collection/Order.php index 525fdbdd45dd9baf7a6439e355fa49f51cdc4d6d..b64a3d0d40220ddf94498f0de25de29eb12c5455 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Report/Shipping/Collection/Order.php +++ b/app/code/core/Mage/Sales/Model/Resource/Report/Shipping/Collection/Order.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Report/Shipping/Collection/Shipment.php b/app/code/core/Mage/Sales/Model/Resource/Report/Shipping/Collection/Shipment.php index 488605d1834c197580b217cf589a045e1623c43a..180b7be3d62e8299307fae1b672fb080d572890b 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Report/Shipping/Collection/Shipment.php +++ b/app/code/core/Mage/Sales/Model/Resource/Report/Shipping/Collection/Shipment.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Sale/Collection.php b/app/code/core/Mage/Sales/Model/Resource/Sale/Collection.php index 4c2bd0b57cf56dd19cd94550c41598184a51b0d7..e11c04f0f45bbbf303603b5750ebbced10395017 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Sale/Collection.php +++ b/app/code/core/Mage/Sales/Model/Resource/Sale/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Resource/Setup.php b/app/code/core/Mage/Sales/Model/Resource/Setup.php index e2c027a5ec7b45e34c49a16186b2f6a9a88fa0f0..0b3f387ce31ff16614aae8fd6f8a2124a5417b5b 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Setup.php +++ b/app/code/core/Mage/Sales/Model/Resource/Setup.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Service/Order.php b/app/code/core/Mage/Sales/Model/Service/Order.php index 7e68e5d4f3da803318bf0b566758586946de50ec..27d0559581875fa7c383f3c0c367068d51767db5 100644 --- a/app/code/core/Mage/Sales/Model/Service/Order.php +++ b/app/code/core/Mage/Sales/Model/Service/Order.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/Model/Service/Quote.php b/app/code/core/Mage/Sales/Model/Service/Quote.php index 149349076591b96a9f1defd749595d05a7b35b78..61a7aafa10d85d1fe4cb0184b1a976cf1427aea7 100644 --- a/app/code/core/Mage/Sales/Model/Service/Quote.php +++ b/app/code/core/Mage/Sales/Model/Service/Quote.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -279,31 +279,30 @@ class Mage_Sales_Model_Service_Quote */ protected function _validate() { - $helper = Mage::helper('Mage_Sales_Helper_Data'); if (!$this->getQuote()->isVirtual()) { $address = $this->getQuote()->getShippingAddress(); $addressValidation = $address->validate(); if ($addressValidation !== true) { Mage::throwException( - $helper->__('Please check shipping address information. %s', implode(' ', $addressValidation)) + Mage::helper('Mage_Sales_Helper_Data')->__('Please check shipping address information. %s', implode(' ', $addressValidation)) ); } $method= $address->getShippingMethod(); $rate = $address->getShippingRateByCode($method); if (!$this->getQuote()->isVirtual() && (!$method || !$rate)) { - Mage::throwException($helper->__('Please specify a shipping method.')); + Mage::throwException(Mage::helper('Mage_Sales_Helper_Data')->__('Please specify a shipping method.')); } } $addressValidation = $this->getQuote()->getBillingAddress()->validate(); if ($addressValidation !== true) { Mage::throwException( - $helper->__('Please check billing address information. %s', implode(' ', $addressValidation)) + Mage::helper('Mage_Sales_Helper_Data')->__('Please check billing address information. %s', implode(' ', $addressValidation)) ); } if (!($this->getQuote()->getPayment()->getMethod())) { - Mage::throwException($helper->__('Please select a valid payment method.')); + Mage::throwException(Mage::helper('Mage_Sales_Helper_Data')->__('Please select a valid payment method.')); } return $this; diff --git a/app/code/core/Mage/Sales/Model/Status/List.php b/app/code/core/Mage/Sales/Model/Status/List.php index b32fabb6aecb05ba15669e8fa48d6b503ae6650c..b22c4ecbd5d8c41d43dc0744ab6abdae8c987d8e 100644 --- a/app/code/core/Mage/Sales/Model/Status/List.php +++ b/app/code/core/Mage/Sales/Model/Status/List.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/controllers/Billing/AgreementController.php b/app/code/core/Mage/Sales/controllers/Billing/AgreementController.php index 0a61662da1f68fa1b09afc3c577fa06cf892e9e3..123b22766617a05fc768f03c119e83e7b6796fe1 100644 --- a/app/code/core/Mage/Sales/controllers/Billing/AgreementController.php +++ b/app/code/core/Mage/Sales/controllers/Billing/AgreementController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/controllers/DownloadController.php b/app/code/core/Mage/Sales/controllers/DownloadController.php index b1e0ad029240cc56991d8b6f3544b1ff407bc67d..e29b32ff110d25a9cfc1b976a72aa3e2113271c5 100644 --- a/app/code/core/Mage/Sales/controllers/DownloadController.php +++ b/app/code/core/Mage/Sales/controllers/DownloadController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/controllers/GuestController.php b/app/code/core/Mage/Sales/controllers/GuestController.php index 422b4f099475361512f9a709eac5cefb8dc49556..67bdf32c0007dd302cbaf852ca6b0efcb7364460 100644 --- a/app/code/core/Mage/Sales/controllers/GuestController.php +++ b/app/code/core/Mage/Sales/controllers/GuestController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/controllers/OrderController.php b/app/code/core/Mage/Sales/controllers/OrderController.php index a5401350c11ff8394902c3eb6da681d959d4932f..16440ca10296db825b1f0272ac7da7ede947d8c5 100644 --- a/app/code/core/Mage/Sales/controllers/OrderController.php +++ b/app/code/core/Mage/Sales/controllers/OrderController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/controllers/Recurring/ProfileController.php b/app/code/core/Mage/Sales/controllers/Recurring/ProfileController.php index 9866fedf18042d71fcba537673563f58f52e7634..40460c2e27eb49ca4299a419d115121c64fecd41 100644 --- a/app/code/core/Mage/Sales/controllers/Recurring/ProfileController.php +++ b/app/code/core/Mage/Sales/controllers/Recurring/ProfileController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/data/sales_setup/data-install-1.6.0.0.php b/app/code/core/Mage/Sales/data/sales_setup/data-install-1.6.0.0.php index ca96dfa848413aad74f61260cf05bb37dd39487e..0a09fd5c53ac09c07c324d33777771cc306c156b 100644 --- a/app/code/core/Mage/Sales/data/sales_setup/data-install-1.6.0.0.php +++ b/app/code/core/Mage/Sales/data/sales_setup/data-install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/data/sales_setup/data-upgrade-1.6.0.4-1.6.0.5.php b/app/code/core/Mage/Sales/data/sales_setup/data-upgrade-1.6.0.4-1.6.0.5.php new file mode 100644 index 0000000000000000000000000000000000000000..18d9c4a4b81bea633131b48ebe789ebcaab43fcf --- /dev/null +++ b/app/code/core/Mage/Sales/data/sales_setup/data-upgrade-1.6.0.4-1.6.0.5.php @@ -0,0 +1,76 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Sales + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** @var $installer Mage_Sales_Model_Resource_Setup */ +$installer = $this; + +$subSelect = $installer->getConnection()->select() + ->from( + array('citem' => $installer->getTable('sales_flat_creditmemo_item')), + array( + 'amount_refunded' => 'SUM(citem.row_total)', + 'base_amount_refunded' => 'SUM(citem.base_row_total)', + 'base_tax_refunded' => 'SUM(citem.base_tax_amount)', + 'discount_refunded' => 'SUM(citem.discount_amount)', + 'base_discount_refunded' => 'SUM(citem.base_discount_amount)', + ) + ) + ->joinLeft( + array('c' => $installer->getTable('sales_flat_creditmemo')), + 'c.entity_id = citem.parent_id', + array() + ) + ->joinLeft( + array('o' => $installer->getTable('sales_flat_order')), + 'o.entity_id = c.order_id', + array() + ) + ->joinLeft( + array('oitem' => $installer->getTable('sales_flat_order_item')), + 'oitem.order_id = o.entity_id AND oitem.product_id=citem.product_id', + array('item_id') + ) + ->group('oitem.item_id'); + +$select = $installer->getConnection()->select() + ->from( + array('selected' => $subSelect), + array( + 'amount_refunded' => 'amount_refunded', + 'base_amount_refunded' => 'base_amount_refunded', + 'base_tax_refunded' => 'base_tax_refunded', + 'discount_refunded' => 'discount_refunded', + 'base_discount_refunded' => 'base_discount_refunded', + ) + ) + ->where('main.item_id = selected.item_id'); + +$updateQuery = $installer->getConnection()->updateFromSelect( + $select, + array('main' => $installer->getTable('sales_flat_order_item')) +); + +$installer->getConnection()->query($updateQuery); diff --git a/app/code/core/Mage/Sales/etc/adminhtml.xml b/app/code/core/Mage/Sales/etc/adminhtml.xml index c27cb4e81fbc0bee510415591071a0f7b2a45672..12d955d6f8d99516c2cb5c427c72b946950cf2e6 100644 --- a/app/code/core/Mage/Sales/etc/adminhtml.xml +++ b/app/code/core/Mage/Sales/etc/adminhtml.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Sales/etc/api.xml b/app/code/core/Mage/Sales/etc/api.xml index d784a4ecf5fefaf6dd279041ff837a692eb0d46c..ec9856c35b6bab078206cee27869cf6df5bbcfea 100644 --- a/app/code/core/Mage/Sales/etc/api.xml +++ b/app/code/core/Mage/Sales/etc/api.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Sales/etc/config.xml b/app/code/core/Mage/Sales/etc/config.xml index 8a447968a902d7d874ab81bce177408b306c3085..4bdc265eddba6af57193f91ea4b227520a885cc1 100644 --- a/app/code/core/Mage/Sales/etc/config.xml +++ b/app/code/core/Mage/Sales/etc/config.xml @@ -21,14 +21,14 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> <config> <modules> <Mage_Sales> - <version>1.6.0.4</version> + <version>1.6.0.7</version> </Mage_Sales> </modules> <global> @@ -399,6 +399,16 @@ </grand_total> </totals> </pdf> + <events> + <sales_order_place_after> + <observers> + <sales_vat_request_params_order_comment> + <class>Mage_Sales_Model_Observer</class> + <method>addVatRequestParamsOrderComment</method> + </sales_vat_request_params_order_comment> + </observers> + </sales_order_place_after> + </events> </global> <frontend> <secure_url> @@ -436,6 +446,22 @@ </updates> </layout> <events> + <sales_quote_address_collect_totals_before> + <observers> + <sales_customer_validate_vat_number> + <class>Mage_Sales_Model_Observer</class> + <method>changeQuoteCustomerGroupId</method> + </sales_customer_validate_vat_number> + </observers> + </sales_quote_address_collect_totals_before> + <sales_quote_address_collect_totals_after> + <observers> + <sales_customer_validate_vat_number> + <class>Mage_Sales_Model_Observer</class> + <method>restoreQuoteCustomerGroupId</method> + </sales_customer_validate_vat_number> + </observers> + </sales_quote_address_collect_totals_after> <sales_quote_collect_totals_after> <observers> <catalog_msrp> diff --git a/app/code/core/Mage/Sales/etc/fieldset.xml b/app/code/core/Mage/Sales/etc/fieldset.xml index f82bc049809aa61943ea169b59617aad30487c7d..72445ec6b002214e41ba3bd079a0d7626059bee0 100644 --- a/app/code/core/Mage/Sales/etc/fieldset.xml +++ b/app/code/core/Mage/Sales/etc/fieldset.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Sales/etc/system.xml b/app/code/core/Mage/Sales/etc/system.xml index c9301d35ab6e741e6d90785586dc79c1dc31afa0..307e8846299d506462cdaa9fa424324c5516be53 100644 --- a/app/code/core/Mage/Sales/etc/system.xml +++ b/app/code/core/Mage/Sales/etc/system.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Sales/etc/widget.xml b/app/code/core/Mage/Sales/etc/widget.xml index f26101dfde9872c3b63979eef1f6d9a5cc4172ba..c8eb0aa15695ab5bcda5326dc94f59f09dad3dc6 100644 --- a/app/code/core/Mage/Sales/etc/widget.xml +++ b/app/code/core/Mage/Sales/etc/widget.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Sales/sql/sales_setup/install-1.6.0.0.php b/app/code/core/Mage/Sales/sql/sales_setup/install-1.6.0.0.php index 7e4e966bb4953808210969308e9ea0287d0c8d1e..ff8e9d711e403f77fda644381b19c9fb61e12b4a 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/upgrade-1.6.0.0-1.6.0.1.php b/app/code/core/Mage/Sales/sql/sales_setup/upgrade-1.6.0.0-1.6.0.1.php index b8f2a9d167c28e33845838d61c737f429fefa425..4157327df39a07d73912b98c84f9216cbd96734b 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/upgrade-1.6.0.0-1.6.0.1.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/upgrade-1.6.0.0-1.6.0.1.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/upgrade-1.6.0.1-1.6.0.2.php b/app/code/core/Mage/Sales/sql/sales_setup/upgrade-1.6.0.1-1.6.0.2.php index 8079806245620336e3a1dabb292503aed2f6cdc2..09d5c540a34ac74ea8e2d34ee9b684bfb1b959c8 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/upgrade-1.6.0.1-1.6.0.2.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/upgrade-1.6.0.1-1.6.0.2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/upgrade-1.6.0.2-1.6.0.3.php b/app/code/core/Mage/Sales/sql/sales_setup/upgrade-1.6.0.2-1.6.0.3.php index 39d53819ee04501d8f524c1e1b9034ba1acd8658..b149adde9996b4b80929b8830a2ede6c9da092ac 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/upgrade-1.6.0.2-1.6.0.3.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/upgrade-1.6.0.2-1.6.0.3.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/upgrade-1.6.0.3-1.6.0.4.php b/app/code/core/Mage/Sales/sql/sales_setup/upgrade-1.6.0.3-1.6.0.4.php index 431140fe81f6b7148071e0fdd5a975d7ada1edd1..641ebb13d4cc548de108d075e06af139f9a5d417 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/upgrade-1.6.0.3-1.6.0.4.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/upgrade-1.6.0.3-1.6.0.4.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sales - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sales/sql/sales_setup/upgrade-1.6.0.4-1.6.0.5.php b/app/code/core/Mage/Sales/sql/sales_setup/upgrade-1.6.0.4-1.6.0.5.php new file mode 100644 index 0000000000000000000000000000000000000000..effc49378de104f40023bf16f47da71609191dd1 --- /dev/null +++ b/app/code/core/Mage/Sales/sql/sales_setup/upgrade-1.6.0.4-1.6.0.5.php @@ -0,0 +1,49 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Sales + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/* @var $installer Mage_Sales_Model_Resource_Setup */ +$installer = $this; +$installer->getConnection() + ->addColumn($installer->getTable('sales_flat_order_item'), 'base_tax_refunded', array( + 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, + 'comment' => 'Base Tax Refunded', + 'scale' => 4, + 'precision' => 12, + )); +$installer->getConnection() + ->addColumn($installer->getTable('sales_flat_order_item'), 'discount_refunded', array( + 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, + 'comment' => 'Discount Refunded', + 'scale' => 4, + 'precision' => 12, + )); +$installer->getConnection() + ->addColumn($installer->getTable('sales_flat_order_item'), 'base_discount_refunded', array( + 'type' => Varien_Db_Ddl_Table::TYPE_DECIMAL, + 'comment' => 'Base Discount Refunded', + 'scale' => 4, + 'precision' => 12, + )); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/upgrade-1.6.0.5-1.6.0.6.php b/app/code/core/Mage/Sales/sql/sales_setup/upgrade-1.6.0.5-1.6.0.6.php new file mode 100644 index 0000000000000000000000000000000000000000..f909aab42c9d4aa9cde3174d00c793569e4306ad --- /dev/null +++ b/app/code/core/Mage/Sales/sql/sales_setup/upgrade-1.6.0.5-1.6.0.6.php @@ -0,0 +1,47 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Sales + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/* @var $installer Mage_Sales_Model_Resource_Setup */ +$installer = $this; + +$entitiesToAlter = array( + 'quote_address', + 'order_address' +); + +$attributes = array( + 'vat_id' => array('type' => Varien_Db_Ddl_Table::TYPE_TEXT), + 'vat_is_valid' => array('type' => Varien_Db_Ddl_Table::TYPE_SMALLINT), + 'vat_request_id' => array('type' => Varien_Db_Ddl_Table::TYPE_TEXT), + 'vat_request_date' => array('type' => Varien_Db_Ddl_Table::TYPE_TEXT), + 'vat_request_success' => array('type' => Varien_Db_Ddl_Table::TYPE_SMALLINT) +); + +foreach ($entitiesToAlter as $entityName) { + foreach ($attributes as $attributeCode => $attributeParams) { + $installer->addAttribute($entityName, $attributeCode, $attributeParams); + } +} diff --git a/app/code/core/Mage/Sales/sql/sales_setup/upgrade-1.6.0.6-1.6.0.7.php b/app/code/core/Mage/Sales/sql/sales_setup/upgrade-1.6.0.6-1.6.0.7.php new file mode 100644 index 0000000000000000000000000000000000000000..d50b282b31a9c5e10ab259d5733979057740af08 --- /dev/null +++ b/app/code/core/Mage/Sales/sql/sales_setup/upgrade-1.6.0.6-1.6.0.7.php @@ -0,0 +1,36 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Sales + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/* @var $installer Mage_Sales_Model_Resource_Setup */ +$installer = $this; + +$installer->getConnection() + ->addColumn($installer->getTable('sales_flat_order'), 'coupon_rule_name', array( + 'TYPE' => Varien_Db_Ddl_Table::TYPE_TEXT, + 'LENGTH' => 255, + 'NULLABLE' => true, + 'COMMENT' => 'Coupon Sales Rule Name' + )); diff --git a/app/code/core/Mage/Sales/view/adminhtml/billing/agreement/form.phtml b/app/code/core/Mage/Sales/view/adminhtml/billing/agreement/form.phtml index c811ef03d3aaee9a681fdec979104931e3ba17da..949d311e5efbc9246b543d42935aa71319270f96 100644 --- a/app/code/core/Mage/Sales/view/adminhtml/billing/agreement/form.phtml +++ b/app/code/core/Mage/Sales/view/adminhtml/billing/agreement/form.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Sales/view/adminhtml/billing/agreement/view/form.phtml b/app/code/core/Mage/Sales/view/adminhtml/billing/agreement/view/form.phtml index d8c5e1d2488d78ccf5073d91809faf860bac7f3c..ef6f4b2eaecf37b33af839aafbac1735b67ae884 100644 --- a/app/code/core/Mage/Sales/view/adminhtml/billing/agreement/view/form.phtml +++ b/app/code/core/Mage/Sales/view/adminhtml/billing/agreement/view/form.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Sales/view/adminhtml/billing/agreement/view/tab/info.phtml b/app/code/core/Mage/Sales/view/adminhtml/billing/agreement/view/tab/info.phtml index 105cd6465000c0b929895d20e94dff81b010409a..11468297fe67e823933a66a99c0c446051313971 100644 --- a/app/code/core/Mage/Sales/view/adminhtml/billing/agreement/view/tab/info.phtml +++ b/app/code/core/Mage/Sales/view/adminhtml/billing/agreement/view/tab/info.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Sales/view/adminhtml/payment/form/billing/agreement.phtml b/app/code/core/Mage/Sales/view/adminhtml/payment/form/billing/agreement.phtml index 20deed0b7fe9a3f4cdae94f7aab458e60b32acfe..1a08f00659e29635b995b0da0b460c6aade934d4 100644 --- a/app/code/core/Mage/Sales/view/adminhtml/payment/form/billing/agreement.phtml +++ b/app/code/core/Mage/Sales/view/adminhtml/payment/form/billing/agreement.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Sales/view/adminhtml/recurring/profile/view.phtml b/app/code/core/Mage/Sales/view/adminhtml/recurring/profile/view.phtml index 37bdcf1d14d8edad215d24c7058104bf77e2910f..f749b6cc4d478c87dd72f3160f06db760ed7e5e7 100644 --- a/app/code/core/Mage/Sales/view/adminhtml/recurring/profile/view.phtml +++ b/app/code/core/Mage/Sales/view/adminhtml/recurring/profile/view.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Sales/view/adminhtml/recurring/profile/view/info.phtml b/app/code/core/Mage/Sales/view/adminhtml/recurring/profile/view/info.phtml index 83ac0370639bd535279c918b3847f1eeed693b90..45585d7dfcfb05797b39d781f268eea3b866f507 100644 --- a/app/code/core/Mage/Sales/view/adminhtml/recurring/profile/view/info.phtml +++ b/app/code/core/Mage/Sales/view/adminhtml/recurring/profile/view/info.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Sales/view/frontend/billing/agreement/view.phtml b/app/code/core/Mage/Sales/view/frontend/billing/agreement/view.phtml index 5a4ce6e08e0d554173e00251279329f98f284836..ead40558b5f3186038bccc14b22ab79b761b811c 100644 --- a/app/code/core/Mage/Sales/view/frontend/billing/agreement/view.phtml +++ b/app/code/core/Mage/Sales/view/frontend/billing/agreement/view.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Sales/view/frontend/billing/agreements.phtml b/app/code/core/Mage/Sales/view/frontend/billing/agreements.phtml index 4627edb657a921e27a6fd8861d86627a312f5df7..b66b05025a867f37d2d12e7c070aa1229c687f49 100644 --- a/app/code/core/Mage/Sales/view/frontend/billing/agreements.phtml +++ b/app/code/core/Mage/Sales/view/frontend/billing/agreements.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Sales/view/frontend/billing_agreement.xml b/app/code/core/Mage/Sales/view/frontend/billing_agreement.xml index ba6b2bbc2337cf71cd3ffaf81ada2d399a06cb6e..2178e685135f52658cc4538799357b4f7376f315 100644 --- a/app/code/core/Mage/Sales/view/frontend/billing_agreement.xml +++ b/app/code/core/Mage/Sales/view/frontend/billing_agreement.xml @@ -21,7 +21,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/Sales/view/frontend/email/creditmemo/items.phtml b/app/code/core/Mage/Sales/view/frontend/email/creditmemo/items.phtml index c304e68453fca19ff5c2dd0f99597eabb7764b40..962c21bc415677186c78bacb01b9c44da20bff3f 100644 --- a/app/code/core/Mage/Sales/view/frontend/email/creditmemo/items.phtml +++ b/app/code/core/Mage/Sales/view/frontend/email/creditmemo/items.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Sales/view/frontend/email/invoice/items.phtml b/app/code/core/Mage/Sales/view/frontend/email/invoice/items.phtml index 17b8bbc8e344b505a7ba085e7fc40abd633b1274..83c79ead464e6a3164d5c2127c030d412c9bd04a 100644 --- a/app/code/core/Mage/Sales/view/frontend/email/invoice/items.phtml +++ b/app/code/core/Mage/Sales/view/frontend/email/invoice/items.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Sales/view/frontend/email/items.phtml b/app/code/core/Mage/Sales/view/frontend/email/items.phtml index 1fd797510c75f04d97342a098decec07459df0f6..b92a5788128de793214aba850e119ab4e6fb76ec 100644 --- a/app/code/core/Mage/Sales/view/frontend/email/items.phtml +++ b/app/code/core/Mage/Sales/view/frontend/email/items.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Sales/view/frontend/email/items/creditmemo/default.phtml b/app/code/core/Mage/Sales/view/frontend/email/items/creditmemo/default.phtml index 5dab6dd48f64bb1e03b037b5a5097eb4ff75dbb9..6edfa17cd746c530f57aac9fb3538424f4b3e4f3 100644 --- a/app/code/core/Mage/Sales/view/frontend/email/items/creditmemo/default.phtml +++ b/app/code/core/Mage/Sales/view/frontend/email/items/creditmemo/default.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Sales/view/frontend/email/items/invoice/default.phtml b/app/code/core/Mage/Sales/view/frontend/email/items/invoice/default.phtml index 5dab6dd48f64bb1e03b037b5a5097eb4ff75dbb9..6edfa17cd746c530f57aac9fb3538424f4b3e4f3 100644 --- a/app/code/core/Mage/Sales/view/frontend/email/items/invoice/default.phtml +++ b/app/code/core/Mage/Sales/view/frontend/email/items/invoice/default.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Sales/view/frontend/email/items/order/default.phtml b/app/code/core/Mage/Sales/view/frontend/email/items/order/default.phtml index 7aace983be8fd4faaebe9ead1e8953d83f93b5bb..e8d19c3dd0e0908ad9f67156cc55ce67d2cb105a 100644 --- a/app/code/core/Mage/Sales/view/frontend/email/items/order/default.phtml +++ b/app/code/core/Mage/Sales/view/frontend/email/items/order/default.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Sales/view/frontend/email/items/shipment/default.phtml b/app/code/core/Mage/Sales/view/frontend/email/items/shipment/default.phtml index 1b475e35a22253d0745a3d1673affbb39fb0acd1..452ee3ded402467ac8fd7d89f801c9c0dc52a2bb 100644 --- a/app/code/core/Mage/Sales/view/frontend/email/items/shipment/default.phtml +++ b/app/code/core/Mage/Sales/view/frontend/email/items/shipment/default.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Sales/view/frontend/email/shipment/items.phtml b/app/code/core/Mage/Sales/view/frontend/email/shipment/items.phtml index f9893f70c45dced7b65da4a3ba702d2873d20557..b2bf2582528fec3096c1244812edc2e283b641dc 100644 --- a/app/code/core/Mage/Sales/view/frontend/email/shipment/items.phtml +++ b/app/code/core/Mage/Sales/view/frontend/email/shipment/items.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Sales/view/frontend/email/shipment/track.phtml b/app/code/core/Mage/Sales/view/frontend/email/shipment/track.phtml index 9da529077b91bafdbdd0311ee4b6cc51939aa401..e670dd03a2e214941fed96ea0d297d343fdfee7b 100644 --- a/app/code/core/Mage/Sales/view/frontend/email/shipment/track.phtml +++ b/app/code/core/Mage/Sales/view/frontend/email/shipment/track.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Sales/view/frontend/guest/form.phtml b/app/code/core/Mage/Sales/view/frontend/guest/form.phtml index 04acce362bc2f0043db5a72f600ee71685445298..544335d1b3cc2cdb38fa948e6e9d17adf81ec214 100644 --- a/app/code/core/Mage/Sales/view/frontend/guest/form.phtml +++ b/app/code/core/Mage/Sales/view/frontend/guest/form.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Sales/view/frontend/layout.xml b/app/code/core/Mage/Sales/view/frontend/layout.xml index 3c2463cb5f7383231e170e16db1279fd3f437d41..6edf1d1ca31d55bcc5be2bf861892c97845d3098 100644 --- a/app/code/core/Mage/Sales/view/frontend/layout.xml +++ b/app/code/core/Mage/Sales/view/frontend/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/Sales/view/frontend/order/comments.phtml b/app/code/core/Mage/Sales/view/frontend/order/comments.phtml index 1d0f460b83972485fe7312ff059c21ed7457dd34..233c3ca99fa0e77e46b0a0c755ee0d50a5b26f33 100644 --- a/app/code/core/Mage/Sales/view/frontend/order/comments.phtml +++ b/app/code/core/Mage/Sales/view/frontend/order/comments.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Sales/view/frontend/order/creditmemo.phtml b/app/code/core/Mage/Sales/view/frontend/order/creditmemo.phtml index 20758b649e6b315436032caca48c6656bff2dca6..774cc4ea1c2c7b0aef179a9fe3612f6a7fb8e7e7 100644 --- a/app/code/core/Mage/Sales/view/frontend/order/creditmemo.phtml +++ b/app/code/core/Mage/Sales/view/frontend/order/creditmemo.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Sales/view/frontend/order/creditmemo/items.phtml b/app/code/core/Mage/Sales/view/frontend/order/creditmemo/items.phtml index 2b717daab71dab6c94e40a523d0b82c5d107f27d..e9cd44b0b2fba6e72aea12cf7251506c32cd850d 100644 --- a/app/code/core/Mage/Sales/view/frontend/order/creditmemo/items.phtml +++ b/app/code/core/Mage/Sales/view/frontend/order/creditmemo/items.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Sales/view/frontend/order/creditmemo/items/renderer/default.phtml b/app/code/core/Mage/Sales/view/frontend/order/creditmemo/items/renderer/default.phtml index 9cd1efc5691db6efd43b71b562e0463ed979bcfd..04695821f8822c4b7da8ca97e6fe70d552db8b9e 100644 --- a/app/code/core/Mage/Sales/view/frontend/order/creditmemo/items/renderer/default.phtml +++ b/app/code/core/Mage/Sales/view/frontend/order/creditmemo/items/renderer/default.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Sales/view/frontend/order/history.phtml b/app/code/core/Mage/Sales/view/frontend/order/history.phtml index e8dc48961e98b9cf636f443ac1e2c9f59c65c241..0cf44867a049aaaf324ab6507443c5d0b4862506 100644 --- a/app/code/core/Mage/Sales/view/frontend/order/history.phtml +++ b/app/code/core/Mage/Sales/view/frontend/order/history.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Sales/view/frontend/order/info.phtml b/app/code/core/Mage/Sales/view/frontend/order/info.phtml index 3fc080cf7ae0eff9ef52c2cfae26a2d2da5f9c44..a0f535d6bee18f1ebd99c2437bbab68e6e7fe0b9 100644 --- a/app/code/core/Mage/Sales/view/frontend/order/info.phtml +++ b/app/code/core/Mage/Sales/view/frontend/order/info.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Sales/view/frontend/order/info/buttons.phtml b/app/code/core/Mage/Sales/view/frontend/order/info/buttons.phtml index 26dca1231b4f772eef83a4699e36b61e4a02e138..0f6c89acf831d8dbd7d0fe837030201a4cd8afdf 100644 --- a/app/code/core/Mage/Sales/view/frontend/order/info/buttons.phtml +++ b/app/code/core/Mage/Sales/view/frontend/order/info/buttons.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Sales/view/frontend/order/invoice.phtml b/app/code/core/Mage/Sales/view/frontend/order/invoice.phtml index e55090ceee5d71a833b201f3bf45df0d024635cc..6ac908fe573d7fc06a42dcc7d1ae53a934352a87 100644 --- a/app/code/core/Mage/Sales/view/frontend/order/invoice.phtml +++ b/app/code/core/Mage/Sales/view/frontend/order/invoice.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Sales/view/frontend/order/invoice/items.phtml b/app/code/core/Mage/Sales/view/frontend/order/invoice/items.phtml index ad07511f68597c9a07b249e2f86ca9b974d3c46b..7c9a5f66b9476d629f12e5111f22c6cbb5e1d129 100644 --- a/app/code/core/Mage/Sales/view/frontend/order/invoice/items.phtml +++ b/app/code/core/Mage/Sales/view/frontend/order/invoice/items.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Sales/view/frontend/order/invoice/items/renderer/default.phtml b/app/code/core/Mage/Sales/view/frontend/order/invoice/items/renderer/default.phtml index 731fddd47a07680ec8747125e9e8ab12fcff64d1..b791f60ff1526727208a0d1cb7404c9bdcd60da8 100644 --- a/app/code/core/Mage/Sales/view/frontend/order/invoice/items/renderer/default.phtml +++ b/app/code/core/Mage/Sales/view/frontend/order/invoice/items/renderer/default.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Sales/view/frontend/order/items.phtml b/app/code/core/Mage/Sales/view/frontend/order/items.phtml index 893d8f9f4895cc1d5901863739bb9382bfca5490..535922b9ac10ba716ff586e28f3fbae7c316f809 100644 --- a/app/code/core/Mage/Sales/view/frontend/order/items.phtml +++ b/app/code/core/Mage/Sales/view/frontend/order/items.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Sales/view/frontend/order/items/renderer/default.phtml b/app/code/core/Mage/Sales/view/frontend/order/items/renderer/default.phtml index aae9922fd7330c636de4d53f1108d83a6de82bdd..5aeda918cc9b359e3932c562ce62250e8de662a0 100644 --- a/app/code/core/Mage/Sales/view/frontend/order/items/renderer/default.phtml +++ b/app/code/core/Mage/Sales/view/frontend/order/items/renderer/default.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Sales/view/frontend/order/print.phtml b/app/code/core/Mage/Sales/view/frontend/order/print.phtml index 8906248ed64dad10e374906c819ed9e9671fd58a..30e9d88ccf1c4c3c86e0fee6c6b759fcd5190d0b 100644 --- a/app/code/core/Mage/Sales/view/frontend/order/print.phtml +++ b/app/code/core/Mage/Sales/view/frontend/order/print.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Sales/view/frontend/order/print/creditmemo.phtml b/app/code/core/Mage/Sales/view/frontend/order/print/creditmemo.phtml index 537b86a350f6002bc2371aa163849f65793312b7..96d8f227d3373af5c55283c40819ef1c65878d92 100644 --- a/app/code/core/Mage/Sales/view/frontend/order/print/creditmemo.phtml +++ b/app/code/core/Mage/Sales/view/frontend/order/print/creditmemo.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Sales/view/frontend/order/print/invoice.phtml b/app/code/core/Mage/Sales/view/frontend/order/print/invoice.phtml index 28a4c0fa8fde421bfa25125abda832c6ff530685..926a5704cb63151cb7a42aa501a1112c29d2ffdb 100644 --- a/app/code/core/Mage/Sales/view/frontend/order/print/invoice.phtml +++ b/app/code/core/Mage/Sales/view/frontend/order/print/invoice.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Sales/view/frontend/order/print/shipment.phtml b/app/code/core/Mage/Sales/view/frontend/order/print/shipment.phtml index 98f9c8f768aec289c0ea77b070d4cb64b563035a..2419e16c2a556c20ca1398115d89611c6bb87e0d 100644 --- a/app/code/core/Mage/Sales/view/frontend/order/print/shipment.phtml +++ b/app/code/core/Mage/Sales/view/frontend/order/print/shipment.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Sales/view/frontend/order/recent.phtml b/app/code/core/Mage/Sales/view/frontend/order/recent.phtml index 292de3f96f8b63022499bcaed681fe1ef88c0efc..1c5168cafec6b73530939d57d8dc26c15694991c 100644 --- a/app/code/core/Mage/Sales/view/frontend/order/recent.phtml +++ b/app/code/core/Mage/Sales/view/frontend/order/recent.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Sales/view/frontend/order/shipment.phtml b/app/code/core/Mage/Sales/view/frontend/order/shipment.phtml index 1410170bd6081395a4b208e3c84eac64c520b4ee..bd3740b99485d23334eb60b429bdc7836009a801 100644 --- a/app/code/core/Mage/Sales/view/frontend/order/shipment.phtml +++ b/app/code/core/Mage/Sales/view/frontend/order/shipment.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Sales/view/frontend/order/shipment/items.phtml b/app/code/core/Mage/Sales/view/frontend/order/shipment/items.phtml index 4352b96097274b8e8313f2500d2c5e8772e8624a..d37ecbf550ad42346c84b568bd78d6a03011de08 100644 --- a/app/code/core/Mage/Sales/view/frontend/order/shipment/items.phtml +++ b/app/code/core/Mage/Sales/view/frontend/order/shipment/items.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Sales/view/frontend/order/shipment/items/renderer/default.phtml b/app/code/core/Mage/Sales/view/frontend/order/shipment/items/renderer/default.phtml index e67cfc0be85374c46546df43617cde40622bcf29..d6e32f966e09b61c36a0d5b2884c3c5a3171ec27 100644 --- a/app/code/core/Mage/Sales/view/frontend/order/shipment/items/renderer/default.phtml +++ b/app/code/core/Mage/Sales/view/frontend/order/shipment/items/renderer/default.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Sales/view/frontend/order/totals.phtml b/app/code/core/Mage/Sales/view/frontend/order/totals.phtml index 870da0ca4faf8ebf13cea759141f8a82c8391d0d..e17b60131494e73b25ebccefb6bf9f4d54c8b17d 100644 --- a/app/code/core/Mage/Sales/view/frontend/order/totals.phtml +++ b/app/code/core/Mage/Sales/view/frontend/order/totals.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /** @@ -35,9 +35,9 @@ <tr class="<?php echo $_code?>"> <td <?php echo $this->getLabelProperties()?>> <?php if ($_total->getStrong()):?> - <strong><?php echo $_total->getLabel()?></strong> + <strong><?php echo $this->escapeHtml($_total->getLabel());?></strong> <?php else:?> - <?php echo $_total->getLabel()?> + <?php echo $this->escapeHtml($_total->getLabel());?> <?php endif?> </td> <td <?php echo $this->getValueProperties()?>> diff --git a/app/code/core/Mage/Sales/view/frontend/order/trackinginfo.phtml b/app/code/core/Mage/Sales/view/frontend/order/trackinginfo.phtml index bd6c6635c7855ea7522b7d4ba16489f02743b8d6..93337cb36b72b58c6ab47cfc89d10fef2e57b245 100644 --- a/app/code/core/Mage/Sales/view/frontend/order/trackinginfo.phtml +++ b/app/code/core/Mage/Sales/view/frontend/order/trackinginfo.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Sales/view/frontend/order/view.phtml b/app/code/core/Mage/Sales/view/frontend/order/view.phtml index 542cddba8908ed543f1c8cdb70d559aa2e444d7f..178ece774af35a922848f465a6ca05a47ba027d9 100644 --- a/app/code/core/Mage/Sales/view/frontend/order/view.phtml +++ b/app/code/core/Mage/Sales/view/frontend/order/view.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Sales/view/frontend/payment/form/billing/agreement.phtml b/app/code/core/Mage/Sales/view/frontend/payment/form/billing/agreement.phtml index 8e2ade9429c24e994bb75f220edb23ead7bc1822..986aaced574e247d4476a30e4ab61aba0944ca94 100644 --- a/app/code/core/Mage/Sales/view/frontend/payment/form/billing/agreement.phtml +++ b/app/code/core/Mage/Sales/view/frontend/payment/form/billing/agreement.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Sales/view/frontend/recurring/grid.phtml b/app/code/core/Mage/Sales/view/frontend/recurring/grid.phtml index 1adf2bd237bc6cf0aa3627c8ab0b4c934e8063a0..47a16debd3749a4cba5529d687006ea90a288b84 100644 --- a/app/code/core/Mage/Sales/view/frontend/recurring/grid.phtml +++ b/app/code/core/Mage/Sales/view/frontend/recurring/grid.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Sales/view/frontend/recurring/profile/view.phtml b/app/code/core/Mage/Sales/view/frontend/recurring/profile/view.phtml index 7de4ee8cff67eea9912d3470e5cf0636522bbc05..1aafd0f1d70c01ed7e18f81c132363eb5bdd1503 100644 --- a/app/code/core/Mage/Sales/view/frontend/recurring/profile/view.phtml +++ b/app/code/core/Mage/Sales/view/frontend/recurring/profile/view.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Sales/view/frontend/recurring/profile/view/info.phtml b/app/code/core/Mage/Sales/view/frontend/recurring/profile/view/info.phtml index 38bef14b690cfe2bbeef8bdeb69911c0bb700c97..fa931d9707bf168be19403001acb8feb64e10ea0 100644 --- a/app/code/core/Mage/Sales/view/frontend/recurring/profile/view/info.phtml +++ b/app/code/core/Mage/Sales/view/frontend/recurring/profile/view/info.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Sales/view/frontend/recurring/profiles.phtml b/app/code/core/Mage/Sales/view/frontend/recurring/profiles.phtml index 05d99802ab7972dbe1de6fc3c6d3c16487d03cad..945de336ce8df7af39ec29ad54b259718836a2cd 100644 --- a/app/code/core/Mage/Sales/view/frontend/recurring/profiles.phtml +++ b/app/code/core/Mage/Sales/view/frontend/recurring/profiles.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Sales/view/frontend/recurring_profile.xml b/app/code/core/Mage/Sales/view/frontend/recurring_profile.xml index 4407422efa1083bac25dc9bae66f83a4886425bc..90cc063eb664f7034f7873ee59599f855cd06043 100644 --- a/app/code/core/Mage/Sales/view/frontend/recurring_profile.xml +++ b/app/code/core/Mage/Sales/view/frontend/recurring_profile.xml @@ -21,7 +21,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/Sales/view/frontend/reorder/sidebar.phtml b/app/code/core/Mage/Sales/view/frontend/reorder/sidebar.phtml index 711238f3971baf89de1632869a3d42e8d3ef2b12..5c0beba3b8fef00ca069ea2c669ad7d85769f4ac 100644 --- a/app/code/core/Mage/Sales/view/frontend/reorder/sidebar.phtml +++ b/app/code/core/Mage/Sales/view/frontend/reorder/sidebar.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Sales/view/frontend/widget/guest/form.phtml b/app/code/core/Mage/Sales/view/frontend/widget/guest/form.phtml index fec911587e2fb947e2c214531a80638a6b019f68..531ec68a88eea3a4cee5990a9b02ec8a03044ee1 100644 --- a/app/code/core/Mage/Sales/view/frontend/widget/guest/form.phtml +++ b/app/code/core/Mage/Sales/view/frontend/widget/guest/form.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /** @var $this Mage_Sales_Block_Widget_Guest_Form */ diff --git a/app/code/core/Mage/SalesRule/Exception.php b/app/code/core/Mage/SalesRule/Exception.php index 5db103e8d864883be2eec0af86fffe770af46155..1f47bae403b9240b22d6949c5efeeac8ab2306c3 100644 --- a/app/code/core/Mage/SalesRule/Exception.php +++ b/app/code/core/Mage/SalesRule/Exception.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/SalesRule/Helper/Coupon.php b/app/code/core/Mage/SalesRule/Helper/Coupon.php new file mode 100644 index 0000000000000000000000000000000000000000..950dc5aaa7c6b633b124359313dca87fe7c8df2a --- /dev/null +++ b/app/code/core/Mage/SalesRule/Helper/Coupon.php @@ -0,0 +1,147 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_SalesRule + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Helper for coupon codes creating and managing + * + * @category Mage + * @package Mage_SalesRule + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_SalesRule_Helper_Coupon extends Mage_Core_Helper_Abstract +{ + /** + * Constants which defines all possible coupon codes formats + */ + const COUPON_FORMAT_ALPHANUMERIC = 'alphanum'; + const COUPON_FORMAT_ALPHABETICAL = 'alpha'; + const COUPON_FORMAT_NUMERIC = 'num'; + + /** + * Defines type of Coupon + */ + const COUPON_TYPE_SPECIFIC_AUTOGENERATED = 1; + + /** + * XML paths to coupon codes generation options + */ + const XML_PATH_SALES_RULE_COUPON_LENGTH = 'promo/auto_generated_coupon_codes/length'; + const XML_PATH_SALES_RULE_COUPON_FORMAT = 'promo/auto_generated_coupon_codes/format'; + const XML_PATH_SALES_RULE_COUPON_PREFIX = 'promo/auto_generated_coupon_codes/prefix'; + const XML_PATH_SALES_RULE_COUPON_SUFFIX = 'promo/auto_generated_coupon_codes/suffix'; + const XML_PATH_SALES_RULE_COUPON_DASH_INTERVAL = 'promo/auto_generated_coupon_codes/dash'; + + /** + * Config path for character set and separator + */ + const XML_CHARSET_NODE = 'global/salesrule/coupon/charset/%s'; + const XML_CHARSET_SEPARATOR = 'global/salesrule/coupon/separator'; + + /** + * Get all possible coupon codes formats + * + * @return array + */ + public function getFormatsList() + { + return array( + self::COUPON_FORMAT_ALPHANUMERIC => $this->__('Alphanumeric'), + self::COUPON_FORMAT_ALPHABETICAL => $this->__('Alphabetical'), + self::COUPON_FORMAT_NUMERIC => $this->__('Numeric'), + ); + } + + /** + * Get default coupon code length + * + * @return int + */ + public function getDefaultLength() + { + return (int)Mage::getStoreConfig(self::XML_PATH_SALES_RULE_COUPON_LENGTH); + } + + /** + * Get default coupon code format + * + * @return int + */ + public function getDefaultFormat() + { + return Mage::getStoreConfig(self::XML_PATH_SALES_RULE_COUPON_FORMAT); + } + + /** + * Get default coupon code prefix + * + * @return string + */ + public function getDefaultPrefix() + { + return Mage::getStoreConfig(self::XML_PATH_SALES_RULE_COUPON_PREFIX); + } + + /** + * Get default coupon code suffix + * + * @return string + */ + public function getDefaultSuffix() + { + return Mage::getStoreConfig(self::XML_PATH_SALES_RULE_COUPON_SUFFIX); + } + + /** + * Get dashes occurrences frequency in coupon code + * + * @return int + */ + public function getDefaultDashInterval() + { + return (int)Mage::getStoreConfig(self::XML_PATH_SALES_RULE_COUPON_DASH_INTERVAL); + } + + /** + * Get Coupon's alphabet as array of chars + * + * @param string $format + * @return array|bool + */ + public function getCharset($format) + { + return str_split((string) Mage::app()->getConfig()->getNode(sprintf(self::XML_CHARSET_NODE, $format))); + } + + /** + * Retrieve Separator from config + * + * @return string + */ + public function getCodeSeparator() + { + return (string) Mage::app()->getConfig()->getNode(Mage_SalesRule_Helper_Coupon::XML_CHARSET_SEPARATOR); + } +} diff --git a/app/code/core/Mage/SalesRule/Helper/Data.php b/app/code/core/Mage/SalesRule/Helper/Data.php index 5a1c7541e67ce7d651bccb19ca91e9df36576b3a..6bf91eef9b033f79df17b33619e0ebeb91743a8b 100644 --- a/app/code/core/Mage/SalesRule/Helper/Data.php +++ b/app/code/core/Mage/SalesRule/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/SalesRule/Model/Coupon.php b/app/code/core/Mage/SalesRule/Model/Coupon.php index b57efa16cad7422daa8e3284778428d22cbd4ca0..dfddd03771a8c6079dcd72a005c4a1c8c4e9cef0 100644 --- a/app/code/core/Mage/SalesRule/Model/Coupon.php +++ b/app/code/core/Mage/SalesRule/Model/Coupon.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -44,6 +44,8 @@ * @method Mage_SalesRule_Model_Coupon setExpirationDate(string $value) * @method int getIsPrimary() * @method Mage_SalesRule_Model_Coupon setIsPrimary(int $value) + * @method int getType() + * @method Mage_SalesRule_Model_Coupon setType(int $value) * * @category Mage * @package Mage_SalesRule @@ -92,11 +94,24 @@ class Mage_SalesRule_Model_Coupon extends Mage_Core_Model_Abstract /** * Load primary coupon for specified rule * - * @param Mage_SalesRule_Model_Rule|int Rule + * @param Mage_SalesRule_Model_Rule|int $rule + * @return Mage_SalesRule_Model_Coupon */ public function loadPrimaryByRule($rule) { $this->getResource()->loadPrimaryByRule($this, $rule); return $this; } + + /** + * Load Shopping Cart Price Rule by coupon code + * + * @param string $couponCode + * @return Mage_SalesRule_Model_Coupon + */ + public function loadByCode($couponCode) + { + $this->load($couponCode, 'code'); + return $this; + } } diff --git a/app/code/core/Mage/SalesRule/Model/Coupon/Codegenerator.php b/app/code/core/Mage/SalesRule/Model/Coupon/Codegenerator.php index a4216854fbbbfc3e9881ec8f6b4fc22a105ab6f6..5f43eacf4adec300410853f7ff4a499c133d5a5f 100644 --- a/app/code/core/Mage/SalesRule/Model/Coupon/Codegenerator.php +++ b/app/code/core/Mage/SalesRule/Model/Coupon/Codegenerator.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/SalesRule/Model/Coupon/CodegeneratorInterface.php b/app/code/core/Mage/SalesRule/Model/Coupon/CodegeneratorInterface.php index 1cc8e3e05390a576d2452e43526c2e2eaa2a8141..40c991328edf06c33ab11e8149e2c71ca03c6132 100644 --- a/app/code/core/Mage/SalesRule/Model/Coupon/CodegeneratorInterface.php +++ b/app/code/core/Mage/SalesRule/Model/Coupon/CodegeneratorInterface.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/SalesRule/Model/Coupon/Massgenerator.php b/app/code/core/Mage/SalesRule/Model/Coupon/Massgenerator.php new file mode 100644 index 0000000000000000000000000000000000000000..5201b6a0cd1d0f0a8e5649fed11db5dfd38122db --- /dev/null +++ b/app/code/core/Mage/SalesRule/Model/Coupon/Massgenerator.php @@ -0,0 +1,194 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_SalesRule + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + + +/** + * SalesRule Mass Coupon Generator + * + * @method Mage_SalesRule_Model_Resource_Coupon getResource() + * + * @category Mage + * @package Mage_SalesRule + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_SalesRule_Model_Coupon_Massgenerator extends Mage_Core_Model_Abstract + implements Mage_SalesRule_Model_Coupon_CodegeneratorInterface +{ + /** + * Maximum probability of guessing the coupon on the first attempt + */ + const MAX_PROBABILITY_OF_GUESSING = 0.25; + const MAX_GENERATE_ATTEMPTS = 10; + + /** + * Count of generated Coupons + * @var int + */ + protected $_generatedCount = 0; + + /** + * Initialize resource + */ + protected function _construct() + { + $this->_init('Mage_SalesRule_Model_Resource_Coupon'); + } + + /** + * Generate coupon code + * + * @return string + */ + public function generateCode() + { + $format = $this->getFormat(); + if (!$format) { + $format = Mage_SalesRule_Helper_Coupon::COUPON_FORMAT_ALPHANUMERIC; + } + $length = max(1, (int) $this->getLength()); + $split = max(0, (int) $this->getDash()); + $suffix = $this->getSuffix(); + $prefix = $this->getPrefix(); + + $splitChar = $this->getDelimiter(); + $charset = Mage::helper('Mage_SalesRule_Helper_Coupon')->getCharset($format); + + $code = ''; + $charsetSize = count($charset); + for ($i=0; $i<$length; $i++) { + $char = $charset[mt_rand(0, $charsetSize - 1)]; + if ($split > 0 && ($i % $split) == 0 && $i != 0) { + $char = $splitChar . $char; + } + $code .= $char; + } + + $code = $prefix . $code . $suffix; + return $code; + } + + /** + * Retrieve delimiter + * + * @return string + */ + public function getDelimiter() + { + if ($this->getData('delimiter')) { + return $this->getData('delimiter'); + } else { + return Mage::helper('Mage_SalesRule_Helper_Coupon')->getCodeSeparator(); + } + } + + /** + * Generate Coupons Pool + * + * @return Mage_SalesRule_Model_Coupon_Massgenerator + */ + public function generatePool() + { + $this->_generatedCount = 0; + $size = $this->getQty(); + + $maxProbability = $this->getMaxProbability() ? $this->getMaxProbability() : self::MAX_PROBABILITY_OF_GUESSING; + $maxAttempts = $this->getMaxAttempts() ? $this->getMaxAttempts() : self::MAX_GENERATE_ATTEMPTS; + + /** @var $coupon Mage_SalesRule_Model_Coupon */ + $coupon = Mage::getModel('Mage_SalesRule_Model_Coupon'); + + $chars = count(Mage::helper('Mage_SalesRule_Helper_Coupon')->getCharset($this->getFormat())); + $length = (int) $this->getLength(); + $maxCodes = pow($chars, $length); + $probability = $size / $maxCodes; + //increase the length of Code if probability is low + if ($probability > $maxProbability) { + do { + $length++; + $maxCodes = pow($chars, $length); + $probability = $size / $maxCodes; + } while ($probability > $maxProbability); + $this->setLength($length); + } + + $now = $this->getResource()->formatDate( + Mage::getSingleton('Mage_Core_Model_Date')->gmtTimestamp() + ); + + for ($i = 0; $i < $size; $i++) { + $attempt = 0; + do { + if ($attempt >= $maxAttempts) { + Mage::throwException(Mage::helper('Mage_SalesRule_Helper_Data')->__('Unable to create requested Coupon Qty. Please check settings and try again.')); + } + $code = $this->generateCode(); + $attempt++; + } while ($this->getResource()->exists($code)); + + $expirationDate = $this->getToDate(); + if ($expirationDate instanceof Zend_Date) { + $expirationDate = $expirationDate->toString(Varien_Date::DATETIME_INTERNAL_FORMAT); + } + + $coupon->setId(null) + ->setRuleId($this->getRuleId()) + ->setUsageLimit($this->getUsesPerCoupon()) + ->setUsagePerCustomer($this->getUsesPerCustomer()) + ->setExpirationDate($expirationDate) + ->setCreatedAt($now) + ->setType(Mage_SalesRule_Helper_Coupon::COUPON_TYPE_SPECIFIC_AUTOGENERATED) + ->setCode($code) + ->save(); + + $this->_generatedCount++; + } + return $this; + } + + /** + * Validate input + * + * @param array $data + * @return bool + */ + public function validateData($data) + { + return !empty($data) && !empty($data['qty']) && !empty($data['rule_id']) + && !empty($data['length']) && !empty($data['format']) + && (int)$data['qty'] > 0 && (int) $data['rule_id'] > 0 + && (int) $data['length'] > 0; + } + + /** + * Retrieve count of generated Coupons + * + * @return int + */ + public function getGeneratedCount() + { + return $this->_generatedCount; + } +} diff --git a/app/code/core/Mage/SalesRule/Model/Observer.php b/app/code/core/Mage/SalesRule/Model/Observer.php index 4eb048868202de07b5f988d9482112b608ca221b..dc7142aa4fe222ae57ba0c66c0c9461d298561a0 100644 --- a/app/code/core/Mage/SalesRule/Model/Observer.php +++ b/app/code/core/Mage/SalesRule/Model/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -213,5 +213,43 @@ class Mage_SalesRule_Model_Observer $attributesTransfer->addData($result); return $this; } + + /** + * Add coupon's rule name to order data + * + * @param Varien_Event_Observer $observer + * @return Mage_SalesRule_Model_Observer + */ + public function addSalesRuleNameToOrder($observer) + { + $order = $observer->getOrder(); + $couponCode = $order->getCouponCode(); + + if (empty($couponCode)) { + return $this; + } + + /** + * @var Mage_SalesRule_Model_Coupon $couponModel + */ + $couponModel = Mage::getModel('Mage_SalesRule_Model_Coupon'); + $couponModel->loadByCode($couponCode); + + $ruleId = $couponModel->getRuleId(); + + if (empty($ruleId)) { + return $this; + } + + /** + * @var Mage_SalesRule_Model_Rule $ruleModel + */ + $ruleModel = Mage::getModel('Mage_SalesRule_Model_Rule'); + $ruleModel->load($ruleId); + + $order->setCouponRuleName($ruleModel->getName()); + + return $this; + } } diff --git a/app/code/core/Mage/SalesRule/Model/Quote/Discount.php b/app/code/core/Mage/SalesRule/Model/Quote/Discount.php index 7cc4206be817d4f3dda216d314c4b5e383ce537b..2515a75c17ade5ff0dd41bae90d248b833d6b1f1 100644 --- a/app/code/core/Mage/SalesRule/Model/Quote/Discount.php +++ b/app/code/core/Mage/SalesRule/Model/Quote/Discount.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -139,7 +139,7 @@ class Mage_SalesRule_Model_Quote_Discount extends Mage_Sales_Model_Quote_Address if ($amount!=0) { $description = $address->getDiscountDescription(); - if ($description) { + if (strlen($description)) { $title = Mage::helper('Mage_Sales_Helper_Data')->__('Discount (%s)', $description); } else { $title = Mage::helper('Mage_Sales_Helper_Data')->__('Discount'); @@ -152,4 +152,4 @@ class Mage_SalesRule_Model_Quote_Discount extends Mage_Sales_Model_Quote_Address } return $this; } -} +} \ No newline at end of file diff --git a/app/code/core/Mage/SalesRule/Model/Quote/Freeshipping.php b/app/code/core/Mage/SalesRule/Model/Quote/Freeshipping.php index b481e20e732d88089c6c16265cf348a88f1d55e2..b7e69ef46aa05a2a5ded6dcdca845c7dec8ac21c 100644 --- a/app/code/core/Mage/SalesRule/Model/Quote/Freeshipping.php +++ b/app/code/core/Mage/SalesRule/Model/Quote/Freeshipping.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/SalesRule/Model/Quote/Nominal/Discount.php b/app/code/core/Mage/SalesRule/Model/Quote/Nominal/Discount.php index afdce233d03922d2dfb02e9060aca37ed77c7e67..eac3aad20bcaafdc3b60734393130dfcc7bb8dce 100644 --- a/app/code/core/Mage/SalesRule/Model/Quote/Nominal/Discount.php +++ b/app/code/core/Mage/SalesRule/Model/Quote/Nominal/Discount.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/SalesRule/Model/Resource/Coupon.php b/app/code/core/Mage/SalesRule/Model/Resource/Coupon.php index ad0ce9c3981941c827922977fe6c7899f4b63f9b..2b00807d828dd3a1036b576e55d63ae2578abd1e 100755 --- a/app/code/core/Mage/SalesRule/Model/Resource/Coupon.php +++ b/app/code/core/Mage/SalesRule/Model/Resource/Coupon.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -36,7 +36,6 @@ class Mage_SalesRule_Model_Resource_Coupon extends Mage_Core_Model_Resource_Db_A { /** * Constructor adds unique fields - * */ protected function _construct() { @@ -50,13 +49,13 @@ class Mage_SalesRule_Model_Resource_Coupon extends Mage_Core_Model_Resource_Db_A /** * Perform actions before object save * - * @param Varien_Object $object - * @return unknown + * @param Mage_Core_Model_Abstract $object + * @return Mage_Core_Model_Resource_Db_Abstract */ public function _beforeSave(Mage_Core_Model_Abstract $object) { if (!$object->getExpirationDate()) { - $object->setExpirationDate(new Zend_Db_Expr('NULL')); + $object->setExpirationDate(null); } else if ($object->getExpirationDate() instanceof Zend_Date) { $object->setExpirationDate($object->getExpirationDate()->toString(Varien_Date::DATETIME_INTERNAL_FORMAT)); } @@ -72,7 +71,7 @@ class Mage_SalesRule_Model_Resource_Coupon extends Mage_Core_Model_Resource_Db_A * * * @param Mage_SalesRule_Model_Coupon $object - * @param unknown_type $rule + * @param Mage_SalesRule_Model_Rule|int $rule * @return unknown */ public function loadPrimaryByRule(Mage_SalesRule_Model_Coupon $object, $rule) @@ -100,4 +99,62 @@ class Mage_SalesRule_Model_Resource_Coupon extends Mage_Core_Model_Resource_Db_A $this->_afterLoad($object); return true; } + + /** + * Check if code exists + * + * @param string $code + * @return bool + */ + public function exists($code) + { + $read = $this->_getReadAdapter(); + $select = $read->select(); + $select->from($this->getMainTable(), 'code'); + $select->where('code = :code'); + + if ($read->fetchOne($select, array('code' => $code)) === false) { + return false; + } + return true; + } + + /** + * Update auto generated Specific Coupon if it's rule changed + * + * @param Mage_SalesRule_Model_Rule $rule + * @return Mage_SalesRule_Model_Resource_Coupon + */ + public function updateSpecificCoupons(Mage_SalesRule_Model_Rule $rule) + { + if (!$rule || !$rule->getId() || !$rule->hasDataChanges()) { + return $this; + } + + $updateArray = array(); + if ($rule->dataHasChangedFor('uses_per_coupon')) { + $updateArray['usage_limit'] = $rule->getUsesPerCoupon(); + } + + if ($rule->dataHasChangedFor('uses_per_customer')) { + $updateArray['usage_per_customer'] = $rule->getUsesPerCustomer(); + } + + $ruleNewDate = new Zend_Date($rule->getToDate()); + $ruleOldDate = new Zend_Date($rule->getOrigData('to_date')); + + if ($ruleNewDate->compare($ruleOldDate)) { + $updateArray['expiration_date'] = $rule->getToDate(); + } + + if (!empty($updateArray)) { + $this->_getWriteAdapter()->update( + $this->getTable('salesrule_coupon'), + $updateArray, + array('rule_id = ?' => $rule->getId()) + ); + } + + return $this; + } } diff --git a/app/code/core/Mage/SalesRule/Model/Resource/Coupon/Collection.php b/app/code/core/Mage/SalesRule/Model/Resource/Coupon/Collection.php index 8f1358f6b14acb3884051352c68398463381eac3..442e6aff3dfa8512b6426c351a1c301593f594ce 100755 --- a/app/code/core/Mage/SalesRule/Model/Resource/Coupon/Collection.php +++ b/app/code/core/Mage/SalesRule/Model/Resource/Coupon/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -76,4 +76,30 @@ class Mage_SalesRule_Model_Resource_Coupon_Collection extends Mage_Core_Model_Re $this->addFieldToFilter('rule_id', array('in' => $ruleIds)); return $this; } + + /** + * Filter collection to be filled with auto-generated coupons only + * + * @return Mage_SalesRule_Model_Resource_Coupon_Collection + */ + public function addGeneratedCouponsFilter() + { + $this->addFieldToFilter('is_primary', array('null' => 1)); + return $this; + } + + /** + * Callback function that filters collection by field "Used" from grid + * + * @param Mage_Core_Model_Resource_Db_Collection_Abstract $collection + * @param Mage_Adminhtml_Block_Widget_Grid_Column $column + */ + public function addIsUsedFilterCallback($collection, $column) + { + $filterValue = $column->getFilter()->getCondition(); + $collection->addFieldToFilter( + $this->getConnection()->getCheckSql('main_table.times_used > 0', 1, 0), + array('eq' => $filterValue) + ); + } } diff --git a/app/code/core/Mage/SalesRule/Model/Resource/Coupon/Usage.php b/app/code/core/Mage/SalesRule/Model/Resource/Coupon/Usage.php index 6536665d9d083cc2355a341d065f19f2f1bcdc7a..e86aa6b050f9f81198e2fc19dcaa860837ca98da 100755 --- a/app/code/core/Mage/SalesRule/Model/Resource/Coupon/Usage.php +++ b/app/code/core/Mage/SalesRule/Model/Resource/Coupon/Usage.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/SalesRule/Model/Resource/Report/Collection.php b/app/code/core/Mage/SalesRule/Model/Resource/Report/Collection.php index b403f55878d94ad84756707404179832c097fbbd..4c3ab312474271e679af73385cf77038d09be263 100755 --- a/app/code/core/Mage/SalesRule/Model/Resource/Report/Collection.php +++ b/app/code/core/Mage/SalesRule/Model/Resource/Report/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -55,6 +55,13 @@ class Mage_SalesRule_Model_Resource_Report_Collection extends Mage_Sales_Model_R */ protected $_selectedColumns = array(); + /** + * array where rules ids stored + * + * @var array + */ + protected $_rulesIdsFilter; + /** * Initialize custom resource model * @@ -88,6 +95,7 @@ class Mage_SalesRule_Model_Resource_Report_Collection extends Mage_Sales_Model_R $this->_selectedColumns = array( 'period' => $this->_periodFormat, 'coupon_code', + 'rule_name', 'coupon_uses' => 'SUM(coupon_uses)', 'subtotal_amount' => 'SUM(subtotal_amount)', 'discount_amount' => 'SUM(discount_amount)', @@ -131,5 +139,54 @@ class Mage_SalesRule_Model_Resource_Report_Collection extends Mage_Sales_Model_R return $this; } + /** + * Add filtering by rules ids + * + * @param array $rulesList + * @return Mage_SalesRule_Model_Resource_Report_Collection + */ + public function addRuleFilter($rulesList) + { + $this->_rulesIdsFilter = $rulesList; + return $this; + } + /** + * Apply filtering by rules ids + * + * @return Mage_SalesRule_Model_Resource_Report_Collection + */ + protected function _applyRulesFilter() + { + if (empty($this->_rulesIdsFilter) || !is_array($this->_rulesIdsFilter)) { + return $this; + } + + $rulesList = Mage::getResourceModel('Mage_SalesRule_Model_Resource_Report_Rule')->getUniqRulesNamesList(); + + $rulesFilterSqlParts = array(); + + foreach ($this->_rulesIdsFilter as $ruleId) { + if (!isset($rulesList[$ruleId])) { + continue; + } + $ruleName = $rulesList[$ruleId]; + $rulesFilterSqlParts[] = $this->getConnection()->quoteInto('rule_name = ?', $ruleName); + } + + if (!empty($rulesFilterSqlParts)) { + $this->getSelect()->where(implode($rulesFilterSqlParts, ' OR ')); + } + } + + /** + * Apply collection custom filter + * + * @return Mage_Sales_Model_Resource_Report_Collection_Abstract + */ + protected function _applyCustomFilter() + { + $this->_applyRulesFilter(); + return parent::_applyCustomFilter(); + } } diff --git a/app/code/core/Mage/SalesRule/Model/Resource/Report/Rule.php b/app/code/core/Mage/SalesRule/Model/Resource/Report/Rule.php index b5f130a05939009168c7e76badb423cd0bccc308..9df8497b10fba0f95306e7044bb2366aa3f769ca 100755 --- a/app/code/core/Mage/SalesRule/Model/Resource/Report/Rule.php +++ b/app/code/core/Mage/SalesRule/Model/Resource/Report/Rule.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -58,4 +58,33 @@ class Mage_SalesRule_Model_Resource_Report_Rule extends Mage_Reports_Model_Resou return $this; } + + /** + * Get all unique Rule Names from aggregated coupons usage data + * + * @return array + */ + public function getUniqRulesNamesList() + { + $adapter = $this->_getReadAdapter(); + $tableName = $this->getTable('coupon_aggregated'); + $select = $adapter->select() + ->from( + $tableName, + new Zend_Db_Expr('DISTINCT rule_name') + ) + ->where('rule_name IS NOT NULL') + ->where('rule_name <> ""') + ->order('rule_name ASC'); + + $rulesNames = $adapter->fetchAll($select); + + $result = array(); + + foreach ($rulesNames as $row) { + $result[] = $row['rule_name']; + } + + return $result; + } } diff --git a/app/code/core/Mage/SalesRule/Model/Resource/Report/Rule/Createdat.php b/app/code/core/Mage/SalesRule/Model/Resource/Report/Rule/Createdat.php index 8591b9f2798efc9f6f077ea869abf0fd7d4fbb18..7b314fea4942879ab495dae5875583426ad3e2ed 100644 --- a/app/code/core/Mage/SalesRule/Model/Resource/Report/Rule/Createdat.php +++ b/app/code/core/Mage/SalesRule/Model/Resource/Report/Rule/Createdat.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -66,6 +66,11 @@ class Mage_SalesRule_Model_Resource_Report_Rule_Createdat extends Mage_Reports_M */ protected function _aggregateByOrder($aggregationField, $from, $to) { + $from = $this->_dateToUtc($from); + $to = $this->_dateToUtc($to); + + $this->_checkDates($from, $to); + $table = $this->getMainTable(); $sourceTable = $this->getTable('sales_flat_order'); $adapter = $this->_getWriteAdapter(); @@ -90,6 +95,7 @@ class Mage_SalesRule_Model_Resource_Report_Rule_Createdat extends Mage_Reports_M 'store_id' => 'store_id', 'order_status' => 'status', 'coupon_code' => 'coupon_code', + 'rule_name' => 'coupon_rule_name', 'coupon_uses' => 'COUNT(entity_id)', 'subtotal_amount' => @@ -151,6 +157,7 @@ class Mage_SalesRule_Model_Resource_Report_Rule_Createdat extends Mage_Reports_M 'store_id' => new Zend_Db_Expr('0'), 'order_status' => 'order_status', 'coupon_code' => 'coupon_code', + 'rule_name' => 'rule_name', 'coupon_uses' => 'SUM(coupon_uses)', 'subtotal_amount' => 'SUM(subtotal_amount)', 'discount_amount' => 'SUM(discount_amount)', diff --git a/app/code/core/Mage/SalesRule/Model/Resource/Report/Rule/Updatedat.php b/app/code/core/Mage/SalesRule/Model/Resource/Report/Rule/Updatedat.php index 7e74449003c2e9c4a855ba5ac50fc0e5f7b24ef7..94e06fe1fc888be21d23056768b97e5747469deb 100644 --- a/app/code/core/Mage/SalesRule/Model/Resource/Report/Rule/Updatedat.php +++ b/app/code/core/Mage/SalesRule/Model/Resource/Report/Rule/Updatedat.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/SalesRule/Model/Resource/Report/Updatedat/Collection.php b/app/code/core/Mage/SalesRule/Model/Resource/Report/Updatedat/Collection.php index 2e604a9a71a3426a8a93e17d6fe955dc8adef46c..c6313246e6ec15b5fe9b03e1383c845005f28090 100755 --- a/app/code/core/Mage/SalesRule/Model/Resource/Report/Updatedat/Collection.php +++ b/app/code/core/Mage/SalesRule/Model/Resource/Report/Updatedat/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/SalesRule/Model/Resource/Rule.php b/app/code/core/Mage/SalesRule/Model/Resource/Rule.php index 8b8be424efc634e556236cc77329af55b82e4412..f515b2f28ad9c43e0e1d209911237e1160ec6037 100755 --- a/app/code/core/Mage/SalesRule/Model/Resource/Rule.php +++ b/app/code/core/Mage/SalesRule/Model/Resource/Rule.php @@ -20,23 +20,40 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ /** - * SalesRule resource model + * Sales Rule resource model * - * @category Mage - * @package Mage_SalesRule - * @author Magento Core Team <core@magentocommerce.com> + * @category Mage + * @package Mage_SalesRule + * @author Magento Core Team <core@magentocommerce.com> */ -class Mage_SalesRule_Model_Resource_Rule extends Mage_Core_Model_Resource_Db_Abstract +class Mage_SalesRule_Model_Resource_Rule extends Mage_Rule_Model_Resource_Abstract { /** - * Constructor + * Store associated with rule entities information map * + * @var array + */ + protected $_associatedEntitiesMap = array( + 'website' => array( + 'associations_table' => 'salesrule_website', + 'rule_id_field' => 'rule_id', + 'entity_id_field' => 'website_id' + ), + 'customer_group' => array( + 'associations_table' => 'salesrule_customer_group', + 'rule_id_field' => 'rule_id', + 'entity_id_field' => 'customer_group_id' + ) + ); + + /** + * Initialize main table and table id field */ protected function _construct() { @@ -44,40 +61,92 @@ class Mage_SalesRule_Model_Resource_Rule extends Mage_Core_Model_Resource_Db_Abs } /** - * On beforeSave + * Add customer group ids and website ids to rule data after load * * @param Mage_Core_Model_Abstract $object + * + * @return Mage_SalesRule_Model_Resource_Rule + */ + protected function _afterLoad(Mage_Core_Model_Abstract $object) + { + $object->setData('customer_group_ids', (array)$this->getCustomerGroupIds($object->getId())); + $object->setData('website_ids', (array)$this->getWebsiteIds($object->getId())); + + parent::_afterLoad($object); + return $this; + } + + /** + * Prepare sales rule's discount quantity + * + * @param Mage_Core_Model_Abstract $object + * + * @return Mage_SalesRule_Model_Resource_Rule */ public function _beforeSave(Mage_Core_Model_Abstract $object) { - if (!$object->getFromDate()) { - $object->setFromDate(Mage::app()->getLocale()->date()); + if (!$object->getDiscountQty()) { + $object->setDiscountQty(new Zend_Db_Expr('NULL')); } - if ($object->getFromDate() instanceof Zend_Date) { - $object->setFromDate($object->getFromDate()->toString(Varien_Date::DATETIME_INTERNAL_FORMAT)); + + parent::_beforeSave($object); + return $this; + } + + /** + * Bind sales rule to customer group(s) and website(s). + * Save rule's associated store labels. + * Save product attributes used in rule. + * + * @param Mage_Core_Model_Abstract $object + * + * @return Mage_SalesRule_Model_Resource_Rule + */ + protected function _afterSave(Mage_Core_Model_Abstract $object) + { + if ($object->hasStoreLabels()) { + $this->saveStoreLabels($object->getId(), $object->getStoreLabels()); } - if (!$object->getToDate()) { - $object->setToDate(new Zend_Db_Expr('NULL')); - } else { - if ($object->getToDate() instanceof Zend_Date) { - $object->setToDate($object->getToDate()->toString(Varien_Date::DATETIME_INTERNAL_FORMAT)); + if ($object->hasWebsiteIds()) { + $websiteIds = $object->getWebsiteIds(); + if (!is_array($websiteIds)) { + $websiteIds = explode(',', (string)$websiteIds); } + $this->bindRuleToEntity($object->getId(), $websiteIds, 'website'); } - if (!$object->getDiscountQty()) { - $object->setDiscountQty(new Zend_Db_Expr('NULL')); + if ($object->hasCustomerGroupIds()) { + $customerGroupIds = $object->getCustomerGroupIds(); + if (!is_array($customerGroupIds)) { + $customerGroupIds = explode(',', (string)$customerGroupIds); + } + $this->bindRuleToEntity($object->getId(), $customerGroupIds, 'customer_group'); } - parent::_beforeSave($object); + // Save product attributes used in rule + $ruleProductAttributes = array_merge( + $this->getProductAttributes($object->getConditionsSerialized()), + $this->getProductAttributes($object->getActionsSerialized()) + ); + if (count($ruleProductAttributes)) { + $this->setActualProductAttributes($object, $ruleProductAttributes); + } + + // Update auto geterated specific coupons if exists + if ($object->getUseAutoGeneration() && $object->hasDataChanges()) { + Mage::getResourceModel('Mage_SalesRule_Model_Resource_Coupon')->updateSpecificCoupons($object); + } + return parent::_afterSave($object); } /** - * Get customer uses + * Retrieve coupon/rule uses for specified customer * - * @param unknown_type $rule - * @param unknown_type $customerId - * @return unknown + * @param Mage_SalesRule_Model_Rule $rule + * @param int $customerId + * + * @return string */ public function getCustomerUses($rule, $customerId) { @@ -93,29 +162,47 @@ class Mage_SalesRule_Model_Resource_Rule extends Mage_Core_Model_Resource_Db_Abs * * @param int $ruleId * @param array $labels + * * @return Mage_SalesRule_Model_Resource_Rule */ public function saveStoreLabels($ruleId, $labels) { - $delete = array(); - $table = $this->getTable('salesrule_label'); + $deleteByStoreIds = array(); + $table = $this->getTable('salesrule_label'); $adapter = $this->_getWriteAdapter(); + $data = array(); foreach ($labels as $storeId => $label) { if (Mage::helper('Mage_Core_Helper_String')->strlen($label)) { - $data = array('rule_id' => $ruleId, 'store_id' => $storeId, 'label' => $label); - $adapter->insertOnDuplicate($table, $data, array('label')); + $data[] = array('rule_id' => $ruleId, 'store_id' => $storeId, 'label' => $label); } else { - $delete[] = $storeId; + $deleteByStoreIds[] = $storeId; } } - if (!empty($delete)) { - $adapter->delete($table, array( - 'rule_id=?' => $ruleId, - 'store_id IN (?)' => $delete - )); + $adapter->beginTransaction(); + try { + if (!empty($data)) { + $adapter->insertOnDuplicate( + $table, + $data, + array('label') + ); + } + + if (!empty($deleteByStoreIds)) { + $adapter->delete($table, array( + 'rule_id=?' => $ruleId, + 'store_id IN (?)' => $deleteByStoreIds + )); + } + } catch (Exception $e) { + $adapter->rollback(); + throw $e; + } + $adapter->commit(); + return $this; } @@ -172,7 +259,7 @@ class Mage_SalesRule_Model_Resource_Rule extends Mage_Core_Model_Resource_Db_Abs * * @param Mage_SalesRule_Model_Rule $rule * @param mixed $attributes - * return Mage_SalesRule_Model_Resource_Rule + * @return Mage_SalesRule_Model_Resource_Rule */ public function setActualProductAttributes($rule, $attributes) { @@ -182,8 +269,8 @@ class Mage_SalesRule_Model_Resource_Rule extends Mage_Core_Model_Resource_Db_Abs //Getting attribute IDs for attribute codes $attributeIds = array(); $select = $this->_getReadAdapter()->select() - ->from(array('a'=>$this->getTable('eav_attribute')), array('a.attribute_id')) - ->where('a.attribute_code IN (?)', array($attributes)); + ->from(array('a' => $this->getTable('eav_attribute')), array('a.attribute_id')) + ->where('a.attribute_code IN (?)', array($attributes)); $attributesFound = $this->_getReadAdapter()->fetchAll($select); if ($attributesFound) { foreach ($attributesFound as $attribute) { @@ -191,8 +278,8 @@ class Mage_SalesRule_Model_Resource_Rule extends Mage_Core_Model_Resource_Db_Abs } $data = array(); - foreach (explode(',', $rule->getCustomerGroupIds()) as $customerGroupId) { - foreach (explode(',', $rule->getWebsiteIds()) as $websiteId) { + foreach ($rule->getCustomerGroupIds() as $customerGroupId) { + foreach ($rule->getWebsiteIds() as $websiteId) { foreach ($attributeIds as $attribute) { $data[] = array ( 'rule_id' => $rule->getId(), @@ -205,6 +292,27 @@ class Mage_SalesRule_Model_Resource_Rule extends Mage_Core_Model_Resource_Db_Abs } $write->insertMultiple($this->getTable('salesrule_product_attribute'), $data); } + return $this; } + + /** + * Collect all product attributes used in serialized rule's action or condition + * + * @param string $serializedString + * + * @return array + */ + public function getProductAttributes($serializedString) + { + $result = array(); + if (preg_match_all('~s:32:"salesrule/rule_condition_product";s:9:"attribute";s:\d+:"(.*?)"~s', + $serializedString, $matches)){ + foreach ($matches[1] as $offset => $attributeCode) { + $result[] = $attributeCode; + } + } + + return $result; + } } diff --git a/app/code/core/Mage/SalesRule/Model/Resource/Rule/Collection.php b/app/code/core/Mage/SalesRule/Model/Resource/Rule/Collection.php index 960353ed0e8dbd9a542be1fb26d5d8f57dbd6371..24d12d5805969971d91c010a2676e0f14316100d 100755 --- a/app/code/core/Mage/SalesRule/Model/Resource/Rule/Collection.php +++ b/app/code/core/Mage/SalesRule/Model/Resource/Rule/Collection.php @@ -20,23 +20,40 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ /** - * SalesRule Model Resource Rule_Collection + * Sales Rules resource collection model * * @category Mage * @package Mage_SalesRule * @author Magento Core Team <core@magentocommerce.com> */ -class Mage_SalesRule_Model_Resource_Rule_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract +class Mage_SalesRule_Model_Resource_Rule_Collection extends Mage_Rule_Model_Resource_Rule_Collection_Abstract { /** - * Constructor + * Store associated with rule entities information map * + * @var array + */ + protected $_associatedEntitiesMap = array( + 'website' => array( + 'associations_table' => 'salesrule_website', + 'rule_id_field' => 'rule_id', + 'entity_id_field' => 'website_id' + ), + 'customer_group' => array( + 'associations_table' => 'salesrule_customer_group', + 'rule_id_field' => 'rule_id', + 'entity_id_field' => 'customer_group_id' + ) + ); + + /** + * Set resource model and determine field mapping */ protected function _construct() { @@ -45,72 +62,100 @@ class Mage_SalesRule_Model_Resource_Rule_Collection extends Mage_Core_Model_Reso } /** - * Set filter to select rules that matches current criteria + * Filter collection by specified website, customer group, coupon code, date. + * Filter collection to use only active rules. + * Involved sorting by sort_order column. + * + * @param int $websiteId + * @param int $customerGroupId + * @param string $couponCode + * @param string|null $now + * @use $this->addWebsiteGroupDateFilter() * - * @param unknown_type $websiteId - * @param unknown_type $customerGroupId - * @param unknown_type $couponCode - * @param unknown_type $now * @return Mage_SalesRule_Model_Resource_Rule_Collection */ public function setValidationFilter($websiteId, $customerGroupId, $couponCode = '', $now = null) { - if (is_null($now)) { - $now = Mage::getModel('Mage_Core_Model_Date')->date('Y-m-d'); - } - /* We need to overwrite joinLeft if coupon is applied */ - $this->getSelect()->reset(); - parent::_initSelect(); + if (!$this->getFlag('validation_filter')) { - $this->addFieldToFilter('website_ids', array('finset' => (int)$websiteId)) - ->addFieldToFilter('customer_group_ids', array('finset' => (int)$customerGroupId)) - ->addFieldToFilter('is_active', 1); + /* We need to overwrite joinLeft if coupon is applied */ + $this->getSelect()->reset(); + parent::_initSelect(); - if ($couponCode) { - $this->getSelect() - ->joinLeft( + $this->addWebsiteGroupDateFilter($websiteId, $customerGroupId, $now); + $select = $this->getSelect(); + + if (strlen($couponCode)) { + $select->joinLeft( array('rule_coupons' => $this->getTable('salesrule_coupon')), 'main_table.rule_id = rule_coupons.rule_id ', array('code') ); - $this->getSelect()->where( - '(main_table.coupon_type = ? ', Mage_SalesRule_Model_Rule::COUPON_TYPE_NO_COUPON - ); - $this->getSelect()->orWhere('rule_coupons.code = ?)', $couponCode); - } else { - $this->addFieldToFilter('main_table.coupon_type', Mage_SalesRule_Model_Rule::COUPON_TYPE_NO_COUPON); + $select->where('(main_table.coupon_type = ? ', Mage_SalesRule_Model_Rule::COUPON_TYPE_NO_COUPON) + ->orWhere('(main_table.coupon_type = ? AND rule_coupons.type = 0', + Mage_SalesRule_Model_Rule::COUPON_TYPE_AUTO) + ->orWhere('main_table.coupon_type = ? AND main_table.use_auto_generation = 1 ' . + 'AND rule_coupons.type = 1', Mage_SalesRule_Model_Rule::COUPON_TYPE_SPECIFIC) + ->orWhere('main_table.coupon_type = ? AND main_table.use_auto_generation = 0 ' . + 'AND rule_coupons.type = 0)', Mage_SalesRule_Model_Rule::COUPON_TYPE_SPECIFIC) + ->where('rule_coupons.code = ?)', $couponCode); + } else { + $this->addFieldToFilter('main_table.coupon_type', Mage_SalesRule_Model_Rule::COUPON_TYPE_NO_COUPON); + } + $this->setOrder('sort_order', self::SORT_ORDER_ASC); + $this->setFlag('validation_filter', true); } - $this->getSelect()->where('from_date is null or from_date <= ?', $now); - $this->getSelect()->where('to_date is null or to_date >= ?', $now); - $this->getSelect()->order('sort_order'); + return $this; } /** - * Filter collection by specified website IDs + * Filter collection by website(s), customer group(s) and date. + * Filter collection to only active rules. + * Sorting is not involved * - * @param int|array $websiteIds - * @return Mage_SalesRule_Model_Resource_Rule_Collection + * @param int $websiteId + * @param int $customerGroupId + * @param string|null $now + * @use $this->addWebsiteFilter() + * + * @return Mage_SalesRule_Model_Mysql4_Rule_Collection */ - public function addWebsiteFilter($websiteIds) + public function addWebsiteGroupDateFilter($websiteId, $customerGroupId, $now = null) { - if (!is_array($websiteIds)) { - $websiteIds = array($websiteIds); - } - $parts = array(); - foreach ($websiteIds as $websiteId) { - $parts[] = $this->getConnection() - ->prepareSqlCondition('main_table.website_ids', array('finset' => $websiteId)); - } - if ($parts) { - $this->getSelect()->where(new Zend_Db_Expr(implode(' OR ', $parts))); + if (!$this->getFlag('website_group_date_filter')) { + if (is_null($now)) { + $now = Mage::getModel('Mage_Core_Model_Date')->date('Y-m-d'); + } + + $this->addWebsiteFilter($websiteId); + + $entityInfo = $this->_getAssociatedEntityInfo('customer_group'); + $connection = $this->getConnection(); + $this->getSelect() + ->joinInner( + array('customer_group_ids' => $this->getTable($entityInfo['associations_table'])), + $connection->quoteInto( + 'main_table.' . $entityInfo['rule_id_field'] + . ' = customer_group_ids.' . $entityInfo['rule_id_field'] + . ' AND customer_group_ids.' . $entityInfo['entity_id_field'] . ' = ?', + (int)$customerGroupId + ), + array() + ) + ->where('from_date is null or from_date <= ?', $now) + ->where('to_date is null or to_date >= ?', $now); + + $this->addIsActiveFilter(); + + $this->setFlag('website_group_date_filter', true); } + return $this; } /** - * Init collection select - * + * Add primary coupon to collection * * @return Mage_SalesRule_Model_Resource_Rule_Collection */ @@ -130,6 +175,7 @@ class Mage_SalesRule_Model_Resource_Rule_Collection extends Mage_Core_Model_Reso * Find product attribute in conditions or actions * * @param string $attributeCode + * * @return Mage_SalesRule_Model_Resource_Rule_Collection */ public function addAttributeInConditionFilter($attributeCode) @@ -144,4 +190,19 @@ class Mage_SalesRule_Model_Resource_Rule_Collection extends Mage_Core_Model_Reso return $this; } + + /** + * Excludes price rules with generated specific coupon codes from collection + * + * @return Mage_SalesRule_Model_Resource_Rule_Collection + */ + public function addAllowedSalesRulesFilter() + { + $this->addFieldToFilter( + 'main_table.use_auto_generation', + array('neq' => 1) + ); + + return $this; + } } diff --git a/app/code/core/Mage/SalesRule/Model/Resource/Rule/Customer.php b/app/code/core/Mage/SalesRule/Model/Resource/Rule/Customer.php index b933e60cd49569152f79b533f0a5a82ee55b9b7f..c3016323c699a3e3fd5070a3e3f4698d09d31cad 100755 --- a/app/code/core/Mage/SalesRule/Model/Resource/Rule/Customer.php +++ b/app/code/core/Mage/SalesRule/Model/Resource/Rule/Customer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/SalesRule/Model/Resource/Rule/Customer/Collection.php b/app/code/core/Mage/SalesRule/Model/Resource/Rule/Customer/Collection.php index 812bf623959351c0222f4769f8dea21bba833e42..281f9b55ae023461a80cf3ffe077c64050bb956d 100755 --- a/app/code/core/Mage/SalesRule/Model/Resource/Rule/Customer/Collection.php +++ b/app/code/core/Mage/SalesRule/Model/Resource/Rule/Customer/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/SalesRule/Model/Rule.php b/app/code/core/Mage/SalesRule/Model/Rule.php index 0c5b83a6ebda041cded060a2e3ffb858b3bfe984..c58fcdb8c57f43ac5c788db36cdb5d38ee9a8bf0 100644 --- a/app/code/core/Mage/SalesRule/Model/Rule.php +++ b/app/code/core/Mage/SalesRule/Model/Rule.php @@ -20,13 +20,13 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ /** - * SalesRule Model + * Shopping Cart Rule data model * * @method Mage_SalesRule_Model_Resource_Rule _getResource() * @method Mage_SalesRule_Model_Resource_Rule getResource() @@ -40,6 +40,8 @@ * @method Mage_SalesRule_Model_Rule setToDate(string $value) * @method int getUsesPerCustomer() * @method Mage_SalesRule_Model_Rule setUsesPerCustomer(int $value) + * @method int getUsesPerCoupon() + * @method Mage_SalesRule_Model_Rule setUsesPerCoupon(int $value) * @method string getCustomerGroupIds() * @method Mage_SalesRule_Model_Rule setCustomerGroupIds(string $value) * @method int getIsActive() @@ -76,16 +78,30 @@ * @method Mage_SalesRule_Model_Rule setWebsiteIds(string $value) * @method int getCouponType() * @method Mage_SalesRule_Model_Rule setCouponType(int $value) + * @method int getUseAutoGeneration() + * @method Mage_SalesRule_Model_Rule setUseAutoGeneration(int $value) + * @method string getCouponCode() + * @method Mage_SalesRule_Model_Rule setCouponCode(string $value) * * @category Mage * @package Mage_SalesRule * @author Magento Core Team <core@magentocommerce.com> */ -class Mage_SalesRule_Model_Rule extends Mage_Rule_Model_Rule +class Mage_SalesRule_Model_Rule extends Mage_Rule_Model_Abstract { - const FREE_SHIPPING_ITEM = 1; + /** + * Free Shipping option "For matching items only" + */ + const FREE_SHIPPING_ITEM = 1; + + /** + * Free Shipping option "For shipment with matching items" + */ const FREE_SHIPPING_ADDRESS = 2; + /** + * Coupon types + */ const COUPON_TYPE_NO_COUPON = 1; const COUPON_TYPE_SPECIFIC = 2; const COUPON_TYPE_AUTO = 3; @@ -100,8 +116,9 @@ class Mage_SalesRule_Model_Rule extends Mage_Rule_Model_Rule const CART_FIXED_ACTION = 'cart_fixed'; const BUY_X_GET_Y_ACTION = 'buy_x_get_y'; - /** + * Store coupon code generator instance + * * @var Mage_SalesRule_Model_Coupon_CodegeneratorInterface */ protected static $_couponCodeGenerator; @@ -122,6 +139,13 @@ class Mage_SalesRule_Model_Rule extends Mage_Rule_Model_Rule */ protected $_eventObject = 'rule'; + /** + * Contain sores labels + * + * @deprecated after 1.6.2.0 + * + * @var array + */ protected $_labels = array(); /** @@ -146,12 +170,15 @@ class Mage_SalesRule_Model_Rule extends Mage_Rule_Model_Rule protected $_couponTypes; /** - * Array of already validated addresses and validation results + * Store already validated addresses and validation results * * @var array */ protected $_validatedAddresses = array(); + /** + * Set resource model and Id field name + */ protected function _construct() { parent::_construct(); @@ -160,183 +187,169 @@ class Mage_SalesRule_Model_Rule extends Mage_Rule_Model_Rule } /** - * Set code generator instance for auto generated coupons + * Returns code mass generator instance for auto generated specific coupons * - * @return Mage_SalesRule_Model_Coupon_CodegeneratorInterface + * @return Mage_SalesRule_Model_Coupon_MassgneratorInterface */ - public static function getCouponCodeGenerator() + public static function getCouponMassGenerator() { - if (!self::$_couponCodeGenerator) { - return Mage::getSingleton('Mage_SalesRule_Model_Coupon_Codegenerator', array('length' => 16)); - } - return self::$_couponCodeGenerator; + return Mage::getSingleton('Mage_SalesRule_Model_Coupon_Massgenerator'); } /** - * Set code generator instance for auto generated coupons + * Set coupon code and uses per coupon * - * @param Mage_SalesRule_Model_Coupon_CodegeneratorInterface + * @return Mage_SalesRule_Model_Rule */ - public static function setCouponCodeGenerator(Mage_SalesRule_Model_Coupon_CodegeneratorInterface $codeGenerator) + protected function _afterLoad() { - self::$_couponCodeGenerator = $codeGenerator; + $this->setCouponCode($this->getPrimaryCoupon()->getCode()); + if ($this->getUsesPerCoupon() !== null && !$this->getUseAutoGeneration()) { + $this->setUsesPerCoupon($this->getPrimaryCoupon()->getUsageLimit()); + } + return parent::_afterLoad(); } /** - * Retrieve rule's primary coupon + * Save/delete coupon * - * @return Mage_SalesRule_Model_Coupon + * @return Mage_SalesRule_Model_Rule */ - public function getPrimaryCoupon() + protected function _afterSave() { - if ($this->_primaryCoupon === null) { - $this->_primaryCoupon = Mage::getModel('Mage_SalesRule_Model_Coupon'); - $this->_primaryCoupon->loadPrimaryByRule($this->getId()); - $this->_primaryCoupon->setRule($this)->setIsPrimary(true); + $couponCode = trim($this->getCouponCode()); + if (strlen($couponCode) + && $this->getCouponType() == self::COUPON_TYPE_SPECIFIC + && !$this->getUseAutoGeneration() + ) { + $this->getPrimaryCoupon() + ->setCode($couponCode) + ->setUsageLimit($this->getUsesPerCoupon() ? $this->getUsesPerCoupon() : null) + ->setUsagePerCustomer($this->getUsesPerCustomer() ? $this->getUsesPerCustomer() : null) + ->setExpirationDate($this->getToDate()) + ->save(); + } else { + $this->getPrimaryCoupon()->delete(); } - return $this->_primaryCoupon; + + parent::_afterSave(); + return $this; } /** - * Processing object after load data + * Initialize rule model data from array. + * Set store labels if applicable. + * + * @param array $data * - * @return Mage_Core_Model_Abstract + * @return Mage_SalesRule_Model_Rule */ - protected function _afterLoad() + public function loadPost(array $data) { - $this->setCouponCode($this->getPrimaryCoupon()->getCode()); - $this->setUsesPerCoupon($this->getPrimaryCoupon()->getUsageLimit()); - return parent::_afterLoad(); + parent::loadPost($data); + + if (isset($data['store_labels'])) { + $this->setStoreLabels($data['store_labels']); + } + + return $this; } + /** + * Get rule condition combine model instance + * + * @return Mage_SalesRule_Model_Rule_Condition_Combine + */ public function getConditionsInstance() { return Mage::getModel('Mage_SalesRule_Model_Rule_Condition_Combine'); } + /** + * Get rule condition product combine model instance + * + * @return Mage_SalesRule_Model_Rule_Condition_Product_Combine + */ public function getActionsInstance() { return Mage::getModel('Mage_SalesRule_Model_Rule_Condition_Product_Combine'); } - public function toString($format='') - { - $str = Mage::helper('Mage_SalesRule_Helper_Data')->__("Name: %s", $this->getName()) ."\n" - . Mage::helper('Mage_SalesRule_Helper_Data')->__("Start at: %s", $this->getStartAt()) ."\n" - . Mage::helper('Mage_SalesRule_Helper_Data')->__("Expire at: %s", $this->getExpireAt()) ."\n" - . Mage::helper('Mage_SalesRule_Helper_Data')->__("Customer registered: %s", $this->getCustomerRegistered()) ."\n" - . Mage::helper('Mage_SalesRule_Helper_Data')->__("Customer is new buyer: %s", $this->getCustomerNewBuyer()) ."\n" - . Mage::helper('Mage_SalesRule_Helper_Data')->__("Description: %s", $this->getDescription()) ."\n\n" - . $this->getConditions()->toStringRecursive() ."\n\n" - . $this->getActions()->toStringRecursive() ."\n\n"; - return $str; - } - /** - * Initialize rule model data from array + * Returns code generator instance for auto generated coupons * - * @param array $rule - * @return Mage_SalesRule_Model_Rule + * @return Mage_SalesRule_Model_Coupon_CodegeneratorInterface */ - public function loadPost(array $rule) + public static function getCouponCodeGenerator() { - $arr = $this->_convertFlatToRecursive($rule); - if (isset($arr['conditions'])) { - $this->getConditions()->setConditions(array())->loadArray($arr['conditions'][1]); - } - if (isset($arr['actions'])) { - $this->getActions()->setActions(array())->loadArray($arr['actions'][1], 'actions'); - } - if (isset($rule['store_labels'])) { - $this->setStoreLabels($rule['store_labels']); + if (!self::$_couponCodeGenerator) { + return Mage::getSingleton('Mage_SalesRule_Model_Coupon_Codegenerator', array('length' => 16)); } - return $this; + return self::$_couponCodeGenerator; } /** - * Returns rule as an array for admin interface - * - * Output example: - * array( - * 'name'=>'Example rule', - * 'conditions'=>{condition_combine::toArray} - * 'actions'=>{action_collection::toArray} - * ) + * Set code generator instance for auto generated coupons * - * @return array + * @param Mage_SalesRule_Model_Coupon_CodegeneratorInterface */ - public function toArray(array $arrAttributes = array()) + public static function setCouponCodeGenerator(Mage_SalesRule_Model_Coupon_CodegeneratorInterface $codeGenerator) { - $out = parent::toArray($arrAttributes); - $out['customer_registered'] = $this->getCustomerRegistered(); - $out['customer_new_buyer'] = $this->getCustomerNewBuyer(); - - return $out; + self::$_couponCodeGenerator = $codeGenerator; } - public function getResourceCollection() + /** + * Retrieve rule's primary coupon + * + * @return Mage_SalesRule_Model_Coupon + */ + public function getPrimaryCoupon() { - return Mage::getResourceModel('Mage_SalesRule_Model_Resource_Rule_Collection'); + if ($this->_primaryCoupon === null) { + $this->_primaryCoupon = Mage::getModel('Mage_SalesRule_Model_Coupon'); + $this->_primaryCoupon->loadPrimaryByRule($this->getId()); + $this->_primaryCoupon->setRule($this)->setIsPrimary(true); + } + return $this->_primaryCoupon; } /** - * Save rule labels after rule save and process product attributes used in actions and conditions + * Get sales rule customer group Ids * - * @return Mage_SalesRule_Model_Rule + * @return array */ - protected function _afterSave() + public function getCustomerGroupIds() { - if ($this->hasStoreLabels()) { - $this->_getResource()->saveStoreLabels($this->getId(), $this->getStoreLabels()); - } - $couponCode = trim($this->getCouponCode()); - if ($couponCode && $this->getCouponType() == self::COUPON_TYPE_SPECIFIC) { - $this->getPrimaryCoupon() - ->setCode($couponCode) - ->setUsageLimit($this->getUsesPerCoupon() ? $this->getUsesPerCoupon() : null) - ->setUsagePerCustomer($this->getUsesPerCustomer() ? $this->getUsesPerCustomer() : null) - ->setExpirationDate($this->getToDate()) - ->save(); - } else { - $this->getPrimaryCoupon()->delete(); + if (!$this->hasCustomerGroupIds()) { + $customerGroupIds = $this->_getResource()->getCustomerGroupIds($this->getId()); + $this->setData('customer_group_ids', (array)$customerGroupIds); } - - //Saving attributes used in rule - $ruleProductAttributes = array_merge( - $this->_getUsedAttributes($this->getConditionsSerialized()), - $this->_getUsedAttributes($this->getActionsSerialized()) - ); - if (count($ruleProductAttributes)) { - $this->getResource()->setActualProductAttributes($this, $ruleProductAttributes); - } - return parent::_afterSave(); + return $this->_getData('customer_group_ids'); } /** - * Get Rule label for specific store + * Get Rule label by specified store + * + * @param Mage_Core_Model_Store|int|bool|null $store * - * @param store $store - * @return string | false + * @return string|bool */ - public function getStoreLabel($store=null) + public function getStoreLabel($store = null) { $storeId = Mage::app()->getStore($store)->getId(); - if ($this->hasStoreLabels()) { - $labels = $this->_getData('store_labels'); - if (isset($labels[$storeId])) { - return $labels[$storeId]; - } elseif ($labels[0]) { - return $labels[0]; - } - return false; - } elseif (!isset($this->_labels[$storeId])) { - $this->_labels[$storeId] = $this->_getResource()->getStoreLabel($this->getId(), $storeId); + $labels = (array)$this->getStoreLabels(); + + if (isset($labels[$storeId])) { + return $labels[$storeId]; + } elseif (isset($labels[0]) && $labels[0]) { + return $labels[0]; } - return $this->_labels[$storeId]; + + return false; } /** - * Get all existing rule labels + * Set if not yet and retrieve rule store labels * * @return array */ @@ -346,6 +359,7 @@ class Mage_SalesRule_Model_Rule extends Mage_Rule_Model_Rule $labels = $this->_getResource()->getStoreLabels($this->getId()); $this->setStoreLabels($labels); } + return $this->_getData('store_labels'); } @@ -378,8 +392,8 @@ class Mage_SalesRule_Model_Rule extends Mage_Rule_Model_Rule Mage_SalesRule_Model_Rule::COUPON_TYPE_SPECIFIC => Mage::helper('Mage_SalesRule_Helper_Data')->__('Specific Coupon'), ); $transport = new Varien_Object(array( - 'coupon_types' => $this->_couponTypes, - 'is_coupon_type_auto_visible' => false + 'coupon_types' => $this->_couponTypes, + 'is_coupon_type_auto_visible' => false )); Mage::dispatchEvent('salesrule_rule_get_coupon_types', array('transport' => $transport)); $this->_couponTypes = $transport->getCouponTypes(); @@ -393,8 +407,9 @@ class Mage_SalesRule_Model_Rule extends Mage_Rule_Model_Rule /** * Acquire coupon instance * - * @param bool Whether or not to save newly created coupon - * @param int Number of attempts to save newly created coupon + * @param bool $saveNewlyCreated Whether or not to save newly created coupon + * @param int $saveAttemptCount Number of attempts to save newly created coupon + * * @return Mage_SalesRule_Model_Coupon|null */ public function acquireCoupon($saveNewlyCreated = true, $saveAttemptCount = 10) @@ -407,13 +422,15 @@ class Mage_SalesRule_Model_Rule extends Mage_Rule_Model_Rule } /** @var Mage_SalesRule_Model_Coupon $coupon */ $coupon = Mage::getModel('Mage_SalesRule_Model_Coupon'); - $coupon->setRule($this)->setIsPrimary(false); - $coupon->setUsageLimit($this->getUsesPerCoupon() ? $this->getUsesPerCoupon() : null) - ->setUsagePerCustomer($this->getUsesPerCustomer() ? $this->getUsesPerCustomer() : null) - ->setExpirationDate($this->getToDate()); + $coupon->setRule($this) + ->setIsPrimary(false) + ->setUsageLimit($this->getUsesPerCoupon() ? $this->getUsesPerCoupon() : null) + ->setUsagePerCustomer($this->getUsesPerCustomer() ? $this->getUsesPerCustomer() : null) + ->setExpirationDate($this->getToDate()); $couponCode = self::getCouponCodeGenerator()->generateCode(); $coupon->setCode($couponCode); + $ok = false; if (!$saveNewlyCreated) { $ok = true; @@ -443,24 +460,6 @@ class Mage_SalesRule_Model_Rule extends Mage_Rule_Model_Rule return $coupon; } - /** - * Return all product attributes used on serialized action or condition - * - * @param string $serializedString - * @return array - */ - protected function _getUsedAttributes($serializedString) - { - $result = array(); - if (preg_match_all('~s:32:"salesrule/rule_condition_product";s:9:"attribute";s:\d+:"(.*?)"~s', - $serializedString, $matches)){ - foreach ($matches[1] as $offset => $attributeCode) { - $result[] = $attributeCode; - } - } - return $result; - } - /** * Check cached validation result for specific address * @@ -511,4 +510,55 @@ class Mage_SalesRule_Model_Rule extends Mage_Rule_Model_Rule } return $address; } + + + + + + /** + * Collect all product attributes used in serialized rule's action or condition + * + * @deprecated after 1.6.2.0 use Mage_SalesRule_Model_Resource_Rule::getProductAttributes() instead + * + * @param string $serializedString + * + * @return array + */ + protected function _getUsedAttributes($serializedString) + { + return $this->_getResource()->getProductAttributes($serializedString); + } + + /** + * @deprecated after 1.6.2.0 + * + * @param string $format + * + * @return string + */ + public function toString($format='') + { + return ''; + } + + /** + * Returns rule as an array for admin interface + * + * @deprecated after 1.6.2.0 + * + * @param array $arrAttributes + * + * Output example: + * array( + * 'name'=>'Example rule', + * 'conditions'=>{condition_combine::toArray} + * 'actions'=>{action_collection::toArray} + * ) + * + * @return array + */ + public function toArray(array $arrAttributes = array()) + { + return parent::toArray($arrAttributes); + } } diff --git a/app/code/core/Mage/SalesRule/Model/Rule/Action/Collection.php b/app/code/core/Mage/SalesRule/Model/Rule/Action/Collection.php index 7d9e6cadd33494095a441f329021330da79ca57a..932634a7c00423b7d4cf1ba86c9c4ba19dab3b09 100644 --- a/app/code/core/Mage/SalesRule/Model/Rule/Action/Collection.php +++ b/app/code/core/Mage/SalesRule/Model/Rule/Action/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/SalesRule/Model/Rule/Action/Product.php b/app/code/core/Mage/SalesRule/Model/Rule/Action/Product.php index 6fd7b8352f11df3a09259f21f55dc15dd6703e6f..02cd04a6e84a0947224a0057eb4dbe925f5edf1f 100644 --- a/app/code/core/Mage/SalesRule/Model/Rule/Action/Product.php +++ b/app/code/core/Mage/SalesRule/Model/Rule/Action/Product.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/SalesRule/Model/Rule/Condition/Address.php b/app/code/core/Mage/SalesRule/Model/Rule/Condition/Address.php index ecf8468eab40d22370fa398a8f6b9f068310be45..3712538ba96b28bc59899dcd4c398fc1cbafb1d2 100644 --- a/app/code/core/Mage/SalesRule/Model/Rule/Condition/Address.php +++ b/app/code/core/Mage/SalesRule/Model/Rule/Condition/Address.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/SalesRule/Model/Rule/Condition/Combine.php b/app/code/core/Mage/SalesRule/Model/Rule/Condition/Combine.php index 19a96dc1ff6c1c8b5d4881685bdfb219c3972636..b12c4c339965ee0c955ebe1bfb32935a0bb5ee2b 100644 --- a/app/code/core/Mage/SalesRule/Model/Rule/Condition/Combine.php +++ b/app/code/core/Mage/SalesRule/Model/Rule/Condition/Combine.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/SalesRule/Model/Rule/Condition/Product.php b/app/code/core/Mage/SalesRule/Model/Rule/Condition/Product.php index 1171b1fb67ce55a60eaee5baaf2eac404c98341a..f392a572e546c80be582e44a4be4a6a2679a344b 100644 --- a/app/code/core/Mage/SalesRule/Model/Rule/Condition/Product.php +++ b/app/code/core/Mage/SalesRule/Model/Rule/Condition/Product.php @@ -20,14 +20,25 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -class Mage_SalesRule_Model_Rule_Condition_Product extends Mage_CatalogRule_Model_Rule_Condition_Product +/** + * Product rule condition data model + * + * @category Mage + * @package Mage_SalesRule + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_SalesRule_Model_Rule_Condition_Product extends Mage_Rule_Model_Condition_Product_Abstract { - + /** + * Add special attributes + * + * @param array $attributes + */ protected function _addSpecialAttributes(array &$attributes) { parent::_addSpecialAttributes($attributes); @@ -40,6 +51,7 @@ class Mage_SalesRule_Model_Rule_Condition_Product extends Mage_CatalogRule_Model * Validate Product Rule Condition * * @param Varien_Object $object + * * @return bool */ public function validate(Varien_Object $object) diff --git a/app/code/core/Mage/SalesRule/Model/Rule/Condition/Product/Combine.php b/app/code/core/Mage/SalesRule/Model/Rule/Condition/Product/Combine.php index 09b42da81bc524ee216b9d2801a55f701a348764..2ce01863f0540efa305a319d22e3670371b58833 100644 --- a/app/code/core/Mage/SalesRule/Model/Rule/Condition/Product/Combine.php +++ b/app/code/core/Mage/SalesRule/Model/Rule/Condition/Product/Combine.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/SalesRule/Model/Rule/Condition/Product/Found.php b/app/code/core/Mage/SalesRule/Model/Rule/Condition/Product/Found.php index 9fdcd57fda0d4139e3a71ac982c1c66868fdb5ff..575f26e76902351a3c9076de6fa2898af4b8048c 100644 --- a/app/code/core/Mage/SalesRule/Model/Rule/Condition/Product/Found.php +++ b/app/code/core/Mage/SalesRule/Model/Rule/Condition/Product/Found.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -50,12 +50,10 @@ class Mage_SalesRule_Model_Rule_Condition_Product_Found public function asHtml() { - $html = $this->getTypeElement()->getHtml(). - Mage::helper('Mage_SalesRule_Helper_Data')->__("If an item is %s in the cart with %s of these conditions true:", - $this->getValueElement()->getHtml(), $this->getAggregatorElement()->getHtml()); - if ($this->getId()!='1') { - $html.= $this->getRemoveLinkHtml(); - } + $html = $this->getTypeElement()->getHtml() . Mage::helper('Mage_SalesRule_Helper_Data')->__("If an item is %s in the cart with %s of these conditions true:", $this->getValueElement()->getHtml(), $this->getAggregatorElement()->getHtml()); + if ($this->getId() != '1') { + $html.= $this->getRemoveLinkHtml(); + } return $html; } diff --git a/app/code/core/Mage/SalesRule/Model/Rule/Condition/Product/Subselect.php b/app/code/core/Mage/SalesRule/Model/Rule/Condition/Product/Subselect.php index f5d6fec5e6189d7d223f1923c210d7db12fe7da1..8f52c0a60d059993c4ead5428ace3beaeb951307 100644 --- a/app/code/core/Mage/SalesRule/Model/Rule/Condition/Product/Subselect.php +++ b/app/code/core/Mage/SalesRule/Model/Rule/Condition/Product/Subselect.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -45,29 +45,17 @@ class Mage_SalesRule_Model_Rule_Condition_Product_Subselect public function asXml($containerKey='conditions', $itemKey='condition') { - $xml .= '<attribute>'.$this->getAttribute().'</attribute>' - .'<operator>'.$this->getOperator().'</operator>' - .parent::asXml($containerKey, $itemKey); + $xml = '<attribute>'.$this->getAttribute().'</attribute>' + . '<operator>'.$this->getOperator().'</operator>' + . parent::asXml($containerKey, $itemKey); return $xml; } -// public function loadAggregatorOptions() -// { -// $this->setAggregatorOption(array( -// '1/all' => Mage::helper('Mage_Rule_Helper_Data')->__('MATCHING ALL'), -// '1/any' => Mage::helper('Mage_Rule_Helper_Data')->__('MATCHING ANY'), -// '0/all' => Mage::helper('Mage_Rule_Helper_Data')->__('NOT MATCHING ALL'), -// '0/any' => Mage::helper('Mage_Rule_Helper_Data')->__('NOT MATCHING ANY'), -// )); -// return $this; -// } - public function loadAttributeOptions() { - $hlp = Mage::helper('Mage_SalesRule_Helper_Data'); $this->setAttributeOption(array( - 'qty' => $hlp->__('total quantity'), - 'base_row_total' => $hlp->__('total amount'), + 'qty' => Mage::helper('Mage_SalesRule_Helper_Data')->__('total quantity'), + 'base_row_total' => Mage::helper('Mage_SalesRule_Helper_Data')->__('total amount'), )); return $this; } @@ -100,15 +88,10 @@ class Mage_SalesRule_Model_Rule_Condition_Product_Subselect public function asHtml() { $html = $this->getTypeElement()->getHtml(). - Mage::helper('Mage_SalesRule_Helper_Data')->__("If %s %s %s for a subselection of items in cart matching %s of these conditions:", - $this->getAttributeElement()->getHtml(), - $this->getOperatorElement()->getHtml(), - $this->getValueElement()->getHtml(), - $this->getAggregatorElement()->getHtml() - ); - if ($this->getId()!='1') { - $html.= $this->getRemoveLinkHtml(); - } + Mage::helper('Mage_SalesRule_Helper_Data')->__("If %s %s %s for a subselection of items in cart matching %s of these conditions:", $this->getAttributeElement()->getHtml(), $this->getOperatorElement()->getHtml(), $this->getValueElement()->getHtml(), $this->getAggregatorElement()->getHtml()); + if ($this->getId() != '1') { + $html .= $this->getRemoveLinkHtml(); + } return $html; } diff --git a/app/code/core/Mage/SalesRule/Model/Rule/Customer.php b/app/code/core/Mage/SalesRule/Model/Rule/Customer.php index 3a9d09b0edd8eb7e1b3d2b916c747d90a0a54b2c..5d912b212ce0f887eed1ce187d5a9ccf9d74dd9c 100644 --- a/app/code/core/Mage/SalesRule/Model/Rule/Customer.php +++ b/app/code/core/Mage/SalesRule/Model/Rule/Customer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/SalesRule/Model/System/Config/Source/Coupon/Format.php b/app/code/core/Mage/SalesRule/Model/System/Config/Source/Coupon/Format.php new file mode 100755 index 0000000000000000000000000000000000000000..1b560d744da319f2f96a64501d41dd7e8af554a9 --- /dev/null +++ b/app/code/core/Mage/SalesRule/Model/System/Config/Source/Coupon/Format.php @@ -0,0 +1,54 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_SalesRule + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Options for Code Format Field in Auto Generated Specific Coupon Codes configuration section + * + * @category Mage + * @package Mage_SalesRule + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_SalesRule_Model_System_Config_Source_Coupon_Format +{ + /** + * Options getter + * + * @return array + */ + public function toOptionArray() + { + $formatsList = Mage::helper('Mage_SalesRule_Helper_Coupon')->getFormatsList(); + $result = array(); + foreach ($formatsList as $formatId => $formatTitle) { + $result[] = array( + 'value' => $formatId, + 'label' => $formatTitle + ); + } + + return $result; + } +} \ No newline at end of file diff --git a/app/code/core/Mage/SalesRule/Model/Validator.php b/app/code/core/Mage/SalesRule/Model/Validator.php index d16b6261e96b48d9794f96cedd50b9a029598e98..fc40996ba0b37fa70c11086408c399389bc62c8e 100644 --- a/app/code/core/Mage/SalesRule/Model/Validator.php +++ b/app/code/core/Mage/SalesRule/Model/Validator.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -388,7 +388,7 @@ class Mage_SalesRule_Model_Validator extends Mage_Core_Model_Abstract case Mage_SalesRule_Model_Rule::BUY_X_GET_Y_ACTION: $x = $rule->getDiscountStep(); $y = $rule->getDiscountAmount(); - if (!$x || $y>=$x) { + if (!$x || $y > $x) { break; } $buyAndDiscountQty = $x + $y; @@ -683,7 +683,7 @@ class Mage_SalesRule_Model_Validator extends Mage_Core_Model_Abstract Rule is a part of rules collection, which includes only rules with 'No Coupon' type or with validated coupon. As a result, if rule uses coupon code(s) ('Specific' or 'Auto' Coupon Type), it always contains validated coupon */ - if ($rule->getCoponType() != Mage_SalesRule_Model_Rule::COUPON_TYPE_NO_COUPON) { + if ($rule->getCouponType() != Mage_SalesRule_Model_Rule::COUPON_TYPE_NO_COUPON) { $address->setCouponCode($this->getCouponCode()); } @@ -704,11 +704,11 @@ class Mage_SalesRule_Model_Validator extends Mage_Core_Model_Abstract $label = ''; if ($ruleLabel) { $label = $ruleLabel; - } else if ($address->getCouponCode()) { + } else if (strlen($address->getCouponCode())) { $label = $address->getCouponCode(); } - if (!empty($label)) { + if (strlen($label)) { $description[$rule->getId()] = $label; } diff --git a/app/code/core/Mage/SalesRule/etc/adminhtml.xml b/app/code/core/Mage/SalesRule/etc/adminhtml.xml index 890853a5ab422581fd36e75874f6902e599fa5ee..9dec343e92467363ad66a6ec19553e6e540ee3b7 100644 --- a/app/code/core/Mage/SalesRule/etc/adminhtml.xml +++ b/app/code/core/Mage/SalesRule/etc/adminhtml.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> @@ -41,13 +41,17 @@ <resources> <admin> <children> - <promo> + <system> <children> - <quote translate="title" module="Mage_SalesRule"> - <title>Shopping Cart Price Rules</title> - </quote> + <config> + <children> + <promo translate="title" module="Mage_SalesRule"> + <title>Shopping Cart Price Rules</title> + </promo> + </children> + </config> </children> - </promo> + </system> </children> </admin> </resources> diff --git a/app/code/core/Mage/SalesRule/etc/config.xml b/app/code/core/Mage/SalesRule/etc/config.xml index 67495d9c0fbf1857ba007642758491bf1e43f51c..8ee555f0393d2193cb98c202cd1295a0bf81a578 100644 --- a/app/code/core/Mage/SalesRule/etc/config.xml +++ b/app/code/core/Mage/SalesRule/etc/config.xml @@ -21,14 +21,14 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> <config> <modules> <Mage_SalesRule> - <version>1.6.0.1</version> + <version>1.6.0.3</version> </Mage_SalesRule> </modules> <global> @@ -57,6 +57,14 @@ </salesrule> </observers> </sales_quote_config_get_product_attributes> + <sales_convert_quote_to_order> + <observers> + <salesrule> + <class>Mage_SalesRule_Model_Observer</class> + <method>addSalesRuleNameToOrder</method> + </salesrule> + </observers> + </sales_convert_quote_to_order> </events> <sales> <quote> @@ -80,6 +88,16 @@ </nominal_totals> </quote> </sales> + <salesrule> + <coupon> + <separator>-</separator> + <charset> + <alphanum>ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789</alphanum> + <alpha>ABCDEFGHIJKLMNOPQRSTUVWXYZ</alpha> + <num>0123456789</num> + </charset> + </coupon> + </salesrule> </global> <adminhtml> <translate> @@ -133,4 +151,12 @@ </aggregate_sales_report_coupons_data> </jobs> </crontab> + <default> + <promo> + <auto_generated_coupon_codes> + <length>12</length> + <format>1</format> + </auto_generated_coupon_codes> + </promo> + </default> </config> diff --git a/app/code/core/Mage/SalesRule/etc/fieldset.xml b/app/code/core/Mage/SalesRule/etc/fieldset.xml index a54cf57713660566d486744a58fcf5ae098108b6..b19dba9b6ed5ce8a8b2ac6c8ff0104cbb8b66813 100644 --- a/app/code/core/Mage/SalesRule/etc/fieldset.xml +++ b/app/code/core/Mage/SalesRule/etc/fieldset.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/SalesRule/etc/system.xml b/app/code/core/Mage/SalesRule/etc/system.xml new file mode 100644 index 0000000000000000000000000000000000000000..66fece631ce6cc94749ceb1e360e7e2fa8715175 --- /dev/null +++ b/app/code/core/Mage/SalesRule/etc/system.xml @@ -0,0 +1,95 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * 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_AFL.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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_SalesRule + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<config> + <sections> + <promo translate="label" module="Mage_SalesRule"> + <class>separator-top</class> + <label>Promotions</label> + <tab>customer</tab> + <frontend_type>text</frontend_type> + <sort_order>400</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>0</show_in_website> + <show_in_store>0</show_in_store> + <groups> + <auto_generated_coupon_codes translate="label" module="Mage_SalesRule"> + <label>Auto Generated Specific Coupon Codes</label> + <show_in_default>1</show_in_default> + <sort_order>10</sort_order> + <fields> + <length translate="label comment" module="Mage_SalesRule"> + <label>Code Length</label> + <frontend_type>text</frontend_type> + <sort_order>10</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>0</show_in_website> + <show_in_store>0</show_in_store> + <comment>Excluding prefix, suffix and separators.</comment> + <frontend_class>validate-digits</frontend_class> + </length> + <format translate="label" module="Mage_SalesRule"> + <label>Code Format</label> + <frontend_type>select</frontend_type> + <source_model>Mage_SalesRule_Model_System_Config_Source_Coupon_Format</source_model> + <sort_order>20</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>0</show_in_website> + <show_in_store>0</show_in_store> + </format> + <prefix translate="label" module="Mage_SalesRule"> + <label>Code Prefix</label> + <frontend_type>text</frontend_type> + <sort_order>30</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>0</show_in_website> + <show_in_store>0</show_in_store> + </prefix> + <suffix translate="label" module="Mage_SalesRule"> + <label>Code Suffix</label> + <frontend_type>text</frontend_type> + <sort_order>40</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>0</show_in_website> + <show_in_store>0</show_in_store> + </suffix> + <dash translate="label comment" module="Mage_SalesRule"> + <label>Dash Every X Characters</label> + <frontend_type>text</frontend_type> + <sort_order>50</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>0</show_in_website> + <show_in_store>0</show_in_store> + <comment>If empty no separation.</comment> + <frontend_class>validate-digits</frontend_class> + </dash> + </fields> + </auto_generated_coupon_codes> + </groups> + </promo> + </sections> +</config> diff --git a/app/code/core/Mage/SalesRule/sql/salesrule_setup/install-1.6.0.0.php b/app/code/core/Mage/SalesRule/sql/salesrule_setup/install-1.6.0.0.php index 2f9db98ab3d5ffa407542dc0dfe4db09d338a587..0dbffcac7026ea8c3ea1cb22df0b4346f3e4d1c5 100644 --- a/app/code/core/Mage/SalesRule/sql/salesrule_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/SalesRule/sql/salesrule_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_SalesRule - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/SalesRule/sql/salesrule_setup/upgrade-1.6.0.0-1.6.0.1.php b/app/code/core/Mage/SalesRule/sql/salesrule_setup/upgrade-1.6.0.0-1.6.0.1.php index 50f7d6fbd8e7c1f41c70206820651846b76c2dc4..97c6591d559e59b5aebaacb6adf3b2a85cf62410 100644 --- a/app/code/core/Mage/SalesRule/sql/salesrule_setup/upgrade-1.6.0.0-1.6.0.1.php +++ b/app/code/core/Mage/SalesRule/sql/salesrule_setup/upgrade-1.6.0.0-1.6.0.1.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/SalesRule/sql/salesrule_setup/upgrade-1.6.0.1-1.6.0.2.php b/app/code/core/Mage/SalesRule/sql/salesrule_setup/upgrade-1.6.0.1-1.6.0.2.php new file mode 100644 index 0000000000000000000000000000000000000000..5cdbef60832fed74832a5748fa4aebc1d34411ea --- /dev/null +++ b/app/code/core/Mage/SalesRule/sql/salesrule_setup/upgrade-1.6.0.1-1.6.0.2.php @@ -0,0 +1,145 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_SalesRule + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * @var $installer Mage_Core_Model_Resource_Setup + */ +$installer = $this; + +$installer->getConnection() + ->addColumn( + $installer->getTable('salesrule_coupon'), + 'created_at', + array( + 'type' => Varien_Db_Ddl_Table::TYPE_TIMESTAMP, + 'comment' => 'Coupon Code Creation Date', + 'nullable' => false, + 'default' => Varien_Db_Ddl_Table::TIMESTAMP_INIT + ) + ); + +$installer->getConnection()->addColumn( + $installer->getTable('salesrule_coupon'), + 'type', + array( + 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, + 'comment' => 'Coupon Code Type', + 'default' => 0 + ) + ); + +$installer->getConnection() + ->addColumn( + $installer->getTable('salesrule'), + 'use_auto_generation', + array( + 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, + 'comment' => 'Use Auto Generation', + 'nullable' => false, + 'default' => 0 + ) + ); + +$installer->getConnection() + ->addColumn( + $installer->getTable('salesrule'), + 'uses_per_coupon', + array( + 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, + 'comment' => 'Uses Per Coupon', + 'nullable' => false, + 'default' => 0 + ) + ); + +$installer->getConnection() + ->addColumn( + $installer->getTable('coupon_aggregated'), + 'rule_name', + array( + 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, + 'length' => 255, + 'comment' => 'Rule Name', + ) + ); + +$installer->getConnection() + ->addColumn( + $installer->getTable('coupon_aggregated_order'), + 'rule_name', + array( + 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, + 'length' => 255, + 'comment' => 'Rule Name', + ) + ); + +$installer->getConnection() + ->addColumn( + $installer->getTable('coupon_aggregated_updated'), + 'rule_name', + array( + 'type' => Varien_Db_Ddl_Table::TYPE_TEXT, + 'length' => 255, + 'comment' => 'Rule Name', + ) + ); + +$installer->getConnection() + ->addIndex( + $installer->getTable('coupon_aggregated'), + $installer->getIdxName( + 'coupon_aggregated', + array('rule_name'), + Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX + ), + array('rule_name'), + Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX + ); + +$installer->getConnection() + ->addIndex( + $installer->getTable('coupon_aggregated_order'), + $installer->getIdxName( + 'coupon_aggregated_order', + array('rule_name'), + Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX + ), + array('rule_name'), + Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX + ); + +$installer->getConnection() + ->addIndex( + $installer->getTable('coupon_aggregated_updated'), + $installer->getIdxName( + 'coupon_aggregated_updated', + array('rule_name'), + Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX + ), + array('rule_name'), + Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX + ); diff --git a/app/code/core/Mage/SalesRule/sql/salesrule_setup/upgrade-1.6.0.2-1.6.0.3.php b/app/code/core/Mage/SalesRule/sql/salesrule_setup/upgrade-1.6.0.2-1.6.0.3.php new file mode 100644 index 0000000000000000000000000000000000000000..9e826d646d78c96d928cbcc6c919db91a653762b --- /dev/null +++ b/app/code/core/Mage/SalesRule/sql/salesrule_setup/upgrade-1.6.0.2-1.6.0.3.php @@ -0,0 +1,182 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_SalesRule + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/* @var $installer Mage_Core_Model_Resource_Setup */ +$installer = $this; +$connection = $installer->getConnection(); + +$rulesTable = $installer->getTable('salesrule'); +$websitesTable = $installer->getTable('core_website'); +$customerGroupsTable = $installer->getTable('customer_group'); +$rulesWebsitesTable = $installer->getTable('salesrule_website'); +$rulesCustomerGroupsTable = $installer->getTable('salesrule_customer_group'); + +$installer->startSetup(); +/** + * Create table 'salesrule_website' if not exists. This table will be used instead of + * column website_ids of main catalog rules table + */ +$table = $connection->newTable($rulesWebsitesTable) + ->addColumn('rule_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array( + 'unsigned' => true, + 'nullable' => false, + 'primary' => true + ), + 'Rule Id' + ) + ->addColumn('website_id', Varien_Db_Ddl_Table::TYPE_SMALLINT, null, array( + 'unsigned' => true, + 'nullable' => false, + 'primary' => true + ), + 'Website Id' + ) + ->addIndex( + $installer->getIdxName('salesrule_website', array('rule_id')), + array('rule_id') + ) + ->addIndex( + $installer->getIdxName('salesrule_website', array('website_id')), + array('website_id') + ) + ->addForeignKey($installer->getFkName('salesrule_website', 'rule_id', 'salesrule', 'rule_id'), + 'rule_id', $rulesTable, 'rule_id', + Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE + ) + ->addForeignKey($installer->getFkName('salesrule_website', 'website_id', 'core/website', 'website_id'), + 'website_id', $websitesTable, 'website_id', + Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE + ) + ->setComment('Sales Rules To Websites Relations'); + +$connection->createTable($table); + + +/** + * Create table 'salesrule_customer_group' if not exists. This table will be used instead of + * column customer_group_ids of main catalog rules table + */ +$table = $connection->newTable($rulesCustomerGroupsTable) + ->addColumn('rule_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array( + 'unsigned' => true, + 'nullable' => false, + 'primary' => true + ), + 'Rule Id' + ) + ->addColumn('customer_group_id', Varien_Db_Ddl_Table::TYPE_SMALLINT, null, array( + 'unsigned' => true, + 'nullable' => false, + 'primary' => true + ), + 'Customer Group Id' + ) + ->addIndex( + $installer->getIdxName('salesrule_customer_group', array('rule_id')), + array('rule_id') + ) + ->addIndex( + $installer->getIdxName('salesrule_customer_group', array('customer_group_id')), + array('customer_group_id') + ) + ->addForeignKey($installer->getFkName('salesrule_customer_group', 'rule_id', 'salesrule', 'rule_id'), + 'rule_id', $rulesTable, 'rule_id', + Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE + ) + ->addForeignKey( + $installer->getFkName('salesrule_customer_group', 'customer_group_id', + 'customer_group', 'customer_group_id' + ), + 'customer_group_id', $customerGroupsTable, 'customer_group_id', + Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE + ) + ->setComment('Sales Rules To Customer Groups Relations'); + +$connection->createTable($table); + + +/** + * Fill out relation table 'salesrule_website' with website Ids + */ +$select = $connection->select() + ->from(array('sr' => $rulesTable), array('sr.rule_id', 'cw.website_id')) + ->join( + array('cw' => $websitesTable), + $connection->prepareSqlCondition( + 'sr.website_ids', array('finset' => new Zend_Db_Expr('cw.website_id')) + ), + array() + ); +$query = $select->insertFromSelect($rulesWebsitesTable, array('rule_id', 'website_id')); +$connection->query($query); + + +/** + * Fill out relation table 'salesrule_customer_group' with customer group Ids + */ + +$select = $connection->select() + ->from(array('sr' => $rulesTable), array('sr.rule_id', 'cg.customer_group_id')) + ->join( + array('cg' => $customerGroupsTable), + $connection->prepareSqlCondition( + 'sr.customer_group_ids', array('finset' => new Zend_Db_Expr('cg.customer_group_id')) + ), + array() + ); +$query = $select->insertFromSelect($rulesCustomerGroupsTable, array('rule_id', 'customer_group_id')); +$connection->query($query); + +/** + * Eliminate obsolete columns + */ +$connection->dropColumn($rulesTable, 'website_ids'); +$connection->dropColumn($rulesTable, 'customer_group_ids'); + +/** + * Change default value to "null" for "from" and "to" dates columns + */ +$connection->modifyColumn( + $rulesTable, + 'from_date', + array( + 'type' => Varien_Db_Ddl_Table::TYPE_DATE, + 'nullable' => true, + 'default' => null + ) +); + +$connection->modifyColumn( + $rulesTable, + 'to_date', + array( + 'type' => Varien_Db_Ddl_Table::TYPE_DATE, + 'nullable' => true, + 'default' => null + ) +); + +$installer->endSetup(); diff --git a/app/code/core/Mage/Sendfriend/Block/Send.php b/app/code/core/Mage/Sendfriend/Block/Send.php index 2fe088fa7ad00cebb6fa4595858dd4ffdc3dffe0..a8d908a858d1d739c9252e38104546f43e0e4336 100644 --- a/app/code/core/Mage/Sendfriend/Block/Send.php +++ b/app/code/core/Mage/Sendfriend/Block/Send.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sendfriend - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sendfriend/Helper/Data.php b/app/code/core/Mage/Sendfriend/Helper/Data.php index 0279d8a3abec418829642bf0892dee19ddfaf816..561982771a602c41b3c882e0ebad09c1cfb0bbe0 100644 --- a/app/code/core/Mage/Sendfriend/Helper/Data.php +++ b/app/code/core/Mage/Sendfriend/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sendfriend - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sendfriend/Model/Observer.php b/app/code/core/Mage/Sendfriend/Model/Observer.php index b5cb158654f7793bb9ece571106f74d91410f016..736681654b4357391b7f2b2bee4a8f49d6334fd2 100644 --- a/app/code/core/Mage/Sendfriend/Model/Observer.php +++ b/app/code/core/Mage/Sendfriend/Model/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sendfriend - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sendfriend/Model/Resource/Sendfriend.php b/app/code/core/Mage/Sendfriend/Model/Resource/Sendfriend.php index 168cd611f37c3f7c48b27241902ebdacc2994864..e7f6bed54860cba52aab20654ee849baec37b1e5 100755 --- a/app/code/core/Mage/Sendfriend/Model/Resource/Sendfriend.php +++ b/app/code/core/Mage/Sendfriend/Model/Resource/Sendfriend.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sendfriend - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sendfriend/Model/Resource/Sendfriend/Collection.php b/app/code/core/Mage/Sendfriend/Model/Resource/Sendfriend/Collection.php index d9dcbfd28c3ce34fd3367eaabfe21f6cad486005..146a57cc9e8ff0c9659389c662fb2aa0bae2d5a3 100755 --- a/app/code/core/Mage/Sendfriend/Model/Resource/Sendfriend/Collection.php +++ b/app/code/core/Mage/Sendfriend/Model/Resource/Sendfriend/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sendfriend - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sendfriend/Model/Resource/Setup.php b/app/code/core/Mage/Sendfriend/Model/Resource/Setup.php index 001e7057e62a2bcfea5e91b3ddd825c139c908a2..4028991a552b7cf531e87e8aa1561b0e4a1cca00 100755 --- a/app/code/core/Mage/Sendfriend/Model/Resource/Setup.php +++ b/app/code/core/Mage/Sendfriend/Model/Resource/Setup.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sendfriend - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sendfriend/Model/Sendfriend.php b/app/code/core/Mage/Sendfriend/Model/Sendfriend.php index 3e4e8ebae77ac04fd1a9bc7593171ab46d9b4809..4629150383f78b0d98284c2b6e06b92de1d4c8c3 100644 --- a/app/code/core/Mage/Sendfriend/Model/Sendfriend.php +++ b/app/code/core/Mage/Sendfriend/Model/Sendfriend.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sendfriend - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sendfriend/controllers/ProductController.php b/app/code/core/Mage/Sendfriend/controllers/ProductController.php index 117f123a04e1450adc802f541fa3259e86a44211..cf94e0cca6de3ab21fd66334d2373193bccb4503 100644 --- a/app/code/core/Mage/Sendfriend/controllers/ProductController.php +++ b/app/code/core/Mage/Sendfriend/controllers/ProductController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sendfriend - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sendfriend/etc/config.xml b/app/code/core/Mage/Sendfriend/etc/config.xml index 5c4ef4966f84cfc2fb60c1bc4cdfcc6ad165ebd3..4079adf7f772661a5921ee162e341c2eddb38fd8 100644 --- a/app/code/core/Mage/Sendfriend/etc/config.xml +++ b/app/code/core/Mage/Sendfriend/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Sendfriend - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Sendfriend/etc/system.xml b/app/code/core/Mage/Sendfriend/etc/system.xml index 2cdd22d5e6a03951f1e2c469e559b0331e8856e1..106c95a4f95cf4bef7304becbfc6fe18efd9dedd 100644 --- a/app/code/core/Mage/Sendfriend/etc/system.xml +++ b/app/code/core/Mage/Sendfriend/etc/system.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Sendfriend - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Sendfriend/sql/sendfriend_setup/install-1.6.0.0.php b/app/code/core/Mage/Sendfriend/sql/sendfriend_setup/install-1.6.0.0.php index da01a360278f08f2141b0c6776563d2e019b6fad..e1d9b1eb39b932dafcab46dbfa1b0a20db963dd1 100644 --- a/app/code/core/Mage/Sendfriend/sql/sendfriend_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/Sendfriend/sql/sendfriend_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sendfriend - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sendfriend/view/frontend/layout.xml b/app/code/core/Mage/Sendfriend/view/frontend/layout.xml index c4c8f19057624ce7bd853d6833b77892d609af68..9b065c4f3b3570c7d8584d959661648a5ede66d2 100644 --- a/app/code/core/Mage/Sendfriend/view/frontend/layout.xml +++ b/app/code/core/Mage/Sendfriend/view/frontend/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Sendfriend/view/frontend/send.phtml b/app/code/core/Mage/Sendfriend/view/frontend/send.phtml index c567e203d43acc6d6f7978e01a0c5466ca373ffb..f39e46354177121d0d201a4e880c8b5271437dd4 100644 --- a/app/code/core/Mage/Sendfriend/view/frontend/send.phtml +++ b/app/code/core/Mage/Sendfriend/view/frontend/send.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /* @var $this Mage_Sendfriend_Block_Send */ diff --git a/app/code/core/Mage/Shipping/Block/Tracking/Ajax.php b/app/code/core/Mage/Shipping/Block/Tracking/Ajax.php index 80d900c8436b7a05218ffb3848e4f4d707d7230f..18340342fc17556735f6619aa5bfffcebf9bb6bf 100644 --- a/app/code/core/Mage/Shipping/Block/Tracking/Ajax.php +++ b/app/code/core/Mage/Shipping/Block/Tracking/Ajax.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Shipping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Shipping/Block/Tracking/Popup.php b/app/code/core/Mage/Shipping/Block/Tracking/Popup.php index 88e4203c6c06dc201579bf32a37afca90eb8a9ed..8417eb54a62e7ac4429472088c4181395f6b60f1 100644 --- a/app/code/core/Mage/Shipping/Block/Tracking/Popup.php +++ b/app/code/core/Mage/Shipping/Block/Tracking/Popup.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Shipping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Shipping/Exception.php b/app/code/core/Mage/Shipping/Exception.php index 737caa97f369d701e9eeacd2c9a119ef30b53e75..cc7911275f5a6259c4bd2b8df63afb9959042e4b 100644 --- a/app/code/core/Mage/Shipping/Exception.php +++ b/app/code/core/Mage/Shipping/Exception.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Shipping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Shipping/Helper/Data.php b/app/code/core/Mage/Shipping/Helper/Data.php index 9c953575de47eb7735c20c5c7dd79cee9781f4ec..d6b341edebaea21db81687b0d45a884b9bbf53fd 100644 --- a/app/code/core/Mage/Shipping/Helper/Data.php +++ b/app/code/core/Mage/Shipping/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Shipping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Shipping/Model/Carrier/Abstract.php b/app/code/core/Mage/Shipping/Model/Carrier/Abstract.php index bd330558bedcc4da1f0b912271f66a62d2fa525c..9b137bf819167c9d84834291618bf7120d1d1991 100644 --- a/app/code/core/Mage/Shipping/Model/Carrier/Abstract.php +++ b/app/code/core/Mage/Shipping/Model/Carrier/Abstract.php @@ -20,17 +20,41 @@ * * @category Mage * @package Mage_Shipping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ abstract class Mage_Shipping_Model_Carrier_Abstract extends Varien_Object { + /** + * Carrier's code + * + * @var string + */ protected $_code; + + /** + * Rates result + * + * @var array + */ protected $_rates = null; + + /** + * Number of boxes in package + * + * @var int + */ protected $_numBoxes = 1; + /** + * Free Method config path + * + * @var string + */ + protected $_freeMethod = 'free_method'; + /** * Whether this carrier has fixed rates calculation * @@ -250,7 +274,7 @@ abstract class Mage_Shipping_Model_Carrier_Abstract extends Varien_Object * @param Mage_Shipping_Model_Rate_Request $request * @return Mage_Shipping_Model_Carrier_Abstract|Mage_Shipping_Model_Rate_Result_Error|boolean */ - public function processAdditionalValidation(Mage_Shipping_Model_Rate_Request $request) + public function proccessAdditionalValidation(Mage_Shipping_Model_Rate_Request $request) { return $this; } @@ -316,7 +340,7 @@ abstract class Mage_Shipping_Model_Carrier_Abstract extends Varien_Object return; } - $freeMethod = $this->getConfigData('free_method'); + $freeMethod = $this->getConfigData($this->_freeMethod); if (!$freeMethod) { return; } @@ -378,9 +402,9 @@ abstract class Mage_Shipping_Model_Carrier_Abstract extends Varien_Object */ public function getMethodPrice($cost, $method='') { - if ($method == $this->getConfigData('free_method') && $this->getConfigData('free_shipping_enable') - && $this->getConfigData('free_shipping_subtotal') <= $this->_rawRequest->getValueWithDiscount() - ){ + if ($method == $this->getConfigData($this->_freeMethod) && $this->getConfigData('free_shipping_enable') + && $this->getConfigData('free_shipping_subtotal') <= $this->_rawRequest->getBaseSubtotalInclTax() + ) { $price = '0.00'; } else { $price = $this->getFinalPriceWithHandlingFee($cost); @@ -391,12 +415,12 @@ abstract class Mage_Shipping_Model_Carrier_Abstract extends Varien_Object /** * get the handling fee for the shipping + cost * - * @return final price for shipping emthod + * @param float $cost + * @return float final price for shipping method */ public function getFinalPriceWithHandlingFee($cost) { $handlingFee = $this->getConfigData('handling_fee'); - $finalMethodPrice = 0; $handlingType = $this->getConfigData('handling_type'); if (!$handlingType) { $handlingType = self::HANDLING_TYPE_FIXED; @@ -406,22 +430,43 @@ abstract class Mage_Shipping_Model_Carrier_Abstract extends Varien_Object $handlingAction = self::HANDLING_ACTION_PERORDER; } - if($handlingAction == self::HANDLING_ACTION_PERPACKAGE) - { - if ($handlingType == self::HANDLING_TYPE_PERCENT) { - $finalMethodPrice = ($cost + ($cost * $handlingFee/100)) * $this->_numBoxes; - } else { - $finalMethodPrice = ($cost + $handlingFee) * $this->_numBoxes; - } - } else { - if ($handlingType == self::HANDLING_TYPE_PERCENT) { - $finalMethodPrice = ($cost * $this->_numBoxes) + ($cost * $this->_numBoxes * $handlingFee / 100); - } else { - $finalMethodPrice = ($cost * $this->_numBoxes) + $handlingFee; - } + return ($handlingAction == self::HANDLING_ACTION_PERPACKAGE) + ? $this->_getPerpackagePrice($cost, $handlingType, $handlingFee) + : $this->_getPerorderPrice($cost, $handlingType, $handlingFee); + } + + /** + * Get final price for shipping method with handling fee per package + * + * @param float $cost + * @param string $handlingType + * @param float $handlingFee + * @return float + */ + protected function _getPerpackagePrice($cost, $handlingType, $handlingFee) + { + if ($handlingType == self::HANDLING_TYPE_PERCENT) { + return ($cost + ($cost * $handlingFee/100)) * $this->_numBoxes; + } + + return ($cost + $handlingFee) * $this->_numBoxes; + } + /** + * Get final price for shipping method with handling fee per order + * + * @param float $cost + * @param string $handlingType + * @param float $handlingFee + * @return float + */ + protected function _getPerorderPrice($cost, $handlingType, $handlingFee) + { + if ($handlingType == self::HANDLING_TYPE_PERCENT) { + return ($cost * $this->_numBoxes) + ($cost * $this->_numBoxes * $handlingFee / 100); } - return $finalMethodPrice; + + return ($cost * $this->_numBoxes) + $handlingFee; } /** diff --git a/app/code/core/Mage/Shipping/Model/Carrier/Flatrate.php b/app/code/core/Mage/Shipping/Model/Carrier/Flatrate.php index d352a66322adaf58b5051d7dffacc41a2f543bd4..592a28f83e6bfb3df836e27d3a352484e2c1492d 100644 --- a/app/code/core/Mage/Shipping/Model/Carrier/Flatrate.php +++ b/app/code/core/Mage/Shipping/Model/Carrier/Flatrate.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Shipping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Shipping/Model/Carrier/Freeshipping.php b/app/code/core/Mage/Shipping/Model/Carrier/Freeshipping.php index 7ebb652e168475e89362ae2a2163420f8d78551e..db8b6b7e70e0d5805a2b4a9f8390ba19e16e30b9 100644 --- a/app/code/core/Mage/Shipping/Model/Carrier/Freeshipping.php +++ b/app/code/core/Mage/Shipping/Model/Carrier/Freeshipping.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Shipping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -53,14 +53,12 @@ class Mage_Shipping_Model_Carrier_Freeshipping } $result = Mage::getModel('Mage_Shipping_Model_Rate_Result'); - $packageValue = $request->getPackageValue(); $this->_updateFreeMethodQuote($request); - $allow = ($request->getFreeShipping()) - || ($packageValue >= $this->getConfigData('free_shipping_subtotal')); - - if ($allow) { + if (($request->getFreeShipping()) + || ($request->getBaseSubtotalInclTax() >= $this->getConfigData('free_shipping_subtotal')) + ) { $method = Mage::getModel('Mage_Shipping_Model_Rate_Result_Method'); $method->setCarrier('freeshipping'); @@ -108,4 +106,4 @@ class Mage_Shipping_Model_Carrier_Freeshipping return array('freeshipping'=>$this->getConfigData('name')); } -} +} \ No newline at end of file diff --git a/app/code/core/Mage/Shipping/Model/Carrier/Interface.php b/app/code/core/Mage/Shipping/Model/Carrier/Interface.php index 9bc201dac3281eae0edf5c080e14d571f577c40b..b6edd0c5f6c4431182e025d24ab090a4d69bea93 100644 --- a/app/code/core/Mage/Shipping/Model/Carrier/Interface.php +++ b/app/code/core/Mage/Shipping/Model/Carrier/Interface.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Shipping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Shipping/Model/Carrier/Pickup.php b/app/code/core/Mage/Shipping/Model/Carrier/Pickup.php index bb5d4348882a448a138bd520f732fe92ba7b0df9..f68881587b4d504f0b562c4b32c62548fcb507ad 100644 --- a/app/code/core/Mage/Shipping/Model/Carrier/Pickup.php +++ b/app/code/core/Mage/Shipping/Model/Carrier/Pickup.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Shipping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Shipping/Model/Carrier/Tablerate.php b/app/code/core/Mage/Shipping/Model/Carrier/Tablerate.php index b7105d183eecf28f581b25d860b0fd894d27008c..78632ab2773eec2ec810eb39bb194fa235dfc2dc 100644 --- a/app/code/core/Mage/Shipping/Model/Carrier/Tablerate.php +++ b/app/code/core/Mage/Shipping/Model/Carrier/Tablerate.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Shipping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Shipping/Model/Config.php b/app/code/core/Mage/Shipping/Model/Config.php index f724d731ec53904ff78f5a2825c714e59e91ce01..ee9f5558146ce7fa9e89c01a7b9d9798845d1a06 100644 --- a/app/code/core/Mage/Shipping/Model/Config.php +++ b/app/code/core/Mage/Shipping/Model/Config.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Shipping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Shipping/Model/Info.php b/app/code/core/Mage/Shipping/Model/Info.php index 9a1a24ef11bbc8ad57839a8fc6282270c9aa0c50..e93939c35ce9ee29462aae2c4d10b518545d844a 100644 --- a/app/code/core/Mage/Shipping/Model/Info.php +++ b/app/code/core/Mage/Shipping/Model/Info.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Shipping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Shipping/Model/Rate/Abstract.php b/app/code/core/Mage/Shipping/Model/Rate/Abstract.php index 38e7aeb828806237ee57ff81b7953aa9ff086c37..e72f4ebec5d3c498273044f8f5fde9bd7233b551 100644 --- a/app/code/core/Mage/Shipping/Model/Rate/Abstract.php +++ b/app/code/core/Mage/Shipping/Model/Rate/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Shipping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Shipping/Model/Rate/Request.php b/app/code/core/Mage/Shipping/Model/Rate/Request.php index 7990f862e3aa6313d2a09cf60231101052c7af60..adb127a90f2150c340654561dbee683938095a8d 100644 --- a/app/code/core/Mage/Shipping/Model/Rate/Request.php +++ b/app/code/core/Mage/Shipping/Model/Rate/Request.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Shipping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Shipping/Model/Rate/Result.php b/app/code/core/Mage/Shipping/Model/Rate/Result.php index fc6d23394c94ebc71259f5f1d35066d1d48c6689..25615659060be2e41375543b3659be5b62f79c74 100644 --- a/app/code/core/Mage/Shipping/Model/Rate/Result.php +++ b/app/code/core/Mage/Shipping/Model/Rate/Result.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Shipping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Shipping/Model/Rate/Result/Abstract.php b/app/code/core/Mage/Shipping/Model/Rate/Result/Abstract.php index 91975e7c51c8e0675ef5e2fd92c326bb6fd6ac1d..6d7a4698a799f8d81b7455d1be5fcb60f2864ed4 100644 --- a/app/code/core/Mage/Shipping/Model/Rate/Result/Abstract.php +++ b/app/code/core/Mage/Shipping/Model/Rate/Result/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Shipping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Shipping/Model/Rate/Result/Error.php b/app/code/core/Mage/Shipping/Model/Rate/Result/Error.php index aa3e15902677e26b64ae82dc0cf0730f63718a71..bda6751f91e3abde62d8e8d3459887209d6dd698 100644 --- a/app/code/core/Mage/Shipping/Model/Rate/Result/Error.php +++ b/app/code/core/Mage/Shipping/Model/Rate/Result/Error.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Shipping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Shipping/Model/Rate/Result/Method.php b/app/code/core/Mage/Shipping/Model/Rate/Result/Method.php index 9f2e454970786d067bd8b3c1c52ec9f8f686ef96..1342150cc4d7913c23c6bde82cf5a3d503071e9c 100644 --- a/app/code/core/Mage/Shipping/Model/Rate/Result/Method.php +++ b/app/code/core/Mage/Shipping/Model/Rate/Result/Method.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Shipping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Shipping/Model/Resource/Carrier/Tablerate.php b/app/code/core/Mage/Shipping/Model/Resource/Carrier/Tablerate.php index aa77d645374d43642ac1f9796792a8887ef790ff..99495a4a955e12bbeb35263d84d30cca5b7af6f6 100755 --- a/app/code/core/Mage/Shipping/Model/Resource/Carrier/Tablerate.php +++ b/app/code/core/Mage/Shipping/Model/Resource/Carrier/Tablerate.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Shipping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -267,8 +267,7 @@ class Mage_Shipping_Model_Resource_Carrier_Tablerate extends Mage_Core_Model_Res $adapter->commit(); if ($this->_importErrors) { - $error = Mage::helper('Mage_Shipping_Helper_Data')->__('%1$d records have been imported. See the following list of errors for each record that has not been imported: %2$s', - $this->_importedRows, implode(" \n", $this->_importErrors)); + $error = Mage::helper('Mage_Shipping_Helper_Data')->__('%1$d records have been imported. See the following list of errors for each record that has not been imported: %2$s', $this->_importedRows, implode(" \n", $this->_importErrors)); Mage::throwException($error); } @@ -349,8 +348,7 @@ class Mage_Shipping_Model_Resource_Carrier_Tablerate extends Mage_Core_Model_Res { // validate row if (count($row) < 5) { - $this->_importErrors[] = Mage::helper('Mage_Shipping_Helper_Data')->__('Invalid Table Rates format in the Row #%s', - $rowNumber); + $this->_importErrors[] = Mage::helper('Mage_Shipping_Helper_Data')->__('Invalid Table Rates format in the Row #%s', $rowNumber); return false; } @@ -367,8 +365,7 @@ class Mage_Shipping_Model_Resource_Carrier_Tablerate extends Mage_Core_Model_Res } elseif ($row[0] == '*' || $row[0] == '') { $countryId = '0'; } else { - $this->_importErrors[] = Mage::helper('Mage_Shipping_Helper_Data')->__('Invalid Country "%s" in the Row #%s.', - $row[0], $rowNumber); + $this->_importErrors[] = Mage::helper('Mage_Shipping_Helper_Data')->__('Invalid Country "%s" in the Row #%s.', $row[0], $rowNumber); return false; } @@ -378,8 +375,7 @@ class Mage_Shipping_Model_Resource_Carrier_Tablerate extends Mage_Core_Model_Res } elseif ($row[1] == '*' || $row[1] == '') { $regionId = 0; } else { - $this->_importErrors[] = Mage::helper('Mage_Shipping_Helper_Data')->__('Invalid Region/State "%s" in the Row #%s.', - $row[1], $rowNumber); + $this->_importErrors[] = Mage::helper('Mage_Shipping_Helper_Data')->__('Invalid Region/State "%s" in the Row #%s.', $row[1], $rowNumber); return false; } @@ -393,24 +389,21 @@ class Mage_Shipping_Model_Resource_Carrier_Tablerate extends Mage_Core_Model_Res // validate condition value $value = $this->_parseDecimalValue($row[3]); if ($value === false) { - $this->_importErrors[] = Mage::helper('Mage_Shipping_Helper_Data')->__('Invalid %s "%s" in the Row #%s.', - $this->_getConditionFullName($this->_importConditionName), $row[3], $rowNumber); + $this->_importErrors[] = Mage::helper('Mage_Shipping_Helper_Data')->__('Invalid %s "%s" in the Row #%s.', $this->_getConditionFullName($this->_importConditionName), $row[3], $rowNumber); return false; } // validate price $price = $this->_parseDecimalValue($row[4]); if ($price === false) { - $this->_importErrors[] = Mage::helper('Mage_Shipping_Helper_Data')->__('Invalid Shipping Price "%s" in the Row #%s.', - $row[4], $rowNumber); + $this->_importErrors[] = Mage::helper('Mage_Shipping_Helper_Data')->__('Invalid Shipping Price "%s" in the Row #%s.', $row[4], $rowNumber); return false; } // protect from duplicate $hash = sprintf("%s-%d-%s-%F", $countryId, $regionId, $zipCode, $value); if (isset($this->_importUniqueHash[$hash])) { - $this->_importErrors[] = Mage::helper('Mage_Shipping_Helper_Data')->__('Duplicate Row #%s (Country "%s", Region/State "%s", Zip "%s" and Value "%s").', - $rowNumber, $row[0], $row[1], $zipCode, $value); + $this->_importErrors[] = Mage::helper('Mage_Shipping_Helper_Data')->__('Duplicate Row #%s (Country "%s", Region/State "%s", Zip "%s" and Value "%s").', $rowNumber, $row[0], $row[1], $zipCode, $value); return false; } $this->_importUniqueHash[$hash] = true; diff --git a/app/code/core/Mage/Shipping/Model/Resource/Carrier/Tablerate/Collection.php b/app/code/core/Mage/Shipping/Model/Resource/Carrier/Tablerate/Collection.php index e1396d28422eaa5b135489c9e05fde4f3c231e4f..afb8bcfaf5dc30b2e63d5e8051cf1eb5c55ce07e 100755 --- a/app/code/core/Mage/Shipping/Model/Resource/Carrier/Tablerate/Collection.php +++ b/app/code/core/Mage/Shipping/Model/Resource/Carrier/Tablerate/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Shipping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Shipping/Model/Shipment/Request.php b/app/code/core/Mage/Shipping/Model/Shipment/Request.php index 5856f3f2c6d369a9c116245b99dac87231dd15d7..fbed26528c2ad675b2a6e00399dda66b02c16954 100644 --- a/app/code/core/Mage/Shipping/Model/Shipment/Request.php +++ b/app/code/core/Mage/Shipping/Model/Shipment/Request.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Shipping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Shipping/Model/Shipment/Return.php b/app/code/core/Mage/Shipping/Model/Shipment/Return.php index f57ef82882b69b454f0ba3609f904037dec8d3da..620b4ba6f1ca098c0f2a19649aa3566ea9aeea1c 100644 --- a/app/code/core/Mage/Shipping/Model/Shipment/Return.php +++ b/app/code/core/Mage/Shipping/Model/Shipment/Return.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Shipping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Shipping/Model/Shipping.php b/app/code/core/Mage/Shipping/Model/Shipping.php index d1f01df7b88d6f75da898b3d2be4174694449ced..1bb9cb4118271ba3f899f89fa0b7bb7960315a96 100644 --- a/app/code/core/Mage/Shipping/Model/Shipping.php +++ b/app/code/core/Mage/Shipping/Model/Shipping.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Shipping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -161,7 +161,7 @@ class Mage_Shipping_Model_Shipping $carrier->setActiveFlag($this->_availabilityConfigField); $result = $carrier->checkAvailableShipCountries($request); if (false !== $result && !($result instanceof Mage_Shipping_Model_Rate_Result_Error)) { - $result = $carrier->processAdditionalValidation($request); + $result = $carrier->proccessAdditionalValidation($request); } /* * Result will be false if the admin set not to show the shipping module @@ -212,6 +212,8 @@ class Mage_Shipping_Model_Shipping $request->setPackageCurrency(Mage::app()->getStore()->getCurrentCurrency()); $request->setLimitCarrier($limitCarrier); + $request->setBaseSubtotalInclTax($address->getBaseSubtotalInclTax()); + return $this->collectRates($request); } diff --git a/app/code/core/Mage/Shipping/Model/Source/HandlingAction.php b/app/code/core/Mage/Shipping/Model/Source/HandlingAction.php index d3085e91e87ca29d3d537540aa2caf2f723001b8..5ab32a772e74ac6d07060e36a5937d7c8a0a15e4 100644 --- a/app/code/core/Mage/Shipping/Model/Source/HandlingAction.php +++ b/app/code/core/Mage/Shipping/Model/Source/HandlingAction.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Shipping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Shipping_Model_Source_HandlingAction diff --git a/app/code/core/Mage/Shipping/Model/Source/HandlingType.php b/app/code/core/Mage/Shipping/Model/Source/HandlingType.php index 40d1f8e26819de6ca5c65161739cc2818a611435..69f7e974914a5d8f3af45a52cb3ef44c3c23ab3a 100644 --- a/app/code/core/Mage/Shipping/Model/Source/HandlingType.php +++ b/app/code/core/Mage/Shipping/Model/Source/HandlingType.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Shipping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Shipping_Model_Source_HandlingType diff --git a/app/code/core/Mage/Shipping/Model/Tracking/Result.php b/app/code/core/Mage/Shipping/Model/Tracking/Result.php index 188d1bc45840f3211a4ac379d3f66888ce7c10ca..507351ea57182aa01812742336e89f83c9aadabf 100644 --- a/app/code/core/Mage/Shipping/Model/Tracking/Result.php +++ b/app/code/core/Mage/Shipping/Model/Tracking/Result.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Shipping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Shipping/Model/Tracking/Result/Abstract.php b/app/code/core/Mage/Shipping/Model/Tracking/Result/Abstract.php index b1e79fa1d6cc095091a810a69be5c53ce537cc6e..6b6f0f7350912f8c23b4a00c83845563ed36ab5a 100644 --- a/app/code/core/Mage/Shipping/Model/Tracking/Result/Abstract.php +++ b/app/code/core/Mage/Shipping/Model/Tracking/Result/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Shipping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Shipping/Model/Tracking/Result/Error.php b/app/code/core/Mage/Shipping/Model/Tracking/Result/Error.php index 9adfafd5909de264f59bd32c3cd660077850452b..65b4a23fd91f29477d18950113e32a06de6cb853 100644 --- a/app/code/core/Mage/Shipping/Model/Tracking/Result/Error.php +++ b/app/code/core/Mage/Shipping/Model/Tracking/Result/Error.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Shipping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Shipping/Model/Tracking/Result/Status.php b/app/code/core/Mage/Shipping/Model/Tracking/Result/Status.php index 21e1765afb69e25e5bc7291d016c56cc93589356..818312c5a0977209f27b441bd424b6433cb261bf 100644 --- a/app/code/core/Mage/Shipping/Model/Tracking/Result/Status.php +++ b/app/code/core/Mage/Shipping/Model/Tracking/Result/Status.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Shipping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Shipping/controllers/TrackingController.php b/app/code/core/Mage/Shipping/controllers/TrackingController.php index 756c5b8d2d864056399902c58f99da436fafe09b..72543193cf7373ce86a9767b710c712582cef110 100644 --- a/app/code/core/Mage/Shipping/controllers/TrackingController.php +++ b/app/code/core/Mage/Shipping/controllers/TrackingController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Shipping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Shipping/etc/adminhtml.xml b/app/code/core/Mage/Shipping/etc/adminhtml.xml index 0dce18fbf0c9fece5633e108464c8471084618ba..986961e6b33302ad9406557773defb806072c562 100644 --- a/app/code/core/Mage/Shipping/etc/adminhtml.xml +++ b/app/code/core/Mage/Shipping/etc/adminhtml.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Shipping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Shipping/etc/config.xml b/app/code/core/Mage/Shipping/etc/config.xml index a3182459d27cb8beb23ed1164b3e42bc320310a1..546a92ed2cec07c19cf944c7276831532ac5d0f2 100644 --- a/app/code/core/Mage/Shipping/etc/config.xml +++ b/app/code/core/Mage/Shipping/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Shipping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Shipping/etc/system.xml b/app/code/core/Mage/Shipping/etc/system.xml index a20c50d8d359a2dfb861898e0c9258acf8e4f910..a0436182896e553e687ae3d0b95f552e5824b1b3 100644 --- a/app/code/core/Mage/Shipping/etc/system.xml +++ b/app/code/core/Mage/Shipping/etc/system.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Shipping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Shipping/sql/shipping_setup/install-1.6.0.0.php b/app/code/core/Mage/Shipping/sql/shipping_setup/install-1.6.0.0.php index 5c09811e428c6b69f35762f4144debee6adda459..c9ee0b9b2f604d7fb08a2525ee17200379e1d2b0 100644 --- a/app/code/core/Mage/Shipping/sql/shipping_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/Shipping/sql/shipping_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Shipping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Shipping/view/frontend/layout.xml b/app/code/core/Mage/Shipping/view/frontend/layout.xml index 03ccdbc426d51ddd8d06777bed5c14ff147fb17d..7f3fb1c04c56ea8bb1e59bbc449db0790f988253 100644 --- a/app/code/core/Mage/Shipping/view/frontend/layout.xml +++ b/app/code/core/Mage/Shipping/view/frontend/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/Shipping/view/frontend/tracking/ajax.phtml b/app/code/core/Mage/Shipping/view/frontend/tracking/ajax.phtml index 91c289cf6517e504a490b2ba84b33302f5a23348..c29c61e5d49cc4277f1e8fece7681ccd24bbc39a 100644 --- a/app/code/core/Mage/Shipping/view/frontend/tracking/ajax.phtml +++ b/app/code/core/Mage/Shipping/view/frontend/tracking/ajax.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Shipping/view/frontend/tracking/popup.phtml b/app/code/core/Mage/Shipping/view/frontend/tracking/popup.phtml index 5b350dcc74a99059f6fce0ff7174944716cf01db..0337d5842fcfbf9374224892b1a42a9cd520e51c 100644 --- a/app/code/core/Mage/Shipping/view/frontend/tracking/popup.phtml +++ b/app/code/core/Mage/Shipping/view/frontend/tracking/popup.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /* @var $this Mage_Shipping_Block_Tracking_Popup */ diff --git a/app/code/core/Mage/Sitemap/Helper/Data.php b/app/code/core/Mage/Sitemap/Helper/Data.php index 1cf500a0e03f4938e3f9dc61af54a6ac330e94f4..7c26c17dd51d2c15d6f4cedabb6fbc858aa84462 100644 --- a/app/code/core/Mage/Sitemap/Helper/Data.php +++ b/app/code/core/Mage/Sitemap/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sitemap - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sitemap/Model/Observer.php b/app/code/core/Mage/Sitemap/Model/Observer.php index d6ffbc3064ce58499a28c6dd2772ebd08c4fdf8e..0f5d8667bccc499a90724b6d0b8d7dae541599da 100644 --- a/app/code/core/Mage/Sitemap/Model/Observer.php +++ b/app/code/core/Mage/Sitemap/Model/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sitemap - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sitemap/Model/Resource/Catalog/Category.php b/app/code/core/Mage/Sitemap/Model/Resource/Catalog/Category.php index 21b4a6f231e53191885c8267f63288acb2bc5495..5b3622fbf4289211636f9bc00316b258a70a4650 100755 --- a/app/code/core/Mage/Sitemap/Model/Resource/Catalog/Category.php +++ b/app/code/core/Mage/Sitemap/Model/Resource/Catalog/Category.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sitemap - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sitemap/Model/Resource/Catalog/Product.php b/app/code/core/Mage/Sitemap/Model/Resource/Catalog/Product.php index 14694816ff56171e7fe509dcadf3cc63db48f171..0c807aed9c2004b463f7c6480ece6cebdacbc3ec 100755 --- a/app/code/core/Mage/Sitemap/Model/Resource/Catalog/Product.php +++ b/app/code/core/Mage/Sitemap/Model/Resource/Catalog/Product.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sitemap - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sitemap/Model/Resource/Cms/Page.php b/app/code/core/Mage/Sitemap/Model/Resource/Cms/Page.php index 0a17c2676975cc08996dceb25b9ac8f8ade1bbca..bb28d20a5d347de03859079bb6825165e5fd737a 100755 --- a/app/code/core/Mage/Sitemap/Model/Resource/Cms/Page.php +++ b/app/code/core/Mage/Sitemap/Model/Resource/Cms/Page.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sitemap - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sitemap/Model/Resource/Sitemap.php b/app/code/core/Mage/Sitemap/Model/Resource/Sitemap.php index 429df129f8827501a55e4f319c752502e2804b46..12d7de7243b2e1d8d8eeb6b613ad4b6a2926aa7d 100755 --- a/app/code/core/Mage/Sitemap/Model/Resource/Sitemap.php +++ b/app/code/core/Mage/Sitemap/Model/Resource/Sitemap.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sitemap - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sitemap/Model/Resource/Sitemap/Collection.php b/app/code/core/Mage/Sitemap/Model/Resource/Sitemap/Collection.php index bff8844bd84e618648782186ac3ed0033284c9a0..f36d8c86047bc0f1a2629cb4988eb957bb04ec3b 100755 --- a/app/code/core/Mage/Sitemap/Model/Resource/Sitemap/Collection.php +++ b/app/code/core/Mage/Sitemap/Model/Resource/Sitemap/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sitemap - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sitemap/Model/Sitemap.php b/app/code/core/Mage/Sitemap/Model/Sitemap.php index 5fadb692baf2e94b80012ea142a02accf70ab5d9..67d0f290cbd63c3bdec63a8a5191b639c37f1c74 100644 --- a/app/code/core/Mage/Sitemap/Model/Sitemap.php +++ b/app/code/core/Mage/Sitemap/Model/Sitemap.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sitemap - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Sitemap/etc/adminhtml.xml b/app/code/core/Mage/Sitemap/etc/adminhtml.xml index 34676a7ba13428275ee113927c3bdb17881e1f9b..5ac192cfe977e2598bb06f9d29bc2f156c5e2c63 100644 --- a/app/code/core/Mage/Sitemap/etc/adminhtml.xml +++ b/app/code/core/Mage/Sitemap/etc/adminhtml.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Sitemap - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Sitemap/etc/config.xml b/app/code/core/Mage/Sitemap/etc/config.xml index 5c986ff1072fb6d8d133888562ac6276d67cb6ae..d3c026ea1843a72ead592bc28540ed417de4f1f2 100644 --- a/app/code/core/Mage/Sitemap/etc/config.xml +++ b/app/code/core/Mage/Sitemap/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Sitemap - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Sitemap/etc/system.xml b/app/code/core/Mage/Sitemap/etc/system.xml index 812154dd37dee8fde274c2ba23a116d67bf7db12..a5458c6330c49fd48d2cdd09d4e5ba9af4b73537 100644 --- a/app/code/core/Mage/Sitemap/etc/system.xml +++ b/app/code/core/Mage/Sitemap/etc/system.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Sitemap - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Sitemap/sql/sitemap_setup/install-1.6.0.0.php b/app/code/core/Mage/Sitemap/sql/sitemap_setup/install-1.6.0.0.php index f4a6d8df8e6fefc35b9daef65039909477467827..0ec99a73ae539aaeba0c3b0a9683f756f1c319c9 100644 --- a/app/code/core/Mage/Sitemap/sql/sitemap_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/Sitemap/sql/sitemap_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Sitemap - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tag/Block/All.php b/app/code/core/Mage/Tag/Block/All.php index 4f383caccbc30e62b38c962b9f04a91d4e93b6de..4b152a44e41e4505d5f92ddbbb094be77dcdd262 100644 --- a/app/code/core/Mage/Tag/Block/All.php +++ b/app/code/core/Mage/Tag/Block/All.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tag - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tag/Block/Customer/Recent.php b/app/code/core/Mage/Tag/Block/Customer/Recent.php index f7f6abd63ec4bc8eca9a7f20f3ccd13bec64e5b3..88b500b72da50f7b17b16d1450aaabdad37e4688 100644 --- a/app/code/core/Mage/Tag/Block/Customer/Recent.php +++ b/app/code/core/Mage/Tag/Block/Customer/Recent.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tag - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tag/Block/Customer/Tags.php b/app/code/core/Mage/Tag/Block/Customer/Tags.php index 1dc291c79c9a0696e19c3d27198d1ec7c79b5261..b157895527d1feda7cc4ab9fdad9f8a0d2e06b33 100644 --- a/app/code/core/Mage/Tag/Block/Customer/Tags.php +++ b/app/code/core/Mage/Tag/Block/Customer/Tags.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tag - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tag/Block/Customer/View.php b/app/code/core/Mage/Tag/Block/Customer/View.php index 8c0a0f42bfaddabcee1edcc0e940159645c82e20..4d8e05a5e4bef468e2c68f03e9ea5b70f936ae6c 100644 --- a/app/code/core/Mage/Tag/Block/Customer/View.php +++ b/app/code/core/Mage/Tag/Block/Customer/View.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tag - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tag/Block/Popular.php b/app/code/core/Mage/Tag/Block/Popular.php index 34d6f1077dae2f1d5c6ce278c55571336d2b8dac..41406ec0a6a0fa13c3851212828a8d3520dfd83b 100644 --- a/app/code/core/Mage/Tag/Block/Popular.php +++ b/app/code/core/Mage/Tag/Block/Popular.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tag - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tag/Block/Product/List.php b/app/code/core/Mage/Tag/Block/Product/List.php index 07a2b35538d5fa8e34a88ba5d5da99dc4e83745b..f39782e2c723a7253429ffc59eacb71147fe96dd 100644 --- a/app/code/core/Mage/Tag/Block/Product/List.php +++ b/app/code/core/Mage/Tag/Block/Product/List.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tag - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tag/Block/Product/Result.php b/app/code/core/Mage/Tag/Block/Product/Result.php index c844e15b91713e348584eb8df2465a31ba37934c..4d312b651de1af70841ca20a0f326fc47454a304 100644 --- a/app/code/core/Mage/Tag/Block/Product/Result.php +++ b/app/code/core/Mage/Tag/Block/Product/Result.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tag - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tag/Helper/Data.php b/app/code/core/Mage/Tag/Helper/Data.php index 2a67a1d27b4f85e48dbc3a9fb5c8098e4cd76d3f..8d3fb07758bc7c6004bbfc97227c5041768b325f 100644 --- a/app/code/core/Mage/Tag/Helper/Data.php +++ b/app/code/core/Mage/Tag/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tag - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tag/Model/Api.php b/app/code/core/Mage/Tag/Model/Api.php index a1dd897bc825ca614d107763dc7d1a7c2e0e2829..1551e9cd1179ad4e80fc9853f1c1ee2dd6b0f286 100644 --- a/app/code/core/Mage/Tag/Model/Api.php +++ b/app/code/core/Mage/Tag/Model/Api.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tag - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tag/Model/Api/V2.php b/app/code/core/Mage/Tag/Model/Api/V2.php index ad49b883a02028d7f960e0fe226a3c3122b26e04..ca37fe380a30630634cff17ab69c235384d556c4 100644 --- a/app/code/core/Mage/Tag/Model/Api/V2.php +++ b/app/code/core/Mage/Tag/Model/Api/V2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tag - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tag/Model/Entity/Customer/Collection.php b/app/code/core/Mage/Tag/Model/Entity/Customer/Collection.php index 14ce99bb45bfe81834e7974e403279dd3fa789d1..e4e3f3c4cd97a5edb8445c3232e820b49bd0fef7 100644 --- a/app/code/core/Mage/Tag/Model/Entity/Customer/Collection.php +++ b/app/code/core/Mage/Tag/Model/Entity/Customer/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tag - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tag/Model/Indexer/Summary.php b/app/code/core/Mage/Tag/Model/Indexer/Summary.php index 6dfefe6d2fab951642b536cd7774f0c3c26b3e01..e821234abe0c19fb9758899382d3e7fde8939bea 100644 --- a/app/code/core/Mage/Tag/Model/Indexer/Summary.php +++ b/app/code/core/Mage/Tag/Model/Indexer/Summary.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tag - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tag/Model/Resource/Customer/Collection.php b/app/code/core/Mage/Tag/Model/Resource/Customer/Collection.php index efc689d1bde07f4e4f5ca4bc53eb04a3f097ca17..28956b76a4fc530313ecf351ada1dd55ae1f3afe 100755 --- a/app/code/core/Mage/Tag/Model/Resource/Customer/Collection.php +++ b/app/code/core/Mage/Tag/Model/Resource/Customer/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tag - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tag/Model/Resource/Indexer/Summary.php b/app/code/core/Mage/Tag/Model/Resource/Indexer/Summary.php index 90fab39f0a215d01b20162fa8ffc88965508c884..d87cc4d896fd9fc88a137368d708cff7b74dd524 100755 --- a/app/code/core/Mage/Tag/Model/Resource/Indexer/Summary.php +++ b/app/code/core/Mage/Tag/Model/Resource/Indexer/Summary.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tag - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -195,7 +195,8 @@ class Mage_Tag_Model_Resource_Indexer_Summary extends Mage_Catalog_Model_Resourc ->group(array( 'tr.tag_id', 'tr.store_id' - )); + )) + ->where('tr.active = 1'); $statusCond = $writeAdapter->quoteInto('=?', Mage_Catalog_Model_Product_Status::STATUS_ENABLED); $this->_addAttributeToSelect($select, 'status', 'e.entity_id', 'cs.store_id', $statusCond); @@ -236,7 +237,8 @@ class Mage_Tag_Model_Resource_Indexer_Summary extends Mage_Catalog_Model_Resourc $agregateSelect = $writeAdapter->select(); $agregateSelect->from($this->getTable('tag_relation'), $selectedFields) - ->group('tag_id'); + ->group('tag_id') + ->where('active = 1'); if (!empty($tagIds)) { $agregateSelect->where('tag_id IN(?)', $tagIds); @@ -253,4 +255,4 @@ class Mage_Tag_Model_Resource_Indexer_Summary extends Mage_Catalog_Model_Resourc return $this; } -} +} \ No newline at end of file diff --git a/app/code/core/Mage/Tag/Model/Resource/Popular/Collection.php b/app/code/core/Mage/Tag/Model/Resource/Popular/Collection.php index f56057744a9aa3aeb38a13eb1105f10148ecc288..6385f3b8c153034610a598e0c7995dc0446ed8d6 100755 --- a/app/code/core/Mage/Tag/Model/Resource/Popular/Collection.php +++ b/app/code/core/Mage/Tag/Model/Resource/Popular/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tag - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tag/Model/Resource/Product/Collection.php b/app/code/core/Mage/Tag/Model/Resource/Product/Collection.php index ae7950df3c569261a265caf89212d7eb8295c950..3c477f16135795ac024e78e55ec9ae2bc55a47af 100755 --- a/app/code/core/Mage/Tag/Model/Resource/Product/Collection.php +++ b/app/code/core/Mage/Tag/Model/Resource/Product/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tag - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tag/Model/Resource/Tag.php b/app/code/core/Mage/Tag/Model/Resource/Tag.php index 4fcfddcbadec9f3a04c8f864715222da907b950a..c2b53563f9741e183df8870bd713bef1a4c065d5 100755 --- a/app/code/core/Mage/Tag/Model/Resource/Tag.php +++ b/app/code/core/Mage/Tag/Model/Resource/Tag.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tag - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -191,4 +191,4 @@ class Mage_Tag_Model_Resource_Tag extends Mage_Core_Model_Resource_Db_Abstract return $this; } -} +} \ No newline at end of file diff --git a/app/code/core/Mage/Tag/Model/Resource/Tag/Collection.php b/app/code/core/Mage/Tag/Model/Resource/Tag/Collection.php index fa61eb842100acf869bd185ff3d5707569d15790..368d4cdf63b728462b9229e3af50d5dffdb90e34 100755 --- a/app/code/core/Mage/Tag/Model/Resource/Tag/Collection.php +++ b/app/code/core/Mage/Tag/Model/Resource/Tag/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tag - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tag/Model/Resource/Tag/Relation.php b/app/code/core/Mage/Tag/Model/Resource/Tag/Relation.php index 357f3cf432fb40cf773de4d2f6df671ddacf8f22..ae46f73d4ecb90468d25ab14595f3fad7cd35f13 100755 --- a/app/code/core/Mage/Tag/Model/Resource/Tag/Relation.php +++ b/app/code/core/Mage/Tag/Model/Resource/Tag/Relation.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tag - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -174,8 +174,7 @@ class Mage_Tag_Model_Resource_Tag_Relation extends Mage_Core_Model_Resource_Db_A $select = $write->select() ->from($this->getMainTable(), 'product_id') ->where('tag_id = :tag_id') - ->where('store_id = :store_id') - ->where('customer_id IS NULL'); + ->where('store_id = :store_id'); $oldRelationIds = $write->fetchCol($select, $bind); $insert = array_diff($addedIds, $oldRelationIds); @@ -199,7 +198,6 @@ class Mage_Tag_Model_Resource_Tag_Relation extends Mage_Core_Model_Resource_Db_A $write->delete($this->getMainTable(), array( 'product_id IN (?)' => $delete, 'store_id = ?' => $model->getStoreId(), - 'customer_id IS NULL' )); } diff --git a/app/code/core/Mage/Tag/Model/Session.php b/app/code/core/Mage/Tag/Model/Session.php index 6ba1055208e6bada7b09d9b62eb4e33e10f57099..c92a58eac31408f16d0e8780233deb53b32ca378 100644 --- a/app/code/core/Mage/Tag/Model/Session.php +++ b/app/code/core/Mage/Tag/Model/Session.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tag - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tag/Model/Tag.php b/app/code/core/Mage/Tag/Model/Tag.php index 8958a3930a94149fa3edf353562a95978408efa4..a1b913768ada6eaa1f1528bf553f11a12843e74c 100644 --- a/app/code/core/Mage/Tag/Model/Tag.php +++ b/app/code/core/Mage/Tag/Model/Tag.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tag - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tag/Model/Tag/Relation.php b/app/code/core/Mage/Tag/Model/Tag/Relation.php index 60cb62e20b99ceb80984ecd0aee7e51d6be2de78..db2a01d5cc6e9d325ebf0965aac7d3efa2d3d477 100644 --- a/app/code/core/Mage/Tag/Model/Tag/Relation.php +++ b/app/code/core/Mage/Tag/Model/Tag/Relation.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tag - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tag/controllers/CustomerController.php b/app/code/core/Mage/Tag/controllers/CustomerController.php index 64d035748f7773a7f2f2744d45acb7dd77ea1134..ef2d023bb818960cdbe25344cbf6339a58ba7c50 100644 --- a/app/code/core/Mage/Tag/controllers/CustomerController.php +++ b/app/code/core/Mage/Tag/controllers/CustomerController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tag - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tag/controllers/IndexController.php b/app/code/core/Mage/Tag/controllers/IndexController.php index b8753878388f6e7f05dcc75a9ebc44c6cacbcede..346480a9a40034ecd41c9cd124bbf5ef1ee2960d 100644 --- a/app/code/core/Mage/Tag/controllers/IndexController.php +++ b/app/code/core/Mage/Tag/controllers/IndexController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tag - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -112,11 +112,9 @@ class Mage_Tag_IndexController extends Mage_Core_Controller_Front_Action */ protected function _cleanTags(array $tagNamesArr) { - $helper = Mage::helper('Mage_Core_Helper_Data'); foreach( $tagNamesArr as $key => $tagName ) { $tagNamesArr[$key] = trim($tagNamesArr[$key], '\''); $tagNamesArr[$key] = trim($tagNamesArr[$key]); - $tagNamesArr[$key] = $helper->escapeHtml($tagNamesArr[$key]); if( $tagNamesArr[$key] == '' ) { unset($tagNamesArr[$key]); } @@ -133,28 +131,35 @@ class Mage_Tag_IndexController extends Mage_Core_Controller_Front_Action protected function _fillMessageBox($counter) { $session = Mage::getSingleton('Mage_Catalog_Model_Session'); + $helper = Mage::helper('Mage_Core_Helper_Data'); if (count($counter[Mage_Tag_Model_Tag::ADD_STATUS_NEW])) { - $session->addSuccess($this->__('%s tag(s) have been accepted for moderation.', - count($counter[Mage_Tag_Model_Tag::ADD_STATUS_NEW])) + $session->addSuccess( + $this->__('%s tag(s) have been accepted for moderation.', count($counter[Mage_Tag_Model_Tag::ADD_STATUS_NEW])) ); } if (count($counter[Mage_Tag_Model_Tag::ADD_STATUS_EXIST])) { foreach ($counter[Mage_Tag_Model_Tag::ADD_STATUS_EXIST] as $tagName) { - $session->addNotice($this->__('Tag "%s" has already been added to the product.' ,$tagName)); + $session->addNotice( + $this->__('Tag "%s" has already been added to the product.' , $helper->escapeHtml($tagName)) + ); } } if (count($counter[Mage_Tag_Model_Tag::ADD_STATUS_SUCCESS])) { foreach ($counter[Mage_Tag_Model_Tag::ADD_STATUS_SUCCESS] as $tagName) { - $session->addSuccess($this->__('Tag "%s" has been added to the product.' ,$tagName)); + $session->addSuccess( + $this->__('Tag "%s" has been added to the product.' ,$helper->escapeHtml($tagName)) + ); } } if (count($counter[Mage_Tag_Model_Tag::ADD_STATUS_REJECTED])) { foreach ($counter[Mage_Tag_Model_Tag::ADD_STATUS_REJECTED] as $tagName) { - $session->addNotice($this->__('Tag "%s" has been rejected by administrator.' ,$tagName)); + $session->addNotice( + $this->__('Tag "%s" has been rejected by administrator.' ,$helper->escapeHtml($tagName)) + ); } } } diff --git a/app/code/core/Mage/Tag/controllers/ListController.php b/app/code/core/Mage/Tag/controllers/ListController.php index cc7d4dbd24725a878911a9de0aacc429b0326864..6f1fa89327324f3df47d0a1f9c288898fe800e36 100644 --- a/app/code/core/Mage/Tag/controllers/ListController.php +++ b/app/code/core/Mage/Tag/controllers/ListController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tag - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tag/controllers/ProductController.php b/app/code/core/Mage/Tag/controllers/ProductController.php index caf9a6beeebe856f2cfdf186ba0b13ed344319ed..aab8edca7837c73c33a44ab6247ebdf3458258be 100644 --- a/app/code/core/Mage/Tag/controllers/ProductController.php +++ b/app/code/core/Mage/Tag/controllers/ProductController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tag - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tag/etc/adminhtml.xml b/app/code/core/Mage/Tag/etc/adminhtml.xml index 3a0cb442620facc2bd80865352fecd310caa2bd7..49a587f6b31ec7005bbee0c70687898cb2e2f5cb 100644 --- a/app/code/core/Mage/Tag/etc/adminhtml.xml +++ b/app/code/core/Mage/Tag/etc/adminhtml.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Tag - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Tag/etc/api.xml b/app/code/core/Mage/Tag/etc/api.xml index cbf3091829b3db3a31b55c97a67505689ce626bc..adfedee017bf4f9ce958b24bdb7c25e7b22ff12a 100644 --- a/app/code/core/Mage/Tag/etc/api.xml +++ b/app/code/core/Mage/Tag/etc/api.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Tag - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Tag/etc/config.xml b/app/code/core/Mage/Tag/etc/config.xml index 23516b2081a3b328241a9ea24f93da9cd37e4e9a..d7459a4153f8664295a68b0349bc9e7cd6d66fac 100644 --- a/app/code/core/Mage/Tag/etc/config.xml +++ b/app/code/core/Mage/Tag/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Tag - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Tag/etc/view.xml b/app/code/core/Mage/Tag/etc/view.xml index 4c259e71b13f2c6675d26865a36bd82968b4580d..31285a67944d33e28c61e7f101a2563c5ff530ea 100644 --- a/app/code/core/Mage/Tag/etc/view.xml +++ b/app/code/core/Mage/Tag/etc/view.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Tag - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Tag/sql/tag_setup/install-1.6.0.0.php b/app/code/core/Mage/Tag/sql/tag_setup/install-1.6.0.0.php index 478fc963b7e59863fc2554a7e21ce2ea44bd09eb..8a2f6a19e18f37ad3e9543f7e944682a913129eb 100644 --- a/app/code/core/Mage/Tag/sql/tag_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/Tag/sql/tag_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tag - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tag/view/frontend/cloud.phtml b/app/code/core/Mage/Tag/view/frontend/cloud.phtml index 03d2d482252f577172a72fe0a3918581995404dc..c178279fef98e5925122553f0eec4df798846648 100644 --- a/app/code/core/Mage/Tag/view/frontend/cloud.phtml +++ b/app/code/core/Mage/Tag/view/frontend/cloud.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Tag/view/frontend/customer/recent.phtml b/app/code/core/Mage/Tag/view/frontend/customer/recent.phtml index 4c522d3b22e3a7ebc511a22b7fa8b72d894d935f..015d5fb682611dfddf504130e5ef0e91cc01315b 100644 --- a/app/code/core/Mage/Tag/view/frontend/customer/recent.phtml +++ b/app/code/core/Mage/Tag/view/frontend/customer/recent.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Tag/view/frontend/customer/tags.phtml b/app/code/core/Mage/Tag/view/frontend/customer/tags.phtml index 8237feabe42719e96b1f5a14ec63da90ad9bce60..1ef70eaa0114bddfa4b962aecf3b980c83a2ee0c 100644 --- a/app/code/core/Mage/Tag/view/frontend/customer/tags.phtml +++ b/app/code/core/Mage/Tag/view/frontend/customer/tags.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Tag/view/frontend/customer/view.phtml b/app/code/core/Mage/Tag/view/frontend/customer/view.phtml index 4f23a533c8cb99868096133356503ec7581de9f5..4a3f89f26e27c2d194dfe7e25d532feae8af9b47 100644 --- a/app/code/core/Mage/Tag/view/frontend/customer/view.phtml +++ b/app/code/core/Mage/Tag/view/frontend/customer/view.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Tag/view/frontend/layout.xml b/app/code/core/Mage/Tag/view/frontend/layout.xml index 8ddb5e18b097bf785a40e162cf1b187749a7d23c..7756237437f9cd4a94bef4ea90bc280680fb87de 100644 --- a/app/code/core/Mage/Tag/view/frontend/layout.xml +++ b/app/code/core/Mage/Tag/view/frontend/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/Tag/view/frontend/list.phtml b/app/code/core/Mage/Tag/view/frontend/list.phtml index 3a30733d0b41dc43c0c0b136a62f12bed37943eb..735ed04981655b03ec8e2c295d04e9776c92d42e 100644 --- a/app/code/core/Mage/Tag/view/frontend/list.phtml +++ b/app/code/core/Mage/Tag/view/frontend/list.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Tag/view/frontend/popular.phtml b/app/code/core/Mage/Tag/view/frontend/popular.phtml index 3cb39aa9f54452da1b90560d1c583b0856b318f2..746d1b9360fc361b1aeafaa4ac3692616677f03f 100644 --- a/app/code/core/Mage/Tag/view/frontend/popular.phtml +++ b/app/code/core/Mage/Tag/view/frontend/popular.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Tax/Block/Adminhtml/Frontend/Region/Updater.php b/app/code/core/Mage/Tax/Block/Adminhtml/Frontend/Region/Updater.php index afcf4b339d4466b025078316d7d5abe1188e5026..a7983cff74fcee0eb758c5a3f484b075234c7344 100644 --- a/app/code/core/Mage/Tax/Block/Adminhtml/Frontend/Region/Updater.php +++ b/app/code/core/Mage/Tax/Block/Adminhtml/Frontend/Region/Updater.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Block/Checkout/Discount.php b/app/code/core/Mage/Tax/Block/Checkout/Discount.php index 2e63200d5bdf2526b281515b1b4ab9ee848566d3..37ed20ce4b87890c1c9e5c3a57352f4c0ff4aaa3 100644 --- a/app/code/core/Mage/Tax/Block/Checkout/Discount.php +++ b/app/code/core/Mage/Tax/Block/Checkout/Discount.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Block/Checkout/Grandtotal.php b/app/code/core/Mage/Tax/Block/Checkout/Grandtotal.php index ba6fa305f407518f739babdf89dc993e6d51b5af..54bf77379866d41538d80517c28e0f1aca0809cb 100644 --- a/app/code/core/Mage/Tax/Block/Checkout/Grandtotal.php +++ b/app/code/core/Mage/Tax/Block/Checkout/Grandtotal.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Block/Checkout/Shipping.php b/app/code/core/Mage/Tax/Block/Checkout/Shipping.php index 1934f47f1ee1a3d3622321705e26166f98a03b0a..9fb37a1cae18bfdfe4f8a74b5d322ef84c1013e3 100644 --- a/app/code/core/Mage/Tax/Block/Checkout/Shipping.php +++ b/app/code/core/Mage/Tax/Block/Checkout/Shipping.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Block/Checkout/Subtotal.php b/app/code/core/Mage/Tax/Block/Checkout/Subtotal.php index a99cae737efdb6b26b11b465a7ed4cf0280bbb4a..85848646bec57480104eb7e8087696a81e8955e8 100644 --- a/app/code/core/Mage/Tax/Block/Checkout/Subtotal.php +++ b/app/code/core/Mage/Tax/Block/Checkout/Subtotal.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Block/Checkout/Tax.php b/app/code/core/Mage/Tax/Block/Checkout/Tax.php index a500d4f7361bfcf9169b5e1848af4087f0aa029d..b4a522918dea9fc2de554222a53a03f164eb8821 100644 --- a/app/code/core/Mage/Tax/Block/Checkout/Tax.php +++ b/app/code/core/Mage/Tax/Block/Checkout/Tax.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Block/Sales/Order/Tax.php b/app/code/core/Mage/Tax/Block/Sales/Order/Tax.php index 47787dcb75ad936a3b476f5d37fdc02be7252285..0f9904d8bee631e2f9656ed9ea105b79dfd49784 100644 --- a/app/code/core/Mage/Tax/Block/Sales/Order/Tax.php +++ b/app/code/core/Mage/Tax/Block/Sales/Order/Tax.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Exception.php b/app/code/core/Mage/Tax/Exception.php index 572fc887060187780d1cc75b27ad14c97cabc158..eb77e3bc907ef6e60b6be70804b2e6a067fe8a4b 100644 --- a/app/code/core/Mage/Tax/Exception.php +++ b/app/code/core/Mage/Tax/Exception.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Helper/Data.php b/app/code/core/Mage/Tax/Helper/Data.php index 74f3ca2c93e5cb59ed5d87ba9bca166ef5660149..82e3554ef34a65d5ef8bc413643d1878e17058b7 100644 --- a/app/code/core/Mage/Tax/Helper/Data.php +++ b/app/code/core/Mage/Tax/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Calculation.php b/app/code/core/Mage/Tax/Model/Calculation.php index c871d3cce68a66b8363f721e6c00bb806eb421aa..bdc78ae5000fbc473d71758bf1c08a798a13904f 100644 --- a/app/code/core/Mage/Tax/Model/Calculation.php +++ b/app/code/core/Mage/Tax/Model/Calculation.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -70,7 +70,7 @@ class Mage_Tax_Model_Calculation extends Mage_Core_Model_Abstract public function getDefaultCustomerTaxClass($store = null) { if ($this->_defaultCustomerTaxClass === null) { - $defaultCustomerGroup = Mage::getStoreConfig(Mage_Customer_Model_Group::XML_PATH_DEFAULT_ID, $store); + $defaultCustomerGroup = Mage::helper('Mage_Customer_Helper_Data')->getDefaultCustomerGroupId($store); $this->_defaultCustomerTaxClass = Mage::getModel('Mage_Customer_Model_Group')->getTaxClassId($defaultCustomerGroup); } return $this->_defaultCustomerTaxClass; diff --git a/app/code/core/Mage/Tax/Model/Calculation/Rate.php b/app/code/core/Mage/Tax/Model/Calculation/Rate.php index 32e1bfdc83f260093fb069f1c63d1d8abdc84c51..05ed6858634ba0c45083f84e1591396967873d90 100644 --- a/app/code/core/Mage/Tax/Model/Calculation/Rate.php +++ b/app/code/core/Mage/Tax/Model/Calculation/Rate.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Calculation/Rate/Title.php b/app/code/core/Mage/Tax/Model/Calculation/Rate/Title.php index 7c0aaae7abc28e997f84266cd06a62acdccc647d..61c58a9e31f0132955ad817eef23f46692a7a59a 100644 --- a/app/code/core/Mage/Tax/Model/Calculation/Rate/Title.php +++ b/app/code/core/Mage/Tax/Model/Calculation/Rate/Title.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Calculation/Rule.php b/app/code/core/Mage/Tax/Model/Calculation/Rule.php index 9bcca6061f72f81885067094337d5bfa8d79d872..954b110ac1d3425a7cb5a53e4f78ec708c29d576 100644 --- a/app/code/core/Mage/Tax/Model/Calculation/Rule.php +++ b/app/code/core/Mage/Tax/Model/Calculation/Rule.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Class.php b/app/code/core/Mage/Tax/Model/Class.php index 73718a219339acfc15b31a16628b567185d0d98b..eeec001561ff79e91335f2cc1ef0ca22f43fcdef 100644 --- a/app/code/core/Mage/Tax/Model/Class.php +++ b/app/code/core/Mage/Tax/Model/Class.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Class/Source/Customer.php b/app/code/core/Mage/Tax/Model/Class/Source/Customer.php index 6683287a11c65fe4f17014af24f3e9c1ed5de92a..376ac1e34be670b536bc23a7892f31f5a85ec6d7 100644 --- a/app/code/core/Mage/Tax/Model/Class/Source/Customer.php +++ b/app/code/core/Mage/Tax/Model/Class/Source/Customer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Class/Source/Product.php b/app/code/core/Mage/Tax/Model/Class/Source/Product.php index 63b212e100004f4345bebc5d9869d2ab99e8351f..8d50c0f460546000a9da39c57f0ad2fd92d2817e 100644 --- a/app/code/core/Mage/Tax/Model/Class/Source/Product.php +++ b/app/code/core/Mage/Tax/Model/Class/Source/Product.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Config.php b/app/code/core/Mage/Tax/Model/Config.php index e6077aea3f3094ed47cfb2608d57731e10b71397..4f9bc3f0a9d30b4835b66f95b61eda0360ff627b 100644 --- a/app/code/core/Mage/Tax/Model/Config.php +++ b/app/code/core/Mage/Tax/Model/Config.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Config/Price/Include.php b/app/code/core/Mage/Tax/Model/Config/Price/Include.php index e0258d81ca266f068728c67af5fa8109cc40920b..06cd76fb8602b2e21c756e8a3375431f1b6f9ae1 100644 --- a/app/code/core/Mage/Tax/Model/Config/Price/Include.php +++ b/app/code/core/Mage/Tax/Model/Config/Price/Include.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Tax_Model_Config_Price_Include extends Mage_Core_Model_Config_Data diff --git a/app/code/core/Mage/Tax/Model/Observer.php b/app/code/core/Mage/Tax/Model/Observer.php index 3af17041e08dfad591595c9c993c745ef83611d1..d4adc8d57d7bd980ff626e2c929ecad0edd59644 100644 --- a/app/code/core/Mage/Tax/Model/Observer.php +++ b/app/code/core/Mage/Tax/Model/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Resource/Calculation.php b/app/code/core/Mage/Tax/Model/Resource/Calculation.php index af065a62a98e9f456a42f7f16d0f49c6e985306f..16e247f3c0173f5f79b0c953ba91e0283c9b37c2 100755 --- a/app/code/core/Mage/Tax/Model/Resource/Calculation.php +++ b/app/code/core/Mage/Tax/Model/Resource/Calculation.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Resource/Calculation/Collection.php b/app/code/core/Mage/Tax/Model/Resource/Calculation/Collection.php index 0fa81571ac62f026e9ba66ce01547e9523d9217f..dde6923333e7775555da08e3e3c8b0973ffa1808 100755 --- a/app/code/core/Mage/Tax/Model/Resource/Calculation/Collection.php +++ b/app/code/core/Mage/Tax/Model/Resource/Calculation/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Resource/Calculation/Rate.php b/app/code/core/Mage/Tax/Model/Resource/Calculation/Rate.php index ee9f61561d6c1789eb04306f4e94639373aa02ab..d70a0a679f065af4019ffb8133cbc3a0e305bd93 100755 --- a/app/code/core/Mage/Tax/Model/Resource/Calculation/Rate.php +++ b/app/code/core/Mage/Tax/Model/Resource/Calculation/Rate.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Resource/Calculation/Rate/Collection.php b/app/code/core/Mage/Tax/Model/Resource/Calculation/Rate/Collection.php index f9d8e6d51f97ecc935d8efec663e569a90e8b08b..f152ab1fd24d6f2f29e1fe840c25c7f1efb7ed12 100755 --- a/app/code/core/Mage/Tax/Model/Resource/Calculation/Rate/Collection.php +++ b/app/code/core/Mage/Tax/Model/Resource/Calculation/Rate/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Resource/Calculation/Rate/Title.php b/app/code/core/Mage/Tax/Model/Resource/Calculation/Rate/Title.php index 9e28326275d4cde0618f62697fcc76fb49ec445e..35f94cc13b4317f149bc91e0672e703160e602ce 100755 --- a/app/code/core/Mage/Tax/Model/Resource/Calculation/Rate/Title.php +++ b/app/code/core/Mage/Tax/Model/Resource/Calculation/Rate/Title.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Resource/Calculation/Rate/Title/Collection.php b/app/code/core/Mage/Tax/Model/Resource/Calculation/Rate/Title/Collection.php index 0ed9524fb60d32035d8eb1641a557c893cbb10ff..65125167aad14deb743771097444bc7a1fef6179 100755 --- a/app/code/core/Mage/Tax/Model/Resource/Calculation/Rate/Title/Collection.php +++ b/app/code/core/Mage/Tax/Model/Resource/Calculation/Rate/Title/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Resource/Calculation/Rule.php b/app/code/core/Mage/Tax/Model/Resource/Calculation/Rule.php index b2b76c144ce1cc8340cd9e4b4196ba324b6418f4..42f4c5038af0065a66addfa29938c5dab62bf910 100755 --- a/app/code/core/Mage/Tax/Model/Resource/Calculation/Rule.php +++ b/app/code/core/Mage/Tax/Model/Resource/Calculation/Rule.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Resource/Calculation/Rule/Collection.php b/app/code/core/Mage/Tax/Model/Resource/Calculation/Rule/Collection.php index e05280bff13ab86eb812248d80f66c8320f68b51..8f02fc839f40da9a22e20f5da187d89bf14942a5 100755 --- a/app/code/core/Mage/Tax/Model/Resource/Calculation/Rule/Collection.php +++ b/app/code/core/Mage/Tax/Model/Resource/Calculation/Rule/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Resource/Class.php b/app/code/core/Mage/Tax/Model/Resource/Class.php index 07b07d1026690800fd5102dee7de4958777cf7d2..6a41cfd8d528017617ebdd8f9841cc08d76dd7bd 100755 --- a/app/code/core/Mage/Tax/Model/Resource/Class.php +++ b/app/code/core/Mage/Tax/Model/Resource/Class.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Resource/Class/Collection.php b/app/code/core/Mage/Tax/Model/Resource/Class/Collection.php index b0aa1440d58fde0f7bed39a7c36d18e1e8b239e6..5aa408ad4144910e07549d1b28e7a97eb6df5f3b 100755 --- a/app/code/core/Mage/Tax/Model/Resource/Class/Collection.php +++ b/app/code/core/Mage/Tax/Model/Resource/Class/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Resource/Report/Collection.php b/app/code/core/Mage/Tax/Model/Resource/Report/Collection.php index e7a6e173893b9e2ab23c32f441d5ec1f4e7351b5..00a19399e245682d867a462aa00de48eeb4b6323 100755 --- a/app/code/core/Mage/Tax/Model/Resource/Report/Collection.php +++ b/app/code/core/Mage/Tax/Model/Resource/Report/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Resource/Report/Tax.php b/app/code/core/Mage/Tax/Model/Resource/Report/Tax.php index 62bfc2bc3af7592b796247bcffd8d4b54857b099..81568a967aed9c614635a8ed6725c584d8530b95 100755 --- a/app/code/core/Mage/Tax/Model/Resource/Report/Tax.php +++ b/app/code/core/Mage/Tax/Model/Resource/Report/Tax.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Resource/Report/Tax/Createdat.php b/app/code/core/Mage/Tax/Model/Resource/Report/Tax/Createdat.php index 1f89fb45b0a59b42a4cd8a6d7a93c04144a881a6..1cd5e3f2d04cf64b182015387fc41a3292b754fb 100644 --- a/app/code/core/Mage/Tax/Model/Resource/Report/Tax/Createdat.php +++ b/app/code/core/Mage/Tax/Model/Resource/Report/Tax/Createdat.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Resource/Report/Tax/Updatedat.php b/app/code/core/Mage/Tax/Model/Resource/Report/Tax/Updatedat.php index ac753906f55a2581b72ff089ca03a5c54c8b3440..1baa178a6a82d246afeeab13cf8c40fe9cf219d7 100644 --- a/app/code/core/Mage/Tax/Model/Resource/Report/Tax/Updatedat.php +++ b/app/code/core/Mage/Tax/Model/Resource/Report/Tax/Updatedat.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Resource/Report/Updatedat/Collection.php b/app/code/core/Mage/Tax/Model/Resource/Report/Updatedat/Collection.php index 4c4222b8c76d326ffff28d30bd996d01cd8b6c01..ec1ed8c95d23d1f27cb31a5716a5450078585086 100755 --- a/app/code/core/Mage/Tax/Model/Resource/Report/Updatedat/Collection.php +++ b/app/code/core/Mage/Tax/Model/Resource/Report/Updatedat/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Resource/Sales/Order/Tax.php b/app/code/core/Mage/Tax/Model/Resource/Sales/Order/Tax.php index 170e671912611c74e927fc19cbae83cd59f1a621..1fdf12be9516cf8c853a7ef8c57eff632dbe87ae 100755 --- a/app/code/core/Mage/Tax/Model/Resource/Sales/Order/Tax.php +++ b/app/code/core/Mage/Tax/Model/Resource/Sales/Order/Tax.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Resource/Sales/Order/Tax/Collection.php b/app/code/core/Mage/Tax/Model/Resource/Sales/Order/Tax/Collection.php index 6a60d5c9e329b75e0346771bb77e02a01b02f3df..95efc86407eafa5b25a670bececaeb37f377e370 100755 --- a/app/code/core/Mage/Tax/Model/Resource/Sales/Order/Tax/Collection.php +++ b/app/code/core/Mage/Tax/Model/Resource/Sales/Order/Tax/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Resource/Sales/Order/Tax/Item.php b/app/code/core/Mage/Tax/Model/Resource/Sales/Order/Tax/Item.php index ce15e61fda3971a1e73e8f9c76eb5441bbad5ef0..a2b4546f7f9a15cf20aca8634ea73d623c5430e6 100755 --- a/app/code/core/Mage/Tax/Model/Resource/Sales/Order/Tax/Item.php +++ b/app/code/core/Mage/Tax/Model/Resource/Sales/Order/Tax/Item.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Resource/Sales/Order/Tax/Item/Collection.php b/app/code/core/Mage/Tax/Model/Resource/Sales/Order/Tax/Item/Collection.php index 801e763b8abd8a577c3df06c7554e2d60aa6ee42..dee0dc61bfc791468f03c6d5981cd2f1d390222f 100755 --- a/app/code/core/Mage/Tax/Model/Resource/Sales/Order/Tax/Item/Collection.php +++ b/app/code/core/Mage/Tax/Model/Resource/Sales/Order/Tax/Item/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Resource/Setup.php b/app/code/core/Mage/Tax/Model/Resource/Setup.php index adeeb61fe804f4d6cd9b75bc5e3b852ac6be6b6f..c1cf9d3e6750cd759fbd7c55e4a8e07cd3dd347e 100755 --- a/app/code/core/Mage/Tax/Model/Resource/Setup.php +++ b/app/code/core/Mage/Tax/Model/Resource/Setup.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Sales/Order/Tax.php b/app/code/core/Mage/Tax/Model/Sales/Order/Tax.php index cf0b6f1f9b57fbd2991a9c9921dc46e731fbf0c3..267828884cd9c76ba72dff803be214d6d7ed750b 100644 --- a/app/code/core/Mage/Tax/Model/Sales/Order/Tax.php +++ b/app/code/core/Mage/Tax/Model/Sales/Order/Tax.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Sales/Order/Tax/Item.php b/app/code/core/Mage/Tax/Model/Sales/Order/Tax/Item.php index f75b34fd42c54d8b8568af355be2ff55241d2e99..3dfd563db166586e87c410e62efd0b7c1211d20c 100644 --- a/app/code/core/Mage/Tax/Model/Sales/Order/Tax/Item.php +++ b/app/code/core/Mage/Tax/Model/Sales/Order/Tax/Item.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Sales/Pdf/Grandtotal.php b/app/code/core/Mage/Tax/Model/Sales/Pdf/Grandtotal.php index 8ab698a5065f2b63059a1da77c5aabace3ca5cc3..dbb98749dc50b142f1b92dc162257bbd8f248e46 100644 --- a/app/code/core/Mage/Tax/Model/Sales/Pdf/Grandtotal.php +++ b/app/code/core/Mage/Tax/Model/Sales/Pdf/Grandtotal.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Sales/Pdf/Shipping.php b/app/code/core/Mage/Tax/Model/Sales/Pdf/Shipping.php index 3d132608573dde59fcefef44246eb29ee632fe35..80d455c180d60ac6aea7ba479dfca3ed571ec689 100644 --- a/app/code/core/Mage/Tax/Model/Sales/Pdf/Shipping.php +++ b/app/code/core/Mage/Tax/Model/Sales/Pdf/Shipping.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Sales/Pdf/Subtotal.php b/app/code/core/Mage/Tax/Model/Sales/Pdf/Subtotal.php index 7e925b39ae642aa5061f5806dea15d1853ff6cde..ceb7eafca58bb951b4ac148b1f27aec8f8499d7e 100644 --- a/app/code/core/Mage/Tax/Model/Sales/Pdf/Subtotal.php +++ b/app/code/core/Mage/Tax/Model/Sales/Pdf/Subtotal.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Sales/Pdf/Tax.php b/app/code/core/Mage/Tax/Model/Sales/Pdf/Tax.php index 6a3c6a4ddcbd2ad4cf6d746385e90f1cbb65d310..405ceeeb5ae18b8a26bdcaf28f685136ea172f01 100644 --- a/app/code/core/Mage/Tax/Model/Sales/Pdf/Tax.php +++ b/app/code/core/Mage/Tax/Model/Sales/Pdf/Tax.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Sales/Total/Quote/Discount.php b/app/code/core/Mage/Tax/Model/Sales/Total/Quote/Discount.php index efd0f29218713c8bee3cd3116135739bb3c391f6..7cdbb337b879a013d0e2a8f6b6143f6415f5f2d1 100644 --- a/app/code/core/Mage/Tax/Model/Sales/Total/Quote/Discount.php +++ b/app/code/core/Mage/Tax/Model/Sales/Total/Quote/Discount.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Sales/Total/Quote/Nominal/Subtotal.php b/app/code/core/Mage/Tax/Model/Sales/Total/Quote/Nominal/Subtotal.php index 94c946bf63f26548c47c9030de5ec5ab3e31d8b5..3618738003d9a3c148e656240755222344953c83 100644 --- a/app/code/core/Mage/Tax/Model/Sales/Total/Quote/Nominal/Subtotal.php +++ b/app/code/core/Mage/Tax/Model/Sales/Total/Quote/Nominal/Subtotal.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Sales/Total/Quote/Nominal/Tax.php b/app/code/core/Mage/Tax/Model/Sales/Total/Quote/Nominal/Tax.php index db346692e01bd74c4644f5adc4ddeef861624232..d33cadb96e3b829cf96c3162e79a4a81661b3928 100644 --- a/app/code/core/Mage/Tax/Model/Sales/Total/Quote/Nominal/Tax.php +++ b/app/code/core/Mage/Tax/Model/Sales/Total/Quote/Nominal/Tax.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Sales/Total/Quote/Shipping.php b/app/code/core/Mage/Tax/Model/Sales/Total/Quote/Shipping.php index 6716d775d7fec30d11ceb92b2ccf8965ec62cc99..d7d11480c872b12a2ff81f0d607589c5ee4f97f8 100644 --- a/app/code/core/Mage/Tax/Model/Sales/Total/Quote/Shipping.php +++ b/app/code/core/Mage/Tax/Model/Sales/Total/Quote/Shipping.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/Sales/Total/Quote/Subtotal.php b/app/code/core/Mage/Tax/Model/Sales/Total/Quote/Subtotal.php index a9a8fea10648454505dc6fb75310d13aee483a8c..6ddb12bb96663fc58f168aa9ddc63dd0f3b693e4 100644 --- a/app/code/core/Mage/Tax/Model/Sales/Total/Quote/Subtotal.php +++ b/app/code/core/Mage/Tax/Model/Sales/Total/Quote/Subtotal.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -64,8 +64,18 @@ class Mage_Tax_Model_Sales_Total_Quote_Subtotal extends Mage_Sales_Model_Quote_A */ protected $_storeTaxRequest = null; + /** + * Quote store + * + * @var Mage_Core_Model_Store + */ protected $_store; + /** + * Rounding deltas for prices + * + * @var array + */ protected $_roundingDeltas = array(); /** @@ -81,7 +91,7 @@ class Mage_Tax_Model_Sales_Total_Quote_Subtotal extends Mage_Sales_Model_Quote_A /** * Calculate item price including/excluding tax, row total including/excluding tax - * and subotal including/excluding tax. + * and subtotal including/excluding tax. * Determine discount price if needed * * @param Mage_Sales_Model_Quote_Address $address @@ -588,10 +598,10 @@ class Mage_Tax_Model_Sales_Total_Quote_Subtotal extends Mage_Sales_Model_Quote_A protected function _deltaRound($price, $rate, $direction, $type='regular') { if ($price) { - $rate = (string) $rate; - $type = $type.$direction; - $delta = isset($this->_roundingDeltas[$type][$rate]) ? $this->_roundingDeltas[$type][$rate] : 0; - $price += $delta; + $rate = (string) $rate; + $type = $type . $direction; + $delta = isset($this->_roundingDeltas[$type][$rate]) ? $this->_roundingDeltas[$type][$rate] : 0; + $price += $delta; $this->_roundingDeltas[$type][$rate] = $price - $this->_calculator->round($price); $price = $this->_calculator->round($price); } diff --git a/app/code/core/Mage/Tax/Model/Sales/Total/Quote/Tax.php b/app/code/core/Mage/Tax/Model/Sales/Total/Quote/Tax.php index 12da51766aa53de641ea08642dcbb153d540d571..cd70c72b4ab11ea05d599bb30663bd68563055aa 100644 --- a/app/code/core/Mage/Tax/Model/Sales/Total/Quote/Tax.php +++ b/app/code/core/Mage/Tax/Model/Sales/Total/Quote/Tax.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -695,12 +695,12 @@ class Mage_Tax_Model_Sales_Total_Quote_Tax extends Mage_Sales_Model_Quote_Addres protected function _deltaRound($price, $rate, $direction, $type='regular') { if ($price) { - $rate = (string) $rate; - $type = $type.$direction; - $delta = isset($this->_roundingDeltas[$type][$rate]) ? $this->_roundingDeltas[$type][$rate] : 0; - $price += $delta; + $rate = (string) $rate; + $type = $type . $direction; + $delta = isset($this->_roundingDeltas[$type][$rate]) ? $this->_roundingDeltas[$type][$rate] : 0; + $price += $delta; $this->_roundingDeltas[$type][$rate] = $price - $this->_calculator->round($price); - $price = $this->_calculator->round($price); + $price = $this->_calculator->round($price); } return $price; } diff --git a/app/code/core/Mage/Tax/Model/System/Config/Source/Algorithm.php b/app/code/core/Mage/Tax/Model/System/Config/Source/Algorithm.php index ff2006e64163c5a47785c843435f1176e586d2f0..05295c45ab4b3b4588fdc5826cfa05ba48b51b58 100644 --- a/app/code/core/Mage/Tax/Model/System/Config/Source/Algorithm.php +++ b/app/code/core/Mage/Tax/Model/System/Config/Source/Algorithm.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/System/Config/Source/Apply.php b/app/code/core/Mage/Tax/Model/System/Config/Source/Apply.php index 5c28dd2c7472bf9900f06f0854a97ae3b8d4a51f..ebed5ea1d8f50b2253c648fc0d14016caad365a0 100644 --- a/app/code/core/Mage/Tax/Model/System/Config/Source/Apply.php +++ b/app/code/core/Mage/Tax/Model/System/Config/Source/Apply.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/System/Config/Source/PriceType.php b/app/code/core/Mage/Tax/Model/System/Config/Source/PriceType.php index 6100357e50ed6ab0ac50e7bf225782a02692a1db..c94db95f533e380a8bc1167b7d2be9b2b58a8980 100644 --- a/app/code/core/Mage/Tax/Model/System/Config/Source/PriceType.php +++ b/app/code/core/Mage/Tax/Model/System/Config/Source/PriceType.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/System/Config/Source/Tax/Country.php b/app/code/core/Mage/Tax/Model/System/Config/Source/Tax/Country.php index b287543ad1738097621edc4353ed3f075f740c2a..a7d8e961ac18a6ce2b605b37d42c08d4b6a47725 100644 --- a/app/code/core/Mage/Tax/Model/System/Config/Source/Tax/Country.php +++ b/app/code/core/Mage/Tax/Model/System/Config/Source/Tax/Country.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/System/Config/Source/Tax/Display/Type.php b/app/code/core/Mage/Tax/Model/System/Config/Source/Tax/Display/Type.php index a39fa0ffcd38cf26c8e94bf4cb38f2de4f70f954..fca4db70e640f450dcaa54ce433b93ac09680ee5 100644 --- a/app/code/core/Mage/Tax/Model/System/Config/Source/Tax/Display/Type.php +++ b/app/code/core/Mage/Tax/Model/System/Config/Source/Tax/Display/Type.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/Model/System/Config/Source/Tax/Region.php b/app/code/core/Mage/Tax/Model/System/Config/Source/Tax/Region.php index 821f4af92e0251a401a72666d45229927897f04c..e34a0eb13598afbf7d61f9c502f6700d0e0267c4 100644 --- a/app/code/core/Mage/Tax/Model/System/Config/Source/Tax/Region.php +++ b/app/code/core/Mage/Tax/Model/System/Config/Source/Tax/Region.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/data/tax_setup/data-install-1.6.0.0.php b/app/code/core/Mage/Tax/data/tax_setup/data-install-1.6.0.0.php index 9a35e17597c3976154b32503972719623a11e325..f07f6c3dfd790d9bc8852d936aa243892b30ae5c 100644 --- a/app/code/core/Mage/Tax/data/tax_setup/data-install-1.6.0.0.php +++ b/app/code/core/Mage/Tax/data/tax_setup/data-install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ /** @var $installer Mage_Tax_Model_Resource_Setup */ diff --git a/app/code/core/Mage/Tax/etc/adminhtml.xml b/app/code/core/Mage/Tax/etc/adminhtml.xml index 3be5e71d76806d95019618fd11bab8ff2cc4cad7..a97a637ce67c217137e251c7f3b167ce0818644f 100644 --- a/app/code/core/Mage/Tax/etc/adminhtml.xml +++ b/app/code/core/Mage/Tax/etc/adminhtml.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Tax/etc/config.xml b/app/code/core/Mage/Tax/etc/config.xml index 495ca2ece0eb1d787f85e607fd47aa6ad1854f2f..c176a9d91f65ccf26fc926fd57e176fb977a621b 100644 --- a/app/code/core/Mage/Tax/etc/config.xml +++ b/app/code/core/Mage/Tax/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Tax/etc/fieldset.xml b/app/code/core/Mage/Tax/etc/fieldset.xml index f46bb2bc08af4120148b81e511679e33d4228fcd..1d7ee3b7af75d102b264c36c4f72432d14d808f8 100644 --- a/app/code/core/Mage/Tax/etc/fieldset.xml +++ b/app/code/core/Mage/Tax/etc/fieldset.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Tax/etc/system.xml b/app/code/core/Mage/Tax/etc/system.xml index 753ac60c9986a3ac48141fb80d33855d6e7304ee..df7c16b1299f750bf7d776b1d731cd2cbf13ad0c 100644 --- a/app/code/core/Mage/Tax/etc/system.xml +++ b/app/code/core/Mage/Tax/etc/system.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Tax/sql/tax_setup/install-1.6.0.0.php b/app/code/core/Mage/Tax/sql/tax_setup/install-1.6.0.0.php index 31da460377f3944c86d362d67ff720525ef8930d..caef882ee4ab6cbacfc765734e8635cc2b8d4bbf 100644 --- a/app/code/core/Mage/Tax/sql/tax_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/Tax/sql/tax_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ /** @var $installer Mage_Tax_Model_Resource_Setup */ diff --git a/app/code/core/Mage/Tax/sql/tax_setup/upgrade-1.6.0.0-1.6.0.1.php b/app/code/core/Mage/Tax/sql/tax_setup/upgrade-1.6.0.0-1.6.0.1.php index 016f7666fea0b2d44cd077850259aa8ae96e25a0..df2a275c0fd9cc4e78f89448dd074a7bf6be9d94 100644 --- a/app/code/core/Mage/Tax/sql/tax_setup/upgrade-1.6.0.0-1.6.0.1.php +++ b/app/code/core/Mage/Tax/sql/tax_setup/upgrade-1.6.0.0-1.6.0.1.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Catalog - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/sql/tax_setup/upgrade-1.6.0.1-1.6.0.2.php b/app/code/core/Mage/Tax/sql/tax_setup/upgrade-1.6.0.1-1.6.0.2.php index 27fa5d4a539967652985a851c9c22f34c43cf911..e9850be20edf546cd2cd6a5263833168aceb502a 100644 --- a/app/code/core/Mage/Tax/sql/tax_setup/upgrade-1.6.0.1-1.6.0.2.php +++ b/app/code/core/Mage/Tax/sql/tax_setup/upgrade-1.6.0.1-1.6.0.2.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/sql/tax_setup/upgrade-1.6.0.2-1.6.0.3.php b/app/code/core/Mage/Tax/sql/tax_setup/upgrade-1.6.0.2-1.6.0.3.php index eae59d1f9ebf90c1cffde6ad001a53576c321613..40a2745f1db2bc6af48f76786238011e2e8e264a 100644 --- a/app/code/core/Mage/Tax/sql/tax_setup/upgrade-1.6.0.2-1.6.0.3.php +++ b/app/code/core/Mage/Tax/sql/tax_setup/upgrade-1.6.0.2-1.6.0.3.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Tax - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Tax/view/frontend/checkout/discount.phtml b/app/code/core/Mage/Tax/view/frontend/checkout/discount.phtml index 26a415a950fc1edf463ee4b470014399cc64eb3e..964a3fa117b77eb5a1ad6a9863015f679e41dcff 100644 --- a/app/code/core/Mage/Tax/view/frontend/checkout/discount.phtml +++ b/app/code/core/Mage/Tax/view/frontend/checkout/discount.phtml @@ -20,6 +20,6 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/Tax/view/frontend/checkout/grandtotal.phtml b/app/code/core/Mage/Tax/view/frontend/checkout/grandtotal.phtml index f3d0ffae7eea88a5446d4693bedd3042c69c19a6..2f835d33de1866338e7762f1b049f3f06059c6cd 100644 --- a/app/code/core/Mage/Tax/view/frontend/checkout/grandtotal.phtml +++ b/app/code/core/Mage/Tax/view/frontend/checkout/grandtotal.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /** diff --git a/app/code/core/Mage/Tax/view/frontend/checkout/shipping.phtml b/app/code/core/Mage/Tax/view/frontend/checkout/shipping.phtml index 694c434a77c7fbd592a8e946e1aee6cfc8fad7be..7df994d508cb33a135801d50eecf891548d530a3 100644 --- a/app/code/core/Mage/Tax/view/frontend/checkout/shipping.phtml +++ b/app/code/core/Mage/Tax/view/frontend/checkout/shipping.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /** diff --git a/app/code/core/Mage/Tax/view/frontend/checkout/subtotal.phtml b/app/code/core/Mage/Tax/view/frontend/checkout/subtotal.phtml index 4319e5cb3723973336d33f639448368d13e814c1..2949899c886b004aa006cd82c2432ef55cf646e4 100644 --- a/app/code/core/Mage/Tax/view/frontend/checkout/subtotal.phtml +++ b/app/code/core/Mage/Tax/view/frontend/checkout/subtotal.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /** diff --git a/app/code/core/Mage/Tax/view/frontend/checkout/tax.phtml b/app/code/core/Mage/Tax/view/frontend/checkout/tax.phtml index 1ca2b6fced5fb74874ed1dfad3e41dfe798bb552..2a757fcd29654659c6be66ad0fa9eff05cd51351 100644 --- a/app/code/core/Mage/Tax/view/frontend/checkout/tax.phtml +++ b/app/code/core/Mage/Tax/view/frontend/checkout/tax.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /** diff --git a/app/code/core/Mage/Tax/view/frontend/order/tax.phtml b/app/code/core/Mage/Tax/view/frontend/order/tax.phtml index f1fabf347ea09adcfbf02f69497d82dd346da0ea..8aa6562581cba2fdc0b0d04e0d0dcd933d79baa4 100644 --- a/app/code/core/Mage/Tax/view/frontend/order/tax.phtml +++ b/app/code/core/Mage/Tax/view/frontend/order/tax.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Usa/Block/Adminhtml/Dhl/Unitofmeasure.php b/app/code/core/Mage/Usa/Block/Adminhtml/Dhl/Unitofmeasure.php new file mode 100644 index 0000000000000000000000000000000000000000..1766570c89f2db2383cfbfb52f1f3832cc4033e5 --- /dev/null +++ b/app/code/core/Mage/Usa/Block/Adminhtml/Dhl/Unitofmeasure.php @@ -0,0 +1,82 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Usa + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Frontend model for DHL shipping methods for documentation + * + * @category Mage + * @package Mage_Usa + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Usa_Block_Adminhtml_Dhl_Unitofmeasure extends Mage_Adminhtml_Block_System_Config_Form_Field +{ + + /** + * Define params and variables + * + * @return void + */ + public function _construct() + { + parent::_construct(); + + $carrierModel = Mage::getSingleton('Mage_Usa_Model_Shipping_Carrier_Dhl_International'); + + $this->setInch($this->jsQuoteEscape($carrierModel->getCode('unit_of_dimension_cut', 'I'))); + $this->setCm($this->jsQuoteEscape($carrierModel->getCode('unit_of_dimension_cut', 'C'))); + + $this->setHeight($this->jsQuoteEscape($carrierModel->getCode('dimensions', 'height'))); + $this->setDepth($this->jsQuoteEscape($carrierModel->getCode('dimensions', 'depth'))); + $this->setWidth($this->jsQuoteEscape($carrierModel->getCode('dimensions', 'width'))); + + $kgWeight = 70; + + $this->setDivideOrderWeightNoteKg( + $this->jsQuoteEscape($this->__('Allows breaking total order weight into smaller pieces if it exeeds %s %s to ensure accurate calculation of shipping charges.', $kgWeight, 'kg')) + ); + + $weight = round( + Mage::helper('Mage_Usa_Helper_Data')->convertMeasureWeight( + $kgWeight, Zend_Measure_Weight::KILOGRAM, Zend_Measure_Weight::POUND), 3); + + $this->setDivideOrderWeightNoteLbp( + $this->jsQuoteEscape($this->__('Allows breaking total order weight into smaller pieces if it exeeds %s %s to ensure accurate calculation of shipping charges.', $weight, 'pounds')) + ); + + $this->setTemplate('dhl/unitofmeasure.phtml'); + } + + /** + * Retrieve Element HTML fragment + * + * @param Varien_Data_Form_Element_Abstract $element + * @return string + */ + protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element) + { + return parent::_getElementHtml($element) . $this->renderView(); + } +} diff --git a/app/code/core/Mage/Usa/Helper/Data.php b/app/code/core/Mage/Usa/Helper/Data.php index 1b66194c1c44d050f286ec54ec822a4b887844d6..8818068929885f3e40275975aff1e2d027b51edd 100644 --- a/app/code/core/Mage/Usa/Helper/Data.php +++ b/app/code/core/Mage/Usa/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Usa - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Abstract.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Abstract.php index 7d434e97f736a78911b300a95651e05b24d27fa5..a6da8c6ee1adc10f83c4f9ad109c4a6e4337f45f 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Abstract.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Usa - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -144,7 +144,7 @@ abstract class Mage_Usa_Model_Shipping_Carrier_Abstract extends Mage_Shipping_Mo * @param Mage_Shipping_Model_Rate_Request $request * @return Mage_Shipping_Model_Carrier_Abstract|Mage_Shipping_Model_Rate_Result_Error|boolean */ - public function processAdditionalValidation(Mage_Shipping_Model_Rate_Request $request) + public function proccessAdditionalValidation(Mage_Shipping_Model_Rate_Request $request) { //Skip by item validation if there is no items in request if(!count($this->getAllItems($request))) { @@ -159,7 +159,7 @@ abstract class Mage_Usa_Model_Shipping_Carrier_Abstract extends Mage_Shipping_Mo foreach ($this->getAllItems($request) as $item) { if ($item->getProduct() && $item->getProduct()->getId()) { - if ($item->getProduct()->getWeight() > $maxAllowedWeight) { + if ($item->getProduct()->getWeight() * $item->getQty() > $maxAllowedWeight) { $errorMsg = ($configErrorMsg) ? $configErrorMsg : $defaultErrorMsg; break; } diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl.php index d59e1b0fdc799c35fefe4f1f99e605c107681081..fcc410634c4190b70ef78c06f826a6c17b028fa7 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Usa - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -383,6 +383,8 @@ class Mage_Usa_Model_Shipping_Carrier_Dhl $r->setPackageId($request->getPackageId()); } + $r->setBaseSubtotalInclTax($request->getBaseSubtotalInclTax()); + $this->_rawRequest = $r; return $this; } @@ -798,8 +800,7 @@ class Mage_Usa_Model_Shipping_Carrier_Dhl $code = (string)$xml->Faults->Fault->Code; $description = $xml->Faults->Fault->Description; $context = $xml->Faults->Fault->Context; - $this->_errors[$code] = Mage::helper('Mage_Usa_Helper_Data')->__('Error #%s : %s (%s)', $code, $description, - $context); + $this->_errors[$code] = Mage::helper('Mage_Usa_Helper_Data')->__('Error #%s : %s (%s)', $code, $description, $context); } else { if ($r->getDestCountryId() == self::USA_COUNTRY_ID) { if ($xml->Shipment) { @@ -1198,15 +1199,9 @@ class Mage_Usa_Model_Shipping_Carrier_Dhl } else { $description = (string)$txml->Result->Desc; if ($description) - $errorArr[$tracknum] = Mage::helper('Mage_Usa_Helper_Data')->__( - 'Error #%s: %s', - $code, - $description - ); + $errorArr[$tracknum] = Mage::helper('Mage_Usa_Helper_Data')->__('Error #%s: %s', $code, $description); else - $errorArr[$tracknum] = Mage::helper('Mage_Usa_Helper_Data')->__( - 'Unable to retrieve tracking' - ); + $errorArr[$tracknum] = Mage::helper('Mage_Usa_Helper_Data')->__('Unable to retrieve tracking'); } } else { $errorArr[$tracknum] = Mage::helper('Mage_Usa_Helper_Data')->__('Unable to retrieve tracking'); @@ -1371,6 +1366,8 @@ class Mage_Usa_Model_Shipping_Carrier_Dhl $request->setPackageCustomsValue($customsValue); $request->setFreeMethodWeight(0); $request->setDhlShipmentType($request->getPackagingType()); + + $request->setBaseSubtotalInclTax($request->getBaseSubtotalInclTax()); } /** diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International.php new file mode 100644 index 0000000000000000000000000000000000000000..56f60bb1731aa3df58280a760788362294e43199 --- /dev/null +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International.php @@ -0,0 +1,1646 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Usa + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * DHL International (API v1.4) + * + * @category Mage + * @package Mage_Usa + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Usa_Model_Shipping_Carrier_Dhl_International + extends Mage_Usa_Model_Shipping_Carrier_Abstract + implements Mage_Shipping_Model_Carrier_Interface +{ + /** + * Carrier Product indicator + */ + const DHL_CONTENT_TYPE_DOC = 'D'; + const DHL_CONTENT_TYPE_NON_DOC = 'N'; + + /** + * Minimum allowed values for shipping package dimensions + */ + const DIMENSION_MIN_CM = 3; + const DIMENSION_MIN_IN = 1; + + /** + * Container types that could be customized + * + * @var array + */ + protected $_customizableContainerTypes = array(self::DHL_CONTENT_TYPE_NON_DOC); + + /** + * Code of the carrier + */ + const CODE = 'dhlint'; + + /** + * Rate request data + * + * @var Mage_Shipping_Model_Rate_Request|null + */ + protected $_request = null; + + /** + * Raw rate request data + * + * @var Varien_Object|null + */ + protected $_rawRequest = null; + + /** + * Rate result data + * + * @var Mage_Shipping_Model_Rate_Result|null + */ + protected $_result = null; + + /** + * Countries parameters data + * + * @var SimpleXMLElement|null + */ + protected $_countryParams = null; + + /** + * Errors placeholder + * + * @var array + */ + protected $_errors = array(); + + /** + * Dhl rates result + * + * @var array + */ + protected $_rates = array(); + + /** + * Store Id + * + * @var int|null + */ + protected $_storeId = null; + + /** + * Carrier's code + * + * @var string + */ + protected $_code = self::CODE; + + /** + * Free Method config path + * + * @var string + */ + protected $_freeMethod = 'free_method_nondoc'; + + /** + * Max weight without fee + * + * @var int + */ + protected $_maxWeight = 70; + + /** + * Flag if response is for shipping label creating + * + * @var bool + */ + protected $_isShippingLabelFlag = false; + + /** + * Request variables array + * + * @var array + */ + protected $_requestVariables = array( + 'id' => array('code' => 'dhl_id', 'setCode' => 'id'), + 'password' => array('code' => 'dhl_password', 'setCode' => 'password'), + 'account' => array('code' => 'dhl_account', 'setCode' => 'account_nbr'), + 'shipping_key' => array('code' => 'dhl_shipping_key', 'setCode' => 'shipping_key'), + 'shipping_intlkey' => array('code' => 'dhl_shipping_intl_key', 'setCode' => 'shipping_intl_key'), + 'shipment_type' => array('code' => 'dhl_shipment_type', 'setCode' => 'shipment_type'), + 'dutiable' => array('code' => 'dhl_dutiable', 'setCode' => 'dutiable'), + 'dutypaymenttype' => array('code' => 'dhl_duty_payment_type', 'setCode' => 'duty_payment_type'), + 'contentdesc' => array('code' => 'dhl_content_desc', 'setCode' => 'content_desc') + ); + + /** + * Dhl International Class constructor + * + * Sets necessary data + */ + protected function _construct() + { + if ($this->getConfigData('content_type') == self::DHL_CONTENT_TYPE_DOC) { + $this->_freeMethod = 'free_method_doc'; + } + } + + /** + * Returns value of given variable + * + * @param mixed $origValue + * @param string $pathToValue + * @return mixed + */ + protected function _getDefaultValue($origValue, $pathToValue) + { + if (!$origValue) { + $origValue = Mage::getStoreConfig( + $pathToValue, + $this->_storeId + ); + } + + return $origValue; + } + + /** + * Collect and get rates + * + * @param Mage_Shipping_Model_Rate_Request $request + * @return bool|Mage_Shipping_Model_Rate_Result|null + */ + public function collectRates(Mage_Shipping_Model_Rate_Request $request) + { + if (!$this->getConfigFlag($this->_activeFlag)) { + return false; + } + + $requestDhl = clone $request; + $this->_storeId = $requestDhl->getStoreId(); + + $origCompanyName = $this->_getDefaultValue( + $requestDhl->getOrigCompanyName(), + Mage_Core_Model_Store::XML_PATH_STORE_STORE_NAME + ); + $origCountryId = $this->_getDefaultValue( + $requestDhl->getOrigCountryId(), + Mage_Shipping_Model_Shipping::XML_PATH_STORE_COUNTRY_ID + ); + $origState = $this->_getDefaultValue( + $requestDhl->getOrigState(), + Mage_Shipping_Model_Shipping::XML_PATH_STORE_REGION_ID + ); + $origCity = $this->_getDefaultValue( + $requestDhl->getOrigCity(), + Mage_Shipping_Model_Shipping::XML_PATH_STORE_CITY + ); + $origPostcode = $this->_getDefaultValue( + $requestDhl->getOrigPostcode(), + Mage_Shipping_Model_Shipping::XML_PATH_STORE_ZIP + ); + + $requestDhl->setOrigCompanyName($origCompanyName) + ->setCountryId($origCountryId) + ->setOrigState($origState) + ->setOrigCity($origCity) + ->setOrigPostal($origPostcode); + $this->setRequest($requestDhl); + + $this->_result = $this->_getQuotes(); + + $this->_updateFreeMethodQuote($request); + + return $this->_result; + } + + /** + * Set Free Method Request + * + * @param string $freeMethod + * @return void + */ + protected function _setFreeMethodRequest($freeMethod) + { + $rawRequest = $this->_rawRequest; + + $rawRequest->setFreeMethodRequest(true); + $freeWeight = $this->getTotalNumOfBoxes($rawRequest->getFreeMethodWeight()); + $rawRequest->setWeight($freeWeight); + $rawRequest->setService($freeMethod); + } + + /** + * Returns request result + * + * @return Mage_Shipping_Model_Rate_Result|null + */ + public function getResult() + { + return $this->_result; + } + + protected function _addParams($requestObject) + { + $request = $this->_request; + foreach ($this->_requestVariables as $code => $objectCode) { + if ($request->getDhlId()) { + $value = $request->getData($objectCode['code']); + } else { + $value = $this->getConfigData($code); + } + $requestObject->setData($objectCode['setCode'], $value); + } + return $requestObject; + } + + /** + * Prepare and set request in property of current instance + * + * @param Varien_Object $request + * @return Mage_Usa_Model_Shipping_Carrier_Dhl + */ + public function setRequest(Varien_Object $request) + { + $this->_request = $request; + $this->_storeId = $request->getStoreId(); + + $requestObject = new Varien_Object(); + + $requestObject->setIsGenerateLabelReturn($request->getIsGenerateLabelReturn()); + + $requestObject->setStoreId($request->getStoreId()); + + if ($request->getLimitMethod()) { + $requestObject->setService($request->getLimitMethod()); + } + + $requestObject = $this->_addParams($requestObject); + + if ($request->getDestPostcode()) { + $requestObject->setDestPostal($request->getDestPostcode()); + } + + $requestObject->setOrigCountry( + $this->_getDefaultValue( + $request->getOrigCountry(), Mage_Shipping_Model_Shipping::XML_PATH_STORE_COUNTRY_ID) + ) + ->setOrigCountryId( + $this->_getDefaultValue( + $request->getOrigCountryId(), Mage_Shipping_Model_Shipping::XML_PATH_STORE_COUNTRY_ID) + ); + + $shippingWeight = $request->getPackageWeight(); + + $requestObject->setValue(round($request->getPackageValue(), 2)) + ->setValueWithDiscount($request->getPackageValueWithDiscount()) + ->setCustomsValue($request->getPackageCustomsValue()) + ->setDestStreet( + Mage::helper('Mage_Core_Helper_String')->substr(str_replace("\n", '', $request->getDestStreet()), 0, 35)) + ->setDestStreetLine2($request->getDestStreetLine2()) + ->setDestCity($request->getDestCity()) + ->setOrigCompanyName($request->getOrigCompanyName()) + ->setOrigCity($request->getOrigCity()) + ->setOrigPhoneNumber($request->getOrigPhoneNumber()) + ->setOrigPersonName($request->getOrigPersonName()) + ->setOrigEmail(Mage::getStoreConfig('trans_email/ident_general/email', $requestObject->getStoreId())) + ->setOrigCity($request->getOrigCity()) + ->setOrigPostal($request->getOrigPostal()) + ->setOrigStreetLine2($request->getOrigStreetLine2()) + ->setDestPhoneNumber($request->getDestPhoneNumber()) + ->setDestPersonName($request->getDestPersonName()) + ->setDestCompanyName($request->getDestCompanyName()); + + $originStreet2 = Mage::getStoreConfig( + Mage_Shipping_Model_Shipping::XML_PATH_STORE_ADDRESS2, $requestObject->getStoreId()); + + $requestObject->setOrigStreet($request->getOrigStreet() ? $request->getOrigStreet() : $originStreet2); + + if (is_numeric($request->getOrigState())) { + $requestObject->setOrigState(Mage::getModel('Mage_Directory_Model_Region')->load($request->getOrigState())->getCode()); + } else { + $requestObject->setOrigState($request->getOrigState()); + } + + if ($request->getDestCountryId()) { + $destCountry = $request->getDestCountryId(); + } else { + $destCountry = self::USA_COUNTRY_ID; + } + + // for DHL, Puerto Rico state for US will assume as Puerto Rico country + // for Puerto Rico, dhl will ship as international + if ($destCountry == self::USA_COUNTRY_ID && ($request->getDestPostcode() == '00912' + || $request->getDestRegionCode() == self::PUERTORICO_COUNTRY_ID) + ) { + $destCountry = self::PUERTORICO_COUNTRY_ID; + } + + $requestObject->setDestCountryId($destCountry) + ->setDestState($request->getDestRegionCode()) + ->setWeight($shippingWeight) + ->setFreeMethodWeight($request->getFreeMethodWeight()) + ->setOrderShipment($request->getOrderShipment()); + + if ($request->getPackageId()) { + $requestObject->setPackageId($request->getPackageId()); + } + + $requestObject->setBaseSubtotalInclTax($request->getBaseSubtotalInclTax()); + + $this->_rawRequest = $requestObject; + return $this; + } + + /** + * Get allowed shipping methods + * + * @return array + */ + public function getAllowedMethods() + { + $contentType = $this->getConfigData('content_type'); + $allowedMethods = array(); + switch ($contentType) { + case self::DHL_CONTENT_TYPE_DOC: + $allowedMethods = explode(',', $this->getConfigData('doc_methods')); + break; + + case self::DHL_CONTENT_TYPE_NON_DOC: + $allowedMethods = explode(',', $this->getConfigData('nondoc_methods')); + break; + default: + Mage::throwException(Mage::helper('Mage_Usa_Helper_Data')->__('Wrong Content Type.')); + } + $methods = array(); + foreach ($allowedMethods as $method) { + $methods[$method] = $this->getDhlProductTitle($method); + } + return $methods; + } + + /** + * Get configuration data of carrier + * + * @param strin $type + * @param string $code + * @return array|bool + */ + public function getCode($type, $code = '') + { + $codes = array( + 'unit_of_measure' => array( + 'L' => Mage::helper('Mage_Usa_Helper_Data')->__('Pounds'), + 'K' => Mage::helper('Mage_Usa_Helper_Data')->__('Kilograms'), + ), + 'unit_of_dimension' => array( + 'I' => Mage::helper('Mage_Usa_Helper_Data')->__('Inches'), + 'C' => Mage::helper('Mage_Usa_Helper_Data')->__('Centimeters'), + ), + 'unit_of_dimension_cut' => array( + 'I' => Mage::helper('Mage_Usa_Helper_Data')->__('inch'), + 'C' => Mage::helper('Mage_Usa_Helper_Data')->__('cm'), + ), + 'dimensions' => array( + 'HEIGHT' => Mage::helper('Mage_Usa_Helper_Data')->__('Height'), + 'DEPTH' => Mage::helper('Mage_Usa_Helper_Data')->__('Depth'), + 'WIDTH' => Mage::helper('Mage_Usa_Helper_Data')->__('Width'), + ), + 'size' => array( + '0' => Mage::helper('Mage_Usa_Helper_Data')->__('Regular'), + '1' => Mage::helper('Mage_Usa_Helper_Data')->__('Specific'), + ), + 'dimensions_variables' => array( + 'L' => Zend_Measure_Weight::POUND, + 'LB' => Zend_Measure_Weight::POUND, + 'POUND' => Zend_Measure_Weight::POUND, + 'K' => Zend_Measure_Weight::KILOGRAM, + 'KG' => Zend_Measure_Weight::KILOGRAM, + 'KILOGRAM' => Zend_Measure_Weight::KILOGRAM, + 'I' => Zend_Measure_Length::INCH, + 'IN' => Zend_Measure_Length::INCH, + 'INCH' => Zend_Measure_Length::INCH, + 'C' => Zend_Measure_Length::CENTIMETER, + 'CM' => Zend_Measure_Length::CENTIMETER, + 'CENTIMETER'=> Zend_Measure_Length::CENTIMETER, + + ) + ); + + if (!isset($codes[$type])) { + return false; + } elseif ('' === $code) { + return $codes[$type]; + } + + $code = strtoupper($code); + if (!isset($codes[$type][$code])) { + return false; + } else { + return $codes[$type][$code]; + } + } + + /** + * Returns DHL shipment methods (depending on package content type, if necessary) + * + * @param string $doc Package content type (doc/non-doc) see DHL_CONTENT_TYPE_* constants + * @return array + */ + public function getDhlProducts($doc) + { + if ($doc == self::DHL_CONTENT_TYPE_DOC) { + // Documents shipping + return array( + '2' => Mage::helper('Mage_Usa_Helper_Data')->__('Easy shop'), + '5' => Mage::helper('Mage_Usa_Helper_Data')->__('Sprintline'), + '6' => Mage::helper('Mage_Usa_Helper_Data')->__('Secureline'), + '7' => Mage::helper('Mage_Usa_Helper_Data')->__('Express easy'), + '9' => Mage::helper('Mage_Usa_Helper_Data')->__('Europack'), + 'B' => Mage::helper('Mage_Usa_Helper_Data')->__('Break bulk express'), + 'C' => Mage::helper('Mage_Usa_Helper_Data')->__('Medical express'), + 'D' => Mage::helper('Mage_Usa_Helper_Data')->__('Express worldwide'), // product content code: DOX + 'U' => Mage::helper('Mage_Usa_Helper_Data')->__('Express worldwide'), // product content code: ECX + 'K' => Mage::helper('Mage_Usa_Helper_Data')->__('Express 9:00'), + 'L' => Mage::helper('Mage_Usa_Helper_Data')->__('Express 10:30'), + 'G' => Mage::helper('Mage_Usa_Helper_Data')->__('Domestic economy select'), + 'W' => Mage::helper('Mage_Usa_Helper_Data')->__('Economy select'), + 'I' => Mage::helper('Mage_Usa_Helper_Data')->__('Break bulk economy'), + 'N' => Mage::helper('Mage_Usa_Helper_Data')->__('Domestic express'), + 'O' => Mage::helper('Mage_Usa_Helper_Data')->__('Others'), + 'R' => Mage::helper('Mage_Usa_Helper_Data')->__('Globalmail business'), + 'S' => Mage::helper('Mage_Usa_Helper_Data')->__('Same day'), + 'T' => Mage::helper('Mage_Usa_Helper_Data')->__('Express 12:00'), + 'X' => Mage::helper('Mage_Usa_Helper_Data')->__('Express envelope'), + ); + } else { + // Services for shipping non-documents cargo + return array( + '1' => Mage::helper('Mage_Usa_Helper_Data')->__('Customer services'), + '3' => Mage::helper('Mage_Usa_Helper_Data')->__('Easy shop'), + '4' => Mage::helper('Mage_Usa_Helper_Data')->__('Jetline'), + '8' => Mage::helper('Mage_Usa_Helper_Data')->__('Express easy'), + 'P' => Mage::helper('Mage_Usa_Helper_Data')->__('Express worldwide'), + 'Q' => Mage::helper('Mage_Usa_Helper_Data')->__('Medical express'), + 'E' => Mage::helper('Mage_Usa_Helper_Data')->__('Express 9:00'), + 'F' => Mage::helper('Mage_Usa_Helper_Data')->__('Freight worldwide'), + 'H' => Mage::helper('Mage_Usa_Helper_Data')->__('Economy select'), + 'J' => Mage::helper('Mage_Usa_Helper_Data')->__('Jumbo box'), + 'M' => Mage::helper('Mage_Usa_Helper_Data')->__('Express 10:30'), + 'V' => Mage::helper('Mage_Usa_Helper_Data')->__('Europack'), + 'Y' => Mage::helper('Mage_Usa_Helper_Data')->__('Express 12:00'), + ); + } + } + + /** + * Returns title of DHL shipping method by its code + * + * @param string $code One-symbol code (see getDhlProducts()) + * @return bool + */ + public function getDhlProductTitle($code) + { + $contentType = $this->getConfigData('content_type'); + $dhlProducts = $this->getDhlProducts($contentType); + return isset($dhlProducts[$code]) ? $dhlProducts[$code] : false; + } + + /** + * Convert item weight to needed weight based on config weight unit dimensions + * + * @param float $weight + * @param bool $maxWeight + * @param string|bool $configWeightUnit + * @return float + */ + protected function _getWeight($weight, $maxWeight = false, $configWeightUnit = false) + { + if ($maxWeight) { + $configWeightUnit = Zend_Measure_Weight::KILOGRAM; + } elseif ($configWeightUnit) { + $configWeightUnit = $this->getCode('dimensions_variables', $configWeightUnit); + } else { + $configWeightUnit = $this->getCode('dimensions_variables', (string)$this->getConfigData('unit_of_measure')); + } + + $countryWeightUnit = $this->getCode('dimensions_variables', $this->_getWeightUnit()); + + if ($configWeightUnit != $countryWeightUnit) { + $weight = Mage::helper('Mage_Usa_Helper_Data')->convertMeasureWeight( + round($weight,3), + $configWeightUnit, + $countryWeightUnit + ); + } + + return round($weight, 3); + } + + /** + * Prepare items to pieces + * + * @return array + */ + protected function _getAllItems() + { + $allItems = $this->_request->getAllItems(); + $fullItems = array(); + + foreach ($allItems as $item) { + if ($item->getProductType() == Mage_Catalog_Model_Product_Type::TYPE_BUNDLE + && $item->getProduct()->getShipmentType() + ) { + continue; + } + + $qty = $item->getQty(); + + if ($item->getParentItem()) { + if (!$item->getParentItem()->getProduct()->getShipmentType()) { + continue; + } + $qty = $item->getIsQtyDecimal() + ? $item->getParentItem()->getQty() + : $item->getParentItem()->getQty() * $item->getQty(); + } + + $itemWeight = $item->getWeight(); + if ($item->getIsQtyDecimal() && $item->getProductType() != Mage_Catalog_Model_Product_Type::TYPE_BUNDLE) { + $itemWeight = $itemWeight * $item->getQty(); + } + + if ($this->_getWeight($itemWeight) > $this->_getWeight($this->_maxWeight, true)) { + return array(); + } + + if (!$item->getParentItem() && $item->getIsQtyDecimal() + && $item->getProductType() != Mage_Catalog_Model_Product_Type::TYPE_BUNDLE + ) { + $qty = 1; + } + $fullItems = array_merge($fullItems, array_fill(0, $qty, $this->_getWeight($itemWeight))); + } + sort($fullItems); + + return $fullItems; + } + + /** + * Make pieces + * + * @param SimpleXMLElement $nodeBkgDetails + * @return void + */ + protected function _makePieces(SimpleXMLElement $nodeBkgDetails) + { + $divideOrderWeight = (string)$this->getConfigData('divide_order_weight'); + $nodePieces = $nodeBkgDetails->addChild('Pieces', '', ''); + $items = $this->_getAllItems(); + $numberOfPieces = 0; + + if ($divideOrderWeight && !empty($items)) { + $maxWeight = $this->_getWeight($this->_maxWeight, true); + $sumWeight = 0; + + $reverseOrderItems = $items; + arsort($reverseOrderItems); + + foreach ($reverseOrderItems as $key => $weight) { + if (!isset($items[$key])) { + continue; + } + unset($items[$key]); + $sumWeight = $weight; + foreach ($items as $key => $weight) { + if (($sumWeight + $weight) < $maxWeight) { + unset($items[$key]); + $sumWeight += $weight; + } elseif (($sumWeight + $weight) > $maxWeight) { + $numberOfPieces++; + $nodePiece = $nodePieces->addChild('Piece', '', ''); + $nodePiece->addChild('PieceID', $numberOfPieces); + $this->_addDimension($nodePiece); + $nodePiece->addChild('Weight', $sumWeight); + break; + } else { + unset($items[$key]); + $numberOfPieces++; + $sumWeight += $weight; + $nodePiece = $nodePieces->addChild('Piece', '', ''); + $nodePiece->addChild('PieceID', $numberOfPieces); + $this->_addDimension($nodePiece); + $nodePiece->addChild('Weight', $sumWeight); + $sumWeight = 0; + break; + } + } + } + if ($sumWeight > 0) { + $numberOfPieces++; + $nodePiece = $nodePieces->addChild('Piece', '', ''); + $nodePiece->addChild('PieceID', $numberOfPieces); + $this->_addDimension($nodePiece); + $nodePiece->addChild('Weight', $sumWeight); + } + } else { + $nodePiece = $nodePieces->addChild('Piece', '', ''); + $nodePiece->addChild('PieceID', 1); + $this->_addDimension($nodePiece); + $nodePiece->addChild('Weight', $this->_getWeight($this->_rawRequest->getWeight())); + } + + $handlingAction = $this->getConfigData('handling_action'); + if ($handlingAction == Mage_Shipping_Model_Carrier_Abstract::HANDLING_ACTION_PERORDER || !$numberOfPieces) { + $numberOfPieces = 1; + } + $this->_numBoxes = $numberOfPieces; + } + + /** + * Convert item dimension to needed dimension based on config dimension unit of measure + * + * @param float $dimension + * @param string|bool $configWeightUnit + * @return float + */ + protected function _getDimension($dimension, $configWeightUnit = false) + { + if (!$configWeightUnit) { + $configWeightUnit = $this->getCode('dimensions_variables', (string)$this->getConfigData('unit_of_measure')); + } else { + $configWeightUnit = $this->getCode('dimensions_variables', $configWeightUnit); + } + + if ($configWeightUnit == Zend_Measure_Weight::POUND) { + $configDimensionUnit = Zend_Measure_Length::INCH; + } else { + $configDimensionUnit = Zend_Measure_Length::CENTIMETER; + } + + $countryDimensionUnit = $this->getCode('dimensions_variables', $this->_getDimensionUnit()); + + if ($configDimensionUnit != $countryDimensionUnit) { + $dimension = Mage::helper('Mage_Usa_Helper_Data')->convertMeasureDimension( + round($dimension, 3), + $configDimensionUnit, + $countryDimensionUnit + ); + } + + return round($dimension, 3); + } + + /** + * Add dimension to piece + * + * @param SimpleXMLElement $nodePiece + * @return void + */ + protected function _addDimension($nodePiece) + { + $sizeChecker = (string)$this->getConfigData('size'); + + $height = $this->_getDimension((string)$this->getConfigData('height')); + $depth = $this->_getDimension((string)$this->getConfigData('depth')); + $width = $this->_getDimension((string)$this->getConfigData('width')); + + if ($sizeChecker && $height && $depth && $width) { + $nodePiece->addChild('Height', $height); + $nodePiece->addChild('Depth', $depth); + $nodePiece->addChild('Width', $width); + } + } + + /** + * Get shipping quotes + * + * @return Mage_Core_Model_Abstract|Mage_Shipping_Model_Rate_Result + */ + protected function _getQuotes() + { + $rawRequest = $this->_rawRequest; + $xmlStr = '<?xml version = "1.0" encoding = "UTF-8"?>' + . '<p:DCTRequest xmlns:p="http://www.dhl.com" xmlns:p1="http://www.dhl.com/datatypes" ' + . 'xmlns:p2="http://www.dhl.com/DCTRequestdatatypes" ' + . 'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ' + . 'xsi:schemaLocation="http://www.dhl.com DCT-req.xsd "/>'; + $xml = new SimpleXMLElement($xmlStr); + $nodeGetQuote = $xml->addChild('GetQuote', '', ''); + $nodeRequest = $nodeGetQuote->addChild('Request'); + + $nodeServiceHeader = $nodeRequest->addChild('ServiceHeader'); + $nodeServiceHeader->addChild('SiteID', (string)$this->getConfigData('id')); + $nodeServiceHeader->addChild('Password', (string)$this->getConfigData('password')); + + $nodeFrom = $nodeGetQuote->addChild('From'); + $nodeFrom->addChild('CountryCode', $rawRequest->getOrigCountryId()); + $nodeFrom->addChild('Postalcode', $rawRequest->getOrigPostal()); + $nodeFrom->addChild('City', $rawRequest->getOrigCity()); + + $nodeBkgDetails = $nodeGetQuote->addChild('BkgDetails'); + $nodeBkgDetails->addChild('PaymentCountryCode', $rawRequest->getOrigCountryId()); + $nodeBkgDetails->addChild('Date', Varien_Date::now(true)); + $nodeBkgDetails->addChild('ReadyTime', 'PT' . (int)(string)$this->getConfigData('ready_time') . 'H00M'); + + $nodeBkgDetails->addChild('DimensionUnit', $this->_getDimensionUnit()); + $nodeBkgDetails->addChild('WeightUnit', $this->_getWeightUnit()); + + $this->_makePieces($nodeBkgDetails); + + $nodeBkgDetails->addChild('PaymentAccountNumber', (string)$this->getConfigData('account')); + + $nodeTo = $nodeGetQuote->addChild('To'); + $nodeTo->addChild('CountryCode', $rawRequest->getDestCountryId()); + $nodeTo->addChild('Postalcode', $rawRequest->getDestPostal()); + $nodeTo->addChild('City', $rawRequest->getDestCity()); + + if ($this->getConfigData('content_type') == self::DHL_CONTENT_TYPE_NON_DOC) { + // IsDutiable flag and Dutiable node indicates that cargo is not a documentation + $nodeBkgDetails->addChild('IsDutiable', 'Y'); + $nodeDutiable = $nodeGetQuote->addChild('Dutiable'); + $baseCurrencyCode = Mage::app()->getWebsite($this->_request->getWebsiteId())->getBaseCurrencyCode(); + $nodeDutiable->addChild('DeclaredCurrency', $baseCurrencyCode); + $nodeDutiable->addChild('DeclaredValue', sprintf("%.2F", $rawRequest->getValue())); + } + + $request = $xml->asXML(); + $request = utf8_encode($request); + $responseBody = $this->_getCachedQuotes($request); + if ($responseBody === null) { + $debugData = array('request' => $request); + try { + $client = new Varien_Http_Client(); + $client->setUri((string)$this->getConfigData('gateway_url')); + $client->setConfig(array('maxredirects' => 0, 'timeout' => 30)); + $client->setRawData($request); + $responseBody = $client->request(Varien_Http_Client::POST)->getBody(); + $debugData['result'] = $responseBody; + $this->_setCachedQuotes($request, $responseBody); + } catch (Exception $e) { + $this->_errors[$e->getCode()] = $e->getMessage(); + $responseBody = ''; + } + $this->_debug($debugData); + } + + return $this->_parseResponse($responseBody); + } + + /** + * Parse response from DHL web service + * + * @param string $response + * @return Mage_Shipping_Model_Rate_Result + */ + protected function _parseResponse($response) + { + $htmlTranslationTable = get_html_translation_table(HTML_ENTITIES); + unset($htmlTranslationTable['<'], $htmlTranslationTable['>'], $htmlTranslationTable['"']); + $response = str_replace(array_keys($htmlTranslationTable), array_values($htmlTranslationTable), $response); + + $responseError = Mage::helper('Mage_Usa_Helper_Data')->__('The response is in wrong format.'); + + if (strlen(trim($response)) > 0) { + if (strpos(trim($response), '<?xml') === 0) { + $xml = simplexml_load_string($response); + if (is_object($xml)) { + if (in_array($xml->getName(), array('ErrorResponse', 'ShipmentValidateErrorResponse')) + || isset($xml->GetQuoteResponse->Note->Condition) + ) { + $code = null; + $data = null; + if (isset($xml->Response->Status->Condition)) { + $nodeCondition = $xml->Response->Status->Condition; + } else { + $nodeCondition = $xml->GetQuoteResponse->Note->Condition; + } + + if ($this->_isShippingLabelFlag) { + foreach ($nodeCondition as $condition) { + $code = isset($condition->ConditionCode) ? (string)$condition->ConditionCode : 0; + $data = isset($condition->ConditionData) ? (string)$condition->ConditionData : ''; + if (!empty($code) && !empty($data)) { + break; + } + } + Mage::throwException(Mage::helper('Mage_Usa_Helper_Data')->__('Error #%s : %s', trim($code), trim($data))); + } + + $code = isset($nodeCondition->ConditionCode) ? (string)$nodeCondition->ConditionCode : 0; + $data = isset($nodeCondition->ConditionData) ? (string)$nodeCondition->ConditionData : ''; + $this->_errors[$code] = Mage::helper('Mage_Usa_Helper_Data')->__('Error #%s : %s', trim($code), trim($data)); + } else { + if (isset($xml->GetQuoteResponse->BkgDetails->QtdShp)) { + foreach ($xml->GetQuoteResponse->BkgDetails->QtdShp as $quotedShipment) { + $this->_addRate($quotedShipment); + } + } elseif (isset($xml->AirwayBillNumber)) { + $result = new Varien_Object(); + $result->setTrackingNumber((string)$xml->AirwayBillNumber); + try { + /* @var $pdf Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf */ + $pdf = Mage::getModel('Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf', array('info' => $xml)); + $result->setShippingLabelContent($pdf->render()); + } catch (Exception $e) { + Mage::throwException(Mage::helper('Mage_Usa_Helper_Data')->__($e->getMessage())); + } + return $result; + } else { + $this->_errors[] = $responseError; + } + } + } + } else { + $this->_errors[] = $responseError; + } + } else { + $this->_errors[] = $responseError; + } + + /* @var $result Mage_Shipping_Model_Rate_Result */ + $result = Mage::getModel('Mage_Shipping_Model_Rate_Result'); + if ($this->_rates) { + foreach ($this->_rates as $rate) { + $method = $rate['service']; + $data = $rate['data']; + /* @var $rate Mage_Shipping_Model_Rate_Result_Method */ + $rate = Mage::getModel('Mage_Shipping_Model_Rate_Result_Method'); + $rate->setCarrier(self::CODE); + $rate->setCarrierTitle($this->getConfigData('title')); + $rate->setMethod($method); + $rate->setMethodTitle($data['term']); + $rate->setCost($data['price_total']); + $rate->setPrice($data['price_total']); + $result->append($rate); + } + } else if (!empty($this->_errors)) { + if ($this->_isShippingLabelFlag) { + Mage::throwException($responseError); + } + return $this->_showError(); + } + return $result; + } + + /** + * Add rate to DHL rates array + * + * @param SimpleXMLElement $shipmentDetails + * @return Mage_Usa_Model_Shipping_Carrier_Dhl_International + */ + protected function _addRate(SimpleXMLElement $shipmentDetails) + { + if (isset($shipmentDetails->ProductShortName) + && isset($shipmentDetails->ShippingCharge) + && isset($shipmentDetails->GlobalProductCode) + && isset($shipmentDetails->CurrencyCode) + && array_key_exists((string)$shipmentDetails->GlobalProductCode, $this->getAllowedMethods()) + ) { + // DHL product code, e.g. '3', 'A', 'Q', etc. + $dhlProduct = (string)$shipmentDetails->GlobalProductCode; + $totalEstimate = (float)(string)$shipmentDetails->ShippingCharge; + $currencyCode = (string)$shipmentDetails->CurrencyCode; + $baseCurrencyCode = Mage::app()->getWebsite($this->_request->getWebsiteId())->getBaseCurrencyCode(); + $dhlProductDescription = $this->getDhlProductTitle($dhlProduct); + + if ($currencyCode != $baseCurrencyCode) { + /* @var $currency Mage_Directory_Model_Currency */ + $currency = Mage::getModel('Mage_Directory_Model_Currency'); + $rates = $currency->getCurrencyRates($currencyCode, array($baseCurrencyCode)); + if (!empty($rates) && isset($rates[$baseCurrencyCode])) { + // Convert to store display currency using store exchange rate + $totalEstimate = $totalEstimate * $rates[$baseCurrencyCode]; + } else { + $rates = $currency->getCurrencyRates($baseCurrencyCode, array($currencyCode)); + if (!empty($rates) && isset($rates[$currencyCode])) { + $totalEstimate = $totalEstimate/$rates[$currencyCode]; + } + if (!isset($rates[$currencyCode]) || !$totalEstimate) { + $totalEstimate = false; + $this->_errors[] = Mage::helper('Mage_Usa_Helper_Data')->__("Exchange rate %s (Base Currency) -> %s not found. DHL method %s skipped", $currencyCode, $baseCurrencyCode, $dhlProductDescription); + } + } + } + if ($totalEstimate) { + $data = array('term' => $dhlProductDescription, + 'price_total' => $this->getMethodPrice($totalEstimate, $dhlProduct)); + if (!empty($this->_rates)) { + foreach ($this->_rates as $product) { + if ($product['data']['term'] == $data['term'] + && $product['data']['price_total'] == $data['price_total'] + ) { + return $this; + } + } + } + $this->_rates[] = array('service' => $dhlProduct, 'data' => $data); + } else { + $this->_errors[] = Mage::helper('Mage_Usa_Helper_Data')->__("Zero shipping charge for '%s'", $dhlProductDescription); + } + } else { + $dhlProductDescription = false; + if (isset($shipmentDetails->GlobalProductCode)) { + $dhlProductDescription = $this->getDhlProductTitle((string)$shipmentDetails->GlobalProductCode); + } + $dhlProductDescription = $dhlProductDescription ? $dhlProductDescription : Mage::helper('Mage_Usa_Helper_Data')->__("DHL"); + $this->_errors[] = Mage::helper('Mage_Usa_Helper_Data')->__("Zero shipping charge for '%s'", $dhlProductDescription); + } + return $this; + } + + /** + * Returns dimension unit (cm or inch) + * + * @return string + */ + protected function _getDimensionUnit() + { + $countryId = $this->_rawRequest->getOrigCountryId(); + $measureUnit = $this->getCountryParams($countryId)->getMeasureUnit(); + if (empty($measureUnit)) { + Mage::throwException(Mage::helper('Mage_Usa_Helper_Data')->__("Cannot identify measure unit for %s", $countryId)); + } + return $measureUnit; + } + + /** + * Returns weight unit (kg or pound) + * + * @return string + */ + protected function _getWeightUnit() + { + $countryId = $this->_rawRequest->getOrigCountryId(); + $weightUnit = $this->getCountryParams($countryId)->getWeightUnit(); + if (empty($weightUnit)) { + Mage::throwException(Mage::helper('Mage_Usa_Helper_Data')->__("Cannot identify weight unit for %s", $countryId)); + } + return $weightUnit; + } + + /** + * Get Country Params by Country Code + * + * @param string $countryCode + * @return Varien_Object + * + * @see $countryCode ISO 3166 Codes (Countries) A2 + */ + protected function getCountryParams($countryCode) + { + if (empty($this->_countryParams)) { + $dhlConfigPath = Mage::getModuleDir('etc', 'Mage_Usa') . DS . 'dhl' . DS; + $countriesXml = file_get_contents($dhlConfigPath . 'international' . DS . 'countries.xml'); + $this->_countryParams = new Varien_Simplexml_Element($countriesXml); + } + if (isset($this->_countryParams->$countryCode)) { + $countryParams = new Varien_Object($this->_countryParams->$countryCode->asArray()); + } + return isset($countryParams) ? $countryParams : new Varien_Object(); + } + + /** + * Do shipment request to carrier web service, obtain Print Shipping Labels and process errors in response + * + * @param Varien_Object $request + * @return Varien_Object + */ + protected function _doShipmentRequest(Varien_Object $request) + { + $this->_prepareShipmentRequest($request); + $this->_mapRequestToShipment($request); + $this->setRequest($request); + + return $this->_doRequest(); + } + + /** + * Processing additional validation to check is carrier applicable. + * + * @param Mage_Shipping_Model_Rate_Request $request + * @return Mage_Shipping_Model_Carrier_Abstract|Mage_Shipping_Model_Rate_Result_Error|boolean + */ + public function proccessAdditionalValidation(Mage_Shipping_Model_Rate_Request $request) + { + //Skip by item validation if there is no items in request + if(!count($this->getAllItems($request))) { + $this->_errors[] = Mage::helper('Mage_Usa_Helper_Data')->__('There is no items in this order'); + } + + if (!empty($this->_errors)) { + return $this->_showError(); + } + + return $this; + } + + /** + * Show default error + * + * @return bool|Mage_Shipping_Model_Rate_Result_Error + */ + protected function _showError() + { + $showMethod = $this->getConfigData('showmethod'); + + if ($showMethod) { + /* @var $error Mage_Shipping_Model_Rate_Result_Error */ + $error = Mage::getModel('Mage_Shipping_Model_Rate_Result_Error'); + $error->setCarrier(self::CODE); + $error->setCarrierTitle($this->getConfigData('title')); + $error->setErrorMessage($this->getConfigData('specificerrmsg')); + $this->_debug($this->_errors); + return $error; + } else { + return false; + } + } + + /** + * Return container types of carrier + * + * @param Varien_Object|null $params + * @return array + */ + public function getContainerTypes(Varien_Object $params = null) + { + return array( + self::DHL_CONTENT_TYPE_DOC => Mage::helper('Mage_Usa_Helper_Data')->__('Documents'), + self::DHL_CONTENT_TYPE_NON_DOC => Mage::helper('Mage_Usa_Helper_Data')->__('Non Documents') + ); + } + + /** + * Map request to shipment + * + * @param Varien_Object $request + * @return null + */ + protected function _mapRequestToShipment(Varien_Object $request) + { + + $request->setOrigCountryId($request->getShipperAddressCountryCode()); + $this->_rawRequest = $request; + $customsValue = 0; + $packageWeight = 0; + $packages = $request->getPackages(); + foreach ($packages as &$piece) { + $params = $piece['params']; + if ($params['width'] || $params['length'] || $params['height']) { + $minValue = $this->_getMinDimension($params['dimension_units']); + if ($params['width'] < $minValue || $params['length'] < $minValue || $params['height'] < $minValue) { + $message = Mage::helper('Mage_Usa_Helper_Data')->__('Height, width and length should be equal or greater than %s', $minValue); + Mage::throwException($message); + } + } + + $weightUnits = $piece['params']['weight_units']; + $piece['params']['height'] = $this->_getDimension($piece['params']['height'], $weightUnits); + $piece['params']['length'] = $this->_getDimension($piece['params']['length'], $weightUnits); + $piece['params']['width'] = $this->_getDimension($piece['params']['width'], $weightUnits); + $piece['params']['dimension_units'] = $this->_getDimensionUnit(); + $piece['params']['weight'] = $this->_getWeight($piece['params']['weight'], false, $weightUnits); + $piece['params']['weight_units'] = $this->_getWeightUnit(); + + $customsValue += $piece['params']['customs_value']; + $packageWeight += $piece['params']['weight']; + } + + $request->setPackages($packages) + ->setPackageWeight($packageWeight) + ->setPackageValue($customsValue) + ->setValueWithDiscount($customsValue) + ->setPackageCustomsValue($customsValue) + ->setFreeMethodWeight(0); + } + + /** + * Retrieve minimum allowed value for dimensions in given dimension unit + * + * @param string $dimensionUnit + * @return int + */ + protected function _getMinDimension($dimensionUnit) + { + return $dimensionUnit == "CENTIMETER" ? self::DIMENSION_MIN_CM : self::DIMENSION_MIN_IN; + } + + /** + * Do rate request and handle errors + * + * @return Mage_Shipping_Model_Rate_Result|Varien_Object + */ + protected function _doRequest() + { + $rawRequest = $this->_request; + + $originRegion = (string)$this->getCountryParams( + Mage::getStoreConfig(Mage_Shipping_Model_Shipping::XML_PATH_STORE_COUNTRY_ID, $this->getStore()) + )->region; + + if (!$originRegion) { + Mage::throwException(Mage::helper('Mage_Usa_Helper_Data')->__('Wrong Region.')); + } + + if ($originRegion == 'AM') { + $originRegion = ''; + } + + $xmlStr = '<?xml version="1.0" encoding="UTF-8"?>' + . '<req:ShipmentValidateRequest' . $originRegion + . ' xmlns:req="http://www.dhl.com"' + . ' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"' + . ' xsi:schemaLocation="http://www.dhl.com ship-val-req' + . ($originRegion ? '_' . $originRegion : '') . '.xsd" />'; + $xml = new SimpleXMLElement($xmlStr); + + $nodeRequest = $xml->addChild('Request', '', ''); + $nodeServiceHeader = $nodeRequest->addChild('ServiceHeader'); + $nodeServiceHeader->addChild('SiteID', (string)$this->getConfigData('id')); + $nodeServiceHeader->addChild('Password', (string)$this->getConfigData('password')); + + if (!$originRegion) { + $xml->addChild('RequestedPickupTime', 'N', ''); + } + $xml->addChild('NewShipper', 'N', ''); + $xml->addChild('LanguageCode', 'EN', ''); + $xml->addChild('PiecesEnabled', 'Y', ''); + + /* Billing */ + $nodeBilling = $xml->addChild('Billing', '', ''); + $nodeBilling->addChild('ShipperAccountNumber', (string)$this->getConfigData('account')); + /* + * Method of Payment: + * S (Shipper) + * R (Receiver) + * T (Third Party) + */ + $nodeBilling->addChild('ShippingPaymentType', 'S'); + + /* + * Shipment bill to account – required if Shipping PaymentType is other than 'S' + */ + $nodeBilling->addChild('BillingAccountNumber', (string)$this->getConfigData('account')); + $nodeBilling->addChild('DutyPaymentType', 'S'); + $nodeBilling->addChild('DutyAccountNumber', (string)$this->getConfigData('account')); + + /* Receiver */ + $nodeConsignee = $xml->addChild('Consignee', '', ''); + + $companyName = ($rawRequest->getRecipientContactCompanyName()) + ? $rawRequest->getRecipientContactCompanyName() + : $rawRequest->getRecipientContactPersonName(); + + $nodeConsignee->addChild('CompanyName', substr($companyName, 0, 35)); + + $address = $rawRequest->getRecipientAddressStreet1(). ' ' . $rawRequest->getRecipientAddressStreet2(); + $address = Mage::helper('Mage_Core_Helper_String')->str_split($address, 35, false, true); + if (is_array($address)) { + foreach ($address as $addressLine) { + $nodeConsignee->addChild('AddressLine', $addressLine); + } + } else { + $nodeConsignee->addChild('AddressLine', $address); + } + + $nodeConsignee->addChild('City', $rawRequest->getRecipientAddressCity()); + $nodeConsignee->addChild('Division', $rawRequest->getRecipientAddressStateOrProvinceCode()); + $nodeConsignee->addChild('PostalCode', $rawRequest->getRecipientAddressPostalCode()); + $nodeConsignee->addChild('CountryCode', $rawRequest->getRecipientAddressCountryCode()); + $nodeConsignee->addChild('CountryName', + (string)$this->getCountryParams($rawRequest->getRecipientAddressCountryCode())->name + ); + $nodeContact = $nodeConsignee->addChild('Contact'); + $nodeContact->addChild('PersonName', substr($rawRequest->getRecipientContactPersonName(), 0, 34)); + $nodeContact->addChild('PhoneNumber', substr($rawRequest->getRecipientContactPhoneNumber(), 0, 24)); + + /* Commodity + * The CommodityCode element contains commodity code for shipment contents. Its + * value should lie in between 1 to 9999.This field is mandatory. + */ + $nodeCommodity = $xml->addChild('Commodity', '', ''); + $nodeCommodity->addChild('CommodityCode', '1'); + + /* Dutiable */ + if ($this->getConfigData('content_type') == self::DHL_CONTENT_TYPE_NON_DOC) { + $nodeDutiable = $xml->addChild('Dutiable', '', ''); + $nodeDutiable->addChild('DeclaredValue', + sprintf("%.2F", $rawRequest->getOrderShipment()->getOrder()->getSubtotal()) + ); + $baseCurrencyCode = Mage::app()->getWebsite($rawRequest->getWebsiteId())->getBaseCurrencyCode(); + $nodeDutiable->addChild('DeclaredCurrency', $baseCurrencyCode); + } + + /* Reference + * This element identifies the reference information. It is an optional field in the + * shipment validation request. Only the first reference will be taken currently. + */ + $nodeReference = $xml->addChild('Reference', '', ''); + $nodeReference->addChild('ReferenceID', 'shipment reference'); + $nodeReference->addChild('ReferenceType', 'St'); + + /* Shipment Details */ + $this->_shipmentDetails($xml, $rawRequest, $originRegion); + + /* Shipper */ + $nodeShipper = $xml->addChild('Shipper', '', ''); + $nodeShipper->addChild('ShipperID', (string)$this->getConfigData('account')); + $nodeShipper->addChild('CompanyName', $rawRequest->getShipperContactCompanyName()); + $nodeShipper->addChild('RegisteredAccount', (string)$this->getConfigData('account')); + + $address = $rawRequest->getShipperAddressStreet1(). ' ' . $rawRequest->getShipperAddressStreet2(); + $address = Mage::helper('Mage_Core_Helper_String')->str_split($address, 35, false, true); + if (is_array($address)) { + foreach ($address as $addressLine) { + $nodeShipper->addChild('AddressLine', $addressLine); + } + } else { + $nodeShipper->addChild('AddressLine', $address); + } + + $nodeShipper->addChild('City', $rawRequest->getShipperAddressCity()); + $nodeShipper->addChild('Division', $rawRequest->getShipperAddressStateOrProvinceCode()); + $nodeShipper->addChild('PostalCode', $rawRequest->getShipperAddressPostalCode()); + $nodeShipper->addChild('CountryCode', $rawRequest->getShipperAddressCountryCode()); + $nodeShipper->addChild('CountryName', + (string)$this->getCountryParams($rawRequest->getShipperAddressCountryCode())->name + ); + $nodeContact = $nodeShipper->addChild('Contact', '', ''); + $nodeContact->addChild('PersonName', substr($rawRequest->getShipperContactPersonName(), 0, 34)); + $nodeContact->addChild('PhoneNumber', substr($rawRequest->getShipperContactPhoneNumber(), 0, 24)); + + $request = $xml->asXML(); + $request = utf8_encode($request); + + $responseBody = $this->_getCachedQuotes($request); + if ($responseBody === null) { + $debugData = array('request' => $request); + try { + $client = new Varien_Http_Client(); + $client->setUri((string)$this->getConfigData('gateway_url')); + $client->setConfig(array('maxredirects' => 0, 'timeout' => 30)); + $client->setRawData($request); + $responseBody = $client->request(Varien_Http_Client::POST)->getBody(); + $debugData['result'] = $responseBody; + $this->_setCachedQuotes($request, $responseBody); + } catch (Exception $e) { + $this->_errors[$e->getCode()] = $e->getMessage(); + $responseBody = ''; + } + $this->_debug($debugData); + } + $this->_isShippingLabelFlag = true; + return $this->_parseResponse($responseBody); + } + + /** + * Generation Shipment Details Node according to origin region + * + * @param SimpleXMLElement $xml + * @param Mage_Shipping_Model_Rate_Request $rawRequest + * @param string $originRegion + * @return void + */ + protected function _shipmentDetails($xml, $rawRequest, $originRegion = '') + { + $nodeShipmentDetails = $xml->addChild('ShipmentDetails', '', ''); + $nodeShipmentDetails->addChild('NumberOfPieces', count($rawRequest->getPackages())); + + if ($originRegion) { + $nodeShipmentDetails->addChild('CurrencyCode', + Mage::app()->getWebsite($this->_request->getWebsiteId())->getBaseCurrencyCode() + ); + } + + $nodePieces = $nodeShipmentDetails->addChild('Pieces', '', ''); + + /* + * Package type + * EE (DHL Express Envelope), OD (Other DHL Packaging), CP (Custom Packaging) + * DC (Document), DM (Domestic), ED (Express Document), FR (Freight) + * BD (Jumbo Document), BP (Jumbo Parcel), JD (Jumbo Junior Document) + * JP (Jumbo Junior Parcel), PA (Parcel), DF (DHL Flyer) + */ + $i = 0; + foreach ($rawRequest->getPackages() as $package) { + $nodePiece = $nodePieces->addChild('Piece', '', ''); + $packageType = 'DC'; + if ($package['params']['container'] == self::DHL_CONTENT_TYPE_NON_DOC) { + $packageType = 'CP'; + } + $nodePiece->addChild('PieceID', ++$i); + $nodePiece->addChild('PackageType', $packageType); + $nodePiece->addChild('Weight', round($package['params']['weight'],1)); + $params = $package['params']; + if ($params['width'] && $params['length'] && $params['height']) { + if (!$originRegion) { + $nodePiece->addChild('Width', round($params['width'])); + $nodePiece->addChild('Height', round($params['height'])); + $nodePiece->addChild('Depth', round($params['length'])); + } else { + $nodePiece->addChild('Depth', round($params['length'])); + $nodePiece->addChild('Width', round($params['width'])); + $nodePiece->addChild('Height', round($params['height'])); + } + } + $content = array(); + foreach ($package['items'] as $item) { + $content[] = $item['name']; + } + $nodePiece->addChild('PieceContents', substr(implode(',', $content), 0, 34)); + } + + if (!$originRegion) { + $nodeShipmentDetails->addChild('Weight', round($rawRequest->getPackageWeight(),1)); + + $nodeShipmentDetails->addChild('WeightUnit', substr($this->_getWeightUnit(),0,1)); + + $nodeShipmentDetails->addChild('GlobalProductCode', $rawRequest->getShippingMethod()); + $nodeShipmentDetails->addChild('LocalProductCode', $rawRequest->getShippingMethod()); + + $nodeShipmentDetails->addChild('Date', Mage::getModel('Mage_Core_Model_Date')->date('Y-m-d')); + $nodeShipmentDetails->addChild('Contents', 'DHL Parcel TEST'); + /* + * The DoorTo Element defines the type of delivery service that applies to the shipment. + * The valid values are DD (Door to Door), DA (Door to Airport) , AA and DC (Door to + * Door non-compliant) + */ + $nodeShipmentDetails->addChild('DoorTo', 'DD'); + $nodeShipmentDetails->addChild('DimensionUnit', substr($this->_getDimensionUnit(),0,1)); + if ($package['params']['container'] == self::DHL_CONTENT_TYPE_NON_DOC) { + $packageType = 'CP'; + } + $nodeShipmentDetails->addChild('PackageType', $packageType); + if ($this->getConfigData('content_type') == self::DHL_CONTENT_TYPE_NON_DOC) { + $nodeShipmentDetails->addChild('IsDutiable', 'Y'); + } + $nodeShipmentDetails->addChild('CurrencyCode', + Mage::app()->getWebsite($this->_request->getWebsiteId())->getBaseCurrencyCode() + ); + } else { + if ($package['params']['container'] == self::DHL_CONTENT_TYPE_NON_DOC) { + $packageType = 'CP'; + } + $nodeShipmentDetails->addChild('PackageType', $packageType); + $nodeShipmentDetails->addChild('Weight', $rawRequest->getPackageWeight()); + + $nodeShipmentDetails->addChild('DimensionUnit', substr($this->_getDimensionUnit(),0,1)); + $nodeShipmentDetails->addChild('WeightUnit', substr($this->_getWeightUnit(),0,1)); + + $nodeShipmentDetails->addChild('GlobalProductCode', $rawRequest->getShippingMethod()); + $nodeShipmentDetails->addChild('LocalProductCode', $rawRequest->getShippingMethod()); + + /* + * The DoorTo Element defines the type of delivery service that applies to the shipment. + * The valid values are DD (Door to Door), DA (Door to Airport) , AA and DC (Door to + * Door non-compliant) + */ + $nodeShipmentDetails->addChild('DoorTo', 'DD'); + $nodeShipmentDetails->addChild('Date', Mage::getModel('Mage_Core_Model_Date')->date('Y-m-d')); + $nodeShipmentDetails->addChild('Contents', 'DHL Parcel TEST'); + } + } + + /** + * Get tracking + * + * @param mixed $trackings + * @return mixed + */ + public function getTracking($trackings) + { + if (!is_array($trackings)) { + $trackings = array($trackings); + } + $this->_getXMLTracking($trackings); + + return $this->_result; + } + + /** + * Send request for tracking + * + * @param array $trackings + * @return void + */ + protected function _getXMLTracking($trackings) + { + $xmlStr = '<?xml version="1.0" encoding="UTF-8"?>' + . '<req:KnownTrackingRequest' + . ' xmlns:req="http://www.dhl.com"' + . ' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"' + . ' xsi:schemaLocation="http://www.dhl.com TrackingRequestKnown.xsd" />'; + + $xml = new SimpleXMLElement($xmlStr); + + $requestNode = $xml->addChild('Request', '', ''); + $serviceHeaderNode = $requestNode->addChild('ServiceHeader', '', ''); + $serviceHeaderNode->addChild('SiteID', (string)$this->getConfigData('id')); + $serviceHeaderNode->addChild('Password', (string)$this->getConfigData('password')); + + $xml->addChild('LanguageCode', 'EN', ''); + foreach ($trackings as $tracking) { + $xml->addChild('AWBNumber', $tracking, ''); + } + /* + * Checkpoint details selection flag + * LAST_CHECK_POINT_ONLY + * ALL_CHECK_POINTS + */ + $xml->addChild('LevelOfDetails', 'ALL_CHECK_POINTS', ''); + + /* + * Value that indicates for getting the tracking details with the additional + * piece details and its respective Piece Details, Piece checkpoints along with + * Shipment Details if queried. + * + * S-Only Shipment Details + * B-Both Shipment & Piece Details + * P-Only Piece Details + * Default is ‘S’ + */ + //$xml->addChild('PiecesEnabled', 'ALL_CHECK_POINTS'); + + $request = $xml->asXML(); + $request = utf8_encode($request); + + $responseBody = $this->_getCachedQuotes($request); + if ($responseBody === null) { + $debugData = array('request' => $request); + try { + $client = new Varien_Http_Client(); + $client->setUri((string)$this->getConfigData('gateway_url')); + $client->setConfig(array('maxredirects' => 0, 'timeout' => 30)); + $client->setRawData($request); + $responseBody = $client->request(Varien_Http_Client::POST)->getBody(); + $debugData['result'] = $responseBody; + $this->_setCachedQuotes($request, $responseBody); + } catch (Exception $e) { + $this->_errors[$e->getCode()] = $e->getMessage(); + $responseBody = ''; + } + $this->_debug($debugData); + } + + $this->_parseXmlTrackingResponse($trackings, $responseBody); + } + + /** + * Parse xml tracking response + * + * @param array $trackings + * @param string $response + * @return void + */ + protected function _parseXmlTrackingResponse($trackings, $response) + { + $errorTitle = Mage::helper('Mage_Usa_Helper_Data')->__('Unable to retrieve tracking'); + $resultArr = array(); + + $htmlTranslationTable = get_html_translation_table(HTML_ENTITIES); + unset($htmlTranslationTable['<'], $htmlTranslationTable['>'], $htmlTranslationTable['"']); + $response = str_replace(array_keys($htmlTranslationTable), array_values($htmlTranslationTable), $response); + + if (strlen(trim($response)) > 0) { + $xml = simplexml_load_string($response); + if (!is_object($xml)) { + $errorTitle = Mage::helper('Mage_Usa_Helper_Data')->__('Response is in the wrong format'); + } + if (is_object($xml) && ((isset($xml->Response->Status->ActionStatus) + && $xml->Response->Status->ActionStatus == 'Failure') + || isset($xml->GetQuoteResponse->Note->Condition)) + ) { + if (isset($xml->Response->Status->Condition)) { + $nodeCondition = $xml->Response->Status->Condition; + } + + $code = isset($nodeCondition->ConditionCode) ? (string)$nodeCondition->ConditionCode : 0; + $data = isset($nodeCondition->ConditionData) ? (string)$nodeCondition->ConditionData : ''; + $this->_errors[$code] = Mage::helper('Mage_Usa_Helper_Data')->__('Error #%s : %s', $code, $data); + } elseif (is_object($xml) && is_object($xml->AWBInfo)) { + foreach ($xml->AWBInfo as $awbinfo) { + $awbinfoData = array(); + $trackNum = isset($awbinfo->AWBNumber) ? (string)$awbinfo->AWBNumber : ''; + if (!is_object($awbinfo) || !$awbinfo->ShipmentInfo) { + $this->_errors[$trackNum] = Mage::helper('Mage_Usa_Helper_Data')->__('Unable to retrieve tracking'); + continue; + } + $shipmentInfo = $awbinfo->ShipmentInfo; + + if ($shipmentInfo->ShipmentDesc) { + $awbinfoData['service'] = (string)$shipmentInfo->ShipmentDesc; + } + + $awbinfoData['weight'] = (string)$shipmentInfo->Weight . ' ' . (string)$shipmentInfo->WeightUnit; + + $packageProgress = array(); + if (isset($shipmentInfo->ShipmentEvent)) { + foreach ($shipmentInfo->ShipmentEvent as $shipmentEvent) { + $shipmentEventArray = array(); + $shipmentEventArray['activity'] = (string)$shipmentEvent->ServiceEvent->EventCode + . ' ' . (string)$shipmentEvent->ServiceEvent->Description; + $shipmentEventArray['deliverydate'] = (string)$shipmentEvent->Date; + $shipmentEventArray['deliverytime'] = (string)$shipmentEvent->Time; + $shipmentEventArray['deliverylocation'] = (string)$shipmentEvent->ServiceArea->Description + . ' [' . (string)$shipmentEvent->ServiceArea->ServiceAreaCode . ']'; + $packageProgress[] = $shipmentEventArray; + } + $awbinfoData['progressdetail'] = $packageProgress; + } + $resultArr[$trackNum] = $awbinfoData; + } + } + } + + $result = Mage::getModel('Mage_Shipping_Model_Tracking_Result'); + + if (!empty($resultArr)) { + foreach ($resultArr as $trackNum => $data) { + $tracking = Mage::getModel('Mage_Shipping_Model_Tracking_Result_Status'); + $tracking->setCarrier($this->_code); + $tracking->setCarrierTitle($this->getConfigData('title')); + $tracking->setTracking($trackNum); + $tracking->addData($data); + $result->append($tracking); + } + } + + if (!empty($this->_errors) || empty($resultArr)) { + $resultArr = !empty($this->_errors) ? $this->_errors : $trackings; + foreach ($resultArr as $trackNum => $err) { + $error = Mage::getModel('Mage_Shipping_Model_Tracking_Result_Error'); + $error->setCarrier($this->_code); + $error->setCarrierTitle($this->getConfigData('title')); + $error->setTracking(!empty($this->_errors) ? $trackNum : $err); + $error->setErrorMessage(!empty($this->_errors) ? $err : $errorTitle); + $result->append($error); + } + } + + $this->_result = $result; + } + + /** + * Get final price for shipping method with handling fee per package + * + * @param float $cost + * @param string $handlingType + * @param float $handlingFee + * @return float + */ + protected function _getPerpackagePrice($cost, $handlingType, $handlingFee) + { + if ($handlingType == Mage_Shipping_Model_Carrier_Abstract::HANDLING_TYPE_PERCENT) { + return $cost + ($cost * $this->_numBoxes * $handlingFee / 100); + } + + return $cost + $this->_numBoxes * $handlingFee; + } + + /** + * Do request to shipment + * + * @param Mage_Shipping_Model_Shipment_Request $request + * @return Varien_Object + */ + public function requestToShipment(Mage_Shipping_Model_Shipment_Request $request) + { + $packages = $request->getPackages(); + if (!is_array($packages) || !$packages) { + Mage::throwException(Mage::helper('Mage_Usa_Helper_Data')->__('No packages for request')); + } + $result = $this->_doShipmentRequest($request); + + $response = new Varien_Object(array( + 'info' => array(array( + 'tracking_number' => $result->getTrackingNumber(), + 'label_content' => $result->getShippingLabelContent() + )) + )); + + $request->setMasterTrackingId($result->getTrackingNumber()); + + return $response; + } +} diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Contenttype.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Contenttype.php new file mode 100644 index 0000000000000000000000000000000000000000..23361502745616a41975c8d2a086a44ee1520f65 --- /dev/null +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Contenttype.php @@ -0,0 +1,50 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Usa + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Source model for DHL Content Type + * + * @category Mage + * @package Mage_Usa + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Usa_Model_Shipping_Carrier_Dhl_International_Source_Contenttype +{ + /** + * Returns array to be used in multiselect on back-end + * + * @return array + */ + public function toOptionArray() + { + return array( + array('label' => Mage::helper('Mage_Usa_Helper_Data')->__('Documents'), + 'value' => Mage_Usa_Model_Shipping_Carrier_Dhl_International::DHL_CONTENT_TYPE_DOC), + array('label' => Mage::helper('Mage_Usa_Helper_Data')->__('Non documents'), + 'value' => Mage_Usa_Model_Shipping_Carrier_Dhl_International::DHL_CONTENT_TYPE_NON_DOC), + ); + } +} diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/Abstract.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/Abstract.php new file mode 100644 index 0000000000000000000000000000000000000000..0d86f6865e67f830308ea94bdb08ffc4aab97d1b --- /dev/null +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/Abstract.php @@ -0,0 +1,72 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Usa + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Source model for DHL shipping methods + * + * @category Mage + * @package Mage_Usa + * @author Magento Core Team <core@magentocommerce.com> + */ +abstract class Mage_Usa_Model_Shipping_Carrier_Dhl_International_Source_Method_Abstract +{ + /** + * Carrier Product Type Indicator + * + * @var string $_contentType + */ + protected $_contentType; + + /** + * Show 'none' in methods list or not; + * + * @var bool + */ + protected $_noneMethod = false; + + /** + * Returns array to be used in multiselect on back-end + * + * @return array + */ + public function toOptionArray() + { + /* @var $carrierModel Mage_Usa_Model_Shipping_Carrier_Dhl_International */ + $carrierModel = Mage::getSingleton('Mage_Usa_Model_Shipping_Carrier_Dhl_International'); + $dhlProducts = $carrierModel->getDhlProducts($this->_contentType); + + $options = array(); + foreach ($dhlProducts as $code => $title) { + $options[] = array('value' => $code, 'label' => $title); + } + + if ($this->_noneMethod) { + array_unshift($options, array('value' => '', 'label' => Mage::helper('Mage_Usa_Helper_Data')->__('None'))); + } + + return $options; + } +} diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/Doc.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/Doc.php new file mode 100644 index 0000000000000000000000000000000000000000..a3205c50e88b30f398291f1b03991adac0752e58 --- /dev/null +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/Doc.php @@ -0,0 +1,43 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Usa + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Source model for DHL shipping methods for documentation + * + * @category Mage + * @package Mage_Usa + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Usa_Model_Shipping_Carrier_Dhl_International_Source_Method_Doc + extends Mage_Usa_Model_Shipping_Carrier_Dhl_International_Source_Method_Abstract +{ + /** + * Carrier Product Type Indicator + * + * @var string $_contentType + */ + protected $_contentType = Mage_Usa_Model_Shipping_Carrier_Dhl_International::DHL_CONTENT_TYPE_DOC; +} diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/Freedoc.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/Freedoc.php new file mode 100644 index 0000000000000000000000000000000000000000..6e74cde1be0ad2170b0e257cf7c67c0165d3fa0f --- /dev/null +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/Freedoc.php @@ -0,0 +1,50 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Usa + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Source model for DHL shipping methods for documentation + * + * @category Mage + * @package Mage_Usa + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Usa_Model_Shipping_Carrier_Dhl_International_Source_Method_Freedoc + extends Mage_Usa_Model_Shipping_Carrier_Dhl_International_Source_Method_Abstract +{ + /** + * Carrier Product Type Indicator + * + * @var string $_contentType + */ + protected $_contentType = Mage_Usa_Model_Shipping_Carrier_Dhl_International::DHL_CONTENT_TYPE_DOC; + + /** + * Show 'none' in methods list or not; + * + * @var bool + */ + protected $_noneMethod = true; +} diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/Freenondoc.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/Freenondoc.php new file mode 100644 index 0000000000000000000000000000000000000000..c824a26febb801bb387e0043427367610db0123a --- /dev/null +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/Freenondoc.php @@ -0,0 +1,50 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Usa + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Source model for DHL shipping methods for documentation + * + * @category Mage + * @package Mage_Usa + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Usa_Model_Shipping_Carrier_Dhl_International_Source_Method_Freenondoc + extends Mage_Usa_Model_Shipping_Carrier_Dhl_International_Source_Method_Abstract +{ + /** + * Carrier Product Type Indicator + * + * @var string $_contentType + */ + protected $_contentType = Mage_Usa_Model_Shipping_Carrier_Dhl_International::DHL_CONTENT_TYPE_NON_DOC; + + /** + * Show 'none' in methods list or not; + * + * @var bool + */ + protected $_noneMethod = true; +} diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/Nondoc.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/Nondoc.php new file mode 100644 index 0000000000000000000000000000000000000000..a5c3a3ab60f0fd534afef0aabd3f73fb46e5c69b --- /dev/null +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/Nondoc.php @@ -0,0 +1,43 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Usa + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Source model for DHL shipping methods for documentation + * + * @category Mage + * @package Mage_Usa + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Usa_Model_Shipping_Carrier_Dhl_International_Source_Method_Nondoc + extends Mage_Usa_Model_Shipping_Carrier_Dhl_International_Source_Method_Abstract +{ + /** + * Carrier Product Type Indicator + * + * @var string $_contentType + */ + protected $_contentType = Mage_Usa_Model_Shipping_Carrier_Dhl_International::DHL_CONTENT_TYPE_NON_DOC; +} diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/Size.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/Size.php new file mode 100644 index 0000000000000000000000000000000000000000..8f56483ee587536b1e34ea4a516d1c4e8967256b --- /dev/null +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/Size.php @@ -0,0 +1,51 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Usa + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Source model for DHL shipping methods for documentation + * + * @category Mage + * @package Mage_Usa + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Usa_Model_Shipping_Carrier_Dhl_International_Source_Method_Size +{ + /** + * Returns array to be used in multiselect on back-end + * + * @return array + */ + public function toOptionArray() + { + $unitArr = Mage::getSingleton('Mage_Usa_Model_Shipping_Carrier_Dhl_International')->getCode('size'); + + $returnArr = array(); + foreach ($unitArr as $key => $val) { + $returnArr[] = array('value' => $key, 'label' => $val); + } + return $returnArr; + } +} diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/Unitofmeasure.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/Unitofmeasure.php new file mode 100644 index 0000000000000000000000000000000000000000..5f061137b5cde80b35e53bc0e42921f7a4a62dad --- /dev/null +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International/Source/Method/Unitofmeasure.php @@ -0,0 +1,51 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Usa + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Source model for DHL shipping methods for documentation + * + * @category Mage + * @package Mage_Usa + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Usa_Model_Shipping_Carrier_Dhl_International_Source_Method_Unitofmeasure +{ + /** + * Returns array to be used in multiselect on back-end + * + * @return array + */ + public function toOptionArray() + { + $unitArr = Mage::getSingleton('Mage_Usa_Model_Shipping_Carrier_Dhl_International')->getCode('unit_of_measure'); + + $returnArr = array(); + foreach ($unitArr as $key => $val) { + $returnArr[] = array('value' => $key, 'label' => $val); + } + return $returnArr; + } +} diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Label/Pdf.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Label/Pdf.php new file mode 100644 index 0000000000000000000000000000000000000000..f4582b44bc85a3dda316f836946aafaaf3ee6302 --- /dev/null +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Label/Pdf.php @@ -0,0 +1,104 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Usa + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * DHL International (API v1.4) Label Creation + * + * @category Mage + * @package Mage_Usa + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf +{ + /** + * @var SimpleXMLElement + */ + protected $_info; + + /** + * Dhl International Label Creation Class constructor + * + * @param array $arguments + */ + public function __construct(array $arguments) + { + $this->_info = $arguments['info']; + } + + /** + * Create Label + * + * @return string + * @throws Zend_Pdf_Exception + * @throws InvalidArgumentException + */ + public function render() + { + $pdf = new Zend_Pdf(); + + $pdfBuilder = new Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf_PageBuilder(); + + $template = new Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf_Page(Zend_Pdf_Page::SIZE_A4_LANDSCAPE); + $pdfBuilder->setPage($template) + ->addProductName((string)$this->_info->ProductShortName) + ->addProductContentCode((string)$this->_info->ProductContentCode) + //->addUnitId({unitId}) + //->addReferenceData({referenceData}) + ->addSenderInfo($this->_info->Shipper) + ->addOriginInfo((string)$this->_info->OriginServiceArea->ServiceAreaCode) + ->addReceiveInfo($this->_info->Consignee) + ->addDestinationFacilityCode( + (string)$this->_info->Consignee->CountryCode, + (string)$this->_info->DestinationServiceArea->ServiceAreaCode, + (string)$this->_info->DestinationServiceArea->FacilityCode + ) + ->addServiceFeaturesCodes() + ->addDeliveryDateCode() + ->addShipmentInformation() + ->addDateInfo($this->_info->ShipmentDate) + ->addWeightInfo((string)$this->_info->ChargeableWeight, (string)$this->_info->WeightUnit) + ->addWaybillBarcode((string)$this->_info->AirwayBillNumber, (string)$this->_info->Barcodes->AWBBarCode) + ->addRoutingBarcode( + (string)$this->_info->DHLRoutingCode, + (string)$this->_info->DHLRoutingDataId, + (string)$this->_info->Barcodes->DHLRoutingBarCode + ) + ->addBorder(); + + foreach ($this->_info->Pieces->Piece as $piece) { + $page = new Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf_Page($template); + $pdfBuilder->setPage($page) + ->addPieceNumber((int)$piece->PieceNumber, (int)$this->_info->Piece) + ->addPieceIdBarcode( + (string)$piece->DataIdentifier, + (string)$piece->LicensePlate, + (string)$piece->LicensePlateBarCode + ); + array_push($pdf->pages, $page); + } + return $pdf->render(); + } +} diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Label/Pdf/Page.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Label/Pdf/Page.php new file mode 100644 index 0000000000000000000000000000000000000000..32b50f734529f506d9f64be853de5fc2915f713a --- /dev/null +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Label/Pdf/Page.php @@ -0,0 +1,150 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Usa + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * DHL International (API v1.4) Label Creation + * + * @category Mage + * @package Mage_Usa + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf_Page extends Zend_Pdf_Page +{ + /** + * Text align constants + */ + const ALIGN_RIGHT = 'right'; + const ALIGN_LEFT = 'left'; + const ALIGN_CENTER = 'center'; + + /** + * Dhl International Label Creation Class Pdf Page constructor + * Create/Make a copy of pdf page + * + * @param Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf_Page|string $param1 + * @param null $param2 + * @param null $param3 + */ + public function __construct($param1, $param2 = null, $param3 = null) + { + if ($param1 instanceof Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf_Page + && $param2 === null && $param3 === null + ) { + $this->_contents = $param1->getContents(); + } + parent::__construct($param1, $param2, $param3); + } + + /** + * Get PDF Page contents + * + * @return string + */ + public function getContents() + { + return $this->_contents; + } + + /** + * Calculate the width of given text in points taking into account current font and font-size + * + * @param string $text + * @param Zend_Pdf_Resource_Font $font + * @param float $font_size + * @return float + */ + public function getTextWidth($text, Zend_Pdf_Resource_Font $font, $font_size) + { + $drawing_text = iconv('', 'UTF-16BE', $text); + $characters = array(); + for ($i = 0; $i < strlen($drawing_text); $i++) { + $characters[] = (ord($drawing_text[$i++]) << 8) | ord($drawing_text[$i]); + } + $glyphs = $font->glyphNumbersForCharacters($characters); + $widths = $font->widthsForGlyphs($glyphs); + $text_width = (array_sum($widths) / $font->getUnitsPerEm()) * $font_size; + return $text_width; + } + + /** + * Draw a line of text at the specified position. + * + * @param string $text + * @param float $x + * @param float $y + * @param string $charEncoding (optional) Character encoding of source text. + * Defaults to current locale. + * @param $align + * @throws Zend_Pdf_Exception + * @return Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf_Page + */ + public function drawText($text, $x, $y, $charEncoding = '', $align = self::ALIGN_LEFT) + { + $left = null; + switch ($align) { + case self::ALIGN_LEFT: + $left = $x; + break; + + case self::ALIGN_CENTER: + $textWidth = $this->getTextWidth($text, $this->getFont(), $this->getFontSize()); + $left = $x - ($textWidth / 2); + break; + + case self::ALIGN_RIGHT: + $textWidth = $this->getTextWidth($text, $this->getFont(), $this->getFontSize()); + $left = $x - $textWidth; + break; + } + return parent::drawText($text, $left, $y, $charEncoding); + } + + /** + * Draw a text paragraph taking into account the maximum number of symbols in a row. + * If line is longer - spit it. + * + * @param array $lines + * @param int $x + * @param int $y + * @param int $maxWidth - number of symbols + * @param string $align + * @throws Zend_Pdf_Exception + * @return float + */ + public function drawLines($lines, $x, $y, $maxWidth, $align = self::ALIGN_LEFT) + { + foreach ($lines as $line) { + if (strlen($line) > $maxWidth) { + $subLines = Mage::helper('Mage_Core_Helper_String')->str_split($line, $maxWidth, true, true); + $y = $this->drawLines(array_filter($subLines), $x, $y, $maxWidth, $align); + continue; + } + $this->drawText($line, $x, $y, null, $align); + $y -= ceil($this->getFontSize()); + } + return $y; + } +} diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Label/Pdf/PageBuilder.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Label/Pdf/PageBuilder.php new file mode 100644 index 0000000000000000000000000000000000000000..7662a81de50f959fd24d75397fe667a66e07e443 --- /dev/null +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Label/Pdf/PageBuilder.php @@ -0,0 +1,627 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Usa + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * DHL International (API v1.4) Label Creation + * + * @category Mage + * @package Mage_Usa + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf_PageBuilder +{ + /** + * X coordinate of a block + */ + const X_INDENT = 60; + + /** + * Y coordinate of a block + */ + const Y_INDENT = 15; + + /** + * Pdf Page Instance + * + * @var Zend_Pdf_Page + */ + protected $_page; + + /** + * Create font instances + */ + public function __construct() + { + $this->_fontNormal = Zend_Pdf_Font::fontWithName(Zend_Pdf_Font::FONT_HELVETICA); + $this->_fontBold = Zend_Pdf_Font::fontWithName(Zend_Pdf_Font::FONT_HELVETICA_BOLD); + } + + /** + * Get Page + * + * @return Zend_Pdf_Page + */ + public function getPage() + { + return $this->_page; + } + + /** + * Set Page + * + * @param Zend_Pdf_Page $page + * @return Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf_PageBuilder + */ + public function setPage(Zend_Pdf_Page $page) + { + $this->_page = $page; + return $this; + } + + /** + * Calculate x coordinate with identation + * + * @param int $pt + * @return int + */ + protected function _x($pt) + { + return $pt + self::X_INDENT; + } + + /** + * Calculate y coordinate with identation + * + * @param int $pt + * @return int + */ + protected function _y($pt) + { + return 595 - self::Y_INDENT - $pt; + } + + /** + * Add Border + * + * @return Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf_Page + * @throws Zend_Pdf_Exception + */ + public function addBorder() + { + $x = $this->_x(0); + $y = $this->_y(0); + + $image = new Zend_Pdf_Resource_Image_Jpeg( + Mage::getDesign()->getSkinFile('dhl/logo.jpg', array('_area' => 'adminhtml')) + ); + $this->_page->drawImage($image, $x + 191, $this->_y(27), $x + 287, $this->_y(1)); + + /* Vertical borders */ + $this->_page->drawLine($x, $y, $x, $this->_y(568)); + $this->_page->drawLine($x + 287.5, $y, $x + 287.5, $this->_y(568)); + $this->_page->drawLine($x + 139.5, $y, $x + 139.5, $this->_y(28)); + $this->_page->drawLine($x + 190.5, $y, $x + 190.5, $this->_y(28)); + + /* Horisontal borders */ + $this->_page->drawLine($x, $y, $x + 288, $y); + $this->_page->drawLine($x, $this->_y(28), $x + 288, $this->_y(28)); + $this->_page->drawLine($x, $this->_y(80.5), $x + 288, $this->_y(80.5)); + $this->_page->drawLine($x, $this->_y(164), $x + 288, $this->_y(164)); + $this->_page->drawLine($x, $this->_y(194), $x + 288, $this->_y(194)); + $this->_page->drawLine($x, $this->_y(217.5), $x + 288, $this->_y(217.5)); + $this->_page->drawLine($x, $this->_y(245.5), $x + 288, $this->_y(245.5)); + $this->_page->drawLine($x, $this->_y(568.5), $x + 288, $this->_y(568.5)); + + $this->_page->setLineWidth(0.3); + $x = $this->_x(3); + $y = $this->_y(83); + $this->_page->drawLine($x, $y, $x + 10, $y); + $this->_page->drawLine($x, $y, $x, $y - 10); + + $x = $this->_x(3); + $y = $this->_y(161); + $this->_page->drawLine($x, $y, $x + 10, $y); + $this->_page->drawLine($x, $y, $x, $y + 10); + + $x = $this->_x(285); + $y = $this->_y(83); + $this->_page->drawLine($x, $y, $x - 10, $y); + $this->_page->drawLine($x, $y, $x, $y - 10); + + $x = $this->_x(285); + $y = $this->_y(161); + $this->_page->drawLine($x, $y, $x - 10, $y); + $this->_page->drawLine($x, $y, $x, $y + 10); + + return $this; + } + + /** + * Add Product Name + * + * @param string $name + * @return Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf_PageBuilder + * @throws InvalidArgumentException + * @throws Zend_Pdf_Exception + */ + public function addProductName($name) + { + $this->_page->saveGS(); + $this->_page->setFont($this->_fontBold, 9); + if (!strlen($name)) { + throw new InvalidArgumentException(Mage::helper('Mage_Usa_Helper_Data')->__('Product name is missing')); + } + $this->_page->drawText($name, $this->_x(8), $this->_y(12)); + $this->_page->restoreGS(); + return $this; + } + + /** + * Add Product Content Code + * + * @param string $code + * @return Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf_PageBuilder + * @throws Zend_Pdf_Exception + * @throws InvalidArgumentException + */ + public function addProductContentCode($code) + { + $this->_page->saveGS(); + $codes = array( + 'TDK' => 0, 'TDE' => 1, 'TDL' => 0, 'TDM' => 1, 'TDT' => 0, + 'TDY' => 1, 'XPD' => 0, 'DOX' => 0, 'WPX' => 1, 'DOM' => 0 + ); + if (!key_exists($code, $codes)) { + throw new InvalidArgumentException(Mage::helper('Mage_Usa_Helper_Data')->__('Product content code is invalid')); + } + $font = null; + if ($codes[$code]) { + $this->_page->drawRectangle( + $this->_x(140), + $this->_y(0), + $this->_x(190), + $this->_y(28), + Zend_Pdf_Page::SHAPE_DRAW_FILL + ); + $this->_page->setFillColor(new Zend_Pdf_Color_Html("#ffffff")); + $font = $this->_fontBold; + } else { + $font = $this->_fontNormal; + } + $this->_page->setFont($font, 17); + $this->_page->drawText($code, $this->_x(146), $this->_y(21)); + $this->_page->restoreGS(); + return $this; + } + + /** + * Add Unit Id + * + * @param int $id + * @return Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf_Page + * @throws Zend_Pdf_Exception + */ + public function addUnitId($id) + { + $this->_page->saveGS(); + $this->_page->setFont($this->_fontNormal, 6); + + $this->_page->drawText('Unit ID', $this->_x(8), $this->_y(20)); + $this->_page->restoreGS(); + return $this; + } + + /** + * Add Reference Data + * + * @param $data + * @return Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf_Page + * @throws Zend_Pdf_Exception + */ + public function addReferenceData($data) + { + $this->_page->saveGS(); + $this->_page->setFont($this->_fontNormal, 6); + $this->_page->drawText('GREF', $this->_x(80), $this->_y(20)); + //TODO: Add reference data rendering + $this->_page->restoreGS(); + return $this; + } + + /** + * Add Sender Info + * + * @param SimpleXMLElement $sender + * @return Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf_PageBuilder + * @throws InvalidArgumentException + * @throws Zend_Pdf_Exception + */ + public function addSenderInfo(SimpleXMLElement $sender) + { + $this->_page->saveGS(); + $this->_page->setFont($this->_fontNormal, 6); + $this->_page->drawText('From:', $this->_x(8), $this->_y(36)); + $contactName = implode(' ', array_filter(array((string)$sender->CompanyName, + (string)$sender->Contact->PersonName)) + ); + if (!$contactName) { + throw new InvalidArgumentException(Mage::helper('Mage_Usa_Helper_Data')->__('Sender contact name is missing')); + } + $this->_page->drawText($contactName, $this->_x(25), $this->_y(36)); + + $phoneNumber = implode(' ', array_filter(array((string)$sender->Contact->PhoneNumber, + (string)$sender->Contact->PhoneExtension)) + ); + $phoneNumber = $phoneNumber ? "Phone: " . $phoneNumber : null; + $pageY = $this->_drawSenderAddress($sender->AddressLine, $phoneNumber); + + $divisionCode = (string)(strlen($sender->DivisionCode) ? $sender->DivisionCode . ' ' : null); + $cityInfo = implode(' ', array_filter(array($sender->City, $divisionCode, $sender->PostalCode))); + if (!strlen($cityInfo)) { + throw new InvalidArgumentException(Mage::helper('Mage_Usa_Helper_Data')->__('Sender city info is missing')); + } + $this->_page->drawText($cityInfo, $this->_x(25), $pageY); + + $this->_page->setFont($this->_fontBold, 6); + $countryInfo = (string)(($sender->CountryName) ? $sender->CountryName : $sender->CountryCode); + if (!strlen($countryInfo)) { + throw new InvalidArgumentException(Mage::helper('Mage_Usa_Helper_Data')->__('Sender country info is missing')); + } + $this->_page->drawText($countryInfo, $this->_x(25), $pageY - $this->_page->getFontSize()); + + $this->_page->restoreGS(); + return $this; + } + + /** + * Draw Sender Address + * + * @param SimpleXMLElement $addressLines + * @param string $phoneNumber + * @return float + * @throws Zend_Pdf_Exception + */ + protected function _drawSenderAddress(SimpleXMLElement $addressLines, $phoneNumber) + { + $lines = array(); + foreach ($addressLines as $line) { + $lines [] = $line; + } + + $pageY = 0; + if (strlen($lines[0]) > 28) { + $firstLine = array_shift($lines); + $pageY = $this->_page->drawLines(array($firstLine), $this->_x(25), $this->_y(42), 28); + $this->_page->drawText($phoneNumber, $this->_x(103), $this->_y(42)); + } else { + $pageY = $this->_y(42); + $lineLength = $this->_page->getTextWidth( + $lines[0] . ' ', $this->_page->getFont(), $this->_page->getFontSize() + ); + $this->_page->drawText($phoneNumber, $this->_x(25 + $lineLength), $this->_y(42)); + } + + return $this->_page->drawLines($lines, $this->_x(25), $pageY, 49); + } + + /** + * Add Origin Info + * + * @param string $serviceAreaCode + * @return Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf_PageBuilder + * @throws InvalidArgumentException + * @throws Zend_Pdf_Exception + */ + public function addOriginInfo($serviceAreaCode) + { + if (strlen(!$serviceAreaCode)) { + throw new InvalidArgumentException(Mage::helper('Mage_Usa_Helper_Data')->__('Origin serviceAreaCode is missing')); + } + $this->_page->saveGS(); + $this->_page->setFont($this->_fontNormal, 6); + $this->_page->drawText("Origin:", $this->_x(260), $this->_y(36)); + $this->_page->setFont($this->_fontBold, 9); + $this->_page->drawText($serviceAreaCode, $this->_x(260), $this->_y(45)); + + $this->_page->restoreGS(); + return $this; + } + + /** + * Add Receive Info + * + * @param SimpleXMLElement $consignee + * @return Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf_PageBuilder + * @throws Zend_Pdf_Exception + */ + public function addReceiveInfo(SimpleXMLElement $consignee) + { + $this->_page->saveGS(); + + $this->_page->setFont($this->_fontNormal, 9); + $this->_page->drawText("To:", $this->_x(5), $this->_y(92)); + $this->_page->drawText($consignee->CompanyName, $this->_x(20), $this->_y(90)); + $y = $this->_page->drawLines($consignee->AddressLine, $this->_x(19), $this->_y(100), 50); + + $this->_page->setFont($this->_fontBold, 11); + $cityInfo = implode(' ', array_filter(array($consignee->PostalCode, $consignee->City, + $consignee->DivisionCode)) + ); + $y = min($y - 3, 460); + $this->_page->drawLines(array($cityInfo, $consignee->CountryName), $this->_x(20), $y, 44); + + $this->_page->setFont($this->_fontNormal, 6); + $this->_page->drawText('Contact:', $this->_x(260), $this->_y(90)); + + $y = $this->_page->drawLines(array($consignee->Contact->PersonName), $this->_x(283), $this->_y(98), 25, + Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf_Page::ALIGN_RIGHT + ); + $phoneNumber = implode(' ', array_filter(array($consignee->Contact->PhoneNumber, + $consignee->Contact->PhoneExtension)) + ); + $this->_page->drawText($phoneNumber, $this->_x(283), $y, null, + Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf_Page::ALIGN_RIGHT + ); + + $this->_page->restoreGS(); + return $this; + } + + /** + * Add Destination Facility Code + * + * @param string $countryCode + * @param string $serviceAreaCode + * @param string $facilityCode + * @return Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf_PageBuilder + * @throws InvalidArgumentException + * @throws Zend_Pdf_Exception + */ + public function addDestinationFacilityCode($countryCode, $serviceAreaCode, $facilityCode) + { + $this->_page->saveGS(); + $this->_page->setFont($this->_fontNormal, 20); + $code = implode('-', array_filter(array($countryCode, $serviceAreaCode, $facilityCode))); + + if (!strlen($code)) { + throw new InvalidArgumentException(Mage::helper('Mage_Usa_Helper_Data')->__('Destination facility code is empty')); + } + $this->_page->drawText($code, $this->_x(144), $this->_y(186), null, + Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf_Page::ALIGN_CENTER + ); + + $this->_page->restoreGS(); + return $this; + } + + /** + * Add Service Features Codes + * + * @return Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf_PageBuilder + * @throws Zend_Pdf_Exception + */ + public function addServiceFeaturesCodes() + { + $this->_page->saveGS(); + $this->_page->drawRectangle($this->_x(0), $this->_y(195), $this->_x(218), $this->_y(217), + Zend_Pdf_Page::SHAPE_DRAW_FILL + ); + $this->_page->restoreGS(); + return $this; + } + + /** + * Add Delivery Date Code + * + * @return Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf_PageBuilder + * @throws Zend_Pdf_Exception + */ + public function addDeliveryDateCode() + { + $this->_page->saveGS(); + + $this->_page->setFont($this->_fontNormal, 6); + $this->_page->drawText('Day:', $this->_x(220), $this->_y(201)); + $this->_page->drawText('Time:', $this->_x(250), $this->_y(201)); + + $this->_page->setFont($this->_fontNormal, 20); + + $this->_page->restoreGS(); + return $this; + } + + /** + * Add Shipment Information + * + * @return Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf_PageBuilder + */ + public function addShipmentInformation() + { + $this->_page->saveGS(); + + $this->_page->restoreGS(); + return $this; + } + + /** + * Add Date Info + * @param string $date + * @return Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf_PageBuilder + * @throws Zend_Pdf_Exception + */ + public function addDateInfo($date) + { + $this->_page->saveGS(); + + $this->_page->setFont($this->_fontNormal, 6); + $this->_page->drawText('Date:', $this->_x(160), $this->_y(224)); + $this->_page->drawText($date, $this->_x(150), $this->_y(231)); + + $this->_page->restoreGS(); + return $this; + } + + /** + * Add Weight Info + * + * @param string $weight + * @param string $unit + * @return Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf_PageBuilder + * @throws InvalidArgumentException + * @throws Zend_Pdf_Exception + */ + public function addWeightInfo($weight, $unit) + { + $this->_page->saveGS(); + + $units = array("K" => 'kg', "L" => 'lb'); + if (!isset($units[$unit])) { + throw new InvalidArgumentException(Mage::helper('Mage_Usa_Helper_Data')->__('Weight unit is invalid')); + } + $unit = $units[$unit]; + + $this->_page->setFont($this->_fontNormal, 6); + $this->_page->drawText('Shpt Weight:', $this->_x(196), $this->_y(224)); + $this->_page->setFont($this->_fontBold, 11); + $this->_page->drawText($weight . ' ' . $unit, $this->_x(195), $this->_y(234)); + + $this->_page->restoreGS(); + return $this; + } + + /** + * Add Waybill Barcode + * + * @param string $number + * @param string $barCode + * @return Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf_PageBuilder + * @throws InvalidArgumentException + * @throws Zend_Pdf_Exception + */ + public function addWaybillBarcode($number, $barCode) + { + $this->_page->saveGS(); + + if(!strlen($number) || !strlen($barCode)) { + throw new InvalidArgumentException(Mage::helper('Mage_Usa_Helper_Data')->__('Waybill barcode information is missing')); + } + $image = new Zend_Pdf_Resource_Image_Png("data://image/png;base64," . $barCode); + $this->_page->drawImage($image, $this->_x(0), $this->_y(296), $this->_x(232), $this->_y(375)); + + $this->_page->setFont($this->_fontNormal, 9); + $number = substr($number, 0, 2) . ' ' . substr($number, 2, 4) . ' ' . substr($number, 6, 4); + $this->_page->drawText("WAYBILL " . $number, $this->_x(13.5), $this->_y(382)); + + $this->_page->restoreGS(); + return $this; + } + + /** + * Add Routing Barcode + * + * @param string $routingCode + * @param string $id + * @param string $barCode + * @return Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf_PageBuilder + * @throws InvalidArgumentException + * @throws Zend_Pdf_Exception + */ + public function addRoutingBarcode($routingCode, $id, $barCode) + { + $this->_page->saveGS(); + + if(!$barCode) { + throw new InvalidArgumentException(Mage::helper('Mage_Usa_Helper_Data')->__('Routing barcode is missing')); + } + + $image = new Zend_Pdf_Resource_Image_Png("data://image/png;base64," . $barCode); + $this->_page->drawImage($image, $this->_x(0), $this->_y(386), $this->_x(232), $this->_y(465)); + + $this->_page->setFont($this->_fontNormal, 9); + $routingText = '(' . $id . ')' . $routingCode; + $this->_page->drawText($routingText, $this->_x(12), $this->_y(472)); + + $this->_page->restoreGS(); + return $this; + } + + /** + * Add Piece Id Barcode + * + * @param string $dataIdentifier + * @param string $licensePlate + * @param string $barCode + * @return Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf_PageBuilder + * @throws InvalidArgumentException + * @throws Zend_Pdf_Exception + */ + public function addPieceIdBarcode($dataIdentifier, $licensePlate, $barCode) + { + $this->_page->saveGS(); + + if (!strlen($barCode)) { + throw new InvalidArgumentException(Mage::helper('Mage_Usa_Helper_Data')->__('Piece Id barcode is missing')); + } + + $image = new Zend_Pdf_Resource_Image_Png('data://image/png;base64,' . $barCode); + $this->_page->drawImage($image, $this->_x(29), $this->_y(476), $this->_x(261), $this->_y(555)); + + $this->_page->setFont($this->_fontNormal, 9); + $routingText = '(' . $dataIdentifier . ')' . $licensePlate; + $this->_page->drawText($routingText, $this->_x(144), $this->_y(563), '', + Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf_Page::ALIGN_CENTER + ); + + $this->_page->restoreGS(); + return $this; + } + + /** + * Add Piece Number + * + * @param int $pieceNumber + * @param int $piecesTotal + * @return Mage_Usa_Model_Shipping_Carrier_Dhl_Label_Pdf_PageBuilder + * @throws InvalidArgumentException + * @throws Zend_Pdf_Exception + */ + public function addPieceNumber($pieceNumber, $piecesTotal) + { + $this->_page->saveGS(); + + if (!$pieceNumber || !$piecesTotal) { + throw new InvalidArgumentException(Mage::helper('Mage_Usa_Helper_Data')->__('Piece number information is missing')); + } + + $this->_page->setFont($this->_fontNormal, 6); + $this->_page->drawText('Piece:', $this->_x(256), $this->_y(224)); + $this->_page->setFont($this->_fontBold, 11); + $this->_page->drawText($pieceNumber . '/' . $piecesTotal, $this->_x(256), $this->_y(234)); + + $this->_page->restoreGS(); + return $this; + } +} diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Source/Dutypaymenttype.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Source/Dutypaymenttype.php index 75140ae602e901d143e04094a630426273693f60..cf8f9e5b5eb7b5daa52039aac49fd0dce245d772 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Source/Dutypaymenttype.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Source/Dutypaymenttype.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Usa - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Source/Freemethod.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Source/Freemethod.php index 0b3318e55b138e597614fe84b044cfd4dbf0c528..19cae0cac3349a85b43b8fb35b25e6d5f673a145 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Source/Freemethod.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Source/Freemethod.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Usa - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Source/Method.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Source/Method.php index 809d2a410f952cc431c58de8963de9e345981791..b876ed0dc28b62a78f4fd75b033303c45dbd83b5 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Source/Method.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Source/Method.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Usa - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Source/Protection/Rounding.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Source/Protection/Rounding.php index 65b1e30c1c7a5edf3a7c74fe525f8ad8bd04fd9a..d4b4b49cf7e3f38eb3f59be286915337a61bc88a 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Source/Protection/Rounding.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Source/Protection/Rounding.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Usa - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Source/Protection/Value.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Source/Protection/Value.php index 348440080e7691b0919cdfd2d236ac07a3b0a768..8349aee73f42364215a328a72b0867408a935ff6 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Source/Protection/Value.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Source/Protection/Value.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Usa - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Source/Shipmenttype.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Source/Shipmenttype.php index 80a05f4fa0564c973b6cb24edd3ce56ccf39cf5b..7965db516a0373cf15174cc869c62d2f5ee612c5 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Source/Shipmenttype.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Source/Shipmenttype.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Usa - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Fedex.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Fedex.php index e8bdd256e14481c3f7fbe4058b173fae6c62f232..99bc8b480ae02c2e0dcb8352933fcb643bdb18e6 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Fedex.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Fedex.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Usa - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -261,6 +261,8 @@ class Mage_Usa_Model_Shipping_Carrier_Fedex $r->setIsReturn($request->getIsReturn()); + $r->setBaseSubtotalInclTax($request->getBaseSubtotalInclTax()); + $this->_rawRequest = $r; return $this; @@ -316,7 +318,7 @@ class Mage_Usa_Model_Shipping_Carrier_Fedex 'ShipTimestamp' => date('c'), 'PackagingType' => $r->getPackaging(), 'TotalInsuredValue' => array( - 'Ammount' => $r->getValue(), + 'Amount' => $r->getValue(), 'Currency' => $this->getCurrencyCode() ), 'Shipper' => array( @@ -339,6 +341,12 @@ class Mage_Usa_Model_Shipping_Carrier_Fedex 'CountryCode' => $r->getOrigCountry() ) ), + 'CustomsClearanceDetail' => array( + 'CustomsValue' => array( + 'Amount' => $r->getValue(), + 'Currency' => $this->getCurrencyCode() + ) + ), 'RateRequestTypes' => 'LIST', 'PackageCount' => '1', 'PackageDetail' => 'INDIVIDUAL_PACKAGES', @@ -347,6 +355,10 @@ class Mage_Usa_Model_Shipping_Carrier_Fedex 'Weight' => array( 'Value' => (float)$r->getWeight(), 'Units' => 'LB' + ), + 'InsuredValue' => array( + 'Amount' => $r->getValue(), + 'Currency' => $this->getCurrencyCode() ) ) ) @@ -395,8 +407,7 @@ class Mage_Usa_Model_Shipping_Carrier_Fedex foreach ($response->RateReplyDetails as $rate) { $serviceName = (string)$rate->ServiceType; if (in_array($serviceName, $allowedMethods)) { - $amount = (string)$rate->RatedShipmentDetails[0] - ->ShipmentRateDetail->TotalNetCharge->Amount; + $amount = $this->_getRateAmountOriginBased($rate); $costArr[$serviceName] = $amount; $priceArr[$serviceName] = $this->getMethodPrice($amount, $serviceName); } @@ -406,7 +417,7 @@ class Mage_Usa_Model_Shipping_Carrier_Fedex $rate = $response->RateReplyDetails; $serviceName = (string)$rate->ServiceType; if (in_array($serviceName, $allowedMethods)) { - $amount = (string)$rate->RatedShipmentDetails[0]->ShipmentRateDetail->TotalNetCharge->Amount; + $amount = $this->_getRateAmountOriginBased($rate); $costArr[$serviceName] = $amount; $priceArr[$serviceName] = $this->getMethodPrice($amount, $serviceName); } @@ -438,6 +449,31 @@ class Mage_Usa_Model_Shipping_Carrier_Fedex return $result; } + /** + * Get origin based amount form response of rate estimation + * + * @param stdClass $rate + * @return null|float + */ + protected function _getRateAmountOriginBased($rate) + { + $amount = null; + if (is_object($rate)) { + foreach($rate->RatedShipmentDetails as $ratedShipmentDetail) { + $shipmentRateDetail = $ratedShipmentDetail->ShipmentRateDetail; + // The "RATED..." rates are expressed in the currency of the origin country + if ((string)$shipmentRateDetail->RateType == 'RATED_ACCOUNT_SHIPMENT') { + $amount = (string)$shipmentRateDetail->TotalNetCharge->Amount; + } + } + if (is_null($amount)) { + $amount = (string)$rate->RatedShipmentDetails[0]->ShipmentRateDetail + ->TotalNetCharge->Amount; + } + } + return $amount; + } + /** * Set free method request * diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Fedex/Source/Dropoff.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Fedex/Source/Dropoff.php index 19cb15596f16de666425475b266c7f039e7ebb38..7ee4c376b39de89fd11c29853f826ed4d5823e02 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Fedex/Source/Dropoff.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Fedex/Source/Dropoff.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Usa - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Fedex/Source/Freemethod.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Fedex/Source/Freemethod.php index 5a42f5dd2ca7e44acf06905788aa4b8b5a7b6d00..6860c22205b13a126d5aad2eef3d78e60a1139ad 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Fedex/Source/Freemethod.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Fedex/Source/Freemethod.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Usa - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Fedex/Source/Method.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Fedex/Source/Method.php index c80e7b156ba099f3630e119391b1c447db78b1de..4ca22b6f0bbf222d809c91db30989d651b517e24 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Fedex/Source/Method.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Fedex/Source/Method.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Usa - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Fedex/Source/Packaging.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Fedex/Source/Packaging.php index ab07fb359ab93e15f4991ff71b786f43bb9c175d..b672460f725f0db9c58cf669c8a8f259830e3e77 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Fedex/Source/Packaging.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Fedex/Source/Packaging.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Usa - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups.php index ab1036ede775401eb5ecb52110ac2da115e4edd6..9f24786511af14609af2f20a3bf4c49750e36dd8 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Usa - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -272,6 +272,8 @@ class Mage_Usa_Model_Shipping_Carrier_Ups $r->setIsReturn($request->getIsReturn()); + $r->setBaseSubtotalInclTax($request->getBaseSubtotalInclTax()); + $this->_rawRequest = $r; return $this; @@ -487,7 +489,7 @@ class Mage_Usa_Model_Shipping_Carrier_Ups /** * Get configuration data of carrier * - * @param strin $type + * @param string $type * @param string $code * @return array|bool */ @@ -1007,10 +1009,7 @@ XMLRequest; if (in_array($responseCurrencyCode, $allowedCurrencies)) { $cost = (float) $cost * $this->_getBaseCurrencyRate($responseCurrencyCode); } else { - $errorTitle = Mage::helper('Mage_Directory_Helper_Data') - ->__('Can\'t convert rate from "%s-%s".', - $responseCurrencyCode, - $this->_request->getPackageCurrency()->getCode()); + $errorTitle = Mage::helper('Mage_Directory_Helper_Data')->__('Can\'t convert rate from "%s-%s".', $responseCurrencyCode, $this->_request->getPackageCurrency()->getCode()); $error = Mage::getModel('Mage_Shipping_Model_Rate_Result_Error'); $error->setCarrier('ups'); $error->setCarrierTitle($this->getConfigData('title')); diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups/Source/Container.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups/Source/Container.php index e1cc23a1c557b648b086b2b1b6fd6dbe78b68a02..52b36972f8b9a46e4413adce56f3c7ef4c7d38e4 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups/Source/Container.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups/Source/Container.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Usa - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups/Source/DestType.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups/Source/DestType.php index e48d497719928178375de4e0eb2c8e06aa39cd5e..f2de3d7166f293d7e2b9900aa34cf437e5db8ddf 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups/Source/DestType.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups/Source/DestType.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Usa - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups/Source/Freemethod.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups/Source/Freemethod.php index dede1e0bb79d23150b11dcb8719159e705f8b3df..199e1d50c2c2f95fae1e9b8b4f8356d2c8bf3531 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups/Source/Freemethod.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups/Source/Freemethod.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Usa - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups/Source/Method.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups/Source/Method.php index 4f2a8f475e9b849fddb552fdeba12db768be63ae..34f502691bb321b09b42a1caedd7fc5ab7ae7054 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups/Source/Method.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups/Source/Method.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Usa - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups/Source/Mode.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups/Source/Mode.php index b707b4c159ebfd2ea82061a449671a2429d220a4..0a2dafa7d3947da722f0b251efd36d0ff512ffda 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups/Source/Mode.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups/Source/Mode.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Usa - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups/Source/OriginShipment.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups/Source/OriginShipment.php index e9beebd26fef98173b6a221bb2cc30709a6081a1..73af78681be9ee28c5f0aad365a163f2ed54b919 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups/Source/OriginShipment.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups/Source/OriginShipment.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Usa - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups/Source/Pickup.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups/Source/Pickup.php index 545ac4d51d3e1864741de8142a556767f756a9de..07b68868c56eb145ce1f62f0bd844e0397cc8c96 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups/Source/Pickup.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups/Source/Pickup.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Usa - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups/Source/Type.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups/Source/Type.php index d1e9ebb1556cb6c9b0f93a6aa1628b865248b0aa..631b827a266eb7c6d0f20fe83866c8a8c2c6c776 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups/Source/Type.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups/Source/Type.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Usa - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups/Source/Unitofmeasure.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups/Source/Unitofmeasure.php index 67f9250c47d5ee6355d3ad326da7ba411fb18007..14e76e3e2291bc71252e262814c2370279c1e44e 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups/Source/Unitofmeasure.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups/Source/Unitofmeasure.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Usa - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Usps.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Usps.php index 9cc187e2a2b3e205847578617de09d9f7d9e32ac..0c81e47668ed879dc72ffbd3d477b4d6419d9569 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Usps.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Usps.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Usa - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -140,12 +140,12 @@ class Mage_Usa_Model_Shipping_Carrier_Usps * @param Mage_Shipping_Model_Rate_Request $request * @return Mage_Shipping_Model_Carrier_Abstract|Mage_Shipping_Model_Rate_Result_Error|boolean */ - public function processAdditionalValidation(Mage_Shipping_Model_Rate_Request $request) + public function proccessAdditionalValidation(Mage_Shipping_Model_Rate_Request $request) { // zip code required for US $this->_isZipCodeRequired = $this->_isUSCountry($request->getDestCountryId()); - return parent::processAdditionalValidation($request); + return parent::proccessAdditionalValidation($request); } /** @@ -287,6 +287,8 @@ class Mage_Usa_Model_Shipping_Carrier_Usps $r->setValue($request->getPackageValue()); $r->setValueWithDiscount($request->getPackageValueWithDiscount()); + $r->setBaseSubtotalInclTax($request->getBaseSubtotalInclTax()); + $this->_rawRequest = $r; return $this; diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Usps/Source/Container.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Usps/Source/Container.php index 838567f73e518400444ca4f115d707a0890840e3..ec9a002983c03fd74fb80f59f4329ecd3fe8b8d1 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Usps/Source/Container.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Usps/Source/Container.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Usa - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Usps/Source/Freemethod.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Usps/Source/Freemethod.php index 3eae56ad3acac28737a4ec607da38fb03c2418bf..7cce6e07a5b3832e1f0ce0acfea5a867408f6b44 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Usps/Source/Freemethod.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Usps/Source/Freemethod.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Usa - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Usps/Source/Machinable.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Usps/Source/Machinable.php index b7d638a70e758ebd6e7cf0fff2c7ea6f41ae1325..57a693f651717d3106873a15162879ef01375337 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Usps/Source/Machinable.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Usps/Source/Machinable.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Usa - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Usps/Source/Method.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Usps/Source/Method.php index 9666d94604c3ae4105e9c8048ce494d7f8d9f305..fc7c8d14ddc045d4732717601192657f905800a3 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Usps/Source/Method.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Usps/Source/Method.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Usa - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Usps/Source/Size.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Usps/Source/Size.php index 6eac5d81cd6b72dbe546d0bfd1a9c7744c06a278..d3643a310927ea2bd103a5be86987ac9a43039a3 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Usps/Source/Size.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Usps/Source/Size.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Usa - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Usa/etc/config.xml b/app/code/core/Mage/Usa/etc/config.xml index 7d5a90b520c2def9551f236936d1451ed991085e..06d27ed54206efec5995516595160c507a4a4037 100644 --- a/app/code/core/Mage/Usa/etc/config.xml +++ b/app/code/core/Mage/Usa/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Usa - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> @@ -54,6 +54,9 @@ <dhl> <class>Mage_Usa_Model_Shipping_Carrier_Dhl</class> </dhl> + <dhlint> + <class>Mage_Usa_Model_Shipping_Carrier_Dhl_International</class> + </dhlint> </carriers> </shipping> <tax> @@ -102,7 +105,7 @@ <shipment_type>P</shipment_type> <shipping_key backend_model="Mage_Adminhtml_Model_System_Config_Backend_Encrypted"/> <shipping_intlkey backend_model="Mage_Adminhtml_Model_System_Config_Backend_Encrypted"/> - <title>DHL</title> + <title>DHL (Deprecated)</title> <specificerrmsg>This shipping method is currently unavailable. If you would like to ship using this shipping method, please contact us.</specificerrmsg> <max_package_weight>150</max_package_weight> <handling_type>F</handling_type> @@ -183,6 +186,25 @@ <handling_type>F</handling_type> <handling_action>O</handling_action> </usps> + <dhlint> + <model>Mage_Usa_Model_Shipping_Carrier_Dhl_International</model> + <account/> + <active>0</active> + <title>DHL</title> + <sallowspecific>0</sallowspecific> + <allowed_methods>1,2,3,4,5,6,7,8,9,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y</allowed_methods> + <free_method>G</free_method> + <gateway_url>https://xmlpitest-ea.dhl.com/XMLShippingServlet</gateway_url> + <id backend_model="Mage_Adminhtml_Model_System_Config_Backend_Encrypted"/> + <password backend_model="Mage_Adminhtml_Model_System_Config_Backend_Encrypted"/> + <shipment_type>N</shipment_type> + <specificerrmsg>This shipping method is currently unavailable. If you would like to ship using this shipping method, please contact us.</specificerrmsg> + <divide_order_weight>1</divide_order_weight> + <unit_of_measure>K</unit_of_measure> + <size>R</size> + <handling_type>F</handling_type> + <handling_action>O</handling_action> + </dhlint> </carriers> </default> </config> diff --git a/app/code/core/Mage/Usa/etc/dhl/international/countries.xml b/app/code/core/Mage/Usa/etc/dhl/international/countries.xml new file mode 100644 index 0000000000000000000000000000000000000000..75854bca598cc00c14beb8a71c23e6d0e0efaf9f --- /dev/null +++ b/app/code/core/Mage/Usa/etc/dhl/international/countries.xml @@ -0,0 +1,1553 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * 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_AFL.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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Usa + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<countries> + <AD> + <currency>EUR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Andorra</name> + </AD> + <AE> + <currency>AED</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>United Arab Emirates</name> + </AE> + <AF> + <currency>AFN</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Afghanistan</name> + </AF> + <AG> + <currency>XCD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AM</region> + <name>Antigua</name> + </AG> + <AI> + <currency>XCD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AM</region> + <name>Anguilla</name> + </AI> + <AL> + <currency>EUR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Albania</name> + </AL> + <AM> + <currency>AMD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Armenia</name> + </AM> + <AN> + <currency>ANG</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Netherlands Antilles</name> + </AN> + <AO> + <currency>AOA</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Angola</name> + </AO> + <AR> + <currency>ARS</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AM</region> + <name>Argentina</name> + </AR> + <AS> + <currency>USD</currency> + <weight_unit>LB</weight_unit> + <measure_unit>IN</measure_unit> + <name>American Samoa</name> + </AS> + <AT> + <currency>EUR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>EA</region> + <name>Austria</name> + </AT> + <AU> + <currency>AUD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Australia</name> + </AU> + <AW> + <currency>AWG</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AM</region> + <name>Aruba</name> + </AW> + <AZ> + <currency>AZM</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Azerbaijan</name> + </AZ> + <BA> + <currency>BAM</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Bosnia and Herzegovina</name> + </BA> + <BB> + <currency>BBD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AM</region> + <name>Barbados</name> + </BB> + <BD> + <currency>BDT</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Bangladesh</name> + </BD> + <BE> + <currency>EUR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>EA</region> + <name>Belgium</name> + </BE> + <BF> + <currency>XOF</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Burkina Faso</name> + </BF> + <BG> + <currency>BGN</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>EA</region> + <name>Bulgaria</name> + </BG> + <BH> + <currency>BHD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Bahrain</name> + </BH> + <BI> + <currency>BIF</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Burundi</name> + </BI> + <BJ> + <currency>XOF</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Benin</name> + </BJ> + <BM> + <currency>BMD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AM</region> + <name>Bermuda</name> + </BM> + <BN> + <currency>BND</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Brunei</name> + </BN> + <BO> + <currency>BOB</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AM</region> + <name>Bolivia</name> + </BO> + <BR> + <currency>BRL</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AM</region> + <name>Brazil</name> + </BR> + <BS> + <currency>BSD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AM</region> + <name>Bahamas</name> + </BS> + <BT> + <currency>BTN</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Bhutan</name> + </BT> + <BW> + <currency>BWP</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Botswana</name> + </BW> + <BY> + <currency>BYR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Belarus</name> + </BY> + <BZ> + <currency>BZD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Belize</name> + </BZ> + <CA> + <currency>CAD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AM</region> + <name>Canada</name> + </CA> + <CD> + <currency>CDF</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Congo, The Democratic Republic of</name> + </CD> + <CF> + <currency>XAF</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Central African Republic</name> + </CF> + <CG> + <currency>XAF</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Congo</name> + </CG> + <CH> + <currency>CHF</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>EA</region> + <name>Switzerland</name> + </CH> + <CI> + <currency>XOF</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Cote d'Ivoire</name> + </CI> + <CK> + <currency>NZD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Cook Islands</name> + </CK> + <CL> + <currency>CLP</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AM</region> + <name>Chile</name> + </CL> + <CM> + <currency>XAF</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Cameroon</name> + </CM> + <CN> + <currency>CNY</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>China, People's Republic</name> + </CN> + <CO> + <currency>COP</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AM</region> + <name>Colombia</name> + </CO> + <CR> + <currency>CRC</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AM</region> + <name>Costa Rica</name> + </CR> + <CU> + <currency>CUP</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Cuba</name> + </CU> + <CV> + <currency>CVE</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Cape Verde</name> + </CV> + <CY> + <currency>EUR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Cyprus</name> + </CY> + <CZ> + <currency>CZK</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>EA</region> + <name>Czech Republic, The</name> + </CZ> + <DE> + <currency>EUR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>EA</region> + <name>Germany</name> + </DE> + <DJ> + <currency>DJF</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Djibouti</name> + </DJ> + <DK> + <currency>DKK</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>EA</region> + <name>Denmark</name> + </DK> + <DM> + <currency>XCD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AM</region> + <name>Dominica</name> + </DM> + <DO> + <currency>DOP</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AM</region> + <name>Dominican Rep.</name> + </DO> + <DZ> + <currency>DZD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Algeria</name> + </DZ> + <EC> + <currency>USD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AM</region> + <name>Ecuador</name> + </EC> + <EE> + <currency>EEK</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>EA</region> + <name>Estonia</name> + </EE> + <EG> + <currency>EGP</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Egypt</name> + </EG> + <ER> + <currency>ERN</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Eritrea</name> + </ER> + <ES> + <currency>EUR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>EA</region> + <name>Spain</name> + </ES> + <ET> + <currency>ETB</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Ethiopia</name> + </ET> + <FI> + <currency>EUR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>EA</region> + <name>Finland</name> + </FI> + <FJ> + <currency>FJD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Fiji</name> + </FJ> + <FK> + <currency>FKP</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Falkland Islands</name> + </FK> + <FM> + <currency>USD</currency> + <weight_unit>LB</weight_unit> + <measure_unit>IN</measure_unit> + <name>MICRONESIA, FEDERATED STATES OF</name> + </FM> + <FO> + <currency>DKK</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Faroe Islands</name> + </FO> + <FR> + <currency>EUR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>EA</region> + <name>France</name> + </FR> + <GA> + <currency>XAF</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Gabon</name> + </GA> + <GB> + <currency>GBP</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>EA</region> + <name>United Kingdom</name> + </GB> + <GD> + <currency>XCD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AM</region> + <name>Grenada</name> + </GD> + <GE> + <currency>GEL</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Georgia</name> + </GE> + <GF> + <currency>EUR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AM</region> + <name>French Guyana</name> + </GF> + <GG> + <currency>GBP</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Guernsey</name> + </GG> + <GH> + <currency>GHS</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Ghana</name> + </GH> + <GI> + <currency>GIP</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Gibraltar</name> + </GI> + <GL> + <currency>DKK</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Greenland</name> + </GL> + <GM> + <currency>GMD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Gambia</name> + </GM> + <GN> + <currency>GNF</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Guinea Republic</name> + </GN> + <GP> + <currency>EUR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AM</region> + <name>Guadeloupe</name> + </GP> + <GQ> + <currency>XAF</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Guinea-Equatorial</name> + </GQ> + <GR> + <currency>EUR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>EA</region> + <name>Greece</name> + </GR> + <GT> + <currency>GTQ</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AM</region> + <name>Guatemala</name> + </GT> + <GU> + <currency>USD</currency> + <weight_unit>LB</weight_unit> + <measure_unit>IN</measure_unit> + <region>AM</region> + <name>Guam</name> + </GU> + <GW> + <currency>GWP</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Guinea-Bissau</name> + </GW> + <GY> + <currency>GYD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AM</region> + <name>Guyana (British)</name> + </GY> + <HK> + <currency>HKD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Hong Kong</name> + </HK> + <HN> + <currency>HNL</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AM</region> + <name>Honduras</name> + </HN> + <HR> + <currency>HRK</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Croatia</name> + </HR> + <HT> + <currency>HTG</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AM</region> + <name>Haiti</name> + </HT> + <HU> + <currency>HUF</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>EA</region> + <name>Hungary</name> + </HU> + <IC> + <currency>EUR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Canary Islands, The</name> + </IC> + <ID> + <currency>IDR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Indonesia</name> + </ID> + <IE> + <currency>EUR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>EA</region> + <name>Ireland, Republic Of</name> + </IE> + <IL> + <currency>ILS</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Israel</name> + </IL> + <IN> + <currency>INR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>India</name> + </IN> + <IQ> + <currency>IQD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Iraq</name> + </IQ> + <IR> + <currency>IRR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Iran (Islamic Republic of)</name> + </IR> + <IS> + <currency>ISK</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>EA</region> + <name>Iceland</name> + </IS> + <IT> + <currency>EUR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>EA</region> + <name>Italy</name> + </IT> + <JE> + <currency>GBP</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Jersey</name> + </JE> + <JM> + <currency>JMD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AM</region> + <name>Jamaica</name> + </JM> + <JO> + <currency>JOD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Jordan</name> + </JO> + <JP> + <currency>JPY</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Japan</name> + </JP> + <KE> + <currency>KES</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Kenya</name> + </KE> + <KG> + <currency>KGS</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Kyrgyzstan</name> + </KG> + <KH> + <currency>KHR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Cambodia</name> + </KH> + <KI> + <currency>AUD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Kiribati</name> + </KI> + <KM> + <currency>KMF</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Comoros</name> + </KM> + <KN> + <currency>XCD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AM</region> + <name>St. Kitts</name> + </KN> + <KP> + <currency>KPW</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Korea, The D.P.R of</name> + </KP> + <KR> + <currency>KRW</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Korea, Republic Of</name> + </KR> + <KV> + <currency>EUR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Kosovo</name> + </KV> + <KW> + <currency>KWD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Kuwait</name> + </KW> + <KY> + <currency>KYD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AM</region> + <name>Cayman Islands</name> + </KY> + <KZ> + <currency>KZT</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Kazakhstan</name> + </KZ> + <LA> + <currency>LAK</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Lao People's Democratic Republic</name> + </LA> + <LB> + <currency>USD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Lebanon</name> + </LB> + <LC> + <currency>XCD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AM</region> + <name>St. Lucia</name> + </LC> + <LI> + <currency>CHF</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Liechtenstein</name> + </LI> + <LK> + <currency>LKR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Sri Lanka</name> + </LK> + <LR> + <currency>LRD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Liberia</name> + </LR> + <LS> + <currency>LSL</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Lesotho</name> + </LS> + <LT> + <currency>LTL</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>EA</region> + <name>Lithuania</name> + </LT> + <LU> + <currency>EUR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>EA</region> + <name>Luxembourg</name> + </LU> + <LV> + <currency>LVL</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>EA</region> + <name>Latvia</name> + </LV> + <LY> + <currency>LYD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Libya</name> + </LY> + <MA> + <currency>MAD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Morocco</name> + </MA> + <MC> + <currency>EUR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Monaco</name> + </MC> + <MD> + <currency>MDL</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Moldova, Republic Of</name> + </MD> + <ME> + <currency>EUR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Montenegro, Republic of</name> + </ME> + <MG> + <currency>MGA</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Madagascar</name> + </MG> + <MH> + <currency>USD</currency> + <weight_unit>LB</weight_unit> + <measure_unit>IN</measure_unit> + <name>Marshall Islands</name> + </MH> + <MK> + <currency>MKD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Macedonia, Rep. of (FYROM)</name> + </MK> + <ML> + <currency>XOF</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Mali</name> + </ML> + <MM> + <currency>USD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Myanmar</name> + </MM> + <MN> + <currency>MNT</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Mongolia</name> + </MN> + <MO> + <currency>MOP</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Macau</name> + </MO> + <MP> + <currency>USD</currency> + <weight_unit>LB</weight_unit> + <measure_unit>IN</measure_unit> + <name>Saipan</name> + </MP> + <MQ> + <currency>EUR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AM</region> + <name>Martinique</name> + </MQ> + <MR> + <currency>MRO</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Mauritania</name> + </MR> + <MS> + <currency>XCD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Montserrat</name> + </MS> + <MT> + <currency>EUR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Malta</name> + </MT> + <MU> + <currency>MUR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Mauritius</name> + </MU> + <MV> + <currency>MVR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Maldives</name> + </MV> + <MW> + <currency>MWK</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Malawi</name> + </MW> + <MX> + <currency>MXN</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AM</region> + <name>Mexico</name> + </MX> + <MY> + <currency>MYR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Malaysia</name> + </MY> + <MZ> + <currency>MZN</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Mozambique</name> + </MZ> + <NA> + <currency>ZAR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Namibia</name> + </NA> + <NC> + <currency>XPF</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>New Caledonia</name> + </NC> + <NE> + <currency>XOF</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Niger</name> + </NE> + <NG> + <currency>NGN</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Nigeria</name> + </NG> + <NI> + <currency>NIO</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AM</region> + <name>Nicaragua</name> + </NI> + <NL> + <currency>EUR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>EA</region> + <name>Netherlands, The</name> + </NL> + <NO> + <currency>NOK</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>EA</region> + <name>Norway</name> + </NO> + <NP> + <currency>NPR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Nepal</name> + </NP> + <NR> + <currency>AUD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Nauru, Republic Of</name> + </NR> + <NU> + <currency>NZD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Niue</name> + </NU> + <NZ> + <currency>NZD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>New Zealand</name> + </NZ> + <OM> + <currency>OMR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Oman</name> + </OM> + <PA> + <currency>PAB</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AM</region> + <name>Panama</name> + </PA> + <PE> + <currency>PEN</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AM</region> + <name>Peru</name> + </PE> + <PF> + <currency>XPF</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Tahiti</name> + </PF> + <PG> + <currency>PGK</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Papua New Guinea</name> + </PG> + <PH> + <currency>PHP</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Philippines, The</name> + </PH> + <PK> + <currency>PKR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Pakistan</name> + </PK> + <PL> + <currency>PLN</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>EA</region> + <name>Poland</name> + </PL> + <PR> + <currency>USD</currency> + <weight_unit>LB</weight_unit> + <measure_unit>IN</measure_unit> + <region>AM</region> + <name>Puerto Rico</name> + </PR> + <PT> + <currency>EUR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>EA</region> + <name>Portugal</name> + </PT> + <PW> + <currency>USD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Palau</name> + </PW> + <PY> + <currency>PYG</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AM</region> + <name>Paraguay</name> + </PY> + <QA> + <currency>QAR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Qatar</name> + </QA> + <RE> + <currency>EUR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Reunion, Island Of</name> + </RE> + <RO> + <currency>RON</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>EA</region> + <name>Romania</name> + </RO> + <RS> + <currency>RSD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Serbia, Republic of</name> + </RS> + <RU> + <currency>RUB</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Russian Federation, The</name> + </RU> + <RW> + <currency>RWF</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Rwanda</name> + </RW> + <SA> + <currency>SAR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Saudi Arabia</name> + </SA> + <SB> + <currency>SBD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Solomon Islands</name> + </SB> + <SC> + <currency>SCR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Seychelles</name> + </SC> + <SD> + <currency>SDG</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Sudan</name> + </SD> + <SE> + <currency>SEK</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>EA</region> + <name>Sweden</name> + </SE> + <SG> + <currency>SGD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Singapore</name> + </SG> + <SI> + <currency>EUR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>EA</region> + <name>Slovenia</name> + </SI> + <SK> + <currency>EUR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>EA</region> + <name>Slovakia</name> + </SK> + <SL> + <currency>SLL</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Sierra Leone</name> + </SL> + <SM> + <currency>EUR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>San Marino</name> + </SM> + <SN> + <currency>XOF</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Senegal</name> + </SN> + <SO> + <currency>SOS</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Somalia</name> + </SO> + <SR> + <currency>SRD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AM</region> + <name>Suriname</name> + </SR> + <ST> + <currency>STD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Sao Tome and Principe</name> + </ST> + <SV> + <currency>USD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AM</region> + <name>El Salvador</name> + </SV> + <SY> + <currency>SYP</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Syria</name> + </SY> + <SZ> + <currency>SZL</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Swaziland</name> + </SZ> + <TC> + <currency>USD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AM</region> + <name>Turks and Caicos Islands</name> + </TC> + <TD> + <currency>XAF</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Chad</name> + </TD> + <TG> + <currency>XOF</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Togo</name> + </TG> + <TH> + <currency>THB</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Thailand</name> + </TH> + <TJ> + <currency>TJS</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Tajikistan</name> + </TJ> + <TL> + <currency>USD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>East Timor</name> + </TL> + <TN> + <currency>TND</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Tunisia</name> + </TN> + <TO> + <currency>TOP</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Tonga</name> + </TO> + <TR> + <currency>TRY</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Turkey</name> + </TR> + <TT> + <currency>TTD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AM</region> + <name>Trinidad and Tobago</name> + </TT> + <TV> + <currency>AUD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Tuvalu</name> + </TV> + <TW> + <currency>TWD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Taiwan</name> + </TW> + <TZ> + <currency>TZS</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Tanzania</name> + </TZ> + <UA> + <currency>UAH</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Ukraine</name> + </UA> + <UG> + <currency>UGX</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Uganda</name> + </UG> + <US> + <currency>USD</currency> + <weight_unit>LB</weight_unit> + <measure_unit>IN</measure_unit> + <region>AM</region> + <name>United States Of America</name> + </US> + <UY> + <currency>UYU</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AM</region> + <name>Uruguay</name> + </UY> + <UZ> + <currency>UZS</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Uzbekistan</name> + </UZ> + <VC> + <currency>XCD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AM</region> + <name>St. Vincent</name> + </VC> + <VE> + <currency>VEF</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AM</region> + <name>Venezuela</name> + </VE> + <VG> + <currency>USD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AM</region> + <name>Virgin Islands (British)</name> + </VG> + <VI> + <currency>USD</currency> + <weight_unit>LB</weight_unit> + <measure_unit>IN</measure_unit> + <name>Virgin Islands (US)</name> + </VI> + <VN> + <currency>VND</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Vietnam</name> + </VN> + <VU> + <currency>VUV</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Vanuatu</name> + </VU> + <WS> + <currency>WST</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Samoa</name> + </WS> + <XB> + <currency>EUR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Bonaire</name> + </XB> + <XC> + <currency>EUR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AM</region> + <name>Curacao</name> + </XC> + <XE> + <currency>ANG</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>St. Eustatius</name> + </XE> + <XM> + <currency>EUR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AM</region> + <name>St. Maarten</name> + </XM> + <XN> + <currency>XCD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AM</region> + <name>Nevis</name> + </XN> + <XS> + <currency>SIS</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Somaliland, Rep of (North Somalia)</name> + </XS> + <XY> + <currency>ANG</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AM</region> + <name>St. Barthelemy</name> + </XY> + <YE> + <currency>YER</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>Yemen, Republic of</name> + </YE> + <YT> + <currency>EUR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Mayotte</name> + </YT> + <ZA> + <currency>ZAR</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <region>AP</region> + <name>South Africa</name> + </ZA> + <ZM> + <currency>ZMK</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Zambia</name> + </ZM> + <ZW> + <currency>ZWD</currency> + <weight_unit>KG</weight_unit> + <measure_unit>CM</measure_unit> + <name>Zimbabwe</name> + </ZW> +</countries> diff --git a/app/code/core/Mage/Usa/etc/system.xml b/app/code/core/Mage/Usa/etc/system.xml index 665f5484f75aa5ed5460edc227ff035ecaad0b63..f68cf10c97fdf5e7bbfef46582ba0a3ca1c1a659 100644 --- a/app/code/core/Mage/Usa/etc/system.xml +++ b/app/code/core/Mage/Usa/etc/system.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Usa - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> @@ -30,7 +30,7 @@ <carriers> <groups> <dhl translate="label" module="Mage_Usa"> - <label>DHL</label> + <label>DHL (Deprecated)</label> <frontend_type>text</frontend_type> <sort_order>130</sort_order> <show_in_default>1</show_in_default> @@ -215,7 +215,7 @@ <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> <show_in_store>0</show_in_store> - 0</sort_order> + </sort_order> <title translate="label"> <label>Title</label> <frontend_type>text</frontend_type> @@ -1146,8 +1146,287 @@ 0</sort_order> </fields> </usps> + <dhlint translate="label" module="Mage_Usa"> + <label>DHL</label> + <frontend_type>text</frontend_type> + <sort_order>140</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>1</show_in_store> + <fields> + <active translate="label"> + <label>Enabled for Checkout</label> + <frontend_type>select</frontend_type> + <source_model>Mage_Adminhtml_Model_System_Config_Source_Yesno</source_model> + <sort_order>10</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>0</show_in_store> + </active> + <gateway_url translate="label"> + <label>Gateway URL</label> + <frontend_type>text</frontend_type> + <sort_order>20</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>0</show_in_store> + </gateway_url> + <title translate="label"> + <label>Title</label> + <frontend_type>text</frontend_type> + <sort_order>20</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>1</show_in_store> + </title> + <id translate="label"> + <label>Access ID</label> + <frontend_type>obscure</frontend_type> + <backend_model>Mage_Adminhtml_Model_System_Config_Backend_Encrypted</backend_model> + <sort_order>50</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>0</show_in_store> + </id> + <password translate="label"> + <label>Password</label> + <frontend_type>obscure</frontend_type> + <backend_model>Mage_Adminhtml_Model_System_Config_Backend_Encrypted</backend_model> + <sort_order>60</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>0</show_in_store> + </password> + <account translate="label"> + <label>Account Number</label> + <frontend_type>text</frontend_type> + <sort_order>70</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>0</show_in_store> + </account> + <content_type translate="label"> + <label>Content Type</label> + <frontend_type>select</frontend_type> + <source_model>Mage_Usa_Model_Shipping_Carrier_Dhl_International_Source_Contenttype</source_model> + <sort_order>90</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>0</show_in_store> + </content_type> + <handling_type translate="label"> + <label>Calculate Handling Fee</label> + <frontend_type>select</frontend_type> + <source_model>Mage_Shipping_Model_Source_HandlingType</source_model> + <sort_order>100</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>0</show_in_store> + </handling_type> + <handling_action translate="label comment"> + <label>Handling Applied</label> + <comment>"Per Order" allows single handling fee for entire order. "Per Package" allows individual handling fee for each package.</comment> + <frontend_type>select</frontend_type> + <source_model>Mage_Shipping_Model_Source_HandlingAction</source_model> + <sort_order>110</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>0</show_in_store> + </handling_action> + <handling_fee translate="label"> + <label>Handling Fee</label> + <frontend_type>text</frontend_type> + <sort_order>120</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>0</show_in_store> + </handling_fee> + <divide_order_weight translate="label comment"> + <label>Divide Order Weight</label> + <comment>Allows breaking total order weight into smaller pieces if it exeeds 70 kg to ensure accurate calculation of shipping charges.</comment> + <frontend_type>select</frontend_type> + <source_model>Mage_Adminhtml_Model_System_Config_Source_Yesno</source_model> + <sort_order>130</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>1</show_in_store> + </divide_order_weight> + <unit_of_measure translate="label"> + <label>Weight Unit</label> + <frontend_type>select</frontend_type> + <source_model>Mage_Usa_Model_Shipping_Carrier_Dhl_International_Source_Method_Unitofmeasure</source_model> + <frontend_model>Mage_Usa_Block_Adminhtml_Dhl_Unitofmeasure</frontend_model> + <sort_order>140</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>1</show_in_store> + </unit_of_measure> + <size translate="label"> + <label>Size</label> + <frontend_type>select</frontend_type> + <source_model>Mage_Usa_Model_Shipping_Carrier_Dhl_International_Source_Method_Size</source_model> + <sort_order>150</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>1</show_in_store> + </size> + <height translate="label"> + <label>Height</label> + <frontend_type>text</frontend_type> + <sort_order>151</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>1</show_in_store> + <depends><size>1</size></depends> + </height> + <depth translate="label"> + <label>Depth</label> + <frontend_type>text</frontend_type> + <sort_order>152</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>1</show_in_store> + <depends><size>1</size></depends> + </depth> + <width translate="label"> + <label>Width</label> + <frontend_type>text</frontend_type> + <sort_order>153</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>1</show_in_store> + <depends><size>1</size></depends> + </width> + <doc_methods translate="label"> + <label>Allowed Methods</label> + <frontend_type>multiselect</frontend_type> + <source_model>Mage_Usa_Model_Shipping_Carrier_Dhl_International_Source_Method_Doc</source_model> + <sort_order>170</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>0</show_in_store> + <depends><content_type>D</content_type></depends> + </doc_methods> + <nondoc_methods translate="label"> + <label>Allowed Methods</label> + <frontend_type>multiselect</frontend_type> + <source_model>Mage_Usa_Model_Shipping_Carrier_Dhl_International_Source_Method_Nondoc</source_model> + <sort_order>170</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>0</show_in_store> + <depends><content_type>N</content_type></depends> + </nondoc_methods> + <ready_time> + <label>Ready time</label> + <comment>Package ready time after order submission (in hours)</comment> + <frontend_type>text</frontend_type> + <sort_order>180</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>0</show_in_store> + </ready_time> + <specificerrmsg translate="label"> + <label>Displayed Error Message</label> + <frontend_type>textarea</frontend_type> + <sort_order>800</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>1</show_in_store> + </specificerrmsg> + <!-- + If the free_shipping_enable flag enable, the system will check free_shipping_subtotal to give free shipping + otherwise will use shopping cart price rule behaviour + --> + <free_method_doc translate="label"> + <label>Free Method</label> + <frontend_type>select</frontend_type> + <frontend_class>free-method</frontend_class> + <source_model>Mage_Usa_Model_Shipping_Carrier_Dhl_International_Source_Method_Freedoc</source_model> + <sort_order>1200</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>0</show_in_store> + <depends><content_type>D</content_type></depends> + </free_method_doc> + <free_method_nondoc translate="label"> + <label>Free Method</label> + <frontend_type>select</frontend_type> + <frontend_class>free-method</frontend_class> + <source_model>Mage_Usa_Model_Shipping_Carrier_Dhl_International_Source_Method_Freenondoc</source_model> + <sort_order>1200</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>0</show_in_store> + <depends><content_type>N</content_type></depends> + </free_method_nondoc> + <free_shipping_enable translate="label"> + <label>Free Shipping with Minimum Order Amount</label> + <frontend_type>select</frontend_type> + <source_model>Mage_Adminhtml_Model_System_Config_Source_Enabledisable</source_model> + <sort_order>1210</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>0</show_in_store> + </free_shipping_enable> + <free_shipping_subtotal translate="label"> + <label>Minimum Order Amount for Free Shipping</label> + <frontend_type>text</frontend_type> + <sort_order>1220</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>0</show_in_store> + </free_shipping_subtotal> + <sallowspecific translate="label"> + <label>Ship to Applicable Countries</label> + <frontend_type>select</frontend_type> + <sort_order>1900</sort_order> + <frontend_class>shipping-applicable-country</frontend_class> + <source_model>Mage_Adminhtml_Model_System_Config_Source_Shipping_Allspecificcountries</source_model> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>0</show_in_store> + </sallowspecific> + <specificcountry translate="label"> + <label>Ship to Specific Countries</label> + <frontend_type>multiselect</frontend_type> + <sort_order>1910</sort_order> + <source_model>Mage_Adminhtml_Model_System_Config_Source_Country</source_model> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>0</show_in_store> + <can_be_empty>1</can_be_empty> + </specificcountry> + <showmethod translate="label"> + <label>Show Method if Not Applicable</label> + <frontend_type>select</frontend_type> + <sort_order>1940</sort_order> + <frontend_class>shipping-skip-hide</frontend_class> + <source_model>Mage_Adminhtml_Model_System_Config_Source_Yesno</source_model> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>0</show_in_store> + </showmethod> + <sort_order translate="label"> + <label>Sort Order</label> + <frontend_type>text</frontend_type> + <sort_order>2000</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>0</show_in_store> + </sort_order> + <debug translate="label"> + <label>Debug</label> + <frontend_type>select</frontend_type> + <source_model>Mage_Adminhtml_Model_System_Config_Source_Yesno</source_model> + <sort_order>1950</sort_order> + <show_in_default>1</show_in_default> + <show_in_website>1</show_in_website> + <show_in_store>0</show_in_store> + </debug> + </fields> + </dhlint> </groups> </carriers> </sections> </config> - diff --git a/app/code/core/Mage/Usa/sql/usa_setup/install-1.6.0.0.php b/app/code/core/Mage/Usa/sql/usa_setup/install-1.6.0.0.php index 24fbca59caa494d037afdddf99d3187f4fbe0a80..a6724261fbb6357ba8d49b543212600db206d5b8 100644 --- a/app/code/core/Mage/Usa/sql/usa_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/Usa/sql/usa_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Usa - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Usa/sql/usa_setup/upgrade-1.6.0.0-1.6.0.1.php b/app/code/core/Mage/Usa/sql/usa_setup/upgrade-1.6.0.0-1.6.0.1.php index 7098a2df122a5e4a1b0d422f9be948f2b52dcbcb..1cb6e15e7438b00b9c7a310dc907bcd7b3b98af4 100644 --- a/app/code/core/Mage/Usa/sql/usa_setup/upgrade-1.6.0.0-1.6.0.1.php +++ b/app/code/core/Mage/Usa/sql/usa_setup/upgrade-1.6.0.0-1.6.0.1.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Usa - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Usa/view/adminhtml/dhl/logo.jpg b/app/code/core/Mage/Usa/view/adminhtml/dhl/logo.jpg new file mode 100644 index 0000000000000000000000000000000000000000..4f80976c6a2c636339812f9bb552e4b406d63d32 Binary files /dev/null and b/app/code/core/Mage/Usa/view/adminhtml/dhl/logo.jpg differ diff --git a/app/code/core/Mage/Usa/view/adminhtml/dhl/unitofmeasure.phtml b/app/code/core/Mage/Usa/view/adminhtml/dhl/unitofmeasure.phtml new file mode 100644 index 0000000000000000000000000000000000000000..e32ac281bd251d5f93492528345275fd1a3d8d6f --- /dev/null +++ b/app/code/core/Mage/Usa/view/adminhtml/dhl/unitofmeasure.phtml @@ -0,0 +1,53 @@ +<?php +/** + * Magento + * + * 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_AFL.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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Usa + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +?> +<?php +/** + * @var $this Mage_Usa_Block_Adminhtml_Dhl_Unitofmeasure + */ +?> +<script type="text/javascript"> + //<![CDATA[ + function changeDimensions() + { + var dimensionUnit = '(<?php echo $this->getInch(); ?>)'; + var dhlintUnitOfMeasureNote = '<?php echo $this->getDivideOrderWeightNoteLbp(); ?>'; + if ($("carriers_dhlint_unit_of_measure").value == "K") { + dimensionUnit = '(<?php echo $this->getCm(); ?>)'; + dhlintUnitOfMeasureNote = '<?php echo $this->getDivideOrderWeightNoteKg(); ?>'; + } + $$('[for="carriers_dhlint_height"]')[0].innerHTML = '<?php echo $this->getHeight(); ?> ' + dimensionUnit; + $$('[for="carriers_dhlint_depth"]')[0].innerHTML = '<?php echo $this->getDepth(); ?> ' + dimensionUnit; + $$('[for="carriers_dhlint_width"]')[0].innerHTML = '<?php echo $this->getWidth(); ?> ' + dimensionUnit; + + $('carriers_dhlint_divide_order_weight').next().down().innerHTML = dhlintUnitOfMeasureNote; + } + document.observe("dom:loaded", function() { + $("carriers_dhlint_unit_of_measure").observe("change", changeDimensions); + changeDimensions(); + }); + //]]> +</script> diff --git a/app/code/core/Mage/Weee/Block/Element/Weee/Tax.php b/app/code/core/Mage/Weee/Block/Element/Weee/Tax.php index a83d7b2484c9ca7d152576d29545bd087f5ef680..967d49d247b27b6341b3278ab2ddef81b39bac62 100644 --- a/app/code/core/Mage/Weee/Block/Element/Weee/Tax.php +++ b/app/code/core/Mage/Weee/Block/Element/Weee/Tax.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Weee - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Weee/Block/Renderer/Weee/Tax.php b/app/code/core/Mage/Weee/Block/Renderer/Weee/Tax.php index 08e2dc7a15edbed0dc497eaf3eadbfecafdd0f9f..a4559043cc6cb89b4c4ddc0c0c7cea537f92bd2a 100644 --- a/app/code/core/Mage/Weee/Block/Renderer/Weee/Tax.php +++ b/app/code/core/Mage/Weee/Block/Renderer/Weee/Tax.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Weee - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Weee/Helper/Data.php b/app/code/core/Mage/Weee/Helper/Data.php index 9e29af583c25b86de1f6adf2363a9d5c9c133f8a..d334636a43ed1a7f05e19bd84f7584998f723088 100644 --- a/app/code/core/Mage/Weee/Helper/Data.php +++ b/app/code/core/Mage/Weee/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Weee - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Weee/Model/Attribute/Backend/Weee/Tax.php b/app/code/core/Mage/Weee/Model/Attribute/Backend/Weee/Tax.php index c58d79da585654f0be1fc82470e1ab65010ab2d6..54185c68fd0014d7b0fbe28e9796d5e1f16ed0f6 100644 --- a/app/code/core/Mage/Weee/Model/Attribute/Backend/Weee/Tax.php +++ b/app/code/core/Mage/Weee/Model/Attribute/Backend/Weee/Tax.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Weee - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Weee/Model/Config/Source/Display.php b/app/code/core/Mage/Weee/Model/Config/Source/Display.php index 87719766cc940216047c8f4f162386fcc5f00d07..7d5d01a43744586302b7fa1463710224b89ee8a2 100644 --- a/app/code/core/Mage/Weee/Model/Config/Source/Display.php +++ b/app/code/core/Mage/Weee/Model/Config/Source/Display.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Weee - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Weee_Model_Config_Source_Display diff --git a/app/code/core/Mage/Weee/Model/Observer.php b/app/code/core/Mage/Weee/Model/Observer.php index 90a0bfe028a6d3ef6c72648d2cd250991318b310..c3f7d09a3fc16bd61cd1f7de76f7c119dd53eede 100644 --- a/app/code/core/Mage/Weee/Model/Observer.php +++ b/app/code/core/Mage/Weee/Model/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Weee - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -200,15 +200,18 @@ class Mage_Weee_Model_Observer extends Mage_Core_Model_Abstract if (!$_product) { return $this; } - if (!Mage::helper('Mage_Weee_Helper_Data')->typeOfDisplay($_product, array(0, 1, 4))) { - return $this; - } + $amount = Mage::helper('Mage_Weee_Helper_Data')->getAmount($_product); $origAmount = Mage::helper('Mage_Weee_Helper_Data')->getOriginalAmount($_product); $options['oldPlusDisposition'] = $origAmount; $options['plusDisposition'] = $amount; + // Exclude Weee amount from excluding tax amount + if (!$weeeHelper->typeOfDisplay($_product, array(0, 1, 4))) { + $options['exclDisposition'] = true; + } + $response->setAdditionalOptions($options); return $this; @@ -222,7 +225,9 @@ class Mage_Weee_Model_Observer extends Mage_Core_Model_Abstract */ public function updateBundleProductOptions(Varien_Event_Observer $observer) { - if (!Mage::helper('Mage_Weee_Helper_Data')->isEnabled()) { + /* @var $weeeHelper Mage_Weee_Helper_Data */ + $weeeHelper = Mage::helper('Mage_Weee_Helper_Data'); + if (!$weeeHelper->isEnabled()) { return $this; } @@ -231,20 +236,25 @@ class Mage_Weee_Model_Observer extends Mage_Core_Model_Abstract $options = $response->getAdditionalOptions(); $_product = Mage::registry('current_product'); - if (!Mage::helper('Mage_Weee_Helper_Data')->typeOfDisplay($_product, array(0, 1, 4))) { - return $this; - } + $typeDynamic = Mage_Bundle_Block_Adminhtml_Catalog_Product_Edit_Tab_Attributes_Extend::DYNAMIC; if (!$_product || $_product->getPriceType() != $typeDynamic) { return $this; } - $amount = Mage::helper('Mage_Weee_Helper_Data')->getAmount($selection); - $options['plusDisposition'] = $amount; + $amount = $weeeHelper->getAmount($selection); + $attributes = $weeeHelper->getProductWeeeAttributes($_product, null, null, null, $weeeHelper->isTaxable()); + $amountInclTaxes = $weeeHelper->getAmountInclTaxes($attributes); + $taxes = $amountInclTaxes - $amount; + $options['plusDisposition'] = $amount; + $options['plusDispositionTax'] = ($taxes < 0) ? 0 : $taxes; + // Exclude Weee amount from excluding tax amount + if (!$weeeHelper->typeOfDisplay($_product, array(0, 1, 4))) { + $options['exclDisposition'] = true; + } $response->setAdditionalOptions($options); return $this; } } - diff --git a/app/code/core/Mage/Weee/Model/Resource/Attribute/Backend/Weee/Tax.php b/app/code/core/Mage/Weee/Model/Resource/Attribute/Backend/Weee/Tax.php index c6e86f91c1f364abc735de3a2ec7681b56550238..81bd2d4833a6cd3d0103f9021870b1153c130a3b 100755 --- a/app/code/core/Mage/Weee/Model/Resource/Attribute/Backend/Weee/Tax.php +++ b/app/code/core/Mage/Weee/Model/Resource/Attribute/Backend/Weee/Tax.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Weee - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Weee/Model/Resource/Setup.php b/app/code/core/Mage/Weee/Model/Resource/Setup.php index d736d91468e39f8ef545452d5ebaeb1435435b34..15738964c17e12fe18d751439e513cd1f845fe3e 100755 --- a/app/code/core/Mage/Weee/Model/Resource/Setup.php +++ b/app/code/core/Mage/Weee/Model/Resource/Setup.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Weee - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Weee/Model/Resource/Tax.php b/app/code/core/Mage/Weee/Model/Resource/Tax.php index d438284a8e551baa3f29db1f0cbc90a791606629..ea2f6b35d7e65d99977a93e499ed6b9a5d568f59 100755 --- a/app/code/core/Mage/Weee/Model/Resource/Tax.php +++ b/app/code/core/Mage/Weee/Model/Resource/Tax.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Weee - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Weee/Model/Tax.php b/app/code/core/Mage/Weee/Model/Tax.php index 78456a7d230517fea185a43a960402daba88cacd..4e9ca0a8f59ce0959616b82bde201c5eabd33321 100644 --- a/app/code/core/Mage/Weee/Model/Tax.php +++ b/app/code/core/Mage/Weee/Model/Tax.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Weee - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -163,18 +163,17 @@ class Mage_Weee_Model_Tax extends Mage_Core_Model_Abstract $taxAmount = $amount = 0; $amount = $value; - /** - * We can't use FPT imcluding/excluding tax - */ -// if ($calculateTax && Mage::helper('Mage_Weee_Helper_Data')->isTaxable($store)) { -// $defaultPercent = Mage::getModel('Mage_Tax_Model_Calculation') -// ->getRate($defaultRateRequest -// ->setProductClassId($product->getTaxClassId())); -// $currentPercent = $product->getTaxPercent(); -// -// $taxAmount = Mage::app()->getStore()->roundPrice($value/(100+$defaultPercent)*$currentPercent); -// $amount = $value - $taxAmount; -// } + if ($calculateTax && Mage::helper('Mage_Weee_Helper_Data')->isTaxable($store)) { + $defaultPercent = Mage::getModel('Mage_Tax_Model_Calculation') + ->getRate($defaultRateRequest + ->setProductClassId($product->getTaxClassId())); + $currentPercent = $product->getTaxPercent(); + if (Mage::helper('Mage_Tax_Helper_Data')->priceIncludesTax($store)) { + $taxAmount = Mage::app()->getStore()->roundPrice($value/(100+$defaultPercent)*$currentPercent); + } else { + $taxAmount = Mage::app()->getStore()->roundPrice($value*$defaultPercent/100); + } + } $one = new Varien_Object(); $one->setName(Mage::helper('Mage_Catalog_Helper_Data')->__($attribute->getFrontend()->getLabel())) diff --git a/app/code/core/Mage/Weee/Model/Total/Creditmemo/Weee.php b/app/code/core/Mage/Weee/Model/Total/Creditmemo/Weee.php index 68a681be72460d2b738a26c73a7858ab9fb3f2ce..87f7574a2755d1492956edd14d41886374cfde43 100644 --- a/app/code/core/Mage/Weee/Model/Total/Creditmemo/Weee.php +++ b/app/code/core/Mage/Weee/Model/Total/Creditmemo/Weee.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Weee - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Weee/Model/Total/Invoice/Weee.php b/app/code/core/Mage/Weee/Model/Total/Invoice/Weee.php index 9f7e07a5464dea7ccf6c085ed3b2a3e87565cf74..00124bcc8279b545670e70c2b9282d24ef59329a 100644 --- a/app/code/core/Mage/Weee/Model/Total/Invoice/Weee.php +++ b/app/code/core/Mage/Weee/Model/Total/Invoice/Weee.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Weee - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Weee/Model/Total/Quote/Nominal/Weee.php b/app/code/core/Mage/Weee/Model/Total/Quote/Nominal/Weee.php index bd99fbea00bc5e69e6e40929665cef667616bbbd..272a11074d73c3436fe6c70b78eb4f36ea33bfa4 100644 --- a/app/code/core/Mage/Weee/Model/Total/Quote/Nominal/Weee.php +++ b/app/code/core/Mage/Weee/Model/Total/Quote/Nominal/Weee.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Weee - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Weee/Model/Total/Quote/Weee.php b/app/code/core/Mage/Weee/Model/Total/Quote/Weee.php index f9737c33199949f6c4e526ce59208ba472b40661..70fac9d4601386a4ed0147774e6ba5e3e1e3eade 100644 --- a/app/code/core/Mage/Weee/Model/Total/Quote/Weee.php +++ b/app/code/core/Mage/Weee/Model/Total/Quote/Weee.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Weee - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Weee/etc/config.xml b/app/code/core/Mage/Weee/etc/config.xml index 476440bc5d89cdc20559c3fbf6c4f71e898aa497..29be61b6ef4dc0e9323416b5e4d6c28112ebf1f5 100644 --- a/app/code/core/Mage/Weee/etc/config.xml +++ b/app/code/core/Mage/Weee/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Weee - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Weee/etc/fieldset.xml b/app/code/core/Mage/Weee/etc/fieldset.xml index 07ffd225d3b712074a06099b35592b26ea3d28ac..70abfb0784dc0c7ba15b1544dfdc843dc207ff36 100644 --- a/app/code/core/Mage/Weee/etc/fieldset.xml +++ b/app/code/core/Mage/Weee/etc/fieldset.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Weee - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Weee/etc/system.xml b/app/code/core/Mage/Weee/etc/system.xml index 0316bd947bc0c6a4aeb75e609e02b97d21ed6d49..c8f53007e1d51362bf32fac85e826e49b92aa93d 100644 --- a/app/code/core/Mage/Weee/etc/system.xml +++ b/app/code/core/Mage/Weee/etc/system.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Weee - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Weee/sql/weee_setup/install-1.6.0.0.php b/app/code/core/Mage/Weee/sql/weee_setup/install-1.6.0.0.php index 78ae551b65cea90c1875e04dc66f85eaecad3038..a244d6c26ef0b203238a80168f320ee861cedd6a 100644 --- a/app/code/core/Mage/Weee/sql/weee_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/Weee/sql/weee_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Weee - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Weee/view/adminhtml/renderer/tax.phtml b/app/code/core/Mage/Weee/view/adminhtml/renderer/tax.phtml index b66a3891abfde7d552a1d51eaa1c242882e0ded5..70e777c05da72ec16e2b788768b116444220e240 100644 --- a/app/code/core/Mage/Weee/view/adminhtml/renderer/tax.phtml +++ b/app/code/core/Mage/Weee/view/adminhtml/renderer/tax.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -69,7 +69,7 @@ </td> <td class="last"> <input type="hidden" name="<?php echo $_htmlName ?>[__index__][delete]" class="delete" disabled="no-template" value="" id="#{prefix}_weee_tax_row___index___delete" /> - <button title="Delete WEEE Tax" class="scalable delete icon-btn delete-product-option" onclick="weeeTaxControl.deleteItem('<?php echo $_htmlId ?>', event);return false"><span>Delete</span></button> + <button title="Delete WEEE Tax" class="scalable delete icon-btn delete-product-option" onclick="weeeTaxControl.deleteItem('<?php echo $_htmlId ?>', event);return false"><span><span><span>Delete</span></span></span></button> </td> </tr> </thead> diff --git a/app/code/core/Mage/Weee/view/frontend/layout.xml b/app/code/core/Mage/Weee/view/frontend/layout.xml index 66670252f092bc3e38f8cd83e75f4177e2bb3f6d..f2421dbe3d2be68ec8d6346a86346a16d859af76 100644 --- a/app/code/core/Mage/Weee/view/frontend/layout.xml +++ b/app/code/core/Mage/Weee/view/frontend/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/Weee/view/frontend/tax_toggle.js b/app/code/core/Mage/Weee/view/frontend/tax_toggle.js index 8de29e41ba092c5b495572a3e1e28e0354e8d962..55646c4eeae71245a97b73775017e1afe38b5ef2 100644 --- a/app/code/core/Mage/Weee/view/frontend/tax_toggle.js +++ b/app/code/core/Mage/Weee/view/frontend/tax_toggle.js @@ -19,7 +19,7 @@ * * @category Varien * @package js - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/Widget/Block/Adminhtml/Widget.php b/app/code/core/Mage/Widget/Block/Adminhtml/Widget.php index cfd6883374d94940d8673ad85d5f256daf2cec2d..a38f760aafa738b106c34155593f9fcb291d433b 100644 --- a/app/code/core/Mage/Widget/Block/Adminhtml/Widget.php +++ b/app/code/core/Mage/Widget/Block/Adminhtml/Widget.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Widget - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -40,7 +40,7 @@ class Mage_Widget_Block_Adminhtml_Widget extends Mage_Adminhtml_Block_Widget_For $this->_blockGroup = 'Mage_Widget'; $this->_controller = 'adminhtml'; $this->_mode = 'widget'; - $this->_headerText = 'Widget Insertion'; + $this->_headerText = $this->helper('Mage_Widget_Helper_Data')->__('Widget Insertion'); $this->removeButton('reset'); $this->removeButton('back'); @@ -49,7 +49,8 @@ class Mage_Widget_Block_Adminhtml_Widget extends Mage_Adminhtml_Block_Widget_For $this->_updateButton('save', 'id', 'insert_button'); $this->_updateButton('save', 'onclick', 'wWidget.insertWidget()'); - $this->_formScripts[] = 'wWidget = new WysiwygWidget.Widget("widget_options_form", "select_widget_type", "widget_options", "' - . $this->getUrl('*/*/loadOptions').'", "' . $this->getRequest()->getParam('widget_target_id') . '");'; + $this->_formScripts[] = 'wWidget = new WysiwygWidget.Widget(' + . '"widget_options_form", "select_widget_type", "widget_options", "' + . $this->getUrl('*/*/loadOptions') .'", "' . $this->getRequest()->getParam('widget_target_id') . '");'; } } diff --git a/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Chooser.php b/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Chooser.php index 1468f81924b0a847815802b980936e91a6310977..7a07bdaa1d69f51eea3a44c9035d11a40c6211ca 100644 --- a/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Chooser.php +++ b/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Chooser.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Widget - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -180,13 +180,26 @@ class Mage_Widget_Block_Adminhtml_Widget_Chooser extends Mage_Adminhtml_Block_Te <label class="widget-option-label" id="' . $chooserId . 'label">' . ($this->getLabel() ? $this->getLabel() : Mage::helper('Mage_Widget_Helper_Data')->__('Not Selected')) . '</label> <div id="' . $chooserId . 'advice-container" class="hidden"></div> - <script type="text/javascript"> - ' . $chooserId . ' = new WysiwygWidget.chooser("' . $chooserId . '", "' . $this->getSourceUrl() . '", ' - . $configJson . '); - if ($("'.$chooserId.'value")) { - $("'.$chooserId.'value").advaiceContainer = "'.$chooserId.'advice-container"; - } - </script> + <script type="text/javascript">//<![CDATA[ + (function() { + var fun_'. $chooserId .' = function() { + window.' . $chooserId . ' = new WysiwygWidget.chooser( + "' . $chooserId . '", + "' . $this->getSourceUrl() . '", + ' . $configJson . ' + ); + }; + if (document.loaded) { //allow load over ajax + $("'.$chooserId.'value").advaiceContainer = "'.$chooserId.'advice-container"; + fun_'. $chooserId .'.call(); + } else { + document.observe("dom:loaded", function () { + $("'.$chooserId.'value").advaiceContainer = "'.$chooserId.'advice-container"; + fun_'. $chooserId .'.call(); + }); + } + })(); + //]]></script> '; } } diff --git a/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Form.php b/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Form.php index 454bafbc0764301717981984ba098951604aa000..1ff5053134b1b1713224a82af3c036f0f6b371b9 100644 --- a/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Form.php +++ b/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Widget - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance.php b/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance.php index 21f41fc392bc08693aa18f0855afc200c1d0905a..9f1abd41ec16dc6ee8e8a7252c557b17adab0bdc 100644 --- a/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance.php +++ b/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Widget - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit.php b/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit.php index 2d2966b9debcd0856fb6b3af3dafc98521f4ee8c..951092b6ea4d9c7307d1b373bf787c72f1fb9373 100644 --- a/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit.php +++ b/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Widget - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/Block.php b/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/Block.php index 40ae3e4df70732578b3d891c95b82c3f30bd5af8..d51e456c01fed15eedd7e4efc595c4e969c6c60b 100644 --- a/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/Block.php +++ b/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/Block.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Widget - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -66,7 +66,7 @@ class Mage_Widget_Block_Adminhtml_Widget_Instance_Edit_Chooser_Block */ public function addAllowedBlock($block) { - $this->_allowedBlocks[] = $type; + $this->_allowedBlocks[] = $block; return $this; } @@ -92,7 +92,7 @@ class Mage_Widget_Block_Adminhtml_Widget_Instance_Edit_Chooser_Block if (is_string($layoutHandle)) { $layoutHandle = explode(',', $layoutHandle); } - $this->_layoutHandle = array_merge(array('default'), $layoutHandle); + $this->_layoutHandle = array_merge(array('default'), (array)$layoutHandle); return $this; } @@ -155,7 +155,8 @@ class Mage_Widget_Block_Adminhtml_Widget_Instance_Edit_Chooser_Block $selectBlock = $this->getLayout()->createBlock('Mage_Core_Block_Html_Select') ->setName('block') ->setClass('required-entry select') - ->setExtraParams('onchange="WidgetInstance.loadSelectBoxByType(\'block_template\', this.up(\'div.group_container\'), this.value)"') + ->setExtraParams('onchange="WidgetInstance.loadSelectBoxByType(\'block_template\',' + .' this.up(\'div.group_container\'), this.value)"') ->setOptions($this->getBlocks()) ->setValue($this->getSelected()); return parent::_toHtml().$selectBlock->toHtml(); diff --git a/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/Layout.php b/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/Layout.php index 3b04b3261713e836e82acceb9e565ca1004357c7..d28fe5d92d2d0d44d6360d33be51150b9bd0ceb1 100644 --- a/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/Layout.php +++ b/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/Layout.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Widget - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/Template.php b/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/Template.php index 1067b6597befe82c9306a96832076cb3f15796d1..ee6ed0b3730b68443bd0c286fc54c7dcae3d0e8e 100644 --- a/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/Template.php +++ b/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/Template.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Widget - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Form.php b/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Form.php index dad034723344ebf882930feae4500b831ee07ddc..272c81afd4d0300f59e11656b060dcd0e08a2819 100644 --- a/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Form.php +++ b/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Widget - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/Main.php b/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/Main.php index 37ede86133535630199ecb21d86cc25ae0f17190..23cbd24608a1dd475fba69a9caf924e9f98df71f 100644 --- a/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/Main.php +++ b/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/Main.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Widget - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/Main/Layout.php b/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/Main/Layout.php index 6ffd0393d028b3c96207b384cbeb2c27699b24c7..5776a2b03b78b65a448b450eb8aa1275f3cb7070 100644 --- a/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/Main/Layout.php +++ b/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/Main/Layout.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Widget - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/Properties.php b/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/Properties.php index 0631ec0e134469e285d60be3da0599fd66201c6a..bb8446c9f3c3ea7ca1c0df81b06d17cf2fa3ddac 100644 --- a/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/Properties.php +++ b/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/Properties.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Widget - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/Settings.php b/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/Settings.php index a42357df1d5d6155624e7860b214c6997b904e6d..c6cf1d79313f8c47a637a112d941c53fc4c6a201 100644 --- a/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/Settings.php +++ b/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/Settings.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Widget - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Tabs.php b/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Tabs.php index 2a6376150062cb8dc0550af24b9211e152d9f6cf..a99365770aeb812915f4fedf398cf05e87b7f5fa 100644 --- a/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Tabs.php +++ b/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Tabs.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Widget - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Grid.php b/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Grid.php index 7b024e65f9c600983f78bde266b5e130c1099b04..84833cb76ef94f593ca150aeaf663a2263257275 100644 --- a/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Grid.php +++ b/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Widget - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Options.php b/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Options.php index 3bd05446d4494bbc201db42df342ed2c74073e3a..b24e4e03e848da16fff51531d8f8c4a42b117a77 100644 --- a/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Options.php +++ b/app/code/core/Mage/Widget/Block/Adminhtml/Widget/Options.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Widget - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Widget/Block/Interface.php b/app/code/core/Mage/Widget/Block/Interface.php index e53e5cb17330be891a604988fbac1b509593a600..caa8ce6375c16c992efe5b6c74017bf280c17a97 100644 --- a/app/code/core/Mage/Widget/Block/Interface.php +++ b/app/code/core/Mage/Widget/Block/Interface.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Widget - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Widget/Helper/Data.php b/app/code/core/Mage/Widget/Helper/Data.php index b1e121a2512a254d002916ed697c725a208535ea..923988b5dd2958bac8d2fa7cb6f3e594745465c6 100644 --- a/app/code/core/Mage/Widget/Helper/Data.php +++ b/app/code/core/Mage/Widget/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Widget - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Widget/Model/Observer.php b/app/code/core/Mage/Widget/Model/Observer.php index 16aaf7f31fc03d296f0834978c871388cb268fc7..087cde685cef164575e385a0e7a1357bc3e610f0 100644 --- a/app/code/core/Mage/Widget/Model/Observer.php +++ b/app/code/core/Mage/Widget/Model/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Widget - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Widget/Model/Resource/Widget.php b/app/code/core/Mage/Widget/Model/Resource/Widget.php index 30021bf73dcdd5ed93fbe94875cc85aa7b5b3948..bdc15b844a9a7f27d45b1cafa7967748196fc837 100755 --- a/app/code/core/Mage/Widget/Model/Resource/Widget.php +++ b/app/code/core/Mage/Widget/Model/Resource/Widget.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Widget - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Widget/Model/Resource/Widget/Instance.php b/app/code/core/Mage/Widget/Model/Resource/Widget/Instance.php index fe5eaf2545414f22b7ee6448b8820b8069639164..7349b13685fd0b0976b3a695f69b2acb24eb4824 100755 --- a/app/code/core/Mage/Widget/Model/Resource/Widget/Instance.php +++ b/app/code/core/Mage/Widget/Model/Resource/Widget/Instance.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Widget - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Widget/Model/Resource/Widget/Instance/Collection.php b/app/code/core/Mage/Widget/Model/Resource/Widget/Instance/Collection.php index 2309187b1ab225e384205a320c6fcd5bc82ca95d..a7645e5a71eb98971217f0df52c7dcb50371aac3 100755 --- a/app/code/core/Mage/Widget/Model/Resource/Widget/Instance/Collection.php +++ b/app/code/core/Mage/Widget/Model/Resource/Widget/Instance/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Widget - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -34,6 +34,14 @@ */ class Mage_Widget_Model_Resource_Widget_Instance_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract { + /** + * Fields map for corellation names & real selected fields + * + * @var array + */ + protected $_map = array('fields' => array('type' => 'instance_type')); + + /** * Constructor * diff --git a/app/code/core/Mage/Widget/Model/Template/Filter.php b/app/code/core/Mage/Widget/Model/Template/Filter.php index 4793ea368e9aa2111d0df012f759a2f8d2be05b8..7cfb6a8989a18e052918145fe4dab8677a33c59a 100644 --- a/app/code/core/Mage/Widget/Model/Template/Filter.php +++ b/app/code/core/Mage/Widget/Model/Template/Filter.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Widget - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Widget/Model/Widget.php b/app/code/core/Mage/Widget/Model/Widget.php index 23adb8394ed07487058621c1f77c50f0db93a751..6c9a7dee1ced71d3e514b1ce4e94ab4b6b79d26d 100644 --- a/app/code/core/Mage/Widget/Model/Widget.php +++ b/app/code/core/Mage/Widget/Model/Widget.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Widget - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Widget/Model/Widget/Config.php b/app/code/core/Mage/Widget/Model/Widget/Config.php index 0bbcccbbebc444bcb021262967013cd535121abb..eba3297e9ca25ac248eca97f6420419f1ca70717 100644 --- a/app/code/core/Mage/Widget/Model/Widget/Config.php +++ b/app/code/core/Mage/Widget/Model/Widget/Config.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Widget - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Widget/Model/Widget/Instance.php b/app/code/core/Mage/Widget/Model/Widget/Instance.php index 772cfa84b21989f49eb9f1f201af4eb48bf824d9..2ae670d969a35327590b5fc19d2c3cb354a0ce20 100644 --- a/app/code/core/Mage/Widget/Model/Widget/Instance.php +++ b/app/code/core/Mage/Widget/Model/Widget/Instance.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Widget - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -318,7 +318,7 @@ class Mage_Widget_Model_Widget_Instance extends Mage_Core_Model_Abstract } else if (is_null($this->getData('widget_parameters'))) { return array(); } - return $this->getData('widget_parameters'); + return (is_array($this->getData('widget_parameters'))) ? $this->getData('widget_parameters') : array(); } /** diff --git a/app/code/core/Mage/Widget/controllers/Adminhtml/Widget/InstanceController.php b/app/code/core/Mage/Widget/controllers/Adminhtml/Widget/InstanceController.php index 3f3a0e04eeee1a3318b6c0231f106401032fa689..b1aea553f47afd64d91ea0679474e0b1027fc372 100644 --- a/app/code/core/Mage/Widget/controllers/Adminhtml/Widget/InstanceController.php +++ b/app/code/core/Mage/Widget/controllers/Adminhtml/Widget/InstanceController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Widget - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -62,7 +62,7 @@ class Mage_Widget_Adminhtml_Widget_InstanceController extends Mage_Adminhtml_Con /** * Init widget instance object and set it to registry * - * @return age_Widget_Model_Widget_Instance|boolean + * @return Mage_Widget_Model_Widget_Instance|boolean */ protected function _initWidgetInstance() { @@ -127,6 +127,17 @@ class Mage_Widget_Adminhtml_Widget_InstanceController extends Mage_Adminhtml_Con $this->renderLayout(); } + /** + * Set body to response + * + * @param string $body + */ + private function setBody($body) + { + Mage::getSingleton('Mage_Core_Model_Translate_Inline')->processResponseBody($body); + $this->getResponse()->setBody($body); + } + /** * Validate action * @@ -143,7 +154,7 @@ class Mage_Widget_Adminhtml_Widget_InstanceController extends Mage_Adminhtml_Con $response->setError(true); $response->setMessage($this->getLayout()->getMessagesBlock()->getGroupedHtml()); } - $this->getResponse()->setBody($response->toJson()); + $this->setBody($response->toJson()); } /** @@ -221,7 +232,7 @@ class Mage_Widget_Adminhtml_Widget_InstanceController extends Mage_Adminhtml_Con ->setId(Mage::helper('Mage_Core_Helper_Data')->uniqHash('categories')) ->setIsAnchorOnly($isAnchorOnly) ->setSelectedCategories(explode(',', $selected)); - $this->getResponse()->setBody($chooser->toHtml()); + $this->setBody($chooser->toHtml()); } /** @@ -241,7 +252,7 @@ class Mage_Widget_Adminhtml_Widget_InstanceController extends Mage_Adminhtml_Con /* @var $serializer Mage_Adminhtml_Block_Widget_Grid_Serializer */ $serializer = $this->getLayout()->createBlock('Mage_Adminhtml_Block_Widget_Grid_Serializer'); $serializer->initSerializerBlock($chooser, 'getSelectedProducts', 'selected_products', 'selected_products'); - $this->getResponse()->setBody($chooser->toHtml().$serializer->toHtml()); + $this->setBody($chooser->toHtml().$serializer->toHtml()); } /** @@ -262,7 +273,7 @@ class Mage_Widget_Adminhtml_Widget_InstanceController extends Mage_Adminhtml_Con ->setLayoutHandle($layout) ->setSelected($selected) ->setAllowedBlocks($widgetInstance->getWidgetSupportedBlocks()); - $this->getResponse()->setBody($blocksChooser->toHtml()); + $this->setBody($blocksChooser->toHtml()); } /** @@ -279,7 +290,7 @@ class Mage_Widget_Adminhtml_Widget_InstanceController extends Mage_Adminhtml_Con ->createBlock('Mage_Widget_Block_Adminhtml_Widget_Instance_Edit_Chooser_Template') ->setSelected($selected) ->setWidgetTemplates($widgetInstance->getWidgetSupportedTemplatesByBlock($block)); - $this->getResponse()->setBody($templateChooser->toHtml()); + $this->setBody($templateChooser->toHtml()); } /** diff --git a/app/code/core/Mage/Widget/controllers/Adminhtml/WidgetController.php b/app/code/core/Mage/Widget/controllers/Adminhtml/WidgetController.php index 04c392afbb2c0146b7367fb5e9e7e126f334067c..7923344246ba623dbe6ae3510c2c60fee8fc4f91 100644 --- a/app/code/core/Mage/Widget/controllers/Adminhtml/WidgetController.php +++ b/app/code/core/Mage/Widget/controllers/Adminhtml/WidgetController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Widget - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Widget/etc/adminhtml.xml b/app/code/core/Mage/Widget/etc/adminhtml.xml index 0e3930d374667858b6089b5b6dbdd3dd655561f7..fec21459c7dbc2bac158a2bc5e73cf82390adc2d 100644 --- a/app/code/core/Mage/Widget/etc/adminhtml.xml +++ b/app/code/core/Mage/Widget/etc/adminhtml.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Widget - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Widget/etc/config.xml b/app/code/core/Mage/Widget/etc/config.xml index ff6aa6ead278296a6e324651f1a7909438bc3c44..71efcaa0a55d59b08bef1e46f11ce9b21e48733b 100644 --- a/app/code/core/Mage/Widget/etc/config.xml +++ b/app/code/core/Mage/Widget/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Widget - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Widget/etc/translater.xml b/app/code/core/Mage/Widget/etc/translater.xml new file mode 100644 index 0000000000000000000000000000000000000000..ca1dc019f9788cc70b38462b969f22a1d55885bc --- /dev/null +++ b/app/code/core/Mage/Widget/etc/translater.xml @@ -0,0 +1,34 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * 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_AFL.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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Widget + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<translater> + <!-- widget.js --> + <widget-ui-insert translate="message" module="Mage_Widget"> + <message>Insert Widget...</message> + </widget-ui-insert> + <!-- end widget.js --> +</translater> diff --git a/app/code/core/Mage/Widget/sql/widget_setup/install-1.6.0.0.php b/app/code/core/Mage/Widget/sql/widget_setup/install-1.6.0.0.php index 5868c78bc56040fb408ef9d58c2de655130c43ba..82a4ab8859afec346791727e09468890817df8a8 100644 --- a/app/code/core/Mage/Widget/sql/widget_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/Widget/sql/widget_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Widget - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Widget/view/adminhtml/instance/edit/layout.phtml b/app/code/core/Mage/Widget/view/adminhtml/instance/edit/layout.phtml index 8d9f7512ba0c36a1b8a479a4087bca356f4dc813..93c2f29eda3fdc903cd9855d2280e680e7f14f84 100644 --- a/app/code/core/Mage/Widget/view/adminhtml/instance/edit/layout.phtml +++ b/app/code/core/Mage/Widget/view/adminhtml/instance/edit/layout.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -41,7 +41,7 @@ var pageGroupTemplate = '<div class="options-box page_group_container" id="page_ '<div class="option-title">'+ '<?php echo $this->getRemoveLayoutButtonHtml() ?>'+ '<label for="widget_instance[{{id}}][page_group]">Display On <span class="required">*</span></label>'+ - '<?php echo $this->getDisplayOnSelectHtml() ?>'+ + '<?php echo $this->getDisplayOnSelectHtml(); ?>'+ '</div>'+ <?php foreach ($this->getDisplayOnContainers() as $container): ?> '<div class="no-display <?php echo $container['code'] ?> group_container" id="<?php echo $container['name'] ?>_{{id}}">'+ @@ -87,7 +87,7 @@ var pageGroupTemplate = '<div class="options-box page_group_container" id="page_ '<input type="hidden" class="product_type_id" name="widget_instance[{{id}}][<?php echo $container['name'] ?>][product_type_id]" value="<?php echo $container['product_type_id'] ?>" />'+ '<p>' + '<input type="text" class="input-text entities" name="widget_instance[{{id}}][<?php echo $container['name'] ?>][entities]" value="{{<?php echo $container['name'] ?>_entities}}" readonly="readonly" /> ' + - '<a class="widget-option-chooser" href="javascript:void(0)" onclick="WidgetInstance.displayEntityChooser(\'<?php echo $container['code'] ?>\', \'<?php echo $container['name'] ?>_ids_{{id}}\')" title="<?php echo $this->helper('Mage_Core_Helper_Data')->jsQuoteEscape(Mage::helper('Mage_Widget_Helper_Data')->__('Open Chooser')); ?>">' + + '<a class="widget-option-chooser" href="javascript:void(0)" onclick="WidgetInstance.displayEntityChooser(\'<?php echo $container['code'] ?>\', \'<?php echo $container['name'] ?>_ids_{{id}}\')" title="<?php echo $this->helper('Mage_Core_Helper_Data')->jsQuoteEscape(Mage::helper('Mage_Widget_Helper_Data')->__('Open Chooser')) ?>">' + '<img src="<?php echo Mage::getDesign()->getSkinUrl('images/rule_chooser_trigger.gif') ?>" class="v-middle" alt="<?php echo $this->helper('Mage_Core_Helper_Data')->jsQuoteEscape(Mage::helper('Mage_Widget_Helper_Data')->__('Open Chooser')); ?>" />' + '</a> ' + '<a href="javascript:void(0)" onclick="WidgetInstance.hideEntityChooser(\'<?php echo $container['name'] ?>_ids_{{id}}\')" title="<?php echo $this->helper('Mage_Core_Helper_Data')->jsQuoteEscape(Mage::helper('Mage_Widget_Helper_Data')->__('Apply')); ?>">' + @@ -175,6 +175,8 @@ var WidgetInstance = { templatePattern : /(^|.|\r|\n)({{(\w+)}})/, count : 0, activePageGroups : $H({}), + selectedItems : {}, + addPageGroup : function(data) { if (this.pageGroupTemplate && (pageGroupContainer = $(this.pageGroupContainerId))) { if (!data.page_id) { @@ -183,6 +185,14 @@ var WidgetInstance = { data.entities = ''; } data.id = this.count++; + if (data[data.group + '_entities']) { + var selected_entities = data[data.group + '_entities'].split(','); + if (selected_entities.length > 0) { + for (var i = 0; i < selected_entities.length; i++) { + this.addProductItemToSelection(data.group + '_ids_' + data.id, selected_entities[i]); + } + } + } pageGroupTemplateObj = new Template(this.pageGroupTemplate, this.templatePattern); Element.insert(pageGroupContainer, {'top':pageGroupTemplateObj.evaluate(data)}); if (data.group) { @@ -196,7 +206,7 @@ var WidgetInstance = { if (data.group == 'pages') { layoutSelect = pageGroup.down('select#layout_handle'); if (layoutSelect) { - for (var i=0; i < layoutSelect.options.length; i++) { + for (var i = 0; i < layoutSelect.options.length; i++) { if (layoutSelect.options[i].value == data.layout_handle) { layoutSelect.options[i].selected = true; break; @@ -206,7 +216,7 @@ var WidgetInstance = { } if ($(this.pageGroupContainerId+'_'+data.id)) { selectGroupElm = $(this.pageGroupContainerId+'_'+data.id).down('select.page_group_select'); - for (var i=0; i < selectGroupElm.options.length; i++) { + for (var i = 0; i < selectGroupElm.options.length; i++) { if (selectGroupElm.options[i].value == data.group) { selectGroupElm.options[i].selected = true; break; @@ -234,6 +244,19 @@ var WidgetInstance = { container.remove(); } }, + addProductItemToSelection: function(groupId, item) { + if (undefined == this.selectedItems[groupId]) { + this.selectedItems[groupId] = $H({}); + } + if (!isNaN(parseInt(item))) { + this.selectedItems[groupId].set(item, 1); + } + }, + removeProductItemFromSelection: function(groupId, item) { + if (undefined !== this.selectedItems[groupId]) { + this.selectedItems[groupId].unset(item); + } + }, showBlockContainer : function(container) { container = $(container); if (container) { @@ -334,16 +357,17 @@ var WidgetInstance = { } }, checkProduct : function(event) { - chooser = event.target.up('div.chooser') - ids = []; - chooser.select('input[type="checkbox"].entities').each(function(elm){ - if (elm.checked) { - ids.push(elm.value); - } - }); - entitiesElm = chooser.up('div.chooser_container').down('input[type="text"].entities'); + var elm = event.memo.element, + container = event.target.up('div.chooser').up('div.chooser_container'), + selectionId = container.id, + entitiesElm = container.down('input[type="text"].entities'); + if (elm.checked) { + this.addProductItemToSelection(selectionId, elm.value); + } else { + this.removeProductItemFromSelection(selectionId, elm.value); + } if (entitiesElm) { - entitiesElm.value = ids.join(','); + entitiesElm.value = this.selectedItems[selectionId].keys().join(','); } }, checkCategory : function(event) { diff --git a/app/code/core/Mage/Widget/view/adminhtml/instance/js.phtml b/app/code/core/Mage/Widget/view/adminhtml/instance/js.phtml index a314f3519dbc8e986ce591cb0bf5606a6d130900..642d258720f69621a8878281371ec8e3efd73cb8 100644 --- a/app/code/core/Mage/Widget/view/adminhtml/instance/js.phtml +++ b/app/code/core/Mage/Widget/view/adminhtml/instance/js.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Widget/view/adminhtml/layout.xml b/app/code/core/Mage/Widget/view/adminhtml/layout.xml index 9fc637c5a8eb413a47350ffeb44d7a03b50dedda..ad67cc27b4cebccac82197bcccba0af89afbaa35 100644 --- a/app/code/core/Mage/Widget/view/adminhtml/layout.xml +++ b/app/code/core/Mage/Widget/view/adminhtml/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Widget/view/frontend/layout.xml b/app/code/core/Mage/Widget/view/frontend/layout.xml index 66d68045712e6a5a2c0c56fe5784356f656ca34d..b6e38fd8e10b4afb4c2d31d831c1ea78b522f7f9 100644 --- a/app/code/core/Mage/Widget/view/frontend/layout.xml +++ b/app/code/core/Mage/Widget/view/frontend/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package Mage_Widget - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Widget/view/frontend/widgets.css b/app/code/core/Mage/Widget/view/frontend/widgets.css index e697a4e58eeaa8f51f2e4e054d2063ce9b884b83..0c1316d2603ce80b539cac4eb4cb9804fb8d457a 100644 --- a/app/code/core/Mage/Widget/view/frontend/widgets.css +++ b/app/code/core/Mage/Widget/view/frontend/widgets.css @@ -19,7 +19,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/Wishlist/Block/Abstract.php b/app/code/core/Mage/Wishlist/Block/Abstract.php index 4822ce6237e19d22fa0e30e6b12d744ca1fb2e54..b9d07e19b9bdd04fa8fbd61139875578de9255e5 100644 --- a/app/code/core/Mage/Wishlist/Block/Abstract.php +++ b/app/code/core/Mage/Wishlist/Block/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Wishlist - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Wishlist/Block/Customer/Sharing.php b/app/code/core/Mage/Wishlist/Block/Customer/Sharing.php index 2a323d8eabbe5ccac3415ad47eb32d8b7e913617..879f281414979892442421aa3ee909b8c2539b69 100644 --- a/app/code/core/Mage/Wishlist/Block/Customer/Sharing.php +++ b/app/code/core/Mage/Wishlist/Block/Customer/Sharing.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Wishlist - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Wishlist/Block/Customer/Sidebar.php b/app/code/core/Mage/Wishlist/Block/Customer/Sidebar.php index ae2801a0e34901ef977283a596461f17b1d0a8d2..be59aa097d27b4053b80ad3dc13bd0f62c9c7c35 100644 --- a/app/code/core/Mage/Wishlist/Block/Customer/Sidebar.php +++ b/app/code/core/Mage/Wishlist/Block/Customer/Sidebar.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Wishlist - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Wishlist/Block/Customer/Wishlist.php b/app/code/core/Mage/Wishlist/Block/Customer/Wishlist.php index 398371ab1f3da3dedafcadfba301aafd295dbbfb..7d86e26d1f965598a985f408c978a6e86510f6d8 100644 --- a/app/code/core/Mage/Wishlist/Block/Customer/Wishlist.php +++ b/app/code/core/Mage/Wishlist/Block/Customer/Wishlist.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Wishlist - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Wishlist/Block/Customer/Wishlist/Item/Options.php b/app/code/core/Mage/Wishlist/Block/Customer/Wishlist/Item/Options.php index 0e07231d418f3983fe9d8c6b04a7ae2df2771e3d..358ef1c01b0d7a2ebf365572b1c3a875d6ae2f71 100644 --- a/app/code/core/Mage/Wishlist/Block/Customer/Wishlist/Item/Options.php +++ b/app/code/core/Mage/Wishlist/Block/Customer/Wishlist/Item/Options.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Wishlist - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Wishlist/Block/Item/Configure.php b/app/code/core/Mage/Wishlist/Block/Item/Configure.php index 2771395014caddbe139e475789793d98378d558f..f204d2cd1ce19a06dd6237a057b4aec9be1ee772 100644 --- a/app/code/core/Mage/Wishlist/Block/Item/Configure.php +++ b/app/code/core/Mage/Wishlist/Block/Item/Configure.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Wishlist - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Wishlist/Block/Links.php b/app/code/core/Mage/Wishlist/Block/Links.php index 5fb443a614a90b5464828260695e29740d0e537d..bd78b4663b6c31fbc2e0c857c3890811a8ffc6cb 100644 --- a/app/code/core/Mage/Wishlist/Block/Links.php +++ b/app/code/core/Mage/Wishlist/Block/Links.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Wishlist - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Wishlist/Block/Render/Item/Price.php b/app/code/core/Mage/Wishlist/Block/Render/Item/Price.php index 0d0cd9ff967dc209e3141a42c0150ab8d854f584..922d80b90e12384724509e2819fe57565668614c 100644 --- a/app/code/core/Mage/Wishlist/Block/Render/Item/Price.php +++ b/app/code/core/Mage/Wishlist/Block/Render/Item/Price.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Wishlist - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Wishlist/Block/Share/Email/Items.php b/app/code/core/Mage/Wishlist/Block/Share/Email/Items.php index 2cd6bc60f5f353bf605dbf2a10add941fbeb8ab1..6d79ab38d9b698cec0f28a18f2ff99f0fdd3de0f 100644 --- a/app/code/core/Mage/Wishlist/Block/Share/Email/Items.php +++ b/app/code/core/Mage/Wishlist/Block/Share/Email/Items.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Wishlist - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Wishlist/Block/Share/Email/Rss.php b/app/code/core/Mage/Wishlist/Block/Share/Email/Rss.php index ed93cab71d760c4bea241d8aefb937d3cb6e6cca..3df7dd114ef75ece9cfbadcb67bcaec6ceebbc48 100644 --- a/app/code/core/Mage/Wishlist/Block/Share/Email/Rss.php +++ b/app/code/core/Mage/Wishlist/Block/Share/Email/Rss.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Wishlist - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Wishlist/Block/Share/Wishlist.php b/app/code/core/Mage/Wishlist/Block/Share/Wishlist.php index fc4c5879123baca6885e95fca4915ff72f140712..b67f0af2fbba167c3cf819f3001c8eec7006e419 100644 --- a/app/code/core/Mage/Wishlist/Block/Share/Wishlist.php +++ b/app/code/core/Mage/Wishlist/Block/Share/Wishlist.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Wishlist - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Wishlist/Controller/Abstract.php b/app/code/core/Mage/Wishlist/Controller/Abstract.php index 0425d4879df94e5397bf795aa1b9d9c45554d566..7d7484b26b619441103702dca166a7ac38bdc207 100644 --- a/app/code/core/Mage/Wishlist/Controller/Abstract.php +++ b/app/code/core/Mage/Wishlist/Controller/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Wishlist - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Wishlist/Helper/Data.php b/app/code/core/Mage/Wishlist/Helper/Data.php index b8add4544d0d4b3175c88bb66b8ef4e0242fc059..9242ed0bf36a83716d19d92a7ad12b557e26b947 100644 --- a/app/code/core/Mage/Wishlist/Helper/Data.php +++ b/app/code/core/Mage/Wishlist/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Wishlist - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Wishlist/Model/Config.php b/app/code/core/Mage/Wishlist/Model/Config.php index 5cb5852c5c1906cb2a377add68b1f21962c9304c..e5900b01e1451014cdc5afb37b8b24a1e21a5328 100644 --- a/app/code/core/Mage/Wishlist/Model/Config.php +++ b/app/code/core/Mage/Wishlist/Model/Config.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Wishlist - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Wishlist/Model/Config/Source/Summary.php b/app/code/core/Mage/Wishlist/Model/Config/Source/Summary.php index 386173335e1fb28971edfdd1d39a8072b88f9ca3..485240fbb1aa7786cec2eca89f6984dbe379011d 100644 --- a/app/code/core/Mage/Wishlist/Model/Config/Source/Summary.php +++ b/app/code/core/Mage/Wishlist/Model/Config/Source/Summary.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Wishlist - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Wishlist_Model_Config_Source_Summary diff --git a/app/code/core/Mage/Wishlist/Model/Item.php b/app/code/core/Mage/Wishlist/Model/Item.php index def9b6c29cb0e50262ea0287314e86546e709546..574ecad38d25d454b031b2749d905d2a6f43ecb2 100644 --- a/app/code/core/Mage/Wishlist/Model/Item.php +++ b/app/code/core/Mage/Wishlist/Model/Item.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Wishlist - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -109,6 +109,18 @@ class Mage_Wishlist_Model_Item extends Mage_Core_Model_Abstract $this->_init('Mage_Wishlist_Model_Resource_Item'); } + /** + * Set quantity. If quantity is less than 0 - set it to 1 + * + * @param int $qty + * @return Mage_Wishlist_Model_Item + */ + public function setQty($qty) + { + $this->setData('qty', ($qty >= 0) ? $qty : 1 ); + return $this; + } + /** * Retrieve resource instance wrapper * @@ -703,4 +715,4 @@ class Mage_Wishlist_Model_Item extends Mage_Core_Model_Abstract $this->setOptions($options->getOptionsByItem($this)); return $this; } -} +} \ No newline at end of file diff --git a/app/code/core/Mage/Wishlist/Model/Item/Option.php b/app/code/core/Mage/Wishlist/Model/Item/Option.php index b618988168df893a5756bf52025570ff8d22ed1a..595f7311e89bdedcb4f1f0917f602689e404f742 100644 --- a/app/code/core/Mage/Wishlist/Model/Item/Option.php +++ b/app/code/core/Mage/Wishlist/Model/Item/Option.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Wishlist - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Wishlist/Model/Observer.php b/app/code/core/Mage/Wishlist/Model/Observer.php index ab84546cd0cb73c733aadfd5c03ab06b4e622785..c0553510f8a32dc8372625421e6b350199508b05 100644 --- a/app/code/core/Mage/Wishlist/Model/Observer.php +++ b/app/code/core/Mage/Wishlist/Model/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Wishlist - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Wishlist/Model/Resource/Item.php b/app/code/core/Mage/Wishlist/Model/Resource/Item.php index e65a41482dcae218959c3727192630c80d3cc400..d99c806ad533f932ec0f64b7ccb9bb4ff98296db 100755 --- a/app/code/core/Mage/Wishlist/Model/Resource/Item.php +++ b/app/code/core/Mage/Wishlist/Model/Resource/Item.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Wishlist - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Wishlist/Model/Resource/Item/Collection.php b/app/code/core/Mage/Wishlist/Model/Resource/Item/Collection.php index a76f284aeb098438921226c0812fec595e0ca9ec..00df05275b4e65ed3209e444e6e41c54dfded66c 100755 --- a/app/code/core/Mage/Wishlist/Model/Resource/Item/Collection.php +++ b/app/code/core/Mage/Wishlist/Model/Resource/Item/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Wishlist - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Wishlist/Model/Resource/Item/Option.php b/app/code/core/Mage/Wishlist/Model/Resource/Item/Option.php index d43a80f67fe5f8639c3302d7b0bcc523e82535bb..4a831fb9adce138269a7a9096864d3b8b13d7ff9 100644 --- a/app/code/core/Mage/Wishlist/Model/Resource/Item/Option.php +++ b/app/code/core/Mage/Wishlist/Model/Resource/Item/Option.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Wishlist - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Wishlist/Model/Resource/Item/Option/Collection.php b/app/code/core/Mage/Wishlist/Model/Resource/Item/Option/Collection.php index ea934a330918afc27b5c20f5f48999f83a4a5d75..2539e26870b7e2e8860c7b492ed3ee62afc77291 100644 --- a/app/code/core/Mage/Wishlist/Model/Resource/Item/Option/Collection.php +++ b/app/code/core/Mage/Wishlist/Model/Resource/Item/Option/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Wishlist - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Wishlist/Model/Resource/Wishlist.php b/app/code/core/Mage/Wishlist/Model/Resource/Wishlist.php index a0bf5a529daa377c8fa80985fb9a40af6f2abc7c..2c00d53f48deb06de822e9e6fe98edf8d07ade46 100755 --- a/app/code/core/Mage/Wishlist/Model/Resource/Wishlist.php +++ b/app/code/core/Mage/Wishlist/Model/Resource/Wishlist.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Wishlist - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Wishlist/Model/Resource/Wishlist/Collection.php b/app/code/core/Mage/Wishlist/Model/Resource/Wishlist/Collection.php index c5c4f3a7f3eeee2f62b28274d98c717822b9ca6b..f480a66362974fc35458080cda6cb95eef09966d 100755 --- a/app/code/core/Mage/Wishlist/Model/Resource/Wishlist/Collection.php +++ b/app/code/core/Mage/Wishlist/Model/Resource/Wishlist/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Wishlist - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Wishlist/Model/Session.php b/app/code/core/Mage/Wishlist/Model/Session.php index 0e8f11bef7e9b6b16ca41a65ffd1e1cf40e561a7..1087e78aa09263170fce84c4ad10d2ff759d10fa 100644 --- a/app/code/core/Mage/Wishlist/Model/Session.php +++ b/app/code/core/Mage/Wishlist/Model/Session.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Wishlist - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Wishlist/Model/Wishlist.php b/app/code/core/Mage/Wishlist/Model/Wishlist.php index d51edbed1e07dc4e62fbf7a1c89c06a166c5235d..001674e7659f62185d5a568068460b9ba72cee1b 100644 --- a/app/code/core/Mage/Wishlist/Model/Wishlist.php +++ b/app/code/core/Mage/Wishlist/Model/Wishlist.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Wishlist - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Wishlist/controllers/IndexController.php b/app/code/core/Mage/Wishlist/controllers/IndexController.php index 653fcce95788f22e0a3a49a3ca5c09db5639a8c8..5d7218c306e2aec3e84637e5fe6ada447b6fb140 100644 --- a/app/code/core/Mage/Wishlist/controllers/IndexController.php +++ b/app/code/core/Mage/Wishlist/controllers/IndexController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Wishlist - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -193,9 +193,7 @@ class Mage_Wishlist_IndexController extends Mage_Wishlist_Controller_Abstract Mage::helper('Mage_Wishlist_Helper_Data')->calculate(); - $message = $this->__('%1$s has been added to your wishlist. Click <a href="%2$s">here</a> to continue shopping', - $product->getName(), Mage::helper('Mage_Core_Helper_Data')->escapeUrl($referer) - ); + $message = $this->__('%1$s has been added to your wishlist. Click <a href="%2$s">here</a> to continue shopping', $product->getName(), Mage::helper('Mage_Core_Helper_Data')->escapeUrl($referer)); $session->addSuccess($message); } catch (Mage_Core_Exception $e) { diff --git a/app/code/core/Mage/Wishlist/controllers/SharedController.php b/app/code/core/Mage/Wishlist/controllers/SharedController.php index 47584a74da9204daa930b6b1e844a89189e3e188..edc10be7f2767c1b19d7a005fd630ec1b25c2288 100644 --- a/app/code/core/Mage/Wishlist/controllers/SharedController.php +++ b/app/code/core/Mage/Wishlist/controllers/SharedController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Wishlist - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Wishlist/etc/adminhtml.xml b/app/code/core/Mage/Wishlist/etc/adminhtml.xml index 4680adf04f2e0a472228d1cb32a1b069060fa469..357419f25b7e27626256699f49a9f8e7f8c33a8a 100644 --- a/app/code/core/Mage/Wishlist/etc/adminhtml.xml +++ b/app/code/core/Mage/Wishlist/etc/adminhtml.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Wishlist - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Wishlist/etc/config.xml b/app/code/core/Mage/Wishlist/etc/config.xml index 503870f0a2f2ec7d3d9a4442baa63457371efdcc..43262e7cab5eec0c07ea982b33612f22c36a3edb 100644 --- a/app/code/core/Mage/Wishlist/etc/config.xml +++ b/app/code/core/Mage/Wishlist/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Wishlist - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Wishlist/etc/system.xml b/app/code/core/Mage/Wishlist/etc/system.xml index 50b71d97e409de8022de33158d46f43df1a9449c..19ab364e4c6843c6b9c705217d495c34cb82808e 100644 --- a/app/code/core/Mage/Wishlist/etc/system.xml +++ b/app/code/core/Mage/Wishlist/etc/system.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Wishlist - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Wishlist/etc/view.xml b/app/code/core/Mage/Wishlist/etc/view.xml index 0f625535658735abbbda592cf435364ff8a5fe0e..d5739b586827276c40b35c1b3cfd75fc6fc7ec01 100644 --- a/app/code/core/Mage/Wishlist/etc/view.xml +++ b/app/code/core/Mage/Wishlist/etc/view.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Wishlist - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/Wishlist/sql/wishlist_setup/install-1.6.0.0.php b/app/code/core/Mage/Wishlist/sql/wishlist_setup/install-1.6.0.0.php index de2e689d27df0058a5b47e4f708f3419ae5e2d0b..42fd33a5f276fa1084443194ad67a3cf2b494ae0 100644 --- a/app/code/core/Mage/Wishlist/sql/wishlist_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/Wishlist/sql/wishlist_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Wishlist - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/Wishlist/view/frontend/email/items.phtml b/app/code/core/Mage/Wishlist/view/frontend/email/items.phtml index 435d33624dd018fa405d28ff30ed17a431907978..e1f36fd9327704397006de795785f97ae40485b8 100644 --- a/app/code/core/Mage/Wishlist/view/frontend/email/items.phtml +++ b/app/code/core/Mage/Wishlist/view/frontend/email/items.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /* @var $this Mage_Wishlist_Block_Share_Email_Items */ diff --git a/app/code/core/Mage/Wishlist/view/frontend/email/rss.phtml b/app/code/core/Mage/Wishlist/view/frontend/email/rss.phtml index 40f3a1bb0c92c2977ea41945c9033de2cb5b6aa6..4e634735bfdb45461c90aa3e1695ffeaf2f6580d 100644 --- a/app/code/core/Mage/Wishlist/view/frontend/email/rss.phtml +++ b/app/code/core/Mage/Wishlist/view/frontend/email/rss.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Wishlist/view/frontend/item/configure/addto.phtml b/app/code/core/Mage/Wishlist/view/frontend/item/configure/addto.phtml index f62068e0c78a658c9df2689a91b7e1f427bdea10..e6315249195a4d625e490e96837276717d7c1365 100644 --- a/app/code/core/Mage/Wishlist/view/frontend/item/configure/addto.phtml +++ b/app/code/core/Mage/Wishlist/view/frontend/item/configure/addto.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Wishlist/view/frontend/layout.xml b/app/code/core/Mage/Wishlist/view/frontend/layout.xml index 1d11fe122ec487750dd66f39f043d46594b14dfa..989c927c202fc9b232fe883c9da1583ad20977fd 100644 --- a/app/code/core/Mage/Wishlist/view/frontend/layout.xml +++ b/app/code/core/Mage/Wishlist/view/frontend/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/Wishlist/view/frontend/options_list.phtml b/app/code/core/Mage/Wishlist/view/frontend/options_list.phtml index 18856d56e85129f3536bb53f40eb648bd3565232..c484565b5285fde015412b348d287c0e15f2138b 100644 --- a/app/code/core/Mage/Wishlist/view/frontend/options_list.phtml +++ b/app/code/core/Mage/Wishlist/view/frontend/options_list.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /* @var $this Mage_Wishlist_Block_Customer_Wishlist_Item_Options */ diff --git a/app/code/core/Mage/Wishlist/view/frontend/render/item/price.phtml b/app/code/core/Mage/Wishlist/view/frontend/render/item/price.phtml index cd91043ce677f35266b5996c06f859a15e7547db..06e7e9b7dcf1f055c98571b1eb19ab14e2999899 100644 --- a/app/code/core/Mage/Wishlist/view/frontend/render/item/price.phtml +++ b/app/code/core/Mage/Wishlist/view/frontend/render/item/price.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /* @var $this Mage_Wishlist_Block_Customer_Wishlist_Render_Item_Price */ diff --git a/app/code/core/Mage/Wishlist/view/frontend/render/item/price_msrp_item.phtml b/app/code/core/Mage/Wishlist/view/frontend/render/item/price_msrp_item.phtml index c4e0b7c0514e9e65b9a5b562b0ed7af35e9e58ce..d61bdefc8cbfd9022cefc88fe2e99aa13cf1727c 100644 --- a/app/code/core/Mage/Wishlist/view/frontend/render/item/price_msrp_item.phtml +++ b/app/code/core/Mage/Wishlist/view/frontend/render/item/price_msrp_item.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Wishlist/view/frontend/render/item/price_msrp_rss.phtml b/app/code/core/Mage/Wishlist/view/frontend/render/item/price_msrp_rss.phtml index 1b2a37776f2cade54e288acecd9c5d7e79b3ae76..f6e2838326e9ac385a3da49e6493f136770ae864 100644 --- a/app/code/core/Mage/Wishlist/view/frontend/render/item/price_msrp_rss.phtml +++ b/app/code/core/Mage/Wishlist/view/frontend/render/item/price_msrp_rss.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Wishlist/view/frontend/shared.phtml b/app/code/core/Mage/Wishlist/view/frontend/shared.phtml index 8b905ad62884f78297e216af3f9cde668739fcb5..1cd048bd1bd24f9a09db273f0c4b9ad0a58d3157 100644 --- a/app/code/core/Mage/Wishlist/view/frontend/shared.phtml +++ b/app/code/core/Mage/Wishlist/view/frontend/shared.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /* @var $this Mage_Wishlist_Block_Share_Wishlist */ diff --git a/app/code/core/Mage/Wishlist/view/frontend/sharing.phtml b/app/code/core/Mage/Wishlist/view/frontend/sharing.phtml index 29f72889e2eadaa61455e8fca3eff9f50575d2d5..333de2010b82b4ac7b813bfcae0aadd4c39ad96f 100644 --- a/app/code/core/Mage/Wishlist/view/frontend/sharing.phtml +++ b/app/code/core/Mage/Wishlist/view/frontend/sharing.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/Wishlist/view/frontend/sidebar.phtml b/app/code/core/Mage/Wishlist/view/frontend/sidebar.phtml index 5eff0770b15e440d8f67c72efd8a5ec900cb84f1..e2f3f6b32ebdaec69c32cc688cfd9a0dbfb8cb9e 100644 --- a/app/code/core/Mage/Wishlist/view/frontend/sidebar.phtml +++ b/app/code/core/Mage/Wishlist/view/frontend/sidebar.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /* @var $this Mage_Wishlist_Block_Customer_Sidebar */ diff --git a/app/code/core/Mage/Wishlist/view/frontend/view.phtml b/app/code/core/Mage/Wishlist/view/frontend/view.phtml index e0fe31f495e5d947ae5ef25a03396a6d5cc08397..4c89ddbb4aad3db3ec4031c66d00bb6ec6fde745 100644 --- a/app/code/core/Mage/Wishlist/view/frontend/view.phtml +++ b/app/code/core/Mage/Wishlist/view/frontend/view.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /* @var $this Mage_Wishlist_Block_Customer_Wishlist */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/History.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/History.php index bbb719a2974265fe21912ad2ece9abfa976fb430..a1522934bf64f789a5d7a1302664159e112743e1 100644 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/History.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/History.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/History/Grid.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/History/Grid.php index e9765503c542d639c93c5fd5a1844a6fc7c64a41..de8d2260a02cf14db3f058a0312a8c7d683cef0a 100644 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/History/Grid.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/History/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile.php index b3ece22a318a4d32676f5417d2e8f28662beb5ee..8f164b2c0ab31a346369eb1bb05a6d10fa2b4103 100644 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit.php index ec81fe9fba95c4033b593618db85390562dfed7b..e2696f1c09186dcb74b9dbb83be590ba8a318690 100644 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Form.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Form.php index 31b57232c3e9ead801ced38a3486fb9f7c218e31..01010d4f7d750e15d45023ecd65c1bd86f2f2f32 100644 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Form.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Submission.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Submission.php index 6c1af9ac6ea6f845a9aa7883a67c006f51dd1e21..2318d01c851864b5eda293169dc18a25dbb8e97a 100644 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Submission.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Submission.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Cache.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Cache.php index 94d3a4757163b71b9ef0fb3cf2510af8ea3375b9..765c1ccef76a604de5ede731dd106083befab738 100755 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Cache.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Cache.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Content.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Content.php index c105ea70438824fae6bef842495b0c203d7ac9d7..4e66b32d255a45b77d9e0d76e27595c61f43970e 100644 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Content.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Content.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Design.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Design.php index ba2404019b8e02dae99d0775c07dea7fad969407..25b98327523baceffd9f1c4291850f15121740fe 100644 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Design.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Design.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Design/Accordion.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Design/Accordion.php index 5045b69c57fa13dd9d6d6f8f89ac851b1d8d0542..ff110010fc3895f57b228501c322f8a1ab90dd63 100644 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Design/Accordion.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Design/Accordion.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Design/Accordion/Images.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Design/Accordion/Images.php index 5838bfe81945cf1efb24d18b5db777c581fb5f1c..e0adfde59c16ddf6affedf2f2c01cbf8dde4569f 100644 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Design/Accordion/Images.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Design/Accordion/Images.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Design/Accordion/Tabs.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Design/Accordion/Tabs.php index 3f6efa5dd654c4e2f71af2b5fb1ff0377dbcfda1..f9d42194983357532037b7ed041e030cb7168956 100644 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Design/Accordion/Tabs.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Design/Accordion/Tabs.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Design/Accordion/Themes.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Design/Accordion/Themes.php index dbb3c521ce40edb0a4368d266c6a5add1b481411..7363fea6b042f09721adfa69c64f6e6b52701790 100644 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Design/Accordion/Themes.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Design/Accordion/Themes.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Design/Preview.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Design/Preview.php index f32953eb67da2dedd4977d0b3a9ca8ce08695f49..ea7b43423e7a729d2cd09133b72219c929d05abd 100644 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Design/Preview.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Design/Preview.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Design/Themes.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Design/Themes.php index 1911811edff1fb4f3300dc3a133119406325f51b..15ee00547ce61dfa71d6292c693472b97f1361d8 100644 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Design/Themes.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Design/Themes.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Flurryanalytics.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Flurryanalytics.php index be2831fb80263aabba1a13de798f5858ec6b665e..e52bd729f3b520d3de928f8f5868d2cee3da798f 100755 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Flurryanalytics.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Flurryanalytics.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/General.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/General.php index e204b4b8cecbc6e291f102fa2606fede98301700..b43c2d8498b791049c9722d701a1cf4443a3069a 100644 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/General.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/General.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Notification.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Notification.php index 3157ecd99b0dc172dd732317d4421c9d8be72ed7..bb743274b36cda7b477018bfdf697a7c44f66392 100755 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Notification.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Notification.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Payment.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Payment.php index 55ddfba566dc35f461f20e4f78878371cc83c857..e155bbaf82b19aad7170ebf1800ce4b99759ee19 100644 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Payment.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Payment.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Settings.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Settings.php index b1b0ebb81c7ab7ccddd58492f3030705a35c13da..972733b98e31c2374c95a43964ebbdd0e628fabf 100755 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Settings.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Settings.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Social.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Social.php index 39f7718f26ed87a8043e224b24bd1849ba471f4b..94f5536e680123b9240d2fe27e64bedbda86cdb0 100755 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Social.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Social.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Submission/History.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Submission/History.php index 589b371e567b7d9208403bdc1cf3ba6c9e79456f..b34407245f9cedec427bf9b9b46807dd49a040a0 100644 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Submission/History.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tab/Submission/History.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tabs.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tabs.php index 31a172854f64e6823a5e909cb1e4f76eb870dfed..eca82073a94e63631970ca08461058903c192e52 100644 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tabs.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Edit/Tabs.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Form/Element/Addrow.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Form/Element/Addrow.php index 078f5261da2a31d784bf3394a4c60fb8ea094270..9e02ab392d4b93fe7c6b41502ae9cf1ca046dfef 100644 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Form/Element/Addrow.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Form/Element/Addrow.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -48,9 +48,9 @@ class Mage_XmlConnect_Block_Adminhtml_Mobile_Form_Element_Addrow . '" value="'.$this->getEscapedValue() . '" ' . $this->serialize($this->getHtmlAttributes()) - . ' ><span>' + . ' ><span><span><span>' . $this->getEscapedValue() - . '</span></button>' + . '</span></span></span></button>' . $this->getAfterElementHtml(); return $html; } diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Form/Element/Color.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Form/Element/Color.php index b4e7472c548c99a0f27d54c11b486b0a61b3b801..1bedd5149dc093079bb2b8270a0892a85a716a91 100644 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Form/Element/Color.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Form/Element/Color.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Form/Element/Country.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Form/Element/Country.php index 75143b51d84da91db756d379d281281719ed9c61..432cdc0104244ef43f40dbe4f9f36bb1d99b81df 100755 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Form/Element/Country.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Form/Element/Country.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Form/Element/Datetime.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Form/Element/Datetime.php index cf421029ed900aa5175fa7209f701ab5b3ff7255..0e4e4e15b7b594eac348693b2bfa3197f4f37c48 100755 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Form/Element/Datetime.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Form/Element/Datetime.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Form/Element/Font.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Form/Element/Font.php index ab86d400b112cffc1d0f08a5c4f33f9f7a961ff1..148f26ae4ba498806ba98314b9e2e67189f4eaba 100644 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Form/Element/Font.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Form/Element/Font.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Form/Element/Image.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Form/Element/Image.php index 55bcd454c2c511b1eab366850ecb79194180d884..387d118db6c4f382eea735ac08b5fd77301c73c9 100644 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Form/Element/Image.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Form/Element/Image.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Form/Element/Page.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Form/Element/Page.php index 4f4b464833c8f9fc6d841f6c371623d973d6731d..0bf904b1dc3e4ed45a05657c299361b9753601b5 100644 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Form/Element/Page.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Form/Element/Page.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -100,8 +100,8 @@ class Mage_XmlConnect_Block_Adminhtml_Mobile_Form_Element_Page list($label, $element) = $this->getElements(); return $element->toHtml() . '</td><td class="label" style="width: 5em">' - . '<button class=" scalable save onclick_button" value="−"><span>' + . '<button class="scalable save onclick_button" value="−"><span><span><span>' . Mage::helper('Mage_XmlConnect_Helper_Data')->__('Delete') - . '</span></button>'; + . '</span></span></span></button>'; } } diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Form/Element/Tabs.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Form/Element/Tabs.php index 29d4ceae6731cd4183ca530b9219bd7376f1ce98..a4af5231ade5276ecffde01f1421e9c996676c06 100644 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Form/Element/Tabs.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Form/Element/Tabs.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Form/Element/Theme.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Form/Element/Theme.php index aad6844dec74839e089b26b5e67155ddc733db92..40901de65d10b7eeb01830cec3b997dd013f72d1 100644 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Form/Element/Theme.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Form/Element/Theme.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Grid.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Grid.php index b0fc01f65a8ae18122925a0a89510c611c339b4a..f89e92ae009c48a2b80b486f04d69679ac18c124 100644 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Grid.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Grid/Renderer/Bool.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Grid/Renderer/Bool.php index 516ae1377ec83773e95924cf4a821d4cde5bb845..8764eb139798207fdc5bbbca6533c8dc15634a62 100644 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Grid/Renderer/Bool.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Grid/Renderer/Bool.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Grid/Renderer/Type.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Grid/Renderer/Type.php index feb73832ba74b897785ad6495044fed5580922b5..c786558dfd25bc6b3466095539fcdddcc2617dd1 100644 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Grid/Renderer/Type.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Grid/Renderer/Type.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Preview/Content.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Preview/Content.php index feda288c5943dd1f4d07257cc3c12e3eb4a0b233..2b4fd85bfe3abd76709aeec0f9ce206426a141f8 100644 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Preview/Content.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Preview/Content.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Preview/Tabitems.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Preview/Tabitems.php index ca128df55a5fe0839104d4785a4820fe9cd719e3..a47d9fa97b4acd20eff869f0537c81eaf76e0bdd 100644 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Preview/Tabitems.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Preview/Tabitems.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Submission.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Submission.php index 6a002bef8fdc05a247776b84113c217c1594b19e..ece95470338ee6773516e4305f7148648e38e508 100644 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Submission.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Submission.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Submission/Form.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Submission/Form.php index c68925f62d6e091e5aab4c31873b42e9e75538a3..324b717b76764df1c54106a9e56d6be5548baee4 100644 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Submission/Form.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Submission/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Submission/Renderer/Country/Androidmarket.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Submission/Renderer/Country/Androidmarket.php index e9ae209f379640b63542d2a74051ff0e3aaf44c0..3d426273b09adc99d6aecce5a5f486bfbb75c09b 100755 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Submission/Renderer/Country/Androidmarket.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Submission/Renderer/Country/Androidmarket.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Submission/Renderer/Country/Istore.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Submission/Renderer/Country/Istore.php index 796ada4d0b77008b20a80e6c7c30c51ada94151d..1a99d008a47474b8ca5e0d8df2b39438fd6f230b 100644 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Submission/Renderer/Country/Istore.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Submission/Renderer/Country/Istore.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Submission/Tab/Container.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Submission/Tab/Container.php index edaefabc954e12364007bd9e9c7724e7a4ab9bd9..88ce204c4f3939e24c92161d29b7caea0c6a899e 100644 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Submission/Tab/Container.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Submission/Tab/Container.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Submission/Tab/Container/Submission.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Submission/Tab/Container/Submission.php index b7725239ce092cd435b3f43be017fe2af28c2536..0cd27832792c0fa0e6b0f8f57638eaa595c32312 100644 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Submission/Tab/Container/Submission.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Submission/Tab/Container/Submission.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Submission/Tabs.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Submission/Tabs.php index 864ede27909f4d7c12993cba849085f95987f92c..22e87602d1a97e8e69c480eab9403d0046f6b51c 100644 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Submission/Tabs.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Submission/Tabs.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Widget/Form.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Widget/Form.php index 0fa378b3f72bc816eea8b837b79fddea9df032eb..abf8c39ee22a406cdd9f2502d67f1c06dbb2f541 100644 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Widget/Form.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Widget/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue.php index bbb0d7d9e02d9620be86f3357a36b360bf154371..a9b0e60054f68c278cdbf8b10cb13212bf5ae3a7 100755 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Edit.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Edit.php index 0ab9e70206cbea6be2ee1d32e1aac63e07085b7a..57a0d077b2e237bea91aee8b1bcb3218f1aea0ee 100755 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Edit.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Edit.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Edit/Form.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Edit/Form.php index e931b16fc8010681d836206823a737f7416b87a7..8a2051a19035124eda5be7ca00cef293d6578118 100755 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Edit/Form.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Edit/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid.php index 642bb7f25d2a1bede8c5ced883cc2a17df8b6a2d..ecfaef1b18057b70e1de2b4672c627b91dd74d4e 100755 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid/Renderer/Action.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid/Renderer/Action.php index 4c550dc62c3e9b1741f5a25f00d733b611f0c09c..d7e64838d19ccc9b965a65431da765d385304213 100755 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid/Renderer/Action.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid/Renderer/Action.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid/Renderer/Application.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid/Renderer/Application.php index b094db007e91f580217a3f216b1435cc75168961..622ba3b850bb936a44eeba4c0e66a0efa00806e0 100755 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid/Renderer/Application.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid/Renderer/Application.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid/Renderer/Id.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid/Renderer/Id.php index d0e8ca4396e00f069dddcd4d768c127df5971c9d..5f38dbda8574be54a8f364d2e7164f6165a8f824 100755 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid/Renderer/Id.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid/Renderer/Id.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid/Renderer/Msgtitle.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid/Renderer/Msgtitle.php index 29639ebcad36935c04cf5dea5256fc409d48cb57..d327133c999eb26ce7303734d04bf05e1611a2e6 100755 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid/Renderer/Msgtitle.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid/Renderer/Msgtitle.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid/Renderer/Pushtitle.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid/Renderer/Pushtitle.php index 7e28ee3e6ae1a8fd42600ab2452e3f10d2b53b9b..b646151319fadae30e4dd9d02cfeb1c5f020e4cf 100755 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid/Renderer/Pushtitle.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid/Renderer/Pushtitle.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid/Renderer/Status.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid/Renderer/Status.php index c097e2881c1c5db9829d3b5103b6f4bb36da70a9..726ce287d3f7a689805727519263a0b429ee5587 100755 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid/Renderer/Status.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid/Renderer/Status.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid/Renderer/Template.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid/Renderer/Template.php index 622603e8094680d1bb8aedb54fbd0c1fea4c8c8e..4e0974a2412bd1685b9ce9009dba39be77d27917 100755 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid/Renderer/Template.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Queue/Grid/Renderer/Template.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Template.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Template.php index 7e276a6eab17263cbed0d66141c31e1a75ebc199..1a171780c697ee530e7ed486ed9d12ac96810d0a 100755 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Template.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Template.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Template/Edit.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Template/Edit.php index ba984a626dfe5e762819f7b0f6adec3a67078d3e..98f6ca0c2db857286c436800a6ef7feb7390489a 100755 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Template/Edit.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Template/Edit.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Template/Edit/Form.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Template/Edit/Form.php index a99f8e85d496183c6d405f45f282a771dbfa5cbd..3940eb474b1057566cf8008de09a40be9e0c5ae0 100755 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Template/Edit/Form.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Template/Edit/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Template/Grid.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Template/Grid.php index f26cc93edfd7df579c298bb1f53addf626af8b20..054cc663c7db794090a5d32d0e94d690d1c7a29e 100755 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Template/Grid.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Template/Grid.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Template/Grid/Renderer/Application.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Template/Grid/Renderer/Application.php index bb47be885bb1061821819f2d6f9e3ea8250bcc29..be448d7b66cd2e003965e1b1194736dcdd90c833 100755 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Template/Grid/Renderer/Application.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Template/Grid/Renderer/Application.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Template/Grid/Renderer/Name.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Template/Grid/Renderer/Name.php index e2f3fce37b50d8c51d2bb49fbefc07935cb5eda2..d51810f6e722aaee265c0855a53700d3105bff5f 100755 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Template/Grid/Renderer/Name.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Template/Grid/Renderer/Name.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Template/Preview.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Template/Preview.php index 26b9aaa5af4a973ce432e52a48d4531c4f8a3bf0..5167a89c9f13d203ea3ba442c0b5f879f0682583 100755 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Template/Preview.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Template/Preview.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Template/Preview/Form.php b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Template/Preview/Form.php index 51b7d068e8ae7e9371509652802e63e81ef02f67..d52ecd734761af1a7959cee52bc82bb883c4e648 100755 --- a/app/code/core/Mage/XmlConnect/Block/Adminhtml/Template/Preview/Form.php +++ b/app/code/core/Mage/XmlConnect/Block/Adminhtml/Template/Preview/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Cart.php b/app/code/core/Mage/XmlConnect/Block/Cart.php index 5de14c3a731b932d27281dffd5a952650954feb0..104174315d778879d41210f7bce9832f79302ed9 100644 --- a/app/code/core/Mage/XmlConnect/Block/Cart.php +++ b/app/code/core/Mage/XmlConnect/Block/Cart.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -62,7 +62,7 @@ class Mage_XmlConnect_Block_Cart extends Mage_Checkout_Block_Cart_Abstract $itemXml->addChild('entity_id', $item->getProduct()->getId()); $itemXml->addChild('entity_type', $type); $itemXml->addChild('item_id', $item->getId()); - $itemXml->addChild('name', $xmlObject->xmlentities($renderer->getProductName())); + $itemXml->addChild('name', $xmlObject->escapeXml($renderer->getProductName())); $itemXml->addChild('code', 'cart[' . $item->getId() . '][qty]'); $itemXml->addChild('qty', $renderer->getQty()); $icon = $renderer->getProductThumbnail()->resize( @@ -192,27 +192,27 @@ class Mage_XmlConnect_Block_Cart extends Mage_Checkout_Block_Cart_Abstract /** * Options list */ - if ($_options = $renderer->getOptionList()) { + $_options = $renderer->getOptionList(); + if ($_options) { $itemOptionsXml = $itemXml->addChild('options'); foreach ($_options as $_option) { $_formattedOptionValue = $renderer->getFormatedOptionValue($_option); $optionXml = $itemOptionsXml->addChild('option'); $optionXml->addAttribute('label', $xmlObject->xmlAttribute($_option['label'])); - $optionXml->addAttribute( - 'text', $xmlObject->xmlAttribute(strip_tags($_formattedOptionValue['value'])) - ); + $optionXml->addAttribute('text', $xmlObject->xmlAttribute($_formattedOptionValue['value'])); } } /** * Item messages */ - if ($messages = $renderer->getMessages()) { + $messages = $renderer->getMessages(); + if ($messages) { $itemMessagesXml = $itemXml->addChild('messages'); foreach ($messages as $message) { $messageXml = $itemMessagesXml->addChild('option'); $messageXml->addChild('type', $message['type']); - $messageXml->addChild('text', $xmlObject->xmlentities($message['text'])); + $messageXml->addChild('text', $xmlObject->escapeXml($message['text'])); } } } diff --git a/app/code/core/Mage/XmlConnect/Block/Cart/Crosssell.php b/app/code/core/Mage/XmlConnect/Block/Cart/Crosssell.php index 7f24a28af5a8ac89ed56cfbc8da4c72c4e00a3ae..0ede156381ef9d1553f149cfad481fdc24dfcd09 100644 --- a/app/code/core/Mage/XmlConnect/Block/Cart/Crosssell.php +++ b/app/code/core/Mage/XmlConnect/Block/Cart/Crosssell.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -55,7 +55,7 @@ class Mage_XmlConnect_Block_Cart_Crosssell extends Mage_Checkout_Block_Cart_Cros /** @var $product Mage_Catalog_Model_Product */ foreach ($this->getItems() as $product) { $itemXmlObj = $crossSellXmlObj->addChild('item'); - $itemXmlObj->addChild('name', $crossSellXmlObj->xmlentities($product->getName())); + $itemXmlObj->addChild('name', $crossSellXmlObj->escapeXml($product->getName())); $icon = $this->helper('Mage_Catalog_Helper_Image')->init($product, 'thumbnail') ->resize(Mage::helper('Mage_XmlConnect_Helper_Image')->getImageSizeForContent('product_small')); @@ -70,12 +70,13 @@ class Mage_XmlConnect_Block_Cart_Crosssell extends Mage_Checkout_Block_Cart_Cros /** * If product type is grouped than it has options as its grouped items */ - if ($product->getTypeId() == Mage_Catalog_Model_Product_Type_Grouped::TYPE_CODE) { + if ($product->getTypeId() == Mage_Catalog_Model_Product_Type_Grouped::TYPE_CODE + || $product->getTypeId() == Mage_Catalog_Model_Product_Type_Configurable::TYPE_CODE) { $product->setHasOptions(true); } $itemXmlObj->addChild('has_options', (int)$product->getHasOptions()); - $itemXmlObj->addChild('in_stock', (int)$product->getIsInStock()); + $itemXmlObj->addChild('in_stock', (int)$product->getStockItem()->getIsInStock()); if ($product->getTypeId() == Mage_Downloadable_Model_Product_Type::TYPE_DOWNLOADABLE) { $itemXmlObj->addChild('is_salable', 0); } else { @@ -96,4 +97,4 @@ class Mage_XmlConnect_Block_Cart_Crosssell extends Mage_Checkout_Block_Cart_Cros } return $crossSellXmlObj->asNiceXml(); } -} +} \ No newline at end of file diff --git a/app/code/core/Mage/XmlConnect/Block/Cart/Info.php b/app/code/core/Mage/XmlConnect/Block/Cart/Info.php index bd9b26600f09cfe4689ff4beaa59f6edd71b2a91..2f8089ee98c00df3984fb2914f1f1c252c76dcd8 100644 --- a/app/code/core/Mage/XmlConnect/Block/Cart/Info.php +++ b/app/code/core/Mage/XmlConnect/Block/Cart/Info.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Cart/Item/Renderer.php b/app/code/core/Mage/XmlConnect/Block/Cart/Item/Renderer.php index c2b08b50279e1c3786d7b27313748b8a345da005..b7d8e7bdefc3e5ab5c30fb586f62923b1ac27ce4 100644 --- a/app/code/core/Mage/XmlConnect/Block/Cart/Item/Renderer.php +++ b/app/code/core/Mage/XmlConnect/Block/Cart/Item/Renderer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -94,7 +94,7 @@ class Mage_XmlConnect_Block_Cart_Item_Renderer extends Mage_Checkout_Block_Cart_ $exclPrice = $_item->getRowTotal(); } $exclPrice = $this->_formatPrice($exclPrice); - $subtotalXmlObj->addAttribute('excluding_tax', $subtotalXmlObj->xmlentities($exclPrice)); + $subtotalXmlObj->addAttribute('excluding_tax', $subtotalXmlObj->escapeXml($exclPrice)); } if ($taxHelper->displayCartPriceInclTax() || $taxHelper->displayCartBothPrices()) { @@ -109,7 +109,7 @@ class Mage_XmlConnect_Block_Cart_Item_Renderer extends Mage_Checkout_Block_Cart_ } $inclPrice = $this->_formatPrice($inclPrice); - $subtotalXmlObj->addAttribute('including_tax', $subtotalXmlObj->xmlentities($inclPrice)); + $subtotalXmlObj->addAttribute('including_tax', $subtotalXmlObj->escapeXml($inclPrice)); } if ($weeeHelper->getApplied($_item)) { @@ -154,7 +154,7 @@ class Mage_XmlConnect_Block_Cart_Item_Renderer extends Mage_Checkout_Block_Cart_ } $exclPrice = $this->_formatPrice($exclPrice); - $priceXmlObj->addAttribute('excluding_tax', $priceXmlObj->xmlentities($exclPrice)); + $priceXmlObj->addAttribute('excluding_tax', $priceXmlObj->escapeXml($exclPrice)); } if ($this->helper('Mage_Tax_Helper_Data')->displayCartPriceInclTax() @@ -171,7 +171,7 @@ class Mage_XmlConnect_Block_Cart_Item_Renderer extends Mage_Checkout_Block_Cart_ } $inclPrice = $this->_formatPrice($inclPrice); - $priceXmlObj->addAttribute('including_tax', $priceXmlObj->xmlentities($inclPrice)); + $priceXmlObj->addAttribute('including_tax', $priceXmlObj->escapeXml($inclPrice)); } if (Mage::helper('Mage_Weee_Helper_Data')->getApplied($_item)) { @@ -244,10 +244,7 @@ class Mage_XmlConnect_Block_Cart_Item_Renderer extends Mage_Checkout_Block_Cart_ } $totalExcl = $this->_formatPrice($totalExcl); - $priceXmlObj->addAttribute( - 'total_excluding_tax', - $priceXmlObj->xmlentities($totalExcl) - ); + $priceXmlObj->addAttribute('total_excluding_tax', $priceXmlObj->escapeXml($totalExcl)); } if ($typeOfDisplay2 && $_item->getWeeeTaxAppliedAmount()) { @@ -258,7 +255,7 @@ class Mage_XmlConnect_Block_Cart_Item_Renderer extends Mage_Checkout_Block_Cart_ } $totalIncl = $this->_formatPrice($totalIncl); - $priceXmlObj->addAttribute('total_including_tax', $priceXmlObj->xmlentities($totalIncl)); + $priceXmlObj->addAttribute('total_including_tax', $priceXmlObj->escapeXml($totalIncl)); } return $priceXmlObj; diff --git a/app/code/core/Mage/XmlConnect/Block/Cart/Item/Renderer/Configurable.php b/app/code/core/Mage/XmlConnect/Block/Cart/Item/Renderer/Configurable.php index 109d55da6de6d4730290148fc55d649d1f43ddb4..cbb4d713be68844cf4f60f558c289a70684a8a11 100644 --- a/app/code/core/Mage/XmlConnect/Block/Cart/Item/Renderer/Configurable.php +++ b/app/code/core/Mage/XmlConnect/Block/Cart/Item/Renderer/Configurable.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Cart/Item/Renderer/Grouped.php b/app/code/core/Mage/XmlConnect/Block/Cart/Item/Renderer/Grouped.php index 49e539e4c625e19e7bd6decdbaaefe3da1385cb3..9d4a0870fce1115381d78fdce6a205db7b50ca1f 100644 --- a/app/code/core/Mage/XmlConnect/Block/Cart/Item/Renderer/Grouped.php +++ b/app/code/core/Mage/XmlConnect/Block/Cart/Item/Renderer/Grouped.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Cart/Paypal/Mecl/Details.php b/app/code/core/Mage/XmlConnect/Block/Cart/Paypal/Mecl/Details.php index 59561df5b87ba5e239604043bce39a7098d87959..b2be761c90f16cda3f2e071c7e2ed5435cf588db 100644 --- a/app/code/core/Mage/XmlConnect/Block/Cart/Paypal/Mecl/Details.php +++ b/app/code/core/Mage/XmlConnect/Block/Cart/Paypal/Mecl/Details.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Cart/Paypal/Mecl/Review.php b/app/code/core/Mage/XmlConnect/Block/Cart/Paypal/Mecl/Review.php index 4ae4debe28e845ee64dc0e27ab89e716678f3ed1..8075daa127e98658697ab0b4917c57b03cf39b87 100644 --- a/app/code/core/Mage/XmlConnect/Block/Cart/Paypal/Mecl/Review.php +++ b/app/code/core/Mage/XmlConnect/Block/Cart/Paypal/Mecl/Review.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Cart/Paypal/Mecl/Shippingmethods.php b/app/code/core/Mage/XmlConnect/Block/Cart/Paypal/Mecl/Shippingmethods.php index 60c408b61791826029c6544dde4c266b6a45162f..16f70fd6e2ec6da035cf48e37fae2d11517d27c8 100644 --- a/app/code/core/Mage/XmlConnect/Block/Cart/Paypal/Mecl/Shippingmethods.php +++ b/app/code/core/Mage/XmlConnect/Block/Cart/Paypal/Mecl/Shippingmethods.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Cart/Paypal/Mep/Totals.php b/app/code/core/Mage/XmlConnect/Block/Cart/Paypal/Mep/Totals.php index 4803a82aa777e261031cefc63364c84ed7d73726..0640cd87eceb6a42ec8122a5283444bfe4d7edef 100644 --- a/app/code/core/Mage/XmlConnect/Block/Cart/Paypal/Mep/Totals.php +++ b/app/code/core/Mage/XmlConnect/Block/Cart/Paypal/Mep/Totals.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Cart/Totals.php b/app/code/core/Mage/XmlConnect/Block/Cart/Totals.php index 0453a5f78fa7aeae3a5bb7ec5b58bcc4a4eb42e7..76995d4a71dabaf123d3f1ab4c4b7072c709be01 100644 --- a/app/code/core/Mage/XmlConnect/Block/Cart/Totals.php +++ b/app/code/core/Mage/XmlConnect/Block/Cart/Totals.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -112,7 +112,7 @@ class Mage_XmlConnect_Block_Cart_Totals extends Mage_Checkout_Block_Cart_Totals $title = $this->__('Gift Card (%s)', $cardCode['c']); $value = $cardCode['c']; $totalXmlObj = $totalsXmlObj->addChild($code); - $totalXmlObj->addChild('title', $totalsXmlObj->xmlentities($title)); + $totalXmlObj->addChild('title', $totalsXmlObj->escapeXml($title)); $totalXmlObj->addChild('value', $value); $value = Mage::helper('Mage_XmlConnect_Helper_Data')->formatPriceForXml($cardCode['a']); $formattedValue = $this->getQuote()->getStore()->formatPrice($value, false); @@ -149,7 +149,7 @@ class Mage_XmlConnect_Block_Cart_Totals extends Mage_Checkout_Block_Cart_Totals { $value = Mage::helper('Mage_XmlConnect_Helper_Data')->formatPriceForXml($value); $totalXmlObj = $totalsXmlObj->addChild($code); - $totalXmlObj->addChild('title', $totalsXmlObj->xmlentities($title)); + $totalXmlObj->addChild('title', $totalsXmlObj->escapeXml($title)); $formattedValue = $this->getQuote()->getStore()->formatPrice($value, false); $totalXmlObj->addChild('value', $value); $totalXmlObj->addChild('formated_value', $formattedValue); diff --git a/app/code/core/Mage/XmlConnect/Block/Catalog.php b/app/code/core/Mage/XmlConnect/Block/Catalog.php index 0ee1a1953dae0c4bf2d65c3c98e53fcae26e6e87..8147086631d17e45400d260b2538a9b398ad16fa 100644 --- a/app/code/core/Mage/XmlConnect/Block/Catalog.php +++ b/app/code/core/Mage/XmlConnect/Block/Catalog.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -67,7 +67,7 @@ class Mage_XmlConnect_Block_Catalog extends Mage_Core_Block_Template $item->addAttribute('isDefault', 1); } $item->addChild('code', $code); - $item->addChild('name', $ordersXmlObject->xmlentities(strip_tags($name))); + $item->addChild('name', $ordersXmlObject->escapeXml($name)); } return $ordersXmlObject; diff --git a/app/code/core/Mage/XmlConnect/Block/Catalog/Category.php b/app/code/core/Mage/XmlConnect/Block/Catalog/Category.php index 30c9e88c12035927d57700b2dfbd90af86bd1b39..3f40326ae907c7bd7211dc6be52cd93eea7268a2 100644 --- a/app/code/core/Mage/XmlConnect/Block/Catalog/Category.php +++ b/app/code/core/Mage/XmlConnect/Block/Catalog/Category.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -78,7 +78,7 @@ class Mage_XmlConnect_Block_Catalog_Category extends Mage_XmlConnect_Block_Catal $item = Mage::getModel('Mage_Catalog_Model_Category')->load($item->getId()); $itemXmlObj = $itemsXmlObj->addChild('item'); - $itemXmlObj->addChild('label', $categoryXmlObj->xmlentities($item->getName())); + $itemXmlObj->addChild('label', $categoryXmlObj->escapeXml($item->getName())); $itemXmlObj->addChild('entity_id', $item->getId()); $itemXmlObj->addChild('content_type', $item->hasChildren() ? 'categories' : 'products'); if (!is_null($categoryId)) { diff --git a/app/code/core/Mage/XmlConnect/Block/Catalog/Category/Info.php b/app/code/core/Mage/XmlConnect/Block/Catalog/Category/Info.php index 7ecc09b293f7d58851dc6531f2c4927f88f20c39..535f46bb862649b23dbebad86f32c070a455930d 100644 --- a/app/code/core/Mage/XmlConnect/Block/Catalog/Category/Info.php +++ b/app/code/core/Mage/XmlConnect/Block/Catalog/Category/Info.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -50,7 +50,7 @@ class Mage_XmlConnect_Block_Catalog_Category_Info extends Mage_XmlConnect_Block_ */ $title = $this->__('Shop'); if ($category->getParentCategory()->getLevel() > 1) { - $title = $infoXmlObj->xmlentities($category->getParentCategory()->getName()); + $title = $infoXmlObj->escapeXml($category->getParentCategory()->getName()); } $infoXmlObj->addChild('parent_title', $title); diff --git a/app/code/core/Mage/XmlConnect/Block/Catalog/Filters.php b/app/code/core/Mage/XmlConnect/Block/Catalog/Filters.php index 908dde3513d4d60812426b0c8fe48ca2c31944c1..436929f5d6cf3f7e3b6fee666a118216bdef486e 100644 --- a/app/code/core/Mage/XmlConnect/Block/Catalog/Filters.php +++ b/app/code/core/Mage/XmlConnect/Block/Catalog/Filters.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -51,14 +51,14 @@ class Mage_XmlConnect_Block_Catalog_Filters extends Mage_XmlConnect_Block_Catalo continue; } $itemXmlObj = $filtersXmlObj->addChild('item'); - $itemXmlObj->addChild('name', $categoryXmlObj->xmlentities($item->getName())); - $itemXmlObj->addChild('code', $categoryXmlObj->xmlentities($item->getCode())); + $itemXmlObj->addChild('name', $categoryXmlObj->escapeXml($item->getName())); + $itemXmlObj->addChild('code', $categoryXmlObj->escapeXml($item->getCode())); $valuesXmlObj = $itemXmlObj->addChild('values'); foreach ($item->getValues() as $value) { $valueXmlObj = $valuesXmlObj->addChild('value'); - $valueXmlObj->addChild('id', $categoryXmlObj->xmlentities($value->getValueString())); - $valueXmlObj->addChild('label', $categoryXmlObj->xmlentities(strip_tags($value->getLabel()))); + $valueXmlObj->addChild('id', $categoryXmlObj->escapeXml($value->getValueString())); + $valueXmlObj->addChild('label', $categoryXmlObj->escapeXml($value->getLabel())); $valueXmlObj->addChild('count', (int)$value->getProductsCount()); } } diff --git a/app/code/core/Mage/XmlConnect/Block/Catalog/Product.php b/app/code/core/Mage/XmlConnect/Block/Catalog/Product.php index 0bf4810baa03720edc3a9554ccc49b831a1b3399..b403c22197d2eb686728a77547329c49bcdf2444 100644 --- a/app/code/core/Mage/XmlConnect/Block/Catalog/Product.php +++ b/app/code/core/Mage/XmlConnect/Block/Catalog/Product.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -46,9 +46,9 @@ class Mage_XmlConnect_Block_Catalog_Product extends Mage_XmlConnect_Block_Catalo $item = Mage::getModel('Mage_XmlConnect_Model_Simplexml_Element', '<' . $itemNodeName . '></' . $itemNodeName . '>'); if ($product && $product->getId()) { $item->addChild('entity_id', $product->getId()); - $item->addChild('name', $item->xmlentities($product->getName())); + $item->addChild('name', $item->escapeXml($product->getName())); $item->addChild('entity_type', $product->getTypeId()); - $item->addChild('short_description', $item->xmlentities($product->getShortDescription())); + $item->addChild('short_description', $item->escapeXml($product->getShortDescription())); $description = Mage::helper('Mage_XmlConnect_Helper_Data')->htmlize($item->xmlentities($product->getDescription())); $item->addChild('description', $description); $item->addChild('link', $product->getProductUrl()); @@ -81,7 +81,8 @@ class Mage_XmlConnect_Block_Catalog_Product extends Mage_XmlConnect_Block_Catalo /** * If product type is grouped than it has options as its grouped items */ - if ($product->getTypeId() == Mage_Catalog_Model_Product_Type_Grouped::TYPE_CODE) { + if ($product->getTypeId() == Mage_Catalog_Model_Product_Type_Grouped::TYPE_CODE + || $product->getTypeId() == Mage_Catalog_Model_Product_Type_Configurable::TYPE_CODE) { $product->setHasOptions(true); } $item->addChild('has_options', (int)$product->getHasOptions()); @@ -159,4 +160,4 @@ class Mage_XmlConnect_Block_Catalog_Product extends Mage_XmlConnect_Block_Catalo return $productXmlObj->asNiceXml(); } -} +} \ No newline at end of file diff --git a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Attributes.php b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Attributes.php index 0993b8d7cc6a5a261d85faccb41040bdbde6349f..24d1e633e5c3623b737703465c164b08a9d7e2df 100644 --- a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Attributes.php +++ b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Attributes.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Gallery.php b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Gallery.php index 33cf9303b6adcdca3416b3a390152985babb9905..f8196ca3c90e5e66c8ac444450be185a7230cb07 100644 --- a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Gallery.php +++ b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Gallery.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/List.php b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/List.php index 6e0e95660acce69efc0c1d601642fe730610326c..638d599b174943ebe8d1046b76db0fd9dccc17e1 100644 --- a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/List.php +++ b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/List.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options.php b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options.php index 40187b0e42402a84cdf341dbada1acbaec46dbe3..601e018e4c826ea97fa567b11ed37e2a73775c6b 100644 --- a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options.php +++ b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -87,7 +87,7 @@ class Mage_XmlConnect_Block_Catalog_Product_Options extends Mage_XmlConnect_Bloc } $optionNode->addAttribute('code', $code); $optionNode->addAttribute('type', $type); - $optionNode->addAttribute('label', $xmlModel->xmlentities($option->getTitle())); + $optionNode->addAttribute('label', $xmlModel->escapeXml($option->getTitle())); if ($option->getIsRequire()) { $optionNode->addAttribute('is_required', 1); } @@ -105,7 +105,7 @@ class Mage_XmlConnect_Block_Catalog_Product_Options extends Mage_XmlConnect_Bloc foreach ($option->getValues() as $value) { $valueNode = $optionNode->addChild('value'); $valueNode->addAttribute('code', $value->getId()); - $valueNode->addAttribute('label', $xmlModel->xmlentities($value->getTitle())); + $valueNode->addAttribute('label', $xmlModel->escapeXml($value->getTitle())); if ($value->getPrice() != 0) { $price = Mage::helper('Mage_XmlConnect_Helper_Data')->formatPriceForXml($value->getPrice()); diff --git a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Bundle.php b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Bundle.php index 5d437e4af1ac21cd731928f81daf71e8b9f81530..1149de2040bcc4fdc2c9ae4c2b61c6ce3c350a48 100644 --- a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Bundle.php +++ b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Bundle.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -80,7 +80,7 @@ class Mage_XmlConnect_Block_Catalog_Product_Options_Bundle extends Mage_XmlConne } $optionNode->addAttribute('code', $code); $optionNode->addAttribute('type', $type); - $optionNode->addAttribute('label', $optionsXmlObj->xmlentities($_option->getTitle())); + $optionNode->addAttribute('label', $optionsXmlObj->escapeXml($_option->getTitle())); if ($_option->getRequired()) { $optionNode->addAttribute('is_required', 1); } @@ -93,7 +93,7 @@ class Mage_XmlConnect_Block_Catalog_Product_Options_Bundle extends Mage_XmlConne $valueNode = $optionNode->addChild('value'); $valueNode->addAttribute('code', $_selection->getSelectionId()); - $valueNode->addAttribute('label', $optionsXmlObj->xmlentities($_selection->getName())); + $valueNode->addAttribute('label', $optionsXmlObj->escapeXml($_selection->getName())); if (!$_option->isMultiSelection()) { if ($_selection->getSelectionCanChangeQty()) { $valueNode->addAttribute('is_qty_editable', 1); diff --git a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Configurable.php b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Configurable.php index 652a614256d82458f2b182abe45fbd88a6685d61..7918147166b9c090d3462c4ed2a029ff8986384a 100644 --- a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Configurable.php +++ b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Configurable.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -131,13 +131,13 @@ class Mage_XmlConnect_Block_Catalog_Product_Options_Configurable extends Mage_Xm $optionNode = $optionsXmlObj->addChild('option'); $optionNode->addAttribute('code', 'super_attribute[' . $id . ']'); $optionNode->addAttribute('type', 'select'); - $optionNode->addAttribute('label', $optionsXmlObj->xmlentities($attribute['label'])); + $optionNode->addAttribute('label', $optionsXmlObj->escapeXml($attribute['label'])); $optionNode->addAttribute('is_required', 1); if ($isFirst) { foreach ($attribute['options'] as $option) { $valueNode = $optionNode->addChild('value'); $valueNode->addAttribute('code', $option['id']); - $valueNode->addAttribute('label', $optionsXmlObj->xmlentities($option['label'])); + $valueNode->addAttribute('label', $optionsXmlObj->escapeXml($option['label'])); if ((float)$option['price'] != 0.00) { $valueNode->addAttribute('price', $option['price']); $valueNode->addAttribute('formated_price', $option['formated_price']); @@ -187,7 +187,7 @@ class Mage_XmlConnect_Block_Catalog_Product_Options_Configurable extends Mage_Xm $_valueNode = $relatedNode->addChild('value'); $_valueNode->addAttribute('code', $option['id']); - $_valueNode->addAttribute('label', $_valueNode->xmlentities($option['label'])); + $_valueNode->addAttribute('label', $_valueNode->escapeXml($option['label'])); if ((float)$option['price'] != 0.00) { $_valueNode->addAttribute('price', $option['price']); $_valueNode->addAttribute('formated_price', $option['formated_price']); diff --git a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Giftcard.php b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Giftcard.php index 0760b5cd4d8b7bc1ee2682537d1a6f461f9e336d..bf77b737a57aa099b1d6227deb8ef6f25dad61a4 100755 --- a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Giftcard.php +++ b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Giftcard.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Grouped.php b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Grouped.php index 0418908d7181452a41fc9889553625671c4f92e6..4c4e154ddca352933170ef7be69968bf4a802f0a 100644 --- a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Grouped.php +++ b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Grouped.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -68,7 +68,7 @@ class Mage_XmlConnect_Block_Catalog_Product_Options_Grouped extends Mage_XmlConn $optionNode->addAttribute('code', 'super_group[' . $_item->getId() . ']'); $optionNode->addAttribute('type', 'product'); - $optionNode->addAttribute('label', $xmlModel->xmlentities($_item->getName())); + $optionNode->addAttribute('label', $xmlModel->escapeXml($_item->getName())); $optionNode->addAttribute('is_qty_editable', 1); $optionNode->addAttribute('qty', $_item->getQty()*1); diff --git a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Simple.php b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Simple.php index a4e1d42e0e1d92ed9f58d9674e09f78fd17af712..a30022fb199988e4bd4fcaeb5e83c8f94f1c478f 100644 --- a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Simple.php +++ b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Simple.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Virtual.php b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Virtual.php index 8c6b189cd6ec387c6f1bcfd177e89da037b6f6cb..dedeb1f853688a363f0176d5544e3664c50b9d9e 100644 --- a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Virtual.php +++ b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Options/Virtual.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Price.php b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Price.php index 47b47b9f0ea4ec9e5b2ae34daa194889a0589d11..0ab89777346e969fa8013a0cf09cb73d1651e72c 100644 --- a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Price.php +++ b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Price.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Price/Bundle.php b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Price/Bundle.php index 20f02386cc5e711d234f390e3ec04d933a2fb661..c6dc64a717fa9bc2d62507806ed14460229acb7f 100644 --- a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Price/Bundle.php +++ b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Price/Bundle.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -104,7 +104,7 @@ class Mage_XmlConnect_Block_Catalog_Product_Price_Bundle extends Mage_Bundle_Blo } $weeeItemXmlObj = $weeeXmlObj->addChild('item'); $weeeItemXmlObj->addAttribute( - 'name', $weeeItemXmlObj->xmlentities($_weeeTaxAttribute->getName()) + 'name', $weeeItemXmlObj->escapeXml($_weeeTaxAttribute->getName()) ); $weeeItemXmlObj->addAttribute( 'amount', $_coreHelper->currency($amount, true, false) @@ -132,7 +132,7 @@ class Mage_XmlConnect_Block_Catalog_Product_Price_Bundle extends Mage_Bundle_Blo } $weeeItemXmlObj = $weeeXmlObj->addChild('item'); $weeeItemXmlObj->addAttribute( - 'name', $weeeItemXmlObj->xmlentities($_weeeTaxAttribute->getName()) + 'name', $weeeItemXmlObj->escapeXml($_weeeTaxAttribute->getName()) ); $weeeItemXmlObj->addAttribute( 'amount', $_coreHelper->currency($amount, true, false) @@ -168,7 +168,7 @@ class Mage_XmlConnect_Block_Catalog_Product_Price_Bundle extends Mage_Bundle_Blo } $weeeItemXmlObj = $weeeXmlObj->addChild('item'); $weeeItemXmlObj->addAttribute( - 'name', $weeeItemXmlObj->xmlentities($_weeeTaxAttribute->getName()) + 'name', $weeeItemXmlObj->escapeXml($_weeeTaxAttribute->getName()) ); $weeeItemXmlObj->addAttribute( 'amount', $_coreHelper->currency($amount, true, false) @@ -194,7 +194,7 @@ class Mage_XmlConnect_Block_Catalog_Product_Price_Bundle extends Mage_Bundle_Blo } $weeeItemXmlObj = $weeeXmlObj->addChild('item'); $weeeItemXmlObj->addAttribute( - 'name', $weeeItemXmlObj->xmlentities($_weeeTaxAttribute->getName()) + 'name', $weeeItemXmlObj->escapeXml($_weeeTaxAttribute->getName()) ); $weeeItemXmlObj->addAttribute('amount', $_coreHelper->currency($amount, true, false)); } @@ -237,7 +237,7 @@ class Mage_XmlConnect_Block_Catalog_Product_Price_Bundle extends Mage_Bundle_Blo } $weeeItemXmlObj = $weeeXmlObj->addChild('item'); $weeeItemXmlObj->addAttribute( - 'name', $weeeItemXmlObj->xmlentities($_weeeTaxAttribute->getName()) + 'name', $weeeItemXmlObj->escapeXml($_weeeTaxAttribute->getName()) ); $weeeItemXmlObj->addAttribute( 'amount', $_coreHelper->currency($amount, true, false) @@ -265,7 +265,7 @@ class Mage_XmlConnect_Block_Catalog_Product_Price_Bundle extends Mage_Bundle_Blo } $weeeItemXmlObj = $weeeXmlObj->addChild('item'); $weeeItemXmlObj->addAttribute( - 'name', $weeeItemXmlObj->xmlentities($_weeeTaxAttribute->getName()) + 'name', $weeeItemXmlObj->escapeXml($_weeeTaxAttribute->getName()) ); $weeeItemXmlObj->addAttribute( 'amount', $_coreHelper->currency($amount, true, false) @@ -300,7 +300,7 @@ class Mage_XmlConnect_Block_Catalog_Product_Price_Bundle extends Mage_Bundle_Blo } $weeeItemXmlObj = $weeeXmlObj->addChild('item'); $weeeItemXmlObj->addAttribute( - 'name', $weeeItemXmlObj->xmlentities($_weeeTaxAttribute->getName()) + 'name', $weeeItemXmlObj->escapeXml($_weeeTaxAttribute->getName()) ); $weeeItemXmlObj->addAttribute( 'amount', $_coreHelper->currency($amount, true, false) @@ -328,7 +328,7 @@ class Mage_XmlConnect_Block_Catalog_Product_Price_Bundle extends Mage_Bundle_Blo } $weeeItemXmlObj = $weeeXmlObj->addChild('item'); $weeeItemXmlObj->addAttribute( - 'name', $weeeItemXmlObj->xmlentities($_weeeTaxAttribute->getName()) + 'name', $weeeItemXmlObj->escapeXml($_weeeTaxAttribute->getName()) ); $weeeItemXmlObj->addAttribute( 'amount', $_coreHelper->currency($amount, true, false) diff --git a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Price/Default.php b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Price/Default.php index 21a0878264ed78fe468d8385caf8a6a333b0faaa..3a1c2666506411950eafd4f1a467bc9e76320204 100644 --- a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Price/Default.php +++ b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Price/Default.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -102,7 +102,7 @@ class Mage_XmlConnect_Block_Catalog_Product_Price_Default extends Mage_Catalog_B foreach ($_weeeTaxAttributes as $_weeeTaxAttribute) { $weeeItemXmlObj = $weeeXmlObj->addChild('item'); $weeeItemXmlObj->addAttribute( - 'name', $weeeItemXmlObj->xmlentities($_weeeTaxAttribute->getName()) + 'name', $weeeItemXmlObj->escapeXml($_weeeTaxAttribute->getName()) ); $weeeItemXmlObj->addAttribute( 'amount', $_coreHelper->currency($_weeeTaxAttribute->getAmount(), true, false) @@ -124,7 +124,7 @@ class Mage_XmlConnect_Block_Catalog_Product_Price_Default extends Mage_Catalog_B foreach ($_weeeTaxAttributes as $_weeeTaxAttribute) { $weeeItemXmlObj = $weeeXmlObj->addChild('item'); $weeeItemXmlObj->addAttribute( - 'name', $weeeItemXmlObj->xmlentities($_weeeTaxAttribute->getName()) + 'name', $weeeItemXmlObj->escapeXml($_weeeTaxAttribute->getName()) ); $weeeItemXmlObj->addAttribute('amount', $_coreHelper->currency( $_weeeTaxAttribute->getAmount() + $_weeeTaxAttribute->getTaxAmount(), true, false @@ -139,7 +139,7 @@ class Mage_XmlConnect_Block_Catalog_Product_Price_Default extends Mage_Catalog_B foreach ($_weeeTaxAttributes as $_weeeTaxAttribute) { $weeeItemXmlObj = $weeeXmlObj->addChild('item'); $weeeItemXmlObj->addAttribute( - 'name', $weeeItemXmlObj->xmlentities($_weeeTaxAttribute->getName()) + 'name', $weeeItemXmlObj->escapeXml($_weeeTaxAttribute->getName()) ); $weeeItemXmlObj->addAttribute( 'amount', $_coreHelper->currency($_weeeTaxAttribute->getAmount(), true, false) @@ -178,7 +178,7 @@ class Mage_XmlConnect_Block_Catalog_Product_Price_Default extends Mage_Catalog_B foreach ($_weeeTaxAttributes as $_weeeTaxAttribute) { $weeeItemXmlObj = $weeeXmlObj->addChild('item'); $weeeItemXmlObj->addAttribute( - 'name', $weeeItemXmlObj->xmlentities($_weeeTaxAttribute->getName()) + 'name', $weeeItemXmlObj->escapeXml($_weeeTaxAttribute->getName()) ); $weeeItemXmlObj->addAttribute( 'amount', $_coreHelper->currency($_weeeTaxAttribute->getAmount(), true, false) @@ -197,7 +197,7 @@ class Mage_XmlConnect_Block_Catalog_Product_Price_Default extends Mage_Catalog_B foreach ($_weeeTaxAttributes as $_weeeTaxAttribute) { $weeeItemXmlObj = $weeeXmlObj->addChild('item'); $weeeItemXmlObj->addAttribute( - 'name', $weeeItemXmlObj->xmlentities($_weeeTaxAttribute->getName()) + 'name', $weeeItemXmlObj->escapeXml($_weeeTaxAttribute->getName()) ); $weeeItemXmlObj->addAttribute('amount', $_coreHelper->currency( $_weeeTaxAttribute->getAmount() + $_weeeTaxAttribute->getTaxAmount(), true, false @@ -214,7 +214,7 @@ class Mage_XmlConnect_Block_Catalog_Product_Price_Default extends Mage_Catalog_B foreach ($_weeeTaxAttributes as $_weeeTaxAttribute) { $weeeItemXmlObj = $weeeXmlObj->addChild('item'); $weeeItemXmlObj->addAttribute( - 'name', $weeeItemXmlObj->xmlentities($_weeeTaxAttribute->getName()) + 'name', $weeeItemXmlObj->escapeXml($_weeeTaxAttribute->getName()) ); $weeeItemXmlObj->addAttribute( 'amount', $_coreHelper->currency($_weeeTaxAttribute->getAmount(), true, false) @@ -267,7 +267,7 @@ class Mage_XmlConnect_Block_Catalog_Product_Price_Default extends Mage_Catalog_B foreach ($_weeeTaxAttributes as $_weeeTaxAttribute) { $weeeItemXmlObj = $weeeXmlObj->addChild('item'); $weeeItemXmlObj->addAttribute( - 'name', $weeeItemXmlObj->xmlentities($_weeeTaxAttribute->getName()) + 'name', $weeeItemXmlObj->escapeXml($_weeeTaxAttribute->getName()) ); $weeeItemXmlObj->addAttribute('amount', $_coreHelper->currency( $_weeeTaxAttribute->getAmount(), true, false @@ -292,7 +292,7 @@ class Mage_XmlConnect_Block_Catalog_Product_Price_Default extends Mage_Catalog_B foreach ($_weeeTaxAttributes as $_weeeTaxAttribute) { $weeeItemXmlObj = $weeeXmlObj->addChild('item'); $weeeItemXmlObj->addAttribute( - 'name', $weeeItemXmlObj->xmlentities($_weeeTaxAttribute->getName()) + 'name', $weeeItemXmlObj->escapeXml($_weeeTaxAttribute->getName()) ); $weeeItemXmlObj->addAttribute('amount', $_coreHelper->currency( $_weeeTaxAttribute->getAmount() + $_weeeTaxAttribute->getTaxAmount(), true, false @@ -313,7 +313,7 @@ class Mage_XmlConnect_Block_Catalog_Product_Price_Default extends Mage_Catalog_B foreach ($_weeeTaxAttributes as $_weeeTaxAttribute) { $weeeItemXmlObj = $weeeXmlObj->addChild('item'); $weeeItemXmlObj->addAttribute( - 'name', $weeeItemXmlObj->xmlentities($_weeeTaxAttribute->getName()) + 'name', $weeeItemXmlObj->escapeXml($_weeeTaxAttribute->getName()) ); $weeeItemXmlObj->addAttribute('amount', $_coreHelper->currency( $_weeeTaxAttribute->getAmount(), true, false diff --git a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Price/Giftcard.php b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Price/Giftcard.php index 8ab6419f6b7475da7fe8b2536604f62632fec133..bbdb69bb43007d808e52705be50101f896ab75a1 100755 --- a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Price/Giftcard.php +++ b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Price/Giftcard.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Related.php b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Related.php index efcfe55ccdc20a01aeb075451e08b5a2434e8f25..b7f1c281999935815446f6f32cace4ea0e0dbe85 100644 --- a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Related.php +++ b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Related.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Review.php b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Review.php index a1a28fb4aef171a46210d7bb463c599870b3b637..9a876d6c9564a8f5c9a5005e64df1812cfe8f259 100644 --- a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Review.php +++ b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Review.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -52,9 +52,9 @@ class Mage_XmlConnect_Block_Catalog_Product_Review extends Mage_XmlConnect_Block if ($review->getId()) { $item->addChild('review_id', $review->getId()); $item->addChild('created_at', $this->formatDate($review->getCreatedAt())); - $item->addChild('title', $item->xmlentities($review->getTitle())); - $item->addChild('nickname', $item->xmlentities($review->getNickname())); - $detail = $item->xmlentities($review->getDetail()); + $item->addChild('title', $item->escapeXml($review->getTitle())); + $item->addChild('nickname', $item->escapeXml($review->getNickname())); + $detail = $item->escapeXml($review->getDetail()); if ($itemNodeName == 'item') { $remainder = ''; $deviceType = Mage::helper('Mage_XmlConnect_Helper_Data')->getDeviceType(); diff --git a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Review/List.php b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Review/List.php index e9189f76d42e8139494d998f027792539a6b75c1..666e957e97bdd059d81b055af28227d13d87441d 100644 --- a/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Review/List.php +++ b/app/code/core/Mage/XmlConnect/Block/Catalog/Product/Review/List.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Catalog/Search.php b/app/code/core/Mage/XmlConnect/Block/Catalog/Search.php index 67e371c5930440f61d3a1df8a01e4d178d61ed11..a4f621da9b993957e9ae537972b8a2aeab05cc2b 100644 --- a/app/code/core/Mage/XmlConnect/Block/Catalog/Search.php +++ b/app/code/core/Mage/XmlConnect/Block/Catalog/Search.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -96,7 +96,7 @@ class Mage_XmlConnect_Block_Catalog_Search extends Mage_XmlConnect_Block_Catalog continue; } $item = $filtersXmlObject->addChild('item'); - $item->addChild('name', $searchXmlObject->xmlentities($filter->getName())); + $item->addChild('name', $searchXmlObject->escapeXml($filter->getName())); $item->addChild('code', $filter->getRequestVar()); $values = $item->addChild('values'); @@ -107,9 +107,7 @@ class Mage_XmlConnect_Block_Catalog_Search extends Mage_XmlConnect_Block_Catalog } $value = $values->addChild('value'); $value->addChild('id', $valueItem->getValueString()); - $value->addChild( - 'label', $searchXmlObject->xmlentities(strip_tags($valueItem->getLabel())) - ); + $value->addChild('label', $searchXmlObject->escapeXml($valueItem->getLabel())); $value->addChild('count', $count); } } diff --git a/app/code/core/Mage/XmlConnect/Block/Catalog/Search/Suggest.php b/app/code/core/Mage/XmlConnect/Block/Catalog/Search/Suggest.php index 31b8f5ceb92e8cea49604dc765e6928aed4c7d8d..d46156adb77cf62a8a7b64342eb38540d0b2215b 100644 --- a/app/code/core/Mage/XmlConnect/Block/Catalog/Search/Suggest.php +++ b/app/code/core/Mage/XmlConnect/Block/Catalog/Search/Suggest.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -58,7 +58,7 @@ class Mage_XmlConnect_Block_Catalog_Search_Suggest extends Mage_CatalogSearch_Bl $items = ''; foreach ($suggestData as $item) { - $items .= $suggestXmlObj->xmlentities(strip_tags($item['title'])) . self::SUGGEST_ITEM_SEPARATOR + $items .= $suggestXmlObj->escapeXml($item['title']) . self::SUGGEST_ITEM_SEPARATOR . (int)$item['num_of_results'] . self::SUGGEST_ITEM_SEPARATOR; } diff --git a/app/code/core/Mage/XmlConnect/Block/Checkout/Address/Billing.php b/app/code/core/Mage/XmlConnect/Block/Checkout/Address/Billing.php index baec11a43529914bae8ea66faa4360e8bf5f88ec..a69a8cf485890dcebc7c21be72874b2ee4c2577d 100644 --- a/app/code/core/Mage/XmlConnect/Block/Checkout/Address/Billing.php +++ b/app/code/core/Mage/XmlConnect/Block/Checkout/Address/Billing.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -55,7 +55,7 @@ class Mage_XmlConnect_Block_Checkout_Address_Billing extends Mage_Checkout_Block } $this->getChild('address_list')->prepareAddressData($address, $item); $item->addChild( - 'address_line', $billingXmlObj->xmlentities($address->format('oneline')) + 'address_line', $billingXmlObj->escapeXml($address->format('oneline')) ); } diff --git a/app/code/core/Mage/XmlConnect/Block/Checkout/Address/Form.php b/app/code/core/Mage/XmlConnect/Block/Checkout/Address/Form.php index 20ec75f1d3b6c3fd861d910888424e7902317ea1..2beec2ad5e637a11bd99f3573e778810dbda56ce 100644 --- a/app/code/core/Mage/XmlConnect/Block/Checkout/Address/Form.php +++ b/app/code/core/Mage/XmlConnect/Block/Checkout/Address/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Checkout/Address/Shipping.php b/app/code/core/Mage/XmlConnect/Block/Checkout/Address/Shipping.php index 8e6c40a1e0e8732d069bb4ba958cdb78331c69c2..f6b9d66968a2885df9c99568628e84b8bd46bba6 100644 --- a/app/code/core/Mage/XmlConnect/Block/Checkout/Address/Shipping.php +++ b/app/code/core/Mage/XmlConnect/Block/Checkout/Address/Shipping.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -54,7 +54,7 @@ class Mage_XmlConnect_Block_Checkout_Address_Shipping extends Mage_Checkout_Bloc $item->addAttribute('selected', 1); } $this->getChild('address_list')->prepareAddressData($address, $item); - $item->addChild('address_line', $shippingXmlObj->xmlentities($address->format('oneline'))); + $item->addChild('address_line', $shippingXmlObj->escapeXml($address->format('oneline'))); } return $shippingXmlObj->asNiceXml(); diff --git a/app/code/core/Mage/XmlConnect/Block/Checkout/Agreements.php b/app/code/core/Mage/XmlConnect/Block/Checkout/Agreements.php index 84f6a37fb8b89cc3c7fae1141a407ab388c37c4b..6521d7388561b10870735a55f19847cdd924b0c1 100644 --- a/app/code/core/Mage/XmlConnect/Block/Checkout/Agreements.php +++ b/app/code/core/Mage/XmlConnect/Block/Checkout/Agreements.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -40,15 +40,18 @@ class Mage_XmlConnect_Block_Checkout_Agreements extends Mage_Checkout_Block_Agre */ protected function _toHtml() { + /** @var $agreementsXmlObj Mage_XmlConnect_Model_Simplexml_Element */ $agreementsXmlObj = Mage::getModel('Mage_XmlConnect_Model_Simplexml_Element', '<agreements></agreements>'); if ($this->getAgreements()) { foreach ($this->getAgreements() as $agreement) { $itemXmlObj = $agreementsXmlObj->addChild('item'); - $content = $agreementsXmlObj->xmlentities($agreement->getContent()); + $content = $agreement->getContent(); if (!$agreement->getIsHtml()) { - $content = nl2br(strip_tags($content)); + $content = nl2br($agreementsXmlObj->escapeXml($content)); + } else { + $agreementsXmlObj->xmlentities($content); } - $agreementText = $agreementsXmlObj->xmlentities($agreement->getCheckboxText()); + $agreementText = $agreementsXmlObj->escapeXml($agreement->getCheckboxText()); $itemXmlObj->addChild('label', $agreementText); $itemXmlObj->addChild('content', $content); $itemXmlObj->addChild('code', 'agreement[' . $agreement->getId() . ']'); diff --git a/app/code/core/Mage/XmlConnect/Block/Checkout/Order/Review.php b/app/code/core/Mage/XmlConnect/Block/Checkout/Order/Review.php index 87002da20ca8c524ff8c0719ba201aa6dbb1b532..b1136a6373286c7252fd9af2da1621e906d88f2e 100644 --- a/app/code/core/Mage/XmlConnect/Block/Checkout/Order/Review.php +++ b/app/code/core/Mage/XmlConnect/Block/Checkout/Order/Review.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Checkout/Order/Review/Info.php b/app/code/core/Mage/XmlConnect/Block/Checkout/Order/Review/Info.php index 77d8d5552aa806139b820ab764bd7cfb1404780d..07801f06ef13817ce07dbc8021ec14de774122cb 100644 --- a/app/code/core/Mage/XmlConnect/Block/Checkout/Order/Review/Info.php +++ b/app/code/core/Mage/XmlConnect/Block/Checkout/Order/Review/Info.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -60,7 +60,7 @@ class Mage_XmlConnect_Block_Checkout_Order_Review_Info extends Mage_Checkout_Blo $itemXml->addChild('entity_id', $item->getProduct()->getId()); $itemXml->addChild('entity_type', $type); $itemXml->addChild('item_id', $item->getId()); - $itemXml->addChild('name', $itemsXmlObj->xmlentities($renderer->getProductName())); + $itemXml->addChild('name', $itemsXmlObj->escapeXml($renderer->getProductName())); $itemXml->addChild('qty', $renderer->getQty()); $icon = $renderer->getProductThumbnail()->resize( Mage::helper('Mage_XmlConnect_Helper_Image')->getImageSizeForContent('product_small') @@ -174,16 +174,15 @@ class Mage_XmlConnect_Block_Checkout_Order_Review_Info extends Mage_Checkout_Blo /** * Options list */ - if ($_options = $renderer->getOptionList()) { + $_options = $renderer->getOptionList(); + if ($_options) { $itemOptionsXml = $itemXml->addChild('options'); foreach ($_options as $_option) { $_formattedOptionValue = $renderer->getFormatedOptionValue($_option); $optionXml = $itemOptionsXml->addChild('option'); - $labelValue = $itemsXmlObj->xmlentities($_option['label']); + $labelValue = $itemsXmlObj->escapeXml($_option['label']); $optionXml->addAttribute('label', $labelValue); - $textValue = $itemsXmlObj->xmlentities( - strip_tags($_formattedOptionValue['value']) - ); + $textValue = $itemsXmlObj->escapeXml($_formattedOptionValue['value']); $optionXml->addAttribute('text', $textValue); } } diff --git a/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Authorizenet.php b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Authorizenet.php index 26d49c717f9b1055a86cbbd4846754cbebe1e755..ced918a75b9e8a74d6c62fcfe2b3549d849a7119 100644 --- a/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Authorizenet.php +++ b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Authorizenet.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Ccsave.php b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Ccsave.php index be19e88360acad2da32623ae07c0112f8922310a..d7bc8fa01afb8cca5c3dc5f1d333290fd7af4cb6 100644 --- a/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Ccsave.php +++ b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Ccsave.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Checkmo.php b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Checkmo.php index 0bdd7caeb4c79724d6e9b8ddc9c8f0593168acff..0cc603bf92f2eee6dd741fbb2f21ec00bc06a2e3 100644 --- a/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Checkmo.php +++ b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Checkmo.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Authorizenet.php b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Authorizenet.php index 5cc6f656f69f2ab3365e5f4e42c5645373549777..5769e517baba7ee54adbbfd0d8c5c0474d04b199 100755 --- a/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Authorizenet.php +++ b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Authorizenet.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Ccsave.php b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Ccsave.php index 5b49907254e57c20d64e8ecd4b6653aac6667cc6..e0a006bd767dc9c4ccd433892da5ddbf6e96dfff 100755 --- a/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Ccsave.php +++ b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Ccsave.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Checkmo.php b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Checkmo.php index 3cc288f1ab9c183d7913603a56da4dd550a5ec90..d7022533192197f9f3ebb408d7a837b3860c613b 100755 --- a/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Checkmo.php +++ b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Checkmo.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Free.php b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Free.php index 82a9ec85eb37bc3767b4a13a150e687ae921f554..680d6230b212a3243662c790d9ee1981e73d5668 100644 --- a/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Free.php +++ b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Free.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Paypal/Abstract.php b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Paypal/Abstract.php index 807ef7d0694cb32e0347eec299fe9c6cd4f008b1..2017fa0b26779711e0d33bb68def28d90942968e 100644 --- a/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Paypal/Abstract.php +++ b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Paypal/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Paypal/Express.php b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Paypal/Express.php index 1979debbd7e2fa969fb342c8ced6b09bc2a230f8..f9d783d8dc08d2e56cee357bd8d164f9213c4a73 100644 --- a/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Paypal/Express.php +++ b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Paypal/Express.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Paypal/Mecl.php b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Paypal/Mecl.php index ea2eec0dbb0dc64e7b178928f5c6dd452e0b2dee..f20cb7cc97b1988061495cce4c7f0809abc8556f 100644 --- a/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Paypal/Mecl.php +++ b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Paypal/Mecl.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Pbridge/Authorizenet.php b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Pbridge/Authorizenet.php index d0f6362706e325a49e3337901179e25b16dec703..bd9b9557987e518c6f49d9b5d15b1b5425326367 100644 --- a/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Pbridge/Authorizenet.php +++ b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Pbridge/Authorizenet.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Pbridge/Paypal/Direct.php b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Pbridge/Paypal/Direct.php index dd5080b97f9ad6a15f739f2b98e8c163b01310fd..c059afb4044e6d2ed2d009951ad27d2aaee65645 100644 --- a/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Pbridge/Paypal/Direct.php +++ b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Pbridge/Paypal/Direct.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Pbridge/Paypaluk/Direct.php b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Pbridge/Paypaluk/Direct.php index 3b885046dc1d83716d463c11cde08073d3c09206..f721725c9ebda491e171c29c42c0ede07e676dc2 100644 --- a/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Pbridge/Paypaluk/Direct.php +++ b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Pbridge/Paypaluk/Direct.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Pbridge/Verisign.php b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Pbridge/Verisign.php index d614df0d699224c0f4e7cc7f5c03119fdacb6686..1626d14502f73073197547b2853ef213b4f84536 100644 --- a/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Pbridge/Verisign.php +++ b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Pbridge/Verisign.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Purchaseorder.php b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Purchaseorder.php index e3b652f5013ccb3f4dace79a9359af62e774a90c..8bc7dfb4bc9e1fde42bd380c861e1e8de4194a5a 100755 --- a/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Purchaseorder.php +++ b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Info/Purchaseorder.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/List.php b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/List.php index 2c2a2eb51cd637d9aa870f05a8eab9b8c261dd61..710b094276a1b2dca37d4ef8d7f232d60cf0c29f 100644 --- a/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/List.php +++ b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/List.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -289,7 +289,7 @@ class Mage_XmlConnect_Block_Checkout_Payment_Method_List extends Mage_Payment_Bl $methodItemXmlObj = $methodsXmlObj->addChild('method'); $methodItemXmlObj->addAttribute('post_name', 'payment[method]'); $methodItemXmlObj->addAttribute('code', $method->getCode()); - $methodItemXmlObj->addAttribute('label', $methodsXmlObj->xmlentities($method->getTitle())); + $methodItemXmlObj->addAttribute('label', $methodsXmlObj->escapeXml($method->getTitle())); if ($this->getQuote()->getPayment()->getMethod() == $method->getCode()) { $methodItemXmlObj->addAttribute('selected', 1); } diff --git a/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Paypal/Direct.php b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Paypal/Direct.php index 1acace7b3321e34b2324287763da6eb12b0b4a9f..d3ccc54585cfc6742c26c15a6aac52fbc642ce73 100644 --- a/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Paypal/Direct.php +++ b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Paypal/Direct.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Paypal/Payflow.php b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Paypal/Payflow.php index ad219ffc962bcd72680e5ff8957c9759657077d3..b6d4b5230445d92376b8b04805a2c02be8409ca0 100644 --- a/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Paypal/Payflow.php +++ b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Paypal/Payflow.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Pbridge/Abstract.php b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Pbridge/Abstract.php index 7c4da4521f6ee65f1daa782de9eb9194f45eae76..67ebc568fb3cd8a8d9e4658d43f144ea4e8f46d5 100755 --- a/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Pbridge/Abstract.php +++ b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Pbridge/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Purchaseorder.php b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Purchaseorder.php index 200c36c5e986e26f6fafd9e4f75091dc3e7214da..a6a761e444f1fd99de5c0cbf7d80ddd418476cee 100644 --- a/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Purchaseorder.php +++ b/app/code/core/Mage/XmlConnect/Block/Checkout/Payment/Method/Purchaseorder.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Checkout/Pbridge/Result.php b/app/code/core/Mage/XmlConnect/Block/Checkout/Pbridge/Result.php index 48a6f63a03a87ac5b80eb6cae98b2ff1e62278ac..1aa392fd8916dd4f19bdf62757c07eaba9615888 100755 --- a/app/code/core/Mage/XmlConnect/Block/Checkout/Pbridge/Result.php +++ b/app/code/core/Mage/XmlConnect/Block/Checkout/Pbridge/Result.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Checkout/Shipping/Method/Available.php b/app/code/core/Mage/XmlConnect/Block/Checkout/Shipping/Method/Available.php index e1444ae4ce4e0a2f1d3bee3d1f97f0cb58cf1986..0cffb2dfb56925ea0eb9c9825f7554da2a9ac03b 100644 --- a/app/code/core/Mage/XmlConnect/Block/Checkout/Shipping/Method/Available.php +++ b/app/code/core/Mage/XmlConnect/Block/Checkout/Shipping/Method/Available.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -49,16 +49,16 @@ class Mage_XmlConnect_Block_Checkout_Shipping_Method_Available $_sole = count($_shippingRateGroups) == 1; foreach ($_shippingRateGroups as $code => $_rates) { $methodXmlObj = $methodsXmlObj->addChild('method'); - $methodXmlObj->addAttribute('label', $methodsXmlObj->xmlentities($this->getCarrierName($code))); + $methodXmlObj->addAttribute('label', $methodsXmlObj->escapeXml($this->getCarrierName($code))); $ratesXmlObj = $methodXmlObj->addChild('rates'); $_sole = $_sole && count($_rates) == 1; foreach ($_rates as $_rate) { $rateXmlObj = $ratesXmlObj->addChild('rate'); - $rateXmlObj->addAttribute('label', $methodsXmlObj->xmlentities($_rate->getMethodTitle())); + $rateXmlObj->addAttribute('label', $methodsXmlObj->escapeXml($_rate->getMethodTitle())); $rateXmlObj->addAttribute('code', $_rate->getCode()); if ($_rate->getErrorMessage()) { - $rateXmlObj->addChild('error_message', $methodsXmlObj->xmlentities($_rate->getErrorMessage())); + $rateXmlObj->addChild('error_message', $methodsXmlObj->escapeXml($_rate->getErrorMessage())); } else { $price = Mage::helper('Mage_Tax_Helper_Data')->getShippingPrice( $_rate->getPrice(), diff --git a/app/code/core/Mage/XmlConnect/Block/Cms/Page.php b/app/code/core/Mage/XmlConnect/Block/Cms/Page.php index be878e713402b3f398b69a443f5d0c01f68d46df..dabd59c7e29a26f9daf8a79c361a05e61e683f68 100644 --- a/app/code/core/Mage/XmlConnect/Block/Cms/Page.php +++ b/app/code/core/Mage/XmlConnect/Block/Cms/Page.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Configuration.php b/app/code/core/Mage/XmlConnect/Block/Configuration.php index 100f691920e46a8629b98e01437ad1e4540e4e50..983cac0e0d1e1299027ea4de98f5cd6d2d62eba1 100644 --- a/app/code/core/Mage/XmlConnect/Block/Configuration.php +++ b/app/code/core/Mage/XmlConnect/Block/Configuration.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Customer/Address/Form.php b/app/code/core/Mage/XmlConnect/Block/Customer/Address/Form.php index 6fc1f1f6673544c472979c37ffa071d06a476379..1010c5da400512771ca99753f0b1da677b454491 100644 --- a/app/code/core/Mage/XmlConnect/Block/Customer/Address/Form.php +++ b/app/code/core/Mage/XmlConnect/Block/Customer/Address/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -250,12 +250,12 @@ class Mage_XmlConnect_Block_Customer_Address_Form extends Mage_Customer_Block_Ad if ($this->getNameWidgetBlock()->getPrefixOptions() === false) { $contactInfoFieldset->addField($this->getNameWidgetBlock()->getFieldId('prefix'), 'text', array( - 'label' => $this->getNameWidgetBlock()->__('Prefix'), + 'label' => $this->__('Prefix'), 'name' => $this->getNameWidgetBlock()->getFieldName('prefix') ) + $attributes); } else { $contactInfoFieldset->addField($this->getNameWidgetBlock()->getFieldId('prefix'), 'select', array( - 'label' => $this->getNameWidgetBlock()->__('Prefix'), + 'label' => $this->__('Prefix'), 'name' => $this->getNameWidgetBlock()->getFieldName('prefix'), 'options' => $this->getNameWidgetBlock()->getPrefixOptions() ) + $attributes); @@ -284,12 +284,12 @@ class Mage_XmlConnect_Block_Customer_Address_Form extends Mage_Customer_Block_Ad if ($this->getNameWidgetBlock()->getSuffixOptions() === false) { $contactInfoFieldset->addField($this->getNameWidgetBlock()->getFieldId('suffix'), 'text', array( - 'label' => $this->getNameWidgetBlock()->__('Suffix'), + 'label' => $this->__('Suffix'), 'name' => $this->getNameWidgetBlock()->getFieldName('suffix') ) + $attributes); } else { $contactInfoFieldset->addField($this->getNameWidgetBlock()->getFieldId('suffix'), 'select', array( - 'label' => $this->getNameWidgetBlock()->__('Suffix'), + 'label' => $this->__('Suffix'), 'name' => $this->getNameWidgetBlock()->getFieldName('suffix'), 'options' => $this->getNameWidgetBlock()->getSuffixOptions() ) + $attributes); @@ -314,7 +314,7 @@ class Mage_XmlConnect_Block_Customer_Address_Form extends Mage_Customer_Block_Ad ); $contactInfoFieldset->addField($this->getNameWidgetBlock()->getFieldId('middlename'), 'text', array( - 'label' => $this->getNameWidgetBlock()->__('M.I.'), + 'label' => $this->__('M.I.'), 'name' => $this->getNameWidgetBlock()->getFieldName('middlename') ) + $attributes); diff --git a/app/code/core/Mage/XmlConnect/Block/Customer/Address/List.php b/app/code/core/Mage/XmlConnect/Block/Customer/Address/List.php index 6f62ef0c4df4ba0d573a6b1180adafbffd45c5c5..d4492b64dd6644458e5441075e1069f0dd6715f5 100644 --- a/app/code/core/Mage/XmlConnect/Block/Customer/Address/List.php +++ b/app/code/core/Mage/XmlConnect/Block/Customer/Address/List.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -82,10 +82,8 @@ class Mage_XmlConnect_Block_Customer_Address_List extends Mage_Core_Block_Templa * @return array */ public function prepareAddressData( - Mage_Customer_Model_Address $address, - Mage_XmlConnect_Model_Simplexml_Element $item - ) - { + Mage_Customer_Model_Address $address, Mage_XmlConnect_Model_Simplexml_Element $item + ) { if (!$address) { return array(); } @@ -123,7 +121,7 @@ class Mage_XmlConnect_Block_Customer_Address_List extends Mage_Core_Block_Templa if (empty($value)) { continue; } - $item->addChild($key, $item->xmlentities($value)); + $item->addChild($key, $item->escapeXml($value)); } } } diff --git a/app/code/core/Mage/XmlConnect/Block/Customer/Form.php b/app/code/core/Mage/XmlConnect/Block/Customer/Form.php index 331397c30addea9906341b8a32e41f7ee7e12cba..164f4ee46e00d4b2749445ca0693e11087b0bf30 100644 --- a/app/code/core/Mage/XmlConnect/Block/Customer/Form.php +++ b/app/code/core/Mage/XmlConnect/Block/Customer/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -46,32 +46,32 @@ class Mage_XmlConnect_Block_Customer_Form extends Mage_Core_Block_Template $xmlModel = Mage::getModel('Mage_XmlConnect_Model_Simplexml_Element', '<node></node>'); //Enterprise_Customer if ($editFlag == 1 && $customer && $customer->getId()) { - $firstname = $xmlModel->xmlentities($customer->getFirstname()); - $lastname = $xmlModel->xmlentities($customer->getLastname()); - $email = $xmlModel->xmlentities($customer->getEmail()); + $firstname = $xmlModel->escapeXml($customer->getFirstname()); + $lastname = $xmlModel->escapeXml($customer->getLastname()); + $email = $xmlModel->escapeXml($customer->getEmail()); } else { $firstname = $lastname = $email = ''; } if ($editFlag) { $passwordManageXml = ' - <field name="change_password" type="checkbox" label="' . $xmlModel->xmlentities($this->__('Change Password')) . '"/> + <field name="change_password" type="checkbox" label="' . $xmlModel->escapeXml($this->__('Change Password')) . '"/> </fieldset> <fieldset> - <field name="current_password" type="password" label="' . $xmlModel->xmlentities($this->__('Current Password')) . '"/> - <field name="password" type="password" label="' . $xmlModel->xmlentities($this->__('New Password')) . '"/> - <field name="confirmation" type="password" label="' . $xmlModel->xmlentities($this->__('Confirm New Password')) . '"> + <field name="current_password" type="password" label="' . $xmlModel->escapeXml($this->__('Current Password')) . '"/> + <field name="password" type="password" label="' . $xmlModel->escapeXml($this->__('New Password')) . '"/> + <field name="confirmation" type="password" label="' . $xmlModel->escapeXml($this->__('Confirm New Password')) . '"> <validators> - <validator type="confirmation" message="' . $xmlModel->xmlentities($this->__('Regular and confirmation passwords must be equal')) . '">password</validator> + <validator type="confirmation" message="' . $xmlModel->escapeXml($this->__('Regular and confirmation passwords must be equal')) . '">password</validator> </validators> </field> </fieldset>'; } else { $passwordManageXml = ' - <field name="password" type="password" label="' . $xmlModel->xmlentities($this->__('Password')) . '" required="true"/> - <field name="confirmation" type="password" label="' . $xmlModel->xmlentities($this->__('Confirm Password')) . '" required="true"> + <field name="password" type="password" label="' . $xmlModel->escapeXml($this->__('Password')) . '" required="true"/> + <field name="confirmation" type="password" label="' . $xmlModel->escapeXml($this->__('Confirm Password')) . '" required="true"> <validators> - <validator type="confirmation" message="' . $xmlModel->xmlentities($this->__('Regular and confirmation passwords must be equal')) . '">password</validator> + <validator type="confirmation" message="' . $xmlModel->escapeXml($this->__('Regular and confirmation passwords must be equal')) . '">password</validator> </validators> </field> </fieldset>'; @@ -80,11 +80,11 @@ class Mage_XmlConnect_Block_Customer_Form extends Mage_Core_Block_Template $xml = <<<EOT <form name="account_form" method="post"> <fieldset> - <field name="firstname" type="text" label="{$xmlModel->xmlentities($this->__('First Name'))}" required="true" value="$firstname" /> - <field name="lastname" type="text" label="{$xmlModel->xmlentities($this->__('Last Name'))}" required="true" value="$lastname" /> - <field name="email" type="text" label="{$xmlModel->xmlentities($this->__('Email'))}" required="true" value="$email"> + <field name="firstname" type="text" label="{$xmlModel->escapeXml($this->__('First Name'))}" required="true" value="$firstname" /> + <field name="lastname" type="text" label="{$xmlModel->escapeXml($this->__('Last Name'))}" required="true" value="$lastname" /> + <field name="email" type="text" label="{$xmlModel->escapeXml($this->__('Email'))}" required="true" value="$email"> <validators> - <validator type="email" message="{$xmlModel->xmlentities($this->__('Wrong email format'))}"/> + <validator type="email" message="{$xmlModel->escapeXml($this->__('Wrong email format'))}"/> </validators> </field> $passwordManageXml diff --git a/app/code/core/Mage/XmlConnect/Block/Customer/GiftcardCheck.php b/app/code/core/Mage/XmlConnect/Block/Customer/GiftcardCheck.php index dd46184c0e459b6ea1c4ebb43b7fcab11d3054b6..12a467aaecc76754db79ad10b2a5ea855c2b3e9c 100644 --- a/app/code/core/Mage/XmlConnect/Block/Customer/GiftcardCheck.php +++ b/app/code/core/Mage/XmlConnect/Block/Customer/GiftcardCheck.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Customer/Order/Details.php b/app/code/core/Mage/XmlConnect/Block/Customer/Order/Details.php index 21b23f6591cf66ee2fa0cf5e702cd83b03d5aa2e..f70676209888092ab90eb3456fe5322ff14dc948 100755 --- a/app/code/core/Mage/XmlConnect/Block/Customer/Order/Details.php +++ b/app/code/core/Mage/XmlConnect/Block/Customer/Order/Details.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Customer/Order/Item/Renderer/Bundle.php b/app/code/core/Mage/XmlConnect/Block/Customer/Order/Item/Renderer/Bundle.php index 01c67a1d5de7a2d8fae98fc5e5489158a4bab10e..263b85982b1ca2a8f0edda480dc3de51994f5d70 100644 --- a/app/code/core/Mage/XmlConnect/Block/Customer/Order/Item/Renderer/Bundle.php +++ b/app/code/core/Mage/XmlConnect/Block/Customer/Order/Item/Renderer/Bundle.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Customer/Order/Item/Renderer/Default.php b/app/code/core/Mage/XmlConnect/Block/Customer/Order/Item/Renderer/Default.php index f92d2721a4fed3f5f2167201cbd8045a000a45e4..0a09e8a50bdc03d37717339ada3eaae07e9f1662 100644 --- a/app/code/core/Mage/XmlConnect/Block/Customer/Order/Item/Renderer/Default.php +++ b/app/code/core/Mage/XmlConnect/Block/Customer/Order/Item/Renderer/Default.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Customer/Order/Item/Renderer/Downloadable.php b/app/code/core/Mage/XmlConnect/Block/Customer/Order/Item/Renderer/Downloadable.php index be8193579d3f62c4e28f9dbc7007015228384c61..d863d910b4fbd2574af8c17e777127f09fa5aa5b 100644 --- a/app/code/core/Mage/XmlConnect/Block/Customer/Order/Item/Renderer/Downloadable.php +++ b/app/code/core/Mage/XmlConnect/Block/Customer/Order/Item/Renderer/Downloadable.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Customer/Order/Item/Renderer/Grouped.php b/app/code/core/Mage/XmlConnect/Block/Customer/Order/Item/Renderer/Grouped.php index 80024e3b471661b008928a9da355a3a72f29c661..0cc93f53bc4e0a0f3c4e802c5c24859975b77aef 100644 --- a/app/code/core/Mage/XmlConnect/Block/Customer/Order/Item/Renderer/Grouped.php +++ b/app/code/core/Mage/XmlConnect/Block/Customer/Order/Item/Renderer/Grouped.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Customer/Order/Items.php b/app/code/core/Mage/XmlConnect/Block/Customer/Order/Items.php index 795509c56c6c50ed21d653f656fdd432b62ffc62..3c6f03ac86ac9e97d867d10b36bc41505e95ac32 100644 --- a/app/code/core/Mage/XmlConnect/Block/Customer/Order/Items.php +++ b/app/code/core/Mage/XmlConnect/Block/Customer/Order/Items.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Customer/Order/List.php b/app/code/core/Mage/XmlConnect/Block/Customer/Order/List.php index 7077c96dcf84e49ecea97e906e7d569fdb96cc29..5564d0d71f4e08d4bbd7a49315dc828fac1dd9fa 100644 --- a/app/code/core/Mage/XmlConnect/Block/Customer/Order/List.php +++ b/app/code/core/Mage/XmlConnect/Block/Customer/Order/List.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -67,7 +67,7 @@ class Mage_XmlConnect_Block_Customer_Order_List extends Mage_Core_Block_Template $item->addChild('number', $_order->getRealOrderId()); $item->addChild('date', $this->formatDate($_order->getCreatedAtStoreDate())); if ($_order->getShippingAddress()) { - $item->addChild('ship_to', $ordersXmlObj->xmlentities($_order->getShippingAddress()->getName())); + $item->addChild('ship_to', $ordersXmlObj->escapeXml($_order->getShippingAddress()->getName())); } $item->addChild('total', $_order->getOrderCurrency()->formatPrecision( $_order->getGrandTotal(), 2, array(), false, false diff --git a/app/code/core/Mage/XmlConnect/Block/Customer/Order/Totals.php b/app/code/core/Mage/XmlConnect/Block/Customer/Order/Totals.php index f3333e7114d1407c56cd3410f814b2dea29b1f3a..557ce24094c84dd7a2dee43123abbf534a85d86e 100644 --- a/app/code/core/Mage/XmlConnect/Block/Customer/Order/Totals.php +++ b/app/code/core/Mage/XmlConnect/Block/Customer/Order/Totals.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Customer/Order/Totals/Tax.php b/app/code/core/Mage/XmlConnect/Block/Customer/Order/Totals/Tax.php index bacca8d2337a692b4adb08b619e65d1d0faecad9..70fbf92b4ba9bc56f83e36fea3a044df38da4813 100644 --- a/app/code/core/Mage/XmlConnect/Block/Customer/Order/Totals/Tax.php +++ b/app/code/core/Mage/XmlConnect/Block/Customer/Order/Totals/Tax.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Block/Customer/Storecredit.php b/app/code/core/Mage/XmlConnect/Block/Customer/Storecredit.php index 733de723ea90117bb026bdace2a72be2a0189df5..aaa280671e864bc687ad41f007f8b233858ca646 100644 --- a/app/code/core/Mage/XmlConnect/Block/Customer/Storecredit.php +++ b/app/code/core/Mage/XmlConnect/Block/Customer/Storecredit.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -46,10 +46,8 @@ class Mage_XmlConnect_Block_Customer_Storecredit extends Mage_Core_Block_Templat $accountBalance = $this->getLayout() ->addBlock('Enterprise_CustomerBalance_Block_Account_Balance', 'account_balance'); - $customerBalanceHelper = Mage::helper('Enterprise_CustomerBalance_Helper_Data'); - $xmlModel->addCustomChild('balance', null, array( - 'label' => $customerBalanceHelper->__('Your current balance is:'), + 'label' => $this->__('Your current balance is:'), 'value' => $accountBalance->getBalance(), 'formatted_value' => Mage::helper('Mage_Core_Helper_Data')->currency($accountBalance->getBalance(), true, false) )); @@ -59,11 +57,11 @@ class Mage_XmlConnect_Block_Customer_Storecredit extends Mage_Core_Block_Templat if ($accountHistory->canShow() && $accountHistory->getEvents() && count($accountHistory->getEvents())) { $balanceHistory = $xmlModel->addCustomChild('balance_history', null, array( - 'label' => $customerBalanceHelper->__('Balance History'), - 'action_label' => $customerBalanceHelper->__('Action'), - 'balance_change_label' => $customerBalanceHelper->__('Balance Change'), - 'balance_label' => $customerBalanceHelper->__('Balance'), - 'date_label' => $customerBalanceHelper->__('Date') + 'label' => $this->__('Balance History'), + 'action_label' => $this->__('Action'), + 'balance_change_label' => $this->__('Balance Change'), + 'balance_label' => $this->__('Balance'), + 'date_label' => $this->__('Date') )); foreach ($accountHistory->getEvents() as $event) { @@ -88,4 +86,4 @@ class Mage_XmlConnect_Block_Customer_Storecredit extends Mage_Core_Block_Templat return $xmlModel->asNiceXml(); } -} +} \ No newline at end of file diff --git a/app/code/core/Mage/XmlConnect/Block/Home.php b/app/code/core/Mage/XmlConnect/Block/Home.php index 9335d0f1c4ff13864c3466ec9af050a85d6d61bd..f03ca66742cd7f48f055ff53e182808b7093a675 100644 --- a/app/code/core/Mage/XmlConnect/Block/Home.php +++ b/app/code/core/Mage/XmlConnect/Block/Home.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -69,7 +69,7 @@ class Mage_XmlConnect_Block_Home extends Mage_XmlConnect_Block_Catalog /** @var $item Mage_Catalog_Model_Category */ $item = Mage::getModel('Mage_Catalog_Model_Category')->load($item->getId()); $itemXmlObj = $itemsXmlObj->addChild('item'); - $itemXmlObj->addChild('label', $homeXmlObj->xmlentities($item->getName())); + $itemXmlObj->addChild('label', $homeXmlObj->escapeXml($item->getName())); $itemXmlObj->addChild('entity_id', $item->getId()); $itemXmlObj->addChild('content_type', $item->hasChildren() ? 'categories' : 'products'); $icon = Mage::helper('Mage_XmlConnect_Helper_Catalog_Category_Image')->initialize($item, 'thumbnail') diff --git a/app/code/core/Mage/XmlConnect/Block/Review/Form.php b/app/code/core/Mage/XmlConnect/Block/Review/Form.php index e31130b338e2c755bb6b8738dccd4c22db310ad4..00c7fbd714070bfa634e61aa0b829cbc05bf19bb 100644 --- a/app/code/core/Mage/XmlConnect/Block/Review/Form.php +++ b/app/code/core/Mage/XmlConnect/Block/Review/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -55,7 +55,7 @@ class Mage_XmlConnect_Block_Review_Form extends Mage_Core_Block_Template $nickname = ''; if ($customer->getId()) { - $nickname = $xmlReview->xmlentities($customer->getFirstname()); + $nickname = $xmlReview->escapeXml($customer->getFirstname()); } if ($this->getRatings()) { diff --git a/app/code/core/Mage/XmlConnect/Block/Wishlist.php b/app/code/core/Mage/XmlConnect/Block/Wishlist.php index 94bf474c182d0d37251af2bb477d126d077fb60c..f293f14413e416d2eb55d7c3d195316a9bc16758 100644 --- a/app/code/core/Mage/XmlConnect/Block/Wishlist.php +++ b/app/code/core/Mage/XmlConnect/Block/Wishlist.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -70,13 +70,14 @@ class Mage_XmlConnect_Block_Wishlist extends Mage_Wishlist_Block_Customer_Wishli $itemXmlObj->addChild('item_id', $item->getWishlistItemId()); $itemXmlObj->addChild('entity_id', $item->getProductId()); $itemXmlObj->addChild('entity_type_id', $item->getProduct()->getTypeId()); - $itemXmlObj->addChild('name', $wishlistXmlObj->xmlentities($item->getName())); - $itemXmlObj->addChild('in_stock', (int)$item->getProduct()->getIsInStock()); + $itemXmlObj->addChild('name', $wishlistXmlObj->escapeXml($item->getName())); + $itemXmlObj->addChild('in_stock', (int)$item->getProduct()->getStockItem()->getIsInStock()); $itemXmlObj->addChild('is_salable', (int)$item->getProduct()->isSalable()); /** * If product type is grouped than it has options as its grouped items */ - if ($item->getProduct()->getTypeId() == Mage_Catalog_Model_Product_Type_Grouped::TYPE_CODE) { + if ($item->getProduct()->getTypeId() == Mage_Catalog_Model_Product_Type_Grouped::TYPE_CODE + || $item->getProduct()->getTypeId() == Mage_Catalog_Model_Product_Type_Configurable::TYPE_CODE) { $item->getProduct()->setHasOptions(true); } $itemXmlObj->addChild('has_options', (int)$item->getProduct()->getHasOptions()); @@ -89,10 +90,10 @@ class Mage_XmlConnect_Block_Wishlist extends Mage_Wishlist_Block_Customer_Wishli $file = Mage::helper('Mage_XmlConnect_Helper_Data')->urlToPath($icon); $iconXml->addAttribute('modification_time', filemtime($file)); - $description = $wishlistXmlObj->xmlentities(strip_tags($item->getDescription())); + $description = $wishlistXmlObj->escapeXml($item->getDescription()); $itemXmlObj->addChild('description', $description); - $addedDate = $wishlistXmlObj->xmlentities($this->getFormatedDate($item->getAddedAt())); + $addedDate = $wishlistXmlObj->escapeXml($this->getFormatedDate($item->getAddedAt())); $itemXmlObj->addChild('added_date', $addedDate); if ($this->getChild('product_price')) { diff --git a/app/code/core/Mage/XmlConnect/Controller/Action.php b/app/code/core/Mage/XmlConnect/Controller/Action.php index 9bba39debce23bd080866b258653eb3068cda8c9..1e38636849fac92087d592c63bcb06016daed80a 100644 --- a/app/code/core/Mage/XmlConnect/Controller/Action.php +++ b/app/code/core/Mage/XmlConnect/Controller/Action.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Helper/Android.php b/app/code/core/Mage/XmlConnect/Helper/Android.php index e4fa964c089fafa4152f191b0e7e25935a4a679c..4ad8845b4901d4510ebf02ac914c2a2a962e3506 100755 --- a/app/code/core/Mage/XmlConnect/Helper/Android.php +++ b/app/code/core/Mage/XmlConnect/Helper/Android.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Helper/Catalog/Category/Image.php b/app/code/core/Mage/XmlConnect/Helper/Catalog/Category/Image.php index 5799712ada0f8795c4afd913acce0631e78f6b61..33b32d1635982fea563fe398bf3be6cfdc999c38 100644 --- a/app/code/core/Mage/XmlConnect/Helper/Catalog/Category/Image.php +++ b/app/code/core/Mage/XmlConnect/Helper/Catalog/Category/Image.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Helper/Customer/Form/Renderer.php b/app/code/core/Mage/XmlConnect/Helper/Customer/Form/Renderer.php index ea40a65c31bdc8881068cb45ea8554eda76cd6c1..ca3dd410957f302d881e29e13fd025565d72bf9c 100644 --- a/app/code/core/Mage/XmlConnect/Helper/Customer/Form/Renderer.php +++ b/app/code/core/Mage/XmlConnect/Helper/Customer/Form/Renderer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -37,11 +37,11 @@ class Mage_XmlConnect_Helper_Customer_Form_Renderer extends Mage_Core_Helper_Abs * Get title and required attributes for a field * * @param Mage_XmlConnect_Model_Simplexml_Form_Abstract $fieldsetXmlObj - * @param Enterprise_Customer_Block_Form_Renderer_Abstract $blockObject + * @param Enterprise_Eav_Block_Form_Renderer_Abstract $blockObject * @return array */ public function addTitleAndRequiredAttr(Mage_XmlConnect_Model_Simplexml_Form_Abstract $fieldsetXmlObj, - Enterprise_Customer_Block_Form_Renderer_Abstract $blockObject + Enterprise_Eav_Block_Form_Renderer_Abstract $blockObject ) { $attributes = array(); diff --git a/app/code/core/Mage/XmlConnect/Helper/Customer/Order.php b/app/code/core/Mage/XmlConnect/Helper/Customer/Order.php index 7c8983e075d556963830e2b444717261ecc1f0f6..c555e0abfa0a68c5d1047851cbf4d2b00aefd026 100644 --- a/app/code/core/Mage/XmlConnect/Helper/Customer/Order.php +++ b/app/code/core/Mage/XmlConnect/Helper/Customer/Order.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -62,7 +62,7 @@ class Mage_XmlConnect_Helper_Customer_Order extends Mage_Core_Helper_Abstract $typesOfDisplay = $renderer->getTypesOfDisplay(); if ($isIncludeTax) { $nodeName = 'including_tax'; - $nodeLabel = $renderer->__('Incl. Tax'); + $nodeLabel = Mage::helper('Mage_Tax_Helper_Data')->__('Incl. Tax'); $inclPrice = $renderer->helper('Mage_Checkout_Helper_Data')->getPriceInclTax($item); $inclSubtotal = $renderer->helper('Mage_Checkout_Helper_Data')->getSubtotalInclTax($item); @@ -77,7 +77,7 @@ class Mage_XmlConnect_Helper_Customer_Order extends Mage_Core_Helper_Abstract $weeeParams['include'] = $inclPrice; } else { $nodeName = 'excluding_tax'; - $nodeLabel = $renderer->__('Excl. Tax'); + $nodeLabel = Mage::helper('Mage_Tax_Helper_Data')->__('Excl. Tax'); if ($typesOfDisplay[self::PRICE_DISPLAY_TYPE_14]) { $price = $item->getPrice() + $renderer->getWeeeTaxAppliedAmount() @@ -221,19 +221,19 @@ class Mage_XmlConnect_Helper_Customer_Order extends Mage_Core_Helper_Abstract ) { $qty = 1 * $item->getQtyOrdered(); if ($qty > 0) { - $quantityXml->addCustomChild('value', $qty, array('label' => $renderer->__('Ordered'))); + $quantityXml->addCustomChild('value', $qty, array('label' => Mage::helper('Mage_XmlConnect_Helper_Data')->__('Ordered'))); } $qty = 1 * $item->getQtyShipped(); if ($qty > 0) { - $quantityXml->addCustomChild('value', $qty, array('label' => $renderer->__('Shipped'))); + $quantityXml->addCustomChild('value', $qty, array('label' => Mage::helper('Mage_XmlConnect_Helper_Data')->__('Shipped'))); } $qty = 1 * $item->getQtyCanceled(); if ($qty > 0) { - $quantityXml->addCustomChild('value', $qty, array('label' => $renderer->__('Canceled'))); + $quantityXml->addCustomChild('value', $qty, array('label' => Mage::helper('Mage_XmlConnect_Helper_Data')->__('Canceled'))); } $qty = 1 * $item->getQtyRefunded(); if ($qty > 0) { - $quantityXml->addCustomChild('value', $qty, array('label' => $renderer->__('Refunded'))); + $quantityXml->addCustomChild('value', $qty, array('label' => Mage::helper('Mage_XmlConnect_Helper_Data')->__('Refunded'))); } } diff --git a/app/code/core/Mage/XmlConnect/Helper/Data.php b/app/code/core/Mage/XmlConnect/Helper/Data.php index 805c66208944f4af12e7830d7048b0d5abc7ec0c..43b25799690a0bea0cb2d82465b751435362c1f6 100644 --- a/app/code/core/Mage/XmlConnect/Helper/Data.php +++ b/app/code/core/Mage/XmlConnect/Helper/Data.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -43,6 +43,11 @@ class Mage_XmlConnect_Helper_Data extends Mage_Core_Helper_Abstract */ const MESSAGE_TITLE_LENGTH = 255; + /** + * Curl default timeout + */ + const CURLOPT_DEFAULT_TIMEOUT = 60; + /** * List of the keys for xml config that have to be excluded form application config * @@ -425,7 +430,6 @@ class Mage_XmlConnect_Helper_Data extends Mage_Core_Helper_Abstract { $w3cUrl = 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'; return <<<EOT -<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "$w3cUrl"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> @@ -612,13 +616,13 @@ EOT; } try { - $appCode = $queue->getAppCode(); + $applicationId = Mage::getModel('Mage_XmlConnect_Model_Template')->load($queue->getTemplateId())->getApplicationId(); /** @var $app Mage_XmlConnect_Model_Application */ - $app = Mage::getModel('Mage_XmlConnect_Model_Application')->loadByCode($appCode); + $app = Mage::getModel('Mage_XmlConnect_Model_Application')->load($applicationId); if (!$app->getId()) { Mage::throwException( - Mage::helper('Mage_XmlConnect_Helper_Data')->__('Can\'t load application with code "%s"', $appCode) + Mage::helper('Mage_XmlConnect_Helper_Data')->__('Can\'t load application with id "%s"', $applicationId) ); } @@ -627,8 +631,6 @@ EOT; return; } - $userpwd = $app->getUserpwd(); - $sendType = $queue->getData('type'); switch ($sendType) { case Mage_XmlConnect_Model_Queue::MESSAGE_TYPE_AIRMAIL: @@ -643,29 +645,21 @@ EOT; break; } - $curlHandler = curl_init(Mage::getStoreConfig($configPath)); + $curl = new Varien_Http_Adapter_Curl(); + $curl->setConfig($this->_getCurlConfig($app->getUserpwd())); - $httpHeaders = $this->getHttpHeaders(); + $urbanUrl = Mage::getStoreConfig($configPath); + $curl->write( + Zend_Http_Client::POST, $urbanUrl, HTTP_REQUEST_HTTP_VER_1_1, $this->getHttpHeaders(), $params + ); - curl_setopt($curlHandler, CURLOPT_POST, 1); - curl_setopt($curlHandler, CURLOPT_HTTPHEADER, $httpHeaders); - curl_setopt($curlHandler, CURLOPT_POSTFIELDS, $params); - curl_setopt($curlHandler, CURLOPT_RETURNTRANSFER, 1); - curl_setopt($curlHandler, CURLOPT_USERPWD, $userpwd); - curl_setopt($curlHandler, CURLOPT_TIMEOUT, 60); - - // Execute the request. - $result = curl_exec($curlHandler); - $succeeded = curl_errno($curlHandler) == 0 ? true : false; - - // close cURL resource, and free up system resources - curl_close($curlHandler); - - if ($succeeded && (is_null($result) || strtolower($result) == 'null')) { + if ($curl->read() && $curl->getInfo(CURLINFO_HTTP_CODE) == 200) { $queue->setStatus(Mage_XmlConnect_Model_Queue::STATUS_COMPLETED); } - $queue->setIsSent(true); + $curl->close(); + $queue->setIsSent(true); + $queue->save(); return; } catch (Exception $e) { Mage::logException($e); @@ -676,12 +670,23 @@ EOT; /** * Get headers for broadcast message * - * @return string + * @return array */ public function getHttpHeaders() { - $httpHeaders = array('Content-Type: application/json'); - return $httpHeaders; + return array('Content-Type: application/json'); + } + + /** + * Get urban airship curl request configuration + * + * @param string $userPwd + * @param int $timeout + * @return array + */ + protected function _getCurlConfig($userPwd, $timeout = self::CURLOPT_DEFAULT_TIMEOUT) + { + return array ('timeout' => $timeout, 'userpwd' => $userPwd); } /** diff --git a/app/code/core/Mage/XmlConnect/Helper/Image.php b/app/code/core/Mage/XmlConnect/Helper/Image.php index 049b61f35ba346634e4339a40a945d162c1bee98..070d5a8e93628f5a8cb5ebca9dbf7537006bfde3 100644 --- a/app/code/core/Mage/XmlConnect/Helper/Image.php +++ b/app/code/core/Mage/XmlConnect/Helper/Image.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Helper/Ipad.php b/app/code/core/Mage/XmlConnect/Helper/Ipad.php index 05a7237178847e7a2c2329b0adfb9a34fd3d2c40..9458b4724855c19b24ca50a26316b8200ecdc77e 100755 --- a/app/code/core/Mage/XmlConnect/Helper/Ipad.php +++ b/app/code/core/Mage/XmlConnect/Helper/Ipad.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Helper/Iphone.php b/app/code/core/Mage/XmlConnect/Helper/Iphone.php index 29827d45e374cf2a1a1bc4d288aa882ac8b53811..a744e5d8a856a287f28e12c24408ca3f647f671a 100644 --- a/app/code/core/Mage/XmlConnect/Helper/Iphone.php +++ b/app/code/core/Mage/XmlConnect/Helper/Iphone.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Helper/Theme.php b/app/code/core/Mage/XmlConnect/Helper/Theme.php index 63855dbae37f90ffbeb3b6f54a3d4446cdb3c4eb..61cf16e9276d329cdd5d365bae5323de73f35ffe 100644 --- a/app/code/core/Mage/XmlConnect/Helper/Theme.php +++ b/app/code/core/Mage/XmlConnect/Helper/Theme.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Adminhtml/System/Config/Backend/Baseurl.php b/app/code/core/Mage/XmlConnect/Model/Adminhtml/System/Config/Backend/Baseurl.php index a8ebefe46b60764f1e83c13f2383301c65ca37a0..b92be073efc6fb8d2a6ccb594fad055c55cad2d3 100644 --- a/app/code/core/Mage/XmlConnect/Model/Adminhtml/System/Config/Backend/Baseurl.php +++ b/app/code/core/Mage/XmlConnect/Model/Adminhtml/System/Config/Backend/Baseurl.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Adminhtml/System/Config/Backend/Currency/Default.php b/app/code/core/Mage/XmlConnect/Model/Adminhtml/System/Config/Backend/Currency/Default.php index 8802f1f30c4f00fdff64165ff043592b6bffb6d7..a4f7a7452fe7b2c3249706892cc7563f3b9a8013 100644 --- a/app/code/core/Mage/XmlConnect/Model/Adminhtml/System/Config/Backend/Currency/Default.php +++ b/app/code/core/Mage/XmlConnect/Model/Adminhtml/System/Config/Backend/Currency/Default.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Application.php b/app/code/core/Mage/XmlConnect/Model/Application.php index 61677907c3a724744215f8a1f752012297042fac..0b9e7dff75bf69d247e9dc0080da7c81269b6b5d 100644 --- a/app/code/core/Mage/XmlConnect/Model/Application.php +++ b/app/code/core/Mage/XmlConnect/Model/Application.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Catalog/Category/Image.php b/app/code/core/Mage/XmlConnect/Model/Catalog/Category/Image.php index d54cd9a79989c4d3d6bcebe9e2e80f44a567296b..220133eaed4d4444ea7ea44c3cb3150893155d8f 100644 --- a/app/code/core/Mage/XmlConnect/Model/Catalog/Category/Image.php +++ b/app/code/core/Mage/XmlConnect/Model/Catalog/Category/Image.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Catalog/Category/Media/Config.php b/app/code/core/Mage/XmlConnect/Model/Catalog/Category/Media/Config.php index f4b47d32c5f2afc63d8909adc377380b74224a59..7b99a5fc00469e2081b6ec5b830bc4eb1edabec8 100644 --- a/app/code/core/Mage/XmlConnect/Model/Catalog/Category/Media/Config.php +++ b/app/code/core/Mage/XmlConnect/Model/Catalog/Category/Media/Config.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/ConfigData.php b/app/code/core/Mage/XmlConnect/Model/ConfigData.php index 6154d18b2d4dd6abd561019a5a5377f9f8f4d91d..2aa05b250b6eb1331fdb088dda8a54d20b02a4fb 100644 --- a/app/code/core/Mage/XmlConnect/Model/ConfigData.php +++ b/app/code/core/Mage/XmlConnect/Model/ConfigData.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/History.php b/app/code/core/Mage/XmlConnect/Model/History.php index 94b4c97b95a2ad965e44a63c7e835e5088980c00..54143db9c584b25e2f830f9697f7ff18f48151f3 100644 --- a/app/code/core/Mage/XmlConnect/Model/History.php +++ b/app/code/core/Mage/XmlConnect/Model/History.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Observer.php b/app/code/core/Mage/XmlConnect/Model/Observer.php index edd3882ed5ddb31acf260fa6016f2de40a060ae2..e1f3dd5c683b9322784b00efd1ab27fd05351e0b 100644 --- a/app/code/core/Mage/XmlConnect/Model/Observer.php +++ b/app/code/core/Mage/XmlConnect/Model/Observer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -112,8 +112,7 @@ class Mage_XmlConnect_Model_Observer foreach ($collection as $message) { if ($message->getId()) { Mage::helper('Mage_XmlConnect_Helper_Data')->sendBroadcastMessage($message); - $message->save(); } } } -} +} \ No newline at end of file diff --git a/app/code/core/Mage/XmlConnect/Model/Payment/Method/Paypal/Config.php b/app/code/core/Mage/XmlConnect/Model/Payment/Method/Paypal/Config.php index 30ff9fab3ee5b5a95c227e947f537875382a2201..9088db2f0c028db95a75523d2b098cf9ade6f60c 100644 --- a/app/code/core/Mage/XmlConnect/Model/Payment/Method/Paypal/Config.php +++ b/app/code/core/Mage/XmlConnect/Model/Payment/Method/Paypal/Config.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Payment/Method/Paypal/Mecl.php b/app/code/core/Mage/XmlConnect/Model/Payment/Method/Paypal/Mecl.php index fc131055fbfdc40861a8959f4fa9754d0f42a3a0..5193aa2bda023f716ed8b0f841a77bdb33da119f 100644 --- a/app/code/core/Mage/XmlConnect/Model/Payment/Method/Paypal/Mecl.php +++ b/app/code/core/Mage/XmlConnect/Model/Payment/Method/Paypal/Mecl.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Payment/Method/Paypal/Mep.php b/app/code/core/Mage/XmlConnect/Model/Payment/Method/Paypal/Mep.php index 3697ee83bed1fce7502c55932e5358fea309ff0f..beaf1e457cebfd2fe882c099295be461fdb8e154 100644 --- a/app/code/core/Mage/XmlConnect/Model/Payment/Method/Paypal/Mep.php +++ b/app/code/core/Mage/XmlConnect/Model/Payment/Method/Paypal/Mep.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Paypal/Mecl/Checkout.php b/app/code/core/Mage/XmlConnect/Model/Paypal/Mecl/Checkout.php index 02ce8c2ead217216bdaffd325b4394a735d6c61d..ef4cc78dde491d071d51884ed3c6ead7f336c28c 100644 --- a/app/code/core/Mage/XmlConnect/Model/Paypal/Mecl/Checkout.php +++ b/app/code/core/Mage/XmlConnect/Model/Paypal/Mecl/Checkout.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Paypal/Mep/Checkout.php b/app/code/core/Mage/XmlConnect/Model/Paypal/Mep/Checkout.php index 386339e7b23c27ad37e9de37c872fe51afd6f9b1..4d130118f736f35914a4628e47b817167bff68fa 100644 --- a/app/code/core/Mage/XmlConnect/Model/Paypal/Mep/Checkout.php +++ b/app/code/core/Mage/XmlConnect/Model/Paypal/Mep/Checkout.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Preview/Abstract.php b/app/code/core/Mage/XmlConnect/Model/Preview/Abstract.php index b331cffee24e18e669bda680f48db439a5d889ec..f2d54c93b0fb44464234f47f039f4a17b32279f0 100755 --- a/app/code/core/Mage/XmlConnect/Model/Preview/Abstract.php +++ b/app/code/core/Mage/XmlConnect/Model/Preview/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Preview/Android.php b/app/code/core/Mage/XmlConnect/Model/Preview/Android.php index 275b65b639a65dbdadac66a281016ce125a77518..29adb1324428eb749ba58a50dd909eab05413bd5 100755 --- a/app/code/core/Mage/XmlConnect/Model/Preview/Android.php +++ b/app/code/core/Mage/XmlConnect/Model/Preview/Android.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Preview/Ipad.php b/app/code/core/Mage/XmlConnect/Model/Preview/Ipad.php index dd0a124a601166a9c4acac03c0b48b5289e0f14a..a87c55d2a5fa644b96615aabab7aa7105927042f 100755 --- a/app/code/core/Mage/XmlConnect/Model/Preview/Ipad.php +++ b/app/code/core/Mage/XmlConnect/Model/Preview/Ipad.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Preview/Iphone.php b/app/code/core/Mage/XmlConnect/Model/Preview/Iphone.php index 9a946e12e555558eab41af1313a32ab238f83bc4..ecb427aad0dfe83883408094e5bc54455c05daee 100755 --- a/app/code/core/Mage/XmlConnect/Model/Preview/Iphone.php +++ b/app/code/core/Mage/XmlConnect/Model/Preview/Iphone.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Queue.php b/app/code/core/Mage/XmlConnect/Model/Queue.php index 9518b9d22bce8634eac8216d028f232a91b7a9e9..a1aa5eed28b5cb052f9dd52d6310a6a299852610 100755 --- a/app/code/core/Mage/XmlConnect/Model/Queue.php +++ b/app/code/core/Mage/XmlConnect/Model/Queue.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Resource/Application.php b/app/code/core/Mage/XmlConnect/Model/Resource/Application.php index eabdf1efc538de89fc9f08b435e720b777d557d2..acd83b42a702fc0c0540baf82b44f24398084ba1 100755 --- a/app/code/core/Mage/XmlConnect/Model/Resource/Application.php +++ b/app/code/core/Mage/XmlConnect/Model/Resource/Application.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Resource/Application/Collection.php b/app/code/core/Mage/XmlConnect/Model/Resource/Application/Collection.php index 73fc0740cff19336c3f96dccc97b62d8a52c25b8..76a2f26172356a9d2878d0983206edc5fbbaeacc 100755 --- a/app/code/core/Mage/XmlConnect/Model/Resource/Application/Collection.php +++ b/app/code/core/Mage/XmlConnect/Model/Resource/Application/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Resource/Cms/Page/Collection.php b/app/code/core/Mage/XmlConnect/Model/Resource/Cms/Page/Collection.php index 46fd005de2fd70fa9ac771ef2d8d842ed31a64c0..c81b20662917ff03481a857a9fa353780ae74c8a 100755 --- a/app/code/core/Mage/XmlConnect/Model/Resource/Cms/Page/Collection.php +++ b/app/code/core/Mage/XmlConnect/Model/Resource/Cms/Page/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Resource/ConfigData.php b/app/code/core/Mage/XmlConnect/Model/Resource/ConfigData.php index d362abf839af46b8d19e264b56fd584cf91fcd8e..98933031af4542c7f3628b0d5e5f1acede435ff1 100644 --- a/app/code/core/Mage/XmlConnect/Model/Resource/ConfigData.php +++ b/app/code/core/Mage/XmlConnect/Model/Resource/ConfigData.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Resource/ConfigData/Collection.php b/app/code/core/Mage/XmlConnect/Model/Resource/ConfigData/Collection.php index 0d821787938a90822dc1761e1f63ab53b26c3516..99ccc99686baca4d98e60e05bedc1dfd2d34687e 100644 --- a/app/code/core/Mage/XmlConnect/Model/Resource/ConfigData/Collection.php +++ b/app/code/core/Mage/XmlConnect/Model/Resource/ConfigData/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Resource/Filter/Collection.php b/app/code/core/Mage/XmlConnect/Model/Resource/Filter/Collection.php index 99f73c25f1ab49797c5e6d1d8e9e2560707f876c..375a6fb43a448d041bfda6ae2a0365169dfa9b74 100755 --- a/app/code/core/Mage/XmlConnect/Model/Resource/Filter/Collection.php +++ b/app/code/core/Mage/XmlConnect/Model/Resource/Filter/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Resource/History.php b/app/code/core/Mage/XmlConnect/Model/Resource/History.php index fb7d929e9a4035e51e2e8f39818609adbaa2af2e..ff8902b2c830b0721f25b49c4dad6c22dc251007 100755 --- a/app/code/core/Mage/XmlConnect/Model/Resource/History.php +++ b/app/code/core/Mage/XmlConnect/Model/Resource/History.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Resource/History/Collection.php b/app/code/core/Mage/XmlConnect/Model/Resource/History/Collection.php index fc6e369e4f2d541234668947547acb94ccc2de88..8a88027cc189b287d5713bd7eed3f311a63cd7af 100755 --- a/app/code/core/Mage/XmlConnect/Model/Resource/History/Collection.php +++ b/app/code/core/Mage/XmlConnect/Model/Resource/History/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Resource/Queue.php b/app/code/core/Mage/XmlConnect/Model/Resource/Queue.php index da3046042f1a6bcba67ce1ff7a7e21fc1038fc4b..f12c1c70f9663a21701d34be035390f148573773 100755 --- a/app/code/core/Mage/XmlConnect/Model/Resource/Queue.php +++ b/app/code/core/Mage/XmlConnect/Model/Resource/Queue.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Resource/Queue/Collection.php b/app/code/core/Mage/XmlConnect/Model/Resource/Queue/Collection.php index be70461365c7a242b4d9dacf089c438ef8f20281..3b7209ed6c2bc53ce530f7e89d8d8324cf7908c2 100755 --- a/app/code/core/Mage/XmlConnect/Model/Resource/Queue/Collection.php +++ b/app/code/core/Mage/XmlConnect/Model/Resource/Queue/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Resource/Setup.php b/app/code/core/Mage/XmlConnect/Model/Resource/Setup.php index 38fd72590540f6064c250b001ac059ced82bc73a..132cd9817efb451a7f819ff30aec7479c7783fa6 100755 --- a/app/code/core/Mage/XmlConnect/Model/Resource/Setup.php +++ b/app/code/core/Mage/XmlConnect/Model/Resource/Setup.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Resource/Template.php b/app/code/core/Mage/XmlConnect/Model/Resource/Template.php index 68a50a1d48449d4666eeaa217cb808f263b44925..f26503c2f65ebd9e9dd7d8bc8b34639d58c5e4b0 100755 --- a/app/code/core/Mage/XmlConnect/Model/Resource/Template.php +++ b/app/code/core/Mage/XmlConnect/Model/Resource/Template.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Resource/Template/Collection.php b/app/code/core/Mage/XmlConnect/Model/Resource/Template/Collection.php index d6670cb6384b8b008f66e3e44750a264b8ae8082..acd309be2486bf61ecc53f4dcd497326ebedfed6 100755 --- a/app/code/core/Mage/XmlConnect/Model/Resource/Template/Collection.php +++ b/app/code/core/Mage/XmlConnect/Model/Resource/Template/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Simplexml/Element.php b/app/code/core/Mage/XmlConnect/Model/Simplexml/Element.php index 67aea94c7ac995d2c0a808be9d469a666c5d1b2e..884e07ad829415e1f5f7962a4b1e557ff4a8065c 100644 --- a/app/code/core/Mage/XmlConnect/Model/Simplexml/Element.php +++ b/app/code/core/Mage/XmlConnect/Model/Simplexml/Element.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -60,18 +60,55 @@ class Mage_XmlConnect_Model_Simplexml_Element extends Varien_Simplexml_Element return $this; } + /** + * Escape xml entities + * + * @param mixed $data + * @param bool $stripTags + * @param array $allowedTags + * @return mixed + */ + public function escapeXml($data, $stripTags = true, $allowedTags = null) + { + if (is_array($data)) { + $result = array(); + foreach ($data as $item) { + if ($stripTags) { + $item = Mage::helper('Mage_Core_Helper_Data')->stripTags($item, $allowedTags); + } + $result[] = $this->xmlentities($item); + } + } else { + if (is_null($data)) { + $data = $this; + } + $data = (string)$data; + + if ($stripTags) { + $data = Mage::helper('Mage_Core_Helper_Data')->stripTags($data, $allowedTags); + } + $result = $this->xmlentities($data); + } + return $result; + } + /** * Converts meaningful xml character (") to xml attribute specification * * @param string $value + * @param bool $stripTags * @return string|this */ - public function xmlAttribute($value = null) + public function xmlAttribute($value = null, $stripTags = true) { if (is_null($value)) { $value = $this; } $value = (string)$value; + + if ($stripTags) { + $value = Mage::helper('Mage_Core_Helper_Data')->stripTags($value); + } $value = str_replace(array('&', '"', '<', '>'), array('&', '"', '<', '>'), $value); return $value; } diff --git a/app/code/core/Mage/XmlConnect/Model/Simplexml/Form.php b/app/code/core/Mage/XmlConnect/Model/Simplexml/Form.php index 8e58472a9e135c0541235e5faccce957e609e8cf..1fcc360ca79b29a1f5d6fc533a73be9cd55d0f74 100644 --- a/app/code/core/Mage/XmlConnect/Model/Simplexml/Form.php +++ b/app/code/core/Mage/XmlConnect/Model/Simplexml/Form.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Abstract.php b/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Abstract.php index 84f7cb2fca9c282aa6ef29c35e9375e2edd2a588..819e5765372f09af9ed38b73c086e912f96aaafc 100644 --- a/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Abstract.php +++ b/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -182,7 +182,7 @@ class Mage_XmlConnect_Model_Simplexml_Form_Abstract extends Varien_Object public function getElements() { if (empty($this->_elements)) { - $this->_elements = Mage::getModel('Mage_XmlConnect_Model_Simplexml_Form_Element_Collection'); + $this->_elements = Mage::getModel('Mage_XmlConnect_Model_Simplexml_Form_Element_Collection', $this); } return $this->_elements; } diff --git a/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Abstract.php b/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Abstract.php index 2aed90b3343c1d0cbc0b89b05d2f0cf91b72a580..c7be7c237a9a6e5cb0b23f1ca93f875aeb46903b 100644 --- a/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Abstract.php +++ b/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Checkbox.php b/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Checkbox.php index 62bf94a76bddf53b44d1f2eedcb34cf8b3020f8b..ee8fc1605c10e07639ae19525fa5518f944ad127 100644 --- a/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Checkbox.php +++ b/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Checkbox.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Collection.php b/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Collection.php index 0694dd4d9ad8e0cf46d6e3758e77a6135df7aaa9..1ea98bb64faa12bd6b4e94f24f9e31597a4b20e5 100644 --- a/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Collection.php +++ b/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Collection.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/CountryListSelect.php b/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/CountryListSelect.php index 69e54c017fdea8808adea6120cddbf21a3780671..86ecc27e7f9b3929b9cb92ce7136a15415204ebc 100644 --- a/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/CountryListSelect.php +++ b/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/CountryListSelect.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Date.php b/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Date.php index 921364960ff2284feec1ae04b0b445704a5797de..27797d28439e80074f26e6b5cd69da14b7dc6154 100644 --- a/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Date.php +++ b/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Date.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Email.php b/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Email.php index 382b75fdcc93611152ebcfc1951aca0944bd3174..6b00f4b2efbe341ef84fede3698d937fcf15616c 100644 --- a/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Email.php +++ b/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Email.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Fieldset.php b/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Fieldset.php index aa6fa3c0e04c638132b169a7a013b0a87cb93221..865f50d00b9942ee3dc8b45809d206863818df7a 100644 --- a/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Fieldset.php +++ b/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Fieldset.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/File.php b/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/File.php index 286b8ef8f4aefc554c3b968c768321f6f05d3081..d58c73f06b257353af4869e18865fd29fb5bee14 100644 --- a/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/File.php +++ b/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/File.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Image.php b/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Image.php index ca7570af62934825f05c1b7a4a0cde597228e1b2..3203054ec19486adcef3a787adfa7b669dc54aae 100644 --- a/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Image.php +++ b/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Image.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Multiline.php b/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Multiline.php index 3936345f9cc933f57ec42402fb467aa93786719d..4128f130d7243f24d764eeba5a77498edcf8b7ea 100644 --- a/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Multiline.php +++ b/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Multiline.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Multiselect.php b/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Multiselect.php index 7349989dca9dd8f0575bba9dca822262371a1781..2dbc66dad8f5f9b935531d1518bc8e20295a41c1 100644 --- a/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Multiselect.php +++ b/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Multiselect.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Renderer/Interface.php b/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Renderer/Interface.php index c71fd3795a985023485d389218a45ef217a862a3..cf5bdbe481c3f103f84c74d2c4f49eda97ad8646 100644 --- a/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Renderer/Interface.php +++ b/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Renderer/Interface.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Select.php b/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Select.php index 7eda8e14d2e96fda8b60836f376693091402431b..ac5c798b3f5bc69eb411a24bc161ca0153aa6b48 100644 --- a/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Select.php +++ b/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Select.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Text.php b/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Text.php index c664e9c4e0ea77403622721b11fac70e1c08bfa3..38d96a3c736b90bd2899289377b93a2e1633af96 100644 --- a/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Text.php +++ b/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Text.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Textarea.php b/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Textarea.php index 92e1b3c9dae5bb4e92b22258f8c369baa0fc5b31..b342fe9cce89e881a91ce62ba572cea5cec5813d 100644 --- a/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Textarea.php +++ b/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Textarea.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Validator.php b/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Validator.php index 5449685a94abf8fb93da31a8de5fe302399df82d..9faec81d938ab41328c23c5365f156a34b56aaad 100644 --- a/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Validator.php +++ b/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Validator.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Validator/Abstract.php b/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Validator/Abstract.php index c592fc28ed4734995d6a551904c6a6f35e77d320..de63badd5c82512333efeac6b36ab85f881c2e1a 100644 --- a/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Validator/Abstract.php +++ b/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Validator/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -71,22 +71,21 @@ class Mage_XmlConnect_Model_Simplexml_Form_Element_Validator_Abstract */ protected function _setDefaultValidatorTypeMessages() { - $helper = Mage::helper('Mage_XmlConnect_Helper_Data'); $this->_validatorTypeMessages = array( - 'min_length' => $helper->__('Text length does not satisfy specified min text range.'), - 'max_length' => $helper->__('Text length does not satisfy specified max text range.'), - 'alphanumeric' => $helper->__('Please use only letters (a-z or A-Z) or numbers (0-9) only in this field. No spaces or other characters are allowed.'), - 'email' => $helper->__('Please enter a valid email address. For example johndoe@domain.com.'), - 'required' => $helper->__('This is a required field.'), - 'required_select' => $helper->__('Please select an option.'), - 'numeric' => $helper->__('Please use numbers only in this field. Please avoid spaces or other characters such as dots or commas.'), - 'alpha' => $helper->__('Please use letters only (a-z or A-Z) in this field.'), - 'url' => $helper->__('Please enter a valid URL. Protocol is required (http://, https:// or ftp://)'), - 'date' => $helper->__('Please enter a valid date.'), - 'max_file_size' => $helper->__('\'%s\' exceeds the allowed file size: %d (bytes)', $this->getFieldLabel(), $this->getValue()), - 'file_extensions' => $helper->__('\'%s\' is not a valid file extension. Allowed extensions: %s', $this->getFieldLabel(), $this->getValue()), - 'max_image_width' => $helper->__('\'%s\' width exceeds allowed value of %d px', $this->getFieldLabel(), $this->getValue()), - 'max_image_height' => $helper->__('\'%s\' height exceeds allowed value of %d px', $this->getFieldLabel(), $this->getValue()) + 'min_length' => Mage::helper('Mage_XmlConnect_Helper_Data')->__('Text length does not satisfy specified min text range.'), + 'max_length' => Mage::helper('Mage_XmlConnect_Helper_Data')->__('Text length does not satisfy specified max text range.'), + 'alphanumeric' => Mage::helper('Mage_XmlConnect_Helper_Data')->__('Please use only letters (a-z or A-Z) or numbers (0-9) only in this field. No spaces or other characters are allowed.'), + 'email' => Mage::helper('Mage_XmlConnect_Helper_Data')->__('Please enter a valid email address. For example johndoe@domain.com.'), + 'required' => Mage::helper('Mage_XmlConnect_Helper_Data')->__('This is a required field.'), + 'required_select' => Mage::helper('Mage_XmlConnect_Helper_Data')->__('Please select an option.'), + 'numeric' => Mage::helper('Mage_XmlConnect_Helper_Data')->__('Please use numbers only in this field. Please avoid spaces or other characters such as dots or commas.'), + 'alpha' => Mage::helper('Mage_XmlConnect_Helper_Data')->__('Please use letters only (a-z or A-Z) in this field.'), + 'url' => Mage::helper('Mage_XmlConnect_Helper_Data')->__('Please enter a valid URL. Protocol is required (http://, https:// or ftp://)'), + 'date' => Mage::helper('Mage_XmlConnect_Helper_Data')->__('Please enter a valid date.'), + 'max_file_size' => Mage::helper('Mage_XmlConnect_Helper_Data')->__('\'%s\' exceeds the allowed file size: %d (bytes)', $this->getFieldLabel(), $this->getValue()), + 'file_extensions' => Mage::helper('Mage_XmlConnect_Helper_Data')->__('\'%s\' is not a valid file extension. Allowed extensions: %s', $this->getFieldLabel(), $this->getValue()), + 'max_image_width' => Mage::helper('Mage_XmlConnect_Helper_Data')->__('\'%s\' width exceeds allowed value of %d px', $this->getFieldLabel(), $this->getValue()), + 'max_image_height' => Mage::helper('Mage_XmlConnect_Helper_Data')->__('\'%s\' height exceeds allowed value of %d px', $this->getFieldLabel(), $this->getValue()) ); return $this; } diff --git a/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Validator/Rule.php b/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Validator/Rule.php index bd47829a6f23466e31ba5a1dd2b3abf6f95de516..0eee1fcf729c476af186035172f7c2de08a9c8dd 100644 --- a/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Validator/Rule.php +++ b/app/code/core/Mage/XmlConnect/Model/Simplexml/Form/Element/Validator/Rule.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Tabs.php b/app/code/core/Mage/XmlConnect/Model/Tabs.php index fbb8232ff936c3a42cf58b165289432dee638550..9bd968fbd5914711f115c20620b21e2416ff40bc 100644 --- a/app/code/core/Mage/XmlConnect/Model/Tabs.php +++ b/app/code/core/Mage/XmlConnect/Model/Tabs.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Template.php b/app/code/core/Mage/XmlConnect/Model/Template.php index bd11e9e724165a6fc5d57e92074bcf8ca2fe0511..017f1c890721e0ebcb706f9c1fafa884dbfb9293 100755 --- a/app/code/core/Mage/XmlConnect/Model/Template.php +++ b/app/code/core/Mage/XmlConnect/Model/Template.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/Model/Theme.php b/app/code/core/Mage/XmlConnect/Model/Theme.php index c855922f8bcb6bcfa5474e1b677d06c366f89b9c..54d22bf259df9947db71e5513da02c872436ed6c 100644 --- a/app/code/core/Mage/XmlConnect/Model/Theme.php +++ b/app/code/core/Mage/XmlConnect/Model/Theme.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/controllers/Adminhtml/MobileController.php b/app/code/core/Mage/XmlConnect/controllers/Adminhtml/MobileController.php index 5b3df9be47ef295689e2be10aeb40063e6c1541d..eac013491f187d335521305c353c16dddade1ef7 100644 --- a/app/code/core/Mage/XmlConnect/controllers/Adminhtml/MobileController.php +++ b/app/code/core/Mage/XmlConnect/controllers/Adminhtml/MobileController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -317,25 +317,29 @@ class Mage_XmlConnect_Adminhtml_MobileController extends Mage_Adminhtml_Controll protected function _processPostRequest() { try { + /** @var $app Mage_XmlConnect_Model_Application */ $app = Mage::helper('Mage_XmlConnect_Helper_Data')->getApplication(); $params = $app->getSubmitParams(); $appConnectorUrl = Mage::getStoreConfig('xmlconnect/mobile_application/magentocommerce_url'); - $curlHandler = curl_init($appConnectorUrl . $params['key']); - - // set URL and other appropriate options - curl_setopt($curlHandler, CURLOPT_POST, 1); - curl_setopt($curlHandler, CURLOPT_POSTFIELDS, $params); - curl_setopt($curlHandler, CURLOPT_SSL_VERIFYHOST, 2); - curl_setopt($curlHandler, CURLOPT_RETURNTRANSFER, 1); - curl_setopt($curlHandler, CURLOPT_SSL_VERIFYPEER, FALSE); - curl_setopt($curlHandler, CURLOPT_TIMEOUT, 60); - // Execute the request. - $result = curl_exec($curlHandler); - - // close cURL resource, and free up system resources - curl_close($curlHandler); + $curl = new Varien_Http_Adapter_Curl(); + $verifyPeerValue = Mage::getStoreConfig('xmlconnect/mobile_application/curl_ssl_verifypeer'); + $curl->setConfig(array( + 'timeout' => Mage_XmlConnect_Helper_Data::CURLOPT_DEFAULT_TIMEOUT, + 'verifypeer' => $verifyPeerValue, 'verifyhost' => 2, 'header' => false + )); + + $mCommerceUrl = $appConnectorUrl . $params['key']; + $curl->write(Zend_Http_Client::POST, $mCommerceUrl, CURL_HTTP_VERSION_1_1, array(), $params); + + $result = $curl->read(); + if(false === $result) { + Mage::log('Curl error: ' . $curl->getError()); + $curl->close(); + Mage::throwException($this->__('Request internal error.')); + } + $curl->close(); // Assert that we received an expected message in reponse. $resultArray = json_decode($result, true); @@ -1313,13 +1317,13 @@ class Mage_XmlConnect_Adminhtml_MobileController extends Mage_Adminhtml_Controll } if (isset($template)) { - $appCode = $template->getAppCode(); + $applicationId = $template->getApplicationId(); } else { - $appCode = Mage::getModel('Mage_XmlConnect_Model_Template')->load($message->getTemplateId())->getAppCode(); + $applicationId = Mage::getModel('Mage_XmlConnect_Model_Template')->load($message->getTemplateId())->getApplicationId(); } /** @var $app Mage_XmlConnect_Model_Application */ - $app = Mage::getModel('Mage_XmlConnect_Model_Application')->loadByCode($appCode); + $app = Mage::getModel('Mage_XmlConnect_Model_Application')->load($applicationId); if(!$app->isNotificationsActive()) { $this->_getSession()->addError( diff --git a/app/code/core/Mage/XmlConnect/controllers/CartController.php b/app/code/core/Mage/XmlConnect/controllers/CartController.php index 8231e99f98bba507250a23dd19224e8f06ebbc4e..ea9ac81dc5500cb8ca12c7c6bc4e5a74286ae813 100644 --- a/app/code/core/Mage/XmlConnect/controllers/CartController.php +++ b/app/code/core/Mage/XmlConnect/controllers/CartController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/controllers/CatalogController.php b/app/code/core/Mage/XmlConnect/controllers/CatalogController.php index ce777ba163840b6c94f5b81d2e4d2fa24879e2f0..99cac50163ffdc68fafa4329fbc4452ffc97de74 100644 --- a/app/code/core/Mage/XmlConnect/controllers/CatalogController.php +++ b/app/code/core/Mage/XmlConnect/controllers/CatalogController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -295,14 +295,7 @@ class Mage_XmlConnect_CatalogController extends Mage_XmlConnect_Controller_Actio $model->setWebsiteId(Mage::app()->getStore()->getWebsiteId()); Mage::register('send_to_friend_model', $model); -/* - if ($model->getMaxSendsToFriend()) { - $this->_message($this->__('Messages cannot be sent more than %d times in an hour.', - $model->getMaxSendsToFriend()), - self::MESSAGE_STATUS_WARNING); - return $this; - } -*/ + $data = $this->getRequest()->getPost(); if (!$data) { diff --git a/app/code/core/Mage/XmlConnect/controllers/CheckoutController.php b/app/code/core/Mage/XmlConnect/controllers/CheckoutController.php index 3a36dee02340dbeb97d1bc437eb800caee34784a..8547d9ba40d04360920af6ccacc6517e4e41fa64 100644 --- a/app/code/core/Mage/XmlConnect/controllers/CheckoutController.php +++ b/app/code/core/Mage/XmlConnect/controllers/CheckoutController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -333,8 +333,7 @@ class Mage_XmlConnect_CheckoutController extends Mage_XmlConnect_Controller_Acti if (!$result) { Mage::dispatchEvent('checkout_controller_onepage_save_shipping_method', array( - 'request' => $this->getRequest(), - 'quote' => $this->getOnepage()->getQuote() + 'request' => $this->getRequest(), 'quote' => $this->getOnepage()->getQuote() )); $this->getOnepage()->getQuote()->collectTotals()->save(); @@ -344,8 +343,7 @@ class Mage_XmlConnect_CheckoutController extends Mage_XmlConnect_Controller_Acti $result['message'] = array($result['message']); } Mage::dispatchEvent('checkout_controller_onepage_save_shipping_method', array( - 'request' => $this->getRequest(), - 'quote' => $this->getOnepage()->getQuote() + 'request' => $this->getRequest(), 'quote' => $this->getOnepage()->getQuote() )); $this->getOnepage()->getQuote()->collectTotals()->save(); $this->_message(implode('. ', $result['message']), self::MESSAGE_STATUS_ERROR); diff --git a/app/code/core/Mage/XmlConnect/controllers/CmsController.php b/app/code/core/Mage/XmlConnect/controllers/CmsController.php index 0ea582df1ed0772b747b14aa11f44c392e0c6666..e9618778b3b870abe541388caab406813dce01ea 100644 --- a/app/code/core/Mage/XmlConnect/controllers/CmsController.php +++ b/app/code/core/Mage/XmlConnect/controllers/CmsController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/controllers/ConfigurationController.php b/app/code/core/Mage/XmlConnect/controllers/ConfigurationController.php index a8af5651f8c1f938d04095bbf06045e220a6481b..2495bdd5304fa9a6668ba49acc3761f1bcb9e18d 100644 --- a/app/code/core/Mage/XmlConnect/controllers/ConfigurationController.php +++ b/app/code/core/Mage/XmlConnect/controllers/ConfigurationController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/controllers/CustomerController.php b/app/code/core/Mage/XmlConnect/controllers/CustomerController.php index 9b7f939e5e163b8ff7c93add3d09f80bba69060e..6ae3b82aaf114b9c3cce594eaebc9109182b7a28 100644 --- a/app/code/core/Mage/XmlConnect/controllers/CustomerController.php +++ b/app/code/core/Mage/XmlConnect/controllers/CustomerController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -367,7 +367,6 @@ class Mage_XmlConnect_CustomerController extends Mage_XmlConnect_Controller_Acti public function addressAction() { if (!$this->_getSession()->isLoggedIn()) { - Mage::log('address:'.$this->_getSession()->getSessionId()); $this->_message( $this->__('Customer not logged in.'), self::MESSAGE_STATUS_ERROR, array('logged_in' => '0') ); diff --git a/app/code/core/Mage/XmlConnect/controllers/IndexController.php b/app/code/core/Mage/XmlConnect/controllers/IndexController.php index f4c8c2281b601d1f58a632a308ec585bb378a18f..b5c90257cb5896e44113c7993103669a226d638e 100644 --- a/app/code/core/Mage/XmlConnect/controllers/IndexController.php +++ b/app/code/core/Mage/XmlConnect/controllers/IndexController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/controllers/Paypal/MeclController.php b/app/code/core/Mage/XmlConnect/controllers/Paypal/MeclController.php index edf2469cddcc5547f018cfd4fb92cfa1c6719252..e10fdeac172a37d4d7750b8a41100712f7ed41c5 100644 --- a/app/code/core/Mage/XmlConnect/controllers/Paypal/MeclController.php +++ b/app/code/core/Mage/XmlConnect/controllers/Paypal/MeclController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/controllers/Paypal/MepController.php b/app/code/core/Mage/XmlConnect/controllers/Paypal/MepController.php index f985c33567dbdea7861b94ded0b5cb017fb5a161..0444e45eb52152bb9ed09adc00b49b2658df3077 100644 --- a/app/code/core/Mage/XmlConnect/controllers/Paypal/MepController.php +++ b/app/code/core/Mage/XmlConnect/controllers/Paypal/MepController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/controllers/PbridgeController.php b/app/code/core/Mage/XmlConnect/controllers/PbridgeController.php index 1b98b041f461fba79d3a39e34fb043edce359db8..b8eb39d6af94a20351e65c04d81eea12d7ce4812 100755 --- a/app/code/core/Mage/XmlConnect/controllers/PbridgeController.php +++ b/app/code/core/Mage/XmlConnect/controllers/PbridgeController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -60,9 +60,7 @@ class Mage_XmlConnect_PbridgeController extends Mage_Core_Controller_Front_Actio protected function _checkPbridge() { if (!is_object(Mage::getConfig()->getNode('modules/Enterprise_Pbridge'))) { - $this->getResponse()->setBody( - $this->__('Payment Bridge module unavailable.') - ); + $this->getResponse()->setBody($this->__('Payment Bridge module unavailable.')); return false; } return true; diff --git a/app/code/core/Mage/XmlConnect/controllers/ReviewController.php b/app/code/core/Mage/XmlConnect/controllers/ReviewController.php index 1f15cfc062d24d7005a4b6ec81664d56ca571b6f..cef3132ed12da8770f3971203d9fb85a87915d70 100644 --- a/app/code/core/Mage/XmlConnect/controllers/ReviewController.php +++ b/app/code/core/Mage/XmlConnect/controllers/ReviewController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/controllers/WishlistController.php b/app/code/core/Mage/XmlConnect/controllers/WishlistController.php index 5c51f3c6f602128037306de17fe4d374b4b787d9..91d04a3f9a89685685808079383cc9d90083899e 100644 --- a/app/code/core/Mage/XmlConnect/controllers/WishlistController.php +++ b/app/code/core/Mage/XmlConnect/controllers/WishlistController.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/etc/adminhtml.xml b/app/code/core/Mage/XmlConnect/etc/adminhtml.xml index 8eb579cc59ad9553f20f5cbf9b615b56e605b66e..2ae741a42053736a8c850df1d7aae4d4540c2f22 100644 --- a/app/code/core/Mage/XmlConnect/etc/adminhtml.xml +++ b/app/code/core/Mage/XmlConnect/etc/adminhtml.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/XmlConnect/etc/config.xml b/app/code/core/Mage/XmlConnect/etc/config.xml index 87a1460f1408717368a86ebdd7b51722f7762d4a..7d2712e00990c62c4b74292dfb70b43efb683a71 100644 --- a/app/code/core/Mage/XmlConnect/etc/config.xml +++ b/app/code/core/Mage/XmlConnect/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> @@ -29,7 +29,7 @@ <modules> <Mage_XmlConnect> <version>1.6.0.0</version> - <innerVersion>22.0</innerVersion> + <innerVersion>22.1</innerVersion> </Mage_XmlConnect> </modules> <global> @@ -359,6 +359,7 @@ </screen_size> <xmlconnect> <mobile_application> + <curl_ssl_verifypeer>1</curl_ssl_verifypeer> <magentocommerce_url>www.magentocommerce.com/products/index.php/mobile/activate/index/key/</magentocommerce_url> <activation_key_url>http://www.magentocommerce.com/product/mobile</activation_key_url> <resubmission_key_url>http://www.magentocommerce.com/product/mobile#resubmission</resubmission_key_url> diff --git a/app/code/core/Mage/XmlConnect/etc/system.xml b/app/code/core/Mage/XmlConnect/etc/system.xml index cc5cae9e3d31e49bdeedf94daa38beb05b6606e5..5958369b9489fa470eee85d9556366dc108a1ec3 100644 --- a/app/code/core/Mage/XmlConnect/etc/system.xml +++ b/app/code/core/Mage/XmlConnect/etc/system.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/XmlConnect/etc/themes/custom.xml b/app/code/core/Mage/XmlConnect/etc/themes/custom.xml index d8c449bd7d7d49c0a6b4eea756aa91d25addd016..74c9f48c814fadd75175e9c4bc993743a77f29b5 100644 --- a/app/code/core/Mage/XmlConnect/etc/themes/custom.xml +++ b/app/code/core/Mage/XmlConnect/etc/themes/custom.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/XmlConnect/etc/themes/default.xml b/app/code/core/Mage/XmlConnect/etc/themes/default.xml index 91bc7204182d4452bfb5a28afe844f5daa864b34..bd6f134a3726cb4595a6083c0d8be1f4ca2f08fa 100644 --- a/app/code/core/Mage/XmlConnect/etc/themes/default.xml +++ b/app/code/core/Mage/XmlConnect/etc/themes/default.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/XmlConnect/etc/themes/funk_leaf.xml b/app/code/core/Mage/XmlConnect/etc/themes/funk_leaf.xml index d7f42d4f6c1dc1b039fed3ee1c5814bba257c6ab..fdfe64bc47cf2ab6afee2bae9ca824f776d70503 100644 --- a/app/code/core/Mage/XmlConnect/etc/themes/funk_leaf.xml +++ b/app/code/core/Mage/XmlConnect/etc/themes/funk_leaf.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/XmlConnect/etc/themes/hot_red.xml b/app/code/core/Mage/XmlConnect/etc/themes/hot_red.xml index 29c9a52ad2744ee3c5be69c11f5903eef56a385a..afc7e3dc0d9b1ce61b47457b4c63373e11d55fbf 100644 --- a/app/code/core/Mage/XmlConnect/etc/themes/hot_red.xml +++ b/app/code/core/Mage/XmlConnect/etc/themes/hot_red.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/XmlConnect/etc/themes/sky_blue.xml b/app/code/core/Mage/XmlConnect/etc/themes/sky_blue.xml index 71e571ad92621ec067e40d46492cd7ada92767de..186d6f79a14d0cc3103796b499506a8dd0dce3a7 100644 --- a/app/code/core/Mage/XmlConnect/etc/themes/sky_blue.xml +++ b/app/code/core/Mage/XmlConnect/etc/themes/sky_blue.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/XmlConnect/sql/xmlconnect_setup/install-1.6.0.0.php b/app/code/core/Mage/XmlConnect/sql/xmlconnect_setup/install-1.6.0.0.php index f9f41045f60dc40c469717834035bbdde937ce74..20b0f3b0ac0fd52384cadfc0ef4c3cf494853dd6 100755 --- a/app/code/core/Mage/XmlConnect/sql/xmlconnect_setup/install-1.6.0.0.php +++ b/app/code/core/Mage/XmlConnect/sql/xmlconnect_setup/install-1.6.0.0.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/view/adminhtml/css/boxes.css b/app/code/core/Mage/XmlConnect/view/adminhtml/css/boxes.css index 009b40ae030925fea53f3fefb516f9f806927024..9b2da1ef36f99ff0b712df47ba59b8699cbe1b67 100644 --- a/app/code/core/Mage/XmlConnect/view/adminhtml/css/boxes.css +++ b/app/code/core/Mage/XmlConnect/view/adminhtml/css/boxes.css @@ -17,7 +17,7 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/view/adminhtml/css/dropdown.css b/app/code/core/Mage/XmlConnect/view/adminhtml/css/dropdown.css index f5d294c84f1ad54a91ec2915683cdcb99342a870..7332ae2807eccf99b7b31405af8bdad6721d94f9 100644 --- a/app/code/core/Mage/XmlConnect/view/adminhtml/css/dropdown.css +++ b/app/code/core/Mage/XmlConnect/view/adminhtml/css/dropdown.css @@ -19,7 +19,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ .dropdown { float:left; width:200px; border:1px solid #ccc; position:relative; } diff --git a/app/code/core/Mage/XmlConnect/view/adminhtml/css/mobile-android.css b/app/code/core/Mage/XmlConnect/view/adminhtml/css/mobile-android.css index f7ad7b3e0799792fbd0312dc8ad509209ab5e8a7..ae84a060b174fd2c7051958b907526293f5c0e58 100644 --- a/app/code/core/Mage/XmlConnect/view/adminhtml/css/mobile-android.css +++ b/app/code/core/Mage/XmlConnect/view/adminhtml/css/mobile-android.css @@ -17,7 +17,7 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/view/adminhtml/css/mobile-catalog.css b/app/code/core/Mage/XmlConnect/view/adminhtml/css/mobile-catalog.css index 93b742019681089350a23a372703d1c4bd44b7eb..d9392c8c419bf27bd7e7fb6bc8b3805b0d2d63ac 100644 --- a/app/code/core/Mage/XmlConnect/view/adminhtml/css/mobile-catalog.css +++ b/app/code/core/Mage/XmlConnect/view/adminhtml/css/mobile-catalog.css @@ -17,7 +17,7 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/view/adminhtml/css/mobile-home.css b/app/code/core/Mage/XmlConnect/view/adminhtml/css/mobile-home.css index fc2fcf355ceecbc4cfe7d5920949683edae8866f..b3a9170a11e856fe7c908ed1f98049763443722d 100644 --- a/app/code/core/Mage/XmlConnect/view/adminhtml/css/mobile-home.css +++ b/app/code/core/Mage/XmlConnect/view/adminhtml/css/mobile-home.css @@ -17,7 +17,7 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/view/adminhtml/css/mobile-ipad-catalog.css b/app/code/core/Mage/XmlConnect/view/adminhtml/css/mobile-ipad-catalog.css index b9c609647866cdd4e3a304fdc917217bcc7f6668..1548ec01ceb9d3481b7214c9f2338c7f36b9595e 100644 --- a/app/code/core/Mage/XmlConnect/view/adminhtml/css/mobile-ipad-catalog.css +++ b/app/code/core/Mage/XmlConnect/view/adminhtml/css/mobile-ipad-catalog.css @@ -17,7 +17,7 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/view/adminhtml/css/mobile-ipad-home.css b/app/code/core/Mage/XmlConnect/view/adminhtml/css/mobile-ipad-home.css index 2c5dbad9fdc0e49dbbb8e2becc627d1aeae1468b..edcea0430c5893d3687b38f5f17b4878a1ee18fa 100644 --- a/app/code/core/Mage/XmlConnect/view/adminhtml/css/mobile-ipad-home.css +++ b/app/code/core/Mage/XmlConnect/view/adminhtml/css/mobile-ipad-home.css @@ -17,7 +17,7 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/core/Mage/XmlConnect/view/adminhtml/css/styles.css b/app/code/core/Mage/XmlConnect/view/adminhtml/css/styles.css index eed238eae9ccb4c3282de253e674c1a06734d194..e00067537259488ebc9348d58dca7efa3ec1ec5e 100644 --- a/app/code/core/Mage/XmlConnect/view/adminhtml/css/styles.css +++ b/app/code/core/Mage/XmlConnect/view/adminhtml/css/styles.css @@ -19,7 +19,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ .wrapper { min-width:1150px !important; } diff --git a/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design.phtml b/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design.phtml index 4b51138652a4e89c87ecd73c29972c5538a0f94c..f8de94e6cef8c2ade4e336c5341ac85314c447bc 100644 --- a/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design.phtml +++ b/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview/catalog_android.phtml b/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview/catalog_android.phtml index de09851d3efd689a99d32e0034247e5e43767848..96dfd17ae1949a58de4655a6ffebec5c7597b19c 100644 --- a/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview/catalog_android.phtml +++ b/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview/catalog_android.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview/catalog_hor_ipad.phtml b/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview/catalog_hor_ipad.phtml index e62d30825b0634e83765eae94a66296e0b96fb71..ac57e9f5fe3fc1dee2a874231444dd81b0a149ef 100644 --- a/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview/catalog_hor_ipad.phtml +++ b/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview/catalog_hor_ipad.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview/catalog_ipad.phtml b/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview/catalog_ipad.phtml index edfa4d520b00ae4415e8cb33e4d9f41427071a4c..5839adb68433e52f3f246d7a5a3501c708522be4 100644 --- a/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview/catalog_ipad.phtml +++ b/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview/catalog_ipad.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview/catalog_iphone.phtml b/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview/catalog_iphone.phtml index f64ad2f02ac10a6ac38209404599b25b9af692c5..9509d952dbb1aeaffdd275a6ce57ab6cbb427eba 100644 --- a/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview/catalog_iphone.phtml +++ b/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview/catalog_iphone.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview/home_android.phtml b/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview/home_android.phtml index a7cced5ed6118cdeb0d9c320f1afbd804a810455..fbf816c234b391bc463bc67f631f26dc79645b50 100644 --- a/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview/home_android.phtml +++ b/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview/home_android.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview/home_hor_ipad.phtml b/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview/home_hor_ipad.phtml index 8c68c6ad8873a117a4d530220ac0b20e22932bf7..2d405e697939fe71434aec56944c02a4eb7cac46 100644 --- a/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview/home_hor_ipad.phtml +++ b/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview/home_hor_ipad.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview/home_ipad.phtml b/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview/home_ipad.phtml index 83ef2fb6fa11a3e33d37e4446bb308afb924bf1b..15c0e6a244671eb158f7af8e2646b934c0391212 100644 --- a/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview/home_ipad.phtml +++ b/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview/home_ipad.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview/home_iphone.phtml b/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview/home_iphone.phtml index e70dd83d5e9888f5b0b8f0ec24b3b362195c18a7..ccd918156da19cfb6da9cc3430fc6dff316d4eb4 100644 --- a/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview/home_iphone.phtml +++ b/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview/home_iphone.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview/productinfo_iphone.phtml b/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview/productinfo_iphone.phtml index 2dc6bbc94fcdb55781779cc01cd86859320701f1..6ebf1ac8897b0d4d05aa6a233e1a88f901187aff 100644 --- a/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview/productinfo_iphone.phtml +++ b/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview/productinfo_iphone.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview/tab_items_android.phtml b/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview/tab_items_android.phtml index 752bfc6c50e16963b6d059ac2d6ab9448ca3061b..6630dc34c6299b0b598a2e02e51ab379b5ffcb9d 100644 --- a/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview/tab_items_android.phtml +++ b/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview/tab_items_android.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview/tab_items_ipad.phtml b/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview/tab_items_ipad.phtml index 4007dc2ae5abd5dc09ec8697f8192f651f69d8d6..6bc2cebee2cef3ece0b663cc903778a04f2d0905 100644 --- a/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview/tab_items_ipad.phtml +++ b/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview/tab_items_ipad.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview/tab_items_iphone.phtml b/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview/tab_items_iphone.phtml index 6b74b21aa94e5e63270e0a5a6068d24394194baf..f9ad024843ee46d46f1c57cda045d951693d7a87 100644 --- a/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview/tab_items_iphone.phtml +++ b/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview/tab_items_iphone.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview_android.phtml b/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview_android.phtml index 1fdd5c9a967d9e16158df0067ae8c30d70373211..086d86d9f3eb4c95821e467918b33df62fa776d2 100644 --- a/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview_android.phtml +++ b/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview_android.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -30,7 +30,7 @@ <div id="XmlconnectThemePreview"></div> <div class="mm-box-blue a-center" style="width:285px;"> - <button type="button" class="scalable" onclick="updatePreview()"><span><?php echo $this->__('Update Preview');?></span></button> + <button type="button" class="scalable" onclick="updatePreview()"><span><span><span><?php echo $this->__('Update Preview');?></span></span></span></button> <p><br />To preview the newly uploaded images, please save your application first.</p> </div> <div class="mm-pager"> diff --git a/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview_ipad.phtml b/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview_ipad.phtml index 29415067ec2f3eb5d1ff7a51ace8758d85662ec4..99303986d77e7339c49ebea51821f9779daf946c 100644 --- a/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview_ipad.phtml +++ b/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview_ipad.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -39,8 +39,8 @@ <div id="XmlconnectThemePreview" class="ipad-portrait"></div> <div id="ipad-tab-orientation" class="mm-box-blue a-center ipad-tab-portrait"> - <button type="button" class="scalable" onclick="updatePreview()"><span><?php echo $this->__('Update Preview');?></span></button> - <button type="button" class="scalable" onclick="changeOrientation()"><span><?php echo $this->__('Change Orientation');?></span></button> + <button type="button" class="scalable" onclick="updatePreview()"><span><span><span><?php echo $this->__('Update Preview');?></span></span></span></button> + <button type="button" class="scalable" onclick="changeOrientation()"><span><span><span><?php echo $this->__('Change Orientation');?></span></span></span></button> <p><br />To preview the newly uploaded images, please save your application first.</p> </div> <div class="mm-pager" style="padding-left:60px;"> diff --git a/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview_iphone.phtml b/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview_iphone.phtml index aa8c1976db6b25d054d8f35333b9a1e63efd273b..c5a7281591d5472716d75674671670e0c20a6397 100644 --- a/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview_iphone.phtml +++ b/app/code/core/Mage/XmlConnect/view/adminhtml/edit/tab/design/preview_iphone.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -30,7 +30,7 @@ <div id="XmlconnectThemePreview"></div> <div class="mm-box-blue a-center" style="width:285px;"> - <button type="button" class="scalable" onclick="updatePreview()"><span><?php echo $this->__('Update Preview');?></span></button> + <button type="button" class="scalable" onclick="updatePreview()"><span><span><span><?php echo $this->__('Update Preview');?></span></span></span></button> <p><br />To preview the newly uploaded images, please save your application first.</p> </div> <div class="mm-pager"> diff --git a/app/code/core/Mage/XmlConnect/view/adminhtml/form/element/addrow.phtml b/app/code/core/Mage/XmlConnect/view/adminhtml/form/element/addrow.phtml index 5235ede188156c6b91988e35dff246689630f141..b25da331c741af0795134f87095fd883f482f3ce 100644 --- a/app/code/core/Mage/XmlConnect/view/adminhtml/form/element/addrow.phtml +++ b/app/code/core/Mage/XmlConnect/view/adminhtml/form/element/addrow.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -58,8 +58,8 @@ function getTdValueInnerHtml() { * @return string */ function getTdButtonInnerHtml(id) { - return '<button id="'+id+'" class=" scalable save onclick_button" value="−">' - +'<span><?php echo $this->__('Delete'); ?></span></button>'; + return '<button id="'+id+'" class="scalable save onclick_button" value="−">' + +'<span><span><span><?php echo $this->__('Delete'); ?></span></span></span></button>'; } /** diff --git a/app/code/core/Mage/XmlConnect/view/adminhtml/form/element/app_tabs_android.phtml b/app/code/core/Mage/XmlConnect/view/adminhtml/form/element/app_tabs_android.phtml index ed2bda19d4a79c83f5c90e3871c0520aacde74ac..ef5be042bafd3f7112a50a0900fbfa807b5c154c 100755 --- a/app/code/core/Mage/XmlConnect/view/adminhtml/form/element/app_tabs_android.phtml +++ b/app/code/core/Mage/XmlConnect/view/adminhtml/form/element/app_tabs_android.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/XmlConnect/view/adminhtml/form/element/app_tabs_ipad.phtml b/app/code/core/Mage/XmlConnect/view/adminhtml/form/element/app_tabs_ipad.phtml index 08c83c6f986c93bca4db386377f1a1238e40bc8a..37ed6123cf569bd7e250a78142a18ec60b435975 100755 --- a/app/code/core/Mage/XmlConnect/view/adminhtml/form/element/app_tabs_ipad.phtml +++ b/app/code/core/Mage/XmlConnect/view/adminhtml/form/element/app_tabs_ipad.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/XmlConnect/view/adminhtml/form/element/app_tabs_iphone.phtml b/app/code/core/Mage/XmlConnect/view/adminhtml/form/element/app_tabs_iphone.phtml index bef6d431e2c2b243fc3d789a39e5961243daa62a..1a66487dbf5682ffd68aa9c7361652bde49eea87 100755 --- a/app/code/core/Mage/XmlConnect/view/adminhtml/form/element/app_tabs_iphone.phtml +++ b/app/code/core/Mage/XmlConnect/view/adminhtml/form/element/app_tabs_iphone.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/XmlConnect/view/adminhtml/form/element/country/androidmarket.phtml b/app/code/core/Mage/XmlConnect/view/adminhtml/form/element/country/androidmarket.phtml index 5e5544a90ad281af0f7caa90dc12021daff03e76..08ace20ee4260a49d66d49101a3c467166675f2b 100644 --- a/app/code/core/Mage/XmlConnect/view/adminhtml/form/element/country/androidmarket.phtml +++ b/app/code/core/Mage/XmlConnect/view/adminhtml/form/element/country/androidmarket.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/XmlConnect/view/adminhtml/form/element/country/istore.phtml b/app/code/core/Mage/XmlConnect/view/adminhtml/form/element/country/istore.phtml index c500135794486df3b85ada60e5f5d579a446af30..a6d3360d0768c9e3f33579dfa117965c19ce52df 100644 --- a/app/code/core/Mage/XmlConnect/view/adminhtml/form/element/country/istore.phtml +++ b/app/code/core/Mage/XmlConnect/view/adminhtml/form/element/country/istore.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/XmlConnect/view/adminhtml/form/element/themes.phtml b/app/code/core/Mage/XmlConnect/view/adminhtml/form/element/themes.phtml index d8c872bbad32dfa81b6fa6d8b4b031dc5bc35628..f51ab6e632a027f1b047de2b0c6c267dbd07940a 100644 --- a/app/code/core/Mage/XmlConnect/view/adminhtml/form/element/themes.phtml +++ b/app/code/core/Mage/XmlConnect/view/adminhtml/form/element/themes.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -500,10 +500,10 @@ function deleteTheme() { <div class="form-buttons" style="float:right"> <button type="button" class="scalable" id="save_theme" onclick="saveTheme();"> - <span><?php echo $this->__('Save Theme'); ?></span> + <span><span><span><?php echo $this->__('Save Theme'); ?></span></span></span> </button> <button type="button" class="scalable" id="save_as_theme_init"> - <span><?php echo $this->__('Save As'); ?></span> + <span><span><span><?php echo $this->__('Save As'); ?></span></span></span> </button> </div> @@ -516,10 +516,10 @@ function deleteTheme() { <input id="input_save_as" type="text" class="input-text" name="input_save_as" autocomplete="off" value="" /> <div class="validation-advice" id="advice-required-theme-name" style="display:none;"><?php echo $this->__('Theme label can\'t be empty'); ?></div> <button type="button" class="scalable save" id="save_as_theme"> - <span><?php echo $this->__('Save'); ?></span> + <span><span><span><?php echo $this->__('Save'); ?></span></span></span> </button> <button type="button" class="scalable" id="save_as_theme_cancel"> - <span><?php echo $this->__('Cancel'); ?></span> + <span><span><span><?php echo $this->__('Cancel'); ?></span></span></span> </button> </div> </div> @@ -601,11 +601,11 @@ $id2observe = array(); <div class="reset-theme"> <button id="reset_theme" type="button" class="scalable"> - <span><?php echo $this->__('Reset theme to default'); ?></span> + <span><span><span><?php echo $this->__('Reset theme to default'); ?></span></span></span> </button> <button id="delete_theme" type="button" class="scalable delete"> - <span><?php echo $this->__('Delete theme'); ?></span> + <span><span><span><?php echo $this->__('Delete theme'); ?></span></span></span> </button> <div id="reset_note" style="display:none;"><?php echo $this->__('Only default theme can be reset'); ?></div> diff --git a/app/code/core/Mage/XmlConnect/view/adminhtml/images/mobile_preview/mobile-catalog.css b/app/code/core/Mage/XmlConnect/view/adminhtml/images/mobile_preview/mobile-catalog.css index f3a499853ae75a69016c5981212018301a1aadff..e1ab1fc4b9952c04cd946aee8eea7766b8f2b6c8 100644 --- a/app/code/core/Mage/XmlConnect/view/adminhtml/images/mobile_preview/mobile-catalog.css +++ b/app/code/core/Mage/XmlConnect/view/adminhtml/images/mobile_preview/mobile-catalog.css @@ -19,7 +19,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ body { margin: 0; padding: 0 } diff --git a/app/code/core/Mage/XmlConnect/view/adminhtml/images/mobile_preview/mobile-home.css b/app/code/core/Mage/XmlConnect/view/adminhtml/images/mobile_preview/mobile-home.css index 00c25521e35a56b6cafc0886f655288d720adf7a..60c8ea9698a2c67c7c5ab9a67c9b8a5fdfe29958 100644 --- a/app/code/core/Mage/XmlConnect/view/adminhtml/images/mobile_preview/mobile-home.css +++ b/app/code/core/Mage/XmlConnect/view/adminhtml/images/mobile_preview/mobile-home.css @@ -19,7 +19,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ body { margin: 0; padding: 0 } diff --git a/app/code/core/Mage/XmlConnect/view/adminhtml/layout.xml b/app/code/core/Mage/XmlConnect/view/adminhtml/layout.xml index e744dd6fd0d7e779b1fcf79fa5aed5b78720b91f..a40ee8c3ec5696f7d4c60582acc6f4d594c90cfb 100644 --- a/app/code/core/Mage/XmlConnect/view/adminhtml/layout.xml +++ b/app/code/core/Mage/XmlConnect/view/adminhtml/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/XmlConnect/view/adminhtml/mobile/notification_helper.phtml b/app/code/core/Mage/XmlConnect/view/adminhtml/mobile/notification_helper.phtml index ff65bbe1515d9db65d4fe51fb8684f3f257edd79..10852de298a5d50c8eb5b58753f059bbd26d4207 100644 --- a/app/code/core/Mage/XmlConnect/view/adminhtml/mobile/notification_helper.phtml +++ b/app/code/core/Mage/XmlConnect/view/adminhtml/mobile/notification_helper.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/XmlConnect/view/adminhtml/submission/app_icons_preview.phtml b/app/code/core/Mage/XmlConnect/view/adminhtml/submission/app_icons_preview.phtml index 4b87ce3c33d0a9577a52de88621d5b7c89afb9b3..a4b3cca97707ad560a005741e3efe3e91dfe5fc0 100644 --- a/app/code/core/Mage/XmlConnect/view/adminhtml/submission/app_icons_preview.phtml +++ b/app/code/core/Mage/XmlConnect/view/adminhtml/submission/app_icons_preview.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/XmlConnect/view/adminhtml/submission/container.phtml b/app/code/core/Mage/XmlConnect/view/adminhtml/submission/container.phtml index 86980133bb10b8dde7528d6fd63aa7fae4608594..dc8a3dcb146b1adcffff673506c7fc2b8dd5d815 100644 --- a/app/code/core/Mage/XmlConnect/view/adminhtml/submission/container.phtml +++ b/app/code/core/Mage/XmlConnect/view/adminhtml/submission/container.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/XmlConnect/view/adminhtml/template/preview.phtml b/app/code/core/Mage/XmlConnect/view/adminhtml/template/preview.phtml index 66930b8fe971764f1bfddb12cd123f68b9bae222..3564334a1028abc18f64259fcabea8dc2a581d0f 100644 --- a/app/code/core/Mage/XmlConnect/view/adminhtml/template/preview.phtml +++ b/app/code/core/Mage/XmlConnect/view/adminhtml/template/preview.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Mage/XmlConnect/view/frontend/layout.xml b/app/code/core/Mage/XmlConnect/view/frontend/layout.xml index 9ee5bfdfe2f60d374b49909dd49431a29325f35f..9b7b01284409e712cf1a509b549fce10343d24c7 100644 --- a/app/code/core/Mage/XmlConnect/view/frontend/layout.xml +++ b/app/code/core/Mage/XmlConnect/view/frontend/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/code/core/Mage/XmlConnect/view/frontend/pbridge/result.phtml b/app/code/core/Mage/XmlConnect/view/frontend/pbridge/result.phtml index ccb79a853276207d0e28bbc216a6dd0079269de5..7d1c317a49a580da77972abc451f573949559b63 100755 --- a/app/code/core/Mage/XmlConnect/view/frontend/pbridge/result.phtml +++ b/app/code/core/Mage/XmlConnect/view/frontend/pbridge/result.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/code/core/Zend/Date.php b/app/code/core/Zend/Date.php new file mode 100644 index 0000000000000000000000000000000000000000..1992f51bdb0effb5120fd7448696ccb366f7f76a --- /dev/null +++ b/app/code/core/Zend/Date.php @@ -0,0 +1,5008 @@ +<?php +/** + * Zend Framework + * + * LICENSE + * + * This source file is subject to the new BSD license that is bundled + * with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://framework.zend.com/license/new-bsd + * 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@zend.com so we can send you a copy immediately. + * + * @category Zend + * @package Zend_Date + * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * @version $Id: Date.php 22713 2010-07-29 11:41:56Z thomas $ + */ + +/** + * Include needed Date classes + */ +#require_once 'Zend/Date/DateObject.php'; +#require_once 'Zend/Locale.php'; +#require_once 'Zend/Locale/Format.php'; +#require_once 'Zend/Locale/Math.php'; + +/** + * This class replaces default Zend_Date because of problem described in Jira ticket MAGE-4872 + * The only difference between current class and original one is overwritten implementation of mktime method + * + * @category Zend + * @package Zend_Date + * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + */ +class Zend_Date extends Zend_Date_DateObject +{ + private $_locale = null; + + // Fractional second variables + private $_fractional = 0; + private $_precision = 3; + + private static $_options = array( + 'format_type' => 'iso', // format for date strings 'iso' or 'php' + 'fix_dst' => true, // fix dst on summer/winter time change + 'extend_month' => false, // false - addMonth like SQL, true like excel + 'cache' => null, // cache to set + 'timesync' => null // timesync server to set + ); + + // Class wide Date Constants + const DAY = 'dd'; + const DAY_SHORT = 'd'; + const DAY_SUFFIX = 'SS'; + const DAY_OF_YEAR = 'D'; + const WEEKDAY = 'EEEE'; + const WEEKDAY_SHORT = 'EEE'; + const WEEKDAY_NARROW = 'E'; + const WEEKDAY_NAME = 'EE'; + const WEEKDAY_8601 = 'eee'; + const WEEKDAY_DIGIT = 'e'; + const WEEK = 'ww'; + const MONTH = 'MM'; + const MONTH_SHORT = 'M'; + const MONTH_DAYS = 'ddd'; + const MONTH_NAME = 'MMMM'; + const MONTH_NAME_SHORT = 'MMM'; + const MONTH_NAME_NARROW = 'MMMMM'; + const YEAR = 'y'; + const YEAR_SHORT = 'yy'; + const YEAR_8601 = 'Y'; + const YEAR_SHORT_8601 = 'YY'; + const LEAPYEAR = 'l'; + const MERIDIEM = 'a'; + const SWATCH = 'B'; + const HOUR = 'HH'; + const HOUR_SHORT = 'H'; + const HOUR_AM = 'hh'; + const HOUR_SHORT_AM = 'h'; + const MINUTE = 'mm'; + const MINUTE_SHORT = 'm'; + const SECOND = 'ss'; + const SECOND_SHORT = 's'; + const MILLISECOND = 'S'; + const TIMEZONE_NAME = 'zzzz'; + const DAYLIGHT = 'I'; + const GMT_DIFF = 'Z'; + const GMT_DIFF_SEP = 'ZZZZ'; + const TIMEZONE = 'z'; + const TIMEZONE_SECS = 'X'; + const ISO_8601 = 'c'; + const RFC_2822 = 'r'; + const TIMESTAMP = 'U'; + const ERA = 'G'; + const ERA_NAME = 'GGGG'; + const ERA_NARROW = 'GGGGG'; + const DATES = 'F'; + const DATE_FULL = 'FFFFF'; + const DATE_LONG = 'FFFF'; + const DATE_MEDIUM = 'FFF'; + const DATE_SHORT = 'FF'; + const TIMES = 'WW'; + const TIME_FULL = 'TTTTT'; + const TIME_LONG = 'TTTT'; + const TIME_MEDIUM = 'TTT'; + const TIME_SHORT = 'TT'; + const DATETIME = 'K'; + const DATETIME_FULL = 'KKKKK'; + const DATETIME_LONG = 'KKKK'; + const DATETIME_MEDIUM = 'KKK'; + const DATETIME_SHORT = 'KK'; + const ATOM = 'OOO'; + const COOKIE = 'CCC'; + const RFC_822 = 'R'; + const RFC_850 = 'RR'; + const RFC_1036 = 'RRR'; + const RFC_1123 = 'RRRR'; + const RFC_3339 = 'RRRRR'; + const RSS = 'SSS'; + const W3C = 'WWW'; + + /** + * Minimum allowed year value + */ + const YEAR_MIN_VALUE = -10000; + + /** + * Maximum allowed year value + */ + const YEAR_MAX_VALUE = 10000; + + /** + * Generates the standard date object, could be a unix timestamp, localized date, + * string, integer, array and so on. Also parts of dates or time are supported + * Always set the default timezone: http://php.net/date_default_timezone_set + * For example, in your bootstrap: date_default_timezone_set('America/Los_Angeles'); + * For detailed instructions please look in the docu. + * + * @param string|integer|Zend_Date|array $date OPTIONAL Date value or value of date part to set + * ,depending on $part. If null the actual time is set + * @param string $part OPTIONAL Defines the input format of $date + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date + * @throws Zend_Date_Exception + */ + public function __construct($date = null, $part = null, $locale = null) + { + if (is_object($date) and !($date instanceof Zend_TimeSync_Protocol) and + !($date instanceof Zend_Date)) { + if ($locale instanceof Zend_Locale) { + $locale = $date; + $date = null; + $part = null; + } else { + $date = (string) $date; + } + } + + if (($date !== null) and !is_array($date) and !($date instanceof Zend_TimeSync_Protocol) and + !($date instanceof Zend_Date) and !defined($date) and Zend_Locale::isLocale($date, true, false)) { + $locale = $date; + $date = null; + $part = null; + } else if (($part !== null) and !defined($part) and Zend_Locale::isLocale($part, true, false)) { + $locale = $part; + $part = null; + } + + $this->setLocale($locale); + if (is_string($date) && ($part === null) && (strlen($date) <= 5)) { + $part = $date; + $date = null; + } + + if ($date === null) { + if ($part === null) { + $date = time(); + } else if ($part !== self::TIMESTAMP) { + $date = self::now($locale); + $date = $date->get($part); + } + } + + if ($date instanceof Zend_TimeSync_Protocol) { + $date = $date->getInfo(); + $date = $this->_getTime($date['offset']); + $part = null; + } else if (parent::$_defaultOffset != 0) { + $date = $this->_getTime(parent::$_defaultOffset); + } + + // set the timezone and offset for $this + $zone = @date_default_timezone_get(); + $this->setTimezone($zone); + + // try to get timezone from date-string + if (!is_int($date)) { + $zone = $this->getTimezoneFromString($date); + $this->setTimezone($zone); + } + + // set datepart + if (($part !== null && $part !== self::TIMESTAMP) or (!is_numeric($date))) { + // switch off dst handling for value setting + $this->setUnixTimestamp($this->getGmtOffset()); + $this->set($date, $part, $this->_locale); + + // DST fix + if (is_array($date) === true) { + if (!isset($date['hour'])) { + $date['hour'] = 0; + } + + $hour = $this->toString('H', 'iso', true); + $hour = $date['hour'] - $hour; + switch ($hour) { + case 1 : + case -23 : + $this->addTimestamp(3600); + break; + case -1 : + case 23 : + $this->subTimestamp(3600); + break; + case 2 : + case -22 : + $this->addTimestamp(7200); + break; + case -2 : + case 22 : + $this->subTimestamp(7200); + break; + } + } + } else { + $this->setUnixTimestamp($date); + } + } + + /** + * Sets class wide options, if no option was given, the actual set options will be returned + * + * @param array $options Options to set + * @throws Zend_Date_Exception + * @return Options array if no option was given + */ + public static function setOptions(array $options = array()) + { + if (empty($options)) { + return self::$_options; + } + + foreach ($options as $name => $value) { + $name = strtolower($name); + + if (array_key_exists($name, self::$_options)) { + switch($name) { + case 'format_type' : + if ((strtolower($value) != 'php') && (strtolower($value) != 'iso')) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("Unknown format type ($value) for dates, only 'iso' and 'php' supported", 0, null, $value); + } + break; + case 'fix_dst' : + if (!is_bool($value)) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("'fix_dst' has to be boolean", 0, null, $value); + } + break; + case 'extend_month' : + if (!is_bool($value)) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("'extend_month' has to be boolean", 0, null, $value); + } + break; + case 'cache' : + if ($value === null) { + parent::$_cache = null; + } else { + if (!$value instanceof Zend_Cache_Core) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("Instance of Zend_Cache expected"); + } + + parent::$_cache = $value; + parent::$_cacheTags = Zend_Date_DateObject::_getTagSupportForCache(); + Zend_Locale_Data::setCache($value); + } + break; + case 'timesync' : + if ($value === null) { + parent::$_defaultOffset = 0; + } else { + if (!$value instanceof Zend_TimeSync_Protocol) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("Instance of Zend_TimeSync expected"); + } + + $date = $value->getInfo(); + parent::$_defaultOffset = $date['offset']; + } + break; + } + self::$_options[$name] = $value; + } + else { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("Unknown option: $name = $value"); + } + } + } + + /** + * Returns this object's internal UNIX timestamp (equivalent to Zend_Date::TIMESTAMP). + * If the timestamp is too large for integers, then the return value will be a string. + * This function does not return the timestamp as an object. + * Use clone() or copyPart() instead. + * + * @return integer|string UNIX timestamp + */ + public function getTimestamp() + { + return $this->getUnixTimestamp(); + } + + /** + * Returns the calculated timestamp + * HINT: timestamps are always GMT + * + * @param string $calc Type of calculation to make + * @param string|integer|array|Zend_Date $stamp Timestamp to calculate, when null the actual timestamp is calculated + * @return Zend_Date|integer + * @throws Zend_Date_Exception + */ + private function _timestamp($calc, $stamp) + { + if ($stamp instanceof Zend_Date) { + // extract timestamp from object + $stamp = $stamp->getTimestamp(); + } + + if (is_array($stamp)) { + if (isset($stamp['timestamp']) === true) { + $stamp = $stamp['timestamp']; + } else { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception('no timestamp given in array'); + } + } + + if ($calc === 'set') { + $return = $this->setUnixTimestamp($stamp); + } else { + $return = $this->_calcdetail($calc, $stamp, self::TIMESTAMP, null); + } + if ($calc != 'cmp') { + return $this; + } + return $return; + } + + /** + * Sets a new timestamp + * + * @param integer|string|array|Zend_Date $timestamp Timestamp to set + * @return Zend_Date Provides fluid interface + * @throws Zend_Date_Exception + */ + public function setTimestamp($timestamp) + { + return $this->_timestamp('set', $timestamp); + } + + /** + * Adds a timestamp + * + * @param integer|string|array|Zend_Date $timestamp Timestamp to add + * @return Zend_Date Provides fluid interface + * @throws Zend_Date_Exception + */ + public function addTimestamp($timestamp) + { + return $this->_timestamp('add', $timestamp); + } + + /** + * Subtracts a timestamp + * + * @param integer|string|array|Zend_Date $timestamp Timestamp to sub + * @return Zend_Date Provides fluid interface + * @throws Zend_Date_Exception + */ + public function subTimestamp($timestamp) + { + return $this->_timestamp('sub', $timestamp); + } + + /** + * Compares two timestamps, returning the difference as integer + * + * @param integer|string|array|Zend_Date $timestamp Timestamp to compare + * @return integer 0 = equal, 1 = later, -1 = earlier + * @throws Zend_Date_Exception + */ + public function compareTimestamp($timestamp) + { + return $this->_timestamp('cmp', $timestamp); + } + + /** + * Returns a string representation of the object + * Supported format tokens are: + * G - era, y - year, Y - ISO year, M - month, w - week of year, D - day of year, d - day of month + * E - day of week, e - number of weekday (1-7), h - hour 1-12, H - hour 0-23, m - minute, s - second + * A - milliseconds of day, z - timezone, Z - timezone offset, S - fractional second, a - period of day + * + * Additionally format tokens but non ISO conform are: + * SS - day suffix, eee - php number of weekday(0-6), ddd - number of days per month + * l - Leap year, B - swatch internet time, I - daylight saving time, X - timezone offset in seconds + * r - RFC2822 format, U - unix timestamp + * + * Not supported ISO tokens are + * u - extended year, Q - quarter, q - quarter, L - stand alone month, W - week of month + * F - day of week of month, g - modified julian, c - stand alone weekday, k - hour 0-11, K - hour 1-24 + * v - wall zone + * + * @param string $format OPTIONAL Rule for formatting output. If null the default date format is used + * @param string $type OPTIONAL Type for the format string which overrides the standard setting + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return string + */ + public function toString($format = null, $type = null, $locale = null) + { + if (is_object($format)) { + if ($format instanceof Zend_Locale) { + $locale = $format; + $format = null; + } else { + $format = (string) $format; + } + } + + if (is_object($type)) { + if ($type instanceof Zend_Locale) { + $locale = $type; + $type = null; + } else { + $type = (string) $type; + } + } + + if (($format !== null) && !defined($format) + && ($format != 'ee') && ($format != 'ss') && ($format != 'GG') && ($format != 'MM') && ($format != 'EE') && ($format != 'TT') + && Zend_Locale::isLocale($format, null, false)) { + $locale = $format; + $format = null; + } + + if (($type !== null) and ($type != 'php') and ($type != 'iso') and + Zend_Locale::isLocale($type, null, false)) { + $locale = $type; + $type = null; + } + + if ($locale === null) { + $locale = $this->getLocale(); + } + + if ($format === null) { + $format = Zend_Locale_Format::getDateFormat($locale) . ' ' . Zend_Locale_Format::getTimeFormat($locale); + } else if (((self::$_options['format_type'] == 'php') && ($type === null)) or ($type == 'php')) { + $format = Zend_Locale_Format::convertPhpToIsoFormat($format); + } + + return $this->date($this->_toToken($format, $locale), $this->getUnixTimestamp(), false); + } + + /** + * Returns a string representation of the date which is equal with the timestamp + * + * @return string + */ + public function __toString() + { + return $this->toString(null, $this->_locale); + } + + /** + * Returns a integer representation of the object + * But returns false when the given part is no value f.e. Month-Name + * + * @param string|integer|Zend_Date $part OPTIONAL Defines the date or datepart to return as integer + * @return integer|false + */ + public function toValue($part = null) + { + $result = $this->get($part); + if (is_numeric($result)) { + return intval("$result"); + } else { + return false; + } + } + + /** + * Returns an array representation of the object + * + * @return array + */ + public function toArray() + { + return array('day' => $this->toString(self::DAY_SHORT, 'iso'), + 'month' => $this->toString(self::MONTH_SHORT, 'iso'), + 'year' => $this->toString(self::YEAR, 'iso'), + 'hour' => $this->toString(self::HOUR_SHORT, 'iso'), + 'minute' => $this->toString(self::MINUTE_SHORT, 'iso'), + 'second' => $this->toString(self::SECOND_SHORT, 'iso'), + 'timezone' => $this->toString(self::TIMEZONE, 'iso'), + 'timestamp' => $this->toString(self::TIMESTAMP, 'iso'), + 'weekday' => $this->toString(self::WEEKDAY_8601, 'iso'), + 'dayofyear' => $this->toString(self::DAY_OF_YEAR, 'iso'), + 'week' => $this->toString(self::WEEK, 'iso'), + 'gmtsecs' => $this->toString(self::TIMEZONE_SECS, 'iso')); + } + + /** + * Returns a representation of a date or datepart + * This could be for example a localized monthname, the time without date, + * the era or only the fractional seconds. There are about 50 different supported date parts. + * For a complete list of supported datepart values look into the docu + * + * @param string $part OPTIONAL Part of the date to return, if null the timestamp is returned + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return string date or datepart + */ + public function get($part = null, $locale = null) + { + if ($locale === null) { + $locale = $this->getLocale(); + } + + if (($part !== null) && !defined($part) + && ($part != 'ee') && ($part != 'ss') && ($part != 'GG') && ($part != 'MM') && ($part != 'EE') && ($part != 'TT') + && Zend_Locale::isLocale($part, null, false)) { + $locale = $part; + $part = null; + } + + if ($part === null) { + $part = self::TIMESTAMP; + } else if (self::$_options['format_type'] == 'php') { + $part = Zend_Locale_Format::convertPhpToIsoFormat($part); + } + + return $this->date($this->_toToken($part, $locale), $this->getUnixTimestamp(), false); + } + + /** + * Internal method to apply tokens + * + * @param string $part + * @param string $locale + * @return string + */ + private function _toToken($part, $locale) { + // get format tokens + $comment = false; + $format = ''; + $orig = ''; + for ($i = 0; isset($part[$i]); ++$i) { + if ($part[$i] == "'") { + $comment = $comment ? false : true; + if (isset($part[$i+1]) && ($part[$i+1] == "'")) { + $comment = $comment ? false : true; + $format .= "\\'"; + ++$i; + } + + $orig = ''; + continue; + } + + if ($comment) { + $format .= '\\' . $part[$i]; + $orig = ''; + } else { + $orig .= $part[$i]; + if (!isset($part[$i+1]) || (isset($orig[0]) && ($orig[0] != $part[$i+1]))) { + $format .= $this->_parseIsoToDate($orig, $locale); + $orig = ''; + } + } + } + + return $format; + } + + /** + * Internal parsing method + * + * @param string $token + * @param string $locale + * @return string + */ + private function _parseIsoToDate($token, $locale) { + switch($token) { + case self::DAY : + return 'd'; + break; + + case self::WEEKDAY_SHORT : + $weekday = strtolower($this->date('D', $this->getUnixTimestamp(), false)); + $day = Zend_Locale_Data::getContent($locale, 'day', array('gregorian', 'format', 'wide', $weekday)); + return $this->_toComment(iconv_substr($day, 0, 3, 'UTF-8')); + break; + + case self::DAY_SHORT : + return 'j'; + break; + + case self::WEEKDAY : + $weekday = strtolower($this->date('D', $this->getUnixTimestamp(), false)); + return $this->_toComment(Zend_Locale_Data::getContent($locale, 'day', array('gregorian', 'format', 'wide', $weekday))); + break; + + case self::WEEKDAY_8601 : + return 'N'; + break; + + case 'ee' : + return $this->_toComment(str_pad($this->date('N', $this->getUnixTimestamp(), false), 2, '0', STR_PAD_LEFT)); + break; + + case self::DAY_SUFFIX : + return 'S'; + break; + + case self::WEEKDAY_DIGIT : + return 'w'; + break; + + case self::DAY_OF_YEAR : + return 'z'; + break; + + case 'DDD' : + return $this->_toComment(str_pad($this->date('z', $this->getUnixTimestamp(), false), 3, '0', STR_PAD_LEFT)); + break; + + case 'DD' : + return $this->_toComment(str_pad($this->date('z', $this->getUnixTimestamp(), false), 2, '0', STR_PAD_LEFT)); + break; + + case self::WEEKDAY_NARROW : + case 'EEEEE' : + $weekday = strtolower($this->date('D', $this->getUnixTimestamp(), false)); + $day = Zend_Locale_Data::getContent($locale, 'day', array('gregorian', 'format', 'abbreviated', $weekday)); + return $this->_toComment(iconv_substr($day, 0, 1, 'UTF-8')); + break; + + case self::WEEKDAY_NAME : + $weekday = strtolower($this->date('D', $this->getUnixTimestamp(), false)); + return $this->_toComment(Zend_Locale_Data::getContent($locale, 'day', array('gregorian', 'format', 'abbreviated', $weekday))); + break; + + case 'w' : + $week = $this->date('W', $this->getUnixTimestamp(), false); + return $this->_toComment(($week[0] == '0') ? $week[1] : $week); + break; + + case self::WEEK : + return 'W'; + break; + + case self::MONTH_NAME : + $month = $this->date('n', $this->getUnixTimestamp(), false); + return $this->_toComment(Zend_Locale_Data::getContent($locale, 'month', array('gregorian', 'format', 'wide', $month))); + break; + + case self::MONTH : + return 'm'; + break; + + case self::MONTH_NAME_SHORT : + $month = $this->date('n', $this->getUnixTimestamp(), false); + return $this->_toComment(Zend_Locale_Data::getContent($locale, 'month', array('gregorian', 'format', 'abbreviated', $month))); + break; + + case self::MONTH_SHORT : + return 'n'; + break; + + case self::MONTH_DAYS : + return 't'; + break; + + case self::MONTH_NAME_NARROW : + $month = $this->date('n', $this->getUnixTimestamp(), false); + $mon = Zend_Locale_Data::getContent($locale, 'month', array('gregorian', 'format', 'abbreviated', $month)); + return $this->_toComment(iconv_substr($mon, 0, 1, 'UTF-8')); + break; + + case self::LEAPYEAR : + return 'L'; + break; + + case self::YEAR_8601 : + return 'o'; + break; + + case self::YEAR : + return 'Y'; + break; + + case self::YEAR_SHORT : + return 'y'; + break; + + case self::YEAR_SHORT_8601 : + return $this->_toComment(substr($this->date('o', $this->getUnixTimestamp(), false), -2, 2)); + break; + + case self::MERIDIEM : + $am = $this->date('a', $this->getUnixTimestamp(), false); + if ($am == 'am') { + return $this->_toComment(Zend_Locale_Data::getContent($locale, 'am')); + } + + return $this->_toComment(Zend_Locale_Data::getContent($locale, 'pm')); + break; + + case self::SWATCH : + return 'B'; + break; + + case self::HOUR_SHORT_AM : + return 'g'; + break; + + case self::HOUR_SHORT : + return 'G'; + break; + + case self::HOUR_AM : + return 'h'; + break; + + case self::HOUR : + return 'H'; + break; + + case self::MINUTE : + return $this->_toComment(str_pad($this->date('i', $this->getUnixTimestamp(), false), 2, '0', STR_PAD_LEFT)); + break; + + case self::SECOND : + return $this->_toComment(str_pad($this->date('s', $this->getUnixTimestamp(), false), 2, '0', STR_PAD_LEFT)); + break; + + case self::MINUTE_SHORT : + return 'i'; + break; + + case self::SECOND_SHORT : + return 's'; + break; + + case self::MILLISECOND : + return $this->_toComment($this->getMilliSecond()); + break; + + case self::TIMEZONE_NAME : + case 'vvvv' : + return 'e'; + break; + + case self::DAYLIGHT : + return 'I'; + break; + + case self::GMT_DIFF : + case 'ZZ' : + case 'ZZZ' : + return 'O'; + break; + + case self::GMT_DIFF_SEP : + return 'P'; + break; + + case self::TIMEZONE : + case 'v' : + case 'zz' : + case 'zzz' : + return 'T'; + break; + + case self::TIMEZONE_SECS : + return 'Z'; + break; + + case self::ISO_8601 : + return 'c'; + break; + + case self::RFC_2822 : + return 'r'; + break; + + case self::TIMESTAMP : + return 'U'; + break; + + case self::ERA : + case 'GG' : + case 'GGG' : + $year = $this->date('Y', $this->getUnixTimestamp(), false); + if ($year < 0) { + return $this->_toComment(Zend_Locale_Data::getContent($locale, 'era', array('gregorian', 'Abbr', '0'))); + } + + return $this->_toComment(Zend_Locale_Data::getContent($locale, 'era', array('gregorian', 'Abbr', '1'))); + break; + + case self::ERA_NARROW : + $year = $this->date('Y', $this->getUnixTimestamp(), false); + if ($year < 0) { + return $this->_toComment(iconv_substr(Zend_Locale_Data::getContent($locale, 'era', array('gregorian', 'Abbr', '0')), 0, 1, 'UTF-8')) . '.'; + } + + return $this->_toComment(iconv_substr(Zend_Locale_Data::getContent($locale, 'era', array('gregorian', 'Abbr', '1')), 0, 1, 'UTF-8')) . '.'; + break; + + case self::ERA_NAME : + $year = $this->date('Y', $this->getUnixTimestamp(), false); + if ($year < 0) { + return $this->_toComment(Zend_Locale_Data::getContent($locale, 'era', array('gregorian', 'Names', '0'))); + } + + return $this->_toComment(Zend_Locale_Data::getContent($locale, 'era', array('gregorian', 'Names', '1'))); + break; + + case self::DATES : + return $this->_toToken(Zend_Locale_Format::getDateFormat($locale), $locale); + break; + + case self::DATE_FULL : + return $this->_toToken(Zend_Locale_Data::getContent($locale, 'date', array('gregorian', 'full')), $locale); + break; + + case self::DATE_LONG : + return $this->_toToken(Zend_Locale_Data::getContent($locale, 'date', array('gregorian', 'long')), $locale); + break; + + case self::DATE_MEDIUM : + return $this->_toToken(Zend_Locale_Data::getContent($locale, 'date', array('gregorian', 'medium')), $locale); + break; + + case self::DATE_SHORT : + return $this->_toToken(Zend_Locale_Data::getContent($locale, 'date', array('gregorian', 'short')), $locale); + break; + + case self::TIMES : + return $this->_toToken(Zend_Locale_Format::getTimeFormat($locale), $locale); + break; + + case self::TIME_FULL : + return $this->_toToken(Zend_Locale_Data::getContent($locale, 'time', 'full'), $locale); + break; + + case self::TIME_LONG : + return $this->_toToken(Zend_Locale_Data::getContent($locale, 'time', 'long'), $locale); + break; + + case self::TIME_MEDIUM : + return $this->_toToken(Zend_Locale_Data::getContent($locale, 'time', 'medium'), $locale); + break; + + case self::TIME_SHORT : + return $this->_toToken(Zend_Locale_Data::getContent($locale, 'time', 'short'), $locale); + break; + + case self::DATETIME : + return $this->_toToken(Zend_Locale_Format::getDateTimeFormat($locale), $locale); + break; + + case self::DATETIME_FULL : + return $this->_toToken(Zend_Locale_Data::getContent($locale, 'datetime', array('gregorian', 'full')), $locale); + break; + + case self::DATETIME_LONG : + return $this->_toToken(Zend_Locale_Data::getContent($locale, 'datetime', array('gregorian', 'long')), $locale); + break; + + case self::DATETIME_MEDIUM : + return $this->_toToken(Zend_Locale_Data::getContent($locale, 'datetime', array('gregorian', 'medium')), $locale); + break; + + case self::DATETIME_SHORT : + return $this->_toToken(Zend_Locale_Data::getContent($locale, 'datetime', array('gregorian', 'short')), $locale); + break; + + case self::ATOM : + return 'Y\-m\-d\TH\:i\:sP'; + break; + + case self::COOKIE : + return 'l\, d\-M\-y H\:i\:s e'; + break; + + case self::RFC_822 : + return 'D\, d M y H\:i\:s O'; + break; + + case self::RFC_850 : + return 'l\, d\-M\-y H\:i\:s e'; + break; + + case self::RFC_1036 : + return 'D\, d M y H\:i\:s O'; + break; + + case self::RFC_1123 : + return 'D\, d M Y H\:i\:s O'; + break; + + case self::RFC_3339 : + return 'Y\-m\-d\TH\:i\:sP'; + break; + + case self::RSS : + return 'D\, d M Y H\:i\:s O'; + break; + + case self::W3C : + return 'Y\-m\-d\TH\:i\:sP'; + break; + } + + if ($token == '') { + return ''; + } + + switch ($token[0]) { + case 'y' : + if ((strlen($token) == 4) && (abs($this->getUnixTimestamp()) <= 0x7FFFFFFF)) { + return 'Y'; + } + + $length = iconv_strlen($token, 'UTF-8'); + return $this->_toComment(str_pad($this->date('Y', $this->getUnixTimestamp(), false), $length, '0', STR_PAD_LEFT)); + break; + + case 'Y' : + if ((strlen($token) == 4) && (abs($this->getUnixTimestamp()) <= 0x7FFFFFFF)) { + return 'o'; + } + + $length = iconv_strlen($token, 'UTF-8'); + return $this->_toComment(str_pad($this->date('o', $this->getUnixTimestamp(), false), $length, '0', STR_PAD_LEFT)); + break; + + case 'A' : + $length = iconv_strlen($token, 'UTF-8'); + $result = substr($this->getMilliSecond(), 0, 3); + $result += $this->date('s', $this->getUnixTimestamp(), false) * 1000; + $result += $this->date('i', $this->getUnixTimestamp(), false) * 60000; + $result += $this->date('H', $this->getUnixTimestamp(), false) * 3600000; + + return $this->_toComment(str_pad($result, $length, '0', STR_PAD_LEFT)); + break; + } + + return $this->_toComment($token); + } + + /** + * Private function to make a comment of a token + * + * @param string $token + * @return string + */ + private function _toComment($token) + { + $token = str_split($token); + $result = ''; + foreach ($token as $tok) { + $result .= '\\' . $tok; + } + + return $result; + } + + /** + * Return digit from standard names (english) + * Faster implementation than locale aware searching + * + * @param string $name + * @return integer Number of this month + * @throws Zend_Date_Exception + */ + private function _getDigitFromName($name) + { + switch($name) { + case "Jan": + return 1; + + case "Feb": + return 2; + + case "Mar": + return 3; + + case "Apr": + return 4; + + case "May": + return 5; + + case "Jun": + return 6; + + case "Jul": + return 7; + + case "Aug": + return 8; + + case "Sep": + return 9; + + case "Oct": + return 10; + + case "Nov": + return 11; + + case "Dec": + return 12; + + default: + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception('Month ($name) is not a known month'); + } + } + + /** + * Counts the exact year number + * < 70 - 2000 added, >70 < 100 - 1900, others just returned + * + * @param integer $value year number + * @return integer Number of year + */ + public static function getFullYear($value) + { + if ($value >= 0) { + if ($value < 70) { + $value += 2000; + } else if ($value < 100) { + $value += 1900; + } + } + return $value; + } + + /** + * Sets the given date as new date or a given datepart as new datepart returning the new datepart + * This could be for example a localized dayname, the date without time, + * the month or only the seconds. There are about 50 different supported date parts. + * For a complete list of supported datepart values look into the docu + * + * @param string|integer|array|Zend_Date $date Date or datepart to set + * @param string $part OPTIONAL Part of the date to set, if null the timestamp is set + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date Provides fluid interface + * @throws Zend_Date_Exception + */ + public function set($date, $part = null, $locale = null) + { + if (self::$_options['format_type'] == 'php') { + $part = Zend_Locale_Format::convertPhpToIsoFormat($part); + } + + $zone = $this->getTimezoneFromString($date); + $this->setTimezone($zone); + + $this->_calculate('set', $date, $part, $locale); + return $this; + } + + /** + * Adds a date or datepart to the existing date, by extracting $part from $date, + * and modifying this object by adding that part. The $part is then extracted from + * this object and returned as an integer or numeric string (for large values, or $part's + * corresponding to pre-defined formatted date strings). + * This could be for example a ISO 8601 date, the hour the monthname or only the minute. + * There are about 50 different supported date parts. + * For a complete list of supported datepart values look into the docu. + * + * @param string|integer|array|Zend_Date $date Date or datepart to add + * @param string $part OPTIONAL Part of the date to add, if null the timestamp is added + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date Provides fluid interface + * @throws Zend_Date_Exception + */ + public function add($date, $part = self::TIMESTAMP, $locale = null) + { + if (self::$_options['format_type'] == 'php') { + $part = Zend_Locale_Format::convertPhpToIsoFormat($part); + } + + $this->_calculate('add', $date, $part, $locale); + return $this; + } + + /** + * Subtracts a date from another date. + * This could be for example a RFC2822 date, the time, + * the year or only the timestamp. There are about 50 different supported date parts. + * For a complete list of supported datepart values look into the docu + * Be aware: Adding -2 Months is not equal to Subtracting 2 Months !!! + * + * @param string|integer|array|Zend_Date $date Date or datepart to subtract + * @param string $part OPTIONAL Part of the date to sub, if null the timestamp is subtracted + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date Provides fluid interface + * @throws Zend_Date_Exception + */ + public function sub($date, $part = self::TIMESTAMP, $locale = null) + { + if (self::$_options['format_type'] == 'php') { + $part = Zend_Locale_Format::convertPhpToIsoFormat($part); + } + + $this->_calculate('sub', $date, $part, $locale); + return $this; + } + + /** + * Compares a date or datepart with the existing one. + * Returns -1 if earlier, 0 if equal and 1 if later. + * + * @param string|integer|array|Zend_Date $date Date or datepart to compare with the date object + * @param string $part OPTIONAL Part of the date to compare, if null the timestamp is subtracted + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return integer 0 = equal, 1 = later, -1 = earlier + * @throws Zend_Date_Exception + */ + public function compare($date, $part = self::TIMESTAMP, $locale = null) + { + if (self::$_options['format_type'] == 'php') { + $part = Zend_Locale_Format::convertPhpToIsoFormat($part); + } + + $compare = $this->_calculate('cmp', $date, $part, $locale); + + if ($compare > 0) { + return 1; + } else if ($compare < 0) { + return -1; + } + return 0; + } + + /** + * Returns a new instance of Zend_Date with the selected part copied. + * To make an exact copy, use PHP's clone keyword. + * For a complete list of supported date part values look into the docu. + * If a date part is copied, all other date parts are set to standard values. + * For example: If only YEAR is copied, the returned date object is equal to + * 01-01-YEAR 00:00:00 (01-01-1970 00:00:00 is equal to timestamp 0) + * If only HOUR is copied, the returned date object is equal to + * 01-01-1970 HOUR:00:00 (so $this contains a timestamp equal to a timestamp of 0 plus HOUR). + * + * @param string $part Part of the date to compare, if null the timestamp is subtracted + * @param string|Zend_Locale $locale OPTIONAL New object's locale. No adjustments to timezone are made. + * @return Zend_Date New clone with requested part + */ + public function copyPart($part, $locale = null) + { + $clone = clone $this; // copy all instance variables + $clone->setUnixTimestamp(0); // except the timestamp + if ($locale != null) { + $clone->setLocale($locale); // set an other locale if selected + } + $clone->set($this, $part); + return $clone; + } + + /** + * Internal function, returns the offset of a given timezone + * + * @param string $zone + * @return integer + */ + public function getTimezoneFromString($zone) + { + if (is_array($zone)) { + return $this->getTimezone(); + } + + if ($zone instanceof Zend_Date) { + return $zone->getTimezone(); + } + + $match = array(); + preg_match('/\dZ$/', $zone, $match); + if (!empty($match)) { + return "Etc/UTC"; + } + + preg_match('/([+-]\d{2}):{0,1}\d{2}/', $zone, $match); + if (!empty($match) and ($match[count($match) - 1] <= 12) and ($match[count($match) - 1] >= -12)) { + $zone = "Etc/GMT"; + $zone .= ($match[count($match) - 1] < 0) ? "+" : "-"; + $zone .= (int) abs($match[count($match) - 1]); + return $zone; + } + + preg_match('/([[:alpha:]\/]{3,30})(?!.*([[:alpha:]\/]{3,30}))/', $zone, $match); + try { + if (!empty($match) and (!is_int($match[count($match) - 1]))) { + $oldzone = $this->getTimezone(); + $this->setTimezone($match[count($match) - 1]); + $result = $this->getTimezone(); + $this->setTimezone($oldzone); + if ($result !== $oldzone) { + return $match[count($match) - 1]; + } + } + } catch (Exception $e) { + // fall through + } + + return $this->getTimezone(); + } + + /** + * Calculates the date or object + * + * @param string $calc Calculation to make + * @param string|integer $date Date for calculation + * @param string|integer $comp Second date for calculation + * @param boolean|integer $dst Use dst correction if option is set + * @return integer|string|Zend_Date new timestamp or Zend_Date depending on calculation + */ + private function _assign($calc, $date, $comp = 0, $dst = false) + { + switch ($calc) { + case 'set' : + if (!empty($comp)) { + $this->setUnixTimestamp(call_user_func(Zend_Locale_Math::$sub, $this->getUnixTimestamp(), $comp)); + } + $this->setUnixTimestamp(call_user_func(Zend_Locale_Math::$add, $this->getUnixTimestamp(), $date)); + $value = $this->getUnixTimestamp(); + break; + case 'add' : + $this->setUnixTimestamp(call_user_func(Zend_Locale_Math::$add, $this->getUnixTimestamp(), $date)); + $value = $this->getUnixTimestamp(); + break; + case 'sub' : + $this->setUnixTimestamp(call_user_func(Zend_Locale_Math::$sub, $this->getUnixTimestamp(), $date)); + $value = $this->getUnixTimestamp(); + break; + default : + // cmp - compare + return call_user_func(Zend_Locale_Math::$comp, $comp, $date); + break; + } + + // dst-correction if 'fix_dst' = true and dst !== false but only for non UTC and non GMT + if ((self::$_options['fix_dst'] === true) and ($dst !== false) and ($this->_dst === true)) { + $hour = $this->toString(self::HOUR, 'iso'); + if ($hour != $dst) { + if (($dst == ($hour + 1)) or ($dst == ($hour - 23))) { + $value += 3600; + } else if (($dst == ($hour - 1)) or ($dst == ($hour + 23))) { + $value -= 3600; + } + $this->setUnixTimestamp($value); + } + } + return $this->getUnixTimestamp(); + } + + + /** + * Calculates the date or object + * + * @param string $calc Calculation to make, one of: 'add'|'sub'|'cmp'|'copy'|'set' + * @param string|integer|array|Zend_Date $date Date or datepart to calculate with + * @param string $part Part of the date to calculate, if null the timestamp is used + * @param string|Zend_Locale $locale Locale for parsing input + * @return integer|string|Zend_Date new timestamp + * @throws Zend_Date_Exception + */ + private function _calculate($calc, $date, $part, $locale) + { + if ($date === null) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception('parameter $date must be set, null is not allowed'); + } + + if (($part !== null) && (strlen($part) !== 2) && (Zend_Locale::isLocale($part, null, false))) { + $locale = $part; + $part = null; + } + + if ($locale === null) { + $locale = $this->getLocale(); + } + + $locale = (string) $locale; + + // Create date parts + $year = $this->toString(self::YEAR, 'iso'); + $month = $this->toString(self::MONTH_SHORT, 'iso'); + $day = $this->toString(self::DAY_SHORT, 'iso'); + $hour = $this->toString(self::HOUR_SHORT, 'iso'); + $minute = $this->toString(self::MINUTE_SHORT, 'iso'); + $second = $this->toString(self::SECOND_SHORT, 'iso'); + // If object extract value + if ($date instanceof Zend_Date) { + $date = $date->toString($part, 'iso', $locale); + } + + if (is_array($date) === true) { + if (empty($part) === false) { + switch($part) { + // Fall through + case self::DAY: + case self::DAY_SHORT: + if (isset($date['day']) === true) { + $date = $date['day']; + } + break; + // Fall through + case self::WEEKDAY_SHORT: + case self::WEEKDAY: + case self::WEEKDAY_8601: + case self::WEEKDAY_DIGIT: + case self::WEEKDAY_NARROW: + case self::WEEKDAY_NAME: + if (isset($date['weekday']) === true) { + $date = $date['weekday']; + $part = self::WEEKDAY_DIGIT; + } + break; + case self::DAY_OF_YEAR: + if (isset($date['day_of_year']) === true) { + $date = $date['day_of_year']; + } + break; + // Fall through + case self::MONTH: + case self::MONTH_SHORT: + case self::MONTH_NAME: + case self::MONTH_NAME_SHORT: + case self::MONTH_NAME_NARROW: + if (isset($date['month']) === true) { + $date = $date['month']; + } + break; + // Fall through + case self::YEAR: + case self::YEAR_SHORT: + case self::YEAR_8601: + case self::YEAR_SHORT_8601: + if (isset($date['year']) === true) { + $date = $date['year']; + } + break; + // Fall through + case self::HOUR: + case self::HOUR_AM: + case self::HOUR_SHORT: + case self::HOUR_SHORT_AM: + if (isset($date['hour']) === true) { + $date = $date['hour']; + } + break; + // Fall through + case self::MINUTE: + case self::MINUTE_SHORT: + if (isset($date['minute']) === true) { + $date = $date['minute']; + } + break; + // Fall through + case self::SECOND: + case self::SECOND_SHORT: + if (isset($date['second']) === true) { + $date = $date['second']; + } + break; + // Fall through + case self::TIMEZONE: + case self::TIMEZONE_NAME: + if (isset($date['timezone']) === true) { + $date = $date['timezone']; + } + break; + case self::TIMESTAMP: + if (isset($date['timestamp']) === true) { + $date = $date['timestamp']; + } + break; + case self::WEEK: + if (isset($date['week']) === true) { + $date = $date['week']; + } + break; + case self::TIMEZONE_SECS: + if (isset($date['gmtsecs']) === true) { + $date = $date['gmtsecs']; + } + break; + default: + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("datepart for part ($part) not found in array"); + break; + } + } else { + $hours = 0; + if (isset($date['hour']) === true) { + $hours = $date['hour']; + } + $minutes = 0; + if (isset($date['minute']) === true) { + $minutes = $date['minute']; + } + $seconds = 0; + if (isset($date['second']) === true) { + $seconds = $date['second']; + } + $months = 0; + if (isset($date['month']) === true) { + $months = $date['month']; + } + $days = 0; + if (isset($date['day']) === true) { + $days = $date['day']; + } + $years = 0; + if (isset($date['year']) === true) { + $years = $date['year']; + } + return $this->_assign($calc, $this->mktime($hours, $minutes, $seconds, $months, $days, $years, true), + $this->mktime($hour, $minute, $second, $month, $day, $year, true), $hour); + } + } + + // $date as object, part of foreign date as own date + switch($part) { + + // day formats + case self::DAY: + if (is_numeric($date)) { + return $this->_assign($calc, $this->mktime(0, 0, 0, 1, 1 + intval($date), 1970, true), + $this->mktime(0, 0, 0, 1, 1 + intval($day), 1970, true), $hour); + } + + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("invalid date ($date) operand, day expected", 0, null, $date); + break; + + case self::WEEKDAY_SHORT: + $daylist = Zend_Locale_Data::getList($locale, 'day'); + $weekday = (int) $this->toString(self::WEEKDAY_DIGIT, 'iso', $locale); + $cnt = 0; + + foreach ($daylist as $key => $value) { + if (strtoupper(iconv_substr($value, 0, 3, 'UTF-8')) == strtoupper($date)) { + $found = $cnt; + break; + } + ++$cnt; + } + + // Weekday found + if ($cnt < 7) { + return $this->_assign($calc, $this->mktime(0, 0, 0, 1, 1 + $found, 1970, true), + $this->mktime(0, 0, 0, 1, 1 + $weekday, 1970, true), $hour); + } + + // Weekday not found + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("invalid date ($date) operand, weekday expected", 0, null, $date); + break; + + case self::DAY_SHORT: + if (is_numeric($date)) { + return $this->_assign($calc, $this->mktime(0, 0, 0, 1, 1 + intval($date), 1970, true), + $this->mktime(0, 0, 0, 1, 1 + intval($day), 1970, true), $hour); + } + + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("invalid date ($date) operand, day expected", 0, null, $date); + break; + + case self::WEEKDAY: + $daylist = Zend_Locale_Data::getList($locale, 'day'); + $weekday = (int) $this->toString(self::WEEKDAY_DIGIT, 'iso', $locale); + $cnt = 0; + + foreach ($daylist as $key => $value) { + if (strtoupper($value) == strtoupper($date)) { + $found = $cnt; + break; + } + ++$cnt; + } + + // Weekday found + if ($cnt < 7) { + return $this->_assign($calc, $this->mktime(0, 0, 0, 1, 1 + $found, 1970, true), + $this->mktime(0, 0, 0, 1, 1 + $weekday, 1970, true), $hour); + } + + // Weekday not found + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("invalid date ($date) operand, weekday expected", 0, null, $date); + break; + + case self::WEEKDAY_8601: + $weekday = (int) $this->toString(self::WEEKDAY_8601, 'iso', $locale); + if ((intval($date) > 0) and (intval($date) < 8)) { + return $this->_assign($calc, $this->mktime(0, 0, 0, 1, 1 + intval($date), 1970, true), + $this->mktime(0, 0, 0, 1, 1 + $weekday, 1970, true), $hour); + } + + // Weekday not found + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("invalid date ($date) operand, weekday expected", 0, null, $date); + break; + + case self::DAY_SUFFIX: + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception('day suffix not supported', 0, null, $date); + break; + + case self::WEEKDAY_DIGIT: + $weekday = (int) $this->toString(self::WEEKDAY_DIGIT, 'iso', $locale); + if (is_numeric($date) and (intval($date) >= 0) and (intval($date) < 7)) { + return $this->_assign($calc, $this->mktime(0, 0, 0, 1, 1 + $date, 1970, true), + $this->mktime(0, 0, 0, 1, 1 + $weekday, 1970, true), $hour); + } + + // Weekday not found + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("invalid date ($date) operand, weekday expected", 0, null, $date); + break; + + case self::DAY_OF_YEAR: + if (is_numeric($date)) { + if (($calc == 'add') || ($calc == 'sub')) { + $year = 1970; + ++$date; + ++$day; + } + + return $this->_assign($calc, $this->mktime(0, 0, 0, 1, $date, $year, true), + $this->mktime(0, 0, 0, $month, $day, $year, true), $hour); + } + + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("invalid date ($date) operand, day expected", 0, null, $date); + break; + + case self::WEEKDAY_NARROW: + $daylist = Zend_Locale_Data::getList($locale, 'day', array('gregorian', 'format', 'abbreviated')); + $weekday = (int) $this->toString(self::WEEKDAY_DIGIT, 'iso', $locale); + $cnt = 0; + foreach ($daylist as $key => $value) { + if (strtoupper(iconv_substr($value, 0, 1, 'UTF-8')) == strtoupper($date)) { + $found = $cnt; + break; + } + ++$cnt; + } + + // Weekday found + if ($cnt < 7) { + return $this->_assign($calc, $this->mktime(0, 0, 0, 1, 1 + $found, 1970, true), + $this->mktime(0, 0, 0, 1, 1 + $weekday, 1970, true), $hour); + } + + // Weekday not found + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("invalid date ($date) operand, weekday expected", 0, null, $date); + break; + + case self::WEEKDAY_NAME: + $daylist = Zend_Locale_Data::getList($locale, 'day', array('gregorian', 'format', 'abbreviated')); + $weekday = (int) $this->toString(self::WEEKDAY_DIGIT, 'iso', $locale); + $cnt = 0; + foreach ($daylist as $key => $value) { + if (strtoupper($value) == strtoupper($date)) { + $found = $cnt; + break; + } + ++$cnt; + } + + // Weekday found + if ($cnt < 7) { + return $this->_assign($calc, $this->mktime(0, 0, 0, 1, 1 + $found, 1970, true), + $this->mktime(0, 0, 0, 1, 1 + $weekday, 1970, true), $hour); + } + + // Weekday not found + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("invalid date ($date) operand, weekday expected", 0, null, $date); + break; + + // week formats + case self::WEEK: + if (is_numeric($date)) { + $week = (int) $this->toString(self::WEEK, 'iso', $locale); + return $this->_assign($calc, parent::mktime(0, 0, 0, 1, 1 + ($date * 7), 1970, true), + parent::mktime(0, 0, 0, 1, 1 + ($week * 7), 1970, true), $hour); + } + + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("invalid date ($date) operand, week expected", 0, null, $date); + break; + + // month formats + case self::MONTH_NAME: + $monthlist = Zend_Locale_Data::getList($locale, 'month'); + $cnt = 0; + foreach ($monthlist as $key => $value) { + if (strtoupper($value) == strtoupper($date)) { + $found = $key; + break; + } + ++$cnt; + } + $date = array_search($date, $monthlist); + + // Monthname found + if ($cnt < 12) { + $fixday = 0; + if ($calc == 'add') { + $date += $found; + $calc = 'set'; + if (self::$_options['extend_month'] == false) { + $parts = $this->getDateParts($this->mktime($hour, $minute, $second, $date, $day, $year, false)); + if ($parts['mday'] != $day) { + $fixday = ($parts['mday'] < $day) ? -$parts['mday'] : ($parts['mday'] - $day); + } + } + } else if ($calc == 'sub') { + $date = $month - $found; + $calc = 'set'; + if (self::$_options['extend_month'] == false) { + $parts = $this->getDateParts($this->mktime($hour, $minute, $second, $date, $day, $year, false)); + if ($parts['mday'] != $day) { + $fixday = ($parts['mday'] < $day) ? -$parts['mday'] : ($parts['mday'] - $day); + } + } + } + return $this->_assign($calc, $this->mktime(0, 0, 0, $date, $day + $fixday, $year, true), + $this->mktime(0, 0, 0, $month, $day, $year, true), $hour); + } + + // Monthname not found + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("invalid date ($date) operand, month expected", 0, null, $date); + break; + + case self::MONTH: + if (is_numeric($date)) { + $fixday = 0; + if ($calc == 'add') { + $date += $month; + $calc = 'set'; + if (self::$_options['extend_month'] == false) { + $parts = $this->getDateParts($this->mktime($hour, $minute, $second, $date, $day, $year, false)); + if ($parts['mday'] != $day) { + $fixday = ($parts['mday'] < $day) ? -$parts['mday'] : ($parts['mday'] - $day); + } + } + } else if ($calc == 'sub') { + $date = $month - $date; + $calc = 'set'; + if (self::$_options['extend_month'] == false) { + $parts = $this->getDateParts($this->mktime($hour, $minute, $second, $date, $day, $year, false)); + if ($parts['mday'] != $day) { + $fixday = ($parts['mday'] < $day) ? -$parts['mday'] : ($parts['mday'] - $day); + } + } + } + return $this->_assign($calc, $this->mktime(0, 0, 0, $date, $day + $fixday, $year, true), + $this->mktime(0, 0, 0, $month, $day, $year, true), $hour); + } + + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("invalid date ($date) operand, month expected", 0, null, $date); + break; + + case self::MONTH_NAME_SHORT: + $monthlist = Zend_Locale_Data::getList($locale, 'month', array('gregorian', 'format', 'abbreviated')); + $cnt = 0; + foreach ($monthlist as $key => $value) { + if (strtoupper($value) == strtoupper($date)) { + $found = $key; + break; + } + ++$cnt; + } + $date = array_search($date, $monthlist); + + // Monthname found + if ($cnt < 12) { + $fixday = 0; + if ($calc == 'add') { + $date += $found; + $calc = 'set'; + if (self::$_options['extend_month'] === false) { + $parts = $this->getDateParts($this->mktime($hour, $minute, $second, $date, $day, $year, false)); + if ($parts['mday'] != $day) { + $fixday = ($parts['mday'] < $day) ? -$parts['mday'] : ($parts['mday'] - $day); + } + } + } else if ($calc == 'sub') { + $date = $month - $found; + $calc = 'set'; + if (self::$_options['extend_month'] === false) { + $parts = $this->getDateParts($this->mktime($hour, $minute, $second, $date, $day, $year, false)); + if ($parts['mday'] != $day) { + $fixday = ($parts['mday'] < $day) ? -$parts['mday'] : ($parts['mday'] - $day); + } + } + } + return $this->_assign($calc, $this->mktime(0, 0, 0, $date, $day + $fixday, $year, true), + $this->mktime(0, 0, 0, $month, $day, $year, true), $hour); + } + + // Monthname not found + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("invalid date ($date) operand, month expected", 0, null, $date); + break; + + case self::MONTH_SHORT: + if (is_numeric($date) === true) { + $fixday = 0; + if ($calc === 'add') { + $date += $month; + $calc = 'set'; + if (self::$_options['extend_month'] === false) { + $parts = $this->getDateParts($this->mktime($hour, $minute, $second, $date, $day, $year, false)); + if ($parts['mday'] != $day) { + $fixday = ($parts['mday'] < $day) ? -$parts['mday'] : ($parts['mday'] - $day); + } + } + } else if ($calc === 'sub') { + $date = $month - $date; + $calc = 'set'; + if (self::$_options['extend_month'] === false) { + $parts = $this->getDateParts($this->mktime($hour, $minute, $second, $date, $day, $year, false)); + if ($parts['mday'] != $day) { + $fixday = ($parts['mday'] < $day) ? -$parts['mday'] : ($parts['mday'] - $day); + } + } + } + + return $this->_assign($calc, $this->mktime(0, 0, 0, $date, $day + $fixday, $year, true), + $this->mktime(0, 0, 0, $month, $day, $year, true), $hour); + } + + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("invalid date ($date) operand, month expected", 0, null, $date); + break; + + case self::MONTH_DAYS: + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception('month days not supported', 0, null, $date); + break; + + case self::MONTH_NAME_NARROW: + $monthlist = Zend_Locale_Data::getList($locale, 'month', array('gregorian', 'stand-alone', 'narrow')); + $cnt = 0; + foreach ($monthlist as $key => $value) { + if (strtoupper($value) === strtoupper($date)) { + $found = $key; + break; + } + ++$cnt; + } + $date = array_search($date, $monthlist); + + // Monthname found + if ($cnt < 12) { + $fixday = 0; + if ($calc === 'add') { + $date += $found; + $calc = 'set'; + if (self::$_options['extend_month'] === false) { + $parts = $this->getDateParts($this->mktime($hour, $minute, $second, $date, $day, $year, false)); + if ($parts['mday'] != $day) { + $fixday = ($parts['mday'] < $day) ? -$parts['mday'] : ($parts['mday'] - $day); + } + } + } else if ($calc === 'sub') { + $date = $month - $found; + $calc = 'set'; + if (self::$_options['extend_month'] === false) { + $parts = $this->getDateParts($this->mktime($hour, $minute, $second, $date, $day, $year, false)); + if ($parts['mday'] != $day) { + $fixday = ($parts['mday'] < $day) ? -$parts['mday'] : ($parts['mday'] - $day); + } + } + } + return $this->_assign($calc, $this->mktime(0, 0, 0, $date, $day + $fixday, $year, true), + $this->mktime(0, 0, 0, $month, $day, $year, true), $hour); + } + + // Monthname not found + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("invalid date ($date) operand, month expected", 0, null, $date); + break; + + // year formats + case self::LEAPYEAR: + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception('leap year not supported', 0, null, $date); + break; + + case self::YEAR_8601: + if (is_numeric($date)) { + if ($calc === 'add') { + $date += $year; + $calc = 'set'; + } else if ($calc === 'sub') { + $date = $year - $date; + $calc = 'set'; + } + + return $this->_assign($calc, $this->mktime(0, 0, 0, $month, $day, intval($date), true), + $this->mktime(0, 0, 0, $month, $day, $year, true), false); + } + + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("invalid date ($date) operand, year expected", 0, null, $date); + break; + + case self::YEAR: + if (is_numeric($date)) { + if ($calc === 'add') { + $date += $year; + $calc = 'set'; + } else if ($calc === 'sub') { + $date = $year - $date; + $calc = 'set'; + } + + return $this->_assign($calc, $this->mktime(0, 0, 0, $month, $day, intval($date), true), + $this->mktime(0, 0, 0, $month, $day, $year, true), false); + } + + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("invalid date ($date) operand, year expected", 0, null, $date); + break; + + case self::YEAR_SHORT: + if (is_numeric($date)) { + $date = intval($date); + if (($calc == 'set') || ($calc == 'cmp')) { + $date = self::getFullYear($date); + } + if ($calc === 'add') { + $date += $year; + $calc = 'set'; + } else if ($calc === 'sub') { + $date = $year - $date; + $calc = 'set'; + } + + return $this->_assign($calc, $this->mktime(0, 0, 0, $month, $day, $date, true), + $this->mktime(0, 0, 0, $month, $day, $year, true), false); + } + + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("invalid date ($date) operand, year expected", 0, null, $date); + break; + + case self::YEAR_SHORT_8601: + if (is_numeric($date)) { + $date = intval($date); + if (($calc === 'set') || ($calc === 'cmp')) { + $date = self::getFullYear($date); + } + if ($calc === 'add') { + $date += $year; + $calc = 'set'; + } else if ($calc === 'sub') { + $date = $year - $date; + $calc = 'set'; + } + + return $this->_assign($calc, $this->mktime(0, 0, 0, $month, $day, $date, true), + $this->mktime(0, 0, 0, $month, $day, $year, true), false); + } + + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("invalid date ($date) operand, year expected", 0, null, $date); + break; + + // time formats + case self::MERIDIEM: + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception('meridiem not supported', 0, null, $date); + break; + + case self::SWATCH: + if (is_numeric($date)) { + $rest = intval($date); + $hours = floor($rest * 24 / 1000); + $rest = $rest - ($hours * 1000 / 24); + $minutes = floor($rest * 1440 / 1000); + $rest = $rest - ($minutes * 1000 / 1440); + $seconds = floor($rest * 86400 / 1000); + return $this->_assign($calc, $this->mktime($hours, $minutes, $seconds, 1, 1, 1970, true), + $this->mktime($hour, $minute, $second, 1, 1, 1970, true), false); + } + + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("invalid date ($date) operand, swatchstamp expected", 0, null, $date); + break; + + case self::HOUR_SHORT_AM: + if (is_numeric($date)) { + return $this->_assign($calc, $this->mktime(intval($date), 0, 0, 1, 1, 1970, true), + $this->mktime($hour, 0, 0, 1, 1, 1970, true), false); + } + + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("invalid date ($date) operand, hour expected", 0, null, $date); + break; + + case self::HOUR_SHORT: + if (is_numeric($date)) { + return $this->_assign($calc, $this->mktime(intval($date), 0, 0, 1, 1, 1970, true), + $this->mktime($hour, 0, 0, 1, 1, 1970, true), false); + } + + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("invalid date ($date) operand, hour expected", 0, null, $date); + break; + + case self::HOUR_AM: + if (is_numeric($date)) { + return $this->_assign($calc, $this->mktime(intval($date), 0, 0, 1, 1, 1970, true), + $this->mktime($hour, 0, 0, 1, 1, 1970, true), false); + } + + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("invalid date ($date) operand, hour expected", 0, null, $date); + break; + + case self::HOUR: + if (is_numeric($date)) { + return $this->_assign($calc, $this->mktime(intval($date), 0, 0, 1, 1, 1970, true), + $this->mktime($hour, 0, 0, 1, 1, 1970, true), false); + } + + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("invalid date ($date) operand, hour expected", 0, null, $date); + break; + + case self::MINUTE: + if (is_numeric($date)) { + return $this->_assign($calc, $this->mktime(0, intval($date), 0, 1, 1, 1970, true), + $this->mktime(0, $minute, 0, 1, 1, 1970, true), false); + } + + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("invalid date ($date) operand, minute expected", 0, null, $date); + break; + + case self::SECOND: + if (is_numeric($date)) { + return $this->_assign($calc, $this->mktime(0, 0, intval($date), 1, 1, 1970, true), + $this->mktime(0, 0, $second, 1, 1, 1970, true), false); + } + + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("invalid date ($date) operand, second expected", 0, null, $date); + break; + + case self::MILLISECOND: + if (is_numeric($date)) { + switch($calc) { + case 'set' : + return $this->setMillisecond($date); + break; + case 'add' : + return $this->addMillisecond($date); + break; + case 'sub' : + return $this->subMillisecond($date); + break; + } + + return $this->compareMillisecond($date); + } + + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("invalid date ($date) operand, milliseconds expected", 0, null, $date); + break; + + case self::MINUTE_SHORT: + if (is_numeric($date)) { + return $this->_assign($calc, $this->mktime(0, intval($date), 0, 1, 1, 1970, true), + $this->mktime(0, $minute, 0, 1, 1, 1970, true), false); + } + + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("invalid date ($date) operand, minute expected", 0, null, $date); + break; + + case self::SECOND_SHORT: + if (is_numeric($date)) { + return $this->_assign($calc, $this->mktime(0, 0, intval($date), 1, 1, 1970, true), + $this->mktime(0, 0, $second, 1, 1, 1970, true), false); + } + + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("invalid date ($date) operand, second expected", 0, null, $date); + break; + + // timezone formats + // break intentionally omitted + case self::TIMEZONE_NAME: + case self::TIMEZONE: + case self::TIMEZONE_SECS: + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception('timezone not supported', 0, null, $date); + break; + + case self::DAYLIGHT: + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception('daylight not supported', 0, null, $date); + break; + + case self::GMT_DIFF: + case self::GMT_DIFF_SEP: + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception('gmtdiff not supported', 0, null, $date); + break; + + // date strings + case self::ISO_8601: + // (-)YYYY-MM-dd + preg_match('/^(-{0,1}\d{4})-(\d{2})-(\d{2})/', $date, $datematch); + // (-)YY-MM-dd + if (empty($datematch)) { + preg_match('/^(-{0,1}\d{2})-(\d{2})-(\d{2})/', $date, $datematch); + } + // (-)YYYYMMdd + if (empty($datematch)) { + preg_match('/^(-{0,1}\d{4})(\d{2})(\d{2})/', $date, $datematch); + } + // (-)YYMMdd + if (empty($datematch)) { + preg_match('/^(-{0,1}\d{2})(\d{2})(\d{2})/', $date, $datematch); + } + $tmpdate = $date; + if (!empty($datematch)) { + $dateMatchCharCount = iconv_strlen($datematch[0], 'UTF-8'); + $tmpdate = iconv_substr($date, + $dateMatchCharCount, + iconv_strlen($date, 'UTF-8') - $dateMatchCharCount, + 'UTF-8'); + } + // (T)hh:mm:ss + preg_match('/[T,\s]{0,1}(\d{2}):(\d{2}):(\d{2})/', $tmpdate, $timematch); + if (empty($timematch)) { + preg_match('/[T,\s]{0,1}(\d{2})(\d{2})(\d{2})/', $tmpdate, $timematch); + } + if (empty($datematch) and empty($timematch)) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("unsupported ISO8601 format ($date)", 0, null, $date); + } + if (!empty($timematch)) { + $timeMatchCharCount = iconv_strlen($timematch[0], 'UTF-8'); + $tmpdate = iconv_substr($tmpdate, + $timeMatchCharCount, + iconv_strlen($tmpdate, 'UTF-8') - $timeMatchCharCount, + 'UTF-8'); + } + if (empty($datematch)) { + $datematch[1] = 1970; + $datematch[2] = 1; + $datematch[3] = 1; + } else if (iconv_strlen($datematch[1], 'UTF-8') == 2) { + $datematch[1] = self::getFullYear($datematch[1]); + } + if (empty($timematch)) { + $timematch[1] = 0; + $timematch[2] = 0; + $timematch[3] = 0; + } + + if (($calc == 'set') || ($calc == 'cmp')) { + --$datematch[2]; + --$month; + --$datematch[3]; + --$day; + $datematch[1] -= 1970; + $year -= 1970; + } + return $this->_assign($calc, $this->mktime($timematch[1], $timematch[2], $timematch[3], 1 + $datematch[2], 1 + $datematch[3], 1970 + $datematch[1], false), + $this->mktime($hour, $minute, $second, 1 + $month, 1 + $day, 1970 + $year, false), false); + break; + + case self::RFC_2822: + $result = preg_match('/^\w{3},\s(\d{1,2})\s(\w{3})\s(\d{4})\s(\d{2}):(\d{2}):{0,1}(\d{0,2})\s([+-]{1}\d{4})$/', $date, $match); + if (!$result) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("no RFC 2822 format ($date)", 0, null, $date); + } + + $months = $this->_getDigitFromName($match[2]); + + if (($calc == 'set') || ($calc == 'cmp')) { + --$months; + --$month; + --$match[1]; + --$day; + $match[3] -= 1970; + $year -= 1970; + } + return $this->_assign($calc, $this->mktime($match[4], $match[5], $match[6], 1 + $months, 1 + $match[1], 1970 + $match[3], false), + $this->mktime($hour, $minute, $second, 1 + $month, 1 + $day, 1970 + $year, false), false); + break; + + case self::TIMESTAMP: + if (is_numeric($date)) { + return $this->_assign($calc, $date, $this->getUnixTimestamp()); + } + + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("invalid date ($date) operand, timestamp expected", 0, null, $date); + break; + + // additional formats + // break intentionally omitted + case self::ERA: + case self::ERA_NAME: + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception('era not supported', 0, null, $date); + break; + + case self::DATES: + try { + $parsed = Zend_Locale_Format::getDate($date, array('locale' => $locale, 'format_type' => 'iso', 'fix_date' => true)); + + if (($calc == 'set') || ($calc == 'cmp')) { + --$parsed['month']; + --$month; + --$parsed['day']; + --$day; + $parsed['year'] -= 1970; + $year -= 1970; + } + + return $this->_assign($calc, $this->mktime(0, 0, 0, 1 + $parsed['month'], 1 + $parsed['day'], 1970 + $parsed['year'], true), + $this->mktime(0, 0, 0, 1 + $month, 1 + $day, 1970 + $year, true), $hour); + } catch (Zend_Locale_Exception $e) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception($e->getMessage(), 0, $e, $date); + } + break; + + case self::DATE_FULL: + try { + $format = Zend_Locale_Data::getContent($locale, 'date', array('gregorian', 'full')); + $parsed = Zend_Locale_Format::getDate($date, array('date_format' => $format, 'format_type' => 'iso', 'locale' => $locale)); + + if (($calc == 'set') || ($calc == 'cmp')) { + --$parsed['month']; + --$month; + --$parsed['day']; + --$day; + $parsed['year'] -= 1970; + $year -= 1970; + } + return $this->_assign($calc, $this->mktime(0, 0, 0, 1 + $parsed['month'], 1 + $parsed['day'], 1970 + $parsed['year'], true), + $this->mktime(0, 0, 0, 1 + $month, 1 + $day, 1970 + $year, true), $hour); + } catch (Zend_Locale_Exception $e) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception($e->getMessage(), 0, $e, $date); + } + break; + + case self::DATE_LONG: + try { + $format = Zend_Locale_Data::getContent($locale, 'date', array('gregorian', 'long')); + $parsed = Zend_Locale_Format::getDate($date, array('date_format' => $format, 'format_type' => 'iso', 'locale' => $locale)); + + if (($calc == 'set') || ($calc == 'cmp')){ + --$parsed['month']; + --$month; + --$parsed['day']; + --$day; + $parsed['year'] -= 1970; + $year -= 1970; + } + return $this->_assign($calc, $this->mktime(0, 0, 0, 1 + $parsed['month'], 1 + $parsed['day'], 1970 + $parsed['year'], true), + $this->mktime(0, 0, 0, 1 + $month, 1 + $day, 1970 + $year, true), $hour); + } catch (Zend_Locale_Exception $e) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception($e->getMessage(), 0, $e, $date); + } + break; + + case self::DATE_MEDIUM: + try { + $format = Zend_Locale_Data::getContent($locale, 'date', array('gregorian', 'medium')); + $parsed = Zend_Locale_Format::getDate($date, array('date_format' => $format, 'format_type' => 'iso', 'locale' => $locale)); + + if (($calc == 'set') || ($calc == 'cmp')) { + --$parsed['month']; + --$month; + --$parsed['day']; + --$day; + $parsed['year'] -= 1970; + $year -= 1970; + } + return $this->_assign($calc, $this->mktime(0, 0, 0, 1 + $parsed['month'], 1 + $parsed['day'], 1970 + $parsed['year'], true), + $this->mktime(0, 0, 0, 1 + $month, 1 + $day, 1970 + $year, true), $hour); + } catch (Zend_Locale_Exception $e) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception($e->getMessage(), 0, $e, $date); + } + break; + + case self::DATE_SHORT: + try { + $format = Zend_Locale_Data::getContent($locale, 'date', array('gregorian', 'short')); + $parsed = Zend_Locale_Format::getDate($date, array('date_format' => $format, 'format_type' => 'iso', 'locale' => $locale)); + + $parsed['year'] = self::getFullYear($parsed['year']); + + if (($calc == 'set') || ($calc == 'cmp')) { + --$parsed['month']; + --$month; + --$parsed['day']; + --$day; + $parsed['year'] -= 1970; + $year -= 1970; + } + return $this->_assign($calc, $this->mktime(0, 0, 0, 1 + $parsed['month'], 1 + $parsed['day'], 1970 + $parsed['year'], true), + $this->mktime(0, 0, 0, 1 + $month, 1 + $day, 1970 + $year, true), $hour); + } catch (Zend_Locale_Exception $e) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception($e->getMessage(), 0, $e, $date); + } + break; + + case self::TIMES: + try { + if ($calc != 'set') { + $month = 1; + $day = 1; + $year = 1970; + } + $parsed = Zend_Locale_Format::getTime($date, array('locale' => $locale, 'format_type' => 'iso', 'fix_date' => true)); + return $this->_assign($calc, $this->mktime($parsed['hour'], $parsed['minute'], $parsed['second'], $month, $day, $year, true), + $this->mktime($hour, $minute, $second, $month, $day, $year, true), false); + } catch (Zend_Locale_Exception $e) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception($e->getMessage(), 0, $e, $date); + } + break; + + case self::TIME_FULL: + try { + $format = Zend_Locale_Data::getContent($locale, 'time', array('gregorian', 'full')); + $parsed = Zend_Locale_Format::getTime($date, array('date_format' => $format, 'format_type' => 'iso', 'locale' => $locale)); + if ($calc != 'set') { + $month = 1; + $day = 1; + $year = 1970; + } + + if (!isset($parsed['second'])) { + $parsed['second'] = 0; + } + + return $this->_assign($calc, $this->mktime($parsed['hour'], $parsed['minute'], $parsed['second'], $month, $day, $year, true), + $this->mktime($hour, $minute, $second, $month, $day, $year, true), false); + } catch (Zend_Locale_Exception $e) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception($e->getMessage(), 0, $e, $date); + } + break; + + case self::TIME_LONG: + try { + $format = Zend_Locale_Data::getContent($locale, 'time', array('gregorian', 'long')); + $parsed = Zend_Locale_Format::getTime($date, array('date_format' => $format, 'format_type' => 'iso', 'locale' => $locale)); + if ($calc != 'set') { + $month = 1; + $day = 1; + $year = 1970; + } + return $this->_assign($calc, $this->mktime($parsed['hour'], $parsed['minute'], $parsed['second'], $month, $day, $year, true), + $this->mktime($hour, $minute, $second, $month, $day, $year, true), false); + } catch (Zend_Locale_Exception $e) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception($e->getMessage(), 0, $e, $date); + } + break; + + case self::TIME_MEDIUM: + try { + $format = Zend_Locale_Data::getContent($locale, 'time', array('gregorian', 'medium')); + $parsed = Zend_Locale_Format::getTime($date, array('date_format' => $format, 'format_type' => 'iso', 'locale' => $locale)); + if ($calc != 'set') { + $month = 1; + $day = 1; + $year = 1970; + } + return $this->_assign($calc, $this->mktime($parsed['hour'], $parsed['minute'], $parsed['second'], $month, $day, $year, true), + $this->mktime($hour, $minute, $second, $month, $day, $year, true), false); + } catch (Zend_Locale_Exception $e) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception($e->getMessage(), 0, $e, $date); + } + break; + + case self::TIME_SHORT: + try { + $format = Zend_Locale_Data::getContent($locale, 'time', array('gregorian', 'short')); + $parsed = Zend_Locale_Format::getTime($date, array('date_format' => $format, 'format_type' => 'iso', 'locale' => $locale)); + if ($calc != 'set') { + $month = 1; + $day = 1; + $year = 1970; + } + + if (!isset($parsed['second'])) { + $parsed['second'] = 0; + } + + return $this->_assign($calc, $this->mktime($parsed['hour'], $parsed['minute'], $parsed['second'], $month, $day, $year, true), + $this->mktime($hour, $minute, $second, $month, $day, $year, true), false); + } catch (Zend_Locale_Exception $e) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception($e->getMessage(), 0, $e, $date); + } + break; + + case self::DATETIME: + try { + $parsed = Zend_Locale_Format::getDateTime($date, array('locale' => $locale, 'format_type' => 'iso', 'fix_date' => true)); + if (($calc == 'set') || ($calc == 'cmp')) { + --$parsed['month']; + --$month; + --$parsed['day']; + --$day; + $parsed['year'] -= 1970; + $year -= 1970; + } + return $this->_assign($calc, $this->mktime($parsed['hour'], $parsed['minute'], $parsed['second'], 1 + $parsed['month'], 1 + $parsed['day'], 1970 + $parsed['year'], true), + $this->mktime($hour, $minute, $second, 1 + $month, 1 + $day, 1970 + $year, true), $hour); + } catch (Zend_Locale_Exception $e) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception($e->getMessage(), 0, $e, $date); + } + break; + + case self::DATETIME_FULL: + try { + $format = Zend_Locale_Data::getContent($locale, 'datetime', array('gregorian', 'full')); + $parsed = Zend_Locale_Format::getDateTime($date, array('date_format' => $format, 'format_type' => 'iso', 'locale' => $locale)); + + if (($calc == 'set') || ($calc == 'cmp')) { + --$parsed['month']; + --$month; + --$parsed['day']; + --$day; + $parsed['year'] -= 1970; + $year -= 1970; + } + + if (!isset($parsed['second'])) { + $parsed['second'] = 0; + } + + return $this->_assign($calc, $this->mktime($parsed['hour'], $parsed['minute'], $parsed['second'], 1 + $parsed['month'], 1 + $parsed['day'], 1970 + $parsed['year'], true), + $this->mktime($hour, $minute, $second, 1 + $month, 1 + $day, 1970 + $year, true), $hour); + } catch (Zend_Locale_Exception $e) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception($e->getMessage(), 0, $e, $date); + } + break; + + case self::DATETIME_LONG: + try { + $format = Zend_Locale_Data::getContent($locale, 'datetime', array('gregorian', 'long')); + $parsed = Zend_Locale_Format::getDateTime($date, array('date_format' => $format, 'format_type' => 'iso', 'locale' => $locale)); + + if (($calc == 'set') || ($calc == 'cmp')){ + --$parsed['month']; + --$month; + --$parsed['day']; + --$day; + $parsed['year'] -= 1970; + $year -= 1970; + } + return $this->_assign($calc, $this->mktime($parsed['hour'], $parsed['minute'], $parsed['second'], 1 + $parsed['month'], 1 + $parsed['day'], 1970 + $parsed['year'], true), + $this->mktime($hour, $minute, $second, 1 + $month, 1 + $day, 1970 + $year, true), $hour); + } catch (Zend_Locale_Exception $e) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception($e->getMessage(), 0, $e, $date); + } + break; + + case self::DATETIME_MEDIUM: + try { + $format = Zend_Locale_Data::getContent($locale, 'datetime', array('gregorian', 'medium')); + $parsed = Zend_Locale_Format::getDateTime($date, array('date_format' => $format, 'format_type' => 'iso', 'locale' => $locale)); + if (($calc == 'set') || ($calc == 'cmp')) { + --$parsed['month']; + --$month; + --$parsed['day']; + --$day; + $parsed['year'] -= 1970; + $year -= 1970; + } + return $this->_assign($calc, $this->mktime($parsed['hour'], $parsed['minute'], $parsed['second'], 1 + $parsed['month'], 1 + $parsed['day'], 1970 + $parsed['year'], true), + $this->mktime($hour, $minute, $second, 1 + $month, 1 + $day, 1970 + $year, true), $hour); + } catch (Zend_Locale_Exception $e) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception($e->getMessage(), 0, $e, $date); + } + break; + + case self::DATETIME_SHORT: + try { + $format = Zend_Locale_Data::getContent($locale, 'datetime', array('gregorian', 'short')); + $parsed = Zend_Locale_Format::getDateTime($date, array('date_format' => $format, 'format_type' => 'iso', 'locale' => $locale)); + + $parsed['year'] = self::getFullYear($parsed['year']); + + if (($calc == 'set') || ($calc == 'cmp')) { + --$parsed['month']; + --$month; + --$parsed['day']; + --$day; + $parsed['year'] -= 1970; + $year -= 1970; + } + + if (!isset($parsed['second'])) { + $parsed['second'] = 0; + } + + return $this->_assign($calc, $this->mktime($parsed['hour'], $parsed['minute'], $parsed['second'], 1 + $parsed['month'], 1 + $parsed['day'], 1970 + $parsed['year'], true), + $this->mktime($hour, $minute, $second, 1 + $month, 1 + $day, 1970 + $year, true), $hour); + } catch (Zend_Locale_Exception $e) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception($e->getMessage(), 0, $e, $date); + } + break; + + // ATOM and RFC_3339 are identical + case self::ATOM: + case self::RFC_3339: + $result = preg_match('/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})\d{0,4}([+-]{1}\d{2}:\d{2}|Z)$/', $date, $match); + if (!$result) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("invalid date ($date) operand, ATOM format expected", 0, null, $date); + } + + if (($calc == 'set') || ($calc == 'cmp')) { + --$match[2]; + --$month; + --$match[3]; + --$day; + $match[1] -= 1970; + $year -= 1970; + } + return $this->_assign($calc, $this->mktime($match[4], $match[5], $match[6], 1 + $match[2], 1 + $match[3], 1970 + $match[1], true), + $this->mktime($hour, $minute, $second, 1 + $month, 1 + $day, 1970 + $year, true), false); + break; + + case self::COOKIE: + $result = preg_match("/^\w{6,9},\s(\d{2})-(\w{3})-(\d{2})\s(\d{2}):(\d{2}):(\d{2})\s.{3,20}$/", $date, $match); + if (!$result) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("invalid date ($date) operand, COOKIE format expected", 0, null, $date); + } + $matchStartPos = iconv_strpos($match[0], ' ', 0, 'UTF-8') + 1; + $match[0] = iconv_substr($match[0], + $matchStartPos, + iconv_strlen($match[0], 'UTF-8') - $matchStartPos, + 'UTF-8'); + + $months = $this->_getDigitFromName($match[2]); + $match[3] = self::getFullYear($match[3]); + + if (($calc == 'set') || ($calc == 'cmp')) { + --$months; + --$month; + --$match[1]; + --$day; + $match[3] -= 1970; + $year -= 1970; + } + return $this->_assign($calc, $this->mktime($match[4], $match[5], $match[6], 1 + $months, 1 + $match[1], 1970 + $match[3], true), + $this->mktime($hour, $minute, $second, 1 + $month, 1 + $day, 1970 + $year, true), false); + break; + + case self::RFC_822: + case self::RFC_1036: + // new RFC 822 format, identical to RFC 1036 standard + $result = preg_match('/^\w{0,3},{0,1}\s{0,1}(\d{1,2})\s(\w{3})\s(\d{2})\s(\d{2}):(\d{2}):{0,1}(\d{0,2})\s([+-]{1}\d{4}|\w{1,20})$/', $date, $match); + if (!$result) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("invalid date ($date) operand, RFC 822 date format expected", 0, null, $date); + } + + $months = $this->_getDigitFromName($match[2]); + $match[3] = self::getFullYear($match[3]); + + if (($calc == 'set') || ($calc == 'cmp')) { + --$months; + --$month; + --$match[1]; + --$day; + $match[3] -= 1970; + $year -= 1970; + } + return $this->_assign($calc, $this->mktime($match[4], $match[5], $match[6], 1 + $months, 1 + $match[1], 1970 + $match[3], false), + $this->mktime($hour, $minute, $second, 1 + $month, 1 + $day, 1970 + $year, false), false); + break; + + case self::RFC_850: + $result = preg_match('/^\w{6,9},\s(\d{2})-(\w{3})-(\d{2})\s(\d{2}):(\d{2}):(\d{2})\s.{3,21}$/', $date, $match); + if (!$result) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("invalid date ($date) operand, RFC 850 date format expected", 0, null, $date); + } + + $months = $this->_getDigitFromName($match[2]); + $match[3] = self::getFullYear($match[3]); + + if (($calc == 'set') || ($calc == 'cmp')) { + --$months; + --$month; + --$match[1]; + --$day; + $match[3] -= 1970; + $year -= 1970; + } + return $this->_assign($calc, $this->mktime($match[4], $match[5], $match[6], 1 + $months, 1 + $match[1], 1970 + $match[3], true), + $this->mktime($hour, $minute, $second, 1 + $month, 1 + $day, 1970 + $year, true), false); + break; + + case self::RFC_1123: + $result = preg_match('/^\w{0,3},{0,1}\s{0,1}(\d{1,2})\s(\w{3})\s(\d{2,4})\s(\d{2}):(\d{2}):{0,1}(\d{0,2})\s([+-]{1}\d{4}|\w{1,20})$/', $date, $match); + if (!$result) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("invalid date ($date) operand, RFC 1123 date format expected", 0, null, $date); + } + + $months = $this->_getDigitFromName($match[2]); + + if (($calc == 'set') || ($calc == 'cmp')) { + --$months; + --$month; + --$match[1]; + --$day; + $match[3] -= 1970; + $year -= 1970; + } + return $this->_assign($calc, $this->mktime($match[4], $match[5], $match[6], 1 + $months, 1 + $match[1], 1970 + $match[3], true), + $this->mktime($hour, $minute, $second, 1 + $month, 1 + $day, 1970 + $year, true), false); + break; + + case self::RSS: + $result = preg_match('/^\w{3},\s(\d{2})\s(\w{3})\s(\d{2,4})\s(\d{1,2}):(\d{2}):(\d{2})\s.{1,21}$/', $date, $match); + if (!$result) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("invalid date ($date) operand, RSS date format expected", 0, null, $date); + } + + $months = $this->_getDigitFromName($match[2]); + $match[3] = self::getFullYear($match[3]); + + if (($calc == 'set') || ($calc == 'cmp')) { + --$months; + --$month; + --$match[1]; + --$day; + $match[3] -= 1970; + $year -= 1970; + } + return $this->_assign($calc, $this->mktime($match[4], $match[5], $match[6], 1 + $months, 1 + $match[1], 1970 + $match[3], true), + $this->mktime($hour, $minute, $second, 1 + $month, 1 + $day, 1970 + $year, true), false); + break; + + case self::W3C: + $result = preg_match('/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})[+-]{1}\d{2}:\d{2}$/', $date, $match); + if (!$result) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("invalid date ($date) operand, W3C date format expected", 0, null, $date); + } + + if (($calc == 'set') || ($calc == 'cmp')) { + --$match[2]; + --$month; + --$match[3]; + --$day; + $match[1] -= 1970; + $year -= 1970; + } + return $this->_assign($calc, $this->mktime($match[4], $match[5], $match[6], 1 + $match[2], 1 + $match[3], 1970 + $match[1], true), + $this->mktime($hour, $minute, $second, 1 + $month, 1 + $day, 1970 + $year, true), false); + break; + + default: + if (!is_numeric($date) || !empty($part)) { + try { + if (empty($part)) { + $part = Zend_Locale_Format::getDateFormat($locale) . " "; + $part .= Zend_Locale_Format::getTimeFormat($locale); + } + + $parsed = Zend_Locale_Format::getDate($date, array('date_format' => $part, 'locale' => $locale, 'fix_date' => true, 'format_type' => 'iso')); + if ((strpos(strtoupper($part), 'YY') !== false) and (strpos(strtoupper($part), 'YYYY') === false)) { + $parsed['year'] = self::getFullYear($parsed['year']); + } + + if (($calc == 'set') || ($calc == 'cmp')) { + if (isset($parsed['month'])) { + --$parsed['month']; + } else { + $parsed['month'] = 0; + } + + if (isset($parsed['day'])) { + --$parsed['day']; + } else { + $parsed['day'] = 0; + } + + if (isset($parsed['year'])) { + $parsed['year'] -= 1970; + } else { + $parsed['year'] = 0; + } + } + + return $this->_assign($calc, $this->mktime( + isset($parsed['hour']) ? $parsed['hour'] : 0, + isset($parsed['minute']) ? $parsed['minute'] : 0, + isset($parsed['second']) ? $parsed['second'] : 0, + isset($parsed['month']) ? (1 + $parsed['month']) : 1, + isset($parsed['day']) ? (1 + $parsed['day']) : 1, + isset($parsed['year']) ? (1970 + $parsed['year']) : 1970, + false), $this->getUnixTimestamp(), false); + } catch (Zend_Locale_Exception $e) { + if (!is_numeric($date)) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception($e->getMessage(), 0, $e, $date); + } + } + } + + return $this->_assign($calc, $date, $this->getUnixTimestamp(), false); + break; + } + } + + /** + * Returns true when both date objects or date parts are equal. + * For example: + * 15.May.2000 <-> 15.June.2000 Equals only for Day or Year... all other will return false + * + * @param string|integer|array|Zend_Date $date Date or datepart to equal with + * @param string $part OPTIONAL Part of the date to compare, if null the timestamp is used + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return boolean + * @throws Zend_Date_Exception + */ + public function equals($date, $part = self::TIMESTAMP, $locale = null) + { + $result = $this->compare($date, $part, $locale); + + if ($result == 0) { + return true; + } + + return false; + } + + /** + * Returns if the given date or datepart is earlier + * For example: + * 15.May.2000 <-> 13.June.1999 will return true for day, year and date, but not for month + * + * @param string|integer|array|Zend_Date $date Date or datepart to compare with + * @param string $part OPTIONAL Part of the date to compare, if null the timestamp is used + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return boolean + * @throws Zend_Date_Exception + */ + public function isEarlier($date, $part = null, $locale = null) + { + $result = $this->compare($date, $part, $locale); + + if ($result == -1) { + return true; + } + + return false; + } + + /** + * Returns if the given date or datepart is later + * For example: + * 15.May.2000 <-> 13.June.1999 will return true for month but false for day, year and date + * Returns if the given date is later + * + * @param string|integer|array|Zend_Date $date Date or datepart to compare with + * @param string $part OPTIONAL Part of the date to compare, if null the timestamp is used + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return boolean + * @throws Zend_Date_Exception + */ + public function isLater($date, $part = null, $locale = null) + { + $result = $this->compare($date, $part, $locale); + + if ($result == 1) { + return true; + } + + return false; + } + + /** + * Returns only the time of the date as new Zend_Date object + * For example: + * 15.May.2000 10:11:23 will return a dateobject equal to 01.Jan.1970 10:11:23 + * + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date + */ + public function getTime($locale = null) + { + if (self::$_options['format_type'] == 'php') { + $format = 'H:i:s'; + } else { + $format = self::TIME_MEDIUM; + } + + return $this->copyPart($format, $locale); + } + + /** + * Returns the calculated time + * + * @param string $calc Calculation to make + * @param string|integer|array|Zend_Date $time Time to calculate with, if null the actual time is taken + * @param string $format Timeformat for parsing input + * @param string|Zend_Locale $locale Locale for parsing input + * @return integer|Zend_Date new time + * @throws Zend_Date_Exception + */ + private function _time($calc, $time, $format, $locale) + { + if ($time === null) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception('parameter $time must be set, null is not allowed'); + } + + if ($time instanceof Zend_Date) { + // extract time from object + $time = $time->toString('HH:mm:ss', 'iso'); + } else { + if (is_array($time)) { + if ((isset($time['hour']) === true) or (isset($time['minute']) === true) or + (isset($time['second']) === true)) { + $parsed = $time; + } else { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("no hour, minute or second given in array"); + } + } else { + if (self::$_options['format_type'] == 'php') { + $format = Zend_Locale_Format::convertPhpToIsoFormat($format); + } + try { + if ($locale === null) { + $locale = $this->getLocale(); + } + + $parsed = Zend_Locale_Format::getTime($time, array('date_format' => $format, 'locale' => $locale, 'format_type' => 'iso')); + } catch (Zend_Locale_Exception $e) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception($e->getMessage(), 0, $e); + } + } + + if (!array_key_exists('hour', $parsed)) { + $parsed['hour'] = 0; + } + + if (!array_key_exists('minute', $parsed)) { + $parsed['minute'] = 0; + } + + if (!array_key_exists('second', $parsed)) { + $parsed['second'] = 0; + } + + $time = str_pad($parsed['hour'], 2, '0', STR_PAD_LEFT) . ":"; + $time .= str_pad($parsed['minute'], 2, '0', STR_PAD_LEFT) . ":"; + $time .= str_pad($parsed['second'], 2, '0', STR_PAD_LEFT); + } + + $return = $this->_calcdetail($calc, $time, self::TIMES, 'de'); + if ($calc != 'cmp') { + return $this; + } + + return $return; + } + + + /** + * Sets a new time for the date object. Format defines how to parse the time string. + * Also a complete date can be given, but only the time is used for setting. + * For example: dd.MMMM.yyTHH:mm' and 'ss sec'-> 10.May.07T25:11 and 44 sec => 1h11min44sec + 1 day + * Returned is the new date object and the existing date is left as it was before + * + * @param string|integer|array|Zend_Date $time Time to set + * @param string $format OPTIONAL Timeformat for parsing input + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date Provides fluid interface + * @throws Zend_Date_Exception + */ + public function setTime($time, $format = null, $locale = null) + { + return $this->_time('set', $time, $format, $locale); + } + + + /** + * Adds a time to the existing date. Format defines how to parse the time string. + * If only parts are given the other parts are set to 0. + * If no format is given, the standardformat of this locale is used. + * For example: HH:mm:ss -> 10 -> +10 hours + * + * @param string|integer|array|Zend_Date $time Time to add + * @param string $format OPTIONAL Timeformat for parsing input + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date Provides fluid interface + * @throws Zend_Date_Exception + */ + public function addTime($time, $format = null, $locale = null) + { + return $this->_time('add', $time, $format, $locale); + } + + + /** + * Subtracts a time from the existing date. Format defines how to parse the time string. + * If only parts are given the other parts are set to 0. + * If no format is given, the standardformat of this locale is used. + * For example: HH:mm:ss -> 10 -> -10 hours + * + * @param string|integer|array|Zend_Date $time Time to sub + * @param string $format OPTIONAL Timeformat for parsing input + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date Provides fluid inteface + * @throws Zend_Date_Exception + */ + public function subTime($time, $format = null, $locale = null) + { + return $this->_time('sub', $time, $format, $locale); + } + + + /** + * Compares the time from the existing date. Format defines how to parse the time string. + * If only parts are given the other parts are set to default. + * If no format us given, the standardformat of this locale is used. + * For example: HH:mm:ss -> 10 -> 10 hours + * + * @param string|integer|array|Zend_Date $time Time to compare + * @param string $format OPTIONAL Timeformat for parsing input + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return integer 0 = equal, 1 = later, -1 = earlier + * @throws Zend_Date_Exception + */ + public function compareTime($time, $format = null, $locale = null) + { + return $this->_time('cmp', $time, $format, $locale); + } + + /** + * Returns a clone of $this, with the time part set to 00:00:00. + * + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date + */ + public function getDate($locale = null) + { + $orig = self::$_options['format_type']; + if (self::$_options['format_type'] == 'php') { + self::$_options['format_type'] = 'iso'; + } + + $date = $this->copyPart(self::DATE_MEDIUM, $locale); + $date->addTimestamp($this->getGmtOffset()); + self::$_options['format_type'] = $orig; + + return $date; + } + + /** + * Returns the calculated date + * + * @param string $calc Calculation to make + * @param string|integer|array|Zend_Date $date Date to calculate with, if null the actual date is taken + * @param string $format Date format for parsing + * @param string|Zend_Locale $locale Locale for parsing input + * @return integer|Zend_Date new date + * @throws Zend_Date_Exception + */ + private function _date($calc, $date, $format, $locale) + { + if ($date === null) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception('parameter $date must be set, null is not allowed'); + } + + if ($date instanceof Zend_Date) { + // extract date from object + $date = $date->toString('d.M.y', 'iso'); + } else { + if (is_array($date)) { + if ((isset($date['year']) === true) or (isset($date['month']) === true) or + (isset($date['day']) === true)) { + $parsed = $date; + } else { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("no day,month or year given in array"); + } + } else { + if ((self::$_options['format_type'] == 'php') && !defined($format)) { + $format = Zend_Locale_Format::convertPhpToIsoFormat($format); + } + try { + if ($locale === null) { + $locale = $this->getLocale(); + } + + $parsed = Zend_Locale_Format::getDate($date, array('date_format' => $format, 'locale' => $locale, 'format_type' => 'iso')); + if ((strpos(strtoupper($format), 'YY') !== false) and (strpos(strtoupper($format), 'YYYY') === false)) { + $parsed['year'] = self::getFullYear($parsed['year']); + } + } catch (Zend_Locale_Exception $e) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception($e->getMessage(), 0, $e); + } + } + + if (!array_key_exists('day', $parsed)) { + $parsed['day'] = 1; + } + + if (!array_key_exists('month', $parsed)) { + $parsed['month'] = 1; + } + + if (!array_key_exists('year', $parsed)) { + $parsed['year'] = 0; + } + + $date = $parsed['day'] . "." . $parsed['month'] . "." . $parsed['year']; + } + + $return = $this->_calcdetail($calc, $date, self::DATE_MEDIUM, 'de'); + if ($calc != 'cmp') { + return $this; + } + return $return; + } + + + /** + * Sets a new date for the date object. Format defines how to parse the date string. + * Also a complete date with time can be given, but only the date is used for setting. + * For example: MMMM.yy HH:mm-> May.07 22:11 => 01.May.07 00:00 + * Returned is the new date object and the existing time is left as it was before + * + * @param string|integer|array|Zend_Date $date Date to set + * @param string $format OPTIONAL Date format for parsing + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date Provides fluid interface + * @throws Zend_Date_Exception + */ + public function setDate($date, $format = null, $locale = null) + { + return $this->_date('set', $date, $format, $locale); + } + + + /** + * Adds a date to the existing date object. Format defines how to parse the date string. + * If only parts are given the other parts are set to 0. + * If no format is given, the standardformat of this locale is used. + * For example: MM.dd.YYYY -> 10 -> +10 months + * + * @param string|integer|array|Zend_Date $date Date to add + * @param string $format OPTIONAL Date format for parsing input + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date Provides fluid interface + * @throws Zend_Date_Exception + */ + public function addDate($date, $format = null, $locale = null) + { + return $this->_date('add', $date, $format, $locale); + } + + + /** + * Subtracts a date from the existing date object. Format defines how to parse the date string. + * If only parts are given the other parts are set to 0. + * If no format is given, the standardformat of this locale is used. + * For example: MM.dd.YYYY -> 10 -> -10 months + * Be aware: Subtracting 2 months is not equal to Adding -2 months !!! + * + * @param string|integer|array|Zend_Date $date Date to sub + * @param string $format OPTIONAL Date format for parsing input + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date Provides fluid interface + * @throws Zend_Date_Exception + */ + public function subDate($date, $format = null, $locale = null) + { + return $this->_date('sub', $date, $format, $locale); + } + + + /** + * Compares the date from the existing date object, ignoring the time. + * Format defines how to parse the date string. + * If only parts are given the other parts are set to 0. + * If no format is given, the standardformat of this locale is used. + * For example: 10.01.2000 => 10.02.1999 -> false + * + * @param string|integer|array|Zend_Date $date Date to compare + * @param string $format OPTIONAL Date format for parsing input + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return integer 0 = equal, 1 = later, -1 = earlier + * @throws Zend_Date_Exception + */ + public function compareDate($date, $format = null, $locale = null) + { + return $this->_date('cmp', $date, $format, $locale); + } + + + /** + * Returns the full ISO 8601 date from the date object. + * Always the complete ISO 8601 specifiction is used. If an other ISO date is needed + * (ISO 8601 defines several formats) use toString() instead. + * This function does not return the ISO date as object. Use copy() instead. + * + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return string + */ + public function getIso($locale = null) + { + return $this->toString(self::ISO_8601, 'iso', $locale); + } + + + /** + * Sets a new date for the date object. Not given parts are set to default. + * Only supported ISO 8601 formats are accepted. + * For example: 050901 -> 01.Sept.2005 00:00:00, 20050201T10:00:30 -> 01.Feb.2005 10h00m30s + * Returned is the new date object + * + * @param string|integer|Zend_Date $date ISO Date to set + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date Provides fluid interface + * @throws Zend_Date_Exception + */ + public function setIso($date, $locale = null) + { + return $this->_calcvalue('set', $date, 'iso', self::ISO_8601, $locale); + } + + + /** + * Adds a ISO date to the date object. Not given parts are set to default. + * Only supported ISO 8601 formats are accepted. + * For example: 050901 -> + 01.Sept.2005 00:00:00, 10:00:00 -> +10h + * Returned is the new date object + * + * @param string|integer|Zend_Date $date ISO Date to add + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date Provides fluid interface + * @throws Zend_Date_Exception + */ + public function addIso($date, $locale = null) + { + return $this->_calcvalue('add', $date, 'iso', self::ISO_8601, $locale); + } + + + /** + * Subtracts a ISO date from the date object. Not given parts are set to default. + * Only supported ISO 8601 formats are accepted. + * For example: 050901 -> - 01.Sept.2005 00:00:00, 10:00:00 -> -10h + * Returned is the new date object + * + * @param string|integer|Zend_Date $date ISO Date to sub + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date Provides fluid interface + * @throws Zend_Date_Exception + */ + public function subIso($date, $locale = null) + { + return $this->_calcvalue('sub', $date, 'iso', self::ISO_8601, $locale); + } + + + /** + * Compares a ISO date with the date object. Not given parts are set to default. + * Only supported ISO 8601 formats are accepted. + * For example: 050901 -> - 01.Sept.2005 00:00:00, 10:00:00 -> -10h + * Returns if equal, earlier or later + * + * @param string|integer|Zend_Date $date ISO Date to sub + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return integer 0 = equal, 1 = later, -1 = earlier + * @throws Zend_Date_Exception + */ + public function compareIso($date, $locale = null) + { + return $this->_calcvalue('cmp', $date, 'iso', self::ISO_8601, $locale); + } + + + /** + * Returns a RFC 822 compilant datestring from the date object. + * This function does not return the RFC date as object. Use copy() instead. + * + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return string + */ + public function getArpa($locale = null) + { + if (self::$_options['format_type'] == 'php') { + $format = 'D\, d M y H\:i\:s O'; + } else { + $format = self::RFC_822; + } + + return $this->toString($format, 'iso', $locale); + } + + + /** + * Sets a RFC 822 date as new date for the date object. + * Only RFC 822 compilant date strings are accepted. + * For example: Sat, 14 Feb 09 00:31:30 +0100 + * Returned is the new date object + * + * @param string|integer|Zend_Date $date RFC 822 to set + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date Provides fluid interface + * @throws Zend_Date_Exception + */ + public function setArpa($date, $locale = null) + { + return $this->_calcvalue('set', $date, 'arpa', self::RFC_822, $locale); + } + + + /** + * Adds a RFC 822 date to the date object. + * ARPA messages are used in emails or HTTP Headers. + * Only RFC 822 compilant date strings are accepted. + * For example: Sat, 14 Feb 09 00:31:30 +0100 + * Returned is the new date object + * + * @param string|integer|Zend_Date $date RFC 822 Date to add + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date Provides fluid interface + * @throws Zend_Date_Exception + */ + public function addArpa($date, $locale = null) + { + return $this->_calcvalue('add', $date, 'arpa', self::RFC_822, $locale); + } + + + /** + * Subtracts a RFC 822 date from the date object. + * ARPA messages are used in emails or HTTP Headers. + * Only RFC 822 compilant date strings are accepted. + * For example: Sat, 14 Feb 09 00:31:30 +0100 + * Returned is the new date object + * + * @param string|integer|Zend_Date $date RFC 822 Date to sub + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date Provides fluid interface + * @throws Zend_Date_Exception + */ + public function subArpa($date, $locale = null) + { + return $this->_calcvalue('sub', $date, 'arpa', self::RFC_822, $locale); + } + + + /** + * Compares a RFC 822 compilant date with the date object. + * ARPA messages are used in emails or HTTP Headers. + * Only RFC 822 compilant date strings are accepted. + * For example: Sat, 14 Feb 09 00:31:30 +0100 + * Returns if equal, earlier or later + * + * @param string|integer|Zend_Date $date RFC 822 Date to sub + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return integer 0 = equal, 1 = later, -1 = earlier + * @throws Zend_Date_Exception + */ + public function compareArpa($date, $locale = null) + { + return $this->_calcvalue('cmp', $date, 'arpa', self::RFC_822, $locale); + } + + + /** + * Check if location is supported + * + * @param $location array - locations array + * @return $horizon float + */ + private function _checkLocation($location) + { + if (!isset($location['longitude']) or !isset($location['latitude'])) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception('Location must include \'longitude\' and \'latitude\'', 0, null, $location); + } + if (($location['longitude'] > 180) or ($location['longitude'] < -180)) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception('Longitude must be between -180 and 180', 0, null, $location); + } + if (($location['latitude'] > 90) or ($location['latitude'] < -90)) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception('Latitude must be between -90 and 90', 0, null, $location); + } + + if (!isset($location['horizon'])){ + $location['horizon'] = 'effective'; + } + + switch ($location['horizon']) { + case 'civil' : + return -0.104528; + break; + case 'nautic' : + return -0.207912; + break; + case 'astronomic' : + return -0.309017; + break; + default : + return -0.0145439; + break; + } + } + + + /** + * Returns the time of sunrise for this date and a given location as new date object + * For a list of cities and correct locations use the class Zend_Date_Cities + * + * @param $location array - location of sunrise + * ['horizon'] -> civil, nautic, astronomical, effective (default) + * ['longitude'] -> longitude of location + * ['latitude'] -> latitude of location + * @return Zend_Date + * @throws Zend_Date_Exception + */ + public function getSunrise($location) + { + $horizon = $this->_checkLocation($location); + $result = clone $this; + $result->set($this->calcSun($location, $horizon, true), self::TIMESTAMP); + return $result; + } + + + /** + * Returns the time of sunset for this date and a given location as new date object + * For a list of cities and correct locations use the class Zend_Date_Cities + * + * @param $location array - location of sunset + * ['horizon'] -> civil, nautic, astronomical, effective (default) + * ['longitude'] -> longitude of location + * ['latitude'] -> latitude of location + * @return Zend_Date + * @throws Zend_Date_Exception + */ + public function getSunset($location) + { + $horizon = $this->_checkLocation($location); + $result = clone $this; + $result->set($this->calcSun($location, $horizon, false), self::TIMESTAMP); + return $result; + } + + + /** + * Returns an array with the sunset and sunrise dates for all horizon types + * For a list of cities and correct locations use the class Zend_Date_Cities + * + * @param $location array - location of suninfo + * ['horizon'] -> civil, nautic, astronomical, effective (default) + * ['longitude'] -> longitude of location + * ['latitude'] -> latitude of location + * @return array - [sunset|sunrise][effective|civil|nautic|astronomic] + * @throws Zend_Date_Exception + */ + public function getSunInfo($location) + { + $suninfo = array(); + for ($i = 0; $i < 4; ++$i) { + switch ($i) { + case 0 : + $location['horizon'] = 'effective'; + break; + case 1 : + $location['horizon'] = 'civil'; + break; + case 2 : + $location['horizon'] = 'nautic'; + break; + case 3 : + $location['horizon'] = 'astronomic'; + break; + } + $horizon = $this->_checkLocation($location); + $result = clone $this; + $result->set($this->calcSun($location, $horizon, true), self::TIMESTAMP); + $suninfo['sunrise'][$location['horizon']] = $result; + $result = clone $this; + $result->set($this->calcSun($location, $horizon, false), self::TIMESTAMP); + $suninfo['sunset'][$location['horizon']] = $result; + } + return $suninfo; + } + + + /** + * Check a given year for leap year. + * + * @param integer|array|Zend_Date $year Year to check + * @return boolean + */ + public static function checkLeapYear($year) + { + if ($year instanceof Zend_Date) { + $year = (int) $year->toString(self::YEAR, 'iso'); + } + + if (is_array($year)) { + if (isset($year['year']) === true) { + $year = $year['year']; + } else { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("no year given in array"); + } + } + + if (!is_numeric($year)) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("year ($year) has to be integer for checkLeapYear()", 0, null, $year); + } + + return (bool) parent::isYearLeapYear($year); + } + + + /** + * Returns true, if the year is a leap year. + * + * @return boolean + */ + public function isLeapYear() + { + return self::checkLeapYear($this); + } + + + /** + * Returns if the set date is todays date + * + * @return boolean + */ + public function isToday() + { + $today = $this->date('Ymd', $this->_getTime()); + $day = $this->date('Ymd', $this->getUnixTimestamp()); + return ($today == $day); + } + + + /** + * Returns if the set date is yesterdays date + * + * @return boolean + */ + public function isYesterday() + { + list($year, $month, $day) = explode('-', $this->date('Y-m-d', $this->_getTime())); + // adjusts for leap days and DST changes that are timezone specific + $yesterday = $this->date('Ymd', $this->mktime(0, 0, 0, $month, $day -1, $year)); + $day = $this->date('Ymd', $this->getUnixTimestamp()); + return $day == $yesterday; + } + + + /** + * Returns if the set date is tomorrows date + * + * @return boolean + */ + public function isTomorrow() + { + list($year, $month, $day) = explode('-', $this->date('Y-m-d', $this->_getTime())); + // adjusts for leap days and DST changes that are timezone specific + $tomorrow = $this->date('Ymd', $this->mktime(0, 0, 0, $month, $day +1, $year)); + $day = $this->date('Ymd', $this->getUnixTimestamp()); + return $day == $tomorrow; + } + + /** + * Returns the actual date as new date object + * + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date + */ + public static function now($locale = null) + { + return new Zend_Date(time(), self::TIMESTAMP, $locale); + } + + /** + * Calculate date details + * + * @param string $calc Calculation to make + * @param string|integer|array|Zend_Date $date Date or Part to calculate + * @param string $part Datepart for Calculation + * @param string|Zend_Locale $locale Locale for parsing input + * @return integer|string new date + * @throws Zend_Date_Exception + */ + private function _calcdetail($calc, $date, $type, $locale) + { + $old = false; + if (self::$_options['format_type'] == 'php') { + self::$_options['format_type'] = 'iso'; + $old = true; + } + + switch($calc) { + case 'set' : + $return = $this->set($date, $type, $locale); + break; + case 'add' : + $return = $this->add($date, $type, $locale); + break; + case 'sub' : + $return = $this->sub($date, $type, $locale); + break; + default : + $return = $this->compare($date, $type, $locale); + break; + } + + if ($old) { + self::$_options['format_type'] = 'php'; + } + + return $return; + } + + /** + * Internal calculation, returns the requested date type + * + * @param string $calc Calculation to make + * @param string|integer|Zend_Date $value Datevalue to calculate with, if null the actual value is taken + * @param string|Zend_Locale $locale Locale for parsing input + * @return integer|Zend_Date new date + * @throws Zend_Date_Exception + */ + private function _calcvalue($calc, $value, $type, $parameter, $locale) + { + if ($value === null) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("parameter $type must be set, null is not allowed"); + } + + if ($locale === null) { + $locale = $this->getLocale(); + } + + if ($value instanceof Zend_Date) { + // extract value from object + $value = $value->toString($parameter, 'iso', $locale); + } else if (!is_array($value) && !is_numeric($value) && ($type != 'iso') && ($type != 'arpa')) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("invalid $type ($value) operand", 0, null, $value); + } + + $return = $this->_calcdetail($calc, $value, $parameter, $locale); + if ($calc != 'cmp') { + return $this; + } + return $return; + } + + + /** + * Returns only the year from the date object as new object. + * For example: 10.May.2000 10:30:00 -> 01.Jan.2000 00:00:00 + * + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date + */ + public function getYear($locale = null) + { + if (self::$_options['format_type'] == 'php') { + $format = 'Y'; + } else { + $format = self::YEAR; + } + + return $this->copyPart($format, $locale); + } + + + /** + * Sets a new year + * If the year is between 0 and 69, 2000 will be set (2000-2069) + * If the year if between 70 and 99, 1999 will be set (1970-1999) + * 3 or 4 digit years are set as expected. If you need to set year 0-99 + * use set() instead. + * Returned is the new date object + * + * @param string|integer|array|Zend_Date $date Year to set + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date Provides fluid interface + * @throws Zend_Date_Exception + */ + public function setYear($year, $locale = null) + { + return $this->_calcvalue('set', $year, 'year', self::YEAR, $locale); + } + + + /** + * Adds the year to the existing date object + * If the year is between 0 and 69, 2000 will be added (2000-2069) + * If the year if between 70 and 99, 1999 will be added (1970-1999) + * 3 or 4 digit years are added as expected. If you need to add years from 0-99 + * use add() instead. + * Returned is the new date object + * + * @param string|integer|array|Zend_Date $date Year to add + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date Provides fluid interface + * @throws Zend_Date_Exception + */ + public function addYear($year, $locale = null) + { + return $this->_calcvalue('add', $year, 'year', self::YEAR, $locale); + } + + + /** + * Subs the year from the existing date object + * If the year is between 0 and 69, 2000 will be subtracted (2000-2069) + * If the year if between 70 and 99, 1999 will be subtracted (1970-1999) + * 3 or 4 digit years are subtracted as expected. If you need to subtract years from 0-99 + * use sub() instead. + * Returned is the new date object + * + * @param string|integer|array|Zend_Date $date Year to sub + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date Provides fluid interface + * @throws Zend_Date_Exception + */ + public function subYear($year, $locale = null) + { + return $this->_calcvalue('sub', $year, 'year', self::YEAR, $locale); + } + + + /** + * Compares the year with the existing date object, ignoring other date parts. + * For example: 10.03.2000 -> 15.02.2000 -> true + * Returns if equal, earlier or later + * + * @param string|integer|array|Zend_Date $year Year to compare + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return integer 0 = equal, 1 = later, -1 = earlier + * @throws Zend_Date_Exception + */ + public function compareYear($year, $locale = null) + { + return $this->_calcvalue('cmp', $year, 'year', self::YEAR, $locale); + } + + + /** + * Returns only the month from the date object as new object. + * For example: 10.May.2000 10:30:00 -> 01.May.1970 00:00:00 + * + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date + */ + public function getMonth($locale = null) + { + if (self::$_options['format_type'] == 'php') { + $format = 'm'; + } else { + $format = self::MONTH; + } + + return $this->copyPart($format, $locale); + } + + + /** + * Returns the calculated month + * + * @param string $calc Calculation to make + * @param string|integer|array|Zend_Date $month Month to calculate with, if null the actual month is taken + * @param string|Zend_Locale $locale Locale for parsing input + * @return integer|Zend_Date new time + * @throws Zend_Date_Exception + */ + private function _month($calc, $month, $locale) + { + if ($month === null) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception('parameter $month must be set, null is not allowed'); + } + + if ($locale === null) { + $locale = $this->getLocale(); + } + + if ($month instanceof Zend_Date) { + // extract month from object + $found = $month->toString(self::MONTH_SHORT, 'iso', $locale); + } else { + if (is_numeric($month)) { + $found = $month; + } else if (is_array($month)) { + if (isset($month['month']) === true) { + $month = $month['month']; + } else { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("no month given in array"); + } + } else { + $monthlist = Zend_Locale_Data::getList($locale, 'month'); + $monthlist2 = Zend_Locale_Data::getList($locale, 'month', array('gregorian', 'format', 'abbreviated')); + + $monthlist = array_merge($monthlist, $monthlist2); + $found = 0; + $cnt = 0; + foreach ($monthlist as $key => $value) { + if (strtoupper($value) == strtoupper($month)) { + $found = ($key % 12) + 1; + break; + } + ++$cnt; + } + if ($found == 0) { + foreach ($monthlist2 as $key => $value) { + if (strtoupper(iconv_substr($value, 0, 1, 'UTF-8')) == strtoupper($month)) { + $found = $key + 1; + break; + } + ++$cnt; + } + } + if ($found == 0) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("unknown month name ($month)", 0, null, $month); + } + } + } + $return = $this->_calcdetail($calc, $found, self::MONTH_SHORT, $locale); + if ($calc != 'cmp') { + return $this; + } + return $return; + } + + + /** + * Sets a new month + * The month can be a number or a string. Setting months lower then 0 and greater then 12 + * will result in adding or subtracting the relevant year. (12 months equal one year) + * If a localized monthname is given it will be parsed with the default locale or the optional + * set locale. + * Returned is the new date object + * + * @param string|integer|array|Zend_Date $month Month to set + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date Provides fluid interface + * @throws Zend_Date_Exception + */ + public function setMonth($month, $locale = null) + { + return $this->_month('set', $month, $locale); + } + + + /** + * Adds months to the existing date object. + * The month can be a number or a string. Adding months lower then 0 and greater then 12 + * will result in adding or subtracting the relevant year. (12 months equal one year) + * If a localized monthname is given it will be parsed with the default locale or the optional + * set locale. + * Returned is the new date object + * + * @param string|integer|array|Zend_Date $month Month to add + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date Provides fluid interface + * @throws Zend_Date_Exception + */ + public function addMonth($month, $locale = null) + { + return $this->_month('add', $month, $locale); + } + + + /** + * Subtracts months from the existing date object. + * The month can be a number or a string. Subtracting months lower then 0 and greater then 12 + * will result in adding or subtracting the relevant year. (12 months equal one year) + * If a localized monthname is given it will be parsed with the default locale or the optional + * set locale. + * Returned is the new date object + * + * @param string|integer|array|Zend_Date $month Month to sub + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date Provides fluid interface + * @throws Zend_Date_Exception + */ + public function subMonth($month, $locale = null) + { + return $this->_month('sub', $month, $locale); + } + + + /** + * Compares the month with the existing date object, ignoring other date parts. + * For example: 10.03.2000 -> 15.03.1950 -> true + * Returns if equal, earlier or later + * + * @param string|integer|array|Zend_Date $month Month to compare + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return integer 0 = equal, 1 = later, -1 = earlier + * @throws Zend_Date_Exception + */ + public function compareMonth($month, $locale = null) + { + return $this->_month('cmp', $month, $locale); + } + + + /** + * Returns the day as new date object + * Example: 20.May.1986 -> 20.Jan.1970 00:00:00 + * + * @param $locale string|Zend_Locale OPTIONAL Locale for parsing input + * @return Zend_Date + */ + public function getDay($locale = null) + { + return $this->copyPart(self::DAY_SHORT, $locale); + } + + + /** + * Returns the calculated day + * + * @param $calc string Type of calculation to make + * @param $day string|integer|Zend_Date Day to calculate, when null the actual day is calculated + * @param $locale string|Zend_Locale Locale for parsing input + * @return Zend_Date|integer + */ + private function _day($calc, $day, $locale) + { + if ($day === null) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception('parameter $day must be set, null is not allowed'); + } + + if ($locale === null) { + $locale = $this->getLocale(); + } + + if ($day instanceof Zend_Date) { + $day = $day->toString(self::DAY_SHORT, 'iso', $locale); + } + + if (is_numeric($day)) { + $type = self::DAY_SHORT; + } else if (is_array($day)) { + if (isset($day['day']) === true) { + $day = $day['day']; + $type = self::WEEKDAY; + } else { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("no day given in array"); + } + } else { + switch (iconv_strlen($day, 'UTF-8')) { + case 1 : + $type = self::WEEKDAY_NARROW; + break; + case 2: + $type = self::WEEKDAY_NAME; + break; + case 3: + $type = self::WEEKDAY_SHORT; + break; + default: + $type = self::WEEKDAY; + break; + } + } + $return = $this->_calcdetail($calc, $day, $type, $locale); + if ($calc != 'cmp') { + return $this; + } + return $return; + } + + + /** + * Sets a new day + * The day can be a number or a string. Setting days lower then 0 or greater than the number of this months days + * will result in adding or subtracting the relevant month. + * If a localized dayname is given it will be parsed with the default locale or the optional + * set locale. + * Returned is the new date object + * Example: setDay('Montag', 'de_AT'); will set the monday of this week as day. + * + * @param string|integer|array|Zend_Date $month Day to set + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date Provides fluid interface + * @throws Zend_Date_Exception + */ + public function setDay($day, $locale = null) + { + return $this->_day('set', $day, $locale); + } + + + /** + * Adds days to the existing date object. + * The day can be a number or a string. Adding days lower then 0 or greater than the number of this months days + * will result in adding or subtracting the relevant month. + * If a localized dayname is given it will be parsed with the default locale or the optional + * set locale. + * + * @param string|integer|array|Zend_Date $month Day to add + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date Provides fluid interface + * @throws Zend_Date_Exception + */ + public function addDay($day, $locale = null) + { + return $this->_day('add', $day, $locale); + } + + + /** + * Subtracts days from the existing date object. + * The day can be a number or a string. Subtracting days lower then 0 or greater than the number of this months days + * will result in adding or subtracting the relevant month. + * If a localized dayname is given it will be parsed with the default locale or the optional + * set locale. + * + * @param string|integer|array|Zend_Date $month Day to sub + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date Provides fluid interface + * @throws Zend_Date_Exception + */ + public function subDay($day, $locale = null) + { + return $this->_day('sub', $day, $locale); + } + + + /** + * Compares the day with the existing date object, ignoring other date parts. + * For example: 'Monday', 'en' -> 08.Jan.2007 -> 0 + * Returns if equal, earlier or later + * + * @param string|integer|array|Zend_Date $day Day to compare + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return integer 0 = equal, 1 = later, -1 = earlier + * @throws Zend_Date_Exception + */ + public function compareDay($day, $locale = null) + { + return $this->_day('cmp', $day, $locale); + } + + + /** + * Returns the weekday as new date object + * Weekday is always from 1-7 + * Example: 09-Jan-2007 -> 2 = Tuesday -> 02-Jan-1970 (when 02.01.1970 is also Tuesday) + * + * @param $locale string|Zend_Locale OPTIONAL Locale for parsing input + * @return Zend_Date + */ + public function getWeekday($locale = null) + { + if (self::$_options['format_type'] == 'php') { + $format = 'l'; + } else { + $format = self::WEEKDAY; + } + + return $this->copyPart($format, $locale); + } + + + /** + * Returns the calculated weekday + * + * @param $calc string Type of calculation to make + * @param $weekday string|integer|array|Zend_Date Weekday to calculate, when null the actual weekday is calculated + * @param $locale string|Zend_Locale Locale for parsing input + * @return Zend_Date|integer + * @throws Zend_Date_Exception + */ + private function _weekday($calc, $weekday, $locale) + { + if ($weekday === null) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception('parameter $weekday must be set, null is not allowed'); + } + + if ($locale === null) { + $locale = $this->getLocale(); + } + + if ($weekday instanceof Zend_Date) { + $weekday = $weekday->toString(self::WEEKDAY_8601, 'iso', $locale); + } + + if (is_numeric($weekday)) { + $type = self::WEEKDAY_8601; + } else if (is_array($weekday)) { + if (isset($weekday['weekday']) === true) { + $weekday = $weekday['weekday']; + $type = self::WEEKDAY; + } else { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("no weekday given in array"); + } + } else { + switch(iconv_strlen($weekday, 'UTF-8')) { + case 1: + $type = self::WEEKDAY_NARROW; + break; + case 2: + $type = self::WEEKDAY_NAME; + break; + case 3: + $type = self::WEEKDAY_SHORT; + break; + default: + $type = self::WEEKDAY; + break; + } + } + $return = $this->_calcdetail($calc, $weekday, $type, $locale); + if ($calc != 'cmp') { + return $this; + } + return $return; + } + + + /** + * Sets a new weekday + * The weekday can be a number or a string. If a localized weekday name is given, + * then it will be parsed as a date in $locale (defaults to the same locale as $this). + * Returned is the new date object. + * Example: setWeekday(3); will set the wednesday of this week as day. + * + * @param string|integer|array|Zend_Date $month Weekday to set + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date Provides fluid interface + * @throws Zend_Date_Exception + */ + public function setWeekday($weekday, $locale = null) + { + return $this->_weekday('set', $weekday, $locale); + } + + + /** + * Adds weekdays to the existing date object. + * The weekday can be a number or a string. + * If a localized dayname is given it will be parsed with the default locale or the optional + * set locale. + * Returned is the new date object + * Example: addWeekday(3); will add the difference of days from the begining of the month until + * wednesday. + * + * @param string|integer|array|Zend_Date $month Weekday to add + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date Provides fluid interface + * @throws Zend_Date_Exception + */ + public function addWeekday($weekday, $locale = null) + { + return $this->_weekday('add', $weekday, $locale); + } + + + /** + * Subtracts weekdays from the existing date object. + * The weekday can be a number or a string. + * If a localized dayname is given it will be parsed with the default locale or the optional + * set locale. + * Returned is the new date object + * Example: subWeekday(3); will subtract the difference of days from the begining of the month until + * wednesday. + * + * @param string|integer|array|Zend_Date $month Weekday to sub + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date Provides fluid interface + * @throws Zend_Date_Exception + */ + public function subWeekday($weekday, $locale = null) + { + return $this->_weekday('sub', $weekday, $locale); + } + + + /** + * Compares the weekday with the existing date object, ignoring other date parts. + * For example: 'Monday', 'en' -> 08.Jan.2007 -> 0 + * Returns if equal, earlier or later + * + * @param string|integer|array|Zend_Date $weekday Weekday to compare + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return integer 0 = equal, 1 = later, -1 = earlier + * @throws Zend_Date_Exception + */ + public function compareWeekday($weekday, $locale = null) + { + return $this->_weekday('cmp', $weekday, $locale); + } + + + /** + * Returns the day of year as new date object + * Example: 02.Feb.1986 10:00:00 -> 02.Feb.1970 00:00:00 + * + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date + */ + public function getDayOfYear($locale = null) + { + if (self::$_options['format_type'] == 'php') { + $format = 'D'; + } else { + $format = self::DAY_OF_YEAR; + } + + return $this->copyPart($format, $locale); + } + + + /** + * Sets a new day of year + * The day of year is always a number. + * Returned is the new date object + * Example: 04.May.2004 -> setDayOfYear(10) -> 10.Jan.2004 + * + * @param string|integer|array|Zend_Date $day Day of Year to set + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date Provides fluid interface + * @throws Zend_Date_Exception + */ + public function setDayOfYear($day, $locale = null) + { + return $this->_calcvalue('set', $day, 'day of year', self::DAY_OF_YEAR, $locale); + } + + + /** + * Adds a day of year to the existing date object. + * The day of year is always a number. + * Returned is the new date object + * Example: addDayOfYear(10); will add 10 days to the existing date object. + * + * @param string|integer|array|Zend_Date $day Day of Year to add + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date Provides fluid interface + * @throws Zend_Date_Exception + */ + public function addDayOfYear($day, $locale = null) + { + return $this->_calcvalue('add', $day, 'day of year', self::DAY_OF_YEAR, $locale); + } + + + /** + * Subtracts a day of year from the existing date object. + * The day of year is always a number. + * Returned is the new date object + * Example: subDayOfYear(10); will subtract 10 days from the existing date object. + * + * @param string|integer|array|Zend_Date $day Day of Year to sub + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date Provides fluid interface + * @throws Zend_Date_Exception + */ + public function subDayOfYear($day, $locale = null) + { + return $this->_calcvalue('sub', $day, 'day of year', self::DAY_OF_YEAR, $locale); + } + + + /** + * Compares the day of year with the existing date object. + * For example: compareDayOfYear(33) -> 02.Feb.2007 -> 0 + * Returns if equal, earlier or later + * + * @param string|integer|array|Zend_Date $day Day of Year to compare + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return integer 0 = equal, 1 = later, -1 = earlier + * @throws Zend_Date_Exception + */ + public function compareDayOfYear($day, $locale = null) + { + return $this->_calcvalue('cmp', $day, 'day of year', self::DAY_OF_YEAR, $locale); + } + + + /** + * Returns the hour as new date object + * Example: 02.Feb.1986 10:30:25 -> 01.Jan.1970 10:00:00 + * + * @param $locale string|Zend_Locale OPTIONAL Locale for parsing input + * @return Zend_Date + */ + public function getHour($locale = null) + { + return $this->copyPart(self::HOUR, $locale); + } + + + /** + * Sets a new hour + * The hour is always a number. + * Returned is the new date object + * Example: 04.May.1993 13:07:25 -> setHour(7); -> 04.May.1993 07:07:25 + * + * @param string|integer|array|Zend_Date $hour Hour to set + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date Provides fluid interface + * @throws Zend_Date_Exception + */ + public function setHour($hour, $locale = null) + { + return $this->_calcvalue('set', $hour, 'hour', self::HOUR_SHORT, $locale); + } + + + /** + * Adds hours to the existing date object. + * The hour is always a number. + * Returned is the new date object + * Example: 04.May.1993 13:07:25 -> addHour(12); -> 05.May.1993 01:07:25 + * + * @param string|integer|array|Zend_Date $hour Hour to add + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date Provides fluid interface + * @throws Zend_Date_Exception + */ + public function addHour($hour, $locale = null) + { + return $this->_calcvalue('add', $hour, 'hour', self::HOUR_SHORT, $locale); + } + + + /** + * Subtracts hours from the existing date object. + * The hour is always a number. + * Returned is the new date object + * Example: 04.May.1993 13:07:25 -> subHour(6); -> 05.May.1993 07:07:25 + * + * @param string|integer|array|Zend_Date $hour Hour to sub + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date Provides fluid interface + * @throws Zend_Date_Exception + */ + public function subHour($hour, $locale = null) + { + return $this->_calcvalue('sub', $hour, 'hour', self::HOUR_SHORT, $locale); + } + + + /** + * Compares the hour with the existing date object. + * For example: 10:30:25 -> compareHour(10) -> 0 + * Returns if equal, earlier or later + * + * @param string|integer|array|Zend_Date $hour Hour to compare + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return integer 0 = equal, 1 = later, -1 = earlier + * @throws Zend_Date_Exception + */ + public function compareHour($hour, $locale = null) + { + return $this->_calcvalue('cmp', $hour, 'hour', self::HOUR_SHORT, $locale); + } + + + /** + * Returns the minute as new date object + * Example: 02.Feb.1986 10:30:25 -> 01.Jan.1970 00:30:00 + * + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date + */ + public function getMinute($locale = null) + { + if (self::$_options['format_type'] == 'php') { + $format = 'i'; + } else { + $format = self::MINUTE; + } + + return $this->copyPart($format, $locale); + } + + + /** + * Sets a new minute + * The minute is always a number. + * Returned is the new date object + * Example: 04.May.1993 13:07:25 -> setMinute(29); -> 04.May.1993 13:29:25 + * + * @param string|integer|array|Zend_Date $minute Minute to set + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date Provides fluid interface + * @throws Zend_Date_Exception + */ + public function setMinute($minute, $locale = null) + { + return $this->_calcvalue('set', $minute, 'minute', self::MINUTE_SHORT, $locale); + } + + + /** + * Adds minutes to the existing date object. + * The minute is always a number. + * Returned is the new date object + * Example: 04.May.1993 13:07:25 -> addMinute(65); -> 04.May.1993 13:12:25 + * + * @param string|integer|array|Zend_Date $minute Minute to add + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date Provides fluid interface + * @throws Zend_Date_Exception + */ + public function addMinute($minute, $locale = null) + { + return $this->_calcvalue('add', $minute, 'minute', self::MINUTE_SHORT, $locale); + } + + + /** + * Subtracts minutes from the existing date object. + * The minute is always a number. + * Returned is the new date object + * Example: 04.May.1993 13:07:25 -> subMinute(9); -> 04.May.1993 12:58:25 + * + * @param string|integer|array|Zend_Date $minute Minute to sub + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date Provides fluid interface + * @throws Zend_Date_Exception + */ + public function subMinute($minute, $locale = null) + { + return $this->_calcvalue('sub', $minute, 'minute', self::MINUTE_SHORT, $locale); + } + + + /** + * Compares the minute with the existing date object. + * For example: 10:30:25 -> compareMinute(30) -> 0 + * Returns if equal, earlier or later + * + * @param string|integer|array|Zend_Date $minute Hour to compare + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return integer 0 = equal, 1 = later, -1 = earlier + * @throws Zend_Date_Exception + */ + public function compareMinute($minute, $locale = null) + { + return $this->_calcvalue('cmp', $minute, 'minute', self::MINUTE_SHORT, $locale); + } + + + /** + * Returns the second as new date object + * Example: 02.Feb.1986 10:30:25 -> 01.Jan.1970 00:00:25 + * + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date + */ + public function getSecond($locale = null) + { + if (self::$_options['format_type'] == 'php') { + $format = 's'; + } else { + $format = self::SECOND; + } + + return $this->copyPart($format, $locale); + } + + + /** + * Sets new seconds to the existing date object. + * The second is always a number. + * Returned is the new date object + * Example: 04.May.1993 13:07:25 -> setSecond(100); -> 04.May.1993 13:08:40 + * + * @param string|integer|array|Zend_Date $second Second to set + * @param string|Zend_Locale $locale (Optional) Locale for parsing input + * @return Zend_Date Provides fluid interface + * @throws Zend_Date_Exception + */ + public function setSecond($second, $locale = null) + { + return $this->_calcvalue('set', $second, 'second', self::SECOND_SHORT, $locale); + } + + + /** + * Adds seconds to the existing date object. + * The second is always a number. + * Returned is the new date object + * Example: 04.May.1993 13:07:25 -> addSecond(65); -> 04.May.1993 13:08:30 + * + * @param string|integer|array|Zend_Date $second Second to add + * @param string|Zend_Locale $locale (Optional) Locale for parsing input + * @return Zend_Date Provides fluid interface + * @throws Zend_Date_Exception + */ + public function addSecond($second, $locale = null) + { + return $this->_calcvalue('add', $second, 'second', self::SECOND_SHORT, $locale); + } + + + /** + * Subtracts seconds from the existing date object. + * The second is always a number. + * Returned is the new date object + * Example: 04.May.1993 13:07:25 -> subSecond(10); -> 04.May.1993 13:07:15 + * + * @param string|integer|array|Zend_Date $second Second to sub + * @param string|Zend_Locale $locale (Optional) Locale for parsing input + * @return Zend_Date Provides fluid interface + * @throws Zend_Date_Exception + */ + public function subSecond($second, $locale = null) + { + return $this->_calcvalue('sub', $second, 'second', self::SECOND_SHORT, $locale); + } + + + /** + * Compares the second with the existing date object. + * For example: 10:30:25 -> compareSecond(25) -> 0 + * Returns if equal, earlier or later + * + * @param string|integer|array|Zend_Date $second Second to compare + * @param string|Zend_Locale $locale (Optional) Locale for parsing input + * @return integer 0 = equal, 1 = later, -1 = earlier + * @throws Zend_Date_Exception + */ + public function compareSecond($second, $locale = null) + { + return $this->_calcvalue('cmp', $second, 'second', self::SECOND_SHORT, $locale); + } + + + /** + * Returns the precision for fractional seconds + * + * @return integer + */ + public function getFractionalPrecision() + { + return $this->_precision; + } + + + /** + * Sets a new precision for fractional seconds + * + * @param integer $precision Precision for the fractional datepart 3 = milliseconds + * @throws Zend_Date_Exception + * @return Zend_Date Provides fluid interface + */ + public function setFractionalPrecision($precision) + { + if (!intval($precision) or ($precision < 0) or ($precision > 9)) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("precision ($precision) must be a positive integer less than 10", 0, null, $precision); + } + + $this->_precision = (int) $precision; + if ($this->_precision < strlen($this->_fractional)) { + $this->_fractional = substr($this->_fractional, 0, $this->_precision); + } else { + $this->_fractional = str_pad($this->_fractional, $this->_precision, '0', STR_PAD_RIGHT); + } + + return $this; + } + + + /** + * Returns the milliseconds of the date object + * + * @return string + */ + public function getMilliSecond() + { + return $this->_fractional; + } + + + /** + * Sets new milliseconds for the date object + * Example: setMilliSecond(550, 2) -> equals +5 Sec +50 MilliSec + * + * @param integer|Zend_Date $milli (Optional) Millisecond to set, when null the actual millisecond is set + * @param integer $precision (Optional) Fraction precision of the given milliseconds + * @return Zend_Date Provides fluid interface + */ + public function setMilliSecond($milli = null, $precision = null) + { + if ($milli === null) { + list($milli, $time) = explode(" ", microtime()); + $milli = intval($milli); + $precision = 6; + } else if (!is_numeric($milli)) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("invalid milli second ($milli) operand", 0, null, $milli); + } + + if ($precision === null) { + $precision = $this->_precision; + } + + if (!is_int($precision) || $precision < 1 || $precision > 9) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("precision ($precision) must be a positive integer less than 10", 0, null, $precision); + } + + $this->_fractional = 0; + $this->addMilliSecond($milli, $precision); + return $this; + } + + + /** + * Adds milliseconds to the date object + * + * @param integer|Zend_Date $milli (Optional) Millisecond to add, when null the actual millisecond is added + * @param integer $precision (Optional) Fractional precision for the given milliseconds + * @return Zend_Date Provides fluid interface + */ + public function addMilliSecond($milli = null, $precision = null) + { + if ($milli === null) { + list($milli, $time) = explode(" ", microtime()); + $milli = intval($milli); + } else if (!is_numeric($milli)) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("invalid milli second ($milli) operand", 0, null, $milli); + } + + if ($precision === null) { + $precision = strlen($milli); + if ($milli < 0) { + --$precision; + } + } + + if (!is_int($precision) || $precision < 1 || $precision > 9) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("precision ($precision) must be a positive integer less than 10", 0, null, $precision); + } + + $this->_fractional += $milli; + + // Add/sub milliseconds + add/sub seconds + $max = pow(10, $this->_precision); + // Milli includes seconds + if ($this->_fractional >= $max) { + while ($this->_fractional >= $max) { + $this->addSecond(1); + $this->_fractional -= $max; + } + } + + if ($this->_fractional < 0) { + while ($this->_fractional < 0) { + $this->subSecond(1); + $this->_fractional += $max; + } + } + + if ($this->_precision > strlen($this->_fractional)) { + $this->_fractional = str_pad($this->_fractional, $this->_precision, '0', STR_PAD_LEFT); + } + + return $this; + } + + + /** + * Subtracts a millisecond + * + * @param integer|Zend_Date $milli (Optional) Millisecond to sub, when null the actual millisecond is subtracted + * @param integer $precision (Optional) Fractional precision for the given milliseconds + * @return Zend_Date Provides fluid interface + */ + public function subMilliSecond($milli = null, $precision = null) + { + $this->addMilliSecond(0 - $milli, $precision); + return $this; + } + + /** + * Compares only the millisecond part, returning the difference + * + * @param integer|Zend_Date $milli OPTIONAL Millisecond to compare, when null the actual millisecond is compared + * @param integer $precision OPTIONAL Fractional precision for the given milliseconds + * @throws Zend_Date_Exception On invalid input + * @return integer 0 = equal, 1 = later, -1 = earlier + */ + public function compareMilliSecond($milli = null, $precision = null) + { + if ($milli === null) { + list($milli, $time) = explode(" ", microtime()); + $milli = intval($milli); + } else if (is_numeric($milli) === false) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("invalid milli second ($milli) operand", 0, null, $milli); + } + + if ($precision === null) { + $precision = strlen($milli); + } else if (!is_int($precision) || $precision < 1 || $precision > 9) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("precision ($precision) must be a positive integer less than 10", 0, null, $precision); + } + + if ($precision === 0) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception('precision is 0'); + } + + if ($precision != $this->_precision) { + if ($precision > $this->_precision) { + $diff = $precision - $this->_precision; + $milli = (int) ($milli / (10 * $diff)); + } else { + $diff = $this->_precision - $precision; + $milli = (int) ($milli * (10 * $diff)); + } + } + + $comp = $this->_fractional - $milli; + if ($comp < 0) { + return -1; + } else if ($comp > 0) { + return 1; + } + return 0; + } + + /** + * Returns the week as new date object using monday as begining of the week + * Example: 12.Jan.2007 -> 08.Jan.1970 00:00:00 + * + * @param $locale string|Zend_Locale OPTIONAL Locale for parsing input + * @return Zend_Date + */ + public function getWeek($locale = null) + { + if (self::$_options['format_type'] == 'php') { + $format = 'W'; + } else { + $format = self::WEEK; + } + + return $this->copyPart($format, $locale); + } + + /** + * Sets a new week. The week is always a number. The day of week is not changed. + * Returned is the new date object + * Example: 09.Jan.2007 13:07:25 -> setWeek(1); -> 02.Jan.2007 13:07:25 + * + * @param string|integer|array|Zend_Date $week Week to set + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date Provides fluid interface + * @throws Zend_Date_Exception + */ + public function setWeek($week, $locale = null) + { + return $this->_calcvalue('set', $week, 'week', self::WEEK, $locale); + } + + /** + * Adds a week. The week is always a number. The day of week is not changed. + * Returned is the new date object + * Example: 09.Jan.2007 13:07:25 -> addWeek(1); -> 16.Jan.2007 13:07:25 + * + * @param string|integer|array|Zend_Date $week Week to add + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date Provides fluid interface + * @throws Zend_Date_Exception + */ + public function addWeek($week, $locale = null) + { + return $this->_calcvalue('add', $week, 'week', self::WEEK, $locale); + } + + /** + * Subtracts a week. The week is always a number. The day of week is not changed. + * Returned is the new date object + * Example: 09.Jan.2007 13:07:25 -> subWeek(1); -> 02.Jan.2007 13:07:25 + * + * @param string|integer|array|Zend_Date $week Week to sub + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return Zend_Date Provides fluid interface + * @throws Zend_Date_Exception + */ + public function subWeek($week, $locale = null) + { + return $this->_calcvalue('sub', $week, 'week', self::WEEK, $locale); + } + + /** + * Compares only the week part, returning the difference + * Returned is the new date object + * Returns if equal, earlier or later + * Example: 09.Jan.2007 13:07:25 -> compareWeek(2); -> 0 + * + * @param string|integer|array|Zend_Date $week Week to compare + * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input + * @return integer 0 = equal, 1 = later, -1 = earlier + */ + public function compareWeek($week, $locale = null) + { + return $this->_calcvalue('cmp', $week, 'week', self::WEEK, $locale); + } + + /** + * Sets a new standard locale for the date object. + * This locale will be used for all functions + * Returned is the really set locale. + * Example: 'de_XX' will be set to 'de' because 'de_XX' does not exist + * 'xx_YY' will be set to 'root' because 'xx' does not exist + * + * @param string|Zend_Locale $locale (Optional) Locale for parsing input + * @throws Zend_Date_Exception When the given locale does not exist + * @return Zend_Date Provides fluent interface + */ + public function setLocale($locale = null) + { + try { + $this->_locale = Zend_Locale::findLocale($locale); + } catch (Zend_Locale_Exception $e) { + #require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception($e->getMessage(), 0, $e); + } + + return $this; + } + + /** + * Returns the actual set locale + * + * @return string + */ + public function getLocale() + { + return $this->_locale; + } + + /** + * Checks if the given date is a real date or datepart. + * Returns false if a expected datepart is missing or a datepart exceeds its possible border. + * But the check will only be done for the expected dateparts which are given by format. + * If no format is given the standard dateformat for the actual locale is used. + * f.e. 30.February.2007 will return false if format is 'dd.MMMM.YYYY' + * + * @param string|array|Zend_Date $date Date to parse for correctness + * @param string $format (Optional) Format for parsing the date string + * @param string|Zend_Locale $locale (Optional) Locale for parsing date parts + * @return boolean True when all date parts are correct + */ + public static function isDate($date, $format = null, $locale = null) + { + if (!is_string($date) && !is_numeric($date) && !($date instanceof Zend_Date) && + !is_array($date)) { + return false; + } + + if (($format !== null) && ($format != 'ee') && ($format != 'ss') && ($format != 'GG') && ($format != 'MM') && ($format != 'EE') && ($format != 'TT') + && (Zend_Locale::isLocale($format, null, false))) { + $locale = $format; + $format = null; + } + + $locale = Zend_Locale::findLocale($locale); + + if ($format === null) { + $format = Zend_Locale_Format::getDateFormat($locale); + } else if ((self::$_options['format_type'] == 'php') && !defined($format)) { + $format = Zend_Locale_Format::convertPhpToIsoFormat($format); + } + + $format = self::_getLocalizedToken($format, $locale); + if (!is_array($date)) { + try { + $parsed = Zend_Locale_Format::getDate($date, array('locale' => $locale, + 'date_format' => $format, 'format_type' => 'iso', + 'fix_date' => false)); + } catch (Zend_Locale_Exception $e) { + // Date can not be parsed + return false; + } + } else { + $parsed = $date; + } + + if (((strpos($format, 'Y') !== false) or (strpos($format, 'y') !== false)) and + (!isset($parsed['year']))) { + // Year expected but not found + return false; + } + + if ((strpos($format, 'M') !== false) and (!isset($parsed['month']))) { + // Month expected but not found + return false; + } + + if ((strpos($format, 'd') !== false) and (!isset($parsed['day']))) { + // Day expected but not found + return false; + } + + if (((strpos($format, 'H') !== false) or (strpos($format, 'h') !== false)) and + (!isset($parsed['hour']))) { + // Hour expected but not found + return false; + } + + if ((strpos($format, 'm') !== false) and (!isset($parsed['minute']))) { + // Minute expected but not found + return false; + } + + if ((strpos($format, 's') !== false) and (!isset($parsed['second']))) { + // Second expected but not found + return false; + } + + // Set not given dateparts + if (isset($parsed['hour']) === false) { + $parsed['hour'] = 12; + } + + if (isset($parsed['minute']) === false) { + $parsed['minute'] = 0; + } + + if (isset($parsed['second']) === false) { + $parsed['second'] = 0; + } + + if (isset($parsed['month']) === false) { + $parsed['month'] = 1; + } + + if (isset($parsed['day']) === false) { + $parsed['day'] = 1; + } + + if (isset($parsed['year']) === false) { + $parsed['year'] = 1970; + } + + if (self::isYearLeapYear($parsed['year'])) { + $parsed['year'] = 1972; + } else { + $parsed['year'] = 1971; + } + + $date = new self($parsed, null, $locale); + $timestamp = $date->mktime($parsed['hour'], $parsed['minute'], $parsed['second'], + $parsed['month'], $parsed['day'], $parsed['year']); + + if ($parsed['year'] != $date->date('Y', $timestamp)) { + // Given year differs from parsed year + return false; + } + + if ($parsed['month'] != $date->date('n', $timestamp)) { + // Given month differs from parsed month + return false; + } + + if ($parsed['day'] != $date->date('j', $timestamp)) { + // Given day differs from parsed day + return false; + } + + if ($parsed['hour'] != $date->date('G', $timestamp)) { + // Given hour differs from parsed hour + return false; + } + + if ($parsed['minute'] != $date->date('i', $timestamp)) { + // Given minute differs from parsed minute + return false; + } + + if ($parsed['second'] != $date->date('s', $timestamp)) { + // Given second differs from parsed second + return false; + } + + return true; + } + + /** + * Returns the ISO Token for all localized constants + * + * @param string $token Token to normalize + * @param string $locale Locale to search + * @return string + */ + protected static function _getLocalizedToken($token, $locale) + { + switch($token) { + case self::ISO_8601 : + return "yyyy-MM-ddThh:mm:ss"; + break; + case self::RFC_2822 : + return "EEE, dd MMM yyyy HH:mm:ss"; + break; + case self::DATES : + return Zend_Locale_Data::getContent($locale, 'date'); + break; + case self::DATE_FULL : + return Zend_Locale_Data::getContent($locale, 'date', array('gregorian', 'full')); + break; + case self::DATE_LONG : + return Zend_Locale_Data::getContent($locale, 'date', array('gregorian', 'long')); + break; + case self::DATE_MEDIUM : + return Zend_Locale_Data::getContent($locale, 'date', array('gregorian', 'medium')); + break; + case self::DATE_SHORT : + return Zend_Locale_Data::getContent($locale, 'date', array('gregorian', 'short')); + break; + case self::TIMES : + return Zend_Locale_Data::getContent($locale, 'time'); + break; + case self::TIME_FULL : + return Zend_Locale_Data::getContent($locale, 'time', array('gregorian', 'full')); + break; + case self::TIME_LONG : + return Zend_Locale_Data::getContent($locale, 'time', array('gregorian', 'long')); + break; + case self::TIME_MEDIUM : + return Zend_Locale_Data::getContent($locale, 'time', array('gregorian', 'medium')); + break; + case self::TIME_SHORT : + return Zend_Locale_Data::getContent($locale, 'time', array('gregorian', 'short')); + break; + case self::DATETIME : + return Zend_Locale_Data::getContent($locale, 'datetime'); + break; + case self::DATETIME_FULL : + return Zend_Locale_Data::getContent($locale, 'datetime', array('gregorian', 'full')); + break; + case self::DATETIME_LONG : + return Zend_Locale_Data::getContent($locale, 'datetime', array('gregorian', 'long')); + break; + case self::DATETIME_MEDIUM : + return Zend_Locale_Data::getContent($locale, 'datetime', array('gregorian', 'medium')); + break; + case self::DATETIME_SHORT : + return Zend_Locale_Data::getContent($locale, 'datetime', array('gregorian', 'short')); + break; + case self::ATOM : + case self::RFC_3339 : + case self::W3C : + return "yyyy-MM-DD HH:mm:ss"; + break; + case self::COOKIE : + case self::RFC_850 : + return "EEEE, dd-MM-yyyy HH:mm:ss"; + break; + case self::RFC_822 : + case self::RFC_1036 : + case self::RFC_1123 : + case self::RSS : + return "EEE, dd MM yyyy HH:mm:ss"; + break; + } + + return $token; + } + + /** + * Get unix timestamp. + * Added limitation: $year value must be between -10 000 and 10 000 + * Parent method implementation causes 504 error if it gets too big(small) year value + * + * @see Zend_Date_DateObject::mktime + * @throws Zend_Date_Exception + * @param $hour + * @param $minute + * @param $second + * @param $month + * @param $day + * @param $year + * @param bool $gmt + * @return float|int + */ + protected function mktime($hour, $minute, $second, $month, $day, $year, $gmt = false) + { + $day = intval($day); + $month = intval($month); + $year = intval($year); + + // correct months > 12 and months < 1 + if ($month > 12) { + $overlap = floor($month / 12); + $year += $overlap; + $month -= $overlap * 12; + } else { + $overlap = ceil((1 - $month) / 12); + $year -= $overlap; + $month += $overlap * 12; + } + + if ($year > self::YEAR_MAX_VALUE || $year < self::YEAR_MIN_VALUE) { + throw new Zend_Date_Exception('Invalid year, it must be between ' . self::YEAR_MIN_VALUE . ' and ' + . self::YEAR_MAX_VALUE); + } + + return parent::mktime($hour, $minute, $second, $month, $day, $year, $gmt); + } +} diff --git a/app/design/adminhtml/default/default/local.xml b/app/design/adminhtml/default/default/local.xml index 91889db13506f84c09ac7ac1217b50847991cd9a..9a8889f9f5e8759e1022069d6225a79193c31c4e 100644 --- a/app/design/adminhtml/default/default/local.xml +++ b/app/design/adminhtml/default/default/local.xml @@ -21,7 +21,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/design/adminhtml/default/default/skin/default/below_ie7.css b/app/design/adminhtml/default/default/skin/default/below_ie7.css index 1ce5d15b22f1e32fcda91fc28a1643799dd31d38..537a1cf8fc5627dca64baafb12ac53a477d1b698 100644 --- a/app/design/adminhtml/default/default/skin/default/below_ie7.css +++ b/app/design/adminhtml/default/default/skin/default/below_ie7.css @@ -17,7 +17,7 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /* Set min-width */ diff --git a/app/design/adminhtml/default/default/skin/default/boxes.css b/app/design/adminhtml/default/default/skin/default/boxes.css index 681cb8f2631f2aab3584e96e9d3c50890df051dc..dbaac45d1bbc21134cb01bbc49cb3faa79ceb04f 100644 --- a/app/design/adminhtml/default/default/skin/default/boxes.css +++ b/app/design/adminhtml/default/default/skin/default/boxes.css @@ -17,7 +17,7 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ @@ -90,9 +90,9 @@ position:fixed; top:45%; left:50%; - width:120px; - margin-left:-60px; - padding:15px 60px; + width:150px; + margin-left:-105px; + padding:15px 30px; background:#fff4e9; border:2px solid #f1af73; color:#d85909; @@ -134,6 +134,9 @@ .grid th { white-space:nowrap; } .grid td.editable input.input-text { width:50px !important; margin-left:4px !important; } .grid td input.input-text { width:86%; } +.grid td input.input-text-export-filter { width:272px; } +.grid td input.input-text-range { width:104px; } +.grid td input.input-text-range-date { width:87px; } .grid td input.input-inactive { background:#eee; } .grid table td { border-width:0 1px 1px 0; border-color:#dadfe0; border-style:solid; } .grid table.border td { background:#fff !important; } @@ -205,7 +208,9 @@ table.actions td { vertical-align:top; } .grid tr.filter .range select { float:right; width:56px !important; margin-top:0; } .grid tr.filter .range .label { display:block; width:36px; float:left; padding-left:2px; } .grid tr.filter .date img { width:15px; height:15px; cursor:pointer; vertical-align:middle; } -.grid .head-massaction select { width:50px !important; } +.grid .head-massaction select { width:auto !important; max-width:90px; } +.grid select.select-export-filter, +.grid select.multiselect-export-filter { width:278px; } /* Grid Footer */ .grid table tfoot tr { background:#D7E5EF; } @@ -270,7 +275,7 @@ ul.tabs a.changed { font-style:italic; } ul.tabs-horiz { margin:0 0 18px 0; background:url(images/horiz_tabs_ul_bg.gif) repeat-x 0 100% #f8f8f8; padding:8px 0 0 5px; } ul.tabs-horiz li { float:left; margin:0 4px; } ul.tabs-horiz li a { display:block; background:#e2e2e2; border:1px solid #ccc; padding:2px 10px; color:#333 !important; text-decoration:none !important; } -ul.tabs-horiz li a.notloaded { color:#999 !important; } +ul.tabs-horiz li a.notloaded { /* not used for now */ } ul.tabs-horiz li a.active { border-bottom:1px solid #fff; background:#fff; } @@ -335,6 +340,7 @@ table.form-edit { width:100%; } label.inline { float:none !important; width:auto !important; } .nested-content .entry-edit { margin-left:2em; } .nested-content .entry-edit .entry-edit { margin-left:0; } +#coupon_container .entry-edit { min-width:310px; } /* Form Elements */ input.input-text,textarea,select { border-width:1px; border-style:solid; border-color:#aaa #c8c8c8 #c8c8c8 #aaa; background:#fff; font:12px arial, helvetica, sans-serif; } @@ -352,7 +358,10 @@ select.multiselect option { padding:3px 4px; border-bottom:1px solid #ddd; .field-100 { background-color:#fff; border-width:1px; border-style:solid; border-color:#aaa #c8c8c8 #c8c8c8 #aaa; padding:2px; } .field-100 textarea, .field-100 input.input-text { float:left; width:100% !important; border:0 !important; padding:0 !important; } - +@media screen and (-webkit-min-device-pixel-ratio:0) { + select option:disabled, + select:disabled option { color:#c9c9c9!important;color:#cacaca!important; text-shadow:2px 2px 2px #000; } +} /* Form List */ /* Table for default form data */ .form-list { width:auto; border:0 !important; } @@ -369,6 +378,7 @@ select.multiselect option { padding:3px 4px; border-bottom:1px solid #ddd; .form-list td.value textarea { width:274px; } .form-list td.value textarea { height:15em; } .form-list td.value select { width:280px; } +.form-list td.value select.select-date { width:87px; } .form-list td.note { background:url(images/note_cell_bg.gif) 6px 10px no-repeat !important; padding-left:18px; } .form-list td.scope-label { padding-left:5px; color:#6f8992; font-size:.9em; } .form-list p.note { margin:0; padding:0 0 0 13px; background:url(images/note_bg.gif) 1px 6px no-repeat; font-size:11px; } @@ -403,7 +413,7 @@ span.delete-file { padding:0; } /* Form Button */ .content-buttons.form-buttons, -.content-header .form-buttons { text-align:right; margin-bottom:0; white-space:nowrap; } +.content-header .form-buttons { text-align:right; margin-bottom:0; } .content-header .content-buttons-placeholder { display:inline !important; } .content-header .form-buttons { float:right; } .content-header td.form-buttons { float:none; } @@ -414,6 +424,7 @@ button, button:hover { background:#f77c16 url(images/btn_over_bg.gif) repeat-x 0 0; } button:active { background:#f77c16 url(images/btn_on_bg.gif) repeat-x 0 0; } button span { line-height:1.35em; background-repeat:no-repeat; background-position:0 50%; } +button span span { background:none !important; padding:0 !important; margin:0 !important; display:inline !important; } button.delete, button.save, button.add { padding-left:6px; } @@ -424,12 +435,18 @@ button.add span, button.back span, button.add-image span, button.add-widget span { padding-left:20px; } +/* Google Chrome specific fix for empty buttons */ +button.add span:after, +button.delete span:after { display:inline-block; clear:both; content:"."; font-size:0; line-height:0; height:0; overflow:hidden; } button.back { border-color:#ccc #aaa #aaa #ccc; background-color:#fff; background-image:url(images/btn_back_bg.gif); color:#555; } button.back span { background-image:url(images/icon_btn_back.gif); } +button.fail, button.cancel, button.delete { border-color:#d24403 #a92000 #a92000 #d24403; background-image:url(images/cancel_btn_bg.gif); background-color:#fcaf81; color:#fff; } +button.fail:hover, button.cancel:hover, button.delete:hover { background-image:url(images/cancel_btn_over_bg.gif); } +button.fail:active, button.cancel:active, button.delete:active { background-image:url(images/cancel_btn_active_bg.gif); background-color:#e0612f; } button.cancel span, @@ -442,6 +459,9 @@ button.add-widget span { background-image:url(images/btn_add-widget_icon2.gif); button.add-variable span { background-image:url(images/btn_add-variable_icon.gif); padding-left:26px; } button.go span { background-image:url(images/btn_go.gif); padding-left:16px; } button.btn-chooser { display:block; margin:0 0 10px; } +button.success { background-image:url(images/btn_gr_bg.gif); border-color:#46745E; } +button.success:hover { background:url(images/btn_gr_over.gif) #6cac46; } +button.success:active { background:url(images/btn_gr_on.gif) repeat-x 0 0 #3fa05e; } button.disabled, button.disabled:hover, @@ -461,6 +481,7 @@ button.icon-btn span { text-indent:-999em; display:block; width:16px; padding:0; .side-col .switcher select { width:100%; } /*.side-col .switcher { margin-right:20px; margin-bottom:20px; }*/ .catalog-categories .side-col .switcher { margin-right:0; margin-bottom:15px; } +.link-storeScope { display:inline-block; vertical-align:middle; margin:0 0 1px; width:16px; height:16px; background:url(images/i_question-mark.png) 0 0 no-repeat; text-decoration:none !important; text-indent:-999em; overflow:hidden; } /* SPACE @@ -693,7 +714,24 @@ div.autocomplete ul li { padding:.5em .7em; min-height:32px; cursor:pointer; tex .login-container .legal { margin:0; background:url(images/login_box_legal_bg.gif) no-repeat; padding:8px 8px 5px 8px; font-size:.95em; } .login-form .validation-advice { margin:3px 0 0 0; } .login-form .forgot-link { margin:0 17px 0 0; text-align:right; } - +.login-form .captcha { padding:10px 0 0; } +.login-form .captcha-image { border:1px solid #aaa; margin:1.5em 0 0; position:relative; } +.login-form .captcha-image img { vertical-align:bottom; } +.login-form .captcha-reload { cursor:pointer; position: absolute; top:2px; right:2px; } +.login-form .captcha-reload.refreshing { animation:rotate 1.5s infinite linear; -webkit-animation:rotate 1.5s infinite linear; -moz-animation:rotate 1.5s infinite linear; } + +@-webkit-keyframes rotate { + 0% { -webkit-transform:rotate(0); } + 0% { -webkit-transform:rotate(360deg); } +} +@-moz-keyframes rotate { + 0% { -moz-transform:rotate(0); } + 0% { -moz-transform:rotate(360deg); } +} +@keyframes rotate { + 0% { transform:rotate(0); } + 0% { transform:rotate(360deg); } +} /* DASHBOARD @@ -758,9 +796,10 @@ ul.item-options li { padding-left:.7em; } .entry-edit .order-address td.label label { width:100px; } .entry-edit .order-address input.input-text, -.entry-edit .order-address .textarea { width:95% !important; } -.entry-edit .order-address .select { width:96.5%; } -.order-search-items .entry-edit .grid { height:610px; overflow:auto; } +.entry-edit .order-address .textarea { width:95% !important; } +.entry-edit .order-address .select { width:96.5%; } +.entry-edit .order-address .validate-vat { text-align:right; padding:10px 0 0; width:96%; } +.order-search-items .entry-edit .grid { height:610px; overflow:auto; } .order-search-items .entry-edit .grid table { width:99.9%; } /* .create-order-totals { background:url(images/bg_create_order_totals.gif) repeat-y 50% 0 !important; } */ @@ -959,6 +998,7 @@ ul.tabs a.paypal-section:hover { background:url(images/tabs_span_bg.gif) repeat- .x-tree-node { margin:0 !important; } .x-tree-node .leaf .x-tree-node-icon { background-image:url(images/fam_leaf.png); } .x-tree-node .system-leaf .x-tree-node-icon { background-image:url(images/fam_application_form_delete.png); } +.x-tree-node-ct { overflow:hidden; } /* Product - Websites */ .webiste-groups { padding:10px 20px; } @@ -1392,6 +1432,19 @@ ul.super-product-attributes { padding-left:15px; } #catalog-wysiwyg-editor .magento_message { padding:0 7px; } #catalog-wysiwyg-editor .magento_buttons { padding-left:7px; padding-right:7px; } +/* Backups */ +.backup-dialog { background-color:#6f8992; background:rgba(111, 137, 146, 0.5); cursor:default; left:50%; margin:0 0 0 -271px; position:fixed; top:50%; width:470px; padding:8px; z-index:400; -moz-box-shadow:0 0 100px #ccc; -webkit-box-shadow:0 0 100px #ccc; box-shadow:0 0 100px #ccc; } +.backup-dialog .entry-edit { border:1px solid #6f8992; } +.backup-dialog .content { background:#fff; border-bottom:1px solid #ccc; max-height:400px; overflow:auto; } +.backup-dialog .question {margin-top: 15px;} +.backup-dialog .buttons-set { border-top:1px solid #ddd; background:#eee; margin:0; overflow:hidden; padding:7px 10px 8px; width:448px; } +.backup-dialog .buttons-set button { margin:0 0 0 5px; } +.backup-dialog #ftp-credentials-container {margin-top: 25px;} +.backup-dialog .password-box-container {margin-top: 15px;} +.backup-dialog #ftp-credentials-container fieldset {margin-bottom: 0;} +.backup-dialog input[type=text], .backup-dialog input[type=password] {width: 180px} +.backup-dialog .exclude-media-checkbox-container {margin-top: 15px;} +.backup-dialog td.maintenance-checkbox-container {margin-top: 0; padding-top: 4px;} /*****************************************/ /******** ALIGNMENTS AND CLEARS **********/ diff --git a/app/design/adminhtml/default/default/skin/default/custom.css b/app/design/adminhtml/default/default/skin/default/custom.css index dc3d9ddb53a57587e838e20dda54bf77c3ee6516..3bb862c984992ed7958048f80925a81b53f86c4a 100644 --- a/app/design/adminhtml/default/default/skin/default/custom.css +++ b/app/design/adminhtml/default/default/skin/default/custom.css @@ -17,6 +17,6 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/adminhtml/default/default/skin/default/ie7.css b/app/design/adminhtml/default/default/skin/default/ie7.css index 027bba30381521615bafa5960f2fa1e1f2a71456..215456a47b455e675bd6474ecc6fe37f76d3eba6 100644 --- a/app/design/adminhtml/default/default/skin/default/ie7.css +++ b/app/design/adminhtml/default/default/skin/default/ie7.css @@ -17,7 +17,7 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/adminhtml/default/default/skin/default/iestyles.css b/app/design/adminhtml/default/default/skin/default/iestyles.css index 0e1d5d6fdf6987ab29a042006b4df28803a4321a..f530b2a7c24e84c8a14d751321680a4f6112a0d4 100644 --- a/app/design/adminhtml/default/default/skin/default/iestyles.css +++ b/app/design/adminhtml/default/default/skin/default/iestyles.css @@ -17,7 +17,7 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /* Clearing */ @@ -93,7 +93,7 @@ button, .form-button { width:auto; margin-left:5px; overflow:visible; button.icon-btn { width:31px; } .nested-content .content-header { position:relative; zoom:1; } -dl.accordion dt a, +dl.accordion dt a, div.collapseable a { width:100%; } .product-image-gallery .grid tbody td { padding: 4px !important; } .massaction .entry-edit fieldset{ float: right;} @@ -108,4 +108,6 @@ div.collapseable a { width:100%; } .grid-severity-critical, .grid-severity-major, -.grid-severity-minor { margin:3px 0; } \ No newline at end of file +.grid-severity-minor { margin:3px 0; } +button.add span, +button.delete span { display:inline-block; height:16px;} diff --git a/app/design/adminhtml/default/default/skin/default/images/btn_gr_bg.gif b/app/design/adminhtml/default/default/skin/default/images/btn_gr_bg.gif new file mode 100644 index 0000000000000000000000000000000000000000..d91a78b537f489ee43baeef28397625dace4b425 Binary files /dev/null and b/app/design/adminhtml/default/default/skin/default/images/btn_gr_bg.gif differ diff --git a/app/design/adminhtml/default/default/skin/default/images/btn_gr_on.gif b/app/design/adminhtml/default/default/skin/default/images/btn_gr_on.gif new file mode 100644 index 0000000000000000000000000000000000000000..b9f7bdeedbf052964092bed39af7ceca9ed05e05 Binary files /dev/null and b/app/design/adminhtml/default/default/skin/default/images/btn_gr_on.gif differ diff --git a/app/design/adminhtml/default/default/skin/default/images/btn_gr_over.gif b/app/design/adminhtml/default/default/skin/default/images/btn_gr_over.gif new file mode 100644 index 0000000000000000000000000000000000000000..73afeb6200c4dd4752393730b631114da01382a0 Binary files /dev/null and b/app/design/adminhtml/default/default/skin/default/images/btn_gr_over.gif differ diff --git a/app/design/adminhtml/default/default/skin/default/images/i_question-mark.png b/app/design/adminhtml/default/default/skin/default/images/i_question-mark.png new file mode 100644 index 0000000000000000000000000000000000000000..889bf696e2fdac4c51300a90ef6a5dec6b09d7cd Binary files /dev/null and b/app/design/adminhtml/default/default/skin/default/images/i_question-mark.png differ diff --git a/app/design/adminhtml/default/default/skin/default/menu.css b/app/design/adminhtml/default/default/skin/default/menu.css index 50b409ef10aa2dd18057aa01078d4a940c3815fe..4eb3b0b2eb48c3a55e137b65bc008645c46183ac 100644 --- a/app/design/adminhtml/default/default/skin/default/menu.css +++ b/app/design/adminhtml/default/default/skin/default/menu.css @@ -17,7 +17,7 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/adminhtml/default/default/skin/default/print.css b/app/design/adminhtml/default/default/skin/default/print.css index 22f8f7c1abc7c2621d183ce5146f69dd8b89ffb7..4186d110f7e9c1afaf8356ed58fec5077d5993cd 100644 --- a/app/design/adminhtml/default/default/skin/default/print.css +++ b/app/design/adminhtml/default/default/skin/default/print.css @@ -19,7 +19,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/adminhtml/default/default/skin/default/reset.css b/app/design/adminhtml/default/default/skin/default/reset.css index af1d4be00b826382e7f98406f9eed33a6a233ec3..853d1e75731bb2d2d8a02aa68f058fecb1ce3d0b 100644 --- a/app/design/adminhtml/default/default/skin/default/reset.css +++ b/app/design/adminhtml/default/default/skin/default/reset.css @@ -17,7 +17,7 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /******************************************/ diff --git a/app/design/adminhtml/default/default/theme.xml b/app/design/adminhtml/default/default/theme.xml index 45b319d3a8b63e280ff735f153aefc90c4db34cc..349c67c5c2eedc7978de950a3ebe5d1af76669af 100644 --- a/app/design/adminhtml/default/default/theme.xml +++ b/app/design/adminhtml/default/default/theme.xml @@ -20,7 +20,7 @@ * * @category Magento * @package Design - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/design/frontend/default/default/local.xml b/app/design/frontend/default/default/local.xml index a5104e5d541350b43d4e348e35b5c77d9efcad31..d18da1122073134e517503b128ab9cf4782506bf 100644 --- a/app/design/frontend/default/default/local.xml +++ b/app/design/frontend/default/default/local.xml @@ -21,7 +21,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/design/frontend/default/default/skin/blank/css/print.css b/app/design/frontend/default/default/skin/blank/css/print.css index e482327e08452f1df63e93f6e6a577e18e6c2694..d13dfa76aa9032af33f527933f06c5b222765c16 100644 --- a/app/design/frontend/default/default/skin/blank/css/print.css +++ b/app/design/frontend/default/default/skin/blank/css/print.css @@ -19,7 +19,7 @@ * * @category design * @package default_blank - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/frontend/default/default/skin/blank/css/styles-ie.css b/app/design/frontend/default/default/skin/blank/css/styles-ie.css index d6df618c519730c00849b0426c926128e9119776..4f98d99c62e6c96c787406f2bd83a32ab5b12051 100644 --- a/app/design/frontend/default/default/skin/blank/css/styles-ie.css +++ b/app/design/frontend/default/default/skin/blank/css/styles-ie.css @@ -19,7 +19,7 @@ * * @category design * @package default_blank - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/frontend/default/default/skin/blank/css/styles.css b/app/design/frontend/default/default/skin/blank/css/styles.css index 4d1858ef2706159fe41fd3d44ae22f9e7228e182..f9aceacee1c3a4bcf20a423bc9f505c5ce9c7cb9 100644 --- a/app/design/frontend/default/default/skin/blank/css/styles.css +++ b/app/design/frontend/default/default/skin/blank/css/styles.css @@ -19,7 +19,7 @@ * * @category design * @package default_blank - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ @@ -373,7 +373,7 @@ tr.summary-details-excluded { font-style:italic; } .std ul.disc { list-style:disc outside; padding-left:18px; margin:0 0 10px; } .std dl dt { font-weight:bold; } .std dl dd { margin:0 0 10px; } -/*.std ul, +.std ul, .std ol, .std dl, .std p, @@ -393,7 +393,7 @@ tr.summary-details-excluded { font-style:italic; } .std b, .std strong { font-weight:bold; } .std i, -.std em { font-style:italic; }*/ +.std em { font-style:italic; } /* Misc */ .links li { display:inline; } @@ -1061,6 +1061,27 @@ tr.summary-details-excluded { font-style:italic; } .account-create {} /* Account Login/Create Pages ============================================================ */ +/* Captcha */ +.captcha-note {} +.captcha-image { float:left; position:relative; } +.captcha-img { border:1px solid #ccc; } +.registered-users .captcha-image {} +#checkout-step-login .captcha-image {} +.captcha-reload { position:absolute; top:2px; right:2px;} +.captcha-reload.refreshing { animation:rotate 1.5s infinite linear; -webkit-animation:rotate 1.5s infinite linear; -moz-animation:rotate 1.5s infinite linear; } + +@-webkit-keyframes rotate { + 0% { -webkit-transform:rotate(0); } + 0% { -webkit-transform:rotate(-360deg); } +} +@-moz-keyframes rotate { + 0% { -moz-transform:rotate(0); } + 0% { -moz-transform:rotate(-360deg); } +} +@keyframes rotate { + 0% { transform:rotate(0); } + 0% { transform:rotate(-360deg); } +} /* Remember Me Popup ===================================================================== */ .window-overlay { background:rgba(0, 0, 0, 0.35); position:absolute; top:0; left:0; height:100%; width:100%; z-index:990; } diff --git a/app/design/frontend/default/default/skin/blue/css/styles-ie.css b/app/design/frontend/default/default/skin/blue/css/styles-ie.css index 94cb13e5a43b7b928fd8527ddbe0f7ffdd691f66..a2fe506af82597567a57e362115f3ae78c3729bf 100644 --- a/app/design/frontend/default/default/skin/blue/css/styles-ie.css +++ b/app/design/frontend/default/default/skin/blue/css/styles-ie.css @@ -19,7 +19,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/frontend/default/default/skin/blue/css/styles.css b/app/design/frontend/default/default/skin/blue/css/styles.css index 5df120b046ae3f11f1a0aa86cb0a0fc23a9013b3..1297140c97e7dfec35f2cd13706e981d74d79b4e 100644 --- a/app/design/frontend/default/default/skin/blue/css/styles.css +++ b/app/design/frontend/default/default/skin/blue/css/styles.css @@ -19,7 +19,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ @@ -406,7 +406,7 @@ tr.summary-details-excluded { font-style:italic; } .std ul.disc { list-style:disc outside; padding-left:18px; margin:0 0 10px; } .std dl dt { font-weight:bold; } .std dl dd { margin:0 0 10px; } -/*.std ul, +std ul, .std ol, .std dl, .std p, @@ -426,7 +426,7 @@ tr.summary-details-excluded { font-style:italic; } .std b, .std strong { font-weight:bold; } .std i, -.std em { font-style:italic; }*/ +.std em { font-style:italic; } /* Misc */ .links li { display:inline; } @@ -1407,7 +1407,7 @@ tr.summary-details-excluded { font-style:italic; } /* Account Login/Create Pages ============================================================ */ -.account-login .content { min-height:240px; padding:14px 21px; background:#faf7ee url(../images/bkg_login-box.gif) 0 0 repeat-x; border:1px solid #bbb6a5; border-bottom:0; } +.account-login .content { min-height:345px; padding:14px 21px; background:#faf7ee url(../images/bkg_login-box.gif) 0 0 repeat-x; border:1px solid #bbb6a5; border-bottom:0; } .account-login .content h2 { font-weight:bold; font-size:13px; margin:0 0 14px; padding:0 0 5px 23px; border-bottom:1px solid #ddd; background-position:0 1px; background-repeat:no-repeat; text-transform:uppercase; color:#e76200; } .account-login .new-users h2 { background-image:url(../images/i_page1.gif)} .account-login .registered-users h2 { background-image:url(../images/i_page2.gif); } @@ -1416,6 +1416,26 @@ tr.summary-details-excluded { font-style:italic; } .account-create {} /* Account Login/Create Pages ============================================================ */ +/* Captcha */ +.captcha-note { clear:left; padding-top:5px; } +.captcha-image { float:left; display:inline; margin:0; position:relative; width:258px; } +.captcha-image .captcha-img { border:1px solid #b6b6b6; vertical-align:bottom; width:100%; } +.registered-users .captcha-image { margin:0; } +.captcha-reload { cursor:pointer; position:absolute; top:2px; right:2px;} +.captcha-reload.refreshing { animation:rotate 1.5s infinite linear; -webkit-animation:rotate 1.5s infinite linear; -moz-animation:rotate 1.5s infinite linear; } + +@-webkit-keyframes rotate { + 0% { -webkit-transform:rotate(0); } + 0% { -webkit-transform:rotate(-360deg); } +} +@-moz-keyframes rotate { + 0% { -moz-transform:rotate(0); } + 0% { -moz-transform:rotate(-360deg); } +} +@keyframes rotate { + 0% { transform:rotate(0); } + 0% { transform:rotate(-360deg); } +} /* Remember Me Popup ===================================================================== */ .window-overlay {background:rgba(0, 0, 0, 0.35); position:absolute; top:0; left:0; height:100%; width:100%; z-index:990; } diff --git a/app/design/frontend/default/default/skin/default/css/print.css b/app/design/frontend/default/default/skin/default/css/print.css index cb7f55d533e6daed780a0ae1212bd9b973cd3f0b..7ce27af597312c09acb73c340ea69bddedf4823e 100644 --- a/app/design/frontend/default/default/skin/default/css/print.css +++ b/app/design/frontend/default/default/skin/default/css/print.css @@ -19,7 +19,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/frontend/default/default/skin/default/css/styles-ie.css b/app/design/frontend/default/default/skin/default/css/styles-ie.css index cf56a043df0da5a23143edad723c01fac0236509..efb88a1d12234ae61a253e06e1a2d0dc4ca28928 100644 --- a/app/design/frontend/default/default/skin/default/css/styles-ie.css +++ b/app/design/frontend/default/default/skin/default/css/styles-ie.css @@ -19,7 +19,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/frontend/default/default/skin/default/css/styles.css b/app/design/frontend/default/default/skin/default/css/styles.css index aa4cc247aced8bed30bfebc68e6950de0050671e..94cc5a16f7d9ba634ee56bdfd51fcc42f1d20e66 100644 --- a/app/design/frontend/default/default/skin/default/css/styles.css +++ b/app/design/frontend/default/default/skin/default/css/styles.css @@ -19,7 +19,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ @@ -435,7 +435,7 @@ tr.summary-details-excluded { font-style:italic; } .std ul.disc { list-style:disc outside; padding-left:18px; margin:0 0 10px; } .std dl dt { font-weight:bold; } .std dl dd { margin:0 0 10px; } -/*.std ul, +.std ul, .std ol, .std dl, .std p, @@ -455,7 +455,7 @@ tr.summary-details-excluded { font-style:italic; } .std b, .std strong { font-weight:bold; } .std i, -.std em { font-style:italic; }*/ +.std em { font-style:italic; } /* Misc */ .links li { display:inline; } @@ -1445,15 +1445,34 @@ tr.summary-details-excluded { font-style:italic; } /* Account Login/Create Pages ============================================================ */ -.account-login .content { min-height:240px; padding:14px 21px; background:#faf7ee url(../images/bkg_login-box.gif) 0 0 repeat-x; border:1px solid #bbb6a5; border-bottom:0; } +.account-login .content { min-height:345px; padding:14px 21px; background:#faf7ee url(../images/bkg_login-box.gif) 0 0 repeat-x; border:1px solid #bbb6a5; border-bottom:0; } .account-login .content h2 { font-weight:bold; font-size:13px; margin:0 0 14px; padding:0 0 5px 23px; border-bottom:1px solid #ddd; background-position:0 1px; background-repeat:no-repeat; text-transform:uppercase; color:#e76200; } .account-login .new-users h2 { background-image:url(../images/i_page1.gif)} .account-login .registered-users h2 { background-image:url(../images/i_page2.gif); } .account-login .buttons-set { border:1px solid #bbb6a5; border-top:0; margin:0; padding:8px 13px; background:#dee5e8 url(../images/bkg_buttons-set1.gif) 0 0 repeat-x; } .account-create {} -/* Account Login/Create Pages ============================================================ */ +/* Captcha ================================================================================ */ +.captcha-note { clear:left; padding-top:5px; } +.captcha-image { float:left; display:inline; margin:0; position:relative; width:258px; } +.captcha-image .captcha-img { border:1px solid #b6b6b6; vertical-align:bottom; width:100%; } +.registered-users .captcha-image { margin:0;} +.captcha-reload { cursor:pointer; position:absolute; top:2px; right:2px;} +.captcha-reload.refreshing { animation:rotate 1.5s infinite linear; -webkit-animation:rotate 1.5s infinite linear; -moz-animation:rotate 1.5s infinite linear; } + +@-webkit-keyframes rotate { + 0% { -webkit-transform:rotate(0); } + 0% { -webkit-transform:rotate(-360deg); } +} +@-moz-keyframes rotate { + 0% { -moz-transform:rotate(0); } + 0% { -moz-transform:rotate(-360deg); } +} +@keyframes rotate { + 0% { transform:rotate(0); } + 0% { transform:rotate(-360deg); } +} /* Remember Me Popup ===================================================================== */ .window-overlay { background:rgba(0, 0, 0, 0.35); position:absolute; top:0; left:0; height:100%; width:100%; z-index:990; } diff --git a/app/design/frontend/default/default/theme.xml b/app/design/frontend/default/default/theme.xml index 45b319d3a8b63e280ff735f153aefc90c4db34cc..349c67c5c2eedc7978de950a3ebe5d1af76669af 100644 --- a/app/design/frontend/default/default/theme.xml +++ b/app/design/frontend/default/default/theme.xml @@ -20,7 +20,7 @@ * * @category Magento * @package Design - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/design/frontend/default/iphone/Mage_Bundle/sales/order/items/renderer.phtml b/app/design/frontend/default/iphone/Mage_Bundle/sales/order/items/renderer.phtml index c18e2444e5f5afc2dba60d4638133d0a463c421c..b71b5b2f6d918f13374748cda831508435a1afac 100644 --- a/app/design/frontend/default/iphone/Mage_Bundle/sales/order/items/renderer.phtml +++ b/app/design/frontend/default/iphone/Mage_Bundle/sales/order/items/renderer.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/default/iphone/Mage_Catalog/layer/view.phtml b/app/design/frontend/default/iphone/Mage_Catalog/layer/view.phtml index ecf077e4e3e791871c17f0c75a17dde0ddae1624..9bf8a22920b359594397480761fba482a687a4ed 100644 --- a/app/design/frontend/default/iphone/Mage_Catalog/layer/view.phtml +++ b/app/design/frontend/default/iphone/Mage_Catalog/layer/view.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/default/iphone/Mage_Catalog/layout.xml b/app/design/frontend/default/iphone/Mage_Catalog/layout.xml index 7ca1cf82725edfe61666ac3036455bbbe2a2d1ff..cd75bba4169af2aa44e8b92189e50195641ff577 100644 --- a/app/design/frontend/default/iphone/Mage_Catalog/layout.xml +++ b/app/design/frontend/default/iphone/Mage_Catalog/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package default_iphone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/frontend/default/iphone/Mage_Catalog/navigation/top.phtml b/app/design/frontend/default/iphone/Mage_Catalog/navigation/top.phtml index 01595f708da4b89f63d3a27283a5399b5a409a8a..de8d3510af1c58ced3bffa86c809e78a7a543c2f 100644 --- a/app/design/frontend/default/iphone/Mage_Catalog/navigation/top.phtml +++ b/app/design/frontend/default/iphone/Mage_Catalog/navigation/top.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/default/iphone/Mage_Catalog/product/compare/list.phtml b/app/design/frontend/default/iphone/Mage_Catalog/product/compare/list.phtml index 194ce8f44d977e6f7a0f35362bca9980c42acbaf..9b3f34f051698d1aa2a30ed459741fb903048f0f 100644 --- a/app/design/frontend/default/iphone/Mage_Catalog/product/compare/list.phtml +++ b/app/design/frontend/default/iphone/Mage_Catalog/product/compare/list.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /* @var $this Mage_Catalog_Block_Product_Compare_List */ @@ -30,9 +30,6 @@ $_imageSize = $this->getVar('product_compare_small_image_size', 'Mage_Catalog'); ?> <?php $_total=$this->getItems()->getSize() ?> <?php if($_total): ?> - <div class="compare-back-link"> - <a href="javascript:history.back(1);">Back</a> - </div> <table class="data-table compare-table" id="product_comparison"> <?php $_i=0 ?> <?php foreach($this->getItems() as $_item): ?> @@ -46,14 +43,19 @@ $_imageSize = $this->getVar('product_compare_small_image_size', 'Mage_Catalog'); <?php $_i=0 ?> <?php foreach($this->getItems() as $_item): ?> <?php if($_i++%10==0): ?> - <th> </th> + <th> + <div class="compare-back-link"> + <a href="javascript:history.back(1);">Back</a> + </div> + <a href="#" onclick="removeAll(event, '<?php echo $this->helper('Mage_Catalog_Helper_Product_Compare')->getClearListUrl(); ?>');" class="compare-clear-all">Clear All</a> + </th> <?php endif; ?> <td> <a class="product-image" href="#" onclick="setLocation('<?php echo $this->getProductUrl($_item) ?>', true)" title="<?php echo $this->stripTags($_item->getName(), null, true) ?>"> <img src="<?php echo $this->helper('Mage_Catalog_Helper_Image')->init($_item, 'small_image')->resize($_imageSize); ?>" width="<?php echo $_imageSize ?>" height="<?php echo $_imageSize ?>" alt="<?php echo $this->stripTags($_item->getName(), null, true) ?>" /> </a> <span class="loader" style="display:none;"></span> - <a href="#" class="btn-remove" onclick="removeItem('<?php echo $this->helper('Mage_Catalog_Helper_Product_Compare')->getRemoveUrl($_item) ?>', this);"><img src="<?php echo $this->getSkinUrl('images/btn_trash.png') ?>" height="10" width="10" /></a> + <a href="#" class="btn-remove" onclick="removeItem(event, '<?php echo $this->helper('Mage_Catalog_Helper_Product_Compare')->getRemoveUrl($_item) ?>', this);"><img src="<?php echo $this->getSkinUrl('images/btn_trash.png') ?>" height="10" width="10" /></a> <h2 class="product-name"><a href="#" onclick="setLocation('<?php echo $this->getProductUrl($_item) ?>', true)" title="<?php echo $this->stripTags($_item->getName(), null, true) ?>"><?php echo $this->helper('Mage_Catalog_Helper_Output')->productAttribute($_item, $_item->getName(), 'name') ?></a></h2> <?php echo $this->getReviewsSummaryHtml($_item, 'short') ?> <?php echo $this->getPriceHtml($_item, true, '-compare-list-top') ?> @@ -132,19 +134,79 @@ $_imageSize = $this->getVar('product_compare_small_image_size', 'Mage_Catalog'); </div> <script type="text/javascript"> document.observe("dom:loaded", function() { - $('product_comparison').on('click', 'th', function (e, elem) { - if ( elem.hasClassName('collapsible') ) { - elem.toggleClassName('collapsed'); - } - elem.nextSiblings().each(function (td) { - td.toggleClassName('collapsed'); + (function () { + var compare_table = $('product_comparison'); + + compare_table.on('click', 'th', function (e, elem) { + if ( elem.hasClassName('collapsible') ) { + elem.toggleClassName('collapsed'); + } + elem.nextSiblings().each(function (td) { + td.toggleClassName('collapsed'); + }); }); - }); - $('product_comparison').select('th').each(function(th) { - if ( th.getDimensions().height > 30 && th.down('span') ) { - th.addClassName('collapsible'); + compare_table.select('th').each(function(th) { + if ( th.getDimensions().height > 30 && th.down('span') ) { + th.addClassName('collapsible'); + } + }); + + if ( compare_table.select('.product-shop-row td').length > 1 ) { + + compare_table.select('.product-shop-row td').each(function (td) { + td.insert({ 'top' : new Element('span', { 'class' : 'move-right' }) }); + td.insert({ 'top' : new Element('span', { 'class' : 'move-left' }) }); + }); + compare_table.on('click', '.move-right', function (e, elem) { + var index = elem.up('td').cellIndex + 1; + compare_table.select('tr td:nth-child(' + index + ')').each(function (td) { + if ( td.next() ) { + //td.addClassName('move-right-animation'); + //td.next().addClassName('move-left-animation'); + var clone = td.clone(true); + td.next().setStyle({ 'webkitTransform' : 'translate3d(100%, 0, 0)' }).addClassName('moved-left').insert({ after : clone.setStyle({ 'webkitTransform' : 'translate3d(-100%, 0, 0)' }).addClassName('moved-right') }); + td.remove(); + + setTimeout(function () { + $$('.moved-right').invoke('addClassName', 'move-right-animation-scale'); + $$('.moved-left').invoke('addClassName', 'move-left-animation'); + }, 1); + } + }); + compare_table.addClassName('hide-controls'); + }); + + compare_table.on('webkitTransitionEnd', 'td', function(e, elem) { + elem.writeAttribute('style', ''); + var classArray = elem.classNames().toArray(); + for (var index = 0, len = classArray.size(); index < len; ++index) { + if(classArray[index] !== 'collapsed'){ + elem.removeClassName(classArray[index]); + } + } + compare_table.removeClassName('hide-controls'); + }) + + compare_table.on('click', '.move-left', function (e, elem) { + var index = elem.up('td').cellIndex + 1; + compare_table.select('tr td:nth-child(' + index + ')').each(function (td) { + if ( td.previous() && td.previous().cellIndex !== 0 ) { + var clone = td.clone(true); + td.previous().setStyle({ 'webkitTransform' : 'translate3d(-100%, 0, 0)' }).addClassName('moved-right').insert({ before : clone.setStyle({ 'webkitTransform' : 'translate3d(100%, 0, 0)' }).addClassName('moved-left') }); + td.remove(); + + setTimeout(function () { + $$('.moved-right').invoke('addClassName', 'move-right-animation'); + $$('.moved-left').invoke('addClassName', 'move-left-animation-scale'); + }, 1); + } + }); + compare_table.addClassName('hide-controls'); + }); + } - }); + + }()); }); @@ -164,8 +226,8 @@ $_imageSize = $this->getVar('product_compare_small_image_size', 'Mage_Catalog'); /** * Send remove item request, after that reload windows */ - function removeItem (url, item) - { + function removeItem (e, url, item) { + e.preventDefault(); new Ajax.Request(url, { parameters: {isAjax: 1, method: 'POST'}, onLoading: function() { @@ -176,11 +238,24 @@ $_imageSize = $this->getVar('product_compare_small_image_size', 'Mage_Catalog'); }, onFailure: item.show() }); + } + + function removeAll (e, url) { + e.preventDefault(); + new Ajax.Request(url, { + parameters: {isAjax: 1, method: 'POST'}, + onLoading: function() { + }, + onSuccess: function() { + window.location.href = document.referrer; + } + }); } + </script> <?php else: ?> <script type="text/javascript"> window.location.href = document.referrer; </script> -<?php endif; ?> \ No newline at end of file +<?php endif; ?> diff --git a/app/design/frontend/default/iphone/Mage_Catalog/product/compare/sidebar.phtml b/app/design/frontend/default/iphone/Mage_Catalog/product/compare/sidebar.phtml index 542b4acdd88c574ab37312c691765aa7e7f018a5..1befcfc2460759e39c8684e93d5270158ffe2a9e 100644 --- a/app/design/frontend/default/iphone/Mage_Catalog/product/compare/sidebar.phtml +++ b/app/design/frontend/default/iphone/Mage_Catalog/product/compare/sidebar.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /* @var $this Mage_Catalog_Block_Product_Compare_Sidebar */ diff --git a/app/design/frontend/default/iphone/Mage_Catalog/product/gallery.phtml b/app/design/frontend/default/iphone/Mage_Catalog/product/gallery.phtml index 8a6b7d0dffca50d6a5cb808e9476ee862a1eb2c7..2e6adceb1bfb6a1fc3fd8e967750ec8774f2ec22 100644 --- a/app/design/frontend/default/iphone/Mage_Catalog/product/gallery.phtml +++ b/app/design/frontend/default/iphone/Mage_Catalog/product/gallery.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/default/iphone/Mage_Catalog/product/list.phtml b/app/design/frontend/default/iphone/Mage_Catalog/product/list.phtml index 62c8545629467539786c930f870c172888e405e9..d841a112317571106cb667cf7958af4ecb11982f 100644 --- a/app/design/frontend/default/iphone/Mage_Catalog/product/list.phtml +++ b/app/design/frontend/default/iphone/Mage_Catalog/product/list.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/default/iphone/Mage_Catalog/product/list/toolbar.phtml b/app/design/frontend/default/iphone/Mage_Catalog/product/list/toolbar.phtml index f3742d93474f2dad6163565f565882f90436356c..e07735a8b20ae6f82ca303c517f6971fd20b65dd 100644 --- a/app/design/frontend/default/iphone/Mage_Catalog/product/list/toolbar.phtml +++ b/app/design/frontend/default/iphone/Mage_Catalog/product/list/toolbar.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/default/iphone/Mage_Catalog/product/list/upsell.phtml b/app/design/frontend/default/iphone/Mage_Catalog/product/list/upsell.phtml index 2555c9073ae3dfccf79df28d6f27dc603667035f..9c0df625992b9e1980f1c5f6948de98802a0d0b5 100644 --- a/app/design/frontend/default/iphone/Mage_Catalog/product/list/upsell.phtml +++ b/app/design/frontend/default/iphone/Mage_Catalog/product/list/upsell.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/default/iphone/Mage_Catalog/product/price.phtml b/app/design/frontend/default/iphone/Mage_Catalog/product/price.phtml index 4ba806ea1dab7d3c46a140bd086f97c60c96df75..8c72c060514f785beef67143c5620d8ce920e49d 100644 --- a/app/design/frontend/default/iphone/Mage_Catalog/product/price.phtml +++ b/app/design/frontend/default/iphone/Mage_Catalog/product/price.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/default/iphone/Mage_Catalog/product/view.phtml b/app/design/frontend/default/iphone/Mage_Catalog/product/view.phtml index 34fe4d9208028e075de49d95555633bc059ad099..52fe51a1e336caf329854254ab2ca88e150b60f5 100644 --- a/app/design/frontend/default/iphone/Mage_Catalog/product/view.phtml +++ b/app/design/frontend/default/iphone/Mage_Catalog/product/view.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ @@ -120,7 +120,7 @@ try { var originalImg = $$('.product-image-wrap .product-image img')[0]; originalImg.up('.product-image-wrap').insert(originalImg.clone().addClassName('cloned')); - setTimeout(function () {$$('.cloned')[0].addClassName('animate');}, 1); + setTimeout(function () {$$('.cloned')[0].setStyle({'webkitTransform' : 'translate3d(' + (document.body.offsetWidth - 190) + 'px, -150px, 2px) scale(0) rotate(200deg)'});}, 1); $$('.product-image-wrap .cloned')[0].observe('webkitTransitionEnd', function(e) { this.form.submit(); }.bind(this)); diff --git a/app/design/frontend/default/iphone/Mage_Catalog/product/view/addto.phtml b/app/design/frontend/default/iphone/Mage_Catalog/product/view/addto.phtml index 53bca847d2ad5ed6bae7d2e10674ec81a1845bb8..7a29901d5100ec436baafe41ada66d9699a3440f 100644 --- a/app/design/frontend/default/iphone/Mage_Catalog/product/view/addto.phtml +++ b/app/design/frontend/default/iphone/Mage_Catalog/product/view/addto.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/default/iphone/Mage_Catalog/product/view/addtocart.phtml b/app/design/frontend/default/iphone/Mage_Catalog/product/view/addtocart.phtml index 19095baf3074f05957d694caccfc8432a381bb81..86bb545e5aa890b707e1f93cf365444e1dacc128 100644 --- a/app/design/frontend/default/iphone/Mage_Catalog/product/view/addtocart.phtml +++ b/app/design/frontend/default/iphone/Mage_Catalog/product/view/addtocart.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/default/iphone/Mage_Catalog/product/view/addtowishlist.phtml b/app/design/frontend/default/iphone/Mage_Catalog/product/view/addtowishlist.phtml index afaf9576bd7f8b1f6be67406a41b73f602fa6e08..2761933d8c07d528a566004f9f15e40fae1f5f03 100644 --- a/app/design/frontend/default/iphone/Mage_Catalog/product/view/addtowishlist.phtml +++ b/app/design/frontend/default/iphone/Mage_Catalog/product/view/addtowishlist.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_iphone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/frontend/default/iphone/Mage_Catalog/product/view/media.phtml b/app/design/frontend/default/iphone/Mage_Catalog/product/view/media.phtml index 516eb740efdb227f41d844dce6d5341497c6bcf1..8b2a813bdf57b8b4ee817441b5aa52624d1bdf36 100644 --- a/app/design/frontend/default/iphone/Mage_Catalog/product/view/media.phtml +++ b/app/design/frontend/default/iphone/Mage_Catalog/product/view/media.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/frontend/default/iphone/Mage_Catalog/product/view/type/grouped.phtml b/app/design/frontend/default/iphone/Mage_Catalog/product/view/type/grouped.phtml index 221f139bcbe870a4c2486b3227e96a796a3504ab..0c9772677bc47c2b3383b8470b871b73e201b8a1 100644 --- a/app/design/frontend/default/iphone/Mage_Catalog/product/view/type/grouped.phtml +++ b/app/design/frontend/default/iphone/Mage_Catalog/product/view/type/grouped.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/frontend/default/iphone/Mage_Catalog/product/view/type/grouped_grid.phtml b/app/design/frontend/default/iphone/Mage_Catalog/product/view/type/grouped_grid.phtml index c1ae86e9222049e2293a9ecae1a54680e72d0768..361fc7e2adb6d2f119b4eaa4fbd00242a7e325d3 100644 --- a/app/design/frontend/default/iphone/Mage_Catalog/product/view/type/grouped_grid.phtml +++ b/app/design/frontend/default/iphone/Mage_Catalog/product/view/type/grouped_grid.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/default/iphone/Mage_CatalogSearch/form.mini.phtml b/app/design/frontend/default/iphone/Mage_CatalogSearch/form.mini.phtml index 3113f0cccbedda28b921cec77b9cef0d98e28569..7526290880cdb78e49ba7554126b4a82ca5a1b08 100644 --- a/app/design/frontend/default/iphone/Mage_CatalogSearch/form.mini.phtml +++ b/app/design/frontend/default/iphone/Mage_CatalogSearch/form.mini.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_iphone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/default/iphone/Mage_CatalogSearch/layout.xml b/app/design/frontend/default/iphone/Mage_CatalogSearch/layout.xml index 799f767ca5484c3334916b57e0f76795a8c91fb6..6e4a0223922d42348cab8dc884cd9c04eab3fd20 100644 --- a/app/design/frontend/default/iphone/Mage_CatalogSearch/layout.xml +++ b/app/design/frontend/default/iphone/Mage_CatalogSearch/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/frontend/default/iphone/Mage_CatalogSearch/result.phtml b/app/design/frontend/default/iphone/Mage_CatalogSearch/result.phtml index b2993fde8382f0f30865eec19d019e75cec553ab..f8c4c77c9f7cd5fdb5184a9812dda6baabaee90e 100644 --- a/app/design/frontend/default/iphone/Mage_CatalogSearch/result.phtml +++ b/app/design/frontend/default/iphone/Mage_CatalogSearch/result.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/default/iphone/Mage_Checkout/cart.phtml b/app/design/frontend/default/iphone/Mage_Checkout/cart.phtml index 24a5c34d3317a2004587a35c28311ec317d4cf35..8ac6063ab720ab186b78c4777917ab217f6ce881 100644 --- a/app/design/frontend/default/iphone/Mage_Checkout/cart.phtml +++ b/app/design/frontend/default/iphone/Mage_Checkout/cart.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_iphone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/default/iphone/Mage_Checkout/cart/item/default.phtml b/app/design/frontend/default/iphone/Mage_Checkout/cart/item/default.phtml index ef00e5e88f5c66ef4f9534200862ad9c7928b1fb..1a148553a18b5fdb6339ffc5f21b19d2baf3155a 100644 --- a/app/design/frontend/default/iphone/Mage_Checkout/cart/item/default.phtml +++ b/app/design/frontend/default/iphone/Mage_Checkout/cart/item/default.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_iphone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/default/iphone/Mage_Checkout/cart/no_items_header.phtml b/app/design/frontend/default/iphone/Mage_Checkout/cart/no_items_header.phtml index 94cd3283462fc21560e5eda53ffbdc64e3e3faf8..71fea202f44754e72ebd166bc0fdf2727e7f0a83 100644 --- a/app/design/frontend/default/iphone/Mage_Checkout/cart/no_items_header.phtml +++ b/app/design/frontend/default/iphone/Mage_Checkout/cart/no_items_header.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/default/iphone/Mage_Checkout/cart/sidebar.phtml b/app/design/frontend/default/iphone/Mage_Checkout/cart/sidebar.phtml index 9a41522d1109146481bdac5ca930cfa4888a4950..99c569716b9b3f8b8605ad8c07dc49bef6053f31 100644 --- a/app/design/frontend/default/iphone/Mage_Checkout/cart/sidebar.phtml +++ b/app/design/frontend/default/iphone/Mage_Checkout/cart/sidebar.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/frontend/default/iphone/Mage_Checkout/cartheader.phtml b/app/design/frontend/default/iphone/Mage_Checkout/cartheader.phtml index e24bc648f8f2ff942707dcf2152b7a490ab409e4..6b0e05aae1440d6fe5ebc6ee0bababebed7665fe 100644 --- a/app/design/frontend/default/iphone/Mage_Checkout/cartheader.phtml +++ b/app/design/frontend/default/iphone/Mage_Checkout/cartheader.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_iphone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/default/iphone/Mage_Checkout/layout.xml b/app/design/frontend/default/iphone/Mage_Checkout/layout.xml index 71ceea539f830e2e4370c2ce0a9488d748384a7a..2a460daabe763f0676745df3580a5db7cbbe8215 100644 --- a/app/design/frontend/default/iphone/Mage_Checkout/layout.xml +++ b/app/design/frontend/default/iphone/Mage_Checkout/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package default_iphone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/frontend/default/iphone/Mage_Checkout/onepage/login.phtml b/app/design/frontend/default/iphone/Mage_Checkout/onepage/login.phtml index 5770289776a9510f78743e7e0ee3bae1ac2599ed..cede25986c288885b8674b641f428750af777dcf 100644 --- a/app/design/frontend/default/iphone/Mage_Checkout/onepage/login.phtml +++ b/app/design/frontend/default/iphone/Mage_Checkout/onepage/login.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -79,6 +79,7 @@ <input type="password" class="input-text required-entry" id="login-password" name="login[password]" /> </div> </li> + <?php echo $this->getChildHtml('form.additional.info'); ?> </ul> </fieldset> </form> diff --git a/app/design/frontend/default/iphone/Mage_Cms/layout.xml b/app/design/frontend/default/iphone/Mage_Cms/layout.xml index d2b586fb2622842b465fed9ebac0ccf45cd74e9d..924ccff79ea7f5003e093347a93e56bc84ee12e1 100644 --- a/app/design/frontend/default/iphone/Mage_Cms/layout.xml +++ b/app/design/frontend/default/iphone/Mage_Cms/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/design/frontend/default/iphone/Mage_Contacts/layout.xml b/app/design/frontend/default/iphone/Mage_Contacts/layout.xml index 5dadc86e94e2abb5fe219cadbfa4f7acd9269910..18e811c5137b269688dd90130ed861d9b16024b8 100644 --- a/app/design/frontend/default/iphone/Mage_Contacts/layout.xml +++ b/app/design/frontend/default/iphone/Mage_Contacts/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/design/frontend/default/iphone/Mage_Customer/form/edit.phtml b/app/design/frontend/default/iphone/Mage_Customer/form/edit.phtml index 91f23f9a835988a3506fa3b90d088307062b90d1..f33ebbfeb4eea7414c5b501311db9e843ecca629 100644 --- a/app/design/frontend/default/iphone/Mage_Customer/form/edit.phtml +++ b/app/design/frontend/default/iphone/Mage_Customer/form/edit.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/default/iphone/Mage_Customer/form/forgotpassword.phtml b/app/design/frontend/default/iphone/Mage_Customer/form/forgotpassword.phtml index 2868d68ae23f098e567e1c3e5028a81c50691cc2..9f143a8a18abd3bfe6f14051adbd17e75a071db2 100644 --- a/app/design/frontend/default/iphone/Mage_Customer/form/forgotpassword.phtml +++ b/app/design/frontend/default/iphone/Mage_Customer/form/forgotpassword.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_iphone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/default/iphone/Mage_Customer/form/login.phtml b/app/design/frontend/default/iphone/Mage_Customer/form/login.phtml index f2438b0cd5d262adc49322b0a9927b14b2af657a..6aa88f55b9fe0eb71a7abf4d893ca4ff5c32a262 100644 --- a/app/design/frontend/default/iphone/Mage_Customer/form/login.phtml +++ b/app/design/frontend/default/iphone/Mage_Customer/form/login.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_iphone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -46,6 +46,7 @@ <label for="pass"><?php echo $this->__('Enter your password') ?>:</label> <input type="password" class="required-entry validate-password" name="login[password]" id="pass" placeholder="<?php echo $this->__('Password') ?>" /> </li> + <?php echo $this->getChildHtml('form.additional.info'); ?> </ul> <a href="<?php echo $this->getForgotPasswordUrl() ?>"><?php echo $this->__('Forgot your password?') ?></a> <div class="login-button"> diff --git a/app/design/frontend/default/iphone/Mage_Customer/form/register.phtml b/app/design/frontend/default/iphone/Mage_Customer/form/register.phtml index b71f965edb9d26ef1a7688a9c020e0531f9adf5d..02bea7ac036f688602aa354d4cc8d103071ec098 100644 --- a/app/design/frontend/default/iphone/Mage_Customer/form/register.phtml +++ b/app/design/frontend/default/iphone/Mage_Customer/form/register.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -160,6 +160,7 @@ <label for="confirmation"><?php echo $this->__('Confirm password') ?>:</label> <input type="password" name="confirmation" id="confirmation" class="required-entry validate-cpassword" placeholder="<?php echo $this->__('Confirm Password') ?>" /> </li> + <?php echo $this->getChildHtml('form.additional.info'); ?> </ul> <a href="<?php echo $this->escapeUrl($this->getBackUrl()) ?>"><?php echo $this->__('Back') ?></a> <input type="submit" value="<?php echo $this->__('Create') ?>" /> diff --git a/app/design/frontend/default/iphone/Mage_Customer/layout.xml b/app/design/frontend/default/iphone/Mage_Customer/layout.xml index a5d32aed54b4ba3bad25446cf3bb85228408e489..73366b4c43ce70c29089d79a12d7a0de936a4002 100644 --- a/app/design/frontend/default/iphone/Mage_Customer/layout.xml +++ b/app/design/frontend/default/iphone/Mage_Customer/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package default_iphone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ @@ -263,4 +263,4 @@ Customer account address edit page </reference> </customer_address_form> -</layout> +</layout> \ No newline at end of file diff --git a/app/design/frontend/default/iphone/Mage_Page/1column.phtml b/app/design/frontend/default/iphone/Mage_Page/1column.phtml index 0ff5cce312aa93ef7da547c98908bc75f26cd4ba..e2e6d84c91256e842ed4157a06c09779cebdb1ca 100644 --- a/app/design/frontend/default/iphone/Mage_Page/1column.phtml +++ b/app/design/frontend/default/iphone/Mage_Page/1column.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_iphone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/default/iphone/Mage_Page/html/footer.phtml b/app/design/frontend/default/iphone/Mage_Page/html/footer.phtml index 9719e392dc99b35924601c791078c57fa17834a8..267a560dbc6bd70bf5510cb9de1d2ec8baa1732e 100644 --- a/app/design/frontend/default/iphone/Mage_Page/html/footer.phtml +++ b/app/design/frontend/default/iphone/Mage_Page/html/footer.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_iphone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/default/iphone/Mage_Page/html/head.phtml b/app/design/frontend/default/iphone/Mage_Page/html/head.phtml index 93a23f810021c733ba603fb9ac39b559c7668d3f..89e3bf1e45132e36217b65a6451bc62f26bbea0a 100644 --- a/app/design/frontend/default/iphone/Mage_Page/html/head.phtml +++ b/app/design/frontend/default/iphone/Mage_Page/html/head.phtml @@ -20,13 +20,13 @@ * * @category design * @package default_iphone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> <title><?php echo $this->getTitle() ?></title> <meta charset="UTF-8"> -<meta name = "viewport" content = "initial-scale = 1, maximum-scale = 1, user-scalable = no"> +<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"> <meta name="description" content="<?php echo htmlspecialchars($this->getDescription()) ?>" /> <meta name="keywords" content="<?php echo htmlspecialchars($this->getKeywords()) ?>" /> <meta name="robots" content="<?php echo htmlspecialchars($this->getRobots()) ?>" /> diff --git a/app/design/frontend/default/iphone/Mage_Page/html/header.phtml b/app/design/frontend/default/iphone/Mage_Page/html/header.phtml index facc5c12d6c63b032bea933401433e5f1f1f9aa7..ab52bb9d36ca584fc7144f6f48cb8f460fca3200 100644 --- a/app/design/frontend/default/iphone/Mage_Page/html/header.phtml +++ b/app/design/frontend/default/iphone/Mage_Page/html/header.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_iphone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /** diff --git a/app/design/frontend/default/iphone/Mage_Page/html/pager.phtml b/app/design/frontend/default/iphone/Mage_Page/html/pager.phtml index d4a7fd538b45fffd8d6531fa3ec5754455c87edc..c355747833f945485fd08c0b30c5abc43acfa362 100644 --- a/app/design/frontend/default/iphone/Mage_Page/html/pager.phtml +++ b/app/design/frontend/default/iphone/Mage_Page/html/pager.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/default/iphone/Mage_Page/layout.xml b/app/design/frontend/default/iphone/Mage_Page/layout.xml index 04ac5bb1845e0574e46c508fe94dac57227e765b..2dd4e0dfe5a370070cbf228f60b15060326ebd19 100644 --- a/app/design/frontend/default/iphone/Mage_Page/layout.xml +++ b/app/design/frontend/default/iphone/Mage_Page/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package default_iphone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/design/frontend/default/iphone/Mage_Page/switch/languages.phtml b/app/design/frontend/default/iphone/Mage_Page/switch/languages.phtml index a4e0ab1a1af3f87ccb7c5286ec58f3a567e35afd..6694bbf1a6c223cd4c6504a416b327d4561d3aa8 100644 --- a/app/design/frontend/default/iphone/Mage_Page/switch/languages.phtml +++ b/app/design/frontend/default/iphone/Mage_Page/switch/languages.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/default/iphone/Mage_Page/switch/stores.phtml b/app/design/frontend/default/iphone/Mage_Page/switch/stores.phtml index 992457716f774eb48190a2a9e4bc6d7cb8fd04cb..b18573aa23a080df3e571d334bef4e3f7273c0c4 100644 --- a/app/design/frontend/default/iphone/Mage_Page/switch/stores.phtml +++ b/app/design/frontend/default/iphone/Mage_Page/switch/stores.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/default/iphone/Mage_Persistent/checkout/onepage/login.phtml b/app/design/frontend/default/iphone/Mage_Persistent/checkout/onepage/login.phtml index 69f7ac4fc942100cc80b78993d24ffd06c511956..a3cf012887b763585831a176374f0e7fb90777fd 100644 --- a/app/design/frontend/default/iphone/Mage_Persistent/checkout/onepage/login.phtml +++ b/app/design/frontend/default/iphone/Mage_Persistent/checkout/onepage/login.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -53,6 +53,7 @@ <input type="password" class="input-text required-entry" id="login-password" name="login[password]" /> </div> </li> + <?php echo $this->getChildHtml('form.additional.info'); ?> <?php echo $this->getChildHtml('persistent.remember.me'); ?> </ul> <input name="context" type="hidden" value="checkout" /> diff --git a/app/design/frontend/default/iphone/Mage_Persistent/customer/form/login.phtml b/app/design/frontend/default/iphone/Mage_Persistent/customer/form/login.phtml index 9f98d14c0e7d1aa12d0685893c431d7990f28aae..25ee9b1d37c85ce50713f3d000dd069271a51f81 100644 --- a/app/design/frontend/default/iphone/Mage_Persistent/customer/form/login.phtml +++ b/app/design/frontend/default/iphone/Mage_Persistent/customer/form/login.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_iphone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -55,6 +55,7 @@ <label for="pass" class="required"><?php echo $this->__('Password') ?></label> <input type="password" name="login[password]" class="input-text required-entry validate-password" id="pass" title="<?php echo $this->__('Password') ?>" /> </li> + <?php echo $this->getChildHtml('form.additional.info'); ?> <?php echo $this->getChildHtml('persistent.remember.me'); ?> </ul> <?php echo $this->getChildHtml('persistent.remember.me.tooltip'); ?><a href="<?php echo $this->getForgotPasswordUrl() ?>"><?php echo $this->__('Forgot your password?') ?></a> diff --git a/app/design/frontend/default/iphone/Mage_Persistent/customer/form/register.phtml b/app/design/frontend/default/iphone/Mage_Persistent/customer/form/register.phtml index dd7da50d83e2e57d12c14a1e32771e5eb4d00450..ce0ca885db91cdbb08aa84af9e0ef837de5646b9 100644 --- a/app/design/frontend/default/iphone/Mage_Persistent/customer/form/register.phtml +++ b/app/design/frontend/default/iphone/Mage_Persistent/customer/form/register.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -164,6 +164,7 @@ <label for="confirmation"><?php echo $this->__('Confirm Password') ?></label> <input type="password" name="confirmation" title="<?php echo $this->__('Confirm Password') ?>" id="confirmation" class="input-text required-entry validate-cpassword" /> </li> + <?php echo $this->getChildHtml('form.additional.info'); ?> <?php echo $this->getChildHtml('persistent.remember.me'); ?> </ul> <input type="submit" value="<?php echo $this->__('Submit') ?>" /> diff --git a/app/design/frontend/default/iphone/Mage_Persistent/layout.xml b/app/design/frontend/default/iphone/Mage_Persistent/layout.xml index 2d7d079a7c61f6cbb6b21f5c83c3f75312e9960e..96732d460b101f6a949517cd3877f1227234e444 100644 --- a/app/design/frontend/default/iphone/Mage_Persistent/layout.xml +++ b/app/design/frontend/default/iphone/Mage_Persistent/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package default_iphone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/design/frontend/default/iphone/Mage_Review/layout.xml b/app/design/frontend/default/iphone/Mage_Review/layout.xml index 254c5f6c174ee8d4963ffd294f2f09d5fba9ac89..e78c5d71f32bdc266294cb974ba2ccc8d9c9e624 100644 --- a/app/design/frontend/default/iphone/Mage_Review/layout.xml +++ b/app/design/frontend/default/iphone/Mage_Review/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package default_iphone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/frontend/default/iphone/Mage_Sales/order/history.phtml b/app/design/frontend/default/iphone/Mage_Sales/order/history.phtml index 9ab60555a954392802ec93b6d1b918369b81f018..eb38f82e98458b63ecebbf1cdefd04f5ceb93a5c 100644 --- a/app/design/frontend/default/iphone/Mage_Sales/order/history.phtml +++ b/app/design/frontend/default/iphone/Mage_Sales/order/history.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_iphone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/default/iphone/Mage_Sales/order/items.phtml b/app/design/frontend/default/iphone/Mage_Sales/order/items.phtml index d4d110eed7c55a90afb63c5ad5b667283453deeb..632b2c1a61253cf7122e18fe4f264e6e5d6ff660 100644 --- a/app/design/frontend/default/iphone/Mage_Sales/order/items.phtml +++ b/app/design/frontend/default/iphone/Mage_Sales/order/items.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/default/iphone/Mage_Sales/order/recent.phtml b/app/design/frontend/default/iphone/Mage_Sales/order/recent.phtml index f930d3e65ef4b2d3c16cf4689021908f3985ae66..36aa40b80b7ff7f95013afc89bd571729e2b3222 100644 --- a/app/design/frontend/default/iphone/Mage_Sales/order/recent.phtml +++ b/app/design/frontend/default/iphone/Mage_Sales/order/recent.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_iphone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/default/iphone/Mage_Sales/order/totals.phtml b/app/design/frontend/default/iphone/Mage_Sales/order/totals.phtml index 10ad108319f6617580f394ac58b4129f98fd4979..b4c2112353951463776f85fdaeda8de19b51efc3 100644 --- a/app/design/frontend/default/iphone/Mage_Sales/order/totals.phtml +++ b/app/design/frontend/default/iphone/Mage_Sales/order/totals.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /** diff --git a/app/design/frontend/default/iphone/Mage_Sendfriend/layout.xml b/app/design/frontend/default/iphone/Mage_Sendfriend/layout.xml index 5042315e4ab7e266230c345ac7f78a316c822499..0bd3ca88fef879f82f193d3ee639424ad3960e12 100644 --- a/app/design/frontend/default/iphone/Mage_Sendfriend/layout.xml +++ b/app/design/frontend/default/iphone/Mage_Sendfriend/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/design/frontend/default/iphone/Mage_Sendfriend/send.phtml b/app/design/frontend/default/iphone/Mage_Sendfriend/send.phtml index 6bd065783193dc0f9cf954c0b2c680ce6ab7ab1e..5d02f145a958ff8672ff4cd1fb6c8eadfd1dd2ac 100644 --- a/app/design/frontend/default/iphone/Mage_Sendfriend/send.phtml +++ b/app/design/frontend/default/iphone/Mage_Sendfriend/send.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /* @var $this Mage_Sendfriend_Block_Send */ diff --git a/app/design/frontend/default/iphone/Mage_Shipping/tracking/ajax.phtml b/app/design/frontend/default/iphone/Mage_Shipping/tracking/ajax.phtml index 5fded9cea371d1366dec1eba5c3cf6313dd0f36e..fed14d7732dcbbff36d0e721a7d414285d80be67 100644 --- a/app/design/frontend/default/iphone/Mage_Shipping/tracking/ajax.phtml +++ b/app/design/frontend/default/iphone/Mage_Shipping/tracking/ajax.phtml @@ -20,6 +20,6 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ \ No newline at end of file diff --git a/app/design/frontend/default/iphone/Mage_Shipping/tracking/popup.phtml b/app/design/frontend/default/iphone/Mage_Shipping/tracking/popup.phtml index a136d9a3f4d7f3500ec0278e5753951ca8548eb2..892cb69a05d5b9f66703b940a6822d97a257627b 100644 --- a/app/design/frontend/default/iphone/Mage_Shipping/tracking/popup.phtml +++ b/app/design/frontend/default/iphone/Mage_Shipping/tracking/popup.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_iphone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/default/iphone/Mage_Tag/layout.xml b/app/design/frontend/default/iphone/Mage_Tag/layout.xml index 868ded54b276fe00b3192f7f479ad325dc4b273c..507175ef3f7664c936e404c3269cd6dcaca5a80a 100644 --- a/app/design/frontend/default/iphone/Mage_Tag/layout.xml +++ b/app/design/frontend/default/iphone/Mage_Tag/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package default_iphone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/frontend/default/iphone/Mage_Tag/list.phtml b/app/design/frontend/default/iphone/Mage_Tag/list.phtml index 1292a86ae9cf9813b9b48334d946240cc650c6ee..65f4b758b5d7a60a45c2087ff3a1f60eeb8a8a05 100644 --- a/app/design/frontend/default/iphone/Mage_Tag/list.phtml +++ b/app/design/frontend/default/iphone/Mage_Tag/list.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/default/iphone/Mage_Wishlist/view.phtml b/app/design/frontend/default/iphone/Mage_Wishlist/view.phtml index ad30bc2066f7765ae8c7fa237f50f576991c98d1..b8cbbfc5b5e1ee0cba41fc431a61aa6a3aee7d9f 100644 --- a/app/design/frontend/default/iphone/Mage_Wishlist/view.phtml +++ b/app/design/frontend/default/iphone/Mage_Wishlist/view.phtml @@ -20,7 +20,7 @@ * * @category design * @package base_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /* @var $this Mage_Wishlist_Block_Customer_Wishlist */ diff --git a/app/design/frontend/default/iphone/local.xml b/app/design/frontend/default/iphone/local.xml index 3199c69890e7f18fc1b5063dada7cc25367f9a7a..7f457881f73ce5a59604746320fc535d2c248592 100644 --- a/app/design/frontend/default/iphone/local.xml +++ b/app/design/frontend/default/iphone/local.xml @@ -21,7 +21,7 @@ * * @category design * @package default_iphone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/design/frontend/default/iphone/skin/default/css/iphone.css b/app/design/frontend/default/iphone/skin/default/css/iphone.css index aad0703eeac23108f5ec36a03836cdcc5361fc6a..14bd89ffb94f3cacbbceb0442155857691d5b161 100644 --- a/app/design/frontend/default/iphone/skin/default/css/iphone.css +++ b/app/design/frontend/default/iphone/skin/default/css/iphone.css @@ -19,7 +19,7 @@ * * @category design * @package default_iphone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ @@ -46,6 +46,23 @@ h2 { font-size:12px; font-weight:normal; line-height:20px; } legend { display:none; } +.messages .notice-msg, +.messages .success-msg { + background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #FFE38D), color-stop(100%, #FFD040)); + padding:10px; + color:#222; + font-weight:bold; + text-shadow:0 1px 0 #eee; + -webkit-box-shadow:0 3px 3px #ccc; +} +.messages .success-msg { + background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #62c462), color-stop(100%, #57a957)); + border:solid #3D773D; + border-width:1px 0; + color:#fff; + text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25); + margin-bottom:10px; +} /* Header -----------------------------*/ @@ -228,7 +245,7 @@ body > header dt.search > a { background-image:url(../images/i_menu_search.png); background-position:18px 10px; background-repeat:no-repeat; - text-indent:-99000px; + text-indent:-999em; } body > header dt.cart:before, @@ -252,7 +269,7 @@ body > header dt.cart > span:first-child { background-image:url(../images/i_menu_cart.png); background-position:center 10px; background-repeat:no-repeat; - text-indent:-99000px; + text-indent:-999em; } body > header dt.active span:first-child { margin:-1px -6px -7px; @@ -593,7 +610,7 @@ select { border-radius:2px; color:#333; font-size:15px; - padding:3px 20px 3px 7px; + padding:3px 30px 3px 7px; -webkit-appearance:none; -webkit-box-sizing:border-box; } @@ -1009,7 +1026,7 @@ section .category-title { display:none; } display:inline-block; vertical-align:middle; top:-2px; - text-indent:-9999px; + text-indent:-999em; margin-right:2px; } @@ -1124,7 +1141,7 @@ section .category-title { display:none; } position:relative; height:27px; width:27px; - text-indent:-9999px; + text-indent:-999em; -webkit-box-shadow:0 0 5px rgba(0, 0, 0, 0.15); -webkit-background-clip:padding-box; } @@ -1466,27 +1483,7 @@ section .category-title { display:none; } /* Product Info Box -----------------------------*/ -.catalog-product-view .messages { - margin:0 -10px 0; -} -.catalog-product-view .messages .notice-msg { - background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #FFE38D), color-stop(100%, #FFD040)); - padding:10px; - color:#222; - font-weight:bold; - text-shadow:0 1px 0 #eee; -} -.catalog-product-view .messages .success-msg { - background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #62c462), color-stop(100%, #57a957)); - border:solid #3D773D; - border-width:1px 0; - color:#fff; - font-weight:bold; - text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25); - margin-bottom:10px; - padding:10px; - -webkit-box-shadow:0 3px 3px #ccc; -} +.catalog-product-view .messages { margin:0 -10px 0; } .product-view { padding:0 0 0; } .product-shop { padding:8px 0 0; } .product-shop .product-image-and-actions { float:left; margin:0 10px 0 0; } @@ -1506,10 +1503,7 @@ section .category-title { display:none; } z-index:1; } .product-shop .product-image-wrap img { -webkit-border-radius:1px; -webkit-box-shadow:0 0 3px #D1D1D1; -webkit-transition:-webkit-transform ease-in 300ms; position:relative; } -.product-shop .product-image-wrap img.animate { -webkit-transform:translate3d(100%,-150px,1px) scale(0) rotate(200deg); z-index:1000; } -@media (orientation: landscape) { - .product-shop .product-image-wrap img.animate { -webkit-transform:translate3d(310px,-150px,1px) scale(0) rotate(200deg); } -} +.product-shop .product-image-wrap img.animate { z-index:101; } .product-shop .product-image-wrap img.cloned { position:absolute; top:0; left:0; } .product-shop .product-image .carousel-items li { padding:2px 2px 0; } .product-shop .product-image .more-views { padding:3px 0 0 0; } @@ -1535,7 +1529,9 @@ section .category-title { display:none; } .product-essential .availability span { font-weight:normal; } .product-essential .product-options dt label { font-size:14px; font-weight:bold; } .product-essential .product-options dt label em { float:left; margin:0 4px 0 0; color:#F9721F; } -.product-essential .product-options dd { border-bottom:1px dotted #555; margin:0 0 10px; padding:0 0 10px; } +.product-essential .product-options dd { border-bottom:1px solid #bbb; padding:0 0 10px; } +.product-essential .product-options dd + dt { border-top:1px solid rgba(255, 255, 255, 0.75); padding:10px 0 0; } +.product-essential .product-options dd:last-child { border:none; } .product-essential .product-options select { width:100%; } .product-essential .product-options input[type=text] { font-size:12px; width:20%; } .product-essential .product-options input[type=text]:disabled { background:#ddd; } @@ -1559,7 +1555,7 @@ section .category-title { display:none; } .product-shop .product-desc .ratings { overflow:hidden; } .product-shop .product-desc .ratings, .product-shop .product-desc .ratings a { color:#FB6B36; } -.rating-box { width:75px; height:15px; margin:3px 0; } +.rating-box { background:url(../images/i_star_black.png) repeat-x center left; background-size:15px 15px; width:75px; height:15px; margin:3px 0; } .rating-box .rating { height:15px; background:url(../images/i_star.png) repeat-x center left; background-size:15px 15px; } .product-shop .product-options-bottom .price-box { font-size:14px; font-weight:bold; text-align:right; } @@ -1754,13 +1750,11 @@ section .category-title { display:none; } .compare-back-link { - position:fixed; - top:0; - left:0; - right:0; - padding:5px 5px 5px 20px; + position:absolute; + padding:0 0 0 10px; z-index:10; } +.compare-clear-all, .compare-back-link a { background:-webkit-gradient(linear, 0 0, 0 100%, from(#ddd), to(#eee)); color:#000; @@ -1774,6 +1768,18 @@ section .category-title { display:none; } z-index:4; -webkit-transform:scale(0.95); } +.compare-clear-all { + color:#fff; + background:-webkit-gradient(linear, left top, left bottom, color-stop(0%,#f85032), color-stop(50%,#f16f5c), color-stop(51%,#f6290c), color-stop(71%,#f02f17), color-stop(100%,#e73827)); + border:1px solid #777; + border-radius:5px; + display:inline-block; + font-weight:normal; + padding:5px 10px; + margin-left:60px; + position:static; + text-shadow:0 1px 0 #000; +} .compare-back-link:before { content:''; background:-webkit-gradient(linear, 0 0, 0 100%, from(#ddd), to(#eee)); @@ -1781,18 +1787,57 @@ section .category-title { display:none; } height:18px; width:18px; position:absolute; - top:10px; - left:11px; + top:5px; + left:1px; -webkit-transform:rotate(45deg) scale(1.001); z-index:3; } -.compare-table { border-collapse:collapse; border-spacing:0; table-layout:fixed; } +.compare-table { border-collapse:collapse; border-spacing:0; table-layout:fixed; -webkit-backface-visibility:hidden; } .compare-table th, -.compare-table td { border:1px solid #ccc; padding:5px 15px; vertical-align:top; } +.compare-table td { background:#fff; border:1px solid #ccc; padding:5px 15px; vertical-align:top; } .compare-table td a { color:#fb6b36; } .compare-table th { background:url(../images/fabric.jpg) repeat; border:none; -webkit-box-shadow:inset -3px 0 3px -3px #ccc; text-shadow:1px 1px 1px #fff; text-align:left; position:relative; padding:5px 10px 5px 10px; } .compare-table tr:nth-child(even) td { background:#f6f6f6; } +.compare-table .move-left, +.compare-table .move-right { + background:-webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#eee)); + border:1px solid #c4c4c4; + border-radius:5px; + display:inline-block; + padding:5px 10px; + position:relative; + height:16px; + width:10px; + -webkit-box-shadow:0 0 2px rgba(0, 0, 0, 0.15); +} +.compare-table .move-left:after, +.compare-table .move-right:after { content:''; position:absolute; top:8px; z-index:2; font-size:0; line-height:0; width:0; } +.compare-table .move-left:after { border-top:5px solid transparent; border-right:10px solid #888; border-bottom:5px solid transparent; right:11px; } +.compare-table .move-right:after { border-top:5px solid transparent; border-left:10px solid #888; border-bottom:5px solid transparent; left:11px; } +.compare-table .move-right { + float:right; +} +.compare-table.hide-controls .moved-right .move-right, +.compare-table.hide-controls .moved-right .move-left, +.compare-table.hide-controls .moved-left .move-right, +.compare-table.hide-controls .moved-left .move-left { + visibility:hidden; +} .compare-table .nobr { display:block; padding:1px 20px 1px 10px; white-space:nowrap; position:relative; text-shadow:1px 1px 0 #fff; } +.compare-table .product-shop-row td:last-child .move-right, +.compare-table .product-shop-row td:nth-child(2) .move-left { visibility:hidden; } +.compare-table .product-shop-row td:only-of-type .move-left, +.compare-table .product-shop-row td:only-of-type .move-right { display:none; } +.compare-table .move-right-animation, +.compare-table .move-left-animation { + -webkit-transition:-webkit-transform 300ms linear; + -webkit-transform:translate3d(0, 0, -5px) !important; +} +.compare-table .move-right-animation-scale, +.compare-table .move-left-animation-scale { + -webkit-transition:-webkit-transform 300ms linear; + -webkit-transform:translate3d(0, 0, 5px) !important; +} .compare-table .collapsible .nobr { background:-webkit-gradient(linear, 0 0, 0 100%, from(#f6f6f6), to(#bbb)); border:1px solid #aaa; border-radius:7px; -webkit-box-shadow:inset 0 1px 3px rgba(0, 0, 0, 0.15), 0 1px 0 #fff; } .compare-table .collapsible .nobr:active, .compare-table .collapsible.collapsed .nobr { background:-webkit-gradient(linear, 0 0, 0 100%, from(#ddd), to(#ccc)); } @@ -1828,6 +1873,7 @@ section .category-title { display:none; } -webkit-box-shadow:0 3px 3px 0 #9F9F9F; -webkit-background-clip:padding-box; } +.compare-table .btn-remove { -webkit-transform:translate3d(0, 0, 0); } .compare-table .product-image { background:#fff; display:inline-block; margin:4px 0 10px; padding:3px; position:relative; border:1px solid #ccc; -webkit-box-shadow:0 1px 2px #ccc; text-align:center; } .compare-table .product-image img {} .compare-table .loader { background:url(../images/loader.gif) no-repeat center rgba(0, 0, 0, 0.05); background-size:20px 20px; float:right; height:20px; width:20px; } @@ -2557,6 +2603,7 @@ section .category-title { display:none; } -webkit-background-clip:padding-box; } .wishlist-wrap { position:relative; } +.wishlist-wrap.grouped-items #wishlist-list li { min-height:initial; position:static; } .wishlist-wrap .remove-all { display:none; top:12px; right:10px; } .wishlist-index-index .my-account > a { display:none; } @@ -2594,24 +2641,6 @@ section .category-title { display:none; } .checkout-cart-index .messages { margin:0 -10px 0 !important; } -.checkout-cart-index .messages .notice-msg, -.checkout-cart-index .messages .success-msg, -.my-account .messages .success-msg { - background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #FFE38D), color-stop(100%, #FFD040)); - padding:10px; - color:#222; - font-weight:bold; - text-shadow:0 1px 0 #eee; -} -.checkout-cart-index .messages .success-msg, -.my-account .messages .success-msg { - background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #62c462), color-stop(100%, #57a957)); - border:solid #3D773D; - border-width:1px 0; - color:#fff; - text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25); - margin-bottom:10px; -} .checkout-onepage-index .page-title { background:-webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#ccc)); border:solid #999; border-width:1px 0; border-top-color:#ccc; margin:0 -10px 10px; padding:10px; } #checkoutSteps { margin:-7px; padding:0; list-style:none; -webkit-box-shadow:3px -3px 2px 0 #F0F0F0; color:#636363; } @@ -2770,11 +2799,12 @@ section .category-title { display:none; } -----------------------------*/ .contacts-index-index .page-title { display:none; } .contacts-index-index .fieldset h2 { display:none; } +.contacts-index-index .messages { margin:0 -10px 0; } .contacts-index-index form { display:block; border:1px solid #D1D1D1; margin:2px -7px -7px; padding:9px; border-radius:2px 2px 5px 5px; background:-webkit-gradient(linear, 0 0, 0 100%,color-stop(0, #FCFDFD), color-stop(0.8, #EEEEEE), color-stop(1, #E8E9E9)); } -.contacts-index-index textarea { width:99%; height:200px; } -.contacts-index-index .fields .field { margin:0 0 8px 0; } .contacts-index-index label { color:#5E5E5E; font-weight:bold; } .contacts-index-index label em { margin:0 3px 0 0; color:#F4641E; } +.contacts-index-index textarea { width:99%; height:200px; } +.contacts-index-index .fields .field { margin:0 0 8px 0; } .contacts-index-index .buttons-set .required { float:right; font-size:12px; font-weight:bold; color:#F4641E; } .contacts-index-index .buttons-set button { padding:5px 10px; background:-webkit-gradient(linear, 0 0, 0 100%, from(#F39823), to(#F37221)); font-size:12px; color:#FFF; border:1px solid #FFF; border-radius:5px; -webkit-box-shadow:0 3px 3px 0 #9F9F9F; } diff --git a/app/design/frontend/default/iphone/skin/default/images/i_star_black.png b/app/design/frontend/default/iphone/skin/default/images/i_star_black.png new file mode 100644 index 0000000000000000000000000000000000000000..eba185915410f4311e72bd22a25cd5e520f94e44 Binary files /dev/null and b/app/design/frontend/default/iphone/skin/default/images/i_star_black.png differ diff --git a/app/design/frontend/default/iphone/skin/default/js/iphone.js b/app/design/frontend/default/iphone/skin/default/js/iphone.js index 080da6fc83edf964fe4f82fa8bedaa65ceac1975..84d0e46a9031a186bf260e4447638e100a9318cf 100644 --- a/app/design/frontend/default/iphone/skin/default/js/iphone.js +++ b/app/design/frontend/default/iphone/skin/default/js/iphone.js @@ -19,7 +19,7 @@ * * @category design * @package default_iphone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ @@ -51,8 +51,11 @@ document.observe("dom:loaded", function() { }); } + + var supportsOrientationChange = "onorientationchange" in window, + orientationEvent = supportsOrientationChange ? "orientationchange" : "resize"; - Event.observe(window, 'orientationchange', function() { + Event.observe(window, orientationEvent, function() { var orientation, page; @@ -72,23 +75,25 @@ document.observe("dom:loaded", function() { if ( $('nav-container') ) { - $$("#nav-container ul").each(function(ul) { - ul.setStyle({'width' : document.body.offsetWidth + "px"}); - }); - - page = Math.floor(Math.abs(sliderPosition/viewportWidth)); - sliderPosition = (sliderPosition + viewportWidth*page) - document.body.offsetWidth*page; - viewportWidth = document.body.offsetWidth; - - $("nav-container").setStyle({"-webkit-transform" : "translate3d(" + sliderPosition + "px, 0, 0)"}); + setTimeout(function () { + $$("#nav-container ul").each(function(ul) { + ul.setStyle({'width' : document.body.offsetWidth + "px"}); + }); + + page = Math.floor(Math.abs(sliderPosition/viewportWidth)); + sliderPosition = (sliderPosition + viewportWidth*page) - document.body.offsetWidth*page; + viewportWidth = document.body.offsetWidth; + + $("nav-container").setStyle({"-webkit-transform" : "translate3d(" + sliderPosition + "px, 0, 0)"}); - if ( upSellCarousel ) { - if (orientation === 'landscape') { - upSellCarousel.resize(3); - } else { - upSellCarousel.resize(2); + if ( upSellCarousel ) { + if (orientation === 'landscape') { + upSellCarousel.resize(3); + } else { + upSellCarousel.resize(2); + } } - } + }, 400); } diff --git a/app/design/frontend/default/iphone/theme.xml b/app/design/frontend/default/iphone/theme.xml index 10e73d61a592dea0a7022682d59f88e2956f71c6..e4fb26c28bd869755bdc4dcfc004352e25aa24bd 100644 --- a/app/design/frontend/default/iphone/theme.xml +++ b/app/design/frontend/default/iphone/theme.xml @@ -20,7 +20,7 @@ * * @category Magento * @package Design - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/design/frontend/default/iphone/view.xml b/app/design/frontend/default/iphone/view.xml index 40bceb48c57f08ecf6b564ed147664dc95ea68a1..d22ed102437b60a2bf0c89877b5f81f24c1b0935 100644 --- a/app/design/frontend/default/iphone/view.xml +++ b/app/design/frontend/default/iphone/view.xml @@ -21,7 +21,7 @@ * * @category Mage * @package modern_theme - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/design/frontend/default/modern/Mage_Catalog/layout.xml b/app/design/frontend/default/modern/Mage_Catalog/layout.xml index 4e481032f5a714a90d010bd8f8e670decb99ff8d..c9bc531de0f50c27eda992568d51f596d2c60175 100644 --- a/app/design/frontend/default/modern/Mage_Catalog/layout.xml +++ b/app/design/frontend/default/modern/Mage_Catalog/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package default_modern - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/frontend/default/modern/Mage_Catalog/product/list.phtml b/app/design/frontend/default/modern/Mage_Catalog/product/list.phtml index 1ea8c58b3c267302dbffb7ecfe52f2a8d6b6a4a0..788d41db2e11c28fc5eb71d24e310a5710ff5866 100644 --- a/app/design/frontend/default/modern/Mage_Catalog/product/list.phtml +++ b/app/design/frontend/default/modern/Mage_Catalog/product/list.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_modern - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/default/modern/Mage_Catalog/product/list/upsell.phtml b/app/design/frontend/default/modern/Mage_Catalog/product/list/upsell.phtml index a578afa85ebc92359bc208d6fc2368808e1c26e1..76ed77fa6072e935b08148b3a21ab2f9f29ae012 100644 --- a/app/design/frontend/default/modern/Mage_Catalog/product/list/upsell.phtml +++ b/app/design/frontend/default/modern/Mage_Catalog/product/list/upsell.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_modern - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/default/modern/Mage_Catalog/product/view.phtml b/app/design/frontend/default/modern/Mage_Catalog/product/view.phtml index 34983dd8b9f2103c95525c744d483171f2442e5e..36eb9b9db444c79da393a0fb9511624f10dd4b75 100644 --- a/app/design/frontend/default/modern/Mage_Catalog/product/view.phtml +++ b/app/design/frontend/default/modern/Mage_Catalog/product/view.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_modern - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/frontend/default/modern/Mage_Catalog/product/view/media.phtml b/app/design/frontend/default/modern/Mage_Catalog/product/view/media.phtml index f1347d716b955956dab6794e2fad3147d1201ba6..05108f38ce7604c45b53ea1a4560d74881017403 100644 --- a/app/design/frontend/default/modern/Mage_Catalog/product/view/media.phtml +++ b/app/design/frontend/default/modern/Mage_Catalog/product/view/media.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_modern - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/frontend/default/modern/Mage_Catalog/product/view/tabs.phtml b/app/design/frontend/default/modern/Mage_Catalog/product/view/tabs.phtml index b9693992f18e15de396e16ed06a05bedcfd06d34..ca88182f1c642fe6cb3199cb17d4c4a2cfc71d48 100644 --- a/app/design/frontend/default/modern/Mage_Catalog/product/view/tabs.phtml +++ b/app/design/frontend/default/modern/Mage_Catalog/product/view/tabs.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_modern - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/frontend/default/modern/Mage_CatalogSearch/form.mini.phtml b/app/design/frontend/default/modern/Mage_CatalogSearch/form.mini.phtml index 8c5cb9a75d8ed17234f0122ed73465fd84782abd..507a9522c0b3ee37ce275ecd840b1410c286397f 100644 --- a/app/design/frontend/default/modern/Mage_CatalogSearch/form.mini.phtml +++ b/app/design/frontend/default/modern/Mage_CatalogSearch/form.mini.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_modern - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/default/modern/Mage_CatalogSearch/layout.xml b/app/design/frontend/default/modern/Mage_CatalogSearch/layout.xml index 9654cfe8f4971e5bae8158f9ae1b7b1be9061264..73073969cab31244b2ffee36b975e6f624843611 100644 --- a/app/design/frontend/default/modern/Mage_CatalogSearch/layout.xml +++ b/app/design/frontend/default/modern/Mage_CatalogSearch/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package default_modern - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/frontend/default/modern/Mage_Checkout/cart.phtml b/app/design/frontend/default/modern/Mage_Checkout/cart.phtml index 2e04c6854c57c821b2d55fa92ce61e8030dc042f..646b7e82c295f6dbdad09702db6dbb5a75ad70cf 100644 --- a/app/design/frontend/default/modern/Mage_Checkout/cart.phtml +++ b/app/design/frontend/default/modern/Mage_Checkout/cart.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_modern - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -99,7 +99,8 @@ <?php if($this->getContinueShoppingUrl()): ?> <button type="button" title="<?php echo $this->__('Continue Shopping') ?>" class="button btn-continue" onclick="setLocation('<?php echo $this->getContinueShoppingUrl() ?>')"><span><span><?php echo $this->__('Continue Shopping') ?></span></span></button> <?php endif; ?> - <button type="submit" title="<?php echo $this->__('Update Shopping Cart') ?>" class="button btn-update"><span><span><?php echo $this->__('Update Shopping Cart') ?></span></span></button> + <button type="submit" name="update_cart_action" value="empty_cart" title="<?php echo $this->__('Clear Shopping Cart'); ?>" class="button btn-update"><span><span><?php echo $this->__('Clear Shopping Cart'); ?></span></span></button> + <button type="submit" name="update_cart_action" value="update_qty" title="<?php echo $this->__('Update Shopping Cart'); ?>" class="button btn-update" style="margin-left: 5px;"><span><span><?php echo $this->__('Update Shopping Cart'); ?></span></span></button> </td> </tr> </tfoot> diff --git a/app/design/frontend/default/modern/Mage_Checkout/layout.xml b/app/design/frontend/default/modern/Mage_Checkout/layout.xml index 0b4e1682de97e9e2071e8ad1a56baf2186faf776..ad1bb5e20931498afbb8acc5c5328b75fdc3d95d 100644 --- a/app/design/frontend/default/modern/Mage_Checkout/layout.xml +++ b/app/design/frontend/default/modern/Mage_Checkout/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package default_modern - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/frontend/default/modern/Mage_Contacts/layout.xml b/app/design/frontend/default/modern/Mage_Contacts/layout.xml index f3af686bb425173503f3555d36bbf095fa124412..a6798c446ac4545a89019f64f27cebb06e30f9fd 100644 --- a/app/design/frontend/default/modern/Mage_Contacts/layout.xml +++ b/app/design/frontend/default/modern/Mage_Contacts/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package default_modern - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/design/frontend/default/modern/Mage_Customer/layout.xml b/app/design/frontend/default/modern/Mage_Customer/layout.xml index 61073ddef783a03067beac0ad7bcfb2d302862b1..d38b2f7268d6d5d8147894bcc59d5d8f2e7d9708 100644 --- a/app/design/frontend/default/modern/Mage_Customer/layout.xml +++ b/app/design/frontend/default/modern/Mage_Customer/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package default_modern - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ @@ -262,4 +262,4 @@ Customer account address edit page </reference> </customer_address_form> -</layout> +</layout> \ No newline at end of file diff --git a/app/design/frontend/default/modern/Mage_Newsletter/layout.xml b/app/design/frontend/default/modern/Mage_Newsletter/layout.xml index 8675ae7bd560e5994a42786d13eb8114fe6a1e15..26944eaa61d7361026713e03c9717793ced14fc8 100644 --- a/app/design/frontend/default/modern/Mage_Newsletter/layout.xml +++ b/app/design/frontend/default/modern/Mage_Newsletter/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package default_modern - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/frontend/default/modern/Mage_Newsletter/subscribe.phtml b/app/design/frontend/default/modern/Mage_Newsletter/subscribe.phtml index c020b50ca7d720c69cecd55b7c1392448d6eed61..123d60f881721728635f42608047dd02c396c92d 100644 --- a/app/design/frontend/default/modern/Mage_Newsletter/subscribe.phtml +++ b/app/design/frontend/default/modern/Mage_Newsletter/subscribe.phtml @@ -20,14 +20,15 @@ * * @category design * @package default_modern - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> <form action="<?php echo $this->getFormActionUrl() ?>" method="post" id="newsletter-validate-detail"> <div class="form-subscribe"> - <div class="form-subscribe-header"><?php echo $this->__('Sign up for our newsletter') ?></div> - <label for="newsletter"><?php echo $this->__('Newsletter Sign-up:') ?></label> + <div class="form-subscribe-header"> + <label for="newsletter"><?php echo $this->__('Newsletter Sign-up:') ?></label> + </div> <div class="input-box"> <input type="text" name="email" id="newsletter" title="<?php echo $this->__('Sign up for our newsletter') ?>" class="input-text required-entry validate-email" /> </div> diff --git a/app/design/frontend/default/modern/Mage_Page/3columns.phtml b/app/design/frontend/default/modern/Mage_Page/3columns.phtml index aa8a272082a36899519651ed9a0a28ab149696c8..1cba8f16a47718e1eea852446d80f1eaa4474b56 100644 --- a/app/design/frontend/default/modern/Mage_Page/3columns.phtml +++ b/app/design/frontend/default/modern/Mage_Page/3columns.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_modern - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/default/modern/Mage_Page/html/footer.phtml b/app/design/frontend/default/modern/Mage_Page/html/footer.phtml index 8b1791b093cc0a00ba84750eeb12f8dfa35956e9..87e491aba3d43a5a0540bdee15d78fe316f6b0d5 100644 --- a/app/design/frontend/default/modern/Mage_Page/html/footer.phtml +++ b/app/design/frontend/default/modern/Mage_Page/html/footer.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_modern - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/app/design/frontend/default/modern/Mage_Page/html/header.phtml b/app/design/frontend/default/modern/Mage_Page/html/header.phtml index d4aa6b4ffab6161f394e27eaa2cbf84b84000a8e..b9588f15d9e275155fa6b7bb78c24f486e88eb12 100644 --- a/app/design/frontend/default/modern/Mage_Page/html/header.phtml +++ b/app/design/frontend/default/modern/Mage_Page/html/header.phtml @@ -20,7 +20,7 @@ * * @category design * @package default_modern - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /** diff --git a/app/design/frontend/default/modern/Mage_Page/layout.xml b/app/design/frontend/default/modern/Mage_Page/layout.xml index 20d2fd8126accfc9b3c3fc082689a401017f5870..264ee3815c5d47a9c18a85e95ea3df374dae70bd 100644 --- a/app/design/frontend/default/modern/Mage_Page/layout.xml +++ b/app/design/frontend/default/modern/Mage_Page/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package default_modern - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/design/frontend/default/modern/Mage_Payment/layout.xml b/app/design/frontend/default/modern/Mage_Payment/layout.xml index f8b282b00ed9d19ba23ee816f59568cc376fca48..d9142e4c1961e80fe5d1ed856c635f1448d1ee74 100644 --- a/app/design/frontend/default/modern/Mage_Payment/layout.xml +++ b/app/design/frontend/default/modern/Mage_Payment/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package default_modern - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/frontend/default/modern/Mage_Persistent/layout.xml b/app/design/frontend/default/modern/Mage_Persistent/layout.xml index 4f993e32ecfb046d74e150cac8afb96e8bf4b0c5..fcd528af940aa431d987a1e9d706cc2f76186fbb 100644 --- a/app/design/frontend/default/modern/Mage_Persistent/layout.xml +++ b/app/design/frontend/default/modern/Mage_Persistent/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package default_modern - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/design/frontend/default/modern/Mage_Review/layout.xml b/app/design/frontend/default/modern/Mage_Review/layout.xml index 164a3f2a27460f8db74c952ce285635e0f3e9fcd..5d74aa94c124a3980d223b764f4ad6e71316b89f 100644 --- a/app/design/frontend/default/modern/Mage_Review/layout.xml +++ b/app/design/frontend/default/modern/Mage_Review/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package default_modern - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/frontend/default/modern/Mage_Rss/layout.xml b/app/design/frontend/default/modern/Mage_Rss/layout.xml index cada63a5e7334777cd5b85244e4ed2ef57e7615b..8568f092c1057963e3c32179e8bac9c7e66adaed 100644 --- a/app/design/frontend/default/modern/Mage_Rss/layout.xml +++ b/app/design/frontend/default/modern/Mage_Rss/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package default_modern - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/design/frontend/default/modern/Mage_Sales/layout.xml b/app/design/frontend/default/modern/Mage_Sales/layout.xml index 148cf032157d6206a2bb7fef036439a35e9ac5ff..7fd68aae47674844b68f1d42699116a724b8a53b 100644 --- a/app/design/frontend/default/modern/Mage_Sales/layout.xml +++ b/app/design/frontend/default/modern/Mage_Sales/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package default_modern - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/frontend/default/modern/Mage_Sendfriend/layout.xml b/app/design/frontend/default/modern/Mage_Sendfriend/layout.xml index 00eb476f015149e8a677f3c83f229d37165da7fb..befd58dd9c4e8b74a8f4d5415406d2b5339c05e6 100644 --- a/app/design/frontend/default/modern/Mage_Sendfriend/layout.xml +++ b/app/design/frontend/default/modern/Mage_Sendfriend/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package default_modern - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/design/frontend/default/modern/Mage_Tag/layout.xml b/app/design/frontend/default/modern/Mage_Tag/layout.xml index 2e9ce7190f95d4ec5e136891404a6316d736704c..b91487556ea0b521f4ee1fef3324f7a520c79d54 100644 --- a/app/design/frontend/default/modern/Mage_Tag/layout.xml +++ b/app/design/frontend/default/modern/Mage_Tag/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package default_modern - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/frontend/default/modern/Mage_Wishlist/layout.xml b/app/design/frontend/default/modern/Mage_Wishlist/layout.xml index 8aa887e295912296f343e9062a570f2d814ccad3..76d8ec45ea3db486b76b6f4367fe47a3647b5526 100644 --- a/app/design/frontend/default/modern/Mage_Wishlist/layout.xml +++ b/app/design/frontend/default/modern/Mage_Wishlist/layout.xml @@ -21,7 +21,7 @@ * * @category design * @package default_modern - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/frontend/default/modern/skin/default/Mage_Catalog/widgets.css b/app/design/frontend/default/modern/skin/default/Mage_Catalog/widgets.css index db0e81e65ddae7276900475b4b276be7d6df6afa..9b6ea5090371d278ef0fc637c2e3491f502259a7 100644 --- a/app/design/frontend/default/modern/skin/default/Mage_Catalog/widgets.css +++ b/app/design/frontend/default/modern/skin/default/Mage_Catalog/widgets.css @@ -19,7 +19,7 @@ * * @category design * @package default_modern - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/frontend/default/modern/skin/default/Mage_Cms/widgets.css b/app/design/frontend/default/modern/skin/default/Mage_Cms/widgets.css index 007a3c31d8458e8b2cdd8fc3eb9435cbf147bbe3..c0ff60a27978767b4f7871bde9d9d88ddcf1227e 100644 --- a/app/design/frontend/default/modern/skin/default/Mage_Cms/widgets.css +++ b/app/design/frontend/default/modern/skin/default/Mage_Cms/widgets.css @@ -19,7 +19,7 @@ * * @category design * @package default_modern - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/frontend/default/modern/skin/default/Mage_Reports/widgets.css b/app/design/frontend/default/modern/skin/default/Mage_Reports/widgets.css index 3f64eb0124fa4c576ed7c545164b5af7d6eb6fe5..ca30335c181b564d949dcb2ec32f90b375cd2847 100644 --- a/app/design/frontend/default/modern/skin/default/Mage_Reports/widgets.css +++ b/app/design/frontend/default/modern/skin/default/Mage_Reports/widgets.css @@ -19,7 +19,7 @@ * * @category design * @package default_modern - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/frontend/default/modern/skin/default/css/print.css b/app/design/frontend/default/modern/skin/default/css/print.css index 18f420a5acbf7764d0c1d8a677797c6db1af097a..900cbbead7dbb953cc9a2f077195155a5a76ff8d 100644 --- a/app/design/frontend/default/modern/skin/default/css/print.css +++ b/app/design/frontend/default/modern/skin/default/css/print.css @@ -19,7 +19,7 @@ * * @category design * @package default_modern - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/frontend/default/modern/skin/default/css/styles-ie.css b/app/design/frontend/default/modern/skin/default/css/styles-ie.css index f6741d6427f8d91c6f90ec13a96c718ae60022f7..1f32591a6b36c31b497d20506f1e9b228b6a5216 100644 --- a/app/design/frontend/default/modern/skin/default/css/styles-ie.css +++ b/app/design/frontend/default/modern/skin/default/css/styles-ie.css @@ -19,7 +19,7 @@ * * @category design * @package default_modern - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/frontend/default/modern/skin/default/css/styles.css b/app/design/frontend/default/modern/skin/default/css/styles.css index cc1b34b7c3420dd857c2bf2f121cdda75ccedbd5..f66070fca801d51b92a684b9ce357a0a5b5d2b1d 100644 --- a/app/design/frontend/default/modern/skin/default/css/styles.css +++ b/app/design/frontend/default/modern/skin/default/css/styles.css @@ -19,7 +19,7 @@ * * @category design * @package default_modern - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ @@ -400,7 +400,7 @@ tr.summary-details-excluded { font-style:italic; } .std ul.disc { list-style:disc outside; padding-left:18px; margin:0 0 10px; } .std dl dt { font-weight:bold; } .std dl dd { margin:0 0 10px; } -/*.std ul, +.std ul, .std ol, .std dl, .std p, @@ -420,7 +420,7 @@ tr.summary-details-excluded { font-style:italic; } .std b, .std strong { font-weight:bold; } .std i, -.std em { font-style:italic; }*/ +.std em { font-style:italic; } /* Misc */ .links li { display:inline; } @@ -1399,6 +1399,26 @@ f/********** Product Prices > */ .account-create {} /* Account Login/Create Pages ============================================================ */ +/* Captcha */ +.captcha-note { clear:left; padding-top:5px; } +.captcha-image { float:left; display:inline; margin:0; position:relative; width:258px; } +.captcha-image .captcha-img { border:1px solid #b6b6b6; vertical-align:bottom; width:100%; } +.registered-users .captcha-image { margin:0; } +.captcha-reload { cursor:pointer; position:absolute; top:2px; right:2px; } +.captcha-reload.refreshing { animation:rotate 1.5s infinite linear; -webkit-animation:rotate 1.5s infinite linear; -moz-animation:rotate 1.5s infinite linear; } + +@-webkit-keyframes rotate { + 0% { -webkit-transform:rotate(0); } + 0% { -webkit-transform:rotate(-360deg); } +} +@-moz-keyframes rotate { + 0% { -moz-transform:rotate(0); } + 0% { -moz-transform:rotate(-360deg); } +} +@keyframes rotate { + 0% { transform:rotate(0); } + 0% { transform:rotate(-360deg); } +} /* Remember Me Popup ===================================================================== */ .window-overlay { background:rgba(0, 0, 0, 0.35); position:absolute; top:0; left:0; height:100%; width:100%; z-index:990; } diff --git a/app/design/frontend/default/modern/theme.xml b/app/design/frontend/default/modern/theme.xml index 9dff831d0e405324d165cc4f19ba6dfa572f2bd9..f0eb3e8985c21f30f4b7f5f2996729391cb3aeb7 100644 --- a/app/design/frontend/default/modern/theme.xml +++ b/app/design/frontend/default/modern/theme.xml @@ -20,7 +20,7 @@ * * @category Magento * @package Design - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/design/frontend/default/modern/view.xml b/app/design/frontend/default/modern/view.xml index 79417b93ee2a3aa9395a073d59f334def74f7f6d..07af45fdb5e15c43c7db14298791db8e862afe12 100644 --- a/app/design/frontend/default/modern/view.xml +++ b/app/design/frontend/default/modern/view.xml @@ -21,7 +21,7 @@ * * @category Mage * @package modern_theme - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/design/install/default/default/skin/default/css/boxes.css b/app/design/install/default/default/skin/default/css/boxes.css index da6d1cd346c9cd4c6009c9e3eb0e7070e04fc43a..a74adeb850a3f34bea48d6c8c288b90921b77942 100644 --- a/app/design/install/default/default/skin/default/css/boxes.css +++ b/app/design/install/default/default/skin/default/css/boxes.css @@ -17,7 +17,7 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/install/default/default/skin/default/css/clears.css b/app/design/install/default/default/skin/default/css/clears.css index a685e4e8182689261ce4b7315788f3b7e486e0fa..808db1458dcdac789ed90f2995871376ad6761f9 100644 --- a/app/design/install/default/default/skin/default/css/clears.css +++ b/app/design/install/default/default/skin/default/css/clears.css @@ -17,7 +17,7 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/install/default/default/skin/default/css/ie7minus.css b/app/design/install/default/default/skin/default/css/ie7minus.css index 269cbac2968d16fb3d142ce6500194afdb58396b..bae36ec0c4c8090e45451a5d7e77c43debf7758c 100644 --- a/app/design/install/default/default/skin/default/css/ie7minus.css +++ b/app/design/install/default/default/skin/default/css/ie7minus.css @@ -17,7 +17,7 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/design/install/default/default/skin/default/css/iestyles.css b/app/design/install/default/default/skin/default/css/iestyles.css index 787d27112ba3172fe41fa2789c82cfd580bae2f4..106a0989e3f033d2b28e330bbe5e2eb56cb35400 100644 --- a/app/design/install/default/default/skin/default/css/iestyles.css +++ b/app/design/install/default/default/skin/default/css/iestyles.css @@ -17,7 +17,7 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ .col2-set, diff --git a/app/design/install/default/default/skin/default/css/reset.css b/app/design/install/default/default/skin/default/css/reset.css index a27b0154ccfde9674ee108d17d2b964fd0b9ddb7..737af5617c328895e2c2b8a36c3b7b7804754182 100644 --- a/app/design/install/default/default/skin/default/css/reset.css +++ b/app/design/install/default/default/skin/default/css/reset.css @@ -17,7 +17,7 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /******************************************/ diff --git a/app/design/install/default/default/theme.xml b/app/design/install/default/default/theme.xml index 45b319d3a8b63e280ff735f153aefc90c4db34cc..349c67c5c2eedc7978de950a3ebe5d1af76669af 100644 --- a/app/design/install/default/default/theme.xml +++ b/app/design/install/default/default/theme.xml @@ -20,7 +20,7 @@ * * @category Magento * @package Design - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/etc/config.xml b/app/etc/config.xml index a3c1df60677917eee7de614c5963691fe3cd0605..29a04117569089425c21f7378e57979d7c68b996 100644 --- a/app/etc/config.xml +++ b/app/etc/config.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/etc/local.xml.additional b/app/etc/local.xml.additional index d2f4cc7812d73624745f3a5786ba7074b08dd955..169c11fc2a9729d6f002b42466c8195b5b8375fc 100644 --- a/app/etc/local.xml.additional +++ b/app/etc/local.xml.additional @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/etc/local.xml.template b/app/etc/local.xml.template index 5b64224770db85fb3a48c549f470eadea75f4c43..59666ca03245aac62820ef5d3db1d83d213c89d9 100644 --- a/app/etc/local.xml.template +++ b/app/etc/local.xml.template @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/etc/modules/Mage_All.xml b/app/etc/modules/Mage_All.xml index ae5d4823e5ce0ea5aabb840e4d5461d469bdbb22..36f71f0e2490efa7f7a01b3c54948662eabdd13e 100644 --- a/app/etc/modules/Mage_All.xml +++ b/app/etc/modules/Mage_All.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Core - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/etc/modules/Mage_Api.xml b/app/etc/modules/Mage_Api.xml index 221755f06b9e41c11e3b0a2565660840d37d3fd5..1fed7e4830497c7d793470c764a7e30486a92f70 100644 --- a/app/etc/modules/Mage_Api.xml +++ b/app/etc/modules/Mage_Api.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Api - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/etc/modules/Mage_Authorizenet.xml b/app/etc/modules/Mage_Authorizenet.xml index 81a887a2202b1e3cda6954f6490fd37d6853d6d2..fc666db0f65df8b8a3679b9d2b28bf2fe482e501 100755 --- a/app/etc/modules/Mage_Authorizenet.xml +++ b/app/etc/modules/Mage_Authorizenet.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Authorizenet - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/etc/modules/Mage_Bundle.xml b/app/etc/modules/Mage_Bundle.xml index 548c813708b49b2d2e060aa71555f3ac8568381a..395f9d9a7e80c5560200729077c2cf2c197fb6de 100644 --- a/app/etc/modules/Mage_Bundle.xml +++ b/app/etc/modules/Mage_Bundle.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Bundle - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/etc/modules/Mage_Captcha.xml b/app/etc/modules/Mage_Captcha.xml new file mode 100755 index 0000000000000000000000000000000000000000..ef84e715540e593eb221eca67c47a226d156662e --- /dev/null +++ b/app/etc/modules/Mage_Captcha.xml @@ -0,0 +1,39 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * 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_AFL.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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Captcha + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<config> + <modules> + <Mage_Captcha> + <active>true</active> + <codePool>core</codePool> + <depends> + <Mage_Customer /> + <Mage_Adminhtml /> + </depends> + </Mage_Captcha> + </modules> +</config> diff --git a/app/etc/modules/Mage_Centinel.xml b/app/etc/modules/Mage_Centinel.xml index 180c0cec2b4e9c30518aaf09176d59bd23b1fa42..51871d22e06fe89a92584516290e44dce0751ef1 100644 --- a/app/etc/modules/Mage_Centinel.xml +++ b/app/etc/modules/Mage_Centinel.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Centinel - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/etc/modules/Mage_Connect.xml b/app/etc/modules/Mage_Connect.xml index 8125e961d6df0ea868e35905b33a99327a1406c7..6b6ec062e72a4447a5d645251038c7919a9166d7 100644 --- a/app/etc/modules/Mage_Connect.xml +++ b/app/etc/modules/Mage_Connect.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/etc/modules/Mage_Downloadable.xml b/app/etc/modules/Mage_Downloadable.xml index 4d18665fa6e555459f0ef701dfb334c394cd4881..3902d8d3dc5d34768f8caae6437e56e111c5bbeb 100644 --- a/app/etc/modules/Mage_Downloadable.xml +++ b/app/etc/modules/Mage_Downloadable.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Downloadable - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/etc/modules/Mage_GoogleOptimizer.xml b/app/etc/modules/Mage_GoogleOptimizer.xml index 61329ad2485c9886558088b25023c41dc2acb4e3..73dbeffed744675817b0f55509323f39f2554db1 100644 --- a/app/etc/modules/Mage_GoogleOptimizer.xml +++ b/app/etc/modules/Mage_GoogleOptimizer.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_GoogleOptimizer - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/etc/modules/Mage_GoogleShopping.xml b/app/etc/modules/Mage_GoogleShopping.xml index 8eef51621bcacd6599ae92b19da00efddb3dce9d..4eef74bafb0c06bf808e9c397beb3223aed39a21 100644 --- a/app/etc/modules/Mage_GoogleShopping.xml +++ b/app/etc/modules/Mage_GoogleShopping.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_GoogleShopping - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/etc/modules/Mage_ImportExport.xml b/app/etc/modules/Mage_ImportExport.xml index 314f4dc6763f9152f00b87154c777fdfb76f2e21..a0029e0ffe497a1e13cafb7ba379a486a255e11e 100755 --- a/app/etc/modules/Mage_ImportExport.xml +++ b/app/etc/modules/Mage_ImportExport.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_ImportExport - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/etc/modules/Mage_LoadTest.xml b/app/etc/modules/Mage_LoadTest.xml index 9df587b51ce85e84d037675969c737657e4f04cc..21439fa6f92b0590d24d62010654a30baf28677d 100644 --- a/app/etc/modules/Mage_LoadTest.xml +++ b/app/etc/modules/Mage_LoadTest.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_LoadTest - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/etc/modules/Mage_Ogone.xml b/app/etc/modules/Mage_Ogone.xml index 89a7ba96251e7927d5e725aca7ca7c4aed39689f..c243024594908cf08c84cb6c8c66d918ff28e633 100644 --- a/app/etc/modules/Mage_Ogone.xml +++ b/app/etc/modules/Mage_Ogone.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Ogone - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/etc/modules/Mage_PageCache.xml b/app/etc/modules/Mage_PageCache.xml index 34ee30e9c3005efeb65610244e7ae4b94f9195a4..ddac7728a32185fd1fb401b87941d300cabe53bb 100644 --- a/app/etc/modules/Mage_PageCache.xml +++ b/app/etc/modules/Mage_PageCache.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_PageCache - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/etc/modules/Mage_Persistent.xml b/app/etc/modules/Mage_Persistent.xml index 56fdf0521741e7efc26daeb065df7bf0cd53aed2..35cc48e05321ea62eec46868d4f19586fccfcfc8 100644 --- a/app/etc/modules/Mage_Persistent.xml +++ b/app/etc/modules/Mage_Persistent.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Persistent - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/etc/modules/Mage_Weee.xml b/app/etc/modules/Mage_Weee.xml index 3b55ba4196a3304556a34984549e2ece3e099755..8a12bfefe9c1b068ca56f5adb4da27e44da0c309 100644 --- a/app/etc/modules/Mage_Weee.xml +++ b/app/etc/modules/Mage_Weee.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Weee - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/etc/modules/Mage_Widget.xml b/app/etc/modules/Mage_Widget.xml index d3958ba92bce1167b382db31396072bfc0e3021b..69d1e0eec9149bd056b5c694a7f4185ffd9f57b5 100644 --- a/app/etc/modules/Mage_Widget.xml +++ b/app/etc/modules/Mage_Widget.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Widget - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/etc/modules/Mage_XmlConnect.xml b/app/etc/modules/Mage_XmlConnect.xml index 9b36095f4fb059873e30a3800abac5cbe48684a2..cf85eab5dba500be87a0c21ca6670c34f9a0a256 100644 --- a/app/etc/modules/Mage_XmlConnect.xml +++ b/app/etc/modules/Mage_XmlConnect.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_XmlConnect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/app/etc/modules/Phoenix_Moneybookers.xml b/app/etc/modules/Phoenix_Moneybookers.xml index 8bf39db839a323aa2aca9e8d82a7a3f1b2651380..c45021b227073063ca95e3944e9998054327d624 100644 --- a/app/etc/modules/Phoenix_Moneybookers.xml +++ b/app/etc/modules/Phoenix_Moneybookers.xml @@ -21,7 +21,7 @@ * * @category Phoenix * @package Phoenix_Moneybookers - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/dev/shell/indexer.php b/dev/shell/indexer.php index 768e5df4117160fc09a1a983c2b130049519d1f4..b02bfc63f8e7dd2d626382a04f06b42abb9c27c2 100644 --- a/dev/shell/indexer.php +++ b/dev/shell/indexer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Shell - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/shell/install.php b/dev/shell/install.php index d1411999dbc7535341cbe25ed8ff402bfe042b56..e429124c5fc58c6f45dc86f993f8f25ac564827f 100644 --- a/dev/shell/install.php +++ b/dev/shell/install.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/shell/log.php b/dev/shell/log.php index 30ddfa0a6513096e296d31a2b9899d8986e8ff09..fdfaa71a6d211a8398ddc26e2a00444fc3c2e815 100644 --- a/dev/shell/log.php +++ b/dev/shell/log.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Shell - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/etc/integration-tests-config.xml b/dev/tests/integration/etc/integration-tests-config.xml index aabbce7bd72d88fc4871cb2da6716397d77ba37f..268d596fec063428f7656a5ef3b2949b8bc8bdba 100644 --- a/dev/tests/integration/etc/integration-tests-config.xml +++ b/dev/tests/integration/etc/integration-tests-config.xml @@ -22,7 +22,7 @@ * @category Magento * @package Magento * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/dev/tests/integration/etc/local-mysql.xml.dist b/dev/tests/integration/etc/local-mysql.xml.dist index d315318f35e746c17715f1d3807ebad7704874e3..04771b02ea5684f2a46cbfedcfd4889f6b660ec2 100644 --- a/dev/tests/integration/etc/local-mysql.xml.dist +++ b/dev/tests/integration/etc/local-mysql.xml.dist @@ -22,7 +22,7 @@ * @category Magento * @package Magento * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/dev/tests/integration/framework/Magento/Test/Bootstrap.php b/dev/tests/integration/framework/Magento/Test/Bootstrap.php index 960a66d0e29a1544085a34a203c920fb9f02f394..9706ca220d2c3a4b5314751f7331776b7a36af6f 100644 --- a/dev/tests/integration/framework/Magento/Test/Bootstrap.php +++ b/dev/tests/integration/framework/Magento/Test/Bootstrap.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -143,12 +143,12 @@ class Magento_Test_Bootstrap * Self instance getter * * @return Magento_Test_Bootstrap - * @throws Exception + * @throws Magento_Exception */ public static function getInstance() { if (!self::$_instance) { - throw new Exception('Bootstrap instance is not defined yet.'); + throw new Magento_Exception('Bootstrap instance is not defined yet.'); } return self::$_instance; } @@ -175,13 +175,15 @@ class Magento_Test_Bootstrap * @param string $moduleEtcFiles * @param string $tmpDir * @param string $cleanupAction + * @param bool $developerMode + * @throws Magento_Exception */ public function __construct( $magentoDir, $localXmlFile, $globalEtcFiles, $moduleEtcFiles, $tmpDir, $cleanupAction = self::CLEANUP_NONE, $developerMode = false ) { if (!in_array($cleanupAction, array(self::CLEANUP_NONE, self::CLEANUP_UNINSTALL, self::CLEANUP_RESTORE_DB))) { - throw new Exception("Cleanup action '{$cleanupAction}' is not supported."); + throw new Magento_Exception("Cleanup action '{$cleanupAction}' is not supported."); } $this->_magentoDir = $magentoDir; @@ -270,12 +272,12 @@ class Magento_Test_Bootstrap * Re-create empty temporary dir by specified * * @param string $optionCode - * @throws Exception if one of protected directories specified + * @throws Magento_Exception if one of protected directories specified */ public function cleanupDir($optionCode) { if (in_array($optionCode, array('etc_dir', 'var_dir', 'media_dir'))) { - throw new Exception("Directory '{$optionCode}' must not be cleaned up while running tests."); + throw new Magento_Exception("Directory '{$optionCode}' must not be cleaned up while running tests."); } $dir = $this->_options[$optionCode]; $this->_removeDirectory($dir, false); @@ -318,18 +320,18 @@ class Magento_Test_Bootstrap /** * Load application local.xml file, determine database vendor name * - * @throws Exception + * @throws Magento_Exception */ protected function _readLocalXml() { if (!is_file($this->_localXmlFile)) { - throw new Exception("Local XML configuration file '{$this->_localXmlFile}' does not exist."); + throw new Magento_Exception("Local XML configuration file '{$this->_localXmlFile}' does not exist."); } $this->_localXml = simplexml_load_file($this->_localXmlFile); $dbVendorId = (string)$this->_localXml->global->resources->default_setup->connection->model; $dbVendorMap = array('mysql4' => 'mysql', 'mssql' => 'mssql', 'oracle' => 'oracle'); if (!array_key_exists($dbVendorId, $dbVendorMap)) { - throw new Exception("Database vendor '{$dbVendorId}' is not supported."); + throw new Magento_Exception("Database vendor '{$dbVendorId}' is not supported."); } $this->_dbVendorName = $dbVendorMap[$dbVendorId]; } @@ -338,17 +340,17 @@ class Magento_Test_Bootstrap * Check all required directories contents and permissions * * @param string $tmpDir - * @throws Exception when any of required directories is not eligible + * @throws Magento_Exception when any of required directories is not eligible */ protected function _verifyDirectories($tmpDir) { /* Magento application dir */ if (!is_file($this->_magentoDir . '/app/bootstrap.php')) { - throw new Exception('Unable to locate Magento root folder and bootstrap.php.'); + throw new Magento_Exception('Unable to locate Magento root folder and bootstrap.php.'); } /* Temporary directory */ if (!is_dir($tmpDir) || !is_writable($tmpDir)) { - throw new Exception("The '{$tmpDir}' is not a directory or not writable."); + throw new Magento_Exception("The '{$tmpDir}' is not a directory or not writable."); } } @@ -400,7 +402,7 @@ class Magento_Test_Bootstrap /** * Create a directory with write permissions or don't touch existing one * - * @throws Exception + * @throws Magento_Exception * @param string $dir */ protected function _ensureDirExists($dir) @@ -410,7 +412,7 @@ class Magento_Test_Bootstrap mkdir($dir, 0777); umask($old); } else if (!is_dir($dir)) { - throw new Exception("'$dir' is not a directory."); + throw new Magento_Exception("'$dir' is not a directory."); } } @@ -440,6 +442,8 @@ class Magento_Test_Bootstrap /** * Install application using temporary directory and vendor-specific database settings + * + * @throws Magento_Exception */ protected function _install() { @@ -464,7 +468,9 @@ class Magento_Test_Bootstrap /* Make sure that local.xml contains an invalid installation date */ $installDate = (string)$this->_localXml->global->install->date; if ($installDate && strtotime($installDate)) { - throw new Exception("Configuration file '$this->_localXmlFile' must contain an invalid installation date."); + throw new Magento_Exception( + "Configuration file '$this->_localXmlFile' must contain an invalid installation date." + ); } /* Replace local.xml */ @@ -485,7 +491,7 @@ class Magento_Test_Bootstrap $localXml = file_get_contents($targetLocalXml); $localXml = str_replace($installDate, date('r'), $localXml, $replacementCount); if ($replacementCount != 1) { - throw new Exception("Unable to replace installation date properly in '$targetLocalXml' file."); + throw new Magento_Exception("Unable to replace installation date properly in '$targetLocalXml' file."); } file_put_contents($targetLocalXml, $localXml, LOCK_EX); diff --git a/dev/tests/integration/framework/Magento/Test/Db/DbAbstract.php b/dev/tests/integration/framework/Magento/Test/Db/DbAbstract.php index 74a73f8feecedf9b5adfb7e73155d044fcd6b154..cc057f66ea01a1979f98bf33b2930c67914a09a5 100644 --- a/dev/tests/integration/framework/Magento/Test/Db/DbAbstract.php +++ b/dev/tests/integration/framework/Magento/Test/Db/DbAbstract.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -72,7 +72,8 @@ abstract class Magento_Test_Db_DbAbstract * @param string $user * @param string $password * @param string $schema - * @param string $dumpFile + * @param string $varPath + * @throws Magento_Exception */ public function __construct($host, $user, $password, $schema, $varPath) { @@ -83,7 +84,9 @@ abstract class Magento_Test_Db_DbAbstract $this->_varPath = $varPath; if (!is_dir($this->_varPath) || !is_writable($this->_varPath)) { - throw new Exception(sprintf('The specified "%s" is not a directory or not writable.', $this->_varPath)); + throw new Magento_Exception( + sprintf('The specified "%s" is not a directory or not writable.', $this->_varPath) + ); } } diff --git a/dev/tests/integration/framework/Magento/Test/Db/Mysql.php b/dev/tests/integration/framework/Magento/Test/Db/Mysql.php index 7eb7063b2dcf70af7e1251844f6fd281362bfc64..9841c2c138bd7c8e19cae2c166e6a40b3f32bebc 100644 --- a/dev/tests/integration/framework/Magento/Test/Db/Mysql.php +++ b/dev/tests/integration/framework/Magento/Test/Db/Mysql.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/framework/Magento/Test/Entity.php b/dev/tests/integration/framework/Magento/Test/Entity.php index f4db5ec17f17a75c3c2519c1bd9ba5bf264af1ee..4462398cbc069bbb56b40328c5fa25aff658fcbb 100644 --- a/dev/tests/integration/framework/Magento/Test/Entity.php +++ b/dev/tests/integration/framework/Magento/Test/Entity.php @@ -21,7 +21,7 @@ * @category Magento * @package Test * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/framework/Magento/Test/Helper/Config.php b/dev/tests/integration/framework/Magento/Test/Helper/Config.php index daa3f1ecc5f9471bfb67a878101647847dafd1aa..1a25c4fc52eeddb36a0c9fd518cd10a27d155908 100644 --- a/dev/tests/integration/framework/Magento/Test/Helper/Config.php +++ b/dev/tests/integration/framework/Magento/Test/Helper/Config.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Test * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/framework/Magento/Test/Helper/Factory.php b/dev/tests/integration/framework/Magento/Test/Helper/Factory.php index 02e130a335c7721fbf9467033a5395eff69d5ec9..1f3997adacbd802d5fbfbdcbb7947b0af9661101 100644 --- a/dev/tests/integration/framework/Magento/Test/Helper/Factory.php +++ b/dev/tests/integration/framework/Magento/Test/Helper/Factory.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Test * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/framework/Magento/Test/Listener.php b/dev/tests/integration/framework/Magento/Test/Listener.php index c77aa83570d682eaf575a8a36ebe27391607d77a..3bc6b8188ab0042867b14e1a827d3a6365493b2e 100644 --- a/dev/tests/integration/framework/Magento/Test/Listener.php +++ b/dev/tests/integration/framework/Magento/Test/Listener.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/framework/Magento/Test/Listener/Annotation/Config.php b/dev/tests/integration/framework/Magento/Test/Listener/Annotation/Config.php index 621a27c01cba76d6e9048ab904cfafde491e29d9..6f76834550b74bfafc88297b055856819d120477 100644 --- a/dev/tests/integration/framework/Magento/Test/Listener/Annotation/Config.php +++ b/dev/tests/integration/framework/Magento/Test/Listener/Annotation/Config.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/framework/Magento/Test/Listener/Annotation/Fixture.php b/dev/tests/integration/framework/Magento/Test/Listener/Annotation/Fixture.php index be4c5f37708c2d9ca005cc663ffdb200ad0f54d6..a590df6794ed3c64fae40b1840d1ae33442868b7 100644 --- a/dev/tests/integration/framework/Magento/Test/Listener/Annotation/Fixture.php +++ b/dev/tests/integration/framework/Magento/Test/Listener/Annotation/Fixture.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -117,8 +117,6 @@ class Magento_Test_Listener_Annotation_Fixture /** * Start transaction - * - * @throws Exception */ protected function _startTransaction() { @@ -155,6 +153,7 @@ class Magento_Test_Listener_Annotation_Fixture * Execute fixture scripts if any * * @param array $fixtures + * @throws Magento_Exception */ protected function _applyFixtures(array $fixtures) { @@ -164,14 +163,14 @@ class Magento_Test_Listener_Annotation_Fixture /* Start transaction before applying first fixture to be able to revert them all further */ if (empty($this->_appliedFixtures)) { if (!$this->_isSingleConnection()) { - throw new Exception('Transaction fixtures with 2 connections are not implemented yet.'); + throw new Magento_Exception('Transaction fixtures with 2 connections are not implemented yet.'); } $this->_startTransaction(); } /* Execute fixture scripts */ foreach ($fixtures as $fixture) { if (strpos($fixture, '\\') !== false) { - throw new Exception('The "\" symbol is not allowed for fixture definition.'); + throw new Magento_Exception('The "\" symbol is not allowed for fixture definition.'); } $fixtureMethod = array(get_class($this->_listener->getCurrentTest()), $fixture); $fixtureScript = realpath(__DIR__ . '/../../../../../testsuite') . DIRECTORY_SEPARATOR . $fixture; diff --git a/dev/tests/integration/framework/Magento/Test/Listener/Annotation/Isolation.php b/dev/tests/integration/framework/Magento/Test/Listener/Annotation/Isolation.php index eea7c24d5e6184b6e7ec80573e5da3404043c9af..fc8a5dfa7b1532ebf560e9f5f32181f0e78b7855 100644 --- a/dev/tests/integration/framework/Magento/Test/Listener/Annotation/Isolation.php +++ b/dev/tests/integration/framework/Magento/Test/Listener/Annotation/Isolation.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -74,6 +74,8 @@ class Magento_Test_Listener_Annotation_Isolation /** * Handler for 'endTest' event + * + * @throws Magento_Exception */ public function endTest() { @@ -86,7 +88,9 @@ class Magento_Test_Listener_Annotation_Isolation if (isset($annotations['method']['magentoAppIsolation'])) { $isolation = $annotations['method']['magentoAppIsolation']; if ($isolation !== array('enabled') && $isolation !== array('disabled')) { - throw new Exception('Invalid "@magentoAppIsolation" annotation, can be "enabled" or "disabled" only.'); + throw new Magento_Exception( + 'Invalid "@magentoAppIsolation" annotation, can be "enabled" or "disabled" only.' + ); } $isIsolationEnabled = ($isolation === array('enabled')); } else { diff --git a/dev/tests/integration/framework/Magento/Test/Profiler/OutputBamboo.php b/dev/tests/integration/framework/Magento/Test/Profiler/OutputBamboo.php index 9f2925e2b827722c5352372ba656c3621b331ae1..94801e253ea27d8576e6c8545633d64a75005bcb 100644 --- a/dev/tests/integration/framework/Magento/Test/Profiler/OutputBamboo.php +++ b/dev/tests/integration/framework/Magento/Test/Profiler/OutputBamboo.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Test * @subpackage integration_test - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/framework/Magento/Test/Request.php b/dev/tests/integration/framework/Magento/Test/Request.php index 55ffe32d55422edcde74a45dc1839867daba961a..677ecee2bf54c66526a9ebc186cad8c4a246ae3a 100644 --- a/dev/tests/integration/framework/Magento/Test/Request.php +++ b/dev/tests/integration/framework/Magento/Test/Request.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/framework/Magento/Test/Response.php b/dev/tests/integration/framework/Magento/Test/Response.php index e7838d240fd9afccfc3794eda8f98a79738c449a..fc73a2613c8715e1a7978ec3ae9855e503d5186b 100644 --- a/dev/tests/integration/framework/Magento/Test/Response.php +++ b/dev/tests/integration/framework/Magento/Test/Response.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/framework/Magento/Test/TestCase/ControllerAbstract.php b/dev/tests/integration/framework/Magento/Test/TestCase/ControllerAbstract.php index d5e5628eae40341029c5b2f02fa1a5208896f191..6ae0ff7ad46098046de14d4c63b943af06989211 100644 --- a/dev/tests/integration/framework/Magento/Test/TestCase/ControllerAbstract.php +++ b/dev/tests/integration/framework/Magento/Test/TestCase/ControllerAbstract.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/framework/Magento/Test/TestCase/IntegrityAbstract.php b/dev/tests/integration/framework/Magento/Test/TestCase/IntegrityAbstract.php index 1db580155afcc15ad2c0acddaeaba296961ffc3d..b00d244338485f9d3fca978d079ee262bd7aa393 100644 --- a/dev/tests/integration/framework/Magento/Test/TestCase/IntegrityAbstract.php +++ b/dev/tests/integration/framework/Magento/Test/TestCase/IntegrityAbstract.php @@ -21,7 +21,7 @@ * @category Magento * @package Test * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/framework/Magento/Test/TestSuite/ModuleGroups.php b/dev/tests/integration/framework/Magento/Test/TestSuite/ModuleGroups.php index 94328668170263220ac89475e00d3061264ed989..f76a2e78927b7f7bef678eac166e435985088631 100644 --- a/dev/tests/integration/framework/Magento/Test/TestSuite/ModuleGroups.php +++ b/dev/tests/integration/framework/Magento/Test/TestSuite/ModuleGroups.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/framework/bootstrap.php b/dev/tests/integration/framework/bootstrap.php index 3cb1cfdf72c7d91a1a673ddc453427c9529d249a..0a9a84d25262779fa69e65b6b671195b0fc30718 100644 --- a/dev/tests/integration/framework/bootstrap.php +++ b/dev/tests/integration/framework/bootstrap.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/framework/tests/unit/framework/bootstrap.php b/dev/tests/integration/framework/tests/unit/framework/bootstrap.php index 376a19c33137b967a49c2329378d7af8f6d35a37..a06c006f126e336c6ce33de0ed6880d77163bdbb 100644 --- a/dev/tests/integration/framework/tests/unit/framework/bootstrap.php +++ b/dev/tests/integration/framework/tests/unit/framework/bootstrap.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/framework/tests/unit/phpunit.xml.dist b/dev/tests/integration/framework/tests/unit/phpunit.xml.dist index 9ce04167e74ce8ea80d97580980a326bf87e65c2..d5af756af1aed3eeed57f2cb1f53fe0071ea40f7 100644 --- a/dev/tests/integration/framework/tests/unit/phpunit.xml.dist +++ b/dev/tests/integration/framework/tests/unit/phpunit.xml.dist @@ -22,7 +22,7 @@ * @category Magento * @package Magento * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Bootstrap/_files/local-custom.xml b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Bootstrap/_files/local-custom.xml index d897e3335e43e8fdfc1b37de0242c19fa033021a..e71daca8dcf8dde19f217f3aa88800b3b16d6069 100644 --- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Bootstrap/_files/local-custom.xml +++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Bootstrap/_files/local-custom.xml @@ -22,7 +22,7 @@ * @category Magento * @package Magento * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Bootstrap/_files/local-invalid.xml b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Bootstrap/_files/local-invalid.xml index f45cd36194f0329448c4dfbbc74a12fb508f8d47..c85d327ba342db3d665496cce4a7f5ddabf2557b 100644 --- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Bootstrap/_files/local-invalid.xml +++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Bootstrap/_files/local-invalid.xml @@ -22,7 +22,7 @@ * @category Magento * @package Magento * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/BootstrapTest.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/BootstrapTest.php index 72e1dd350dafc326f19c250375df7cb807c2bfe4..c11d8a4b2010f0bf53781a1ce484e2b502187a3b 100644 --- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/BootstrapTest.php +++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/BootstrapTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -120,7 +120,7 @@ class Magento_Test_BootstrapTest extends PHPUnit_Framework_TestCase } /** - * @expectedException Exception + * @expectedException Magento_Exception */ public function testGetInstance() { @@ -244,7 +244,7 @@ class Magento_Test_BootstrapTest extends PHPUnit_Framework_TestCase } /** - * @expectedException Exception + * @expectedException Magento_Exception */ public function testConstructorCleanupException() { @@ -253,7 +253,7 @@ class Magento_Test_BootstrapTest extends PHPUnit_Framework_TestCase /** * @dataProvider constructorExceptionDataProvider - * @expectedException Exception + * @expectedException Magento_Exception */ public function testConstructorException($localXmlFile) { @@ -286,7 +286,8 @@ class Magento_Test_BootstrapTest extends PHPUnit_Framework_TestCase } /** - * @expectedException Exception + * @dataProvider cleanupDirExceptionDataProvider + * @expectedException Magento_Exception */ public function testCleanupDirException($optionCode) { @@ -299,10 +300,9 @@ class Magento_Test_BootstrapTest extends PHPUnit_Framework_TestCase public function cleanupDirExceptionDataProvider() { return array( - array('etc_dir'), - array('var_dir'), - array('media_dir'), - array('static_dir') + 'etc' => array('etc_dir'), + 'var' => array('var_dir'), + 'media' => array('media_dir'), ); } } diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Db/MysqlTest.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Db/MysqlTest.php index dafc88b8526ed918fd437bc0be387e21613aa605..f501c496a3479e32d07c18e97f0fa3ad352427a4 100644 --- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Db/MysqlTest.php +++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Db/MysqlTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento * @subpackage unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/EntityTest.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/EntityTest.php index 53e046248922e4ed804e7ffdc954244868698f96..59d57880ba94028686fe1b4cee889b81fd011f23 100644 --- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/EntityTest.php +++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/EntityTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -42,13 +42,15 @@ class Magento_Test_EntityTest extends PHPUnit_Framework_TestCase /** * Callback for save method in mocked model + * + * @throws Magento_Exception */ public function saveModelAndFailOnUpdate() { if (!$this->_model->getId()) { $this->saveModelSuccessfully(); } else { - throw new Exception('Synthetic model update failure.'); + throw new Magento_Exception('Synthetic model update failure.'); } } @@ -64,7 +66,7 @@ class Magento_Test_EntityTest extends PHPUnit_Framework_TestCase { return array( 'successful CRUD' => array('saveModelSuccessfully'), - 'cleanup on update error' => array('saveModelAndFailOnUpdate', 'Exception'), + 'cleanup on update error' => array('saveModelAndFailOnUpdate', 'Magento_Exception'), ); } diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Helper/FactoryTest.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Helper/FactoryTest.php index 98f674dc10bb198d0baa528e5558fdf965f4219c..dd3ee83db2178253de82c45355fae0f5be335151 100644 --- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Helper/FactoryTest.php +++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Helper/FactoryTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento * @subpackage unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Listener/Annotation/ConfigTest.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Listener/Annotation/ConfigTest.php index 88a553cb77c03f4f2bd999ad1ad49d8197778364..bf56e11dc9bc44ca85357155f4fb8aa862d29f8b 100644 --- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Listener/Annotation/ConfigTest.php +++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Listener/Annotation/ConfigTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Listener/Annotation/FixtureTest.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Listener/Annotation/FixtureTest.php index 64b8a823263c75c5d6aa3f0ae161c2ae3c2b79ff..0dec19426ec53ed576506252744e81a8ef984ab4 100644 --- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Listener/Annotation/FixtureTest.php +++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Listener/Annotation/FixtureTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -132,6 +132,15 @@ class Magento_Test_Listener_Annotation_FixtureTest extends PHPUnit_Framework_Tes $this->_annotation->endTest(); } + /** + * @magentoDataFixture fixture\path\must\not\contain\backslash.php + * @expectedException Magento_Exception + */ + public function testMethodAnnotationInvalidPath() + { + $this->_annotation->startTest(); + } + /** * @param Magento_Test_Listener_Annotation_Fixture $annotation * @depends testClassAnnotation diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Listener/Annotation/IsolationTest.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Listener/Annotation/IsolationTest.php index dc1e90f381d11dc6075fa7d33d95396ad29b9d41..cac803a6c143f0b765cc1c2f25e31ece3ec18f46 100644 --- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Listener/Annotation/IsolationTest.php +++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Listener/Annotation/IsolationTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -54,7 +54,13 @@ class Magento_Test_Listener_Annotation_IsolationTest extends PHPUnit_Framework_T protected function tearDown() { - $this->_listener->endTest($this->_listener->getCurrentTest(), 0); + /* + * If an exception is thrown by a listener on 'startTest' event, + * 'setUp' method won't be executed and there will be nothing to cleanup + */ + if ($this->_listener) { + $this->_listener->endTest($this->_listener->getCurrentTest(), 0); + } } public function testStartTestSuite() @@ -65,7 +71,7 @@ class Magento_Test_Listener_Annotation_IsolationTest extends PHPUnit_Framework_T /** * @magentoAppIsolation invalid - * @expectedException Exception + * @expectedException Magento_Exception */ public function testEndTestIsolationInvalid() { @@ -75,7 +81,7 @@ class Magento_Test_Listener_Annotation_IsolationTest extends PHPUnit_Framework_T /** * @magentoAppIsolation enabled * @magentoAppIsolation disabled - * @expectedException Exception + * @expectedException Magento_Exception */ public function testEndTestIsolationAmbiguous() { diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Listener/_files/sample_fixture_two_rollback.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Listener/_files/sample_fixture_two_rollback.php index c409278a0a165bf4e271172d8b88f31485d21ebb..d99a676c60af2eb1210f2f98eb48e6b64a169d30 100644 --- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Listener/_files/sample_fixture_two_rollback.php +++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Listener/_files/sample_fixture_two_rollback.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/ListenerTest.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/ListenerTest.php index 6ceaa34727f28e5d4090a2e7abbd70ed0383ceed..7efc8233d32bd96e31d5d98bdf5e3b457f970483 100644 --- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/ListenerTest.php +++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/ListenerTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Profiler/OutputBambooTest.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Profiler/OutputBambooTest.php index 56daa3fd523bef7aece52268510772bbd6f9235e..93dc596ae76a83d80f08e811c82259d3e110d49a 100644 --- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Profiler/OutputBambooTest.php +++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/Profiler/OutputBambooTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/RequestTest.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/RequestTest.php index 10a29eeaf20e3f54e5c01ace855d63d8ddc5f564..7d684e9ffc67f77db42ee2c3d669c581c733df65 100644 --- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/RequestTest.php +++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/RequestTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/ResponseTest.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/ResponseTest.php index d01362b482d74731060774dd0b9525db4acc979e..dae3eb2c75b4e85515073df3015cdba40dbd1fcb 100644 --- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/ResponseTest.php +++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/ResponseTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/TestCase/ControllerAbstractTest.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/TestCase/ControllerAbstractTest.php index 60eec6fcee83ab3014e9d8c4241ff2563df5ea0d..3c8e50b63b962c66c9a7823600664667ddba83de 100644 --- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/TestCase/ControllerAbstractTest.php +++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/TestCase/ControllerAbstractTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/TestSuite/ModuleGroupsTest.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/TestSuite/ModuleGroupsTest.php index ad8649c5ee2d3244731eb0b65174436e20653611..2eaab2c71d2973a9efe7162313c934d950a23892 100644 --- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/TestSuite/ModuleGroupsTest.php +++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/TestSuite/ModuleGroupsTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -159,11 +159,12 @@ class Magento_Test_TestSuite_ModuleGroupsTest extends PHPUnit_Framework_TestCase * Adds fixture tests to the suite * * @param Magento_Test_TestSuite_ModuleGroups $suite - * @return Magento_Test_Profiler_ModuleGroupsTest + * @return Magento_Test_TestSuite_ModuleGroupsTest */ protected function _fillTests($suite) { - $fileIterator = File_Iterator_Factory::getFileIterator( + $fileIteratorFactory = new File_Iterator_Factory(); + $fileIterator = $fileIteratorFactory->getFileIterator( array(__DIR__ . '/_files/ModuleGroups'), '.php' ); diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/TestSuite/_files/ModuleGroups/Mg_Author_Module.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/TestSuite/_files/ModuleGroups/Mg_Author_Module.php index 2288181607ec6e4be6971cce64400567ade903bc..16152ac35177e20bf0f52debe62562fe8d2c47be 100644 --- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/TestSuite/_files/ModuleGroups/Mg_Author_Module.php +++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/TestSuite/_files/ModuleGroups/Mg_Author_Module.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/TestSuite/_files/ModuleGroups/Mg_Integrity.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/TestSuite/_files/ModuleGroups/Mg_Integrity.php index 6e1fb6fbe24aff50bf0db4aacd9526ea0dbb7dd4..a727761fd75adb4aece08b9d64ec8e3b2afd0819 100644 --- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/TestSuite/_files/ModuleGroups/Mg_Integrity.php +++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/TestSuite/_files/ModuleGroups/Mg_Integrity.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/TestSuite/_files/ModuleGroups/Mg_Mage_Catalog.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/TestSuite/_files/ModuleGroups/Mg_Mage_Catalog.php index 5506d40174866a565c650e342a85a772409f3146..ebf9f5cf533671c35bacab80f50a25819f235428 100644 --- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/TestSuite/_files/ModuleGroups/Mg_Mage_Catalog.php +++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/TestSuite/_files/ModuleGroups/Mg_Mage_Catalog.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/TestSuite/_files/ModuleGroups/Mg_Mage_Core.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/TestSuite/_files/ModuleGroups/Mg_Mage_Core.php index 056f5584c220a10fed6fdd9f85ccbd424ffdeb46..727383533ea1d5f412752f2ae7668e8558c50479 100644 --- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/TestSuite/_files/ModuleGroups/Mg_Mage_Core.php +++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/TestSuite/_files/ModuleGroups/Mg_Mage_Core.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/TestSuite/_files/ModuleGroups/Mg_Mage_Core_Mage_Eav.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/TestSuite/_files/ModuleGroups/Mg_Mage_Core_Mage_Eav.php index 354262dfaefa0c0488b066b55534b007531e4031..11e58c8b647b13a7ce42a4ce5f814b6c56712887 100644 --- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/TestSuite/_files/ModuleGroups/Mg_Mage_Core_Mage_Eav.php +++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/TestSuite/_files/ModuleGroups/Mg_Mage_Core_Mage_Eav.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/phpunit-ce.xml.dist b/dev/tests/integration/phpunit-ce.xml.dist index d2deea4c6d74355981e028b81413961e299c0314..b4bed55d3894551b7b88aa437b74c935f8f9802f 100644 --- a/dev/tests/integration/phpunit-ce.xml.dist +++ b/dev/tests/integration/phpunit-ce.xml.dist @@ -22,7 +22,7 @@ * @category Magento * @package Magento * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/dev/tests/integration/phpunit.xml.dist b/dev/tests/integration/phpunit.xml.dist index 1d4cbe902a50043f0447e73e6920edb6a9aa5ca4..03aa860ead5bb467148f1c9aeb78c1fc17ab6cba 100644 --- a/dev/tests/integration/phpunit.xml.dist +++ b/dev/tests/integration/phpunit.xml.dist @@ -22,7 +22,7 @@ * @category Magento * @package Magento * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/dev/tests/integration/testsuite/AllRelevantTests.php b/dev/tests/integration/testsuite/AllRelevantTests.php index 852461f78cb931acd61a5d9c5688ec6805fbccaa..0423c4ea6ce3228924a29e77e3b9f16a7890ca0d 100644 --- a/dev/tests/integration/testsuite/AllRelevantTests.php +++ b/dev/tests/integration/testsuite/AllRelevantTests.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -32,9 +32,10 @@ class AllRelevantTests { public static function suite() { + $fileIteratorFactory = new File_Iterator_Factory(); $suite = new Magento_Test_TestSuite_ModuleGroups(false); $suite->addTestFiles( - File_Iterator_Factory::getFileIterator( + $fileIteratorFactory->getFileIterator( array(__DIR__), array('Test.php') ) diff --git a/dev/tests/integration/testsuite/Mage/Admin/Model/UserTest.php b/dev/tests/integration/testsuite/Mage/Admin/Model/UserTest.php new file mode 100644 index 0000000000000000000000000000000000000000..b440a7ffb8b1ea4a69674542411e211ce457c208 --- /dev/null +++ b/dev/tests/integration/testsuite/Mage/Admin/Model/UserTest.php @@ -0,0 +1,54 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Mage_Admin + * @subpackage integration_tests + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * @group module:Mage_Admin + * @magentoDataFixture Mage/Admin/_files/user.php + */ +class Mage_Admin_Model_UserTest extends PHPUnit_Framework_TestCase +{ + /** + * @var Mage_Admin_Model_User + */ + protected $_model; + + protected function setUp() + { + $this->_model = new Mage_Admin_Model_User; + } + + /** + * Ensure that an exception is not thrown, if the user does not exist + */ + public function testLoadByUsername() + { + $this->_model->loadByUsername('non_existing_user'); + $this->assertNull($this->_model->getId(), 'The admin user has an unexpected ID'); + $this->_model->loadByUsername('user'); + $this->assertNotEmpty($this->_model->getId(), 'The admin user should have been loaded'); + } +} diff --git a/dev/tests/integration/testsuite/Mage/Admin/_files/user.php b/dev/tests/integration/testsuite/Mage/Admin/_files/user.php new file mode 100644 index 0000000000000000000000000000000000000000..b1be18ccb0611b115b77231d467e1f150d3f676c --- /dev/null +++ b/dev/tests/integration/testsuite/Mage/Admin/_files/user.php @@ -0,0 +1,50 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Mage_Adminhtml + * @subpackage integration_tests + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +$user = new Mage_Admin_Model_User(); +$user->setData(array( + 'firstname' => 'firstname', + 'lastname' => 'lastname', + 'email' => 'admin@example.com', + 'username' => 'user', + 'password' => 'password', + 'is_active' => 1 +)); +$user->save(); + +$roleAdmin = new Mage_Admin_Model_Role(); +$roleAdmin->load('Administrators', 'role_name'); + +$roleUser = new Mage_Admin_Model_Role(); +$roleUser->setData(array( + 'parent_id' => $roleAdmin->getId(), + 'tree_level' => $roleAdmin->getTreeLevel() + 1, + 'role_type' => Mage_Admin_Model_Acl::ROLE_TYPE_USER, + 'user_id' => $user->getId(), + 'role_name' => $user->getFirstname(), +)); +$roleUser->save(); diff --git a/dev/tests/integration/testsuite/Mage/Adminhtml/Block/Report/Sales/Bestsellers/GridTest.php b/dev/tests/integration/testsuite/Mage/Adminhtml/Block/Report/Sales/Bestsellers/GridTest.php index 3cb9ace85a79df2fba49b4549de6e3a6b911f948..d72978c416e48a1f306caf87ada2db022db4de4e 100644 --- a/dev/tests/integration/testsuite/Mage/Adminhtml/Block/Report/Sales/Bestsellers/GridTest.php +++ b/dev/tests/integration/testsuite/Mage/Adminhtml/Block/Report/Sales/Bestsellers/GridTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Adminhtml * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Adminhtml/Block/Report/Sales/Coupons/GridTest.php b/dev/tests/integration/testsuite/Mage/Adminhtml/Block/Report/Sales/Coupons/GridTest.php index 36dbbc3e29625891379f7eec8ea2f79bfeb9b447..f166f446b188f9380085e9fcf348a73bba3f78dc 100644 --- a/dev/tests/integration/testsuite/Mage/Adminhtml/Block/Report/Sales/Coupons/GridTest.php +++ b/dev/tests/integration/testsuite/Mage/Adminhtml/Block/Report/Sales/Coupons/GridTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Adminhtml * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Adminhtml/Block/Report/Sales/Invoiced/GridTest.php b/dev/tests/integration/testsuite/Mage/Adminhtml/Block/Report/Sales/Invoiced/GridTest.php index 7efb87852f32f6ff7341f6d5d37c4a86b657ef5d..d82f557c367bc4c3025d12f64e6e7f578c00936c 100644 --- a/dev/tests/integration/testsuite/Mage/Adminhtml/Block/Report/Sales/Invoiced/GridTest.php +++ b/dev/tests/integration/testsuite/Mage/Adminhtml/Block/Report/Sales/Invoiced/GridTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Adminhtml * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Adminhtml/Block/Report/Sales/Refunded/GridTest.php b/dev/tests/integration/testsuite/Mage/Adminhtml/Block/Report/Sales/Refunded/GridTest.php index 7ba1a1de87d89dbed76b497256827a57e037daf7..04a7589e381cd89eef61d2dfa400846e138fee1c 100644 --- a/dev/tests/integration/testsuite/Mage/Adminhtml/Block/Report/Sales/Refunded/GridTest.php +++ b/dev/tests/integration/testsuite/Mage/Adminhtml/Block/Report/Sales/Refunded/GridTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Adminhtml * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Adminhtml/Block/Report/Sales/Sales/GridTest.php b/dev/tests/integration/testsuite/Mage/Adminhtml/Block/Report/Sales/Sales/GridTest.php index 4e0e96872d0b9a413e0efd187e1998f11dcc3c75..adf8b98a8b453cdfa20f4e9a56a69a823a8a980d 100644 --- a/dev/tests/integration/testsuite/Mage/Adminhtml/Block/Report/Sales/Sales/GridTest.php +++ b/dev/tests/integration/testsuite/Mage/Adminhtml/Block/Report/Sales/Sales/GridTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Adminhtml * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Adminhtml/Block/Report/Sales/Shipping/GridTest.php b/dev/tests/integration/testsuite/Mage/Adminhtml/Block/Report/Sales/Shipping/GridTest.php index ddde2b1b5bc08e03d82543609311a862f44c7f2b..f38a6b4428ae02026cf315fe5aa473357819b351 100644 --- a/dev/tests/integration/testsuite/Mage/Adminhtml/Block/Report/Sales/Shipping/GridTest.php +++ b/dev/tests/integration/testsuite/Mage/Adminhtml/Block/Report/Sales/Shipping/GridTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Adminhtml * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Adminhtml/Block/Report/Sales/Tax/GridTest.php b/dev/tests/integration/testsuite/Mage/Adminhtml/Block/Report/Sales/Tax/GridTest.php index fed831b7166842dbde912716208e8b84c26ffaf2..9a264ab2442239f1cf876f2516288789bff81ac7 100644 --- a/dev/tests/integration/testsuite/Mage/Adminhtml/Block/Report/Sales/Tax/GridTest.php +++ b/dev/tests/integration/testsuite/Mage/Adminhtml/Block/Report/Sales/Tax/GridTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Adminhtml * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Bundle/Model/ProductTest.php b/dev/tests/integration/testsuite/Mage/Bundle/Model/ProductTest.php index a334034e6a72ed508e2104ed69b7b9f6277d8f2c..97bf609b7ef11c41819462920bdc3b98ee5eb4ea 100644 --- a/dev/tests/integration/testsuite/Mage/Bundle/Model/ProductTest.php +++ b/dev/tests/integration/testsuite/Mage/Bundle/Model/ProductTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Block/Product/AbstractTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Block/Product/AbstractTest.php index 2be585437dc79c87828b21157f36e03fb03136bc..0f8a359470f1ef7b299cb2074c3377c0ce5f2fd8 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Block/Product/AbstractTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Block/Product/AbstractTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Block/Product/List/CrosssellTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Block/Product/List/CrosssellTest.php index 82ac3acb9b8067c486344d15a2c57a5e4c45fab7..f22b95d3d3d932b8a1d6a129da9875135165a932 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Block/Product/List/CrosssellTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Block/Product/List/CrosssellTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Block/Product/List/RelatedTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Block/Product/List/RelatedTest.php index 0077f65584f0fd104dee26908faef3639477d584..0bd2274b4932e66dd7e0092a22309b30ac47f173 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Block/Product/List/RelatedTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Block/Product/List/RelatedTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Block/Product/ListTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Block/Product/ListTest.php index 58e1f006586eeef45e7ddfd00c92b9e0012e3698..d3f1bfb733bdd5f61be2035fdec2d853b25bf97e 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Block/Product/ListTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Block/Product/ListTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Block/Product/NewTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Block/Product/NewTest.php index d704714a22343ef50686d616e958e8e6bf3d3848..573f44c3442c07f4564951cee75b2301c0865f79 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Block/Product/NewTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Block/Product/NewTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Block/Product/View/OptionsTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Block/Product/View/OptionsTest.php index bfca13d2007dd44c5f329d3762b5152397fab362..f452eb51a88919e81b2b3e3b76489f72d2eb04eb 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Block/Product/View/OptionsTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Block/Product/View/OptionsTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Block/Product/View/Type/ConfigurableTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Block/Product/View/Type/ConfigurableTest.php index 2b842f5671c778c9b13b685a53754c550b1aaaf0..107871af4bae0432940c30b337d26562168ab2a8 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Block/Product/View/Type/ConfigurableTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Block/Product/View/Type/ConfigurableTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Block/Product/ViewTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Block/Product/ViewTest.php index 8611f5705e9484c369f02fb7f0dee3f46bc9f8f7..2f702efdaeb8ba9bc58b094e94482db9a386f14a 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Block/Product/ViewTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Block/Product/ViewTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Helper/Category/FlatTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Helper/Category/FlatTest.php index d4ba437e16db87a63da51cd9f9abc53f261e74c1..d2f5fc1e241fc3af32a97cc842c6d3dece686c3f 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Helper/Category/FlatTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Helper/Category/FlatTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Helper/CategoryTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Helper/CategoryTest.php index c797f1be361714cfa512bce1229b0553e68e8bbe..3f5b327cd660272f94ea18b00e17979e4bdafdf3 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Helper/CategoryTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Helper/CategoryTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Helper/DataTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Helper/DataTest.php index 13c73ec415224b789b7daae35f000a53ad20cae2..b19d52b1c9e36178b0b94e4115a4a30c58f7c09b 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Helper/DataTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Helper/DataTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Helper/ImageTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Helper/ImageTest.php index 21beecba6df668fc575d6c7a4e10b2e94cabfd87..a807e55f7525f86a9d941c94474f7f070a1c3953 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Helper/ImageTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Helper/ImageTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Helper/MapTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Helper/MapTest.php index aaafc87880ed3584cf18b38cfe8c66c10d8ce872..e9933eec28c653483e6dc06971688d8786e2a061 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Helper/MapTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Helper/MapTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Helper/OutputTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Helper/OutputTest.php index 2a753b9e8834361c7bb3bf8176d2b34377100350..051156c558775c472636462abcf0ba18be5f2089 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Helper/OutputTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Helper/OutputTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Helper/Product/CompareTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Helper/Product/CompareTest.php index d1df320ddf081329f8e9a49f417ef6693b3a29a5..17c1af84744ed77a4478e09b88433df9bc40aba8 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Helper/Product/CompareTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Helper/Product/CompareTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Helper/Product/FlatTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Helper/Product/FlatTest.php index 1427e7559009bbe3bcd13f3d9453750ef9083b52..3bb352450b2bb0f13dc2515ae9c6ae4ad1b3a1ad 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Helper/Product/FlatTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Helper/Product/FlatTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Helper/Product/UrlTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Helper/Product/UrlTest.php index a9fe5754b2aff98aa0b6b8b378f73c2345fc19db..455e5476d8811e71fbafc77d0b9dd85bc5c10db7 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Helper/Product/UrlTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Helper/Product/UrlTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Helper/Product/ViewTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Helper/Product/ViewTest.php index c0d89cdd80e5edf89937a539f2869cfc56d36673..8a1221fe1a4069a7ad030f3c54f8f9ba87f320c9 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Helper/Product/ViewTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Helper/Product/ViewTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Helper/ProductTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Helper/ProductTest.php index e23a0cd82a497c76dd154a2a0d4ef9736aec8b11..67db56c06093925d96351c473d1d08086dac8c3d 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Helper/ProductTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Helper/ProductTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Model/AbstractTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Model/AbstractTest.php index a8c630ecce3ef735db839621f9ac6acda163992a..bf17bcb9767a09bf9bcdef78cad260d2dc945121 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Model/AbstractTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Model/AbstractTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Model/Category/Api/V2Test.php b/dev/tests/integration/testsuite/Mage/Catalog/Model/Category/Api/V2Test.php index 80522f14fd3204a07c7dad8cace33cfee5f9a2be..b3b5af045c01d069e4909dfa127272bad28baddb 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Model/Category/Api/V2Test.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Model/Category/Api/V2Test.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Model/Category/ApiTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Model/Category/ApiTest.php index f9a4577b30057a982b2102e82315d724be0e477f..7b0e6b00da4a1889045f64cf275a900e73594209 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Model/Category/ApiTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Model/Category/ApiTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Model/Category/Attribute/ApiTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Model/Category/Attribute/ApiTest.php index 46efa05cb14726adde79ff92a60c560f735d1819..551a2621fb7d0400fc08f06c5056cd565367e530 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Model/Category/Attribute/ApiTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Model/Category/Attribute/ApiTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Model/CategoryTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Model/CategoryTest.php index 4b3b54ba2017d5dbc6839b8996fae47bad0fca21..e7405acf0c64cb5d83e0ccfd679f6dfaa1cd67bf 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Model/CategoryTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Model/CategoryTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Model/CategoryTreeTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Model/CategoryTreeTest.php index 4268071d6fbde06bc2c155b466266446079e577c..bd8cc1aeaef9ef8ec6853af8b8d7f63d64835c35 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Model/CategoryTreeTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Model/CategoryTreeTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Model/Convert/Adapter/ProductTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Model/Convert/Adapter/ProductTest.php index ff877828a9c6174d1822fa3c4b1383983286209b..83f25abae1234d8783b05a5ac55c9cf2ddc1d599 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Model/Convert/Adapter/ProductTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Model/Convert/Adapter/ProductTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Model/DesignTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Model/DesignTest.php index ca4ea04e6c624a65581e9e7a901f04e1d3923f32..c1be6aa212bf06bf94040d1df9e51cdb56c96027 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Model/DesignTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Model/DesignTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Model/Layer/Filter/AttributeTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Model/Layer/Filter/AttributeTest.php index 69fbdae641a053a4d263ef695fe391fd13e27bfb..6c9b2787ea9c171f6b0a3cd1ce5ade55ca640f1c 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Model/Layer/Filter/AttributeTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Model/Layer/Filter/AttributeTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Model/Layer/Filter/CategoryTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Model/Layer/Filter/CategoryTest.php index 1e9c02f90cce5a6c37474dd7b2acf7b8948c8de8..ff6ff6b1ad3b6fd56e6cb6b2dcae5bd4ec3702b4 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Model/Layer/Filter/CategoryTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Model/Layer/Filter/CategoryTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Model/Layer/Filter/DecimalTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Model/Layer/Filter/DecimalTest.php index 771f3637b5014dc07bb5b3a6c8d53bdbf3b06607..cbf4054b8fd8379ae3af59cf241bd018b558cfed 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Model/Layer/Filter/DecimalTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Model/Layer/Filter/DecimalTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Model/Layer/Filter/ItemTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Model/Layer/Filter/ItemTest.php index a247f1e8304d0a7eac6b40abcda14cd35638c7a5..243778384d5f5719433baa9bdddc61400d540351 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Model/Layer/Filter/ItemTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Model/Layer/Filter/ItemTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Model/Layer/Filter/PriceTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Model/Layer/Filter/PriceTest.php index aa52072d86d6c420ca05db65bd5e815baae55268..4ae94c8722c938d8167c91f3990b729939eaaa3a 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Model/Layer/Filter/PriceTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Model/Layer/Filter/PriceTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -64,6 +64,7 @@ class Mage_Catalog_Model_Layer_Filter_PriceTest extends PHPUnit_Framework_TestCa */ public function testGetPriceRangeManual() { + $this->markTestIncomplete('MAGE-4937'); $this->assertEquals(15, $this->_model->getPriceRange()); } diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Model/Layer/Filter/_files/attribute_weight_filterable.php b/dev/tests/integration/testsuite/Mage/Catalog/Model/Layer/Filter/_files/attribute_weight_filterable.php index 1599e036819afe7513f0dce461fa0b32ade2bdba..11815f476cfe34529790ac47ae08851a01d5dded 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Model/Layer/Filter/_files/attribute_weight_filterable.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Model/Layer/Filter/_files/attribute_weight_filterable.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Model/Layer/Filter/_files/attribute_with_option.php b/dev/tests/integration/testsuite/Mage/Catalog/Model/Layer/Filter/_files/attribute_with_option.php index 29bd4595dfcc0d4d5debd696996670703d25ebd1..32b3fd71fc4aa5d0776a1b2c57c5bce01b4640d3 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Model/Layer/Filter/_files/attribute_with_option.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Model/Layer/Filter/_files/attribute_with_option.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Model/LayerTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Model/LayerTest.php index 42f8341ecef80b7ad599a9d759145f44b33186f0..fe2cc752345e7d1e138dd6813ae7fec4df7d8749 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Model/LayerTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Model/LayerTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Attribute/ApiTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Attribute/ApiTest.php index 97db160e8dbea272cc9761d8c20703ff214543aa..836ac67902bd3cda3ebf616d0926c3f7cae86cd1 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Attribute/ApiTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Attribute/ApiTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Attribute/Backend/MediaTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Attribute/Backend/MediaTest.php index c34150e225d883f30487bd811cd97c105fdb7c8d..ee62db19a2bf0814453df76aa45123dcd526d3d3 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Attribute/Backend/MediaTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Attribute/Backend/MediaTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Attribute/Backend/PriceTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Attribute/Backend/PriceTest.php index f16bf60c9db637c8c0302009f7d24e5cb556ee37..02a3dae18fffcd377a0d14b63524c16842e736d1 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Attribute/Backend/PriceTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Attribute/Backend/PriceTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Attribute/Backend/TierpriceTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Attribute/Backend/TierpriceTest.php index b942eee43e628a70569c1b6414be9eecba13bb98..983ea6c9136ebf447b5d5e30cab042ce142b03f4 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Attribute/Backend/TierpriceTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Attribute/Backend/TierpriceTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Attribute/Media/ApiTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Attribute/Media/ApiTest.php index 847f5113a49a7e289f5f178fffb047747ba3db77..54b7306a86275ba60ba66d82f00c55e034ffa5e7 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Attribute/Media/ApiTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Attribute/Media/ApiTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Attribute/Tierprice/Api/V2Test.php b/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Attribute/Tierprice/Api/V2Test.php index ab3957dbd5dbd5899802b75a085547e31832b9a1..8a417047b14c28311a82e10c7008186d4d90ef36 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Attribute/Tierprice/Api/V2Test.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Attribute/Tierprice/Api/V2Test.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Attribute/Tierprice/ApiTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Attribute/Tierprice/ApiTest.php index a3640cc9dbd28af56b7576108e799e9acfa48e99..f6c81d1eea2a77adb129306e5e40f634776ea1c2 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Attribute/Tierprice/ApiTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Attribute/Tierprice/ApiTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/ImageTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/ImageTest.php index a47d613a3e2ba931cd6538177a8a132924866570..0b244cd11fa12fe68b41915f4ca875bf4f6798b5 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/ImageTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/ImageTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Type/AbstractTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Type/AbstractTest.php index a9a08aa2e0f8f368c1f172c3f92accc542ee79c1..fd6f3c8d03f22107ac5c93566c3d0659103ce8fa 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Type/AbstractTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Type/AbstractTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Type/ApiTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Type/ApiTest.php index cd1d0c9f896247dd18b770e3fb1a6bcb9e09835c..6bb14d545ef1ccd222f2e5ba37ee911769966bf6 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Type/ApiTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Type/ApiTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Type/Configurable/AttributeTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Type/Configurable/AttributeTest.php index a113322dba5932d9f160f3e577feb838bfef25f0..94062b5bb8836de67b920b08667728f852bd07de 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Type/Configurable/AttributeTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Type/Configurable/AttributeTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Type/Configurable/PriceTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Type/Configurable/PriceTest.php index bc7b8d0feab881d7d0efc714723c7fc16ab29f09..5ed2a7e4049e7afef5981117df84d2bc3d0e0bf7 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Type/Configurable/PriceTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Type/Configurable/PriceTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Type/ConfigurableTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Type/ConfigurableTest.php index 2121d34905857eaa1b9a54782da15259606ce6d5..8e4d673b2b0771781d3f8c88a65f478a7251b370 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Type/ConfigurableTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Type/ConfigurableTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Type/PriceTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Type/PriceTest.php index 2c38bd59b57c0f3726944bc2d688f43ce048fa54..12b93ccd3c6ac081017193f13b397678b82216d5 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Type/PriceTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Type/PriceTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Type/VirtualTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Type/VirtualTest.php index 7742dfe4ff3758be9cd67b5ab8643dfb783ff17b..1bd2f32d7e7a85c3d309d705e0d7b45df68c33db 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Type/VirtualTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Type/VirtualTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/TypeTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/TypeTest.php index 1c938608d145fbfa8a7001e3bea59892567e3507..40e83e4a087f98d13289675053fb54cf1655d6e4 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/TypeTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/TypeTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/UrlTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/UrlTest.php index 525cb60abc36aa1f2b6835f5d7240d347dfca03e..a75684fedcade4a0ab4756ae02fb1415cc3f74e1 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/UrlTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Model/Product/UrlTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Model/ProductExternalTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Model/ProductExternalTest.php index ff05d5a6d90f817cb928bd0612cd3c7f353064ce..65757063690b7ae635be8abe38f06915dde3b3ba 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Model/ProductExternalTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Model/ProductExternalTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Model/ProductGettersTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Model/ProductGettersTest.php index 8c1e32e5a658bdac7ccfe607c45b4ae618ad731c..1f4dea052b0139062f135dddffdd6c21858bdabf 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Model/ProductGettersTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Model/ProductGettersTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Model/ProductPriceTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Model/ProductPriceTest.php index 8bdd0ad055f26ebb90f888ac62ceee59b23d2a5d..4dbb640bdbfa01ed58e0489fa0feb8b58108c577 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Model/ProductPriceTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Model/ProductPriceTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Model/ProductTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Model/ProductTest.php index 96d97f948629af88b35bdf3244719b32d510f9ca..73db51a690e48ec005d51eb286d05aeccb0c7079 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Model/ProductTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Model/ProductTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Model/Resource/Eav/AttributeTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Model/Resource/Eav/AttributeTest.php index 478a0f9d388a70eb7c78c11e8df2d516b05d1298..fc65e8656e36c889250d2cf303a3ff16ef993e16 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Model/Resource/Eav/AttributeTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Model/Resource/Eav/AttributeTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Model/Resource/Product/CollectionTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Model/Resource/Product/CollectionTest.php index 51637e912eb39b802ebd06adee1202ec662e8935..e02774fd64330350684e6e3628543ae227a5a7c9 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Model/Resource/Product/CollectionTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Model/Resource/Product/CollectionTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Model/Resource/UrlTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Model/Resource/UrlTest.php new file mode 100644 index 0000000000000000000000000000000000000000..35bab86534d78accf3af7d1a5d972bb9914d5c27 --- /dev/null +++ b/dev/tests/integration/testsuite/Mage/Catalog/Model/Resource/UrlTest.php @@ -0,0 +1,51 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Catalog + * @subpackage integration_tests + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * @group module:Mage_Catalog + */ +class Mage_Catalog_Model_Resource_UrlTest extends PHPUnit_Framework_TestCase +{ + /** + * @var Mage_Catalog_Model_Resource_Url + */ + protected $_model; + + protected function setUp() + { + $this->_model = new Mage_Catalog_Model_Resource_Url(); + } + + /** + * @magentoDataFixture Mage/Catalog/Model/Resource/_files/url_rewrites.php + */ + public function testGetLastUsedRewriteRequestIncrement() + { + $this->markTestIncomplete('Bug MAGETWO-724'); + $this->assertEquals(1000, $this->_model->getLastUsedRewriteRequestIncrement('url-key-', '.html', 1)); + } +} diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Model/Resource/_files/url_rewrites.php b/dev/tests/integration/testsuite/Mage/Catalog/Model/Resource/_files/url_rewrites.php new file mode 100644 index 0000000000000000000000000000000000000000..20117f79bdae0c547183edebd9e97d8bce7f5764 --- /dev/null +++ b/dev/tests/integration/testsuite/Mage/Catalog/Model/Resource/_files/url_rewrites.php @@ -0,0 +1,67 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Mage_Catalog + * @subpackage integration_tests + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +$category = new Mage_Catalog_Model_Category(); +$category->setId(3) + ->setName('Category 1') + ->setParentId(2) /**/ + ->setPath('1/2/3') + ->setLevel(2) + ->setAvailableSortBy('name') + ->setDefaultSortBy('name') + ->setIsActive(true) + ->setPosition(1) + ->save(); + +$urlKeys = array( + 'url-key-', + 'url-key-1', + 'url-key-2', + 'url-key-5', + 'url-key-1000', + 'url-key-999', + 'url-key-asdf', +); + +foreach ($urlKeys as $i => $urlKey) { + $id = $i + 1; + $product = new Mage_Catalog_Model_Product(); + $product->setTypeId(Mage_Catalog_Model_Product_Type::TYPE_SIMPLE) + ->setId($id) + ->setStoreId(1) + ->setAttributeSetId(4) + ->setWebsiteIds(array(1)) + ->setName('Simple Product ' . $id) + ->setSku('simple-' . $id) + ->setPrice(10) + ->setCategoryIds(array(3)) + ->setVisibility(Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH) + ->setStatus(Mage_Catalog_Model_Product_Status::STATUS_ENABLED) + ->setUrlKey($urlKey) + ->setUrlPath($urlKey . '.html') + ->save(); +} diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Model/UrlTest.php b/dev/tests/integration/testsuite/Mage/Catalog/Model/UrlTest.php index 69d4c580fb2bcece1a46f3bd69a91b31cb733e25..f53bba842d84796764d5685788fe644a721a13ee 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Model/UrlTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/Model/UrlTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/WidgetTest.php b/dev/tests/integration/testsuite/Mage/Catalog/WidgetTest.php index b3ca950192f1c0c2b8707ce7bb5e67ed66098ec0..1b6a6157404a5c35b3321ef8908fb8cafa09c031 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/WidgetTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/WidgetTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/_files/categories.php b/dev/tests/integration/testsuite/Mage/Catalog/_files/categories.php index f1dcd00f5a556433f2f52f47a0c14db623e20033..9468bc840d5a4096604e2fcf0fd727701682bf76 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/_files/categories.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/_files/categories.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/_files/product_configurable.php b/dev/tests/integration/testsuite/Mage/Catalog/_files/product_configurable.php index 01c30ac8197a346e3ab9c4234411908666321a54..ad77e378572ad404ea0b6c524765df33704c6b7f 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/_files/product_configurable.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/_files/product_configurable.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/_files/product_image.php b/dev/tests/integration/testsuite/Mage/Catalog/_files/product_image.php index 1f9d82a80fb0b02e6c942462fff52dae18b87b91..04470048fa990eeaf64671d5ef0932bbdc5d15ba 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/_files/product_image.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/_files/product_image.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/_files/product_image_rollback.php b/dev/tests/integration/testsuite/Mage/Catalog/_files/product_image_rollback.php index d930a0e151f8ebbf3fb8663c32bb0b5394fcf603..8adc74d0a3af525f01ed035dc8e07bdb66b3de76 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/_files/product_image_rollback.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/_files/product_image_rollback.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/_files/product_simple.php b/dev/tests/integration/testsuite/Mage/Catalog/_files/product_simple.php index b015936a82d371ba99fd3737033365bd826e86c2..3625859943efe9584b53b34914d47bda812e0c77 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/_files/product_simple.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/_files/product_simple.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/_files/product_with_image.php b/dev/tests/integration/testsuite/Mage/Catalog/_files/product_with_image.php index d4254639e75353a47b453ab4d72be693d529f957..c0d621c7f6059aeb1e607221279c7645df81f295 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/_files/product_with_image.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/_files/product_with_image.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/_files/product_with_image_rollback.php b/dev/tests/integration/testsuite/Mage/Catalog/_files/product_with_image_rollback.php index 355443c01975a53a345b11713847daca9eff0eef..b026d20cb961af2b8d70e2396fadbc77d880f0a9 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/_files/product_with_image_rollback.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/_files/product_with_image_rollback.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/_files/products.php b/dev/tests/integration/testsuite/Mage/Catalog/_files/products.php index 249e5c67a5d47a8aa857e135ca1216a05954f601..c026a37deefa1078b207a5b03e0cbad2d6d73b1a 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/_files/products.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/_files/products.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/_files/products_crosssell.php b/dev/tests/integration/testsuite/Mage/Catalog/_files/products_crosssell.php index 72e3af3f17a55f587b75657515b4c1198f30d8c5..70006cd26386b89e98a7835e959b4d0bd4a99fc5 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/_files/products_crosssell.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/_files/products_crosssell.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/_files/products_new.php b/dev/tests/integration/testsuite/Mage/Catalog/_files/products_new.php index 0128b5055b78f412577c8f37dc1358c3974e8214..98e99144ad5bd6a6f190153cd202ba4a8e773dae 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/_files/products_new.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/_files/products_new.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/_files/products_related.php b/dev/tests/integration/testsuite/Mage/Catalog/_files/products_related.php index a6fb9cfc14acdf4390c9ed06af6e3c0a4805be34..a0735c892f0efc37055aa083204e661b4f441ed8 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/_files/products_related.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/_files/products_related.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/_files/two_products.php b/dev/tests/integration/testsuite/Mage/Catalog/_files/two_products.php index 94005394ab3edd95cb6f62e347b4230d0650d7cd..ba361be241b71951062a2b8aa2aa912fb15219ad 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/_files/two_products.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/_files/two_products.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/_files/url_rewrites.php b/dev/tests/integration/testsuite/Mage/Catalog/_files/url_rewrites.php index c499dfe9dc981d80540de8943cd9146f29a4d6a8..0d03fda1f72af22705991e3e11154099f3f15d65 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/_files/url_rewrites.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/_files/url_rewrites.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/_files/url_rewrites_invalid.php b/dev/tests/integration/testsuite/Mage/Catalog/_files/url_rewrites_invalid.php index a58c5b026e417240423ece93eab823ef6f0ec9da..cb2137b79ab03bd6ac1b5862797d992709d81dbb 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/_files/url_rewrites_invalid.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/_files/url_rewrites_invalid.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/controllers/CategoryControllerTest.php b/dev/tests/integration/testsuite/Mage/Catalog/controllers/CategoryControllerTest.php index 0c6836b156fb32e428943baee0e54eb477139c18..2c1d1fca09f9e6c2bd4533dde388b24f3fb6b4b2 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/controllers/CategoryControllerTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/controllers/CategoryControllerTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/controllers/IndexControllerTest.php b/dev/tests/integration/testsuite/Mage/Catalog/controllers/IndexControllerTest.php index f534272384ef4663e036fe1cdfae945e43650e8a..23942bbce9c6e755a35dc4a1ab3915277cfc62a9 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/controllers/IndexControllerTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/controllers/IndexControllerTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/controllers/Product/CompareControllerTest.php b/dev/tests/integration/testsuite/Mage/Catalog/controllers/Product/CompareControllerTest.php index ba251f42b5ff73a92d6d83cd6c500acd8659d5ae..b41bfb5e8b3dc2b9953a3bb39c377f9049a22f47 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/controllers/Product/CompareControllerTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/controllers/Product/CompareControllerTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/controllers/ProductControllerTest.php b/dev/tests/integration/testsuite/Mage/Catalog/controllers/ProductControllerTest.php index ec0ab31c807fb083ed63fde26f19c3f5d9fc4bd5..9f82f4bebdab850ea44dd29580d107c8d1fbc683 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/controllers/ProductControllerTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/controllers/ProductControllerTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/controllers/Seo/SitemapControllerTest.php b/dev/tests/integration/testsuite/Mage/Catalog/controllers/Seo/SitemapControllerTest.php index 32d4c2903e7ae493977aefa3c3dca91b89992f0d..1e18d444c3359e98c7a6724abb59cbe8d4183e43 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/controllers/Seo/SitemapControllerTest.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/controllers/Seo/SitemapControllerTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/controllers/_files/products.php b/dev/tests/integration/testsuite/Mage/Catalog/controllers/_files/products.php index 3d742ba8f9a265e371676f10dbc15f89776c2b99..1370bbbb1d547944d6f1acad1857391b5533b428 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/controllers/_files/products.php +++ b/dev/tests/integration/testsuite/Mage/Catalog/controllers/_files/products.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/CatalogInventory/Model/Stock/ItemTest.php b/dev/tests/integration/testsuite/Mage/CatalogInventory/Model/Stock/ItemTest.php index 7d7a96ad14f8b7c1c7bb661ccc8de147cb0a9483..224358890256b0bbcc8581f83895007f881e9154 100644 --- a/dev/tests/integration/testsuite/Mage/CatalogInventory/Model/Stock/ItemTest.php +++ b/dev/tests/integration/testsuite/Mage/CatalogInventory/Model/Stock/ItemTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_CatalogInventory * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/CatalogSearch/Block/TermTest.php b/dev/tests/integration/testsuite/Mage/CatalogSearch/Block/TermTest.php index d53fa303491d9b0c1d62d9dd0547b9e2df54873e..45cb142857b83311fbd60e350922e480afdaaf3a 100644 --- a/dev/tests/integration/testsuite/Mage/CatalogSearch/Block/TermTest.php +++ b/dev/tests/integration/testsuite/Mage/CatalogSearch/Block/TermTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_CatalogSearch * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/CatalogSearch/Helper/DataTest.php b/dev/tests/integration/testsuite/Mage/CatalogSearch/Helper/DataTest.php index 45ee4143e5b99938589ab454c93607e77b1d4c6b..0ded32d16defcaaab3a24d8f764cbbb2c96ff671 100644 --- a/dev/tests/integration/testsuite/Mage/CatalogSearch/Helper/DataTest.php +++ b/dev/tests/integration/testsuite/Mage/CatalogSearch/Helper/DataTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_CatalogSearch * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Checkout/Block/Cart/Item/RendererTest.php b/dev/tests/integration/testsuite/Mage/Checkout/Block/Cart/Item/RendererTest.php index 764cf6cd5efb21776ad1ac1ca8641fedc3b55b53..4137742064898969eea1b1fce1ae7585a7f32479 100644 --- a/dev/tests/integration/testsuite/Mage/Checkout/Block/Cart/Item/RendererTest.php +++ b/dev/tests/integration/testsuite/Mage/Checkout/Block/Cart/Item/RendererTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Checkout * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Cms/Block/BlockTest.php b/dev/tests/integration/testsuite/Mage/Cms/Block/BlockTest.php index 0a8a825c7c1761ea33d7fb3369b318d2fdf8d053..72de4b406ea2afb1684b50bbb99d19dec4be3496 100644 --- a/dev/tests/integration/testsuite/Mage/Cms/Block/BlockTest.php +++ b/dev/tests/integration/testsuite/Mage/Cms/Block/BlockTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Cms * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Cms/Block/Widget/BlockTest.php b/dev/tests/integration/testsuite/Mage/Cms/Block/Widget/BlockTest.php index f96f22f10c38f637a803d6ab79c989456948f595..d7d101c5cec680b64240e3dad5f537a3a2783363 100644 --- a/dev/tests/integration/testsuite/Mage/Cms/Block/Widget/BlockTest.php +++ b/dev/tests/integration/testsuite/Mage/Cms/Block/Widget/BlockTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Cms * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Cms/Helper/PageTest.php b/dev/tests/integration/testsuite/Mage/Cms/Helper/PageTest.php index 7978a58d824438b022a8de712431d5b499dbb50e..fba25852f20db0ec176a6d3b7759930710dfd140 100644 --- a/dev/tests/integration/testsuite/Mage/Cms/Helper/PageTest.php +++ b/dev/tests/integration/testsuite/Mage/Cms/Helper/PageTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Cms * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Cms/Model/Wysiwyg/ConfigTest.php b/dev/tests/integration/testsuite/Mage/Cms/Model/Wysiwyg/ConfigTest.php index 985f76bd6cbb8fc20d9a6ea706e571a966820b59..2c504f06dd192561125a5aa2c877e0b0d9c9eb07 100644 --- a/dev/tests/integration/testsuite/Mage/Cms/Model/Wysiwyg/ConfigTest.php +++ b/dev/tests/integration/testsuite/Mage/Cms/Model/Wysiwyg/ConfigTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Cms/Model/Wysiwyg/Images/StorageTest.php b/dev/tests/integration/testsuite/Mage/Cms/Model/Wysiwyg/Images/StorageTest.php index 0bb49cd103224cd98c616640cd25d47e8b2ddcc5..4a4ad02c296f4adf75470eb120f442f122127b35 100644 --- a/dev/tests/integration/testsuite/Mage/Cms/Model/Wysiwyg/Images/StorageTest.php +++ b/dev/tests/integration/testsuite/Mage/Cms/Model/Wysiwyg/Images/StorageTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Cms * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Cms/_files/block.php b/dev/tests/integration/testsuite/Mage/Cms/_files/block.php index 80a714c0b0e52f637b7d6f4c0e9fb527865500e6..e7a3a0d2f3651806934fe3ee1c9f618c05590f60 100644 --- a/dev/tests/integration/testsuite/Mage/Cms/_files/block.php +++ b/dev/tests/integration/testsuite/Mage/Cms/_files/block.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Cms * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Cms/_files/pages.php b/dev/tests/integration/testsuite/Mage/Cms/_files/pages.php index d4f6b1b1298b0ba941bd043741198366d5a23693..200e7a2458f476e7a52019551213214de5259935 100644 --- a/dev/tests/integration/testsuite/Mage/Cms/_files/pages.php +++ b/dev/tests/integration/testsuite/Mage/Cms/_files/pages.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Cms * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Cms/controllers/PageControllerTest.php b/dev/tests/integration/testsuite/Mage/Cms/controllers/PageControllerTest.php index 6a0a4cdb8387bf6f5922fe7fa5c627dc6ab8639c..2fad5dd8bb43a28223287fc58fdc3da7dbec93bd 100644 --- a/dev/tests/integration/testsuite/Mage/Cms/controllers/PageControllerTest.php +++ b/dev/tests/integration/testsuite/Mage/Cms/controllers/PageControllerTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Cms * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Block/AbstractTest.php b/dev/tests/integration/testsuite/Mage/Core/Block/AbstractTest.php index 288dde0b6fc9601899eb0c1302696232767f10f0..19a235e43a44ae0191a5db9d0c08ae42e6b7fb30 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Block/AbstractTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Block/AbstractTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Block/TemplateTest.php b/dev/tests/integration/testsuite/Mage/Core/Block/TemplateTest.php index 0921818c69170dad8c71dbef5cc6fb6d894e34f6..ef9acf10b8cfb644a0534c17b75ef814e985a0ff 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Block/TemplateTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Block/TemplateTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Block/TextTest.php b/dev/tests/integration/testsuite/Mage/Core/Block/TextTest.php index 0873f3457c791640097843589e81795914c8f2ec..65de66e8e9c40a0350a14be3981f13644f2da1be 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Block/TextTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Block/TextTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Block/_files/adminhtml/default/default/Mage_Core/dummy.phtml b/dev/tests/integration/testsuite/Mage/Core/Block/_files/adminhtml/default/default/Mage_Core/dummy.phtml index 5f5594b334f34d7bbf4b525eed1a5e49c6273219..a8be76c89682c6cb074fc316b585bdb99e85bc0b 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Block/_files/adminhtml/default/default/Mage_Core/dummy.phtml +++ b/dev/tests/integration/testsuite/Mage/Core/Block/_files/adminhtml/default/default/Mage_Core/dummy.phtml @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/dev/tests/integration/testsuite/Mage/Core/Block/_files/frontend/default/default/Mage_Core/dummy.phtml b/dev/tests/integration/testsuite/Mage/Core/Block/_files/frontend/default/default/Mage_Core/dummy.phtml index 5f5594b334f34d7bbf4b525eed1a5e49c6273219..a8be76c89682c6cb074fc316b585bdb99e85bc0b 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Block/_files/frontend/default/default/Mage_Core/dummy.phtml +++ b/dev/tests/integration/testsuite/Mage/Core/Block/_files/frontend/default/default/Mage_Core/dummy.phtml @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/dev/tests/integration/testsuite/Mage/Core/Block/_files/template_test_assign.phtml b/dev/tests/integration/testsuite/Mage/Core/Block/_files/template_test_assign.phtml index cb8ea7316d6210aca3e2e2feaa6f46b67755c38b..4244ad4290f7488e6a12f49d3fc853721e20be42 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Block/_files/template_test_assign.phtml +++ b/dev/tests/integration/testsuite/Mage/Core/Block/_files/template_test_assign.phtml @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/dev/tests/integration/testsuite/Mage/Core/Controller/RequestHttpTest.php b/dev/tests/integration/testsuite/Mage/Core/Controller/RequestHttpTest.php index 52137a42f7fcf4b23d00fdac2e03ce5a60f7751b..858c98152e6ff57c84208a5cfe791ebd4d315f1e 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Controller/RequestHttpTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Controller/RequestHttpTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Controller/Varien/ActionTest.php b/dev/tests/integration/testsuite/Mage/Core/Controller/Varien/ActionTest.php index 3b273148b173c2cfe57fd66fd5c752647b0af7c9..c175acf053f85bf150cc36a81a84263b6d81f19f 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Controller/Varien/ActionTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Controller/Varien/ActionTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Controller/Varien/FrontTest.php b/dev/tests/integration/testsuite/Mage/Core/Controller/Varien/FrontTest.php index 7701a7bec20271353d8b69d7cd1c3ca9661d8be8..c86a776b16f72ef0da061d4f8551e37116953351 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Controller/Varien/FrontTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Controller/Varien/FrontTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Controller/Varien/Router/StandardTest.php b/dev/tests/integration/testsuite/Mage/Core/Controller/Varien/Router/StandardTest.php index 97d9509fd4ad7c23b17a47f84841a0ed04152c33..3916e1fb0eb510eb2acfed12cfb63c025070dc9b 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Controller/Varien/Router/StandardTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Controller/Varien/Router/StandardTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Helper/AbstractTest.php b/dev/tests/integration/testsuite/Mage/Core/Helper/AbstractTest.php index 522710d079393b6cccf17eb97cb5b2ff56407599..360bcae3555adccbeb82180a86c8bd99acd9f1d1 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Helper/AbstractTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Helper/AbstractTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -113,6 +113,20 @@ class Mage_Core_Helper_AbstractTest extends PHPUnit_Framework_TestCase $this->assertEquals($expected[0], $this->_helper->jsQuoteEscape($data[0])); } + /** + * @covers Mage_Core_Helper_Abstract::quoteEscape + */ + public function testQuoteEscape() + { + $data = "Text with 'single' and \"double\" quotes"; + $expected = array( + "Text with 'single' and "double" quotes", + "Text with \\'single\\' and \\"double\\" quotes", + ); + $this->assertEquals($expected[0], $this->_helper->quoteEscape($data)); + $this->assertEquals($expected[1], $this->_helper->quoteEscape($data, true)); + } + public function testSetGetLayout() { $this->assertNull($this->_helper->getLayout()); diff --git a/dev/tests/integration/testsuite/Mage/Core/Helper/DataTest.php b/dev/tests/integration/testsuite/Mage/Core/Helper/DataTest.php index b3dd782a91cc7e7a218821f4013ccab3e22f2f4e..923d9670c7ee1b82afe0e40782df6615a45910c8 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Helper/DataTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Helper/DataTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -256,7 +256,7 @@ XML; /** * @param array $array * @param string $rootName - * @expectedException Exception + * @expectedException Magento_Exception * @dataProvider assocToXmlExceptionDataProvider */ public function testAssocToXmlException($array, $rootName = '_') diff --git a/dev/tests/integration/testsuite/Mage/Core/Helper/HttpTest.php b/dev/tests/integration/testsuite/Mage/Core/Helper/HttpTest.php index 4cfa73c71e725efd5b5e37526b5cc3e550964a86..264a377b95bae45eb9139c194ba4e45cf6ae892f 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Helper/HttpTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Helper/HttpTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Helper/JsTest.php b/dev/tests/integration/testsuite/Mage/Core/Helper/JsTest.php index b7f9c11f88ac78eab87d22aa29698a60f0d72b53..8c54e49bc4fba9656164d6939d42f0ed44ce649d 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Helper/JsTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Helper/JsTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -39,7 +39,7 @@ class Mage_Core_Helper_JsTest extends PHPUnit_Framework_TestCase public function setUp() { - $this->_helper = new Mage_Core_Helper_Js; + $this->_helper = new Mage_Core_Helper_Js(); } public function testGetTranslateJson() diff --git a/dev/tests/integration/testsuite/Mage/Core/Helper/StringTest.php b/dev/tests/integration/testsuite/Mage/Core/Helper/StringTest.php index b1301691338a2d3528cc392b136b6fb628119fea..7c425838b11d562309d30b5f59cc02dc3edd45be 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Helper/StringTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Helper/StringTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Helper/Url/RewriteTest.php b/dev/tests/integration/testsuite/Mage/Core/Helper/Url/RewriteTest.php index d6c917253eecd140c994bb55d7c7c5af5c1696fd..0adc229d8c210ac0077ffa5e10c2ba95c32fd581 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Helper/Url/RewriteTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Helper/Url/RewriteTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Helper/UrlTest.php b/dev/tests/integration/testsuite/Mage/Core/Helper/UrlTest.php index d2703f3f78f3fa264e1dc25e0531d1dca5f76c88..8ae6e207217c47a3bbd3eeb4016b3532e5d47d09 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Helper/UrlTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Helper/UrlTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/App/AreaTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/App/AreaTest.php index 21b115cae05fd16f5990ba44f426f91b04b1280f..046dd274355ec7896012541d924f5094a7343652 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/App/AreaTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/App/AreaTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/AppTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/AppTest.php index e97a8dd1a3f1287c1d129c398a659e9855333452..b3be327bba2c2e14d6e63323592ef64be7e3b358 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/AppTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/AppTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/CacheTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/CacheTest.php index 0d20b426e6fbdab311d90d3010f307b43504fe89..950e68d8d917cea1409b6442ca3d50f812c72e64 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/CacheTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/CacheTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -70,6 +70,34 @@ class Mage_Core_Model_CacheTest extends PHPUnit_Framework_TestCase ); } + /** + * @param string $optionCode + * @param string $extensionRequired + * @dataProvider backendTwoLevelsDataProvider + */ + public function testBackendTwoLevels($optionCode, $extensionRequired) + { + if ($extensionRequired) { + if (!extension_loaded($extensionRequired)) { + $this->markTestSkipped("The PHP extension '{$extensionRequired}' is required for this test."); + } + } + $model = new Mage_Core_Model_Cache(array('backend' => $optionCode)); + $backend = $model->getFrontend()->getBackend(); + $this->assertInstanceOf('Zend_Cache_Backend_TwoLevels', $backend); + } + + /** + * @return array + */ + public function backendTwoLevelsDataProvider() + { + return array( + array('Memcached', 'memcached'), + array('Memcached', 'memcache'), + ); + } + public function testGetFrontend() { $frontend = $this->_model->getFrontend(); @@ -270,6 +298,7 @@ class Mage_Core_Model_CacheTest extends PHPUnit_Framework_TestCase Mage_Core_Model_CacheTestRequestProcessor::$isEnabled = true; $this->assertTrue($model->processRequest()); } + } class Mage_Core_Model_CacheTestRequestProcessor diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/Config/BaseTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/Config/BaseTest.php index a793d2d0e1d0b5030d829cb56d638265afc58f69..cfa39f23177543e56c08fdf037e89730e358b834 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/Config/BaseTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/Config/BaseTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/Config/DataTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/Config/DataTest.php index bd246a1fb7af606d7e59582dfccccb6174f17fcc..977cebc839602b60a0b5d82887877fed667044e3 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/Config/DataTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/Config/DataTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/Config/ElementTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/Config/ElementTest.php index 8578d88800dbe92e5be46f88107181cadd2ba063..b1293f42bba888713bbd2cfae0af8dd7d5e31275 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/Config/ElementTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/Config/ElementTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/Config/FieldsetTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/Config/FieldsetTest.php index f251c0bf4f4d2759fa2a1ec2a257d13470e115f4..a2baa9579b43c8f8ec29069edd2e9959b1c1f6d6 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/Config/FieldsetTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/Config/FieldsetTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/Config/OptionsTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/Config/OptionsTest.php index 3bf988490c31d296754675cbbbf08145e9163cb9..b59577e8d9e86beb667e06e2bb17ea1d3bf50bb4 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/Config/OptionsTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/Config/OptionsTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -78,7 +78,7 @@ class Mage_Core_Model_Config_OptionsTest extends PHPUnit_Framework_TestCase } /** - * @expectedException Exception + * @expectedException Mage_Core_Exception */ public function testGetDirException() { diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/Config/SystemTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/Config/SystemTest.php index 48d524b672cb8b22165a4323674debcc7cf9e267..09bc4bbebf76b048c6282f9ee91b13c27241f214 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/Config/SystemTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/Config/SystemTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/ConfigFactoryTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/ConfigFactoryTest.php index dcf8d6b7d843ff060f096daec1e34e0c90b56ce9..620ea2b3e9e896133f48b92971a140e6acfa8bd7 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/ConfigFactoryTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/ConfigFactoryTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/ConfigTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/ConfigTest.php index 438b4ef0ea9babe4f1254ee9ed98b1308ec5f8fd..ac66c624734e79f045bf607cb32d2b7ea70e490a 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/ConfigTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/ConfigTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/Design/Backend/ExceptionsTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/Design/Backend/ExceptionsTest.php index 2824c845ee190d07015c1c0698a29b24a1eb5866..c8e0e1717961952fabfaa06cbd88a23f5daa9141 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/Design/Backend/ExceptionsTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/Design/Backend/ExceptionsTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/Design/PackageMergingTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/Design/PackageMergingTest.php index 667f5ed8c1906f4eaa6d93da6e8f17768d73c532..765ea62f33718b6e32d01b1be5ab529cd13c3dbc 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/Design/PackageMergingTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/Design/PackageMergingTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -68,7 +68,7 @@ class Mage_Core_Model_Design_PackageMergingTest extends PHPUnit_Framework_TestCa /** * @magentoConfigFixture current_store dev/css/merge_css_files 1 - * @expectedException Exception + * @expectedException Magento_Exception */ public function testMergeFilesException() { diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/Design/PackageTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/Design/PackageTest.php index d464078dcb03fa04f048dfc468b982daed38b441..6a92944596f076405c2f28a3baa8ebdb5553f587 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/Design/PackageTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/Design/PackageTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -194,9 +194,9 @@ class Mage_Core_Model_Design_PackageTest extends PHPUnit_Framework_TestCase 'ru_RU', ), 'lib skin file inside theme' => array( - 'varien/product.js', + 'jquery/jquery-no-conflict.js', array('_skin' => 'theme_nested_skin'), - $prefix . 'custom_theme/skin/theme_nested_skin/varien/product.js', + $prefix . 'custom_theme/skin/theme_nested_skin/jquery/jquery-no-conflict.js', ), 'primary theme fallback - same theme & default skin' => array( 'fixture_script_two.js', @@ -214,9 +214,9 @@ class Mage_Core_Model_Design_PackageTest extends PHPUnit_Framework_TestCase $prefix . 'default/skin/default/fixture_script_four.js', ), 'lib fallback' => array( - 'varien/product.js', + 'jquery/jquery-no-conflict.js', array('_skin' => 'default'), - '%s/pub/js/varien/product.js', + '%s/pub/js/jquery/jquery-no-conflict.js', ), ); } @@ -325,7 +325,7 @@ class Mage_Core_Model_Design_PackageTest extends PHPUnit_Framework_TestCase /** * @param string $file - * @expectedException Exception + * @expectedException Magento_Exception * @dataProvider getSkinUrlDataExceptionProvider */ public function testGetSkinUrlException($file) @@ -339,17 +339,15 @@ class Mage_Core_Model_Design_PackageTest extends PHPUnit_Framework_TestCase public function getSkinUrlDataExceptionProvider() { return array( - // non-existing theme file - array('path/to/nonexisting-file.ext'), - // non-existing module file - array('Some_Module::path/to/nonexisting-file.ext'), + 'non-existing theme file' => array('path/to/nonexisting-file.ext'), + 'non-existing module file' => array('Some_Module::path/to/nonexisting-file.ext'), ); } /** * @param string $file - * @expectedException Exception + * @expectedException Magento_Exception * @dataProvider findFileExceptionDataProvider */ public function testFindFileException($file) diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/Design/Source/DesignTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/Design/Source/DesignTest.php index 4dddcd4c947466c544cbee8f62f0050806062633..41a223e9115de55ca92aa8fa7bef3b4698ccfca3 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/Design/Source/DesignTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/Design/Source/DesignTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/Design/Source/_files/design/frontend/a/d/theme.xml b/dev/tests/integration/testsuite/Mage/Core/Model/Design/Source/_files/design/frontend/a/d/theme.xml index 069342fef20a4713ea5be737ac02f6af4eec7fab..9425c1dee7dc9d25113edc252fc4f49e231a8a8e 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/Design/Source/_files/design/frontend/a/d/theme.xml +++ b/dev/tests/integration/testsuite/Mage/Core/Model/Design/Source/_files/design/frontend/a/d/theme.xml @@ -22,7 +22,7 @@ * @category Magento * @package Magento_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/Design/Source/_files/design/frontend/b/e/theme.xml b/dev/tests/integration/testsuite/Mage/Core/Model/Design/Source/_files/design/frontend/b/e/theme.xml index 4ee5a86e3b8a6f0c0672adf4a389dc9030f34926..63f27ed4cde8debeb7475b4126023f0040f6387c 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/Design/Source/_files/design/frontend/b/e/theme.xml +++ b/dev/tests/integration/testsuite/Mage/Core/Model/Design/Source/_files/design/frontend/b/e/theme.xml @@ -22,7 +22,7 @@ * @category Magento * @package Magento_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/Design/Source/_files/design/frontend/default/default/theme.xml b/dev/tests/integration/testsuite/Mage/Core/Model/Design/Source/_files/design/frontend/default/default/theme.xml index e95655aa69430eb4471629c9f6a137e8aeffed9d..b06392913550f863240377c3c3c20e93e2924808 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/Design/Source/_files/design/frontend/default/default/theme.xml +++ b/dev/tests/integration/testsuite/Mage/Core/Model/Design/Source/_files/design/frontend/default/default/theme.xml @@ -22,7 +22,7 @@ * @category Magento * @package Magento_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/DesignTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/DesignTest.php index 282a91ab53f9105f0e571fb32f6cd3184b14084e..9f452de5a5627bd9a9650d0a0b433070292045c4 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/DesignTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/DesignTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/Email/Template/FilterTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/Email/Template/FilterTest.php index 60a9a212390418fb0867907f536b7d56cdd69b16..874a2d617b9cc3025c06051ee2b7366b1087ef29 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/Email/Template/FilterTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/Email/Template/FilterTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/Email/TemplateTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/Email/TemplateTest.php index 94369c2dd89019702966ccde53b2fea6972fbf92..349f3cb61ba86e1113b22205984b4582db59d381 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/Email/TemplateTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/Email/TemplateTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/EncryptionTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/EncryptionTest.php index faae607846f802fb0e6f75dfa82c8722f4d7c1a2..c08e6b64af115ce0b2e07153960e4aad33d28137 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/EncryptionTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/EncryptionTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/Layout/DataTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/Layout/DataTest.php index 257295c81847f637b3fceb4fc7747beda79d6254..3d49d83ec6e42280c794ff135948f1ca743ac107 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/Layout/DataTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/Layout/DataTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/Layout/ElementTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/Layout/ElementTest.php index 4d31f9ad4dfa84cdfa2af591c976705c1351c245..20c137dd0fdb3b4ae28f755c0f9fec3f00b936d3 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/Layout/ElementTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/Layout/ElementTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/Layout/UpdateTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/Layout/UpdateTest.php index 9df0e796db8c734889f5607f04257498dfe29095..02a696860d85511f546cf2ac828fb170ff9ad0f0 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/Layout/UpdateTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/Layout/UpdateTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -122,7 +122,7 @@ class Mage_Core_Model_Layout_UpdateTest extends PHPUnit_Framework_TestCase } /** - * @expectedException Exception + * @expectedException Magento_Exception * @dataProvider getFileLayoutUpdatesXmlExceptionDataProvider */ public function testGetFileLayoutUpdatesXmlException($configFixture) diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/LayoutTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/LayoutTest.php index 82b2781eaa5699bf11e573e39e924cdda4eff17b..5d9d3055c33ef63067af5355d6fea8606ea894e8 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/LayoutTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/LayoutTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/Resource/CacheTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/Resource/CacheTest.php index b6fa8efb0eed0f269a1631884e098dd8498a9696..a2a919f75479f068b521cc727ed53d1a88c3f4ae 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/Resource/CacheTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/Resource/CacheTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/Resource/ConfigTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/Resource/ConfigTest.php index 3a247d514f29518fc53808553c5df47219b9712d..d53df3b96efd5522be19d66b5ec0777ab9d59dc6 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/Resource/ConfigTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/Resource/ConfigTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/Resource/Db/AbstractTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/Resource/Db/AbstractTest.php index 952ee4bb108231fa2024b51a3cfb0ba0eb06cab4..5d4da746c2c3877d4c8d8278c18356ed26fdd8f0 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/Resource/Db/AbstractTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/Resource/Db/AbstractTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/Resource/Entity/TableTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/Resource/Entity/TableTest.php index 4e15fa14921b9f089f894fb0c24c9148a2cc6715..a61268909afb88524259ebb4b858f5874dc655b4 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/Resource/Entity/TableTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/Resource/Entity/TableTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/Resource/Helper/Mysql4Test.php b/dev/tests/integration/testsuite/Mage/Core/Model/Resource/Helper/Mysql4Test.php index b6aa400ce25a3e5fce748c7b10ca8602c6a491fa..98aa1a9672aab13aaebc3dfdf3bb9723436e6972 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/Resource/Helper/Mysql4Test.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/Resource/Helper/Mysql4Test.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/Resource/IteratorTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/Resource/IteratorTest.php index 36114b9a1c587722bc0b1834b7ace42a6189bbac..da7058e787686f28f31764df0eac416075039d04 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/Resource/IteratorTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/Resource/IteratorTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/Resource/LayoutTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/Resource/LayoutTest.php index 08f1a595b6e0a3c64ceb0f6abbe1985b115fff27..f03dbd461c00d836d9801d42998dd6f1226055bb 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/Resource/LayoutTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/Resource/LayoutTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/Resource/SessionTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/Resource/SessionTest.php index 61bc9f891d1799ec68e1a364fb42b620a9d3f4f1..b8796a4b331b26f93b057cdaef0270dceb92abfe 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/Resource/SessionTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/Resource/SessionTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/Resource/SetupTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/Resource/SetupTest.php index 2601d5720b9e4821681feacd46bb5cedd73ac5bb..8adbb18dfd1d46ff0a43fae9e1c782a8d50955f4 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/Resource/SetupTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/Resource/SetupTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/Resource/Store/CollectionTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/Resource/Store/CollectionTest.php index 156c4d7490b4a57bf896d8824fed93fc36241220..c9672c72d16b67493df26705a1962684390cff82 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/Resource/Store/CollectionTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/Resource/Store/CollectionTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/Resource/TransactionTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/Resource/TransactionTest.php index e3ab56ed9e7ee98309c2f61a14980aa2fc8feedd..8b9f870be77c7a88498ab9529e3844b5fed1a4bf 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/Resource/TransactionTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/Resource/TransactionTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/ResourceMysqlTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/ResourceMysqlTest.php index 4f2d68f07ac374d35d9136890fa0ad9bbdcb3681..a84ff399fe027990c0a60802e830453428df62da 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/ResourceMysqlTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/ResourceMysqlTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/ResourceTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/ResourceTest.php index 107ac26a21d304355abe05a2718712f6190f4cd2..cdb8eb23d4749943a49613788a9e0894c89dbb49 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/ResourceTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/ResourceTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/Session/Abstract/VarienTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/Session/Abstract/VarienTest.php new file mode 100644 index 0000000000000000000000000000000000000000..90e7d9d74099907e5d8cf7f42ef4a280de5aae5c --- /dev/null +++ b/dev/tests/integration/testsuite/Mage/Core/Model/Session/Abstract/VarienTest.php @@ -0,0 +1,72 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Core + * @subpackage integration_tests + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Test class for Mage_Core_Model_Session_Abstract_Varien + * + */ +class Mage_Core_Model_Session_Abstract_VarienTest extends PHPUnit_Framework_TestCase +{ + /** + * @dataProvider sessionSaveMethodDataProvider + */ + public function testSessionSaveMethod($saveMethod, $iniValue) + { + $this->markTestIncomplete('Bug MAGE-5487'); + + // depending on configuration some values cannot be set as default save session handlers. + $origSessionHandler = ini_set('session.save_handler', $iniValue); + if ($iniValue && (ini_get($iniValue) != $iniValue)) { + $this->markTestSkipped("Can't set '$iniValue' as session save handler"); + } + ini_set('session.save_handler', $origSessionHandler); + + Mage::getConfig()->setNode(Mage_Core_Model_Session_Abstract::XML_NODE_SESSION_SAVE, $saveMethod); + /** + * @var Mage_Core_Model_Session_Abstract_Varien + */ + $model = new Mage_Core_Model_Session_Abstract(); + $model->start(); + if ($iniValue) { + $this->assertEquals(ini_get('session.save_handler'), $iniValue); + } + } + + public function sessionSaveMethodDataProvider() + { + $testCases = array( + array('db', 'user'), + array('memcache', 'memcache'), + array('memcached', 'memcached'), + array('eaccelerator', 'eaccelerator'), + array('', ''), + array('dummy', ''), + ); + + return $testCases; + } +} diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/StoreTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/StoreTest.php index 565de8a28f4b838be1bff2e1ca8766703f8cc794..e2526e0e8b265bcef829050a3d450465c1dd41dd 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/StoreTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/StoreTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/TemplateTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/TemplateTest.php index d368ad1dc14f4ddf59123e9e2a9893ede49a92f4..57671082095875dde2b8db24e5d4a8f9cc2215a4 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/TemplateTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/TemplateTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -32,7 +32,7 @@ class Mage_Core_Model_TemplateTest extends PHPUnit_Framework_TestCase { /** * @dataProvider setDesignConfigExceptionDataProvider - * @expectedException Exception + * @expectedException Magento_Exception */ public function testSetDesignConfigException($config) { diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/Translate/ExprTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/Translate/ExprTest.php index fc72a74d1d12b7b0e0db947a279214949ffa91d3..05f5c6c6b57510e470206fe6e07360d1deb657f1 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/Translate/ExprTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/Translate/ExprTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/Translate/InlineTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/Translate/InlineTest.php index 5730906ea7da060c7fa34c57d25b99149e524b0a..424f3162b5adde4b8a301760d04c53989aa3cf33 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/Translate/InlineTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/Translate/InlineTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -114,6 +114,7 @@ class Mage_Core_Model_Translate_InlineTest extends PHPUnit_Framework_TestCase { $actualText = $originalText; $this->_model->processResponseBody($actualText); + $this->markTestIncomplete('Bug MAGE-2494'); $this->assertEquals($expectedText, $actualText); } diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/Translate/StringTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/Translate/StringTest.php index c3b0a00f8f587a1b9342ccbd175cb9c7a153f3f6..2f9a1355c18210d42a0dae781d2f384a63e4804d 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/Translate/StringTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/Translate/StringTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/Translate/_files/_translation_data.php b/dev/tests/integration/testsuite/Mage/Core/Model/Translate/_files/_translation_data.php index fa331faa9be09221b0a28608168965b21fd76009..62f1fef866e50820e7c44271e25e6b11b21b5e72 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/Translate/_files/_translation_data.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/Translate/_files/_translation_data.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ ?> diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/TranslateTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/TranslateTest.php index ddd06be46e52ac1df695c2c5fa599abc427361da..f0da11bf7197d5f6143dec96598668efc6c41996 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/TranslateTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/TranslateTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/Url/RewriteTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/Url/RewriteTest.php index 5b5aff4c5395e6fd14c276cadbe68594d0200663..529bd9a0d80c2831583ab9e7d685cea31ab67371 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/Url/RewriteTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/Url/RewriteTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/UrlTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/UrlTest.php index 3186e6db14a935043629177c7883490950b8ce4e..e9f846ea440a5cb27e4bc3a18fbf9f2ed217229e 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/UrlTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/UrlTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/Variable/ConfigTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/Variable/ConfigTest.php index 67af589ea734dac11c4c693655adbeea914ffedc..29f51470496cd4305293401c096e5a38b4ae4ea2 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/Variable/ConfigTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/Variable/ConfigTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/VariableTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/VariableTest.php index d005684162c12928fde066584a1108dd23098c41..4beee5401394e5eeec85c9cc85eb5801dc43fce5 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/VariableTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/VariableTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/WebsiteTest.php b/dev/tests/integration/testsuite/Mage/Core/Model/WebsiteTest.php index 49208ace18161707e8b7065d5773f26c4baa9214..47372f57d703adc387773ff5a01f4f7dae7e7a3b 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/WebsiteTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/WebsiteTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/_files/_layout_update.xml b/dev/tests/integration/testsuite/Mage/Core/Model/_files/_layout_update.xml index 149d9027f6fda41ce85243f17cb28d9ef8bb0463..77035653d3e7d2ae8bf5f232bc0e4aafbd5eca58 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/_files/_layout_update.xml +++ b/dev/tests/integration/testsuite/Mage/Core/Model/_files/_layout_update.xml @@ -22,7 +22,7 @@ * @category Magento * @package Magento_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/adminhtml/package/test/theme.xml b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/adminhtml/package/test/theme.xml index b25b136ec04da7ca8b83ca427cea3fc1dc0558b7..2c130a71ea67f81204b73e22e31b5243ce29f858 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/adminhtml/package/test/theme.xml +++ b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/adminhtml/package/test/theme.xml @@ -20,7 +20,7 @@ * * @category Magento * @package Design - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/default/default/theme.xml b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/default/default/theme.xml index 45b319d3a8b63e280ff735f153aefc90c4db34cc..349c67c5c2eedc7978de950a3ebe5d1af76669af 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/default/default/theme.xml +++ b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/default/default/theme.xml @@ -20,7 +20,7 @@ * * @category Magento * @package Design - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/custom_theme/skin/default/fixture_script_two.js b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/custom_theme/skin/default/fixture_script_two.js index 292dbf3c7f024c56221d1fa82b79c54dda9a91f8..b88ca07cbf0cc6bc40800269f11c06e5688a9e08 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/custom_theme/skin/default/fixture_script_two.js +++ b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/custom_theme/skin/default/fixture_script_two.js @@ -20,7 +20,7 @@ * @category Magento * @package Magento_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /* fixture skin file located inside the default skin of the custom theme */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/custom_theme/skin/theme_nested_skin/Fixture_Module/fixture_script.js b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/custom_theme/skin/theme_nested_skin/Fixture_Module/fixture_script.js index a767351fc608cf71e4bc3b8107f60d0d7456eccf..3c2694c98c7e8a0a3f537d1ed3d3af9eef249166 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/custom_theme/skin/theme_nested_skin/Fixture_Module/fixture_script.js +++ b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/custom_theme/skin/theme_nested_skin/Fixture_Module/fixture_script.js @@ -20,7 +20,7 @@ * @category Magento * @package Magento_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /* modular fixture skin file located inside the nested skin of the custom theme */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/custom_theme/skin/theme_nested_skin/fixture_script.js b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/custom_theme/skin/theme_nested_skin/fixture_script.js index 9e91f5f0afcb64749ba21bd8d0e99a4cf2375bba..0ef49cd0ebb04a3dd4ae3b411d9574a9852f0966 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/custom_theme/skin/theme_nested_skin/fixture_script.js +++ b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/custom_theme/skin/theme_nested_skin/fixture_script.js @@ -20,7 +20,7 @@ * @category Magento * @package Magento_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /* fixture skin file located inside the nested skin of the custom theme */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/custom_theme/skin/theme_nested_skin/varien/product.js b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/custom_theme/skin/theme_nested_skin/jquery/jquery-no-conflict.js similarity index 93% rename from dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/custom_theme/skin/theme_nested_skin/varien/product.js rename to dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/custom_theme/skin/theme_nested_skin/jquery/jquery-no-conflict.js index 9dd7df72c74bf2ffc4c48c166986e6a3a2389a20..c338f1260ee9a5277f18916263c66b9ac0765ead 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/custom_theme/skin/theme_nested_skin/varien/product.js +++ b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/custom_theme/skin/theme_nested_skin/jquery/jquery-no-conflict.js @@ -20,7 +20,7 @@ * @category Magento * @package Magento_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /* fixture skin file that overrides the lib file */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/custom_theme/skin/theme_nested_skin/locale/ru_RU/Fixture_Module/fixture_script.js b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/custom_theme/skin/theme_nested_skin/locale/ru_RU/Fixture_Module/fixture_script.js index 73b8f350d6b6c3232e09d7f31d85ddc854814ed6..45a713854a6da89c3a61ecdd3386a61bf1affd00 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/custom_theme/skin/theme_nested_skin/locale/ru_RU/Fixture_Module/fixture_script.js +++ b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/custom_theme/skin/theme_nested_skin/locale/ru_RU/Fixture_Module/fixture_script.js @@ -20,7 +20,7 @@ * @category Magento * @package Magento_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /* localized modular fixture skin file located inside the nested skin of the custom theme */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/custom_theme/skin/theme_nested_skin/locale/ru_RU/fixture_script.js b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/custom_theme/skin/theme_nested_skin/locale/ru_RU/fixture_script.js index 5b6b77ce46c0cecc0befcc28bfa69bf185ad8bbd..bfc53e2bf043d8cf02f7db5edb49e0d3bed94dcd 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/custom_theme/skin/theme_nested_skin/locale/ru_RU/fixture_script.js +++ b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/custom_theme/skin/theme_nested_skin/locale/ru_RU/fixture_script.js @@ -20,7 +20,7 @@ * @category Magento * @package Magento_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /* localized fixture skin file located inside the nested skin of the custom theme */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/custom_theme/theme.xml b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/custom_theme/theme.xml index 5505b38a92d14991a10ee6a849293a034b86b5b9..a6cd3944f4207983bad05f4573098fca0070be6f 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/custom_theme/theme.xml +++ b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/custom_theme/theme.xml @@ -20,7 +20,7 @@ * * @category Magento * @package Design - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/fallback.phtml b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/fallback.phtml index e99233ceb7b2c546dad9b14f9db88a404279f3eb..6e70d50c9c8bbe3a1eec0a9eadc135af05c76676 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/fallback.phtml +++ b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/fallback.phtml @@ -21,6 +21,6 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/skin/access_violation.php b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/skin/access_violation.php index dfd04b9b67c379f3dae798798f9392e96eb8de01..ba4afa09300497991ddea942bdc2b2d0af989741 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/skin/access_violation.php +++ b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/skin/access_violation.php @@ -21,6 +21,6 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/skin/default/fixture_script_four.js b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/skin/default/fixture_script_four.js index bf7cb8caa6ae71c6f5b3e9046dbd48e67d13e5fa..43caebf5b45b5315ee081db57b25d29d08397692 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/skin/default/fixture_script_four.js +++ b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/skin/default/fixture_script_four.js @@ -20,7 +20,7 @@ * @category Magento * @package Magento_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /* fixture skin file located inside the default skin of the default theme */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/skin/default/fixture_script_three.js b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/skin/default/fixture_script_three.js index bf7cb8caa6ae71c6f5b3e9046dbd48e67d13e5fa..43caebf5b45b5315ee081db57b25d29d08397692 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/skin/default/fixture_script_three.js +++ b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/skin/default/fixture_script_three.js @@ -20,7 +20,7 @@ * @category Magento * @package Magento_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /* fixture skin file located inside the default skin of the default theme */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/skin/default/fixture_script_two.js b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/skin/default/fixture_script_two.js index bf7cb8caa6ae71c6f5b3e9046dbd48e67d13e5fa..43caebf5b45b5315ee081db57b25d29d08397692 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/skin/default/fixture_script_two.js +++ b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/skin/default/fixture_script_two.js @@ -20,7 +20,7 @@ * @category Magento * @package Magento_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /* fixture skin file located inside the default skin of the default theme */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/skin/default/scripts.js b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/skin/default/scripts.js index 144114045d298c151cd1644adeca79124f8752f7..06cae5423e282061dca540a1e8c5942551e25be6 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/skin/default/scripts.js +++ b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/skin/default/scripts.js @@ -20,7 +20,7 @@ * @category Magento * @package Magento_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /* scripts.js */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/skin/theme/css/deep/recursive.css b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/skin/theme/css/deep/recursive.css index aeaee0addd3c8f290c0f38fe6ed9f7ba8855a255..f77e8e7f9a9f895e7c17593b6839ec54f7bb4503 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/skin/theme/css/deep/recursive.css +++ b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/skin/theme/css/deep/recursive.css @@ -20,7 +20,7 @@ * @category design * @package default_default * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ dt {background: url('../../recursive2.gif')} diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/skin/theme/css/exception.css b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/skin/theme/css/exception.css index 59dda6b9d23bb6f72bf58bb18b2a87dc1eca84de..1bf8c86edd43e06bbe649a1a4554d75c0f8eb1bd 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/skin/theme/css/exception.css +++ b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/skin/theme/css/exception.css @@ -20,7 +20,7 @@ * @category design * @package default_default * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ li.rogue {background: url(../../access_violation.php);} diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/skin/theme/css/file.css b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/skin/theme/css/file.css index d71539d48c28ac610ae0de3451b7cf0e0c710760..37122691eac5a827dfb57be5b6431c5a41d23bb4 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/skin/theme/css/file.css +++ b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/skin/theme/css/file.css @@ -20,7 +20,7 @@ * @category design * @package default_default * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ @import url(../recursive.css); diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/skin/theme/recursive.css b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/skin/theme/recursive.css index bf4d8ed14e920f2ae4ce790b64243ac3ea0687d8..fbbe5ac03655fef2eb69e837a86412b4d4e1b95c 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/skin/theme/recursive.css +++ b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/skin/theme/recursive.css @@ -20,7 +20,7 @@ * @category design * @package default_default * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ dl {background: url(recursive.gif)} diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/skin/theme_nested_skin/fixture_script_three.js b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/skin/theme_nested_skin/fixture_script_three.js index b5c1514eab982de147699fc5334fba40b752aade..7e226d137d1c5fe07c44e3541a1a1af62fc0f27a 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/skin/theme_nested_skin/fixture_script_three.js +++ b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/skin/theme_nested_skin/fixture_script_three.js @@ -20,7 +20,7 @@ * @category Magento * @package Magento_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /* fixture skin file located inside the nested skin of the default theme */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/skin/theme_nested_skin/fixture_script_two.js b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/skin/theme_nested_skin/fixture_script_two.js index b5c1514eab982de147699fc5334fba40b752aade..7e226d137d1c5fe07c44e3541a1a1af62fc0f27a 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/skin/theme_nested_skin/fixture_script_two.js +++ b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/package/default/skin/theme_nested_skin/fixture_script_two.js @@ -20,7 +20,7 @@ * @category Magento * @package Magento_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /* fixture skin file located inside the nested skin of the default theme */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/test/default/Mage_Catalog/layout.xml b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/test/default/Mage_Catalog/layout.xml index eb1a8c442c4d656b50152a3113388ce614ce0110..9f64c8bba6331af08bc644a5f2b38bac6068aa35 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/test/default/Mage_Catalog/layout.xml +++ b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/test/default/Mage_Catalog/layout.xml @@ -22,7 +22,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/test/default/Mage_Catalog/theme_template.phtml b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/test/default/Mage_Catalog/theme_template.phtml index e99233ceb7b2c546dad9b14f9db88a404279f3eb..6e70d50c9c8bbe3a1eec0a9eadc135af05c76676 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/test/default/Mage_Catalog/theme_template.phtml +++ b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/test/default/Mage_Catalog/theme_template.phtml @@ -21,6 +21,6 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/test/default/Mage_Cms/layout.xml b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/test/default/Mage_Cms/layout.xml index 95e6d47361ea8597094fd7d1dad00c581b7a311c..f045ca76a994bf408d5513137944feaf3bd16dfa 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/test/default/Mage_Cms/layout.xml +++ b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/test/default/Mage_Cms/layout.xml @@ -22,7 +22,7 @@ * @category Magento * @package Magento_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/test/default/Mage_Core/layout.xml b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/test/default/Mage_Core/layout.xml index 8a428ccd5414f328e3f26681ae6132cc93e8ca7b..d821ee4a1a6ab952ec37a548499a8acc2fbf865a 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/test/default/Mage_Core/layout.xml +++ b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/test/default/Mage_Core/layout.xml @@ -22,7 +22,7 @@ * @category Magento * @package Magento_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/test/default/skin/default/css/styles.css b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/test/default/skin/default/css/styles.css index 84a8e791bc3766cc55717fa99e319b13ee23fd13..c3154cfb19bfb5c810bb73a0c8b86dc716a51e12 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/test/default/skin/default/css/styles.css +++ b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/test/default/skin/default/css/styles.css @@ -20,6 +20,6 @@ * @category design * @package default_default * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/test/default/skin/default/js/tabs.js b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/test/default/skin/default/js/tabs.js index 61c2ef9ed4df0653438e6ce673b2f4a558148b59..d1467deef820c82b7de2f0c57c1885357877dbf4 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/test/default/skin/default/js/tabs.js +++ b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/test/default/skin/default/js/tabs.js @@ -20,6 +20,6 @@ * @category Magento * @package Magento_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/test/default/view.xml b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/test/default/view.xml index 6c82111167b185d15cc3c99e4dcadc350ed9c8ec..a538af376690e31748169a8fad6f1fb2092ea647 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/test/default/view.xml +++ b/dev/tests/integration/testsuite/Mage/Core/Model/_files/design/frontend/test/default/view.xml @@ -22,7 +22,7 @@ * @category Magento * @package Magento_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/_files/jslib/calendar.css b/dev/tests/integration/testsuite/Mage/Core/Model/_files/jslib/calendar.css index 67c8c13ebd2ef8c7c9528281ad895c1de861487a..e0a2f1c095b8f69c9d0b0bdb851ba2d227eb3938 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/_files/jslib/calendar.css +++ b/dev/tests/integration/testsuite/Mage/Core/Model/_files/jslib/calendar.css @@ -20,7 +20,7 @@ * @category design * @package default_default * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /* calendar.css */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/_files/jslib/calendar.js b/dev/tests/integration/testsuite/Mage/Core/Model/_files/jslib/calendar.js index 2c7e61007661d68cbd215b34133350dffd30672a..f70dd91c15e528fca7d38711b3383f35d63f04df 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/_files/jslib/calendar.js +++ b/dev/tests/integration/testsuite/Mage/Core/Model/_files/jslib/calendar.js @@ -20,7 +20,7 @@ * @category Magento * @package Magento_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /* calendar.js */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/_files/skin/_merged/case_2_merged_css_files.css b/dev/tests/integration/testsuite/Mage/Core/Model/_files/skin/_merged/case_2_merged_css_files.css index 2fefa5899c84422b309888bc241c3aa2e9149aa5..a42c1ba3848d27f31bdc26533e21a5f192dde232 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/_files/skin/_merged/case_2_merged_css_files.css +++ b/dev/tests/integration/testsuite/Mage/Core/Model/_files/skin/_merged/case_2_merged_css_files.css @@ -20,7 +20,7 @@ * @category design * @package default_default * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ @import url(../frontend/package/default/theme/en_US/recursive.css); diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/_files/skin/_merged/case_2_merged_js_files.js b/dev/tests/integration/testsuite/Mage/Core/Model/_files/skin/_merged/case_2_merged_js_files.js index b808e91a6c3065c0f6205bcf678176d255eff3ca..a749fe46fa40586c1466e56cd88e0afb899e9a68 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/_files/skin/_merged/case_2_merged_js_files.js +++ b/dev/tests/integration/testsuite/Mage/Core/Model/_files/skin/_merged/case_2_merged_js_files.js @@ -20,7 +20,7 @@ * @category Magento * @package Magento_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /* calendar.js */ diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/_files/skin/file.css b/dev/tests/integration/testsuite/Mage/Core/Model/_files/skin/file.css index 337118838b1aeb3b76844c8767826776f079d7d1..c96fc7e43df079e8d802894427b4ef5ca3ac5417 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/_files/skin/file.css +++ b/dev/tests/integration/testsuite/Mage/Core/Model/_files/skin/file.css @@ -20,7 +20,7 @@ * @category design * @package default_default * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ a {color:red} diff --git a/dev/tests/integration/testsuite/Mage/Core/Model/_files/skin/script.js b/dev/tests/integration/testsuite/Mage/Core/Model/_files/skin/script.js index 144114045d298c151cd1644adeca79124f8752f7..06cae5423e282061dca540a1e8c5942551e25be6 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Model/_files/skin/script.js +++ b/dev/tests/integration/testsuite/Mage/Core/Model/_files/skin/script.js @@ -20,7 +20,7 @@ * @category Magento * @package Magento_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /* scripts.js */ diff --git a/dev/tests/integration/testsuite/Mage/Core/_files/design_change.php b/dev/tests/integration/testsuite/Mage/Core/_files/design_change.php index 3ef95e558f6dacccd539c8be7a3e3735eaf0f631..eb5522452c02315a6bdc151ef18962a4a4e9ce67 100644 --- a/dev/tests/integration/testsuite/Mage/Core/_files/design_change.php +++ b/dev/tests/integration/testsuite/Mage/Core/_files/design_change.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/_files/design_change_timezone.php b/dev/tests/integration/testsuite/Mage/Core/_files/design_change_timezone.php index 35dd20645b506b80b17e054cd18a87f1444dba40..f6dbb7cf492b94790b37ee96ff2551d2b308d55a 100644 --- a/dev/tests/integration/testsuite/Mage/Core/_files/design_change_timezone.php +++ b/dev/tests/integration/testsuite/Mage/Core/_files/design_change_timezone.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/_files/store.php b/dev/tests/integration/testsuite/Mage/Core/_files/store.php index f104831b2526232562bd1827af65847571b80150..2a9270f6a4dff15a2208586f5351386f64d0968c 100644 --- a/dev/tests/integration/testsuite/Mage/Core/_files/store.php +++ b/dev/tests/integration/testsuite/Mage/Core/_files/store.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/_files/variable.php b/dev/tests/integration/testsuite/Mage/Core/_files/variable.php index 86c423f26f668ee799746bf959008aec1df122c4..59a1f46d08a3088483cde7470bb24426d4522589 100644 --- a/dev/tests/integration/testsuite/Mage/Core/_files/variable.php +++ b/dev/tests/integration/testsuite/Mage/Core/_files/variable.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/controllers/AjaxControllerTest.php b/dev/tests/integration/testsuite/Mage/Core/controllers/AjaxControllerTest.php index 832b28222371ca6ce6761003da9464cb36275254..dca416d2d4c4fcd333bd335e4a7f61eea52dd223 100644 --- a/dev/tests/integration/testsuite/Mage/Core/controllers/AjaxControllerTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/controllers/AjaxControllerTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Core/controllers/IndexControllerTest.php b/dev/tests/integration/testsuite/Mage/Core/controllers/IndexControllerTest.php index fb65bfdad51ce4056483f7a79ef7399bfc6ac0be..59fdba2fd7d590bb4717d1c834be91835a0fe626 100644 --- a/dev/tests/integration/testsuite/Mage/Core/controllers/IndexControllerTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/controllers/IndexControllerTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Cron/Model/ObserverTest.php b/dev/tests/integration/testsuite/Mage/Cron/Model/ObserverTest.php index c4fc0a1170f80d96d5e0726cbe7c3fb05b003a5e..c841d9f6fe9a3e65d2a5d31bfab0b54852fdf264 100644 --- a/dev/tests/integration/testsuite/Mage/Cron/Model/ObserverTest.php +++ b/dev/tests/integration/testsuite/Mage/Cron/Model/ObserverTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Cron * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Customer/Block/Account/Dashboard/InfoTest.php b/dev/tests/integration/testsuite/Mage/Customer/Block/Account/Dashboard/InfoTest.php index d86c1268faf9db4afaaf1edc56c1efef0da21a26..0e42218e94d3dabedb71fdf52d160fb8548dc8fe 100644 --- a/dev/tests/integration/testsuite/Mage/Customer/Block/Account/Dashboard/InfoTest.php +++ b/dev/tests/integration/testsuite/Mage/Customer/Block/Account/Dashboard/InfoTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Customer * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Customer/Block/Widget/GenderTest.php b/dev/tests/integration/testsuite/Mage/Customer/Block/Widget/GenderTest.php index 5d8fda23b70ba16c1821f4bc9b2fdfd82ac3f225..179dc1f4b7aaba9d1cacab981850aac42805eb76 100644 --- a/dev/tests/integration/testsuite/Mage/Customer/Block/Widget/GenderTest.php +++ b/dev/tests/integration/testsuite/Mage/Customer/Block/Widget/GenderTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Customer * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Customer/Model/Address/ConfigTest.php b/dev/tests/integration/testsuite/Mage/Customer/Model/Address/ConfigTest.php index a100e941e04dac7260e831312fa38d7ae6b88a93..fb3ef247b40ce6afd5f5f3b7d66fc1d1872b4726 100644 --- a/dev/tests/integration/testsuite/Mage/Customer/Model/Address/ConfigTest.php +++ b/dev/tests/integration/testsuite/Mage/Customer/Model/Address/ConfigTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Customer * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Customer/Model/Convert/Adapter/CustomerTest.php b/dev/tests/integration/testsuite/Mage/Customer/Model/Convert/Adapter/CustomerTest.php index c8ca1966e42643b7154c4a9375afabd0cadcd2bd..0ea51b12fa679433e461342e2f53bcb72df24deb 100644 --- a/dev/tests/integration/testsuite/Mage/Customer/Model/Convert/Adapter/CustomerTest.php +++ b/dev/tests/integration/testsuite/Mage/Customer/Model/Convert/Adapter/CustomerTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Customer * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Customer/Model/FormTest.php b/dev/tests/integration/testsuite/Mage/Customer/Model/FormTest.php index 5c9f51f9c95d78493f9856a8bb299254e40346c7..987113988f5a98f9de9735de3458fb1a0aefda66 100644 --- a/dev/tests/integration/testsuite/Mage/Customer/Model/FormTest.php +++ b/dev/tests/integration/testsuite/Mage/Customer/Model/FormTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Customer * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Customer/Model/GroupTest.php b/dev/tests/integration/testsuite/Mage/Customer/Model/GroupTest.php index 46c9b7ec1b78d041a3c8f1bf271a40a3076fcbeb..21b6b43bdd9e0d23431b2c4e0c1b186c376d86af 100644 --- a/dev/tests/integration/testsuite/Mage/Customer/Model/GroupTest.php +++ b/dev/tests/integration/testsuite/Mage/Customer/Model/GroupTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Customer * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Customer/_files/address_formats.php b/dev/tests/integration/testsuite/Mage/Customer/_files/address_formats.php index 82d224b7253d62799b4bb7865142e989cd0cdc60..15922ea1bee6b18321503640335615e7b8e86ef0 100644 --- a/dev/tests/integration/testsuite/Mage/Customer/_files/address_formats.php +++ b/dev/tests/integration/testsuite/Mage/Customer/_files/address_formats.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Customer * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Eav/Model/Resource/Entity/Attribute/CollectionTest.php b/dev/tests/integration/testsuite/Mage/Eav/Model/Resource/Entity/Attribute/CollectionTest.php index 105e21a6e391524925e84ce56dd814e62f5c4507..3b9228b8db9a42b0c5bb24366ee3d1269bba5fae 100644 --- a/dev/tests/integration/testsuite/Mage/Eav/Model/Resource/Entity/Attribute/CollectionTest.php +++ b/dev/tests/integration/testsuite/Mage/Eav/Model/Resource/Entity/Attribute/CollectionTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/GiftMessage/Block/Message/InlineTest.php b/dev/tests/integration/testsuite/Mage/GiftMessage/Block/Message/InlineTest.php index e64f8aea98cfbb853e9c8d553da18c17345626d8..7b1480b3eac723b1f18a1cfb5cf147275cba5e8b 100644 --- a/dev/tests/integration/testsuite/Mage/GiftMessage/Block/Message/InlineTest.php +++ b/dev/tests/integration/testsuite/Mage/GiftMessage/Block/Message/InlineTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_GiftMessage * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Index/Model/ShellTest.php b/dev/tests/integration/testsuite/Mage/Index/Model/ShellTest.php index 54ec79332cb23db24d5f4a7ebdbb3955bb6f2992..1893020e24e7659124aa2bad038305485e96fbc6 100644 --- a/dev/tests/integration/testsuite/Mage/Index/Model/ShellTest.php +++ b/dev/tests/integration/testsuite/Mage/Index/Model/ShellTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Index * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Log/Model/Resource/ShellTest.php b/dev/tests/integration/testsuite/Mage/Log/Model/Resource/ShellTest.php index 75c8fb20c32191cbd2f62b13616a52dd672513c9..8a80cb19956bcd3afe7ebe257c2e86486892ddcc 100644 --- a/dev/tests/integration/testsuite/Mage/Log/Model/Resource/ShellTest.php +++ b/dev/tests/integration/testsuite/Mage/Log/Model/Resource/ShellTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Log * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Log/Model/ShellTest.php b/dev/tests/integration/testsuite/Mage/Log/Model/ShellTest.php index cad96501a16bc45f1d8f59e99456f43c1819e042..7d21ce79781b1295c69a13e74e8c0f52939a300e 100644 --- a/dev/tests/integration/testsuite/Mage/Log/Model/ShellTest.php +++ b/dev/tests/integration/testsuite/Mage/Log/Model/ShellTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Log * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Newsletter/Model/QueueTest.php b/dev/tests/integration/testsuite/Mage/Newsletter/Model/QueueTest.php index a737f45323330657e554389821b3b31936c1121a..f8781d075a64f4698cd572a7352663dbef2339eb 100644 --- a/dev/tests/integration/testsuite/Mage/Newsletter/Model/QueueTest.php +++ b/dev/tests/integration/testsuite/Mage/Newsletter/Model/QueueTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Newsletter * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Newsletter/Model/TemplateTest.php b/dev/tests/integration/testsuite/Mage/Newsletter/Model/TemplateTest.php index 976be3f9129202f3a829e283de4b20754fa49041..2729e31604f34e116c53f5cc31d11ed74bc8f157 100644 --- a/dev/tests/integration/testsuite/Mage/Newsletter/Model/TemplateTest.php +++ b/dev/tests/integration/testsuite/Mage/Newsletter/Model/TemplateTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Newsletter * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Newsletter/_files/queue.php b/dev/tests/integration/testsuite/Mage/Newsletter/_files/queue.php index 540f8f547be1434ad274ba7f5b5dc207a6e0b595..e45eab0076afc25e0a1adefa2f09d302550e5d70 100644 --- a/dev/tests/integration/testsuite/Mage/Newsletter/_files/queue.php +++ b/dev/tests/integration/testsuite/Mage/Newsletter/_files/queue.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Newsletter * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Newsletter/_files/subscribers.php b/dev/tests/integration/testsuite/Mage/Newsletter/_files/subscribers.php index eddb2bb1617e2b9709e9c0a0b36aac3dfeaf4866..a1169c5bb745e7d65ad74313213cb231fba94bfd 100644 --- a/dev/tests/integration/testsuite/Mage/Newsletter/_files/subscribers.php +++ b/dev/tests/integration/testsuite/Mage/Newsletter/_files/subscribers.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Newsletter * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Newsletter/_files/template.php b/dev/tests/integration/testsuite/Mage/Newsletter/_files/template.php index 8089aa325f7178975f1b1c7f89994610b5bc1c81..0578383503290b507c3e0647e0f6cfcd3714e143 100644 --- a/dev/tests/integration/testsuite/Mage/Newsletter/_files/template.php +++ b/dev/tests/integration/testsuite/Mage/Newsletter/_files/template.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Newsletter * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Page/Block/Html/BreadcrumbsTest.php b/dev/tests/integration/testsuite/Mage/Page/Block/Html/BreadcrumbsTest.php index 6bbb675d4303d7d1f02c31df18c09606d3998555..22ca031a7608d05ebbc3420a5cbd122eaa8f6376 100644 --- a/dev/tests/integration/testsuite/Mage/Page/Block/Html/BreadcrumbsTest.php +++ b/dev/tests/integration/testsuite/Mage/Page/Block/Html/BreadcrumbsTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Page * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Page/Block/Html/FooterTest.php b/dev/tests/integration/testsuite/Mage/Page/Block/Html/FooterTest.php index c861377b5bbe6f35beb2e17c15b6fecbbb4fd5c4..d575c477e8af4df1f43a0420f6c71f9dae5961e0 100644 --- a/dev/tests/integration/testsuite/Mage/Page/Block/Html/FooterTest.php +++ b/dev/tests/integration/testsuite/Mage/Page/Block/Html/FooterTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Page * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Page/Block/Html/HeadTest.php b/dev/tests/integration/testsuite/Mage/Page/Block/Html/HeadTest.php index f190d56313fe9b6d48a123d973656459768f5a74..f758a078ab3193b80c6497cc3ad634d176d5a56b 100644 --- a/dev/tests/integration/testsuite/Mage/Page/Block/Html/HeadTest.php +++ b/dev/tests/integration/testsuite/Mage/Page/Block/Html/HeadTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Page * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -60,7 +60,7 @@ class Mage_Page_Block_Html_HeadTest extends PHPUnit_Framework_TestCase } /** - * @expectedException Exception + * @expectedException Magento_Exception */ public function testAddCssException() { diff --git a/dev/tests/integration/testsuite/Mage/ProductAlert/Block/Email/StockTest.php b/dev/tests/integration/testsuite/Mage/ProductAlert/Block/Email/StockTest.php index 7e48ee05a017ec3f5cd9feccdfa08143969ea1dd..6121b8b74dd4262ff89564917ef49129f1416e15 100644 --- a/dev/tests/integration/testsuite/Mage/ProductAlert/Block/Email/StockTest.php +++ b/dev/tests/integration/testsuite/Mage/ProductAlert/Block/Email/StockTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_ProductAlert * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Report/WidgetTest.php b/dev/tests/integration/testsuite/Mage/Report/WidgetTest.php index 645dfc1a667010fdab0f82b8cd12fc9af4130acb..0662245f6212978cd7fe360e352bd2de6d5ad929 100644 --- a/dev/tests/integration/testsuite/Mage/Report/WidgetTest.php +++ b/dev/tests/integration/testsuite/Mage/Report/WidgetTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Report * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Review/controllers/ProductControllerTest.php b/dev/tests/integration/testsuite/Mage/Review/controllers/ProductControllerTest.php index 436fc8c20822c52bc14de4d286f7d5249ae41c56..7208319bf81aaaf4a30355998f6e3f0823bf8ad8 100644 --- a/dev/tests/integration/testsuite/Mage/Review/controllers/ProductControllerTest.php +++ b/dev/tests/integration/testsuite/Mage/Review/controllers/ProductControllerTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Review * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Sales/Block/Order/CommentsTest.php b/dev/tests/integration/testsuite/Mage/Sales/Block/Order/CommentsTest.php index 3b5f9d953521de92778f9e20e3585ef0df8e3e05..179f07d4fb4344268a0518f28909de69419e4efa 100644 --- a/dev/tests/integration/testsuite/Mage/Sales/Block/Order/CommentsTest.php +++ b/dev/tests/integration/testsuite/Mage/Sales/Block/Order/CommentsTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Sales * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Sales/Model/Order/Shipment/TrackTest.php b/dev/tests/integration/testsuite/Mage/Sales/Model/Order/Shipment/TrackTest.php index 337b417abca8923922155a1cf4d8817ca559fe8b..3b0caf3fbfa881d52c49a2be0daa30d91e376e6e 100644 --- a/dev/tests/integration/testsuite/Mage/Sales/Model/Order/Shipment/TrackTest.php +++ b/dev/tests/integration/testsuite/Mage/Sales/Model/Order/Shipment/TrackTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Sale * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Shipping/Helper/DataTest.php b/dev/tests/integration/testsuite/Mage/Shipping/Helper/DataTest.php index 0b86e77b7381728de449c857ba9aae3e3080acd6..9b6ced5e46ef150bfe2ade2cda6127c72c55fe0a 100644 --- a/dev/tests/integration/testsuite/Mage/Shipping/Helper/DataTest.php +++ b/dev/tests/integration/testsuite/Mage/Shipping/Helper/DataTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Shipping * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Tag/Block/Customer/ViewTest.php b/dev/tests/integration/testsuite/Mage/Tag/Block/Customer/ViewTest.php index e1c4be4bd8e1609edeac83083830fe4f6931fbc5..903c81953fd0bd28ca3d6dcc12b879bf24cc6bf6 100644 --- a/dev/tests/integration/testsuite/Mage/Tag/Block/Customer/ViewTest.php +++ b/dev/tests/integration/testsuite/Mage/Tag/Block/Customer/ViewTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Tag * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Tag/Model/TagTest.php b/dev/tests/integration/testsuite/Mage/Tag/Model/TagTest.php index 9f3202de2c31cda414e1af493e0b22cc2b450386..5aaa986b134bd9c14709881973f2fd10af67189f 100644 --- a/dev/tests/integration/testsuite/Mage/Tag/Model/TagTest.php +++ b/dev/tests/integration/testsuite/Mage/Tag/Model/TagTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Tag * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/MainTest.php b/dev/tests/integration/testsuite/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/MainTest.php index d916f36becf4b3cb321bc9e201c1e50eae68eb7f..7f6bdd79ed4824b61c7da035f3f8f5b2fb790309 100644 --- a/dev/tests/integration/testsuite/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/MainTest.php +++ b/dev/tests/integration/testsuite/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/MainTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Widget * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/SettingsTest.php b/dev/tests/integration/testsuite/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/SettingsTest.php index ff54432e66b66a64f91a3008e7638be2c4cab492..36baeaaf2451f61b78d25bcf995ffe89bd60741a 100644 --- a/dev/tests/integration/testsuite/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/SettingsTest.php +++ b/dev/tests/integration/testsuite/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/SettingsTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Widget * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Widget/Model/Widget/ConfigTest.php b/dev/tests/integration/testsuite/Mage/Widget/Model/Widget/ConfigTest.php index 6091d1b1fc5100dd14a18dce781ee0f98afc43fc..804f62a3b3f14b565ad90a449c698648177b6f76 100644 --- a/dev/tests/integration/testsuite/Mage/Widget/Model/Widget/ConfigTest.php +++ b/dev/tests/integration/testsuite/Mage/Widget/Model/Widget/ConfigTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Widget * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Widget/Model/Widget/InstanceTest.php b/dev/tests/integration/testsuite/Mage/Widget/Model/Widget/InstanceTest.php index 605d79fcbbd1e15e46c055a87896616a0f089022..c487fdd49c0c0513c0be36ea14df4d298def2545 100644 --- a/dev/tests/integration/testsuite/Mage/Widget/Model/Widget/InstanceTest.php +++ b/dev/tests/integration/testsuite/Mage/Widget/Model/Widget/InstanceTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Widget * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Widget/Model/WidgetTest.php b/dev/tests/integration/testsuite/Mage/Widget/Model/WidgetTest.php index caf0e705696585cba4a33144d48829ad2d64240d..5d00129277acc8185a4632fa71ace5cec84c704e 100644 --- a/dev/tests/integration/testsuite/Mage/Widget/Model/WidgetTest.php +++ b/dev/tests/integration/testsuite/Mage/Widget/Model/WidgetTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Widget * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Wishlist/Block/AbstractTest.php b/dev/tests/integration/testsuite/Mage/Wishlist/Block/AbstractTest.php index 95f7da6f522eb90721c1e3194d6c6f6d71573f93..8910b52f3d2a45b8bc527986b0a55ea092d9d070 100644 --- a/dev/tests/integration/testsuite/Mage/Wishlist/Block/AbstractTest.php +++ b/dev/tests/integration/testsuite/Mage/Wishlist/Block/AbstractTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Wishlist * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/XmlConnect/Helper/Catalog/ImageTest.php b/dev/tests/integration/testsuite/Mage/XmlConnect/Helper/Catalog/ImageTest.php index f8d0f2c59e8c20b515a1f9fac27d2dfff39ea5a5..54b4cf689961271629e0b34553b7afdb17a8e328 100644 --- a/dev/tests/integration/testsuite/Mage/XmlConnect/Helper/Catalog/ImageTest.php +++ b/dev/tests/integration/testsuite/Mage/XmlConnect/Helper/Catalog/ImageTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_XmlConnect * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/XmlConnect/Helper/DataTest.php b/dev/tests/integration/testsuite/Mage/XmlConnect/Helper/DataTest.php index a87f261e1632ffbf69f95f930c9ab24b2fc9e40d..7cac4390517f462d764733000c95333b8559b516 100644 --- a/dev/tests/integration/testsuite/Mage/XmlConnect/Helper/DataTest.php +++ b/dev/tests/integration/testsuite/Mage/XmlConnect/Helper/DataTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_XmlConnect * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/XmlConnect/Helper/ImageTest.php b/dev/tests/integration/testsuite/Mage/XmlConnect/Helper/ImageTest.php index f768b8ea04c543db358c09d90b590fab8c76049a..02245f4eda39b5ad8ba55472e404d64bba65f6fd 100644 --- a/dev/tests/integration/testsuite/Mage/XmlConnect/Helper/ImageTest.php +++ b/dev/tests/integration/testsuite/Mage/XmlConnect/Helper/ImageTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_XmlConnect * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/XmlConnect/Model/Catalog/Category/ImageTest.php b/dev/tests/integration/testsuite/Mage/XmlConnect/Model/Catalog/Category/ImageTest.php index 52a822e15553af7aa3e23ad81dcb1d9cb3bb0bd0..d57e9aca3fdf5d73b0e88a386ee9100756d8b894 100644 --- a/dev/tests/integration/testsuite/Mage/XmlConnect/Model/Catalog/Category/ImageTest.php +++ b/dev/tests/integration/testsuite/Mage/XmlConnect/Model/Catalog/Category/ImageTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_XmlConnect * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/XmlConnect/Model/TabsTest.php b/dev/tests/integration/testsuite/Mage/XmlConnect/Model/TabsTest.php index b23e5bbda75bab6269fcb5ef39465c27671b4f80..d6219db2032aacb24d08392e46d6ee7926e2ef0a 100644 --- a/dev/tests/integration/testsuite/Mage/XmlConnect/Model/TabsTest.php +++ b/dev/tests/integration/testsuite/Mage/XmlConnect/Model/TabsTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_XmlConnect * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/MageTest.php b/dev/tests/integration/testsuite/MageTest.php index 87733e249b595a522cc9bf352bdc59bd77c82810..62110a5c3e38f50c7961a06f795826996241dee2 100644 --- a/dev/tests/integration/testsuite/MageTest.php +++ b/dev/tests/integration/testsuite/MageTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -134,4 +134,38 @@ class MageTest extends PHPUnit_Framework_TestCase 'class name' => array('Mage_Core_Helper_Js', 'Mage_Core_Helper_Js'), ); } + + /** + * @magentoAppIsolation enabled + */ + public function testSetConfigModel() + { + Mage::reset(); + Mage::setConfigModel(); + $config = Mage::getConfig(); + $this->assertInstanceOf('Mage_Core_Model_Config', $config); + + Mage::reset(); + Mage::setConfigModel(array('config_model' => 'Mage_Core_Model_Config')); + $config = Mage::getConfig(); + $this->assertInstanceOf('Mage_Core_Model_Config', $config); + + Mage::reset(); + Mage::setConfigModel(array('config_model' => 'ERROR_STRING')); + $config = Mage::getConfig(); + $this->assertInstanceOf('Mage_Core_Model_Config', $config); + } + + /** + * @magentoAppIsolation enabled + */ + public function testSetIsInstalled() + { + if (!Mage::isInstalled()) { + $this->assertFalse(Mage::isInstalled()); + + Mage::setIsInstalled(array('is_installed' => true)); + $this->assertTrue(Mage::isInstalled()); + } + } } diff --git a/dev/tests/integration/testsuite/Phoenix/Moneybookers/Block/FormTest.php b/dev/tests/integration/testsuite/Phoenix/Moneybookers/Block/FormTest.php index 220d137040a52e5d3bc62df3c5fb47515000de26..8df0bb880d3641b0bda6c160445c719e8673f57b 100644 --- a/dev/tests/integration/testsuite/Phoenix/Moneybookers/Block/FormTest.php +++ b/dev/tests/integration/testsuite/Phoenix/Moneybookers/Block/FormTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Phoenix_Moneybookers * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Phoenix/Moneybookers/Block/PaymentTest.php b/dev/tests/integration/testsuite/Phoenix/Moneybookers/Block/PaymentTest.php index 28ea11b92129e9284756cbc7840062519c0f350c..debaf2833e98b43ee744d98f9427a08c615e323e 100644 --- a/dev/tests/integration/testsuite/Phoenix/Moneybookers/Block/PaymentTest.php +++ b/dev/tests/integration/testsuite/Phoenix/Moneybookers/Block/PaymentTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Phoenix_Moneybookers * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/integrity/Mage/Widget/SkinFilesTest.php b/dev/tests/integration/testsuite/integrity/Mage/Widget/SkinFilesTest.php index f6a303d45850f2f904bbfb63d3c98b7c212050aa..dfa511e84bc36375bc6e9b280e68c83093ef75df 100644 --- a/dev/tests/integration/testsuite/integrity/Mage/Widget/SkinFilesTest.php +++ b/dev/tests/integration/testsuite/integrity/Mage/Widget/SkinFilesTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Widget * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/integrity/Mage/Widget/TemplateFilesTest.php b/dev/tests/integration/testsuite/integrity/Mage/Widget/TemplateFilesTest.php index 46a86fbeced0dfb26d54228e92ca76fedfdc88fe..e980ab86168f5729cb3e537341a0fe182402325d 100644 --- a/dev/tests/integration/testsuite/integrity/Mage/Widget/TemplateFilesTest.php +++ b/dev/tests/integration/testsuite/integrity/Mage/Widget/TemplateFilesTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Widget * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/integrity/Mage/XmlConnect/SkinFilesTest.php b/dev/tests/integration/testsuite/integrity/Mage/XmlConnect/SkinFilesTest.php index 3f777ebd5a0a11361ad5ce9cfd22a987cc6eb34d..39ed836c88b7e8de7d683cd93376c1f4f567492f 100644 --- a/dev/tests/integration/testsuite/integrity/Mage/XmlConnect/SkinFilesTest.php +++ b/dev/tests/integration/testsuite/integrity/Mage/XmlConnect/SkinFilesTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_XmlConnect * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/integrity/modular/Email/TemplateFilesTest.php b/dev/tests/integration/testsuite/integrity/modular/Email/TemplateFilesTest.php index fa4e74621e874ba428003150c537f1aa5d71f49c..622d2284e89442514f14825bb0e7a50005ed0b0a 100644 --- a/dev/tests/integration/testsuite/integrity/modular/Email/TemplateFilesTest.php +++ b/dev/tests/integration/testsuite/integrity/modular/Email/TemplateFilesTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/integrity/modular/LayoutFilesTest.php b/dev/tests/integration/testsuite/integrity/modular/LayoutFilesTest.php index a42ce1b02aded43b8cff1df1705ac72792f8c08c..2c28e7a820754e0d9efe9b0ed4ef964696b87f8b 100644 --- a/dev/tests/integration/testsuite/integrity/modular/LayoutFilesTest.php +++ b/dev/tests/integration/testsuite/integrity/modular/LayoutFilesTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/integrity/modular/TemplateFilesTest.php b/dev/tests/integration/testsuite/integrity/modular/TemplateFilesTest.php index 7b342805bfafeebd7d0589b7165ee93ccc237692..bc123d31d2c51f0b9dd6dc26695e21d77d38c556 100644 --- a/dev/tests/integration/testsuite/integrity/modular/TemplateFilesTest.php +++ b/dev/tests/integration/testsuite/integrity/modular/TemplateFilesTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/integrity/modular/ViewConfigFilesTest.php b/dev/tests/integration/testsuite/integrity/modular/ViewConfigFilesTest.php index 4634b64bb25872e73ed18012efbddbb81f35c0ee..2ae7f552b98612f709c8d2bb06a3738aa7a6f754 100644 --- a/dev/tests/integration/testsuite/integrity/modular/ViewConfigFilesTest.php +++ b/dev/tests/integration/testsuite/integrity/modular/ViewConfigFilesTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/integrity/theme/SkinFilesTest.php b/dev/tests/integration/testsuite/integrity/theme/SkinFilesTest.php index 97c514e573986dcbd312393e17d749778e9d0544..65298dd11011239acbb8583415f4f37529e5ccf9 100644 --- a/dev/tests/integration/testsuite/integrity/theme/SkinFilesTest.php +++ b/dev/tests/integration/testsuite/integrity/theme/SkinFilesTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -150,12 +150,15 @@ class Integrity_Theme_SkinFilesTest extends Magento_Test_TestCase_IntegrityAbstr $layout = Mage::app()->getLayout()->getUpdate()->getFileLayoutUpdatesXml( $area, $package, $theme ); - foreach ($layout->xpath('//action[@method="addCss" or @method="addJs"]/*[1]') as $filenameNode) { - $skinFile = (string)$filenameNode; - if ($this->_isFileForDisabledModule($skinFile)) { - continue; + $elements = $layout->xpath('//action[@method="addCss" or @method="addJs"]/*[1]'); + if ($elements) { + foreach ($elements as $filenameNode) { + $skinFile = (string)$filenameNode; + if ($this->_isFileForDisabledModule($skinFile)) { + continue; + } + $files[$area][$package][$theme][] = $skinFile; } - $files[$area][$package][$theme][] = $skinFile; } } diff --git a/dev/tests/integration/testsuite/integrity/theme/TemplateFilesTest.php b/dev/tests/integration/testsuite/integrity/theme/TemplateFilesTest.php index 793ccbce6ea11d73d1caee94df159b0f51556598..c46869ac8994a14e6e800852e6d22e8492a47705 100644 --- a/dev/tests/integration/testsuite/integrity/theme/TemplateFilesTest.php +++ b/dev/tests/integration/testsuite/integrity/theme/TemplateFilesTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/integrity/theme/XmlFilesTest.php b/dev/tests/integration/testsuite/integrity/theme/XmlFilesTest.php index cf3bd97f2bada32b3c637e5974db5ec1eb0ad392..b1d7439633cc1bf2a81b7597d617fefb9f8ae986 100644 --- a/dev/tests/integration/testsuite/integrity/theme/XmlFilesTest.php +++ b/dev/tests/integration/testsuite/integrity/theme/XmlFilesTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/static/framework/Inspection/CodeSniffer/Command.php b/dev/tests/static/framework/Inspection/CodeSniffer/Command.php index 3a014241a2a2583584c23b676f1f37ea06908f65..bd319002b10190c41a349ae3fd6691256b003083 100644 --- a/dev/tests/static/framework/Inspection/CodeSniffer/Command.php +++ b/dev/tests/static/framework/Inspection/CodeSniffer/Command.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento * @subpackage static_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/static/framework/Inspection/CommandAbstract.php b/dev/tests/static/framework/Inspection/CommandAbstract.php index 38a295262d0b113ce19c4a8f2c636e6da9270596..90f0356e7940a7b16f58964a4943e4db5a0abfac 100644 --- a/dev/tests/static/framework/Inspection/CommandAbstract.php +++ b/dev/tests/static/framework/Inspection/CommandAbstract.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento * @subpackage static_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -55,7 +55,7 @@ abstract class Inspection_CommandAbstract public function run(array $whiteList, array $blackList = array()) { $shellCmd = $this->_buildShellCmd($whiteList, $blackList); - return $this->_execShellCmd($shellCmd); + return ($this->_execShellCmd($shellCmd) !== false); } /** @@ -65,7 +65,7 @@ abstract class Inspection_CommandAbstract */ public function canRun() { - return $this->_execShellCmd($this->_buildVersionShellCmd()); + return ($this->_execShellCmd($this->_buildVersionShellCmd()) !== false); } /** @@ -75,10 +75,10 @@ abstract class Inspection_CommandAbstract */ public function getVersion() { - if (!$this->_execShellCmd($this->_buildVersionShellCmd(), $versionOutput)) { + $versionOutput = $this->_execShellCmd($this->_buildVersionShellCmd()); + if (!$versionOutput) { return null; } - $versionOutput = implode("\n", $versionOutput); return (preg_match('/[^\d]*([^\s]+)/', $versionOutput, $matches) ? $matches[1] : $versionOutput); } @@ -109,16 +109,16 @@ abstract class Inspection_CommandAbstract abstract protected function _buildShellCmd($whiteList, $blackList); /** - * Execute the shell command on the current environment + * Execute a shell command on the current environment and return its output or FALSE on failure * * @param string $shellCmd - * @param array $output - * @return bool + * @return string|false */ - protected function _execShellCmd($shellCmd, array &$output = null) + protected function _execShellCmd($shellCmd) { $output = array(); exec($shellCmd . ' 2>&1', $output, $exitCode); - return ($exitCode === 0); + $output = implode(PHP_EOL, $output); + return ($exitCode === 0 ? $output : false); } } diff --git a/dev/tests/static/framework/Inspection/CopyPasteDetector/Command.php b/dev/tests/static/framework/Inspection/CopyPasteDetector/Command.php index 27067af3fcef7f0cc7ced26328fab51c41ac0966..9d1e0db261e96994f44e1d7c4c8bafe4042f4aba 100644 --- a/dev/tests/static/framework/Inspection/CopyPasteDetector/Command.php +++ b/dev/tests/static/framework/Inspection/CopyPasteDetector/Command.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento * @subpackage static_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -108,24 +108,22 @@ class Inspection_CopyPasteDetector_Command extends Inspection_CommandAbstract } /** - * Under Unix platform creates one more report in html-format. - * The report is generated based on already existing report in xml format and XSLT conversion scheme - * in "html_report.xslt". Returns null, if conversion tool was not found, otherwise returns true/false as a result - * of conversion tool execution. + * Generate HTML representation for an existing XML report using XSLT transformation * * @return bool|null */ protected function _generateHtmlReport() { - $isWindows = strncasecmp(PHP_OS, 'win', 3) == 0; - if ($isWindows) { - return null; - } - if (!$this->_execShellCmd('xsltproc --version')) { + if ($this->_execShellCmd('xsltproc --version') === false) { return null; } $xsltFile = __DIR__ . '/html_report.xslt'; - $result = $this->_execShellCmd("xsltproc {$xsltFile} {$this->_reportFile} > {$this->_reportFile}.html"); - return $result; + $result = $this->_execShellCmd(sprintf( + "xsltproc %s %s > %s", + escapeshellarg($xsltFile), + escapeshellarg($this->_reportFile), + escapeshellarg("{$this->_reportFile}.html") + )); + return ($result !== false); } } diff --git a/dev/tests/static/framework/Inspection/MessDetector/Command.php b/dev/tests/static/framework/Inspection/MessDetector/Command.php index e45e00d32b72f8429fa5021e88aabb7432ad1c90..0e593aa20a2eaab3270fa6dabe518e07607d7c79 100644 --- a/dev/tests/static/framework/Inspection/MessDetector/Command.php +++ b/dev/tests/static/framework/Inspection/MessDetector/Command.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento * @subpackage static_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/static/framework/bootstrap.php b/dev/tests/static/framework/bootstrap.php index bd58290f3e58710f90e73dd50e239ff0774d901b..f5f9af2d0ef29a6dadc6b1f378dad61ed1dfcb03 100644 --- a/dev/tests/static/framework/bootstrap.php +++ b/dev/tests/static/framework/bootstrap.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento * @subpackage static_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ if (!defined('PATH_TO_SOURCE_CODE')) { diff --git a/dev/tests/static/framework/tests/unit/phpunit.xml.dist b/dev/tests/static/framework/tests/unit/phpunit.xml.dist index fbfb3dba7c976c6d39dd69c43d5e53146415d593..4e5e511dd1fd6608b4150ad0ee1e5feae7886c9c 100644 --- a/dev/tests/static/framework/tests/unit/phpunit.xml.dist +++ b/dev/tests/static/framework/tests/unit/phpunit.xml.dist @@ -21,7 +21,7 @@ * * @category Magento * @package unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/dev/tests/static/framework/tests/unit/testsuite/Inspection/CodeSniffer/CommandTest.php b/dev/tests/static/framework/tests/unit/testsuite/Inspection/CodeSniffer/CommandTest.php index 927630e6cf886b98bb73c8546ff13bd900f108fe..5d48ddcf627f0df5f25446a25b4371d434aeec26 100644 --- a/dev/tests/static/framework/tests/unit/testsuite/Inspection/CodeSniffer/CommandTest.php +++ b/dev/tests/static/framework/tests/unit/testsuite/Inspection/CodeSniffer/CommandTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento * @subpackage static_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -44,13 +44,13 @@ class Inspection_CodeSniffer_CommandTest extends PHPUnit_Framework_TestCase /** * @dataProvider canRunDataProvider */ - public function testCanRun($expectedResult) + public function testCanRun($cmdOutput, $expectedResult) { $this->_cmd ->expects($this->once()) ->method('_execShellCmd') ->with($this->stringContains('phpcs')) - ->will($this->returnValue($expectedResult)) + ->will($this->returnValue($cmdOutput)) ; $this->assertEquals($expectedResult, $this->_cmd->canRun()); } @@ -58,8 +58,8 @@ class Inspection_CodeSniffer_CommandTest extends PHPUnit_Framework_TestCase public function canRunDataProvider() { return array( - 'success' => array(true), - 'failure' => array(false), + 'success' => array('PHP_CodeSniffer version X.Y.Z', true), + 'failure' => array(false, false), ); } @@ -68,16 +68,11 @@ class Inspection_CodeSniffer_CommandTest extends PHPUnit_Framework_TestCase */ public function testGetVersion($versionCmdOutput, $expectedVersion) { - $cmdCallback = function ($shellCmd, array &$output = null) use ($versionCmdOutput) - { - $output = array($versionCmdOutput); - return !empty($shellCmd); - }; $this->_cmd ->expects($this->once()) ->method('_execShellCmd') ->with($this->stringContains('phpcs')) - ->will($this->returnCallback($cmdCallback)) + ->will($this->returnValue($versionCmdOutput)) ; $this->assertEquals($expectedVersion, $this->_cmd->getVersion()); } diff --git a/dev/tests/static/framework/tests/unit/testsuite/Inspection/CopyPasteDetector/CommandTest.php b/dev/tests/static/framework/tests/unit/testsuite/Inspection/CopyPasteDetector/CommandTest.php index 2c5c1472d9c82c563dc704e833fed88e9798838f..270afbd0ca12981bbe9bfc6c03b7d8ced8aed9bd 100644 --- a/dev/tests/static/framework/tests/unit/testsuite/Inspection/CopyPasteDetector/CommandTest.php +++ b/dev/tests/static/framework/tests/unit/testsuite/Inspection/CopyPasteDetector/CommandTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento * @subpackage static_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -41,32 +41,25 @@ class Inspection_CopyPasteDetector_CommandTest extends PHPUnit_Framework_TestCas ); } - public function canTestDataProvider() - { - return array( - 'success' => array(true), - 'failure' => array(false), - ); - } - /** - * @dataProvider canTestDataProvider + * @dataProvider canRunDataProvider */ - public function testCanRun($expectedResult) + public function testCanRun($cmdOutput, $expectedResult) { $this->_cmd ->expects($this->once()) ->method('_execShellCmd') ->with($this->stringContains('phpcpd')) - ->will($this->returnValue($expectedResult)) + ->will($this->returnValue($cmdOutput)) ; $this->assertEquals($expectedResult, $this->_cmd->canRun()); } - public function getVersionDataProvider() + public function canRunDataProvider() { return array( - array('phpcpd 1.3.2 by Sebastian Bergmann.', '1.3.2'), + 'success' => array('phpcpd X.Y.Z', true), + 'failure' => array(false, false), ); } @@ -75,20 +68,22 @@ class Inspection_CopyPasteDetector_CommandTest extends PHPUnit_Framework_TestCas */ public function testGetVersion($versionCmdOutput, $expectedVersion) { - $cmdCallback = function ($shellCmd, array &$output = null) use ($versionCmdOutput) - { - $output = array($versionCmdOutput); - return !empty($shellCmd); - }; $this->_cmd ->expects($this->once()) ->method('_execShellCmd') ->with($this->stringContains('phpcpd')) - ->will($this->returnCallback($cmdCallback)) + ->will($this->returnValue($versionCmdOutput)) ; $this->assertEquals($expectedVersion, $this->_cmd->getVersion()); } + public function getVersionDataProvider() + { + return array( + array('phpcpd 1.3.2 by Sebastian Bergmann.', '1.3.2'), + ); + } + public function testRun() { $expectedQuoteChar = substr(escapeshellarg(' '), 0, 1); @@ -100,10 +95,34 @@ class Inspection_CopyPasteDetector_CommandTest extends PHPUnit_Framework_TestCas ; $expectedCmd = str_replace('"', $expectedQuoteChar, $expectedCmd); $this->_cmd - ->expects($this->once()) + ->expects($this->at(0)) ->method('_execShellCmd') ->with($expectedCmd) ; $this->_cmd->run(array('some/test/dir with space', 'some/test/file with space.php')); } + + public function testRunHtmlReport() + { + $this->_cmd + ->expects($this->at(0)) + ->method('_execShellCmd') + ->with($this->stringContains('phpcpd')) + ; + $this->_cmd + ->expects($this->at(1)) + ->method('_execShellCmd') + ->with($this->stringContains('xsltproc')) + ->will($this->returnValue('Using libxml X, libxslt Y and libexslt Z')) + ; + $expectedQuoteChar = substr(escapeshellarg(' '), 0, 1); + $expectedXsltCmd = 'xsltproc "%s/html_report.xslt" "some/report/file.xml" > "some/report/file.xml.html"'; + $expectedXsltCmd = str_replace('"', $expectedQuoteChar, $expectedXsltCmd); + $this->_cmd + ->expects($this->at(2)) + ->method('_execShellCmd') + ->with($this->matches($expectedXsltCmd)) + ; + $this->_cmd->run(array()); + } } diff --git a/dev/tests/static/framework/tests/unit/testsuite/Inspection/MessDetector/CommandTest.php b/dev/tests/static/framework/tests/unit/testsuite/Inspection/MessDetector/CommandTest.php index 14be99113199bb66d76c7589479b3d39648633f4..e6e07d121e48901a2e71db6c4f258542726c86a3 100644 --- a/dev/tests/static/framework/tests/unit/testsuite/Inspection/MessDetector/CommandTest.php +++ b/dev/tests/static/framework/tests/unit/testsuite/Inspection/MessDetector/CommandTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento * @subpackage static_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -49,13 +49,13 @@ class Inspection_MessDetector_CommandTest extends PHPUnit_Framework_TestCase /** * @dataProvider canTestDataProvider */ - public function testCanRun($expectedResult) + public function testCanRun($cmdOutput, $expectedResult) { $this->_cmd ->expects($this->once()) ->method('_execShellCmd') ->with($this->stringContains('phpmd')) - ->will($this->returnValue($expectedResult)) + ->will($this->returnValue($cmdOutput)) ; $this->assertEquals($expectedResult, $this->_cmd->canRun()); } @@ -63,16 +63,8 @@ class Inspection_MessDetector_CommandTest extends PHPUnit_Framework_TestCase public function canTestDataProvider() { return array( - 'success' => array(true), - 'failure' => array(false), - ); - } - - public function getVersionDataProvider() - { - return array( - array('PHPMD 0.2.8RC1 by Manuel Pichler', '0.2.8RC1'), - array('PHPMD 1.1.1 by Manuel Pichler', '1.1.1'), + 'success' => array('PHPMD X.Y.Z', true), + 'failure' => array(false, false), ); } @@ -81,20 +73,23 @@ class Inspection_MessDetector_CommandTest extends PHPUnit_Framework_TestCase */ public function testGetVersion($versionCmdOutput, $expectedVersion) { - $cmdCallback = function ($shellCmd, array &$output = null) use ($versionCmdOutput) - { - $output = array($versionCmdOutput); - return !empty($shellCmd); - }; $this->_cmd ->expects($this->once()) ->method('_execShellCmd') ->with($this->stringContains('phpmd')) - ->will($this->returnCallback($cmdCallback)) + ->will($this->returnValue($versionCmdOutput)) ; $this->assertEquals($expectedVersion, $this->_cmd->getVersion()); } + public function getVersionDataProvider() + { + return array( + array('PHPMD 0.2.8RC1 by Manuel Pichler', '0.2.8RC1'), + array('PHPMD 1.1.1 by Manuel Pichler', '1.1.1'), + ); + } + public function testRun() { $expectedQuoteChar = substr(escapeshellarg(' '), 0, 1); diff --git a/dev/tests/static/phpunit-all.xml.dist b/dev/tests/static/phpunit-all.xml.dist index 2481868d11202ed5378eead55ca1640ff646cbb2..a4d56cf25e6bdde6b9f4fad0b3de7d07b6920d86 100644 --- a/dev/tests/static/phpunit-all.xml.dist +++ b/dev/tests/static/phpunit-all.xml.dist @@ -23,7 +23,7 @@ * * @category tests * @package static - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/dev/tests/static/phpunit.xml.dist b/dev/tests/static/phpunit.xml.dist index 8e316d443df756adc68b9d2721e67922e9393656..8bef5f4fe2fb1c7ec7cd026ce67c57126dab881c 100644 --- a/dev/tests/static/phpunit.xml.dist +++ b/dev/tests/static/phpunit.xml.dist @@ -23,7 +23,7 @@ * * @category tests * @package static - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/dev/tests/static/testsuite/Integrity/ClassesTest.php b/dev/tests/static/testsuite/Integrity/ClassesTest.php index d198aab986ea850ccb25e1c9d66d46b7fb528fb7..13994e9ee65d6471741b930019a55c8e3bb38929 100644 --- a/dev/tests/static/testsuite/Integrity/ClassesTest.php +++ b/dev/tests/static/testsuite/Integrity/ClassesTest.php @@ -23,7 +23,7 @@ * @category tests * @package static * @subpackage Integrity - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Integrity_ClassesTest extends PHPUnit_Framework_TestCase @@ -36,14 +36,14 @@ class Integrity_ClassesTest extends PHPUnit_Framework_TestCase protected static $_existingClasses = array(); /** - * @param SplFileInfo $file - * @dataProvider phpFileDataProvider + * @param string $file + * @dataProvider Util_Files::getPhpFiles */ public function testPhpFile($file) { self::skipBuggyFile($file); $contents = file_get_contents($file); - $classes = $this->_collectMatches($contents, '/ + $classes = Util_Classes::getAllMatches($contents, '/ # ::getResourceModel ::getBlockSingleton ::getModel ::getSingleton \:\:get(?:ResourceModel | BlockSingleton | Model | Singleton)?\(\s*[\'"]([a-z\d_]+)[\'"]\s*[\),] @@ -66,7 +66,7 @@ class Integrity_ClassesTest extends PHPUnit_Framework_TestCase ); // without modifier "i". Starting from capital letter is a significant characteristic of a class name - $this->_collectMatches($contents, '/(?:\-> | parent\:\:)(?:_init | setType)\(\s* + Util_Classes::getAllMatches($contents, '/(?:\-> | parent\:\:)(?:_init | setType)\(\s* \'([A-Z][a-z\d][A-Za-z\d_]+)\'(?:,\s*\'([A-Z][a-z\d][A-Za-z\d_]+)\') \s*\)/x', $classes @@ -85,20 +85,12 @@ class Integrity_ClassesTest extends PHPUnit_Framework_TestCase */ protected function _collectResourceHelpersPhp($contents, &$classes) { - $matches = $this->_collectMatches($contents, '/(?:\:\:|\->)getResourceHelper\(\s*\'([a-z\d_]+)\'\s*\)/ix'); + $matches = Util_Classes::getAllMatches($contents, '/(?:\:\:|\->)getResourceHelper\(\s*\'([a-z\d_]+)\'\s*\)/ix'); foreach ($matches as $moduleName) { $classes[] = "{$moduleName}_Model_Resource_Helper_Mysql4"; } } - /** - * @return array - */ - public function phpFileDataProvider() - { - return FileDataProvider::getPhpFiles(); - } - /** * @param string $path * @dataProvider configFileDataProvider @@ -106,44 +98,8 @@ class Integrity_ClassesTest extends PHPUnit_Framework_TestCase public function testConfigFile($path) { self::skipBuggyFile($path); - $xml = simplexml_load_file($path); - $classes = array(); - - // various nodes - $nodes = $xml->xpath('/config//resource_adapter | //class | //model | //backend_model | //source_model - | //price_model | //model_token | //writer_model | //clone_model | //frontend_model | //admin_renderer - | //renderer' - ) ?: array(); - foreach ($nodes as $node) { - if (preg_match('/^([A-Z][a-z\d_][A-Za-z\d_]+)\:?/', (string)$node, $matches)) { - $classes[$matches[1]] = 1; - } - } - - // "backend_model" attribute - $nodes = $xml->xpath('//@backend_model') ?: array(); - foreach ($nodes as $node) { - $node = (array)$node; - $classes[$node['@attributes']['backend_model']] = 1; - } - - $this->_collectLoggingExpectedModels($xml, $classes); - - $this->_assertClassesExist(array_keys($classes)); - } - - /** - * Special case: collect "expected models" from logging xml-file - * - * @param SimpleXmlElement $xml - * @param array &$classes - */ - protected function _collectLoggingExpectedModels($xml, &$classes) - { - $nodes = $xml->xpath('/logging/*/expected_models/* | /logging/*/actions/*/expected_models/*') ?: array(); - foreach ($nodes as $node) { - $classes[$node->getName()] = 1; - } + $classes = Util_Classes::collectClassesInConfig(simplexml_load_file($path)); + $this->_assertClassesExist($classes); } /** @@ -151,71 +107,30 @@ class Integrity_ClassesTest extends PHPUnit_Framework_TestCase */ public function configFileDataProvider() { - return FileDataProvider::getConfigFiles(); + return Util_Files::getConfigFiles(); } /** * @param string $path - * @dataProvider layoutFileDataProvider + * @dataProvider Util_Files::getLayoutFiles */ public function testLayoutFile($path) { self::skipBuggyFile($path); $xml = simplexml_load_file($path); - $classes = array(); - - // block@type - $nodes = $xml->xpath('/layout//block[@type]') ?: array(); - foreach ($nodes as $node) { - $node = (array)$node; - $class = $node['@attributes']['type']; - $classes[(string)$class] = 1; - } - // any text nodes that contain conventional block/model/helper names - $nodes = $xml->xpath('/layout//action/attributeType | /layout//action[@method="addTab"]/content - | /layout//action[@method="addRenderer" or @method="addItemRender" or @method="addColumnRender" - or @method="addPriceBlockType" or @method="addMergeSettingsBlockType" - or @method="addInformationRenderer" or @method="addOptionRenderer" or @method="addRowItemRender" - or @method="addDatabaseBlock"]/*[2] - | /layout//action[@method="setMassactionBlockName" or @method="addProductConfigurationHelper"]/name - | /layout//action[@method="setEntityModelClass"]/code - | /layout//*[contains(text(), "_Block_") or contains(text(), "_Model_") or contains(text(), "_Helper_")]' - ) ?: array(); - foreach ($nodes as $node) { - $classes[(string)$node] = 1; + $classes = Util_Classes::getXmlNodeValues($xml, + '/layout//*[contains(text(), "_Block_") or contains(text(), "_Model_") or contains(text(), "_Helper_")]' + ); + foreach (Util_Classes::getXmlAttributeValues($xml, '/layout//@helper', 'helper') as $class) { + $classes[] = Util_Classes::getCallbackClass($class); } - - $this->_collectLayoutHelpersAndModules($xml, $classes); - - $this->_assertClassesExist(array_keys($classes)); - } - - /** - * Special case: collect declaration of helpers and modules in layout files and figure out helper class names - * - * @param SimpleXmlElement $xml - * @param array &$classes - */ - protected function _collectLayoutHelpersAndModules($xml, &$classes) - { - $nodes = $xml->xpath('/layout//@helper | /layout//@module') ?: array(); - foreach ($nodes as $node) { - $node = (array)$node; - if (isset($node['@attributes']['helper'])) { - $class = explode('::', $node['@attributes']['helper']); - $classes[array_shift($class)] = 1; - } - if (isset($node['@attributes']['module'])) { - $class = $node['@attributes']['module'] . '_Helper_Data'; - $classes[$class] = 1; - } + foreach (Util_Classes::getXmlAttributeValues($xml, '/layout//@module', 'module') as $module) { + $classes[] = "{$module}_Helper_Data"; } - } + $classes = array_merge($classes, Util_Classes::collectLayoutClasses($xml)); - public function layoutFileDataProvider() - { - return FileDataProvider::getLayoutFiles(); + $this->_assertClassesExist(array_unique($classes)); } /** @@ -246,27 +161,6 @@ class Integrity_ClassesTest extends PHPUnit_Framework_TestCase } } - /** - * Sub-routine to find all unique matches in specified content using specified PCRE - * - * @param string $contents - * @param string $regex - * @param array &$result - * @return array - */ - protected function _collectMatches($contents, $regex, &$result = array()) - { - preg_match_all($regex, $contents, $matches); - array_shift($matches); - foreach ($matches as $row) { - $result = array_merge($result, $row); - } - $result = array_filter(array_unique($result), function($value) { - return !empty($value); - }); - return $result; - } - /** * Check whether specified classes correspond to a file according PSR-0 standard * diff --git a/dev/tests/static/testsuite/Legacy/ClassesTest.php b/dev/tests/static/testsuite/Legacy/ClassesTest.php index 73eb4725a46ddb77a5f327afe7e8e11fc5266a67..392d45050ae87a33592cf9911eb96e1a889dbd22 100644 --- a/dev/tests/static/testsuite/Legacy/ClassesTest.php +++ b/dev/tests/static/testsuite/Legacy/ClassesTest.php @@ -21,7 +21,7 @@ * @category tests * @package static * @subpackage Integrity - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -31,25 +31,25 @@ class Legacy_ClassesTest extends PHPUnit_Framework_TestCase { /** - * List of already found classes to avoid checking them over and over again - * - * @var array + * @param string $file + * @dataProvider Util_Files::getPhpFiles */ - protected static $_existingClasses = array(); + public function testPhpCode($file) + { + $classes = self::collectPhpCodeClasses(file_get_contents($file)); + $this->_assertNonFactoryName($classes); + } /** - * Collect class names by patterns + * Scan contents as PHP-code and find class name occurrences * - * @param string $file - * @dataProvider FileDataProvider::getPhpFiles + * @param string $contents + * @param array &$classes + * @return array */ - public function testPhpCode($file) + public static function collectPhpCodeClasses($contents, &$classes = array()) { - $contents = file_get_contents($file); - $classes = array(); - $this->_collectMatches( - $contents, - '/ + Util_Classes::getAllMatches($contents, '/ # ::getModel ::getSingleton ::getResourceModel ::getResourceSingleton \:\:get(?:Resource)?(?:Model | Singleton)\(\s*[\'"]([^\'"]+)[\'"]\s*[\),] @@ -84,220 +84,85 @@ class Legacy_ClassesTest extends PHPUnit_Framework_TestCase $skipForInit = implode('|', array('id', '[\w\d_]+_id', 'pk', 'code', 'status', 'serial_number', 'entity_pk_value', 'currency_code') ); - $this->_collectMatches( - $contents, - '/ + Util_Classes::getAllMatches($contents, '/ (?:parent\:\: | \->)_init\(\s*[\'"]([^\'"]+)[\'"]\s*\) | (?:parent\:\: | \->)_init\(\s*[\'"]([^\'"]+)[\'"]\s*,\s*[\'"]((?!(' . $skipForInit . '))[^\'"]+)[\'"]\s*\) /Uix', $classes ); - - $this->_assertClassesNamedCorrect($classes, $file); + return $classes; } /** - * Return list of php and phtml files - * - * @return array - */ - public function phpFileDataProvider() - { - return FileDataProvider::getPhpFiles(); - } - - /** - * Collect class names by xpath in configurable files - * * @param string $path * @dataProvider configFileDataProvider */ public function testConfiguration($path) { $xml = simplexml_load_file($path); - $classes = array(); - - // various nodes - // excluding class in /config/sections and model in //staging_items/* - $nodes = $xml->xpath('/config//resource_adapter | /config/*[not(name()="sections")]//class - | //model[parent::parent[not(name() = "staging_items")]] | //backend_model | //source_model - | //price_model | //model_token | //writer_model | //clone_model | //frontend_model | //admin_renderer - | //renderer' - ) ?: array(); - foreach ($nodes as $node) { - if (preg_match('/([\w\d_\/]+)\:{0,2}/i', (string)$node, $matches)) { - $classes[$matches[1]] = 1; - } - } - - // "backend_model" attribute - $nodes = $xml->xpath('//@backend_model') ?: array(); - foreach ($nodes as $node) { - $node = (array)$node; - $classes[$node['@attributes']['backend_model']] = 1; - } - $this->_collectLoggingExpectedModels($xml, $classes); + $classes = Util_Classes::collectClassesInConfig($xml); + $this->_assertNonFactoryName($classes); - $this->_assertClassesNamedCorrect(array_keys($classes), $path); + $modules = Util_Classes::getXmlAttributeValues($xml, '//@module', 'module'); + $this->_assertNonFactoryName(array_unique($modules)); } /** - * Return list of configurable files - * * @return array */ public function configFileDataProvider() { - return FileDataProvider::getConfigFiles(); + return Util_Files::getConfigFiles(); } /** - * Special case: collect "expected models" from logging xml-file - * - * @param SimpleXmlElement $xml - * @param array &$classes - */ - protected function _collectLoggingExpectedModels($xml, &$classes) - { - $nodes = $xml->xpath('/logging/*/expected_models/* | /logging/*/actions/*/expected_models/*') ?: array(); - foreach ($nodes as $node) { - $classes[$node->getName()] = 1; - } - } - - /** - * Collect class names from layout files - * * @param string $path * @dataProvider layoutFileDataProvider */ public function testLayouts($path) { $xml = simplexml_load_file($path); - $classes = array(); - - // block@type - $nodes = $xml->xpath('/layout//block[@type]') ?: array(); - foreach ($nodes as $node) { - $node = (array)$node; - $class = $node['@attributes']['type']; - $classes[(string)$class] = 1; + $classes = Util_Classes::collectLayoutClasses($xml); + foreach (Util_Classes::getXmlAttributeValues($xml, '/layout//@helper', 'helper') as $class) { + $classes[] = Util_Classes::getCallbackClass($class); } - - // any text nodes that contain conventional block/model/helper names - $nodes = $xml->xpath('/layout//action/attributeType | /layout//renderer_block | /layout//renderer - | /layout//action[@method="addTab"]/content - | /layout//action[@method="addRenderer" or @method="addItemRender" or @method="addColumnRender" - or @method="addPriceBlockType" or @method="addMergeSettingsBlockType" - or @method="addInformationRenderer" or @method="addOptionRenderer" or @method="addRowItemRender" - or @method="addDatabaseBlock"]/block - | /layout//action[@method="setMassactionBlockName" or @method="addProductConfigurationHelper"]/name - | /layout//action[@method="setEntityModelClass"]/code' - ) ?: array(); - foreach ($nodes as $node) { - $classes[(string)$node] = 1; - } - - $this->_collectLayoutHelpersAndModules($xml, $classes); - - $this->_assertClassesNamedCorrect(array_keys($classes), $path); + $classes = array_merge($classes, Util_Classes::getXmlAttributeValues($xml, '/layout//@module', 'module')); + $this->_assertNonFactoryName(array_unique($classes)); } /** - * Return list of layout files - * * @return array */ public function layoutFileDataProvider() { - return FileDataProvider::getLayoutFiles(); - } - - /** - * Special case: collect declaration of helpers and modules in layout files and figure out helper class names - * - * @param SimpleXmlElement $xml - * @param array &$classes - */ - protected function _collectLayoutHelpersAndModules($xml, &$classes) - { - $nodes = $xml->xpath('/layout//@helper | /layout//@module') ?: array(); - foreach ($nodes as $node) { - $node = (array)$node; - if (isset($node['@attributes']['helper'])) { - $class = explode('::', $node['@attributes']['helper']); - $classes[array_shift($class)] = 1; - } - if (isset($node['@attributes']['module'])) { - $class = $node['@attributes']['module'] . '_Helper_Data'; - $classes[$class] = 1; - } - } + return Util_Files::getLayoutFiles(); } /** - * Sub-routine to find all unique matches in specified content using specified PCRE + * Check whether specified classes or module names correspond to a file according PSR-0 standard * - * @param string $contents - * @param string $regex - * @param array &$result - * @return array - */ - protected function _collectMatches($contents, $regex, &$result = array()) - { - preg_match_all($regex, $contents, $matches); - - array_shift($matches); - foreach ($matches as $row) { - $result = array_merge($result, $row); - } - $result = array_filter(array_unique($result), function($value) { - return !empty($value); - }); - return $result; - } - - /** - * Check whether specified classes correspond to a file according PSR-0 standard - * - * Cyclomatic complexity is because of temporary marking test as incomplete * Suppressing "unused variable" because of the "catch" block * - * @param array $classes - * @param string $fileName - * @SuppressWarnings(PHPMD.CyclomaticComplexity) + * @param array $names * @SuppressWarnings(PHPMD.UnusedLocalVariable) */ - protected function _assertClassesNamedCorrect($classes, $fileName) + protected function _assertNonFactoryName($names) { - if (!$classes) { + if (!$names) { return; } - $badClasses = array(); - foreach ($classes as $class) { + $factoryNames = array(); + foreach ($names as $name) { try { - $matches = array(); - $this->assertTrue(preg_match('/(?:[^\w\d_]|__)/i', $class, $matches) == 0); - array_filter( - array_map(function ($value) { - return ucfirst($value) === $value; - }, - explode('_', $class) - ), - array($this, "assertTrue") - ); - self::$_existingClasses[$class] = 1; + $this->assertFalse(false === strpos($name, '_')); + $this->assertRegExp('/^([A-Z][A-Za-z\d_]+)+$/', $name); } catch (PHPUnit_Framework_AssertionFailedError $e) { - if ('Mage_Catalog_Model_Resource_Convert' == $class) { - $this->markTestIncomplete('Bug MAGE-4763'); - } - - $badClasses[] = $class; + $factoryNames[] = $name; } } - if ($badClasses) { - $this->fail("Incorrect class(es) declaration in {$fileName}:\n" . implode("\n", $badClasses)); + if ($factoryNames) { + $this->fail('Obsolete factory name(s) detected:' . "\n" . implode("\n", $factoryNames)); } } } diff --git a/dev/tests/static/testsuite/Legacy/ConfigTest.php b/dev/tests/static/testsuite/Legacy/ConfigTest.php index c6e7d56879f165ce86462bd879e8e450f2250e3a..a9cdb9739e11a005b3344a23626c7e573dc675ce 100644 --- a/dev/tests/static/testsuite/Legacy/ConfigTest.php +++ b/dev/tests/static/testsuite/Legacy/ConfigTest.php @@ -21,7 +21,7 @@ * @category tests * @package static * @subpackage Legacy - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -62,6 +62,6 @@ class Legacy_ConfigTest extends PHPUnit_Framework_TestCase */ public function configFileDataProvider() { - return FileDataProvider::getConfigFiles('config.xml'); + return Util_Files::getConfigFiles('config.xml'); } } diff --git a/dev/tests/static/testsuite/Legacy/EmailTemplateTest.php b/dev/tests/static/testsuite/Legacy/EmailTemplateTest.php index 7dce06e2c4f644f57a48bf577cb039fe28d7f20b..c48e9f0ca8ba53317dbb7591f112b5706696a1f4 100644 --- a/dev/tests/static/testsuite/Legacy/EmailTemplateTest.php +++ b/dev/tests/static/testsuite/Legacy/EmailTemplateTest.php @@ -21,7 +21,7 @@ * @category tests * @package static * @subpackage Legacy - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -46,6 +46,6 @@ class Legacy_EmailTemplateTest extends PHPUnit_Framework_TestCase public function obsoleteDirectivesDataProvider() { - return FileDataProvider::getEmailTemplates(); + return Util_Files::getEmailTemplates(); } } diff --git a/dev/tests/static/testsuite/Legacy/FilesystemTest.php b/dev/tests/static/testsuite/Legacy/FilesystemTest.php new file mode 100644 index 0000000000000000000000000000000000000000..8a9ba2a978842b012bca71b86a7c4df264bcbcdc --- /dev/null +++ b/dev/tests/static/testsuite/Legacy/FilesystemTest.php @@ -0,0 +1,53 @@ +<?php +/** + * Backwards-incompatible changes in file system + * + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category tests + * @package static + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +class Legacy_FilesystemTest extends PHPUnit_Framework_TestCase +{ + /** + * Directories may re-appear again during merging, therefore ensure they were properly relocated + * + * @param string $path + * @dataProvider relocationsDataProvider + */ + public function testRelocations($path) + { + $this->assertFileNotExists(realpath(__DIR__ . '/../../../../..') . DIRECTORY_SEPARATOR . $path); + } + + public function relocationsDataProvider() + { + return array( + array('Relocated to pub/errors' => 'errors'), + array('Eliminated with Mage_Compiler' => 'includes'), + array('Relocated to pub/js' => 'js'), + array('Relocated to pub/media' => 'media'), + array('Eliminated as not needed' => 'pkginfo'), + array('Dissolved into themes under app/design ' => 'skin'), + ); + } +} diff --git a/dev/tests/static/testsuite/Legacy/LayoutTest.php b/dev/tests/static/testsuite/Legacy/LayoutTest.php index 58c8274727d5c6cce9f93123d6631e464091d6fe..e3e6c502cfd00dab038f6b063fd2f316a2cddceb 100644 --- a/dev/tests/static/testsuite/Legacy/LayoutTest.php +++ b/dev/tests/static/testsuite/Legacy/LayoutTest.php @@ -21,7 +21,7 @@ * @category tests * @package static * @subpackage Legacy - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -54,6 +54,6 @@ class Legacy_LayoutTest extends PHPUnit_Framework_TestCase public function layoutFileDataProvider() { - return FileDataProvider::getLayoutFiles(); + return Util_Files::getLayoutFiles(); } } diff --git a/dev/tests/static/testsuite/Legacy/LicenseTest.php b/dev/tests/static/testsuite/Legacy/LicenseTest.php index da4d8ff1c38e2d15091b76d86aaee08bd3569a6e..c566b01295dffc0b4a96604020c5f17c25b5ae88 100644 --- a/dev/tests/static/testsuite/Legacy/LicenseTest.php +++ b/dev/tests/static/testsuite/Legacy/LicenseTest.php @@ -21,7 +21,7 @@ * @category tests * @package static * @subpackage Legacy - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/static/testsuite/Legacy/ObsoleteCodeTest.php b/dev/tests/static/testsuite/Legacy/ObsoleteCodeTest.php index fe477e1b286300fd260015a6f302588de14f7474..7a719d40852afd5989fc0c4138c89506fd0b72c4 100644 --- a/dev/tests/static/testsuite/Legacy/ObsoleteCodeTest.php +++ b/dev/tests/static/testsuite/Legacy/ObsoleteCodeTest.php @@ -21,7 +21,7 @@ * @category tests * @package static * @subpackage Legacy - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -64,7 +64,7 @@ class Legacy_ObsoleteCodeTest extends PHPUnit_Framework_TestCase */ public function phpFileDataProvider() { - return FileDataProvider::getPhpFiles(); + return Util_Files::getPhpFiles(); } /** @@ -82,7 +82,7 @@ class Legacy_ObsoleteCodeTest extends PHPUnit_Framework_TestCase */ public function xmlFileDataProvider() { - return FileDataProvider::getXmlFiles(); + return Util_Files::getXmlFiles(); } /** @@ -100,7 +100,7 @@ class Legacy_ObsoleteCodeTest extends PHPUnit_Framework_TestCase */ public function jsFileDataProvider() { - return FileDataProvider::getJsFiles(); + return Util_Files::getJsFiles(); } /** @@ -265,8 +265,16 @@ class Legacy_ObsoleteCodeTest extends PHPUnit_Framework_TestCase $result = array(); foreach ($config as $key => $value) { $entity = is_string($key) ? $key : $value; - $class = isset($value['class_scope']) ? $value['class_scope'] : null; - $suggestion = isset($value['suggestion']) ? sprintf(self::SUGGESTION_MESSAGE, $value['suggestion']) : ''; + $class = null; + $suggestion = null; + if (is_array($value)) { + if (isset($value['class_scope'])) { + $class = $value['class_scope']; + } + if (isset($value['suggestion'])) { + $suggestion = sprintf(self::SUGGESTION_MESSAGE, $value['suggestion']); + } + } $result[$entity] = array( 'suggestion' => $suggestion, 'class_scope' => $class diff --git a/dev/tests/static/testsuite/Legacy/TableTest.php b/dev/tests/static/testsuite/Legacy/TableTest.php index 54daafe3b828baa01f48d1344e9bd3e585b8e933..22339a457590dfee2dc8885cf242482a1332a440 100644 --- a/dev/tests/static/testsuite/Legacy/TableTest.php +++ b/dev/tests/static/testsuite/Legacy/TableTest.php @@ -21,7 +21,7 @@ * @category tests * @package static * @subpackage Legacy - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -159,18 +159,7 @@ class Legacy_TableTest extends PHPUnit_Framework_TestCase */ protected function _getRegexpTableInArrays($filePath) { - $keys = array( - 'table', - 'additional_attribute_table', - ); - - $regexps = array(); - foreach ($keys as $key) { - $regexps[] = '[\'"]' . $key . '[\'"]\s*=>\s*[\'"]([^\'"]+)'; - } - $result = '#' . implode('|', $regexps) . '#'; - - return $result; + return '/[\'"](?:[a-z\d_]+_)?table[\'"]\s*=>\s*[\'"]([^\'"]+)/'; } /** @@ -243,6 +232,6 @@ class Legacy_TableTest extends PHPUnit_Framework_TestCase */ public function tableNameDataProvider() { - return FileDataProvider::getPhpFiles(); + return Util_Files::getPhpFiles(); } } diff --git a/dev/tests/static/testsuite/Legacy/_files/obsolete_classes.php b/dev/tests/static/testsuite/Legacy/_files/obsolete_classes.php index f83052271ead55f4789356edf8665bf1c0f7ba80..ffbf1c92249611be64595ffd4ed5a4c71f305930 100644 --- a/dev/tests/static/testsuite/Legacy/_files/obsolete_classes.php +++ b/dev/tests/static/testsuite/Legacy/_files/obsolete_classes.php @@ -21,7 +21,7 @@ * @category tests * @package static * @subpackage Legacy - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ return array( @@ -165,6 +165,7 @@ return array( 'Varien_Convert_Validator_Dryrun', 'Varien_Convert_Validator_Column', 'Varien_Convert_Validator_Interface', + 'Varien_Profiler' => array('suggestion' => 'Magento_Profiler'), 'Mage_Catalog_Model_Resource_Product_Attribute_Frontend_Tierprice', 'Mage_Adminhtml_Block_Api_Tab_Userroles', 'Mage_Adminhtml_Block_Api_Edituser', diff --git a/dev/tests/static/testsuite/Legacy/_files/obsolete_constants.php b/dev/tests/static/testsuite/Legacy/_files/obsolete_constants.php index e1e032a6140bdd86c33a56488aec82c0f4aff196..b86e08dfe470209be0ef7458ff0fbf7322d9df57 100644 --- a/dev/tests/static/testsuite/Legacy/_files/obsolete_constants.php +++ b/dev/tests/static/testsuite/Legacy/_files/obsolete_constants.php @@ -21,7 +21,7 @@ * @category tests * @package static * @subpackage Legacy - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ return array( diff --git a/dev/tests/static/testsuite/Legacy/_files/obsolete_methods.php b/dev/tests/static/testsuite/Legacy/_files/obsolete_methods.php index f220926ab8a96d4b1d11819399aa99bcbca06b0c..d34c02eb67cece9bb12f97dfe1c10222f6b022a4 100644 --- a/dev/tests/static/testsuite/Legacy/_files/obsolete_methods.php +++ b/dev/tests/static/testsuite/Legacy/_files/obsolete_methods.php @@ -21,7 +21,7 @@ * @category tests * @package static * @subpackage Legacy - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ return array( diff --git a/dev/tests/static/testsuite/Legacy/_files/obsolete_properties.php b/dev/tests/static/testsuite/Legacy/_files/obsolete_properties.php index 42f2143ee3d72906c34ddce49a530968eaeca61e..e56d77a1e51f2bf71a58f7dc039c0634b9c66297 100644 --- a/dev/tests/static/testsuite/Legacy/_files/obsolete_properties.php +++ b/dev/tests/static/testsuite/Legacy/_files/obsolete_properties.php @@ -21,7 +21,7 @@ * @category tests * @package static * @subpackage Legacy - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ return array( diff --git a/dev/tests/static/testsuite/Php/Exemplar/CodeMessTest.php b/dev/tests/static/testsuite/Php/Exemplar/CodeMessTest.php index 39265f6542fd7fef6c43ea367bb5d79f062f0e4e..623be2325217583f429e775692abe9dfc8867a3d 100644 --- a/dev/tests/static/testsuite/Php/Exemplar/CodeMessTest.php +++ b/dev/tests/static/testsuite/Php/Exemplar/CodeMessTest.php @@ -18,10 +18,9 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @category Magento - * @package Magento - * @subpackage static_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @category tests + * @package static + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -69,7 +68,7 @@ class Php_Exemplar_CodeMessTest extends PHPUnit_Framework_TestCase $doc->load($rulesetFile); libxml_use_internal_errors(true); - $isValid = $doc->schemaValidate('http://pmd.sourceforge.net/ruleset_xml_schema.xsd'); + $isValid = $doc->schemaValidate(__DIR__ . '/_files/phpmd_ruleset.xsd'); $errors = "XML-file is invalid.\n"; if ($isValid === false) { foreach (libxml_get_errors() as $error) { @@ -93,24 +92,25 @@ class Php_Exemplar_CodeMessTest extends PHPUnit_Framework_TestCase /** * @param string $inputFile - * @param string $expectedReportFile + * @param string|array $expectedXpaths * @depends testRulesetFormat * @depends testPhpMdAvailability * @dataProvider ruleViolationDataProvider */ - public function testRuleViolation($inputFile, $expectedReportFile) + public function testRuleViolation($inputFile, $expectedXpaths) { $this->assertFalse(self::$_cmd->run( array($inputFile)), "PHP Mess Detector has failed to identify problem at the erroneous file {$inputFile}" ); - /* Cleanup report from the variable information */ - $actualReportXml = file_get_contents(self::$_cmd->getReportFile()); - $actualReportXml = preg_replace('/(?<!\?xml)\s+version=".+?"/', '', $actualReportXml, 1); - $actualReportXml = preg_replace('/\s+(?:timestamp|externalInfoUrl)=".+?"/', '', $actualReportXml); - $actualReportXml = str_replace(realpath($inputFile), basename($inputFile), $actualReportXml); - - $this->assertXmlStringEqualsXmlFile($expectedReportFile, $actualReportXml); + $actualReportXml = simplexml_load_file(self::$_cmd->getReportFile()); + $expectedXpaths = (array)$expectedXpaths; + foreach ($expectedXpaths as $expectedXpath) { + $this->assertNotEmpty( + $actualReportXml->xpath($expectedXpath), + "Expected xpath: '$expectedXpath' for file: '$inputFile'" + ); + } } /** @@ -118,59 +118,6 @@ class Php_Exemplar_CodeMessTest extends PHPUnit_Framework_TestCase */ public function ruleViolationDataProvider() { - return array( - 'cyclomatic complexity' => array( - __DIR__ . '/_files/phpmd/input/cyclomatic_complexity.php', - __DIR__ . '/_files/phpmd/output/cyclomatic_complexity.xml', - ), - 'method length' => array( - __DIR__ . '/_files/phpmd/input/method_length.php', - __DIR__ . '/_files/phpmd/output/method_length.xml', - ), - 'parameter list' => array( - __DIR__ . '/_files/phpmd/input/parameter_list.php', - __DIR__ . '/_files/phpmd/output/parameter_list.xml', - ), - 'method count' => array( - __DIR__ . '/_files/phpmd/input/method_count.php', - __DIR__ . '/_files/phpmd/output/method_count.xml', - ), - 'field count' => array( - __DIR__ . '/_files/phpmd/input/field_count.php', - __DIR__ . '/_files/phpmd/output/field_count.xml', - ), - 'public count' => array( - __DIR__ . '/_files/phpmd/input/public_count.php', - __DIR__ . '/_files/phpmd/output/public_count.xml', - ), - 'prohibited statement' => array( - __DIR__ . '/_files/phpmd/input/prohibited_statement.php', - __DIR__ . '/_files/phpmd/output/prohibited_statement.xml', - ), - 'prohibited statement goto' => array( - __DIR__ . '/_files/phpmd/input/prohibited_statement_goto.php', - __DIR__ . '/_files/phpmd/output/prohibited_statement_goto.xml', - ), - 'inheritance depth' => array( - __DIR__ . '/_files/phpmd/input/inheritance_depth.php', - __DIR__ . '/_files/phpmd/output/inheritance_depth.xml', - ), - 'descendant count' => array( - __DIR__ . '/_files/phpmd/input/descendant_count.php', - __DIR__ . '/_files/phpmd/output/descendant_count.xml', - ), - 'coupling' => array( - __DIR__ . '/_files/phpmd/input/coupling.php', - __DIR__ . '/_files/phpmd/output/coupling.xml', - ), - 'naming' => array( - __DIR__ . '/_files/phpmd/input/naming.php', - __DIR__ . '/_files/phpmd/output/naming.xml', - ), - 'unused' => array( - __DIR__ . '/_files/phpmd/input/unused.php', - __DIR__ . '/_files/phpmd/output/unused.xml', - ), - ); + return include(__DIR__ . '/_files/phpmd/data.php'); } } diff --git a/dev/tests/static/testsuite/Php/Exemplar/CodeStyleTest.php b/dev/tests/static/testsuite/Php/Exemplar/CodeStyleTest.php index fc73b0b586fd70e641cdbb821d2d10df65807680..2b13aa68cf23a3064f5dddbc441026bddd3a31af 100644 --- a/dev/tests/static/testsuite/Php/Exemplar/CodeStyleTest.php +++ b/dev/tests/static/testsuite/Php/Exemplar/CodeStyleTest.php @@ -18,10 +18,9 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @category Magento - * @package Magento - * @subpackage static_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @category tests + * @package static + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/data.php b/dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/data.php new file mode 100644 index 0000000000000000000000000000000000000000..b3883be2bc087ba19278a2ed7db83bd2bb110d4c --- /dev/null +++ b/dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/data.php @@ -0,0 +1,125 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category tests + * @package static + * @subpackage Legacy + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +return array( + 'cyclomatic complexity' => array( + __DIR__ . '/input/cyclomatic_complexity.php', + 'file/violation[@beginline=8 and @endline=40 and @rule="CyclomaticComplexity" and @ruleset="Code Size Rules" + and @package="+global" and @class="Foo" and @method="bar" and @priority=3]' + ), + 'method length' => array( + __DIR__ . '/input/method_length.php', + 'file/violation[@beginline=8 and @endline=107 and @rule="ExcessiveMethodLength" and @ruleset="Code Size Rules" + and @package="+global" and @class="Foo" and @method="bar" and @priority=3]', + ), + 'parameter list' => array( + __DIR__ . '/input/parameter_list.php', + 'file/violation[@beginline=8 and @endline=11 and @rule="ExcessiveParameterList" and @ruleset="Code Size Rules" + and @package="+global" and @class="Foo" and @method="bar" and @priority=3]', + ), + 'method count' => array( + __DIR__ . '/input/method_count.php', + 'file/violation[@beginline=6 and @endline=116 and @rule="TooManyMethods" and @ruleset="Code Size Rules" + and @package="+global" and @class="Foo" and @priority=3]', + ), + 'field count' => array( + __DIR__ . '/input/field_count.php', + 'file/violation[@beginline=6 and @endline=29 and @rule="TooManyFields" and @ruleset="Code Size Rules" + and @package="+global" and @class="Foo" and @priority=3]', + ), + 'public count' => array( + __DIR__ . '/input/public_count.php', + 'file/violation[@beginline=11 and @endline=58 and @rule="ExcessivePublicCount" and @ruleset="Code Size Rules" + and @package="+global" and @class="Foo" and @priority=3]', + ), + 'prohibited statement' => array( + __DIR__ . '/input/prohibited_statement.php', + array( + 'file/violation[@beginline=7 and @endline=7 and @rule="ExitExpression" and @ruleset="Design Rules" + and @priority=1]', + 'file/violation[@beginline=12 and @endline=12 and @rule="EvalExpression" and @ruleset="Design Rules" + and @priority=1]', + ), + ), + 'prohibited statement goto' => array( + __DIR__ . '/input/prohibited_statement_goto.php', + 'file/violation[@beginline=10 and @endline=10 and @rule="GotoStatement" and @ruleset="Design Rules" + and @priority=1]', + ), + 'inheritance depth' => array( + __DIR__ . '/input/inheritance_depth.php', + 'file/violation[@beginline=15 and @endline=15 and @rule="DepthOfInheritance" and @ruleset="Design Rules" + and @package="+global" and @class="Foo07" and @priority=2]', + ), + 'descendant count' => array( + __DIR__ . '/input/descendant_count.php', + 'file/violation[@beginline=3 and @endline=3 and @rule="NumberOfChildren" and @ruleset="Design Rules" + and @package="+global" and @class="Foo01" and @priority=2]', + ), + 'coupling' => array( + __DIR__ . '/input/coupling.php', + 'file/violation[@beginline=19 and @endline=78 and @rule="CouplingBetweenObjects" and @ruleset="Design Rules" + and @package="+global" and @class="Foo" and @priority=2]', + ), + 'naming' => array( + __DIR__ . '/input/naming.php', + array( + 'file/violation[@beginline=5 and @endline=5 and @rule="ConstantNamingConventions" + and @ruleset="Naming Rules" and @priority=4]', + 'file/violation[@beginline=11 and @endline=11 and @rule="ShortVariable" and @ruleset="Naming Rules" + and @priority=3]', + 'file/violation[@beginline=13 and @endline=13 and @rule="LongVariable" and @ruleset="Naming Rules" + and @priority=3]', + 'file/violation[@beginline=18 and @endline=18 and @rule="ConstructorWithNameAsEnclosingClass" + and @ruleset="Naming Rules" and @class="Foo" and @method="Foo" and @priority=3]', + 'file/violation[@beginline=20 and @endline=20 and @rule="ShortVariable" and @ruleset="Naming Rules" + and @priority=3]', + 'file/violation[@beginline=20 and @endline=20 and @rule="LongVariable" and @ruleset="Naming Rules" + and @priority=3]', + 'file/violation[@beginline=22 and @endline=22 and @rule="ShortVariable" and @ruleset="Naming Rules" + and @priority=3]', + 'file/violation[@beginline=23 and @endline=23 and @rule="LongVariable" and @ruleset="Naming Rules" + and @priority=3]', + 'file/violation[@beginline=30 and @endline=30 and @rule="ShortMethodName" and @ruleset="Naming Rules" + and @package="+global" and @class="Foo" and @method="_x" and @priority=3]', + 'file/violation[@beginline=36 and @endline=39 and @rule="BooleanGetMethodName" and @ruleset="Naming Rules" + and @package="+global" and @class="Foo" and @method="getBoolValue" and @priority=4]', + ), + ), + 'unused' => array( + __DIR__ . '/input/unused.php', + array( + 'file/violation[@beginline=5 and @endline=5 and @rule="UnusedPrivateField" and @ruleset="Unused Code Rules" + and @priority=3]', + 'file/violation[@beginline=7 and @endline=7 and @rule="UnusedPrivateMethod" and @ruleset="Unused Code Rules" + and @package="+global" and @class="Foo" and @method="_unusedMethod" and @priority=3]', + 'file/violation[@beginline=9 and @endline=9 and @rule="UnusedFormalParameter" + and @ruleset="Unused Code Rules" and @priority=3]', + 'file/violation[@beginline=11 and @endline=11 and @rule="UnusedLocalVariable" + and @ruleset="Unused Code Rules" and @priority=3]', + ), + ), +); diff --git a/dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/output/coupling.xml b/dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/output/coupling.xml deleted file mode 100644 index 4c08cf792869e98875aa91dac79118d535982780..0000000000000000000000000000000000000000 --- a/dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/output/coupling.xml +++ /dev/null @@ -1,8 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?> -<pmd> - <file name="coupling.php"> - <violation beginline="19" endline="78" rule="CouplingBetweenObjects" ruleset="Design Rules" package="+global" class="Foo" priority="2"> - The class Foo has a coupling between objects value of 13. Consider to reduce the number of dependencies under 13. - </violation> - </file> -</pmd> diff --git a/dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/output/cyclomatic_complexity.xml b/dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/output/cyclomatic_complexity.xml deleted file mode 100644 index 8e4ce0b529c196f0e19d40f0038d816e9caad440..0000000000000000000000000000000000000000 --- a/dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/output/cyclomatic_complexity.xml +++ /dev/null @@ -1,8 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?> -<pmd> - <file name="cyclomatic_complexity.php"> - <violation beginline="8" endline="40" rule="CyclomaticComplexity" ruleset="Code Size Rules" package="+global" class="Foo" method="bar" priority="3"> - The method bar() has a Cyclomatic Complexity of 10. - </violation> - </file> -</pmd> diff --git a/dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/output/descendant_count.xml b/dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/output/descendant_count.xml deleted file mode 100644 index c3c0a54ae4ca0042d805eef8c2a2ed66ddc37084..0000000000000000000000000000000000000000 --- a/dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/output/descendant_count.xml +++ /dev/null @@ -1,8 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?> -<pmd> - <file name="descendant_count.php"> - <violation beginline="3" endline="3" rule="NumberOfChildren" ruleset="Design Rules" package="+global" class="Foo01" priority="2"> - The class Foo01 has 15 children. Consider to rebalance this class hierarchy. - </violation> - </file> -</pmd> diff --git a/dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/output/field_count.xml b/dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/output/field_count.xml deleted file mode 100644 index 5d0c0dd935a1ee83d1106c3df96cdb459c409cdc..0000000000000000000000000000000000000000 --- a/dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/output/field_count.xml +++ /dev/null @@ -1,8 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?> -<pmd> - <file name="field_count.php"> - <violation beginline="6" endline="29" rule="TooManyFields" ruleset="Code Size Rules" package="+global" class="Foo" priority="3"> - Too many fields - </violation> - </file> -</pmd> diff --git a/dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/output/inheritance_depth.xml b/dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/output/inheritance_depth.xml deleted file mode 100644 index f0db5d63d97a91ee6be35ed3cd287410e31c7ab3..0000000000000000000000000000000000000000 --- a/dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/output/inheritance_depth.xml +++ /dev/null @@ -1,8 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?> -<pmd> - <file name="inheritance_depth.php"> - <violation beginline="15" endline="15" rule="DepthOfInheritance" ruleset="Design Rules" package="+global" class="Foo07" priority="2"> - The class Foo07 has 6 parents. Consider to reduce the depth of this class hierarchy. - </violation> - </file> -</pmd> diff --git a/dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/output/method_count.xml b/dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/output/method_count.xml deleted file mode 100644 index aa401ab28ae01fe38376a47245b267ecf2105193..0000000000000000000000000000000000000000 --- a/dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/output/method_count.xml +++ /dev/null @@ -1,8 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?> -<pmd> - <file name="method_count.php"> - <violation beginline="6" endline="116" rule="TooManyMethods" ruleset="Code Size Rules" package="+global" class="Foo" priority="3"> - This class has too many methods, consider refactoring it. - </violation> - </file> -</pmd> diff --git a/dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/output/method_length.xml b/dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/output/method_length.xml deleted file mode 100644 index c54238a0e2f03dd720e73f4cdad9bfcf12beda01..0000000000000000000000000000000000000000 --- a/dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/output/method_length.xml +++ /dev/null @@ -1,8 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?> -<pmd> - <file name="method_length.php"> - <violation beginline="8" endline="107" rule="ExcessiveMethodLength" ruleset="Code Size Rules" package="+global" class="Foo" method="bar" priority="3"> - Avoid really long methods. - </violation> - </file> -</pmd> diff --git a/dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/output/naming.xml b/dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/output/naming.xml deleted file mode 100644 index 716948efe78ba44dcfa20059fe6fb0fd13af6207..0000000000000000000000000000000000000000 --- a/dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/output/naming.xml +++ /dev/null @@ -1,35 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?> -<pmd> - <file name="naming.php"> - <violation beginline="5" endline="5" rule="ConstantNamingConventions" ruleset="Naming Rules" priority="4"> - Constant nonUppercaseName should be defined in uppercase - </violation> - <violation beginline="11" endline="11" rule="ShortVariable" ruleset="Naming Rules" priority="3"> - Avoid variables with short names like $_a - </violation> - <violation beginline="13" endline="13" rule="LongVariable" ruleset="Naming Rules" priority="3"> - Avoid excessively long variable names like $_tooLongPropertyName1 - </violation> - <violation beginline="18" endline="18" rule="ConstructorWithNameAsEnclosingClass" ruleset="Naming Rules" package="+global" class="Foo" method="Foo" priority="3"> - Classes should not have a constructor method with the same name as the class - </violation> - <violation beginline="20" endline="20" rule="ShortVariable" ruleset="Naming Rules" priority="3"> - Avoid variables with short names like $a1 - </violation> - <violation beginline="20" endline="20" rule="LongVariable" ruleset="Naming Rules" priority="3"> - Avoid excessively long variable names like $tooLongParameterName2 - </violation> - <violation beginline="22" endline="22" rule="ShortVariable" ruleset="Naming Rules" priority="3"> - Avoid variables with short names like $a2 - </violation> - <violation beginline="23" endline="23" rule="LongVariable" ruleset="Naming Rules" priority="3"> - Avoid excessively long variable names like $tooLongLocalVariable3 - </violation> - <violation beginline="30" endline="30" rule="ShortMethodName" ruleset="Naming Rules" package="+global" class="Foo" method="_x" priority="3"> - Avoid using short method names like Foo::_x() - </violation> - <violation beginline="36" endline="39" rule="BooleanGetMethodName" ruleset="Naming Rules" package="+global" class="Foo" method="getBoolValue" priority="4"> - The 'getBoolValue()' method which returns a boolean should be named 'is...()' or 'has...()' - </violation> - </file> -</pmd> diff --git a/dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/output/parameter_list.xml b/dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/output/parameter_list.xml deleted file mode 100644 index 10b56ec540b5056a77fd0a86bce3f987a5c62fb7..0000000000000000000000000000000000000000 --- a/dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/output/parameter_list.xml +++ /dev/null @@ -1,8 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?> -<pmd> - <file name="parameter_list.php"> - <violation beginline="8" endline="11" rule="ExcessiveParameterList" ruleset="Code Size Rules" package="+global" class="Foo" method="bar" priority="3"> - Avoid really long parameter lists. - </violation> - </file> -</pmd> diff --git a/dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/output/prohibited_statement.xml b/dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/output/prohibited_statement.xml deleted file mode 100644 index e41a5a4b76a3a2dd84bf8160a893e7f651020716..0000000000000000000000000000000000000000 --- a/dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/output/prohibited_statement.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?> -<pmd> - <file name="prohibited_statement.php"> - <violation beginline="7" endline="7" rule="ExitExpression" ruleset="Design Rules" priority="1"> - The method terminateApplication() contains an exit expression. - </violation> - <violation beginline="12" endline="12" rule="EvalExpression" ruleset="Design Rules" priority="1"> - The method evaluateExpression() contains an eval expression. - </violation> - </file> -</pmd> diff --git a/dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/output/prohibited_statement_goto.xml b/dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/output/prohibited_statement_goto.xml deleted file mode 100644 index ecd423d8a02378c58f6040cbc8dfec8fcd9037ab..0000000000000000000000000000000000000000 --- a/dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/output/prohibited_statement_goto.xml +++ /dev/null @@ -1,8 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?> -<pmd> - <file name="prohibited_statement_goto.php"> - <violation beginline="10" endline="10" rule="GotoStatement" ruleset="Design Rules" priority="1"> - The method loopArrayCallback() utilizes a goto statement. - </violation> - </file> -</pmd> diff --git a/dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/output/public_count.xml b/dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/output/public_count.xml deleted file mode 100644 index c3f45ca379ec5edc379aa7d68f148c1c5736d0d7..0000000000000000000000000000000000000000 --- a/dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/output/public_count.xml +++ /dev/null @@ -1,8 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?> -<pmd> - <file name="public_count.php"> - <violation beginline="11" endline="58" rule="ExcessivePublicCount" ruleset="Code Size Rules" package="+global" class="Foo" priority="3"> - This class has a bunch of public methods and attributes - </violation> - </file> -</pmd> diff --git a/dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/output/unused.xml b/dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/output/unused.xml deleted file mode 100644 index b6104d301329dd7cfa60a3d4ea64c086fbb97668..0000000000000000000000000000000000000000 --- a/dev/tests/static/testsuite/Php/Exemplar/_files/phpmd/output/unused.xml +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?> -<pmd> - <file name="unused.php"> - <violation beginline="5" endline="5" rule="UnusedPrivateField" ruleset="Unused Code Rules" priority="3"> - Avoid unused private fields such as '$_unusedField'. - </violation> - <violation beginline="7" endline="7" rule="UnusedPrivateMethod" ruleset="Unused Code Rules" package="+global" class="Foo" method="_unusedMethod" priority="3"> - Avoid unused private methods such as '_unusedMethod'. - </violation> - <violation beginline="9" endline="9" rule="UnusedFormalParameter" ruleset="Unused Code Rules" priority="3"> - Avoid unused parameters such as '$unusedParameter'. - </violation> - <violation beginline="11" endline="11" rule="UnusedLocalVariable" ruleset="Unused Code Rules" priority="3"> - Avoid unused local variables such as '$unusedLocalVariable'. - </violation> - </file> -</pmd> diff --git a/dev/tests/static/testsuite/Php/Exemplar/_files/phpmd_ruleset.xsd b/dev/tests/static/testsuite/Php/Exemplar/_files/phpmd_ruleset.xsd new file mode 100644 index 0000000000000000000000000000000000000000..cd8830c85e8ac734fc85247b37c641c0d00ca5d8 --- /dev/null +++ b/dev/tests/static/testsuite/Php/Exemplar/_files/phpmd_ruleset.xsd @@ -0,0 +1,132 @@ +<?xml version="1.0"?> +<!-- +/** + * XML-schema for validating rulesets for PHP Mess Detector + * + * Copyright (c) 2002-2009, InfoEther, Inc + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * The end-user documentation included with the redistribution, if + * any, must include the following acknowledgement: + * "This product includes software developed in part by support from + * the Defense Advanced Research Project Agency (DARPA)" + * * Neither the name of InfoEther, LLC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * @link http://pmd.sourceforge.net/ruleset_xml_schema.xsd + * @license http://pmd.sourceforge.net/license.html + */ +--> +<xs:schema + xmlns:xs="http://www.w3.org/2001/XMLSchema" + xmlns="http://pmd.sf.net/ruleset/1.0.0" + targetNamespace="http://pmd.sf.net/ruleset/1.0.0" + elementFormDefault="qualified"> + + <xs:element name="ruleset"> + <xs:complexType> + <xs:sequence> + <xs:element ref="description" minOccurs="1" maxOccurs="1" /> + <xs:element ref="exclude-pattern" minOccurs="0" maxOccurs="unbounded" /> + <xs:element ref="include-pattern" minOccurs="0" maxOccurs="unbounded" /> + <xs:element ref="rule" minOccurs="1" maxOccurs="unbounded" /> + </xs:sequence> + <xs:attribute name="name" type="xs:string" use="required" /> + <xs:attribute name="language" type="xs:string" use="optional"> + <xs:annotation> + <xs:documentation source="version">1.0.0+</xs:documentation> + <xs:documentation source="description"> + Language on which this ruleset applies; + e.g. "java" (default), "jsp" + </xs:documentation> + </xs:annotation> + </xs:attribute> + </xs:complexType> + </xs:element> + + <xs:element name="description" type="xs:string"> + </xs:element> + + <xs:element name="include-pattern" type="xs:string"> + </xs:element> + + <xs:element name="exclude-pattern" type="xs:string"> + </xs:element> + + <xs:element name="rule"> + <xs:complexType> + <xs:sequence> + <xs:element ref="description" minOccurs="0" maxOccurs="1" /> + <xs:element ref="priority" minOccurs="0" maxOccurs="1"/> + <xs:element ref="properties" minOccurs="0" maxOccurs="1" /> + <xs:element ref="exclude" minOccurs="0" maxOccurs="unbounded" /> + <xs:element ref="example" minOccurs="0" maxOccurs="unbounded" /> + </xs:sequence> + <xs:attribute name="name" type="xs:ID" use="optional" /> + <xs:attribute name="since" type="xs:string" use="optional" /> + <xs:attribute name="ref" type="xs:string" use="optional" /> + <xs:attribute name="message" type="xs:string" use="optional" /> + <xs:attribute name="externalInfoUrl" type="xs:string" use="optional" /> + <xs:attribute name="class" type="xs:NMTOKEN" use="optional" /> + <xs:attribute name="dfa" type="xs:boolean" use="optional" /> <!-- rule uses dataflow analysis --> + <xs:attribute name="typeResolution" type="xs:boolean" default="false" use="optional" /> + </xs:complexType> + </xs:element> + + <xs:element name="example" type="xs:string"/> + + <!-- Default priority is the lowest --> + <xs:element name="priority" type="xs:int" default="5"/> + + <xs:element name="properties"> + <xs:complexType> + <xs:sequence> + <xs:element ref="property" minOccurs="1" maxOccurs="unbounded" /> + </xs:sequence> + </xs:complexType> + </xs:element> + + <xs:element name="property"> + <xs:complexType> + <xs:sequence> + <xs:element ref="value" minOccurs="0" maxOccurs="1" /> + </xs:sequence> + <xs:attribute name="name" type="xs:NMTOKEN" use="required" /> + <xs:attribute name="value" type="xs:string" use="optional" /> + <xs:attribute name="description" type="xs:string" use="optional" /> + <xs:attribute name="pluginname" type="xs:NMTOKEN" use="optional" /> + </xs:complexType> + </xs:element> + + <xs:element name="value" type="xs:string"> + </xs:element> + + <xs:element name="exclude"> + <xs:complexType> + <xs:attribute name="name" type="xs:NMTOKEN" use="required" /> + </xs:complexType> + </xs:element> + +</xs:schema> diff --git a/dev/tests/static/testsuite/Php/LiveCodeTest.php b/dev/tests/static/testsuite/Php/LiveCodeTest.php index ac6418e6a61f23f7e2365ae9ba89c226d3b3eed8..2795c4746ffe13b37ed0507026cda336e59e35f3 100644 --- a/dev/tests/static/testsuite/Php/LiveCodeTest.php +++ b/dev/tests/static/testsuite/Php/LiveCodeTest.php @@ -18,10 +18,9 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @category Magento - * @package Magento - * @subpackage static_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @category tests + * @package static + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/static/testsuite/Php/_files/phpcs/ruleset.xml b/dev/tests/static/testsuite/Php/_files/phpcs/ruleset.xml index 861def00070a100ecd85771a5840f6d3f9865c72..9b33ba1658868a2c9d490d47fe1a09bfa74b84e5 100644 --- a/dev/tests/static/testsuite/Php/_files/phpcs/ruleset.xml +++ b/dev/tests/static/testsuite/Php/_files/phpcs/ruleset.xml @@ -19,9 +19,9 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @category Magento - * @package static_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @category tests + * @package static + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/dev/tests/static/testsuite/Php/_files/phpmd/ruleset.xml b/dev/tests/static/testsuite/Php/_files/phpmd/ruleset.xml index a77945522fb8688cff4e9c509affe5586db28519..16b04b46702bc33d800188412825fb301c9a45a3 100644 --- a/dev/tests/static/testsuite/Php/_files/phpmd/ruleset.xml +++ b/dev/tests/static/testsuite/Php/_files/phpmd/ruleset.xml @@ -19,10 +19,10 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @category tests - * @package static - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + * @category tests + * @package static + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> <ruleset name="Magento PHPMD rule set" xmlns="http://pmd.sf.net/ruleset/1.0.0" diff --git a/dev/tests/static/testsuite/Util/Classes.php b/dev/tests/static/testsuite/Util/Classes.php new file mode 100644 index 0000000000000000000000000000000000000000..b8e341538e35f50667cdefc7e9dd322ef9b1de7e --- /dev/null +++ b/dev/tests/static/testsuite/Util/Classes.php @@ -0,0 +1,154 @@ +<?php +/** + * A helper for handling Magento-specific class names in various use cases + * + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category tests + * @package static + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +class Util_Classes +{ + /** + * Find all unique matches in specified content using specified PCRE + * + * @param string $contents + * @param string $regex + * @param array &$result + * @return array + */ + public static function getAllMatches($contents, $regex, &$result = array()) + { + preg_match_all($regex, $contents, $matches); + + array_shift($matches); + foreach ($matches as $row) { + $result = array_merge($result, $row); + } + $result = array_filter(array_unique($result), function($value) { + return !empty($value); + }); + return $result; + } + + /** + * Get XML node text values or values of specified attribute using specified xPath + * + * The node must contain specified attribute + * + * @param SimpleXMLElement $xml + * @param string $xPath + * @return array + */ + public static function getXmlNodeValues(SimpleXMLElement $xml, $xPath) + { + $result = array(); + $nodes = $xml->xpath($xPath) ?: array(); + foreach ($nodes as $node) { + $result[] = (string)$node; + } + return $result; + } + + /** + * Get XML node attribute values using specified xPath + * + * @param SimpleXMLElement $xml + * @param string $xPath + * @param string $attributeName + * @return array + */ + public static function getXmlAttributeValues(SimpleXMLElement $xml, $xPath, $attributeName) + { + $result = array(); + $nodes = $xml->xpath($xPath) ?: array(); + foreach ($nodes as $node) { + $node = (array)$node; + if (isset($node['@attributes'][$attributeName])) { + $result[] = $node['@attributes'][$attributeName]; + } + } + return $result; + } + + /** + * Extract class name from a conventional callback specification "Class::method" + * + * @param string $callbackName + * @return string + */ + public static function getCallbackClass($callbackName) + { + $class = explode('::', $callbackName); + return $class[0]; + } + + /** + * Find classes in a configuration XML-file (assumes any files under Namespace/Module/etc/*.xml) + * + * @param SimpleXMLElement $xml + * @return array + */ + public static function collectClassesInConfig(SimpleXMLElement $xml) + { + $classes = self::getXmlNodeValues($xml, ' + /config//resource_adapter | /config/*[not(name()="sections")]//class | //model + | //backend_model | //source_model | //price_model | //model_token | //writer_model | //clone_model + | //frontend_model | //admin_renderer | //renderer' + ); + $classes = array_merge($classes, self::getXmlAttributeValues($xml, '//@backend_model', 'backend_model')); + $nodes = $xml->xpath('/logging/*/expected_models/* | /logging/*/actions/*/expected_models/*') ?: array(); + foreach ($nodes as $node) { + $classes[] = $node->getName(); + } + + $classes = array_map(array('Util_Classes', 'getCallbackClass'), $classes); + $classes = array_map('trim', $classes); + $classes = array_unique($classes); + $classes = array_filter($classes, function ($value) { + return !empty($value); + }); + + return $classes; + } + + /** + * Find classes in a layout configuration XML-file + * + * @param SimpleXMLElement $xml + * @return array + */ + public static function collectLayoutClasses(SimpleXMLElement $xml) + { + $classes = self::getXmlAttributeValues($xml, '/layout//block[@type]', 'type'); + $classes = array_merge($classes, self::getXmlNodeValues($xml, + '/layout//action/attributeType | /layout//action[@method="addTab"]/content + | /layout//action[@method="addRenderer" or @method="addItemRender" or @method="addColumnRender" + or @method="addPriceBlockType" or @method="addMergeSettingsBlockType" + or @method="addInformationRenderer" or @method="addOptionRenderer" or @method="addRowItemRender" + or @method="addDatabaseBlock"]/*[2] + | /layout//action[@method="setMassactionBlockName" or @method="addProductConfigurationHelper"]/name + | /layout//action[@method="setEntityModelClass"]/code' + )); + return array_unique($classes); + } +} diff --git a/dev/tests/static/testsuite/FileDataProvider.php b/dev/tests/static/testsuite/Util/Files.php similarity index 97% rename from dev/tests/static/testsuite/FileDataProvider.php rename to dev/tests/static/testsuite/Util/Files.php index 01d302baccf695ba34b079a523cb80636e0d9aea..b3caf9ba871d561dd35a0bcd838852ee064b2cd7 100644 --- a/dev/tests/static/testsuite/FileDataProvider.php +++ b/dev/tests/static/testsuite/Util/Files.php @@ -1,5 +1,7 @@ <?php /** + * A helper to gather specific kinds if files in Magento application + * * Magento * * NOTICE OF LICENSE @@ -20,15 +22,10 @@ * * @category tests * @package static - * @subpackage Legacy - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - -/** - * One time iterator to gather fiels in our system - */ -final class FileDataProvider +class Util_Files { /** * In-memory cache for the data sets @@ -95,7 +92,7 @@ final class FileDataProvider * * @param string $fileNamePattern * @param array $excludedFileNames - * @return array|bool + * @return array */ public static function getConfigFiles( $fileNamePattern = '*.xml', $excludedFileNames = array('wsdl.xml', 'wsdl2.xml', 'wsi.xml') diff --git a/dev/tests/unit/framework/bootstrap.php b/dev/tests/unit/framework/bootstrap.php index 305c19b8f0b7a0df4b2cfd19adb33e6ea7c1349b..2231f660c229a12f7647d205c98d79334476f903 100755 --- a/dev/tests/unit/framework/bootstrap.php +++ b/dev/tests/unit/framework/bootstrap.php @@ -20,7 +20,7 @@ * * @category Magento * @package unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/unit/phpunit.xml.dist b/dev/tests/unit/phpunit.xml.dist index 0590ba7f8f7daa2575175762c8ffa7a76085dd8f..9799a5ecb8f3ed216e48a6b318edc7767c94644c 100755 --- a/dev/tests/unit/phpunit.xml.dist +++ b/dev/tests/unit/phpunit.xml.dist @@ -22,7 +22,7 @@ * @category Magento * @package Magento * @subpackage unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/dev/tests/unit/testsuite/AllTests.php b/dev/tests/unit/testsuite/AllTests.php index 089bf36fa684e3aef2899c322cd3bd712ff4e4f6..0775f1c2edd229b7e3a83410347700e04da78a98 100755 --- a/dev/tests/unit/testsuite/AllTests.php +++ b/dev/tests/unit/testsuite/AllTests.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento * @subpackage unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Model/Layer/Filter/Price/AlgorithmTest.php b/dev/tests/unit/testsuite/Mage/Catalog/Model/Layer/Filter/Price/AlgorithmTest.php similarity index 76% rename from dev/tests/integration/testsuite/Mage/Catalog/Model/Layer/Filter/Price/AlgorithmTest.php rename to dev/tests/unit/testsuite/Mage/Catalog/Model/Layer/Filter/Price/AlgorithmTest.php index e54d175175a8241a8296efdd6a3c7efa37ae9ed9..e51e5d846f3f7b171bfda7de929441c1a215f7ba 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Model/Layer/Filter/Price/AlgorithmTest.php +++ b/dev/tests/unit/testsuite/Mage/Catalog/Model/Layer/Filter/Price/AlgorithmTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -48,7 +48,7 @@ class Mage_Catalog_Model_Layer_Filter_Price_AlgorithmTest extends PHPUnit_Framew */ public function testPricesSegmentation($prices, $intervalsNumber, $intervalItems) { - $this->_model->setPrices($prices); + $this->_model->setLimits()->setPrices($prices); if (!is_null($intervalsNumber)) { $this->assertEquals($intervalsNumber, $this->_model->getIntervalsNumber()); } @@ -68,4 +68,19 @@ class Mage_Catalog_Model_Layer_Filter_Price_AlgorithmTest extends PHPUnit_Framew { return include(__DIR__ . '/_files/_algorithm_data.php'); } + + public function testPriceLimits() + { + $this->_model->setLimits()->setPrices(array(5, 10, 15, 20, 50, 100, 150)); + $this->assertEquals(array( + 0 => array('from' => 0, 'to' => 20, 'count' => 3), + 1 => array('from' => 20, 'to' => '', 'count' => 4) + ), $this->_model->calculateSeparators()); + + $this->_model->setLimits(10, 100); + $this->assertEquals(array( + 0 => array('from' => 10, 'to' => 20, 'count' => 2), + 1 => array('from' => 20, 'to' => 100, 'count' => 2) + ), $this->_model->calculateSeparators()); + } } diff --git a/dev/tests/integration/testsuite/Mage/Catalog/Model/Layer/Filter/Price/_files/_algorithm_data.php b/dev/tests/unit/testsuite/Mage/Catalog/Model/Layer/Filter/Price/_files/_algorithm_data.php similarity index 74% rename from dev/tests/integration/testsuite/Mage/Catalog/Model/Layer/Filter/Price/_files/_algorithm_data.php rename to dev/tests/unit/testsuite/Mage/Catalog/Model/Layer/Filter/Price/_files/_algorithm_data.php index 6e186b469c4c439d82a332c0611d684ec86d4e92..6e262c13a0f5b6032ffe61088c2965ea2067d0ea 100644 --- a/dev/tests/integration/testsuite/Mage/Catalog/Model/Layer/Filter/Price/_files/_algorithm_data.php +++ b/dev/tests/unit/testsuite/Mage/Catalog/Model/Layer/Filter/Price/_files/_algorithm_data.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Catalog * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -65,7 +65,7 @@ $testCases = array( ), // test if best rounding factor is used array( - array(10.19, 10.21, 10.2, 10.2, 10.2), + array(10.19, 10.2, 10.2, 10.2, 10.21), 2, array( array( @@ -82,7 +82,7 @@ $testCases = array( ), // test if best rounding factor is used array( - array(10.18, 10.2, 10.19, 10.19, 10.19), + array(10.18, 10.19, 10.19, 10.19, 10.2), 2, array( array( @@ -97,9 +97,79 @@ $testCases = array( ), ) ), + // test preventing low count in interval and rounding factor to have lower priority + array( + array( + 0.01, 0.01, 0.01, 0.02, 0.02, 0.03, 0.03, 0.04, 0.04, 0.04, + 0.05, 0.05, 0.05, 0.06, 0.06, 0.06, 0.06, 0.07, 0.07, 0.08, 0.08, + 2.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 5.99, 13.50, + 15.99, 41.95, 69.99, 89.99, 99.99, 99.99, 160.99, 161.94, + 199.99, 199.99, 199.99, 239.99, 329.99, 447.98, 550.00, 599.99, + 699.99, 750.00, 847.97, 1599.99, 2699.99, 4999.95 + ), 7, array( + array( + 'from' => 0, + 'to' => 0.05, + 'count' => 10, + ), + // this is important, that not 0.06 is used to prevent low count in interval + array( + 'from' => 0.05, + 'to' => 0.07, + 'count' => 7, + ), + array( + 'from' => 0.07, + 'to' => 5, + 'count' => 5, + ), + array( + 'from' => 5.99, + 'to' => 5.99, + 'count' => 9, + ), + array( + 'from' => 10, + 'to' => 100, + 'count' => 7, + ), + array( + 'from' => 100, + 'to' => 500, + 'count' => 8, + ), + array( + 'from' => 500, + 'to' => '', + 'count' => 8, + ), + ) + ), // test with large values (variance is near to zero) array( - array_merge(array(8997.71, 8997.73), array_fill(0, 291, 8997.72)), + array_merge(array(9659.57), array_fill(0, 231, 9659.58), array(9659.59)), + 10, + array( + array( + 'from' => 9659.57, + 'to' => 9659.57, + 'count' => 1, + ), + array( + 'from' => 9659.58, + 'to' => 9659.58, + 'count' => 231, + ), + array( + 'from' => 9659.59, + 'to' => 9659.59, + 'count' => 1, + ), + ) + ), + // another test with large values (variance is near to zero) + array( + array_merge(array(8997.71), array_fill(0, 291, 8997.72), array(8997.73)), 10, array( array( @@ -190,8 +260,8 @@ $testCases = array( // simple test array( array( - 199.99, 99.99, 550, 329.99, 199.99, 99.99, 599.99, 41.95, 69.99, 89.99, 239.99, - 161.94, 160.99, 699.99, 199.99, 750, 1599.99, 2699.99, 13.5, 4999.95, 447.98, 847.97 + 13.5, 41.95, 69.99, 89.99, 99.99, 99.99, 160.99, 161.94, 199.99, 199.99, 199.99, + 239.99, 329.99, 447.98, 550, 599.99, 699.99, 750, 847.97, 1599.99, 2699.99, 4999.95 ), 4, array( array( 'from' => 0, @@ -289,11 +359,11 @@ for ($i = 0; $i < 50; ++$i) { ), // one price is bigger than others array( - array_merge(array($randomPrice1), array_fill( + array_merge(array_fill( 0, $randomCount, $randomPrice - )), + ), array($randomPrice1)), null, array( array( @@ -310,14 +380,13 @@ for ($i = 0; $i < 50; ++$i) { ), // one price is less and one is bigger than others array( - array_merge(array( - $randomPrice, - $randomPrice2 - ), array_fill( - 0, - $randomCount1, - $randomPrice1 - )), + array_merge( + array($randomPrice), array_fill( + 0, + $randomCount1, + $randomPrice1 + ), array($randomPrice2) + ), null, array( array( diff --git a/dev/tests/unit/testsuite/Magento/AllTests.php b/dev/tests/unit/testsuite/Magento/AllTests.php index cbb1a9644617658733197e25c990252332beb0d5..1549b2f6a922984ca89cf7aabaa840f5e902e2f9 100755 --- a/dev/tests/unit/testsuite/Magento/AllTests.php +++ b/dev/tests/unit/testsuite/Magento/AllTests.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento * @subpackage unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/unit/testsuite/Magento/Autoload/Ns/TestClass.php b/dev/tests/unit/testsuite/Magento/Autoload/Ns/TestClass.php index cbfbe27d7f21a7d048f72e0c2ce0ca0b1efb1a7c..a137f1358ee62989bb9b968b8db3932ef7bd9058 100644 --- a/dev/tests/unit/testsuite/Magento/Autoload/Ns/TestClass.php +++ b/dev/tests/unit/testsuite/Magento/Autoload/Ns/TestClass.php @@ -20,7 +20,7 @@ * * @category Magento * @package unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/unit/testsuite/Magento/Autoload/TestClass.php b/dev/tests/unit/testsuite/Magento/Autoload/TestClass.php index 76c8c9a19eec1aed0f8533d599589e3b2d7d7e69..cad6cf57d86beaedeff13d6299bdf251d802d4f1 100644 --- a/dev/tests/unit/testsuite/Magento/Autoload/TestClass.php +++ b/dev/tests/unit/testsuite/Magento/Autoload/TestClass.php @@ -20,7 +20,7 @@ * * @category Magento * @package unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/unit/testsuite/Magento/Autoload/TestClassExists.php b/dev/tests/unit/testsuite/Magento/Autoload/TestClassExists.php index 05d9098a7b2a17a05782d2f4b54b4ac00ca97b11..bd7d4ac74e57f448abb8d1c0c88e9f194ba67068 100644 --- a/dev/tests/unit/testsuite/Magento/Autoload/TestClassExists.php +++ b/dev/tests/unit/testsuite/Magento/Autoload/TestClassExists.php @@ -20,7 +20,7 @@ * * @category Magento * @package unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/unit/testsuite/Magento/Autoload/TestClassMapInFile.php b/dev/tests/unit/testsuite/Magento/Autoload/TestClassMapInFile.php index d708d3ba1fc6bbcbf0eed4c8f71038de2aea88bb..a74b13fd69b9dd825db9417ad7e5e91982ef28ae 100644 --- a/dev/tests/unit/testsuite/Magento/Autoload/TestClassMapInFile.php +++ b/dev/tests/unit/testsuite/Magento/Autoload/TestClassMapInFile.php @@ -20,7 +20,7 @@ * * @category Magento * @package unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/unit/testsuite/Magento/Autoload/TestMap.php b/dev/tests/unit/testsuite/Magento/Autoload/TestMap.php index c8bb524f10ea14597b2fdeb2c8a186ed074deab6..f66b484ce87144f984d1dd402801979bb1104cca 100644 --- a/dev/tests/unit/testsuite/Magento/Autoload/TestMap.php +++ b/dev/tests/unit/testsuite/Magento/Autoload/TestMap.php @@ -20,7 +20,7 @@ * * @category Magento * @package unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/unit/testsuite/Magento/AutoloadTest.php b/dev/tests/unit/testsuite/Magento/AutoloadTest.php index 04b4899dabbface1a25ca825a7d39bd4ddd053aa..31475445fe349135160927a48d3ae051da9965dd 100644 --- a/dev/tests/unit/testsuite/Magento/AutoloadTest.php +++ b/dev/tests/unit/testsuite/Magento/AutoloadTest.php @@ -20,7 +20,7 @@ * * @category Magento * @package unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -106,7 +106,7 @@ class Magento_AutoloadTest extends PHPUnit_Framework_TestCase } /** - * @expectedException Exception + * @expectedException Magento_Exception */ public function testAddFilesMapWrongFile() { @@ -114,7 +114,7 @@ class Magento_AutoloadTest extends PHPUnit_Framework_TestCase } /** - * @expectedException Exception + * @expectedException Magento_Exception */ public function testAddFilesMapWrongParam() { diff --git a/dev/tests/unit/testsuite/Magento/Config/AllTests.php b/dev/tests/unit/testsuite/Magento/Config/AllTests.php index f15a4edbac37c4985ed720da311b3f9c7a14b304..e63a290e25729088876528c9a12d24d621e4a90f 100644 --- a/dev/tests/unit/testsuite/Magento/Config/AllTests.php +++ b/dev/tests/unit/testsuite/Magento/Config/AllTests.php @@ -21,7 +21,7 @@ * @category Magento * @package Framework * @subpackage unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/unit/testsuite/Magento/Config/DomTest.php b/dev/tests/unit/testsuite/Magento/Config/DomTest.php index 2054f362457d6b62b84b53304c29ccde2120c457..82aeab8793124e01abaa8c95fc635bcd2237cba1 100644 --- a/dev/tests/unit/testsuite/Magento/Config/DomTest.php +++ b/dev/tests/unit/testsuite/Magento/Config/DomTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Framework * @subpackage unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -67,7 +67,7 @@ class Magento_Config_DomTest extends PHPUnit_Framework_TestCase * @param string $xmlFile * @param string $newXmlFile * @dataProvider mergeExceptionDataProvider - * @expectedException Exception + * @expectedException Magento_Exception */ public function testMergeException($xmlFile, $newXmlFile) { diff --git a/dev/tests/unit/testsuite/Magento/Config/ThemeTest.php b/dev/tests/unit/testsuite/Magento/Config/ThemeTest.php index d986734952663e6fd27542ff34c0bfa7da1214ab..edd6f7a1558f41ff9119c83eb9eb7ec9d8ee48d6 100644 --- a/dev/tests/unit/testsuite/Magento/Config/ThemeTest.php +++ b/dev/tests/unit/testsuite/Magento/Config/ThemeTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Framework * @subpackage unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -38,7 +38,7 @@ class Magento_Config_ThemeTest extends PHPUnit_Framework_TestCase } /** - * @expectedException Exception + * @expectedException Magento_Exception */ public function testConstructException() { @@ -99,7 +99,7 @@ class Magento_Config_ThemeTest extends PHPUnit_Framework_TestCase /** * @dataProvider getCompatibleVersionsExceptionDataProvider - * @expectedException Exception + * @expectedException Magento_Exception */ public function testGetCompatibleVersionsException($package, $theme) { diff --git a/dev/tests/unit/testsuite/Magento/Config/ViewTest.php b/dev/tests/unit/testsuite/Magento/Config/ViewTest.php index 987f7d69f1bf2dbf1c4d95905a4c880c1c2232b0..342c7b3d57ab66b75a5143daec50a7c8c49f8c36 100644 --- a/dev/tests/unit/testsuite/Magento/Config/ViewTest.php +++ b/dev/tests/unit/testsuite/Magento/Config/ViewTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Framework * @subpackage unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/unit/testsuite/Magento/Config/XsdTest.php b/dev/tests/unit/testsuite/Magento/Config/XsdTest.php index bff797f368cfd326b8f767cf163d3e0e6afcd3cf..738ae1d60becc39efea5330c6ae6ac248f5aa454 100644 --- a/dev/tests/unit/testsuite/Magento/Config/XsdTest.php +++ b/dev/tests/unit/testsuite/Magento/Config/XsdTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Framework * @subpackage unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/unit/testsuite/Magento/Config/_files/dom/ambiguous_merged.xml b/dev/tests/unit/testsuite/Magento/Config/_files/dom/ambiguous_merged.xml index 091f4d861ee22e449318120d350aa3dc2e9046a5..4fd97f1b5b794ec05bb44269efa5713f4a84b2f1 100644 --- a/dev/tests/unit/testsuite/Magento/Config/_files/dom/ambiguous_merged.xml +++ b/dev/tests/unit/testsuite/Magento/Config/_files/dom/ambiguous_merged.xml @@ -22,7 +22,7 @@ * @category Magento * @package Framework * @subpackage unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/dev/tests/unit/testsuite/Magento/Config/_files/dom/ambiguous_new_one.xml b/dev/tests/unit/testsuite/Magento/Config/_files/dom/ambiguous_new_one.xml index 091f4d861ee22e449318120d350aa3dc2e9046a5..4fd97f1b5b794ec05bb44269efa5713f4a84b2f1 100644 --- a/dev/tests/unit/testsuite/Magento/Config/_files/dom/ambiguous_new_one.xml +++ b/dev/tests/unit/testsuite/Magento/Config/_files/dom/ambiguous_new_one.xml @@ -22,7 +22,7 @@ * @category Magento * @package Framework * @subpackage unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/dev/tests/unit/testsuite/Magento/Config/_files/dom/ambiguous_new_two.xml b/dev/tests/unit/testsuite/Magento/Config/_files/dom/ambiguous_new_two.xml index d33ad29000d4184e22b0481d76eef30efa6f25c0..6cec05a21f2d44ab3216cd03715623717343c043 100644 --- a/dev/tests/unit/testsuite/Magento/Config/_files/dom/ambiguous_new_two.xml +++ b/dev/tests/unit/testsuite/Magento/Config/_files/dom/ambiguous_new_two.xml @@ -22,7 +22,7 @@ * @category Magento * @package Framework * @subpackage unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/dev/tests/unit/testsuite/Magento/Config/_files/dom/ambiguous_one.xml b/dev/tests/unit/testsuite/Magento/Config/_files/dom/ambiguous_one.xml index 97dd42ad6d8e15a7b979bea8c960bef25e942ffc..fbe1a6b73d7ab02bad3ea8fb9360ab54f688b6d7 100644 --- a/dev/tests/unit/testsuite/Magento/Config/_files/dom/ambiguous_one.xml +++ b/dev/tests/unit/testsuite/Magento/Config/_files/dom/ambiguous_one.xml @@ -22,7 +22,7 @@ * @category Magento * @package Framework * @subpackage unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/dev/tests/unit/testsuite/Magento/Config/_files/dom/ambiguous_two.xml b/dev/tests/unit/testsuite/Magento/Config/_files/dom/ambiguous_two.xml index c342817c5605065940f4b3e42a739918d8d3b2e6..4416643a47a0824b51d89bffa85fa775cc5219d7 100644 --- a/dev/tests/unit/testsuite/Magento/Config/_files/dom/ambiguous_two.xml +++ b/dev/tests/unit/testsuite/Magento/Config/_files/dom/ambiguous_two.xml @@ -22,7 +22,7 @@ * @category Magento * @package Framework * @subpackage unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/dev/tests/unit/testsuite/Magento/Config/_files/dom/ids.xml b/dev/tests/unit/testsuite/Magento/Config/_files/dom/ids.xml index acad2c19cb68829376810f235bcc03c75465b614..0bcc4e58460da6dcec8ea0a686cfeac9dcda86b4 100644 --- a/dev/tests/unit/testsuite/Magento/Config/_files/dom/ids.xml +++ b/dev/tests/unit/testsuite/Magento/Config/_files/dom/ids.xml @@ -22,7 +22,7 @@ * @category Magento * @package Framework * @subpackage unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/dev/tests/unit/testsuite/Magento/Config/_files/dom/ids_merged.xml b/dev/tests/unit/testsuite/Magento/Config/_files/dom/ids_merged.xml index 6ad736d3cb516880317c883d50bc602c645893b9..0a9d5ae17efad0be25f5e3ff1652b8611c7244df 100644 --- a/dev/tests/unit/testsuite/Magento/Config/_files/dom/ids_merged.xml +++ b/dev/tests/unit/testsuite/Magento/Config/_files/dom/ids_merged.xml @@ -22,7 +22,7 @@ * @category Magento * @package Framework * @subpackage unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/dev/tests/unit/testsuite/Magento/Config/_files/dom/ids_new.xml b/dev/tests/unit/testsuite/Magento/Config/_files/dom/ids_new.xml index 5d53c7c7b5156e0239d2bf69d29814e94a2569e4..91ad6d7772bb408532001ac33d96bde1e1f7d85a 100644 --- a/dev/tests/unit/testsuite/Magento/Config/_files/dom/ids_new.xml +++ b/dev/tests/unit/testsuite/Magento/Config/_files/dom/ids_new.xml @@ -22,7 +22,7 @@ * @category Magento * @package Framework * @subpackage unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/dev/tests/unit/testsuite/Magento/Config/_files/dom/no_ids.xml b/dev/tests/unit/testsuite/Magento/Config/_files/dom/no_ids.xml index 4a21c41a653c9984c650e323c327f1c385d730a6..d573788c8bfcb1980538b7f598d5db72332f810e 100644 --- a/dev/tests/unit/testsuite/Magento/Config/_files/dom/no_ids.xml +++ b/dev/tests/unit/testsuite/Magento/Config/_files/dom/no_ids.xml @@ -22,7 +22,7 @@ * @category Magento * @package Framework * @subpackage unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/dev/tests/unit/testsuite/Magento/Config/_files/dom/no_ids_merged.xml b/dev/tests/unit/testsuite/Magento/Config/_files/dom/no_ids_merged.xml index eceb88cf4cc20154a5ade6a3cb05bc96270ce7a0..e15f99a3c60b599c094b100de55af7a9d07cb27c 100644 --- a/dev/tests/unit/testsuite/Magento/Config/_files/dom/no_ids_merged.xml +++ b/dev/tests/unit/testsuite/Magento/Config/_files/dom/no_ids_merged.xml @@ -22,7 +22,7 @@ * @category Magento * @package Framework * @subpackage unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/dev/tests/unit/testsuite/Magento/Config/_files/dom/no_ids_new.xml b/dev/tests/unit/testsuite/Magento/Config/_files/dom/no_ids_new.xml index 504d87e235f926873b25b23e6705f504eb20a440..7a3432cb702ba70635ebc167c8d4dd44bb540580 100644 --- a/dev/tests/unit/testsuite/Magento/Config/_files/dom/no_ids_new.xml +++ b/dev/tests/unit/testsuite/Magento/Config/_files/dom/no_ids_new.xml @@ -22,7 +22,7 @@ * @category Magento * @package Framework * @subpackage unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/dev/tests/unit/testsuite/Magento/Config/_files/packages/default/default/theme.xml b/dev/tests/unit/testsuite/Magento/Config/_files/packages/default/default/theme.xml index b265c884ea23ab9dc88ecb2c25f6118097be88c8..bffc8a3722fd362556ae73d3a84acc1bcb87a2e6 100644 --- a/dev/tests/unit/testsuite/Magento/Config/_files/packages/default/default/theme.xml +++ b/dev/tests/unit/testsuite/Magento/Config/_files/packages/default/default/theme.xml @@ -22,7 +22,7 @@ * @category Magento * @package Framework * @subpackage unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/dev/tests/unit/testsuite/Magento/Config/_files/packages/default/test/theme.xml b/dev/tests/unit/testsuite/Magento/Config/_files/packages/default/test/theme.xml index 219d2e0c1dfdc6c2b2d32feee156a1737c61602d..dcb20cf5a0aa672eba31464ee95bbeaef73bbcdf 100644 --- a/dev/tests/unit/testsuite/Magento/Config/_files/packages/default/test/theme.xml +++ b/dev/tests/unit/testsuite/Magento/Config/_files/packages/default/test/theme.xml @@ -22,7 +22,7 @@ * @category Magento * @package Framework * @subpackage unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/dev/tests/unit/testsuite/Magento/Config/_files/packages/default/test2/theme.xml b/dev/tests/unit/testsuite/Magento/Config/_files/packages/default/test2/theme.xml index 9e4adee857eef5888ec7f4a7818ffc0831206539..7fb5f811033a974839759d5128b3b1e86871b7a2 100644 --- a/dev/tests/unit/testsuite/Magento/Config/_files/packages/default/test2/theme.xml +++ b/dev/tests/unit/testsuite/Magento/Config/_files/packages/default/test2/theme.xml @@ -22,7 +22,7 @@ * @category Magento * @package Framework * @subpackage unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/dev/tests/unit/testsuite/Magento/Config/_files/packages/test/default/theme.xml b/dev/tests/unit/testsuite/Magento/Config/_files/packages/test/default/theme.xml index effccc4e009060ece402a25f88dbb55fdaf2112d..675a2e4d6b15063db1fcf6069885a369f6832b07 100644 --- a/dev/tests/unit/testsuite/Magento/Config/_files/packages/test/default/theme.xml +++ b/dev/tests/unit/testsuite/Magento/Config/_files/packages/test/default/theme.xml @@ -22,7 +22,7 @@ * @category Magento * @package Framework * @subpackage unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/dev/tests/unit/testsuite/Magento/Config/_files/sample.xsd b/dev/tests/unit/testsuite/Magento/Config/_files/sample.xsd index 077a406d4dd24b99c5716c68e32001bfc188d245..ffbdf289d6040e68d2866ad5b91e82519325642c 100644 --- a/dev/tests/unit/testsuite/Magento/Config/_files/sample.xsd +++ b/dev/tests/unit/testsuite/Magento/Config/_files/sample.xsd @@ -22,7 +22,7 @@ * @category Magento * @package Framework * @subpackage unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/dev/tests/unit/testsuite/Magento/Config/_files/theme_invalid.xml b/dev/tests/unit/testsuite/Magento/Config/_files/theme_invalid.xml index a97319f557bc41f5114f61793434b234de18c749..38b9a6bba30f17a1edeaa19c003dfff6e20f80fe 100644 --- a/dev/tests/unit/testsuite/Magento/Config/_files/theme_invalid.xml +++ b/dev/tests/unit/testsuite/Magento/Config/_files/theme_invalid.xml @@ -22,7 +22,7 @@ * @category Magento * @package Framework * @subpackage unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/dev/tests/unit/testsuite/Magento/Config/_files/view_invalid.xml b/dev/tests/unit/testsuite/Magento/Config/_files/view_invalid.xml index a6cbe5cffd8fd97a5275f0dac1549257d5c642d0..e58f7107f41afc2017c0174b852ab9399e6a040e 100644 --- a/dev/tests/unit/testsuite/Magento/Config/_files/view_invalid.xml +++ b/dev/tests/unit/testsuite/Magento/Config/_files/view_invalid.xml @@ -22,7 +22,7 @@ * @category Magento * @package Framework * @subpackage unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/dev/tests/unit/testsuite/Magento/Config/_files/view_one.xml b/dev/tests/unit/testsuite/Magento/Config/_files/view_one.xml index c52162289b79c3f13a8c373cc1aac2b0553cdbd2..330dd70487f1f3446ba5976d544a9108f7a2b8af 100644 --- a/dev/tests/unit/testsuite/Magento/Config/_files/view_one.xml +++ b/dev/tests/unit/testsuite/Magento/Config/_files/view_one.xml @@ -22,7 +22,7 @@ * @category Magento * @package Framework * @subpackage unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/dev/tests/unit/testsuite/Magento/Config/_files/view_two.xml b/dev/tests/unit/testsuite/Magento/Config/_files/view_two.xml index f3a6f8a01f55453fefe99d413e60967b799032de..4bba445d376f6859beab8f733b363843d4010222 100644 --- a/dev/tests/unit/testsuite/Magento/Config/_files/view_two.xml +++ b/dev/tests/unit/testsuite/Magento/Config/_files/view_two.xml @@ -22,7 +22,7 @@ * @category Magento * @package Framework * @subpackage unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/dev/tests/unit/testsuite/Magento/Convert/AllTests.php b/dev/tests/unit/testsuite/Magento/Convert/AllTests.php index 42b85c03ec898b77e04348edd2f0577fd4b6d148..9f59d4a9b371a212fda55bc131d3ff66252b3378 100644 --- a/dev/tests/unit/testsuite/Magento/Convert/AllTests.php +++ b/dev/tests/unit/testsuite/Magento/Convert/AllTests.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Convert * @subpackage unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/unit/testsuite/Magento/Convert/ExcelTest.php b/dev/tests/unit/testsuite/Magento/Convert/ExcelTest.php index a6b03d41c44cdd13cedf694d3c6deeb58bafbb71..0981fc3ff8fabbed521824e4e6c06c5a9b7eb702 100644 --- a/dev/tests/unit/testsuite/Magento/Convert/ExcelTest.php +++ b/dev/tests/unit/testsuite/Magento/Convert/ExcelTest.php @@ -20,7 +20,7 @@ * * @category Magento * @package unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/unit/testsuite/Magento/Crypt/_files/_cipher_info.php b/dev/tests/unit/testsuite/Magento/Crypt/_files/_cipher_info.php index da6454a73232b065bc7c7b96898f8a1054a3cd1e..08c5738b0256efe153100810f3046b45838c838c 100755 --- a/dev/tests/unit/testsuite/Magento/Crypt/_files/_cipher_info.php +++ b/dev/tests/unit/testsuite/Magento/Crypt/_files/_cipher_info.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ ?> diff --git a/dev/tests/unit/testsuite/Magento/Crypt/_files/_crypt_fixtures.php b/dev/tests/unit/testsuite/Magento/Crypt/_files/_crypt_fixtures.php index c0958273809dcf29c930979561223716b71249fb..3bab6723b5df05cf9506ded7cdd56f8e261e9ef3 100755 --- a/dev/tests/unit/testsuite/Magento/Crypt/_files/_crypt_fixtures.php +++ b/dev/tests/unit/testsuite/Magento/Crypt/_files/_crypt_fixtures.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ ?> diff --git a/dev/tests/unit/testsuite/Magento/CryptTest.php b/dev/tests/unit/testsuite/Magento/CryptTest.php index fa5ce95c3a81ce72958d17ed6d77b88dd38fb5bf..8bc511dd95a8c6452541c67ea26ae36aa635953f 100755 --- a/dev/tests/unit/testsuite/Magento/CryptTest.php +++ b/dev/tests/unit/testsuite/Magento/CryptTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Crypt * @subpackage unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/unit/testsuite/Magento/Profiler/AllTests.php b/dev/tests/unit/testsuite/Magento/Profiler/AllTests.php index b4c058044b38b80c8a37aad38d7e252f6a10dcb4..3fb0c4e4941a135a120a59bd42327497f36a46c0 100644 --- a/dev/tests/unit/testsuite/Magento/Profiler/AllTests.php +++ b/dev/tests/unit/testsuite/Magento/Profiler/AllTests.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Profiler * @subpackage unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/unit/testsuite/Magento/Profiler/Output/AllTests.php b/dev/tests/unit/testsuite/Magento/Profiler/Output/AllTests.php index e10ea3ebaf854357b34929051bf70e29fc7283e0..05fdab33e081aa4940a564723371f77271ed245f 100644 --- a/dev/tests/unit/testsuite/Magento/Profiler/Output/AllTests.php +++ b/dev/tests/unit/testsuite/Magento/Profiler/Output/AllTests.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Profiler * @subpackage unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/unit/testsuite/Magento/Profiler/Output/CsvfileTest.php b/dev/tests/unit/testsuite/Magento/Profiler/Output/CsvfileTest.php index 434698f3ed39e5b412822b1267b978b73403cf20..65e660d4b4fded84c4950848b90302137c6f3b01 100644 --- a/dev/tests/unit/testsuite/Magento/Profiler/Output/CsvfileTest.php +++ b/dev/tests/unit/testsuite/Magento/Profiler/Output/CsvfileTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Profiler * @subpackage unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/unit/testsuite/Magento/Profiler/Output/FirebugTest.php b/dev/tests/unit/testsuite/Magento/Profiler/Output/FirebugTest.php index 1ec32bafc8a6ed4ec16ed41aa7076332cbf16878..afa998c77e141ec42dfebf4b99a2aabcd60ab6b2 100644 --- a/dev/tests/unit/testsuite/Magento/Profiler/Output/FirebugTest.php +++ b/dev/tests/unit/testsuite/Magento/Profiler/Output/FirebugTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Profiler * @subpackage unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/unit/testsuite/Magento/Profiler/Output/HtmlTest.php b/dev/tests/unit/testsuite/Magento/Profiler/Output/HtmlTest.php index b88dedbf114bed7e21e79375878f9efe6ebe4d51..7c821c42d86c66654d2532e1040a11458c8f2af3 100644 --- a/dev/tests/unit/testsuite/Magento/Profiler/Output/HtmlTest.php +++ b/dev/tests/unit/testsuite/Magento/Profiler/Output/HtmlTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Profiler * @subpackage unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/unit/testsuite/Magento/Profiler/OutputAbstractTest.php b/dev/tests/unit/testsuite/Magento/Profiler/OutputAbstractTest.php index 1c1413846849855773c3f181b24991ed81335e08..2756284d777123441201f378e1b2f84f1b3403ad 100644 --- a/dev/tests/unit/testsuite/Magento/Profiler/OutputAbstractTest.php +++ b/dev/tests/unit/testsuite/Magento/Profiler/OutputAbstractTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Profiler * @subpackage unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/unit/testsuite/Magento/Profiler/_files/timers.php b/dev/tests/unit/testsuite/Magento/Profiler/_files/timers.php index d086f5f46986053a8421859a55e46ede7eea7b91..08efe2c237817031d1fb1a1553375164ca83129d 100644 --- a/dev/tests/unit/testsuite/Magento/Profiler/_files/timers.php +++ b/dev/tests/unit/testsuite/Magento/Profiler/_files/timers.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ ?> diff --git a/dev/tests/unit/testsuite/Magento/ProfilerTest.php b/dev/tests/unit/testsuite/Magento/ProfilerTest.php index c7a4e7d4015e832cbdf608c4c8cd211891d4925f..dd3e648b40a016cddb61303616087c8267748076 100644 --- a/dev/tests/unit/testsuite/Magento/ProfilerTest.php +++ b/dev/tests/unit/testsuite/Magento/ProfilerTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Magento_Profiler * @subpackage unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/unit/testsuite/Varien/AllTests.php b/dev/tests/unit/testsuite/Varien/AllTests.php index e5e6c2a2b615dca392963561e330d918427081e1..8ec15846d5ac9b2cde3f37864ea980968440e0b2 100644 --- a/dev/tests/unit/testsuite/Varien/AllTests.php +++ b/dev/tests/unit/testsuite/Varien/AllTests.php @@ -21,7 +21,7 @@ * @category Magento * @package Varien * @subpackage unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tests/unit/testsuite/Varien/Data/Collection/DbTest.php b/dev/tests/unit/testsuite/Varien/Data/Collection/DbTest.php index 31c970deb96f48a433ffc61b3e5166d236f8298e..11fa0adfcec63a61b7628e63e435b7d893e6ce0e 100644 --- a/dev/tests/unit/testsuite/Varien/Data/Collection/DbTest.php +++ b/dev/tests/unit/testsuite/Varien/Data/Collection/DbTest.php @@ -21,7 +21,7 @@ * @category Varien * @package Varien_Data * @subpackage unit_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -105,4 +105,81 @@ class Varien_Data_Collection_DbTest extends PHPUnit_Framework_TestCase } return $adapter; } + + /** + * Test that adding field to filter builds proper sql WHERE condition + */ + public function testAddFieldToFilter() + { + $adapter =$this->_getAdapterMock( + 'Zend_Db_Adapter_Pdo_Mysql', + array('fetchAll', 'prepareSqlCondition'), + null + ); + $adapter->expects($this->any()) + ->method('prepareSqlCondition') + ->with( + $this->stringContains('is_imported'), + $this->anything() + ) + ->will($this->returnValue('is_imported = 1')); + $this->_collection->setConnection($adapter); + $select = $this->_collection->getSelect()->from('test'); + + $this->_collection->addFieldToFilter('is_imported', array('eq' => '1')); + $this->assertEquals('SELECT `test`.* FROM `test` WHERE (is_imported = 1)', $select->assemble()); + } + + /** + * Test that adding multiple fields to filter at once + * builds proper sql WHERE condition and created conditions are joined with OR + */ + public function testAddFieldToFilterWithMultipleParams() + { + $adapter = $this->_getAdapterMock( + 'Zend_Db_Adapter_Pdo_Mysql', + array('fetchAll', 'prepareSqlCondition'), + null + ); + $adapter->expects($this->at(0)) + ->method('prepareSqlCondition') + ->with( + 'weight', + array('in' => array(1,3)) + ) + ->will($this->returnValue('weight in (1, 3)')); + $adapter->expects($this->at(1)) + ->method('prepareSqlCondition') + ->with( + 'name', + array('like' => 'M%') + ) + ->will($this->returnValue("name like 'M%'")); + $this->_collection->setConnection($adapter); + $select = $this->_collection->getSelect()->from("test"); + + $this->_collection->addFieldToFilter( + array('weight', 'name'), + array(array('in' => array(1,3)), array('like' => 'M%')) + ); + + $this->assertEquals( + "SELECT `test`.* FROM `test` WHERE ((weight in (1, 3)) OR (name like 'M%'))", + $select->assemble() + ); + + $adapter->expects($this->at(0)) + ->method('prepareSqlCondition') + ->with( + 'is_imported', + $this->anything() + ) + ->will($this->returnValue('is_imported = 1')); + + $this->_collection->addFieldToFilter('is_imported', array('eq' => '1')); + $this->assertEquals( + "SELECT `test`.* FROM `test` WHERE ((weight in (1, 3)) OR (name like 'M%')) AND (is_imported = 1)", + $select->assemble() + ); + } } diff --git a/dev/tests/unit/testsuite/Varien/Db/Adapter/Pdo/MysqlTest.php b/dev/tests/unit/testsuite/Varien/Db/Adapter/Pdo/MysqlTest.php new file mode 100644 index 0000000000000000000000000000000000000000..9a99f8135219e7ddc04312b97d0814f3f1556671 --- /dev/null +++ b/dev/tests/unit/testsuite/Varien/Db/Adapter/Pdo/MysqlTest.php @@ -0,0 +1,91 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Varien + * @package Varien_Data + * @subpackage unit_tests + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Varien_Db_Adapter_Pdo_Mysql class test + */ +class Varien_Db_Adapter_Pdo_MysqlTest extends PHPUnit_Framework_TestCase +{ + /** + * Adapter for test + * @var Varien_Db_Adapter_Pdo_Mysql + */ + private $_adapter; + + /** + * Setup + */ + protected function setUp() + { + $this->_adapter = new Varien_Db_Adapter_Pdo_Mysql( + array( + 'dbname' => 'not_exists', + 'username' => 'not_valid', + 'password' => 'not_valid', + ) + ); + } + + /** + * Test result for bigint + * + * @dataProvider bigintResultProvider + */ + public function testPrepareColumnValueForBigint($value, $expectedResult) + { + $result = $this->_adapter->prepareColumnValue( + array('DATA_TYPE' => 'bigint'), + $value + ); + $this->assertEquals($expectedResult, $result); + } + + /** + * Data Provider for testPrepareColumnValueForBigint + */ + public function bigintResultProvider() + { + return array( + array(1, 1), + array(0, 0), + array(-1, -1), + array(1.0, 1), + array(0.0, 0), + array(-1.0, -1), + array(1e-10, 0), + array(7.9, 8), + array(PHP_INT_MAX, PHP_INT_MAX), + array(PHP_INT_MAX+1, '2147483648'), + array(9223372036854775807, '9223372036854775807'), + array(9223372036854775807.3423424234, '9223372036854775807'), + array(PHP_INT_MAX*pow(10, 10)+12, '21474836470000000012'), + array((0.099999999999999999999999995+0.2+0.3+0.4+0.5)*10, '15'), + array('21474836470000000012', '21474836470000000012'), + array(0x5468792130ABCDEF, '6082244480221302255') + ); + } +} diff --git a/dev/tests/unit/testsuite/Varien/ObjectTest.php b/dev/tests/unit/testsuite/Varien/ObjectTest.php index 4972df449b142a58c72f596375225b22331c22cd..35892068ff0a778faac6c752464ef9574b658d24 100644 --- a/dev/tests/unit/testsuite/Varien/ObjectTest.php +++ b/dev/tests/unit/testsuite/Varien/ObjectTest.php @@ -21,7 +21,7 @@ * @category Magento * @package Mage_Core * @subpackage integration_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tools/batch_tests/batch.php b/dev/tools/batch_tests/batch.php index 186249a17709381040c28ebca602d3bd7daa555e..5f2dc16c3bc3c0efec047a91c8e2a58cc8c5052f 100644 --- a/dev/tools/batch_tests/batch.php +++ b/dev/tools/batch_tests/batch.php @@ -21,7 +21,7 @@ * @category Magento * @package tools * @subpackage batch_tests - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tools/classmap/fs_generator.php b/dev/tools/classmap/fs_generator.php index e5271b2e7b73869b565ac7dd867a2029d89284f3..964da6d049694a74e4ef5133267cda3fc0e39cd3 100644 --- a/dev/tools/classmap/fs_generator.php +++ b/dev/tools/classmap/fs_generator.php @@ -20,7 +20,7 @@ * * @category Magento * @package tools - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tools/classmap/log_generator.php b/dev/tools/classmap/log_generator.php index d575f325b7431f714a032ed28b358f74703da2eb..b6879ae4ea70211ad7b4908f9bbfbf1564986051 100644 --- a/dev/tools/classmap/log_generator.php +++ b/dev/tools/classmap/log_generator.php @@ -20,7 +20,7 @@ * * @category Magento * @package tools - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tools/classmap/logger.php b/dev/tools/classmap/logger.php index 2896343c039c7d8caf62aeafd25334bfa281c613..e6551bb1da92fc4d031c152ce50730fb9462b13d 100644 --- a/dev/tools/classmap/logger.php +++ b/dev/tools/classmap/logger.php @@ -20,7 +20,7 @@ * * @category Magento * @package tools - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/dev/tools/migration/factory_names.php b/dev/tools/migration/factory_names.php new file mode 100644 index 0000000000000000000000000000000000000000..aba70af8c58ab7b54cbda1a82c977283d2435a1a --- /dev/null +++ b/dev/tools/migration/factory_names.php @@ -0,0 +1,114 @@ +<?php +/** + * Automated replacement of factory names into real ones + * + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package tools + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +require realpath(dirname(dirname(dirname(__DIR__)))) . '/dev/tests/static/framework/bootstrap.php'; + +// PHP code +foreach (Util_Files::getPhpFiles() as $file) { + $file = array_shift($file); + $content = file_get_contents($file); + $classes = Legacy_ClassesTest::collectPhpCodeClasses($content); + $factoryNames = array_filter($classes, 'isFactoryName'); + if (!$factoryNames) { + continue; + } + $search = array(); + $replace = array(); + foreach ($factoryNames as $factoryName) { + list($module, $name) = getModuleName($factoryName); + addReplace($factoryName, $module, $name, '::getModel(%s', '_Model_', $search, $replace); + addReplace($factoryName, $module, $name, '::getSingleton(%s', '_Model_', $search, $replace); + addReplace($factoryName, $module, $name, '::getResourceModel(%s', '_Model_Resource_', $search, $replace); + addReplace($factoryName, $module, $name, '::getResourceSingleton(%s', '_Model_Resource_', $search, $replace); + addReplace($factoryName, $module, $name, 'addBlock(%s', '_Block_', $search, $replace); + addReplace($factoryName, $module, $name, 'createBlock(%s', '_Block_', $search, $replace); + addReplace($factoryName, $module, $name, 'getBlockClassName(%s', '_Block_', $search, $replace); + addReplace($factoryName, $module, $name, 'getBlockSingleton(%s', '_Block_', $search, $replace); + addReplace($factoryName, $module, $name, 'helper(%s', '_Helper_', $search, $replace); + } + $newContent = str_replace($search, $replace, $content); + if ($newContent != $content) { + echo "{$file}\n"; + print_r($factoryNames); + file_put_contents($file, $newContent); + } +} + +/** + * Whether the given class name is a factory name + * + * @param string $class + * @return bool + */ +function isFactoryName($class) +{ + return false !== strpos($class, '/') || preg_match('/^[a-z\d]+(_[A-Za-z\d]+)?$/', $class); +} + +/** + * Transform factory name into a pair of module and name + * + * @param string $factoryName + * @return array + */ +function getModuleName($factoryName) +{ + if (false !== strpos($factoryName, '/')) { + list($module, $name) = explode('/', $factoryName); + } else { + $module = $factoryName; + $name = false; + } + if (false === strpos($module, '_')) { + $module = "Mage_{$module}"; + } + return array($module, $name); +} + +/** + * Add search/replacements of factory name into real name based on a specified "sprintf()" pattern + * + * @param string $factoryName + * @param string $module + * @param string $name + * @param string $pattern + * @param string $suffix + * @param array &$search + * @param array &$replace + */ +function addReplace($factoryName, $module, $name, $pattern, $suffix, &$search, &$replace) +{ + if (empty($name)) { + if ('_Helper_' !== $suffix) { + return; + } + $name = 'data'; + } + $realName = implode('_', array_map('ucfirst', explode('_', $module . $suffix . $name))); + $search[] = sprintf($pattern, "'{$factoryName}'"); + $replace[] = sprintf($pattern, "'{$realName}'"); +} diff --git a/downloader/Maged/Connect.php b/downloader/Maged/Connect.php index 855cdb3eb323b5894c7ba081da11d060218ed49e..511c84299bcee71d79d3d95759aba88a7cb54372 100644 --- a/downloader/Maged/Connect.php +++ b/downloader/Maged/Connect.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -54,17 +54,17 @@ class Maged_Connect { /** - * Object of config - * - * @var Mage_Connect_Config - */ + * Object of config + * + * @var Mage_Connect_Config + */ protected $_config; /** - * Object of single config - * - * @var Mage_Connect_Singleconfig - */ + * Object of single config + * + * @var Mage_Connect_Singleconfig + */ protected $_sconfig; /** @@ -75,22 +75,29 @@ class Maged_Connect protected $_frontend; /** - * Internal cache for command objects - * - * @var array - */ + * Internal cache for command objects + * + * @var array + */ protected $_cmdCache = array(); /** - * Instance of class - * - * @var Maged_Connect - */ + * Console Started flag + * + * @var boolean + */ + protected $_consoleStarted = false; + + /** + * Instance of class + * + * @var Maged_Connect + */ static protected $_instance; /** - * Constructor - */ + * Constructor loads Config, Cache Config and initializes Frontend + */ public function __construct() { $this->getConfig(); @@ -99,10 +106,20 @@ class Maged_Connect } /** - * Initialize instance - * - * @return Maged_Connect - */ + * Destructor, sends Console footer if Console started + */ + public function __destruct() + { + if ($this->_consoleStarted) { + $this->_consoleFooter(); + } + } + + /** + * Initialize instance + * + * @return Maged_Connect + */ public static function getInstance() { if (!self::$_instance) { @@ -112,10 +129,10 @@ class Maged_Connect } /** - * Retrieve object of config and set it to Mage_Connect_Command - * - * @return Mage_Connect_Config - */ + * Retrieve object of config and set it to Mage_Connect_Command + * + * @return Mage_Connect_Config + */ public function getConfig() { if (!$this->_config) { @@ -134,15 +151,19 @@ class Maged_Connect } /** - * Retrieve object of single config and set it to Mage_Connect_Command - * - * @param bool $reload - * @return Mage_Connect_Singleconfig - */ + * Retrieve object of single config and set it to Mage_Connect_Command + * + * @param bool $reload + * @return Mage_Connect_Singleconfig + */ public function getSingleConfig($reload = false) { if(!$this->_sconfig || $reload) { - $this->_sconfig = new Mage_Connect_Singleconfig($this->getConfig()->magento_root . DIRECTORY_SEPARATOR . $this->getConfig()->downloader_path . DIRECTORY_SEPARATOR . Mage_Connect_Singleconfig::DEFAULT_SCONFIG_FILENAME); + $this->_sconfig = new Mage_Connect_Singleconfig( + $this->getConfig()->magento_root . DIRECTORY_SEPARATOR + . $this->getConfig()->downloader_path . DIRECTORY_SEPARATOR + . Mage_Connect_Singleconfig::DEFAULT_SCONFIG_FILENAME + ); } Mage_Connect_Command::setSconfig($this->_sconfig); return $this->_sconfig; @@ -150,10 +171,10 @@ class Maged_Connect } /** - * Retrieve object of frontend and set it to Mage_Connect_Command - * - * @return Maged_Connect_Frontend - */ + * Retrieve object of frontend and set it to Mage_Connect_Command + * + * @return Maged_Connect_Frontend + */ public function getFrontend() { if (!$this->_frontend) { @@ -164,30 +185,30 @@ class Maged_Connect } /** - * Retrieve lof from frontend - * - * @return array - */ + * Retrieve lof from frontend + * + * @return array + */ public function getLog() { return $this->getFrontend()->getLog(); } /** - * Retrieve output from frontend - * - * @return array - */ + * Retrieve output from frontend + * + * @return array + */ public function getOutput() { return $this->getFrontend()->getOutput(); } /** - * Clean registry - * - * @return Maged_Connect - */ + * Clean registry + * + * @return Maged_Connect + */ public function cleanSconfig() { $this->getSingleConfig()->clear(); @@ -195,11 +216,11 @@ class Maged_Connect } /** - * Delete directory recursively - * - * @param string $path - * @return Maged_Connect - */ + * Delete directory recursively + * + * @param string $path + * @return Maged_Connect + */ public function delTree($path) { if (@is_dir($path)) { $entries = @scandir($path); @@ -216,13 +237,13 @@ class Maged_Connect } /** - * Run commands from Mage_Connect_Command - * - * @param string $command - * @param array $options - * @param array $params - * @return - */ + * Run commands from Mage_Connect_Command + * + * @param string $command + * @param array $options + * @param array $params + * @return boolean|Mage_Connect_Error + */ public function run($command, $options=array(), $params=array()) { @set_time_limit(0); @@ -256,16 +277,20 @@ class Maged_Connect } } - public function setRemoteConfig($uri) #$host, $user, $password, $path='', $port=null) + /** + * Set remote Config by URI + * + * @param $uri + * @return Maged_Connect + */ + public function setRemoteConfig($uri) { - #$uri = 'ftp://' . $user . ':' . $password . '@' . $host . (is_numeric($port) ? ':' . $port : '') . '/' . trim($path, '/') . '/'; - //$this->run('config-set', array(), array('remote_config', $uri)); - //$this->run('config-set', array('ftp'=>$uri), array('remote_config', $uri)); $this->getConfig()->remote_config=$uri; return $this; } /** + * Show Errors * * @param array $errors Error messages * @return Maged_Connect @@ -276,7 +301,7 @@ class Maged_Connect $run = new Maged_Model_Connect_Request(); if ($callback = $run->get('failure_callback')) { if (is_array($callback)) { - call_user_func_array($callback, array($result)); + call_user_func_array($callback, array($errors)); } else { echo $callback; } @@ -289,8 +314,9 @@ class Maged_Connect /** * Run Mage_Connect_Command with html output console style * - * @param array|Maged_Model $runParams command, options, params, - * comment, success_callback, failure_callback + * @throws Maged_Exception + * @param array|string|Maged_Model $runParams command, options, params, comment, success_callback, failure_callback + * @return bool|Mage_Connect_Error */ public function runHtmlConsole($runParams) { @@ -317,6 +343,58 @@ class Maged_Connect } if (!$run->get('no-header')) { + $this->_consoleHeader(); + } + echo htmlspecialchars($run->get('comment')).'<br/>'; + + if ($command = $run->get('command')) { + $result = $this->run($command, $run->get('options'), $run->get('params')); + + if ($this->getFrontend()->hasErrors()) { + echo "<br/>CONNECT ERROR: "; + foreach ($this->getFrontend()->getErrors(false) as $error) { + echo nl2br($error[1]); + echo '<br/>'; + } + } + echo '<script type="text/javascript">'; + if ($this->getFrontend()->hasErrors()) { + if ($callback = $run->get('failure_callback')) { + if (is_array($callback)) { + call_user_func_array($callback, array($result)); + } else { + echo $callback; + } + } + } else { + if (!$run->get('no-footer')) { + if ($callback = $run->get('success_callback')) { + if (is_array($callback)) { + call_user_func_array($callback, array($result)); + } else { + echo $callback; + } + } + } + } + echo '</script>'; + } else { + $result = false; + } + if ($this->getFrontend()->getErrors() || !$run->get('no-footer')) { + //$this->_consoleFooter(); + $fe->setLogStream($oldLogStream); + } + return $result; + } + + /** + * Show HTML Console Header + * + * @return void + */ + protected function _consoleHeader() { + if (!$this->_consoleStarted) { ?> <html><head><style type="text/css"> body { margin:0px; @@ -413,44 +491,17 @@ function clear_cache(callbacks) } </script> <?php + $this->_consoleStarted = true; } - echo htmlspecialchars($run->get('comment')); - - if ($command = $run->get('command')) { - $result = $this->run($command, $run->get('options'), $run->get('params')); + } - if ($this->getFrontend()->hasErrors()) { - echo "<br/>CONNECT ERROR: "; - foreach ($this->getFrontend()->getErrors(false) as $error) { - echo nl2br($error[1]); - echo '<br/>'; - } - } - echo '<script type="text/javascript">'; - if ($this->getFrontend()->hasErrors()) { - if ($callback = $run->get('failure_callback')) { - if (is_array($callback)) { - call_user_func_array($callback, array($result)); - } else { - echo $callback; - } - } - } else { - if (!$run->get('no-footer')) { - if ($callback = $run->get('success_callback')) { - if (is_array($callback)) { - call_user_func_array($callback, array($result)); - } else { - echo $callback; - } - } - } - } - echo '</script>'; - } else { - $result = false; - } - if ($this->getFrontend()->getErrors() || !$run->get('no-footer')) { + /** + * Show HTML Console Footer + * + * @return void + */ + protected function _consoleFooter() { + if ($this->_consoleStarted) { ?> <script type="text/javascript"> if (parent && parent.disableInputs) { @@ -459,8 +510,7 @@ if (parent && parent.disableInputs) { </script> </body></html> <?php - $fe->setLogStream($oldLogStream); + $this->_consoleStarted = false; } - return $result; } } diff --git a/downloader/Maged/Connect/Frontend.php b/downloader/Maged/Connect/Frontend.php index 1546546635b2e13ccd72f1dfd40c1b6499e7e9e1..1960558d1bdafe577730a2e409cb686dcc6cd1dd 100644 --- a/downloader/Maged/Connect/Frontend.php +++ b/downloader/Maged/Connect/Frontend.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/downloader/Maged/Controller.php b/downloader/Maged/Controller.php index abf21744113d1bddd5a27665c2a11998162ef80e..f6ea742072c02dca1f3ccaec897823ab6c6bc496 100755 --- a/downloader/Maged/Controller.php +++ b/downloader/Maged/Controller.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -491,7 +491,6 @@ final class Maged_Controller self::singleton()->dispatch(); } catch (Exception $e) { echo $e->getMessage(); - //echo self::singleton()->view()->set('exception', $e)->template("exception.phtml"); } } @@ -883,6 +882,18 @@ final class Maged_Controller @file_put_contents($this->_getMaintenanceFilePath(), 'maintenance'); } } + + if (!empty($_GET['archive_type'])) { + $isSuccess = $this->_createBackup($_GET['archive_type'], $_GET['backup_name']); + + if (!$isSuccess) { + $this->endInstall(); + $this->cleanCache(); + throw new Mage_Exception( + 'The installation process has been canceled because of the backup creation error' + ); + } + } } /** @@ -973,4 +984,96 @@ final class Maged_Controller 'number' => '2', ); } + + /** + * Create Backup + * + * @param string $archiveType + * @param string $archiveName + * @return bool + */ + protected function _createBackup($archiveType, $archiveName){ + /** @var $connect Maged_Connect */ + $connect = $this->model('connect', true)->connect(); + $connect->runHtmlConsole('Creating data backup...'); + + $isSuccess = false; + + try { + $type = $this->_getBackupTypeByCode($archiveType); + + $backupManager = Mage_Backup::getBackupInstance($type) + ->setBackupExtension(Mage::helper('Mage_Backup_Helper_Data')->getExtensionByType($type)) + ->setTime(time()) + ->setName($archiveName) + ->setBackupsDir(Mage::helper('Mage_Backup_Helper_Data')->getBackupsDir()); + + Mage::register('backup_manager', $backupManager); + + if ($type != Mage_Backup_Helper_Data::TYPE_DB) { + $backupManager->setRootDir(Mage::getBaseDir()) + ->addIgnorePaths(Mage::helper('Mage_Backup_Helper_Data')->getBackupIgnorePaths()); + } + $backupManager->create(); + $connect->runHtmlConsole( + $this->_getCreateBackupSuccessMessageByType($type) + ); + $isSuccess = true; + } catch (Mage_Backup_Exception_NotEnoughFreeSpace $e) { + $connect->runHtmlConsole('Not enough free space to create backup.'); + Mage::logException($e); + } catch (Mage_Backup_Exception_NotEnoughPermissions $e) { + $connect->runHtmlConsole('Not enough permissions to create backup.'); + Mage::logException($e); + } catch (Exception $e) { + $connect->runHtmlConsole('An error occurred while creating the backup.'); + Mage::logException($e); + } + + return $isSuccess; + } + + /** + * Retrieve Backup Type by Code + * + * @param int $code + * @return string + */ + protected function _getBackupTypeByCode($code) + { + $typeMap = array( + 1 => Mage_Backup_Helper_Data::TYPE_DB, + 2 => Mage_Backup_Helper_Data::TYPE_SYSTEM_SNAPSHOT, + 3 => Mage_Backup_Helper_Data::TYPE_SNAPSHOT_WITHOUT_MEDIA, + 4 => Mage_Backup_Helper_Data::TYPE_MEDIA + ); + + if (!isset($typeMap[$code])) { + Mage::throwException('Unknown backup type'); + } + + return $typeMap[$code]; + } + + /** + * Get backup create success message by backup type + * + * @param string $type + * @return string + */ + protected function _getCreateBackupSuccessMessageByType($type) + { + $messagesMap = array( + Mage_Backup_Helper_Data::TYPE_SYSTEM_SNAPSHOT => 'System backup has been created', + Mage_Backup_Helper_Data::TYPE_SNAPSHOT_WITHOUT_MEDIA => 'System backup has been created', + Mage_Backup_Helper_Data::TYPE_MEDIA => 'Database and media backup has been created', + Mage_Backup_Helper_Data::TYPE_DB => 'Database backup has been created' + ); + + if (!isset($messagesMap[$type])) { + return ''; + } + + return $messagesMap[$type]; + } } diff --git a/downloader/Maged/Exception.php b/downloader/Maged/Exception.php index 8237000cdf459b01598d417c3e2a6fff9289c01d..ca1a27581dbe4e28842e6f5b9b28a98c1307140c 100755 --- a/downloader/Maged/Exception.php +++ b/downloader/Maged/Exception.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/downloader/Maged/Model.php b/downloader/Maged/Model.php index 9f1bcd51373a41c2522cad33ade9e1257a3274d7..f6a6e3333d0e4d88be7ae65cc47ef851d8f8cebd 100755 --- a/downloader/Maged/Model.php +++ b/downloader/Maged/Model.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/downloader/Maged/Model/Config.php b/downloader/Maged/Model/Config.php index cddc2e3805f825e3a713627a3ffd32b7a12e4da3..ba9ecbc7d7a57e5a218e277d6bc9bb1b1994aa7f 100644 --- a/downloader/Maged/Model/Config.php +++ b/downloader/Maged/Model/Config.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/downloader/Maged/Model/Config/Abstract.php b/downloader/Maged/Model/Config/Abstract.php index 49326f78de2de0679b1ffa549eb564473aa2184f..8c99c26dbf40f30b8189a911a89e1af1e6546ad2 100644 --- a/downloader/Maged/Model/Config/Abstract.php +++ b/downloader/Maged/Model/Config/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/downloader/Maged/Model/Config/Community.php b/downloader/Maged/Model/Config/Community.php index f245ca32324d6723fb9d005a2c25644069ab3652..b565c294ab9e0d0467897dfdb5deda87fbb6363e 100644 --- a/downloader/Maged/Model/Config/Community.php +++ b/downloader/Maged/Model/Config/Community.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/downloader/Maged/Model/Config/Interface.php b/downloader/Maged/Model/Config/Interface.php index 73994dfbc008589ca9d47f94d3ecae05c43a6cf5..286571eae1d7bfae266fca34d238412807d390ef 100644 --- a/downloader/Maged/Model/Config/Interface.php +++ b/downloader/Maged/Model/Config/Interface.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/downloader/Maged/Model/Connect.php b/downloader/Maged/Model/Connect.php index 031e9047b38646a755f38eeab5686ce345778f2d..9f83ac76e64498b6c10db3bf03579e6ef1a300ed 100644 --- a/downloader/Maged/Model/Connect.php +++ b/downloader/Maged/Model/Connect.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/downloader/Maged/Model/Connect/Request.php b/downloader/Maged/Model/Connect/Request.php index 228bcce742cc2627041287c45103cd5335147faf..b2e334e3426ac79336f1911871c7cc1c9d6e9793 100644 --- a/downloader/Maged/Model/Connect/Request.php +++ b/downloader/Maged/Model/Connect/Request.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/downloader/Maged/Model/Dowloader.php b/downloader/Maged/Model/Dowloader.php index 06a34ce36e3c3d0d0d9a399d349528dcd25fe8fe..976b747677e5fb77e66b00cfa62e423ae08cee99 100755 --- a/downloader/Maged/Model/Dowloader.php +++ b/downloader/Maged/Model/Dowloader.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/downloader/Maged/Model/Session.php b/downloader/Maged/Model/Session.php index e5bcb0b1d3b5f8b40215683182b80f95095456d6..980e30d1616212e1ddd5876a360471bcd3336c0b 100644 --- a/downloader/Maged/Model/Session.php +++ b/downloader/Maged/Model/Session.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/downloader/Maged/View.php b/downloader/Maged/View.php index defa0f18b839ce4a91fe3471f4819b378537f2b4..c236e446ef9f83602ca21c3803f380650faab4d1 100755 --- a/downloader/Maged/View.php +++ b/downloader/Maged/View.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/downloader/index.php b/downloader/index.php index 4bc284e435a120cf61b4f569c9daa2a144145628..dcc6a0c0bb91cc55f4ce499efc46fc0fe7a3937d 100755 --- a/downloader/index.php +++ b/downloader/index.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/downloader/lib/Mage/Archive.php b/downloader/lib/Mage/Archive.php index 1d3cc3fe94ce56ee431b0e224c4b9012853203c4..d948103d5ad2bbaf93b12822976f8e833a2d75c7 100644 --- a/downloader/lib/Mage/Archive.php +++ b/downloader/lib/Mage/Archive.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Archive - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -157,12 +157,13 @@ class Mage_Archive if ($i == 0) { $packed = rtrim($destination, DS) . DS; } else { - $packed = rtrim($destination, DS) . DS . '~tmp-'. microtime(true) . $archivers[$i-1] . '.' . $archivers[$i-1]; + $packed = rtrim($destination, DS) . DS . '~tmp-'. microtime(true) . $archivers[$i-1] . '.' + . $archivers[$i-1]; } $source = $this->_getArchiver($archivers[$i])->unpack($source, $packed); - + //var_dump($packed, $source); - + if ($clearInterm && $interimSource && $i >= 0) { unlink($interimSource); } @@ -218,5 +219,4 @@ class Mage_Archive } return false; } - -} +} \ No newline at end of file diff --git a/downloader/lib/Mage/Archive/Abstract.php b/downloader/lib/Mage/Archive/Abstract.php index 4871259695cb0f0abca6a1f828438d60a00e4c17..2aece18795558b642db83fcd7acb43aea1b65a27 100644 --- a/downloader/lib/Mage/Archive/Abstract.php +++ b/downloader/lib/Mage/Archive/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Archive - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -34,14 +34,16 @@ class Mage_Archive_Abstract { /** - * Write data to file. If file can't be opened, + * Write data to file. If file can't be opened - throw exception * * @param string $destination * @param string $data * @return boolean + * @throws Mage_Exception */ protected function _writeFile($destination, $data) { + $destination = trim($destination); if(false === file_put_contents($destination, $data)) { throw new Mage_Exception("Can't write to file: " . $destination); } @@ -53,6 +55,7 @@ class Mage_Archive_Abstract * * @param string $source * @return string + * @throws Mage_Exception */ protected function _readFile($source) { @@ -70,7 +73,8 @@ class Mage_Archive_Abstract * Get file name from source (URI) without last extension. * * @param string $source - * @return string + * @param bool $withExtension + * @return mixed|string */ public function getFilename($source, $withExtension=false) { @@ -80,5 +84,4 @@ class Mage_Archive_Abstract } return $file; } - } diff --git a/downloader/lib/Mage/Archive/Bz.php b/downloader/lib/Mage/Archive/Bz.php index cf5c42cd87ddb81b7e7edd2d9e31c65736e225d8..052fdcb4b21e99545cb75914ef86ee51deb66d64 100644 --- a/downloader/lib/Mage/Archive/Bz.php +++ b/downloader/lib/Mage/Archive/Bz.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Archive - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -43,9 +43,19 @@ class Mage_Archive_Bz extends Mage_Archive_Abstract implements Mage_Archive_Inte */ public function pack($source, $destination) { - $data = $this->_readFile($source); - $bzData = bzcompress($data, 9); - $this->_writeFile($destination, $bzData); + $fileReader = new Mage_Archive_Helper_File($source); + $fileReader->open('r'); + + $archiveWriter = new Mage_Archive_Helper_File_Bz($destination); + $archiveWriter->open('w'); + + while (!$fileReader->eof()) { + $archiveWriter->write($fileReader->read()); + } + + $fileReader->close(); + $archiveWriter->close(); + return $destination; } @@ -58,21 +68,21 @@ class Mage_Archive_Bz extends Mage_Archive_Abstract implements Mage_Archive_Inte */ public function unpack($source, $destination) { - $data = ''; - $bzPointer = bzopen($source, 'r' ); - if (empty($bzPointer)) { - throw new Exception('Can\'t open BZ archive : ' . $source); - } - while (!feof($bzPointer)) { - $data .= bzread($bzPointer, 131072); - } - bzclose($bzPointer); if (is_dir($destination)) { $file = $this->getFilename($source); $destination = $destination . $file; } - echo $destination; - $this->_writeFile($destination, $data); + + $archiveReader = new Mage_Archive_Helper_File_Bz($source); + $archiveReader->open('r'); + + $fileWriter = new Mage_Archive_Helper_File($destination); + $fileWriter->open('w'); + + while (!$archiveReader->eof()) { + $fileWriter->write($archiveReader->read()); + } + return $destination; } diff --git a/downloader/lib/Mage/Archive/Gz.php b/downloader/lib/Mage/Archive/Gz.php index 0e8dfd1d6b9428f0e0ef054b6398e0609a0686ce..43a7c0d58b85cf55f80e55472f6ea497960f8835 100644 --- a/downloader/lib/Mage/Archive/Gz.php +++ b/downloader/lib/Mage/Archive/Gz.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Archive - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -42,9 +42,19 @@ class Mage_Archive_Gz extends Mage_Archive_Abstract implements Mage_Archive_Inte */ public function pack($source, $destination) { - $data = $this->_readFile($source); - $gzData = gzencode($data, 9); - $this->_writeFile($destination, $gzData); + $fileReader = new Mage_Archive_Helper_File($source); + $fileReader->open('r'); + + $archiveWriter = new Mage_Archive_Helper_File_Gz($destination); + $archiveWriter->open('wb9'); + + while (!$fileReader->eof()) { + $archiveWriter->write($fileReader->read()); + } + + $fileReader->close(); + $archiveWriter->close(); + return $destination; } @@ -57,21 +67,21 @@ class Mage_Archive_Gz extends Mage_Archive_Abstract implements Mage_Archive_Inte */ public function unpack($source, $destination) { - $gzPointer = gzopen($source, 'r' ); - if (empty($gzPointer)) { - throw new Mage_Exception('Can\'t open GZ archive : ' . $source); - } - $data = ''; - while (!gzeof($gzPointer)) { - $data .= gzread($gzPointer, 131072); - } - gzclose($gzPointer); if (is_dir($destination)) { $file = $this->getFilename($source); $destination = $destination . $file; } - $this->_writeFile($destination, $data); + + $archiveReader = new Mage_Archive_Helper_File_Gz($source); + $archiveReader->open('r'); + + $fileWriter = new Mage_Archive_Helper_File($destination); + $fileWriter->open('w'); + + while (!$archiveReader->eof()) { + $fileWriter->write($archiveReader->read()); + } + return $destination; } - } diff --git a/downloader/lib/Mage/Archive/Helper/File.php b/downloader/lib/Mage/Archive/Helper/File.php new file mode 100755 index 0000000000000000000000000000000000000000..0487263389445ddf9224cd52f0e04bff75baa488 --- /dev/null +++ b/downloader/lib/Mage/Archive/Helper/File.php @@ -0,0 +1,274 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Archive + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** +* Helper class that simplifies files stream reading and writing +* +* @category Mage +* @package Mage_Archive +* @author Magento Core Team <core@magentocommerce.com> +*/ +class Mage_Archive_Helper_File +{ + /** + * Full path to directory where file located + * + * @var string + */ + protected $_fileLocation; + + /** + * File name + * + * @var string + */ + protected $_fileName; + + /** + * Full path (directory + filename) to file + * + * @var string + */ + protected $_filePath; + + /** + * File permissions that will be set if file opened in write mode + * + * @var int + */ + protected $_chmod; + + /** + * File handler + * + * @var pointer + */ + protected $_fileHandler; + + /** + * Set file path via constructor + * + * @param string $filePath + */ + public function __construct($filePath) + { + $pathInfo = pathinfo($filePath); + + $this->_filePath = $filePath; + $this->_fileLocation = isset($pathInfo['dirname']) ? $pathInfo['dirname'] : ''; + $this->_fileName = isset($pathInfo['basename']) ? $pathInfo['basename'] : ''; + } + + /** + * Close file if it's not closed before object destruction + */ + public function __destruct() + { + if ($this->_fileHandler) { + $this->_close(); + } + } + + /** + * Open file + * + * @param string $mode + * @param int $chmod + * @throws Mage_Exception + */ + public function open($mode = 'w+', $chmod = 0666) + { + if ($this->_isWritableMode($mode)) { + if (!is_writable($this->_fileLocation)) { + throw new Mage_Exception('Permission denied to write to ' . $this->_fileLocation); + } + + if (is_file($this->_filePath) && !is_writable($this->_filePath)) { + throw new Mage_Exception("Can't open file " . $this->_fileName . " for writing. Permission denied."); + } + } + + if ($this->_isReadableMode($mode) && (!is_file($this->_filePath) || !is_readable($this->_filePath))) { + if (!is_file($this->_filePath)) { + throw new Mage_Exception('File ' . $this->_filePath . ' does not exist'); + } + + if (!is_readable($this->_filePath)) { + throw new Mage_Exception('Permission denied to read file ' . $this->_filePath); + } + } + + $this->_open($mode); + + $this->_chmod = $chmod; + } + + /** + * Write data to file + * + * @param string $data + */ + public function write($data) + { + $this->_checkFileOpened(); + $this->_write($data); + } + + /** + * Read data from file + * + * @param int $length + * @return string|boolean + */ + public function read($length = 4096) + { + $data = false; + $this->_checkFileOpened(); + if ($length > 0) { + $data = $this->_read($length); + } + + return $data; + } + + /** + * Check whether end of file reached + * + * @return boolean + */ + public function eof() + { + $this->_checkFileOpened(); + return $this->_eof(); + } + + /** + * Close file + */ + public function close() + { + $this->_checkFileOpened(); + $this->_close(); + $this->_fileHandler = false; + @chmod($this->_filePath, $this->_chmod); + } + + /** + * Implementation of file opening + * + * @param string $mode + * @throws Mage_Exception + */ + protected function _open($mode) + { + $this->_fileHandler = @fopen($this->_filePath, $mode); + + if (false === $this->_fileHandler) { + throw new Mage_Exception('Failed to open file ' . $this->_filePath); + } + } + + /** + * Implementation of writing data to file + * + * @param string $data + * @throws Mage_Exception + */ + protected function _write($data) + { + $result = @fwrite($this->_fileHandler, $data); + + if (false === $result) { + throw new Mage_Exception('Failed to write data to ' . $this->_filePath); + } + } + + /** + * Implementation of file reading + * + * @param int $length + * @throws Mage_Exception + */ + protected function _read($length) + { + $result = fread($this->_fileHandler, $length); + + if (false === $result) { + throw new Mage_Exception('Failed to read data from ' . $this->_filePath); + } + + return $result; + } + + /** + * Implementation of EOF indicator + * + * @return boolean + */ + protected function _eof() + { + return feof($this->_fileHandler); + } + + /** + * Implementation of file closing + */ + protected function _close() + { + fclose($this->_fileHandler); + } + + /** + * Check whether requested mode is writable mode + * + * @param string $mode + */ + protected function _isWritableMode($mode) + { + return preg_match('/(^[waxc])|(\+$)/', $mode); + } + + /** + * Check whether requested mode is readable mode + * + * @param string $mode + */ + protected function _isReadableMode($mode) { + return !$this->_isWritableMode($mode); + } + + /** + * Check whether file is opened + * + * @throws Mage_Exception + */ + protected function _checkFileOpened() + { + if (!$this->_fileHandler) { + throw new Mage_Exception('File not opened'); + } + } +} diff --git a/downloader/lib/Mage/Archive/Helper/File/Bz.php b/downloader/lib/Mage/Archive/Helper/File/Bz.php new file mode 100755 index 0000000000000000000000000000000000000000..dbddaaeb6a1b619ff0c50c056f35d18af2201a79 --- /dev/null +++ b/downloader/lib/Mage/Archive/Helper/File/Bz.php @@ -0,0 +1,92 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Archive + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** +* Helper class that simplifies bz2 files stream reading and writing +* +* @category Mage +* @package Mage_Archive +* @author Magento Core Team <core@magentocommerce.com> +*/ +class Mage_Archive_Helper_File_Bz extends Mage_Archive_Helper_File +{ + /** + * Open bz archive file + * + * @throws Mage_Exception + * @param string $mode + */ + protected function _open($mode) + { + $this->_fileHandler = @bzopen($this->_filePath, $mode); + + if (false === $this->_fileHandler) { + throw new Mage_Exception('Failed to open file ' . $this->_filePath); + } + } + + /** + * Write data to bz archive + * + * @throws Mage_Exception + * @param $data + */ + protected function _write($data) + { + $result = @bzwrite($this->_fileHandler, $data); + + if (false === $result) { + throw new Mage_Exception('Failed to write data to ' . $this->_filePath); + } + } + + /** + * Read data from bz archive + * + * @throws Mage_Exception + * @param int $length + * @return string + */ + protected function _read($length) + { + $data = bzread($this->_fileHandler, $length); + + if (false === $data) { + throw new Mage_Exception('Failed to read data from ' . $this->_filePath); + } + + return $data; + } + + /** + * Close bz archive + */ + protected function _close() + { + bzclose($this->_fileHandler); + } +} + diff --git a/downloader/lib/Mage/Archive/Helper/File/Gz.php b/downloader/lib/Mage/Archive/Helper/File/Gz.php new file mode 100755 index 0000000000000000000000000000000000000000..9bf01228510e6bf6ab378dcb47fd8fd1f519e0d0 --- /dev/null +++ b/downloader/lib/Mage/Archive/Helper/File/Gz.php @@ -0,0 +1,83 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Archive + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** +* Helper class that simplifies gz files stream reading and writing +* +* @category Mage +* @package Mage_Archive +* @author Magento Core Team <core@magentocommerce.com> +*/ +class Mage_Archive_Helper_File_Gz extends Mage_Archive_Helper_File +{ + /** + * @see Mage_Archive_Helper_File::_open() + */ + protected function _open($mode) + { + $this->_fileHandler = @gzopen($this->_filePath, $mode); + + if (false === $this->_fileHandler) { + throw new Mage_Exception('Failed to open file ' . $this->_filePath); + } + } + + /** + * @see Mage_Archive_Helper_File::_write() + */ + protected function _write($data) + { + $result = @gzwrite($this->_fileHandler, $data); + + if (empty($result) && !empty($data)) { + throw new Mage_Exception('Failed to write data to ' . $this->_filePath); + } + } + + /** + * @see Mage_Archive_Helper_File::_read() + */ + protected function _read($length) + { + return gzread($this->_fileHandler, $length); + } + + /** + * @see Mage_Archive_Helper_File::_eof() + */ + protected function _eof() + { + return gzeof($this->_fileHandler); + } + + /** + * @see Mage_Archive_Helper_File::_close() + */ + protected function _close() + { + gzclose($this->_fileHandler); + } +} diff --git a/downloader/lib/Mage/Archive/Interface.php b/downloader/lib/Mage/Archive/Interface.php index 8ef9af3c84e08fb6eee4b376cfd4f52fe8a457f9..8b3fe7c8ba31dcb79dd2a8ba9db8bea5aab8ef73 100644 --- a/downloader/lib/Mage/Archive/Interface.php +++ b/downloader/lib/Mage/Archive/Interface.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Archive - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/downloader/lib/Mage/Archive/Tar.php b/downloader/lib/Mage/Archive/Tar.php index dca45fcd3cb633e4752e9bfffac679bb974b118d..e36fec58ea5cc7b7f43182756cfe89f3fcd5d1bf 100644 --- a/downloader/lib/Mage/Archive/Tar.php +++ b/downloader/lib/Mage/Archive/Tar.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Archive - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -34,9 +34,11 @@ class Mage_Archive_Tar extends Mage_Archive_Abstract implements Mage_Archive_Interface { /** - * Constant is used for parse tar's header. + * Tar block size + * + * @const int */ - const FORMAT_PARSE_HEADER = 'a100name/a8mode/a8uid/a8gid/a12size/a12mtime/a8checksum/a1type/a100symlink/a6magic/a2version/a32uname/a32gname/a8devmajor/a8devminor/a155prefix/a12closer'; + const TAR_BLOCK_SIZE = 512; /** * Keep file or directory for packing. @@ -60,6 +62,122 @@ class Mage_Archive_Tar extends Mage_Archive_Abstract implements Mage_Archive_Int */ protected $_skipRoot; + /** + * Tarball data writer + * + * @var Mage_Archive_Helper_File + */ + protected $_writer; + + /** + * Tarball data reader + * + * @var Mage_Archive_Helper_File + */ + protected $_reader; + + /** + * Path to file where tarball should be placed + * + * @var string + */ + protected $_destinationFilePath; + + /** + * Initialize tarball writer + * + * @return Mage_Archive_Tar + */ + protected function _initWriter() + { + $this->_writer = new Mage_Archive_Helper_File($this->_destinationFilePath); + $this->_writer->open('w'); + + return $this; + } + + /** + * Returns string that is used for tar's header parsing + * + * @return string + */ + protected static final function _getFormatParseHeader() + { + return 'a100name/a8mode/a8uid/a8gid/a12size/a12mtime/a8checksum/a1type/a100symlink/a6magic/a2version/' + . 'a32uname/a32gname/a8devmajor/a8devminor/a155prefix/a12closer'; + } + + /** + * Destroy tarball writer + * + * @return Mage_Archive_Tar + */ + protected function _destroyWriter() + { + if ($this->_writer instanceof Mage_Archive_Helper_File) { + $this->_writer->close(); + $this->_writer = null; + } + + return $this; + } + + /** + * Get tarball writer + * + * @return Mage_Archive_Helper_File + */ + protected function _getWriter() + { + if (!$this->_writer) { + $this->_initWriter(); + } + + return $this->_writer; + } + + /** + * Initialize tarball reader + * + * @return Mage_Archive_Tar + */ + protected function _initReader() + { + $this->_reader = new Mage_Archive_Helper_File($this->_getCurrentFile()); + $this->_reader->open('r'); + + return $this; + } + + /** + * Destroy tarball reader + * + * @return Mage_Archive_Tar + */ + protected function _destroyReader() + { + if ($this->_reader instanceof Mage_Archive_Helper_File) { + $this->_reader->close(); + $this->_reader = null; + } + + return $this; + } + + /** + * Get tarball reader + * + * @return Mage_Archive_Helper_File + */ + protected function _getReader() + { + if (!$this->_reader) { + $this->_initReader(); + } + + return $this->_reader; + } + /** * Set option that define ability skip first catalog level. * @@ -80,7 +198,19 @@ class Mage_Archive_Tar extends Mage_Archive_Abstract implements Mage_Archive_Int */ protected function _setCurrentFile($file) { - $this->_currentFile = $file .((is_dir($file) && substr($file, -1)!=DS)?DS:''); + $this->_currentFile = $file .((!is_link($file) && is_dir($file) && substr($file, -1) != DS) ? DS : ''); + return $this; + } + + /** + * Set path to file where tarball should be placed + * + * @param string $destinationFilePath + * @return Mage_Archive_Tar + */ + protected function _setDestinationFilePath($destinationFilePath) + { + $this->_destinationFilePath = $destinationFilePath; return $this; } @@ -124,6 +254,7 @@ class Mage_Archive_Tar extends Mage_Archive_Abstract implements Mage_Archive_Int * Walk through directory and add to tar file or directory. * Result is packed string on TAR format. * + * @deprecated after 1.7.0.0 * @param boolean $skipRoot * @return string */ @@ -154,10 +285,74 @@ class Mage_Archive_Tar extends Mage_Archive_Abstract implements Mage_Archive_Int return $tarData; } + /** + * Recursively walk through file tree and create tarball + * + * @param boolean $skipRoot + * @param boolean $finalize + * @throws Mage_Exception + */ + protected function _createTar($skipRoot = false, $finalize = false) + { + if (!$skipRoot) { + $this->_packAndWriteCurrentFile(); + } + + $file = $this->_getCurrentFile(); + + if (is_dir($file)) { + $dirFiles = scandir($file); + + if (false === $dirFiles) { + throw new Mage_Exception('Can\'t scan dir: ' . $file); + } + + array_shift($dirFiles); /* remove './'*/ + array_shift($dirFiles); /* remove '../'*/ + + foreach ($dirFiles as $item) { + $this->_setCurrentFile($file . $item)->_createTar(); + } + } + + if ($finalize) { + $this->_getWriter()->write(str_repeat("\0", self::TAR_BLOCK_SIZE * 12)); + } + } + + /** + * Write current file to tarball + */ + protected function _packAndWriteCurrentFile() + { + $archiveWriter = $this->_getWriter(); + $archiveWriter->write($this->_composeHeader()); + + $currentFile = $this->_getCurrentFile(); + + $fileSize = 0; + + if (is_file($currentFile) && !is_link($currentFile)) { + $fileReader = new Mage_Archive_Helper_File($currentFile); + $fileReader->open('r'); + + while (!$fileReader->eof()) { + $archiveWriter->write($fileReader->read()); + } + + $fileReader->close(); + + $fileSize = filesize($currentFile); + } + + $appendZerosCount = (self::TAR_BLOCK_SIZE - $fileSize % self::TAR_BLOCK_SIZE) % self::TAR_BLOCK_SIZE; + $archiveWriter->write(str_repeat("\0", $appendZerosCount)); + } + /** * Compose header for current file in TAR format. * If length of file's name greater 100 characters, - * method breaks header to two pieces. First conatins + * method breaks header into two pieces. First contains * header and data with long name. Second contain only header. * * @param boolean $long @@ -178,14 +373,16 @@ class Mage_Archive_Tar extends Mage_Archive_Abstract implements Mage_Archive_Int } $header = array(); $header['100-name'] = $long?'././@LongLink':substr($nameFile, 0, 100); - $header['8-mode'] = $long?' ':str_pad(substr(sprintf("%07o", $infoFile['mode']),-4), 6, '0', STR_PAD_LEFT); + $header['8-mode'] = $long ? ' ' + : str_pad(substr(sprintf("%07o", $infoFile['mode']),-4), 6, '0', STR_PAD_LEFT); $header['8-uid'] = $long || $infoFile['uid']==0?"\0\0\0\0\0\0\0":sprintf("%07o", $infoFile['uid']); $header['8-gid'] = $long || $infoFile['gid']==0?"\0\0\0\0\0\0\0":sprintf("%07o", $infoFile['gid']); - $header['12-size'] = $long?sprintf("%011o", strlen($nameFile)):sprintf("%011o", is_dir($file) ? 0 : filesize($file)); + $header['12-size'] = $long ? sprintf("%011o", strlen($nameFile)) : sprintf("%011o", is_dir($file) + ? 0 : filesize($file)); $header['12-mtime'] = $long?'00000000000':sprintf("%011o", $infoFile['mtime']); $header['8-check'] = sprintf('% 8s', ''); - $header['1-type'] = $long?'L':(is_link($file) ? 2 : is_dir ($file) ? 5 : 0); - $header['100-symlink'] = is_link($file) == 2 ? readlink($item) : ''; + $header['1-type'] = $long ? 'L' : (is_link($file) ? 2 : (is_dir($file) ? 5 : 0)); + $header['100-symlink'] = is_link($file) ? readlink($file) : ''; $header['6-magic'] = 'ustar '; $header['2-version'] = ' '; $a=function_exists('posix_getpwuid')?posix_getpwuid (fileowner($file)):array('name'=>''); @@ -219,38 +416,63 @@ class Mage_Archive_Tar extends Mage_Archive_Abstract implements Mage_Archive_Int * * @param string $destination path to file is unpacked * @return array list of files + * @throws Mage_Exception */ protected function _unpackCurrentTar($destination) { - $file = $this->_getCurrentFile(); - $pointer = fopen($file, 'r'); - if (empty($pointer)) { - throw new Mage_Exception('Can\'t open file: ' . $file); - } + $archiveReader = $this->_getReader(); $list = array(); - while (!feof($pointer)) { - $header = $this->_parseHeader($pointer); - if ($header) { - $currentFile = $destination . $header['name']; - if ($header['type']=='5' && @mkdir($currentFile, 0777, true)) { - $list[] = $currentFile . DS; - } elseif (in_array($header['type'], array("0",chr(0), ''))) { - $dirname = dirname($currentFile); - if(!file_exists($dirname)) { - @mkdir($dirname, 0777, true); + + while (!$archiveReader->eof()) { + $header = $this->_extractFileHeader(); + + if (!$header) { + continue; + } + + $currentFile = $destination . $header['name']; + $dirname = dirname($currentFile); + + if (in_array($header['type'], array("0",chr(0), ''))) { + + if(!file_exists($dirname)) { + $mkdirResult = @mkdir($dirname, 0777, true); + + if (false === $mkdirResult) { + throw new Mage_Exception('Failed to create directory ' . $dirname); } - $this->_writeFile($currentFile, $header['data']); - $list[] = $currentFile; + } + + $this->_extractAndWriteFile($header, $currentFile); + $list[] = $currentFile; + + } elseif ($header['type'] == '5') { + + if(!file_exists($dirname)) { + $mkdirResult = @mkdir($currentFile, $header['mode'], true); + + if (false === $mkdirResult) { + throw new Mage_Exception('Failed to create directory ' . $currentFile); + } + } + $list[] = $currentFile . DS; + } elseif ($header['type'] == '2') { + + $symlinkResult = @symlink($header['symlink'], $currentFile); + + if (false === $symlinkResult) { + throw new Mage_Exception('Failed to create symlink ' . $currentFile . ' to ' . $header['symlink']); } } } - fclose($pointer); + return $list; } /** * Get header from TAR string and unpacked it by format. * + * @deprecated after 1.7.0.0 * @param resource $pointer * @return string */ @@ -262,10 +484,9 @@ class Mage_Archive_Tar extends Mage_Archive_Abstract implements Mage_Archive_Int return false; } - $fmt = self::FORMAT_PARSE_HEADER; + $fmt = self::_getFormatParseHeader(); $header = unpack ($fmt, $firstLine); - $header['mode']=$header['mode']+0; $header['uid']=octdec($header['uid']); $header['gid']=octdec($header['gid']); @@ -284,7 +505,7 @@ class Mage_Archive_Tar extends Mage_Archive_Abstract implements Mage_Archive_Int } $isUstar = 'ustar' == strtolower(substr($header['magic'], 0, 5)); - + $checksumOk = $header['checksum'] == $checksum; if (isset($header['name']) && $checksumOk) { if ($header['name'] == '././@LongLink' && $header['type'] == 'L') { @@ -304,6 +525,90 @@ class Mage_Archive_Tar extends Mage_Archive_Abstract implements Mage_Archive_Int return false; } + /** + * Read and decode file header information from tarball + * + * @return array|boolean + */ + protected function _extractFileHeader() + { + $archiveReader = $this->_getReader(); + + $headerBlock = $archiveReader->read(self::TAR_BLOCK_SIZE); + + if (strlen($headerBlock) < self::TAR_BLOCK_SIZE) { + return false; + } + + $header = unpack(self::_getFormatParseHeader(), $headerBlock); + + $header['mode'] = octdec($header['mode']); + $header['uid'] = octdec($header['uid']); + $header['gid'] = octdec($header['gid']); + $header['size'] = octdec($header['size']); + $header['mtime'] = octdec($header['mtime']); + $header['checksum'] = octdec($header['checksum']); + + if ($header['type'] == "5") { + $header['size'] = 0; + } + + $checksum = 0; + $headerBlock = substr_replace($headerBlock, ' ', 148, 8); + + for ($i = 0; $i < 512; $i++) { + $checksum += ord(substr($headerBlock, $i, 1)); + } + + $isUstar = 'ustar' == strtolower(substr($header['magic'], 0, 5)); + + $checksumOk = $header['checksum'] == $checksum; + if (isset($header['name']) && $checksumOk) { + + if (!($header['name'] == '././@LongLink' && $header['type'] == 'L')) { + return $header; + } + + $realNameBlockSize = floor(($header['size'] + self::TAR_BLOCK_SIZE - 1) / self::TAR_BLOCK_SIZE) + * self::TAR_BLOCK_SIZE; + $realNameBlock = $archiveReader->read($realNameBlockSize); + $realName = substr($realNameBlock, 0, $header['size']); + + $headerMain = $this->_extractFileHeader(); + $headerMain['name'] = $realName; + return $headerMain; + } + + return false; + } + + /** + * Extract next file from tarball by its $header information and save it to $destination + * + * @param array $fileHeader + * @param string $destination + */ + protected function _extractAndWriteFile($fileHeader, $destination) + { + $fileWriter = new Mage_Archive_Helper_File($destination); + $fileWriter->open('w', $fileHeader['mode']); + + $archiveReader = $this->_getReader(); + + $filesize = $fileHeader['size']; + $bytesExtracted = 0; + + while ($filesize > $bytesExtracted && !$archiveReader->eof()) { + $block = $archiveReader->read(self::TAR_BLOCK_SIZE); + $nonExtractedBytesCount = $filesize - $bytesExtracted; + + $data = substr($block, 0, $nonExtractedBytesCount); + $fileWriter->write($data); + + $bytesExtracted += strlen($block); + } + } + /** * Pack file to TAR (Tape Archiver). * @@ -312,14 +617,18 @@ class Mage_Archive_Tar extends Mage_Archive_Abstract implements Mage_Archive_Int * @param boolean $skipRoot * @return string */ - public function pack($source, $destination, $skipRoot=false) + public function pack($source, $destination, $skipRoot = false) { $this->_setSkipRoot($skipRoot); $source = realpath($source); $tarData = $this->_setCurrentPath($source) - ->_setCurrentFile($source) - ->_packToTar($skipRoot); - $this->_writeFile($destination, $tarData); + ->_setDestinationFilePath($destination) + ->_setCurrentFile($source); + + $this->_initWriter(); + $this->_createTar($skipRoot, true); + $this->_destroyWriter(); + return $destination; } @@ -332,13 +641,13 @@ class Mage_Archive_Tar extends Mage_Archive_Abstract implements Mage_Archive_Int */ public function unpack($source, $destination) { - $tempFile = $destination . DS . '~tmp-'.microtime(true).'.tar'; - $data = $this->_readFile($source); - $this->_writeFile($tempFile, $data); - $this->_setCurrentFile($tempFile) - ->_setCurrentPath($tempFile) - ->_unpackCurrentTar($destination); - unlink($tempFile); + $this->_setCurrentFile($source) + ->_setCurrentPath($source); + + $this->_initReader(); + $this->_unpackCurrentTar($destination); + $this->_destroyReader(); + return $destination; } @@ -352,21 +661,28 @@ class Mage_Archive_Tar extends Mage_Archive_Abstract implements Mage_Archive_Int */ public function extract($file, $source, $destination) { - $pointer = fopen($source, 'r'); - if (empty($pointer)) { - throw new Mage_Exception('Can\'t open file: '.$source); - } - $list = array(); + $this->_setCurrentFile($source); + $this->_initReader(); + + $archiveReader = $this->_getReader(); $extractedFile = ''; - while (!feof($pointer)) { - $header = $this->_parseHeader($pointer); + + while (!$archiveReader->eof()) { + $header = $this->_extractFileHeader(); if ($header['name'] == $file) { $extractedFile = $destination . basename($header['name']); - $this->_writeFile($extractedFile, $header['data']); + $this->_extractAndWriteFile($header, $extractedFile); break; } + + if ($header['type'] != 5){ + $skipBytes = floor(($header['size'] + self::TAR_BLOCK_SIZE - 1) / self::TAR_BLOCK_SIZE) + * self::TAR_BLOCK_SIZE; + $archiveReader->read($skipBytes); + } } - fclose($pointer); + + $this->_destroyReader(); return $extractedFile; } } diff --git a/downloader/lib/Mage/Autoload/Simple.php b/downloader/lib/Mage/Autoload/Simple.php index 83e1a5a4f0021a490b962e2a8979de6e295ef8a5..260b57a3759013073758c5dab163be577f65b8cf 100644 --- a/downloader/lib/Mage/Autoload/Simple.php +++ b/downloader/lib/Mage/Autoload/Simple.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Autoload - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/downloader/lib/Mage/Backup.php b/downloader/lib/Mage/Backup.php new file mode 100755 index 0000000000000000000000000000000000000000..88f2f48b43648d762885b0d62e7ff6252610c2ee --- /dev/null +++ b/downloader/lib/Mage/Backup.php @@ -0,0 +1,59 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Backup + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Class to work with backups + * + * @category Mage + * @package Mage_Backup + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Backup +{ + /** + * List of supported a backup types + * + * @var array + */ + static protected $_allowedBackupTypes = array('db', 'snapshot', 'filesystem', 'media', 'nomedia'); + + /** + * get Backup Instance By File Name + * + * @param string $type + * @return Mage_Backup_Interface + */ + static public function getBackupInstance($type) + { + $class = 'Mage_Backup_' . $type; + + if (!in_array($type, self::$_allowedBackupTypes) || !class_exists($class, true)){ + throw new Mage_Exception('Current implementation not supported this type (' . $type . ') of backup.'); + } + + return new $class(); + } +} diff --git a/downloader/lib/Mage/Backup/Abstract.php b/downloader/lib/Mage/Backup/Abstract.php new file mode 100755 index 0000000000000000000000000000000000000000..340819f784b4376b0a964c8aeee170c4b1a2e984 --- /dev/null +++ b/downloader/lib/Mage/Backup/Abstract.php @@ -0,0 +1,318 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Backup + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Class to work with archives + * + * @category Mage + * @package Mage_Backup + * @author Magento Core Team <core@magentocommerce.com> + */ +abstract class Mage_Backup_Abstract implements Mage_Backup_Interface +{ + /** + * Backup name + * + * @var string + */ + protected $_name; + + /** + * Backup creation date + * + * @var int + */ + protected $_time; + + /** + * Backup file extension + * + * @var string + */ + protected $_backupExtension; + + /** + * Resource model + * + * @var object + */ + protected $_resourceModel; + + /** + * Magento's root directory + * + * @var string + */ + protected $_rootDir; + + /** + * Path to directory where backups stored + * + * @var string + */ + protected $_backupsDir; + + /** + * Is last operation completed successfully + * + * @var bool + */ + protected $_lastOperationSucceed = false; + + /** + * Last failed operation error message + * + * @var string + */ + protected $_lastErrorMessage; + + + /** + * Set Backup Extension + * + * @param string $backupExtension + * @return Mage_Backup_Interface + */ + public function setBackupExtension($backupExtension) + { + $this->_backupExtension = $backupExtension; + return $this; + } + + /** + * Get Backup Extension + * + * @return string + */ + public function getBackupExtension() + { + return $this->_backupExtension; + } + + /** + * Set Resource Model + * + * @param object $resourceModel + * @return Mage_Backup_Interface + */ + public function setResourceModel($resourceModel) + { + $this->_resourceModel = $resourceModel; + return $this; + } + + /** + * Get Resource Model + * + * @return object + */ + public function getResourceModel() + { + return $this->_resourceModel; + } + + /** + * Set Time + * + * @param int $time + * @return Mage_Backup_Interface + */ + public function setTime($time) + { + $this->_time = $time; + return $this; + } + + /** + * Get Time + * + * @return int + */ + public function getTime() + { + return $this->_time; + } + + /** + * Set root directory of Magento installation + * + * @param string $rootDir + * @throws Mage_Exception + * @return Mage_Backup_Interface + */ + public function setRootDir($rootDir) + { + if (!is_dir($rootDir)) { + throw new Mage_Exception('Bad root directory'); + } + + $this->_rootDir = $rootDir; + return $this; + } + + /** + * Get Magento's root directory + * @return string + */ + public function getRootDir() + { + return $this->_rootDir; + } + + /** + * Set path to directory where backups stored + * + * @param string $backupsDir + * @return Mage_Backup_Interface + */ + public function setBackupsDir($backupsDir) + { + $this->_backupsDir = $backupsDir; + return $this; + } + + /** + * Get path to directory where backups stored + * + * @return string + */ + public function getBackupsDir() + { + return $this->_backupsDir; + } + + /** + * Get path to backup + * + * @return string + */ + public function getBackupPath() + { + return $this->getBackupsDir() . DS . $this->getBackupFilename(); + } + + /** + * Get backup file name + * + * @return string + */ + public function getBackupFilename() + { + $filename = $this->getTime() . '_' . $this->getType(); + + $name = $this->getName(); + + if (!empty($name)) { + $filename .= '_' . $name; + } + + $filename .= '.' . $this->getBackupExtension(); + + return $filename; + } + + /** + * Check whether last operation completed successfully + * + * @return bool + */ + public function getIsSuccess() + { + return $this->_lastOperationSucceed; + } + + /** + * Get last error message + * + * @return string + */ + public function getErrorMessage() + { + return $this->_lastErrorMessage; + } + + /** + * Set error message + * + * @param string $errorMessage + * @return string + */ + public function setErrorMessage($errorMessage) + { + $this->_lastErrorMessage = $errorMessage; + } + + /** + * Set backup name + * + * @param string $name + * @param bool $applyFilter + * @return Mage_Backup_Interface + */ + public function setName($name, $applyFilter = true) + { + if ($applyFilter) { + $name = $this->_filterName($name); + } + $this->_name = $name; + return $this; + } + + /** + * Get backup name + * + * @return string + */ + public function getName() + { + return $this->_name; + } + + /** + * Get backup display name + * + * @return string + */ + public function getDisplayName() + { + return str_replace('_', ' ', $this->_name); + } + + /** + * Removes disallowed characters and replaces spaces with underscores + * + * @param string $name + * @return string + */ + protected function _filterName($name) + { + $name = trim(preg_replace('/[^\da-zA-Z ]/', '', $name)); + $name = preg_replace('/\s{2,}/', ' ', $name); + $name = str_replace(' ', '_', $name); + + return $name; + } +} diff --git a/downloader/lib/Mage/Backup/Archive/Tar.php b/downloader/lib/Mage/Backup/Archive/Tar.php new file mode 100644 index 0000000000000000000000000000000000000000..07e6c34a1e6d7f762715c4ea8cfab0eadf5816d1 --- /dev/null +++ b/downloader/lib/Mage/Backup/Archive/Tar.php @@ -0,0 +1,82 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Backup + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Extended version of Mage_Archive_Tar that supports filtering + * + * @category Mage + * @package Mage_Backup + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Backup_Archive_Tar extends Mage_Archive_Tar +{ + /** + * Filenames or filename parts that are used for filtering files + * + * @var array() + */ + protected $_skipFiles = array(); + + /** + * Overridden Mage_Archive_Tar::_createTar method that does the same actions as it's parent but filters + * files using Mage_Backup_Filesystem_Iterator_Filter + * + * @see Mage_Archive_Tar::_createTar() + * @param bool $skipRoot + * @param bool $finalize + */ + protected function _createTar($skipRoot = false, $finalize = false) + { + $path = $this->_getCurrentFile(); + + $filesystemIterator = new RecursiveIteratorIterator( + new RecursiveDirectoryIterator($path), RecursiveIteratorIterator::SELF_FIRST + ); + + $iterator = new Mage_Backup_Filesystem_Iterator_Filter($filesystemIterator, $this->_skipFiles); + + foreach ($iterator as $item) { + $this->_setCurrentFile($item->getPathname()); + $this->_packAndWriteCurrentFile(); + } + + if ($finalize) { + $this->_getWriter()->write(str_repeat("\0", self::TAR_BLOCK_SIZE * 12)); + } + } + + /** + * Set files that shouldn't be added to tarball + * + * @param array $skipFiles + * @return Mage_Backup_Archive_Tar + */ + public function setSkipFiles(array $skipFiles) + { + $this->_skipFiles = $skipFiles; + return $this; + } +} diff --git a/downloader/lib/Mage/Backup/Db.php b/downloader/lib/Mage/Backup/Db.php new file mode 100755 index 0000000000000000000000000000000000000000..17912345396e1e8c590433df233d2387d78853ab --- /dev/null +++ b/downloader/lib/Mage/Backup/Db.php @@ -0,0 +1,129 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Backup + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Class to work with database backups + * + * @category Mage + * @package Mage_Backup + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Backup_Db extends Mage_Backup_Abstract +{ + /** + * Implementation Rollback functionality for Db + * + * @return bool + */ + public function rollback() + { + set_time_limit(0); + ignore_user_abort(true); + + $this->_lastOperationSucceed = false; + + $archiveManager = new Mage_Archive(); + $source = $archiveManager->unpack($this->getBackupPath(), $this->getBackupsDir()); + + $this->getResourceModel()->beginTransaction(); + + $file = fopen($source, "r"); + $query = ''; + while(!feof($file)) { + $line = fgets($file); + $query .= $line; + if ($this->_isLineLastInCommand($line)){ + $this->getResourceModel()->runCommand($query); + $query = ''; + } + } + fclose($file); + $this->getResourceModel()->commitTransaction(); + @unlink($source); + + $this->_lastOperationSucceed = true; + + return true; + } + + /** + * Check is line a last in sql command + * + * @param $line + * @return bool + */ + protected function _isLineLastInCommand($line) + { + $cleanLine = trim($line); + $lineLength = strlen($cleanLine); + + $returnResult = false; + if ($lineLength > 0){ + $lastSymbolIndex = $lineLength-1; + if ($cleanLine[$lastSymbolIndex] == ';'){ + $returnResult = true; + } + } + + return $returnResult; + } + + /** + * Implementation Create Backup functionality for Db + * + * @return boolean + */ + public function create() + { + set_time_limit(0); + ignore_user_abort(true); + + $this->_lastOperationSucceed = false; + + $backup = Mage::getModel('Mage_Backup_Model_Backup') + ->setTime($this->getTime()) + ->setType($this->getType()) + ->setPath($this->getBackupsDir()) + ->setName($this->getName()); + + $backupDb = Mage::getModel('Mage_Backup_Model_Db'); + $backupDb->createBackup($backup); + + $this->_lastOperationSucceed = true; + + return true; + } + + /** + * Get Backup Type + * + * @return string + */ + public function getType() + { + return "db"; + } +} diff --git a/downloader/lib/Mage/Backup/Exception.php b/downloader/lib/Mage/Backup/Exception.php new file mode 100755 index 0000000000000000000000000000000000000000..c92f1346347e1175d9bd9d50ea0e349a9324e373 --- /dev/null +++ b/downloader/lib/Mage/Backup/Exception.php @@ -0,0 +1,36 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Backup + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Exception + * + * @category Mage + * @package Mage_Backup + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Backup_Exception extends Mage_Exception +{ +} diff --git a/downloader/lib/Mage/Backup/Exception/CantLoadSnapshot.php b/downloader/lib/Mage/Backup/Exception/CantLoadSnapshot.php new file mode 100755 index 0000000000000000000000000000000000000000..98ed8f6f19106485ca5e1cf14f790403c5c2eb53 --- /dev/null +++ b/downloader/lib/Mage/Backup/Exception/CantLoadSnapshot.php @@ -0,0 +1,36 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Backup + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Exception + * + * @category Mage + * @package Mage_Backup + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Backup_Exception_CantLoadSnapshot extends Mage_Backup_Exception +{ +} diff --git a/downloader/lib/Mage/Backup/Exception/FtpConnectionFailed.php b/downloader/lib/Mage/Backup/Exception/FtpConnectionFailed.php new file mode 100755 index 0000000000000000000000000000000000000000..cd6aa9b6905a99ac5e2460b52c874267b627c131 --- /dev/null +++ b/downloader/lib/Mage/Backup/Exception/FtpConnectionFailed.php @@ -0,0 +1,36 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Backup + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Exception + * + * @category Mage + * @package Mage_Backup + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Backup_Exception_FtpConnectionFailed extends Mage_Backup_Exception +{ +} diff --git a/downloader/lib/Mage/Backup/Exception/FtpValidationFailed.php b/downloader/lib/Mage/Backup/Exception/FtpValidationFailed.php new file mode 100755 index 0000000000000000000000000000000000000000..acc4c9e72a805b8f348bdb07f1cc28f6623a9502 --- /dev/null +++ b/downloader/lib/Mage/Backup/Exception/FtpValidationFailed.php @@ -0,0 +1,36 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Backup + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Exception + * + * @category Mage + * @package Mage_Backup + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Backup_Exception_FtpValidationFailed extends Mage_Backup_Exception +{ +} diff --git a/downloader/lib/Mage/Backup/Exception/NotEnoughFreeSpace.php b/downloader/lib/Mage/Backup/Exception/NotEnoughFreeSpace.php new file mode 100755 index 0000000000000000000000000000000000000000..21e56a199112ba84c6a25d1f43767d8c2d586d19 --- /dev/null +++ b/downloader/lib/Mage/Backup/Exception/NotEnoughFreeSpace.php @@ -0,0 +1,36 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Backup + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Exception + * + * @category Mage + * @package Mage_Backup + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Backup_Exception_NotEnoughFreeSpace extends Mage_Backup_Exception +{ +} diff --git a/downloader/lib/Mage/Backup/Exception/NotEnoughPermissions.php b/downloader/lib/Mage/Backup/Exception/NotEnoughPermissions.php new file mode 100755 index 0000000000000000000000000000000000000000..001d1a907aa480fdc10ea9e68b5adced59c695e1 --- /dev/null +++ b/downloader/lib/Mage/Backup/Exception/NotEnoughPermissions.php @@ -0,0 +1,36 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Backup + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Exception + * + * @category Mage + * @package Mage_Backup + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Backup_Exception_NotEnoughPermissions extends Mage_Backup_Exception +{ +} diff --git a/downloader/lib/Mage/Backup/Filesystem.php b/downloader/lib/Mage/Backup/Filesystem.php new file mode 100755 index 0000000000000000000000000000000000000000..b366f762b03bf623c42df29f7aac56b744631111 --- /dev/null +++ b/downloader/lib/Mage/Backup/Filesystem.php @@ -0,0 +1,283 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Backup + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +/** + * Class to work with filesystem backups + * + * @category Mage + * @package Mage_Backup + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Backup_Filesystem extends Mage_Backup_Abstract +{ + /** + * Paths that ignored when creating or rolling back snapshot + * + * @var array + */ + protected $_ignorePaths = array(); + + /** + * Whether use ftp account for rollback procedure + * + * @var bool + */ + protected $_useFtp = false; + + /** + * Ftp host + * + * @var string + */ + protected $_ftpHost; + + /** + * Ftp username + * + * @var string + */ + protected $_ftpUser; + + /** + * Password to ftp account + * + * @var string + */ + protected $_ftpPass; + + /** + * Ftp path to Magento installation + * + * @var string + */ + protected $_ftpPath; + + /** + * Implementation Rollback functionality for Filesystem + * + * @throws Mage_Exception + * @return bool + */ + public function rollback() + { + $this->_lastOperationSucceed = false; + + set_time_limit(0); + ignore_user_abort(true); + + $rollbackWorker = $this->_useFtp ? new Mage_Backup_Filesystem_Rollback_Ftp($this) + : new Mage_Backup_Filesystem_Rollback_Fs($this); + $rollbackWorker->run(); + + $this->_lastOperationSucceed = true; + } + + /** + * Implementation Create Backup functionality for Filesystem + * + * @throws Mage_Exception + * @return boolean + */ + public function create() + { + set_time_limit(0); + ignore_user_abort(true); + + $this->_lastOperationSucceed = false; + + $this->_checkBackupsDir(); + + $fsHelper = new Mage_Backup_Filesystem_Helper(); + + $filesInfo = $fsHelper->getInfo( + $this->getRootDir(), + Mage_Backup_Filesystem_Helper::INFO_READABLE | Mage_Backup_Filesystem_Helper::INFO_SIZE, + $this->getIgnorePaths() + ); + + if (!$filesInfo['readable']) { + throw new Mage_Backup_Exception_NotEnoughPermissions('Not enough permissions to read files for backup'); + } + + $freeSpace = disk_free_space($this->getBackupsDir()); + + if (2 * $filesInfo['size'] > $freeSpace) { + throw new Mage_Backup_Exception_NotEnoughFreeSpace('Not enough free space to create backup'); + } + + $tarTmpPath = $this->_getTarTmpPath(); + + $tarPacker = new Mage_Backup_Archive_Tar(); + $tarPacker->setSkipFiles($this->getIgnorePaths()) + ->pack($this->getRootDir(), $tarTmpPath, true); + + if (!is_file($tarTmpPath) || filesize($tarTmpPath) == 0) { + throw new Mage_Exception('Failed to create backup'); + } + + $backupPath = $this->getBackupPath(); + + $gzPacker = new Mage_Archive_Gz(); + $gzPacker->pack($tarTmpPath, $backupPath); + + if (!is_file($backupPath) || filesize($backupPath) == 0) { + throw new Mage_Exception('Failed to create backup'); + } + + @unlink($tarTmpPath); + + $this->_lastOperationSucceed = true; + } + + /** + * Force class to use ftp for rollback procedure + * + * @param string $host + * @param string $username + * @param string $password + * @param string $path + * @return Mage_Backup_Filesystem + */ + public function setUseFtp($host, $username, $password, $path) + { + $this->_useFtp = true; + $this->_ftpHost = $host; + $this->_ftpUser = $username; + $this->_ftpPass = $password; + $this->_ftpPath = $path; + return $this; + } + + /** + * Get backup type + * + * @see Mage_Backup_Interface::getType() + * @return string + */ + public function getType() + { + return 'filesystem'; + } + + /** + * Add path that should be ignoring when creating or rolling back backup + * + * @param string|array $paths + * @return Mage_Backup_Filesystem + */ + public function addIgnorePaths($paths) + { + if (is_string($paths)) { + if (!in_array($paths, $this->_ignorePaths)) { + $this->_ignorePaths[] = $paths; + } + } + else if (is_array($paths)) { + foreach ($paths as $path) { + $this->addIgnorePaths($path); + } + } + + return $this; + } + + /** + * Get paths that should be ignored while creating or rolling back backup procedure + * + * @return array + */ + public function getIgnorePaths() + { + return $this->_ignorePaths; + } + + /** + * Set directory where backups saved and add it to ignore paths + * + * @see Mage_Backup_Abstract::setBackupsDir() + * @param string $backupsDir + * @return Mage_Backup_Filesystem + */ + public function setBackupsDir($backupsDir) + { + parent::setBackupsDir($backupsDir); + $this->addIgnorePaths($backupsDir); + return $this; + } + + /** + * getter for $_ftpPath variable + * + * @return string + */ + public function getFtpPath() + { + return $this->_ftpPath; + } + + /** + * Get ftp connection string + * + * @return string + */ + public function getFtpConnectString() + { + return 'ftp://' . $this->_ftpUser . ':' . $this->_ftpPass . '@' . $this->_ftpHost . $this->_ftpPath; + } + + /** + * Check backups directory existance and whether it's writeable + * + * @throws Mage_Exception + */ + protected function _checkBackupsDir() + { + $backupsDir = $this->getBackupsDir(); + + if (!is_dir($backupsDir)) { + $backupsDirParentDirectory = basename($backupsDir); + + if (!is_writeable($backupsDirParentDirectory)) { + throw new Mage_Backup_Exception_NotEnoughPermissions('Cant create backups directory'); + } + + mkdir($backupsDir); + chmod($backupsDir, 0777); + } + + if (!is_writable($backupsDir)) { + throw new Mage_Backup_Exception_NotEnoughPermissions('Backups directory is not writeable'); + } + } + + /** + * Generate tmp name for tarball + */ + protected function _getTarTmpPath() + { + $tmpName = '~tmp-'. microtime(true) . '.tar'; + return $this->getBackupsDir() . DS . $tmpName; + } +} diff --git a/downloader/lib/Mage/Backup/Filesystem/Helper.php b/downloader/lib/Mage/Backup/Filesystem/Helper.php new file mode 100755 index 0000000000000000000000000000000000000000..c62c4a0adf7976de9d8e62bece63114bad3663d5 --- /dev/null +++ b/downloader/lib/Mage/Backup/Filesystem/Helper.php @@ -0,0 +1,137 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Backup + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Filesystem helper for Mage_Backup library + * + * @category Mage + * @package Mage_Backup + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Backup_Filesystem_Helper +{ + /** + * Constant can be used in getInfo() function as second parameter. + * Check whether directory and all files/sub directories are writable + * + * @const int + */ + const INFO_WRITABLE = 1; + + /** + * Constant can be used in getInfo() function as second parameter. + * Check whether directory and all files/sub directories are readable + * + * @const int + */ + const INFO_READABLE = 2; + + /** + * Constant can be used in getInfo() function as second parameter. + * Get directory size + * + * @const int + */ + const INFO_SIZE = 4; + + /** + * Constant can be used in getInfo() function as second parameter. + * Combination of INFO_WRITABLE, INFO_READABLE, INFO_SIZE + * + * @const int + */ + const INFO_ALL = 7; + + /** + * Recursively delete $path + * + * @param string $path + * @param array $skipPaths + * @param bool $removeRoot + * @throws Mage_Exception + */ + public function rm($path, $skipPaths = array(), $removeRoot = false) + { + $filesystemIterator = new RecursiveIteratorIterator( + new RecursiveDirectoryIterator($path), RecursiveIteratorIterator::CHILD_FIRST + ); + + $iterator = new Mage_Backup_Filesystem_Iterator_Filter($filesystemIterator, $skipPaths); + + foreach ($iterator as $item) { + $item->isDir() ? @rmdir($item->__toString()) : @unlink($item->__toString()); + } + + if ($removeRoot && is_dir($path)) { + @rmdir($path); + } + } + + /** + * Get information (readable, writable, size) about $path + * + * @param string $path + * @param int $infoOptions + * @param array $skipFiles + */ + public function getInfo($path, $infoOptions = self::INFO_ALL, $skipFiles = array()) + { + $info = array(); + if ($infoOptions & self::INFO_READABLE) { + $info['readable'] = true; + } + + if ($infoOptions & self::INFO_WRITABLE) { + $info['writable'] = true; + } + + if ($infoOptions & self::INFO_SIZE) { + $info['size'] = 0; + } + + $filesystemIterator = new RecursiveIteratorIterator( + new RecursiveDirectoryIterator($path), RecursiveIteratorIterator::CHILD_FIRST + ); + + $iterator = new Mage_Backup_Filesystem_Iterator_Filter($filesystemIterator, $skipFiles); + + foreach ($iterator as $item) { + if (($infoOptions & self::INFO_WRITABLE) && !$item->isWritable()) { + $info['writable'] = false; + } + + if (($infoOptions & self::INFO_READABLE) && !$item->isReadable()) { + $info['readable'] = false; + } + + if ($infoOptions & self::INFO_SIZE && !$item->isDir()) { + $info['size'] += $item->getSize(); + } + } + + return $info; + } +} diff --git a/downloader/lib/Mage/Backup/Filesystem/Iterator/Filter.php b/downloader/lib/Mage/Backup/Filesystem/Iterator/Filter.php new file mode 100755 index 0000000000000000000000000000000000000000..40ae6f053bab7f1f440f379bc42479a541d11844 --- /dev/null +++ b/downloader/lib/Mage/Backup/Filesystem/Iterator/Filter.php @@ -0,0 +1,77 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Backup + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Filter Iterator + * + * @category Mage + * @package Mage_Backup + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Backup_Filesystem_Iterator_Filter extends FilterIterator +{ + /** + * Array that is used for filtering + * + * @var array + */ + protected $_filters; + + /** + * Constructor + * + * @param Iterator $iterator + * @param array $skipFiles + */ + public function __construct(Iterator $iterator, array $filters) + { + parent::__construct($iterator); + $this->_filters = $filters; + } + + /** + * Check whether the current element of the iterator is acceptable + * + * @return bool + */ + public function accept() + { + $current = $this->current()->__toString(); + $currentFilename = $this->current()->getFilename(); + + if ($currentFilename == '.' || $currentFilename == '..') { + return false; + } + + foreach ($this->_filters as $filter) { + if (false !== strpos($current, $filter)) { + return false; + } + } + + return true; + } +} diff --git a/downloader/lib/Mage/Backup/Filesystem/Rollback/Abstract.php b/downloader/lib/Mage/Backup/Filesystem/Rollback/Abstract.php new file mode 100755 index 0000000000000000000000000000000000000000..134b5fdb698c1cc94812acc04c3be5eb55da0114 --- /dev/null +++ b/downloader/lib/Mage/Backup/Filesystem/Rollback/Abstract.php @@ -0,0 +1,57 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Backup + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Filesystem rollback workers abstract class + * + * @category Mage + * @package Mage_Backup + * @author Magento Core Team <core@magentocommerce.com> + */ +abstract class Mage_Backup_Filesystem_Rollback_Abstract +{ + /** + * Snapshot object + * + * @var Mage_Backup_Filesystem + */ + protected $_snapshot; + + /** + * Default worker constructor + * + * @param Mage_Backup_Filesystem $snapshotObject + */ + public function __construct(Mage_Backup_Filesystem $snapshotObject) + { + $this->_snapshot = $snapshotObject; + } + + /** + * Main worker's function that makes files rollback + */ + abstract public function run(); +} diff --git a/downloader/lib/Mage/Backup/Filesystem/Rollback/Fs.php b/downloader/lib/Mage/Backup/Filesystem/Rollback/Fs.php new file mode 100755 index 0000000000000000000000000000000000000000..a98b89e687b0564c83c6accef53491dafe8a3f52 --- /dev/null +++ b/downloader/lib/Mage/Backup/Filesystem/Rollback/Fs.php @@ -0,0 +1,78 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Backup + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Rollback worker for rolling back via local filesystem + * + * @category Mage + * @package Mage_Backup + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Backup_Filesystem_Rollback_Fs extends Mage_Backup_Filesystem_Rollback_Abstract +{ + /** + * Files rollback implementation via local filesystem + * + * @see Mage_Backup_Filesystem_Rollback_Abstract::run() + * @throws Mage_Exception + */ + public function run() + { + $snapshotPath = $this->_snapshot->getBackupPath(); + + if (!is_file($snapshotPath) || !is_readable($snapshotPath)) { + throw new Mage_Backup_Exception_CantLoadSnapshot('Cant load snapshot archive'); + } + + $fsHelper = new Mage_Backup_Filesystem_Helper(); + + $filesInfo = $fsHelper->getInfo( + $this->_snapshot->getRootDir(), + Mage_Backup_Filesystem_Helper::INFO_WRITABLE, + $this->_snapshot->getIgnorePaths() + ); + + if (!$filesInfo['writable']) { + throw new Mage_Backup_Exception_NotEnoughPermissions( + 'Unable to make rollback because not all files are writable' + ); + } + + $archiver = new Mage_Archive(); + + /** + * we need these fake initializations because all magento's files in filesystem will be deleted and autoloader + * wont be able to load classes that we need for unpacking + */ + new Mage_Archive_Tar(); + new Mage_Archive_Gz(); + new Mage_Archive_Helper_File(''); + new Mage_Archive_Helper_File_Gz(''); + + $fsHelper->rm($this->_snapshot->getRootDir(), $this->_snapshot->getIgnorePaths()); + $archiver->unpack($snapshotPath, $this->_snapshot->getRootDir()); + } +} diff --git a/downloader/lib/Mage/Backup/Filesystem/Rollback/Ftp.php b/downloader/lib/Mage/Backup/Filesystem/Rollback/Ftp.php new file mode 100755 index 0000000000000000000000000000000000000000..5a1806742c20b5209d609ad9d83f28b1e6b97061 --- /dev/null +++ b/downloader/lib/Mage/Backup/Filesystem/Rollback/Ftp.php @@ -0,0 +1,194 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Backup + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Rollback worker for rolling back via ftp + * + * @category Mage + * @package Mage_Backup + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Backup_Filesystem_Rollback_Ftp extends Mage_Backup_Filesystem_Rollback_Abstract +{ + /** + * Ftp client + * + * @var Mage_System_Ftp + */ + protected $_ftpClient; + + /** + * Files rollback implementation via ftp + * + * @see Mage_Backup_Filesystem_Rollback_Abstract::run() + * @throws Mage_Exception + */ + public function run() + { + $snapshotPath = $this->_snapshot->getBackupPath(); + + if (!is_file($snapshotPath) || !is_readable($snapshotPath)) { + throw new Mage_Backup_Exception_CantLoadSnapshot('Cant load snapshot archive'); + } + + $this->_initFtpClient(); + $this->_validateFtp(); + + $tmpDir = $this->_createTmpDir(); + $this->_unpackSnapshot($tmpDir); + + $fsHelper = new Mage_Backup_Filesystem_Helper(); + + $this->_cleanupFtp(); + $this->_uploadBackupToFtp($tmpDir); + + $fsHelper->rm($tmpDir, array(), true); + } + + /** + * Initialize ftp client and connect to ftp + * + * @throws Mage_Backup_Exception_FtpConnectionFailed + */ + protected function _initFtpClient() + { + try { + $this->_ftpClient = new Mage_System_Ftp(); + $this->_ftpClient->connect($this->_snapshot->getFtpConnectString()); + } catch (Exception $e) { + throw new Mage_Backup_Exception_FtpConnectionFailed($e->getMessage()); + } + } + + /** + * Perform ftp validation. Check whether ftp account provided points to current magento installation + * + * @throws Mage_Exception + */ + protected function _validateFtp() + { + $validationFilename = '~validation-' . microtime(true) . '.tmp'; + $validationFilePath = $this->_snapshot->getBackupsDir() . DS . $validationFilename; + + $fh = @fopen($validationFilePath, 'w'); + @fclose($fh); + + if (!is_file($validationFilePath)) { + throw new Mage_Exception('Unable to validate ftp account'); + } + + $rootDir = $this->_snapshot->getRootDir(); + $ftpPath = $this->_snapshot->getFtpPath() . DS . str_replace($rootDir, '', $validationFilePath); + + $fileExistsOnFtp = $this->_ftpClient->fileExists($ftpPath); + @unlink($validationFilePath); + + if (!$fileExistsOnFtp) { + throw new Mage_Backup_Exception_FtpValidationFailed('Failed to validate ftp account'); + } + } + + /** + * Unpack snapshot + * + * @param string $tmpDir + */ + protected function _unpackSnapshot($tmpDir) + { + $snapshotPath = $this->_snapshot->getBackupPath(); + + $archiver = new Mage_Archive(); + $archiver->unpack($snapshotPath, $tmpDir); + } + + /** + * @throws Mage_Exception + * @return string + */ + protected function _createTmpDir() + { + $tmpDir = $this->_snapshot->getBackupsDir() . DS . '~tmp-' . microtime(true); + + $result = @mkdir($tmpDir); + + if (false === $result) { + throw new Mage_Backup_Exception_NotEnoughPermissions('Failed to create directory ' . $tmpDir); + } + + return $tmpDir; + } + + /** + * Delete magento and all files from ftp + */ + protected function _cleanupFtp() + { + $rootDir = $this->_snapshot->getRootDir(); + + $filesystemIterator = new RecursiveIteratorIterator( + new RecursiveDirectoryIterator($rootDir), RecursiveIteratorIterator::CHILD_FIRST + ); + + $iterator = new Mage_Backup_Filesystem_Iterator_Filter($filesystemIterator, $this->_snapshot->getIgnorePaths()); + + foreach ($iterator as $item) { + $ftpPath = $this->_snapshot->getFtpPath() . DS . str_replace($rootDir, '', $item->__toString()); + $ftpPath = str_replace(DS, '/', $ftpPath); + + $this->_ftpClient->delete($ftpPath); + } + } + + /** + * Perform files rollback + * + * @param string $tmpDir + * @throws Mage_Exception + */ + protected function _uploadBackupToFtp($tmpDir) + { + $filesystemIterator = new RecursiveIteratorIterator( + new RecursiveDirectoryIterator($tmpDir), RecursiveIteratorIterator::SELF_FIRST + ); + + $iterator = new Mage_Backup_Filesystem_Iterator_Filter($filesystemIterator, $this->_snapshot->getIgnorePaths()); + + foreach ($filesystemIterator as $item) { + $ftpPath = $this->_snapshot->getFtpPath() . DS . str_replace($tmpDir, '', $item->__toString()); + $ftpPath = str_replace(DS, '/', $ftpPath); + + if ($item->isDir()) { + $this->_ftpClient->mkdirRecursive($ftpPath); + } else { + $result = $this->_ftpClient->put($ftpPath, $item->__toString()); + if (false === $result) { + throw new Mage_Backup_Exception_NotEnoughPermissions('Failed to upload file ' + . $item->__toString() . ' to ftp'); + } + } + } + } +} diff --git a/downloader/lib/Mage/Backup/Interface.php b/downloader/lib/Mage/Backup/Interface.php new file mode 100755 index 0000000000000000000000000000000000000000..46cf6eeaac7f36bbfde9711d3ba37bde7c885740 --- /dev/null +++ b/downloader/lib/Mage/Backup/Interface.php @@ -0,0 +1,88 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Backup + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Interface for work with archives + * + * @category Mage + * @package Mage_Backup + * @author Magento Core Team <core@magentocommerce.com> + */ +interface Mage_Backup_Interface +{ + /** + * Create Backup + * + * @return boolean + */ + public function create(); + + /** + * Rollback Backup + * + * @return boolean + */ + public function rollback(); + + /** + * Set Backup Extension + * + * @param string $backupExtension + * @return Mage_Backup_Interface + */ + public function setBackupExtension($backupExtension); + + /** + * Set Resource Model + * + * @param object $resourceModel + * @return Mage_Backup_Interface + */ + public function setResourceModel($resourceModel); + + /** + * Set Time + * + * @param int $time + * @return Mage_Backup_Interface + */ + public function setTime($time); + + /** + * Get Backup Type + * + * @return string + */ + public function getType(); + + /** + * Set path to directory where backups stored + * + * @param string $backupsDir + * @return Mage_Backup_Interface + */ + public function setBackupsDir($backupsDir); +} diff --git a/downloader/lib/Mage/Backup/Media.php b/downloader/lib/Mage/Backup/Media.php new file mode 100644 index 0000000000000000000000000000000000000000..a6014d44c8025f68ee4e14a6305baefcdf3511e5 --- /dev/null +++ b/downloader/lib/Mage/Backup/Media.php @@ -0,0 +1,99 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Backup + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Class to work media folder and database backups + * + * @category Mage + * @package Mage_Backup + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Backup_Media extends Mage_Backup_Snapshot +{ + /** + * Implementation Rollback functionality for Snapshot + * + * @throws Mage_Exception + * @return bool + */ + public function rollback() + { + $this->_prepareIgnoreList(); + return parent::rollback(); + } + + /** + * Implementation Create Backup functionality for Snapshot + * + * @throws Mage_Exception + * @return bool + */ + public function create() + { + $this->_prepareIgnoreList(); + return parent::create(); + } + + /** + * Overlap getType + * + * @return string + * @see Mage_Backup_Interface::getType() + */ + public function getType() + { + return 'media'; + } + + /** + * Add all folders and files except media and db backup to ignore list + * + * @return Mage_Backup_Media + */ + protected function _prepareIgnoreList() + { + $iterator = new DirectoryIterator($this->getRootDir()); + + foreach ($iterator as $item) { + $filename = $item->getFilename(); + if (!in_array($filename, array('media', 'var'))) { + $this->addIgnorePaths($item->getPathname()); + } + } + + $iterator = new DirectoryIterator($this->getRootDir() . DS . 'var'); + $dbBackupFilename = $this->_getDbBackupManager()->getBackupFilename(); + + foreach ($iterator as $item) { + $filename = $item->getFilename(); + if ($filename != $dbBackupFilename) { + $this->addIgnorePaths($item->getPathname()); + } + } + + return $this; + } +} diff --git a/downloader/lib/Mage/Backup/Nomedia.php b/downloader/lib/Mage/Backup/Nomedia.php new file mode 100755 index 0000000000000000000000000000000000000000..81c48565603ef5b5b6e3a3fffc3bfa76828f399d --- /dev/null +++ b/downloader/lib/Mage/Backup/Nomedia.php @@ -0,0 +1,82 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Backup + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Class to work system backup that excludes media folder + * + * @category Mage + * @package Mage_Backup + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Backup_Nomedia extends Mage_Backup_Snapshot +{ + /** + * Implementation Rollback functionality for Snapshot + * + * @throws Mage_Exception + * @return bool + */ + public function rollback() + { + $this->_prepareIgnoreList(); + return parent::rollback(); + } + + /** + * Implementation Create Backup functionality for Snapshot + * + * @throws Mage_Exception + * @return bool + */ + public function create() + { + $this->_prepareIgnoreList(); + return parent::create(); + } + + /** + * Overlap getType + * + * @return string + * @see Mage_Backup_Interface::getType() + */ + public function getType() + { + return 'nomedia'; + } + + /** + * Add media folder to ignore list + * + * @return Mage_Backup_Media + */ + protected function _prepareIgnoreList() + { + $this->addIgnorePaths($this->getRootDir() . DS . 'media'); + + return $this; + } +} \ No newline at end of file diff --git a/downloader/lib/Mage/Backup/Snapshot.php b/downloader/lib/Mage/Backup/Snapshot.php new file mode 100755 index 0000000000000000000000000000000000000000..8b539b791b8ec280b1e6937992cbee38ae09583d --- /dev/null +++ b/downloader/lib/Mage/Backup/Snapshot.php @@ -0,0 +1,140 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Backup + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Class to work with full filesystem and database backups + * + * @category Mage + * @package Mage_Backup + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Backup_Snapshot extends Mage_Backup_Filesystem +{ + /** + * Database backup manager + * + * @var Mage_Backup_Db + */ + protected $_dbBackupManager; + + /** + * Implementation Rollback functionality for Snapshot + * + * @throws Mage_Exception + * @return bool + */ + public function rollback() + { + $result = parent::rollback(); + + $this->_lastOperationSucceed = false; + + try { + $this->_getDbBackupManager()->rollback(); + } catch (Exception $e) { + $this->_removeDbBackup(); + throw $e; + } + + $this->_removeDbBackup(); + $this->_lastOperationSucceed = true; + + return $result; + } + + /** + * Implementation Create Backup functionality for Snapshot + * + * @throws Mage_Exception + * @return bool + */ + public function create() + { + $this->_getDbBackupManager()->create(); + + try { + $result = parent::create(); + } catch (Exception $e) { + $this->_removeDbBackup(); + throw $e; + } + + $this->_lastOperationSucceed = false; + $this->_removeDbBackup(); + $this->_lastOperationSucceed = true; + + return $result; + } + + /** + * Overlap getType + * + * @return string + * @see Mage_Backup_Interface::getType() + */ + public function getType() + { + return 'snapshot'; + } + + /** + * Create Db Instance + * + * @return Mage_Backup_Interface + */ + protected function _createDbBackupInstance() + { + return Mage_Backup::getBackupInstance(Mage_Backup_Helper_Data::TYPE_DB) + ->setBackupExtension(Mage::helper('Mage_Backup_Helper_Data')->getExtensionByType(Mage_Backup_Helper_Data::TYPE_DB)) + ->setTime($this->getTime()) + ->setBackupsDir(Mage::getBaseDir("var")) + ->setResourceModel($this->getResourceModel()); + } + + /** + * Get database backup manager + * + * @return Mage_Backup_Db + */ + protected function _getDbBackupManager() + { + if (is_null($this->_dbBackupManager)) { + $this->_dbBackupManager = $this->_createDbBackupInstance(); + } + + return $this->_dbBackupManager; + } + + /** + * Remove Db backup after added it to the snapshot + * + * @return Mage_Backup_Snapshot + */ + protected function _removeDbBackup(){ + @unlink($this->_getDbBackupManager()->getBackupPath()); + return $this; + } +} diff --git a/downloader/lib/Mage/Connect/Channel/Generator.php b/downloader/lib/Mage/Connect/Channel/Generator.php index 73563fc62d87217c5abb1e54b5af73efd5a7eaa0..8870dc046e88144fac4670532bb95891e73a0643 100644 --- a/downloader/lib/Mage/Connect/Channel/Generator.php +++ b/downloader/lib/Mage/Connect/Channel/Generator.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/downloader/lib/Mage/Connect/Channel/Parser.php b/downloader/lib/Mage/Connect/Channel/Parser.php index f9e05c347ecde227215066a08939483706eeafd7..faa86fc9582c77a6ee606350244520be2959652d 100644 --- a/downloader/lib/Mage/Connect/Channel/Parser.php +++ b/downloader/lib/Mage/Connect/Channel/Parser.php @@ -20,6 +20,6 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/downloader/lib/Mage/Connect/Channel/VO.php b/downloader/lib/Mage/Connect/Channel/VO.php index 165ea6ee70ea66080b64d5019068b77318a7398f..9ad4160b2667b25cff58e74c5d0578ff0bec3ff9 100644 --- a/downloader/lib/Mage/Connect/Channel/VO.php +++ b/downloader/lib/Mage/Connect/Channel/VO.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/downloader/lib/Mage/Connect/Command.php b/downloader/lib/Mage/Connect/Command.php index e8090ecc38d24aed60e9baa79fa1aae99a3b2d96..191fb2e605b094ebbca0f64837b1c009847d4924 100644 --- a/downloader/lib/Mage/Connect/Command.php +++ b/downloader/lib/Mage/Connect/Command.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/downloader/lib/Mage/Connect/Command/Channels.php b/downloader/lib/Mage/Connect/Command/Channels.php index 483a85599255ac77d9eb32d3c1418eb3404ae050..1ed6edfea9c57de22ad6f38adf55e568fc2903f5 100644 --- a/downloader/lib/Mage/Connect/Command/Channels.php +++ b/downloader/lib/Mage/Connect/Command/Channels.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/downloader/lib/Mage/Connect/Command/Channels_Header.php b/downloader/lib/Mage/Connect/Command/Channels_Header.php index dba6b6bec3f7a92cf4d37824b896bdf7536a02fa..69d03141239e4a4edf4fbb4ea7b1568d8aaf839d 100644 --- a/downloader/lib/Mage/Connect/Command/Channels_Header.php +++ b/downloader/lib/Mage/Connect/Command/Channels_Header.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/downloader/lib/Mage/Connect/Command/Config.php b/downloader/lib/Mage/Connect/Command/Config.php index f7023e1323ac029b77506d4119f0a271d2bc775f..2f4972c8d749372d1e90090f37bee4ef137215b1 100644 --- a/downloader/lib/Mage/Connect/Command/Config.php +++ b/downloader/lib/Mage/Connect/Command/Config.php @@ -20,19 +20,26 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - -class Mage_Connect_Command_Config -extends Mage_Connect_Command - +/** + * Configuration command callbacks + * + * @throws Exception + * @category Mage + * @package Mage_Connect + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Connect_Command_Config extends Mage_Connect_Command { + /** + * Parameters constants + */ const PARAM_KEY = 0; const PARAM_VAL = 1; - /** * Show config variable * @param string $command @@ -70,7 +77,6 @@ extends Mage_Connect_Command } } - /** * Set config variable * @param string $command @@ -207,7 +213,4 @@ extends Mage_Connect_Command return $this->doError($command, $e->getMessage()); } } - } - - diff --git a/downloader/lib/Mage/Connect/Command/Config_Header.php b/downloader/lib/Mage/Connect/Command/Config_Header.php index c812b30079e5ca0009fa1fd5a4b16f1a25351af1..c763068dca1b3eda80ddccc0765ab83aceed5dfa 100644 --- a/downloader/lib/Mage/Connect/Command/Config_Header.php +++ b/downloader/lib/Mage/Connect/Command/Config_Header.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/downloader/lib/Mage/Connect/Command/Install.php b/downloader/lib/Mage/Connect/Command/Install.php index 4253781bf88e4dc65489553f9e482fde7aea10d9..bfaf88acd872aa3927db324b0df495a8c71afb7c 100644 --- a/downloader/lib/Mage/Connect/Command/Install.php +++ b/downloader/lib/Mage/Connect/Command/Install.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ final class Mage_Connect_Command_Install extends Mage_Connect_Command @@ -28,9 +28,11 @@ final class Mage_Connect_Command_Install extends Mage_Connect_Command /** * Install action callback * + * @throws Exception * @param string $command * @param array $options * @param array $params + * @param array $objects * @return array|null */ public function doInstall($command, $options, $params, $objects = array()) @@ -46,7 +48,7 @@ final class Mage_Connect_Command_Install extends Mage_Connect_Command $packager = $this->getPackager(); /** @var $cache Mage_Connect_Singleconfig */ /** @var $config Mage_Connect_Config */ - if($ftp) { + if ($ftp) { list($cache, $config, $ftpObj) = $packager->getRemoteConf($ftp); } else { $cache = $this->getSconfig(); @@ -65,7 +67,7 @@ final class Mage_Connect_Command_Install extends Mage_Connect_Command $channelAuth = isset($options['auth'])?$options['auth']:array(); $rest = $this->rest(); - if(empty($config->magento_root)){ + if (empty($config->magento_root)) { $config->magento_root=dirname(dirname($_SERVER['SCRIPT_FILENAME'])); } chdir($config->magento_root); @@ -74,7 +76,7 @@ final class Mage_Connect_Command_Install extends Mage_Connect_Command $dirTmp = DIRECTORY_SEPARATOR . Mage_Connect_Package_Reader::PATH_TO_TEMPORARY_DIRECTORY; $dirMedia = DIRECTORY_SEPARATOR . 'media'; $isWritable = true; - if($ftp) { + if ($ftp) { $cwd=$ftpObj->getcwd(); $ftpObj->mkdirRecursive($cwd . $dirCache,0777); $ftpObj->chdir($cwd); @@ -97,25 +99,25 @@ final class Mage_Connect_Command_Install extends Mage_Connect_Command $isWritable = $isWritable && is_writable($config->magento_root . $dirMedia) && is_writable($config->magento_root . $dirCache) && is_writable($config->magento_root . $dirTmp); - if(!$isWritable){ + if (!$isWritable) { $this->doError($command, $err); throw new Exception( 'Your Magento folder does not have sufficient write permissions, which downloader requires.' ); } - if(!empty($channelAuth)){ + if (!empty($channelAuth)) { $rest->getLoader()->setCredentials($channelAuth['username'], $channelAuth['password']); } - if($installFileMode) { - if(count($params) < 1) { + if ($installFileMode) { + if (count($params) < 1) { throw new Exception("Argument should be: filename"); } $filename = $params[0]; - if(!@file_exists($filename)) { + if (!@file_exists($filename)) { throw new Exception("File '{$filename}' not found"); } - if(!@is_readable($filename)) { + if (!@is_readable($filename)) { throw new Exception("File '{$filename}' is not readable"); } @@ -123,8 +125,8 @@ final class Mage_Connect_Command_Install extends Mage_Connect_Command $package->setConfig($config); $package->validate(); $errors = $package->getErrors(); - if(count($errors)) { - throw new Exception("Package file is invalid\n".implode("\n", $errors)); + if (count($errors)) { + throw new Exception("Package file is invalid\n" . implode("\n", $errors)); } $pChan = $package->getChannel(); @@ -138,20 +140,20 @@ final class Mage_Connect_Command_Install extends Mage_Connect_Command $conflicts = $cache->hasConflicts($pChan, $pName, $pVer); - if(false !== $conflicts) { + if (false !== $conflicts) { $conflicts = implode(", ",$conflicts); - if($forceMode) { - $this->doError($command, "Package {$pChan}/{$pName} {$pVer} conflicts with: ".$conflicts); + if ($forceMode) { + $this->doError($command, "Package {$pChan}/{$pName} {$pVer} conflicts with: " . $conflicts); } else { - throw new Exception("Package {$pChan}/{$pName} {$pVer} conflicts with: ".$conflicts); + throw new Exception("Package {$pChan}/{$pName} {$pVer} conflicts with: " . $conflicts); } } $conflicts = $package->checkPhpDependencies(); - if(true !== $conflicts) { - $confilcts = implode(",",$conflicts); - $err = "Package {$pChan}/{$pName} {$pVer} depends on PHP extensions: ".$conflicts; - if($forceMode) { + if (true !== $conflicts) { + $conflicts = implode(",",$conflicts); + $err = "Package {$pChan}/{$pName} {$pVer} depends on PHP extensions: " . $conflicts; + if ($forceMode) { $this->doError($command, $err); } else { throw new Exception($err); @@ -159,17 +161,17 @@ final class Mage_Connect_Command_Install extends Mage_Connect_Command } $conflicts = $package->checkPhpVersion(); - if(true !== $conflicts) { - $err = "Package {$pChan}/{$pName} {$pVer}: ".$conflicts; - if($forceMode) { + if (true !== $conflicts) { + $err = "Package {$pChan}/{$pName} {$pVer}: " . $conflicts; + if ($forceMode) { $this->doError($command, $err); } else { throw new Exception($err); } } - if(!$noFilesInstall) { - if($ftp) { + if (!$noFilesInstall) { + if ($ftp) { $packager->processInstallPackageFtp($package, $filename, $config, $ftpObj); } else { $packager->processInstallPackage($package, $filename, $config); @@ -184,7 +186,7 @@ final class Mage_Connect_Command_Install extends Mage_Connect_Command $title = isset($options['title']) ? $options['title'] : "Package installed: "; $out = array($command => array('data'=>$installedDeps, 'assoc'=>$installedDepsAssoc, 'title'=>$title)); - if($ftp) { + if ($ftp) { $packager->writeToRemoteCache($cache, $ftpObj); @unlink($config->getFilename()); } @@ -193,8 +195,8 @@ final class Mage_Connect_Command_Install extends Mage_Connect_Command return $out[$command]['data']; } - if(!$upgradeAllMode) { - if(count($params) < 2) { + if (!$upgradeAllMode) { + if (count($params) < 2) { throw new Exception("Argument should be: channelName packageName"); } $channel = $params[0]; @@ -211,37 +213,37 @@ final class Mage_Connect_Command_Install extends Mage_Connect_Command /* * process 'failed' results */ - if(count($packagesToInstall['failed'])) { + if (count($packagesToInstall['failed'])) { $showError=!count($packagesToInstall['result']); - foreach($packagesToInstall['failed'] as $failed){ - $msg="Package {$failed['channel']}/{$failed['name']} failed: ".$failed['reason']; - if($showError){ + foreach ($packagesToInstall['failed'] as $failed) { + $msg="Package {$failed['channel']}/{$failed['name']} failed: " . $failed['reason']; + if ($showError) { $this->doError($command, $msg); - }else{ + } else { $this->ui()->output($msg); } } } $packagesToInstall = $packagesToInstall['result']; } else { - if(empty($params[0])) { + if (empty($params[0])) { $channels = $cache->getChannelNames(); } else { $channel = $params[0]; - if(!$cache->isChannel($channel)) { + if (!$cache->isChannel($channel)) { throw new Exception("'{$channel}' is not existant channel name / valid uri"); } $channels = $cache->chanName($channel); } $packagesToInstall = array(); $neededToUpgrade = $packager->getUpgradesList($channels, $cache, $config, $rest); - foreach($neededToUpgrade as $chan=>$packages) { - foreach($packages as $name=>$data) { + foreach ($neededToUpgrade as $chan=>$packages) { + foreach ($packages as $name=>$data) { $versionTo = $data['to']; $tmp = $packager->getDependenciesList($chan, $name, $cache, $config, $versionTo, $versionTo, $withDepsMode, false, $rest ); - if(count($tmp['result'])) { + if (count($tmp['result'])) { $packagesToInstall = array_merge($packagesToInstall, $tmp['result']); } } @@ -254,7 +256,7 @@ final class Mage_Connect_Command_Install extends Mage_Connect_Command $installedDeps = array(); $installedDepsAssoc = array(); - foreach($packagesToInstall as $package) { + foreach ($packagesToInstall as $package) { try { $pName = $package['name']; $pChan = $package['channel']; @@ -272,7 +274,7 @@ final class Mage_Connect_Command_Install extends Mage_Connect_Command continue; } - if('incompartible' == $pInstallState) { + if ('incompartible' == $pInstallState) { $this->ui()->output( "Package incompartible with installed Magento: {$pChan}/{$pName} {$pVer}, skipping" ); @@ -281,12 +283,12 @@ final class Mage_Connect_Command_Install extends Mage_Connect_Command $conflicts = $cache->hasConflicts($pChan, $pName, $pVer); - if(false !== $conflicts) { + if (false !== $conflicts) { $conflicts = implode(", ",$conflicts); - if($forceMode) { - $this->doError($command, "Package {$pChan}/{$pName} {$pVer} conflicts with: ".$conflicts); + if ($forceMode) { + $this->doError($command, "Package {$pChan}/{$pName} {$pVer} conflicts with: " . $conflicts); } else { - throw new Exception("Package {$pChan}/{$pName} {$pVer} conflicts with: ".$conflicts); + throw new Exception("Package {$pChan}/{$pName} {$pVer} conflicts with: " . $conflicts); } } @@ -294,7 +296,7 @@ final class Mage_Connect_Command_Install extends Mage_Connect_Command * Modifications */ if (($upgradeMode || ($pInstallState == 'upgrade')) && !$ignoreModifiedMode) { - if($ftp) { + if ($ftp) { $modifications = $packager->getRemoteModifiedFiles($pChan, $pName, $cache, $config, $ftp); } else { $modifications = $packager->getLocalModifiedFiles($pChan, $pName, $cache, $config); @@ -302,8 +304,8 @@ final class Mage_Connect_Command_Install extends Mage_Connect_Command if (count($modifications) > 0) { $this->ui()->output('Changed locally: '); foreach ($modifications as $row) { - if(!$ftp) { - $this->ui()->output($config->magento_root.DS.$row); + if (!$ftp) { + $this->ui()->output($config->magento_root . DS . $row); } else { $this->ui()->output($row); } @@ -311,7 +313,7 @@ final class Mage_Connect_Command_Install extends Mage_Connect_Command } } - if($ftp) { + if ($ftp) { $cwd=$ftpObj->getcwd(); $dir=$cwd . DIRECTORY_SEPARATOR .$config->downloader_path . DIRECTORY_SEPARATOR . Mage_Connect_Config::DEFAULT_CACHE_PATH . DIRECTORY_SEPARATOR . trim( $pChan, "\\/"); @@ -322,9 +324,9 @@ final class Mage_Connect_Command_Install extends Mage_Connect_Command @mkdir($dir, 0777, true); } $dir = $config->getChannelCacheDir($pChan); - $packageFileName = $pName."-".$pVer.".tgz"; - $file = $dir.DIRECTORY_SEPARATOR.$packageFileName; - if(!@file_exists($file)) { + $packageFileName = $pName . "-" . $pVer . ".tgz"; + $file = $dir . DIRECTORY_SEPARATOR . $packageFileName; + if (!@file_exists($file)) { $this->ui()->output("Starting to download $packageFileName ..."); $rest->downloadPackageFileOfRelease($pName, $pVer, $file); $this->ui()->output(sprintf("...done: %s bytes", number_format(filesize($file)))); @@ -352,10 +354,10 @@ final class Mage_Connect_Command_Install extends Mage_Connect_Command } $conflicts = $package->checkPhpDependencies(); - if(true !== $conflicts) { - $confilcts = implode(",",$conflicts); - $err = "Package {$pChan}/{$pName} {$pVer} depends on PHP extensions: ".$conflicts; - if($forceMode) { + if (true !== $conflicts) { + $conflicts = implode(",",$conflicts); + $err = "Package {$pChan}/{$pName} {$pVer} depends on PHP extensions: " . $conflicts; + if ($forceMode) { $this->doError($command, $err); } else { throw new Exception($err); @@ -363,18 +365,18 @@ final class Mage_Connect_Command_Install extends Mage_Connect_Command } $conflicts = $package->checkPhpVersion(); - if(true !== $conflicts) { - $err = "Package {$pChan}/{$pName} {$pVer}: ".$conflicts; - if($forceMode) { + if (true !== $conflicts) { + $err = "Package {$pChan}/{$pName} {$pVer}: " . $conflicts; + if ($forceMode) { $this->doError($command, $err); } else { throw new Exception($err); } } - if(!$noFilesInstall) { + if (!$noFilesInstall) { $this->ui()->output("Installing package {$pChan}/{$pName} {$pVer}"); - if($ftp) { + if ($ftp) { $packager->processInstallPackageFtp($package, $file, $config, $ftpObj); } else { $packager->processInstallPackage($package, $file, $config); @@ -394,7 +396,7 @@ final class Mage_Connect_Command_Install extends Mage_Connect_Command $title = isset($options['title']) ? $options['title'] : "Package installed: "; $out = array($command => array('data'=>$installedDeps, 'assoc'=>$installedDepsAssoc, 'title'=>$title)); - if($ftp) { + if ($ftp) { $packager->writeToRemoteCache($cache, $ftpObj); @unlink($config->getFilename()); } @@ -402,7 +404,7 @@ final class Mage_Connect_Command_Install extends Mage_Connect_Command $this->ui()->output($out); return $out[$command]['data']; } catch (Exception $e) { - if($ftp) { + if ($ftp) { $packager->writeToRemoteCache($cache, $ftpObj); @unlink($config->getFilename()); } @@ -444,14 +446,14 @@ final class Mage_Connect_Command_Install extends Mage_Connect_Command * @param string $command * @param array $options * @param array $params - * @return null + * @return array|null */ public function doUninstall($command, $options, $params) { $this->cleanupParams($params); try { - if(count($params) != 2) { + if (count($params) != 2) { throw new Exception("Argument count should be = 2"); } @@ -466,7 +468,7 @@ final class Mage_Connect_Command_Install extends Mage_Connect_Command /** @var $cache Mage_Connect_Singleconfig */ /** @var $config Mage_Connect_Config */ /** @var $ftpObj Mage_Connect_Ftp */ - if($ftp) { + if ($ftp) { list($cache, $config, $ftpObj) = $packager->getRemoteConf($ftp); } else { $cache = $this->getSconfig(); @@ -474,47 +476,47 @@ final class Mage_Connect_Command_Install extends Mage_Connect_Command } $channel = $cache->chanName($channel); - if(!$cache->hasPackage($channel, $package)) { + if (!$cache->hasPackage($channel, $package)) { throw new Exception("Package is not installed"); } $deletedPackages = array(); $list = $packager->getUninstallList($channel, $package, $cache, $config, $withDepsMode); - foreach($list['list'] as $packageData) { + foreach ($list['list'] as $packageData) { try { $reqd = $cache->requiredByOtherPackages( $packageData['channel'], $packageData['name'], $list['list'] ); - if(count($reqd)) { + if (count($reqd)) { $errMessage = "{$packageData['channel']}/{$packageData['name']} " . "{$packageData['version']} is required by: "; $t = array(); - foreach($reqd as $r) { - $t[] = $r['channel']."/".$r['name']. " ".$r['version']; + foreach ($reqd as $r) { + $t[] = $r['channel'] . "/" . $r['name'] . " " . $r['version']; } $errMessage .= implode(", ", $t); - if($forceMode) { - $this->ui()->output("Warning: ".$errMessage); + if ($forceMode) { + $this->ui()->output("Warning: " . $errMessage); } else { throw new Exception($errMessage); } } } catch(Exception $e) { - if($forceMode) { + if ($forceMode) { $this->doError($command, $e->getMessage()); } else { throw new Exception($e->getMessage()); } } } - foreach($list['list'] as $packageData) { + foreach ($list['list'] as $packageData) { try { list($chan, $pack) = array($packageData['channel'], $packageData['name']); $packageName = $packageData['channel'] . "/" . $packageData['name']; $this->ui()->output("Starting to uninstall $packageName "); - if($ftp) { + if ($ftp) { $packager->processUninstallPackageFtp($chan, $pack, $cache, $ftpObj); } else { $packager->processUninstallPackage($chan, $pack, $cache, $config); @@ -523,19 +525,20 @@ final class Mage_Connect_Command_Install extends Mage_Connect_Command $deletedPackages[] = array($chan, $pack); $this->ui()->output("Package {$packageName} uninstalled"); } catch(Exception $e) { - if($forceMode) { + if ($forceMode) { $this->doError($command, $e->getMessage()); } else { throw new Exception($e->getMessage()); } } } - if($ftp) { + if ($ftp) { $packager->writeToRemoteCache($cache, $ftpObj); @unlink($config->getFilename()); } $out = array($command=>array('data'=>$deletedPackages, 'title'=>'Package deleted: ')); $this->ui()->output($out); + return $out[$command]['data']; } catch (Exception $e) { return $this->doError($command, $e->getMessage()); } diff --git a/downloader/lib/Mage/Connect/Command/Install_Header.php b/downloader/lib/Mage/Connect/Command/Install_Header.php index 75e07ffcd3313911563391a0885fc323426c717c..12e004d22cffcc9b730d2e7a3747f006566f8b0e 100644 --- a/downloader/lib/Mage/Connect/Command/Install_Header.php +++ b/downloader/lib/Mage/Connect/Command/Install_Header.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/downloader/lib/Mage/Connect/Command/Package.php b/downloader/lib/Mage/Connect/Command/Package.php index 3516bdc0ef1f95e0087d3cf2df78023438103ca1..0f0efe3f014912d55b9113a1919cce1e365c7e96 100644 --- a/downloader/lib/Mage/Connect/Command/Package.php +++ b/downloader/lib/Mage/Connect/Command/Package.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/downloader/lib/Mage/Connect/Command/Package_Header.php b/downloader/lib/Mage/Connect/Command/Package_Header.php index f738ba800d091202f7df8999755830328c8074aa..6c0a05d2641409e9b6a5f823d48b531ebef44bb3 100644 --- a/downloader/lib/Mage/Connect/Command/Package_Header.php +++ b/downloader/lib/Mage/Connect/Command/Package_Header.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/downloader/lib/Mage/Connect/Command/Registry.php b/downloader/lib/Mage/Connect/Command/Registry.php index f2fc850733db07206aba4d35d13b7b2b483eca2e..2577c1c5b74a92d7547b774e5db41d60bea40c9b 100644 --- a/downloader/lib/Mage/Connect/Command/Registry.php +++ b/downloader/lib/Mage/Connect/Command/Registry.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/downloader/lib/Mage/Connect/Command/Registry_Header.php b/downloader/lib/Mage/Connect/Command/Registry_Header.php index 410625e3c47d6d4803d8d18f4b38abd8119407e6..4b77ee170c6eae577cd5fd63473fee01b2deb7ad 100644 --- a/downloader/lib/Mage/Connect/Command/Registry_Header.php +++ b/downloader/lib/Mage/Connect/Command/Registry_Header.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/downloader/lib/Mage/Connect/Command/Remote.php b/downloader/lib/Mage/Connect/Command/Remote.php index d2a39a03f70167633fa16a0ebd941644b366352a..7d8c879c8453746c9ae294bd5de7752eb5171db6 100644 --- a/downloader/lib/Mage/Connect/Command/Remote.php +++ b/downloader/lib/Mage/Connect/Command/Remote.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/downloader/lib/Mage/Connect/Command/Remote_Header.php b/downloader/lib/Mage/Connect/Command/Remote_Header.php index dcfd359eea1a688c60ba6d41baa6601801b91b48..79793670cb2d53560055b834455dc101e9510604 100644 --- a/downloader/lib/Mage/Connect/Command/Remote_Header.php +++ b/downloader/lib/Mage/Connect/Command/Remote_Header.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/downloader/lib/Mage/Connect/Config.php b/downloader/lib/Mage/Connect/Config.php index 22136a2d80c83a3060d4a0a75132063b2d5a7ca3..c964de14eccad503ad8fbc49933ae74a8305f257 100644 --- a/downloader/lib/Mage/Connect/Config.php +++ b/downloader/lib/Mage/Connect/Config.php @@ -20,9 +20,30 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ + +/** + * Magento Connect Config + * + * @property string php_ini + * @property string protocol + * @property string preferred_state + * @property string use_custom_permissions_mode + * @property string global_dir_mode + * @property string global_file_mode + * @property string downloader_path + * @property string magento_root + * @property string root_channel_uri + * @property string root_channel + * @property string remote_config + * @property string sync_pear + * + * @category Mage + * @package Mage_Connect + * @author Magento Core Team <core@magentocommerce.com> + */ class Mage_Connect_Config implements Iterator { /** @@ -53,11 +74,28 @@ class Mage_Connect_Config implements Iterator */ protected $_configError = ''; + /** + * Header string + */ const HEADER = "::ConnectConfig::v::1.0::"; + + /** + * Default paths + */ const DEFAULT_DOWNLOADER_PATH = "downloader"; const DEFAULT_CACHE_PATH = ".cache"; + /** + * Array of default properties + * @var array + */ protected $defaultProperties = array(); + + /** + * Array of properties + * + * @var array + */ protected $properties = array(); /** @@ -71,6 +109,11 @@ class Mage_Connect_Config implements Iterator $this->load(); } + /** + * Initialise Properties and Default Properties + * + * @return void + */ protected function initProperties() { $this->defaultProperties = array ( @@ -162,22 +205,43 @@ class Mage_Connect_Config implements Iterator $this->properties = $this->defaultProperties; } + /** + * Retrieve Downloader Path + * + * @return string + */ public function getDownloaderPath() { return $this->magento_root . DIRECTORY_SEPARATOR . $this->downloader_path; } + /** + * Retrieve Packages Cache Directory + * + * @return string + */ public function getPackagesCacheDir() { return $this->getDownloaderPath() . DIRECTORY_SEPARATOR . self::DEFAULT_CACHE_PATH; } + /** + * Retrieve Channel Cache Directory + * + * @param string $channel + * @return string + */ public function getChannelCacheDir($channel) { $channel = trim( $channel, "\\/"); return $this->getPackagesCacheDir(). DIRECTORY_SEPARATOR . $channel; } + /** + * Get Config file name + * + * @return string + */ public function getFilename() { return $this->_configFile; @@ -211,7 +275,7 @@ class Mage_Connect_Config implements Iterator clearstatcache(); $size = filesize($this->_configFile); - if(!$size) { + if (!$size) { $this->_configError = "Wrong config file size {$this->_configFile} please save Settings again"; return false; } @@ -219,7 +283,7 @@ class Mage_Connect_Config implements Iterator $headerLen = strlen(self::HEADER); try { $contents = fread($f, $headerLen); - if(self::HEADER != $contents) { + if (self::HEADER != $contents) { $this->_configError = "Wrong configuration file {$this->_configFile} please save Settings again"; return false; } @@ -232,7 +296,7 @@ class Mage_Connect_Config implements Iterator return false; } $data = @unserialize($contents); - if($data === false) { + if ($data === false) { $this->_configError = "Wrong configuration file {$this->_configFile} please save Settings again"; return false; } @@ -241,6 +305,7 @@ class Mage_Connect_Config implements Iterator } @fclose($f); $this->_configLoaded=true; + return true; } /** @@ -301,83 +366,158 @@ class Mage_Connect_Config implements Iterator return $result; } + /** + * Validate value for configuration key + * + * @param string $key + * @param mixed $val + * @return bool + */ public function validate($key, $val) { $rules = $this->extractField($key, 'rules'); - if(null === $rules) { + if (null === $rules) { return true; - } elseif( is_array($rules) ) { + } elseif ( is_array($rules) ) { return in_array($val, $rules); } return false; } + /** + * Get possible values for configuration key + * + * @param string $key + * @return null|string + */ public function possible($key) { $data = $this->getKey($key); - if(! $data) { + if (! $data) { return null; } - if('set' == $data['type']) { + if ('set' == $data['type']) { return implode("|", $data['rules']); } - if(!empty($data['possible'])) { + if (!empty($data['possible'])) { return $data['possible']; } - return "<".$data['type'].">"; + return "<" . $data['type'] . ">"; } + /** + * Get type of key + * + * @param string $key + * @return mixed|null + */ public function type($key) { return $this->extractField($key, 'type'); } + /** + * Get documentation information + * + * @param string $key + * @return mixed|null + */ public function doc($key) { return $this->extractField($key, 'doc'); } + /** + * Get property of key + * + * @param $key + * @param $field + * @return mixed|null + */ public function extractField($key, $field) { - if(!isset($this->properties[$key][$field])) { + if (!isset($this->properties[$key][$field])) { return null; } return $this->properties[$key][$field]; } + /** + * Check Key exists in properties array + * + * @param string $fld + * @return bool + */ public function hasKey($fld) { return isset($this->properties[$fld]); } + /** + * Get all Key properties + * + * @param $fld + * @return null + */ public function getKey($fld) { - if($this->hasKey($fld)) { + if ($this->hasKey($fld)) { return $this->properties[$fld]; } return null; } + /** + * Set the internal pointer of the Properties array to its first element + * + * @return void + */ public function rewind() { reset($this->properties); } + /** + * Validate current property + * + * @return bool + */ public function valid() { return current($this->properties) !== false; } + /** + * Get Key of current property + * + * @return mixed + */ public function key() { return key($this->properties); } + /** + * Get current Property + * + * @return mixed + */ public function current() { return current($this->properties); } + /** + * Advance the internal array pointer of the Properties array + * + * @return void + */ public function next() { next($this->properties); } + /** + * Retrieve value of property + * + * @param string $var + * @return null + */ public function __get($var) { if (isset($this->properties[$var]['value'])) { @@ -386,6 +526,13 @@ class Mage_Connect_Config implements Iterator return null; } + /** + * Set value of property + * + * @param string $var + * @param mixed $value + * @return void + */ public function __set($var, $value) { if (is_string($value)) { @@ -395,17 +542,23 @@ class Mage_Connect_Config implements Iterator if ($value === null) { $value = ''; } - if($this->properties[$var]['value'] !== $value) { + if ($this->properties[$var]['value'] !== $value) { $this->properties[$var]['value'] = $value; $this->store(); } } } + /** + * Prepare Array of class properties + * + * @param bool $withRules + * @return array + */ public function toArray($withRules = false) { $out = array(); - foreach($this as $k=>$v) { + foreach ($this as $k=>$v) { $out[$k] = $withRules ? $v : $v['value']; } return $out; diff --git a/downloader/lib/Mage/Connect/Converter.php b/downloader/lib/Mage/Connect/Converter.php index c22866869084c03ddbe311af0b9cce087d4113e4..46c3152b7925e4b49a72b87aa30e9131d327ceeb 100644 --- a/downloader/lib/Mage/Connect/Converter.php +++ b/downloader/lib/Mage/Connect/Converter.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/downloader/lib/Mage/Connect/Frontend.php b/downloader/lib/Mage/Connect/Frontend.php index 4ebaf7b14f2a0500d98c66252f551bfd50634df4..2cd9358e5a3777acbd0d7a198beea8c65f8172bc 100644 --- a/downloader/lib/Mage/Connect/Frontend.php +++ b/downloader/lib/Mage/Connect/Frontend.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Connect_Frontend diff --git a/downloader/lib/Mage/Connect/Frontend/CLI.php b/downloader/lib/Mage/Connect/Frontend/CLI.php index a0d0c4b88f89cb7f8e5330235d48ee894fcb09ee..1212c7f80d40bf01b8e924fd1481859f013429fd 100644 --- a/downloader/lib/Mage/Connect/Frontend/CLI.php +++ b/downloader/lib/Mage/Connect/Frontend/CLI.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/downloader/lib/Mage/Connect/Ftp.php b/downloader/lib/Mage/Connect/Ftp.php index ffb71e37137f4d167a742d8655b94db430918e48..65d3700efd1436aa69d824bcb8b3cb205c251f67 100644 --- a/downloader/lib/Mage/Connect/Ftp.php +++ b/downloader/lib/Mage/Connect/Ftp.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/downloader/lib/Mage/Connect/Loader.php b/downloader/lib/Mage/Connect/Loader.php index f622fcc206b1ec52202472c2899dd5feccaed240..78ebc35fe365e66f57bc42965ba0d1d34c80795a 100644 --- a/downloader/lib/Mage/Connect/Loader.php +++ b/downloader/lib/Mage/Connect/Loader.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -33,11 +33,11 @@ */ class Mage_Connect_Loader { - /** * Factory for HTTP client - * @param string/false $protocol 'curl'/'socket' or false for auto-detect - * @return Mage_HTTP_Client/Mage_Connect_Loader_Ftp + * + * @param string|false $protocol 'curl'/'socket' or false for auto-detect + * @return Mage_HTTP_IClient|Mage_Connect_Loader_Ftp */ public static function getInstance($protocol='') { @@ -47,5 +47,4 @@ class Mage_Connect_Loader return Mage_HTTP_Client::getInstance(); } } - } diff --git a/downloader/lib/Mage/Connect/Loader/Ftp.php b/downloader/lib/Mage/Connect/Loader/Ftp.php index c410bde3977e292a2b33cfad475514d29805bc82..d74ae20f8831eb96e69c38b5dfdc8689de373572 100644 --- a/downloader/lib/Mage/Connect/Loader/Ftp.php +++ b/downloader/lib/Mage/Connect/Loader/Ftp.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/downloader/lib/Mage/Connect/Package.php b/downloader/lib/Mage/Connect/Package.php index d031edbac3cc18b23abb1b1e8d94a729a5a452ea..d785876165e3e24644dc67cabb9ee178f5b1456f 100644 --- a/downloader/lib/Mage/Connect/Package.php +++ b/downloader/lib/Mage/Connect/Package.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/downloader/lib/Mage/Connect/Package/Hotfix.php b/downloader/lib/Mage/Connect/Package/Hotfix.php index 3c1ba9413676b10fd3e021240e071303ecc46db1..b0f436d3beeac6b347510dd9e26eccb3177f81c1 100644 --- a/downloader/lib/Mage/Connect/Package/Hotfix.php +++ b/downloader/lib/Mage/Connect/Package/Hotfix.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/downloader/lib/Mage/Connect/Package/Reader.php b/downloader/lib/Mage/Connect/Package/Reader.php index 3776698d1d0785838f9a98ab6bca47d378612bb1..5b38949e041acfb2c0d932f667384bfc954afeeb 100644 --- a/downloader/lib/Mage/Connect/Package/Reader.php +++ b/downloader/lib/Mage/Connect/Package/Reader.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/downloader/lib/Mage/Connect/Package/Target.php b/downloader/lib/Mage/Connect/Package/Target.php index 435d7c79077d36c968e59724173ff06443f1891f..ac162d39933e72cf2173b42a020f80d3faf644e4 100644 --- a/downloader/lib/Mage/Connect/Package/Target.php +++ b/downloader/lib/Mage/Connect/Package/Target.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/downloader/lib/Mage/Connect/Package/VO.php b/downloader/lib/Mage/Connect/Package/VO.php index 0a31198dd85a38b29ef44cb743c7ccbd892af78f..880fc6bd705eff92e9a5e10aabfa403ab8d065d5 100644 --- a/downloader/lib/Mage/Connect/Package/VO.php +++ b/downloader/lib/Mage/Connect/Package/VO.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/downloader/lib/Mage/Connect/Package/Writer.php b/downloader/lib/Mage/Connect/Package/Writer.php index 2018e3c9ae76e0ca3eb9e6dfd3255b8c187ca2d9..79006feb3005318a5f122b5b0b5579740ba88ce3 100644 --- a/downloader/lib/Mage/Connect/Package/Writer.php +++ b/downloader/lib/Mage/Connect/Package/Writer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/downloader/lib/Mage/Connect/Packager.php b/downloader/lib/Mage/Connect/Packager.php index 899b95378b530cb25b167548d780c09cb0de3f31..ec6ed49e71722d2f2e607cb8a13d213030b66c22 100644 --- a/downloader/lib/Mage/Connect/Packager.php +++ b/downloader/lib/Mage/Connect/Packager.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -261,7 +261,7 @@ class Mage_Connect_Packager $contents = $package->getContents(); $targetPath = rtrim($configObj->magento_root, "\\/"); - foreach($contents as $file) { + foreach ($contents as $file) { $fileName = basename($file); $filePath = dirname($file); $dest = $targetPath . DIRECTORY_SEPARATOR . $filePath . DIRECTORY_SEPARATOR . $fileName; @@ -290,7 +290,7 @@ class Mage_Connect_Packager $ftpDir = $ftp->getcwd(); $package = $cacheObj->getPackageObject($chanName, $package); $contents = $package->getContents(); - foreach($contents as $file) { + foreach ($contents as $file) { $ftp->delete($file); $this->removeEmptyDirectory(dirname($file), $ftp); } @@ -317,7 +317,7 @@ class Mage_Connect_Packager /** * Return correct global dir mode in octal representation * - * @param Maged_Model_Config $config + * @param Mage_Connect_Config $config * @return int */ protected function _getDirMode($config) @@ -332,7 +332,7 @@ class Mage_Connect_Packager /** * Return global file mode in octal representation * - * @param Maged_Model_Config $config + * @param Mage_Connect_Config $config * @return int */ protected function _getFileMode($config) @@ -360,7 +360,7 @@ class Mage_Connect_Packager * * @param Mage_Connect_Package $package * @param string $file - * @param Maged_Model_Config $configObj + * @param Mage_Connect_Config $configObj * @param Mage_Connect_Ftp $ftp * @return void */ @@ -369,13 +369,13 @@ class Mage_Connect_Packager $ftpDir = $ftp->getcwd(); $contents = $package->getContents(); $arc = $this->getArchiver(); - $target = dirname($file).DS.$package->getReleaseFilename(); + $target = dirname($file) . DS . $package->getReleaseFilename(); @mkdir($target, 0777, true); $tar = $arc->unpack($file, $target); $modeFile = $this->_getFileMode($configObj); $modeDir = $this->_getDirMode($configObj); - foreach($contents as $file) { - $source = $tar.DS.$file; + foreach ($contents as $file) { + $source = $tar . DS . $file; if (file_exists($source) && is_file($source)) { $args = array(ltrim($file,"/"), $source); if($modeDir||$modeFile) { @@ -401,23 +401,23 @@ class Mage_Connect_Packager * * @param Mage_Connect_Package $package * @param string $file + * @param Mage_Connect_Config $configObj * @return void - * @throws Exception */ public function processInstallPackage($package, $file, $configObj) { $contents = $package->getContents(); $arc = $this->getArchiver(); - $target = dirname($file).DS.$package->getReleaseFilename(); + $target = dirname($file) . DS . $package->getReleaseFilename(); @mkdir($target, 0777, true); $tar = $arc->unpack($file, $target); $modeFile = $this->_getFileMode($configObj); $modeDir = $this->_getDirMode($configObj); $targetPath = rtrim($configObj->magento_root, "\\/"); - foreach($contents as $file) { + foreach ($contents as $file) { $fileName = basename($file); $filePath = dirname($file); - $source = $tar.DS.$file; + $source = $tar . DS . $file; @mkdir($targetPath. DS . $filePath, $modeDir, true); $dest = $targetPath . DS . $filePath . DS . $fileName; if (is_file($source)) { @@ -496,8 +496,9 @@ class Mage_Connect_Packager /** * Get upgrades list * - * @param string/array $channels + * @param string|array $channels * @param Mage_Connect_Singleconfig $cacheObject + * @param Mage_Connect_Config $configObj * @param Mage_Connect_Rest $restObj optional * @param bool $checkConflicts * @return array @@ -513,7 +514,7 @@ class Mage_Connect_Packager } $updates = array(); - foreach($channels as $chan) { + foreach ($channels as $chan) { if(!$cacheObject->isChannel($chan)) { continue; @@ -536,14 +537,14 @@ class Mage_Connect_Packager */ $state = $configObj->preferred_state ? $configObj->preferred_state : "stable"; - foreach($localPackages as $localName=>$localData) { + foreach ($localPackages as $localName=>$localData) { if(!isset($remotePackages[$localName])) { continue; } $package = $remotePackages[$localName]; $neededToUpgrade = false; $remoteVersion = $localVersion = trim($localData[Mage_Connect_Singleconfig::K_VER]); - foreach($package as $version => $s) { + foreach ($package as $version => $s) { if($cacheObject->compareStabilities($s, $state) < 0) { continue; @@ -581,7 +582,7 @@ class Mage_Connect_Packager * @param Mage_Connect_Singleconfig $cache * @param Mage_Connect_Config $config * @param bool $withDepsRecursive - * @return array + * @return array|null */ public function getUninstallList($chanName, $package, $cache, $config, $withDepsRecursive = true) { @@ -599,7 +600,7 @@ class Mage_Connect_Packager $hash = array(); return array('list'=>array()); } - return; + return null; } $dependencies = $cache->getPackageDependencies($chanName, $package); $data = $cache->getPackage($chanName, $package); @@ -614,14 +615,14 @@ class Mage_Connect_Packager if($withDepsRecursive) { $fields = array('name','channel','min','max'); - foreach($dependencies as $row) { + foreach ($dependencies as $row) { /** * Converts an array to variables * @var $pChannel string Channel Name * @var $pName string Package Name */ - foreach($fields as $key) { - $varName = "p".ucfirst($key); + foreach ($fields as $key) { + $varName = "p" . ucfirst($key); $$varName = $row[$key]; } $method = __FUNCTION__; @@ -642,6 +643,8 @@ class Mage_Connect_Packager $hash = array(); return array('list'=>$out); } + + return null; } /** @@ -656,7 +659,7 @@ class Mage_Connect_Packager * @param string $versionMax Required package maximum version * @param string $installState Package install state * @param string $message Package install message - * @param array $dependencies Package dependencies + * @param array|string $dependencies Package dependencies * @return bool */ private function addHashData(&$hash, $name, $channel, $downloaded_version = '', $stability = '', $versionMin = '', @@ -677,7 +680,7 @@ class Mage_Connect_Packager 'max' => $versionMax, 'install_state' => $installState, 'message' => (isset($this->installStates[$installState]) ? - $this->installStates[$installState] : '').$message, + $this->installStates[$installState] : '') . $message, 'packages' => $dependencies, ); return true; @@ -713,7 +716,7 @@ class Mage_Connect_Packager try { $chanName = $cache->chanName($chanName); - if (!$rest){ + if (!$rest) { $rest = new Mage_Connect_Rest($config->protocol); } $rest->setChannel($cache->chanUrl($chanName)); @@ -739,6 +742,7 @@ class Mage_Connect_Packager if (!$version) { $versionState = $cache->detectVersionFromRestArray($releases, $versionMin, $versionMax); if ($versionState) { + /** @var $packageInfo Mage_Connect_Package */ $packageInfo = $rest->getPackageReleaseInfo($package, $versionState); if (false !== $packageInfo) { $stability = $packageInfo->getStability(); @@ -758,7 +762,7 @@ class Mage_Connect_Packager * check is package already installed */ if ($installedPackage = $cache->isPackageInstalled($package)) { - if ($chanName == $installedPackage['channel']){ + if ($chanName == $installedPackage['channel']) { /** * check versions */ @@ -808,7 +812,7 @@ class Mage_Connect_Packager if ($withDepsRecursive && self::INSTALL_STATE_INCOMPATIBLE != $install_state) { $flds = array('name','channel','min','max'); - foreach($dependencies as $row) { + foreach ($dependencies as $row) { /** * Converts an array to variables * @var $pChannel string Channel Name @@ -816,13 +820,13 @@ class Mage_Connect_Packager * @var $pMax string Maximum version number * @var $pMin string Minimum version number */ - foreach($flds as $key) { - $varName = "p".ucfirst($key); + foreach ($flds as $key) { + $varName = "p" . ucfirst($key); $$varName = $row[$key]; } $method = __FUNCTION__; /** - * @todo When we are building dependencies tree we should base this calculations not on full key as + * When we are building dependencies tree we should base this calculations not on full key as * on a unique value but check it by parts. First part which should be checked is EXTENSION_NAME * also this part should be unique globally not per channel. */ @@ -844,7 +848,7 @@ class Mage_Connect_Packager } $names = array("pMin","pMax","hasMin","hasMax"); - for($i=0, $c=count($names); $i<$c; $i++) { + for ($i=0, $c=count($names); $i<$c; $i++) { if(!isset($$names[$i])) { continue; } @@ -896,8 +900,9 @@ class Mage_Connect_Packager $_failed = array(); return array('deps' => $deps, 'result' => $out, 'failed'=> $failed); } - } + return null; + } /** * Process dependencies hash. Makes topological sorting and gives operation order list @@ -911,8 +916,7 @@ class Mage_Connect_Packager $nodes = array(); $graph = new Mage_Connect_Structures_Graph(); - foreach($depsHash as $key=>$data) { - $packages = $data['packages']; + foreach ($depsHash as $key=>$data) { $node = new Mage_Connect_Structures_Node(); $nodes[$key] =& $node; unset($data['packages']); @@ -921,12 +925,12 @@ class Mage_Connect_Packager unset($node); } - if(count($nodes) > 1) { - foreach($depsHash as $key=>$data) { + if (count($nodes) > 1) { + foreach ($depsHash as $key=>$data) { $packages = $data['packages']; - foreach($packages as $pdata) { + foreach ($packages as $pdata) { $pName = $pdata['name']; - if(isset($nodes[$key], $nodes[$pName])) { + if (isset($nodes[$key], $nodes[$pName])) { $nodes[$key]->connectTo($nodes[$pName]); } } @@ -940,8 +944,9 @@ class Mage_Connect_Packager $result = $graph->topologicalSort(); $sortReverse ? krsort($result) : ksort($result); $out = array(); - foreach($result as $nodes) { - foreach($nodes as $n) { + foreach ($result as $nodes) { + foreach ($nodes as $n) { + /** @var $n Mage_Connect_Structures_Node */ $out[] = $n->getData(); } } diff --git a/downloader/lib/Mage/Connect/Rest.php b/downloader/lib/Mage/Connect/Rest.php index 4ec1ad889484a943e0b08484bcbcc404708dbe2c..ab24c264dc7dee7ad1d4cd34590ce2a9b0c9be84 100644 --- a/downloader/lib/Mage/Connect/Rest.php +++ b/downloader/lib/Mage/Connect/Rest.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -31,10 +31,11 @@ * @package Mage_Connect * @author Magento Core Team <core@magentocommerce.com> */ - class Mage_Connect_Rest { - + /** + * Paths for xml config files + */ const CHANNELS_XML = "channels.xml"; const CHANNEL_XML = "channel.xml"; const PACKAGES_XML = "packages.xml"; @@ -48,28 +49,38 @@ class Mage_Connect_Rest */ protected $_loader = null; - /** * XML parser + * * @var Mage_Xml_Parser */ protected $_parser = null; /** * Channel URI + * * @var string */ protected $_chanUri = ''; /** - * Protocol HTTP or FTP - * - * @var string http or ftp - */ + * Protocol HTTP or FTP + * + * @var string http or ftp + */ protected $_protocol = ''; /** - * Constructor + * States interpretation + * + * @var array + */ + protected $states = array('b'=>'beta', 'd'=>'dev', 's'=>'stable', 'a'=>'alpha'); + + /** + * Constructor sets default protocol + * + * @param string $protocol */ public function __construct($protocol="http") { @@ -87,10 +98,10 @@ class Mage_Connect_Rest } /** - * Set channel info + * Set channel URI * * @param string $uri - * @param sting $name + * @return void */ public function setChannel($uri) { @@ -99,17 +110,17 @@ class Mage_Connect_Rest /** * Get HTTP loader - * @return Mage_Connect_Loader + * + * @return Mage_HTTP_IClient|Mage_Connect_Loader_Ftp */ public function getLoader() { - if(is_null($this->_loader)) { + if (is_null($this->_loader)) { $this->_loader = Mage_Connect_Loader::getInstance($this->_protocol); } return $this->_loader; } - /** * Get parser * @@ -117,7 +128,7 @@ class Mage_Connect_Rest */ protected function getParser() { - if(is_null($this->_parser)) { + if (is_null($this->_parser)) { $this->_parser = new Mage_Xml_Parser(); } return $this->_parser; @@ -125,15 +136,16 @@ class Mage_Connect_Rest /** * Load URI response - * @param string $uri + * + * @param string $uriSuffix + * @return bool|string */ protected function loadChannelUri($uriSuffix) { - $url = $this->_chanUri."/".$uriSuffix; - //print $url."\n"; + $url = $this->_chanUri . "/" . $uriSuffix; $this->getLoader()->get($url); $statusCode = $this->getLoader()->getStatus(); - if($statusCode != 200) { + if ($statusCode != 200) { return false; } return $this->getLoader()->getBody(); @@ -141,79 +153,82 @@ class Mage_Connect_Rest /** * Get channels list of URI + * * @return array */ public function getChannelInfo() { $out = $this->loadChannelUri(self::CHANNEL_XML); $statusCode = $this->getLoader()->getStatus(); - if($statusCode != 200) { + if ($statusCode != 200) { throw new Exception("Invalid server response for {$this->_chanUri}"); } $parser = $this->getParser(); $out = $parser->loadXML($out)->xmlToArray(); - // TODO: add channel validator $vo = new Mage_Connect_Channel_VO(); $vo->fromArray($out['channel']); - if(!$vo->validate()) { + if (!$vo->validate()) { throw new Exception("Invalid channel.xml file"); } return $vo; } - /** * Get packages list of channel + * * @return array */ public function getPackages() { $out = $this->loadChannelUri(self::PACKAGES_XML); $statusCode = $this->getLoader()->getStatus(); - if($statusCode != 200) { + if ($statusCode != 200) { return false; } $parser = $this->getParser(); $out = $parser->loadXML($out)->xmlToArray(); - - if(!isset($out['data']['p'])) { + if (!isset($out['data']['p'])) { return array(); } - if(isset($out['data']['p'][0])) { + if (isset($out['data']['p'][0])) { return $out['data']['p']; } - if(is_array($out['data']['p'])) { + if (is_array($out['data']['p'])) { return array($out['data']['p']); } return array(); } - + /** + * Return Channel Packages loaded from Channel Server + * + * @return array|bool|string + */ public function getPackagesHashed() { $out = $this->loadChannelUri(self::PACKAGES_XML); $statusCode = $this->getLoader()->getStatus(); - if($statusCode != 200) { + if ($statusCode != 200) { return false; } $parser = $this->getParser(); $out = $parser->loadXML($out)->xmlToArray(); $return = array(); - if(!isset($out['data']['p'])) { + if (!isset($out['data']['p'])) { return $return; } - if(isset($out['data']['p'][0])) { + if (isset($out['data']['p'][0])) { $return = $out['data']['p']; - }elseif(is_array($out['data']['p'])) { + } elseif (is_array($out['data']['p'])) { $return = array($out['data']['p']); } - $c = count($return); - if($c) { + $c = count($return); + if ($c) { $output = array(); - for($i=0; $i<$c; $i++) { + for ($i=0; $i<$c; $i++) { $element = $return[$i]; $output[$element['n']] = $element['r']; } @@ -221,7 +236,7 @@ class Mage_Connect_Rest } $out = array(); - foreach($return as $name=>$package) { + foreach ($return as $name=>$package) { $stabilities = array_map(array($this, 'shortStateToLong'), array_keys($package)); $versions = array_map('trim', array_values($package)); $package = array_combine($versions, $stabilities); @@ -233,6 +248,7 @@ class Mage_Connect_Rest /** * Stub + * * @param $n * @return unknown_type */ @@ -243,22 +259,24 @@ class Mage_Connect_Rest /** * Get releases list of package on current channel + * * @param string $package package name + * @return array|bool */ public function getReleases($package) { - $out = $this->loadChannelUri($this->escapePackageName($package)."/".self::RELEASES_XML); + $out = $this->loadChannelUri($this->escapePackageName($package) . "/" . self::RELEASES_XML); $statusCode = $this->getLoader()->getStatus(); - if($statusCode != 200) { + if ($statusCode != 200) { return false; } $parser = $this->getParser(); $out = $parser->loadXML($out)->xmlToArray(); - if(!isset($out['releases']['r'])) { + if (!isset($out['releases']['r'])) { return array(); } $src = $out['releases']['r']; - if(!array_key_exists(0, $src)) { + if (!array_key_exists(0, $src)) { return array($src); } $this->sortReleases($src); @@ -267,6 +285,7 @@ class Mage_Connect_Rest /** * Sort releases + * * @param array $releases * @return void */ @@ -278,6 +297,7 @@ class Mage_Connect_Rest /** * Sort releases callback + * * @param string $a * @param srting $b * @return int @@ -295,23 +315,24 @@ class Mage_Connect_Rest */ public function getPackageInfo($package) { - $out = $this->loadChannelUri($this->escapePackageName($package)."/".self::PACKAGE_XML); - if(false === $out) { + $out = $this->loadChannelUri($this->escapePackageName($package) . "/" . self::PACKAGE_XML); + if (false === $out) { return false; } return new Mage_Connect_Package($out); } /** + * Retrieve information on Package Release from the Channel Server * * @param $package * @param $version - * @return Mage_Connect_Package + * @return Mage_Connect_Package|bool */ public function getPackageReleaseInfo($package, $version) { - $out = $this->loadChannelUri($this->escapePackageName($package)."/".$version."/".self::PACKAGE_XML); - if(false === $out) { + $out = $this->loadChannelUri($this->escapePackageName($package) . "/" . $version . "/" . self::PACKAGE_XML); + if (false === $out) { return false; } return new Mage_Connect_Package($out); @@ -319,48 +340,51 @@ class Mage_Connect_Rest /** * Get package archive file of release + * + * @throws Exception * @param string $package package name - * @param string $version version + * @param string $version package version + * @param string $targetFile + * @return bool */ public function downloadPackageFileOfRelease($package, $version, $targetFile) { $package = $this->escapePackageName($package); $version = $this->escapePackageName($version); - - if(file_exists($targetFile)) { - $chksum = $this->loadChannelUri($package."/".$version."/checksum"); + if (file_exists($targetFile)) { + $chksum = $this->loadChannelUri($package . "/" . $version . "/checksum"); $statusCode = $this->getLoader()->getStatus(); - if($statusCode == 200) { - if(md5_file($targetFile) == $chksum) { + if ($statusCode == 200) { + if (md5_file($targetFile) == $chksum) { return true; } } } - - $out = $this->loadChannelUri($package."/".$version."/".$package."-".$version.".".self::EXT); + $out = $this->loadChannelUri($package . "/" . $version . "/" . $package . "-" . $version . "." . self::EXT); $statusCode = $this->getLoader()->getStatus(); - if($statusCode != 200) { + if ($statusCode != 200) { throw new Exception("Package not found: {$package} {$version}"); } $dir = dirname($targetFile); @mkdir($dir, 0777, true); $result = @file_put_contents($targetFile, $out); - if(false === $result) { + if (false === $result) { throw new Exception("Cannot write to file {$targetFile}"); } return true; } - protected $states = array('b'=>'beta', 'd'=>'dev', 's'=>'stable', 'a'=>'alpha'); - + /** + * Decode state + * + * @param string $s + * @return string + */ public function shortStateToLong($s) { return isset($this->states[$s]) ? $this->states[$s] : 'dev'; } - - } - diff --git a/downloader/lib/Mage/Connect/Singleconfig.php b/downloader/lib/Mage/Connect/Singleconfig.php index c02cd4a40993aea9439522db35679cda2d53458b..9766e9218d0958d14cb29d15e8d4509ed974596f 100644 --- a/downloader/lib/Mage/Connect/Singleconfig.php +++ b/downloader/lib/Mage/Connect/Singleconfig.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/downloader/lib/Mage/Connect/Structures/Graph.php b/downloader/lib/Mage/Connect/Structures/Graph.php index 8bcb9d73e895a727bb581f9477ed8231c6134af4..6e9410cde52cbc07da5549a95e6d4f83c0ff1502 100644 --- a/downloader/lib/Mage/Connect/Structures/Graph.php +++ b/downloader/lib/Mage/Connect/Structures/Graph.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/downloader/lib/Mage/Connect/Structures/Node.php b/downloader/lib/Mage/Connect/Structures/Node.php index 4abae479028c58041658b7269a20ab489d7c1d69..10265904d72de91e8a42d21c32d965e61c17f91d 100644 --- a/downloader/lib/Mage/Connect/Structures/Node.php +++ b/downloader/lib/Mage/Connect/Structures/Node.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/downloader/lib/Mage/Connect/Validator.php b/downloader/lib/Mage/Connect/Validator.php index ebebefc14f89c89610e7017412a5ca6750bd0e92..0310a2e2080683400ef3e8c1a23c4e7d4e5d0c16 100644 --- a/downloader/lib/Mage/Connect/Validator.php +++ b/downloader/lib/Mage/Connect/Validator.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -31,50 +31,56 @@ * @package Mage_Connect * @author Magento Core Team <core@magentocommerce.com> */ - class Mage_Connect_Validator { + /** + * Array of stability variants + * + * @var array + */ protected static $_stability = array(0=>'devel',1=>'alpha',2=>'beta',3=>'stable'); - + /** + * Get array of Stability variants + * + * @static + * @return array + */ public static function getStabilities() { return self::$_stability; } - - /** * Compare stabilities. Returns: * * -1 if the first stability is lower than the second * 0 if they are equal * 1 if the second is lower. - * @param $s1 - * @param $s2 - * @return int + * + * @param int|string $s1 + * @param int|string $s2 + * @return int|null */ public function compareStabilities($s1, $s2) { $list = $this->getStabilities(); $tmp = array_combine(array_values($list),array_keys($list)); - if(!isset($tmp[$s1], $tmp[$s2])) { + if (!isset($tmp[$s1], $tmp[$s2])) { throw new Exception("Invalid stability in compareStabilities argument"); } - - // 'stable' turns to 3 - // 'devel' turns to 0 $s1 = $tmp[$s1]; $s2 = $tmp[$s2]; - if($s1 === $s2) { + if ($s1 === $s2) { return 0; - } elseif($s1 > $s2) { + } elseif ($s1 > $s2) { return 1; - } elseif($s1 < $s2) { + } elseif ($s1 < $s2) { return -1; } + return null; } /** @@ -87,6 +93,7 @@ class Mage_Connect_Validator /** * Validate max len of string + * * @param string $str * @param int $maxLen * @return bool @@ -123,94 +130,103 @@ class Mage_Connect_Validator /** * Validate compatible data + * * @param array $data * @return bool */ public function validateCompatible(array $data) { - if(!count($data)) { + if (!count($data)) { /** * Allow empty */ return true; } $count = 0; - foreach($data as $k=>$v) { - foreach(array('name','channel','min','max') as $fld) { + foreach ($data as $v) { + /** + * Converts an array to variables + * @var $channel string Channel Name + * @var $name string Package Name + * @var $max string Maximum version number + * @var $min string Minimum version number + */ + foreach (array('name','channel','min','max') as $fld) { $$fld = trim($v[$fld]); - } - $count++; - - $res = $this->validateUrl($channel) && strlen($channel); - if(!$res) { - $this->addError("Invalid or empty channel in compat. #{$count}"); - } + } + $count++; - $res = $this->validatePackageName($name) && strlen($name); - if(!$res) { - $this->addError("Invalid or empty name in compat. #{$count}"); - } - $res1 = $this->validateVersion($min); - if(!$res1) { - $this->addError("Invalid or empty minVersion in compat. #{$count}"); - } - $res2 = $this->validateVersion($max); - if(!$res2) { - $this->addError("Invalid or empty maxVersion in compat. #{$count}"); - } - if($res1 && $res2 && $this->versionLower($max, $min)) { - $this->addError("Max version is lower than min in compat #{$count}"); - } + $res = $this->validateUrl($channel) && strlen($channel); + if (!$res) { + $this->addError("Invalid or empty channel in compatibility #{$count}"); + } + $res = $this->validatePackageName($name) && strlen($name); + if (!$res) { + $this->addError("Invalid or empty name in compatibility #{$count}"); + } + $res1 = $this->validateVersion($min); + if (!$res1) { + $this->addError("Invalid or empty minVersion in compatibility #{$count}"); + } + $res2 = $this->validateVersion($max); + if (!$res2) { + $this->addError("Invalid or empty maxVersion in compatibility #{$count}"); + } + if ($res1 && $res2 && $this->versionLower($max, $min)) { + $this->addError("Max version is lower than min in compatibility #{$count}"); + } } - return ! $this->hasErrors(); + return !$this->hasErrors(); } /** * Validate authors of package + * * @param array $authors * @return bool */ public function validateAuthors(array $authors) { - if(!count($authors)) { + if (!count($authors)) { $this->addError('Empty authors section'); return false; } $count = 0; - foreach($authors as $k=>$v) { + foreach ($authors as $v) { $count++; array_map('trim', $v); $name = $v['name']; $login = $v['user']; $email = $v['email']; $res = $this->validateMaxLen($name, 256) && strlen($name); - if(!$res) { + if (!$res) { $this->addError("Invalid or empty name for author #{$count}"); } - $res = $this->validatePackageName($login) && strlen($login); - if(!$res) { + $res = $this->validateAuthorName($login) && strlen($login); + if (!$res) { $this->addError("Invalid or empty login for author #{$count}"); } $res = $this->validateEmail($email); - if(!$res) { + if (!$res) { $this->addError("Invalid or empty email for author #{$count}"); } } - return ! $this->hasErrors(); + return !$this->hasErrors(); } - /** * Validator errors + * * @var array */ private $_errors = array(); /** * Add error + * * @param string $err - * @return + * @return void */ private function addError($err) { @@ -219,10 +235,10 @@ class Mage_Connect_Validator /** * Set validator errors + * * @param array $err - * @return + * @return void */ - private function setErrors(array $err) { $this->_errors = $err; @@ -230,7 +246,8 @@ class Mage_Connect_Validator /** * Clear validator errors - * @return + * + * @return void */ private function clearErrors() { @@ -239,23 +256,24 @@ class Mage_Connect_Validator /** * Check if there are validator errors set - * @return unknown_type + * + * @return int */ public function hasErrors() { return count($this->_errors) != 0; } - /** * Get errors + * * @param bool $clear if true after this call erros will be cleared * @return array */ public function getErrors($clear = true) { $out = $this->_errors; - if($clear) { + if ($clear) { $this->clearErrors(); } return $out; @@ -263,6 +281,7 @@ class Mage_Connect_Validator /** * Validate URL + * * @param string $str * @return bool */ @@ -274,9 +293,9 @@ class Mage_Connect_Validator return preg_match($regex, $str); } - /** * Validates package stability + * * @param string $str * @return bool */ @@ -287,6 +306,7 @@ class Mage_Connect_Validator /** * Validate date format + * * @param $date * @return bool */ @@ -294,13 +314,12 @@ class Mage_Connect_Validator { $subs = null; $check1 = preg_match("/^([\d]{4})-([\d]{2})-([\d]{2})$/i", $date, $subs); - if(!$check1) { + if (!$check1) { return false; } return checkdate($subs[2], $subs[3], $subs[1]); } - /** * Validate email * @param string $email @@ -321,8 +340,20 @@ class Mage_Connect_Validator return preg_match("/^[a-zA-Z0-9_]+$/i", $name); } + /** + * Validate author name + * + * @param string $name + * @return bool + */ + public function validateAuthorName($name) + { + return preg_match("/^[a-zA-Z0-9_-]+$/i", $name); + } + /** * Validate version number + * * @param string $version * @return bool */ @@ -333,6 +364,7 @@ class Mage_Connect_Validator /** * Check versions are equal + * * @param string $v1 * @param string $v2 * @return bool @@ -344,6 +376,7 @@ class Mage_Connect_Validator /** * Check version $v1 <= $v2 + * * @param string $v1 * @param string $v2 * @return bool @@ -353,9 +386,9 @@ class Mage_Connect_Validator return version_compare($v1, $v2, "le"); } - /** * Check if version $v1 lower than $v2 + * * @param string $v1 * @param string $v2 * @return bool @@ -367,6 +400,7 @@ class Mage_Connect_Validator /** * Check version $v1 >= $v2 + * * @param string $v1 * @param string $v2 * @return bool @@ -376,9 +410,9 @@ class Mage_Connect_Validator return version_compare($v1, $v2, "ge"); } - /** * Generic regex validation + * * @param string $str * @param string $regex * @return bool @@ -388,9 +422,9 @@ class Mage_Connect_Validator return preg_match($regex, $str); } - /** * Check if PHP extension loaded + * * @param string $name Extension name * @return bool */ @@ -399,15 +433,22 @@ class Mage_Connect_Validator return extension_loaded($name); } - + /** + * Validate PHP version + * + * @param string $min + * @param string $max + * @param string $ver + * @return bool + */ public function validatePHPVersion($min, $max, $ver = PHP_VERSION) { $minAccepted = true; - if($min) { + if ($min) { $minAccepted = version_compare($ver, $min, ">="); } $maxAccepted = true; - if($max) { + if ($max) { $maxAccepted = version_compare($ver, $max, "<="); } return (bool) $minAccepted && $maxAccepted; diff --git a/downloader/lib/Mage/DB/Exception.php b/downloader/lib/Mage/DB/Exception.php index 14038cfcdf59f9f8a71ca34f29c771a508e10df2..36d72fe7d1bdce739ff1c521029e272a5afa3361 100644 --- a/downloader/lib/Mage/DB/Exception.php +++ b/downloader/lib/Mage/DB/Exception.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_DB - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/downloader/lib/Mage/DB/Mysqli.php b/downloader/lib/Mage/DB/Mysqli.php index 7871e92f64db86e31757b83ba37fb7d330933ddc..5f7a4a683dfb0c7819456ac66c2b6f9fb909bf60 100644 --- a/downloader/lib/Mage/DB/Mysqli.php +++ b/downloader/lib/Mage/DB/Mysqli.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_DB - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/downloader/lib/Mage/Exception.php b/downloader/lib/Mage/Exception.php index 0f91be1c6da0ba0b885cd9399dcb9265e06958ac..87698fe658711b05377f500c88ce9cacda91dd80 100644 --- a/downloader/lib/Mage/Exception.php +++ b/downloader/lib/Mage/Exception.php @@ -19,8 +19,8 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category Mage - * @package Mage_Exception - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @package Mage + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -32,4 +32,4 @@ * @author Magento Core Team <core@magentocommerce.com> */ class Mage_Exception extends Exception -{} +{} \ No newline at end of file diff --git a/downloader/lib/Mage/HTTP/Client.php b/downloader/lib/Mage/HTTP/Client.php index 797b9f627a78ae6a93c746426edfa6adab832d89..5fa2d8cae90bbcba063647f37261cdbf6b6795e6 100644 --- a/downloader/lib/Mage/HTTP/Client.php +++ b/downloader/lib/Mage/HTTP/Client.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_HTTP - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -31,10 +31,8 @@ * @package Mage_Connect * @author Magento Core Team <core@magentocommerce.com> */ - class Mage_HTTP_Client { - /** * Disallow to instantiate - pvt constructor */ @@ -43,24 +41,24 @@ class Mage_HTTP_Client } - /** * Factory for HTTP client - * @param string/false $frontend 'curl'/'socket' or false for auto-detect + * + * @static + * @throws Exception + * @param string|bool $frontend 'curl'/'socket' or false for auto-detect * @return Mage_HTTP_IClient */ public static function getInstance($frontend = false) { - if(false === $frontend) - { + if (false === $frontend) { $frontend = self::detectFrontend(); } - if(false === $frontend) - { + if (false === $frontend) { throw new Exception("Cannot find frontend automatically, set it manually"); } - $class = __CLASS__."_".str_replace(' ', DIRECTORY_SEPARATOR, ucwords(str_replace('_', ' ', $frontend))); + $class = __CLASS__ . "_" . str_replace(' ', DIRECTORY_SEPARATOR, ucwords(str_replace('_', ' ', $frontend))); $obj = new $class(); return $obj; } @@ -73,10 +71,10 @@ class Mage_HTTP_Client */ protected static function detectFrontend() { - if(function_exists("curl_init")) { + if (function_exists("curl_init")) { return "curl"; } - if(function_exists("fsockopen")) { + if (function_exists("fsockopen")) { return "socket"; } return false; diff --git a/downloader/lib/Mage/HTTP/Client/Curl.php b/downloader/lib/Mage/HTTP/Client/Curl.php index 0840f185007906db8f9fc179a496b35982638abf..7ac2d0c912adeda583849bd46cb720569cf34e67 100644 --- a/downloader/lib/Mage/HTTP/Client/Curl.php +++ b/downloader/lib/Mage/HTTP/Client/Curl.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_HTTP - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/downloader/lib/Mage/HTTP/Client/Socket.php b/downloader/lib/Mage/HTTP/Client/Socket.php index 6a428f5f71cafc892594894a575852628d94b90c..5b3ef0a984289eaaf1dc9573e1732edbf9ec7473 100644 --- a/downloader/lib/Mage/HTTP/Client/Socket.php +++ b/downloader/lib/Mage/HTTP/Client/Socket.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_HTTP - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/downloader/lib/Mage/HTTP/IClient.php b/downloader/lib/Mage/HTTP/IClient.php index 1d351b88e5d13d74749c58d3f7c6eaaff8a1cd2c..90e92b5f45e0a3e333bebe4ad14dde3f93161828 100644 --- a/downloader/lib/Mage/HTTP/IClient.php +++ b/downloader/lib/Mage/HTTP/IClient.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_HTTP - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/downloader/lib/Mage/System/Args.php b/downloader/lib/Mage/System/Args.php index 3dd4442a4b385b1e7a3ff28acbd5fa95847f2792..416113b951f39d9968ecacc1d92c7c152d54570a 100644 --- a/downloader/lib/Mage/System/Args.php +++ b/downloader/lib/Mage/System/Args.php @@ -19,8 +19,8 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category Mage - * @package Mage_System - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @package Mage_Connect + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -59,7 +59,7 @@ class Mage_System_Args { $this->flags = array(); $this->filtered = array(); - + if(false === $source) { $argv = $GLOBALS['argv']; array_shift($argv); @@ -89,7 +89,7 @@ class Mage_System_Args } elseif(strlen($str) == 2 && $str[0] == '-') // -a { - $this->flags[$str[1]] = true; + $this->flags[$str[1]] = true; if(isset($argv[$i + 1]) && preg_match('/^--?.+/', $argv[$i + 1]) == 0) { $this->flags[$str[1]] = $argv[$i + 1]; $argv[$i + 1] = null; @@ -99,4 +99,4 @@ class Mage_System_Args } } } -} +} \ No newline at end of file diff --git a/downloader/lib/Mage/System/Dirs.php b/downloader/lib/Mage/System/Dirs.php index 866cf4c793c15bd22714f95267ecd92d75e3b1d9..e6fee86becc5406eb629c5106d0272086855d46f 100644 --- a/downloader/lib/Mage/System/Dirs.php +++ b/downloader/lib/Mage/System/Dirs.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_System - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_System_Dirs @@ -35,12 +35,12 @@ class Mage_System_Dirs if (!@file_exists($dirname)) { return false; } - + // Simple delete for a file if (@is_file($dirname) || @is_link($dirname)) { return unlink($dirname); } - + // Create and iterate stack $stack = array($dirname); while ($entry = array_pop($stack)) { @@ -49,12 +49,12 @@ class Mage_System_Dirs @unlink($entry); continue; } - + // Attempt to remove the directory if (@rmdir($entry)) { continue; } - + // Otherwise add it to the stack $stack[] = $entry; $dh = opendir($entry); @@ -62,7 +62,7 @@ class Mage_System_Dirs // Ignore pointers if ($child === '.' || $child === '..') { continue; - } + } // Unlink files and add directories to stack $child = $entry . DIRECTORY_SEPARATOR . $child; if (is_dir($child) && !is_link($child)) { @@ -72,33 +72,33 @@ class Mage_System_Dirs } } @closedir($dh); - } + } return true; - } - - + } + + public static function mkdirStrict($path, $recursive = true, $mode = 0777) { - $exists = file_exists($path); + $exists = file_exists($path); if($exists && is_dir($path)) { return true; } if($exists && !is_dir($path)) { throw new Exception("'{$path}' already exists, should be a dir, not a file!"); - } - $out = @mkdir($path, $mode, $recursive); + } + $out = @mkdir($path, $mode, $recursive); if(false === $out) { throw new Exception("Can't create dir: '{$path}'"); - } + } return true; } - + public static function copyFileStrict($source, $dest) { $exists = file_exists($source); if(!$exists) { throw new Exception('No file exists: '.$exists); } - + } -} +} \ No newline at end of file diff --git a/downloader/lib/Mage/System/Ftp.php b/downloader/lib/Mage/System/Ftp.php new file mode 100755 index 0000000000000000000000000000000000000000..d348981626e3ba6eba1ece01536aa7a410357787 --- /dev/null +++ b/downloader/lib/Mage/System/Ftp.php @@ -0,0 +1,509 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_System + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Class to work with remote FTP server + * + * @category Mage + * @package Mage_System + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_System_Ftp +{ + + /** + * Connection object + * + * @var resource + */ + protected $_conn = false; + + /** + * Check connected, throw exception if not + * + * @throws Exception + * @return void + */ + protected function checkConnected() + { + if(!$this->_conn) { + throw new Exception(__CLASS__." - no connection established with server"); + } + } + + /** + * ftp_mkdir wrapper + * + * @param sting $name + * @return unknown_type + */ + public function mdkir($name) + { + $this->checkConnected(); + return @ftp_mkdir($this->_conn, $name); + } + + /** + * Make dir recursive + * + * @param string $path + * @param int $mode + * @return bool + */ + public function mkdirRecursive($path, $mode = 0777) + { + $this->checkConnected(); + $dir = explode("/", $path); + $path= ""; + $ret = true; + for ($i=0; $i < count($dir); $i++) { + $path .= "/" .$dir[$i]; + if(!@ftp_chdir($this->_conn, $path)) { + @ftp_chdir($this->_conn,"/"); + if(!@ftp_mkdir($this->_conn,$path)) { + $ret=false; + break; + } else { + @ftp_chmod($this->_conn, $mode, $path); + } + } + } + return $ret; + } + + /** + * Try to login to server + * + * @param string $login + * @param string $password + * @throws Exception on invalid login credentials + * @return bool + */ + public function login($login = "anonymous", $password = "") + { + $this->checkConnected(); + $res = @ftp_login($this->_conn, $login, $password); + if(!$res) { + throw new Exception("Invalid login credentials"); + } + return $res; + } + + /** + * Validate connection string + * + * @param string $string + * @throws Exception + * @return string + */ + public function validateConnectionString($string) + { + $data = @parse_url($string); + if(false === $data) { + throw new Exception("Connection string invalid: '{$string}'"); + } + if($data['scheme'] != 'ftp') { + throw new Exception("Support for scheme unsupported: '{$data['scheme']}'"); + } + return $data; + } + + /** + * Connect to server using connect string + * Connection string: ftp://user:pass@server:port/path + * user,pass,port,path are optional parts + * + * @param string $string + * @param int $timeout + */ + public function connect($string, $timeout = 900) + { + $params = $this->validateConnectionString($string); + $port = isset($params['port']) ? intval($params['port']) : 21; + + $this->_conn = ftp_connect($params['host'], $port, $timeout); + + if(!$this->_conn) { + throw new Exception("Cannot connect to host: {$params['host']}"); + } + if(isset($params['user']) && isset($params['pass'])) { + $this->login($params['user'], $params['pass']); + } else { + $this->login(); + } + if(isset($params['path'])) { + if(!$this->chdir($params['path'])) { + throw new Exception ("Cannot chdir after login to: {$params['path']}"); + } + } + } + + /** + * ftp_fput wrapper + * + * @param string $remoteFile + * @param resource $handle + * @param int $mode FTP_BINARY | FTP_ASCII + * @param int $startPos + * @return bool + */ + public function fput($remoteFile, $handle, $mode = FTP_BINARY, $startPos = 0) + { + $this->checkConnected(); + return @ftp_fput($this->_conn, $remoteFile, $handle, $mode, $startPos); + } + + /** + * ftp_put wrapper + * + * @param string $remoteFile + * @param string $localFile + * @param int $mode FTP_BINARY | FTP_ASCII + * @param int $startPos + * @return bool + */ + public function put($remoteFile, $localFile, $mode = FTP_BINARY, $startPos = 0) + { + $this->checkConnected(); + return ftp_put($this->_conn, $remoteFile, $localFile, $mode, $startPos); + } + + /** + * Get current working directory + * + * @return mixed + */ + public function getcwd() + { + $d = $this->raw("pwd"); + $data = explode(" ", $d[0], 3); + if(empty($data[1])) { + return false; + } + if(intval($data[0]) != 257) { + return false; + } + $out = trim($data[1], '"'); + if($out !== "/") { + $out = rtrim($out, "/"); + } + return $out; + } + + /** + * ftp_raw wrapper + * + * @param string $cmd + * @return mixed + */ + public function raw($cmd) + { + $this->checkConnected(); + return @ftp_raw($this->_conn, $cmd); + } + + /** + * Upload local file to remote + * + * Can be used for relative and absoulte remote paths + * Relative: use chdir before calling this + * + * @param srting $remote + * @param string $local + * @param int $dirMode + * @param int $ftpMode + * @return unknown_type + */ + public function upload($remote, $local, $dirMode = 0777, $ftpMode = FTP_BINARY) + { + $this->checkConnected(); + + if(!file_exists($local)) { + throw new Exception("Local file doesn't exist: {$localFile}"); + } + if(!is_readable($local)) { + throw new Exception("Local file is not readable: {$localFile}"); + } + if(is_dir($local)) { + throw new Exception("Directory given instead of file: {$localFile}"); + } + + $globalPathMode = substr($remote, 0, 1) == "/"; + $dirname = dirname($remote); + $cwd = $this->getcwd(); + if(false === $cwd) { + throw new Exception("Server returns something awful on PWD command"); + } + + if(!$globalPathMode) { + $dirname = $cwd."/".$dirname; + $remote = $cwd."/".$remote; + } + $res = $this->mkdirRecursive($dirname, $dirMode); + $this->chdir($cwd); + + if(!$res) { + return false; + } + return $this->put($remote, $local, $ftpMode); + } + + /** + * Download remote file to local machine + * + * @param string $remote + * @param string $local + * @param int $ftpMode FTP_BINARY|FTP_ASCII + * @return bool + */ + public function download($remote, $local, $ftpMode = FTP_BINARY) + { + $this->checkConnected(); + return $this->get($local, $remote, $ftpMode); + } + + /** + * ftp_pasv wrapper + * + * @param bool $pasv + * @return bool + */ + public function pasv($pasv) + { + $this->checkConnected(); + return @ftp_pasv($this->_conn, (bool) $pasv); + } + + /** + * Close FTP connection + * + * @return void + */ + public function close() + { + if($this->_conn) { + @ftp_close($this->_conn); + } + } + + /** + * ftp_chmod wrapper + * + * @param $mode + * @param $remoteFile + * @return bool + */ + public function chmod($mode, $remoteFile) + { + $this->checkConnected(); + return @ftp_chmod($this->_conn, $mode, $remoteFile); + } + + /** + * ftp_chdir wrapper + * + * @param string $dir + * @return bool + */ + public function chdir($dir) + { + $this->checkConnected(); + return @ftp_chdir($this->_conn, $dir); + } + + /** + * ftp_cdup wrapper + * + * @return bool + */ + public function cdup() + { + $this->checkConnected(); + return @ftp_cdup($this->_conn); + } + + /** + * ftp_get wrapper + * + * @param string $localFile + * @param string $remoteFile + * @param int $fileMode FTP_BINARY | FTP_ASCII + * @param int $resumeOffset + * @return bool + */ + public function get($localFile, $remoteFile, $fileMode = FTP_BINARY, $resumeOffset = 0) + { + $remoteFile = $this->correctFilePath($remoteFile); + $this->checkConnected(); + return @ftp_get($this->_conn, $localFile, $remoteFile, $fileMode, $resumeOffset); + } + + /** + * ftp_nlist wrapper + * + * @param string $dir + * @return bool + */ + public function nlist($dir = "/") + { + $this->checkConnected(); + $dir = $this->correctFilePath($dir); + return @ftp_nlist($this->_conn, $dir); + } + + /** + * ftp_rawlist wrapper + * + * @param string $dir + * @param bool $recursive + * @return mixed + */ + public function rawlist( $dir = "/", $recursive = false ) + { + $this->checkConnected(); + $dir = $this->correctFilePath($dir); + return @ftp_rawlist($this->_conn, $dir, $recursive); + } + + /** + * Convert byte count to float KB/MB format + * + * @param int $bytes + * @return string + */ + public static function byteconvert($bytes) + { + $symbol = array('B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'); + $exp = floor( log($bytes) / log(1024) ); + return sprintf( '%.2f ' . $symbol[ $exp ], ($bytes / pow(1024, floor($exp))) ); + } + + /** + * Chmod string "-rwxrwxrwx" to "777" converter + * + * @param string $chmod + * @return string + */ + public static function chmodnum($chmod) + { + $trans = array('-' => '0', 'r' => '4', 'w' => '2', 'x' => '1'); + $chmod = substr(strtr($chmod, $trans), 1); + $array = str_split($chmod, 3); + return array_sum(str_split($array[0])) . array_sum(str_split($array[1])) . array_sum(str_split($array[2])); + } + + /** + * Check whether file exists + * + * @param string $path + * @param bool $excludeIfIsDir + * @return bool + */ + public function fileExists($path, $excludeIfIsDir = true) + { + $path = $this->correctFilePath($path); + $globalPathMode = substr($path, 0, 1) == "/"; + + $file = basename($path); + $dir = $globalPathMode ? dirname($path) : $this->getcwd()."/".$path; + $data = $this->ls($dir); + foreach($data as $row) { + if($file == $row['name']) { + if($excludeIfIsDir && $row['dir']) { + continue; + } + return true; + } + } + return false; + } + + /** + * Get directory contents in PHP array + * + * @param string $dir + * @param bool $recursive + * @return array + */ + public function ls($dir = "/", $recursive = false) + { + $dir= $this->correctFilePath($dir); + $rawfiles = (array) $this->rawlist($dir, $recursive); + $structure = array(); + $arraypointer = &$structure; + foreach ($rawfiles as $rawfile) { + if ($rawfile[0] == '/') { + $paths = array_slice(explode('/', str_replace(':', '', $rawfile)), 1); + $arraypointer = &$structure; + foreach ($paths as $path) { + foreach ($arraypointer as $i => $file) { + if ($file['name'] == $path) { + $arraypointer = &$arraypointer[ $i ]['children']; + break; + } + } + } + } elseif(!empty($rawfile)) { + $info = preg_split("/[\s]+/", $rawfile, 9); + $arraypointer[] = array( + 'name' => $info[8], + 'dir' => $info[0]{0} == 'd', + 'size' => (int) $info[4], + 'chmod' => self::chmodnum($info[0]), + 'rawdata' => $info, + 'raw' => $rawfile + ); + } + } + return $structure; + } + + /** + * Correct file path + * + * @param string $str + * @return string + */ + public function correctFilePath($str) + { + $str = str_replace("\\", "/", $str); + $str = preg_replace("/^.\//", "", $str); + return $str; + } + + /** + * Delete file + * + * @param string $file + * @return bool + */ + public function delete($file) + { + $this->checkConnected(); + $file = $this->correctFilePath($file); + return @ftp_delete($this->_conn, $file); + } +} diff --git a/downloader/lib/Mage/Xml/Generator.php b/downloader/lib/Mage/Xml/Generator.php index 79eb709eba025a82afe62e148b129ad1f5fbd905..a66f73c12068163ff308f0fd3f335890c700909a 100644 --- a/downloader/lib/Mage/Xml/Generator.php +++ b/downloader/lib/Mage/Xml/Generator.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Xml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Xml_Generator diff --git a/downloader/lib/Mage/Xml/Parser.php b/downloader/lib/Mage/Xml/Parser.php index 5411c2d7abff7d2125eb6d5cf1056434c1931607..31912941a3e34fa9bf2caeb214617132035cbc80 100644 --- a/downloader/lib/Mage/Xml/Parser.php +++ b/downloader/lib/Mage/Xml/Parser.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Xml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ class Mage_Xml_Parser diff --git a/downloader/mage.php b/downloader/mage.php index eaf65a78e0fffe1c480ae1c6600734c72e808add..13a68d5941735b3eed9c10833573804cbf264ae1 100644 --- a/downloader/mage.php +++ b/downloader/mage.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/downloader/skin/boxes.css b/downloader/skin/boxes.css index f35d2366471e93998abba7b798e37a6eb35ac1be..e17bc0fdfc958efe27a441b6861e98f964dddb90 100644 --- a/downloader/skin/boxes.css +++ b/downloader/skin/boxes.css @@ -19,7 +19,7 @@ * * @category design * @package default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /* diff --git a/downloader/skin/ie7boxes.css b/downloader/skin/ie7boxes.css index 01b21b645bbbb6f5fd6fcb9c5319cd82549765cb..9e845a2fb8b4af85f17b94b6fe4089bb7e10c68c 100644 --- a/downloader/skin/ie7boxes.css +++ b/downloader/skin/ie7boxes.css @@ -19,7 +19,7 @@ * * @category design * @package default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ .main { height:auto !important; } diff --git a/downloader/skin/ieboxes.css b/downloader/skin/ieboxes.css index 13c0deef26a10655aea6a3c205715c865b1091d5..363647beab7d4c5a2960ed90d6f8eff1d80cc45d 100644 --- a/downloader/skin/ieboxes.css +++ b/downloader/skin/ieboxes.css @@ -19,7 +19,7 @@ * * @category design * @package default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ button, .form-button { filter:chroma(color=#000000); overflow:visible; width:auto; } diff --git a/downloader/skin/install/boxes.css b/downloader/skin/install/boxes.css index eef0413bcd4af49b22bd4c7ff81794a59083e22b..4a68125f861fe93af1d63c980d856b3f3295034b 100644 --- a/downloader/skin/install/boxes.css +++ b/downloader/skin/install/boxes.css @@ -19,7 +19,7 @@ * * @category design * @package default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/downloader/skin/install/clears.css b/downloader/skin/install/clears.css index 4edc49323a29d4275eae8bfaf19a27774a68c7de..6faf5a2c906f5a42462503b9faa4d80aecc39a3b 100644 --- a/downloader/skin/install/clears.css +++ b/downloader/skin/install/clears.css @@ -19,7 +19,7 @@ * * @category design * @package default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/downloader/skin/install/ie7minus.css b/downloader/skin/install/ie7minus.css index fbe2dc3afb37e95a8bc3e5d9cd6b6f4f5eeb67b8..387afa1f8b811d01591a929b63ed70255308fb31 100644 --- a/downloader/skin/install/ie7minus.css +++ b/downloader/skin/install/ie7minus.css @@ -19,7 +19,7 @@ * * @category design * @package default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/downloader/skin/install/iestyles.css b/downloader/skin/install/iestyles.css index 7154566a3208449b8f25d9a13b46217ca8177bfb..753e7905634e0987b203a9bc1b8798e1af1d0eda 100644 --- a/downloader/skin/install/iestyles.css +++ b/downloader/skin/install/iestyles.css @@ -19,7 +19,7 @@ * * @category design * @package default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ .col2-set, diff --git a/downloader/skin/install/reset.css b/downloader/skin/install/reset.css index 177f95b69851fedb273c661388506e50e7618a18..9c54b4e305d6c1487d025653383e5f6d38775dd8 100644 --- a/downloader/skin/install/reset.css +++ b/downloader/skin/install/reset.css @@ -19,7 +19,7 @@ * * @category design * @package default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /******************************************/ diff --git a/downloader/target.xml b/downloader/target.xml index a40d45a4f805db7b20866a47380cd30f68e482aa..1ccf13fef8e485b33092e512b18027584a80fc8d 100644 --- a/downloader/target.xml +++ b/downloader/target.xml @@ -21,7 +21,7 @@ * * @category design * @package default_default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/downloader/template/connect/iframe.phtml b/downloader/template/connect/iframe.phtml index a20161c48c73c0accb9700e887da87a9ed4d6778..2a03f4bbb09ccc8f0dcac8ab516a5b7c040d44e2 100644 --- a/downloader/template/connect/iframe.phtml +++ b/downloader/template/connect/iframe.phtml @@ -20,7 +20,7 @@ * * @category design * @package default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -51,7 +51,11 @@ function confirmExit() function onSubmit(formObj) { - if(formObj)formObj.action = addParamToUrl(formObj.action, 'maintenance', (top.$('maintenance').checked === true ? '1' : '0')); + if(formObj){ + formObj.action = addParamToUrl(formObj.action, 'maintenance', (top.$('maintenance').checked === true ? '1' : '0')); + formObj.action = addParamToUrl(formObj.action, 'archive_type', top.$('is_backup').checked === true ? top.$('archive_type').value:0); + formObj.action = addParamToUrl(formObj.action, 'backup_name', top.$('backup_name').value); + } top.$('connect_iframe_success').style.display = 'none'; top.$('connect_iframe_failure').style.display = 'none'; top.$('connect_iframe_container').style.display = ''; diff --git a/downloader/template/connect/packages.phtml b/downloader/template/connect/packages.phtml index 459feb098aa8e00d072d4e36033deedb40544be3..a0a3d812d9eb890d267366316f653eea721ef395 100644 --- a/downloader/template/connect/packages.phtml +++ b/downloader/template/connect/packages.phtml @@ -20,7 +20,7 @@ * * @category design * @package default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -30,17 +30,54 @@ <h4>Settings</h4> </div> <ul class="bare-list"> -<li><input type="checkbox" id="maintenance" value="1" checked="checked" /> -<label for="maintenance">Put store on the maintenance mode while installing/upgrading</label> -</li> + <li> + <input type="checkbox" id="maintenance" value="1" checked="checked" /> + <label for="maintenance">Put store on the maintenance mode while installing/upgrading/backup creating</label> + </li> + <li> + <table cellpadding="0" cellspacing="0"> + <tr> + <td rowspan="2" valign="top"> + <input type="checkbox" id="is_backup" value="1" /> + </td> + <td> + <label for="is_backup">Create Backup</label> + </td> + <td> + <select id="archive_type" style="width: 320px;"> + <option value="1">Database</option> + <option value="4">Database and Media</option> + <option value="2">System</option> + <option value="3">System (excluding Media)</option> + </select> + </td> + </tr> + <tr id="backup-name-container" style="display: none; margin-top: 5px;"> + <td> + <label for="backup_name">Backup Name</label> + </td> + <td> + <input type="text" name="backup_name" id="backup_name" style="width: 320px; margin-top:8px;"/> + </td> + </tr> + </table> + </li> </ul> - <div class="bar-head"> <h4>Install New Extensions</h4> </div> <script type="text/javascript"> <!-- - function connectPrepare(form) { +changeAvailableArchiveStatus = function (){ + $('archive_type').disabled = !$('is_backup').checked; + $('is_backup').checked ? $('backup-name-container').show() : $('backup-name-container').hide(); + $('backup_name').value = ''; +} + +Event.observe('is_backup', 'change', changeAvailableArchiveStatus); +Event.observe(window, 'load', changeAvailableArchiveStatus); + +function connectPrepare(form) { new Ajax.Request(form.action, { method:'post', parameters: {install_package_id: form.install_package_id.value}, diff --git a/downloader/template/connect/packages_prepare.phtml b/downloader/template/connect/packages_prepare.phtml index 36d2198d9c182ce57c2c873ecb81035847656e08..f9370b3646d83a2b553c6d45d4c60572b173eb9e 100644 --- a/downloader/template/connect/packages_prepare.phtml +++ b/downloader/template/connect/packages_prepare.phtml @@ -20,7 +20,7 @@ * * @category design * @package default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/downloader/template/exception.phtml b/downloader/template/exception.phtml index c961fa45be3e10c4ad911aa3fb0dfd681d66285e..000c3e21e2d9465ea3f2137c42e0b088d8a2f1a0 100644 --- a/downloader/template/exception.phtml +++ b/downloader/template/exception.phtml @@ -20,7 +20,7 @@ * * @category design * @package default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/downloader/template/footer.phtml b/downloader/template/footer.phtml index 0733e19cf5f83d94f4b01173161900efcab61530..372e7e15cfb4d20d0a01f898dd83bf1def485efe 100755 --- a/downloader/template/footer.phtml +++ b/downloader/template/footer.phtml @@ -20,7 +20,7 @@ * * @category design * @package default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/downloader/template/header.phtml b/downloader/template/header.phtml index 0f4fc494dfe951cb27c7300d07b3c72c0773bb86..e48fab01db8858d2427a60caaf544a7fe4fa1371 100644 --- a/downloader/template/header.phtml +++ b/downloader/template/header.phtml @@ -20,7 +20,7 @@ * * @category design * @package default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/downloader/template/index.phtml b/downloader/template/index.phtml index 5a6c59b911e060079c14e4873bc413f30e6264fe..fc7b1ea57ff5d4699168167d2a06b18cf17051b9 100755 --- a/downloader/template/index.phtml +++ b/downloader/template/index.phtml @@ -20,7 +20,7 @@ * * @category design * @package default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/downloader/template/install/download.phtml b/downloader/template/install/download.phtml index 488e7147f545212fe654161a664253ac6fd2ee1c..2099c14b1845a14e7ffd981f7a3fe53401140012 100644 --- a/downloader/template/install/download.phtml +++ b/downloader/template/install/download.phtml @@ -20,7 +20,7 @@ * * @category design * @package default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> @@ -41,13 +41,13 @@ <button class="form-button" type="button" onclick="location.href='<?php echo $this->mageUrl() ?>'"><span>Continue Magento installation</span></button> <br/><br/><br/> <p>Alternatively, you could proceed with Re-Downloading all packages</p> - <?php echo($this->get('channel_notice')); ?> + <?php echo($this->get('channel_notice')); ?> <form id="reinstall_all" method="post" action="<?php echo $this->url('connectInstallAll') ?>&force=1" target="connect_iframe" onsubmit="return installAll(true)"> <fieldset class="fieldset-download"> <?php endif; ?> <table cellspacing="0" class="form-list"> - <tr> + <tr> <td class="label">Magento Connect Channel Protocol:</td> <td class="value"> <select id="protocol" name="protocol"> @@ -55,8 +55,18 @@ <option value="ftp" <?php if ($this->get('protocol')=='ftp'):?>selected="selected"<?php endif ?>>Ftp</option> </select> </td> - </tr> - <?php echo($this->get('channel_protocol_fields')); ?> + </tr> + <?php echo($this->get('channel_protocol_fields')); ?> + <tr> + <td class="label">Magento Version Stability:</td> + <td class="value"> + <select id="preferred_state" name="preferred_state"> + <option value="stable" <?php if ($this->get('preferred_state') == 'stable'):?>selected="selected"<?php endif ?>>stable</option> + <option value="beta" <?php if ($this->get('preferred_state') == 'beta'):?>selected="selected"<?php endif ?>>beta</option> + <option value="alpha" <?php if ($this->get('preferred_state') == 'alpha'):?>selected="selected"<?php endif ?>>alpha</option> + </select> + </td> + </tr> <tr> <td class="label">Use Custom Permissions:</td> <td class="value"> @@ -71,13 +81,13 @@ <tr> <td class="label">Folders:</td> <td class="value"> - <input id="mkdir_mode" name="mkdir_mode" value="<?php echo($this->get('mkdir_mode'));?>" type="text" class="input-text"></input> + <input id="mkdir_mode" name="mkdir_mode" value="<?php echo($this->get('mkdir_mode'));?>" type="text" class="input-text"/> </td> </tr> <tr> <td class="label">Files:</td> <td class="value"> - <input id="chmod_file_mode" name="chmod_file_mode" value="<?php echo($this->get('chmod_file_mode'));?>" type="text" class="input-text"></input> + <input id="chmod_file_mode" name="chmod_file_mode" value="<?php echo($this->get('chmod_file_mode'));?>" type="text" class="input-text"/> </td> </tr> </table> diff --git a/downloader/template/install/footer.phtml b/downloader/template/install/footer.phtml index 9c7e422c9c7b66d83fd16a287fd4266518f357e0..385246b378cc7fe2d2807b8e50511716d7122334 100644 --- a/downloader/template/install/footer.phtml +++ b/downloader/template/install/footer.phtml @@ -20,7 +20,7 @@ * * @category design * @package default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/downloader/template/install/header.phtml b/downloader/template/install/header.phtml index 07c92673c4d020e17acd7d81a6ef8c1d3af8363b..c259f1a659a43cdc573cfd35e415fb0972e83acb 100644 --- a/downloader/template/install/header.phtml +++ b/downloader/template/install/header.phtml @@ -20,7 +20,7 @@ * * @category design * @package default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/downloader/template/install/writable.phtml b/downloader/template/install/writable.phtml index 30c0bd88e017f9bf7dc165c20020fe85bd0a6f6d..38809447e5fa14be07484d124aaab84e24f39194 100644 --- a/downloader/template/install/writable.phtml +++ b/downloader/template/install/writable.phtml @@ -20,7 +20,7 @@ * * @category design * @package default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/downloader/template/login.phtml b/downloader/template/login.phtml index 5221b2452461d9906450e2d66edceeac1a91bf94..71fdffb92f39b3fe23ec23acc4ba3a35a66b2601 100755 --- a/downloader/template/login.phtml +++ b/downloader/template/login.phtml @@ -20,7 +20,7 @@ * * @category design * @package default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/downloader/template/messages.phtml b/downloader/template/messages.phtml index 4a0cf4dcb31559097bdcf1d1ac3db0e69d1f42bb..ec5acdbf1203b0a153b91cbdf7e25ade503287b1 100755 --- a/downloader/template/messages.phtml +++ b/downloader/template/messages.phtml @@ -20,7 +20,7 @@ * * @category design * @package default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/downloader/template/noroute.phtml b/downloader/template/noroute.phtml index 3c88a577160b3a9e9112a08778a87cc5e561370d..fd34843b4b2558d3a2eccc73d8a7367380268f10 100755 --- a/downloader/template/noroute.phtml +++ b/downloader/template/noroute.phtml @@ -20,7 +20,7 @@ * * @category design * @package default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/downloader/template/settings.phtml b/downloader/template/settings.phtml index 61ea08db4fa4b350fed27c989e5157dfc7d9930a..d05a3dfd67759c825f48db29550a822ee28dd3eb 100755 --- a/downloader/template/settings.phtml +++ b/downloader/template/settings.phtml @@ -20,7 +20,7 @@ * * @category design * @package default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/downloader/template/writable.phtml b/downloader/template/writable.phtml index 9572eb5389c5a15cfaa46000ffd9b6ef40b71a26..556b28dbfb03b58dcdd473c72502373c65d08e9d 100755 --- a/downloader/template/writable.phtml +++ b/downloader/template/writable.phtml @@ -20,7 +20,7 @@ * * @category design * @package default - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/index.php b/index.php index 645fec8f1a74aec6acc1237d3a7266899456e4b8..65f5ca00090b6de7d81b5617e3a8c74063136cd6 100644 --- a/index.php +++ b/index.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/index.php.sample b/index.php.sample index e15c51c5097fb00b639dc87117d120511ec9e940..763066a3f281f9227585a000cb88b41027bc8a2c 100644 --- a/index.php.sample +++ b/index.php.sample @@ -20,7 +20,7 @@ * * @category Mage * @package Mage - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Mage/Archive.php b/lib/Mage/Archive.php index 7685b2668a95d8a0c58ccf4deeabeea467d5249b..99dcd09c6b15d678e3ab2d465ba4bca8b459f747 100644 --- a/lib/Mage/Archive.php +++ b/lib/Mage/Archive.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Archive - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -143,7 +143,8 @@ class Mage_Archive * * @param string $source * @param string $destination - * @param boolean $tillTar + * @param bool $tillTar + * @param bool $clearInterm * @return string Path to file */ public function unpack($source, $destination='.', $tillTar=false, $clearInterm = true) @@ -160,9 +161,7 @@ class Mage_Archive $packed = rtrim($destination, DS) . DS . '~tmp-'. microtime(true) . $archivers[$i-1] . '.' . $archivers[$i-1]; } $source = $this->_getArchiver($archivers[$i])->unpack($source, $packed); - - //var_dump($packed, $source); - + if ($clearInterm && $interimSource && $i >= 0) { unlink($interimSource); } @@ -218,5 +217,4 @@ class Mage_Archive } return false; } - -} \ No newline at end of file +} diff --git a/lib/Mage/Archive/Abstract.php b/lib/Mage/Archive/Abstract.php index ec8ccf0a60615743f3f9fee76c0b08faa3c3267c..2aece18795558b642db83fcd7acb43aea1b65a27 100644 --- a/lib/Mage/Archive/Abstract.php +++ b/lib/Mage/Archive/Abstract.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Archive - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -34,14 +34,16 @@ class Mage_Archive_Abstract { /** - * Write data to file. If file can't be opened, + * Write data to file. If file can't be opened - throw exception * * @param string $destination * @param string $data * @return boolean + * @throws Mage_Exception */ protected function _writeFile($destination, $data) { + $destination = trim($destination); if(false === file_put_contents($destination, $data)) { throw new Mage_Exception("Can't write to file: " . $destination); } @@ -53,6 +55,7 @@ class Mage_Archive_Abstract * * @param string $source * @return string + * @throws Mage_Exception */ protected function _readFile($source) { @@ -70,7 +73,8 @@ class Mage_Archive_Abstract * Get file name from source (URI) without last extension. * * @param string $source - * @return string + * @param bool $withExtension + * @return mixed|string */ public function getFilename($source, $withExtension=false) { @@ -80,5 +84,4 @@ class Mage_Archive_Abstract } return $file; } - -} \ No newline at end of file +} diff --git a/lib/Mage/Archive/Bz.php b/lib/Mage/Archive/Bz.php index 21c5c7e9963f99cf6209fd8c906d1c46e4a9f449..c76b62049efa03dfe79e2d934117d8c3d1f0cdf7 100644 --- a/lib/Mage/Archive/Bz.php +++ b/lib/Mage/Archive/Bz.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Archive - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -43,9 +43,19 @@ class Mage_Archive_Bz extends Mage_Archive_Abstract implements Mage_Archive_Inte */ public function pack($source, $destination) { - $data = $this->_readFile($source); - $bzData = bzcompress($data, 9); - $this->_writeFile($destination, $bzData); + $fileReader = new Mage_Archive_Helper_File($source); + $fileReader->open('r'); + + $archiveWriter = new Mage_Archive_Helper_File_Bz($destination); + $archiveWriter->open('w'); + + while (!$fileReader->eof()) { + $archiveWriter->write($fileReader->read()); + } + + $fileReader->close(); + $archiveWriter->close(); + return $destination; } @@ -58,21 +68,21 @@ class Mage_Archive_Bz extends Mage_Archive_Abstract implements Mage_Archive_Inte */ public function unpack($source, $destination) { - $data = ''; - $bzPointer = bzopen($source, 'r' ); - if (empty($bzPointer)) { - throw new Exception('Can\'t open BZ archive : ' . $source); - } - while (!feof($bzPointer)) { - $data .= bzread($bzPointer, 131072); - } - bzclose($bzPointer); if (is_dir($destination)) { $file = $this->getFilename($source); $destination = $destination . $file; } - echo $destination; - $this->_writeFile($destination, $data); + + $archiveReader = new Mage_Archive_Helper_File_Bz($source); + $archiveReader->open('r'); + + $fileWriter = new Mage_Archive_Helper_File($destination); + $fileWriter->open('w'); + + while (!$archiveReader->eof()) { + $fileWriter->write($archiveReader->read()); + } + return $destination; } diff --git a/lib/Mage/Archive/Gz.php b/lib/Mage/Archive/Gz.php index 4600d5f643e91f814dc7521d2b0d5f6640e20e14..6c213543d0d85db064f8d2ae62eac33e8159cb77 100644 --- a/lib/Mage/Archive/Gz.php +++ b/lib/Mage/Archive/Gz.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Archive - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -42,9 +42,19 @@ class Mage_Archive_Gz extends Mage_Archive_Abstract implements Mage_Archive_Inte */ public function pack($source, $destination) { - $data = $this->_readFile($source); - $gzData = gzencode($data, 9); - $this->_writeFile($destination, $gzData); + $fileReader = new Mage_Archive_Helper_File($source); + $fileReader->open('r'); + + $archiveWriter = new Mage_Archive_Helper_File_Gz($destination); + $archiveWriter->open('wb9'); + + while (!$fileReader->eof()) { + $archiveWriter->write($fileReader->read()); + } + + $fileReader->close(); + $archiveWriter->close(); + return $destination; } @@ -57,21 +67,21 @@ class Mage_Archive_Gz extends Mage_Archive_Abstract implements Mage_Archive_Inte */ public function unpack($source, $destination) { - $gzPointer = gzopen($source, 'r' ); - if (empty($gzPointer)) { - throw new Mage_Exception('Can\'t open GZ archive : ' . $source); - } - $data = ''; - while (!gzeof($gzPointer)) { - $data .= gzread($gzPointer, 131072); - } - gzclose($gzPointer); if (is_dir($destination)) { $file = $this->getFilename($source); $destination = $destination . $file; } - $this->_writeFile($destination, $data); + + $archiveReader = new Mage_Archive_Helper_File_Gz($source); + $archiveReader->open('r'); + + $fileWriter = new Mage_Archive_Helper_File($destination); + $fileWriter->open('w'); + + while (!$archiveReader->eof()) { + $fileWriter->write($archiveReader->read()); + } + return $destination; } - } \ No newline at end of file diff --git a/lib/Mage/Archive/Helper/File.php b/lib/Mage/Archive/Helper/File.php new file mode 100644 index 0000000000000000000000000000000000000000..0487263389445ddf9224cd52f0e04bff75baa488 --- /dev/null +++ b/lib/Mage/Archive/Helper/File.php @@ -0,0 +1,274 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Archive + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** +* Helper class that simplifies files stream reading and writing +* +* @category Mage +* @package Mage_Archive +* @author Magento Core Team <core@magentocommerce.com> +*/ +class Mage_Archive_Helper_File +{ + /** + * Full path to directory where file located + * + * @var string + */ + protected $_fileLocation; + + /** + * File name + * + * @var string + */ + protected $_fileName; + + /** + * Full path (directory + filename) to file + * + * @var string + */ + protected $_filePath; + + /** + * File permissions that will be set if file opened in write mode + * + * @var int + */ + protected $_chmod; + + /** + * File handler + * + * @var pointer + */ + protected $_fileHandler; + + /** + * Set file path via constructor + * + * @param string $filePath + */ + public function __construct($filePath) + { + $pathInfo = pathinfo($filePath); + + $this->_filePath = $filePath; + $this->_fileLocation = isset($pathInfo['dirname']) ? $pathInfo['dirname'] : ''; + $this->_fileName = isset($pathInfo['basename']) ? $pathInfo['basename'] : ''; + } + + /** + * Close file if it's not closed before object destruction + */ + public function __destruct() + { + if ($this->_fileHandler) { + $this->_close(); + } + } + + /** + * Open file + * + * @param string $mode + * @param int $chmod + * @throws Mage_Exception + */ + public function open($mode = 'w+', $chmod = 0666) + { + if ($this->_isWritableMode($mode)) { + if (!is_writable($this->_fileLocation)) { + throw new Mage_Exception('Permission denied to write to ' . $this->_fileLocation); + } + + if (is_file($this->_filePath) && !is_writable($this->_filePath)) { + throw new Mage_Exception("Can't open file " . $this->_fileName . " for writing. Permission denied."); + } + } + + if ($this->_isReadableMode($mode) && (!is_file($this->_filePath) || !is_readable($this->_filePath))) { + if (!is_file($this->_filePath)) { + throw new Mage_Exception('File ' . $this->_filePath . ' does not exist'); + } + + if (!is_readable($this->_filePath)) { + throw new Mage_Exception('Permission denied to read file ' . $this->_filePath); + } + } + + $this->_open($mode); + + $this->_chmod = $chmod; + } + + /** + * Write data to file + * + * @param string $data + */ + public function write($data) + { + $this->_checkFileOpened(); + $this->_write($data); + } + + /** + * Read data from file + * + * @param int $length + * @return string|boolean + */ + public function read($length = 4096) + { + $data = false; + $this->_checkFileOpened(); + if ($length > 0) { + $data = $this->_read($length); + } + + return $data; + } + + /** + * Check whether end of file reached + * + * @return boolean + */ + public function eof() + { + $this->_checkFileOpened(); + return $this->_eof(); + } + + /** + * Close file + */ + public function close() + { + $this->_checkFileOpened(); + $this->_close(); + $this->_fileHandler = false; + @chmod($this->_filePath, $this->_chmod); + } + + /** + * Implementation of file opening + * + * @param string $mode + * @throws Mage_Exception + */ + protected function _open($mode) + { + $this->_fileHandler = @fopen($this->_filePath, $mode); + + if (false === $this->_fileHandler) { + throw new Mage_Exception('Failed to open file ' . $this->_filePath); + } + } + + /** + * Implementation of writing data to file + * + * @param string $data + * @throws Mage_Exception + */ + protected function _write($data) + { + $result = @fwrite($this->_fileHandler, $data); + + if (false === $result) { + throw new Mage_Exception('Failed to write data to ' . $this->_filePath); + } + } + + /** + * Implementation of file reading + * + * @param int $length + * @throws Mage_Exception + */ + protected function _read($length) + { + $result = fread($this->_fileHandler, $length); + + if (false === $result) { + throw new Mage_Exception('Failed to read data from ' . $this->_filePath); + } + + return $result; + } + + /** + * Implementation of EOF indicator + * + * @return boolean + */ + protected function _eof() + { + return feof($this->_fileHandler); + } + + /** + * Implementation of file closing + */ + protected function _close() + { + fclose($this->_fileHandler); + } + + /** + * Check whether requested mode is writable mode + * + * @param string $mode + */ + protected function _isWritableMode($mode) + { + return preg_match('/(^[waxc])|(\+$)/', $mode); + } + + /** + * Check whether requested mode is readable mode + * + * @param string $mode + */ + protected function _isReadableMode($mode) { + return !$this->_isWritableMode($mode); + } + + /** + * Check whether file is opened + * + * @throws Mage_Exception + */ + protected function _checkFileOpened() + { + if (!$this->_fileHandler) { + throw new Mage_Exception('File not opened'); + } + } +} diff --git a/lib/Mage/Archive/Helper/File/Bz.php b/lib/Mage/Archive/Helper/File/Bz.php new file mode 100644 index 0000000000000000000000000000000000000000..3cce1ad126ab55c50351c8a886ee97fbf03cc445 --- /dev/null +++ b/lib/Mage/Archive/Helper/File/Bz.php @@ -0,0 +1,92 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Archive + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** +* Helper class that simplifies bz2 files stream reading and writing +* +* @category Mage +* @package Mage_Archive +* @author Magento Core Team <core@magentocommerce.com> +*/ +class Mage_Archive_Helper_File_Bz extends Mage_Archive_Helper_File +{ + /** + * Open bz archive file + * + * @throws Mage_Exception + * @param string $mode + */ + protected function _open($mode) + { + $this->_fileHandler = @bzopen($this->_filePath, $mode); + + if (false === $this->_fileHandler) { + throw new Mage_Exception('Failed to open file ' . $this->_filePath); + } + } + + /** + * Write data to bz archive + * + * @throws Mage_Exception + * @param $data + */ + protected function _write($data) + { + $result = @bzwrite($this->_fileHandler, $data); + + if (false === $result) { + throw new Mage_Exception('Failed to write data to ' . $this->_filePath); + } + } + + /** + * Read data from bz archive + * + * @throws Mage_Exception + * @param int $length + * @return string + */ + protected function _read($length) + { + $data = bzread($this->_fileHandler, $length); + + if (false === $data) { + throw new Mage_Exception('Failed to read data from ' . $this->_filePath); + } + + return $data; + } + + /** + * Close bz archive + */ + protected function _close() + { + bzclose($this->_fileHandler); + } +} + diff --git a/lib/Mage/Archive/Helper/File/Gz.php b/lib/Mage/Archive/Helper/File/Gz.php new file mode 100644 index 0000000000000000000000000000000000000000..9bf01228510e6bf6ab378dcb47fd8fd1f519e0d0 --- /dev/null +++ b/lib/Mage/Archive/Helper/File/Gz.php @@ -0,0 +1,83 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Archive + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** +* Helper class that simplifies gz files stream reading and writing +* +* @category Mage +* @package Mage_Archive +* @author Magento Core Team <core@magentocommerce.com> +*/ +class Mage_Archive_Helper_File_Gz extends Mage_Archive_Helper_File +{ + /** + * @see Mage_Archive_Helper_File::_open() + */ + protected function _open($mode) + { + $this->_fileHandler = @gzopen($this->_filePath, $mode); + + if (false === $this->_fileHandler) { + throw new Mage_Exception('Failed to open file ' . $this->_filePath); + } + } + + /** + * @see Mage_Archive_Helper_File::_write() + */ + protected function _write($data) + { + $result = @gzwrite($this->_fileHandler, $data); + + if (empty($result) && !empty($data)) { + throw new Mage_Exception('Failed to write data to ' . $this->_filePath); + } + } + + /** + * @see Mage_Archive_Helper_File::_read() + */ + protected function _read($length) + { + return gzread($this->_fileHandler, $length); + } + + /** + * @see Mage_Archive_Helper_File::_eof() + */ + protected function _eof() + { + return gzeof($this->_fileHandler); + } + + /** + * @see Mage_Archive_Helper_File::_close() + */ + protected function _close() + { + gzclose($this->_fileHandler); + } +} diff --git a/lib/Mage/Archive/Interface.php b/lib/Mage/Archive/Interface.php index 8badba4f49a2ff19d0602a3c4eda77eba040e974..9122b2f5c7cff2bade2552a8ffd9a4e4b6eb9c36 100644 --- a/lib/Mage/Archive/Interface.php +++ b/lib/Mage/Archive/Interface.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Archive - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Mage/Archive/Tar.php b/lib/Mage/Archive/Tar.php index dca45fcd3cb633e4752e9bfffac679bb974b118d..e36fec58ea5cc7b7f43182756cfe89f3fcd5d1bf 100644 --- a/lib/Mage/Archive/Tar.php +++ b/lib/Mage/Archive/Tar.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Archive - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -34,9 +34,11 @@ class Mage_Archive_Tar extends Mage_Archive_Abstract implements Mage_Archive_Interface { /** - * Constant is used for parse tar's header. + * Tar block size + * + * @const int */ - const FORMAT_PARSE_HEADER = 'a100name/a8mode/a8uid/a8gid/a12size/a12mtime/a8checksum/a1type/a100symlink/a6magic/a2version/a32uname/a32gname/a8devmajor/a8devminor/a155prefix/a12closer'; + const TAR_BLOCK_SIZE = 512; /** * Keep file or directory for packing. @@ -60,6 +62,122 @@ class Mage_Archive_Tar extends Mage_Archive_Abstract implements Mage_Archive_Int */ protected $_skipRoot; + /** + * Tarball data writer + * + * @var Mage_Archive_Helper_File + */ + protected $_writer; + + /** + * Tarball data reader + * + * @var Mage_Archive_Helper_File + */ + protected $_reader; + + /** + * Path to file where tarball should be placed + * + * @var string + */ + protected $_destinationFilePath; + + /** + * Initialize tarball writer + * + * @return Mage_Archive_Tar + */ + protected function _initWriter() + { + $this->_writer = new Mage_Archive_Helper_File($this->_destinationFilePath); + $this->_writer->open('w'); + + return $this; + } + + /** + * Returns string that is used for tar's header parsing + * + * @return string + */ + protected static final function _getFormatParseHeader() + { + return 'a100name/a8mode/a8uid/a8gid/a12size/a12mtime/a8checksum/a1type/a100symlink/a6magic/a2version/' + . 'a32uname/a32gname/a8devmajor/a8devminor/a155prefix/a12closer'; + } + + /** + * Destroy tarball writer + * + * @return Mage_Archive_Tar + */ + protected function _destroyWriter() + { + if ($this->_writer instanceof Mage_Archive_Helper_File) { + $this->_writer->close(); + $this->_writer = null; + } + + return $this; + } + + /** + * Get tarball writer + * + * @return Mage_Archive_Helper_File + */ + protected function _getWriter() + { + if (!$this->_writer) { + $this->_initWriter(); + } + + return $this->_writer; + } + + /** + * Initialize tarball reader + * + * @return Mage_Archive_Tar + */ + protected function _initReader() + { + $this->_reader = new Mage_Archive_Helper_File($this->_getCurrentFile()); + $this->_reader->open('r'); + + return $this; + } + + /** + * Destroy tarball reader + * + * @return Mage_Archive_Tar + */ + protected function _destroyReader() + { + if ($this->_reader instanceof Mage_Archive_Helper_File) { + $this->_reader->close(); + $this->_reader = null; + } + + return $this; + } + + /** + * Get tarball reader + * + * @return Mage_Archive_Helper_File + */ + protected function _getReader() + { + if (!$this->_reader) { + $this->_initReader(); + } + + return $this->_reader; + } + /** * Set option that define ability skip first catalog level. * @@ -80,7 +198,19 @@ class Mage_Archive_Tar extends Mage_Archive_Abstract implements Mage_Archive_Int */ protected function _setCurrentFile($file) { - $this->_currentFile = $file .((is_dir($file) && substr($file, -1)!=DS)?DS:''); + $this->_currentFile = $file .((!is_link($file) && is_dir($file) && substr($file, -1) != DS) ? DS : ''); + return $this; + } + + /** + * Set path to file where tarball should be placed + * + * @param string $destinationFilePath + * @return Mage_Archive_Tar + */ + protected function _setDestinationFilePath($destinationFilePath) + { + $this->_destinationFilePath = $destinationFilePath; return $this; } @@ -124,6 +254,7 @@ class Mage_Archive_Tar extends Mage_Archive_Abstract implements Mage_Archive_Int * Walk through directory and add to tar file or directory. * Result is packed string on TAR format. * + * @deprecated after 1.7.0.0 * @param boolean $skipRoot * @return string */ @@ -154,10 +285,74 @@ class Mage_Archive_Tar extends Mage_Archive_Abstract implements Mage_Archive_Int return $tarData; } + /** + * Recursively walk through file tree and create tarball + * + * @param boolean $skipRoot + * @param boolean $finalize + * @throws Mage_Exception + */ + protected function _createTar($skipRoot = false, $finalize = false) + { + if (!$skipRoot) { + $this->_packAndWriteCurrentFile(); + } + + $file = $this->_getCurrentFile(); + + if (is_dir($file)) { + $dirFiles = scandir($file); + + if (false === $dirFiles) { + throw new Mage_Exception('Can\'t scan dir: ' . $file); + } + + array_shift($dirFiles); /* remove './'*/ + array_shift($dirFiles); /* remove '../'*/ + + foreach ($dirFiles as $item) { + $this->_setCurrentFile($file . $item)->_createTar(); + } + } + + if ($finalize) { + $this->_getWriter()->write(str_repeat("\0", self::TAR_BLOCK_SIZE * 12)); + } + } + + /** + * Write current file to tarball + */ + protected function _packAndWriteCurrentFile() + { + $archiveWriter = $this->_getWriter(); + $archiveWriter->write($this->_composeHeader()); + + $currentFile = $this->_getCurrentFile(); + + $fileSize = 0; + + if (is_file($currentFile) && !is_link($currentFile)) { + $fileReader = new Mage_Archive_Helper_File($currentFile); + $fileReader->open('r'); + + while (!$fileReader->eof()) { + $archiveWriter->write($fileReader->read()); + } + + $fileReader->close(); + + $fileSize = filesize($currentFile); + } + + $appendZerosCount = (self::TAR_BLOCK_SIZE - $fileSize % self::TAR_BLOCK_SIZE) % self::TAR_BLOCK_SIZE; + $archiveWriter->write(str_repeat("\0", $appendZerosCount)); + } + /** * Compose header for current file in TAR format. * If length of file's name greater 100 characters, - * method breaks header to two pieces. First conatins + * method breaks header into two pieces. First contains * header and data with long name. Second contain only header. * * @param boolean $long @@ -178,14 +373,16 @@ class Mage_Archive_Tar extends Mage_Archive_Abstract implements Mage_Archive_Int } $header = array(); $header['100-name'] = $long?'././@LongLink':substr($nameFile, 0, 100); - $header['8-mode'] = $long?' ':str_pad(substr(sprintf("%07o", $infoFile['mode']),-4), 6, '0', STR_PAD_LEFT); + $header['8-mode'] = $long ? ' ' + : str_pad(substr(sprintf("%07o", $infoFile['mode']),-4), 6, '0', STR_PAD_LEFT); $header['8-uid'] = $long || $infoFile['uid']==0?"\0\0\0\0\0\0\0":sprintf("%07o", $infoFile['uid']); $header['8-gid'] = $long || $infoFile['gid']==0?"\0\0\0\0\0\0\0":sprintf("%07o", $infoFile['gid']); - $header['12-size'] = $long?sprintf("%011o", strlen($nameFile)):sprintf("%011o", is_dir($file) ? 0 : filesize($file)); + $header['12-size'] = $long ? sprintf("%011o", strlen($nameFile)) : sprintf("%011o", is_dir($file) + ? 0 : filesize($file)); $header['12-mtime'] = $long?'00000000000':sprintf("%011o", $infoFile['mtime']); $header['8-check'] = sprintf('% 8s', ''); - $header['1-type'] = $long?'L':(is_link($file) ? 2 : is_dir ($file) ? 5 : 0); - $header['100-symlink'] = is_link($file) == 2 ? readlink($item) : ''; + $header['1-type'] = $long ? 'L' : (is_link($file) ? 2 : (is_dir($file) ? 5 : 0)); + $header['100-symlink'] = is_link($file) ? readlink($file) : ''; $header['6-magic'] = 'ustar '; $header['2-version'] = ' '; $a=function_exists('posix_getpwuid')?posix_getpwuid (fileowner($file)):array('name'=>''); @@ -219,38 +416,63 @@ class Mage_Archive_Tar extends Mage_Archive_Abstract implements Mage_Archive_Int * * @param string $destination path to file is unpacked * @return array list of files + * @throws Mage_Exception */ protected function _unpackCurrentTar($destination) { - $file = $this->_getCurrentFile(); - $pointer = fopen($file, 'r'); - if (empty($pointer)) { - throw new Mage_Exception('Can\'t open file: ' . $file); - } + $archiveReader = $this->_getReader(); $list = array(); - while (!feof($pointer)) { - $header = $this->_parseHeader($pointer); - if ($header) { - $currentFile = $destination . $header['name']; - if ($header['type']=='5' && @mkdir($currentFile, 0777, true)) { - $list[] = $currentFile . DS; - } elseif (in_array($header['type'], array("0",chr(0), ''))) { - $dirname = dirname($currentFile); - if(!file_exists($dirname)) { - @mkdir($dirname, 0777, true); + + while (!$archiveReader->eof()) { + $header = $this->_extractFileHeader(); + + if (!$header) { + continue; + } + + $currentFile = $destination . $header['name']; + $dirname = dirname($currentFile); + + if (in_array($header['type'], array("0",chr(0), ''))) { + + if(!file_exists($dirname)) { + $mkdirResult = @mkdir($dirname, 0777, true); + + if (false === $mkdirResult) { + throw new Mage_Exception('Failed to create directory ' . $dirname); } - $this->_writeFile($currentFile, $header['data']); - $list[] = $currentFile; + } + + $this->_extractAndWriteFile($header, $currentFile); + $list[] = $currentFile; + + } elseif ($header['type'] == '5') { + + if(!file_exists($dirname)) { + $mkdirResult = @mkdir($currentFile, $header['mode'], true); + + if (false === $mkdirResult) { + throw new Mage_Exception('Failed to create directory ' . $currentFile); + } + } + $list[] = $currentFile . DS; + } elseif ($header['type'] == '2') { + + $symlinkResult = @symlink($header['symlink'], $currentFile); + + if (false === $symlinkResult) { + throw new Mage_Exception('Failed to create symlink ' . $currentFile . ' to ' . $header['symlink']); } } } - fclose($pointer); + return $list; } /** * Get header from TAR string and unpacked it by format. * + * @deprecated after 1.7.0.0 * @param resource $pointer * @return string */ @@ -262,10 +484,9 @@ class Mage_Archive_Tar extends Mage_Archive_Abstract implements Mage_Archive_Int return false; } - $fmt = self::FORMAT_PARSE_HEADER; + $fmt = self::_getFormatParseHeader(); $header = unpack ($fmt, $firstLine); - $header['mode']=$header['mode']+0; $header['uid']=octdec($header['uid']); $header['gid']=octdec($header['gid']); @@ -284,7 +505,7 @@ class Mage_Archive_Tar extends Mage_Archive_Abstract implements Mage_Archive_Int } $isUstar = 'ustar' == strtolower(substr($header['magic'], 0, 5)); - + $checksumOk = $header['checksum'] == $checksum; if (isset($header['name']) && $checksumOk) { if ($header['name'] == '././@LongLink' && $header['type'] == 'L') { @@ -304,6 +525,90 @@ class Mage_Archive_Tar extends Mage_Archive_Abstract implements Mage_Archive_Int return false; } + /** + * Read and decode file header information from tarball + * + * @return array|boolean + */ + protected function _extractFileHeader() + { + $archiveReader = $this->_getReader(); + + $headerBlock = $archiveReader->read(self::TAR_BLOCK_SIZE); + + if (strlen($headerBlock) < self::TAR_BLOCK_SIZE) { + return false; + } + + $header = unpack(self::_getFormatParseHeader(), $headerBlock); + + $header['mode'] = octdec($header['mode']); + $header['uid'] = octdec($header['uid']); + $header['gid'] = octdec($header['gid']); + $header['size'] = octdec($header['size']); + $header['mtime'] = octdec($header['mtime']); + $header['checksum'] = octdec($header['checksum']); + + if ($header['type'] == "5") { + $header['size'] = 0; + } + + $checksum = 0; + $headerBlock = substr_replace($headerBlock, ' ', 148, 8); + + for ($i = 0; $i < 512; $i++) { + $checksum += ord(substr($headerBlock, $i, 1)); + } + + $isUstar = 'ustar' == strtolower(substr($header['magic'], 0, 5)); + + $checksumOk = $header['checksum'] == $checksum; + if (isset($header['name']) && $checksumOk) { + + if (!($header['name'] == '././@LongLink' && $header['type'] == 'L')) { + return $header; + } + + $realNameBlockSize = floor(($header['size'] + self::TAR_BLOCK_SIZE - 1) / self::TAR_BLOCK_SIZE) + * self::TAR_BLOCK_SIZE; + $realNameBlock = $archiveReader->read($realNameBlockSize); + $realName = substr($realNameBlock, 0, $header['size']); + + $headerMain = $this->_extractFileHeader(); + $headerMain['name'] = $realName; + return $headerMain; + } + + return false; + } + + /** + * Extract next file from tarball by its $header information and save it to $destination + * + * @param array $fileHeader + * @param string $destination + */ + protected function _extractAndWriteFile($fileHeader, $destination) + { + $fileWriter = new Mage_Archive_Helper_File($destination); + $fileWriter->open('w', $fileHeader['mode']); + + $archiveReader = $this->_getReader(); + + $filesize = $fileHeader['size']; + $bytesExtracted = 0; + + while ($filesize > $bytesExtracted && !$archiveReader->eof()) { + $block = $archiveReader->read(self::TAR_BLOCK_SIZE); + $nonExtractedBytesCount = $filesize - $bytesExtracted; + + $data = substr($block, 0, $nonExtractedBytesCount); + $fileWriter->write($data); + + $bytesExtracted += strlen($block); + } + } + /** * Pack file to TAR (Tape Archiver). * @@ -312,14 +617,18 @@ class Mage_Archive_Tar extends Mage_Archive_Abstract implements Mage_Archive_Int * @param boolean $skipRoot * @return string */ - public function pack($source, $destination, $skipRoot=false) + public function pack($source, $destination, $skipRoot = false) { $this->_setSkipRoot($skipRoot); $source = realpath($source); $tarData = $this->_setCurrentPath($source) - ->_setCurrentFile($source) - ->_packToTar($skipRoot); - $this->_writeFile($destination, $tarData); + ->_setDestinationFilePath($destination) + ->_setCurrentFile($source); + + $this->_initWriter(); + $this->_createTar($skipRoot, true); + $this->_destroyWriter(); + return $destination; } @@ -332,13 +641,13 @@ class Mage_Archive_Tar extends Mage_Archive_Abstract implements Mage_Archive_Int */ public function unpack($source, $destination) { - $tempFile = $destination . DS . '~tmp-'.microtime(true).'.tar'; - $data = $this->_readFile($source); - $this->_writeFile($tempFile, $data); - $this->_setCurrentFile($tempFile) - ->_setCurrentPath($tempFile) - ->_unpackCurrentTar($destination); - unlink($tempFile); + $this->_setCurrentFile($source) + ->_setCurrentPath($source); + + $this->_initReader(); + $this->_unpackCurrentTar($destination); + $this->_destroyReader(); + return $destination; } @@ -352,21 +661,28 @@ class Mage_Archive_Tar extends Mage_Archive_Abstract implements Mage_Archive_Int */ public function extract($file, $source, $destination) { - $pointer = fopen($source, 'r'); - if (empty($pointer)) { - throw new Mage_Exception('Can\'t open file: '.$source); - } - $list = array(); + $this->_setCurrentFile($source); + $this->_initReader(); + + $archiveReader = $this->_getReader(); $extractedFile = ''; - while (!feof($pointer)) { - $header = $this->_parseHeader($pointer); + + while (!$archiveReader->eof()) { + $header = $this->_extractFileHeader(); if ($header['name'] == $file) { $extractedFile = $destination . basename($header['name']); - $this->_writeFile($extractedFile, $header['data']); + $this->_extractAndWriteFile($header, $extractedFile); break; } + + if ($header['type'] != 5){ + $skipBytes = floor(($header['size'] + self::TAR_BLOCK_SIZE - 1) / self::TAR_BLOCK_SIZE) + * self::TAR_BLOCK_SIZE; + $archiveReader->read($skipBytes); + } } - fclose($pointer); + + $this->_destroyReader(); return $extractedFile; } } diff --git a/lib/Mage/Autoload/Simple.php b/lib/Mage/Autoload/Simple.php index 7a37db8df63d71f621315733b4bbf3e167a5bdf1..8faadf984a861c71d7732eb5d0e35cfbc5b73297 100644 --- a/lib/Mage/Autoload/Simple.php +++ b/lib/Mage/Autoload/Simple.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Mage/Backup.php b/lib/Mage/Backup.php new file mode 100644 index 0000000000000000000000000000000000000000..d31d45a86c8bd1d559d82c13ab645751bc3b2da3 --- /dev/null +++ b/lib/Mage/Backup.php @@ -0,0 +1,59 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Backup + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Class to work with backups + * + * @category Mage + * @package Mage_Backup + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Backup +{ + /** + * List of supported a backup types + * + * @var array + */ + static protected $_allowedBackupTypes = array('db', 'snapshot', 'filesystem', 'media', 'nomedia'); + + /** + * get Backup Instance By File Name + * + * @param string $type + * @return Mage_Backup_Interface + */ + static public function getBackupInstance($type) + { + $class = 'Mage_Backup_' . $type; + + if (!in_array($type, self::$_allowedBackupTypes) || !class_exists($class, true)){ + throw new Mage_Exception('Current implementation not supported this type (' . $type . ') of backup.'); + } + + return new $class(); + } +} diff --git a/lib/Mage/Backup/Abstract.php b/lib/Mage/Backup/Abstract.php new file mode 100644 index 0000000000000000000000000000000000000000..864551600e734fa2dd249ed1e2023b71d9bafc04 --- /dev/null +++ b/lib/Mage/Backup/Abstract.php @@ -0,0 +1,317 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Backup + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +/** + * Class to work with archives + * + * @category Mage + * @package Mage_Backup + * @author Magento Core Team <core@magentocommerce.com> + */ +abstract class Mage_Backup_Abstract implements Mage_Backup_Interface +{ + /** + * Backup name + * + * @var string + */ + protected $_name; + + /** + * Backup creation date + * + * @var int + */ + protected $_time; + + /** + * Backup file extension + * + * @var string + */ + protected $_backupExtension; + + /** + * Resource model + * + * @var object + */ + protected $_resourceModel; + + /** + * Magento's root directory + * + * @var string + */ + protected $_rootDir; + + /** + * Path to directory where backups stored + * + * @var string + */ + protected $_backupsDir; + + /** + * Is last operation completed successfully + * + * @var bool + */ + protected $_lastOperationSucceed = false; + + /** + * Last failed operation error message + * + * @var string + */ + protected $_lastErrorMessage; + + + /** + * Set Backup Extension + * + * @param string $backupExtension + * @return Mage_Backup_Interface + */ + public function setBackupExtension($backupExtension) + { + $this->_backupExtension = $backupExtension; + return $this; + } + + /** + * Get Backup Extension + * + * @return string + */ + public function getBackupExtension() + { + return $this->_backupExtension; + } + + /** + * Set Resource Model + * + * @param object $resourceModel + * @return Mage_Backup_Interface + */ + public function setResourceModel($resourceModel) + { + $this->_resourceModel = $resourceModel; + return $this; + } + + /** + * Get Resource Model + * + * @return object + */ + public function getResourceModel() + { + return $this->_resourceModel; + } + + /** + * Set Time + * + * @param int $time + * @return Mage_Backup_Interface + */ + public function setTime($time) + { + $this->_time = $time; + return $this; + } + + /** + * Get Time + * + * @return int + */ + public function getTime() + { + return $this->_time; + } + + /** + * Set root directory of Magento installation + * + * @param string $rootDir + * @throws Mage_Exception + * @return Mage_Backup_Interface + */ + public function setRootDir($rootDir) + { + if (!is_dir($rootDir)) { + throw new Mage_Exception('Bad root directory'); + } + + $this->_rootDir = $rootDir; + return $this; + } + + /** + * Get Magento's root directory + * @return string + */ + public function getRootDir() + { + return $this->_rootDir; + } + + /** + * Set path to directory where backups stored + * + * @param string $backupsDir + * @return Mage_Backup_Interface + */ + public function setBackupsDir($backupsDir) + { + $this->_backupsDir = $backupsDir; + return $this; + } + + /** + * Get path to directory where backups stored + * + * @return string + */ + public function getBackupsDir() + { + return $this->_backupsDir; + } + + /** + * Get path to backup + * + * @return string + */ + public function getBackupPath() + { + return $this->getBackupsDir() . DS . $this->getBackupFilename(); + } + + /** + * Get backup file name + * + * @return string + */ + public function getBackupFilename() + { + $filename = $this->getTime() . '_' . $this->getType(); + + $name = $this->getName(); + + if (!empty($name)) { + $filename .= '_' . $name; + } + + $filename .= '.' . $this->getBackupExtension(); + + return $filename; + } + + /** + * Check whether last operation completed successfully + * + * @return bool + */ + public function getIsSuccess() + { + return $this->_lastOperationSucceed; + } + + /** + * Get last error message + * + * @return string + */ + public function getErrorMessage() + { + return $this->_lastErrorMessage; + } + + /** + * Set error message + * + * @param string $errorMessage + * @return string + */ + public function setErrorMessage($errorMessage) + { + $this->_lastErrorMessage = $errorMessage; + } + + /** + * Set backup name + * + * @param string $name + * @param bool $applyFilter + * @return Mage_Backup_Interface + */ + public function setName($name, $applyFilter = true) + { + if ($applyFilter) { + $name = $this->_filterName($name); + } + $this->_name = $name; + return $this; + } + + /** + * Get backup name + * + * @return string + */ + public function getName() + { + return $this->_name; + } + + /** + * Get backup display name + * + * @return string + */ + public function getDisplayName() + { + return str_replace('_', ' ', $this->_name); + } + + /** + * Removes disallowed characters and replaces spaces with underscores + * + * @param string $name + * @return string + */ + protected function _filterName($name) + { + $name = trim(preg_replace('/[^\da-zA-Z ]/', '', $name)); + $name = preg_replace('/\s{2,}/', ' ', $name); + $name = str_replace(' ', '_', $name); + + return $name; + } +} diff --git a/lib/Mage/Backup/Archive/Tar.php b/lib/Mage/Backup/Archive/Tar.php new file mode 100644 index 0000000000000000000000000000000000000000..c2e3a39d22a807c8002fa3ad14689631c2d28108 --- /dev/null +++ b/lib/Mage/Backup/Archive/Tar.php @@ -0,0 +1,82 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Backup + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Extended version of Mage_Archive_Tar that supports filtering + * + * @category Mage + * @package Mage_Backup + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Backup_Archive_Tar extends Mage_Archive_Tar +{ + /** + * Filenames or filename parts that are used for filtering files + * + * @var array() + */ + protected $_skipFiles = array(); + + /** + * Overridden Mage_Archive_Tar::_createTar method that does the same actions as it's parent but filters + * files using Mage_Backup_Filesystem_Iterator_Filter + * + * @see Mage_Archive_Tar::_createTar() + * @param bool $skipRoot + * @param bool $finalize + */ + protected function _createTar($skipRoot = false, $finalize = false) + { + $path = $this->_getCurrentFile(); + + $filesystemIterator = new RecursiveIteratorIterator( + new RecursiveDirectoryIterator($path), RecursiveIteratorIterator::SELF_FIRST + ); + + $iterator = new Mage_Backup_Filesystem_Iterator_Filter($filesystemIterator, $this->_skipFiles); + + foreach ($iterator as $item) { + $this->_setCurrentFile($item->getPathname()); + $this->_packAndWriteCurrentFile(); + } + + if ($finalize) { + $this->_getWriter()->write(str_repeat("\0", self::TAR_BLOCK_SIZE * 12)); + } + } + + /** + * Set files that shouldn't be added to tarball + * + * @param array $skipFiles + * @return Mage_Backup_Archive_Tar + */ + public function setSkipFiles(array $skipFiles) + { + $this->_skipFiles = $skipFiles; + return $this; + } +} diff --git a/lib/Mage/Backup/Db.php b/lib/Mage/Backup/Db.php new file mode 100644 index 0000000000000000000000000000000000000000..17912345396e1e8c590433df233d2387d78853ab --- /dev/null +++ b/lib/Mage/Backup/Db.php @@ -0,0 +1,129 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Backup + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Class to work with database backups + * + * @category Mage + * @package Mage_Backup + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Backup_Db extends Mage_Backup_Abstract +{ + /** + * Implementation Rollback functionality for Db + * + * @return bool + */ + public function rollback() + { + set_time_limit(0); + ignore_user_abort(true); + + $this->_lastOperationSucceed = false; + + $archiveManager = new Mage_Archive(); + $source = $archiveManager->unpack($this->getBackupPath(), $this->getBackupsDir()); + + $this->getResourceModel()->beginTransaction(); + + $file = fopen($source, "r"); + $query = ''; + while(!feof($file)) { + $line = fgets($file); + $query .= $line; + if ($this->_isLineLastInCommand($line)){ + $this->getResourceModel()->runCommand($query); + $query = ''; + } + } + fclose($file); + $this->getResourceModel()->commitTransaction(); + @unlink($source); + + $this->_lastOperationSucceed = true; + + return true; + } + + /** + * Check is line a last in sql command + * + * @param $line + * @return bool + */ + protected function _isLineLastInCommand($line) + { + $cleanLine = trim($line); + $lineLength = strlen($cleanLine); + + $returnResult = false; + if ($lineLength > 0){ + $lastSymbolIndex = $lineLength-1; + if ($cleanLine[$lastSymbolIndex] == ';'){ + $returnResult = true; + } + } + + return $returnResult; + } + + /** + * Implementation Create Backup functionality for Db + * + * @return boolean + */ + public function create() + { + set_time_limit(0); + ignore_user_abort(true); + + $this->_lastOperationSucceed = false; + + $backup = Mage::getModel('Mage_Backup_Model_Backup') + ->setTime($this->getTime()) + ->setType($this->getType()) + ->setPath($this->getBackupsDir()) + ->setName($this->getName()); + + $backupDb = Mage::getModel('Mage_Backup_Model_Db'); + $backupDb->createBackup($backup); + + $this->_lastOperationSucceed = true; + + return true; + } + + /** + * Get Backup Type + * + * @return string + */ + public function getType() + { + return "db"; + } +} diff --git a/lib/Mage/Backup/Exception.php b/lib/Mage/Backup/Exception.php new file mode 100644 index 0000000000000000000000000000000000000000..220ba4d94c08985cc0707d8964c67e19d56c978e --- /dev/null +++ b/lib/Mage/Backup/Exception.php @@ -0,0 +1,36 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Backup + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Exception + * + * @category Mage + * @package Mage_Backup + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Backup_Exception extends Mage_Exception +{ +} diff --git a/lib/Mage/Backup/Exception/CantLoadSnapshot.php b/lib/Mage/Backup/Exception/CantLoadSnapshot.php new file mode 100644 index 0000000000000000000000000000000000000000..681c7f40ed49bd3501a35bc496b6b266f533e088 --- /dev/null +++ b/lib/Mage/Backup/Exception/CantLoadSnapshot.php @@ -0,0 +1,36 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Backup + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Exception + * + * @category Mage + * @package Mage_Backup + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Backup_Exception_CantLoadSnapshot extends Mage_Backup_Exception +{ +} diff --git a/lib/Mage/Backup/Exception/FtpConnectionFailed.php b/lib/Mage/Backup/Exception/FtpConnectionFailed.php new file mode 100644 index 0000000000000000000000000000000000000000..7ff689827df13fe7f5a8726e9e02c063ec227186 --- /dev/null +++ b/lib/Mage/Backup/Exception/FtpConnectionFailed.php @@ -0,0 +1,36 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Backup + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Exception + * + * @category Mage + * @package Mage_Backup + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Backup_Exception_FtpConnectionFailed extends Mage_Backup_Exception +{ +} diff --git a/lib/Mage/Backup/Exception/FtpValidationFailed.php b/lib/Mage/Backup/Exception/FtpValidationFailed.php new file mode 100644 index 0000000000000000000000000000000000000000..1e3b80e96c3b3b070c0aa891c9fb1b89197a93ca --- /dev/null +++ b/lib/Mage/Backup/Exception/FtpValidationFailed.php @@ -0,0 +1,36 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Backup + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Exception + * + * @category Mage + * @package Mage_Backup + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Backup_Exception_FtpValidationFailed extends Mage_Backup_Exception +{ +} diff --git a/lib/Mage/Backup/Exception/NotEnoughFreeSpace.php b/lib/Mage/Backup/Exception/NotEnoughFreeSpace.php new file mode 100644 index 0000000000000000000000000000000000000000..dff2b06ebd03913472047df19af0320fa43de9ba --- /dev/null +++ b/lib/Mage/Backup/Exception/NotEnoughFreeSpace.php @@ -0,0 +1,36 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Backup + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Exception + * + * @category Mage + * @package Mage_Backup + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Backup_Exception_NotEnoughFreeSpace extends Mage_Backup_Exception +{ +} diff --git a/lib/Mage/Backup/Exception/NotEnoughPermissions.php b/lib/Mage/Backup/Exception/NotEnoughPermissions.php new file mode 100644 index 0000000000000000000000000000000000000000..88d6fe9f3fd8e3e876adef1f4f820537d9d5c914 --- /dev/null +++ b/lib/Mage/Backup/Exception/NotEnoughPermissions.php @@ -0,0 +1,36 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Backup + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Exception + * + * @category Mage + * @package Mage_Backup + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Backup_Exception_NotEnoughPermissions extends Mage_Backup_Exception +{ +} diff --git a/lib/Mage/Backup/Filesystem.php b/lib/Mage/Backup/Filesystem.php new file mode 100644 index 0000000000000000000000000000000000000000..6c20dd906a1ba461872ae7aaa6834b778703d59a --- /dev/null +++ b/lib/Mage/Backup/Filesystem.php @@ -0,0 +1,284 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Backup + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Class to work with filesystem backups + * + * @category Mage + * @package Mage_Backup + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Backup_Filesystem extends Mage_Backup_Abstract +{ + /** + * Paths that ignored when creating or rolling back snapshot + * + * @var array + */ + protected $_ignorePaths = array(); + + /** + * Whether use ftp account for rollback procedure + * + * @var bool + */ + protected $_useFtp = false; + + /** + * Ftp host + * + * @var string + */ + protected $_ftpHost; + + /** + * Ftp username + * + * @var string + */ + protected $_ftpUser; + + /** + * Password to ftp account + * + * @var string + */ + protected $_ftpPass; + + /** + * Ftp path to Magento installation + * + * @var string + */ + protected $_ftpPath; + + /** + * Implementation Rollback functionality for Filesystem + * + * @throws Mage_Exception + * @return bool + */ + public function rollback() + { + $this->_lastOperationSucceed = false; + + set_time_limit(0); + ignore_user_abort(true); + + $rollbackWorker = $this->_useFtp ? new Mage_Backup_Filesystem_Rollback_Ftp($this) + : new Mage_Backup_Filesystem_Rollback_Fs($this); + $rollbackWorker->run(); + + $this->_lastOperationSucceed = true; + } + + /** + * Implementation Create Backup functionality for Filesystem + * + * @throws Mage_Exception + * @return boolean + */ + public function create() + { + set_time_limit(0); + ignore_user_abort(true); + + $this->_lastOperationSucceed = false; + + $this->_checkBackupsDir(); + + $fsHelper = new Mage_Backup_Filesystem_Helper(); + + $filesInfo = $fsHelper->getInfo( + $this->getRootDir(), + Mage_Backup_Filesystem_Helper::INFO_READABLE | Mage_Backup_Filesystem_Helper::INFO_SIZE, + $this->getIgnorePaths() + ); + + if (!$filesInfo['readable']) { + throw new Mage_Backup_Exception_NotEnoughPermissions('Not enough permissions to read files for backup'); + } + + $freeSpace = disk_free_space($this->getBackupsDir()); + + if (2 * $filesInfo['size'] > $freeSpace) { + throw new Mage_Backup_Exception_NotEnoughFreeSpace('Not enough free space to create backup'); + } + + $tarTmpPath = $this->_getTarTmpPath(); + + $tarPacker = new Mage_Backup_Archive_Tar(); + $tarPacker->setSkipFiles($this->getIgnorePaths()) + ->pack($this->getRootDir(), $tarTmpPath, true); + + if (!is_file($tarTmpPath) || filesize($tarTmpPath) == 0) { + throw new Mage_Exception('Failed to create backup'); + } + + $backupPath = $this->getBackupPath(); + + $gzPacker = new Mage_Archive_Gz(); + $gzPacker->pack($tarTmpPath, $backupPath); + + if (!is_file($backupPath) || filesize($backupPath) == 0) { + throw new Mage_Exception('Failed to create backup'); + } + + @unlink($tarTmpPath); + + $this->_lastOperationSucceed = true; + } + + /** + * Force class to use ftp for rollback procedure + * + * @param string $host + * @param string $username + * @param string $password + * @param string $path + * @return Mage_Backup_Filesystem + */ + public function setUseFtp($host, $username, $password, $path) + { + $this->_useFtp = true; + $this->_ftpHost = $host; + $this->_ftpUser = $username; + $this->_ftpPass = $password; + $this->_ftpPath = $path; + return $this; + } + + /** + * Get backup type + * + * @see Mage_Backup_Interface::getType() + * @return string + */ + public function getType() + { + return 'filesystem'; + } + + /** + * Add path that should be ignoring when creating or rolling back backup + * + * @param string|array $paths + * @return Mage_Backup_Filesystem + */ + public function addIgnorePaths($paths) + { + if (is_string($paths)) { + if (!in_array($paths, $this->_ignorePaths)) { + $this->_ignorePaths[] = $paths; + } + } + else if (is_array($paths)) { + foreach ($paths as $path) { + $this->addIgnorePaths($path); + } + } + + return $this; + } + + /** + * Get paths that should be ignored while creating or rolling back backup procedure + * + * @return array + */ + public function getIgnorePaths() + { + return $this->_ignorePaths; + } + + /** + * Set directory where backups saved and add it to ignore paths + * + * @see Mage_Backup_Abstract::setBackupsDir() + * @param string $backupsDir + * @return Mage_Backup_Filesystem + */ + public function setBackupsDir($backupsDir) + { + parent::setBackupsDir($backupsDir); + $this->addIgnorePaths($backupsDir); + return $this; + } + + /** + * getter for $_ftpPath variable + * + * @return string + */ + public function getFtpPath() + { + return $this->_ftpPath; + } + + /** + * Get ftp connection string + * + * @return string + */ + public function getFtpConnectString() + { + return 'ftp://' . $this->_ftpUser . ':' . $this->_ftpPass . '@' . $this->_ftpHost . $this->_ftpPath; + } + + /** + * Check backups directory existance and whether it's writeable + * + * @throws Mage_Exception + */ + protected function _checkBackupsDir() + { + $backupsDir = $this->getBackupsDir(); + + if (!is_dir($backupsDir)) { + $backupsDirParentDirectory = basename($backupsDir); + + if (!is_writeable($backupsDirParentDirectory)) { + throw new Mage_Backup_Exception_NotEnoughPermissions('Cant create backups directory'); + } + + mkdir($backupsDir); + chmod($backupsDir, 0777); + } + + if (!is_writable($backupsDir)) { + throw new Mage_Backup_Exception_NotEnoughPermissions('Backups directory is not writeable'); + } + } + + /** + * Generate tmp name for tarball + */ + protected function _getTarTmpPath() + { + $tmpName = '~tmp-'. microtime(true) . '.tar'; + return $this->getBackupsDir() . DS . $tmpName; + } +} diff --git a/lib/Mage/Backup/Filesystem/Helper.php b/lib/Mage/Backup/Filesystem/Helper.php new file mode 100644 index 0000000000000000000000000000000000000000..5868045448c06b45b29d21a0a5856701dad089bd --- /dev/null +++ b/lib/Mage/Backup/Filesystem/Helper.php @@ -0,0 +1,137 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Backup + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Filesystem helper for Mage_Backup library + * + * @category Mage + * @package Mage_Backup + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Backup_Filesystem_Helper +{ + /** + * Constant can be used in getInfo() function as second parameter. + * Check whether directory and all files/sub directories are writable + * + * @const int + */ + const INFO_WRITABLE = 1; + + /** + * Constant can be used in getInfo() function as second parameter. + * Check whether directory and all files/sub directories are readable + * + * @const int + */ + const INFO_READABLE = 2; + + /** + * Constant can be used in getInfo() function as second parameter. + * Get directory size + * + * @const int + */ + const INFO_SIZE = 4; + + /** + * Constant can be used in getInfo() function as second parameter. + * Combination of INFO_WRITABLE, INFO_READABLE, INFO_SIZE + * + * @const int + */ + const INFO_ALL = 7; + + /** + * Recursively delete $path + * + * @param string $path + * @param array $skipPaths + * @param bool $removeRoot + * @throws Mage_Exception + */ + public function rm($path, $skipPaths = array(), $removeRoot = false) + { + $filesystemIterator = new RecursiveIteratorIterator( + new RecursiveDirectoryIterator($path), RecursiveIteratorIterator::CHILD_FIRST + ); + + $iterator = new Mage_Backup_Filesystem_Iterator_Filter($filesystemIterator, $skipPaths); + + foreach ($iterator as $item) { + $item->isDir() ? @rmdir($item->__toString()) : @unlink($item->__toString()); + } + + if ($removeRoot && is_dir($path)) { + @rmdir($path); + } + } + + /** + * Get information (readable, writable, size) about $path + * + * @param string $path + * @param int $infoOptions + * @param array $skipFiles + */ + public function getInfo($path, $infoOptions = self::INFO_ALL, $skipFiles = array()) + { + $info = array(); + if ($infoOptions & self::INFO_READABLE) { + $info['readable'] = true; + } + + if ($infoOptions & self::INFO_WRITABLE) { + $info['writable'] = true; + } + + if ($infoOptions & self::INFO_SIZE) { + $info['size'] = 0; + } + + $filesystemIterator = new RecursiveIteratorIterator( + new RecursiveDirectoryIterator($path), RecursiveIteratorIterator::CHILD_FIRST + ); + + $iterator = new Mage_Backup_Filesystem_Iterator_Filter($filesystemIterator, $skipFiles); + + foreach ($iterator as $item) { + if (($infoOptions & self::INFO_WRITABLE) && !$item->isWritable()) { + $info['writable'] = false; + } + + if (($infoOptions & self::INFO_READABLE) && !$item->isReadable()) { + $info['readable'] = false; + } + + if ($infoOptions & self::INFO_SIZE && !$item->isDir()) { + $info['size'] += $item->getSize(); + } + } + + return $info; + } +} diff --git a/lib/Mage/Backup/Filesystem/Iterator/Filter.php b/lib/Mage/Backup/Filesystem/Iterator/Filter.php new file mode 100644 index 0000000000000000000000000000000000000000..070e335af90f7589cbc669e9baf966fa51d25f71 --- /dev/null +++ b/lib/Mage/Backup/Filesystem/Iterator/Filter.php @@ -0,0 +1,77 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Backup + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Filter Iterator + * + * @category Mage + * @package Mage_Backup + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Backup_Filesystem_Iterator_Filter extends FilterIterator +{ + /** + * Array that is used for filtering + * + * @var array + */ + protected $_filters; + + /** + * Constructor + * + * @param Iterator $iterator + * @param array $skipFiles + */ + public function __construct(Iterator $iterator, array $filters) + { + parent::__construct($iterator); + $this->_filters = $filters; + } + + /** + * Check whether the current element of the iterator is acceptable + * + * @return bool + */ + public function accept() + { + $current = $this->current()->__toString(); + $currentFilename = $this->current()->getFilename(); + + if ($currentFilename == '.' || $currentFilename == '..') { + return false; + } + + foreach ($this->_filters as $filter) { + if (false !== strpos($current, $filter)) { + return false; + } + } + + return true; + } +} diff --git a/lib/Mage/Backup/Filesystem/Rollback/Abstract.php b/lib/Mage/Backup/Filesystem/Rollback/Abstract.php new file mode 100644 index 0000000000000000000000000000000000000000..b1923fcdf988bc144077fcfaf7b8925bab3073c6 --- /dev/null +++ b/lib/Mage/Backup/Filesystem/Rollback/Abstract.php @@ -0,0 +1,57 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Backup + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Filesystem rollback workers abstract class + * + * @category Mage + * @package Mage_Backup + * @author Magento Core Team <core@magentocommerce.com> + */ +abstract class Mage_Backup_Filesystem_Rollback_Abstract +{ + /** + * Snapshot object + * + * @var Mage_Backup_Filesystem + */ + protected $_snapshot; + + /** + * Default worker constructor + * + * @param Mage_Backup_Filesystem $snapshotObject + */ + public function __construct(Mage_Backup_Filesystem $snapshotObject) + { + $this->_snapshot = $snapshotObject; + } + + /** + * Main worker's function that makes files rollback + */ + abstract public function run(); +} diff --git a/lib/Mage/Backup/Filesystem/Rollback/Fs.php b/lib/Mage/Backup/Filesystem/Rollback/Fs.php new file mode 100644 index 0000000000000000000000000000000000000000..2089fe857de8dcd6856a8836e76e66e99e97f694 --- /dev/null +++ b/lib/Mage/Backup/Filesystem/Rollback/Fs.php @@ -0,0 +1,78 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Backup + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Rollback worker for rolling back via local filesystem + * + * @category Mage + * @package Mage_Backup + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Backup_Filesystem_Rollback_Fs extends Mage_Backup_Filesystem_Rollback_Abstract +{ + /** + * Files rollback implementation via local filesystem + * + * @see Mage_Backup_Filesystem_Rollback_Abstract::run() + * @throws Mage_Exception + */ + public function run() + { + $snapshotPath = $this->_snapshot->getBackupPath(); + + if (!is_file($snapshotPath) || !is_readable($snapshotPath)) { + throw new Mage_Backup_Exception_CantLoadSnapshot('Cant load snapshot archive'); + } + + $fsHelper = new Mage_Backup_Filesystem_Helper(); + + $filesInfo = $fsHelper->getInfo( + $this->_snapshot->getRootDir(), + Mage_Backup_Filesystem_Helper::INFO_WRITABLE, + $this->_snapshot->getIgnorePaths() + ); + + if (!$filesInfo['writable']) { + throw new Mage_Backup_Exception_NotEnoughPermissions( + 'Unable to make rollback because not all files are writable' + ); + } + + $archiver = new Mage_Archive(); + + /** + * we need these fake initializations because all magento's files in filesystem will be deleted and autoloader + * wont be able to load classes that we need for unpacking + */ + new Mage_Archive_Tar(); + new Mage_Archive_Gz(); + new Mage_Archive_Helper_File(''); + new Mage_Archive_Helper_File_Gz(''); + + $fsHelper->rm($this->_snapshot->getRootDir(), $this->_snapshot->getIgnorePaths()); + $archiver->unpack($snapshotPath, $this->_snapshot->getRootDir()); + } +} diff --git a/lib/Mage/Backup/Filesystem/Rollback/Ftp.php b/lib/Mage/Backup/Filesystem/Rollback/Ftp.php new file mode 100644 index 0000000000000000000000000000000000000000..f529340241524054b20b45e1530906e3d7c5ec8e --- /dev/null +++ b/lib/Mage/Backup/Filesystem/Rollback/Ftp.php @@ -0,0 +1,198 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Backup + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Rollback worker for rolling back via ftp + * + * @category Mage + * @package Mage_Backup + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Backup_Filesystem_Rollback_Ftp extends Mage_Backup_Filesystem_Rollback_Abstract +{ + /** + * Ftp client + * + * @var Mage_System_Ftp + */ + protected $_ftpClient; + + /** + * Files rollback implementation via ftp + * + * @see Mage_Backup_Filesystem_Rollback_Abstract::run() + * @throws Mage_Exception + */ + public function run() + { + $snapshotPath = $this->_snapshot->getBackupPath(); + + if (!is_file($snapshotPath) || !is_readable($snapshotPath)) { + throw new Mage_Backup_Exception_CantLoadSnapshot('Cant load snapshot archive'); + } + + $this->_initFtpClient(); + $this->_validateFtp(); + + $tmpDir = $this->_createTmpDir(); + $this->_unpackSnapshot($tmpDir); + + $fsHelper = new Mage_Backup_Filesystem_Helper(); + + $this->_cleanupFtp(); + $this->_uploadBackupToFtp($tmpDir); + + $fsHelper->rm($tmpDir, array(), true); + } + + /** + * Initialize ftp client and connect to ftp + * + * @throws Mage_Backup_Exception_FtpConnectionFailed + */ + protected function _initFtpClient() + { + try { + $this->_ftpClient = new Mage_System_Ftp(); + $this->_ftpClient->connect($this->_snapshot->getFtpConnectString()); + } catch (Exception $e) { + throw new Mage_Backup_Exception_FtpConnectionFailed($e->getMessage()); + } + } + + /** + * Perform ftp validation. Check whether ftp account provided points to current magento installation + * + * @throws Mage_Exception + */ + protected function _validateFtp() + { + $validationFilename = '~validation-' . microtime(true) . '.tmp'; + $validationFilePath = $this->_snapshot->getBackupsDir() . DS . $validationFilename; + + $fh = @fopen($validationFilePath, 'w'); + @fclose($fh); + + if (!is_file($validationFilePath)) { + throw new Mage_Exception('Unable to validate ftp account'); + } + + $rootDir = $this->_snapshot->getRootDir(); + $ftpPath = $this->_snapshot->getFtpPath() . DS . str_replace($rootDir, '', $validationFilePath); + + $fileExistsOnFtp = $this->_ftpClient->fileExists($ftpPath); + @unlink($validationFilePath); + + if (!$fileExistsOnFtp) { + throw new Mage_Backup_Exception_FtpValidationFailed('Failed to validate ftp account'); + } + } + + /** + * Unpack snapshot + * + * @param string $tmpDir + */ + protected function _unpackSnapshot($tmpDir) + { + $snapshotPath = $this->_snapshot->getBackupPath(); + + $archiver = new Mage_Archive(); + $archiver->unpack($snapshotPath, $tmpDir); + } + + /** + * @throws Mage_Exception + * @return string + */ + protected function _createTmpDir() + { + $tmpDir = $this->_snapshot->getBackupsDir() . DS . '~tmp-' . microtime(true); + + $result = @mkdir($tmpDir); + + if (false === $result) { + throw new Mage_Backup_Exception_NotEnoughPermissions('Failed to create directory ' . $tmpDir); + } + + return $tmpDir; + } + + /** + * Delete magento and all files from ftp + */ + protected function _cleanupFtp() + { + $rootDir = $this->_snapshot->getRootDir(); + + $filesystemIterator = new RecursiveIteratorIterator( + new RecursiveDirectoryIterator($rootDir), RecursiveIteratorIterator::CHILD_FIRST + ); + + $iterator = new Mage_Backup_Filesystem_Iterator_Filter($filesystemIterator, $this->_snapshot->getIgnorePaths()); + + foreach ($iterator as $item) { + $ftpPath = $this->_snapshot->getFtpPath() . DS . str_replace($rootDir, '', $item->__toString()); + $ftpPath = str_replace(DS, '/', $ftpPath); + + $this->_ftpClient->delete($ftpPath); + } + } + + /** + * Perform files rollback + * + * @param string $tmpDir + * @throws Mage_Exception + */ + protected function _uploadBackupToFtp($tmpDir) + { + $filesystemIterator = new RecursiveIteratorIterator( + new RecursiveDirectoryIterator($tmpDir), RecursiveIteratorIterator::SELF_FIRST + ); + + $iterator = new Mage_Backup_Filesystem_Iterator_Filter($filesystemIterator, $this->_snapshot->getIgnorePaths()); + + foreach ($filesystemIterator as $item) { + $ftpPath = $this->_snapshot->getFtpPath() . DS . str_replace($tmpDir, '', $item->__toString()); + $ftpPath = str_replace(DS, '/', $ftpPath); + + if ($item->isLink()) { + continue; + } + + if ($item->isDir()) { + $this->_ftpClient->mkdirRecursive($ftpPath); + } else { + $result = $this->_ftpClient->put($ftpPath, $item->__toString()); + if (false === $result) { + throw new Mage_Backup_Exception_NotEnoughPermissions('Failed to upload file ' + . $item->__toString() . ' to ftp'); + } + } + } + } +} diff --git a/lib/Mage/Backup/Interface.php b/lib/Mage/Backup/Interface.php new file mode 100644 index 0000000000000000000000000000000000000000..d14a8edce2f556c2efa9d3ffc09b7e23074e14d6 --- /dev/null +++ b/lib/Mage/Backup/Interface.php @@ -0,0 +1,88 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Backup + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Interface for work with archives + * + * @category Mage + * @package Mage_Backup + * @author Magento Core Team <core@magentocommerce.com> + */ +interface Mage_Backup_Interface +{ + /** + * Create Backup + * + * @return boolean + */ + public function create(); + + /** + * Rollback Backup + * + * @return boolean + */ + public function rollback(); + + /** + * Set Backup Extension + * + * @param string $backupExtension + * @return Mage_Backup_Interface + */ + public function setBackupExtension($backupExtension); + + /** + * Set Resource Model + * + * @param object $resourceModel + * @return Mage_Backup_Interface + */ + public function setResourceModel($resourceModel); + + /** + * Set Time + * + * @param int $time + * @return Mage_Backup_Interface + */ + public function setTime($time); + + /** + * Get Backup Type + * + * @return string + */ + public function getType(); + + /** + * Set path to directory where backups stored + * + * @param string $backupsDir + * @return Mage_Backup_Interface + */ + public function setBackupsDir($backupsDir); +} diff --git a/lib/Mage/Backup/Media.php b/lib/Mage/Backup/Media.php new file mode 100644 index 0000000000000000000000000000000000000000..2c5fe0be4a0d7ac0cf1513df9d1a50287d13c80a --- /dev/null +++ b/lib/Mage/Backup/Media.php @@ -0,0 +1,99 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Backup + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Class to work media folder and database backups + * + * @category Mage + * @package Mage_Backup + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Backup_Media extends Mage_Backup_Snapshot +{ + /** + * Implementation Rollback functionality for Snapshot + * + * @throws Mage_Exception + * @return bool + */ + public function rollback() + { + $this->_prepareIgnoreList(); + return parent::rollback(); + } + + /** + * Implementation Create Backup functionality for Snapshot + * + * @throws Mage_Exception + * @return bool + */ + public function create() + { + $this->_prepareIgnoreList(); + return parent::create(); + } + + /** + * Overlap getType + * + * @return string + * @see Mage_Backup_Interface::getType() + */ + public function getType() + { + return 'media'; + } + + /** + * Add all folders and files except media and db backup to ignore list + * + * @return Mage_Backup_Media + */ + protected function _prepareIgnoreList() + { + $iterator = new DirectoryIterator($this->getRootDir()); + + foreach ($iterator as $item) { + $filename = $item->getFilename(); + if (!in_array($filename, array('media', 'var'))) { + $this->addIgnorePaths($item->getPathname()); + } + } + + $iterator = new DirectoryIterator($this->getRootDir() . DS . 'var'); + $dbBackupFilename = $this->_getDbBackupManager()->getBackupFilename(); + + foreach ($iterator as $item) { + $filename = $item->getFilename(); + if ($filename != $dbBackupFilename) { + $this->addIgnorePaths($item->getPathname()); + } + } + + return $this; + } +} diff --git a/lib/Mage/Backup/Nomedia.php b/lib/Mage/Backup/Nomedia.php new file mode 100644 index 0000000000000000000000000000000000000000..81c48565603ef5b5b6e3a3fffc3bfa76828f399d --- /dev/null +++ b/lib/Mage/Backup/Nomedia.php @@ -0,0 +1,82 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Backup + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Class to work system backup that excludes media folder + * + * @category Mage + * @package Mage_Backup + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Backup_Nomedia extends Mage_Backup_Snapshot +{ + /** + * Implementation Rollback functionality for Snapshot + * + * @throws Mage_Exception + * @return bool + */ + public function rollback() + { + $this->_prepareIgnoreList(); + return parent::rollback(); + } + + /** + * Implementation Create Backup functionality for Snapshot + * + * @throws Mage_Exception + * @return bool + */ + public function create() + { + $this->_prepareIgnoreList(); + return parent::create(); + } + + /** + * Overlap getType + * + * @return string + * @see Mage_Backup_Interface::getType() + */ + public function getType() + { + return 'nomedia'; + } + + /** + * Add media folder to ignore list + * + * @return Mage_Backup_Media + */ + protected function _prepareIgnoreList() + { + $this->addIgnorePaths($this->getRootDir() . DS . 'media'); + + return $this; + } +} \ No newline at end of file diff --git a/lib/Mage/Backup/Snapshot.php b/lib/Mage/Backup/Snapshot.php new file mode 100644 index 0000000000000000000000000000000000000000..8b539b791b8ec280b1e6937992cbee38ae09583d --- /dev/null +++ b/lib/Mage/Backup/Snapshot.php @@ -0,0 +1,140 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Backup + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Class to work with full filesystem and database backups + * + * @category Mage + * @package Mage_Backup + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_Backup_Snapshot extends Mage_Backup_Filesystem +{ + /** + * Database backup manager + * + * @var Mage_Backup_Db + */ + protected $_dbBackupManager; + + /** + * Implementation Rollback functionality for Snapshot + * + * @throws Mage_Exception + * @return bool + */ + public function rollback() + { + $result = parent::rollback(); + + $this->_lastOperationSucceed = false; + + try { + $this->_getDbBackupManager()->rollback(); + } catch (Exception $e) { + $this->_removeDbBackup(); + throw $e; + } + + $this->_removeDbBackup(); + $this->_lastOperationSucceed = true; + + return $result; + } + + /** + * Implementation Create Backup functionality for Snapshot + * + * @throws Mage_Exception + * @return bool + */ + public function create() + { + $this->_getDbBackupManager()->create(); + + try { + $result = parent::create(); + } catch (Exception $e) { + $this->_removeDbBackup(); + throw $e; + } + + $this->_lastOperationSucceed = false; + $this->_removeDbBackup(); + $this->_lastOperationSucceed = true; + + return $result; + } + + /** + * Overlap getType + * + * @return string + * @see Mage_Backup_Interface::getType() + */ + public function getType() + { + return 'snapshot'; + } + + /** + * Create Db Instance + * + * @return Mage_Backup_Interface + */ + protected function _createDbBackupInstance() + { + return Mage_Backup::getBackupInstance(Mage_Backup_Helper_Data::TYPE_DB) + ->setBackupExtension(Mage::helper('Mage_Backup_Helper_Data')->getExtensionByType(Mage_Backup_Helper_Data::TYPE_DB)) + ->setTime($this->getTime()) + ->setBackupsDir(Mage::getBaseDir("var")) + ->setResourceModel($this->getResourceModel()); + } + + /** + * Get database backup manager + * + * @return Mage_Backup_Db + */ + protected function _getDbBackupManager() + { + if (is_null($this->_dbBackupManager)) { + $this->_dbBackupManager = $this->_createDbBackupInstance(); + } + + return $this->_dbBackupManager; + } + + /** + * Remove Db backup after added it to the snapshot + * + * @return Mage_Backup_Snapshot + */ + protected function _removeDbBackup(){ + @unlink($this->_getDbBackupManager()->getBackupPath()); + return $this; + } +} diff --git a/lib/Mage/Connect/Channel/Generator.php b/lib/Mage/Connect/Channel/Generator.php index 823873f49153f29a068919bf139cc506dfda8859..2ae17b7f836b6fbed6cd26ba026b7114fcdd8157 100644 --- a/lib/Mage/Connect/Channel/Generator.php +++ b/lib/Mage/Connect/Channel/Generator.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Mage/Connect/Channel/Parser.php b/lib/Mage/Connect/Channel/Parser.php index 53235fc0aa621a43bdb57427db121f8c0339c7b4..ac6342ed24c21a9f5c20c626affe6f45fd0d2ad1 100644 --- a/lib/Mage/Connect/Channel/Parser.php +++ b/lib/Mage/Connect/Channel/Parser.php @@ -20,6 +20,6 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ \ No newline at end of file diff --git a/lib/Mage/Connect/Channel/VO.php b/lib/Mage/Connect/Channel/VO.php index 8a8138fdaa5a59a7c80221173f806606a675c490..c3f93dceb3d362e4c4bd247699afac3267e2ce04 100644 --- a/lib/Mage/Connect/Channel/VO.php +++ b/lib/Mage/Connect/Channel/VO.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Mage/Connect/Command.php b/lib/Mage/Connect/Command.php index 7876cab34511823eb9e1c7ed2e16384a65392a34..fcc9c07714ba70f4822f5c3260a54e7e79a7edde 100644 --- a/lib/Mage/Connect/Command.php +++ b/lib/Mage/Connect/Command.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Mage/Connect/Command/Channels.php b/lib/Mage/Connect/Command/Channels.php index 483a85599255ac77d9eb32d3c1418eb3404ae050..1ed6edfea9c57de22ad6f38adf55e568fc2903f5 100644 --- a/lib/Mage/Connect/Command/Channels.php +++ b/lib/Mage/Connect/Command/Channels.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Mage/Connect/Command/Channels_Header.php b/lib/Mage/Connect/Command/Channels_Header.php index 011a2512e987c7b9eb8d568233094663705ab678..94f7e9bb68518784e6e50fa92fd371b803db1217 100644 --- a/lib/Mage/Connect/Command/Channels_Header.php +++ b/lib/Mage/Connect/Command/Channels_Header.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Mage/Connect/Command/Config.php b/lib/Mage/Connect/Command/Config.php index 36dd8fdff19d575ff6d2edfb90e0f8361739da3a..87f7e12182d3209a0678111a51ac8f1631a169b0 100644 --- a/lib/Mage/Connect/Command/Config.php +++ b/lib/Mage/Connect/Command/Config.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Mage/Connect/Command/Config_Header.php b/lib/Mage/Connect/Command/Config_Header.php index 383f12bcd1559cdaadf7cf85db078d218af0cd2a..9208cc7138336ce3009f7fe8784b99035b6b81b6 100644 --- a/lib/Mage/Connect/Command/Config_Header.php +++ b/lib/Mage/Connect/Command/Config_Header.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Mage/Connect/Command/Install.php b/lib/Mage/Connect/Command/Install.php index c53e94c4de9f11f5b60d696ca3a4f32031d25bfd..89c4b88a0550d9878fa459e6e2c9eceab83c85bd 100644 --- a/lib/Mage/Connect/Command/Install.php +++ b/lib/Mage/Connect/Command/Install.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Mage/Connect/Command/Install_Header.php b/lib/Mage/Connect/Command/Install_Header.php index c1f5f1d956ab269a7475cc35a04af1b9f391ea6a..859278b94fdc61c06785a19153d9b4b5f79c8e14 100644 --- a/lib/Mage/Connect/Command/Install_Header.php +++ b/lib/Mage/Connect/Command/Install_Header.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Mage/Connect/Command/Package.php b/lib/Mage/Connect/Command/Package.php index 2973c2ba423b4052ee95873932f22224293f88ff..8875dd4c6165739d2823d791140b8d0e9590f868 100644 --- a/lib/Mage/Connect/Command/Package.php +++ b/lib/Mage/Connect/Command/Package.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Mage/Connect/Command/Package_Header.php b/lib/Mage/Connect/Command/Package_Header.php index ce3032363d8075b400868b6097847df8cf4fe181..2ca696bb5ad9ada00c41b71b0b7539f4f3f600ef 100644 --- a/lib/Mage/Connect/Command/Package_Header.php +++ b/lib/Mage/Connect/Command/Package_Header.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Mage/Connect/Command/Registry.php b/lib/Mage/Connect/Command/Registry.php index 06c2771b00afcdac960201d8b090f08fa0f9bf28..a1fab5ed7da60e7e898a92c992bbccc1117a511a 100644 --- a/lib/Mage/Connect/Command/Registry.php +++ b/lib/Mage/Connect/Command/Registry.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Mage/Connect/Command/Registry_Header.php b/lib/Mage/Connect/Command/Registry_Header.php index ed7a38a99d514ffd6cfb290664db19cd174d5a3a..580d32f45327c6ed60d51b4e4d49e9dd0ee479b3 100644 --- a/lib/Mage/Connect/Command/Registry_Header.php +++ b/lib/Mage/Connect/Command/Registry_Header.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Mage/Connect/Command/Remote.php b/lib/Mage/Connect/Command/Remote.php index 030d40b55c7e09d440afdf083a3f87dfa4c986f0..c9f2b5a18f4275b868b3875a6621854794f5df20 100644 --- a/lib/Mage/Connect/Command/Remote.php +++ b/lib/Mage/Connect/Command/Remote.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Mage/Connect/Command/Remote_Header.php b/lib/Mage/Connect/Command/Remote_Header.php index 07cf3d924369790ac1e755e3d17c8324bc41a6cc..53e9b40aeacc0fa5f3e8c24345327f34f35c4e8f 100644 --- a/lib/Mage/Connect/Command/Remote_Header.php +++ b/lib/Mage/Connect/Command/Remote_Header.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Mage/Connect/Config.php b/lib/Mage/Connect/Config.php index 69b2e301f95c4a2a6816f6012932c80ef3ce9e8f..8e0aad14eae286473392c955144eaf87bb472cb2 100644 --- a/lib/Mage/Connect/Config.php +++ b/lib/Mage/Connect/Config.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Mage/Connect/Converter.php b/lib/Mage/Connect/Converter.php index a8228bc521c0dfcd236746027ca7a0db26463c5b..067e07173385f9df6bf8fc004af2f341d95cae09 100644 --- a/lib/Mage/Connect/Converter.php +++ b/lib/Mage/Connect/Converter.php @@ -21,7 +21,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Mage/Connect/Frontend.php b/lib/Mage/Connect/Frontend.php index 20f486e2d12f6d38fe57c695780ced58c3bda8c7..b2e6d72a765dc61ca86255590ddf604c8e8c5a7c 100644 --- a/lib/Mage/Connect/Frontend.php +++ b/lib/Mage/Connect/Frontend.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Mage/Connect/Frontend/CLI.php b/lib/Mage/Connect/Frontend/CLI.php index 937a28ddbafeef61358b9359e0be8222d6f5c223..2395dfe8492cf87eaf35f432b57cc3e89a81b4f1 100644 --- a/lib/Mage/Connect/Frontend/CLI.php +++ b/lib/Mage/Connect/Frontend/CLI.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Mage/Connect/Ftp.php b/lib/Mage/Connect/Ftp.php index 8569bcd9254ed3b15df460be104971b998491953..8432c207a0d2ec57fd415280701e70b9b946c30d 100644 --- a/lib/Mage/Connect/Ftp.php +++ b/lib/Mage/Connect/Ftp.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -31,464 +31,6 @@ * @package Mage_Connect * @author Magento Core Team <core@magentocommerce.com> */ -class Mage_Connect_Ftp +class Mage_Connect_Ftp extends Mage_System_Ftp { - - /** - * Connection object - * @var resource - */ - protected $_conn = false; - - public function __construct() - { - - } - - /** - * Check connected, throw exception if not - * @throws Exception - * @return void - */ - protected function checkConnected() - { - if(!$this->_conn) { - throw new Exception(__CLASS__." - no connection established with server"); - } - } - - /** - * ftp_mkdir wrapper - * @param stin$name - * @return unknown_type - */ - public function mdkir($name) - { - $this->checkConnected(); - return @ftp_mkdir($this->_conn, $name); - } - - - - /** - * Make dir recursive - * @param string $path - * @param int $mode - */ - public function mkdirRecursive($path, $mode = 0777) - { - $this->checkConnected(); - $dir = split("/", $path); - $path= ""; - $ret = true; - for ($i=0; $i < count($dir); $i++) { - $path .= "/" .$dir[$i]; - if(!@ftp_chdir($this->_conn, $path)) { - @ftp_chdir($this->_conn,"/"); - if(!@ftp_mkdir($this->_conn,$path)) { - $ret=false; - break; - } else { - @ftp_chmod($this->_conn, $mode, $path); - } - } - } - return $ret; - } - - - /** - * Try to login to server - * @param string $login - * @param string $password - * @throws Exception on invalid login credentials - * @return bool - */ - public function login($login = "anonymous", $password = "test@gmail.com") - { - $this->checkConnected(); - $res = @ftp_login($this->_conn, $login, $password); - if(!$res) { - throw new Exception("Invalid login credentials"); - } - return $res; - } - - /** - * Validate connection string - * @param string $string - * @throws Exception - * @return string - */ - public function validateConnectionString($string) - { - $data = @parse_url($string); - if(false === $data) { - throw new Exception("Connection string invalid: '{$string}'"); - } - if($data['scheme'] != 'ftp') { - throw new Exception("Support for scheme unsupported: '{$data['scheme']}'"); - } - return $data; - } - - /** - * Connect to server using connect string - * Connection string: ftp://user:pass@server:port/path - * user,pass,port,path are optional parts - * @param string $string - * - * @param $timeout - * @return unknown_type - */ - public function connect($string, $timeout = 900) - { - $params = $this->validateConnectionString($string); - $port = isset($params['port']) ? intval($params['port']) : 21; - - $this->_conn = ftp_connect($params['host'], $port, $timeout); - - if(!$this->_conn) { - throw new Exception("Cannot connect to host: {$params['host']}"); - } - if(isset($params['user']) && isset($params['pass'])) { - $this->login($params['user'], $params['pass']); - } else { - $this->login(); - } - if(isset($params['path'])) { - if(!$this->chdir($params['path'])) { - throw new Exception ("Cannot chdir after login to: {$params['path']}"); - } - } - } - - /** - * ftp_fput wrapper - * @param string $remoteFile - * @param resource $handle - * @param int $mode FTP_BINARY | FTP_ASCII - * @param int $startPos - * @return bool - */ - - public function fput($remoteFile, $handle, $mode = FTP_BINARY, $startPos = 0) - { - $this->checkConnected(); - return @ftp_fput($this->_conn, $remoteFile, $handle, $mode, $startPos); - } - - /** - * ftp_put wrapper - * @param string $remoteFile - * @param string $localFile - * @param int $mode FTP_BINARY | FTP_ASCII - * @param int $startPos - * @return bool - */ - public function put($remoteFile, $localFile, $mode = FTP_BINARY, $startPos = 0) - { - $this->checkConnected(); - return ftp_put($this->_conn, $remoteFile, $localFile, $mode, $startPos); - } - - - /** - * Get current working directory - * @return mixed - */ - public function getcwd() - { - $d = $this->raw("pwd"); - $data = explode(" ", $d[0], 3); - if(empty($data[1])) { - return false; - } - if(intval($data[0]) != 257) { - return false; - } - $out = trim($data[1], '"'); - if($out !== "/") { - $out = rtrim($out, "/"); - } - return $out; - } - - /** - * ftp_raw wrapper - * @param string $cmd - * @return mixed - */ - public function raw($cmd) - { - $this->checkConnected(); - return @ftp_raw($this->_conn, $cmd); - } - - - /** - * Upload local file to remote - * - * Can be used for relative and absoulte remote paths - * Relative: use chdir before calling this - * - * @param srting $remote - * @param string $local - * @param int $dirMode - * @param int $ftpMode - * @return unknown_type - */ - public function upload($remote, $local, $dirMode = 0777, $ftpMode = FTP_BINARY) - { - $this->checkConnected(); - - if(!file_exists($local)) { - throw new Exception("Local file doesn't exist: {$localFile}"); - } - if(!is_readable($local)) { - throw new Exception("Local file is not readable: {$localFile}"); - } - if(is_dir($local)) { - throw new Exception("Directory given instead of file: {$localFile}"); - } - - $globalPathMode = substr($remote, 0, 1) == "/"; - $dirname = dirname($remote); - $cwd = $this->getcwd(); - if(false === $cwd) { - throw new Exception("Server returns something awful on PWD command"); - } - - if(!$globalPathMode) { - $dirname = $cwd."/".$dirname; - $remote = $cwd."/".$remote; - } - $res = $this->mkdirRecursive($dirname, $dirMode); - $this->chdir($cwd); - - if(!$res) { - return false; - } - return $this->put($remote, $local, $ftpMode); - } - - /** - * Download remote file to local machine - * @param string $remote - * @param string $local - * @param int $ftpMode FTP_BINARY|FTP_ASCII - * @return bool - */ - public function download($remote, $local, $ftpMode = FTP_BINARY) - { - $this->checkConnected(); - return $this->get($local, $remote, $ftpMode); - } - - - /** - * ftp_pasv wrapper - * @param bool $pasv - * @return bool - */ - public function pasv($pasv) - { - $this->checkConnected(); - return @ftp_pasv($this->_conn, (bool) $pasv); - } - - /** - * Close FTP connection - * @return void - */ - public function close() - { - if($this->_conn) { - @ftp_close($this->_conn); - } - } - - /** - * ftp_chmod wrapper - * @param $mode - * @param $remoteFile - * @return bool - */ - public function chmod($mode, $remoteFile) - { - $this->checkConnected(); - return @ftp_chmod($this->_conn, $mode, $remoteFile); - } - - /** - * ftp_chdir wrapper - * @param string $dir - * @return bool - */ - public function chdir($dir) - { - $this->checkConnected(); - return @ftp_chdir($this->_conn, $dir); - } - - /** - * ftp_cdup wrapper - * @return bool - */ - public function cdup() - { - $this->checkConnected(); - return @ftp_cdup($this->_conn); - } - - /** - * ftp_get wrapper - * @param string $localFile - * @param string $remoteFile - * @param int $fileMode FTP_BINARY | FTP_ASCII - * @param int $resumeOffset - * @return bool - */ - public function get($localFile, $remoteFile, $fileMode = FTP_BINARY, $resumeOffset = 0) - { - $remoteFile = $this->correctFilePath($remoteFile); - $this->checkConnected(); - return @ftp_get($this->_conn, $localFile, $remoteFile, $fileMode, $resumeOffset); - } - - /** - * ftp_nlist wrapper - * @param string $dir - * @return bool - */ - public function nlist($dir = "/") - { - $this->checkConnected(); - $dir = $this->correctFilePath($dir); - return @ftp_nlist($this->_conn, $dir); - } - - /** - * ftp_rawlist wrapper - * @param string $dir - * @param bool $recursive - * @return mixed - */ - public function rawlist( $dir = "/", $recursive = false ) - { - $this->checkConnected(); - $dir = $this->correctFilePath($dir); - return @ftp_rawlist($this->_conn, $dir, $recursive); - } - - - /** - * Convert byte count to float KB/MB format - * @param int $bytes - * @return string - */ - public static function byteconvert($bytes) - { - $symbol = array('B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'); - $exp = floor( log($bytes) / log(1024) ); - return sprintf( '%.2f ' . $symbol[ $exp ], ($bytes / pow(1024, floor($exp))) ); - } - - /** - * Chmod string "-rwxrwxrwx" to "777" converter - * @param string $chmod - * @return string - */ - public static function chmodnum($chmod) - { - $trans = array('-' => '0', 'r' => '4', 'w' => '2', 'x' => '1'); - $chmod = substr(strtr($chmod, $trans), 1); - $array = str_split($chmod, 3); - return array_sum(str_split($array[0])) . array_sum(str_split($array[1])) . array_sum(str_split($array[2])); - } - - - public function fileExists($path, $excludeIfIsDir = true) - { - $path = $this->correctFilePath($path); - $globalPathMode = substr($path, 0, 1) == "/"; - - $file = basename($path); - $dir = $globalPathMode ? dirname($path) : $this->getcwd()."/".$path; - $data = $this->ls($dir); - foreach($data as $row) { - if($file == $row['name']) { - if($excludeIfIsDir && $row['dir']) { - continue; - } - return true; - } - } - return false; - } - - - /** - * Get directory contents in PHP array - * @param string $dir - * @param bool $recursive - * @return array - */ - public function ls($dir = "/", $recursive = false) - { - $dir= $this->correctFilePath($dir); - $rawfiles = (array) $this->rawlist($dir, $recursive); - $structure = array(); - $arraypointer = &$structure; - foreach ($rawfiles as $rawfile) { - if ($rawfile[0] == '/') { - $paths = array_slice(explode('/', str_replace(':', '', $rawfile)), 1); - $arraypointer = &$structure; - foreach ($paths as $path) { - foreach ($arraypointer as $i => $file) { - if ($file['name'] == $path) { - $arraypointer = &$arraypointer[ $i ]['children']; - break; - } - } - } - } elseif(!empty($rawfile)) { - $info = preg_split("/[\s]+/", $rawfile, 9); - $arraypointer[] = array( - 'name' => $info[8], - 'dir' => $info[0]{0} == 'd', - 'size' => (int) $info[4], - 'chmod' => self::chmodnum($info[0]), - 'rawdata' => $info, - 'raw' => $rawfile - ); - } - } - return $structure; - } - - - /** - * Correct file path - * @param $str - * @return string - */ - public function correctFilePath($str) - { - $str = str_replace("\\", "/", $str); - $str = preg_replace("/^.\//", "", $str); - return $str; - } - - public function delete($file) - { - $this->checkConnected(); - $file = $this->correctFilePath($file); - return @ftp_delete($this->_conn, $file); - } - - - - - -} \ No newline at end of file +} diff --git a/lib/Mage/Connect/Loader.php b/lib/Mage/Connect/Loader.php index de8001fea7eb582f9ff2c29f3396b7a081f9ff89..aea4bb465089c31d7b7c87e58389e63a1943a350 100644 --- a/lib/Mage/Connect/Loader.php +++ b/lib/Mage/Connect/Loader.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Mage/Connect/Loader/Ftp.php b/lib/Mage/Connect/Loader/Ftp.php index 88bbfdffa2b89d80a5c6e37616669d5def42980d..1fb2f51e2a2bed9f1d423095e3f99a998a318879 100644 --- a/lib/Mage/Connect/Loader/Ftp.php +++ b/lib/Mage/Connect/Loader/Ftp.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Mage/Connect/Package.php b/lib/Mage/Connect/Package.php index 8915a0baca762b07ce73f7438da15e777a933a36..4a3f4fdb9487d7d5a131217b99d256e22d6efd14 100644 --- a/lib/Mage/Connect/Package.php +++ b/lib/Mage/Connect/Package.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Mage/Connect/Package/Hotfix.php b/lib/Mage/Connect/Package/Hotfix.php index bfa385cf1d514a7218d5a2b9ac6335fe8ec0efb7..a94ed690b09939eb46d3069176d0314107c0d1cf 100644 --- a/lib/Mage/Connect/Package/Hotfix.php +++ b/lib/Mage/Connect/Package/Hotfix.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Mage/Connect/Package/Reader.php b/lib/Mage/Connect/Package/Reader.php index 08ebdb8d11a30ab75335523379bee23b7c8f4b26..943b325bfdc6a50c0ab76dbb32b8b3f187d5da54 100644 --- a/lib/Mage/Connect/Package/Reader.php +++ b/lib/Mage/Connect/Package/Reader.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Mage/Connect/Package/Target.php b/lib/Mage/Connect/Package/Target.php index 8deaa45aecceb4015c52ec440251a5b4c1b29c03..13f01802a9b578463402b71adfd3100aeb381aab 100644 --- a/lib/Mage/Connect/Package/Target.php +++ b/lib/Mage/Connect/Package/Target.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Mage/Connect/Package/VO.php b/lib/Mage/Connect/Package/VO.php index bd08d02eca22f471a76ec907a7b0c47fec93dfbf..cb728ace851db0ca0c8d0c0c6707be5be4a3b40c 100644 --- a/lib/Mage/Connect/Package/VO.php +++ b/lib/Mage/Connect/Package/VO.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Mage/Connect/Package/Writer.php b/lib/Mage/Connect/Package/Writer.php index ee27e30d6cd01b582c36b2f1b0bc91a9a15dce61..3955cf02644a4c5a2900fbe5c0b60f2c84bb4fc2 100644 --- a/lib/Mage/Connect/Package/Writer.php +++ b/lib/Mage/Connect/Package/Writer.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Mage/Connect/Packager.php b/lib/Mage/Connect/Packager.php index e96a0e55feb406d598aafdfd370e48c43e148831..b1aa7639105277c3eaf99ea5c7092a4efe9123d9 100644 --- a/lib/Mage/Connect/Packager.php +++ b/lib/Mage/Connect/Packager.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Mage/Connect/Rest.php b/lib/Mage/Connect/Rest.php index e5f004522d5d31c5312b115c3b5a78a6841b9011..7c772ed5ecf6288a45f15d8d7c0e786132831771 100644 --- a/lib/Mage/Connect/Rest.php +++ b/lib/Mage/Connect/Rest.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Mage/Connect/Singleconfig.php b/lib/Mage/Connect/Singleconfig.php index 419e99090e579e52a5be16688988ecaa8e3d1513..5e48db7702ce6c833ae71cf5594debf484d383c8 100644 --- a/lib/Mage/Connect/Singleconfig.php +++ b/lib/Mage/Connect/Singleconfig.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Mage/Connect/Structures/Graph.php b/lib/Mage/Connect/Structures/Graph.php index 8bcb9d73e895a727bb581f9477ed8231c6134af4..6e9410cde52cbc07da5549a95e6d4f83c0ff1502 100644 --- a/lib/Mage/Connect/Structures/Graph.php +++ b/lib/Mage/Connect/Structures/Graph.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Mage/Connect/Structures/Node.php b/lib/Mage/Connect/Structures/Node.php index 4abae479028c58041658b7269a20ab489d7c1d69..10265904d72de91e8a42d21c32d965e61c17f91d 100644 --- a/lib/Mage/Connect/Structures/Node.php +++ b/lib/Mage/Connect/Structures/Node.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Mage/Connect/Validator.php b/lib/Mage/Connect/Validator.php index 022c448c09c2a0de828970d06748920168a7971e..8ef8aaab8ffdde84fcbca04df13d54b738aab15b 100644 --- a/lib/Mage/Connect/Validator.php +++ b/lib/Mage/Connect/Validator.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Mage/DB/Exception.php b/lib/Mage/DB/Exception.php index 3476787901a2b991936070c7933a48507569bd5b..593a33015b57ecdb8c690f23b071d777482c5bbb 100644 --- a/lib/Mage/DB/Exception.php +++ b/lib/Mage/DB/Exception.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Db - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Mage/DB/Mysqli.php b/lib/Mage/DB/Mysqli.php index 548ce43032795f354f5c1e0afcbde4e9146b3b96..aae6f8344027026dde04bad9047705154b1280b1 100644 --- a/lib/Mage/DB/Mysqli.php +++ b/lib/Mage/DB/Mysqli.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Db - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Mage/Exception.php b/lib/Mage/Exception.php index eb04f2c8362faafcff3719cecd779d2f71e9b38d..fa0dda27fe4a1d9b4ad3cc0c5d888d32aa0585a4 100644 --- a/lib/Mage/Exception.php +++ b/lib/Mage/Exception.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -32,4 +32,5 @@ * @author Magento Core Team <core@magentocommerce.com> */ class Mage_Exception extends Exception -{} +{ +} \ No newline at end of file diff --git a/lib/Mage/HTTP/Client.php b/lib/Mage/HTTP/Client.php index bee8e7657d89fddf6e42bb41330769f532253006..c92b87ad92b06247eca3fe0dc82bc6636a7c3b20 100644 --- a/lib/Mage/HTTP/Client.php +++ b/lib/Mage/HTTP/Client.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Mage/HTTP/Client/Curl.php b/lib/Mage/HTTP/Client/Curl.php index bb20ceed622fadf09e1ae10e28967e40cefd828e..24c8c1eca93f2d995c9da0e2543a9d03fef865ba 100644 --- a/lib/Mage/HTTP/Client/Curl.php +++ b/lib/Mage/HTTP/Client/Curl.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Mage/HTTP/Client/Socket.php b/lib/Mage/HTTP/Client/Socket.php index d4e51801b85e086415cfb8b96ab20889fdb6dc14..0fab5328e38e8800fb2925224b09ef8787a351cb 100644 --- a/lib/Mage/HTTP/Client/Socket.php +++ b/lib/Mage/HTTP/Client/Socket.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Mage/HTTP/IClient.php b/lib/Mage/HTTP/IClient.php index 5163808a118124af5f9382a220163cd6f98ca1ce..2c59e814552453a0bca23d6a12fe48b788a83d4b 100644 --- a/lib/Mage/HTTP/IClient.php +++ b/lib/Mage/HTTP/IClient.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Connect - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Mage/System/Args.php b/lib/Mage/System/Args.php index d871567971bfa899f06fce840db99cf05388a350..e7f6bdfbaac2ea14ef6262d3e6ecc88a5d5a5a55 100644 --- a/lib/Mage/System/Args.php +++ b/lib/Mage/System/Args.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_System - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -59,7 +59,7 @@ class Mage_System_Args { $this->flags = array(); $this->filtered = array(); - + if(false === $source) { $argv = $GLOBALS['argv']; array_shift($argv); @@ -89,7 +89,7 @@ class Mage_System_Args } elseif(strlen($str) == 2 && $str[0] == '-') // -a { - $this->flags[$str[1]] = true; + $this->flags[$str[1]] = true; if(isset($argv[$i + 1]) && preg_match('/^--?.+/', $argv[$i + 1]) == 0) { $this->flags[$str[1]] = $argv[$i + 1]; $argv[$i + 1] = null; diff --git a/lib/Mage/System/Dirs.php b/lib/Mage/System/Dirs.php index d9097ad26d6f89ec6ef6ec9f34d07662160e7c92..ad8e4c47aa3ecb08836b2011c33f81f12b21f3fd 100644 --- a/lib/Mage/System/Dirs.php +++ b/lib/Mage/System/Dirs.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_System - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -103,4 +103,4 @@ class Mage_System_Dirs } } -} \ No newline at end of file +} diff --git a/lib/Mage/System/Ftp.php b/lib/Mage/System/Ftp.php new file mode 100644 index 0000000000000000000000000000000000000000..a9fe9353d604c2ba16b826bb6ceba80220568fb2 --- /dev/null +++ b/lib/Mage/System/Ftp.php @@ -0,0 +1,509 @@ +<?php +/** + * Magento + * + * 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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_System + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Class to work with remote FTP server + * + * @category Mage + * @package Mage_System + * @author Magento Core Team <core@magentocommerce.com> + */ +class Mage_System_Ftp +{ + + /** + * Connection object + * + * @var resource + */ + protected $_conn = false; + + /** + * Check connected, throw exception if not + * + * @throws Exception + * @return void + */ + protected function checkConnected() + { + if(!$this->_conn) { + throw new Exception(__CLASS__." - no connection established with server"); + } + } + + /** + * ftp_mkdir wrapper + * + * @param stin$name + * @return unknown_type + */ + public function mdkir($name) + { + $this->checkConnected(); + return @ftp_mkdir($this->_conn, $name); + } + + /** + * Make dir recursive + * + * @param string $path + * @param int $mode + * @return bool + */ + public function mkdirRecursive($path, $mode = 0777) + { + $this->checkConnected(); + $dir = explode("/", $path); + $path= ""; + $ret = true; + for ($i=0; $i < count($dir); $i++) { + $path .= "/" .$dir[$i]; + if(!@ftp_chdir($this->_conn, $path)) { + @ftp_chdir($this->_conn,"/"); + if(!@ftp_mkdir($this->_conn,$path)) { + $ret=false; + break; + } else { + @ftp_chmod($this->_conn, $mode, $path); + } + } + } + return $ret; + } + + /** + * Try to login to server + * + * @param string $login + * @param string $password + * @throws Exception on invalid login credentials + * @return bool + */ + public function login($login = "anonymous", $password = "test@gmail.com") + { + $this->checkConnected(); + $res = @ftp_login($this->_conn, $login, $password); + if(!$res) { + throw new Exception("Invalid login credentials"); + } + return $res; + } + + /** + * Validate connection string + * + * @param string $string + * @throws Exception + * @return string + */ + public function validateConnectionString($string) + { + $data = @parse_url($string); + if(false === $data) { + throw new Exception("Connection string invalid: '{$string}'"); + } + if($data['scheme'] != 'ftp') { + throw new Exception("Support for scheme unsupported: '{$data['scheme']}'"); + } + return $data; + } + + /** + * Connect to server using connect string + * Connection string: ftp://user:pass@server:port/path + * user,pass,port,path are optional parts + * + * @param string $string + * @param int $timeout + */ + public function connect($string, $timeout = 900) + { + $params = $this->validateConnectionString($string); + $port = isset($params['port']) ? intval($params['port']) : 21; + + $this->_conn = ftp_connect($params['host'], $port, $timeout); + + if(!$this->_conn) { + throw new Exception("Cannot connect to host: {$params['host']}"); + } + if(isset($params['user']) && isset($params['pass'])) { + $this->login($params['user'], $params['pass']); + } else { + $this->login(); + } + if(isset($params['path'])) { + if(!$this->chdir($params['path'])) { + throw new Exception ("Cannot chdir after login to: {$params['path']}"); + } + } + } + + /** + * ftp_fput wrapper + * + * @param string $remoteFile + * @param resource $handle + * @param int $mode FTP_BINARY | FTP_ASCII + * @param int $startPos + * @return bool + */ + public function fput($remoteFile, $handle, $mode = FTP_BINARY, $startPos = 0) + { + $this->checkConnected(); + return @ftp_fput($this->_conn, $remoteFile, $handle, $mode, $startPos); + } + + /** + * ftp_put wrapper + * + * @param string $remoteFile + * @param string $localFile + * @param int $mode FTP_BINARY | FTP_ASCII + * @param int $startPos + * @return bool + */ + public function put($remoteFile, $localFile, $mode = FTP_BINARY, $startPos = 0) + { + $this->checkConnected(); + return ftp_put($this->_conn, $remoteFile, $localFile, $mode, $startPos); + } + + /** + * Get current working directory + * + * @return mixed + */ + public function getcwd() + { + $d = $this->raw("pwd"); + $data = explode(" ", $d[0], 3); + if(empty($data[1])) { + return false; + } + if(intval($data[0]) != 257) { + return false; + } + $out = trim($data[1], '"'); + if($out !== "/") { + $out = rtrim($out, "/"); + } + return $out; + } + + /** + * ftp_raw wrapper + * + * @param string $cmd + * @return mixed + */ + public function raw($cmd) + { + $this->checkConnected(); + return @ftp_raw($this->_conn, $cmd); + } + + /** + * Upload local file to remote + * + * Can be used for relative and absoulte remote paths + * Relative: use chdir before calling this + * + * @param srting $remote + * @param string $local + * @param int $dirMode + * @param int $ftpMode + * @return unknown_type + */ + public function upload($remote, $local, $dirMode = 0777, $ftpMode = FTP_BINARY) + { + $this->checkConnected(); + + if(!file_exists($local)) { + throw new Exception("Local file doesn't exist: {$localFile}"); + } + if(!is_readable($local)) { + throw new Exception("Local file is not readable: {$localFile}"); + } + if(is_dir($local)) { + throw new Exception("Directory given instead of file: {$localFile}"); + } + + $globalPathMode = substr($remote, 0, 1) == "/"; + $dirname = dirname($remote); + $cwd = $this->getcwd(); + if(false === $cwd) { + throw new Exception("Server returns something awful on PWD command"); + } + + if(!$globalPathMode) { + $dirname = $cwd."/".$dirname; + $remote = $cwd."/".$remote; + } + $res = $this->mkdirRecursive($dirname, $dirMode); + $this->chdir($cwd); + + if(!$res) { + return false; + } + return $this->put($remote, $local, $ftpMode); + } + + /** + * Download remote file to local machine + * + * @param string $remote + * @param string $local + * @param int $ftpMode FTP_BINARY|FTP_ASCII + * @return bool + */ + public function download($remote, $local, $ftpMode = FTP_BINARY) + { + $this->checkConnected(); + return $this->get($local, $remote, $ftpMode); + } + + /** + * ftp_pasv wrapper + * + * @param bool $pasv + * @return bool + */ + public function pasv($pasv) + { + $this->checkConnected(); + return @ftp_pasv($this->_conn, (bool) $pasv); + } + + /** + * Close FTP connection + * + * @return void + */ + public function close() + { + if($this->_conn) { + @ftp_close($this->_conn); + } + } + + /** + * ftp_chmod wrapper + * + * @param $mode + * @param $remoteFile + * @return bool + */ + public function chmod($mode, $remoteFile) + { + $this->checkConnected(); + return @ftp_chmod($this->_conn, $mode, $remoteFile); + } + + /** + * ftp_chdir wrapper + * + * @param string $dir + * @return bool + */ + public function chdir($dir) + { + $this->checkConnected(); + return @ftp_chdir($this->_conn, $dir); + } + + /** + * ftp_cdup wrapper + * + * @return bool + */ + public function cdup() + { + $this->checkConnected(); + return @ftp_cdup($this->_conn); + } + + /** + * ftp_get wrapper + * + * @param string $localFile + * @param string $remoteFile + * @param int $fileMode FTP_BINARY | FTP_ASCII + * @param int $resumeOffset + * @return bool + */ + public function get($localFile, $remoteFile, $fileMode = FTP_BINARY, $resumeOffset = 0) + { + $remoteFile = $this->correctFilePath($remoteFile); + $this->checkConnected(); + return @ftp_get($this->_conn, $localFile, $remoteFile, $fileMode, $resumeOffset); + } + + /** + * ftp_nlist wrapper + * + * @param string $dir + * @return bool + */ + public function nlist($dir = "/") + { + $this->checkConnected(); + $dir = $this->correctFilePath($dir); + return @ftp_nlist($this->_conn, $dir); + } + + /** + * ftp_rawlist wrapper + * + * @param string $dir + * @param bool $recursive + * @return mixed + */ + public function rawlist( $dir = "/", $recursive = false ) + { + $this->checkConnected(); + $dir = $this->correctFilePath($dir); + return @ftp_rawlist($this->_conn, $dir, $recursive); + } + + /** + * Convert byte count to float KB/MB format + * + * @param int $bytes + * @return string + */ + public static function byteconvert($bytes) + { + $symbol = array('B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'); + $exp = floor( log($bytes) / log(1024) ); + return sprintf( '%.2f ' . $symbol[ $exp ], ($bytes / pow(1024, floor($exp))) ); + } + + /** + * Chmod string "-rwxrwxrwx" to "777" converter + * + * @param string $chmod + * @return string + */ + public static function chmodnum($chmod) + { + $trans = array('-' => '0', 'r' => '4', 'w' => '2', 'x' => '1'); + $chmod = substr(strtr($chmod, $trans), 1); + $array = str_split($chmod, 3); + return array_sum(str_split($array[0])) . array_sum(str_split($array[1])) . array_sum(str_split($array[2])); + } + + /** + * Check whether file exists + * + * @param string $path + * @param bool $excludeIfIsDir + * @return bool + */ + public function fileExists($path, $excludeIfIsDir = true) + { + $path = $this->correctFilePath($path); + $globalPathMode = substr($path, 0, 1) == "/"; + + $file = basename($path); + $dir = $globalPathMode ? dirname($path) : $this->getcwd()."/".$path; + $data = $this->ls($dir); + foreach($data as $row) { + if($file == $row['name']) { + if($excludeIfIsDir && $row['dir']) { + continue; + } + return true; + } + } + return false; + } + + /** + * Get directory contents in PHP array + * + * @param string $dir + * @param bool $recursive + * @return array + */ + public function ls($dir = "/", $recursive = false) + { + $dir= $this->correctFilePath($dir); + $rawfiles = (array) $this->rawlist($dir, $recursive); + $structure = array(); + $arraypointer = &$structure; + foreach ($rawfiles as $rawfile) { + if ($rawfile[0] == '/') { + $paths = array_slice(explode('/', str_replace(':', '', $rawfile)), 1); + $arraypointer = &$structure; + foreach ($paths as $path) { + foreach ($arraypointer as $i => $file) { + if ($file['name'] == $path) { + $arraypointer = &$arraypointer[ $i ]['children']; + break; + } + } + } + } elseif(!empty($rawfile)) { + $info = preg_split("/[\s]+/", $rawfile, 9); + $arraypointer[] = array( + 'name' => $info[8], + 'dir' => $info[0]{0} == 'd', + 'size' => (int) $info[4], + 'chmod' => self::chmodnum($info[0]), + 'rawdata' => $info, + 'raw' => $rawfile + ); + } + } + return $structure; + } + + /** + * Correct file path + * + * @param string $str + * @return string + */ + public function correctFilePath($str) + { + $str = str_replace("\\", "/", $str); + $str = preg_replace("/^.\//", "", $str); + return $str; + } + + /** + * Delete file + * + * @param string $file + * @return bool + */ + public function delete($file) + { + $this->checkConnected(); + $file = $this->correctFilePath($file); + return @ftp_delete($this->_conn, $file); + } +} diff --git a/lib/Mage/Xml/Generator.php b/lib/Mage/Xml/Generator.php index f95ef6d06ab51fff3367c748e840e8156865c477..1c9d4f9cdc72b447d261e0022c1de02b53299e56 100644 --- a/lib/Mage/Xml/Generator.php +++ b/lib/Mage/Xml/Generator.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Xml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Mage/Xml/Parser.php b/lib/Mage/Xml/Parser.php index 4539f41a07de9a769cced93551cdaabf42522c87..f4937f52ac2c9594c36cdb5743e3e41aba8db3f8 100644 --- a/lib/Mage/Xml/Parser.php +++ b/lib/Mage/Xml/Parser.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage_Xml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Magento/Autoload.php b/lib/Magento/Autoload.php index 95dc5ca90266ea37c447ad5c851cd5618657a00e..f771f196b9cab499afccc8fcf33926185b780ffe 100644 --- a/lib/Magento/Autoload.php +++ b/lib/Magento/Autoload.php @@ -20,7 +20,7 @@ * * @category Magento * @package Magento_Loader - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -152,8 +152,8 @@ class Magento_Autoload * Add classes files declaration to the map. New map will override existing values if such was defined before. * * @param array|string $map - * @param string $basePath * @return Magento_Autoload + * @throws Magento_Exception */ public function addFilesMap($map) { @@ -161,13 +161,13 @@ class Magento_Autoload if (is_file($map) && is_readable($map)) { $map = unserialize(file_get_contents($map)); } else { - throw new Exception($map . ' file does not exist.'); + throw new Magento_Exception($map . ' file does not exist.'); } } if (is_array($map)) { $this->_filesMap = array_merge($this->_filesMap, $map); } else { - throw new Exception('$map parameter should be an array or path map file.'); + throw new Magento_Exception('$map parameter should be an array or path map file.'); } return $this; } diff --git a/lib/Magento/Config/Dom.php b/lib/Magento/Config/Dom.php index f251a20a5cb1ad46c1b2e68d377758651b7a363b..527083f11d30e0a7358b6e15cefc28c20cb85f66 100644 --- a/lib/Magento/Config/Dom.php +++ b/lib/Magento/Config/Dom.php @@ -21,7 +21,7 @@ * @category Magento * @package Framework * @subpackage Config - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -135,7 +135,7 @@ class Magento_Config_Dom * Getter for node by path * * @param string $nodePath - * @throws Exception an exception is possible if original document contains multiple nodes for identifier + * @throws Magento_Exception an exception is possible if original document contains multiple nodes for identifier * @return DOMElement | null */ protected function _getMatchedNode($nodePath) @@ -144,7 +144,7 @@ class Magento_Config_Dom $matchedNodes = $xPath->query($nodePath); $node = null; if ($matchedNodes->length > 1) { - throw new Exception("More than one node matching the query: {$nodePath}"); + throw new Magento_Exception("More than one node matching the query: {$nodePath}"); } elseif ($matchedNodes->length == 1) { $node = $matchedNodes->item(0); } diff --git a/lib/Magento/Config/Theme.php b/lib/Magento/Config/Theme.php index d9f48ec7efba5b74a939591a2d958fea60655867..5c9b48c4316a97756edde72ace4c8aab24a3963c 100644 --- a/lib/Magento/Config/Theme.php +++ b/lib/Magento/Config/Theme.php @@ -21,7 +21,7 @@ * @category Magento * @package Framework * @subpackage Config - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -86,7 +86,7 @@ class Magento_Config_Theme extends Magento_Config_XmlAbstract * * @param string $package * @param string $theme - * @throw Exception an exception in case of unknown theme + * @throw Magento_Exception an exception in case of unknown theme * @return array */ public function getCompatibleVersions($package, $theme) @@ -96,7 +96,7 @@ class Magento_Config_Theme extends Magento_Config_XmlAbstract ->query("/design/package[@code='{$package}']/theme[@code='{$theme}']/requirements/magento_version") ->item(0); if (!$version) { - throw new Exception('Unknown theme "' . $theme . '" in "' . $package . '" package.'); + throw new Magento_Exception('Unknown theme "' . $theme . '" in "' . $package . '" package.'); } $result = array( 'from' => $version->getAttribute('from'), diff --git a/lib/Magento/Config/View.php b/lib/Magento/Config/View.php index 343fd632c39cfb21d371c682024af503c37ed9c0..8f79ebca66bf5203662c48f886a1166a0561d8a9 100644 --- a/lib/Magento/Config/View.php +++ b/lib/Magento/Config/View.php @@ -21,7 +21,7 @@ * @category Magento * @package Framework * @subpackage Config - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Magento/Config/XmlAbstract.php b/lib/Magento/Config/XmlAbstract.php index 1564cde447943e3ac67bccfd76a33e5e1045321c..0e0a6d607fc4468e5392dadff28991d6ceb61f9e 100644 --- a/lib/Magento/Config/XmlAbstract.php +++ b/lib/Magento/Config/XmlAbstract.php @@ -21,7 +21,7 @@ * @category Magento * @package Framework * @subpackage Config - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -39,12 +39,12 @@ abstract class Magento_Config_XmlAbstract * Instantiate with the list of files to merge * * @param array $configFiles - * @throws Exception + * @throws Magento_Exception */ public function __construct(array $configFiles) { if (empty($configFiles)) { - throw new Exception('There must be at least one configuration file specified.'); + throw new Magento_Exception('There must be at least one configuration file specified.'); } $this->_merge($configFiles); } @@ -60,14 +60,14 @@ abstract class Magento_Config_XmlAbstract * Merge the config XML-files * * @param array $configFiles - * @throws Exception if a non-existing or invalid XML-file passed + * @throws Magento_Exception if a non-existing or invalid XML-file passed */ protected function _merge($configFiles) { $domConfig = new Magento_Config_Dom($this->_getInitialXml(), $this->_getIdAttributes()); foreach ($configFiles as $file) { if (!file_exists($file)) { - throw new Exception("File does not exist: {$file}"); + throw new Magento_Exception("File does not exist: {$file}"); } $domConfig->merge(file_get_contents($file)); if (!$domConfig->validate($this->getSchemaFile(), $errors)) { @@ -76,7 +76,7 @@ abstract class Magento_Config_XmlAbstract foreach ($errors as $error) { $message .= "{$error->message} Line: {$error->line}\n"; } - throw new Exception($message); + throw new Magento_Exception($message); } } $this->_dom = $domConfig->getDom(); diff --git a/lib/Magento/Config/theme.xsd b/lib/Magento/Config/theme.xsd index 6ae28d51cdf760789a26423155493ffeec7693c2..3ad9700cb099c32653cd28fd9343a7a2f401b9f4 100644 --- a/lib/Magento/Config/theme.xsd +++ b/lib/Magento/Config/theme.xsd @@ -22,7 +22,7 @@ * @category Magento * @package Framework * @subpackage Config - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/lib/Magento/Config/view.xsd b/lib/Magento/Config/view.xsd index bd1900ef116431d48a0c9d27465a43cedd5dc31b..f5976575136a15ca7d35bd8adf6cc27401200434 100644 --- a/lib/Magento/Config/view.xsd +++ b/lib/Magento/Config/view.xsd @@ -22,7 +22,7 @@ * @category Magento * @package Framework * @subpackage Config - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/lib/Magento/Convert/Excel.php b/lib/Magento/Convert/Excel.php index dcc4f8acb3174440336ab713750d94cb1193dff9..9f9e7a4b0c716c937291f3f295357e24a794e1d6 100644 --- a/lib/Magento/Convert/Excel.php +++ b/lib/Magento/Convert/Excel.php @@ -20,7 +20,7 @@ * * @category Magento * @package Magento_Convert - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Magento/Crypt.php b/lib/Magento/Crypt.php index 358f09bd4d786faddfd23d83b821f1a032dc30aa..58fcf18d3974cc13320c247582a1eece24cdfc01 100755 --- a/lib/Magento/Crypt.php +++ b/lib/Magento/Crypt.php @@ -20,7 +20,7 @@ * * @category Magento * @package Magento_Crypt - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Magento/Exception.php b/lib/Magento/Exception.php index e66d0a5d2e968139c1755aa87d7d65faf473a8e8..ee2a63590353d0caccc950f39258d59a6c3ad942 100755 --- a/lib/Magento/Exception.php +++ b/lib/Magento/Exception.php @@ -20,7 +20,7 @@ * * @category Magento * @package Magento_Exception - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Magento/Profiler.php b/lib/Magento/Profiler.php index ef1bd38edbdfc5361a77d33b93855f256707b9ab..9723bbaf099e3dceea0af5770437d4b02f6af5f5 100644 --- a/lib/Magento/Profiler.php +++ b/lib/Magento/Profiler.php @@ -20,7 +20,7 @@ * * @category Magento * @package Magento_Profiler - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Magento/Profiler/Output/Csvfile.php b/lib/Magento/Profiler/Output/Csvfile.php index a9c35d812b8f7fcf0ebc6ad83c194d574e104217..522dc67899bcc335be538f4c517839c1999c49d2 100644 --- a/lib/Magento/Profiler/Output/Csvfile.php +++ b/lib/Magento/Profiler/Output/Csvfile.php @@ -20,7 +20,7 @@ * * @category Magento * @package Magento_Profiler - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Magento/Profiler/Output/Firebug.php b/lib/Magento/Profiler/Output/Firebug.php index 6f2031f86db97086cb90043d364ef67dbedbcd11..435822f458d1e11371e6d81ee252fd0400a70324 100644 --- a/lib/Magento/Profiler/Output/Firebug.php +++ b/lib/Magento/Profiler/Output/Firebug.php @@ -20,7 +20,7 @@ * * @category Magento * @package Magento_Profiler - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Magento/Profiler/Output/Html.php b/lib/Magento/Profiler/Output/Html.php index 630bdbd58ecedcf5669bad36aab96ac87d0522f8..ce5faeac74af83d4702fe640f18ce1f908a52ae8 100644 --- a/lib/Magento/Profiler/Output/Html.php +++ b/lib/Magento/Profiler/Output/Html.php @@ -20,7 +20,7 @@ * * @category Magento * @package Magento_Profiler - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Magento/Profiler/OutputAbstract.php b/lib/Magento/Profiler/OutputAbstract.php index 9411eee9952af7602ce383f38fd72c81810836a2..0544c662db02d1fab8b0bed7f9463e0f9312be59 100644 --- a/lib/Magento/Profiler/OutputAbstract.php +++ b/lib/Magento/Profiler/OutputAbstract.php @@ -20,7 +20,7 @@ * * @category Magento * @package Magento_Profiler - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Cache/Backend/Database.php b/lib/Varien/Cache/Backend/Database.php index 6eb13557153a5dcd60153a2726d934247e8996bb..af3170da0392d44b060036c2a64e781669b11d0c 100644 --- a/lib/Varien/Cache/Backend/Database.php +++ b/lib/Varien/Cache/Backend/Database.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Cache - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Cache/Backend/Eaccelerator.php b/lib/Varien/Cache/Backend/Eaccelerator.php index 996f82404a2f73eaf0e8bcf08b5a6dd4538f294b..016f14347db7590966525bfad0812345656418c3 100644 --- a/lib/Varien/Cache/Backend/Eaccelerator.php +++ b/lib/Varien/Cache/Backend/Eaccelerator.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Cache - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Cache/Backend/Memcached.php b/lib/Varien/Cache/Backend/Memcached.php index 67bcc5c9ea9a3e02e0143c12dde272a80a3e6cb8..e228f57f1ea5df3b4279bfb6cee1812c4849bf97 100644 --- a/lib/Varien/Cache/Backend/Memcached.php +++ b/lib/Varien/Cache/Backend/Memcached.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Cache - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Cache/Core.php b/lib/Varien/Cache/Core.php index c4d92fbfa44564b0034400d3010dfa10604aa679..f2ee0773437721596f54c47e15f0021455fd8437 100644 --- a/lib/Varien/Cache/Core.php +++ b/lib/Varien/Cache/Core.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Cache - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Convert/Container/Abstract.php b/lib/Varien/Convert/Container/Abstract.php index 489e212ac7df38d5faec3e977903aca3d148f655..a0d98da7dbabb95fc3456a60a32cd556bef98cdb 100644 --- a/lib/Varien/Convert/Container/Abstract.php +++ b/lib/Varien/Convert/Container/Abstract.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Convert - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Convert/Exception.php b/lib/Varien/Convert/Exception.php index 97dca706f0761460878474d5f4940797cc74668c..b3c83d749d7b22a5cb6717d5a22d954808bc9989 100644 --- a/lib/Varien/Convert/Exception.php +++ b/lib/Varien/Convert/Exception.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Convert - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Convert/Mapper/Column.php b/lib/Varien/Convert/Mapper/Column.php index 0df76cf99f40ffebcc6c35829dc2033c72279369..95ac6e1a354edf0d93045d94f5996d187ff124a8 100644 --- a/lib/Varien/Convert/Mapper/Column.php +++ b/lib/Varien/Convert/Mapper/Column.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Convert - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Convert/Mapper/Interface.php b/lib/Varien/Convert/Mapper/Interface.php index 7cd9963a549a8555900cf05cb345747ba272cb0f..1a7808f5a631da29b03dea705145f45ead497535 100644 --- a/lib/Varien/Convert/Mapper/Interface.php +++ b/lib/Varien/Convert/Mapper/Interface.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Convert - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Data/Collection.php b/lib/Varien/Data/Collection.php index bcdf6b05ba6321785c37c7dcc88f85bd1deb5a42..c4b3a0dd354e23511112f30ea13ffa572751b1cf 100644 --- a/lib/Varien/Data/Collection.php +++ b/lib/Varien/Data/Collection.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Data - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Data/Collection/Db.php b/lib/Varien/Data/Collection/Db.php index a82f359f78ed89808b498d84d964e4d71ff7a2e8..0ac9545b3f3bcf45b070a2b97bc9b28b6580f7e9 100644 --- a/lib/Varien/Data/Collection/Db.php +++ b/lib/Varien/Data/Collection/Db.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Data - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -373,42 +373,76 @@ class Varien_Data_Collection_Db extends Varien_Data_Collection * Add field filter to collection * * @see self::_getConditionSql for $condition - * @param string $field - * @param null|string|array $condition - * @return Mage_Eav_Model_Entity_Collection_Abstract + * + * @param string|array $field + * @param null|string|array $condition + * + * @return Mage_Eav_Model_Entity_Collection_Abstract */ - public function addFieldToFilter($field, $condition=null) + public function addFieldToFilter($field, $condition = null) { - $field = $this->_getMappedField($field); - $this->_select->where($this->_getConditionSql($field, $condition), null, Varien_Db_Select::TYPE_CONDITION); + if (!is_array($field)) { + $resultCondition = $this->_translateCondition($field, $condition); + } else { + $conditions = array(); + foreach ($field as $key => $currField) { + $conditions[] = $this->_translateCondition( + $currField, + isset($condition[$key]) ? $condition[$key] : null + ); + } + + $resultCondition = '(' . join(') ' . Zend_Db_Select::SQL_OR . ' (', $conditions) . ')'; + } + + $this->_select->where($resultCondition); + return $this; } + /** + * Build sql where condition part + * + * @param string|array $field + * @param null|string|array $condition + * + * @return string + */ + protected function _translateCondition($field, $condition) + { + $field = $this->_getMappedField($field); + return $this->_getConditionSql($field, $condition); + } + /** * Try to get mapped field name for filter to collection * - * @param string - * @return string + * @param string $field + * @return string */ protected function _getMappedField($field) { - $mappedFiled = $field; - $mapper = $this->_getMapper(); if (isset($mapper['fields'][$field])) { $mappedFiled = $mapper['fields'][$field]; + } else { + $mappedFiled = $field; } return $mappedFiled; } + /** + * Retrieve mapper data + * + * @return array|bool|null + */ protected function _getMapper() { if (isset($this->_map)) { return $this->_map; - } - else { + } else { return false; } } @@ -468,6 +502,7 @@ class Varien_Data_Collection_Db extends Varien_Data_Collection } $this->_isOrdersRendered = true; } + return $this; } @@ -488,7 +523,9 @@ class Varien_Data_Collection_Db extends Varien_Data_Collection /** * Set select distinct * - * @param bool $flag + * @param bool $flag + * + * @return Varien_Data_Collection_Db */ public function distinct($flag) { @@ -509,6 +546,9 @@ class Varien_Data_Collection_Db extends Varien_Data_Collection /** * Load data * + * @param bool $printQuery + * @param bool $logQuery + * * @return Varien_Data_Collection_Db */ public function load($printQuery = false, $logQuery = false) @@ -547,7 +587,7 @@ class Varien_Data_Collection_Db extends Varien_Data_Collection * Returns a collection item that corresponds to the fetched row * and moves the internal data pointer ahead * - * return Varien_Object|bool + * @return Varien_Object|bool */ public function fetchItem() { @@ -643,8 +683,10 @@ class Varien_Data_Collection_Db extends Varien_Data_Collection /** * Print and/or log query * - * @param boolean $printQuery - * @param boolean $logQuery + * @param bool $printQuery + * @param bool $logQuery + * @param string $sql + * * @return Varien_Data_Collection_Db */ public function printLogQuery($printQuery = false, $logQuery = false, $sql = null) { diff --git a/lib/Varien/Data/Collection/Filesystem.php b/lib/Varien/Data/Collection/Filesystem.php index 8d6c2cd045f125c89a3373f1ddfd20cf2e9ccd91..c7f5871e93067ce852e885d6936c8a3639823184 100644 --- a/lib/Varien/Data/Collection/Filesystem.php +++ b/lib/Varien/Data/Collection/Filesystem.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Data - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -511,7 +511,7 @@ class Varien_Data_Collection_Filesystem extends Varien_Data_Collection return $this->addCallbackFilter($field, $cond['in'], $type, array($this, 'filterCallbackInArray')); } if (isset($cond['nin'])) { - return $this->addCallbackFilter($field, $cond['nin'], $type, array($this, 'filterCallbackIn'), $inverted); + return $this->addCallbackFilter($field, $cond['nin'], $type, array($this, 'filterCallbackInArray'), $inverted); } if (isset($cond['notnull'])) { return $this->addCallbackFilter($field, $cond['notnull'], $type, array($this, 'filterCallbackIsNull'), $inverted); diff --git a/lib/Varien/Data/Form.php b/lib/Varien/Data/Form.php index 194bc69886873b4f1d6ecff5a28c3e57200b2907..0d4de443344272dbf1a14eefc28c89691d17f4fa 100644 --- a/lib/Varien/Data/Form.php +++ b/lib/Varien/Data/Form.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Data - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Data/Form/Abstract.php b/lib/Varien/Data/Form/Abstract.php index af4a5ac0a41f8f4eb2a33fbd4ddd02a034606b54..c1d91002521f3ec89423201d58eb487d7077f87c 100644 --- a/lib/Varien/Data/Form/Abstract.php +++ b/lib/Varien/Data/Form/Abstract.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Data - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -110,10 +110,12 @@ class Varien_Data_Form_Abstract extends Varien_Object /** * Add form element * - * @param Varien_Data_Form_Element_Abstract $element - * @return Varien_Data_Form + * @param Varien_Data_Form_Element_Abstract $element + * @param bool|string|null $after + * + * @return Varien_Data_Form */ - public function addElement(Varien_Data_Form_Element_Abstract $element, $after=null) + public function addElement(Varien_Data_Form_Element_Abstract $element, $after = null) { $element->setForm($this); $this->getElements()->add($element, $after); @@ -163,11 +165,12 @@ class Varien_Data_Form_Abstract extends Varien_Object * Enter description here... * * @param string $elementId - * @param unknown_type $config - * @param unknown_type $after + * @param array $config + * @param bool|string|null $after + * * @return Varien_Data_Form_Element_Fieldset */ - public function addFieldset($elementId, $config, $after=false) + public function addFieldset($elementId, $config, $after = false) { $element = new Varien_Data_Form_Element_Fieldset($config); $element->setId($elementId); diff --git a/lib/Varien/Data/Form/Element/Abstract.php b/lib/Varien/Data/Form/Element/Abstract.php index c7b8ff0fb6da4bd0dc326c35c06c66f84614137e..bf45faea108418cc201a530a5d94718f0c3d67bd 100644 --- a/lib/Varien/Data/Form/Element/Abstract.php +++ b/lib/Varien/Data/Form/Element/Abstract.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Data - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Data/Form/Element/Button.php b/lib/Varien/Data/Form/Element/Button.php index 19e4c7914825f59e6d71fb5b454ba8d1e32e523d..29b4cafd759b60b4bb0505b5ff1134ff291afa15 100644 --- a/lib/Varien/Data/Form/Element/Button.php +++ b/lib/Varien/Data/Form/Element/Button.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Data - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Data/Form/Element/Checkbox.php b/lib/Varien/Data/Form/Element/Checkbox.php index d7299b01f1382e93ee9dc3aa20796f6a3871ae91..c1a327de904cba856c47d72d731b71ef1fb69e36 100644 --- a/lib/Varien/Data/Form/Element/Checkbox.php +++ b/lib/Varien/Data/Form/Element/Checkbox.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Data - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Data/Form/Element/Checkboxes.php b/lib/Varien/Data/Form/Element/Checkboxes.php index 8939177e16f106034120287d8226fa1ab4e3ff44..a348692bce03ac57493867662250469f5d462b1d 100644 --- a/lib/Varien/Data/Form/Element/Checkboxes.php +++ b/lib/Varien/Data/Form/Element/Checkboxes.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Data - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Data/Form/Element/Collection.php b/lib/Varien/Data/Form/Element/Collection.php index 345d59bd629849cf734bc8318a05cf13053ac622..4808378e3c3b3e7f9a70bad0746fa9b46f953bf1 100644 --- a/lib/Varien/Data/Form/Element/Collection.php +++ b/lib/Varien/Data/Form/Element/Collection.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Data - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -116,10 +116,11 @@ class Varien_Data_Form_Element_Collection implements ArrayAccess, IteratorAggreg * * @todo get it straight with $after * @param Varien_Data_Form_Element_Abstract $element - * @param boolean|'^'|string $after - * @return Varien_Data_Form_Element_Abstract + * @param bool|string $after + * + * @return Varien_Data_Form_Element_Collection */ - public function add(Varien_Data_Form_Element_Abstract $element, $after=false) + public function add(Varien_Data_Form_Element_Abstract $element, $after = false) { // Set the Form for the node if ($this->_container->getForm() instanceof Varien_Data_Form) { diff --git a/lib/Varien/Data/Form/Element/Column.php b/lib/Varien/Data/Form/Element/Column.php index b01eb8b7605001e330e98c392ebe3b85641d38b2..bccfc5d006d5633024a2eec78a7c6dfc735229d7 100644 --- a/lib/Varien/Data/Form/Element/Column.php +++ b/lib/Varien/Data/Form/Element/Column.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Data - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Data/Form/Element/Date.php b/lib/Varien/Data/Form/Element/Date.php index f1399de4f604dc05c8036f6396dd4cf9b1760917..ffbc18681ecdc2f2dff7aaadf05fdde5603604db 100644 --- a/lib/Varien/Data/Form/Element/Date.php +++ b/lib/Varien/Data/Form/Element/Date.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Data - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Data/Form/Element/Editor.php b/lib/Varien/Data/Form/Element/Editor.php index 9ba24266c25aa397d3240c4331e32a3344ef364f..074f9e338df70b28422cb5f7b0e6277b339392ac 100644 --- a/lib/Varien/Data/Form/Element/Editor.php +++ b/lib/Varien/Data/Form/Element/Editor.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Data - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -308,7 +308,7 @@ class Varien_Data_Form_Element_Editor extends Varien_Data_Form_Element_Textarea $html.= isset($data['style']) ? ' style="'.$data['style'].'"' : ''; $html.= isset($data['id']) ? ' id="'.$data['id'].'"' : ''; $html.= '>'; - $html.= isset($data['title']) ? '<span>'.$data['title'].'</span>' : ''; + $html.= isset($data['title']) ? '<span><span><span>'.$data['title'].'</span></span></span>' : ''; $html.= '</button>'; return $html; diff --git a/lib/Varien/Data/Form/Element/Fieldset.php b/lib/Varien/Data/Form/Element/Fieldset.php index 588428bb07b3fb521f5edac75bd732b30efa19d3..a7c49f2a9ef8c0f24f11509b8a37749f6bf9a986 100644 --- a/lib/Varien/Data/Form/Element/Fieldset.php +++ b/lib/Varien/Data/Form/Element/Fieldset.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Data - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Data/Form/Element/File.php b/lib/Varien/Data/Form/Element/File.php index a3a06c264ef3e250d5ba08dd578ff5402ed1ea0b..0fb5c1a155233a4b88890bc93168720799e9ccd1 100644 --- a/lib/Varien/Data/Form/Element/File.php +++ b/lib/Varien/Data/Form/Element/File.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Data - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Data/Form/Element/Gallery.php b/lib/Varien/Data/Form/Element/Gallery.php index a697dd75b46a01cb89defdd07960e15e98ccb108..19984a79a40c01371c30749aff333a62dc8e3fee 100644 --- a/lib/Varien/Data/Form/Element/Gallery.php +++ b/lib/Varien/Data/Form/Element/Gallery.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Data - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Data/Form/Element/Hidden.php b/lib/Varien/Data/Form/Element/Hidden.php index d835e193ecac20c03303de764b2cc220b1e947d2..c20faa77bd1dc0c864040887c2a5e8a733e60591 100644 --- a/lib/Varien/Data/Form/Element/Hidden.php +++ b/lib/Varien/Data/Form/Element/Hidden.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Data - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Data/Form/Element/Image.php b/lib/Varien/Data/Form/Element/Image.php index 41420a1a62d8330c47e3218c6de30a67b3b381ac..4e5fe23f3f8e4cdd0553ead06d3495b1e4968bb1 100644 --- a/lib/Varien/Data/Form/Element/Image.php +++ b/lib/Varien/Data/Form/Element/Image.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Data - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Data/Form/Element/Imagefile.php b/lib/Varien/Data/Form/Element/Imagefile.php index 2eb815bffb67a164f49094f6130f97a1b05316aa..42e4baa7273305fa69f222acc97b25667f63170b 100644 --- a/lib/Varien/Data/Form/Element/Imagefile.php +++ b/lib/Varien/Data/Form/Element/Imagefile.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Data - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Data/Form/Element/Label.php b/lib/Varien/Data/Form/Element/Label.php index 18637f161aedd44d704c5a45ee5ff8a64f979726..34ae50b617bedb81855bf2a4f4e76d029a68f591 100644 --- a/lib/Varien/Data/Form/Element/Label.php +++ b/lib/Varien/Data/Form/Element/Label.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Data - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -33,19 +33,28 @@ */ class Varien_Data_Form_Element_Label extends Varien_Data_Form_Element_Abstract { - public function __construct($attributes=array()) + /** + * Assigns attributes for Element + * + * @param array $attributes + */ + public function __construct($attributes=array()) { parent::__construct($attributes); $this->setType('label'); } + /** + * Retrieve Element HTML + * + * @return string + */ public function getElementHtml() { - $html = $this->getBold() ? '<strong>' : ''; - $html.= $this->getEscapedValue(); - $html.= $this->getBold() ? '</strong>' : ''; - $html.= $this->getAfterElementHtml(); - return $html; + $html = $this->getBold() ? '<strong>' : ''; + $html.= $this->getEscapedValue(); + $html.= $this->getBold() ? '</strong>' : ''; + $html.= $this->getAfterElementHtml(); + return $html; } - -} \ No newline at end of file +} diff --git a/lib/Varien/Data/Form/Element/Link.php b/lib/Varien/Data/Form/Element/Link.php index 20bc2289df94b20aba1056504b0e3ff015d63ad1..b268069665d6c93025b8b92ceda081621ae5f347 100644 --- a/lib/Varien/Data/Form/Element/Link.php +++ b/lib/Varien/Data/Form/Element/Link.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Data - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Data/Form/Element/Multiline.php b/lib/Varien/Data/Form/Element/Multiline.php index 15c9522a2bb8e03272c4dfa3adee7ee525f75e33..f1edc0e2de0da425504701302433e887819b66a7 100644 --- a/lib/Varien/Data/Form/Element/Multiline.php +++ b/lib/Varien/Data/Form/Element/Multiline.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Data - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Data/Form/Element/Multiselect.php b/lib/Varien/Data/Form/Element/Multiselect.php index b47dc0ae19da629c75b9693574247cfad4f69b74..e0d1373bf35bf780e2169df1a3761f6b636dc1ca 100644 --- a/lib/Varien/Data/Form/Element/Multiselect.php +++ b/lib/Varien/Data/Form/Element/Multiselect.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Data - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Data/Form/Element/Note.php b/lib/Varien/Data/Form/Element/Note.php index 52311f20ca60a75935e70061edca188acd65da82..889daf0ab42721f5aa7d2da21b381607b3a79800 100644 --- a/lib/Varien/Data/Form/Element/Note.php +++ b/lib/Varien/Data/Form/Element/Note.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Data - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Data/Form/Element/Obscure.php b/lib/Varien/Data/Form/Element/Obscure.php index 2be904654d22e60ca73ce66b3bfbfbdad545db30..b75de33d2be93e1ed41399992d3714eeb67a18a4 100644 --- a/lib/Varien/Data/Form/Element/Obscure.php +++ b/lib/Varien/Data/Form/Element/Obscure.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Data - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Data/Form/Element/Password.php b/lib/Varien/Data/Form/Element/Password.php index f5428f683e8e8795272a6016d5d49c86d168cd1f..656e0c050373a3943956c3d3d7f20627167ab73f 100644 --- a/lib/Varien/Data/Form/Element/Password.php +++ b/lib/Varien/Data/Form/Element/Password.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Data - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Data/Form/Element/Radio.php b/lib/Varien/Data/Form/Element/Radio.php index ba8f22490d4d86cef8d4d78674751ab44e847768..39c648aafaef76315c138f698e804c6750bd5b01 100644 --- a/lib/Varien/Data/Form/Element/Radio.php +++ b/lib/Varien/Data/Form/Element/Radio.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Data - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Data/Form/Element/Radios.php b/lib/Varien/Data/Form/Element/Radios.php index 65460b2359b3a60f978a10b06d8c3cee0ee71283..9c4842781c50604f26564d165028538069a69ce1 100644 --- a/lib/Varien/Data/Form/Element/Radios.php +++ b/lib/Varien/Data/Form/Element/Radios.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Data - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Data/Form/Element/Renderer/Interface.php b/lib/Varien/Data/Form/Element/Renderer/Interface.php index d4b0043b00130e8dfec5f0dfe62df26cdf104f20..253cd84bb05f71bab1e520d843cf20ff0e81e330 100644 --- a/lib/Varien/Data/Form/Element/Renderer/Interface.php +++ b/lib/Varien/Data/Form/Element/Renderer/Interface.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Data - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Data/Form/Element/Reset.php b/lib/Varien/Data/Form/Element/Reset.php index 816a19d4e2ae8fa92b386e9314c4d98c73a095de..c92db81c668a4d9f1fa2e0ca2bfbe79ab8e1e95f 100644 --- a/lib/Varien/Data/Form/Element/Reset.php +++ b/lib/Varien/Data/Form/Element/Reset.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Data - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Data/Form/Element/Select.php b/lib/Varien/Data/Form/Element/Select.php index b425dd00a9985c839afbe4cfce29e3272934c244..96210bd041066c4320f0977cebf9797ce5c75c30 100644 --- a/lib/Varien/Data/Form/Element/Select.php +++ b/lib/Varien/Data/Form/Element/Select.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Data - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Data/Form/Element/Submit.php b/lib/Varien/Data/Form/Element/Submit.php index 7104f10c4a5e1343356d2a1c6cf00aa83223ac30..5a7d97ec7d960cd03dfc6f8fb74e3df6f8956919 100644 --- a/lib/Varien/Data/Form/Element/Submit.php +++ b/lib/Varien/Data/Form/Element/Submit.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Data - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Data/Form/Element/Text.php b/lib/Varien/Data/Form/Element/Text.php index d3e7d0f52e77b54d79d231d5b6c5c1ce25ab2cd1..0c069612367b6027cc4b85af3e16826d8e7cc644 100644 --- a/lib/Varien/Data/Form/Element/Text.php +++ b/lib/Varien/Data/Form/Element/Text.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Data - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Data/Form/Element/Textarea.php b/lib/Varien/Data/Form/Element/Textarea.php index a3b9651c0b30009e8d240361d0f9b075c1ca710b..e039e62a96c6198a83132c041612e82eadf5998c 100644 --- a/lib/Varien/Data/Form/Element/Textarea.php +++ b/lib/Varien/Data/Form/Element/Textarea.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Data - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Data/Form/Element/Time.php b/lib/Varien/Data/Form/Element/Time.php index 34498f47c76eca6c3cc40cf8547c14f075671c03..f5ff2b90e421e212ea14de88a8937e67d5be56c0 100644 --- a/lib/Varien/Data/Form/Element/Time.php +++ b/lib/Varien/Data/Form/Element/Time.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Data - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Data/Form/Filter/Date.php b/lib/Varien/Data/Form/Filter/Date.php index a924f5019e9f5c13524760ba5d7d0f6db0d8b8a3..6d074e7d729d73f2d37637025d160db2d6c1a9c3 100644 --- a/lib/Varien/Data/Form/Filter/Date.php +++ b/lib/Varien/Data/Form/Filter/Date.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Data - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Data/Form/Filter/Escapehtml.php b/lib/Varien/Data/Form/Filter/Escapehtml.php index 73e67713ca3ae8c7456b16db2ada637f501daecc..ccfe6a11a5c1eb9214e25d670d8f2ffd4ecece84 100644 --- a/lib/Varien/Data/Form/Filter/Escapehtml.php +++ b/lib/Varien/Data/Form/Filter/Escapehtml.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Data - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Data/Form/Filter/Interface.php b/lib/Varien/Data/Form/Filter/Interface.php index abbb87ef7783273357ff7c619b88b1d83ef687f9..b443754c9501d7939c90fab7412bcac6895ac254 100644 --- a/lib/Varien/Data/Form/Filter/Interface.php +++ b/lib/Varien/Data/Form/Filter/Interface.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Data - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Data/Form/Filter/Striptags.php b/lib/Varien/Data/Form/Filter/Striptags.php index b93ef25caffc87bd43dc23356d87894af92ca3d0..22e5e4c1e5006e1b48d5a8fed5c4db48381e0f46 100644 --- a/lib/Varien/Data/Form/Filter/Striptags.php +++ b/lib/Varien/Data/Form/Filter/Striptags.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Data - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Data/Tree.php b/lib/Varien/Data/Tree.php index 8fab55606fad635e802a27ab82b7a820b237bbee..ba43ef6448395f6fe96914550521ffae22202534 100644 --- a/lib/Varien/Data/Tree.php +++ b/lib/Varien/Data/Tree.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Data - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Data/Tree/Db.php b/lib/Varien/Data/Tree/Db.php index 9398bf0619762f39710de3d1dbb287af412c6b9f..31cbdcfae38e1f0b9dbdccc29e71f45f726deff7 100644 --- a/lib/Varien/Data/Tree/Db.php +++ b/lib/Varien/Data/Tree/Db.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Data - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Data/Tree/Dbp.php b/lib/Varien/Data/Tree/Dbp.php index fefc0cbaec509cc8a1d073871259c336bb553ca0..277e8c0aa1acb8e2b491cb96c8cb55409dca132e 100644 --- a/lib/Varien/Data/Tree/Dbp.php +++ b/lib/Varien/Data/Tree/Dbp.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Data - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Data/Tree/Node.php b/lib/Varien/Data/Tree/Node.php index b83dd5bc8ad6979c79fca67470a848400eb952a4..2014445f30082be3f3cf254c543509b3d3e3ff39 100644 --- a/lib/Varien/Data/Tree/Node.php +++ b/lib/Varien/Data/Tree/Node.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Data - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Data/Tree/Node/Collection.php b/lib/Varien/Data/Tree/Node/Collection.php index 8dd0396eaac76b749784bf855cdbdff1779bb1b0..91541e35c608ba9dcfc71ac3cc8b74051d54743a 100644 --- a/lib/Varien/Data/Tree/Node/Collection.php +++ b/lib/Varien/Data/Tree/Node/Collection.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Data - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Date.php b/lib/Varien/Date.php index 5b7a40833e389316091e2718a22eaa0a40c8ab04..bbd815bd3ddb623df78d4d16034afb1c30ea9346 100644 --- a/lib/Varien/Date.php +++ b/lib/Varien/Date.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Date - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Db/Adapter/Interface.php b/lib/Varien/Db/Adapter/Interface.php index 08fd4ddf06a12c35b299d4c35d0fa9268d91e551..85af7e2f0ad2dcc4ab12ea756b5dc3801428e75d 100644 --- a/lib/Varien/Db/Adapter/Interface.php +++ b/lib/Varien/Db/Adapter/Interface.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Db - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -821,6 +821,16 @@ interface Varien_Db_Adapter_Interface */ public function getDatePartSql($date); + /** + * Prepare substring sql function + * + * @param Zend_Db_Expr|string $stringExpression quoted field name or SQL statement + * @param int|string|Zend_Db_Expr $pos + * @param int|string|Zend_Db_Expr|null $len + * @return Zend_Db_Expr + */ + public function getSubstringSql($stringExpression, $pos, $len = null); + /** * Extract part of a date * diff --git a/lib/Varien/Db/Adapter/Mysqli.php b/lib/Varien/Db/Adapter/Mysqli.php index 9cc1d51a142834f410d7fba5715ca420d9f965cf..26c8242912cfc3887b2c370cbeee580349e2e46f 100644 --- a/lib/Varien/Db/Adapter/Mysqli.php +++ b/lib/Varien/Db/Adapter/Mysqli.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Db - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Db/Adapter/Pdo/Mysql.php b/lib/Varien/Db/Adapter/Pdo/Mysql.php index afa243860bef58b184fb982f36fe36c29e3933b7..035e2ce1a404bf705d12595f2e1a46c36860b005 100644 --- a/lib/Varien/Db/Adapter/Pdo/Mysql.php +++ b/lib/Varien/Db/Adapter/Pdo/Mysql.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Db - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -48,6 +48,11 @@ class Varien_Db_Adapter_Pdo_Mysql extends Zend_Db_Adapter_Pdo_Mysql implements V const LENGTH_INDEX_NAME = 64; const LENGTH_FOREIGN_NAME = 64; + /** + * MEMORY engine type for MySQL tables + */ + const ENGINE_MEMORY = 'MEMORY'; + /** * Default class name for a DB statement. * @@ -429,21 +434,6 @@ class Varien_Db_Adapter_Pdo_Mysql extends Zend_Db_Adapter_Pdo_Mysql implements V } } - if (strpos($sql, ':') !== false || strpos($sql, '?') !== false) { - $before = count($bind); - $this->_bindParams = $bind; // Used by callback - $sql = preg_replace_callback('#(([\'"])((\\2)|((.*?[^\\\\])\\2)))#', - array($this, 'proccessBindCallback'), - $sql); - Varien_Exception::processPcreError(); - $bind = $this->_bindParams; - - // If _processBindCallbacks() has added named entries to positional bind - normalize it to positional - if (!$isNamedBind && $before && (count($bind) != $before)) { - $this->_convertMixedBind($sql, $bind); - } - } - // Special query hook if ($this->_queryHook) { $object = $this->_queryHook['object']; @@ -2002,23 +1992,10 @@ class Varien_Db_Adapter_Pdo_Mysql extends Zend_Db_Adapter_Pdo_Mysql implements V } $columns = array(); - $columnsDefinition = $table->getColumns(); foreach ($indexData['COLUMNS'] as $columnData) { - $columnCode = strtoupper($columnData['NAME']); $column = $this->quoteIdentifier($columnData['NAME']); if (!empty($columnData['SIZE'])) { $column .= sprintf('(%d)', $columnData['SIZE']); - } else if (isset($columnsDefinition[$columnCode]['DATA_TYPE']) - && in_array($columnsDefinition[$columnCode]['DATA_TYPE'], - array(Varien_Db_Ddl_Table::TYPE_BLOB, Varien_Db_Ddl_Table::TYPE_TEXT)) - ) { - if (!empty($columnsDefinition[$columnCode]['LENGTH']) - && is_numeric($columnsDefinition[$columnCode]['LENGTH']) - ) { - $column .= "({$columnsDefinition[$columnCode]['LENGTH']})"; - } else { - $column .= '(255)'; - } } $columns[] = $column; } @@ -2361,19 +2338,7 @@ class Varien_Db_Adapter_Pdo_Mysql extends Zend_Db_Adapter_Pdo_Mysql implements V $field, $tableName); throw new Zend_Db_Exception($msg); } - $prefix = ''; - $fieldUpperCase = strtoupper($field); - if (isset($columns[$fieldUpperCase]['DATA_TYPE']) - && in_array($columns[$fieldUpperCase]['DATA_TYPE'], - array(Varien_Db_Ddl_Table::TYPE_BLOB, Varien_Db_Ddl_Table::TYPE_TEXT)) - ) { - if (!empty($columns[$fieldUpperCase]['LENGTH']) && is_numeric($columns[$fieldUpperCase]['LENGTH'])) { - $prefix .= "({$columns[$fieldUpperCase]['LENGTH']})"; - } else { - $prefix .= '(255)'; - } - } - $fieldSql[] = $this->quoteIdentifier($field) . $prefix; + $fieldSql[] = $this->quoteIdentifier($field); } $fieldSql = implode(',', $fieldSql); @@ -2700,7 +2665,9 @@ class Varien_Db_Adapter_Pdo_Mysql extends Zend_Db_Adapter_Pdo_Mysql implements V $value = (int)$value; break; case 'bigint': - // Can't cast to int on 32 bit systems here: BIGINT is larger than such systems' MAX_INT + if (!is_integer($value)) { + $value = sprintf('%.0f', (float)$value); + } break; case 'decimal': @@ -2941,6 +2908,22 @@ class Varien_Db_Adapter_Pdo_Mysql extends Zend_Db_Adapter_Pdo_Mysql implements V return new Zend_Db_Expr(sprintf('DATE(%s)', $date)); } + /** + * Prepare substring sql function + * + * @param Zend_Db_Expr|string $stringExpression quoted field name or SQL statement + * @param int|string|Zend_Db_Expr $pos + * @param int|string|Zend_Db_Expr|null $len + * @return Zend_Db_Expr + */ + public function getSubstringSql($stringExpression, $pos, $len = null) + { + if (is_null($len)) { + return new Zend_Db_Expr(sprintf('SUBSTRING(%s, %s)', $stringExpression, $pos)); + } + return new Zend_Db_Expr(sprintf('SUBSTRING(%s, %s, %s)', $stringExpression, $pos, $len)); + } + /** * Extract part of a date * diff --git a/lib/Varien/Db/Ddl/Table.php b/lib/Varien/Db/Ddl/Table.php index 5de68c40cf90ecd5fe6694ee1dfc168206d691b5..1f179f049cbf22bf758119a8145aa49f45cd1f02 100644 --- a/lib/Varien/Db/Ddl/Table.php +++ b/lib/Varien/Db/Ddl/Table.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Db - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Db/Exception.php b/lib/Varien/Db/Exception.php index 771a3f040673f146ae39065a85b40a63c8fd3de0..ba18848544ef933f842a10153df82c607a3ca495 100644 --- a/lib/Varien/Db/Exception.php +++ b/lib/Varien/Db/Exception.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Db - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Db/Helper.php b/lib/Varien/Db/Helper.php index f356a539d0875b9dc0b4f6223dc22ce964ed8625..72438fcaeafec53d284fd77139aa8f3af081238b 100644 --- a/lib/Varien/Db/Helper.php +++ b/lib/Varien/Db/Helper.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Db - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Db/Select.php b/lib/Varien/Db/Select.php index 5f89ef28e9622cadd447aee62f20c92c96234cfe..3ee9b4d8bf77162751080cc3c49a82fa0dd4b248 100644 --- a/lib/Varien/Db/Select.php +++ b/lib/Varien/Db/Select.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Db - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Db/Statement/Parameter.php b/lib/Varien/Db/Statement/Parameter.php index c1cb98160f0cd38f2a90d0c757c064c8d3d7d6b8..60649613f6d5cb581b785c1edbd20963269263ef 100644 --- a/lib/Varien/Db/Statement/Parameter.php +++ b/lib/Varien/Db/Statement/Parameter.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Db - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Db/Statement/Pdo/Mysql.php b/lib/Varien/Db/Statement/Pdo/Mysql.php index 1bc05919c43d4d824f6ea092421a3713dc90ac23..3b26fe4f7afe584d9c444614674e78654c60a050 100644 --- a/lib/Varien/Db/Statement/Pdo/Mysql.php +++ b/lib/Varien/Db/Statement/Pdo/Mysql.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Db - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Db/Statement/Sqlsrv.php b/lib/Varien/Db/Statement/Sqlsrv.php index b564bf9e233d58d23462e2d474a14348e6016192..3cdf0b06ed75f774ef684750331e840fb83a9717 100644 --- a/lib/Varien/Db/Statement/Sqlsrv.php +++ b/lib/Varien/Db/Statement/Sqlsrv.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Db - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Db/Tree.php b/lib/Varien/Db/Tree.php index 1485a529388aabe7b3be7a03da62205be7af39c5..0535ea159b85882c86f5cef6b05e7ab54538394f 100644 --- a/lib/Varien/Db/Tree.php +++ b/lib/Varien/Db/Tree.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Db - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Db/Tree/Exception.php b/lib/Varien/Db/Tree/Exception.php index 9b8a8fffecf9467ae5335d2a3b4091ce9777da74..f92b3cc7cad50226706d5e8a0f57cea741262d0a 100644 --- a/lib/Varien/Db/Tree/Exception.php +++ b/lib/Varien/Db/Tree/Exception.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Db - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Db/Tree/Node.php b/lib/Varien/Db/Tree/Node.php index c230bdb025ca5846937dfe8e5824baeb6c9dba38..44eb501d32bc5ac68e420f65af932ba3d87864d4 100644 --- a/lib/Varien/Db/Tree/Node.php +++ b/lib/Varien/Db/Tree/Node.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Db - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Db/Tree/Node/Exception.php b/lib/Varien/Db/Tree/Node/Exception.php index 69f7f02f2157dbd181c83d6169bb418d455f9eb0..ddb14ad09c1a846bb6142ddfe494138a9867e6d0 100644 --- a/lib/Varien/Db/Tree/Node/Exception.php +++ b/lib/Varien/Db/Tree/Node/Exception.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Db - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Db/Tree/NodeSet.php b/lib/Varien/Db/Tree/NodeSet.php index 621e7556c7c7137c753c7112a2fd2fe8445d8e7a..96050c8dc1cb35ac4262a7a7eec1ddc2b47af7d7 100644 --- a/lib/Varien/Db/Tree/NodeSet.php +++ b/lib/Varien/Db/Tree/NodeSet.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Db - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Db/Tree/NodeSet/Exception.php b/lib/Varien/Db/Tree/NodeSet/Exception.php index 86dc4d91347857443dae488e2307f981ed0d5273..e53514af43068dc7baa6e383b4aca3a7a2598805 100644 --- a/lib/Varien/Db/Tree/NodeSet/Exception.php +++ b/lib/Varien/Db/Tree/NodeSet/Exception.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Db - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Debug.php b/lib/Varien/Debug.php index 8c4aaaeeed1b32f16460d6aea50e19b8b12f2d38..29e3ed1df749b173ba02c0a6ee9408f9dff67b32 100644 --- a/lib/Varien/Debug.php +++ b/lib/Varien/Debug.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Debug - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Directory/Collection.php b/lib/Varien/Directory/Collection.php index abff04334b690bb126e0ca85ad64018d585513e7..b4a411e3f99dbf2cb343072ce9a897b1055a048e 100644 --- a/lib/Varien/Directory/Collection.php +++ b/lib/Varien/Directory/Collection.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Directory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Directory/Factory.php b/lib/Varien/Directory/Factory.php index 6012d5680101cc7880c7fd8efaa586a1021d8705..9af51379ae738e4550ef323fe6e17b5f6a47ef85 100644 --- a/lib/Varien/Directory/Factory.php +++ b/lib/Varien/Directory/Factory.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Directory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Directory/IFactory.php b/lib/Varien/Directory/IFactory.php index 72e35480a0d3435ce73c23dd4de7ee7e3a2c70a5..0d873c070f774ff0f1c4f40537586632900fd4b2 100644 --- a/lib/Varien/Directory/IFactory.php +++ b/lib/Varien/Directory/IFactory.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Directory - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Event.php b/lib/Varien/Event.php index f03ca40105f0742699356148f3f570749b1e0fdc..5dfea2c2fd3bbc4ac017328cbb4e644581a78db4 100644 --- a/lib/Varien/Event.php +++ b/lib/Varien/Event.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Event - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Event/Collection.php b/lib/Varien/Event/Collection.php index 1d582be20f7334ebffedd0477f28b38362848f52..cfebaf7dd150430c00672bbaafc2d0bd28a209d9 100644 --- a/lib/Varien/Event/Collection.php +++ b/lib/Varien/Event/Collection.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Event - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Event/Observer.php b/lib/Varien/Event/Observer.php index 35bec5266dc8e9dfb8f53832d4bda4ee7e831d14..a1b7c997e77bb760d06c5d6fad77912ae4f61c98 100644 --- a/lib/Varien/Event/Observer.php +++ b/lib/Varien/Event/Observer.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Event - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Event/Observer/Collection.php b/lib/Varien/Event/Observer/Collection.php index 6719eaad5f665e4929eea5226a3e1fc085e754ce..1ce82b14f985300eb176b59680e2ef01f7a4508c 100644 --- a/lib/Varien/Event/Observer/Collection.php +++ b/lib/Varien/Event/Observer/Collection.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Event - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Event/Observer/Cron.php b/lib/Varien/Event/Observer/Cron.php index 1909c3355d6b369234caccafda9c98e11533716e..308e57e0a705b01040c0f8c7bc410a8ab51b8a9c 100644 --- a/lib/Varien/Event/Observer/Cron.php +++ b/lib/Varien/Event/Observer/Cron.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Event - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Event/Observer/Regex.php b/lib/Varien/Event/Observer/Regex.php index 124240452b7f19dd00b2a79cf9e02ffb155ed02d..7519f26dd73edd7568f33e4a87409cb57fd4ea22 100644 --- a/lib/Varien/Event/Observer/Regex.php +++ b/lib/Varien/Event/Observer/Regex.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Event - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Exception.php b/lib/Varien/Exception.php index 56a3d4bfb8e86be3c8fea2cd3837e0f175e848fa..b1907df44b581d0f8bc69ce459262eafb74822a5 100644 --- a/lib/Varien/Exception.php +++ b/lib/Varien/Exception.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Exception - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/File/Csv.php b/lib/Varien/File/Csv.php index c36e0d9b961156832f14e822c3c5523027e0e832..e46592c94ddd0b682af3e364533900cebbecc316 100644 --- a/lib/Varien/File/Csv.php +++ b/lib/Varien/File/Csv.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_File - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/File/CsvMulty.php b/lib/Varien/File/CsvMulty.php index fc22ea125db77f7ff26966384e9fc8a4bc3aef66..2e3370b0ec135e0687e01a7c8ac957666ccfc176 100644 --- a/lib/Varien/File/CsvMulty.php +++ b/lib/Varien/File/CsvMulty.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_File - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/File/Object.php b/lib/Varien/File/Object.php index 6ee294ab5992bff7eb8a86b257f9afd22e3ddc6e..26b58053b15154b533324dba8ad2fbac195d419b 100644 --- a/lib/Varien/File/Object.php +++ b/lib/Varien/File/Object.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_File - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/File/Transfer/Adapter/Http.php b/lib/Varien/File/Transfer/Adapter/Http.php index 2bcd656114d2bb679d9dd3fc0dd81468db0ac869..9022b598e6b11722226481ce2e07d8bce78792e3 100644 --- a/lib/Varien/File/Transfer/Adapter/Http.php +++ b/lib/Varien/File/Transfer/Adapter/Http.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_File - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/File/Uploader.php b/lib/Varien/File/Uploader.php index 11fc486fd99dccac62cf411c3f916a3985042c07..bbf34ce47be9a8ac1511150a1a754fd726b55cef 100644 --- a/lib/Varien/File/Uploader.php +++ b/lib/Varien/File/Uploader.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_File - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Filter/Array.php b/lib/Varien/Filter/Array.php index d4f114b58ecf0dfd5ef44e78dd9c6fad085218c5..13fca5c691b07d1ed02461cc6ffbafba8738cdb4 100644 --- a/lib/Varien/Filter/Array.php +++ b/lib/Varien/Filter/Array.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Filter - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Filter/Array/Grid.php b/lib/Varien/Filter/Array/Grid.php index cfc95cca8c851c71b391e368ffa9f9e5855e27b0..513e703eb467c9db6da6cb5aadd5900e05e10839 100644 --- a/lib/Varien/Filter/Array/Grid.php +++ b/lib/Varien/Filter/Array/Grid.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Filter - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Filter/Email.php b/lib/Varien/Filter/Email.php index 2fd999616a52b9804ab137a3c7618b4d9db837f9..c47a320b44a5096a7644d886c0f5f8d414a1c709 100644 --- a/lib/Varien/Filter/Email.php +++ b/lib/Varien/Filter/Email.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Filter - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Filter/Money.php b/lib/Varien/Filter/Money.php index 0994e40e63a881e7669e368d5caf6727c0c12f20..35c23b6456e40a4882b4d0eb9a87e01b366373fe 100644 --- a/lib/Varien/Filter/Money.php +++ b/lib/Varien/Filter/Money.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Filter - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Filter/Object.php b/lib/Varien/Filter/Object.php index 51b870711831112b300863c9763367a4ee90ed40..8f5227e720ab1989903834f9739a8d9f4da8ec17 100644 --- a/lib/Varien/Filter/Object.php +++ b/lib/Varien/Filter/Object.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Filter - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Filter/Object/Grid.php b/lib/Varien/Filter/Object/Grid.php index d917af5e83b00d0b5ffd70915faacf167857651a..555e42b1b9ca6ca8a7ca6c8d7b3e06ee1bd15d4d 100644 --- a/lib/Varien/Filter/Object/Grid.php +++ b/lib/Varien/Filter/Object/Grid.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Filter - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Filter/Sprintf.php b/lib/Varien/Filter/Sprintf.php index cb72145d51c86014ce087110978461c6019650f6..da1ae3302ba2bfbd544baa5b81c4554f0f8e379f 100644 --- a/lib/Varien/Filter/Sprintf.php +++ b/lib/Varien/Filter/Sprintf.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Filter - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Filter/Template.php b/lib/Varien/Filter/Template.php index f23c8417708f49103a8b13fef8ef8cf0e7ee60ff..06bd6f7f7d87624ea71bcd26808d5e05a7303865 100644 --- a/lib/Varien/Filter/Template.php +++ b/lib/Varien/Filter/Template.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Filter - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Filter/Template/Simple.php b/lib/Varien/Filter/Template/Simple.php index 6094815070811953ecfd6ec63628450fef329208..a8b32f4fe764dddd0a478b9fe1b61c08b9151206 100644 --- a/lib/Varien/Filter/Template/Simple.php +++ b/lib/Varien/Filter/Template/Simple.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Filter - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Filter/Template/Tokenizer/Abstract.php b/lib/Varien/Filter/Template/Tokenizer/Abstract.php index 275f8a204babad5bcd7fc6df7e48c589985dce93..841183df054d9b2ec5ad7a9a211eed7a9ccbd42d 100644 --- a/lib/Varien/Filter/Template/Tokenizer/Abstract.php +++ b/lib/Varien/Filter/Template/Tokenizer/Abstract.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Filter - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Filter/Template/Tokenizer/Parameter.php b/lib/Varien/Filter/Template/Tokenizer/Parameter.php index 674fe1ed7ad002ccf8178ba561e2fe9de480de91..aad3c5cdd0d3af322bd079a41854eada42c2749c 100644 --- a/lib/Varien/Filter/Template/Tokenizer/Parameter.php +++ b/lib/Varien/Filter/Template/Tokenizer/Parameter.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Filter - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Filter/Template/Tokenizer/Variable.php b/lib/Varien/Filter/Template/Tokenizer/Variable.php index e4ac002709ddfa0c2979a6f2e14857632c40c627..7e99aa0f6334528741de7061282eb4720cc78556 100644 --- a/lib/Varien/Filter/Template/Tokenizer/Variable.php +++ b/lib/Varien/Filter/Template/Tokenizer/Variable.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Filter - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Gdata/Gshopping/Content.php b/lib/Varien/Gdata/Gshopping/Content.php index 95a63bf8ecf13e7d5e0c167c7fcf8eff03f6f8ef..8c0ad8164e3969210f5046a1945c384ab0aacc23 100644 --- a/lib/Varien/Gdata/Gshopping/Content.php +++ b/lib/Varien/Gdata/Gshopping/Content.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Gdata - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Gdata/Gshopping/Entry.php b/lib/Varien/Gdata/Gshopping/Entry.php index c365b2375863839ce6884396cb077dc3b2aac691..f703c70ca28a158b8b97c72182bdf1b6b7ddcc9b 100644 --- a/lib/Varien/Gdata/Gshopping/Entry.php +++ b/lib/Varien/Gdata/Gshopping/Entry.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Gdata - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Gdata/Gshopping/Extension/Attribute.php b/lib/Varien/Gdata/Gshopping/Extension/Attribute.php index 7730fd53ee33d9434987a0441e40ba07d72b7a80..745a0f409aa656fc60674ea1904228908fbcaa84 100644 --- a/lib/Varien/Gdata/Gshopping/Extension/Attribute.php +++ b/lib/Varien/Gdata/Gshopping/Extension/Attribute.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Gdata - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Gdata/Gshopping/Extension/Control.php b/lib/Varien/Gdata/Gshopping/Extension/Control.php index b162ebd05cf8e609c350e3d2929de93084fd3ff1..c46c136685596663178c9b7f684298912378ec7a 100644 --- a/lib/Varien/Gdata/Gshopping/Extension/Control.php +++ b/lib/Varien/Gdata/Gshopping/Extension/Control.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Gdata - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Gdata/Gshopping/Extension/Shipping.php b/lib/Varien/Gdata/Gshopping/Extension/Shipping.php index 759ca8acb0568d5009210b89a524dc3c6a5e6a9f..8c04271ce62f652bf1e94a66fb1d41951ab3709f 100644 --- a/lib/Varien/Gdata/Gshopping/Extension/Shipping.php +++ b/lib/Varien/Gdata/Gshopping/Extension/Shipping.php @@ -21,7 +21,7 @@ * * @category Varien * @package Varien_Gdata - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Gdata/Gshopping/Extension/Tax.php b/lib/Varien/Gdata/Gshopping/Extension/Tax.php index 1413355f716888e12a7a9c5d354a35c886d9651d..d57ea1314a7a6fa9874879f9ec3ba594938815a3 100644 --- a/lib/Varien/Gdata/Gshopping/Extension/Tax.php +++ b/lib/Varien/Gdata/Gshopping/Extension/Tax.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Gdata - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Gdata/Gshopping/HttpException.php b/lib/Varien/Gdata/Gshopping/HttpException.php index e8d312b871b5ddbb0234abe43ce84ea5d1768301..090737dabc88898db18363eb9f32a1df476c89e2 100644 --- a/lib/Varien/Gdata/Gshopping/HttpException.php +++ b/lib/Varien/Gdata/Gshopping/HttpException.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Gdata - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Gdata/Gshopping/ItemQuery.php b/lib/Varien/Gdata/Gshopping/ItemQuery.php index 5eb66baedf5c85b662c5d9cad88e93364994f241..0206900dc9397418dde0cbc572fab7fe21321f6f 100644 --- a/lib/Varien/Gdata/Gshopping/ItemQuery.php +++ b/lib/Varien/Gdata/Gshopping/ItemQuery.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Gdata - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Http/Adapter/Curl.php b/lib/Varien/Http/Adapter/Curl.php index 9ff8641bf3bba65ccbc32f891f666c3bf13c6aac..f88a6143a88ca1e5983105ccc0e55ce7a097494e 100644 --- a/lib/Varien/Http/Adapter/Curl.php +++ b/lib/Varien/Http/Adapter/Curl.php @@ -20,15 +20,15 @@ * * @category Varien * @package Varien_Http - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ /** * HTTP CURL Adapter * - * @category Varien - * @package Varien_Http + * @category Varien + * @package Varien_Http * @author Magento Core Team <core@magentocommerce.com> */ class Varien_Http_Adapter_Curl implements Zend_Http_Client_Adapter_Interface @@ -40,27 +40,37 @@ class Varien_Http_Adapter_Curl implements Zend_Http_Client_Adapter_Interface */ protected $_config = array(); + /** + * Curl handle + * + * @var resource + */ protected $_resource; + /** + * Allow parameters + * + * @var array + */ + protected $_allowedParams = array('timeout' => CURLOPT_TIMEOUT, 'maxredirects' => CURLOPT_MAXREDIRS, + 'proxy' => CURLOPT_PROXY, 'ssl_cert' => CURLOPT_SSLCERT, 'userpwd' => CURLOPT_USERPWD); + /** * Apply current configuration array to transport resource + * + * @return Varien_Http_Adapter_Curl */ protected function _applyConfig() { - //curl_setopt(); - if (isset($this->_config['timeout'])) { - curl_setopt($this->_getResource(), CURLOPT_TIMEOUT, $this->_config['timeout']); - } - if (isset($this->_config['maxredirects'])) { - curl_setopt($this->_getResource(), CURLOPT_MAXREDIRS, $this->_config['maxredirects']); - } - if (isset($this->_config['proxy'])) { - curl_setopt ($this->_getResource(), CURLOPT_PROXY, $this->_config['proxy']); - } - if (isset($this->_config['ssl_cert'])) { - curl_setopt($this->_getResource(), CURLOPT_SSLCERT, $this->_config['ssl_cert']); + if (empty($this->_config)) { + return $this; } + foreach ($this->_config as $param => $curlOption) { + if (array_key_exists($param, $this->_allowedParams)) { + curl_setopt($this->_getResource(), $this->_allowedParams[$param], $this->_config[$param]); + } + } return $this; } @@ -68,6 +78,7 @@ class Varien_Http_Adapter_Curl implements Zend_Http_Client_Adapter_Interface * Set the configuration array for the adapter * * @param array $config + * @return Varien_Http_Adapter_Curl */ public function setConfig($config = array()) { @@ -78,9 +89,11 @@ class Varien_Http_Adapter_Curl implements Zend_Http_Client_Adapter_Interface /** * Connect to the remote server * + * @deprecated since 1.4.0.0-rc1 * @param string $host * @param int $port * @param boolean $secure + * @return Varien_Http_Adapter_Curl */ public function connect($host, $port = 80, $secure = false) { @@ -92,7 +105,7 @@ class Varien_Http_Adapter_Curl implements Zend_Http_Client_Adapter_Interface curl_setopt($this->_getResource(), CURLOPT_MAXREDIRS, $this->_config['maxredirects']); } if (isset($this->_config['proxy'])) { - curl_setopt ($this->_getResource(), CURLOPT_PROXY, $this->_config['proxy']); + curl_setopt($this->_getResource(), CURLOPT_PROXY, $this->_config['proxy']); } return $this; @@ -126,14 +139,21 @@ class Varien_Http_Adapter_Curl implements Zend_Http_Client_Adapter_Interface curl_setopt($this->_getResource(), CURLOPT_HTTPGET, true); } - if( is_array($headers) ) { + if (is_array($headers)) { curl_setopt($this->_getResource(), CURLOPT_HTTPHEADER, $headers); } - curl_setopt($this->_getResource(), CURLOPT_HEADER, true); - curl_setopt($this->_getResource(), CURLOPT_SSL_VERIFYPEER, 0); - curl_setopt($this->_getResource(), CURLOPT_SSL_VERIFYHOST, 0); + /** + * @internal Curl options setter have to be re-factored + */ + $header = isset($this->_config['header']) ? $this->_config['header'] : true; + curl_setopt($this->_getResource(), CURLOPT_HEADER, $header); + + $verifyPeer = isset($this->_config['verifypeer']) ? $this->_config['verifypeer'] : 0; + curl_setopt($this->_getResource(), CURLOPT_SSL_VERIFYPEER, $verifyPeer); + $verifyHost = isset($this->_config['verifyhost']) ? $this->_config['verifyhost'] : 0; + curl_setopt($this->_getResource(), CURLOPT_SSL_VERIFYHOST, $verifyHost); return $body; } @@ -148,8 +168,7 @@ class Varien_Http_Adapter_Curl implements Zend_Http_Client_Adapter_Interface $response = curl_exec($this->_getResource()); // Remove 100 and 101 responses headers - if (Zend_Http_Response::extractCode($response) == 100 || - Zend_Http_Response::extractCode($response) == 101) { + if (Zend_Http_Response::extractCode($response) == 100 || Zend_Http_Response::extractCode($response) == 101) { $response = preg_split('/^\r?$/m', $response, 2); $response = trim($response[1]); } @@ -160,6 +179,7 @@ class Varien_Http_Adapter_Curl implements Zend_Http_Client_Adapter_Interface /** * Close the connection to the server * + * @return Varien_Http_Adapter_Curl */ public function close() { @@ -168,6 +188,11 @@ class Varien_Http_Adapter_Curl implements Zend_Http_Client_Adapter_Interface return $this; } + /** + * Returns a cURL handle on success + * + * @return resource + */ protected function _getResource() { if (is_null($this->_resource)) { @@ -176,11 +201,21 @@ class Varien_Http_Adapter_Curl implements Zend_Http_Client_Adapter_Interface return $this->_resource; } + /** + * Get last error number + * + * @return int + */ public function getErrno() { return curl_errno($this->_getResource()); } + /** + * Get string with last error for the current session + * + * @return string + */ public function getError() { return curl_error($this->_getResource()); @@ -234,4 +269,4 @@ class Varien_Http_Adapter_Curl implements Zend_Http_Client_Adapter_Interface curl_multi_close($multihandle); return $result; } -} +} \ No newline at end of file diff --git a/lib/Varien/Http/Client.php b/lib/Varien/Http/Client.php index d13d1f2918b169213f8fbeee04d752e6af6d2bb1..d2a002bb3ff9b83ae7860ce5f44223c31d21cd36 100644 --- a/lib/Varien/Http/Client.php +++ b/lib/Varien/Http/Client.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Http - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Image.php b/lib/Varien/Image.php index d243fbadfbbfc73c52ffc0974bbc694799114dc1..cddc6cc412a94b3a0290e508ba8c190a2841e25a 100644 --- a/lib/Varien/Image.php +++ b/lib/Varien/Image.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Image - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Image/Adapter.php b/lib/Varien/Image/Adapter.php index c4269cd2c7356e4fa6cbffef1ef20b078f322928..62a66e949e259e8263c21718297a1c321f3f7738 100644 --- a/lib/Varien/Image/Adapter.php +++ b/lib/Varien/Image/Adapter.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Image - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Image/Adapter/Abstract.php b/lib/Varien/Image/Adapter/Abstract.php index 43d203e1435bb2129de28b79c11bea8d0aaa4eb1..7361ea49d824f4815c258b6fca19a6a8e4afb03f 100644 --- a/lib/Varien/Image/Adapter/Abstract.php +++ b/lib/Varien/Image/Adapter/Abstract.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Image - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Image/Adapter/Gd2.php b/lib/Varien/Image/Adapter/Gd2.php index 04f802eb1be82b457b93a804ccf6486f8b91a2a9..4ece20d0ce3ec9631a118ead72f25907b6aa6eaa 100644 --- a/lib/Varien/Image/Adapter/Gd2.php +++ b/lib/Varien/Image/Adapter/Gd2.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Image - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Io/Abstract.php b/lib/Varien/Io/Abstract.php index d639f695156ce8a0967043520aa64fd7b1be0e44..f6f72c231e7239f4095a4eec5e186f4c6239f70b 100644 --- a/lib/Varien/Io/Abstract.php +++ b/lib/Varien/Io/Abstract.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Io - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Io/Exception.php b/lib/Varien/Io/Exception.php index c8fa503be316e2818288bc5960f718a623bf1f46..1d66d6b006dcb5b1e5908c9c7c4f6f1fb597d57e 100644 --- a/lib/Varien/Io/Exception.php +++ b/lib/Varien/Io/Exception.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Convert - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Io/File.php b/lib/Varien/Io/File.php index fd362ea8d75d10b8331f3faad46338519ebe42a9..42f2e6317c8a8f9ebf22a01b7efff99e91474a24 100644 --- a/lib/Varien/Io/File.php +++ b/lib/Varien/Io/File.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Io - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Io/Ftp.php b/lib/Varien/Io/Ftp.php index f4e7424a06df4214efaa3e6a8bfe4e3bdabb4596..68797d76bf440e0753b5d07c29c71d7a76d10a0f 100644 --- a/lib/Varien/Io/Ftp.php +++ b/lib/Varien/Io/Ftp.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Io - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Io/Interface.php b/lib/Varien/Io/Interface.php index 5bde5ae1a3d3a0c5d63b8621cfa98b53e5e025c0..25b6c16bc3ee568f667a8c9b6eeda984e9bac6d8 100644 --- a/lib/Varien/Io/Interface.php +++ b/lib/Varien/Io/Interface.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Io - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Io/Sftp.php b/lib/Varien/Io/Sftp.php index 981ba00cb01bdcf7a9ae4b1533ae7eb840dec226..814e31531b002a43512ef97c2dca43b92441caa8 100644 --- a/lib/Varien/Io/Sftp.php +++ b/lib/Varien/Io/Sftp.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Io - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Object.php b/lib/Varien/Object.php index 60ad0f3ef33947362c8d21ceda56a48790c0320a..400519ae6aa36ba733467bcb292de6dbaaee467b 100644 --- a/lib/Varien/Object.php +++ b/lib/Varien/Object.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Object - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Object/Cache.php b/lib/Varien/Object/Cache.php index 737badd2e5725fccfb74d7ff15c0d9f80741cc73..10a0189fc112cb43cb0448af3ee7d7b5889f2b92 100644 --- a/lib/Varien/Object/Cache.php +++ b/lib/Varien/Object/Cache.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Object - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Object/Mapper.php b/lib/Varien/Object/Mapper.php index 0ef84b6221086ae14fd4773507dbe9486d8983b7..6895d2575c4347d101a8deeea0733dd9b622388f 100644 --- a/lib/Varien/Object/Mapper.php +++ b/lib/Varien/Object/Mapper.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Object - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Pear.php b/lib/Varien/Pear.php index 0d445ffafe44111cc28fe485e5d11005bf95565f..9322036857615ef83ede49586d3f2520931e4dd2 100644 --- a/lib/Varien/Pear.php +++ b/lib/Varien/Pear.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Pear - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Pear/Frontend.php b/lib/Varien/Pear/Frontend.php index 106ad3eaee226edb50a401d8add1b33a36d1e050..56011af0cc149d6e8c408e81d8296a5a83730dbd 100644 --- a/lib/Varien/Pear/Frontend.php +++ b/lib/Varien/Pear/Frontend.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Pear - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Pear/Package.php b/lib/Varien/Pear/Package.php index 81d606b0de494577167a8539cffafc7d384aa68d..a24c4d0e5985dc6bac5367d181954ba1278e3b6a 100644 --- a/lib/Varien/Pear/Package.php +++ b/lib/Varien/Pear/Package.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Pear - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Pear/Registry.php b/lib/Varien/Pear/Registry.php index c7f57a091c676d5beba4a799dfecc6cb740bb8a7..9fc5423a8124d79ca1086f16b397a8e885704927 100644 --- a/lib/Varien/Pear/Registry.php +++ b/lib/Varien/Pear/Registry.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Pear - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Simplexml/Config.php b/lib/Varien/Simplexml/Config.php index d8afe008f61ab4ebb6d34242770c81b12dff4d2b..1e67925df12e66ee609ac2e81c089a74601a71dd 100644 --- a/lib/Varien/Simplexml/Config.php +++ b/lib/Varien/Simplexml/Config.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Simplexml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Simplexml/Config/Cache/Abstract.php b/lib/Varien/Simplexml/Config/Cache/Abstract.php index 39fbdf2724f38083aca3f5ca462e6a3d548067b3..5c330e6cb7c102767c4953f118b3d75ce56ba4ef 100644 --- a/lib/Varien/Simplexml/Config/Cache/Abstract.php +++ b/lib/Varien/Simplexml/Config/Cache/Abstract.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Simplexml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Simplexml/Config/Cache/File.php b/lib/Varien/Simplexml/Config/Cache/File.php index 5bd9c2f0d6275668c03e1f3fe935a5c569702722..04e55a99d1e91e0177f6d204844773e29dce40ae 100644 --- a/lib/Varien/Simplexml/Config/Cache/File.php +++ b/lib/Varien/Simplexml/Config/Cache/File.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Simplexml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Varien/Simplexml/Element.php b/lib/Varien/Simplexml/Element.php index 29bd1ab4daf846870786bbf19619c589dd1b0a6d..6907bfaa197c20104930e4fc5a7b35226a5efa6c 100644 --- a/lib/Varien/Simplexml/Element.php +++ b/lib/Varien/Simplexml/Element.php @@ -20,7 +20,7 @@ * * @category Varien * @package Varien_Simplexml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/lib/Zend/Captcha/Word.php b/lib/Zend/Captcha/Word.php index a9bbbea753f06ef6ed75f9a2d5d607c6fb591bb6..6170b06da9cb1ee7de6948052cea5c39d940200c 100644 --- a/lib/Zend/Captcha/Word.php +++ b/lib/Zend/Captcha/Word.php @@ -93,10 +93,10 @@ abstract class Zend_Captcha_Word extends Zend_Captcha_Base * @var integer */ protected $_timeout = 300; - + /** * Should generate() keep session or create a new one? - * + * * @var boolean */ protected $_keepSession = false; @@ -219,11 +219,11 @@ abstract class Zend_Captcha_Word extends Zend_Captcha_Base /** * Sets if session should be preserved on generate() - * + * * @param $keepSession Should session be kept on generate()? * @return Zend_Captcha_Word */ - public function setKeepSession($keepSession) + public function setKeepSession($keepSession) { $this->_keepSession = $keepSession; return $this; @@ -231,7 +231,7 @@ abstract class Zend_Captcha_Word extends Zend_Captcha_Base /** * Numbers should be included in the pattern? - * + * * @return bool */ public function getUseNumbers() @@ -241,7 +241,7 @@ abstract class Zend_Captcha_Word extends Zend_Captcha_Base /** * Set if numbers should be included in the pattern - * + * * @param $_useNumbers numbers should be included in the pattern? * @return Zend_Captcha_Word */ @@ -250,7 +250,7 @@ abstract class Zend_Captcha_Word extends Zend_Captcha_Base $this->_useNumbers = $_useNumbers; return $this; } - + /** * Get session object * @@ -348,7 +348,7 @@ abstract class Zend_Captcha_Word extends Zend_Captcha_Base public function generate() { if(!$this->_keepSession) { - $this->_session = null; + $this->_session = null; } $id = $this->_generateRandomId(); $this->_setId($id); diff --git a/lib/flex/uploader/uploader.mxml b/lib/flex/uploader/uploader.mxml index badde73cf8c6eecc3b07318637542a0713c22653..cfe2fd34e983938fb4c7abe4272d4e7d29c2d9c3 100644 --- a/lib/flex/uploader/uploader.mxml +++ b/lib/flex/uploader/uploader.mxml @@ -19,7 +19,7 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/lib/flex/uploader/uploaderSingle.mxml b/lib/flex/uploader/uploaderSingle.mxml index 6c0dd0d99c38244743a8d97523930e9ca6ed58d1..486af44765bb9035fb69a8d3c2fc592779f2ff0f 100644 --- a/lib/flex/uploader/uploaderSingle.mxml +++ b/lib/flex/uploader/uploaderSingle.mxml @@ -19,7 +19,7 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/lib/flex/varien/varien/upload/Uploader.as b/lib/flex/varien/varien/upload/Uploader.as index e9d70b4b6f80e0ed2666d2d966c2bd425e04d13b..ef22bd8d7c110fee7474258ddedf18cd433dba1e 100644 --- a/lib/flex/varien/varien/upload/Uploader.as +++ b/lib/flex/varien/varien/upload/Uploader.as @@ -17,7 +17,7 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ package varien.upload diff --git a/lib/flex/varien/varien/upload/UploaderEvent.as b/lib/flex/varien/varien/upload/UploaderEvent.as index 1fdf0a1a32d625f8ebd50a77d72b6d2651988868..7e5184bbe7f52eefb115e6a3ff3448c8abfd107a 100644 --- a/lib/flex/varien/varien/upload/UploaderEvent.as +++ b/lib/flex/varien/varien/upload/UploaderEvent.as @@ -17,7 +17,7 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ package varien.upload diff --git a/lib/flex/varien/varien/upload/UploaderSingle.as b/lib/flex/varien/varien/upload/UploaderSingle.as index 70eeadaa6150ea268a2dafd17e7dcc04b32ab7ea..4b6dd831e65fa70ddfd2822cc270156af02f48ca 100644 --- a/lib/flex/varien/varien/upload/UploaderSingle.as +++ b/lib/flex/varien/varien/upload/UploaderSingle.as @@ -17,7 +17,7 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ package varien.upload diff --git a/pub/cron.php b/pub/cron.php index a432c58833f0a63808a1fdd1a9b9970405697d75..2838df7c434058fc00f13bd57ee9adc9c6934f0c 100644 --- a/pub/cron.php +++ b/pub/cron.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/pub/errors/404.php b/pub/errors/404.php index 31b9da1e80794d3a779aaf84edeb36d0f5a94841..7f334436603b6596ed7f30694781f756aa4d61a5 100644 --- a/pub/errors/404.php +++ b/pub/errors/404.php @@ -20,7 +20,7 @@ * * @category Mage * @package Errors - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/pub/errors/503.php b/pub/errors/503.php index bd85f185df332b7b9237c06502ca73901fbc8a51..3222f011d7c585f530f178afd9fc506a5f4c35a4 100644 --- a/pub/errors/503.php +++ b/pub/errors/503.php @@ -20,7 +20,7 @@ * * @category Mage * @package Errors - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/pub/errors/default/404.phtml b/pub/errors/default/404.phtml index 21818565229b4f9f16b8c8ff20ec0d0822f01fca..ae28970a2ee55f2f372736f6c858796f913a27a5 100644 --- a/pub/errors/default/404.phtml +++ b/pub/errors/default/404.phtml @@ -20,7 +20,7 @@ * * @category Mage * @package Errors - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/pub/errors/default/503.phtml b/pub/errors/default/503.phtml index 379a7ea813a536f359263cacb14557933069006f..4088fa4ddd503333685e088566a86a0f9744547f 100644 --- a/pub/errors/default/503.phtml +++ b/pub/errors/default/503.phtml @@ -20,7 +20,7 @@ * * @category Mage * @package Errors - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/pub/errors/default/css/styles.css b/pub/errors/default/css/styles.css index 01641c3c0f491d85502b6a986c27848d4c0a0196..052af92d74b044ea82ad46b548c4c55f59e909db 100644 --- a/pub/errors/default/css/styles.css +++ b/pub/errors/default/css/styles.css @@ -19,7 +19,7 @@ * * @category Mage * @package Errors - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /* Reset ================================================================================= */ diff --git a/pub/errors/default/page.phtml b/pub/errors/default/page.phtml index 40f41fd8005de84e8ac4e130acf772583b70bfc3..01bd06ba1a53f676a9a1ddd38fa1aaebcfb5803c 100644 --- a/pub/errors/default/page.phtml +++ b/pub/errors/default/page.phtml @@ -20,7 +20,7 @@ * * @category Mage * @package Errors - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/pub/errors/default/report.phtml b/pub/errors/default/report.phtml index 841ec3333f301d1d020205c11e9cd9258d944752..dac1dcd48dc16d283ab450ef1f8cd9a88d9bb303 100644 --- a/pub/errors/default/report.phtml +++ b/pub/errors/default/report.phtml @@ -20,7 +20,7 @@ * * @category Mage * @package Errors - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> diff --git a/pub/errors/design.xml b/pub/errors/design.xml index cbe33232081f8d09a8e53432cb00cc08322b060e..af38e26c75701b37044275cb84c2de606446513e 100644 --- a/pub/errors/design.xml +++ b/pub/errors/design.xml @@ -21,7 +21,7 @@ * * @category Mage * @package Errors - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/pub/errors/local.xml.sample b/pub/errors/local.xml.sample index 232cfc93d6648d598140aa34e7f960965214353c..253bee51727d25d79ae4cc68849ee92c550fa5b3 100644 --- a/pub/errors/local.xml.sample +++ b/pub/errors/local.xml.sample @@ -21,7 +21,7 @@ * * @category Mage * @package Errors - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ --> diff --git a/pub/errors/processor.php b/pub/errors/processor.php index f302052ca7efde546ce7e5b81e7a27c3b43c5b77..3a6cabd5d29ae949f566e41fa93b05622a7cad3c 100644 --- a/pub/errors/processor.php +++ b/pub/errors/processor.php @@ -20,7 +20,7 @@ * * @category Mage * @package Errors - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/pub/errors/report.php b/pub/errors/report.php index eaff181a90d1faf7a3b45d840709bce8277f2062..7ed9dd9788fc5d0903a3ec9ab812c8b15680223c 100644 --- a/pub/errors/report.php +++ b/pub/errors/report.php @@ -20,7 +20,7 @@ * * @category Mage * @package Errors - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/pub/get.php b/pub/get.php index 8cf6b18ed72b1ae7b701a663b3762a0a14c55fdf..7e04fc25a853678a27543568767bbaa0b153072e 100644 --- a/pub/get.php +++ b/pub/get.php @@ -21,7 +21,7 @@ * * @category Mage * @package Mage - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ require_once '../app/bootstrap.php'; diff --git a/pub/index.php b/pub/index.php index 4de3ac880b1bf928c33fab17aedc667f1e1783bf..417ade6b7003b6f9b8808fa1689a79a507b15953 100644 --- a/pub/index.php +++ b/pub/index.php @@ -20,7 +20,7 @@ * * @category Mage * @package Mage - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/pub/js/jquery/jquery-1.7.1.min.js b/pub/js/jquery/jquery-1.7.1.min.js new file mode 100644 index 0000000000000000000000000000000000000000..198b3ff07d801dffa2c42fcf3b67eb3295eef85f --- /dev/null +++ b/pub/js/jquery/jquery-1.7.1.min.js @@ -0,0 +1,4 @@ +/*! jQuery v1.7.1 jquery.com | jquery.org/license */ +(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cv(a){if(!ck[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){cl||(cl=c.createElement("iframe"),cl.frameBorder=cl.width=cl.height=0),b.appendChild(cl);if(!cm||!cl.createElement)cm=(cl.contentWindow||cl.contentDocument).document,cm.write((c.compatMode==="CSS1Compat"?"<!doctype html>":"")+"<html><body>"),cm.close();d=cm.createElement(a),cm.body.appendChild(d),e=f.css(d,"display"),b.removeChild(cl)}ck[a]=e}return ck[a]}function cu(a,b){var c={};f.each(cq.concat.apply([],cq.slice(0,b)),function(){c[this]=a});return c}function ct(){cr=b}function cs(){setTimeout(ct,0);return cr=f.now()}function cj(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ci(){try{return new a.XMLHttpRequest}catch(b){}}function cc(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g<i;g++){if(g===1)for(h in a.converters)typeof h=="string"&&(e[h.toLowerCase()]=a.converters[h]);l=k,k=d[g];if(k==="*")k=l;else if(l!=="*"&&l!==k){m=l+" "+k,n=e[m]||e["* "+k];if(!n){p=b;for(o in e){j=o.split(" ");if(j[0]===l||j[0]==="*"){p=e[j[1]+" "+k];if(p){o=e[o],o===!0?n=p:p===!0&&(n=o);break}}}}!n&&!p&&f.error("No conversion from "+m.replace(" "," to ")),n!==!0&&(c=n?n(c):p(o(c)))}}return c}function cb(a,c,d){var e=a.contents,f=a.dataTypes,g=a.responseFields,h,i,j,k;for(i in g)i in d&&(c[g[i]]=d[i]);while(f[0]==="*")f.shift(),h===b&&(h=a.mimeType||c.getResponseHeader("content-type"));if(h)for(i in e)if(e[i]&&e[i].test(h)){f.unshift(i);break}if(f[0]in d)j=f[0];else{for(i in d){if(!f[0]||a.converters[i+" "+f[0]]){j=i;break}k||(k=i)}j=j||k}if(j){j!==f[0]&&f.unshift(j);return d[j]}}function ca(a,b,c,d){if(f.isArray(b))f.each(b,function(b,e){c||bE.test(a)?d(a,e):ca(a+"["+(typeof e=="object"||f.isArray(e)?b:"")+"]",e,c,d)});else if(!c&&b!=null&&typeof b=="object")for(var e in b)ca(a+"["+e+"]",b[e],c,d);else d(a,b)}function b_(a,c){var d,e,g=f.ajaxSettings.flatOptions||{};for(d in c)c[d]!==b&&((g[d]?a:e||(e={}))[d]=c[d]);e&&f.extend(!0,a,e)}function b$(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h=a[f],i=0,j=h?h.length:0,k=a===bT,l;for(;i<j&&(k||!l);i++)l=h[i](c,d,e),typeof l=="string"&&(!k||g[l]?l=b:(c.dataTypes.unshift(l),l=b$(a,c,d,e,l,g)));(k||!l)&&!g["*"]&&(l=b$(a,c,d,e,"*",g));return l}function bZ(a){return function(b,c){typeof b!="string"&&(c=b,b="*");if(f.isFunction(c)){var d=b.toLowerCase().split(bP),e=0,g=d.length,h,i,j;for(;e<g;e++)h=d[e],j=/^\+/.test(h),j&&(h=h.substr(1)||"*"),i=a[h]=a[h]||[],i[j?"unshift":"push"](c)}}}function bC(a,b,c){var d=b==="width"?a.offsetWidth:a.offsetHeight,e=b==="width"?bx:by,g=0,h=e.length;if(d>0){if(c!=="border")for(;g<h;g++)c||(d-=parseFloat(f.css(a,"padding"+e[g]))||0),c==="margin"?d+=parseFloat(f.css(a,c+e[g]))||0:d-=parseFloat(f.css(a,"border"+e[g]+"Width"))||0;return d+"px"}d=bz(a,b,b);if(d<0||d==null)d=a.style[b]||0;d=parseFloat(d)||0;if(c)for(;g<h;g++)d+=parseFloat(f.css(a,"padding"+e[g]))||0,c!=="padding"&&(d+=parseFloat(f.css(a,"border"+e[g]+"Width"))||0),c==="margin"&&(d+=parseFloat(f.css(a,c+e[g]))||0);return d+"px"}function bp(a,b){b.src?f.ajax({url:b.src,async:!1,dataType:"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(bf,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)}function bo(a){var b=c.createElement("div");bh.appendChild(b),b.innerHTML=a.outerHTML;return b.firstChild}function bn(a){var b=(a.nodeName||"").toLowerCase();b==="input"?bm(a):b!=="script"&&typeof a.getElementsByTagName!="undefined"&&f.grep(a.getElementsByTagName("input"),bm)}function bm(a){if(a.type==="checkbox"||a.type==="radio")a.defaultChecked=a.checked}function bl(a){return typeof a.getElementsByTagName!="undefined"?a.getElementsByTagName("*"):typeof a.querySelectorAll!="undefined"?a.querySelectorAll("*"):[]}function bk(a,b){var c;if(b.nodeType===1){b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase();if(c==="object")b.outerHTML=a.outerHTML;else if(c!=="input"||a.type!=="checkbox"&&a.type!=="radio"){if(c==="option")b.selected=a.defaultSelected;else if(c==="input"||c==="textarea")b.defaultValue=a.defaultValue}else a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value);b.removeAttribute(f.expando)}}function bj(a,b){if(b.nodeType===1&&!!f.hasData(a)){var c,d,e,g=f._data(a),h=f._data(b,g),i=g.events;if(i){delete h.handle,h.events={};for(c in i)for(d=0,e=i[c].length;d<e;d++)f.event.add(b,c+(i[c][d].namespace?".":"")+i[c][d].namespace,i[c][d],i[c][d].data)}h.data&&(h.data=f.extend({},h.data))}}function bi(a,b){return f.nodeName(a,"table")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function U(a){var b=V.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}function T(a,b,c){b=b||0;if(f.isFunction(b))return f.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return f.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var d=f.grep(a,function(a){return a.nodeType===1});if(O.test(b))return f.filter(b,d,!c);b=f.filter(b,d)}return f.grep(a,function(a,d){return f.inArray(a,b)>=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?parseFloat(d):j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c<d;c++)b[a[c]]=!0;return b}var c=a.document,d=a.navigator,e=a.location,f=function(){function J(){if(!e.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(J,1);return}e.ready()}}var e=function(a,b){return new e.fn.init(a,b,h)},f=a.jQuery,g=a.$,h,i=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.1",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j<k;j++)if((a=arguments[j])!=null)for(c in a){d=i[c],f=a[c];if(i===f)continue;l&&f&&(e.isPlainObject(f)||(g=e.isArray(f)))?(g?(g=!1,h=d&&e.isArray(d)?d:[]):h=d&&e.isPlainObject(d)?d:{},i[c]=e.extend(l,h,f)):f!==b&&(i[c]=f)}return i},e.extend({noConflict:function(b){a.$===e&&(a.$=g),b&&a.jQuery===e&&(a.jQuery=f);return e},isReady:!1,readyWait:1,holdReady:function(a){a?e.readyWait++:e.ready(!0)},ready:function(a){if(a===!0&&!--e.readyWait||a!==!0&&!e.isReady){if(!c.body)return setTimeout(e.ready,1);e.isReady=!0;if(a!==!0&&--e.readyWait>0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g<h;)if(c.apply(a[g++],d)===!1)break}else if(i){for(f in a)if(c.call(a[f],f,a[f])===!1)break}else for(;g<h;)if(c.call(a[g],g,a[g++])===!1)break;return a},trim:G?function(a){return a==null?"":G.call(a)}:function(a){return a==null?"":(a+"").replace(k,"").replace(l,"")},makeArray:function(a,b){var c=b||[];if(a!=null){var d=e.type(a);a.length==null||d==="string"||d==="function"||d==="regexp"||e.isWindow(a)?E.call(c,a):e.merge(c,a)}return c},inArray:function(a,b,c){var d;if(b){if(H)return H.call(b,a,c);d=b.length,c=c?c<0?Math.max(0,d+c):c:0;for(;c<d;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,c){var d=a.length,e=0;if(typeof c.length=="number")for(var f=c.length;e<f;e++)a[d++]=c[e];else while(c[e]!==b)a[d++]=c[e++];a.length=d;return a},grep:function(a,b,c){var d=[],e;c=!!c;for(var f=0,g=a.length;f<g;f++)e=!!b(a[f],f),c!==e&&d.push(a[f]);return d},map:function(a,c,d){var f,g,h=[],i=0,j=a.length,k=a instanceof e||j!==b&&typeof j=="number"&&(j>0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i<j;i++)f=c(a[i],i,d),f!=null&&(h[h.length]=f);else for(g in a)f=c(a[g],g,d),f!=null&&(h[h.length]=f);return h.concat.apply([],h)},guid:1,proxy:function(a,c){if(typeof c=="string"){var d=a[c];c=a,a=d}if(!e.isFunction(a))return b;var f=F.call(arguments,2),g=function(){return a.apply(c,f.concat(F.call(arguments)))};g.guid=a.guid=a.guid||g.guid||e.guid++;return g},access:function(a,c,d,f,g,h){var i=a.length;if(typeof c=="object"){for(var j in c)e.access(a,j,c[j],f,g,d);return a}if(d!==b){f=!h&&f&&e.isFunction(d);for(var k=0;k<i;k++)g(a[k],c,f?d.call(a[k],k,g(a[k],c)):d,h);return a}return i?g(a[0],c):b},now:function(){return(new Date).getTime()},uaMatch:function(a){a=a.toLowerCase();var b=r.exec(a)||s.exec(a)||t.exec(a)||a.indexOf("compatible")<0&&u.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},sub:function(){function a(b,c){return new a.fn.init(b,c)}e.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function(d,f){f&&f instanceof e&&!(f instanceof a)&&(f=a(f));return e.fn.init.call(this,d,f,b)},a.fn.init.prototype=a.fn;var b=a(c);return a},browser:{}}),e.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){I["[object "+b+"]"]=b.toLowerCase()}),z=e.uaMatch(y),z.browser&&(e.browser[z.browser]=!0,e.browser.version=z.version),e.browser.webkit&&(e.browser.safari=!0),j.test("Â ")&&(k=/^[\s\xA0]+/,l=/[\s\xA0]+$/),h=e(c),c.addEventListener?B=function(){c.removeEventListener("DOMContentLoaded",B,!1),e.ready()}:c.attachEvent&&(B=function(){c.readyState==="complete"&&(c.detachEvent("onreadystatechange",B),e.ready())});return e}(),g={};f.Callbacks=function(a){a=a?g[a]||h(a):{};var c=[],d=[],e,i,j,k,l,m=function(b){var d,e,g,h,i;for(d=0,e=b.length;d<e;d++)g=b[d],h=f.type(g),h==="array"?m(g):h==="function"&&(!a.unique||!o.has(g))&&c.push(g)},n=function(b,f){f=f||[],e=!a.memory||[b,f],i=!0,l=j||0,j=0,k=c.length;for(;c&&l<k;l++)if(c[l].apply(b,f)===!1&&a.stopOnFalse){e=!0;break}i=!1,c&&(a.once?e===!0?o.disable():c=[]:d&&d.length&&(e=d.shift(),o.fireWith(e[0],e[1])))},o={add:function(){if(c){var a=c.length;m(arguments),i?k=c.length:e&&e!==!0&&(j=a,n(e[0],e[1]))}return this},remove:function(){if(c){var b=arguments,d=0,e=b.length;for(;d<e;d++)for(var f=0;f<c.length;f++)if(b[d]===c[f]){i&&f<=k&&(k--,f<=l&&l--),c.splice(f--,1);if(a.unique)break}}return this},has:function(a){if(c){var b=0,d=c.length;for(;b<d;b++)if(a===c[b])return!0}return!1},empty:function(){c=[];return this},disable:function(){c=d=e=b;return this},disabled:function(){return!c},lock:function(){d=b,(!e||e===!0)&&o.disable();return this},locked:function(){return!d},fireWith:function(b,c){d&&(i?a.once||d.push([b,c]):(!a.once||!e)&&n(b,c));return this},fire:function(){o.fireWith(this,arguments);return this},fired:function(){return!!e}};return o};var i=[].slice;f.extend({Deferred:function(a){var b=f.Callbacks("once memory"),c=f.Callbacks("once memory"),d=f.Callbacks("memory"),e="pending",g={resolve:b,reject:c,notify:d},h={done:b.add,fail:c.add,progress:d.add,state:function(){return e},isResolved:b.fired,isRejected:c.fired,then:function(a,b,c){i.done(a).fail(b).progress(c);return this},always:function(){i.done.apply(i,arguments).fail.apply(i,arguments);return this},pipe:function(a,b,c){return f.Deferred(function(d){f.each({done:[a,"resolve"],fail:[b,"reject"],progress:[c,"notify"]},function(a,b){var c=b[0],e=b[1],g;f.isFunction(c)?i[a](function(){g=c.apply(this,arguments),g&&f.isFunction(g.promise)?g.promise().then(d.resolve,d.reject,d.notify):d[e+"With"](this===i?d:this,[g])}):i[a](d[e])})}).promise()},promise:function(a){if(a==null)a=h;else for(var b in h)a[b]=h[b];return a}},i=h.promise({}),j;for(j in g)i[j]=g[j].fire,i[j+"With"]=g[j].fireWith;i.done(function(){e="resolved"},c.disable,d.lock).fail(function(){e="rejected"},b.disable,d.lock),a&&a.call(i,i);return i},when:function(a){function m(a){return function(b){e[a]=arguments.length>1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c<d;c++)b[c]&&b[c].promise&&f.isFunction(b[c].promise)?b[c].promise().then(l(c),j.reject,m(c)):--g;g||j.resolveWith(j,b)}else j!==a&&j.resolveWith(j,d?[a]:[]);return k}}),f.support=function(){var b,d,e,g,h,i,j,k,l,m,n,o,p,q=c.createElement("div"),r=c.documentElement;q.setAttribute("className","t"),q.innerHTML=" <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>",d=q.getElementsByTagName("*"),e=q.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=q.getElementsByTagName("input")[0],b={leadingWhitespace:q.firstChild.nodeType===3,tbody:!q.getElementsByTagName("tbody").length,htmlSerialize:!!q.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:q.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav></:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete q.test}catch(s){b.deleteExpando=!1}!q.addEventListener&&q.attachEvent&&q.fireEvent&&(q.attachEvent("onclick",function(){b.noCloneEvent=!1}),q.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),q.appendChild(i),k=c.createDocumentFragment(),k.appendChild(q.lastChild),b.checkClone=k.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,k.removeChild(i),k.appendChild(q),q.innerHTML="",a.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",q.style.width="2px",q.appendChild(j),b.reliableMarginRight=(parseInt((a.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0);if(q.attachEvent)for(o in{submit:1,change:1,focusin:1})n="on"+o,p=n in q,p||(q.setAttribute(n,"return;"),p=typeof q[n]=="function"),b[o+"Bubbles"]=p;k.removeChild(q),k=g=h=j=q=i=null,f(function(){var a,d,e,g,h,i,j,k,m,n,o,r=c.getElementsByTagName("body")[0];!r||(j=1,k="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;",m="visibility:hidden;border:0;",n="style='"+k+"border:5px solid #000;padding:0;'",o="<div "+n+"><div></div></div>"+"<table "+n+" cellpadding='0' cellspacing='0'>"+"<tr><td></td></tr></table>",a=c.createElement("div"),a.style.cssText=m+"width:0;height:0;position:static;top:0;margin-top:"+j+"px",r.insertBefore(a,r.firstChild),q=c.createElement("div"),a.appendChild(q),q.innerHTML="<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>",l=q.getElementsByTagName("td"),p=l[0].offsetHeight===0,l[0].style.display="",l[1].style.display="none",b.reliableHiddenOffsets=p&&l[0].offsetHeight===0,q.innerHTML="",q.style.width=q.style.paddingLeft="1px",f.boxModel=b.boxModel=q.offsetWidth===2,typeof q.style.zoom!="undefined"&&(q.style.display="inline",q.style.zoom=1,b.inlineBlockNeedsLayout=q.offsetWidth===2,q.style.display="",q.innerHTML="<div style='width:4px;'></div>",b.shrinkWrapBlocks=q.offsetWidth!==2),q.style.cssText=k+m,q.innerHTML=o,d=q.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,i={doesNotAddBorder:e.offsetTop!==5,doesAddBorderForTableAndCells:h.offsetTop===5},e.style.position="fixed",e.style.top="20px",i.fixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",i.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,i.doesNotIncludeMarginInBodyOffset=r.offsetTop!==j,r.removeChild(a),q=a=null,f.extend(b,i))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e<g;e++)delete d[b[e]];if(!(c?m:f.isEmptyObject)(d))return}}if(!c){delete j[k].data;if(!m(j[k]))return}f.support.deleteExpando||!j.setInterval?delete j[k]:j[k]=null,i&&(f.support.deleteExpando?delete a[h]:a.removeAttribute?a.removeAttribute(h):a[h]=null)}},_data:function(a,b,c){return f.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=f.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),f.fn.extend({data:function(a,c){var d,e,g,h=null;if(typeof a=="undefined"){if(this.length){h=f.data(this[0]);if(this[0].nodeType===1&&!f._data(this[0],"parsedAttrs")){e=this[0].attributes;for(var i=0,j=e.length;i<j;i++)g=e[i].name,g.indexOf("data-")===0&&(g=f.camelCase(g.substring(5)),l(this[0],g,h[g]));f._data(this[0],"parsedAttrs",!0)}}return h}if(typeof a=="object")return this.each(function(){f.data(this,a)});d=a.split("."),d[1]=d[1]?"."+d[1]:"";if(c===b){h=this.triggerHandler("getData"+d[1]+"!",[d[0]]),h===b&&this.length&&(h=f.data(this[0],a),h=l(this[0],a,h));return h===b&&d[1]?this.data(d[0]):h}return this.each(function(){var b=f(this),e=[d[0],c];b.triggerHandler("setData"+d[1]+"!",e),f.data(this,a,c),b.triggerHandler("changeData"+d[1]+"!",e)})},removeData:function(a){return this.each(function(){f.removeData(this,a)})}}),f.extend({_mark:function(a,b){a&&(b=(b||"fx")+"mark",f._data(a,b,(f._data(a,b)||0)+1))},_unmark:function(a,b,c){a!==!0&&(c=b,b=a,a=!1);if(b){c=c||"fx";var d=c+"mark",e=a?0:(f._data(b,d)||1)-1;e?f._data(b,d,e):(f.removeData(b,d,!0),n(b,c,"mark"))}},queue:function(a,b,c){var d;if(a){b=(b||"fx")+"queue",d=f._data(a,b),c&&(!d||f.isArray(c)?d=f._data(a,b,f.makeArray(c)):d.push(c));return d||[]}},dequeue:function(a,b){b=b||"fx";var c=f.queue(a,b),d=c.shift(),e={};d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),f._data(a,b+".run",e),d.call(a,function(){f.dequeue(a,b)},e)),c.length||(f.removeData(a,b+"queue "+b+".run",!0),n(a,b,"queue"))}}),f.fn.extend({queue:function(a,c){typeof a!="string"&&(c=a,a="fx");if(c===b)return f.queue(this[0],a);return this.each(function(){var b=f.queue(this,a,c);a==="fx"&&b[0]!=="inprogress"&&f.dequeue(this,a)})},dequeue:function(a){return this.each(function(){f.dequeue(this,a)})},delay:function(a,b){a=f.fx?f.fx.speeds[a]||a:a,b=b||"fx";return this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,c){function m(){--h||d.resolveWith(e,[e])}typeof a!="string"&&(c=a,a=b),a=a||"fx";var d=f.Deferred(),e=this,g=e.length,h=1,i=a+"defer",j=a+"queue",k=a+"mark",l;while(g--)if(l=f.data(e[g],i,b,!0)||(f.data(e[g],j,b,!0)||f.data(e[g],k,b,!0))&&f.data(e[g],i,f.Callbacks("once memory"),!0))h++,l.add(m);m();return d.promise()}});var o=/[\n\t\r]/g,p=/\s+/,q=/\r/g,r=/^(?:button|input)$/i,s=/^(?:button|input|object|select|textarea)$/i,t=/^a(?:rea)?$/i,u=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,v=f.support.getSetAttribute,w,x,y;f.fn.extend({attr:function(a,b){return f.access(this,a,b,!0,f.attr)},removeAttr:function(a){return this.each(function(){f.removeAttr(this,a)})},prop:function(a,b){return f.access(this,a,b,!0,f.prop)},removeProp:function(a){a=f.propFix[a]||a;return this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,g,h,i;if(f.isFunction(a))return this.each(function(b){f(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(p);for(c=0,d=this.length;c<d;c++){e=this[c];if(e.nodeType===1)if(!e.className&&b.length===1)e.className=a;else{g=" "+e.className+" ";for(h=0,i=b.length;h<i;h++)~g.indexOf(" "+b[h]+" ")||(g+=b[h]+" ");e.className=f.trim(g)}}}return this},removeClass:function(a){var c,d,e,g,h,i,j;if(f.isFunction(a))return this.each(function(b){f(this).removeClass(a.call(this,b,this.className))});if(a&&typeof a=="string"||a===b){c=(a||"").split(p);for(d=0,e=this.length;d<e;d++){g=this[d];if(g.nodeType===1&&g.className)if(a){h=(" "+g.className+" ").replace(o," ");for(i=0,j=c.length;i<j;i++)h=h.replace(" "+c[i]+" "," ");g.className=f.trim(h)}else g.className=""}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";if(f.isFunction(a))return this.each(function(c){f(this).toggleClass(a.call(this,c,this.className,b),b)});return this.each(function(){if(c==="string"){var e,g=0,h=f(this),i=b,j=a.split(p);while(e=j[g++])i=d?i:!h.hasClass(e),h[i?"addClass":"removeClass"](e)}else if(c==="undefined"||c==="boolean")this.className&&f._data(this,"__className__",this.className),this.className=this.className||a===!1?"":f._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ",c=0,d=this.length;for(;c<d;c++)if(this[c].nodeType===1&&(" "+this[c].className+" ").replace(o," ").indexOf(b)>-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.nodeName.toLowerCase()]||f.valHooks[g.type];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c<d;c++){e=i[c];if(e.selected&&(f.support.optDisabled?!e.disabled:e.getAttribute("disabled")===null)&&(!e.parentNode.disabled||!f.nodeName(e.parentNode,"optgroup"))){b=f(e).val();if(j)return b;h.push(b)}}if(j&&!h.length&&i.length)return f(i[g]).val();return h},set:function(a,b){var c=f.makeArray(b);f(a).find("option").each(function(){this.selected=f.inArray(f(this).val(),c)>=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;h<g;h++)e=d[h],e&&(c=f.propFix[e]||e,f.attr(a,e,""),a.removeAttribute(v?e:c),u.test(e)&&c in a&&(a[c]=!1))}},attrHooks:{type:{set:function(a,b){if(r.test(a.nodeName)&&a.parentNode)f.error("type property can't be changed");else if(!f.support.radioValue&&b==="radio"&&f.nodeName(a,"input")){var c=a.value;a.setAttribute("type",b),c&&(a.value=c);return b}}},value:{get:function(a,b){if(w&&f.nodeName(a,"button"))return w.get(a,b);return b in a?a.value:null},set:function(a,b,c){if(w&&f.nodeName(a,"button"))return w.set(a,b,c);a.value=b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e,g,h,i=a.nodeType;if(!!a&&i!==3&&i!==8&&i!==2){h=i!==1||!f.isXMLDoc(a),h&&(c=f.propFix[c]||c,g=f.propHooks[c]);return d!==b?g&&"set"in g&&(e=g.set(a,d,c))!==b?e:a[c]=d:g&&"get"in g&&(e=g.get(a,c))!==null?e:a[c]}},propHooks:{tabIndex:{get:function(a){var c=a.getAttributeNode("tabindex");return c&&c.specified?parseInt(c.value,10):s.test(a.nodeName)||t.test(a.nodeName)&&a.href?0:b}}}}),f.attrHooks.tabindex=f.propHooks.tabIndex,x={get:function(a,c){var d,e=f.prop(a,c);return e===!0||typeof e!="boolean"&&(d=a.getAttributeNode(c))&&d.nodeValue!==!1?c.toLowerCase():b},set:function(a,b,c){var d;b===!1?f.removeAttr(a,c):(d=f.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase()));return c}},v||(y={name:!0,id:!0},w=f.valHooks.button={get:function(a,c){var d;d=a.getAttributeNode(c);return d&&(y[c]?d.nodeValue!=="":d.specified)?d.nodeValue:b},set:function(a,b,d){var e=a.getAttributeNode(d);e||(e=c.createAttribute(d),a.setAttributeNode(e));return e.nodeValue=b+""}},f.attrHooks.tabindex.set=w.set,f.each(["width","height"],function(a,b){f.attrHooks[b]=f.extend(f.attrHooks[b],{set:function(a,c){if(c===""){a.setAttribute(b,"auto");return c}}})}),f.attrHooks.contenteditable={get:w.get,set:function(a,b,c){b===""&&(b="false"),w.set(a,b,c)}}),f.support.hrefNormalized||f.each(["href","src","width","height"],function(a,c){f.attrHooks[c]=f.extend(f.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),f.support.style||(f.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}}),f.support.optSelected||(f.propHooks.selected=f.extend(f.propHooks.selected,{get:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex);return null}})),f.support.enctype||(f.propFix.enctype="encoding"),f.support.checkOn||f.each(["radio","checkbox"],function(){f.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),f.each(["radio","checkbox"],function(){f.valHooks[this]=f.extend(f.valHooks[this],{set:function(a,b){if(f.isArray(b))return a.checked=f.inArray(f(a).val(),b)>=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/\bhover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function(a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")}; +f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k<c.length;k++){l=A.exec(c[k])||[],m=l[1],n=(l[2]||"").split(".").sort(),s=f.event.special[m]||{},m=(g?s.delegateType:s.bindType)||m,s=f.event.special[m]||{},o=f.extend({type:m,origType:l[1],data:e,handler:d,guid:d.guid,selector:g,quick:G(g),namespace:n.join(".")},p),r=j[m];if(!r){r=j[m]=[],r.delegateCount=0;if(!s.setup||s.setup.call(a,e,n,i)===!1)a.addEventListener?a.addEventListener(m,i,!1):a.attachEvent&&a.attachEvent("on"+m,i)}s.add&&(s.add.call(a,o),o.handler.guid||(o.handler.guid=d.guid)),g?r.splice(r.delegateCount++,0,o):r.push(o),f.event.global[m]=!0}a=null}},global:{},remove:function(a,b,c,d,e){var g=f.hasData(a)&&f._data(a),h,i,j,k,l,m,n,o,p,q,r,s;if(!!g&&!!(o=g.events)){b=f.trim(I(b||"")).split(" ");for(h=0;h<b.length;h++){i=A.exec(b[h])||[],j=k=i[1],l=i[2];if(!j){for(j in o)f.event.remove(a,j+b[h],c,d,!0);continue}p=f.event.special[j]||{},j=(d?p.delegateType:p.bindType)||j,r=o[j]||[],m=r.length,l=l?new RegExp("(^|\\.)"+l.split(".").sort().join("\\.(?:.*\\.)?")+"(\\.|$)"):null;for(n=0;n<r.length;n++)s=r[n],(e||k===s.origType)&&(!c||c.guid===s.guid)&&(!l||l.test(s.namespace))&&(!d||d===s.selector||d==="**"&&s.selector)&&(r.splice(n--,1),s.selector&&r.delegateCount--,p.remove&&p.remove.call(a,s));r.length===0&&m!==r.length&&((!p.teardown||p.teardown.call(a,l)===!1)&&f.removeEvent(a,j,g.handle),delete o[j])}f.isEmptyObject(o)&&(q=g.handle,q&&(q.elem=null),f.removeData(a,["events","handle"],!0))}},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(c,d,e,g){if(!e||e.nodeType!==3&&e.nodeType!==8){var h=c.type||c,i=[],j,k,l,m,n,o,p,q,r,s;if(E.test(h+f.event.triggered))return;h.indexOf("!")>=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;l<r.length&&!c.isPropagationStopped();l++)m=r[l][0],c.type=r[l][1],q=(f._data(m,"events")||{})[c.type]&&f._data(m,"handle"),q&&q.apply(m,d),q=o&&m[o],q&&f.acceptData(m)&&q.apply(m,d)===!1&&c.preventDefault();c.type=h,!g&&!c.isDefaultPrevented()&&(!p._default||p._default.apply(e.ownerDocument,d)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)&&o&&e[h]&&(h!=="focus"&&h!=="blur"||c.target.offsetWidth!==0)&&!f.isWindow(e)&&(n=e[o],n&&(e[o]=null),f.event.triggered=h,e[h](),f.event.triggered=b,n&&(e[o]=n));return c.result}},dispatch:function(c){c=f.event.fix(c||a.event);var d=(f._data(this,"events")||{})[c.type]||[],e=d.delegateCount,g=[].slice.call(arguments,0),h=!c.exclusive&&!c.namespace,i=[],j,k,l,m,n,o,p,q,r,s,t;g[0]=c,c.delegateTarget=this;if(e&&!c.target.disabled&&(!c.button||c.type!=="click")){m=f(this),m.context=this.ownerDocument||this;for(l=c.target;l!=this;l=l.parentNode||this){o={},q=[],m[0]=l;for(j=0;j<e;j++)r=d[j],s=r.selector,o[s]===b&&(o[s]=r.quick?H(l,r.quick):m.is(s)),o[s]&&q.push(r);q.length&&i.push({elem:l,matches:q})}}d.length>e&&i.push({elem:this,matches:d.slice(e)});for(j=0;j<i.length&&!c.isPropagationStopped();j++){p=i[j],c.currentTarget=p.elem;for(k=0;k<p.matches.length&&!c.isImmediatePropagationStopped();k++){r=p.matches[k];if(h||!c.namespace&&!r.namespace||c.namespace_re&&c.namespace_re.test(r.namespace))c.data=r.data,c.handleObj=r,n=((f.event.special[r.origType]||{}).handle||r.handler).apply(p.elem,g),n!==b&&(c.result=n,n===!1&&(c.preventDefault(),c.stopPropagation()))}}return c.result},props:"attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){a.which==null&&(a.which=b.charCode!=null?b.charCode:b.keyCode);return a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,d){var e,f,g,h=d.button,i=d.fromElement;a.pageX==null&&d.clientX!=null&&(e=a.target.ownerDocument||c,f=e.documentElement,g=e.body,a.pageX=d.clientX+(f&&f.scrollLeft||g&&g.scrollLeft||0)-(f&&f.clientLeft||g&&g.clientLeft||0),a.pageY=d.clientY+(f&&f.scrollTop||g&&g.scrollTop||0)-(f&&f.clientTop||g&&g.clientTop||0)),!a.relatedTarget&&i&&(a.relatedTarget=i===a.target?d.toElement:i),!a.which&&h!==b&&(a.which=h&1?1:h&2?3:h&4?2:0);return a}},fix:function(a){if(a[f.expando])return a;var d,e,g=a,h=f.event.fixHooks[a.type]||{},i=h.props?this.props.concat(h.props):this.props;a=f.Event(g);for(d=i.length;d;)e=i[--d],a[e]=g[e];a.target||(a.target=g.srcElement||c),a.target.nodeType===3&&(a.target=a.target.parentNode),a.metaKey===b&&(a.metaKey=a.ctrlKey);return h.filter?h.filter(a,g):a},special:{ready:{setup:f.bindReady},load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(a,b,c){f.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}},simulate:function(a,b,c,d){var e=f.extend(new f.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?f.event.trigger(e,null,b):f.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},f.event.handle=f.event.dispatch,f.removeEvent=c.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){a.detachEvent&&a.detachEvent("on"+b,c)},f.Event=function(a,b){if(!(this instanceof f.Event))return new f.Event(a,b);a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?K:J):this.type=a,b&&f.extend(this,b),this.timeStamp=a&&a.timeStamp||f.now(),this[f.expando]=!0},f.Event.prototype={preventDefault:function(){this.isDefaultPrevented=K;var a=this.originalEvent;!a||(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=K;var a=this.originalEvent;!a||(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=K,this.stopPropagation()},isDefaultPrevented:J,isPropagationStopped:J,isImmediatePropagationStopped:J},f.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){f.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c=this,d=a.relatedTarget,e=a.handleObj,g=e.selector,h;if(!d||d!==c&&!f.contains(c,d))a.type=e.origType,h=e.handler.apply(this,arguments),a.type=b;return h}}}),f.support.submitBubbles||(f.event.special.submit={setup:function(){if(f.nodeName(this,"form"))return!1;f.event.add(this,"click._submit keypress._submit",function(a){var c=a.target,d=f.nodeName(c,"input")||f.nodeName(c,"button")?c.form:b;d&&!d._submit_attached&&(f.event.add(d,"submit._submit",function(a){this.parentNode&&!a.isTrigger&&f.event.simulate("submit",this.parentNode,a,!0)}),d._submit_attached=!0)})},teardown:function(){if(f.nodeName(this,"form"))return!1;f.event.remove(this,"._submit")}}),f.support.changeBubbles||(f.event.special.change={setup:function(){if(z.test(this.nodeName)){if(this.type==="checkbox"||this.type==="radio")f.event.add(this,"propertychange._change",function(a){a.originalEvent.propertyName==="checked"&&(this._just_changed=!0)}),f.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1,f.event.simulate("change",this,a,!0))});return!1}f.event.add(this,"beforeactivate._change",function(a){var b=a.target;z.test(b.nodeName)&&!b._change_attached&&(f.event.add(b,"change._change",function(a){this.parentNode&&!a.isSimulated&&!a.isTrigger&&f.event.simulate("change",this.parentNode,a,!0)}),b._change_attached=!0)})},handle:function(a){var b=a.target;if(this!==b||a.isSimulated||a.isTrigger||b.type!=="radio"&&b.type!=="checkbox")return a.handleObj.handler.apply(this,arguments)},teardown:function(){f.event.remove(this,"._change");return z.test(this.nodeName)}}),f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){var d=0,e=function(a){f.event.simulate(b,a.target,f.event.fix(a),!0)};f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0)},teardown:function(){--d===0&&c.removeEventListener(a,e,!0)}}}),f.fn.extend({on:function(a,c,d,e,g){var h,i;if(typeof a=="object"){typeof c!="string"&&(d=c,c=b);for(i in a)this.on(i,c,d,a[i],g);return this}d==null&&e==null?(e=c,d=c=b):e==null&&(typeof c=="string"?(e=d,d=b):(e=d,d=c,c=b));if(e===!1)e=J;else if(!e)return this;g===1&&(h=e,e=function(a){f().off(a);return h.apply(this,arguments)},e.guid=h.guid||(h.guid=f.guid++));return this.each(function(){f.event.add(this,a,e,d,c)})},one:function(a,b,c,d){return this.on.call(this,a,b,c,d,1)},off:function(a,c,d){if(a&&a.preventDefault&&a.handleObj){var e=a.handleObj;f(a.delegateTarget).off(e.namespace?e.type+"."+e.namespace:e.type,e.selector,e.handler);return this}if(typeof a=="object"){for(var g in a)this.off(g,c,a[g]);return this}if(c===!1||typeof c=="function")d=c,c=b;d===!1&&(d=J);return this.each(function(){f.event.remove(this,a,d,c)})},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},live:function(a,b,c){f(this.context).on(a,this.selector,b,c);return this},die:function(a,b){f(this.context).off(a,this.selector||"**",b);return this},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return arguments.length==1?this.off(a,"**"):this.off(b,a,c)},trigger:function(a,b){return this.each(function(){f.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0])return f.event.trigger(a,b,this[0],!0)},toggle:function(a){var b=arguments,c=a.guid||f.guid++,d=0,e=function(c){var e=(f._data(this,"lastToggle"+a.guid)||0)%d;f._data(this,"lastToggle"+a.guid,e+1),c.preventDefault();return b[e].apply(this,arguments)||!1};e.guid=c;while(d<b.length)b[d++].guid=c;return this.click(e)},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),f.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){f.fn[b]=function(a,c){c==null&&(c=a,a=null);return arguments.length>0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h<i;h++){var j=e[h];if(j){var k=!1;j=j[a];while(j){if(j[d]===c){k=e[j.sizset];break}if(j.nodeType===1){g||(j[d]=c,j.sizset=h);if(typeof b!="string"){if(j===b){k=!0;break}}else if(m.filter(b,[j]).length>0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h<i;h++){var j=e[h];if(j){var k=!1;j=j[a];while(j){if(j[d]===c){k=e[j.sizset];break}j.nodeType===1&&!g&&(j[d]=c,j.sizset=h);if(j.nodeName.toLowerCase()===b){k=j;break}j=j[a]}e[h]=k}}}var a=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b<a.length;b++)a[b]===a[b-1]&&a.splice(b--,1)}return a},m.matches=function(a,b){return m(a,null,null,b)},m.matchesSelector=function(a,b){return m(b,null,null,[a]).length>0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e<f;e++){h=o.order[e];if(g=o.leftMatch[h].exec(a)){i=g[1],g.splice(1,1);if(i.substr(i.length-1)!=="\\"){g[1]=(g[1]||"").replace(j,""),d=o.find[h](g,b,c);if(d!=null){a=a.replace(o.match[h],"");break}}}}d||(d=typeof b.getElementsByTagName!="undefined"?b.getElementsByTagName("*"):[]);return{set:d,expr:a}},m.filter=function(a,c,d,e){var f,g,h,i,j,k,l,n,p,q=a,r=[],s=c,t=c&&c[0]&&m.isXML(c[0]);while(a&&c.length){for(h in o.filter)if((f=o.leftMatch[h].exec(a))!=null&&f[2]){k=o.filter[h],l=f[1],g=!1,f.splice(1,1);if(l.substr(l.length-1)==="\\")continue;s===r&&(r=[]);if(o.preFilter[h]){f=o.preFilter[h](f,s,d,r,e,t);if(!f)g=i=!0;else if(f===!0)continue}if(f)for(n=0;(j=s[n])!=null;n++)j&&(i=k(j,f,n,s),p=e^i,d&&i!=null?p?g=!0:s[n]=!1:p&&(r.push(j),g=!0));if(i!==b){d||(s=r),a=a.replace(o.match[h],"");if(!g)return[];break}}if(a===q)if(g==null)m.error(a);else break;q=a}return s},m.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)};var n=m.getText=function(a){var b,c,d=a.nodeType,e="";if(d){if(d===1||d===9){if(typeof a.textContent=="string")return a.textContent;if(typeof a.innerText=="string")return a.innerText.replace(k,"");for(a=a.firstChild;a;a=a.nextSibling)e+=n(a)}else if(d===3||d===4)return a.nodeValue}else for(b=0;c=a[b];b++)c.nodeType!==8&&(e+=n(c));return e},o=m.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")},type:function(a){return a.getAttribute("type")}},relative:{"+":function(a,b){var c=typeof b=="string",d=c&&!l.test(b),e=c&&!d;d&&(b=b.toLowerCase());for(var f=0,g=a.length,h;f<g;f++)if(h=a[f]){while((h=h.previousSibling)&&h.nodeType!==1);a[f]=e||h&&h.nodeName.toLowerCase()===b?h||!1:h===b}e&&m.filter(b,a,!0)},">":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e<f;e++){c=a[e];if(c){var g=c.parentNode;a[e]=g.nodeName.toLowerCase()===b?g:!1}}}else{for(;e<f;e++)c=a[e],c&&(a[e]=d?c.parentNode:c.parentNode===b);d&&m.filter(b,a,!0)}},"":function(a,b,c){var d,f=e++,g=x;typeof b=="string"&&!l.test(b)&&(b=b.toLowerCase(),d=b,g=w),g("parentNode",b,f,a,d,c)},"~":function(a,b,c){var d,f=e++,g=x;typeof b=="string"&&!l.test(b)&&(b=b.toLowerCase(),d=b,g=w),g("previousSibling",b,f,a,d,c)}},find:{ID:function(a,b,c){if(typeof b.getElementById!="undefined"&&!c){var d=b.getElementById(a[1]);return d&&d.parentNode?[d]:[]}},NAME:function(a,b){if(typeof b.getElementsByName!="undefined"){var c=[],d=b.getElementsByName(a[1]);for(var e=0,f=d.length;e<f;e++)d[e].getAttribute("name")===a[1]&&c.push(d[e]);return c.length===0?null:c}},TAG:function(a,b){if(typeof b.getElementsByTagName!="undefined")return b.getElementsByTagName(a[1])}},preFilter:{CLASS:function(a,b,c,d,e,f){a=" "+a[1].replace(j,"")+" ";if(f)return a;for(var g=0,h;(h=b[g])!=null;g++)h&&(e^(h.className&&(" "+h.className+" ").replace(/[\t\n\r]/g," ").indexOf(a)>=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return b<c[3]-0},gt:function(a,b,c){return b>c[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h<i;h++)if(g[h]===a)return!1;return!0}m.error(e)},CHILD:function(a,b){var c,e,f,g,h,i,j,k=b[1],l=a;switch(k){case"only":case"first":while(l=l.previousSibling)if(l.nodeType===1)return!1;if(k==="first")return!0;l=a;case"last":while(l=l.nextSibling)if(l.nodeType===1)return!1;return!0;case"nth":c=b[2],e=b[3];if(c===1&&e===0)return!0;f=b[0],g=a.parentNode;if(g&&(g[d]!==f||!a.nodeIndex)){i=0;for(l=g.firstChild;l;l=l.nextSibling)l.nodeType===1&&(l.nodeIndex=++i);g[d]=f}j=a.nodeIndex-e;return c===0?j===0:j%c===0&&j/c>=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c<e;c++)d.push(a[c]);else for(;a[c];c++)d.push(a[c]);return d}}var u,v;c.documentElement.compareDocumentPosition?u=function(a,b){if(a===b){h=!0;return 0}if(!a.compareDocumentPosition||!b.compareDocumentPosition)return a.compareDocumentPosition?-1:1;return a.compareDocumentPosition(b)&4?-1:1}:(u=function(a,b){if(a===b){h=!0;return 0}if(a.sourceIndex&&b.sourceIndex)return a.sourceIndex-b.sourceIndex;var c,d,e=[],f=[],g=a.parentNode,i=b.parentNode,j=g;if(g===i)return v(a,b);if(!g)return-1;if(!i)return 1;while(j)e.unshift(j),j=j.parentNode;j=i;while(j)f.unshift(j),j=j.parentNode;c=e.length,d=f.length;for(var k=0;k<c&&k<d;k++)if(e[k]!==f[k])return v(e[k],f[k]);return k===c?v(a,f[k],-1):v(e[k],b,1)},v=function(a,b,c){if(a===b)return c;var d=a.nextSibling;while(d){if(d===b)return-1;d=d.nextSibling}return 1}),function(){var a=c.createElement("div"),d="script"+(new Date).getTime(),e=c.documentElement;a.innerHTML="<a name='"+d+"'/>",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="<p class='TEST'></p>";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="<div class='test e'></div><div class='test'></div>";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h<i;h++)m(a,g[h],e,c);return m.filter(f,e)};m.attr=f.attr,m.selectors.attrMap={},f.find=m,f.expr=m.selectors,f.expr[":"]=f.expr.filters,f.unique=m.uniqueSort,f.text=m.getText,f.isXMLDoc=m.isXML,f.contains=m.contains}();var L=/Until$/,M=/^(?:parents|prevUntil|prevAll)/,N=/,/,O=/^.[^:#\[\.,]*$/,P=Array.prototype.slice,Q=f.expr.match.POS,R={children:!0,contents:!0,next:!0,prev:!0};f.fn.extend({find:function(a){var b=this,c,d;if(typeof a!="string")return f(a).filter(function(){for(c=0,d=b.length;c<d;c++)if(f.contains(b[c],this))return!0});var e=this.pushStack("","find",a),g,h,i;for(c=0,d=this.length;c<d;c++){g=e.length,f.find(a,this[c],e);if(c>0)for(h=g;h<e.length;h++)for(i=0;i<g;i++)if(e[i]===e[h]){e.splice(h--,1);break}}return e},has:function(a){var b=f(a);return this.filter(function(){for(var a=0,c=b.length;a<c;a++)if(f.contains(this,b[a]))return!0})},not:function(a){return this.pushStack(T(this,a,!1),"not",a)},filter:function(a){return this.pushStack(T(this,a,!0),"filter",a)},is:function(a){return!!a&&(typeof a=="string"?Q.test(a)?f(a,this.context).index(this[0])>=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d<a.length;d++)f(g).is(a[d])&&c.push({selector:a[d],elem:g,level:h});g=g.parentNode,h++}return c}var i=Q.test(a)||typeof a!="string"?f(a,b||this.context):0;for(d=0,e=this.length;d<e;d++){g=this[d];while(g){if(i?i.index(g)>-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/<tbody/i,_=/<|&#?\w+;/,ba=/<(?:script|style)/i,bb=/<(?:script|object|embed|option|style)/i,bc=new RegExp("<(?:"+V+")","i"),bd=/checked\s*(?:[^=]|=\s*.checked.)/i,be=/\/(java|ecma)script/i,bf=/^\s*<!(?:\[CDATA\[|\-\-)/,bg={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div<div>","</div>"]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f.clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function() +{for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1></$2>");try{for(var c=0,d=this.length;c<d;c++)this[c].nodeType===1&&(f.cleanData(this[c].getElementsByTagName("*")),this[c].innerHTML=a)}catch(e){this.empty().append(a)}}else f.isFunction(a)?this.each(function(b){var c=f(this);c.html(a.call(this,b,c.html()))}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(f.isFunction(a))return this.each(function(b){var c=f(this),d=c.html();c.replaceWith(a.call(this,b,d))});typeof a!="string"&&(a=f(a).detach());return this.each(function(){var b=this.nextSibling,c=this.parentNode;f(this).remove(),b?f(b).before(a):f(c).append(a)})}return this.length?this.pushStack(f(f.isFunction(a)?a():a),"replaceWith",a):this},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,d){var e,g,h,i,j=a[0],k=[];if(!f.support.checkClone&&arguments.length===3&&typeof j=="string"&&bd.test(j))return this.each(function(){f(this).domManip(a,c,d,!0)});if(f.isFunction(j))return this.each(function(e){var g=f(this);a[0]=j.call(this,e,c?g.html():b),g.domManip(a,c,d)});if(this[0]){i=j&&j.parentNode,f.support.parentNode&&i&&i.nodeType===11&&i.childNodes.length===this.length?e={fragment:i}:e=f.buildFragment(a,this,k),h=e.fragment,h.childNodes.length===1?g=h=h.firstChild:g=h.firstChild;if(g){c=c&&f.nodeName(g,"tr");for(var l=0,m=this.length,n=m-1;l<m;l++)d.call(c?bi(this[l],g):this[l],e.cacheable||m>1&&l<n?f.clone(h,!0,!0):h)}k.length&&f.each(k,bp)}return this}}),f.buildFragment=function(a,b,d){var e,g,h,i,j=a[0];b&&b[0]&&(i=b[0].ownerDocument||b[0]),i.createDocumentFragment||(i=c),a.length===1&&typeof j=="string"&&j.length<512&&i===c&&j.charAt(0)==="<"&&!bb.test(j)&&(f.support.checkClone||!bd.test(j))&&(f.support.html5Clone||!bc.test(j))&&(g=!0,h=f.fragments[j],h&&h!==1&&(e=h)),e||(e=i.createDocumentFragment(),f.clean(a,i,e,d)),g&&(f.fragments[j]=h?e:1);return{fragment:e,cacheable:g}},f.fragments={},f.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){f.fn[a]=function(c){var d=[],e=f(c),g=this.length===1&&this[0].parentNode;if(g&&g.nodeType===11&&g.childNodes.length===1&&e.length===1){e[b](this[0]);return this}for(var h=0,i=e.length;h<i;h++){var j=(h>0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||!bc.test("<"+a.nodeName)?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!_.test(k))k=b.createTextNode(k);else{k=k.replace(Y,"<$1></$2>");var l=(Z.exec(k)||["",""])[1].toLowerCase(),m=bg[l]||bg._default,n=m[0],o=b.createElement("div");b===c?bh.appendChild(o):U(b).appendChild(o),o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=$.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]==="<table>"&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&X.test(k)&&o.insertBefore(b.createTextNode(X.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i<r;i++)bn(k[i]);else bn(k);k.nodeType?h.push(k):h=f.merge(h,k)}if(d){g=function(a){return!a.type||be.test(a.type)};for(j=0;h[j];j++)if(e&&f.nodeName(h[j],"script")&&(!h[j].type||h[j].type.toLowerCase()==="text/javascript"))e.push(h[j].parentNode?h[j].parentNode.removeChild(h[j]):h[j]);else{if(h[j].nodeType===1){var s=f.grep(h[j].getElementsByTagName("script"),g);h.splice.apply(h,[j+1,0].concat(s))}d.appendChild(h[j])}}return h},cleanData:function(a){var b,c,d=f.cache,e=f.event.special,g=f.support.deleteExpando;for(var h=0,i;(i=a[h])!=null;h++){if(i.nodeName&&f.noData[i.nodeName.toLowerCase()])continue;c=i[f.expando];if(c){b=d[c];if(b&&b.events){for(var j in b.events)e[j]?f.event.remove(i,j):f.removeEvent(i,j,b.handle);b.handle&&(b.handle.elem=null)}g?delete i[f.expando]:i.removeAttribute&&i.removeAttribute(f.expando),delete d[c]}}}});var bq=/alpha\([^)]*\)/i,br=/opacity=([^)]*)/,bs=/([A-Z]|^ms)/g,bt=/^-?\d+(?:px)?$/i,bu=/^-?\d/,bv=/^([\-+])=([\-+.\de]+)/,bw={position:"absolute",visibility:"hidden",display:"block"},bx=["Left","Right"],by=["Top","Bottom"],bz,bA,bB;f.fn.css=function(a,c){if(arguments.length===2&&c===b)return this;return f.access(this,a,c,!0,function(a,c,d){return d!==b?f.style(a,c,d):f.css(a,c)})},f.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bz(a,"opacity","opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":f.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!!a&&a.nodeType!==3&&a.nodeType!==8&&!!a.style){var g,h,i=f.camelCase(c),j=a.style,k=f.cssHooks[i];c=f.cssProps[i]||i;if(d===b){if(k&&"get"in k&&(g=k.get(a,!1,e))!==b)return g;return j[c]}h=typeof d,h==="string"&&(g=bv.exec(d))&&(d=+(g[1]+1)*+g[2]+parseFloat(f.css(a,c)),h="number");if(d==null||h==="number"&&isNaN(d))return;h==="number"&&!f.cssNumber[i]&&(d+="px");if(!k||!("set"in k)||(d=k.set(a,d))!==b)try{j[c]=d}catch(l){}}},css:function(a,c,d){var e,g;c=f.camelCase(c),g=f.cssHooks[c],c=f.cssProps[c]||c,c==="cssFloat"&&(c="float");if(g&&"get"in g&&(e=g.get(a,!0,d))!==b)return e;if(bz)return bz(a,c)},swap:function(a,b,c){var d={};for(var e in b)d[e]=a.style[e],a.style[e]=b[e];c.call(a);for(e in b)a.style[e]=d[e]}}),f.curCSS=f.css,f.each(["height","width"],function(a,b){f.cssHooks[b]={get:function(a,c,d){var e;if(c){if(a.offsetWidth!==0)return bC(a,b,d);f.swap(a,bw,function(){e=bC(a,b,d)});return e}},set:function(a,b){if(!bt.test(b))return b;b=parseFloat(b);if(b>=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return br.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bq,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bq.test(g)?g.replace(bq,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bz(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bA=function(a,b){var c,d,e;b=b.replace(bs,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b)));return c}),c.documentElement.currentStyle&&(bB=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f===null&&g&&(e=g[b])&&(f=e),!bt.test(f)&&bu.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f||0,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),bz=bA||bB,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bD=/%20/g,bE=/\[\]$/,bF=/\r?\n/g,bG=/#.*$/,bH=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bI=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bJ=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bK=/^(?:GET|HEAD)$/,bL=/^\/\//,bM=/\?/,bN=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bO=/^(?:select|textarea)/i,bP=/\s+/,bQ=/([?&])_=[^&]*/,bR=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bS=f.fn.load,bT={},bU={},bV,bW,bX=["*/"]+["*"];try{bV=e.href}catch(bY){bV=c.createElement("a"),bV.href="",bV=bV.href}bW=bR.exec(bV.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bS)return bS.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("<div>").append(c.replace(bN,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bO.test(this.nodeName)||bI.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bF,"\r\n")}}):{name:b.name,value:c.replace(bF,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b_(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b_(a,b);return a},ajaxSettings:{url:bV,isLocal:bJ.test(bW[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bX},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bZ(bT),ajaxTransport:bZ(bU),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?cb(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cc(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bH.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bG,"").replace(bL,bW[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bP),d.crossDomain==null&&(r=bR.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bW[1]&&r[2]==bW[2]&&(r[3]||(r[1]==="http:"?80:443))==(bW[3]||(bW[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),b$(bT,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bK.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bM.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bQ,"$1_="+x);d.url=y+(y===d.url?(bM.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bX+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=b$(bU,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2)w(-1,z);else throw z}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)ca(g,a[g],c,e);return d.join("&").replace(bD,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cd=f.now(),ce=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cd++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ce.test(b.url)||e&&ce.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(ce,l),b.url===j&&(e&&(k=k.replace(ce,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var cf=a.ActiveXObject?function(){for(var a in ch)ch[a](0,1)}:!1,cg=0,ch;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ci()||cj()}:ci,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,cf&&delete ch[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cg,cf&&(ch||(ch={},f(a).unload(cf)),ch[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var ck={},cl,cm,cn=/^(?:toggle|show|hide)$/,co=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cp,cq=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cr;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cu("show",3),a,b,c);for(var g=0,h=this.length;g<h;g++)d=this[g],d.style&&(e=d.style.display,!f._data(d,"olddisplay")&&e==="none"&&(e=d.style.display=""),e===""&&f.css(d,"display")==="none"&&f._data(d,"olddisplay",cv(d.nodeName)));for(g=0;g<h;g++){d=this[g];if(d.style){e=d.style.display;if(e===""||e==="none")d.style.display=f._data(d,"olddisplay")||""}}return this},hide:function(a,b,c){if(a||a===0)return this.animate(cu("hide",3),a,b,c);var d,e,g=0,h=this.length;for(;g<h;g++)d=this[g],d.style&&(e=f.css(d,"display"),e!=="none"&&!f._data(d,"olddisplay")&&f._data(d,"olddisplay",e));for(g=0;g<h;g++)this[g].style&&(this[g].style.display="none");return this},_toggle:f.fn.toggle,toggle:function(a,b,c){var d=typeof a=="boolean";f.isFunction(a)&&f.isFunction(b)?this._toggle.apply(this,arguments):a==null||d?this.each(function(){var b=d?a:f(this).is(":hidden");f(this)[b?"show":"hide"]()}):this.animate(cu("toggle",3),a,b,c);return this},fadeTo:function(a,b,c,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){function g(){e.queue===!1&&f._mark(this);var b=f.extend({},e),c=this.nodeType===1,d=c&&f(this).is(":hidden"),g,h,i,j,k,l,m,n,o;b.animatedProperties={};for(i in a){g=f.camelCase(i),i!==g&&(a[g]=a[i],delete a[i]),h=a[g],f.isArray(h)?(b.animatedProperties[g]=h[1],h=a[g]=h[0]):b.animatedProperties[g]=b.specialEasing&&b.specialEasing[g]||b.easing||"swing";if(h==="hide"&&d||h==="show"&&!d)return b.complete.call(this);c&&(g==="height"||g==="width")&&(b.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY],f.css(this,"display")==="inline"&&f.css(this,"float")==="none"&&(!f.support.inlineBlockNeedsLayout||cv(this.nodeName)==="inline"?this.style.display="inline-block":this.style.zoom=1))}b.overflow!=null&&(this.style.overflow="hidden");for(i in a)j=new f.fx(this,b,i),h=a[i],cn.test(h)?(o=f._data(this,"toggle"+i)||(h==="toggle"?d?"show":"hide":0),o?(f._data(this,"toggle"+i,o==="show"?"hide":"show"),j[o]()):j[h]()):(k=co.exec(h),l=j.cur(),k?(m=parseFloat(k[2]),n=k[3]||(f.cssNumber[i]?"":"px"),n!=="px"&&(f.style(this,i,(m||1)+n),l=(m||1)/j.cur()*l,f.style(this,i,l+n)),k[1]&&(m=(k[1]==="-="?-1:1)*m+l),j.custom(l,m,n)):j.custom(l,h,""));return!0}var e=f.speed(b,c,d);if(f.isEmptyObject(a))return this.each(e.complete,[!1]);a=f.extend({},a);return e.queue===!1?this.each(g):this.queue(e.queue,g)},stop:function(a,c,d){typeof a!="string"&&(d=c,c=a,a=b),c&&a!==!1&&this.queue(a||"fx",[]);return this.each(function(){function h(a,b,c){var e=b[c];f.removeData(a,c,!0),e.stop(d)}var b,c=!1,e=f.timers,g=f._data(this);d||f._unmark(!0,this);if(a==null)for(b in g)g[b]&&g[b].stop&&b.indexOf(".run")===b.length-4&&h(this,g,b);else g[b=a+".run"]&&g[b].stop&&h(this,g,b);for(b=e.length;b--;)e[b].elem===this&&(a==null||e[b].queue===a)&&(d?e[b](!0):e[b].saveState(),c=!0,e.splice(b,1));(!d||!c)&&f.dequeue(this,a)})}}),f.each({slideDown:cu("show",1),slideUp:cu("hide",1),slideToggle:cu("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){f.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),f.extend({speed:function(a,b,c){var d=a&&typeof a=="object"?f.extend({},a):{complete:c||!c&&b||f.isFunction(a)&&a,duration:a,easing:c&&b||b&&!f.isFunction(b)&&b};d.duration=f.fx.off?0:typeof d.duration=="number"?d.duration:d.duration in f.fx.speeds?f.fx.speeds[d.duration]:f.fx.speeds._default;if(d.queue==null||d.queue===!0)d.queue="fx";d.old=d.complete,d.complete=function(a){f.isFunction(d.old)&&d.old.call(this),d.queue?f.dequeue(this,d.queue):a!==!1&&f._unmark(this)};return d},easing:{linear:function(a,b,c,d){return c+d*a},swing:function(a,b,c,d){return(-Math.cos(a*Math.PI)/2+.5)*d+c}},timers:[],fx:function(a,b,c){this.options=b,this.elem=a,this.prop=c,b.orig=b.orig||{}}}),f.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this),(f.fx.step[this.prop]||f.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a,b=f.css(this.elem,this.prop);return isNaN(a=parseFloat(b))?!b||b==="auto"?0:b:a},custom:function(a,c,d){function h(a){return e.step(a)}var e=this,g=f.fx;this.startTime=cr||cs(),this.end=c,this.now=this.start=a,this.pos=this.state=0,this.unit=d||this.unit||(f.cssNumber[this.prop]?"":"px"),h.queue=this.options.queue,h.elem=this.elem,h.saveState=function(){e.options.hide&&f._data(e.elem,"fxshow"+e.prop)===b&&f._data(e.elem,"fxshow"+e.prop,e.start)},h()&&f.timers.push(h)&&!cp&&(cp=setInterval(g.tick,g.interval))},show:function(){var a=f._data(this.elem,"fxshow"+this.prop);this.options.orig[this.prop]=a||f.style(this.elem,this.prop),this.options.show=!0,a!==b?this.custom(this.cur(),a):this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur()),f(this.elem).show()},hide:function(){this.options.orig[this.prop]=f._data(this.elem,"fxshow"+this.prop)||f.style(this.elem,this.prop),this.options.hide=!0,this.custom(this.cur(),0)},step:function(a){var b,c,d,e=cr||cs(),g=!0,h=this.elem,i=this.options;if(a||e>=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c<b.length;c++)a=b[c],!a()&&b[c]===a&&b.splice(c--,1);b.length||f.fx.stop()},interval:13,stop:function(){clearInterval(cp),cp=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){f.style(a.elem,"opacity",a.now)},_default:function(a){a.elem.style&&a.elem.style[a.prop]!=null?a.elem.style[a.prop]=a.now+a.unit:a.elem[a.prop]=a.now}}}),f.each(["width","height"],function(a,b){f.fx.step[b]=function(a){f.style(a.elem,b,Math.max(0,a.now)+a.unit)}}),f.expr&&f.expr.filters&&(f.expr.filters.animated=function(a){return f.grep(f.timers,function(b){return a===b.elem}).length});var cw=/^t(?:able|d|h)$/i,cx=/^(?:body|html)$/i;"getBoundingClientRect"in c.documentElement?f.fn.offset=function(a){var b=this[0],c;if(a)return this.each(function(b){f.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return f.offset.bodyOffset(b);try{c=b.getBoundingClientRect()}catch(d){}var e=b.ownerDocument,g=e.documentElement;if(!c||!f.contains(g,b))return c?{top:c.top,left:c.left}:{top:0,left:0};var h=e.body,i=cy(e),j=g.clientTop||h.clientTop||0,k=g.clientLeft||h.clientLeft||0,l=i.pageYOffset||f.support.boxModel&&g.scrollTop||h.scrollTop,m=i.pageXOffset||f.support.boxModel&&g.scrollLeft||h.scrollLeft,n=c.top+l-j,o=c.left+m-k;return{top:n,left:o}}:f.fn.offset=function(a){var b=this[0];if(a)return this.each(function(b){f.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return f.offset.bodyOffset(b);var c,d=b.offsetParent,e=b,g=b.ownerDocument,h=g.documentElement,i=g.body,j=g.defaultView,k=j?j.getComputedStyle(b,null):b.currentStyle,l=b.offsetTop,m=b.offsetLeft;while((b=b.parentNode)&&b!==i&&b!==h){if(f.support.fixedPosition&&k.position==="fixed")break;c=j?j.getComputedStyle(b,null):b.currentStyle,l-=b.scrollTop,m-=b.scrollLeft,b===d&&(l+=b.offsetTop,m+=b.offsetLeft,f.support.doesNotAddBorder&&(!f.support.doesAddBorderForTableAndCells||!cw.test(b.nodeName))&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),e=d,d=b.offsetParent),f.support.subtractsBorderForOverflowNotVisible&&c.overflow!=="visible"&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),k=c}if(k.position==="relative"||k.position==="static")l+=i.offsetTop,m+=i.offsetLeft;f.support.fixedPosition&&k.position==="fixed"&&(l+=Math.max(h.scrollTop,i.scrollTop),m+=Math.max(h.scrollLeft,i.scrollLeft));return{top:l,left:m}},f.offset={bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;f.support.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(f.css(a,"marginTop"))||0,c+=parseFloat(f.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var d=f.css(a,"position");d==="static"&&(a.style.position="relative");var e=f(a),g=e.offset(),h=f.css(a,"top"),i=f.css(a,"left"),j=(d==="absolute"||d==="fixed")&&f.inArray("auto",[h,i])>-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cy(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cy(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,d,"padding")):this[d]():null},f.fn["outer"+c]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,d,a?"margin":"border")):this[d]():null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c],h=e.document.body;return e.document.compatMode==="CSS1Compat"&&g||h&&h["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var i=f.css(e,d),j=parseFloat(i);return f.isNumeric(j)?j:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window); \ No newline at end of file diff --git a/pub/js/jquery/jquery-no-conflict.js b/pub/js/jquery/jquery-no-conflict.js new file mode 100644 index 0000000000000000000000000000000000000000..f0bcbcfc9187ad9c9daf601c0e0cef362bb01ea4 --- /dev/null +++ b/pub/js/jquery/jquery-no-conflict.js @@ -0,0 +1,26 @@ +/** + * Magento + * + * 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_AFL.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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category jquery + * @package js + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ + +jQuery.noConflict(); diff --git a/pub/js/lib/dropdown.js b/pub/js/lib/dropdown.js index a7d79cceda67383520cca6f8d7ef2476704f2ad9..acedb6d84cc519615a4cd989a1fe1732e84e77e9 100644 --- a/pub/js/lib/dropdown.js +++ b/pub/js/lib/dropdown.js @@ -19,7 +19,7 @@ * * @category Mage * @package js - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ dropdown = function() { diff --git a/pub/js/lib/flex.js b/pub/js/lib/flex.js index 4ba34b6f91693bd256aa351a61a1c849ba807b53..4317e27759cdf93589dc6726b848714a62b43742 100644 --- a/pub/js/lib/flex.js +++ b/pub/js/lib/flex.js @@ -19,7 +19,7 @@ * * @category Mage * @package js - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/pub/js/mage/adminhtml/accordion.js b/pub/js/mage/adminhtml/accordion.js index b66046777109c662d90635d6fe4728460d8935dd..dbc456691bd34cc6b1ec3b8a7614471ab6f89f43 100644 --- a/pub/js/mage/adminhtml/accordion.js +++ b/pub/js/mage/adminhtml/accordion.js @@ -19,7 +19,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ var varienAccordion = new Class.create(); diff --git a/pub/js/mage/adminhtml/backup.js b/pub/js/mage/adminhtml/backup.js new file mode 100644 index 0000000000000000000000000000000000000000..0b28a2ab0bab4518ddf213dc11b4990c8349bf55 --- /dev/null +++ b/pub/js/mage/adminhtml/backup.js @@ -0,0 +1,189 @@ +/** + * Magento + * + * 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_AFL.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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package Mage_Adminhtml + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +var AdminBackup = new Class.create(); +AdminBackup.prototype = { + initialize : function(a, b){ + this.reset(); + this.rollbackUrl = this.backupUrl = ''; + this.rollbackValidator = new Validation($('rollback-form')); + this.backupValidator = new Validation($('backup-form')); + }, + + reset: function() { + this.time = 0; + this.type = ''; + $('use-ftp-checkbox-row').hide(); + $('use_ftp').checked = false; + $('ftp-credentials-container').hide(); + $('backup_maintenance_mode').checked = false; + $('rollback_maintenance_mode').checked = false; + $('exclude_media').checked = false; + $('password').value = ''; + $('backup_name').value = ''; + $$('.validation-advice').invoke('remove'); + $$('input').invoke('removeClassName', 'validation-failed'); + $$('input').invoke('removeClassName', 'validation-passed'); + $$('.backup-messages').invoke('hide'); + $$('#ftp-credentials-container input').each(function(item) { + item.value = ''; + }); + }, + + backup: function(type) { + this.reset(); + this.type = type; + this.showBackupWarning(); + return false; + }, + + rollback: function(type, time) { + this.reset(); + this.time = time; + this.type = type; + this.showRollbackWarning(); + return false; + }, + + showBackupWarning: function() { + this.showPopup('backup-warning'); + }, + + showRollbackWarning: function() { + this.showPopup('rollback-warning'); + }, + + requestBackupOptions: function() { + this.hidePopups(); + var action = this.type != 'snapshot' ? 'hide' : 'show'; + $$('#exclude-media-checkbox-container').invoke(action); + this.showPopup('backup-options'); + }, + + requestPassword: function() { + this.hidePopups(); + this.type != 'db' ? $('use-ftp-checkbox-row').show() : $('use-ftp-checkbox-row').hide(); + this.showPopup('rollback-request-password'); + }, + + toggleFtpCredentialsForm: function() { + $('use_ftp').checked ? $('ftp-credentials-container').show() + : $('ftp-credentials-container').hide(); + var divId = 'rollback-request-password'; + + $$('#ftp-credentials-container input').each(function(item) { + if (item.name == 'ftp_path') return; + $('use_ftp').checked ? item.addClassName('required-entry') : item.removeClassName('required-entry'); + }); + + $(divId).show().setStyle({ + 'marginTop': -$(divId).getDimensions().height / 2 + 'px' + }); + }, + + submitBackup: function () { + if (!!this.backupValidator && this.backupValidator.validate()) { + this.hidePopups(); + var data = { + 'type': this.type, + 'maintenance_mode': $('backup_maintenance_mode').checked ? 1 : 0, + 'backup_name': $('backup_name').value, + 'exclude_media': $('exclude_media').checked ? 1 : 0 + }; + + new Ajax.Request(this.backupUrl, { + onSuccess: function(transport) { + this.processResponse(transport, 'backup-options'); + }.bind(this), + method: 'post', + parameters: data + }); + } + return false; + }, + + submitRollback: function() { + if (!!this.rollbackValidator && this.rollbackValidator.validate()) { + var data = this.getPostData(); + this.hidePopups(); + new Ajax.Request(this.rollbackUrl, { + onSuccess: function(transport) { + this.processResponse(transport, 'rollback-request-password'); + }.bind(this), + method: 'post', + parameters: data + }); + } + return false; + }, + + processResponse: function(transport, popupId) { + if (!transport.responseText.isJSON()) { + return; + } + + var json = transport.responseText.evalJSON(); + + if (!!json.error) { + this.displayError(popupId, json.error); + this.showPopup(popupId); + return; + } + + if (!!json.redirect_url) { + setLocation(json.redirect_url); + } + }, + + displayError: function(parentContainer, message) { + var messageHtml = this.getErrorMessageHtml(message); + $$('#' + parentContainer + ' .backup-messages .messages').invoke('update', messageHtml); + $$('#' + parentContainer + ' .backup-messages').invoke('show'); + }, + + getErrorMessageHtml: function(message) { + return '<li class="error-msg"><ul><li><span>' + message + '</span></li></ul></li>'; + }, + + getPostData: function() { + var data = $('rollback-form').serialize(true); + data['time'] = this.time; + data['type'] = this.type; + return data; + }, + + showPopup: function(divId) { + $(divId).show().setStyle({ + 'marginTop': -$(divId).getDimensions().height / 2 + 'px' + }); + $('popup-window-mask').setStyle({ + height: $('html-body').getHeight() + 'px' + }).show(); + }, + + hidePopups: function() { + $$('.backup-dialog').each(Element.hide); + $('popup-window-mask').hide(); + } +} diff --git a/pub/js/mage/adminhtml/browser.js b/pub/js/mage/adminhtml/browser.js index 75bcb5589d20cf8dedca39507713b4fe907ffd22..66a841c34158c39f2ba801b88c8ee62e2af466d1 100644 --- a/pub/js/mage/adminhtml/browser.js +++ b/pub/js/mage/adminhtml/browser.js @@ -19,7 +19,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ MediabrowserUtility = { diff --git a/pub/js/mage/adminhtml/events.js b/pub/js/mage/adminhtml/events.js index 3c60a7083ae29cbe59d77b59ca491a2588e66c4e..0908b0db40995c3757221cf906e342914c5fa106 100644 --- a/pub/js/mage/adminhtml/events.js +++ b/pub/js/mage/adminhtml/events.js @@ -19,7 +19,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ // from http://www.someelement.com/2007/03/eventpublisher-custom-events-la-pubsub.html diff --git a/pub/js/mage/adminhtml/fix-extjs-defer-before.js b/pub/js/mage/adminhtml/fix-extjs-defer-before.js new file mode 100644 index 0000000000000000000000000000000000000000..50aa3d0ebaaa0130d7fdcc1e78459d8c1bb58f99 --- /dev/null +++ b/pub/js/mage/adminhtml/fix-extjs-defer-before.js @@ -0,0 +1,42 @@ +/** + * Magento + * + * 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_AFL.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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package js + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +/*@cc_on +// code only for IE7 when ExtJs overwrite "defer" function in PrototypeJs +(function(){ + var last = null; + var ie7 = @if(@_jscript_version==5.7) 1 @end + 0; + if (ie7) { + var eDefer = Function.prototype.defer; + Function.prototype.defer = function() { + // prevent throw stack overflow exception + if (last !== this) { + last = this; + eDefer.apply(last, arguments); + } + return this; + }; + } +})(); +@*/ diff --git a/pub/js/mage/adminhtml/fix-extjs-defer.js b/pub/js/mage/adminhtml/fix-extjs-defer.js index e0cacf19a4f3c266aad55558cc9734cfd0d2dd54..13b95075709d512f17cd25a851dc7a5b52e49d44 100644 --- a/pub/js/mage/adminhtml/fix-extjs-defer.js +++ b/pub/js/mage/adminhtml/fix-extjs-defer.js @@ -15,12 +15,12 @@ * * Do not edit or add to this file if you wish to upgrade Magento to newer * versions in the future. If you wish to customize Magento for your - * needs please refer to http://www.magentocommerce.com for more information. + * needs please refer to http://www.magentocommerce.com for more information. * * @category Mage * @package js - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ (function(){ @@ -32,6 +32,6 @@ return this.delay.curry(0.01).apply(this, arguments); } - return eDefer.apply(this, args); + return eDefer.apply(this, arguments); } })(); \ No newline at end of file diff --git a/pub/js/mage/adminhtml/flexuploader.js b/pub/js/mage/adminhtml/flexuploader.js index ba4c5ee17831875637ce4ea7a91dc6312fde8d45..ab1647d78e704ba745b0979cac8768ded67eb9d7 100644 --- a/pub/js/mage/adminhtml/flexuploader.js +++ b/pub/js/mage/adminhtml/flexuploader.js @@ -19,7 +19,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/pub/js/mage/adminhtml/form.js b/pub/js/mage/adminhtml/form.js index 36ecd49cd352e651af1f2bc9d326f9a482134921..4b5a657ad09ebd81df355ed76b337d3fabf3dbe0 100644 --- a/pub/js/mage/adminhtml/form.js +++ b/pub/js/mage/adminhtml/form.js @@ -19,7 +19,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ var varienForm = new Class.create(); @@ -231,7 +231,8 @@ RegionUpdater.prototype = { option = document.createElement('OPTION'); option.value = regionId; - option.text = region.name; + option.text = region.name.stripTags(); + option.title = region.name; if (this.regionSelectEl.options.add) { this.regionSelectEl.options.add(option); @@ -387,7 +388,6 @@ SelectUpdater.prototype = { /** * Observer that watches for dependent form elements * If an element depends on 1 or more of other elements, it should show up only when all of them gain specified values - * TODO: implement multiple values per "master" elements */ FormElementDependenceController = Class.create(); FormElementDependenceController.prototype = { @@ -396,6 +396,7 @@ FormElementDependenceController.prototype = { * 'id_of_dependent_element' : { * 'id_of_master_element_1' : 'reference_value', * 'id_of_master_element_2' : 'reference_value' + * 'id_of_master_element_3' : ['reference_value1', 'reference_value2'] * ... * } * } @@ -441,8 +442,14 @@ FormElementDependenceController.prototype = { var shouldShowUp = true; for (var idFrom in valuesFrom) { var from = $(idFrom); - if (!from || from.value != valuesFrom[idFrom]) { - shouldShowUp = false; + if (valuesFrom[idFrom] instanceof Array) { + if (!from || valuesFrom[idFrom].indexOf(from.value) == -1) { + shouldShowUp = false; + } + } else { + if (!from || from.value != valuesFrom[idFrom]) { + shouldShowUp = false; + } } } diff --git a/pub/js/mage/adminhtml/grid.js b/pub/js/mage/adminhtml/grid.js index 343983f887590db5c0679f49daa96b6f2184383e..36cbd7932e8deaa5a314274b2a8412e8f24a85dd 100644 --- a/pub/js/mage/adminhtml/grid.js +++ b/pub/js/mage/adminhtml/grid.js @@ -19,7 +19,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ var varienGrid = new Class.create(); @@ -240,20 +240,27 @@ varienGrid.prototype = { _processFailure : function(transport){ location.href = BASE_URL; }, - addVarToUrl : function(varName, varValue){ + _addVarToUrl : function(url, varName, varValue){ var re = new RegExp('\/('+varName+'\/.*?\/)'); - var parts = this.url.split(new RegExp('\\?')); - this.url = parts[0].replace(re, '/'); - this.url+= varName+'/'+varValue+'/'; + var parts = url.split(new RegExp('\\?')); + url = parts[0].replace(re, '/'); + url+= varName+'/'+varValue+'/'; if(parts.size()>1) { - this.url+= '?' + parts[1]; + url+= '?' + parts[1]; } - //this.url = this.url.replace(/([^:])\/{2,}/g, '$1/'); + return url; + }, + addVarToUrl : function(varName, varValue){ + this.url = this._addVarToUrl(this.url, varName, varValue); return this.url; }, doExport : function(){ if($(this.containerId+'_export')){ - location.href = $(this.containerId+'_export').value; + var exportUrl = $(this.containerId+'_export').value; + if(this.massaction && this.massaction.checkedString) { + exportUrl = this._addVarToUrl(exportUrl, this.massaction.formFieldNameInternal, this.massaction.checkedString); + } + location.href = exportUrl; } }, bindFilterFields : function(){ @@ -353,6 +360,7 @@ varienGridMassaction.prototype = { this.useAjax = false; this.grid = grid; + this.grid.massaction = this; this.containerId = containerId; this.initMassactionElements(); diff --git a/pub/js/mage/adminhtml/image.js b/pub/js/mage/adminhtml/image.js index c3ac5016910ad02e992d207fe89c5154b8e836cb..ed9bda38a1b480a2953bf771c82762a0a2e7c187 100644 --- a/pub/js/mage/adminhtml/image.js +++ b/pub/js/mage/adminhtml/image.js @@ -19,7 +19,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/pub/js/mage/adminhtml/loader.js b/pub/js/mage/adminhtml/loader.js index 77306878aa4f219d4940893b209eb667fc8a52cc..9291bf093233d55d1a1c3c2a68e1db7a9c8f824e 100644 --- a/pub/js/mage/adminhtml/loader.js +++ b/pub/js/mage/adminhtml/loader.js @@ -19,7 +19,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/pub/js/mage/adminhtml/tabs.js b/pub/js/mage/adminhtml/tabs.js index 4aafd1f1b30b1de32004c6d891007568169d4649..702953b2e1b95eaa4c947d60c8056f611581938b 100644 --- a/pub/js/mage/adminhtml/tabs.js +++ b/pub/js/mage/adminhtml/tabs.js @@ -19,7 +19,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ var varienTabs = new Class.create(); diff --git a/pub/js/mage/adminhtml/tools.js b/pub/js/mage/adminhtml/tools.js index cf3d3975e97c6075eac5f211aff6dd1fdfd3949b..89478f8a14843afb47490600bfab4c3f8c98631a 100644 --- a/pub/js/mage/adminhtml/tools.js +++ b/pub/js/mage/adminhtml/tools.js @@ -19,7 +19,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ function setLocation(url){ diff --git a/pub/js/mage/adminhtml/uploader.js b/pub/js/mage/adminhtml/uploader.js index 913d3ab1d72a17e2a130cf8510a637212e2afcce..b68b178ecb28694257069e7e9bfc7318fa3bd991 100644 --- a/pub/js/mage/adminhtml/uploader.js +++ b/pub/js/mage/adminhtml/uploader.js @@ -19,7 +19,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /** diff --git a/pub/js/mage/adminhtml/wysiwyg/tiny_mce/plugins/magentovariable/editor_plugin.js b/pub/js/mage/adminhtml/wysiwyg/tiny_mce/plugins/magentovariable/editor_plugin.js index 60f8971a237826b933048cf9ba9a7f962272e141..4ad98c88ec5ae9535fc6459064f7a6c2fa764e7d 100644 --- a/pub/js/mage/adminhtml/wysiwyg/tiny_mce/plugins/magentovariable/editor_plugin.js +++ b/pub/js/mage/adminhtml/wysiwyg/tiny_mce/plugins/magentovariable/editor_plugin.js @@ -19,7 +19,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/pub/js/mage/adminhtml/wysiwyg/tiny_mce/plugins/magentowidget/editor_plugin.js b/pub/js/mage/adminhtml/wysiwyg/tiny_mce/plugins/magentowidget/editor_plugin.js index 7519bd879cef1ad50eb7e8beee812655c5a65d34..7154fcfcdec033bcbbbd95ebf2364e7c29929f06 100644 --- a/pub/js/mage/adminhtml/wysiwyg/tiny_mce/plugins/magentowidget/editor_plugin.js +++ b/pub/js/mage/adminhtml/wysiwyg/tiny_mce/plugins/magentowidget/editor_plugin.js @@ -19,7 +19,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ tinyMCE.addI18n({en:{ diff --git a/pub/js/mage/adminhtml/wysiwyg/tiny_mce/setup.js b/pub/js/mage/adminhtml/wysiwyg/tiny_mce/setup.js index e4500d84fc7d0ecaa8df25abe56630d7e9ecd833..7e4a5621da773ce616f2d394ae4dd7730befb119 100644 --- a/pub/js/mage/adminhtml/wysiwyg/tiny_mce/setup.js +++ b/pub/js/mage/adminhtml/wysiwyg/tiny_mce/setup.js @@ -19,7 +19,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/pub/js/mage/adminhtml/wysiwyg/tiny_mce/themes/advanced/skins/default/content.css b/pub/js/mage/adminhtml/wysiwyg/tiny_mce/themes/advanced/skins/default/content.css index 08b0098a15faed005597d9008c9734694fd1c41e..1728f5b539969e84da7b59e497684c5619443660 100644 --- a/pub/js/mage/adminhtml/wysiwyg/tiny_mce/themes/advanced/skins/default/content.css +++ b/pub/js/mage/adminhtml/wysiwyg/tiny_mce/themes/advanced/skins/default/content.css @@ -19,7 +19,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/pub/js/mage/adminhtml/wysiwyg/tiny_mce/themes/advanced/skins/default/dialog.css b/pub/js/mage/adminhtml/wysiwyg/tiny_mce/themes/advanced/skins/default/dialog.css index cf23ae03988ba046ce6c4617a63e0a149550c471..8fb1c3a8468d4912e783575d910c7b8a28f5c1e1 100644 --- a/pub/js/mage/adminhtml/wysiwyg/tiny_mce/themes/advanced/skins/default/dialog.css +++ b/pub/js/mage/adminhtml/wysiwyg/tiny_mce/themes/advanced/skins/default/dialog.css @@ -19,7 +19,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/pub/js/mage/adminhtml/wysiwyg/widget.js b/pub/js/mage/adminhtml/wysiwyg/widget.js index 510a7b469b72660fcb5233fcfe590b0d408b1934..286acb6e4bdb46a4299f7bf53281fa96b0057f3e 100644 --- a/pub/js/mage/adminhtml/wysiwyg/widget.js +++ b/pub/js/mage/adminhtml/wysiwyg/widget.js @@ -19,7 +19,7 @@ * * @category Mage * @package Mage_Adminhtml - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ @@ -51,7 +51,7 @@ var widgetTools = { closable:true, className:'magento', windowClassName:"popup-window", - title:'Insert Widget', + title:Translator.translate('Insert Widget...'), top:50, width:950, //height:450, @@ -88,7 +88,9 @@ WysiwygWidget.Widget.prototype = { this.optionsUrl = optionsSourceUrl; this.optionValues = new Hash({}); this.widgetTargetId = widgetTargetId; - this.bMark = tinyMCE.activeEditor.selection.getBookmark(); + if (typeof(tinyMCE) != "undefined" && tinyMCE.activeEditor) { + this.bMark = tinyMCE.activeEditor.selection.getBookmark(); + } Event.observe(this.widgetEl, "change", this.loadOptions.bind(this)); @@ -233,8 +235,12 @@ WysiwygWidget.Widget.prototype = { widgetTools.onAjaxSuccess(transport); Windows.close("widget_window"); - tinyMCE.activeEditor.focus(); - tinyMCE.activeEditor.selection.moveToBookmark(this.bMark); + if (typeof(tinyMCE) != "undefined" && tinyMCE.activeEditor) { + tinyMCE.activeEditor.focus(); + if (this.bMark) { + tinyMCE.activeEditor.selection.moveToBookmark(this.bMark); + } + } this.updateContent(transport.responseText); } catch(e) { diff --git a/pub/js/mage/captcha.js b/pub/js/mage/captcha.js new file mode 100644 index 0000000000000000000000000000000000000000..7d90c3117e61853fa72078d01038248fdbb4f37f --- /dev/null +++ b/pub/js/mage/captcha.js @@ -0,0 +1,87 @@ +/** + * Magento + * + * 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_AFL.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@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Mage + * @package js + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +var Captcha = Class.create(); +Captcha.prototype = { + initialize: function(url, formId){ + this.url = url; + this.formId = formId; + }, + refresh: function(elem) { + formId = this.formId; + if (elem) Element.addClassName(elem, 'refreshing'); + new Ajax.Request(this.url, { + onSuccess: function (response) { + if (response.responseText.isJSON()) { + var json = response.responseText.evalJSON(); + if (!json.error && json.imgSrc) { + $(formId).writeAttribute('src', json.imgSrc); + if (elem) Element.removeClassName(elem, 'refreshing'); + } else { + if (elem) Element.removeClassName(elem, 'refreshing'); + } + } + }, + method: 'post', + parameters: { + 'formId' : this.formId + } + }); + } +}; + +document.observe('billing-request:completed', function(event){ + if (window.checkout !== undefined){ + if (window.checkout.method == 'guest' && $('guest_checkout')){ + window.captcha_guest_checkout.refresh() + } + if (window.checkout !== undefined && window.checkout.method== 'register' && $('register_during_checkout')){ + window.captcha_register_during_checkout.refresh() + } + } +}); + + +document.observe('login:setMethod', function(event){ + switch(event.memo.method){ + case 'guest': + if ($('register_during_checkout')) { + $('captcha-input-box-register_during_checkout').hide(); + $('captcha-image-box-register_during_checkout').hide(); + $('captcha-input-box-guest_checkout').show(); + $('captcha-image-box-guest_checkout').show(); + + } + break; + case 'register': + if ($('guest_checkout')) { + $('captcha-input-box-guest_checkout').hide(); + $('captcha-image-box-guest_checkout').hide(); + $('captcha-input-box-register_during_checkout').show(); + $('captcha-image-box-register_during_checkout').show(); + + } + break; + } +}); diff --git a/pub/js/mage/directpost.js b/pub/js/mage/directpost.js index 4c521b8eb8f0f931c96d5c0e00dcf6ecb509beb7..e62fee2973bd0e652b4b63c012a7629629c0f6c9 100644 --- a/pub/js/mage/directpost.js +++ b/pub/js/mage/directpost.js @@ -19,7 +19,7 @@ * * @category Mage * @package js - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ var directPost = Class.create(); diff --git a/pub/js/mage/translate.js b/pub/js/mage/translate.js index 78b29263a031508a7d2608688e4dd915aab246c7..6bf101e96d59d53f4ad4ee5f49e7fa0a47d527c8 100644 --- a/pub/js/mage/translate.js +++ b/pub/js/mage/translate.js @@ -19,7 +19,7 @@ * * @category Mage * @package js - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/pub/js/mage/translate_inline.css b/pub/js/mage/translate_inline.css index 9d1f035f7ef315f11c187df9e96a9fd5cf1e722b..dbd742b2d480cb5ea2df94dd140889b86b276494 100644 --- a/pub/js/mage/translate_inline.css +++ b/pub/js/mage/translate_inline.css @@ -19,11 +19,13 @@ * * @category Mage * @package js - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ -.translate-inline { /* background:black; font-weight:bold; color:red; */ border:dotted 1px red;} +.translate-inline { /* background:black; font-weight:bold; color:red; */ outline: dotted 1px red!important;} +* html .translate-inline, +*+html .translate-inline{ border: dotted 1px red !important;} .translate-inline-script, .translate-inline-title { background:yellow; color:black; font-weight:bold; } #translate-inline-trig { position:absolute;left:-1000px; opacity:.8; filter:alpha(opacity=80); cursor:pointer; margin-top:10px; z-index:1000;} diff --git a/pub/js/mage/translate_inline.js b/pub/js/mage/translate_inline.js index bd64cb61ed822c62f5e987a92a1385bbf462f584..c78c6255731e105bdaf1450b1344f26979fde095 100644 --- a/pub/js/mage/translate_inline.js +++ b/pub/js/mage/translate_inline.js @@ -19,7 +19,7 @@ * * @category Mage * @package js - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ @@ -59,16 +59,18 @@ TranslateInline.prototype = { $$('*[translate]').each(this.initializeElement.bind(this)); }, - trigShow: function (el) { - this.trigHideClear(); + trigShow: function (el, event) { + if (this.trigContentEl != el) { + this.trigHideClear(); + this.trigContentEl = el; - var p = Element.cumulativeOffset(el); + var p = Element.cumulativeOffset(el); - this.trigEl.style.left = p[0]+'px'; - this.trigEl.style.top = p[1]+'px'; - this.trigEl.style.display = 'block'; - - this.trigContentEl = el; + this.trigEl.style.left = p[0]+'px'; + this.trigEl.style.top = p[1]+'px'; + this.trigEl.style.display = 'block'; + Event.stop(event); + }; }, trigHide: function() { diff --git a/pub/js/prototype/prototype.js b/pub/js/prototype/prototype.js index 0f36ae577678bd338d4bd2d4887a44e3b8768a37..474b2231bbdd2b9756ae0a4cf62c20496695e891 100644 --- a/pub/js/prototype/prototype.js +++ b/pub/js/prototype/prototype.js @@ -5830,7 +5830,7 @@ Form.EventObserver = Class.create(Abstract.EventObserver, { function pollDoScroll() { try { document.documentElement.doScroll('left'); } catch(e) { - timer = this.defer(); + timer = pollDoScroll.defer(); return; } fireContentLoadedEvent(); diff --git a/pub/js/prototype/validation.js b/pub/js/prototype/validation.js index 8765876f7aa103c83562dda88ebb8050f62b40ea..92dd31ff0543c8336819b4b8dc5d0d46086f1234 100644 --- a/pub/js/prototype/validation.js +++ b/pub/js/prototype/validation.js @@ -408,7 +408,7 @@ Object.extend(Validation, { }); Validation.add('IsEmpty', '', function(v) { - return (v == '' || (v == null) || (v.length == 0) || /^\s+$/.test(v)); // || /^\s+$/.test(v)); + return (v == '' || (v == null) || (v.length == 0) || /^\s+$/.test(v)); }); Validation.addAllThese([ @@ -421,8 +421,33 @@ Validation.addAllThese([ ['required-entry', 'This is a required field.', function(v) { return !Validation.get('IsEmpty').test(v); }], - ['validate-number', 'Please enter a valid number in this field.', function(v) { - return Validation.get('IsEmpty').test(v) || (!isNaN(parseNumber(v)) && !/^\s+$/.test(parseNumber(v))); + ['validate-number', 'Please enter a valid number in this field.', function(v, elm) { + if (elm.hasClassName('required-entry') && !Validation.get('required-entry').test(v)) { + return true; // hardcode, should be achieved by CSS classes ordering + } + + return !Validation.get('IsEmpty').test(v) + && !isNaN(parseNumber(v)) && /^\s*-?\d*([.,]\d*)?\s*$/.test(v); + }], + ['validate-number-range', 'The value is not within the specified range.', function(v, elm) { + var numValue = parseNumber(v); + if (Validation.get('IsEmpty').test(v) || isNaN(numValue)) { + return false; + } + + var reRange = /^number-range-([-\d.,]+)-([-\d.,]+)$/, + result = true; + + $w(elm.className).each(function(name) { + var m = reRange.exec(name), min, max; + if (m) { + min = parseNumber(m[1]); + max = parseNumber(m[2]); + result = result && numValue >= min && numValue <= max; + } + }); + + return result; }], ['validate-digits', 'Please use numbers only in this field. Please avoid spaces or other characters such as dots or commas.', function(v) { return Validation.get('IsEmpty').test(v) || !/[^\d]/.test(v); @@ -449,6 +474,9 @@ Validation.addAllThese([ ['validate-alphanum', 'Please use only letters (a-z or A-Z) or numbers (0-9) only in this field. No spaces or other characters are allowed.', function(v) { return Validation.get('IsEmpty').test(v) || /^[a-zA-Z0-9]+$/.test(v) /*!/\W/.test(v)*/ }], + ['validate-alphanum-with-spaces', 'Please use only letters (a-z or A-Z), numbers (0-9) or spaces only in this field.', function(v) { + return Validation.get('IsEmpty').test(v) || /^[a-zA-Z0-9 ]+$/.test(v) /*!/\W/.test(v)*/ + }], ['validate-street', 'Please use only letters (a-z or A-Z) or numbers (0-9) or spaces and # only in this field.', function(v) { return Validation.get('IsEmpty').test(v) || /^[ \w]{3,}([A-Za-z]\.)?([ \w]*\#\d+)?(\r\n| )[ \w]{3,}/.test(v) }], @@ -571,14 +599,17 @@ Validation.addAllThese([ return false; } }], - ['validate-not-negative-number', 'Please enter a valid number in this field.', function(v) { + ['validate-not-negative-number', 'Please enter a valid number in this field.', function(v, elm) { + if (elm.hasClassName('required-entry') && !Validation.get('required-entry').test(v)) { + return true; // hardcode, should be achieved by CSS classes ordering + } + v = parseNumber(v); - return (!isNaN(v) && v>=0); + return !isNaN(v) && v>=0; }], ['validate-state', 'Please select State/Province.', function(v) { return (v!=0 || v == ''); }], - ['validate-new-password', 'Please enter 6 or more characters. Leading or trailing spaces will be ignored.', function(v) { if (!Validation.get('validate-password').test(v)) return false; if (Validation.get('IsEmpty').test(v) && v != '') return false; @@ -586,13 +617,13 @@ Validation.addAllThese([ }], ['validate-greater-than-zero', 'Please enter a number greater than 0 in this field.', function(v) { if(v.length) - return parseFloat(v) > 0; + return parseNumber(v) > 0; else return true; }], ['validate-zero-or-greater', 'Please enter a number 0 or greater in this field.', function(v) { if(v.length) - return parseFloat(v) >= 0; + return parseNumber(v) >= 0; else return true; }], diff --git a/pub/js/varien/configurable.js b/pub/js/varien/configurable.js index b0851b09d0487baec8510c09c3059bc41a892633..68baf730baeaa7d394ddee1cd4e15835b61b6841 100644 --- a/pub/js/varien/configurable.js +++ b/pub/js/varien/configurable.js @@ -19,7 +19,7 @@ * * @category Varien * @package js - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ if (typeof Product == 'undefined') { diff --git a/pub/js/varien/form.js b/pub/js/varien/form.js index 6934c9252a9da30e79e19f84753cb93a8041c8a1..be90e86bf88639519a46be072ea70908d1348e96 100644 --- a/pub/js/varien/form.js +++ b/pub/js/varien/form.js @@ -19,7 +19,7 @@ * * @category Varien * @package js - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ VarienForm = Class.create(); @@ -199,7 +199,8 @@ RegionUpdater.prototype = { option = document.createElement('OPTION'); option.value = regionId; - option.text = region.name; + option.text = region.name.stripTags(); + option.title = region.name; if (this.regionSelectEl.options.add) { this.regionSelectEl.options.add(option); diff --git a/pub/js/varien/js.js b/pub/js/varien/js.js index 4ef1f772ce0063d99bea3a678a9b29b9e24a5725..a6b67f6c5eecaf680c900bffb1ed602d6a2282ae 100644 --- a/pub/js/varien/js.js +++ b/pub/js/varien/js.js @@ -19,7 +19,7 @@ * * @category Varien * @package js - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ function popWin(url,win,para) { @@ -654,17 +654,16 @@ if (!("console" in window) || !("firebug" in console)) * * @example fireEvent($('my-input', 'click')); */ -function fireEvent(element, event){ - if (document.createEventObject){ - // dispatch for IE - var evt = document.createEventObject(); - return element.fireEvent('on'+event,evt) - } - else{ - // dispatch for firefox + others +function fireEvent(element, event) { + if (document.createEvent) { + // dispatch for all browsers except IE before version 9 var evt = document.createEvent("HTMLEvents"); - evt.initEvent(event, true, true ); // event type,bubbling,cancelable - return !element.dispatchEvent(evt); + evt.initEvent(event, true, true ); // event type, bubbling, cancelable + return element.dispatchEvent(evt); + } else { + // dispatch for IE before version 9 + var evt = document.createEventObject(); + return element.fireEvent('on' + event, evt) } } @@ -681,4 +680,4 @@ if ((typeof Range != "undefined") && !Range.prototype.createContextualFragment) div.outerHTML = html; return frag; }; -} \ No newline at end of file +} diff --git a/pub/js/varien/product.js b/pub/js/varien/product.js index a3efa6bbaca4800797cae3ec5d69e9ea5876aa4b..dd1c43fa0e62f1146f60cd681d8d51ac2a1598e1 100644 --- a/pub/js/varien/product.js +++ b/pub/js/varien/product.js @@ -19,7 +19,7 @@ * * @category Varien * @package js - * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com) + * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ if(typeof Product=='undefined') { @@ -491,7 +491,8 @@ Product.Config.prototype = { for(var i=this.settings.length-1;i>=0;i--){ var selected = this.settings[i].options[this.settings[i].selectedIndex]; if(selected.config){ - price+= parseFloat(selected.config.price); + var parsedOldPrice = parseFloat(selected.config.oldPrice); + price += isNaN(parsedOldPrice) ? 0 : parsedOldPrice; } } if (price < 0) @@ -572,8 +573,11 @@ Product.OptionsPrice.prototype = { this.oldMinusDisposition = config.oldMinusDisposition; this.minusDisposition = config.minusDisposition; - this.optionPrices = {}; - this.containers = {}; + this.exclDisposition = config.exclDisposition; + + this.optionPrices = {}; + this.customPrices = {}; + this.containers = {}; this.displayZeroPrice = true; @@ -596,6 +600,9 @@ Product.OptionsPrice.prototype = { this.optionPrices[key] = price; }, + addCustomPrices: function(key, price) { + this.customPrices[key] = price; + }, getOptionPrices: function() { var price = 0; var nonTaxable = 0; @@ -657,6 +664,20 @@ Product.OptionsPrice.prototype = { _priceInclTax += parseFloat(_productPrice) * (100 + this.currentTax) / 100; } + var subPrice = 0; + var subPriceincludeTax = 0; + Object.values(this.customPrices).each(function(el){ + if (el.excludeTax && el.includeTax) { + subPrice += el.excludeTax; + subPriceincludeTax += el.includeTax; + } else { + subPrice += el.price; + subPriceincludeTax += el.price; + } + }); + price += subPrice; + _priceInclTax += subPriceincludeTax; + if (this.specialTaxPrice == 'true') { var excl = price; var incl = _priceInclTax; @@ -671,7 +692,10 @@ Product.OptionsPrice.prototype = { var incl = excl + tax; } - excl += parseFloat(_plusDisposition); + if (typeof this.exclDisposition == 'undefined') { + excl += parseFloat(_plusDisposition); + } + incl += parseFloat(_plusDisposition) + parseFloat(this.plusDispositionTax); excl -= parseFloat(_minusDisposition); incl -= parseFloat(_minusDisposition); @@ -735,7 +759,8 @@ Product.OptionsPrice.prototype = { }; var container = $(this.containers[3]) ? this.containers[3] : this.containers[0]; var price = parsePrice($(container).innerHTML); - var tierPrice = parsePrice($$('.price.tier-' + i)[0].innerHTML); + var tierPrice = $$('.price.tier-' + i); + tierPrice = tierPrice.length ? parseInt(tierPrice[0].innerHTML, 10) : 0; var $percent = Selector.findChildElements(el, ['.percent.tier-' + i]); $percent.each(function (el) { el.innerHTML = Math.ceil(100 - ((100 / price) * tierPrice));