From b4e09013e866d1a0f126fdeed6b9c93197a11fe9 Mon Sep 17 00:00:00 2001 From: Tom Klingenberg Date: Thu, 14 Jan 2016 16:16:01 +0100 Subject: [PATCH 01/67] Streamline database port with Magento Setup Model Installer throw exception when port is set within a parameter of it's own. the (optional) database port is to be set within the host parameter and not within the port parameter. --- .../Framework/DB/Adapter/Pdo/Mysql.php | 6 +++++ .../DB/Test/Unit/Adapter/Pdo/MysqlTest.php | 27 +++++++++++++++++++ .../Model/ResourceModel/Type/Db/Pdo/Mysql.php | 7 +++++ .../Test/Unit/Validator/DbValidatorTest.php | 3 ++- 4 files changed, 42 insertions(+), 1 deletion(-) diff --git a/lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php b/lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php index d5a5aa20d2961..6aa735ff1c6c6 100644 --- a/lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php +++ b/lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php @@ -329,6 +329,12 @@ protected function _connect() throw new \Zend_Db_Adapter_Exception('No host configured to connect'); } + if (isset($this->_config['port'])) { + throw new \Zend_Db_Adapter_Exception('Port must be configured within host parameter'); + } + + unset($this->_config['port']); + if (strpos($this->_config['host'], '/') !== false) { $this->_config['unix_socket'] = $this->_config['host']; unset($this->_config['host']); diff --git a/lib/internal/Magento/Framework/DB/Test/Unit/Adapter/Pdo/MysqlTest.php b/lib/internal/Magento/Framework/DB/Test/Unit/Adapter/Pdo/MysqlTest.php index 0d52fca446f36..18c522cf67193 100644 --- a/lib/internal/Magento/Framework/DB/Test/Unit/Adapter/Pdo/MysqlTest.php +++ b/lib/internal/Magento/Framework/DB/Test/Unit/Adapter/Pdo/MysqlTest.php @@ -14,6 +14,8 @@ use Magento\Framework\DB\Adapter\AdapterInterface; use Magento\Framework\DB\Select; use Magento\Framework\DB\Select\SelectRenderer; +use Magento\Framework\Model\ResourceModel\Type\Db\Pdo\Mysql; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; class MysqlTest extends \PHPUnit_Framework_TestCase { @@ -523,4 +525,29 @@ public function getIndexNameDataProvider() ['short_table_name', ['field1', 'field2'], '', 'SHORT_TABLE_NAME_FIELD1_FIELD2'], ]; } + + /** + * @test + */ + public function connectPortThrow() + { + $arguments = [ + 'config' => ['host' => 'localhost'], + ]; + $subject = (new ObjectManager($this))->getObject(Mysql::class, $arguments); + $this->assertInstanceOf(Mysql::class, $subject); + + $arguments = [ + 'config' => ['host' => 'localhost', 'port' => '33390'], + ]; + + try { + (new ObjectManager($this))->getObject(Mysql::class, $arguments); + $this->fail('an expected exception was not thrown'); + } catch (\InvalidArgumentException $e) { + $expected = 'MySQL adapter: Port must be configured within host (like \'localhost:33390\') ' . + 'parameter, not within port'; + $this->assertSame($expected, $e->getMessage()); + } + } } diff --git a/lib/internal/Magento/Framework/Model/ResourceModel/Type/Db/Pdo/Mysql.php b/lib/internal/Magento/Framework/Model/ResourceModel/Type/Db/Pdo/Mysql.php index 735b0b7f23b5d..2cf976b79688b 100644 --- a/lib/internal/Magento/Framework/Model/ResourceModel/Type/Db/Pdo/Mysql.php +++ b/lib/internal/Magento/Framework/Model/ResourceModel/Type/Db/Pdo/Mysql.php @@ -114,6 +114,13 @@ private function getValidConfig(array $config) } } + if (isset($config['port'])) { + throw new \InvalidArgumentException( + "MySQL adapter: Port must be configured within host (like '$config[host]:$config[port]') parameter, " . + "not within port" + ); + } + $config['active'] = !( $config['active'] === 'false' || $config['active'] === false diff --git a/setup/src/Magento/Setup/Test/Unit/Validator/DbValidatorTest.php b/setup/src/Magento/Setup/Test/Unit/Validator/DbValidatorTest.php index ba614172c0b7c..792ce47504017 100644 --- a/setup/src/Magento/Setup/Test/Unit/Validator/DbValidatorTest.php +++ b/setup/src/Magento/Setup/Test/Unit/Validator/DbValidatorTest.php @@ -38,7 +38,7 @@ protected function setUp() public function testCheckDatabaseConnection() { $this->connection - ->expects($this->once()) + ->expects($this->exactly(2)) ->method('fetchOne') ->with('SELECT version()') ->willReturn('5.6.0-0ubuntu0.12.04.1'); @@ -79,6 +79,7 @@ public function testCheckDatabaseConnection() ] ); $this->assertEquals(true, $this->dbValidator->checkDatabaseConnection('name', 'host', 'user', 'password')); + $this->assertEquals(true, $this->dbValidator->checkDatabaseConnection('name', 'host:3339', 'user', 'password')); } /** From 97a93134ca31ec11f4873fcaf57444c6ea16f4bc Mon Sep 17 00:00:00 2001 From: Viktor Paladiychuk Date: Fri, 8 Apr 2016 19:25:44 +0300 Subject: [PATCH 02/67] MAGETWO-49175: Wrong behavior of "Client side less compilation" type --- .../ClientSideLessCompilation/Renderer.php | 38 +++++--------- .../Framework/View/Asset/AssetInterface.php | 7 +++ .../Magento/Framework/View/Asset/File.php | 10 ++++ .../Magento/Framework/View/Asset/Remote.php | 8 +++ .../Magento/Framework/View/Asset/Source.php | 16 ++++++ .../Framework/View/Page/Config/Renderer.php | 50 +++++++++++++------ 6 files changed, 88 insertions(+), 41 deletions(-) diff --git a/app/code/Magento/Developer/Model/View/Page/Config/ClientSideLessCompilation/Renderer.php b/app/code/Magento/Developer/Model/View/Page/Config/ClientSideLessCompilation/Renderer.php index 575b1d32840d4..f30026b993e2f 100644 --- a/app/code/Magento/Developer/Model/View/Page/Config/ClientSideLessCompilation/Renderer.php +++ b/app/code/Magento/Developer/Model/View/Page/Config/ClientSideLessCompilation/Renderer.php @@ -54,13 +54,19 @@ public function __construct( */ protected function addDefaultAttributes($contentType, $attributes) { + $rel = ''; switch ($contentType) { + case 'less': + $rel = 'stylesheet/less'; + break; case 'css': - return ' rel="stylesheet/less" type="text/css" ' . ($attributes ?: ' media="all"'); + $rel = 'stylesheet'; break; - } + if ($rel) { + return ' rel="' . $rel . '" type="text/css" ' . ($attributes ?: ' media="all"'); + } return parent::addDefaultAttributes($contentType, $attributes); } @@ -95,32 +101,14 @@ private function renderLessJsScripts($resultGroups) } /** - * Render HTML tags referencing corresponding URLs + * Get asset content type * - * @param string $template - * @param array $assets + * @param \Magento\Framework\View\Asset\AssetInterface|\Magento\Framework\View\Asset\File $asset * @return string */ - protected function renderAssetHtml($template, $assets) + protected function getAssetContentType(\Magento\Framework\View\Asset\AssetInterface $asset) { - $result = ''; - try { - foreach ($assets as $asset) { - /** @var $asset \Magento\Framework\View\Asset\File */ - if ($asset instanceof \Magento\Framework\View\Asset\File - && $asset->getSourceUrl() != $asset->getUrl() - ) { - $attributes = $this->addDefaultAttributes('less', []); - $groupTemplate = $this->getAssetTemplate($asset->getContentType(), $attributes); - $result .= sprintf($groupTemplate, $asset->getSourceUrl()); - } else { - $result .= sprintf($template, $asset->getUrl()); - } - } - } catch (\Magento\Framework\Exception\LocalizedException $e) { - $this->logger->critical($e); - $result .= sprintf($template, $this->urlBuilder->getUrl('', ['_direct' => 'core/index/notFound'])); - } - return $result; + $asset->getSourceFile(); + return parent::getAssetContentType($asset); } } diff --git a/lib/internal/Magento/Framework/View/Asset/AssetInterface.php b/lib/internal/Magento/Framework/View/Asset/AssetInterface.php index 4569da67f8e9c..efeca084654e4 100644 --- a/lib/internal/Magento/Framework/View/Asset/AssetInterface.php +++ b/lib/internal/Magento/Framework/View/Asset/AssetInterface.php @@ -23,4 +23,11 @@ public function getUrl(); * @return string */ public function getContentType(); + + /** + * Retrieve source content type + * + * @return string + */ + public function getSourceContentType(); } diff --git a/lib/internal/Magento/Framework/View/Asset/File.php b/lib/internal/Magento/Framework/View/Asset/File.php index 979c996e1ea94..98168576f687c 100644 --- a/lib/internal/Magento/Framework/View/Asset/File.php +++ b/lib/internal/Magento/Framework/View/Asset/File.php @@ -155,6 +155,16 @@ public function getSourceFile() return $this->resolvedFile; } + /** + * Get source content type + * + * @return string + */ + public function getSourceContentType() + { + return $this->source->getSourceContentType(); + } + /** * {@inheritdoc} */ diff --git a/lib/internal/Magento/Framework/View/Asset/Remote.php b/lib/internal/Magento/Framework/View/Asset/Remote.php index ef847f5738f1d..720f75d1e0639 100644 --- a/lib/internal/Magento/Framework/View/Asset/Remote.php +++ b/lib/internal/Magento/Framework/View/Asset/Remote.php @@ -51,4 +51,12 @@ public function getContentType() { return $this->contentType; } + + /** + * {@inheritdoc} + */ + public function getSourceContentType() + { + return $this->getContentType(); + } } diff --git a/lib/internal/Magento/Framework/View/Asset/Source.php b/lib/internal/Magento/Framework/View/Asset/Source.php index a2dced1646ab5..f73f5217febae 100644 --- a/lib/internal/Magento/Framework/View/Asset/Source.php +++ b/lib/internal/Magento/Framework/View/Asset/Source.php @@ -58,6 +58,11 @@ class Source */ private $readFactory; + /** + * @var string + */ + private $sourceContentType; + /** * Constructor * @@ -141,6 +146,7 @@ private function preProcess(LocalInterface $asset) } $chain = $this->createChain($asset, $dir, $path); + $this->sourceContentType = $chain->getContentType(); $this->preProcessorPool->process($chain); $chain->assertValid(); if ($chain->isChanged()) { @@ -156,6 +162,16 @@ private function preProcess(LocalInterface $asset) return $result; } + /** + * Get source content type + * + * @return string + */ + public function getSourceContentType() + { + return $this->sourceContentType; + } + /** * @param LocalInterface $asset * @return bool|string diff --git a/lib/internal/Magento/Framework/View/Page/Config/Renderer.php b/lib/internal/Magento/Framework/View/Page/Config/Renderer.php index a52291edd23ab..98367238fbd39 100644 --- a/lib/internal/Magento/Framework/View/Page/Config/Renderer.php +++ b/lib/internal/Magento/Framework/View/Page/Config/Renderer.php @@ -236,19 +236,7 @@ public function renderAssets($resultGroups = []) */ protected function renderAssetGroup(\Magento\Framework\View\Asset\PropertyGroup $group) { - $groupAssets = $this->processMerge($group->getAll(), $group); - - $attributes = $this->getGroupAttributes($group); - $attributes = $this->addDefaultAttributes( - $group->getProperty(GroupedCollection::PROPERTY_CONTENT_TYPE), - $attributes - ); - - $groupTemplate = $this->getAssetTemplate( - $group->getProperty(GroupedCollection::PROPERTY_CONTENT_TYPE), - $attributes - ); - $groupHtml = $this->renderAssetHtml($groupTemplate, $groupAssets); + $groupHtml = $this->renderAssetHtml($group); $groupHtml = $this->processIeCondition($groupHtml, $group); return $groupHtml; } @@ -346,16 +334,24 @@ protected function processIeCondition($groupHtml, $group) /** * Render HTML tags referencing corresponding URLs * - * @param string $template - * @param array $assets + * @param \Magento\Framework\View\Asset\PropertyGroup $group * @return string */ - protected function renderAssetHtml($template, $assets) + protected function renderAssetHtml(\Magento\Framework\View\Asset\PropertyGroup $group) { + $assets = $this->processMerge($group->getAll(), $group); + $attributes = $this->getGroupAttributes($group); + $result = ''; try { /** @var $asset \Magento\Framework\View\Asset\AssetInterface */ foreach ($assets as $asset) { + $attributes = $this->addDefaultAttributes($this->getAssetContentType($asset), $attributes); + + $template = $this->getAssetTemplate( + $group->getProperty(GroupedCollection::PROPERTY_CONTENT_TYPE), + $attributes + ); $result .= sprintf($template, $asset->getUrl()); } } catch (\Magento\Framework\Exception\LocalizedException $e) { @@ -365,6 +361,28 @@ protected function renderAssetHtml($template, $assets) return $result; } + /** + * Get asset content type + * + * @param \Magento\Framework\View\Asset\AssetInterface $asset + * @return string + */ + protected function getAssetContentType(\Magento\Framework\View\Asset\AssetInterface $asset) + { + return $asset->getSourceContentType(); + } + + /** + * Get asset content type + * + * @param \Magento\Framework\View\Asset\AssetInterface $asset + * @return string + */ + protected function getAssetContentType(\Magento\Framework\View\Asset\AssetInterface $asset) + { + return $asset->getSourceContentType(); + } + /** * @return array */ From 9f99d7ba0b6de5a7fa923d46b52ff435eef6a2ac Mon Sep 17 00:00:00 2001 From: Gordon Knoppe Date: Fri, 22 Apr 2016 21:33:06 +0100 Subject: [PATCH 03/67] Database port missing in Magento\TestFramework\Db\Mysql #3529 - Add port number parsing to connection parameters --- .../Magento/TestFramework/Db/Mysql.php | 29 +++++++++++++++---- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/dev/tests/integration/framework/Magento/TestFramework/Db/Mysql.php b/dev/tests/integration/framework/Magento/TestFramework/Db/Mysql.php index 0ac0438f69ab7..2acfcaa96f2ac 100644 --- a/dev/tests/integration/framework/Magento/TestFramework/Db/Mysql.php +++ b/dev/tests/integration/framework/Magento/TestFramework/Db/Mysql.php @@ -13,6 +13,11 @@ class Mysql extends \Magento\TestFramework\Db\AbstractDb { + /** + * Default port + */ + const DEFAULT_PORT = 3306; + /** * Defaults extra file name */ @@ -32,12 +37,25 @@ class Mysql extends \Magento\TestFramework\Db\AbstractDb */ private $_defaultsExtraFile; + /** + * Port number for connection + * + * @var integer + */ + private $_port; + /** * {@inheritdoc} */ public function __construct($host, $user, $password, $schema, $varPath, \Magento\Framework\Shell $shell) { parent::__construct($host, $user, $password, $schema, $varPath, $shell); + $this->_port = self::DEFAULT_PORT; + if (strpos($this->_host, ':') !== false) { + list($host, $port) = explode(':', $this->_host); + $this->_host = $host; + $this->_port = (int) $port; + } $this->_dbDumpFile = $this->_varPath . '/setup_dump_' . $this->_schema . '.sql'; $this->_defaultsExtraFile = rtrim($this->_varPath, '\\/') . '/' . self::DEFAULTS_EXTRA_FILE_NAME; } @@ -49,10 +67,11 @@ public function cleanup() { $this->ensureDefaultsExtraFile(); $this->_shell->execute( - 'mysql --defaults-file=%s --host=%s %s -e %s', + 'mysql --defaults-file=%s --host=%s --port=%s %s -e %s', [ $this->_defaultsExtraFile, $this->_host, + $this->_port, $this->_schema, "DROP DATABASE `{$this->_schema}`; CREATE DATABASE `{$this->_schema}`" ] @@ -86,8 +105,8 @@ public function storeDbDump() { $this->ensureDefaultsExtraFile(); $this->_shell->execute( - 'mysqldump --defaults-file=%s --host=%s %s > %s', - [$this->_defaultsExtraFile, $this->_host, $this->_schema, $this->getSetupDbDumpFilename()] + 'mysqldump --defaults-file=%s --host=%s --port=%s %s > %s', + [$this->_defaultsExtraFile, $this->_host, $this->_port, $this->_schema, $this->getSetupDbDumpFilename()] ); } @@ -102,8 +121,8 @@ public function restoreFromDbDump() throw new \LogicException("DB dump file does not exist: " . $this->getSetupDbDumpFilename()); } $this->_shell->execute( - 'mysql --defaults-file=%s --host=%s %s < %s', - [$this->_defaultsExtraFile, $this->_host, $this->_schema, $this->getSetupDbDumpFilename()] + 'mysql --defaults-file=%s --host=%s --port=%s %s < %s', + [$this->_defaultsExtraFile, $this->_host, $this->_port, $this->_schema, $this->getSetupDbDumpFilename()] ); } From 3f506d8e6f342c45b1f406db6c559697f8e7de08 Mon Sep 17 00:00:00 2001 From: Viktor Paladiychuk Date: Mon, 25 Apr 2016 16:36:18 +0300 Subject: [PATCH 04/67] MAGETWO-49175: Wrong behavior of "Client side less compilation" type --- .../Magento/Framework/View/Page/Config/Renderer.php | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/lib/internal/Magento/Framework/View/Page/Config/Renderer.php b/lib/internal/Magento/Framework/View/Page/Config/Renderer.php index 98367238fbd39..fcb270b97bfaa 100644 --- a/lib/internal/Magento/Framework/View/Page/Config/Renderer.php +++ b/lib/internal/Magento/Framework/View/Page/Config/Renderer.php @@ -367,18 +367,7 @@ protected function renderAssetHtml(\Magento\Framework\View\Asset\PropertyGroup $ * @param \Magento\Framework\View\Asset\AssetInterface $asset * @return string */ - protected function getAssetContentType(\Magento\Framework\View\Asset\AssetInterface $asset) - { - return $asset->getSourceContentType(); - } - - /** - * Get asset content type - * - * @param \Magento\Framework\View\Asset\AssetInterface $asset - * @return string - */ - protected function getAssetContentType(\Magento\Framework\View\Asset\AssetInterface $asset) + protected function getAssetContentType(\Magento\Framework\View\Asset\AssetInterface $asset) { return $asset->getSourceContentType(); } From 87ae657d7fca182ffed7a9af8edfa8d0ea9a760f Mon Sep 17 00:00:00 2001 From: Viktor Paladiychuk Date: Wed, 27 Apr 2016 19:28:24 +0300 Subject: [PATCH 05/67] MAGETWO-49175: Wrong behavior of "Client side less compilation" type --- .../PreProcessor/FrontendCompilation.php | 26 ++++++++++++------- .../ClientSideLessCompilation/Renderer.php | 5 +++- .../Framework/View/Asset/AssetInterface.php | 8 ++++++ .../Magento/Framework/View/Asset/File.php | 10 +++++++ .../View/Asset/PreProcessor/Chain.php | 5 +++- .../Magento/Framework/View/Asset/Remote.php | 11 ++++++++ .../Magento/Framework/View/Asset/Source.php | 10 +++++++ .../Framework/View/Page/Config/Renderer.php | 16 ++++++++++-- 8 files changed, 78 insertions(+), 13 deletions(-) diff --git a/app/code/Magento/Developer/Model/View/Asset/PreProcessor/FrontendCompilation.php b/app/code/Magento/Developer/Model/View/Asset/PreProcessor/FrontendCompilation.php index ab4f2a425ca2d..d5448cc102d85 100644 --- a/app/code/Magento/Developer/Model/View/Asset/PreProcessor/FrontendCompilation.php +++ b/app/code/Magento/Developer/Model/View/Asset/PreProcessor/FrontendCompilation.php @@ -87,7 +87,10 @@ public function process(PreProcessor\Chain $chain) /** @var FallbackContext $context */ $context = $chain->getAsset()->getContext(); - $chain->setContent($this->processContent($path, $content, $module, $context)); + + $result = $this->processContent($path, $content, $module, $context); + $chain->setContent($result['content']); + $chain->setContentType($result['sourceType']); } finally { $this->lockerProcess->unlockProcess(); } @@ -100,28 +103,33 @@ public function process(PreProcessor\Chain $chain) * @param string $content * @param string $module * @param FallbackContext $context - * @return string + * @return array */ private function processContent($path, $content, $module, FallbackContext $context) { + $sourceType = '#\.' . preg_quote(pathinfo($path, PATHINFO_EXTENSION)) . '$#'; + foreach ($this->alternativeSource->getAlternativesExtensionsNames() as $name) { $asset = $this->assetBuilder->setArea($context->getAreaCode()) ->setTheme($context->getThemePath()) ->setLocale($context->getLocale()) ->setModule($module) - ->setPath(preg_replace( - '#\.' . preg_quote(pathinfo($path, PATHINFO_EXTENSION)) . '$#', - '.' . $name, - $path - ))->build(); + ->setPath(preg_replace($sourceType, '.' . $name, $path)) + ->build(); $processedContent = $this->assetSource->getContent($asset); if (trim($processedContent) !== '') { - return $processedContent; + return [ + 'content' => $processedContent, + 'sourceType' => $name + ]; } } - return $content; + return [ + 'content' => $content, + 'sourceType' => $sourceType + ]; } } diff --git a/app/code/Magento/Developer/Model/View/Page/Config/ClientSideLessCompilation/Renderer.php b/app/code/Magento/Developer/Model/View/Page/Config/ClientSideLessCompilation/Renderer.php index f30026b993e2f..313b3f21727c2 100644 --- a/app/code/Magento/Developer/Model/View/Page/Config/ClientSideLessCompilation/Renderer.php +++ b/app/code/Magento/Developer/Model/View/Page/Config/ClientSideLessCompilation/Renderer.php @@ -108,7 +108,10 @@ private function renderLessJsScripts($resultGroups) */ protected function getAssetContentType(\Magento\Framework\View\Asset\AssetInterface $asset) { + if (!in_array($asset->getContentType(), ['css', 'less'])) { + return parent::getAssetContentType($asset); + } $asset->getSourceFile(); - return parent::getAssetContentType($asset); + return $asset->getSourceContentType(); } } diff --git a/lib/internal/Magento/Framework/View/Asset/AssetInterface.php b/lib/internal/Magento/Framework/View/Asset/AssetInterface.php index efeca084654e4..e2d5b66b4a834 100644 --- a/lib/internal/Magento/Framework/View/Asset/AssetInterface.php +++ b/lib/internal/Magento/Framework/View/Asset/AssetInterface.php @@ -30,4 +30,12 @@ public function getContentType(); * @return string */ public function getSourceContentType(); + + /** + * Set source content type + * + * @param string|null $type + * @return void + */ + public function setSourceContentType($type); } diff --git a/lib/internal/Magento/Framework/View/Asset/File.php b/lib/internal/Magento/Framework/View/Asset/File.php index 98168576f687c..3f7ad69277dbb 100644 --- a/lib/internal/Magento/Framework/View/Asset/File.php +++ b/lib/internal/Magento/Framework/View/Asset/File.php @@ -165,6 +165,16 @@ public function getSourceContentType() return $this->source->getSourceContentType(); } + /** + * Set source content type + * + * @param string|null $type + */ + public function setSourceContentType($type) + { + $this->source->setSourceContentType($type); + } + /** * {@inheritdoc} */ diff --git a/lib/internal/Magento/Framework/View/Asset/PreProcessor/Chain.php b/lib/internal/Magento/Framework/View/Asset/PreProcessor/Chain.php index 93d0a289be88b..b1021991bcf86 100644 --- a/lib/internal/Magento/Framework/View/Asset/PreProcessor/Chain.php +++ b/lib/internal/Magento/Framework/View/Asset/PreProcessor/Chain.php @@ -14,6 +14,8 @@ */ class Chain { + private $contentTypesFriends = ['less', 'css']; + /** * @var LocalInterface */ @@ -178,7 +180,8 @@ public function getTargetAssetPath() */ public function assertValid() { - if ($this->contentType !== $this->targetContentType) { + if ($this->contentType !== $this->targetContentType + && !array_intersect([$this->contentType, $this->targetContentType], $this->contentTypesFriends)) { throw new \LogicException( "The requested asset type was '{$this->targetContentType}', but ended up with '{$this->contentType}'" ); diff --git a/lib/internal/Magento/Framework/View/Asset/Remote.php b/lib/internal/Magento/Framework/View/Asset/Remote.php index 720f75d1e0639..367869f6ed3cf 100644 --- a/lib/internal/Magento/Framework/View/Asset/Remote.php +++ b/lib/internal/Magento/Framework/View/Asset/Remote.php @@ -59,4 +59,15 @@ public function getSourceContentType() { return $this->getContentType(); } + + /** + * Set source content type + * + * @param string|null $type + * @return void + */ + public function setSourceContentType($type) + { + $this->contentType = $type; + } } diff --git a/lib/internal/Magento/Framework/View/Asset/Source.php b/lib/internal/Magento/Framework/View/Asset/Source.php index f73f5217febae..573f1f0cc1355 100644 --- a/lib/internal/Magento/Framework/View/Asset/Source.php +++ b/lib/internal/Magento/Framework/View/Asset/Source.php @@ -172,6 +172,16 @@ public function getSourceContentType() return $this->sourceContentType; } + /** + * Set source content type + * + * @param string|null $type + */ + public function setSourceContentType($type) + { + $this->sourceContentType = $type; + } + /** * @param LocalInterface $asset * @return bool|string diff --git a/lib/internal/Magento/Framework/View/Page/Config/Renderer.php b/lib/internal/Magento/Framework/View/Page/Config/Renderer.php index fcb270b97bfaa..a768df9f38daf 100644 --- a/lib/internal/Magento/Framework/View/Page/Config/Renderer.php +++ b/lib/internal/Magento/Framework/View/Page/Config/Renderer.php @@ -347,6 +347,7 @@ protected function renderAssetHtml(\Magento\Framework\View\Asset\PropertyGroup $ /** @var $asset \Magento\Framework\View\Asset\AssetInterface */ foreach ($assets as $asset) { $attributes = $this->addDefaultAttributes($this->getAssetContentType($asset), $attributes); + $asset->setSourceContentType(null); $template = $this->getAssetTemplate( $group->getProperty(GroupedCollection::PROPERTY_CONTENT_TYPE), @@ -367,9 +368,20 @@ protected function renderAssetHtml(\Magento\Framework\View\Asset\PropertyGroup $ * @param \Magento\Framework\View\Asset\AssetInterface $asset * @return string */ - protected function getAssetContentType(\Magento\Framework\View\Asset\AssetInterface $asset) + protected function getAssetContentType(\Magento\Framework\View\Asset\AssetInterface $asset) { - return $asset->getSourceContentType(); + return $asset->getContentType(); + } + + /** + * Set asset content type + * + * @param \Magento\Framework\View\Asset\AssetInterface $asset + * @param string|null $type + */ + protected function setAssetContentType(\Magento\Framework\View\Asset\AssetInterface $asset, $type) + { + $asset->setSourceContentType($type); } /** From 6ff6743a7c5be34c6a56d08fa57f3a8bd6a39422 Mon Sep 17 00:00:00 2001 From: Viktor Paladiychuk Date: Thu, 28 Apr 2016 13:40:04 +0300 Subject: [PATCH 06/67] MAGETWO-49175: Wrong behavior of "Client side less compilation" type --- app/code/Magento/Developer/etc/di.xml | 10 ++++++++++ .../Framework/View/Asset/PreProcessor/Chain.php | 13 ++++++++++--- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/Developer/etc/di.xml b/app/code/Magento/Developer/etc/di.xml index f04d55ea8285f..2ababe345a84c 100644 --- a/app/code/Magento/Developer/etc/di.xml +++ b/app/code/Magento/Developer/etc/di.xml @@ -241,4 +241,14 @@ web + + + + + + less + + + + diff --git a/lib/internal/Magento/Framework/View/Asset/PreProcessor/Chain.php b/lib/internal/Magento/Framework/View/Asset/PreProcessor/Chain.php index b1021991bcf86..bb7958b45a3ef 100644 --- a/lib/internal/Magento/Framework/View/Asset/PreProcessor/Chain.php +++ b/lib/internal/Magento/Framework/View/Asset/PreProcessor/Chain.php @@ -14,7 +14,10 @@ */ class Chain { - private $contentTypesFriends = ['less', 'css']; + /** + * @var array + */ + private $compatibleTypes; /** * @var LocalInterface @@ -61,12 +64,14 @@ class Chain * @param string $origContent * @param string $origContentType * @param string $origAssetPath + * @param array $compatibleTypes */ public function __construct( LocalInterface $asset, $origContent, $origContentType, - $origAssetPath + $origAssetPath, + array $compatibleTypes = [] ) { $this->asset = $asset; $this->origContent = $origContent; @@ -76,6 +81,7 @@ public function __construct( $this->targetContentType = $asset->getContentType(); $this->targetAssetPath = $asset->getPath(); $this->origAssetPath = $origAssetPath; + $this->compatibleTypes = $compatibleTypes; } /** @@ -181,7 +187,8 @@ public function getTargetAssetPath() public function assertValid() { if ($this->contentType !== $this->targetContentType - && !array_intersect([$this->contentType, $this->targetContentType], $this->contentTypesFriends)) { + && !in_array($this->contentType, $this->compatibleTypes[$this->targetContentType])) { + throw new \LogicException( "The requested asset type was '{$this->targetContentType}', but ended up with '{$this->contentType}'" ); From effee586fdaa7b733d870adfb35bfcd8699f223e Mon Sep 17 00:00:00 2001 From: Viktor Paladiychuk Date: Thu, 28 Apr 2016 16:36:06 +0300 Subject: [PATCH 07/67] MAGETWO-49175: Wrong behavior of "Client side less compilation" type --- app/code/Magento/Developer/etc/di.xml | 2 +- lib/internal/Magento/Framework/View/Asset/File.php | 1 + .../Magento/Framework/View/Asset/PreProcessor/Chain.php | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Developer/etc/di.xml b/app/code/Magento/Developer/etc/di.xml index 2ababe345a84c..397b67f379f72 100644 --- a/app/code/Magento/Developer/etc/di.xml +++ b/app/code/Magento/Developer/etc/di.xml @@ -246,7 +246,7 @@ - less + true diff --git a/lib/internal/Magento/Framework/View/Asset/File.php b/lib/internal/Magento/Framework/View/Asset/File.php index 3f7ad69277dbb..f7fbadca76397 100644 --- a/lib/internal/Magento/Framework/View/Asset/File.php +++ b/lib/internal/Magento/Framework/View/Asset/File.php @@ -169,6 +169,7 @@ public function getSourceContentType() * Set source content type * * @param string|null $type + * @return void */ public function setSourceContentType($type) { diff --git a/lib/internal/Magento/Framework/View/Asset/PreProcessor/Chain.php b/lib/internal/Magento/Framework/View/Asset/PreProcessor/Chain.php index bb7958b45a3ef..b4fe2f0d1cd8f 100644 --- a/lib/internal/Magento/Framework/View/Asset/PreProcessor/Chain.php +++ b/lib/internal/Magento/Framework/View/Asset/PreProcessor/Chain.php @@ -187,7 +187,7 @@ public function getTargetAssetPath() public function assertValid() { if ($this->contentType !== $this->targetContentType - && !in_array($this->contentType, $this->compatibleTypes[$this->targetContentType])) { + && empty($this->compatibleTypes[$this->targetContentType][$this->contentType])) { throw new \LogicException( "The requested asset type was '{$this->targetContentType}', but ended up with '{$this->contentType}'" From 5184a7e4d62ff70e4b26139ac312ea0830acb321 Mon Sep 17 00:00:00 2001 From: Viktor Paladiychuk Date: Thu, 28 Apr 2016 17:38:39 +0300 Subject: [PATCH 08/67] MAGETWO-49175: Wrong behavior of "Client side less compilation" type --- lib/internal/Magento/Framework/View/Asset/Source.php | 1 + .../Magento/Framework/View/Page/Config/Renderer.php | 6 ++---- .../Framework/View/Test/Unit/Page/Config/RendererTest.php | 2 ++ 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/internal/Magento/Framework/View/Asset/Source.php b/lib/internal/Magento/Framework/View/Asset/Source.php index 573f1f0cc1355..e1afbcac24b5a 100644 --- a/lib/internal/Magento/Framework/View/Asset/Source.php +++ b/lib/internal/Magento/Framework/View/Asset/Source.php @@ -176,6 +176,7 @@ public function getSourceContentType() * Set source content type * * @param string|null $type + * @return void */ public function setSourceContentType($type) { diff --git a/lib/internal/Magento/Framework/View/Page/Config/Renderer.php b/lib/internal/Magento/Framework/View/Page/Config/Renderer.php index a768df9f38daf..c97e972768a52 100644 --- a/lib/internal/Magento/Framework/View/Page/Config/Renderer.php +++ b/lib/internal/Magento/Framework/View/Page/Config/Renderer.php @@ -346,14 +346,12 @@ protected function renderAssetHtml(\Magento\Framework\View\Asset\PropertyGroup $ try { /** @var $asset \Magento\Framework\View\Asset\AssetInterface */ foreach ($assets as $asset) { - $attributes = $this->addDefaultAttributes($this->getAssetContentType($asset), $attributes); - $asset->setSourceContentType(null); - $template = $this->getAssetTemplate( $group->getProperty(GroupedCollection::PROPERTY_CONTENT_TYPE), - $attributes + $this->addDefaultAttributes($this->getAssetContentType($asset), $attributes) ); $result .= sprintf($template, $asset->getUrl()); + $asset->setSourceContentType(null); } } catch (\Magento\Framework\Exception\LocalizedException $e) { $this->logger->critical($e); diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Page/Config/RendererTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Page/Config/RendererTest.php index ed77622ba3828..9fbc0693159b9 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/Page/Config/RendererTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/Page/Config/RendererTest.php @@ -265,6 +265,7 @@ public function testRenderAssets($groupOne, $groupTwo, $expectedResult) $assetMockOne->expects($this->exactly(2)) ->method('getUrl') ->willReturn($assetUrl); + $assetMockOne->expects($this->atLeastOnce())->method('getContentType')->willReturn($groupOne['type']); $groupAssetsOne = [$assetMockOne, $assetMockOne]; @@ -287,6 +288,7 @@ public function testRenderAssets($groupOne, $groupTwo, $expectedResult) $assetMockTwo->expects($this->once()) ->method('getUrl') ->willThrowException($exception); + $assetMockTwo->expects($this->atLeastOnce())->method('getContentType')->willReturn($groupTwo['type']); $groupAssetsTwo = [$assetMockTwo]; From 4c56bad73625cf0e6d16fca3f809ab9f98d7e680 Mon Sep 17 00:00:00 2001 From: Viktor Paladiychuk Date: Thu, 28 Apr 2016 17:56:26 +0300 Subject: [PATCH 09/67] MAGETWO-49175: Wrong behavior of "Client side less compilation" type --- .../Magento/Framework/View/Page/Config/Renderer.php | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/lib/internal/Magento/Framework/View/Page/Config/Renderer.php b/lib/internal/Magento/Framework/View/Page/Config/Renderer.php index c97e972768a52..26ab5332e1c1a 100644 --- a/lib/internal/Magento/Framework/View/Page/Config/Renderer.php +++ b/lib/internal/Magento/Framework/View/Page/Config/Renderer.php @@ -371,17 +371,6 @@ protected function getAssetContentType(\Magento\Framework\View\Asset\AssetInterf return $asset->getContentType(); } - /** - * Set asset content type - * - * @param \Magento\Framework\View\Asset\AssetInterface $asset - * @param string|null $type - */ - protected function setAssetContentType(\Magento\Framework\View\Asset\AssetInterface $asset, $type) - { - $asset->setSourceContentType($type); - } - /** * @return array */ From 62f156c97de1dcb9d44e4f786f0bed12db799cf4 Mon Sep 17 00:00:00 2001 From: Viktor Paladiychuk Date: Thu, 28 Apr 2016 18:40:38 +0300 Subject: [PATCH 10/67] MAGETWO-49175: Wrong behavior of "Client side less compilation" type --- .../Asset/PreProcessor/FrontendCompilationTest.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/app/code/Magento/Developer/Test/Unit/Model/View/Asset/PreProcessor/FrontendCompilationTest.php b/app/code/Magento/Developer/Test/Unit/Model/View/Asset/PreProcessor/FrontendCompilationTest.php index 87c688147b846..956476f7150fa 100644 --- a/app/code/Magento/Developer/Test/Unit/Model/View/Asset/PreProcessor/FrontendCompilationTest.php +++ b/app/code/Magento/Developer/Test/Unit/Model/View/Asset/PreProcessor/FrontendCompilationTest.php @@ -136,6 +136,8 @@ public function testProcessException() */ public function testProcess() { + $newContentType = 'less'; + $this->lockerProcessMock->expects(self::once()) ->method('lockProcess') ->with(self::isType('string')); @@ -170,7 +172,7 @@ public function testProcess() $this->alternativeSourceMock->expects(self::once()) ->method('getAlternativesExtensionsNames') - ->willReturn(['less']); + ->willReturn([$newContentType]); $this->assetSourceMock->expects(self::once()) ->method('getContent') @@ -185,7 +187,7 @@ public function testProcess() 'lock' ); - $frontendCompilation->process($this->getChainMockExpects()); + $frontendCompilation->process($this->getChainMockExpects('', 1, 1, $newContentType)); } /** @@ -236,9 +238,10 @@ private function getChainMock() * @param string $content * @param int $contentExactly * @param int $pathExactly + * @param string $newContentType * @return Chain|\PHPUnit_Framework_MockObject_MockObject */ - private function getChainMockExpects($content = '', $contentExactly = 1, $pathExactly = 1) + private function getChainMockExpects($content = '', $contentExactly = 1, $pathExactly = 1, $newContentType = '') { $chainMock = $this->getChainMock(); @@ -250,7 +253,10 @@ private function getChainMockExpects($content = '', $contentExactly = 1, $pathEx ->willReturn($this->getAssetMockExpects($pathExactly)); $chainMock->expects(self::exactly($contentExactly)) ->method('setContent') - ->willReturn(self::NEW_CONTENT); + ->with(self::NEW_CONTENT); + $chainMock->expects(self::exactly($contentExactly)) + ->method('setContentType') + ->with($newContentType); return $chainMock; } From bc681d0f113133994f01377566688f47756c7603 Mon Sep 17 00:00:00 2001 From: Viktor Paladiychuk Date: Fri, 29 Apr 2016 12:15:56 +0300 Subject: [PATCH 11/67] MAGETWO-49175: Wrong behavior of "Client side less compilation" type --- .../Page/Config/ClientSideLessCompilation/Renderer.php | 7 ++++++- .../View/Asset/PreProcessor/FrontendCompilationTest.php | 1 - 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Developer/Model/View/Page/Config/ClientSideLessCompilation/Renderer.php b/app/code/Magento/Developer/Model/View/Page/Config/ClientSideLessCompilation/Renderer.php index 313b3f21727c2..929a8e13e09a9 100644 --- a/app/code/Magento/Developer/Model/View/Page/Config/ClientSideLessCompilation/Renderer.php +++ b/app/code/Magento/Developer/Model/View/Page/Config/ClientSideLessCompilation/Renderer.php @@ -12,6 +12,11 @@ */ class Renderer extends Config\Renderer { + /** + * @var array + */ + private $processingTypes = ['css', 'less']; + /** * @var \Magento\Framework\View\Asset\Repository */ @@ -108,7 +113,7 @@ private function renderLessJsScripts($resultGroups) */ protected function getAssetContentType(\Magento\Framework\View\Asset\AssetInterface $asset) { - if (!in_array($asset->getContentType(), ['css', 'less'])) { + if (!in_array($asset->getContentType(), $this->processingTypes)) { return parent::getAssetContentType($asset); } $asset->getSourceFile(); diff --git a/app/code/Magento/Developer/Test/Unit/Model/View/Asset/PreProcessor/FrontendCompilationTest.php b/app/code/Magento/Developer/Test/Unit/Model/View/Asset/PreProcessor/FrontendCompilationTest.php index 956476f7150fa..97f0b1d5a6bdb 100644 --- a/app/code/Magento/Developer/Test/Unit/Model/View/Asset/PreProcessor/FrontendCompilationTest.php +++ b/app/code/Magento/Developer/Test/Unit/Model/View/Asset/PreProcessor/FrontendCompilationTest.php @@ -112,7 +112,6 @@ public function testProcessException() ->method('build') ->willThrowException(new \Exception()); - $this->assetSourceMock->expects(self::never()) ->method('getContent'); From 91d18452ae0167c416046be89964c6b6d04dedcf Mon Sep 17 00:00:00 2001 From: Viktor Paladiychuk Date: Fri, 29 Apr 2016 12:19:25 +0300 Subject: [PATCH 12/67] MAGETWO-49175: Wrong behavior of "Client side less compilation" type --- .../View/Page/Config/ClientSideLessCompilation/Renderer.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Developer/Model/View/Page/Config/ClientSideLessCompilation/Renderer.php b/app/code/Magento/Developer/Model/View/Page/Config/ClientSideLessCompilation/Renderer.php index 929a8e13e09a9..e89b94388fd9a 100644 --- a/app/code/Magento/Developer/Model/View/Page/Config/ClientSideLessCompilation/Renderer.php +++ b/app/code/Magento/Developer/Model/View/Page/Config/ClientSideLessCompilation/Renderer.php @@ -15,7 +15,7 @@ class Renderer extends Config\Renderer /** * @var array */ - private $processingTypes = ['css', 'less']; + private static $processingTypes = ['css', 'less']; /** * @var \Magento\Framework\View\Asset\Repository @@ -113,7 +113,7 @@ private function renderLessJsScripts($resultGroups) */ protected function getAssetContentType(\Magento\Framework\View\Asset\AssetInterface $asset) { - if (!in_array($asset->getContentType(), $this->processingTypes)) { + if (!in_array($asset->getContentType(), self::$processingTypes)) { return parent::getAssetContentType($asset); } $asset->getSourceFile(); From 0d2d3f761ed349df291cfdf4cecbd5eb9e2fe7df Mon Sep 17 00:00:00 2001 From: Viktor Paladiychuk Date: Thu, 12 May 2016 18:48:47 +0300 Subject: [PATCH 13/67] MAGETWO-49175: Wrong behavior of "Client side less compilation" type --- .../Magento/Framework/View/Asset/File.php | 9 ++++++-- .../Magento/Framework/View/Asset/Source.php | 23 +------------------ 2 files changed, 8 insertions(+), 24 deletions(-) diff --git a/lib/internal/Magento/Framework/View/Asset/File.php b/lib/internal/Magento/Framework/View/Asset/File.php index f7fbadca76397..9c0728cb296f2 100644 --- a/lib/internal/Magento/Framework/View/Asset/File.php +++ b/lib/internal/Magento/Framework/View/Asset/File.php @@ -48,6 +48,11 @@ class File implements MergeableInterface */ private $minification; + /** + * @var string + */ + private $sourceContentType; + /** * @param Source $source * @param ContextInterface $context @@ -162,7 +167,7 @@ public function getSourceFile() */ public function getSourceContentType() { - return $this->source->getSourceContentType(); + return $this->sourceContentType; } /** @@ -173,7 +178,7 @@ public function getSourceContentType() */ public function setSourceContentType($type) { - $this->source->setSourceContentType($type); + $this->sourceContentType = $type; } /** diff --git a/lib/internal/Magento/Framework/View/Asset/Source.php b/lib/internal/Magento/Framework/View/Asset/Source.php index e1afbcac24b5a..dabe541ca2869 100644 --- a/lib/internal/Magento/Framework/View/Asset/Source.php +++ b/lib/internal/Magento/Framework/View/Asset/Source.php @@ -146,8 +146,8 @@ private function preProcess(LocalInterface $asset) } $chain = $this->createChain($asset, $dir, $path); - $this->sourceContentType = $chain->getContentType(); $this->preProcessorPool->process($chain); + $asset->setSourceContentType($chain->getContentType()); $chain->assertValid(); if ($chain->isChanged()) { $dir = $this->varDir->getAbsolutePath(); @@ -162,27 +162,6 @@ private function preProcess(LocalInterface $asset) return $result; } - /** - * Get source content type - * - * @return string - */ - public function getSourceContentType() - { - return $this->sourceContentType; - } - - /** - * Set source content type - * - * @param string|null $type - * @return void - */ - public function setSourceContentType($type) - { - $this->sourceContentType = $type; - } - /** * @param LocalInterface $asset * @return bool|string From 0e1394216bcd1ff36a90d12ba4aac77bd7290c44 Mon Sep 17 00:00:00 2001 From: Viktor Paladiychuk Date: Fri, 13 May 2016 09:40:43 +0300 Subject: [PATCH 14/67] MAGETWO-49175: Wrong behavior of "Client side less compilation" type --- lib/internal/Magento/Framework/View/Asset/Source.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/lib/internal/Magento/Framework/View/Asset/Source.php b/lib/internal/Magento/Framework/View/Asset/Source.php index dabe541ca2869..db663af420a37 100644 --- a/lib/internal/Magento/Framework/View/Asset/Source.php +++ b/lib/internal/Magento/Framework/View/Asset/Source.php @@ -58,11 +58,6 @@ class Source */ private $readFactory; - /** - * @var string - */ - private $sourceContentType; - /** * Constructor * From 54df23a2cddd92d6961dfda3b80e480c6d7c822e Mon Sep 17 00:00:00 2001 From: Bohdan Korablov Date: Tue, 17 May 2016 16:02:18 +0300 Subject: [PATCH 15/67] MAGETWO-52850: [GitHub] UTF-8 special character issue in widgets #4232 --- lib/web/legacy-build.min.js | 2 +- lib/web/mage/adminhtml/tools.js | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/web/legacy-build.min.js b/lib/web/legacy-build.min.js index 289cf49e76a13..dd618319b1884 100644 --- a/lib/web/legacy-build.min.js +++ b/lib/web/legacy-build.min.js @@ -5,4 +5,4 @@ var Prototype={Version:"1.7",Browser:(function(){var d=navigator.userAgent;var b * Released under the MIT, BSD, and GPL Licenses. * More information: http://sizzlejs.com/ */ -(function(){var w=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,p=0,g=Object.prototype.toString,u=false,o=true;[0,0].sort(function(){o=false;return 0});var d=function(L,B,I,D){I=I||[];var e=B=B||document;if(B.nodeType!==1&&B.nodeType!==9){return[]}if(!L||typeof L!=="string"){return I}var J=[],K,G,P,O,H,A,z=true,E=v(B),N=L;while((w.exec(""),K=w.exec(N))!==null){N=K[3];J.push(K[1]);if(K[2]){A=K[3];break}}if(J.length>1&&q.exec(L)){if(J.length===2&&h.relative[J[0]]){G=l(J[0]+J[1],B)}else{G=h.relative[J[0]]?[B]:d(J.shift(),B);while(J.length){L=J.shift();if(h.relative[L]){L+=J.shift()}G=l(L,G)}}}else{if(!D&&J.length>1&&B.nodeType===9&&!E&&h.match.ID.test(J[0])&&!h.match.ID.test(J[J.length-1])){var Q=d.find(J.shift(),B,E);B=Q.expr?d.filter(Q.expr,Q.set)[0]:Q.set[0]}if(B){var Q=D?{expr:J.pop(),set:b(D)}:d.find(J.pop(),J.length===1&&(J[0]==="~"||J[0]==="+")&&B.parentNode?B.parentNode:B,E);G=Q.expr?d.filter(Q.expr,Q.set):Q.set;if(J.length>0){P=b(G)}else{z=false}while(J.length){var C=J.pop(),F=C;if(!h.relative[C]){C=""}else{F=J.pop()}if(F==null){F=B}h.relative[C](P,F,E)}}else{P=J=[]}}if(!P){P=G}if(!P){throw"Syntax error, unrecognized expression: "+(C||L)}if(g.call(P)==="[object Array]"){if(!z){I.push.apply(I,P)}else{if(B&&B.nodeType===1){for(var M=0;P[M]!=null;M++){if(P[M]&&(P[M]===true||P[M].nodeType===1&&n(B,P[M]))){I.push(G[M])}}}else{for(var M=0;P[M]!=null;M++){if(P[M]&&P[M].nodeType===1){I.push(G[M])}}}}}else{b(P,I)}if(A){d(A,e,I,D);d.uniqueSort(I)}return I};d.uniqueSort=function(z){if(f){u=o;z.sort(f);if(u){for(var e=1;e":function(E,z,F){var C=typeof z==="string";if(C&&!/\W/.test(z)){z=F?z:z.toUpperCase();for(var A=0,e=E.length;A=0)){if(!A){e.push(D)}}else{if(A){z[C]=false}}}}return false},ID:function(e){return e[1].replace(/\\/g,"")},TAG:function(z,e){for(var A=0;e[A]===false;A++){}return e[A]&&v(e[A])?z[1]:z[1].toUpperCase()},CHILD:function(e){if(e[1]=="nth"){var z=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(e[2]=="even"&&"2n"||e[2]=="odd"&&"2n+1"||!/\D/.test(e[2])&&"0n+"+e[2]||e[2]);e[2]=(z[1]+(z[2]||1))-0;e[3]=z[3]-0}e[0]=p++;return e},ATTR:function(C,z,A,e,D,E){var B=C[1].replace(/\\/g,"");if(!E&&h.attrMap[B]){C[1]=h.attrMap[B]}if(C[2]==="~="){C[4]=" "+C[4]+" "}return C},PSEUDO:function(C,z,A,e,D){if(C[1]==="not"){if((w.exec(C[3])||"").length>1||/^\w/.test(C[3])){C[3]=d(C[3],null,null,z)}else{var B=d.filter(C[3],z,A,true^D);if(!A){e.push.apply(e,B)}return false}}else{if(h.match.POS.test(C[0])||h.match.CHILD.test(C[0])){return true}}return C},POS:function(e){e.unshift(true);return e}},filters:{enabled:function(e){return e.disabled===false&&e.type!=="hidden"},disabled:function(e){return e.disabled===true},checked:function(e){return e.checked===true},selected:function(e){e.parentNode.selectedIndex;return e.selected===true},parent:function(e){return !!e.firstChild},empty:function(e){return !e.firstChild},has:function(A,z,e){return !!d(e[3],A).length},header:function(e){return/h\d/i.test(e.nodeName)},text:function(e){return"text"===e.type},radio:function(e){return"radio"===e.type},checkbox:function(e){return"checkbox"===e.type},file:function(e){return"file"===e.type},password:function(e){return"password"===e.type},submit:function(e){return"submit"===e.type},image:function(e){return"image"===e.type},reset:function(e){return"reset"===e.type},button:function(e){return"button"===e.type||e.nodeName.toUpperCase()==="BUTTON"},input:function(e){return/input|select|textarea|button/i.test(e.nodeName)}},setFilters:{first:function(z,e){return e===0},last:function(A,z,e,B){return z===B.length-1},even:function(z,e){return e%2===0},odd:function(z,e){return e%2===1},lt:function(A,z,e){return ze[3]-0},nth:function(A,z,e){return e[3]-0==z},eq:function(A,z,e){return e[3]-0==z}},filter:{PSEUDO:function(E,A,B,F){var z=A[1],C=h.filters[z];if(C){return C(E,B,A,F)}else{if(z==="contains"){return(E.textContent||E.innerText||"").indexOf(A[3])>=0}else{if(z==="not"){var D=A[3];for(var B=0,e=D.length;B=0)}}},ID:function(z,e){return z.nodeType===1&&z.getAttribute("id")===e},TAG:function(z,e){return(e==="*"&&z.nodeType===1)||z.nodeName===e},CLASS:function(z,e){return(" "+(z.className||z.getAttribute("class"))+" ").indexOf(e)>-1},ATTR:function(D,B){var A=B[1],e=h.attrHandle[A]?h.attrHandle[A](D):D[A]!=null?D[A]:D.getAttribute(A),E=e+"",C=B[2],z=B[4];return e==null?C==="!=":C==="="?E===z:C==="*="?E.indexOf(z)>=0:C==="~="?(" "+E+" ").indexOf(z)>=0:!z?E&&e!==false:C==="!="?E!=z:C==="^="?E.indexOf(z)===0:C==="$="?E.substr(E.length-z.length)===z:C==="|="?E===z||E.substr(0,z.length+1)===z+"-":false},POS:function(C,z,A,D){var e=z[2],B=h.setFilters[e];if(B){return B(C,A,z,D)}}}};var q=h.match.POS;for(var s in h.match){h.match[s]=new RegExp(h.match[s].source+/(?![^\[]*\])(?![^\(]*\))/.source);h.leftMatch[s]=new RegExp(/(^(?:.|\r|\n)*?)/.source+h.match[s].source)}var b=function(z,e){z=Array.prototype.slice.call(z,0);if(e){e.push.apply(e,z);return e}return z};try{Array.prototype.slice.call(document.documentElement.childNodes,0)}catch(r){b=function(C,B){var z=B||[];if(g.call(C)==="[object Array]"){Array.prototype.push.apply(z,C)}else{if(typeof C.length==="number"){for(var A=0,e=C.length;A";var e=document.documentElement;e.insertBefore(z,e.firstChild);if(!!document.getElementById(A)){h.find.ID=function(C,D,E){if(typeof D.getElementById!=="undefined"&&!E){var B=D.getElementById(C[1]);return B?B.id===C[1]||typeof B.getAttributeNode!=="undefined"&&B.getAttributeNode("id").nodeValue===C[1]?[B]:undefined:[]}};h.filter.ID=function(D,B){var C=typeof D.getAttributeNode!=="undefined"&&D.getAttributeNode("id");return D.nodeType===1&&C&&C.nodeValue===B}}e.removeChild(z);e=z=null})();(function(){var e=document.createElement("div");e.appendChild(document.createComment(""));if(e.getElementsByTagName("*").length>0){h.find.TAG=function(z,D){var C=D.getElementsByTagName(z[1]);if(z[1]==="*"){var B=[];for(var A=0;C[A];A++){if(C[A].nodeType===1){B.push(C[A])}}C=B}return C}}e.innerHTML="";if(e.firstChild&&typeof e.firstChild.getAttribute!=="undefined"&&e.firstChild.getAttribute("href")!=="#"){h.attrHandle.href=function(z){return z.getAttribute("href",2)}}e=null})();if(document.querySelectorAll){(function(){var e=d,A=document.createElement("div");A.innerHTML="

";if(A.querySelectorAll&&A.querySelectorAll(".TEST").length===0){return}d=function(E,D,B,C){D=D||document;if(!C&&D.nodeType===9&&!v(D)){try{return b(D.querySelectorAll(E),B)}catch(F){}}return e(E,D,B,C)};for(var z in e){d[z]=e[z]}A=null})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var e=document.createElement("div");e.innerHTML="
";if(e.getElementsByClassName("e").length===0){return}e.lastChild.className="e";if(e.getElementsByClassName("e").length===1){return}h.order.splice(1,0,"CLASS");h.find.CLASS=function(z,A,B){if(typeof A.getElementsByClassName!=="undefined"&&!B){return A.getElementsByClassName(z[1])}};e=null})()}function t(z,E,D,I,F,H){var G=z=="previousSibling"&&!H;for(var B=0,A=I.length;B0){C=e;break}}}e=e[z]}I[B]=C}}}var n=document.compareDocumentPosition?function(z,e){return z.compareDocumentPosition(e)&16}:function(z,e){return z!==e&&(z.contains?z.contains(e):true)};var v=function(e){return e.nodeType===9&&e.documentElement.nodeName!=="HTML"||!!e.ownerDocument&&e.ownerDocument.documentElement.nodeName!=="HTML"};var l=function(e,F){var B=[],C="",D,A=F.nodeType?[F]:F;while((D=h.match.PSEUDO.exec(e))){C+=D[0];e=e.replace(h.match.PSEUDO,"")}e=h.relative[e]?e+"*":e;for(var E=0,z=A.length;E=0}).sortBy(function(f){return f.tabIndex}).first();return b?b:e.find(function(f){return/^(?:input|select|textarea)$/i.test(f.tagName)})},focusFirstElement:function(d){d=$(d);var b=d.findFirstElement();if(b){b.activate()}return d},request:function(d,b){d=$(d),b=Object.clone(b||{});var f=b.parameters,e=d.readAttribute("action")||"";if(e.blank()){e=window.location.href}b.parameters=d.serialize(true);if(f){if(Object.isString(f)){f=f.toQueryParams()}Object.extend(b.parameters,f)}if(d.hasAttribute("method")&&!b.method){b.method=d.method}return new Ajax.Request(e,b)}};Form.Element={focus:function(b){$(b).focus();return b},select:function(b){$(b).select();return b}};Form.Element.Methods={serialize:function(b){b=$(b);if(!b.disabled&&b.name){var d=b.getValue();if(d!=undefined){var e={};e[b.name]=d;return Object.toQueryString(e)}}return""},getValue:function(b){b=$(b);var d=b.tagName.toLowerCase();return Form.Element.Serializers[d](b)},setValue:function(b,d){b=$(b);var e=b.tagName.toLowerCase();Form.Element.Serializers[e](b,d);return b},clear:function(b){$(b).value="";return b},present:function(b){return $(b).value!=""},activate:function(b){b=$(b);try{b.focus();if(b.select&&(b.tagName.toLowerCase()!="input"||!(/^(?:button|reset|submit)$/i.test(b.type)))){b.select()}}catch(d){}return b},disable:function(b){b=$(b);b.disabled=true;return b},enable:function(b){b=$(b);b.disabled=false;return b}};var Field=Form.Element;var $F=Form.Element.Methods.getValue;Form.Element.Serializers=(function(){function d(n,o){switch(n.type.toLowerCase()){case"checkbox":case"radio":return h(n,o);default:return g(n,o)}}function h(n,o){if(Object.isUndefined(o)){return n.checked?n.value:null}else{n.checked=!!o}}function g(n,o){if(Object.isUndefined(o)){return n.value}else{n.value=o}}function b(p,s){if(Object.isUndefined(s)){return(p.type==="select-one"?e:f)(p)}var o,q,t=!Object.isArray(s);for(var n=0,r=p.length;n=0?l(o.options[n]):null}function f(q){var n,r=q.length;if(!r){return null}for(var p=0,n=[];p=this.offset[1]&&e=this.offset[0]&&b=this.offset[1]&&this.ycomp=this.offset[0]&&this.xcomp0})._each(b)},set:function(b){this.element.className=b},add:function(b){if(this.include(b)){return}this.set($A(this).concat(b).join(" "))},remove:function(b){if(!this.include(b)){return}this.set($A(this).without(b).join(" "))},toString:function(){return $A(this).join(" ")}};Object.extend(Element.ClassNames.prototype,Enumerable);(function(){window.Selector=Class.create({initialize:function(b){this.expression=b.strip()},findElements:function(b){return Prototype.Selector.select(this.expression,b)},match:function(b){return Prototype.Selector.match(b,this.expression)},toString:function(){return this.expression},inspect:function(){return"#"}});Object.extend(Selector,{matchElements:function(h,l){var b=Prototype.Selector.match,f=[];for(var e=0,g=h.length;e0){if(typeof arguments[0]=="string"){e=arguments[0];d=1}else{e=arguments[0]?arguments[0].id:null}}if(!e){e="window_"+new Date().getTime()}if($(e)){alert("Window "+e+" is already registered in the DOM! Make sure you use setDestroyOnClose() or destroyOnClose: true in the constructor")}this.options=Object.extend({className:"dialog",windowClassName:null,blurClassName:null,minWidth:100,minHeight:20,resizable:true,closable:true,minimizable:true,maximizable:true,draggable:true,userData:null,showEffect:(Window.hasEffectLib?Effect.Appear:Element.show),hideEffect:(Window.hasEffectLib?Effect.Fade:Element.hide),showEffectOptions:{},hideEffectOptions:{},effectOptions:null,parent:document.body,title:" ",url:null,onload:Prototype.emptyFunction,width:200,height:300,opacity:1,recenterAuto:true,wiredDrag:false,closeOnEsc:true,closeCallback:null,destroyOnClose:false,gridX:1,gridY:1},arguments[d]||{});if(this.options.blurClassName){this.options.focusClassName=this.options.className}if(typeof this.options.top=="undefined"&&typeof this.options.bottom=="undefined"){this.options.top=this._round(Math.random()*500,this.options.gridY)}if(typeof this.options.left=="undefined"&&typeof this.options.right=="undefined"){this.options.left=this._round(Math.random()*500,this.options.gridX)}if(this.options.effectOptions){Object.extend(this.options.hideEffectOptions,this.options.effectOptions);Object.extend(this.options.showEffectOptions,this.options.effectOptions);if(this.options.showEffect==Element.Appear){this.options.showEffectOptions.to=this.options.opacity}}if(Window.hasEffectLib){if(this.options.showEffect==Effect.Appear){this.options.showEffectOptions.to=this.options.opacity}if(this.options.hideEffect==Effect.Fade){this.options.hideEffectOptions.from=this.options.opacity}}if(this.options.hideEffect==Element.hide){this.options.hideEffect=function(){Element.hide(this.element);if(this.options.destroyOnClose){this.destroy()}}.bind(this)}if(this.options.parent!=document.body){this.options.parent=$(this.options.parent)}this.element=this._createWindow(e);this.element.win=this;this.eventMouseDown=this._initDrag.bindAsEventListener(this);this.eventMouseUp=this._endDrag.bindAsEventListener(this);this.eventMouseMove=this._updateDrag.bindAsEventListener(this);this.eventOnLoad=this._getWindowBorderSize.bindAsEventListener(this);this.eventMouseDownContent=this.toFront.bindAsEventListener(this);this.eventResize=this._recenter.bindAsEventListener(this);this.eventKeyUp=this._keyUp.bindAsEventListener(this);this.topbar=$(this.element.id+"_top");this.bottombar=$(this.element.id+"_bottom");this.content=$(this.element.id+"_content");Event.observe(this.topbar,"mousedown",this.eventMouseDown);Event.observe(this.bottombar,"mousedown",this.eventMouseDown);Event.observe(this.content,"mousedown",this.eventMouseDownContent);Event.observe(window,"load",this.eventOnLoad);Event.observe(window,"resize",this.eventResize);Event.observe(window,"scroll",this.eventResize);Event.observe(document,"keyup",this.eventKeyUp);Event.observe(this.options.parent,"scroll",this.eventResize);if(this.options.draggable){var b=this;[this.topbar,this.topbar.up().previous(),this.topbar.up().next()].each(function(f){f.observe("mousedown",b.eventMouseDown);f.addClassName("top_draggable")});[this.bottombar.up(),this.bottombar.up().previous(),this.bottombar.up().next()].each(function(f){f.observe("mousedown",b.eventMouseDown);f.addClassName("bottom_draggable")})}if(this.options.resizable){this.sizer=$(this.element.id+"_sizer");Event.observe(this.sizer,"mousedown",this.eventMouseDown)}this.useLeft=null;this.useTop=null;if(typeof this.options.left!="undefined"){this.element.setStyle({left:parseFloat(this.options.left)+"px"});this.useLeft=true}else{this.element.setStyle({right:parseFloat(this.options.right)+"px"});this.useLeft=false}if(typeof this.options.top!="undefined"){this.element.setStyle({top:parseFloat(this.options.top)+"px"});this.useTop=true}else{this.element.setStyle({bottom:parseFloat(this.options.bottom)+"px"});this.useTop=false}this.storedLocation=null;this.setOpacity(this.options.opacity);if(this.options.zIndex){this.setZIndex(this.options.zIndex)}else{this.setZIndex(this.getMaxZIndex())}if(this.options.destroyOnClose){this.setDestroyOnClose(true)}this._getWindowBorderSize();this.width=this.options.width;this.height=this.options.height;this.visible=false;this.constraint=false;this.constraintPad={top:0,left:0,bottom:0,right:0};if(this.width&&this.height){this.setSize(this.options.width,this.options.height)}this.setTitle(this.options.title);Windows.register(this)},getMaxZIndex:function(){var b=0,d;var g=document.body.childNodes;for(d=0;d ';$(this.getId()+"_table_content").innerHTML=d;this.content=$(this.element.id+"_content")}this.getContent().innerHTML=b},setAjaxContent:function(d,b,f,e){this.showFunction=f?"showCenter":"show";this.showModal=e||false;b=b||{};this.setHTMLContent("");this.onComplete=b.onComplete;if(!this._onCompleteHandler){this._onCompleteHandler=this._setAjaxContent.bind(this)}b.onComplete=this._onCompleteHandler;new Ajax.Request(d,b);b.onComplete=this.onComplete},_setAjaxContent:function(b){Element.update(this.getContent(),b.responseText);if(this.onComplete){this.onComplete(b)}this.onComplete=null;this[this.showFunction](this.showModal)},setURL:function(b){if(this.options.url){this.content.src=null}this.options.url=b;var d="";$(this.getId()+"_table_content").innerHTML=d;this.content=$(this.element.id+"_content")},getURL:function(){return this.options.url?this.options.url:null},refresh:function(){if(this.options.url){$(this.element.getAttribute("id")+"_content").src=this.options.url}},setCookie:function(d,e,t,g,b){d=d||this.element.id;this.cookie=[d,e,t,g,b];var r=WindowUtilities.getCookie(d);if(r){var s=r.split(",");var p=s[0].split(":");var o=s[1].split(":");var q=parseFloat(s[2]),l=parseFloat(s[3]);var n=s[4];var f=s[5];this.setSize(q,l);if(n=="true"){this.doMinimize=true}else{if(f=="true"){this.doMaximize=true}}this.useLeft=p[0]=="l";this.useTop=o[0]=="t";this.element.setStyle(this.useLeft?{left:p[1]}:{right:p[1]});this.element.setStyle(this.useTop?{top:o[1]}:{bottom:o[1]})}},getId:function(){return this.element.id},setDestroyOnClose:function(){this.options.destroyOnClose=true},setConstraint:function(b,d){this.constraint=b;this.constraintPad=Object.extend(this.constraintPad,d||{});if(this.useTop&&this.useLeft){this.setLocation(parseFloat(this.element.style.top),parseFloat(this.element.style.left))}},_initDrag:function(d){if(Event.element(d)==this.sizer&&this.isMinimized()){return}if(Event.element(d)!=this.sizer&&this.isMaximized()){return}if(Prototype.Browser.IE&&this.heightN==0){this._getWindowBorderSize()}this.pointer=[this._round(Event.pointerX(d),this.options.gridX),this._round(Event.pointerY(d),this.options.gridY)];if(this.options.wiredDrag){this.currentDrag=this._createWiredElement()}else{this.currentDrag=this.element}if(Event.element(d)==this.sizer){this.doResize=true;this.widthOrg=this.width;this.heightOrg=this.height;this.bottomOrg=parseFloat(this.element.getStyle("bottom"));this.rightOrg=parseFloat(this.element.getStyle("right"));this._notify("onStartResize")}else{this.doResize=false;var b=$(this.getId()+"_close");if(b&&Position.within(b,this.pointer[0],this.pointer[1])){this.currentDrag=null;return}this.toFront();if(!this.options.draggable){return}this._notify("onStartMove")}Event.observe(document,"mouseup",this.eventMouseUp,false);Event.observe(document,"mousemove",this.eventMouseMove,false);WindowUtilities.disableScreen("__invisible__","__invisible__",this.overlayOpacity);document.body.ondrag=function(){return false};document.body.onselectstart=function(){return false};this.currentDrag.show();Event.stop(d)},_round:function(d,b){return b==1?d:d=Math.floor(d/b)*b},_updateDrag:function(d){var b=[this._round(Event.pointerX(d),this.options.gridX),this._round(Event.pointerY(d),this.options.gridY)];var q=b[0]-this.pointer[0];var p=b[1]-this.pointer[1];if(this.doResize){var o=this.widthOrg+q;var f=this.heightOrg+p;q=this.width-this.widthOrg;p=this.height-this.heightOrg;if(this.useLeft){o=this._updateWidthConstraint(o)}else{this.currentDrag.setStyle({right:(this.rightOrg-q)+"px"})}if(this.useTop){f=this._updateHeightConstraint(f)}else{this.currentDrag.setStyle({bottom:(this.bottomOrg-p)+"px"})}this.setSize(o,f);this._notify("onResize")}else{this.pointer=b;if(this.useLeft){var e=parseFloat(this.currentDrag.getStyle("left"))+q;var n=this._updateLeftConstraint(e);this.pointer[0]+=n-e;this.currentDrag.setStyle({left:n+"px"})}else{this.currentDrag.setStyle({right:parseFloat(this.currentDrag.getStyle("right"))-q+"px"})}if(this.useTop){var l=parseFloat(this.currentDrag.getStyle("top"))+p;var g=this._updateTopConstraint(l);this.pointer[1]+=g-l;this.currentDrag.setStyle({top:g+"px"})}else{this.currentDrag.setStyle({bottom:parseFloat(this.currentDrag.getStyle("bottom"))-p+"px"})}this._notify("onMove")}if(this.iefix){this._fixIEOverlapping()}this._removeStoreLocation();Event.stop(d)},_endDrag:function(b){WindowUtilities.enableScreen("__invisible__");if(this.doResize){this._notify("onEndResize")}else{this._notify("onEndMove")}Event.stopObserving(document,"mouseup",this.eventMouseUp,false);Event.stopObserving(document,"mousemove",this.eventMouseMove,false);Event.stop(b);this._hideWiredElement();this._saveCookie();document.body.ondrag=null;document.body.onselectstart=null},_updateLeftConstraint:function(d){if(this.constraint&&this.useLeft&&this.useTop){var b=this.options.parent==document.body?WindowUtilities.getPageSize().windowWidth:this.options.parent.getDimensions().width;if(db-this.constraintPad.right){d=b-this.constraintPad.right-this.width-this.widthE-this.widthW}}return d},_updateTopConstraint:function(e){if(this.constraint&&this.useLeft&&this.useTop){var b=this.options.parent==document.body?WindowUtilities.getPageSize().windowHeight:this.options.parent.getDimensions().height;var d=this.height+this.heightN+this.heightS;if(eb-this.constraintPad.bottom){e=b-this.constraintPad.bottom-d}}return e},_updateWidthConstraint:function(b){if(this.constraint&&this.useLeft&&this.useTop){var d=this.options.parent==document.body?WindowUtilities.getPageSize().windowWidth:this.options.parent.getDimensions().width;var e=parseFloat(this.element.getStyle("left"));if(e+b+this.widthE+this.widthW>d-this.constraintPad.right){b=d-this.constraintPad.right-e-this.widthE-this.widthW}}return b},_updateHeightConstraint:function(d){if(this.constraint&&this.useLeft&&this.useTop){var b=this.options.parent==document.body?WindowUtilities.getPageSize().windowHeight:this.options.parent.getDimensions().height;var e=parseFloat(this.element.getStyle("top"));if(e+d+this.heightN+this.heightS>b-this.constraintPad.bottom){d=b-this.constraintPad.bottom-e-this.heightN-this.heightS}}return d},_createWindow:function(b){var h=this.options.className;var f=document.createElement("div");f.setAttribute("id",b);f.className="dialog";if(this.options.windowClassName){f.className+=" "+this.options.windowClassName}var g;if(this.options.url){g=''}else{g='
'}var l=this.options.closable?"
":"";var n=this.options.minimizable?"
":"";var o=this.options.maximizable?"
":"";var e=this.options.resizable?"class='"+h+"_sizer' id='"+b+"_sizer'":"class='"+h+"_se'";var d="../themes/default/blank.gif";f.innerHTML=l+n+o+"
"+this.options.title+"
"+g+"
";Element.hide(f);this.options.parent.insertBefore(f,this.options.parent.firstChild);Event.observe($(b+"_content"),"load",this.options.onload);return f},changeClassName:function(b){var d=this.options.className;var e=this.getId();$A(["_close","_minimize","_maximize","_sizer","_content"]).each(function(f){this._toggleClassName($(e+f),d+f,b+f)}.bind(this));this._toggleClassName($(e+"_top"),d+"_title",b+"_title");$$("#"+e+" td").each(function(f){f.className=f.className.sub(d,b)});this.options.className=b},_toggleClassName:function(e,d,b){if(e){e.removeClassName(d);e.addClassName(b)}},setLocation:function(f,d){f=this._updateTopConstraint(f);d=this._updateLeftConstraint(d);var b=this.currentDrag||this.element;b.setStyle({top:f+"px"});b.setStyle({left:d+"px"});this.useLeft=true;this.useTop=true},getLocation:function(){var b={};if(this.useTop){b=Object.extend(b,{top:this.element.getStyle("top")})}else{b=Object.extend(b,{bottom:this.element.getStyle("bottom")})}if(this.useLeft){b=Object.extend(b,{left:this.element.getStyle("left")})}else{b=Object.extend(b,{right:this.element.getStyle("right")})}return b},getSize:function(){return{width:this.width,height:this.height}},setSize:function(f,d,b){f=parseFloat(f);d=parseFloat(d);if(!this.minimized&&fthis.options.maxHeight){d=this.options.maxHeight}if(this.options.maxWidth&&f>this.options.maxWidth){f=this.options.maxWidth}if(this.useTop&&this.useLeft&&Window.hasEffectLib&&Effect.ResizeWindow&&b){new Effect.ResizeWindow(this,null,null,f,d,{duration:Window.resizeEffectDuration})}else{this.width=f;this.height=d;var h=this.currentDrag?this.currentDrag:this.element;h.setStyle({width:f+this.widthW+this.widthE+"px"});h.setStyle({height:d+this.heightN+this.heightS+"px"});if(!this.currentDrag||this.currentDrag==this.element){var g=$(this.element.id+"_content");g.setStyle({height:d+"px"});g.setStyle({width:f+"px"})}}},updateHeight:function(){this.setSize(this.width,this.content.scrollHeight,true)},updateWidth:function(){this.setSize(this.content.scrollWidth,this.height,true)},toFront:function(){if(this.element.style.zIndex0)&&(navigator.userAgent.indexOf("Opera")<0)&&(this.element.getStyle("position")=="absolute")){new Insertion.After(this.element.id,'');this.iefix=$(this.element.id+"_iefix")}if(this.iefix){setTimeout(this._fixIEOverlapping.bind(this),50)}},_fixIEOverlapping:function(){Position.clone(this.element,this.iefix);this.iefix.style.zIndex=this.element.style.zIndex-1;this.iefix.show()},_keyUp:function(b){if(27==b.keyCode&&this.options.closeOnEsc){this.close()}},_getWindowBorderSize:function(d){var e=this._createHiddenDiv(this.options.className+"_n");this.heightN=Element.getDimensions(e).height;e.parentNode.removeChild(e);var e=this._createHiddenDiv(this.options.className+"_s");this.heightS=Element.getDimensions(e).height;e.parentNode.removeChild(e);var e=this._createHiddenDiv(this.options.className+"_e");this.widthE=Element.getDimensions(e).width;e.parentNode.removeChild(e);var e=this._createHiddenDiv(this.options.className+"_w");this.widthW=Element.getDimensions(e).width;e.parentNode.removeChild(e);var e=document.createElement("div");e.className="overlay_"+this.options.className;document.body.appendChild(e);var b=this;setTimeout(function(){b.overlayOpacity=($(e).getStyle("opacity"));e.parentNode.removeChild(e)},10);if(Prototype.Browser.IE){this.heightS=$(this.getId()+"_row3").getDimensions().height;this.heightN=$(this.getId()+"_row1").getDimensions().height}if(Prototype.Browser.WebKit&&Prototype.Browser.WebKitVersion<420){this.setSize(this.width,this.height)}if(this.doMaximize){this.maximize()}if(this.doMinimize){this.minimize()}},_createHiddenDiv:function(d){var b=document.body;var e=document.createElement("div");e.setAttribute("id",this.element.id+"_tmp");e.className=d;e.style.display="none";e.innerHTML="";b.insertBefore(e,b.firstChild);return e},_storeLocation:function(){if(this.storedLocation==null){this.storedLocation={useTop:this.useTop,useLeft:this.useLeft,top:this.element.getStyle("top"),bottom:this.element.getStyle("bottom"),left:this.element.getStyle("left"),right:this.element.getStyle("right"),width:this.width,height:this.height}}},_restoreLocation:function(){if(this.storedLocation!=null){this.useLeft=this.storedLocation.useLeft;this.useTop=this.storedLocation.useTop;if(this.useLeft&&this.useTop&&Window.hasEffectLib&&Effect.ResizeWindow){new Effect.ResizeWindow(this,this.storedLocation.top,this.storedLocation.left,this.storedLocation.width,this.storedLocation.height,{duration:Window.resizeEffectDuration})}else{this.element.setStyle(this.useLeft?{left:this.storedLocation.left}:{right:this.storedLocation.right});this.element.setStyle(this.useTop?{top:this.storedLocation.top}:{bottom:this.storedLocation.bottom});this.setSize(this.storedLocation.width,this.storedLocation.height)}Windows.resetOverflow();this._removeStoreLocation()}},_removeStoreLocation:function(){this.storedLocation=null},_saveCookie:function(){if(this.cookie){var b="";if(this.useLeft){b+="l:"+(this.storedLocation?this.storedLocation.left:this.element.getStyle("left"))}else{b+="r:"+(this.storedLocation?this.storedLocation.right:this.element.getStyle("right"))}if(this.useTop){b+=",t:"+(this.storedLocation?this.storedLocation.top:this.element.getStyle("top"))}else{b+=",b:"+(this.storedLocation?this.storedLocation.bottom:this.element.getStyle("bottom"))}b+=","+(this.storedLocation?this.storedLocation.width:this.width);b+=","+(this.storedLocation?this.storedLocation.height:this.height);b+=","+this.isMinimized();b+=","+this.isMaximized();WindowUtilities.setCookie(b,this.cookie)}},_createWiredElement:function(){if(!this.wiredElement){if(Prototype.Browser.IE){this._getWindowBorderSize()}var d=document.createElement("div");d.className="wired_frame "+this.options.className+"_wired_frame";d.style.position="absolute";this.options.parent.insertBefore(d,this.options.parent.firstChild);this.wiredElement=$(d)}if(this.useLeft){this.wiredElement.setStyle({left:this.element.getStyle("left")})}else{this.wiredElement.setStyle({right:this.element.getStyle("right")})}if(this.useTop){this.wiredElement.setStyle({top:this.element.getStyle("top")})}else{this.wiredElement.setStyle({bottom:this.element.getStyle("bottom")})}var b=this.element.getDimensions();this.wiredElement.setStyle({width:b.width+"px",height:b.height+"px"});this.wiredElement.setStyle({zIndex:Windows.maxZIndex+30});return this.wiredElement},_hideWiredElement:function(){if(!this.wiredElement||!this.currentDrag){return}if(this.currentDrag==this.element){this.currentDrag=null}else{if(this.useLeft){this.element.setStyle({left:this.currentDrag.getStyle("left")})}else{this.element.setStyle({right:this.currentDrag.getStyle("right")})}if(this.useTop){this.element.setStyle({top:this.currentDrag.getStyle("top")})}else{this.element.setStyle({bottom:this.currentDrag.getStyle("bottom")})}this.currentDrag.hide();this.currentDrag=null;if(this.doResize){this.setSize(this.width,this.height)}}},_notify:function(b){if(this.options[b]){this.options[b](this)}else{Windows.notify(b,this)}}};var Windows={windows:[],modalWindows:[],observers:[],focusedWindow:null,maxZIndex:0,overlayShowEffectOptions:{duration:0.5},overlayHideEffectOptions:{duration:0.5},addObserver:function(b){this.removeObserver(b);this.observers.push(b)},removeObserver:function(b){this.observers=this.observers.reject(function(d){return d==b})},notify:function(b,d){this.observers.each(function(e){if(e[b]){e[b](b,d)}})},getWindow:function(b){return this.windows.detect(function(e){return e.getId()==b})},getFocusedWindow:function(){return this.focusedWindow},updateFocusedWindow:function(){this.focusedWindow=this.windows.length>=2?this.windows[this.windows.length-2]:null},register:function(b){this.windows.push(b)},addModalWindow:function(b){if(this.modalWindows.length==0){WindowUtilities.disableScreen(b.options.className,"overlay_modal",b.overlayOpacity,b.getId(),b.options.parent)}else{if(Window.keepMultiModalWindow){$("overlay_modal").style.zIndex=Windows.maxZIndex+1;Windows.maxZIndex+=1;WindowUtilities._hideSelect(this.modalWindows.last().getId())}else{this.modalWindows.last().element.hide()}WindowUtilities._showSelect(b.getId())}this.modalWindows.push(b)},removeModalWindow:function(b){this.modalWindows.pop();if(this.modalWindows.length==0){WindowUtilities.enableScreen()}else{if(Window.keepMultiModalWindow){this.modalWindows.last().toFront();WindowUtilities._showSelect(this.modalWindows.last().getId())}else{this.modalWindows.last().element.show()}}},register:function(b){this.windows.push(b)},unregister:function(b){this.windows=this.windows.reject(function(e){return e==b})},closeAll:function(){this.windows.each(function(b){Windows.close(b.getId())})},closeAllModalWindows:function(){WindowUtilities.enableScreen();this.modalWindows.each(function(b){if(b){b.close()}})},minimize:function(e,b){var d=this.getWindow(e);if(d&&d.visible){d.minimize()}Event.stop(b)},maximize:function(e,b){var d=this.getWindow(e);if(d&&d.visible){d.maximize()}Event.stop(b)},close:function(e,b){var d=this.getWindow(e);if(d){d.close()}if(b){Event.stop(b)}},blur:function(d){var b=this.getWindow(d);if(!b){return}if(b.options.blurClassName){b.changeClassName(b.options.blurClassName)}if(this.focusedWindow==b){this.focusedWindow=null}b._notify("onBlur")},focus:function(d){var b=this.getWindow(d);if(!b){return}if(this.focusedWindow){this.blur(this.focusedWindow.getId())}if(b.options.focusClassName){b.changeClassName(b.options.focusClassName)}this.focusedWindow=b;b._notify("onFocus")},unsetOverflow:function(b){this.windows.each(function(e){e.oldOverflow=e.getContent().getStyle("overflow")||"auto";e.getContent().setStyle({overflow:"hidden"})});if(b&&b.oldOverflow){b.getContent().setStyle({overflow:b.oldOverflow})}},resetOverflow:function(){this.windows.each(function(b){if(b.oldOverflow){b.getContent().setStyle({overflow:b.oldOverflow})}})},updateZindex:function(b,d){if(b>this.maxZIndex){this.maxZIndex=b;if(this.focusedWindow){this.blur(this.focusedWindow.getId())}}this.focusedWindow=d;if(this.focusedWindow){this.focus(this.focusedWindow.getId())}}};var Dialog={dialogId:null,onCompleteFunc:null,callFunc:null,parameters:null,confirm:function(f,e){if(f&&typeof f!="string"){Dialog._runAjaxRequest(f,e,Dialog.confirm);return}f=f||"";e=e||{};var h=e.okLabel?e.okLabel:"Ok";var b=e.cancelLabel?e.cancelLabel:"Cancel";e=Object.extend(e,e.windowParameters||{});e.windowParameters=e.windowParameters||{};e.className=e.className||"alert";var d="class ='"+(e.buttonClass?e.buttonClass+" ":"")+" ok_button'";var g="class ='"+(e.buttonClass?e.buttonClass+" ":"")+" cancel_button'";var f="
"+f+"
";return this._openDialog(f,e)},alert:function(e,d){if(e&&typeof e!="string"){Dialog._runAjaxRequest(e,d,Dialog.alert);return}e=e||"";d=d||{};var f=d.okLabel?d.okLabel:"Ok";d=Object.extend(d,d.windowParameters||{});d.windowParameters=d.windowParameters||{};d.className=d.className||"alert";var b="class ='"+(d.buttonClass?d.buttonClass+" ":"")+" ok_button'";var e="
"+e+"
";return this._openDialog(e,d)},info:function(d,b){if(d&&typeof d!="string"){Dialog._runAjaxRequest(d,b,Dialog.info);return}d=d||"";b=b||{};b=Object.extend(b,b.windowParameters||{});b.windowParameters=b.windowParameters||{};b.className=b.className||"alert";var d="";if(b.showProgress){d+=""}b.ok=null;b.cancel=null;return this._openDialog(d,b)},setInfoMessage:function(b){$("modal_dialog_message").update(b)},closeInfo:function(){Windows.close(this.dialogId)},_openDialog:function(g,f){var e=f.className;if(!f.height&&!f.width){f.width=WindowUtilities.getPageSize(f.options.parent||document.body).pageWidth/2}if(f.id){this.dialogId=f.id}else{var d=new Date();this.dialogId="modal_dialog_"+d.getTime();f.id=this.dialogId}if(!f.height||!f.width){var b=WindowUtilities._computeSize(g,this.dialogId,f.width,f.height,5,e);if(f.height){f.width=b+5}else{f.height=b+5}}f.effectOptions=f.effectOptions;f.resizable=f.resizable||false;f.minimizable=f.minimizable||false;f.maximizable=f.maximizable||false;f.draggable=f.draggable||false;f.closable=f.closable||false;var h=new Window(f);h.getContent().innerHTML=g;h.showCenter(true,f.top,f.left);h.setDestroyOnClose();h.cancelCallback=f.onCancel||f.cancel;h.okCallback=f.onOk||f.ok;return h},_getAjaxContent:function(b){Dialog.callFunc(b.responseText,Dialog.parameters)},_runAjaxRequest:function(e,d,b){if(e.options==null){e.options={}}Dialog.onCompleteFunc=e.options.onComplete;Dialog.parameters=d;Dialog.callFunc=b;e.options.onComplete=Dialog._getAjaxContent;new Ajax.Request(e.url,e.options)},okCallback:function(){var b=Windows.focusedWindow;if(!b.okCallback||b.okCallback(b)){$$("#"+b.getId()+" input").each(function(d){d.onclick=null});b.close()}},cancelCallback:function(){var b=Windows.focusedWindow;$$("#"+b.getId()+" input").each(function(d){d.onclick=null});b.close();if(b.cancelCallback){b.cancelCallback(b)}}};if(Prototype.Browser.WebKit){var array=navigator.userAgent.match(new RegExp(/AppleWebKit\/([\d\.\+]*)/));Prototype.Browser.WebKitVersion=parseFloat(array[1])}var WindowUtilities={getWindowScroll:function(parent){var T,L,W,H;parent=parent||document.body;if(parent!=document.body){T=parent.scrollTop;L=parent.scrollLeft;W=parent.scrollWidth;H=parent.scrollHeight}else{var w=window;with(w.document){if(w.document.documentElement&&documentElement.scrollTop){T=documentElement.scrollTop;L=documentElement.scrollLeft}else{if(w.document.body){T=body.scrollTop;L=body.scrollLeft}}if(w.innerWidth){W=w.innerWidth;H=w.innerHeight}else{if(w.document.documentElement&&documentElement.clientWidth){W=documentElement.clientWidth;H=documentElement.clientHeight}else{W=body.offsetWidth;H=body.offsetHeight}}}}return{top:T,left:L,width:W,height:H}},getPageSize:function(f){f=f||document.body;var e,l;var g,d;if(f!=document.body){e=f.getWidth();l=f.getHeight();d=f.scrollWidth;g=f.scrollHeight}else{var h,b;if(window.innerHeight&&window.scrollMaxY){h=document.body.scrollWidth;b=window.innerHeight+window.scrollMaxY}else{if(document.body.scrollHeight>document.body.offsetHeight){h=document.body.scrollWidth;b=document.body.scrollHeight}else{h=document.body.offsetWidth;b=document.body.offsetHeight}}if(self.innerHeight){e=document.documentElement.clientWidth;l=self.innerHeight}else{if(document.documentElement&&document.documentElement.clientHeight){e=document.documentElement.clientWidth;l=document.documentElement.clientHeight}else{if(document.body){e=document.body.clientWidth;l=document.body.clientHeight}}}if(b"}catch(h){}var g=d.firstChild||null;if(g&&(g.tagName.toUpperCase()!=b)){g=g.getElementsByTagName(b)[0]}if(!g){g=document.createElement(b)}if(!g){return}if(arguments[1]){if(this._isStringOrNumber(arguments[1])||(arguments[1] instanceof Array)||arguments[1].tagName){this._children(g,arguments[1])}else{var f=this._attributes(arguments[1]);if(f.length){try{d.innerHTML="<"+b+" "+f+">"}catch(h){}g=d.firstChild||null;if(!g){g=document.createElement(b);for(attr in arguments[1]){g[attr=="class"?"className":attr]=arguments[1][attr]}}if(g.tagName.toUpperCase()!=b){g=d.getElementsByTagName(b)[0]}}}}if(arguments[2]){this._children(g,arguments[2])}return $(g)},_text:function(b){return document.createTextNode(b)},ATTR_MAP:{className:"class",htmlFor:"for"},_attributes:function(b){var d=[];for(attribute in b){d.push((attribute in this.ATTR_MAP?this.ATTR_MAP[attribute]:attribute)+'="'+b[attribute].toString().escapeHTML().gsub(/"/,""")+'"')}return d.join(" ")},_children:function(d,b){if(b.tagName){d.appendChild(b);return}if(typeof b=="object"){b.flatten().each(function(f){if(typeof f=="object"){d.appendChild(f)}else{if(Builder._isStringOrNumber(f)){d.appendChild(Builder._text(f))}}})}else{if(Builder._isStringOrNumber(b)){d.appendChild(Builder._text(b))}}},_isStringOrNumber:function(b){return(typeof b=="string"||typeof b=="number")},build:function(d){var b=this.node("div");$(b).update(d.strip());return b.down()},dump:function(d){if(typeof d!="object"&&typeof d!="function"){d=window}var b=("A ABBR ACRONYM ADDRESS APPLET AREA B BASE BASEFONT BDO BIG BLOCKQUOTE BODY BR BUTTON CAPTION CENTER CITE CODE COL COLGROUP DD DEL DFN DIR DIV DL DT EM FIELDSET FONT FORM FRAME FRAMESET H1 H2 H3 H4 H5 H6 HEAD HR HTML I IFRAME IMG INPUT INS ISINDEX KBD LABEL LEGEND LI LINK MAP MENU META NOFRAMES NOSCRIPT OBJECT OL OPTGROUP OPTION P PARAM PRE Q S SAMP SCRIPT SELECT SMALL SPAN STRIKE STRONG STYLE SUB SUP TABLE TBODY TD TEXTAREA TFOOT TH THEAD TITLE TR TT U UL VAR").split(/\s+/);b.each(function(e){d[e]=function(){return Builder.node.apply(Builder,[e].concat($A(arguments)))}})}};String.prototype.parseColor=function(){var b="#";if(this.slice(0,4)=="rgb("){var e=this.slice(4,this.length-1).split(",");var d=0;do{b+=parseInt(e[d]).toColorPart()}while(++d<3)}else{if(this.slice(0,1)=="#"){if(this.length==4){for(var d=1;d<4;d++){b+=(this.charAt(d)+this.charAt(d)).toLowerCase()}}if(this.length==7){b=this.toLowerCase()}}}return(b.length==7?b:(arguments[0]||this))};Element.collectTextNodes=function(b){return $A($(b).childNodes).collect(function(d){return(d.nodeType==3?d.nodeValue:(d.hasChildNodes()?Element.collectTextNodes(d):""))}).flatten().join("")};Element.collectTextNodesIgnoreClass=function(b,d){return $A($(b).childNodes).collect(function(e){return(e.nodeType==3?e.nodeValue:((e.hasChildNodes()&&!Element.hasClassName(e,d))?Element.collectTextNodesIgnoreClass(e,d):""))}).flatten().join("")};Element.setContentZoom=function(b,d){b=$(b);b.setStyle({fontSize:(d/100)+"em"});if(Prototype.Browser.WebKit){window.scrollBy(0,0)}return b};Element.getInlineOpacity=function(b){return $(b).style.opacity||""};Element.forceRerendering=function(b){try{b=$(b);var f=document.createTextNode(" ");b.appendChild(f);b.removeChild(f)}catch(d){}};var Effect={_elementDoesNotExistError:{name:"ElementDoesNotExistError",message:"The specified DOM element does not exist, but is required for this effect to operate"},Transitions:{linear:Prototype.K,sinoidal:function(b){return(-Math.cos(b*Math.PI)/2)+0.5},reverse:function(b){return 1-b},flicker:function(b){var b=((-Math.cos(b*Math.PI)/4)+0.75)+Math.random()/4;return b>1?1:b},wobble:function(b){return(-Math.cos(b*Math.PI*(9*b))/2)+0.5},pulse:function(d,b){return(-Math.cos((d*((b||5)-0.5)*2)*Math.PI)/2)+0.5},spring:function(b){return 1-(Math.cos(b*4.5*Math.PI)*Math.exp(-b*6))},none:function(b){return 0},full:function(b){return 1}},DefaultOptions:{duration:1,fps:100,sync:false,from:0,to:1,delay:0,queue:"parallel"},tagifyText:function(b){var d="position:relative";if(Prototype.Browser.IE){d+=";zoom:1"}b=$(b);$A(b.childNodes).each(function(e){if(e.nodeType==3){e.nodeValue.toArray().each(function(f){b.insertBefore(new Element("span",{style:d}).update(f==" "?String.fromCharCode(160):f),e)});Element.remove(e)}})},multiple:function(d,e){var g;if(((typeof d=="object")||Object.isFunction(d))&&(d.length)){g=d}else{g=$(d).childNodes}var b=Object.extend({speed:0.1,delay:0},arguments[2]||{});var f=b.delay;$A(g).each(function(l,h){new e(l,Object.extend(b,{delay:h*b.speed+f}))})},PAIRS:{slide:["SlideDown","SlideUp"],blind:["BlindDown","BlindUp"],appear:["Appear","Fade"]},toggle:function(d,e){d=$(d);e=(e||"appear").toLowerCase();var b=Object.extend({queue:{position:"end",scope:(d.id||"global"),limit:1}},arguments[2]||{});Effect[d.visible()?Effect.PAIRS[e][1]:Effect.PAIRS[e][0]](d,b)}};Effect.DefaultOptions.transition=Effect.Transitions.sinoidal;Effect.ScopedQueue=Class.create(Enumerable,{initialize:function(){this.effects=[];this.interval=null},_each:function(b){this.effects._each(b)},add:function(d){var e=new Date().getTime();var b=Object.isString(d.options.queue)?d.options.queue:d.options.queue.position;switch(b){case"front":this.effects.findAll(function(f){return f.state=="idle"}).each(function(f){f.startOn+=d.finishOn;f.finishOn+=d.finishOn});break;case"with-last":e=this.effects.pluck("startOn").max()||e;break;case"end":e=this.effects.pluck("finishOn").max()||e;break}d.startOn+=e;d.finishOn+=e;if(!d.options.queue.limit||(this.effects.length=this.startOn){if(e>=this.finishOn){this.render(1);this.cancel();this.event("beforeFinish");if(this.finish){this.finish()}this.event("afterFinish");return}var d=(e-this.startOn)/this.totalTime,b=(d*this.totalFrames).round();if(b>this.currentFrame){this.render(d);this.currentFrame=b}}},cancel:function(){if(!this.options.sync){Effect.Queues.get(Object.isString(this.options.queue)?"global":this.options.queue.scope).remove(this)}this.state="finished"},event:function(b){if(this.options[b+"Internal"]){this.options[b+"Internal"](this)}if(this.options[b]){this.options[b](this)}},inspect:function(){var b=$H();for(property in this){if(!Object.isFunction(this[property])){b.set(property,this[property])}}return"#"}});Effect.Parallel=Class.create(Effect.Base,{initialize:function(b){this.effects=b||[];this.start(arguments[1])},update:function(b){this.effects.invoke("render",b)},finish:function(b){this.effects.each(function(d){d.render(1);d.cancel();d.event("beforeFinish");if(d.finish){d.finish(b)}d.event("afterFinish")})}});Effect.Tween=Class.create(Effect.Base,{initialize:function(e,h,g){e=Object.isString(e)?$(e):e;var d=$A(arguments),f=d.last(),b=d.length==5?d[3]:null;this.method=Object.isFunction(f)?f.bind(e):Object.isFunction(e[f])?e[f].bind(e):function(l){e[f]=l};this.start(Object.extend({from:h,to:g},b||{}))},update:function(b){this.method(b)}});Effect.Event=Class.create(Effect.Base,{initialize:function(){this.start(Object.extend({duration:0},arguments[0]||{}))},update:Prototype.emptyFunction});Effect.Opacity=Class.create(Effect.Base,{initialize:function(d){this.element=$(d);if(!this.element){throw (Effect._elementDoesNotExistError)}if(Prototype.Browser.IE&&(!this.element.currentStyle.hasLayout)){this.element.setStyle({zoom:1})}var b=Object.extend({from:this.element.getOpacity()||0,to:1},arguments[1]||{});this.start(b)},update:function(b){this.element.setOpacity(b)}});Effect.Move=Class.create(Effect.Base,{initialize:function(d){this.element=$(d);if(!this.element){throw (Effect._elementDoesNotExistError)}var b=Object.extend({x:0,y:0,mode:"relative"},arguments[1]||{});this.start(b)},setup:function(){this.element.makePositioned();this.originalLeft=parseFloat(this.element.getStyle("left")||"0");this.originalTop=parseFloat(this.element.getStyle("top")||"0");if(this.options.mode=="absolute"){this.options.x=this.options.x-this.originalLeft;this.options.y=this.options.y-this.originalTop}},update:function(b){this.element.setStyle({left:(this.options.x*b+this.originalLeft).round()+"px",top:(this.options.y*b+this.originalTop).round()+"px"})}});Effect.MoveBy=function(d,b,e){return new Effect.Move(d,Object.extend({x:e,y:b},arguments[3]||{}))};Effect.Scale=Class.create(Effect.Base,{initialize:function(d,e){this.element=$(d);if(!this.element){throw (Effect._elementDoesNotExistError)}var b=Object.extend({scaleX:true,scaleY:true,scaleContent:true,scaleFromCenter:false,scaleMode:"box",scaleFrom:100,scaleTo:e},arguments[2]||{});this.start(b)},setup:function(){this.restoreAfterFinish=this.options.restoreAfterFinish||false;this.elementPositioning=this.element.getStyle("position");this.originalStyle={};["top","left","width","height","fontSize"].each(function(d){this.originalStyle[d]=this.element.style[d]}.bind(this));this.originalTop=this.element.offsetTop;this.originalLeft=this.element.offsetLeft;var b=this.element.getStyle("font-size")||"100%";["em","px","%","pt"].each(function(d){if(b.indexOf(d)>0){this.fontSize=parseFloat(b);this.fontSizeType=d}}.bind(this));this.factor=(this.options.scaleTo-this.options.scaleFrom)/100;this.dims=null;if(this.options.scaleMode=="box"){this.dims=[this.element.offsetHeight,this.element.offsetWidth]}if(/^content/.test(this.options.scaleMode)){this.dims=[this.element.scrollHeight,this.element.scrollWidth]}if(!this.dims){this.dims=[this.options.scaleMode.originalHeight,this.options.scaleMode.originalWidth]}},update:function(b){var d=(this.options.scaleFrom/100)+(this.factor*b);if(this.options.scaleContent&&this.fontSize){this.element.setStyle({fontSize:this.fontSize*d+this.fontSizeType})}this.setDimensions(this.dims[0]*d,this.dims[1]*d)},finish:function(b){if(this.restoreAfterFinish){this.element.setStyle(this.originalStyle)}},setDimensions:function(b,g){var h={};if(this.options.scaleX){h.width=g.round()+"px"}if(this.options.scaleY){h.height=b.round()+"px"}if(this.options.scaleFromCenter){var f=(b-this.dims[0])/2;var e=(g-this.dims[1])/2;if(this.elementPositioning=="absolute"){if(this.options.scaleY){h.top=this.originalTop-f+"px"}if(this.options.scaleX){h.left=this.originalLeft-e+"px"}}else{if(this.options.scaleY){h.top=-f+"px"}if(this.options.scaleX){h.left=-e+"px"}}}this.element.setStyle(h)}});Effect.Highlight=Class.create(Effect.Base,{initialize:function(d){this.element=$(d);if(!this.element){throw (Effect._elementDoesNotExistError)}var b=Object.extend({startcolor:"#ffff99"},arguments[1]||{});this.start(b)},setup:function(){if(this.element.getStyle("display")=="none"){this.cancel();return}this.oldStyle={};if(!this.options.keepBackgroundImage){this.oldStyle.backgroundImage=this.element.getStyle("background-image");this.element.setStyle({backgroundImage:"none"})}if(!this.options.endcolor){this.options.endcolor=this.element.getStyle("background-color").parseColor("#ffffff")}if(!this.options.restorecolor){this.options.restorecolor=this.element.getStyle("background-color")}this._base=$R(0,2).map(function(b){return parseInt(this.options.startcolor.slice(b*2+1,b*2+3),16)}.bind(this));this._delta=$R(0,2).map(function(b){return parseInt(this.options.endcolor.slice(b*2+1,b*2+3),16)-this._base[b]}.bind(this))},update:function(b){this.element.setStyle({backgroundColor:$R(0,2).inject("#",function(d,e,f){return d+((this._base[f]+(this._delta[f]*b)).round().toColorPart())}.bind(this))})},finish:function(){this.element.setStyle(Object.extend(this.oldStyle,{backgroundColor:this.options.restorecolor}))}});Effect.ScrollTo=function(e){var d=arguments[1]||{},b=document.viewport.getScrollOffsets(),f=$(e).cumulativeOffset();if(d.offset){f[1]+=d.offset}return new Effect.Tween(null,b.top,f[1],d,function(g){scrollTo(b.left,g.round())})};Effect.Fade=function(e){e=$(e);var b=e.getInlineOpacity();var d=Object.extend({from:e.getOpacity()||1,to:0,afterFinishInternal:function(f){if(f.options.to!=0){return}f.element.hide().setStyle({opacity:b})}},arguments[1]||{});return new Effect.Opacity(e,d)};Effect.Appear=function(d){d=$(d);var b=Object.extend({from:(d.getStyle("display")=="none"?0:d.getOpacity()||0),to:1,afterFinishInternal:function(e){e.element.forceRerendering()},beforeSetup:function(e){e.element.setOpacity(e.options.from).show()}},arguments[1]||{});return new Effect.Opacity(d,b)};Effect.Puff=function(d){d=$(d);var b={opacity:d.getInlineOpacity(),position:d.getStyle("position"),top:d.style.top,left:d.style.left,width:d.style.width,height:d.style.height};return new Effect.Parallel([new Effect.Scale(d,200,{sync:true,scaleFromCenter:true,scaleContent:true,restoreAfterFinish:true}),new Effect.Opacity(d,{sync:true,to:0})],Object.extend({duration:1,beforeSetupInternal:function(e){Position.absolutize(e.effects[0].element)},afterFinishInternal:function(e){e.effects[0].element.hide().setStyle(b)}},arguments[1]||{}))};Effect.BlindUp=function(b){b=$(b);b.makeClipping();return new Effect.Scale(b,0,Object.extend({scaleContent:false,scaleX:false,restoreAfterFinish:true,afterFinishInternal:function(d){d.element.hide().undoClipping()}},arguments[1]||{}))};Effect.BlindDown=function(d){d=$(d);var b=d.getDimensions();return new Effect.Scale(d,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:0,scaleMode:{originalHeight:b.height,originalWidth:b.width},restoreAfterFinish:true,afterSetup:function(e){e.element.makeClipping().setStyle({height:"0px"}).show()},afterFinishInternal:function(e){e.element.undoClipping()}},arguments[1]||{}))};Effect.SwitchOff=function(d){d=$(d);var b=d.getInlineOpacity();return new Effect.Appear(d,Object.extend({duration:0.4,from:0,transition:Effect.Transitions.flicker,afterFinishInternal:function(e){new Effect.Scale(e.element,1,{duration:0.3,scaleFromCenter:true,scaleX:false,scaleContent:false,restoreAfterFinish:true,beforeSetup:function(f){f.element.makePositioned().makeClipping()},afterFinishInternal:function(f){f.element.hide().undoClipping().undoPositioned().setStyle({opacity:b})}})}},arguments[1]||{}))};Effect.DropOut=function(d){d=$(d);var b={top:d.getStyle("top"),left:d.getStyle("left"),opacity:d.getInlineOpacity()};return new Effect.Parallel([new Effect.Move(d,{x:0,y:100,sync:true}),new Effect.Opacity(d,{sync:true,to:0})],Object.extend({duration:0.5,beforeSetup:function(e){e.effects[0].element.makePositioned()},afterFinishInternal:function(e){e.effects[0].element.hide().undoPositioned().setStyle(b)}},arguments[1]||{}))};Effect.Shake=function(f){f=$(f);var d=Object.extend({distance:20,duration:0.5},arguments[1]||{});var g=parseFloat(d.distance);var e=parseFloat(d.duration)/10;var b={top:f.getStyle("top"),left:f.getStyle("left")};return new Effect.Move(f,{x:g,y:0,duration:e,afterFinishInternal:function(h){new Effect.Move(h.element,{x:-g*2,y:0,duration:e*2,afterFinishInternal:function(l){new Effect.Move(l.element,{x:g*2,y:0,duration:e*2,afterFinishInternal:function(n){new Effect.Move(n.element,{x:-g*2,y:0,duration:e*2,afterFinishInternal:function(o){new Effect.Move(o.element,{x:g*2,y:0,duration:e*2,afterFinishInternal:function(p){new Effect.Move(p.element,{x:-g,y:0,duration:e,afterFinishInternal:function(q){q.element.undoPositioned().setStyle(b)}})}})}})}})}})}})};Effect.SlideDown=function(e){e=$(e).cleanWhitespace();var b=e.down().getStyle("bottom");var d=e.getDimensions();return new Effect.Scale(e,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:window.opera?0:1,scaleMode:{originalHeight:d.height,originalWidth:d.width},restoreAfterFinish:true,afterSetup:function(f){f.element.makePositioned();f.element.down().makePositioned();if(window.opera){f.element.setStyle({top:""})}f.element.makeClipping().setStyle({height:"0px"}).show()},afterUpdateInternal:function(f){f.element.down().setStyle({bottom:(f.dims[0]-f.element.clientHeight)+"px"})},afterFinishInternal:function(f){f.element.undoClipping().undoPositioned();f.element.down().undoPositioned().setStyle({bottom:b})}},arguments[1]||{}))};Effect.SlideUp=function(e){e=$(e).cleanWhitespace();var b=e.down().getStyle("bottom");var d=e.getDimensions();return new Effect.Scale(e,window.opera?0:1,Object.extend({scaleContent:false,scaleX:false,scaleMode:"box",scaleFrom:100,scaleMode:{originalHeight:d.height,originalWidth:d.width},restoreAfterFinish:true,afterSetup:function(f){f.element.makePositioned();f.element.down().makePositioned();if(window.opera){f.element.setStyle({top:""})}f.element.makeClipping().show()},afterUpdateInternal:function(f){f.element.down().setStyle({bottom:(f.dims[0]-f.element.clientHeight)+"px"})},afterFinishInternal:function(f){f.element.hide().undoClipping().undoPositioned();f.element.down().undoPositioned().setStyle({bottom:b})}},arguments[1]||{}))};Effect.Squish=function(b){return new Effect.Scale(b,window.opera?1:0,{restoreAfterFinish:true,beforeSetup:function(d){d.element.makeClipping()},afterFinishInternal:function(d){d.element.hide().undoClipping()}})};Effect.Grow=function(e){e=$(e);var d=Object.extend({direction:"center",moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.full},arguments[1]||{});var b={top:e.style.top,left:e.style.left,height:e.style.height,width:e.style.width,opacity:e.getInlineOpacity()};var l=e.getDimensions();var n,h;var g,f;switch(d.direction){case"top-left":n=h=g=f=0;break;case"top-right":n=l.width;h=f=0;g=-l.width;break;case"bottom-left":n=g=0;h=l.height;f=-l.height;break;case"bottom-right":n=l.width;h=l.height;g=-l.width;f=-l.height;break;case"center":n=l.width/2;h=l.height/2;g=-l.width/2;f=-l.height/2;break}return new Effect.Move(e,{x:n,y:h,duration:0.01,beforeSetup:function(o){o.element.hide().makeClipping().makePositioned()},afterFinishInternal:function(o){new Effect.Parallel([new Effect.Opacity(o.element,{sync:true,to:1,from:0,transition:d.opacityTransition}),new Effect.Move(o.element,{x:g,y:f,sync:true,transition:d.moveTransition}),new Effect.Scale(o.element,100,{scaleMode:{originalHeight:l.height,originalWidth:l.width},sync:true,scaleFrom:window.opera?1:0,transition:d.scaleTransition,restoreAfterFinish:true})],Object.extend({beforeSetup:function(p){p.effects[0].element.setStyle({height:"0px"}).show()},afterFinishInternal:function(p){p.effects[0].element.undoClipping().undoPositioned().setStyle(b)}},d))}})};Effect.Shrink=function(e){e=$(e);var d=Object.extend({direction:"center",moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.none},arguments[1]||{});var b={top:e.style.top,left:e.style.left,height:e.style.height,width:e.style.width,opacity:e.getInlineOpacity()};var h=e.getDimensions();var g,f;switch(d.direction){case"top-left":g=f=0;break;case"top-right":g=h.width;f=0;break;case"bottom-left":g=0;f=h.height;break;case"bottom-right":g=h.width;f=h.height;break;case"center":g=h.width/2;f=h.height/2;break}return new Effect.Parallel([new Effect.Opacity(e,{sync:true,to:0,from:1,transition:d.opacityTransition}),new Effect.Scale(e,window.opera?1:0,{sync:true,transition:d.scaleTransition,restoreAfterFinish:true}),new Effect.Move(e,{x:g,y:f,sync:true,transition:d.moveTransition})],Object.extend({beforeStartInternal:function(l){l.effects[0].element.makePositioned().makeClipping()},afterFinishInternal:function(l){l.effects[0].element.hide().undoClipping().undoPositioned().setStyle(b)}},d))};Effect.Pulsate=function(e){e=$(e);var d=arguments[1]||{},b=e.getInlineOpacity(),g=d.transition||Effect.Transitions.linear,f=function(h){return 1-g((-Math.cos((h*(d.pulses||5)*2)*Math.PI)/2)+0.5)};return new Effect.Opacity(e,Object.extend(Object.extend({duration:2,from:0,afterFinishInternal:function(h){h.element.setStyle({opacity:b})}},d),{transition:f}))};Effect.Fold=function(d){d=$(d);var b={top:d.style.top,left:d.style.left,width:d.style.width,height:d.style.height};d.makeClipping();return new Effect.Scale(d,5,Object.extend({scaleContent:false,scaleX:false,afterFinishInternal:function(e){new Effect.Scale(d,1,{scaleContent:false,scaleY:false,afterFinishInternal:function(f){f.element.hide().undoClipping().setStyle(b)}})}},arguments[1]||{}))};Effect.Morph=Class.create(Effect.Base,{initialize:function(e){this.element=$(e);if(!this.element){throw (Effect._elementDoesNotExistError)}var b=Object.extend({style:{}},arguments[1]||{});if(!Object.isString(b.style)){this.style=$H(b.style)}else{if(b.style.include(":")){this.style=b.style.parseStyle()}else{this.element.addClassName(b.style);this.style=$H(this.element.getStyles());this.element.removeClassName(b.style);var d=this.element.getStyles();this.style=this.style.reject(function(f){return f.value==d[f.key]});b.afterFinishInternal=function(f){f.element.addClassName(f.options.style);f.transforms.each(function(g){f.element.style[g.style]=""})}}}this.start(b)},setup:function(){function b(d){if(!d||["rgba(0, 0, 0, 0)","transparent"].include(d)){d="#ffffff"}d=d.parseColor();return $R(0,2).map(function(e){return parseInt(d.slice(e*2+1,e*2+3),16)})}this.transforms=this.style.map(function(l){var h=l[0],g=l[1],f=null;if(g.parseColor("#zzzzzz")!="#zzzzzz"){g=g.parseColor();f="color"}else{if(h=="opacity"){g=parseFloat(g);if(Prototype.Browser.IE&&(!this.element.currentStyle.hasLayout)){this.element.setStyle({zoom:1})}}else{if(Element.CSS_LENGTH.test(g)){var e=g.match(/^([\+\-]?[0-9\.]+)(.*)$/);g=parseFloat(e[1]);f=(e.length==3)?e[2]:null}}}var d=this.element.getStyle(h);return{style:h.camelize(),originalValue:f=="color"?b(d):parseFloat(d||0),targetValue:f=="color"?b(g):g,unit:f}}.bind(this)).reject(function(d){return((d.originalValue==d.targetValue)||(d.unit!="color"&&(isNaN(d.originalValue)||isNaN(d.targetValue))))})},update:function(b){var f={},d,e=this.transforms.length;while(e--){f[(d=this.transforms[e]).style]=d.unit=="color"?"#"+(Math.round(d.originalValue[0]+(d.targetValue[0]-d.originalValue[0])*b)).toColorPart()+(Math.round(d.originalValue[1]+(d.targetValue[1]-d.originalValue[1])*b)).toColorPart()+(Math.round(d.originalValue[2]+(d.targetValue[2]-d.originalValue[2])*b)).toColorPart():(d.originalValue+(d.targetValue-d.originalValue)*b).toFixed(3)+(d.unit===null?"":d.unit)}this.element.setStyle(f,true)}});Effect.Transform=Class.create({initialize:function(b){this.tracks=[];this.options=arguments[1]||{};this.addTracks(b)},addTracks:function(b){b.each(function(d){d=$H(d);var e=d.values().first();this.tracks.push($H({ids:d.keys().first(),effect:Effect.Morph,options:{style:e}}))}.bind(this));return this},play:function(){return new Effect.Parallel(this.tracks.map(function(b){var f=b.get("ids"),e=b.get("effect"),d=b.get("options");var g=[$(f)||$$(f)].flatten();return g.map(function(h){return new e(h,Object.extend({sync:true},d))})}).flatten(),this.options)}});Element.CSS_PROPERTIES=$w("backgroundColor backgroundPosition borderBottomColor borderBottomStyle borderBottomWidth borderLeftColor borderLeftStyle borderLeftWidth borderRightColor borderRightStyle borderRightWidth borderSpacing borderTopColor borderTopStyle borderTopWidth bottom clip color fontSize fontWeight height left letterSpacing lineHeight marginBottom marginLeft marginRight marginTop markerOffset maxHeight maxWidth minHeight minWidth opacity outlineColor outlineOffset outlineWidth paddingBottom paddingLeft paddingRight paddingTop right textIndent top width wordSpacing zIndex");Element.CSS_LENGTH=/^(([\+\-]?[0-9\.]+)(em|ex|px|in|cm|mm|pt|pc|\%))|0$/;String.__parseStyleElement=document.createElement("div");String.prototype.parseStyle=function(){var d,b=$H();if(Prototype.Browser.WebKit){d=new Element("div",{style:this}).style}else{String.__parseStyleElement.innerHTML='
';d=String.__parseStyleElement.childNodes[0].style}Element.CSS_PROPERTIES.each(function(e){if(d[e]){b.set(e,d[e])}});if(Prototype.Browser.IE&&this.include("opacity")){b.set("opacity",this.match(/opacity:\s*((?:0|1)?(?:\.\d*)?)/)[1])}return b};if(document.defaultView&&document.defaultView.getComputedStyle){Element.getStyles=function(d){var b=document.defaultView.getComputedStyle($(d),null);return Element.CSS_PROPERTIES.inject({},function(e,f){e[f]=b[f];return e})}}else{Element.getStyles=function(d){d=$(d);var b=d.currentStyle,e;e=Element.CSS_PROPERTIES.inject({},function(f,g){f[g]=b[g];return f});if(!e.opacity){e.opacity=d.getOpacity()}return e}}Effect.Methods={morph:function(b,d){b=$(b);new Effect.Morph(b,Object.extend({style:d},arguments[2]||{}));return b},visualEffect:function(e,g,d){e=$(e);var f=g.dasherize().camelize(),b=f.charAt(0).toUpperCase()+f.substring(1);new Effect[b](e,d);return e},highlight:function(d,b){d=$(d);new Effect.Highlight(d,b);return d}};$w("fade appear grow shrink fold blindUp blindDown slideUp slideDown pulsate shake puff squish switchOff dropOut").each(function(b){Effect.Methods[b]=function(e,d){e=$(e);Effect[b.charAt(0).toUpperCase()+b.substring(1)](e,d);return e}});$w("getInlineOpacity forceRerendering setContentZoom collectTextNodes collectTextNodesIgnoreClass getStyles").each(function(b){Effect.Methods[b]=Element[b]});Element.addMethods(Effect.Methods);function validateCreditCard(e){var d="0123456789";var b="";for(i=0;i9?Math.floor(a/10+a%10):a}for(i=0;i=d},maxLength:function(b,e,d){return b.length<=d},min:function(b,e,d){return b>=parseFloat(d)},max:function(b,e,d){return b<=parseFloat(d)},notOneOf:function(b,e,d){return $A(d).all(function(f){return b!=f})},oneOf:function(b,e,d){return $A(d).any(function(f){return b==f})},is:function(b,e,d){return b==d},isNot:function(b,e,d){return b!=d},equalToField:function(b,e,d){return b==$F(d)},notEqualToField:function(b,e,d){return b!=$F(d)},include:function(b,e,d){return $A(d).all(function(f){return Validation.get(f).test(b,e)})}};var Validation=Class.create();Validation.defaultOptions={onSubmit:true,stopOnFirst:false,immediate:false,focusOnError:true,useTitles:false,addClassNameToContainer:false,containerClassName:".input-box",onFormValidate:function(b,d){},onElementValidate:function(b,d){}};Validation.prototype={initialize:function(d,b){this.form=$(d);if(!this.form){return}this.options=Object.extend({onSubmit:Validation.defaultOptions.onSubmit,stopOnFirst:Validation.defaultOptions.stopOnFirst,immediate:Validation.defaultOptions.immediate,focusOnError:Validation.defaultOptions.focusOnError,useTitles:Validation.defaultOptions.useTitles,onFormValidate:Validation.defaultOptions.onFormValidate,onElementValidate:Validation.defaultOptions.onElementValidate},b||{});if(this.options.onSubmit){Event.observe(this.form,"submit",this.onSubmit.bind(this),false)}if(this.options.immediate){Form.getElements(this.form).each(function(e){if(e.tagName.toLowerCase()=="select"){Event.observe(e,"blur",this.onChange.bindAsEventListener(this))}if(e.type.toLowerCase()=="radio"||e.type.toLowerCase()=="checkbox"){Event.observe(e,"click",this.onChange.bindAsEventListener(this))}else{Event.observe(e,"change",this.onChange.bindAsEventListener(this))}},this)}},onChange:function(b){Validation.isOnChange=true;Validation.validate(Event.element(b),{useTitle:this.options.useTitles,onElementValidate:this.options.onElementValidate});Validation.isOnChange=false},onSubmit:function(b){if(!this.validate()){Event.stop(b)}},validate:function(){var b=false;var d=this.options.useTitles;var g=this.options.onElementValidate;try{if(this.options.stopOnFirst){b=Form.getElements(this.form).all(function(e){if(e.hasClassName("local-validation")&&!this.isElementInForm(e,this.form)){return true}return Validation.validate(e,{useTitle:d,onElementValidate:g})},this)}else{b=Form.getElements(this.form).collect(function(e){if(e.hasClassName("local-validation")&&!this.isElementInForm(e,this.form)){return true}if(e.hasClassName("validation-disabled")){return true}return Validation.validate(e,{useTitle:d,onElementValidate:g})},this).all()}}catch(f){}if(!b&&this.options.focusOnError){try{Form.getElements(this.form).findAll(function(e){return $(e).hasClassName("validation-failed")}).first().focus()}catch(f){}}this.options.onFormValidate(b,this.form);return b},reset:function(){Form.getElements(this.form).each(Validation.reset)},isElementInForm:function(e,d){var b=e.up("form");if(b==d){return true}return false}};Object.extend(Validation,{validate:function(e,b){b=Object.extend({useTitle:false,onElementValidate:function(f,g){}},b||{});e=$(e);var d=$w(e.className);return result=d.all(function(f){var g=Validation.test(f,e,b.useTitle);b.onElementValidate(g,e);return g})},insertAdvice:function(f,d){var b=$(f).up(".field-row");if(b){Element.insert(b,{after:d})}else{if(f.up("td.value")){f.up("td.value").insert({bottom:d})}else{if(f.advaiceContainer&&$(f.advaiceContainer)){$(f.advaiceContainer).update(d)}else{switch(f.type.toLowerCase()){case"checkbox":case"radio":var e=f.parentNode;if(e){Element.insert(e,{bottom:d})}else{Element.insert(f,{after:d})}break;default:Element.insert(f,{after:d})}}}}},showAdvice:function(e,d,b){if(!e.advices){e.advices=new Hash()}else{e.advices.each(function(f){if(!d||f.value.id!=d.id){this.hideAdvice(e,f.value)}}.bind(this))}e.advices.set(b,d);if(typeof Effect=="undefined"){d.style.display="block"}else{if(!d._adviceAbsolutize){new Effect.Appear(d,{duration:1})}else{Position.absolutize(d);d.show();d.setStyle({top:d._adviceTop,left:d._adviceLeft,width:d._adviceWidth,"z-index":1000});d.addClassName("advice-absolute")}}},hideAdvice:function(d,b){if(b!=null){new Effect.Fade(b,{duration:1,afterFinishInternal:function(){b.hide()}})}},updateCallback:function(elm,status){if(typeof elm.callbackFunction!="undefined"){eval(elm.callbackFunction+"('"+elm.id+"','"+status+"')")}},ajaxError:function(g,f){var e="validate-ajax";var d=Validation.getAdvice(e,g);if(d==null){d=this.createAdvice(e,g,false,f)}this.showAdvice(g,d,"validate-ajax");this.updateCallback(g,"failed");g.addClassName("validation-failed");g.addClassName("validate-ajax");if(Validation.defaultOptions.addClassNameToContainer&&Validation.defaultOptions.containerClassName!=""){var b=g.up(Validation.defaultOptions.containerClassName);if(b&&this.allowContainerClassName(g)){b.removeClassName("validation-passed");b.addClassName("validation-error")}}},allowContainerClassName:function(b){if(b.type=="radio"||b.type=="checkbox"){return b.hasClassName("change-container-classname")}return true},test:function(g,o,l){var d=Validation.get(g);var n="__advice"+g.camelize();try{if(Validation.isVisible(o)&&!d.test($F(o),o)){var f=Validation.getAdvice(g,o);if(f==null){f=this.createAdvice(g,o,l)}this.showAdvice(o,f,g);this.updateCallback(o,"failed");o[n]=1;if(!o.advaiceContainer){o.removeClassName("validation-passed");o.addClassName("validation-failed")}if(Validation.defaultOptions.addClassNameToContainer&&Validation.defaultOptions.containerClassName!=""){var b=o.up(Validation.defaultOptions.containerClassName);if(b&&this.allowContainerClassName(o)){b.removeClassName("validation-passed");b.addClassName("validation-error")}}return false}else{var f=Validation.getAdvice(g,o);this.hideAdvice(o,f);this.updateCallback(o,"passed");o[n]="";o.removeClassName("validation-failed");o.addClassName("validation-passed");if(Validation.defaultOptions.addClassNameToContainer&&Validation.defaultOptions.containerClassName!=""){var b=o.up(Validation.defaultOptions.containerClassName);if(b&&!b.down(".validation-failed")&&this.allowContainerClassName(o)){if(!Validation.get("IsEmpty").test(o.value)||!this.isVisible(o)){b.addClassName("validation-passed")}else{b.removeClassName("validation-passed")}b.removeClassName("validation-error")}}return true}}catch(h){throw (h)}},isVisible:function(b){while(b.tagName!="BODY"){if(!$(b).visible()){return false}b=b.parentNode}return true},getAdvice:function(b,d){return $("advice-"+b+"-"+Validation.getElmID(d))||$("advice-"+Validation.getElmID(d))},createAdvice:function(e,n,l,d){var b=Validation.get(e);var h=l?((n&&n.title)?n.title:b.error):b.error;if(d){h=d}if(jQuery.mage.__){h=jQuery.mage.__(h)}advice='";Validation.insertAdvice(n,advice);advice=Validation.getAdvice(e,n);if($(n).hasClassName("absolute-advice")){var g=$(n).getDimensions();var f=Position.cumulativeOffset(n);advice._adviceTop=(f[1]+g.height)+"px";advice._adviceLeft=(f[0])+"px";advice._adviceWidth=(g.width)+"px";advice._adviceAbsolutize=true}return advice},getElmID:function(b){return b.id?b.id:b.name},reset:function(d){d=$(d);var b=$w(d.className);b.each(function(g){var h="__advice"+g.camelize();if(d[h]){var f=Validation.getAdvice(g,d);if(f){f.hide()}d[h]=""}d.removeClassName("validation-failed");d.removeClassName("validation-passed");if(Validation.defaultOptions.addClassNameToContainer&&Validation.defaultOptions.containerClassName!=""){var e=d.up(Validation.defaultOptions.containerClassName);if(e){e.removeClassName("validation-passed");e.removeClassName("validation-error")}}})},add:function(f,e,g,d){var b={};b[f]=new Validator(f,e,g,d);Object.extend(Validation.methods,b)},addAllThese:function(b){var d={};$A(b).each(function(e){d[e[0]]=new Validator(e[0],e[1],e[2],(e.length>3?e[3]:{}))});Object.extend(Validation.methods,d)},get:function(b){return Validation.methods[b]?Validation.methods[b]:Validation.methods._LikeNoIDIEverSaw_},methods:{_LikeNoIDIEverSaw_:new Validator("_LikeNoIDIEverSaw_","",{})}});Validation.add("IsEmpty","",function(b){return(b==""||(b==null)||(b.length==0)||/^\s+$/.test(b))});Validation.addAllThese([["validate-no-html-tags","HTML tags are not allowed",function(b){return !/<(\/)?\w+/.test(b)}],["validate-select","Please select an option.",function(b){return((b!="none")&&(b!=null)&&(b.length!=0))}],["required-entry","This is a required field.",function(b){return !Validation.get("IsEmpty").test(b)}],["validate-number","Please enter a valid number in this field.",function(b){return Validation.get("IsEmpty").test(b)||(!isNaN(parseNumber(b))&&/^\s*-?\d*(\.\d*)?\s*$/.test(b))}],["validate-number-range","The value is not within the specified range.",function(e,g){if(Validation.get("IsEmpty").test(e)){return true}var f=parseNumber(e);if(isNaN(f)){return false}var d=/^number-range-(-?[\d.,]+)?-(-?[\d.,]+)?$/,b=true;$w(g.className).each(function(l){var h=d.exec(l);if(h){b=b&&(h[1]==null||h[1]==""||f>=parseNumber(h[1]))&&(h[2]==null||h[2]==""||f<=parseNumber(h[2]))}});return b}],["validate-digits","Please use numbers only in this field. Please avoid spaces or other characters such as dots or commas.",function(b){return Validation.get("IsEmpty").test(b)||!/[^\d]/.test(b)}],["validate-digits-range","The value is not within the specified range.",function(e,g){if(Validation.get("IsEmpty").test(e)){return true}var f=parseNumber(e);if(isNaN(f)){return false}var d=/^digits-range-(-?\d+)?-(-?\d+)?$/,b=true;$w(g.className).each(function(l){var h=d.exec(l);if(h){b=b&&(h[1]==null||h[1]==""||f>=parseNumber(h[1]))&&(h[2]==null||h[2]==""||f<=parseNumber(h[2]))}});return b}],["validate-range","The value is not within the specified range.",function(f,l){var g,h;if(Validation.get("IsEmpty").test(f)){return true}else{if(Validation.get("validate-digits").test(f)){g=h=parseNumber(f)}else{var e=/^(-?\d+)?-(-?\d+)?$/.exec(f);if(e){g=parseNumber(e[1]);h=parseNumber(e[2]);if(g>h){return false}}else{return false}}}var d=/^range-(-?\d+)?-(-?\d+)?$/,b=true;$w(l.className).each(function(n){var q=d.exec(n);if(q){var p=parseNumber(q[1]);var o=parseNumber(q[2]);b=b&&(isNaN(p)||g>=p)&&(isNaN(o)||h<=o)}});return b}],["validate-alpha","Please use letters only (a-z or A-Z) in this field.",function(b){return Validation.get("IsEmpty").test(b)||/^[a-zA-Z]+$/.test(b)}],["validate-code","Please use only letters (a-z), numbers (0-9) or underscore (_) in this field, and the first character should be a letter.",function(b){return Validation.get("IsEmpty").test(b)||/^[a-z]+[a-z0-9_]+$/.test(b)}],["validate-alphanum","Please use only letters (a-z or A-Z) or numbers (0-9) in this field. No spaces or other characters are allowed.",function(b){return Validation.get("IsEmpty").test(b)||/^[a-zA-Z0-9]+$/.test(b)}],["validate-alphanum-with-spaces","Please use only letters (a-z or A-Z), numbers (0-9) or spaces only in this field.",function(b){return Validation.get("IsEmpty").test(b)||/^[a-zA-Z0-9 ]+$/.test(b)}],["validate-street",'Please use only letters (a-z or A-Z), numbers (0-9), spaces and "#" in this field.',function(b){return Validation.get("IsEmpty").test(b)||/^[ \w]{3,}([A-Za-z]\.)?([ \w]*\#\d+)?(\r\n| )[ \w]{3,}/.test(b)}],["validate-phoneStrict","Please enter a valid phone number (Ex: 123-456-7890).",function(b){return Validation.get("IsEmpty").test(b)||/^(\()?\d{3}(\))?(-|\s)?\d{3}(-|\s)\d{4}$/.test(b)}],["validate-phoneLax","Please enter a valid phone number (Ex: 123-456-7890).",function(b){return Validation.get("IsEmpty").test(b)||/^((\d[-. ]?)?((\(\d{3}\))|\d{3}))?[-. ]?\d{3}[-. ]?\d{4}$/.test(b)}],["validate-fax","Please enter a valid fax number (Ex: 123-456-7890).",function(b){return Validation.get("IsEmpty").test(b)||/^(\()?\d{3}(\))?(-|\s)?\d{3}(-|\s)\d{4}$/.test(b)}],["validate-date","Please enter a valid date.",function(b){var d=new Date(b);return Validation.get("IsEmpty").test(b)||!isNaN(d)}],["validate-date-range","Make sure the To Date is later than or the same as the From Date.",function(e,h){var d=/\bdate-range-(\w+)-(\w+)\b/.exec(h.className);if(!d||d[2]=="to"||Validation.get("IsEmpty").test(e)){return true}var f=new Date().getFullYear()+"";var b=function(l){l=l.split(/[.\/]/);if(l[2]&&l[2].length<4){l[2]=f.substr(0,l[2].length)+l[2]}return new Date(l.join("/")).getTime()};var g=Element.select(h.form,".validate-date-range.date-range-"+d[1]+"-to");return !g.length||Validation.get("IsEmpty").test(g[0].value)||b(e)<=b(g[0].value)}],["validate-email","Please enter a valid email address (Ex: johndoe@domain.com).",function(b){return Validation.get("IsEmpty").test(b)||/^([a-z0-9,!\#\$%&'\*\+\/=\?\^_`\{\|\}~-]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z0-9,!\#\$%&'\*\+\/=\?\^_`\{\|\}~-]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*@([a-z0-9-]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z0-9-]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*\.(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]){2,})$/i.test(b)}],["validate-emailSender","Please use only visible characters and spaces.",function(b){return Validation.get("IsEmpty").test(b)||/^[\S ]+$/.test(b)}],["validate-password","Please enter 6 or more characters. Leading or trailing spaces will be ignored.",function(b){var d=b.strip();return !(d.length>0&&d.length<6)}],["validate-admin-password","Please enter 7 or more characters, using both numeric and alphabetic.",function(b){var d=b.strip();if(0==d.length){return true}if(!(/[a-z]/i.test(b))||!(/[0-9]/.test(b))){return false}return !(d.length<7)}],["validate-cpassword","Please make sure your passwords match.",function(b){var d=$("confirmation")?$("confirmation"):$$(".validate-cpassword")[0];var g=false;if($("password")){g=$("password")}var h=$$(".validate-password");for(var e=0;e=0}],["validate-zero-or-greater","Please enter a number 0 or greater in this field.",function(b){return Validation.get("validate-not-negative-number").test(b)}],["validate-greater-than-zero","Please enter a number greater than 0 in this field.",function(b){if(Validation.get("IsEmpty").test(b)){return true}b=parseNumber(b);return !isNaN(b)&&b>0}],["validate-state","Please select State/Province.",function(b){return(b!=0||b=="")}],["validate-new-password","Please enter 6 or more characters. Leading or trailing spaces will be ignored.",function(b){if(!Validation.get("validate-password").test(b)){return false}if(Validation.get("IsEmpty").test(b)&&b!=""){return false}return true}],["validate-cc-number","Please enter a valid credit card number.",function(b,e){var d=$(e.id.substr(0,e.id.indexOf("_cc_number"))+"_cc_type");if(d&&typeof Validation.creditCartTypes.get(d.value)!="undefined"&&Validation.creditCartTypes.get(d.value)[2]==false){if(!Validation.get("IsEmpty").test(b)&&Validation.get("validate-digits").test(b)){return true}else{return false}}return validateCreditCard(b)}],["validate-cc-type","Credit card number does not match credit card type.",function(d,g){g.value=removeDelimiters(g.value);d=removeDelimiters(d);var f=$(g.id.substr(0,g.id.indexOf("_cc_number"))+"_cc_type");if(!f){return true}var e=f.value;if(typeof Validation.creditCartTypes.get(e)=="undefined"){return false}if(Validation.creditCartTypes.get(e)[0]==false){return true}var b="";Validation.creditCartTypes.each(function(h){if(h.value[0]&&d.match(h.value[0])){b=h.key;throw $break}});if(b!=e){return false}if(f.hasClassName("validation-failed")&&Validation.isOnChange){Validation.validate(f)}return true}],["validate-cc-type-select","Card type does not match credit card number.",function(d,e){var b=$(e.id.substr(0,e.id.indexOf("_cc_type"))+"_cc_number");if(Validation.isOnChange&&Validation.get("IsEmpty").test(b.value)){return true}if(Validation.get("validate-cc-type").test(b.value,b)){Validation.validate(b)}return Validation.get("validate-cc-type").test(b.value,b)}],["validate-cc-exp","Incorrect credit card expiration date.",function(b,l){var h=b;var g=$(l.id.substr(0,l.id.indexOf("_expiration"))+"_expiration_yr").value;var f=new Date();var e=f.getMonth()+1;var d=f.getFullYear();if(h=n)}});return b}],["validate-percents","Please enter a number lower than 100.",{max:100}],["required-file","Please select a file.",function(d,e){var b=!Validation.get("IsEmpty").test(d);if(b===false){ovId=e.id+"_value";if($(ovId)){b=!Validation.get("IsEmpty").test($(ovId).value)}}return b}],["validate-cc-ukss","Please enter issue number or start date for switch/solo card type.",function(o,g){var b;if(g.id.match(/(.)+_cc_issue$/)){b=g.id.indexOf("_cc_issue")}else{if(g.id.match(/(.)+_start_month$/)){b=g.id.indexOf("_start_month")}else{b=g.id.indexOf("_start_year")}}var f=g.id.substr(0,b);var d=$(f+"_cc_type");if(!d){return true}var n=d.value;if(["SS","SM","SO"].indexOf(n)==-1){return true}$(f+"_cc_issue").advaiceContainer=$(f+"_start_month").advaiceContainer=$(f+"_start_year").advaiceContainer=$(f+"_cc_type_ss_div").down(".adv-container");var h=$(f+"_cc_issue").value;var l=$(f+"_start_month").value;var p=$(f+"_start_year").value;var e=(l&&p)?true:false;if(!e&&!h){return false}return true}]]);function removeDelimiters(b){b=b.replace(/\s/g,"");b=b.replace(/\-/g,"");return b}function parseNumber(b){if(typeof b!="string"){return parseFloat(b)}var e=b.indexOf(".");var d=b.indexOf(",");if(e!=-1&&d!=-1){if(d>e){b=b.replace(".","").replace(",",".")}else{b=b.replace(",","")}}else{if(d!=-1){b=b.replace(",",".")}}return parseFloat(b)}Validation.creditCartTypes=$H({SO:[new RegExp("^(6334[5-9]([0-9]{11}|[0-9]{13,14}))|(6767([0-9]{12}|[0-9]{14,15}))$"),new RegExp("^([0-9]{3}|[0-9]{4})?$"),true],SM:[new RegExp("(^(5[0678])[0-9]{11,18}$)|(^(6[^05])[0-9]{11,18}$)|(^(601)[^1][0-9]{9,16}$)|(^(6011)[0-9]{9,11}$)|(^(6011)[0-9]{13,16}$)|(^(65)[0-9]{11,13}$)|(^(65)[0-9]{15,18}$)|(^(49030)[2-9]([0-9]{10}$|[0-9]{12,13}$))|(^(49033)[5-9]([0-9]{10}$|[0-9]{12,13}$))|(^(49110)[1-2]([0-9]{10}$|[0-9]{12,13}$))|(^(49117)[4-9]([0-9]{10}$|[0-9]{12,13}$))|(^(49118)[0-2]([0-9]{10}$|[0-9]{12,13}$))|(^(4936)([0-9]{12}$|[0-9]{14,15}$))"),new RegExp("^([0-9]{3}|[0-9]{4})?$"),true],VI:[new RegExp("^4[0-9]{12}([0-9]{3})?$"),new RegExp("^[0-9]{3}$"),true],MC:[new RegExp("^5[1-5][0-9]{14}$"),new RegExp("^[0-9]{3}$"),true],AE:[new RegExp("^3[47][0-9]{13}$"),new RegExp("^[0-9]{4}$"),true],DI:[new RegExp("^6(011|4[4-9][0-9]|5[0-9]{2})[0-9]{12}$"),new RegExp("^[0-9]{3}$"),true],JCB:[new RegExp("^(3[0-9]{15}|(2131|1800)[0-9]{11})$"),new RegExp("^[0-9]{3,4}$"),true],OT:[false,new RegExp("^([0-9]{3}|[0-9]{4})?$"),false]});function popWin(d,e,b){var e=window.open(d,e,b);e.focus()}function setLocation(b){window.location.href=b}function setPLocation(d,b){if(b){window.opener.focus()}window.opener.location.href=d}function setLanguageCode(e,f){var b=window.location.href;var h="",g;if(g=b.match(/\#(.*)$/)){b=b.replace(/\#(.*)$/,"");h=g[0]}if(b.match(/[?]/)){var d=/([?&]store=)[a-z0-9_]*/;if(b.match(d)){b=b.replace(d,"$1"+e)}else{b+="&store="+e}var d=/([?&]from_store=)[a-z0-9_]*/;if(b.match(d)){b=b.replace(d,"")}}else{b+="?store="+e}if(typeof(f)!="undefined"){b+="&from_store="+f}b+=h;setLocation(b)}function decorateGeneric(h,e){var l=["odd","even","first","last"];var d={};var g=h.length;if(g){if(typeof(e)=="undefined"){e=l}if(!e.length){return}for(var b in l){d[l[b]]=false}for(var b in e){d[e[b]]=true}if(d.first){Element.addClassName(h[0],"first")}if(d.last){Element.addClassName(h[g-1],"last")}for(var f=0;f-1){b="?"+f.substring(d+2);f=f.substring(0,d+1)}return f+e+b}function formatCurrency(n,q,g){var l=isNaN(q.precision=Math.abs(q.precision))?2:q.precision;var v=isNaN(q.requiredPrecision=Math.abs(q.requiredPrecision))?2:q.requiredPrecision;l=v;var t=isNaN(q.integerRequired=Math.abs(q.integerRequired))?1:q.integerRequired;var p=q.decimalSymbol==undefined?",":q.decimalSymbol;var e=q.groupSymbol==undefined?".":q.groupSymbol;var d=q.groupLength==undefined?3:q.groupLength;var u="";if(g==undefined||g==true){u=n<0?"-":(g?"+":"")}else{if(g==false){u=""}}var h=parseInt(n=Math.abs(+n||0).toFixed(l))+"";var f=(h.lengthd?j%d:0;re=new RegExp("(\\d{"+d+"})(?=\\d)","g");var b=(j?h.substr(0,j)+e:"")+h.substr(j).replace(re,"$1"+e)+(l?p+Math.abs(n-h).toFixed(l).replace(/-/,0).slice(2):"");var o="";if(q.pattern.indexOf("{sign}")==-1){o=u+q.pattern}else{o=q.pattern.replace("{sign}",u)}return o.replace("%s",b).replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function expandDetails(d,b){if(Element.hasClassName(d,"show-details")){$$(b).each(function(e){e.hide()});Element.removeClassName(d,"show-details")}else{$$(b).each(function(e){e.show()});Element.addClassName(d,"show-details")}}var isIE=navigator.appVersion.match(/MSIE/)=="MSIE";if(!window.Varien){var Varien=new Object()}Varien.showLoading=function(){var b=$("loading-process");b&&b.show()};Varien.hideLoading=function(){var b=$("loading-process");b&&b.hide()};Varien.GlobalHandlers={onCreate:function(){Varien.showLoading()},onComplete:function(){if(Ajax.activeRequestCount==0){Varien.hideLoading()}}};Ajax.Responders.register(Varien.GlobalHandlers);Varien.searchForm=Class.create();Varien.searchForm.prototype={initialize:function(d,e,b){this.form=$(d);this.field=$(e);this.emptyText=b;Event.observe(this.form,"submit",this.submit.bind(this));Event.observe(this.field,"focus",this.focus.bind(this));Event.observe(this.field,"blur",this.blur.bind(this));this.blur()},submit:function(b){if(this.field.value==this.emptyText||this.field.value==""){Event.stop(b);return false}return true},focus:function(b){if(this.field.value==this.emptyText){this.field.value=""}},blur:function(b){if(this.field.value==""){this.field.value=this.emptyText}}};Varien.DateElement=Class.create();Varien.DateElement.prototype={initialize:function(b,d,f,e){if(b=="id"){this.day=$(d+"day");this.month=$(d+"month");this.year=$(d+"year");this.full=$(d+"full");this.advice=$(d+"date-advice")}else{if(b=="container"){this.day=d.day;this.month=d.month;this.year=d.year;this.full=d.full;this.advice=d.advice}else{return}}this.required=f;this.format=e;this.day.addClassName("validate-custom");this.day.validate=this.validate.bind(this);this.month.addClassName("validate-custom");this.month.validate=this.validate.bind(this);this.year.addClassName("validate-custom");this.year.validate=this.validate.bind(this);this.setDateRange(false,false);this.year.setAttribute("autocomplete","off");this.advice.hide()},validate:function(){var l=false,o=parseInt(this.day.value,10)||0,f=parseInt(this.month.value,10)||0,h=parseInt(this.year.value,10)||0;if(this.day.value.strip().empty()&&this.month.value.strip().empty()&&this.year.value.strip().empty()){if(this.required){l="Please enter a date."}else{this.full.value=""}}else{if(!o||!f||!h){l="Please enter a valid full date."}else{var d=new Date,n=0,e=null;d.setYear(h);d.setMonth(f-1);d.setDate(32);n=32-d.getDate();if(!n||n>31){n=31}if(o<1||o>n){e="day";l="Please enter a valid day (1-%1)."}else{if(f<1||f>12){e="month";l="Please enter a valid month (1-12)."}else{if(o%10==o){this.day.value="0"+o}if(f%10==f){this.month.value="0"+f}this.full.value=this.format.replace(/%[mb]/i,this.month.value).replace(/%[de]/i,this.day.value).replace(/%y/i,this.year.value);var b=this.month.value+"/"+this.day.value+"/"+this.year.value;var g=new Date(b);if(isNaN(g)){l="Please enter a valid date."}else{this.setFullDate(g)}}}var p=false;if(!l&&!this.validateData()){e=this.validateDataErrorType;p=this.validateDataErrorText;l=p}}}if(l!==false){if(jQuery.mage.__){l=jQuery.mage.__(l)}if(!p){this.advice.innerHTML=l.replace("%1",n)}else{this.advice.innerHTML=this.errorTextModifier(l)}this.advice.show();return false}this.day.removeClassName("validation-failed");this.month.removeClassName("validation-failed");this.year.removeClassName("validation-failed");this.advice.hide();return true},validateData:function(){var d=this.fullDate.getFullYear();var b=new Date;this.curyear=b.getFullYear();return(d>=1900&&d<=this.curyear)},validateDataErrorType:"year",validateDataErrorText:"Please enter a valid year (1900-%1).",errorTextModifier:function(b){return b.replace("%1",this.curyear)},setDateRange:function(b,d){this.minDate=b;this.maxDate=d},setFullDate:function(b){this.fullDate=b}};Varien.DOB=Class.create();Varien.DOB.prototype={initialize:function(b,g,f){var e=$$(b)[0];var d={};d.day=Element.select(e,".dob-day input")[0];d.month=Element.select(e,".dob-month input")[0];d.year=Element.select(e,".dob-year input")[0];d.full=Element.select(e,".dob-full input")[0];d.advice=Element.select(e,".validation-advice")[0];new Varien.DateElement("container",d,g,f)}};Varien.dateRangeDate=Class.create();Varien.dateRangeDate.prototype=Object.extend(new Varien.DateElement(),{validateData:function(){var b=true;if(this.minDate||this.maxValue){if(this.minDate){this.minDate=new Date(this.minDate);this.minDate.setHours(0);if(isNaN(this.minDate)){this.minDate=new Date("1/1/1900")}b=b&&(this.fullDate>=this.minDate)}if(this.maxDate){this.maxDate=new Date(this.maxDate);this.minDate.setHours(0);if(isNaN(this.maxDate)){this.maxDate=new Date()}b=b&&(this.fullDate<=this.maxDate)}if(this.maxDate&&this.minDate){this.validateDataErrorText="Please enter a valid date between %s and %s"}else{if(this.maxDate){this.validateDataErrorText="Please enter a valid date less than or equal to %s"}else{if(this.minDate){this.validateDataErrorText="Please enter a valid date equal to or greater than %s"}else{this.validateDataErrorText=""}}}}return b},validateDataErrorText:"Date should be between %s and %s",errorTextModifier:function(b){if(this.minDate){b=b.sub("%s",this.dateFormat(this.minDate))}if(this.maxDate){b=b.sub("%s",this.dateFormat(this.maxDate))}return b},dateFormat:function(b){return(b.getMonth()+1)+"/"+b.getDate()+"/"+b.getFullYear()}});Varien.FileElement=Class.create();Varien.FileElement.prototype={initialize:function(b){this.fileElement=$(b);this.hiddenElement=$(b+"_value");this.fileElement.observe("change",this.selectFile.bind(this))},selectFile:function(b){this.hiddenElement.value=this.fileElement.getValue()}};Validation.addAllThese([["validate-custom"," ",function(b,d){return d.validate()}]]);Element.addMethods({getInnerText:function(b){b=$(b);if(b.innerText&&!Prototype.Browser.Opera){return b.innerText}return b.innerHTML.stripScripts().unescapeHTML().replace(/[\n\r\s]+/g," ").strip()}});function fireEvent(d,e){if(document.createEvent){var b=document.createEvent("HTMLEvents");b.initEvent(e,true,true);return d.dispatchEvent(b)}else{var b=document.createEventObject();return d.fireEvent("on"+e,b)}}function modulo(b,f){var e=f/10000;var d=b%f;if(Math.abs(d-f)b.toFixed(2).toString().length){b=b.toFixed(2)}return b+" "+d[e]};var SessionError=Class.create();SessionError.prototype={initialize:function(b){this.errorText=b},toString:function(){return"Session Error:"+this.errorText}};Ajax.Request.addMethods({initialize:function($super,d,b){$super(b);this.transport=Ajax.getTransport();if(!d.match(new RegExp("[?&]isAjax=true",""))){d=d.match(new RegExp("\\?","g"))?d+"&isAjax=true":d+"?isAjax=true"}if(Object.isString(this.options.parameters)&&this.options.parameters.indexOf("form_key=")==-1){this.options.parameters+="&"+Object.toQueryString({form_key:FORM_KEY})}else{if(!this.options.parameters){this.options.parameters={form_key:FORM_KEY}}if(!this.options.parameters.form_key){this.options.parameters.form_key=FORM_KEY}}this.request(d)},respondToReadyState:function(b){var g=Ajax.Request.Events[b],d=new Ajax.Response(this);if(g=="Complete"){try{this._complete=true;if(d.responseText.isJSON()){var f=d.responseText.evalJSON();if(f.ajaxExpired&&f.ajaxRedirect){window.location.replace(f.ajaxRedirect);throw new SessionError("session expired")}}(this.options["on"+d.status]||this.options["on"+(this.success()?"Success":"Failure")]||Prototype.emptyFunction)(d,d.headerJSON)}catch(h){this.dispatchException(h);if(h instanceof SessionError){return}}var l=d.getHeader("Content-type");if(this.options.evalJS=="force"||(this.options.evalJS&&this.isSameOrigin()&&l&&l.match(/^\s*(text|application)\/(x-)?(java|ecma)script(;.*)?\s*$/i))){this.evalResponse()}}try{(this.options["on"+g]||Prototype.emptyFunction)(d,d.headerJSON);Ajax.Responders.dispatch("on"+g,this,d,d.headerJSON)}catch(h){this.dispatchException(h)}if(g=="Complete"){this.transport.onreadystatechange=Prototype.emptyFunction}}});Ajax.Updater.respondToReadyState=Ajax.Request.respondToReadyState;var varienLoader=new Class.create();varienLoader.prototype={initialize:function(b){this.callback=false;this.cache=$H();this.caching=b||false;this.url=false},getCache:function(b){if(this.cache.get(b)){return this.cache.get(b)}return false},load:function(b,d,f){this.url=b;this.callback=f;if(this.caching){var e=this.getCache(b);if(e){this.processResult(e);return}}if(typeof(d.updaterId)!="undefined"){new varienUpdater(d.updaterId,b,{evalScripts:true,onComplete:this.processResult.bind(this),onFailure:this._processFailure.bind(this)})}else{new Ajax.Request(b,{method:"post",parameters:d||{},onComplete:this.processResult.bind(this),onFailure:this._processFailure.bind(this)})}},_processFailure:function(b){location.href=BASE_URL},processResult:function(b){if(this.caching){this.cache.set(this.url,b)}if(this.callback){this.callback(b.responseText)}}};if(!window.varienLoaderHandler){var varienLoaderHandler=new Object()}varienLoaderHandler.handler={onCreate:function(b){if(b.options.loaderArea===false){return}jQuery("body").trigger("processStart")},onException:function(b){jQuery("body").trigger("processStop")},onComplete:function(b){jQuery("body").trigger("processStop")}};function setLoaderPosition(){var e=$("loading_mask_loader");if(e&&Prototype.Browser.IE){var d=e.getDimensions();var f=document.viewport.getDimensions();var b=document.viewport.getScrollOffsets();e.style.left=Math.floor(f.width/2+b.left-d.width/2)+"px";e.style.top=Math.floor(f.height/2+b.top-d.height/2)+"px";e.style.position="absolute"}}function toggleSelectsUnderBlock(f,b){if(Prototype.Browser.IE){var e=document.getElementsByTagName("select");for(var d=0;d');d.document.close();Event.observe(d,"load",function(){var e=d.document.getElementById("image_preview");d.resizeTo(e.width+40,e.height+80)})}}function checkByProductPriceType(b){if(b.id=="price_type"){this.productPriceType=b.value;return false}else{if(b.id=="price"&&this.productPriceType==0){return false}return true}}Event.observe(window,"load",function(){if($("price_default")&&$("price_default").checked){$("price").disabled="disabled"}});function toggleSeveralValueElements(f,e,b,d){if(e&&f){if(Object.prototype.toString.call(e)!="[object Array]"){e=[e]}e.each(function(g){toggleValueElements(f,g,b,d)})}}function toggleValueElements(l,d,f,h){if(d&&l){var n=[l];if(typeof f!="undefined"){if(Object.prototype.toString.call(f)!="[object Array]"){f=[f]}for(var g=0;g>2;l=((p&3)<<4)|(n>>4);g=((n&15)<<2)|(h>>6);f=h&63;if(isNaN(n)){g=f=64}else{if(isNaN(h)){f=64}}b=b+this._keyStr.charAt(o)+this._keyStr.charAt(l)+this._keyStr.charAt(g)+this._keyStr.charAt(f)}return b},decode:function(e){var b="";var p,n,h;var o,l,g,f;var d=0;if(typeof window.atob==="function"){return window.atob(e)}e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");while(d>4);n=((l&15)<<4)|(g>>2);h=((g&3)<<6)|f;b=b+String.fromCharCode(p);if(g!=64){b=b+String.fromCharCode(n)}if(f!=64){b=b+String.fromCharCode(h)}}b=Base64._utf8_decode(b);return b},mageEncode:function(b){return this.encode(b).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,",")},mageDecode:function(b){b=b.replace(/\-/g,"+").replace(/_/g,"/").replace(/,/g,"=");return this.decode(b)},idEncode:function(b){return this.encode(b).replace(/\+/g,":").replace(/\//g,"_").replace(/=/g,"-")},idDecode:function(b){b=b.replace(/\-/g,"=").replace(/_/g,"/").replace(/\:/g,"+");return this.decode(b)},_utf8_encode:function(d){d=d.replace(/\r\n/g,"\n");var b="";for(var f=0;f127)&&(e<2048)){b+=String.fromCharCode((e>>6)|192);b+=String.fromCharCode((e&63)|128)}else{b+=String.fromCharCode((e>>12)|224);b+=String.fromCharCode(((e>>6)&63)|128);b+=String.fromCharCode((e&63)|128)}}}return b},_utf8_decode:function(b){var d="";var e=0;var f=c1=c2=0;while(e191)&&(f<224)){c2=b.charCodeAt(e+1);d+=String.fromCharCode(((f&31)<<6)|(c2&63));e+=2}else{c2=b.charCodeAt(e+1);c3=b.charCodeAt(e+2);d+=String.fromCharCode(((f&15)<<12)|((c2&63)<<6)|(c3&63));e+=3}}}return d}};function sortNumeric(d,b){return d-b}(function(){var globals=["Prototype","Abstract","Try","Class","PeriodicalExecuter","Template","$break","Enumerable","$A","$w","$H","Hash","$R","ObjectRange","Ajax","$","Form","Field","$F","Toggle","Insertion","$continue","Position","Windows","Dialog","array","WindowUtilities","Builder","Effect","validateCreditCard","Validator","Validation","removeDelimiters","parseNumber","popWin","setLocation","setPLocation","setLanguageCode","decorateGeneric","decorateTable","decorateList","decorateDataList","parseSidUrl","formatCurrency","expandDetails","isIE","Varien","fireEvent","modulo","byteConvert","SessionError","varienLoader","varienLoaderHandler","setLoaderPosition","toggleSelectsUnderBlock","varienUpdater","setElementDisable","toggleParentVis","toggleFieldsetVis","toggleVis","imagePreview","checkByProductPriceType","toggleSeveralValueElements","toggleValueElements","submitAndReloadArea","syncOnchangeValue","updateElementAtCursor","firebugEnabled","disableElement","enableElement","disableElements","enableElements","Cookie","Fieldset","Base64","sortNumeric","Element","$$","Sizzle","Selector","Window"];globals.forEach(function(prop){window[prop]=eval(prop)})})(); \ No newline at end of file +(function(){var w=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,p=0,g=Object.prototype.toString,u=false,o=true;[0,0].sort(function(){o=false;return 0});var d=function(L,B,I,D){I=I||[];var e=B=B||document;if(B.nodeType!==1&&B.nodeType!==9){return[]}if(!L||typeof L!=="string"){return I}var J=[],K,G,P,O,H,A,z=true,E=v(B),N=L;while((w.exec(""),K=w.exec(N))!==null){N=K[3];J.push(K[1]);if(K[2]){A=K[3];break}}if(J.length>1&&q.exec(L)){if(J.length===2&&h.relative[J[0]]){G=l(J[0]+J[1],B)}else{G=h.relative[J[0]]?[B]:d(J.shift(),B);while(J.length){L=J.shift();if(h.relative[L]){L+=J.shift()}G=l(L,G)}}}else{if(!D&&J.length>1&&B.nodeType===9&&!E&&h.match.ID.test(J[0])&&!h.match.ID.test(J[J.length-1])){var Q=d.find(J.shift(),B,E);B=Q.expr?d.filter(Q.expr,Q.set)[0]:Q.set[0]}if(B){var Q=D?{expr:J.pop(),set:b(D)}:d.find(J.pop(),J.length===1&&(J[0]==="~"||J[0]==="+")&&B.parentNode?B.parentNode:B,E);G=Q.expr?d.filter(Q.expr,Q.set):Q.set;if(J.length>0){P=b(G)}else{z=false}while(J.length){var C=J.pop(),F=C;if(!h.relative[C]){C=""}else{F=J.pop()}if(F==null){F=B}h.relative[C](P,F,E)}}else{P=J=[]}}if(!P){P=G}if(!P){throw"Syntax error, unrecognized expression: "+(C||L)}if(g.call(P)==="[object Array]"){if(!z){I.push.apply(I,P)}else{if(B&&B.nodeType===1){for(var M=0;P[M]!=null;M++){if(P[M]&&(P[M]===true||P[M].nodeType===1&&n(B,P[M]))){I.push(G[M])}}}else{for(var M=0;P[M]!=null;M++){if(P[M]&&P[M].nodeType===1){I.push(G[M])}}}}}else{b(P,I)}if(A){d(A,e,I,D);d.uniqueSort(I)}return I};d.uniqueSort=function(z){if(f){u=o;z.sort(f);if(u){for(var e=1;e":function(E,z,F){var C=typeof z==="string";if(C&&!/\W/.test(z)){z=F?z:z.toUpperCase();for(var A=0,e=E.length;A=0)){if(!A){e.push(D)}}else{if(A){z[C]=false}}}}return false},ID:function(e){return e[1].replace(/\\/g,"")},TAG:function(z,e){for(var A=0;e[A]===false;A++){}return e[A]&&v(e[A])?z[1]:z[1].toUpperCase()},CHILD:function(e){if(e[1]=="nth"){var z=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(e[2]=="even"&&"2n"||e[2]=="odd"&&"2n+1"||!/\D/.test(e[2])&&"0n+"+e[2]||e[2]);e[2]=(z[1]+(z[2]||1))-0;e[3]=z[3]-0}e[0]=p++;return e},ATTR:function(C,z,A,e,D,E){var B=C[1].replace(/\\/g,"");if(!E&&h.attrMap[B]){C[1]=h.attrMap[B]}if(C[2]==="~="){C[4]=" "+C[4]+" "}return C},PSEUDO:function(C,z,A,e,D){if(C[1]==="not"){if((w.exec(C[3])||"").length>1||/^\w/.test(C[3])){C[3]=d(C[3],null,null,z)}else{var B=d.filter(C[3],z,A,true^D);if(!A){e.push.apply(e,B)}return false}}else{if(h.match.POS.test(C[0])||h.match.CHILD.test(C[0])){return true}}return C},POS:function(e){e.unshift(true);return e}},filters:{enabled:function(e){return e.disabled===false&&e.type!=="hidden"},disabled:function(e){return e.disabled===true},checked:function(e){return e.checked===true},selected:function(e){e.parentNode.selectedIndex;return e.selected===true},parent:function(e){return !!e.firstChild},empty:function(e){return !e.firstChild},has:function(A,z,e){return !!d(e[3],A).length},header:function(e){return/h\d/i.test(e.nodeName)},text:function(e){return"text"===e.type},radio:function(e){return"radio"===e.type},checkbox:function(e){return"checkbox"===e.type},file:function(e){return"file"===e.type},password:function(e){return"password"===e.type},submit:function(e){return"submit"===e.type},image:function(e){return"image"===e.type},reset:function(e){return"reset"===e.type},button:function(e){return"button"===e.type||e.nodeName.toUpperCase()==="BUTTON"},input:function(e){return/input|select|textarea|button/i.test(e.nodeName)}},setFilters:{first:function(z,e){return e===0},last:function(A,z,e,B){return z===B.length-1},even:function(z,e){return e%2===0},odd:function(z,e){return e%2===1},lt:function(A,z,e){return ze[3]-0},nth:function(A,z,e){return e[3]-0==z},eq:function(A,z,e){return e[3]-0==z}},filter:{PSEUDO:function(E,A,B,F){var z=A[1],C=h.filters[z];if(C){return C(E,B,A,F)}else{if(z==="contains"){return(E.textContent||E.innerText||"").indexOf(A[3])>=0}else{if(z==="not"){var D=A[3];for(var B=0,e=D.length;B=0)}}},ID:function(z,e){return z.nodeType===1&&z.getAttribute("id")===e},TAG:function(z,e){return(e==="*"&&z.nodeType===1)||z.nodeName===e},CLASS:function(z,e){return(" "+(z.className||z.getAttribute("class"))+" ").indexOf(e)>-1},ATTR:function(D,B){var A=B[1],e=h.attrHandle[A]?h.attrHandle[A](D):D[A]!=null?D[A]:D.getAttribute(A),E=e+"",C=B[2],z=B[4];return e==null?C==="!=":C==="="?E===z:C==="*="?E.indexOf(z)>=0:C==="~="?(" "+E+" ").indexOf(z)>=0:!z?E&&e!==false:C==="!="?E!=z:C==="^="?E.indexOf(z)===0:C==="$="?E.substr(E.length-z.length)===z:C==="|="?E===z||E.substr(0,z.length+1)===z+"-":false},POS:function(C,z,A,D){var e=z[2],B=h.setFilters[e];if(B){return B(C,A,z,D)}}}};var q=h.match.POS;for(var s in h.match){h.match[s]=new RegExp(h.match[s].source+/(?![^\[]*\])(?![^\(]*\))/.source);h.leftMatch[s]=new RegExp(/(^(?:.|\r|\n)*?)/.source+h.match[s].source)}var b=function(z,e){z=Array.prototype.slice.call(z,0);if(e){e.push.apply(e,z);return e}return z};try{Array.prototype.slice.call(document.documentElement.childNodes,0)}catch(r){b=function(C,B){var z=B||[];if(g.call(C)==="[object Array]"){Array.prototype.push.apply(z,C)}else{if(typeof C.length==="number"){for(var A=0,e=C.length;A";var e=document.documentElement;e.insertBefore(z,e.firstChild);if(!!document.getElementById(A)){h.find.ID=function(C,D,E){if(typeof D.getElementById!=="undefined"&&!E){var B=D.getElementById(C[1]);return B?B.id===C[1]||typeof B.getAttributeNode!=="undefined"&&B.getAttributeNode("id").nodeValue===C[1]?[B]:undefined:[]}};h.filter.ID=function(D,B){var C=typeof D.getAttributeNode!=="undefined"&&D.getAttributeNode("id");return D.nodeType===1&&C&&C.nodeValue===B}}e.removeChild(z);e=z=null})();(function(){var e=document.createElement("div");e.appendChild(document.createComment(""));if(e.getElementsByTagName("*").length>0){h.find.TAG=function(z,D){var C=D.getElementsByTagName(z[1]);if(z[1]==="*"){var B=[];for(var A=0;C[A];A++){if(C[A].nodeType===1){B.push(C[A])}}C=B}return C}}e.innerHTML="";if(e.firstChild&&typeof e.firstChild.getAttribute!=="undefined"&&e.firstChild.getAttribute("href")!=="#"){h.attrHandle.href=function(z){return z.getAttribute("href",2)}}e=null})();if(document.querySelectorAll){(function(){var e=d,A=document.createElement("div");A.innerHTML="

";if(A.querySelectorAll&&A.querySelectorAll(".TEST").length===0){return}d=function(E,D,B,C){D=D||document;if(!C&&D.nodeType===9&&!v(D)){try{return b(D.querySelectorAll(E),B)}catch(F){}}return e(E,D,B,C)};for(var z in e){d[z]=e[z]}A=null})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var e=document.createElement("div");e.innerHTML="
";if(e.getElementsByClassName("e").length===0){return}e.lastChild.className="e";if(e.getElementsByClassName("e").length===1){return}h.order.splice(1,0,"CLASS");h.find.CLASS=function(z,A,B){if(typeof A.getElementsByClassName!=="undefined"&&!B){return A.getElementsByClassName(z[1])}};e=null})()}function t(z,E,D,I,F,H){var G=z=="previousSibling"&&!H;for(var B=0,A=I.length;B0){C=e;break}}}e=e[z]}I[B]=C}}}var n=document.compareDocumentPosition?function(z,e){return z.compareDocumentPosition(e)&16}:function(z,e){return z!==e&&(z.contains?z.contains(e):true)};var v=function(e){return e.nodeType===9&&e.documentElement.nodeName!=="HTML"||!!e.ownerDocument&&e.ownerDocument.documentElement.nodeName!=="HTML"};var l=function(e,F){var B=[],C="",D,A=F.nodeType?[F]:F;while((D=h.match.PSEUDO.exec(e))){C+=D[0];e=e.replace(h.match.PSEUDO,"")}e=h.relative[e]?e+"*":e;for(var E=0,z=A.length;E=0}).sortBy(function(f){return f.tabIndex}).first();return b?b:e.find(function(f){return/^(?:input|select|textarea)$/i.test(f.tagName)})},focusFirstElement:function(d){d=$(d);var b=d.findFirstElement();if(b){b.activate()}return d},request:function(d,b){d=$(d),b=Object.clone(b||{});var f=b.parameters,e=d.readAttribute("action")||"";if(e.blank()){e=window.location.href}b.parameters=d.serialize(true);if(f){if(Object.isString(f)){f=f.toQueryParams()}Object.extend(b.parameters,f)}if(d.hasAttribute("method")&&!b.method){b.method=d.method}return new Ajax.Request(e,b)}};Form.Element={focus:function(b){$(b).focus();return b},select:function(b){$(b).select();return b}};Form.Element.Methods={serialize:function(b){b=$(b);if(!b.disabled&&b.name){var d=b.getValue();if(d!=undefined){var e={};e[b.name]=d;return Object.toQueryString(e)}}return""},getValue:function(b){b=$(b);var d=b.tagName.toLowerCase();return Form.Element.Serializers[d](b)},setValue:function(b,d){b=$(b);var e=b.tagName.toLowerCase();Form.Element.Serializers[e](b,d);return b},clear:function(b){$(b).value="";return b},present:function(b){return $(b).value!=""},activate:function(b){b=$(b);try{b.focus();if(b.select&&(b.tagName.toLowerCase()!="input"||!(/^(?:button|reset|submit)$/i.test(b.type)))){b.select()}}catch(d){}return b},disable:function(b){b=$(b);b.disabled=true;return b},enable:function(b){b=$(b);b.disabled=false;return b}};var Field=Form.Element;var $F=Form.Element.Methods.getValue;Form.Element.Serializers=(function(){function d(n,o){switch(n.type.toLowerCase()){case"checkbox":case"radio":return h(n,o);default:return g(n,o)}}function h(n,o){if(Object.isUndefined(o)){return n.checked?n.value:null}else{n.checked=!!o}}function g(n,o){if(Object.isUndefined(o)){return n.value}else{n.value=o}}function b(p,s){if(Object.isUndefined(s)){return(p.type==="select-one"?e:f)(p)}var o,q,t=!Object.isArray(s);for(var n=0,r=p.length;n=0?l(o.options[n]):null}function f(q){var n,r=q.length;if(!r){return null}for(var p=0,n=[];p=this.offset[1]&&e=this.offset[0]&&b=this.offset[1]&&this.ycomp=this.offset[0]&&this.xcomp0})._each(b)},set:function(b){this.element.className=b},add:function(b){if(this.include(b)){return}this.set($A(this).concat(b).join(" "))},remove:function(b){if(!this.include(b)){return}this.set($A(this).without(b).join(" "))},toString:function(){return $A(this).join(" ")}};Object.extend(Element.ClassNames.prototype,Enumerable);(function(){window.Selector=Class.create({initialize:function(b){this.expression=b.strip()},findElements:function(b){return Prototype.Selector.select(this.expression,b)},match:function(b){return Prototype.Selector.match(b,this.expression)},toString:function(){return this.expression},inspect:function(){return"#"}});Object.extend(Selector,{matchElements:function(h,l){var b=Prototype.Selector.match,f=[];for(var e=0,g=h.length;e0){if(typeof arguments[0]=="string"){e=arguments[0];d=1}else{e=arguments[0]?arguments[0].id:null}}if(!e){e="window_"+new Date().getTime()}if($(e)){alert("Window "+e+" is already registered in the DOM! Make sure you use setDestroyOnClose() or destroyOnClose: true in the constructor")}this.options=Object.extend({className:"dialog",windowClassName:null,blurClassName:null,minWidth:100,minHeight:20,resizable:true,closable:true,minimizable:true,maximizable:true,draggable:true,userData:null,showEffect:(Window.hasEffectLib?Effect.Appear:Element.show),hideEffect:(Window.hasEffectLib?Effect.Fade:Element.hide),showEffectOptions:{},hideEffectOptions:{},effectOptions:null,parent:document.body,title:" ",url:null,onload:Prototype.emptyFunction,width:200,height:300,opacity:1,recenterAuto:true,wiredDrag:false,closeOnEsc:true,closeCallback:null,destroyOnClose:false,gridX:1,gridY:1},arguments[d]||{});if(this.options.blurClassName){this.options.focusClassName=this.options.className}if(typeof this.options.top=="undefined"&&typeof this.options.bottom=="undefined"){this.options.top=this._round(Math.random()*500,this.options.gridY)}if(typeof this.options.left=="undefined"&&typeof this.options.right=="undefined"){this.options.left=this._round(Math.random()*500,this.options.gridX)}if(this.options.effectOptions){Object.extend(this.options.hideEffectOptions,this.options.effectOptions);Object.extend(this.options.showEffectOptions,this.options.effectOptions);if(this.options.showEffect==Element.Appear){this.options.showEffectOptions.to=this.options.opacity}}if(Window.hasEffectLib){if(this.options.showEffect==Effect.Appear){this.options.showEffectOptions.to=this.options.opacity}if(this.options.hideEffect==Effect.Fade){this.options.hideEffectOptions.from=this.options.opacity}}if(this.options.hideEffect==Element.hide){this.options.hideEffect=function(){Element.hide(this.element);if(this.options.destroyOnClose){this.destroy()}}.bind(this)}if(this.options.parent!=document.body){this.options.parent=$(this.options.parent)}this.element=this._createWindow(e);this.element.win=this;this.eventMouseDown=this._initDrag.bindAsEventListener(this);this.eventMouseUp=this._endDrag.bindAsEventListener(this);this.eventMouseMove=this._updateDrag.bindAsEventListener(this);this.eventOnLoad=this._getWindowBorderSize.bindAsEventListener(this);this.eventMouseDownContent=this.toFront.bindAsEventListener(this);this.eventResize=this._recenter.bindAsEventListener(this);this.eventKeyUp=this._keyUp.bindAsEventListener(this);this.topbar=$(this.element.id+"_top");this.bottombar=$(this.element.id+"_bottom");this.content=$(this.element.id+"_content");Event.observe(this.topbar,"mousedown",this.eventMouseDown);Event.observe(this.bottombar,"mousedown",this.eventMouseDown);Event.observe(this.content,"mousedown",this.eventMouseDownContent);Event.observe(window,"load",this.eventOnLoad);Event.observe(window,"resize",this.eventResize);Event.observe(window,"scroll",this.eventResize);Event.observe(document,"keyup",this.eventKeyUp);Event.observe(this.options.parent,"scroll",this.eventResize);if(this.options.draggable){var b=this;[this.topbar,this.topbar.up().previous(),this.topbar.up().next()].each(function(f){f.observe("mousedown",b.eventMouseDown);f.addClassName("top_draggable")});[this.bottombar.up(),this.bottombar.up().previous(),this.bottombar.up().next()].each(function(f){f.observe("mousedown",b.eventMouseDown);f.addClassName("bottom_draggable")})}if(this.options.resizable){this.sizer=$(this.element.id+"_sizer");Event.observe(this.sizer,"mousedown",this.eventMouseDown)}this.useLeft=null;this.useTop=null;if(typeof this.options.left!="undefined"){this.element.setStyle({left:parseFloat(this.options.left)+"px"});this.useLeft=true}else{this.element.setStyle({right:parseFloat(this.options.right)+"px"});this.useLeft=false}if(typeof this.options.top!="undefined"){this.element.setStyle({top:parseFloat(this.options.top)+"px"});this.useTop=true}else{this.element.setStyle({bottom:parseFloat(this.options.bottom)+"px"});this.useTop=false}this.storedLocation=null;this.setOpacity(this.options.opacity);if(this.options.zIndex){this.setZIndex(this.options.zIndex)}else{this.setZIndex(this.getMaxZIndex())}if(this.options.destroyOnClose){this.setDestroyOnClose(true)}this._getWindowBorderSize();this.width=this.options.width;this.height=this.options.height;this.visible=false;this.constraint=false;this.constraintPad={top:0,left:0,bottom:0,right:0};if(this.width&&this.height){this.setSize(this.options.width,this.options.height)}this.setTitle(this.options.title);Windows.register(this)},getMaxZIndex:function(){var b=0,d;var g=document.body.childNodes;for(d=0;d ';$(this.getId()+"_table_content").innerHTML=d;this.content=$(this.element.id+"_content")}this.getContent().innerHTML=b},setAjaxContent:function(d,b,f,e){this.showFunction=f?"showCenter":"show";this.showModal=e||false;b=b||{};this.setHTMLContent("");this.onComplete=b.onComplete;if(!this._onCompleteHandler){this._onCompleteHandler=this._setAjaxContent.bind(this)}b.onComplete=this._onCompleteHandler;new Ajax.Request(d,b);b.onComplete=this.onComplete},_setAjaxContent:function(b){Element.update(this.getContent(),b.responseText);if(this.onComplete){this.onComplete(b)}this.onComplete=null;this[this.showFunction](this.showModal)},setURL:function(b){if(this.options.url){this.content.src=null}this.options.url=b;var d="";$(this.getId()+"_table_content").innerHTML=d;this.content=$(this.element.id+"_content")},getURL:function(){return this.options.url?this.options.url:null},refresh:function(){if(this.options.url){$(this.element.getAttribute("id")+"_content").src=this.options.url}},setCookie:function(d,e,t,g,b){d=d||this.element.id;this.cookie=[d,e,t,g,b];var r=WindowUtilities.getCookie(d);if(r){var s=r.split(",");var p=s[0].split(":");var o=s[1].split(":");var q=parseFloat(s[2]),l=parseFloat(s[3]);var n=s[4];var f=s[5];this.setSize(q,l);if(n=="true"){this.doMinimize=true}else{if(f=="true"){this.doMaximize=true}}this.useLeft=p[0]=="l";this.useTop=o[0]=="t";this.element.setStyle(this.useLeft?{left:p[1]}:{right:p[1]});this.element.setStyle(this.useTop?{top:o[1]}:{bottom:o[1]})}},getId:function(){return this.element.id},setDestroyOnClose:function(){this.options.destroyOnClose=true},setConstraint:function(b,d){this.constraint=b;this.constraintPad=Object.extend(this.constraintPad,d||{});if(this.useTop&&this.useLeft){this.setLocation(parseFloat(this.element.style.top),parseFloat(this.element.style.left))}},_initDrag:function(d){if(Event.element(d)==this.sizer&&this.isMinimized()){return}if(Event.element(d)!=this.sizer&&this.isMaximized()){return}if(Prototype.Browser.IE&&this.heightN==0){this._getWindowBorderSize()}this.pointer=[this._round(Event.pointerX(d),this.options.gridX),this._round(Event.pointerY(d),this.options.gridY)];if(this.options.wiredDrag){this.currentDrag=this._createWiredElement()}else{this.currentDrag=this.element}if(Event.element(d)==this.sizer){this.doResize=true;this.widthOrg=this.width;this.heightOrg=this.height;this.bottomOrg=parseFloat(this.element.getStyle("bottom"));this.rightOrg=parseFloat(this.element.getStyle("right"));this._notify("onStartResize")}else{this.doResize=false;var b=$(this.getId()+"_close");if(b&&Position.within(b,this.pointer[0],this.pointer[1])){this.currentDrag=null;return}this.toFront();if(!this.options.draggable){return}this._notify("onStartMove")}Event.observe(document,"mouseup",this.eventMouseUp,false);Event.observe(document,"mousemove",this.eventMouseMove,false);WindowUtilities.disableScreen("__invisible__","__invisible__",this.overlayOpacity);document.body.ondrag=function(){return false};document.body.onselectstart=function(){return false};this.currentDrag.show();Event.stop(d)},_round:function(d,b){return b==1?d:d=Math.floor(d/b)*b},_updateDrag:function(d){var b=[this._round(Event.pointerX(d),this.options.gridX),this._round(Event.pointerY(d),this.options.gridY)];var q=b[0]-this.pointer[0];var p=b[1]-this.pointer[1];if(this.doResize){var o=this.widthOrg+q;var f=this.heightOrg+p;q=this.width-this.widthOrg;p=this.height-this.heightOrg;if(this.useLeft){o=this._updateWidthConstraint(o)}else{this.currentDrag.setStyle({right:(this.rightOrg-q)+"px"})}if(this.useTop){f=this._updateHeightConstraint(f)}else{this.currentDrag.setStyle({bottom:(this.bottomOrg-p)+"px"})}this.setSize(o,f);this._notify("onResize")}else{this.pointer=b;if(this.useLeft){var e=parseFloat(this.currentDrag.getStyle("left"))+q;var n=this._updateLeftConstraint(e);this.pointer[0]+=n-e;this.currentDrag.setStyle({left:n+"px"})}else{this.currentDrag.setStyle({right:parseFloat(this.currentDrag.getStyle("right"))-q+"px"})}if(this.useTop){var l=parseFloat(this.currentDrag.getStyle("top"))+p;var g=this._updateTopConstraint(l);this.pointer[1]+=g-l;this.currentDrag.setStyle({top:g+"px"})}else{this.currentDrag.setStyle({bottom:parseFloat(this.currentDrag.getStyle("bottom"))-p+"px"})}this._notify("onMove")}if(this.iefix){this._fixIEOverlapping()}this._removeStoreLocation();Event.stop(d)},_endDrag:function(b){WindowUtilities.enableScreen("__invisible__");if(this.doResize){this._notify("onEndResize")}else{this._notify("onEndMove")}Event.stopObserving(document,"mouseup",this.eventMouseUp,false);Event.stopObserving(document,"mousemove",this.eventMouseMove,false);Event.stop(b);this._hideWiredElement();this._saveCookie();document.body.ondrag=null;document.body.onselectstart=null},_updateLeftConstraint:function(d){if(this.constraint&&this.useLeft&&this.useTop){var b=this.options.parent==document.body?WindowUtilities.getPageSize().windowWidth:this.options.parent.getDimensions().width;if(db-this.constraintPad.right){d=b-this.constraintPad.right-this.width-this.widthE-this.widthW}}return d},_updateTopConstraint:function(e){if(this.constraint&&this.useLeft&&this.useTop){var b=this.options.parent==document.body?WindowUtilities.getPageSize().windowHeight:this.options.parent.getDimensions().height;var d=this.height+this.heightN+this.heightS;if(eb-this.constraintPad.bottom){e=b-this.constraintPad.bottom-d}}return e},_updateWidthConstraint:function(b){if(this.constraint&&this.useLeft&&this.useTop){var d=this.options.parent==document.body?WindowUtilities.getPageSize().windowWidth:this.options.parent.getDimensions().width;var e=parseFloat(this.element.getStyle("left"));if(e+b+this.widthE+this.widthW>d-this.constraintPad.right){b=d-this.constraintPad.right-e-this.widthE-this.widthW}}return b},_updateHeightConstraint:function(d){if(this.constraint&&this.useLeft&&this.useTop){var b=this.options.parent==document.body?WindowUtilities.getPageSize().windowHeight:this.options.parent.getDimensions().height;var e=parseFloat(this.element.getStyle("top"));if(e+d+this.heightN+this.heightS>b-this.constraintPad.bottom){d=b-this.constraintPad.bottom-e-this.heightN-this.heightS}}return d},_createWindow:function(b){var h=this.options.className;var f=document.createElement("div");f.setAttribute("id",b);f.className="dialog";if(this.options.windowClassName){f.className+=" "+this.options.windowClassName}var g;if(this.options.url){g=''}else{g='
'}var l=this.options.closable?"
":"";var n=this.options.minimizable?"
":"";var o=this.options.maximizable?"
":"";var e=this.options.resizable?"class='"+h+"_sizer' id='"+b+"_sizer'":"class='"+h+"_se'";var d="../themes/default/blank.gif";f.innerHTML=l+n+o+"
"+this.options.title+"
"+g+"
";Element.hide(f);this.options.parent.insertBefore(f,this.options.parent.firstChild);Event.observe($(b+"_content"),"load",this.options.onload);return f},changeClassName:function(b){var d=this.options.className;var e=this.getId();$A(["_close","_minimize","_maximize","_sizer","_content"]).each(function(f){this._toggleClassName($(e+f),d+f,b+f)}.bind(this));this._toggleClassName($(e+"_top"),d+"_title",b+"_title");$$("#"+e+" td").each(function(f){f.className=f.className.sub(d,b)});this.options.className=b},_toggleClassName:function(e,d,b){if(e){e.removeClassName(d);e.addClassName(b)}},setLocation:function(f,d){f=this._updateTopConstraint(f);d=this._updateLeftConstraint(d);var b=this.currentDrag||this.element;b.setStyle({top:f+"px"});b.setStyle({left:d+"px"});this.useLeft=true;this.useTop=true},getLocation:function(){var b={};if(this.useTop){b=Object.extend(b,{top:this.element.getStyle("top")})}else{b=Object.extend(b,{bottom:this.element.getStyle("bottom")})}if(this.useLeft){b=Object.extend(b,{left:this.element.getStyle("left")})}else{b=Object.extend(b,{right:this.element.getStyle("right")})}return b},getSize:function(){return{width:this.width,height:this.height}},setSize:function(f,d,b){f=parseFloat(f);d=parseFloat(d);if(!this.minimized&&fthis.options.maxHeight){d=this.options.maxHeight}if(this.options.maxWidth&&f>this.options.maxWidth){f=this.options.maxWidth}if(this.useTop&&this.useLeft&&Window.hasEffectLib&&Effect.ResizeWindow&&b){new Effect.ResizeWindow(this,null,null,f,d,{duration:Window.resizeEffectDuration})}else{this.width=f;this.height=d;var h=this.currentDrag?this.currentDrag:this.element;h.setStyle({width:f+this.widthW+this.widthE+"px"});h.setStyle({height:d+this.heightN+this.heightS+"px"});if(!this.currentDrag||this.currentDrag==this.element){var g=$(this.element.id+"_content");g.setStyle({height:d+"px"});g.setStyle({width:f+"px"})}}},updateHeight:function(){this.setSize(this.width,this.content.scrollHeight,true)},updateWidth:function(){this.setSize(this.content.scrollWidth,this.height,true)},toFront:function(){if(this.element.style.zIndex0)&&(navigator.userAgent.indexOf("Opera")<0)&&(this.element.getStyle("position")=="absolute")){new Insertion.After(this.element.id,'');this.iefix=$(this.element.id+"_iefix")}if(this.iefix){setTimeout(this._fixIEOverlapping.bind(this),50)}},_fixIEOverlapping:function(){Position.clone(this.element,this.iefix);this.iefix.style.zIndex=this.element.style.zIndex-1;this.iefix.show()},_keyUp:function(b){if(27==b.keyCode&&this.options.closeOnEsc){this.close()}},_getWindowBorderSize:function(d){var e=this._createHiddenDiv(this.options.className+"_n");this.heightN=Element.getDimensions(e).height;e.parentNode.removeChild(e);var e=this._createHiddenDiv(this.options.className+"_s");this.heightS=Element.getDimensions(e).height;e.parentNode.removeChild(e);var e=this._createHiddenDiv(this.options.className+"_e");this.widthE=Element.getDimensions(e).width;e.parentNode.removeChild(e);var e=this._createHiddenDiv(this.options.className+"_w");this.widthW=Element.getDimensions(e).width;e.parentNode.removeChild(e);var e=document.createElement("div");e.className="overlay_"+this.options.className;document.body.appendChild(e);var b=this;setTimeout(function(){b.overlayOpacity=($(e).getStyle("opacity"));e.parentNode.removeChild(e)},10);if(Prototype.Browser.IE){this.heightS=$(this.getId()+"_row3").getDimensions().height;this.heightN=$(this.getId()+"_row1").getDimensions().height}if(Prototype.Browser.WebKit&&Prototype.Browser.WebKitVersion<420){this.setSize(this.width,this.height)}if(this.doMaximize){this.maximize()}if(this.doMinimize){this.minimize()}},_createHiddenDiv:function(d){var b=document.body;var e=document.createElement("div");e.setAttribute("id",this.element.id+"_tmp");e.className=d;e.style.display="none";e.innerHTML="";b.insertBefore(e,b.firstChild);return e},_storeLocation:function(){if(this.storedLocation==null){this.storedLocation={useTop:this.useTop,useLeft:this.useLeft,top:this.element.getStyle("top"),bottom:this.element.getStyle("bottom"),left:this.element.getStyle("left"),right:this.element.getStyle("right"),width:this.width,height:this.height}}},_restoreLocation:function(){if(this.storedLocation!=null){this.useLeft=this.storedLocation.useLeft;this.useTop=this.storedLocation.useTop;if(this.useLeft&&this.useTop&&Window.hasEffectLib&&Effect.ResizeWindow){new Effect.ResizeWindow(this,this.storedLocation.top,this.storedLocation.left,this.storedLocation.width,this.storedLocation.height,{duration:Window.resizeEffectDuration})}else{this.element.setStyle(this.useLeft?{left:this.storedLocation.left}:{right:this.storedLocation.right});this.element.setStyle(this.useTop?{top:this.storedLocation.top}:{bottom:this.storedLocation.bottom});this.setSize(this.storedLocation.width,this.storedLocation.height)}Windows.resetOverflow();this._removeStoreLocation()}},_removeStoreLocation:function(){this.storedLocation=null},_saveCookie:function(){if(this.cookie){var b="";if(this.useLeft){b+="l:"+(this.storedLocation?this.storedLocation.left:this.element.getStyle("left"))}else{b+="r:"+(this.storedLocation?this.storedLocation.right:this.element.getStyle("right"))}if(this.useTop){b+=",t:"+(this.storedLocation?this.storedLocation.top:this.element.getStyle("top"))}else{b+=",b:"+(this.storedLocation?this.storedLocation.bottom:this.element.getStyle("bottom"))}b+=","+(this.storedLocation?this.storedLocation.width:this.width);b+=","+(this.storedLocation?this.storedLocation.height:this.height);b+=","+this.isMinimized();b+=","+this.isMaximized();WindowUtilities.setCookie(b,this.cookie)}},_createWiredElement:function(){if(!this.wiredElement){if(Prototype.Browser.IE){this._getWindowBorderSize()}var d=document.createElement("div");d.className="wired_frame "+this.options.className+"_wired_frame";d.style.position="absolute";this.options.parent.insertBefore(d,this.options.parent.firstChild);this.wiredElement=$(d)}if(this.useLeft){this.wiredElement.setStyle({left:this.element.getStyle("left")})}else{this.wiredElement.setStyle({right:this.element.getStyle("right")})}if(this.useTop){this.wiredElement.setStyle({top:this.element.getStyle("top")})}else{this.wiredElement.setStyle({bottom:this.element.getStyle("bottom")})}var b=this.element.getDimensions();this.wiredElement.setStyle({width:b.width+"px",height:b.height+"px"});this.wiredElement.setStyle({zIndex:Windows.maxZIndex+30});return this.wiredElement},_hideWiredElement:function(){if(!this.wiredElement||!this.currentDrag){return}if(this.currentDrag==this.element){this.currentDrag=null}else{if(this.useLeft){this.element.setStyle({left:this.currentDrag.getStyle("left")})}else{this.element.setStyle({right:this.currentDrag.getStyle("right")})}if(this.useTop){this.element.setStyle({top:this.currentDrag.getStyle("top")})}else{this.element.setStyle({bottom:this.currentDrag.getStyle("bottom")})}this.currentDrag.hide();this.currentDrag=null;if(this.doResize){this.setSize(this.width,this.height)}}},_notify:function(b){if(this.options[b]){this.options[b](this)}else{Windows.notify(b,this)}}};var Windows={windows:[],modalWindows:[],observers:[],focusedWindow:null,maxZIndex:0,overlayShowEffectOptions:{duration:0.5},overlayHideEffectOptions:{duration:0.5},addObserver:function(b){this.removeObserver(b);this.observers.push(b)},removeObserver:function(b){this.observers=this.observers.reject(function(d){return d==b})},notify:function(b,d){this.observers.each(function(e){if(e[b]){e[b](b,d)}})},getWindow:function(b){return this.windows.detect(function(e){return e.getId()==b})},getFocusedWindow:function(){return this.focusedWindow},updateFocusedWindow:function(){this.focusedWindow=this.windows.length>=2?this.windows[this.windows.length-2]:null},register:function(b){this.windows.push(b)},addModalWindow:function(b){if(this.modalWindows.length==0){WindowUtilities.disableScreen(b.options.className,"overlay_modal",b.overlayOpacity,b.getId(),b.options.parent)}else{if(Window.keepMultiModalWindow){$("overlay_modal").style.zIndex=Windows.maxZIndex+1;Windows.maxZIndex+=1;WindowUtilities._hideSelect(this.modalWindows.last().getId())}else{this.modalWindows.last().element.hide()}WindowUtilities._showSelect(b.getId())}this.modalWindows.push(b)},removeModalWindow:function(b){this.modalWindows.pop();if(this.modalWindows.length==0){WindowUtilities.enableScreen()}else{if(Window.keepMultiModalWindow){this.modalWindows.last().toFront();WindowUtilities._showSelect(this.modalWindows.last().getId())}else{this.modalWindows.last().element.show()}}},register:function(b){this.windows.push(b)},unregister:function(b){this.windows=this.windows.reject(function(e){return e==b})},closeAll:function(){this.windows.each(function(b){Windows.close(b.getId())})},closeAllModalWindows:function(){WindowUtilities.enableScreen();this.modalWindows.each(function(b){if(b){b.close()}})},minimize:function(e,b){var d=this.getWindow(e);if(d&&d.visible){d.minimize()}Event.stop(b)},maximize:function(e,b){var d=this.getWindow(e);if(d&&d.visible){d.maximize()}Event.stop(b)},close:function(e,b){var d=this.getWindow(e);if(d){d.close()}if(b){Event.stop(b)}},blur:function(d){var b=this.getWindow(d);if(!b){return}if(b.options.blurClassName){b.changeClassName(b.options.blurClassName)}if(this.focusedWindow==b){this.focusedWindow=null}b._notify("onBlur")},focus:function(d){var b=this.getWindow(d);if(!b){return}if(this.focusedWindow){this.blur(this.focusedWindow.getId())}if(b.options.focusClassName){b.changeClassName(b.options.focusClassName)}this.focusedWindow=b;b._notify("onFocus")},unsetOverflow:function(b){this.windows.each(function(e){e.oldOverflow=e.getContent().getStyle("overflow")||"auto";e.getContent().setStyle({overflow:"hidden"})});if(b&&b.oldOverflow){b.getContent().setStyle({overflow:b.oldOverflow})}},resetOverflow:function(){this.windows.each(function(b){if(b.oldOverflow){b.getContent().setStyle({overflow:b.oldOverflow})}})},updateZindex:function(b,d){if(b>this.maxZIndex){this.maxZIndex=b;if(this.focusedWindow){this.blur(this.focusedWindow.getId())}}this.focusedWindow=d;if(this.focusedWindow){this.focus(this.focusedWindow.getId())}}};var Dialog={dialogId:null,onCompleteFunc:null,callFunc:null,parameters:null,confirm:function(f,e){if(f&&typeof f!="string"){Dialog._runAjaxRequest(f,e,Dialog.confirm);return}f=f||"";e=e||{};var h=e.okLabel?e.okLabel:"Ok";var b=e.cancelLabel?e.cancelLabel:"Cancel";e=Object.extend(e,e.windowParameters||{});e.windowParameters=e.windowParameters||{};e.className=e.className||"alert";var d="class ='"+(e.buttonClass?e.buttonClass+" ":"")+" ok_button'";var g="class ='"+(e.buttonClass?e.buttonClass+" ":"")+" cancel_button'";var f="
"+f+"
";return this._openDialog(f,e)},alert:function(e,d){if(e&&typeof e!="string"){Dialog._runAjaxRequest(e,d,Dialog.alert);return}e=e||"";d=d||{};var f=d.okLabel?d.okLabel:"Ok";d=Object.extend(d,d.windowParameters||{});d.windowParameters=d.windowParameters||{};d.className=d.className||"alert";var b="class ='"+(d.buttonClass?d.buttonClass+" ":"")+" ok_button'";var e="
"+e+"
";return this._openDialog(e,d)},info:function(d,b){if(d&&typeof d!="string"){Dialog._runAjaxRequest(d,b,Dialog.info);return}d=d||"";b=b||{};b=Object.extend(b,b.windowParameters||{});b.windowParameters=b.windowParameters||{};b.className=b.className||"alert";var d="";if(b.showProgress){d+=""}b.ok=null;b.cancel=null;return this._openDialog(d,b)},setInfoMessage:function(b){$("modal_dialog_message").update(b)},closeInfo:function(){Windows.close(this.dialogId)},_openDialog:function(g,f){var e=f.className;if(!f.height&&!f.width){f.width=WindowUtilities.getPageSize(f.options.parent||document.body).pageWidth/2}if(f.id){this.dialogId=f.id}else{var d=new Date();this.dialogId="modal_dialog_"+d.getTime();f.id=this.dialogId}if(!f.height||!f.width){var b=WindowUtilities._computeSize(g,this.dialogId,f.width,f.height,5,e);if(f.height){f.width=b+5}else{f.height=b+5}}f.effectOptions=f.effectOptions;f.resizable=f.resizable||false;f.minimizable=f.minimizable||false;f.maximizable=f.maximizable||false;f.draggable=f.draggable||false;f.closable=f.closable||false;var h=new Window(f);h.getContent().innerHTML=g;h.showCenter(true,f.top,f.left);h.setDestroyOnClose();h.cancelCallback=f.onCancel||f.cancel;h.okCallback=f.onOk||f.ok;return h},_getAjaxContent:function(b){Dialog.callFunc(b.responseText,Dialog.parameters)},_runAjaxRequest:function(e,d,b){if(e.options==null){e.options={}}Dialog.onCompleteFunc=e.options.onComplete;Dialog.parameters=d;Dialog.callFunc=b;e.options.onComplete=Dialog._getAjaxContent;new Ajax.Request(e.url,e.options)},okCallback:function(){var b=Windows.focusedWindow;if(!b.okCallback||b.okCallback(b)){$$("#"+b.getId()+" input").each(function(d){d.onclick=null});b.close()}},cancelCallback:function(){var b=Windows.focusedWindow;$$("#"+b.getId()+" input").each(function(d){d.onclick=null});b.close();if(b.cancelCallback){b.cancelCallback(b)}}};if(Prototype.Browser.WebKit){var array=navigator.userAgent.match(new RegExp(/AppleWebKit\/([\d\.\+]*)/));Prototype.Browser.WebKitVersion=parseFloat(array[1])}var WindowUtilities={getWindowScroll:function(parent){var T,L,W,H;parent=parent||document.body;if(parent!=document.body){T=parent.scrollTop;L=parent.scrollLeft;W=parent.scrollWidth;H=parent.scrollHeight}else{var w=window;with(w.document){if(w.document.documentElement&&documentElement.scrollTop){T=documentElement.scrollTop;L=documentElement.scrollLeft}else{if(w.document.body){T=body.scrollTop;L=body.scrollLeft}}if(w.innerWidth){W=w.innerWidth;H=w.innerHeight}else{if(w.document.documentElement&&documentElement.clientWidth){W=documentElement.clientWidth;H=documentElement.clientHeight}else{W=body.offsetWidth;H=body.offsetHeight}}}}return{top:T,left:L,width:W,height:H}},getPageSize:function(f){f=f||document.body;var e,l;var g,d;if(f!=document.body){e=f.getWidth();l=f.getHeight();d=f.scrollWidth;g=f.scrollHeight}else{var h,b;if(window.innerHeight&&window.scrollMaxY){h=document.body.scrollWidth;b=window.innerHeight+window.scrollMaxY}else{if(document.body.scrollHeight>document.body.offsetHeight){h=document.body.scrollWidth;b=document.body.scrollHeight}else{h=document.body.offsetWidth;b=document.body.offsetHeight}}if(self.innerHeight){e=document.documentElement.clientWidth;l=self.innerHeight}else{if(document.documentElement&&document.documentElement.clientHeight){e=document.documentElement.clientWidth;l=document.documentElement.clientHeight}else{if(document.body){e=document.body.clientWidth;l=document.body.clientHeight}}}if(b"}catch(h){}var g=d.firstChild||null;if(g&&(g.tagName.toUpperCase()!=b)){g=g.getElementsByTagName(b)[0]}if(!g){g=document.createElement(b)}if(!g){return}if(arguments[1]){if(this._isStringOrNumber(arguments[1])||(arguments[1] instanceof Array)||arguments[1].tagName){this._children(g,arguments[1])}else{var f=this._attributes(arguments[1]);if(f.length){try{d.innerHTML="<"+b+" "+f+">"}catch(h){}g=d.firstChild||null;if(!g){g=document.createElement(b);for(attr in arguments[1]){g[attr=="class"?"className":attr]=arguments[1][attr]}}if(g.tagName.toUpperCase()!=b){g=d.getElementsByTagName(b)[0]}}}}if(arguments[2]){this._children(g,arguments[2])}return $(g)},_text:function(b){return document.createTextNode(b)},ATTR_MAP:{className:"class",htmlFor:"for"},_attributes:function(b){var d=[];for(attribute in b){d.push((attribute in this.ATTR_MAP?this.ATTR_MAP[attribute]:attribute)+'="'+b[attribute].toString().escapeHTML().gsub(/"/,""")+'"')}return d.join(" ")},_children:function(d,b){if(b.tagName){d.appendChild(b);return}if(typeof b=="object"){b.flatten().each(function(f){if(typeof f=="object"){d.appendChild(f)}else{if(Builder._isStringOrNumber(f)){d.appendChild(Builder._text(f))}}})}else{if(Builder._isStringOrNumber(b)){d.appendChild(Builder._text(b))}}},_isStringOrNumber:function(b){return(typeof b=="string"||typeof b=="number")},build:function(d){var b=this.node("div");$(b).update(d.strip());return b.down()},dump:function(d){if(typeof d!="object"&&typeof d!="function"){d=window}var b=("A ABBR ACRONYM ADDRESS APPLET AREA B BASE BASEFONT BDO BIG BLOCKQUOTE BODY BR BUTTON CAPTION CENTER CITE CODE COL COLGROUP DD DEL DFN DIR DIV DL DT EM FIELDSET FONT FORM FRAME FRAMESET H1 H2 H3 H4 H5 H6 HEAD HR HTML I IFRAME IMG INPUT INS ISINDEX KBD LABEL LEGEND LI LINK MAP MENU META NOFRAMES NOSCRIPT OBJECT OL OPTGROUP OPTION P PARAM PRE Q S SAMP SCRIPT SELECT SMALL SPAN STRIKE STRONG STYLE SUB SUP TABLE TBODY TD TEXTAREA TFOOT TH THEAD TITLE TR TT U UL VAR").split(/\s+/);b.each(function(e){d[e]=function(){return Builder.node.apply(Builder,[e].concat($A(arguments)))}})}};String.prototype.parseColor=function(){var b="#";if(this.slice(0,4)=="rgb("){var e=this.slice(4,this.length-1).split(",");var d=0;do{b+=parseInt(e[d]).toColorPart()}while(++d<3)}else{if(this.slice(0,1)=="#"){if(this.length==4){for(var d=1;d<4;d++){b+=(this.charAt(d)+this.charAt(d)).toLowerCase()}}if(this.length==7){b=this.toLowerCase()}}}return(b.length==7?b:(arguments[0]||this))};Element.collectTextNodes=function(b){return $A($(b).childNodes).collect(function(d){return(d.nodeType==3?d.nodeValue:(d.hasChildNodes()?Element.collectTextNodes(d):""))}).flatten().join("")};Element.collectTextNodesIgnoreClass=function(b,d){return $A($(b).childNodes).collect(function(e){return(e.nodeType==3?e.nodeValue:((e.hasChildNodes()&&!Element.hasClassName(e,d))?Element.collectTextNodesIgnoreClass(e,d):""))}).flatten().join("")};Element.setContentZoom=function(b,d){b=$(b);b.setStyle({fontSize:(d/100)+"em"});if(Prototype.Browser.WebKit){window.scrollBy(0,0)}return b};Element.getInlineOpacity=function(b){return $(b).style.opacity||""};Element.forceRerendering=function(b){try{b=$(b);var f=document.createTextNode(" ");b.appendChild(f);b.removeChild(f)}catch(d){}};var Effect={_elementDoesNotExistError:{name:"ElementDoesNotExistError",message:"The specified DOM element does not exist, but is required for this effect to operate"},Transitions:{linear:Prototype.K,sinoidal:function(b){return(-Math.cos(b*Math.PI)/2)+0.5},reverse:function(b){return 1-b},flicker:function(b){var b=((-Math.cos(b*Math.PI)/4)+0.75)+Math.random()/4;return b>1?1:b},wobble:function(b){return(-Math.cos(b*Math.PI*(9*b))/2)+0.5},pulse:function(d,b){return(-Math.cos((d*((b||5)-0.5)*2)*Math.PI)/2)+0.5},spring:function(b){return 1-(Math.cos(b*4.5*Math.PI)*Math.exp(-b*6))},none:function(b){return 0},full:function(b){return 1}},DefaultOptions:{duration:1,fps:100,sync:false,from:0,to:1,delay:0,queue:"parallel"},tagifyText:function(b){var d="position:relative";if(Prototype.Browser.IE){d+=";zoom:1"}b=$(b);$A(b.childNodes).each(function(e){if(e.nodeType==3){e.nodeValue.toArray().each(function(f){b.insertBefore(new Element("span",{style:d}).update(f==" "?String.fromCharCode(160):f),e)});Element.remove(e)}})},multiple:function(d,e){var g;if(((typeof d=="object")||Object.isFunction(d))&&(d.length)){g=d}else{g=$(d).childNodes}var b=Object.extend({speed:0.1,delay:0},arguments[2]||{});var f=b.delay;$A(g).each(function(l,h){new e(l,Object.extend(b,{delay:h*b.speed+f}))})},PAIRS:{slide:["SlideDown","SlideUp"],blind:["BlindDown","BlindUp"],appear:["Appear","Fade"]},toggle:function(d,e){d=$(d);e=(e||"appear").toLowerCase();var b=Object.extend({queue:{position:"end",scope:(d.id||"global"),limit:1}},arguments[2]||{});Effect[d.visible()?Effect.PAIRS[e][1]:Effect.PAIRS[e][0]](d,b)}};Effect.DefaultOptions.transition=Effect.Transitions.sinoidal;Effect.ScopedQueue=Class.create(Enumerable,{initialize:function(){this.effects=[];this.interval=null},_each:function(b){this.effects._each(b)},add:function(d){var e=new Date().getTime();var b=Object.isString(d.options.queue)?d.options.queue:d.options.queue.position;switch(b){case"front":this.effects.findAll(function(f){return f.state=="idle"}).each(function(f){f.startOn+=d.finishOn;f.finishOn+=d.finishOn});break;case"with-last":e=this.effects.pluck("startOn").max()||e;break;case"end":e=this.effects.pluck("finishOn").max()||e;break}d.startOn+=e;d.finishOn+=e;if(!d.options.queue.limit||(this.effects.length=this.startOn){if(e>=this.finishOn){this.render(1);this.cancel();this.event("beforeFinish");if(this.finish){this.finish()}this.event("afterFinish");return}var d=(e-this.startOn)/this.totalTime,b=(d*this.totalFrames).round();if(b>this.currentFrame){this.render(d);this.currentFrame=b}}},cancel:function(){if(!this.options.sync){Effect.Queues.get(Object.isString(this.options.queue)?"global":this.options.queue.scope).remove(this)}this.state="finished"},event:function(b){if(this.options[b+"Internal"]){this.options[b+"Internal"](this)}if(this.options[b]){this.options[b](this)}},inspect:function(){var b=$H();for(property in this){if(!Object.isFunction(this[property])){b.set(property,this[property])}}return"#"}});Effect.Parallel=Class.create(Effect.Base,{initialize:function(b){this.effects=b||[];this.start(arguments[1])},update:function(b){this.effects.invoke("render",b)},finish:function(b){this.effects.each(function(d){d.render(1);d.cancel();d.event("beforeFinish");if(d.finish){d.finish(b)}d.event("afterFinish")})}});Effect.Tween=Class.create(Effect.Base,{initialize:function(e,h,g){e=Object.isString(e)?$(e):e;var d=$A(arguments),f=d.last(),b=d.length==5?d[3]:null;this.method=Object.isFunction(f)?f.bind(e):Object.isFunction(e[f])?e[f].bind(e):function(l){e[f]=l};this.start(Object.extend({from:h,to:g},b||{}))},update:function(b){this.method(b)}});Effect.Event=Class.create(Effect.Base,{initialize:function(){this.start(Object.extend({duration:0},arguments[0]||{}))},update:Prototype.emptyFunction});Effect.Opacity=Class.create(Effect.Base,{initialize:function(d){this.element=$(d);if(!this.element){throw (Effect._elementDoesNotExistError)}if(Prototype.Browser.IE&&(!this.element.currentStyle.hasLayout)){this.element.setStyle({zoom:1})}var b=Object.extend({from:this.element.getOpacity()||0,to:1},arguments[1]||{});this.start(b)},update:function(b){this.element.setOpacity(b)}});Effect.Move=Class.create(Effect.Base,{initialize:function(d){this.element=$(d);if(!this.element){throw (Effect._elementDoesNotExistError)}var b=Object.extend({x:0,y:0,mode:"relative"},arguments[1]||{});this.start(b)},setup:function(){this.element.makePositioned();this.originalLeft=parseFloat(this.element.getStyle("left")||"0");this.originalTop=parseFloat(this.element.getStyle("top")||"0");if(this.options.mode=="absolute"){this.options.x=this.options.x-this.originalLeft;this.options.y=this.options.y-this.originalTop}},update:function(b){this.element.setStyle({left:(this.options.x*b+this.originalLeft).round()+"px",top:(this.options.y*b+this.originalTop).round()+"px"})}});Effect.MoveBy=function(d,b,e){return new Effect.Move(d,Object.extend({x:e,y:b},arguments[3]||{}))};Effect.Scale=Class.create(Effect.Base,{initialize:function(d,e){this.element=$(d);if(!this.element){throw (Effect._elementDoesNotExistError)}var b=Object.extend({scaleX:true,scaleY:true,scaleContent:true,scaleFromCenter:false,scaleMode:"box",scaleFrom:100,scaleTo:e},arguments[2]||{});this.start(b)},setup:function(){this.restoreAfterFinish=this.options.restoreAfterFinish||false;this.elementPositioning=this.element.getStyle("position");this.originalStyle={};["top","left","width","height","fontSize"].each(function(d){this.originalStyle[d]=this.element.style[d]}.bind(this));this.originalTop=this.element.offsetTop;this.originalLeft=this.element.offsetLeft;var b=this.element.getStyle("font-size")||"100%";["em","px","%","pt"].each(function(d){if(b.indexOf(d)>0){this.fontSize=parseFloat(b);this.fontSizeType=d}}.bind(this));this.factor=(this.options.scaleTo-this.options.scaleFrom)/100;this.dims=null;if(this.options.scaleMode=="box"){this.dims=[this.element.offsetHeight,this.element.offsetWidth]}if(/^content/.test(this.options.scaleMode)){this.dims=[this.element.scrollHeight,this.element.scrollWidth]}if(!this.dims){this.dims=[this.options.scaleMode.originalHeight,this.options.scaleMode.originalWidth]}},update:function(b){var d=(this.options.scaleFrom/100)+(this.factor*b);if(this.options.scaleContent&&this.fontSize){this.element.setStyle({fontSize:this.fontSize*d+this.fontSizeType})}this.setDimensions(this.dims[0]*d,this.dims[1]*d)},finish:function(b){if(this.restoreAfterFinish){this.element.setStyle(this.originalStyle)}},setDimensions:function(b,g){var h={};if(this.options.scaleX){h.width=g.round()+"px"}if(this.options.scaleY){h.height=b.round()+"px"}if(this.options.scaleFromCenter){var f=(b-this.dims[0])/2;var e=(g-this.dims[1])/2;if(this.elementPositioning=="absolute"){if(this.options.scaleY){h.top=this.originalTop-f+"px"}if(this.options.scaleX){h.left=this.originalLeft-e+"px"}}else{if(this.options.scaleY){h.top=-f+"px"}if(this.options.scaleX){h.left=-e+"px"}}}this.element.setStyle(h)}});Effect.Highlight=Class.create(Effect.Base,{initialize:function(d){this.element=$(d);if(!this.element){throw (Effect._elementDoesNotExistError)}var b=Object.extend({startcolor:"#ffff99"},arguments[1]||{});this.start(b)},setup:function(){if(this.element.getStyle("display")=="none"){this.cancel();return}this.oldStyle={};if(!this.options.keepBackgroundImage){this.oldStyle.backgroundImage=this.element.getStyle("background-image");this.element.setStyle({backgroundImage:"none"})}if(!this.options.endcolor){this.options.endcolor=this.element.getStyle("background-color").parseColor("#ffffff")}if(!this.options.restorecolor){this.options.restorecolor=this.element.getStyle("background-color")}this._base=$R(0,2).map(function(b){return parseInt(this.options.startcolor.slice(b*2+1,b*2+3),16)}.bind(this));this._delta=$R(0,2).map(function(b){return parseInt(this.options.endcolor.slice(b*2+1,b*2+3),16)-this._base[b]}.bind(this))},update:function(b){this.element.setStyle({backgroundColor:$R(0,2).inject("#",function(d,e,f){return d+((this._base[f]+(this._delta[f]*b)).round().toColorPart())}.bind(this))})},finish:function(){this.element.setStyle(Object.extend(this.oldStyle,{backgroundColor:this.options.restorecolor}))}});Effect.ScrollTo=function(e){var d=arguments[1]||{},b=document.viewport.getScrollOffsets(),f=$(e).cumulativeOffset();if(d.offset){f[1]+=d.offset}return new Effect.Tween(null,b.top,f[1],d,function(g){scrollTo(b.left,g.round())})};Effect.Fade=function(e){e=$(e);var b=e.getInlineOpacity();var d=Object.extend({from:e.getOpacity()||1,to:0,afterFinishInternal:function(f){if(f.options.to!=0){return}f.element.hide().setStyle({opacity:b})}},arguments[1]||{});return new Effect.Opacity(e,d)};Effect.Appear=function(d){d=$(d);var b=Object.extend({from:(d.getStyle("display")=="none"?0:d.getOpacity()||0),to:1,afterFinishInternal:function(e){e.element.forceRerendering()},beforeSetup:function(e){e.element.setOpacity(e.options.from).show()}},arguments[1]||{});return new Effect.Opacity(d,b)};Effect.Puff=function(d){d=$(d);var b={opacity:d.getInlineOpacity(),position:d.getStyle("position"),top:d.style.top,left:d.style.left,width:d.style.width,height:d.style.height};return new Effect.Parallel([new Effect.Scale(d,200,{sync:true,scaleFromCenter:true,scaleContent:true,restoreAfterFinish:true}),new Effect.Opacity(d,{sync:true,to:0})],Object.extend({duration:1,beforeSetupInternal:function(e){Position.absolutize(e.effects[0].element)},afterFinishInternal:function(e){e.effects[0].element.hide().setStyle(b)}},arguments[1]||{}))};Effect.BlindUp=function(b){b=$(b);b.makeClipping();return new Effect.Scale(b,0,Object.extend({scaleContent:false,scaleX:false,restoreAfterFinish:true,afterFinishInternal:function(d){d.element.hide().undoClipping()}},arguments[1]||{}))};Effect.BlindDown=function(d){d=$(d);var b=d.getDimensions();return new Effect.Scale(d,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:0,scaleMode:{originalHeight:b.height,originalWidth:b.width},restoreAfterFinish:true,afterSetup:function(e){e.element.makeClipping().setStyle({height:"0px"}).show()},afterFinishInternal:function(e){e.element.undoClipping()}},arguments[1]||{}))};Effect.SwitchOff=function(d){d=$(d);var b=d.getInlineOpacity();return new Effect.Appear(d,Object.extend({duration:0.4,from:0,transition:Effect.Transitions.flicker,afterFinishInternal:function(e){new Effect.Scale(e.element,1,{duration:0.3,scaleFromCenter:true,scaleX:false,scaleContent:false,restoreAfterFinish:true,beforeSetup:function(f){f.element.makePositioned().makeClipping()},afterFinishInternal:function(f){f.element.hide().undoClipping().undoPositioned().setStyle({opacity:b})}})}},arguments[1]||{}))};Effect.DropOut=function(d){d=$(d);var b={top:d.getStyle("top"),left:d.getStyle("left"),opacity:d.getInlineOpacity()};return new Effect.Parallel([new Effect.Move(d,{x:0,y:100,sync:true}),new Effect.Opacity(d,{sync:true,to:0})],Object.extend({duration:0.5,beforeSetup:function(e){e.effects[0].element.makePositioned()},afterFinishInternal:function(e){e.effects[0].element.hide().undoPositioned().setStyle(b)}},arguments[1]||{}))};Effect.Shake=function(f){f=$(f);var d=Object.extend({distance:20,duration:0.5},arguments[1]||{});var g=parseFloat(d.distance);var e=parseFloat(d.duration)/10;var b={top:f.getStyle("top"),left:f.getStyle("left")};return new Effect.Move(f,{x:g,y:0,duration:e,afterFinishInternal:function(h){new Effect.Move(h.element,{x:-g*2,y:0,duration:e*2,afterFinishInternal:function(l){new Effect.Move(l.element,{x:g*2,y:0,duration:e*2,afterFinishInternal:function(n){new Effect.Move(n.element,{x:-g*2,y:0,duration:e*2,afterFinishInternal:function(o){new Effect.Move(o.element,{x:g*2,y:0,duration:e*2,afterFinishInternal:function(p){new Effect.Move(p.element,{x:-g,y:0,duration:e,afterFinishInternal:function(q){q.element.undoPositioned().setStyle(b)}})}})}})}})}})}})};Effect.SlideDown=function(e){e=$(e).cleanWhitespace();var b=e.down().getStyle("bottom");var d=e.getDimensions();return new Effect.Scale(e,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:window.opera?0:1,scaleMode:{originalHeight:d.height,originalWidth:d.width},restoreAfterFinish:true,afterSetup:function(f){f.element.makePositioned();f.element.down().makePositioned();if(window.opera){f.element.setStyle({top:""})}f.element.makeClipping().setStyle({height:"0px"}).show()},afterUpdateInternal:function(f){f.element.down().setStyle({bottom:(f.dims[0]-f.element.clientHeight)+"px"})},afterFinishInternal:function(f){f.element.undoClipping().undoPositioned();f.element.down().undoPositioned().setStyle({bottom:b})}},arguments[1]||{}))};Effect.SlideUp=function(e){e=$(e).cleanWhitespace();var b=e.down().getStyle("bottom");var d=e.getDimensions();return new Effect.Scale(e,window.opera?0:1,Object.extend({scaleContent:false,scaleX:false,scaleMode:"box",scaleFrom:100,scaleMode:{originalHeight:d.height,originalWidth:d.width},restoreAfterFinish:true,afterSetup:function(f){f.element.makePositioned();f.element.down().makePositioned();if(window.opera){f.element.setStyle({top:""})}f.element.makeClipping().show()},afterUpdateInternal:function(f){f.element.down().setStyle({bottom:(f.dims[0]-f.element.clientHeight)+"px"})},afterFinishInternal:function(f){f.element.hide().undoClipping().undoPositioned();f.element.down().undoPositioned().setStyle({bottom:b})}},arguments[1]||{}))};Effect.Squish=function(b){return new Effect.Scale(b,window.opera?1:0,{restoreAfterFinish:true,beforeSetup:function(d){d.element.makeClipping()},afterFinishInternal:function(d){d.element.hide().undoClipping()}})};Effect.Grow=function(e){e=$(e);var d=Object.extend({direction:"center",moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.full},arguments[1]||{});var b={top:e.style.top,left:e.style.left,height:e.style.height,width:e.style.width,opacity:e.getInlineOpacity()};var l=e.getDimensions();var n,h;var g,f;switch(d.direction){case"top-left":n=h=g=f=0;break;case"top-right":n=l.width;h=f=0;g=-l.width;break;case"bottom-left":n=g=0;h=l.height;f=-l.height;break;case"bottom-right":n=l.width;h=l.height;g=-l.width;f=-l.height;break;case"center":n=l.width/2;h=l.height/2;g=-l.width/2;f=-l.height/2;break}return new Effect.Move(e,{x:n,y:h,duration:0.01,beforeSetup:function(o){o.element.hide().makeClipping().makePositioned()},afterFinishInternal:function(o){new Effect.Parallel([new Effect.Opacity(o.element,{sync:true,to:1,from:0,transition:d.opacityTransition}),new Effect.Move(o.element,{x:g,y:f,sync:true,transition:d.moveTransition}),new Effect.Scale(o.element,100,{scaleMode:{originalHeight:l.height,originalWidth:l.width},sync:true,scaleFrom:window.opera?1:0,transition:d.scaleTransition,restoreAfterFinish:true})],Object.extend({beforeSetup:function(p){p.effects[0].element.setStyle({height:"0px"}).show()},afterFinishInternal:function(p){p.effects[0].element.undoClipping().undoPositioned().setStyle(b)}},d))}})};Effect.Shrink=function(e){e=$(e);var d=Object.extend({direction:"center",moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.none},arguments[1]||{});var b={top:e.style.top,left:e.style.left,height:e.style.height,width:e.style.width,opacity:e.getInlineOpacity()};var h=e.getDimensions();var g,f;switch(d.direction){case"top-left":g=f=0;break;case"top-right":g=h.width;f=0;break;case"bottom-left":g=0;f=h.height;break;case"bottom-right":g=h.width;f=h.height;break;case"center":g=h.width/2;f=h.height/2;break}return new Effect.Parallel([new Effect.Opacity(e,{sync:true,to:0,from:1,transition:d.opacityTransition}),new Effect.Scale(e,window.opera?1:0,{sync:true,transition:d.scaleTransition,restoreAfterFinish:true}),new Effect.Move(e,{x:g,y:f,sync:true,transition:d.moveTransition})],Object.extend({beforeStartInternal:function(l){l.effects[0].element.makePositioned().makeClipping()},afterFinishInternal:function(l){l.effects[0].element.hide().undoClipping().undoPositioned().setStyle(b)}},d))};Effect.Pulsate=function(e){e=$(e);var d=arguments[1]||{},b=e.getInlineOpacity(),g=d.transition||Effect.Transitions.linear,f=function(h){return 1-g((-Math.cos((h*(d.pulses||5)*2)*Math.PI)/2)+0.5)};return new Effect.Opacity(e,Object.extend(Object.extend({duration:2,from:0,afterFinishInternal:function(h){h.element.setStyle({opacity:b})}},d),{transition:f}))};Effect.Fold=function(d){d=$(d);var b={top:d.style.top,left:d.style.left,width:d.style.width,height:d.style.height};d.makeClipping();return new Effect.Scale(d,5,Object.extend({scaleContent:false,scaleX:false,afterFinishInternal:function(e){new Effect.Scale(d,1,{scaleContent:false,scaleY:false,afterFinishInternal:function(f){f.element.hide().undoClipping().setStyle(b)}})}},arguments[1]||{}))};Effect.Morph=Class.create(Effect.Base,{initialize:function(e){this.element=$(e);if(!this.element){throw (Effect._elementDoesNotExistError)}var b=Object.extend({style:{}},arguments[1]||{});if(!Object.isString(b.style)){this.style=$H(b.style)}else{if(b.style.include(":")){this.style=b.style.parseStyle()}else{this.element.addClassName(b.style);this.style=$H(this.element.getStyles());this.element.removeClassName(b.style);var d=this.element.getStyles();this.style=this.style.reject(function(f){return f.value==d[f.key]});b.afterFinishInternal=function(f){f.element.addClassName(f.options.style);f.transforms.each(function(g){f.element.style[g.style]=""})}}}this.start(b)},setup:function(){function b(d){if(!d||["rgba(0, 0, 0, 0)","transparent"].include(d)){d="#ffffff"}d=d.parseColor();return $R(0,2).map(function(e){return parseInt(d.slice(e*2+1,e*2+3),16)})}this.transforms=this.style.map(function(l){var h=l[0],g=l[1],f=null;if(g.parseColor("#zzzzzz")!="#zzzzzz"){g=g.parseColor();f="color"}else{if(h=="opacity"){g=parseFloat(g);if(Prototype.Browser.IE&&(!this.element.currentStyle.hasLayout)){this.element.setStyle({zoom:1})}}else{if(Element.CSS_LENGTH.test(g)){var e=g.match(/^([\+\-]?[0-9\.]+)(.*)$/);g=parseFloat(e[1]);f=(e.length==3)?e[2]:null}}}var d=this.element.getStyle(h);return{style:h.camelize(),originalValue:f=="color"?b(d):parseFloat(d||0),targetValue:f=="color"?b(g):g,unit:f}}.bind(this)).reject(function(d){return((d.originalValue==d.targetValue)||(d.unit!="color"&&(isNaN(d.originalValue)||isNaN(d.targetValue))))})},update:function(b){var f={},d,e=this.transforms.length;while(e--){f[(d=this.transforms[e]).style]=d.unit=="color"?"#"+(Math.round(d.originalValue[0]+(d.targetValue[0]-d.originalValue[0])*b)).toColorPart()+(Math.round(d.originalValue[1]+(d.targetValue[1]-d.originalValue[1])*b)).toColorPart()+(Math.round(d.originalValue[2]+(d.targetValue[2]-d.originalValue[2])*b)).toColorPart():(d.originalValue+(d.targetValue-d.originalValue)*b).toFixed(3)+(d.unit===null?"":d.unit)}this.element.setStyle(f,true)}});Effect.Transform=Class.create({initialize:function(b){this.tracks=[];this.options=arguments[1]||{};this.addTracks(b)},addTracks:function(b){b.each(function(d){d=$H(d);var e=d.values().first();this.tracks.push($H({ids:d.keys().first(),effect:Effect.Morph,options:{style:e}}))}.bind(this));return this},play:function(){return new Effect.Parallel(this.tracks.map(function(b){var f=b.get("ids"),e=b.get("effect"),d=b.get("options");var g=[$(f)||$$(f)].flatten();return g.map(function(h){return new e(h,Object.extend({sync:true},d))})}).flatten(),this.options)}});Element.CSS_PROPERTIES=$w("backgroundColor backgroundPosition borderBottomColor borderBottomStyle borderBottomWidth borderLeftColor borderLeftStyle borderLeftWidth borderRightColor borderRightStyle borderRightWidth borderSpacing borderTopColor borderTopStyle borderTopWidth bottom clip color fontSize fontWeight height left letterSpacing lineHeight marginBottom marginLeft marginRight marginTop markerOffset maxHeight maxWidth minHeight minWidth opacity outlineColor outlineOffset outlineWidth paddingBottom paddingLeft paddingRight paddingTop right textIndent top width wordSpacing zIndex");Element.CSS_LENGTH=/^(([\+\-]?[0-9\.]+)(em|ex|px|in|cm|mm|pt|pc|\%))|0$/;String.__parseStyleElement=document.createElement("div");String.prototype.parseStyle=function(){var d,b=$H();if(Prototype.Browser.WebKit){d=new Element("div",{style:this}).style}else{String.__parseStyleElement.innerHTML='
';d=String.__parseStyleElement.childNodes[0].style}Element.CSS_PROPERTIES.each(function(e){if(d[e]){b.set(e,d[e])}});if(Prototype.Browser.IE&&this.include("opacity")){b.set("opacity",this.match(/opacity:\s*((?:0|1)?(?:\.\d*)?)/)[1])}return b};if(document.defaultView&&document.defaultView.getComputedStyle){Element.getStyles=function(d){var b=document.defaultView.getComputedStyle($(d),null);return Element.CSS_PROPERTIES.inject({},function(e,f){e[f]=b[f];return e})}}else{Element.getStyles=function(d){d=$(d);var b=d.currentStyle,e;e=Element.CSS_PROPERTIES.inject({},function(f,g){f[g]=b[g];return f});if(!e.opacity){e.opacity=d.getOpacity()}return e}}Effect.Methods={morph:function(b,d){b=$(b);new Effect.Morph(b,Object.extend({style:d},arguments[2]||{}));return b},visualEffect:function(e,g,d){e=$(e);var f=g.dasherize().camelize(),b=f.charAt(0).toUpperCase()+f.substring(1);new Effect[b](e,d);return e},highlight:function(d,b){d=$(d);new Effect.Highlight(d,b);return d}};$w("fade appear grow shrink fold blindUp blindDown slideUp slideDown pulsate shake puff squish switchOff dropOut").each(function(b){Effect.Methods[b]=function(e,d){e=$(e);Effect[b.charAt(0).toUpperCase()+b.substring(1)](e,d);return e}});$w("getInlineOpacity forceRerendering setContentZoom collectTextNodes collectTextNodesIgnoreClass getStyles").each(function(b){Effect.Methods[b]=Element[b]});Element.addMethods(Effect.Methods);function validateCreditCard(e){var d="0123456789";var b="";for(i=0;i9?Math.floor(a/10+a%10):a}for(i=0;i=d},maxLength:function(b,e,d){return b.length<=d},min:function(b,e,d){return b>=parseFloat(d)},max:function(b,e,d){return b<=parseFloat(d)},notOneOf:function(b,e,d){return $A(d).all(function(f){return b!=f})},oneOf:function(b,e,d){return $A(d).any(function(f){return b==f})},is:function(b,e,d){return b==d},isNot:function(b,e,d){return b!=d},equalToField:function(b,e,d){return b==$F(d)},notEqualToField:function(b,e,d){return b!=$F(d)},include:function(b,e,d){return $A(d).all(function(f){return Validation.get(f).test(b,e)})}};var Validation=Class.create();Validation.defaultOptions={onSubmit:true,stopOnFirst:false,immediate:false,focusOnError:true,useTitles:false,addClassNameToContainer:false,containerClassName:".input-box",onFormValidate:function(b,d){},onElementValidate:function(b,d){}};Validation.prototype={initialize:function(d,b){this.form=$(d);if(!this.form){return}this.options=Object.extend({onSubmit:Validation.defaultOptions.onSubmit,stopOnFirst:Validation.defaultOptions.stopOnFirst,immediate:Validation.defaultOptions.immediate,focusOnError:Validation.defaultOptions.focusOnError,useTitles:Validation.defaultOptions.useTitles,onFormValidate:Validation.defaultOptions.onFormValidate,onElementValidate:Validation.defaultOptions.onElementValidate},b||{});if(this.options.onSubmit){Event.observe(this.form,"submit",this.onSubmit.bind(this),false)}if(this.options.immediate){Form.getElements(this.form).each(function(e){if(e.tagName.toLowerCase()=="select"){Event.observe(e,"blur",this.onChange.bindAsEventListener(this))}if(e.type.toLowerCase()=="radio"||e.type.toLowerCase()=="checkbox"){Event.observe(e,"click",this.onChange.bindAsEventListener(this))}else{Event.observe(e,"change",this.onChange.bindAsEventListener(this))}},this)}},onChange:function(b){Validation.isOnChange=true;Validation.validate(Event.element(b),{useTitle:this.options.useTitles,onElementValidate:this.options.onElementValidate});Validation.isOnChange=false},onSubmit:function(b){if(!this.validate()){Event.stop(b)}},validate:function(){var b=false;var d=this.options.useTitles;var g=this.options.onElementValidate;try{if(this.options.stopOnFirst){b=Form.getElements(this.form).all(function(e){if(e.hasClassName("local-validation")&&!this.isElementInForm(e,this.form)){return true}return Validation.validate(e,{useTitle:d,onElementValidate:g})},this)}else{b=Form.getElements(this.form).collect(function(e){if(e.hasClassName("local-validation")&&!this.isElementInForm(e,this.form)){return true}if(e.hasClassName("validation-disabled")){return true}return Validation.validate(e,{useTitle:d,onElementValidate:g})},this).all()}}catch(f){}if(!b&&this.options.focusOnError){try{Form.getElements(this.form).findAll(function(e){return $(e).hasClassName("validation-failed")}).first().focus()}catch(f){}}this.options.onFormValidate(b,this.form);return b},reset:function(){Form.getElements(this.form).each(Validation.reset)},isElementInForm:function(e,d){var b=e.up("form");if(b==d){return true}return false}};Object.extend(Validation,{validate:function(e,b){b=Object.extend({useTitle:false,onElementValidate:function(f,g){}},b||{});e=$(e);var d=$w(e.className);return result=d.all(function(f){var g=Validation.test(f,e,b.useTitle);b.onElementValidate(g,e);return g})},insertAdvice:function(f,d){var b=$(f).up(".field-row");if(b){Element.insert(b,{after:d})}else{if(f.up("td.value")){f.up("td.value").insert({bottom:d})}else{if(f.advaiceContainer&&$(f.advaiceContainer)){$(f.advaiceContainer).update(d)}else{switch(f.type.toLowerCase()){case"checkbox":case"radio":var e=f.parentNode;if(e){Element.insert(e,{bottom:d})}else{Element.insert(f,{after:d})}break;default:Element.insert(f,{after:d})}}}}},showAdvice:function(e,d,b){if(!e.advices){e.advices=new Hash()}else{e.advices.each(function(f){if(!d||f.value.id!=d.id){this.hideAdvice(e,f.value)}}.bind(this))}e.advices.set(b,d);if(typeof Effect=="undefined"){d.style.display="block"}else{if(!d._adviceAbsolutize){new Effect.Appear(d,{duration:1})}else{Position.absolutize(d);d.show();d.setStyle({top:d._adviceTop,left:d._adviceLeft,width:d._adviceWidth,"z-index":1000});d.addClassName("advice-absolute")}}},hideAdvice:function(d,b){if(b!=null){new Effect.Fade(b,{duration:1,afterFinishInternal:function(){b.hide()}})}},updateCallback:function(elm,status){if(typeof elm.callbackFunction!="undefined"){eval(elm.callbackFunction+"('"+elm.id+"','"+status+"')")}},ajaxError:function(g,f){var e="validate-ajax";var d=Validation.getAdvice(e,g);if(d==null){d=this.createAdvice(e,g,false,f)}this.showAdvice(g,d,"validate-ajax");this.updateCallback(g,"failed");g.addClassName("validation-failed");g.addClassName("validate-ajax");if(Validation.defaultOptions.addClassNameToContainer&&Validation.defaultOptions.containerClassName!=""){var b=g.up(Validation.defaultOptions.containerClassName);if(b&&this.allowContainerClassName(g)){b.removeClassName("validation-passed");b.addClassName("validation-error")}}},allowContainerClassName:function(b){if(b.type=="radio"||b.type=="checkbox"){return b.hasClassName("change-container-classname")}return true},test:function(g,o,l){var d=Validation.get(g);var n="__advice"+g.camelize();try{if(Validation.isVisible(o)&&!d.test($F(o),o)){var f=Validation.getAdvice(g,o);if(f==null){f=this.createAdvice(g,o,l)}this.showAdvice(o,f,g);this.updateCallback(o,"failed");o[n]=1;if(!o.advaiceContainer){o.removeClassName("validation-passed");o.addClassName("validation-failed")}if(Validation.defaultOptions.addClassNameToContainer&&Validation.defaultOptions.containerClassName!=""){var b=o.up(Validation.defaultOptions.containerClassName);if(b&&this.allowContainerClassName(o)){b.removeClassName("validation-passed");b.addClassName("validation-error")}}return false}else{var f=Validation.getAdvice(g,o);this.hideAdvice(o,f);this.updateCallback(o,"passed");o[n]="";o.removeClassName("validation-failed");o.addClassName("validation-passed");if(Validation.defaultOptions.addClassNameToContainer&&Validation.defaultOptions.containerClassName!=""){var b=o.up(Validation.defaultOptions.containerClassName);if(b&&!b.down(".validation-failed")&&this.allowContainerClassName(o)){if(!Validation.get("IsEmpty").test(o.value)||!this.isVisible(o)){b.addClassName("validation-passed")}else{b.removeClassName("validation-passed")}b.removeClassName("validation-error")}}return true}}catch(h){throw (h)}},isVisible:function(b){while(b.tagName!="BODY"){if(!$(b).visible()){return false}b=b.parentNode}return true},getAdvice:function(b,d){return $("advice-"+b+"-"+Validation.getElmID(d))||$("advice-"+Validation.getElmID(d))},createAdvice:function(e,n,l,d){var b=Validation.get(e);var h=l?((n&&n.title)?n.title:b.error):b.error;if(d){h=d}if(jQuery.mage.__){h=jQuery.mage.__(h)}advice='";Validation.insertAdvice(n,advice);advice=Validation.getAdvice(e,n);if($(n).hasClassName("absolute-advice")){var g=$(n).getDimensions();var f=Position.cumulativeOffset(n);advice._adviceTop=(f[1]+g.height)+"px";advice._adviceLeft=(f[0])+"px";advice._adviceWidth=(g.width)+"px";advice._adviceAbsolutize=true}return advice},getElmID:function(b){return b.id?b.id:b.name},reset:function(d){d=$(d);var b=$w(d.className);b.each(function(g){var h="__advice"+g.camelize();if(d[h]){var f=Validation.getAdvice(g,d);if(f){f.hide()}d[h]=""}d.removeClassName("validation-failed");d.removeClassName("validation-passed");if(Validation.defaultOptions.addClassNameToContainer&&Validation.defaultOptions.containerClassName!=""){var e=d.up(Validation.defaultOptions.containerClassName);if(e){e.removeClassName("validation-passed");e.removeClassName("validation-error")}}})},add:function(f,e,g,d){var b={};b[f]=new Validator(f,e,g,d);Object.extend(Validation.methods,b)},addAllThese:function(b){var d={};$A(b).each(function(e){d[e[0]]=new Validator(e[0],e[1],e[2],(e.length>3?e[3]:{}))});Object.extend(Validation.methods,d)},get:function(b){return Validation.methods[b]?Validation.methods[b]:Validation.methods._LikeNoIDIEverSaw_},methods:{_LikeNoIDIEverSaw_:new Validator("_LikeNoIDIEverSaw_","",{})}});Validation.add("IsEmpty","",function(b){return(b==""||(b==null)||(b.length==0)||/^\s+$/.test(b))});Validation.addAllThese([["validate-no-html-tags","HTML tags are not allowed",function(b){return !/<(\/)?\w+/.test(b)}],["validate-select","Please select an option.",function(b){return((b!="none")&&(b!=null)&&(b.length!=0))}],["required-entry","This is a required field.",function(b){return !Validation.get("IsEmpty").test(b)}],["validate-number","Please enter a valid number in this field.",function(b){return Validation.get("IsEmpty").test(b)||(!isNaN(parseNumber(b))&&/^\s*-?\d*(\.\d*)?\s*$/.test(b))}],["validate-number-range","The value is not within the specified range.",function(e,g){if(Validation.get("IsEmpty").test(e)){return true}var f=parseNumber(e);if(isNaN(f)){return false}var d=/^number-range-(-?[\d.,]+)?-(-?[\d.,]+)?$/,b=true;$w(g.className).each(function(l){var h=d.exec(l);if(h){b=b&&(h[1]==null||h[1]==""||f>=parseNumber(h[1]))&&(h[2]==null||h[2]==""||f<=parseNumber(h[2]))}});return b}],["validate-digits","Please use numbers only in this field. Please avoid spaces or other characters such as dots or commas.",function(b){return Validation.get("IsEmpty").test(b)||!/[^\d]/.test(b)}],["validate-digits-range","The value is not within the specified range.",function(e,g){if(Validation.get("IsEmpty").test(e)){return true}var f=parseNumber(e);if(isNaN(f)){return false}var d=/^digits-range-(-?\d+)?-(-?\d+)?$/,b=true;$w(g.className).each(function(l){var h=d.exec(l);if(h){b=b&&(h[1]==null||h[1]==""||f>=parseNumber(h[1]))&&(h[2]==null||h[2]==""||f<=parseNumber(h[2]))}});return b}],["validate-range","The value is not within the specified range.",function(f,l){var g,h;if(Validation.get("IsEmpty").test(f)){return true}else{if(Validation.get("validate-digits").test(f)){g=h=parseNumber(f)}else{var e=/^(-?\d+)?-(-?\d+)?$/.exec(f);if(e){g=parseNumber(e[1]);h=parseNumber(e[2]);if(g>h){return false}}else{return false}}}var d=/^range-(-?\d+)?-(-?\d+)?$/,b=true;$w(l.className).each(function(n){var q=d.exec(n);if(q){var p=parseNumber(q[1]);var o=parseNumber(q[2]);b=b&&(isNaN(p)||g>=p)&&(isNaN(o)||h<=o)}});return b}],["validate-alpha","Please use letters only (a-z or A-Z) in this field.",function(b){return Validation.get("IsEmpty").test(b)||/^[a-zA-Z]+$/.test(b)}],["validate-code","Please use only letters (a-z), numbers (0-9) or underscore (_) in this field, and the first character should be a letter.",function(b){return Validation.get("IsEmpty").test(b)||/^[a-z]+[a-z0-9_]+$/.test(b)}],["validate-alphanum","Please use only letters (a-z or A-Z) or numbers (0-9) in this field. No spaces or other characters are allowed.",function(b){return Validation.get("IsEmpty").test(b)||/^[a-zA-Z0-9]+$/.test(b)}],["validate-alphanum-with-spaces","Please use only letters (a-z or A-Z), numbers (0-9) or spaces only in this field.",function(b){return Validation.get("IsEmpty").test(b)||/^[a-zA-Z0-9 ]+$/.test(b)}],["validate-street",'Please use only letters (a-z or A-Z), numbers (0-9), spaces and "#" in this field.',function(b){return Validation.get("IsEmpty").test(b)||/^[ \w]{3,}([A-Za-z]\.)?([ \w]*\#\d+)?(\r\n| )[ \w]{3,}/.test(b)}],["validate-phoneStrict","Please enter a valid phone number (Ex: 123-456-7890).",function(b){return Validation.get("IsEmpty").test(b)||/^(\()?\d{3}(\))?(-|\s)?\d{3}(-|\s)\d{4}$/.test(b)}],["validate-phoneLax","Please enter a valid phone number (Ex: 123-456-7890).",function(b){return Validation.get("IsEmpty").test(b)||/^((\d[-. ]?)?((\(\d{3}\))|\d{3}))?[-. ]?\d{3}[-. ]?\d{4}$/.test(b)}],["validate-fax","Please enter a valid fax number (Ex: 123-456-7890).",function(b){return Validation.get("IsEmpty").test(b)||/^(\()?\d{3}(\))?(-|\s)?\d{3}(-|\s)\d{4}$/.test(b)}],["validate-date","Please enter a valid date.",function(b){var d=new Date(b);return Validation.get("IsEmpty").test(b)||!isNaN(d)}],["validate-date-range","Make sure the To Date is later than or the same as the From Date.",function(e,h){var d=/\bdate-range-(\w+)-(\w+)\b/.exec(h.className);if(!d||d[2]=="to"||Validation.get("IsEmpty").test(e)){return true}var f=new Date().getFullYear()+"";var b=function(l){l=l.split(/[.\/]/);if(l[2]&&l[2].length<4){l[2]=f.substr(0,l[2].length)+l[2]}return new Date(l.join("/")).getTime()};var g=Element.select(h.form,".validate-date-range.date-range-"+d[1]+"-to");return !g.length||Validation.get("IsEmpty").test(g[0].value)||b(e)<=b(g[0].value)}],["validate-email","Please enter a valid email address (Ex: johndoe@domain.com).",function(b){return Validation.get("IsEmpty").test(b)||/^([a-z0-9,!\#\$%&'\*\+\/=\?\^_`\{\|\}~-]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z0-9,!\#\$%&'\*\+\/=\?\^_`\{\|\}~-]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*@([a-z0-9-]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z0-9-]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*\.(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]){2,})$/i.test(b)}],["validate-emailSender","Please use only visible characters and spaces.",function(b){return Validation.get("IsEmpty").test(b)||/^[\S ]+$/.test(b)}],["validate-password","Please enter 6 or more characters. Leading and trailing spaces will be ignored.",function(b){var d=b.strip();return !(d.length>0&&d.length<6)}],["validate-admin-password","Please enter 7 or more characters, using both numeric and alphabetic.",function(b){var d=b.strip();if(0==d.length){return true}if(!(/[a-z]/i.test(b))||!(/[0-9]/.test(b))){return false}return !(d.length<7)}],["validate-cpassword","Please make sure your passwords match.",function(b){var d=$("confirmation")?$("confirmation"):$$(".validate-cpassword")[0];var g=false;if($("password")){g=$("password")}var h=$$(".validate-password");for(var e=0;e=0}],["validate-zero-or-greater","Please enter a number 0 or greater in this field.",function(b){return Validation.get("validate-not-negative-number").test(b)}],["validate-greater-than-zero","Please enter a number greater than 0 in this field.",function(b){if(Validation.get("IsEmpty").test(b)){return true}b=parseNumber(b);return !isNaN(b)&&b>0}],["validate-state","Please select State/Province.",function(b){return(b!=0||b=="")}],["validate-new-password","Please enter 6 or more characters. Leading and trailing spaces will be ignored.",function(b){if(!Validation.get("validate-password").test(b)){return false}if(Validation.get("IsEmpty").test(b)&&b!=""){return false}return true}],["validate-cc-number","Please enter a valid credit card number.",function(b,e){var d=$(e.id.substr(0,e.id.indexOf("_cc_number"))+"_cc_type");if(d&&typeof Validation.creditCartTypes.get(d.value)!="undefined"&&Validation.creditCartTypes.get(d.value)[2]==false){if(!Validation.get("IsEmpty").test(b)&&Validation.get("validate-digits").test(b)){return true}else{return false}}return validateCreditCard(b)}],["validate-cc-type","Credit card number does not match credit card type.",function(d,g){g.value=removeDelimiters(g.value);d=removeDelimiters(d);var f=$(g.id.substr(0,g.id.indexOf("_cc_number"))+"_cc_type");if(!f){return true}var e=f.value;if(typeof Validation.creditCartTypes.get(e)=="undefined"){return false}if(Validation.creditCartTypes.get(e)[0]==false){return true}var b="";Validation.creditCartTypes.each(function(h){if(h.value[0]&&d.match(h.value[0])){b=h.key;throw $break}});if(b!=e){return false}if(f.hasClassName("validation-failed")&&Validation.isOnChange){Validation.validate(f)}return true}],["validate-cc-type-select","Card type does not match credit card number.",function(d,e){var b=$(e.id.substr(0,e.id.indexOf("_cc_type"))+"_cc_number");if(Validation.isOnChange&&Validation.get("IsEmpty").test(b.value)){return true}if(Validation.get("validate-cc-type").test(b.value,b)){Validation.validate(b)}return Validation.get("validate-cc-type").test(b.value,b)}],["validate-cc-exp","Incorrect credit card expiration date.",function(b,l){var h=b;var g=$(l.id.substr(0,l.id.indexOf("_expiration"))+"_expiration_yr").value;var f=new Date();var e=f.getMonth()+1;var d=f.getFullYear();if(h=n)}});return b}],["validate-percents","Please enter a number lower than 100.",{max:100}],["required-file","Please select a file.",function(d,e){var b=!Validation.get("IsEmpty").test(d);if(b===false){ovId=e.id+"_value";if($(ovId)){b=!Validation.get("IsEmpty").test($(ovId).value)}}return b}],["validate-cc-ukss","Please enter issue number or start date for switch/solo card type.",function(o,g){var b;if(g.id.match(/(.)+_cc_issue$/)){b=g.id.indexOf("_cc_issue")}else{if(g.id.match(/(.)+_start_month$/)){b=g.id.indexOf("_start_month")}else{b=g.id.indexOf("_start_year")}}var f=g.id.substr(0,b);var d=$(f+"_cc_type");if(!d){return true}var n=d.value;if(["SS","SM","SO"].indexOf(n)==-1){return true}$(f+"_cc_issue").advaiceContainer=$(f+"_start_month").advaiceContainer=$(f+"_start_year").advaiceContainer=$(f+"_cc_type_ss_div").down(".adv-container");var h=$(f+"_cc_issue").value;var l=$(f+"_start_month").value;var p=$(f+"_start_year").value;var e=(l&&p)?true:false;if(!e&&!h){return false}return true}]]);function removeDelimiters(b){b=b.replace(/\s/g,"");b=b.replace(/\-/g,"");return b}function parseNumber(b){if(typeof b!="string"){return parseFloat(b)}var e=b.indexOf(".");var d=b.indexOf(",");if(e!=-1&&d!=-1){if(d>e){b=b.replace(".","").replace(",",".")}else{b=b.replace(",","")}}else{if(d!=-1){b=b.replace(",",".")}}return parseFloat(b)}Validation.creditCartTypes=$H({SO:[new RegExp("^(6334[5-9]([0-9]{11}|[0-9]{13,14}))|(6767([0-9]{12}|[0-9]{14,15}))$"),new RegExp("^([0-9]{3}|[0-9]{4})?$"),true],SM:[new RegExp("(^(5[0678])[0-9]{11,18}$)|(^(6[^05])[0-9]{11,18}$)|(^(601)[^1][0-9]{9,16}$)|(^(6011)[0-9]{9,11}$)|(^(6011)[0-9]{13,16}$)|(^(65)[0-9]{11,13}$)|(^(65)[0-9]{15,18}$)|(^(49030)[2-9]([0-9]{10}$|[0-9]{12,13}$))|(^(49033)[5-9]([0-9]{10}$|[0-9]{12,13}$))|(^(49110)[1-2]([0-9]{10}$|[0-9]{12,13}$))|(^(49117)[4-9]([0-9]{10}$|[0-9]{12,13}$))|(^(49118)[0-2]([0-9]{10}$|[0-9]{12,13}$))|(^(4936)([0-9]{12}$|[0-9]{14,15}$))"),new RegExp("^([0-9]{3}|[0-9]{4})?$"),true],VI:[new RegExp("^4[0-9]{12}([0-9]{3})?$"),new RegExp("^[0-9]{3}$"),true],MC:[new RegExp("^5[1-5][0-9]{14}$"),new RegExp("^[0-9]{3}$"),true],AE:[new RegExp("^3[47][0-9]{13}$"),new RegExp("^[0-9]{4}$"),true],DI:[new RegExp("^6(011|4[4-9][0-9]|5[0-9]{2})[0-9]{12}$"),new RegExp("^[0-9]{3}$"),true],JCB:[new RegExp("^(3[0-9]{15}|(2131|1800)[0-9]{11})$"),new RegExp("^[0-9]{3,4}$"),true],OT:[false,new RegExp("^([0-9]{3}|[0-9]{4})?$"),false]});function popWin(d,e,b){var e=window.open(d,e,b);e.focus()}function setLocation(b){window.location.href=b}function setPLocation(d,b){if(b){window.opener.focus()}window.opener.location.href=d}function setLanguageCode(e,f){var b=window.location.href;var h="",g;if(g=b.match(/\#(.*)$/)){b=b.replace(/\#(.*)$/,"");h=g[0]}if(b.match(/[?]/)){var d=/([?&]store=)[a-z0-9_]*/;if(b.match(d)){b=b.replace(d,"$1"+e)}else{b+="&store="+e}var d=/([?&]from_store=)[a-z0-9_]*/;if(b.match(d)){b=b.replace(d,"")}}else{b+="?store="+e}if(typeof(f)!="undefined"){b+="&from_store="+f}b+=h;setLocation(b)}function decorateGeneric(h,e){var l=["odd","even","first","last"];var d={};var g=h.length;if(g){if(typeof(e)=="undefined"){e=l}if(!e.length){return}for(var b in l){d[l[b]]=false}for(var b in e){d[e[b]]=true}if(d.first){Element.addClassName(h[0],"first")}if(d.last){Element.addClassName(h[g-1],"last")}for(var f=0;f-1){b="?"+f.substring(d+2);f=f.substring(0,d+1)}return f+e+b}function formatCurrency(n,q,g){var l=isNaN(q.precision=Math.abs(q.precision))?2:q.precision;var v=isNaN(q.requiredPrecision=Math.abs(q.requiredPrecision))?2:q.requiredPrecision;l=v;var t=isNaN(q.integerRequired=Math.abs(q.integerRequired))?1:q.integerRequired;var p=q.decimalSymbol==undefined?",":q.decimalSymbol;var e=q.groupSymbol==undefined?".":q.groupSymbol;var d=q.groupLength==undefined?3:q.groupLength;var u="";if(g==undefined||g==true){u=n<0?"-":(g?"+":"")}else{if(g==false){u=""}}var h=parseInt(n=Math.abs(+n||0).toFixed(l))+"";var f=(h.lengthd?j%d:0;re=new RegExp("(\\d{"+d+"})(?=\\d)","g");var b=(j?h.substr(0,j)+e:"")+h.substr(j).replace(re,"$1"+e)+(l?p+Math.abs(n-h).toFixed(l).replace(/-/,0).slice(2):"");var o="";if(q.pattern.indexOf("{sign}")==-1){o=u+q.pattern}else{o=q.pattern.replace("{sign}",u)}return o.replace("%s",b).replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function expandDetails(d,b){if(Element.hasClassName(d,"show-details")){$$(b).each(function(e){e.hide()});Element.removeClassName(d,"show-details")}else{$$(b).each(function(e){e.show()});Element.addClassName(d,"show-details")}}var isIE=navigator.appVersion.match(/MSIE/)=="MSIE";if(!window.Varien){var Varien=new Object()}Varien.showLoading=function(){var b=$("loading-process");b&&b.show()};Varien.hideLoading=function(){var b=$("loading-process");b&&b.hide()};Varien.GlobalHandlers={onCreate:function(){Varien.showLoading()},onComplete:function(){if(Ajax.activeRequestCount==0){Varien.hideLoading()}}};Ajax.Responders.register(Varien.GlobalHandlers);Varien.searchForm=Class.create();Varien.searchForm.prototype={initialize:function(d,e,b){this.form=$(d);this.field=$(e);this.emptyText=b;Event.observe(this.form,"submit",this.submit.bind(this));Event.observe(this.field,"focus",this.focus.bind(this));Event.observe(this.field,"blur",this.blur.bind(this));this.blur()},submit:function(b){if(this.field.value==this.emptyText||this.field.value==""){Event.stop(b);return false}return true},focus:function(b){if(this.field.value==this.emptyText){this.field.value=""}},blur:function(b){if(this.field.value==""){this.field.value=this.emptyText}}};Varien.DateElement=Class.create();Varien.DateElement.prototype={initialize:function(b,d,f,e){if(b=="id"){this.day=$(d+"day");this.month=$(d+"month");this.year=$(d+"year");this.full=$(d+"full");this.advice=$(d+"date-advice")}else{if(b=="container"){this.day=d.day;this.month=d.month;this.year=d.year;this.full=d.full;this.advice=d.advice}else{return}}this.required=f;this.format=e;this.day.addClassName("validate-custom");this.day.validate=this.validate.bind(this);this.month.addClassName("validate-custom");this.month.validate=this.validate.bind(this);this.year.addClassName("validate-custom");this.year.validate=this.validate.bind(this);this.setDateRange(false,false);this.year.setAttribute("autocomplete","off");this.advice.hide()},validate:function(){var l=false,o=parseInt(this.day.value,10)||0,f=parseInt(this.month.value,10)||0,h=parseInt(this.year.value,10)||0;if(this.day.value.strip().empty()&&this.month.value.strip().empty()&&this.year.value.strip().empty()){if(this.required){l="Please enter a date."}else{this.full.value=""}}else{if(!o||!f||!h){l="Please enter a valid full date."}else{var d=new Date,n=0,e=null;d.setYear(h);d.setMonth(f-1);d.setDate(32);n=32-d.getDate();if(!n||n>31){n=31}if(o<1||o>n){e="day";l="Please enter a valid day (1-%1)."}else{if(f<1||f>12){e="month";l="Please enter a valid month (1-12)."}else{if(o%10==o){this.day.value="0"+o}if(f%10==f){this.month.value="0"+f}this.full.value=this.format.replace(/%[mb]/i,this.month.value).replace(/%[de]/i,this.day.value).replace(/%y/i,this.year.value);var b=this.month.value+"/"+this.day.value+"/"+this.year.value;var g=new Date(b);if(isNaN(g)){l="Please enter a valid date."}else{this.setFullDate(g)}}}var p=false;if(!l&&!this.validateData()){e=this.validateDataErrorType;p=this.validateDataErrorText;l=p}}}if(l!==false){if(jQuery.mage.__){l=jQuery.mage.__(l)}if(!p){this.advice.innerHTML=l.replace("%1",n)}else{this.advice.innerHTML=this.errorTextModifier(l)}this.advice.show();return false}this.day.removeClassName("validation-failed");this.month.removeClassName("validation-failed");this.year.removeClassName("validation-failed");this.advice.hide();return true},validateData:function(){var d=this.fullDate.getFullYear();var b=new Date;this.curyear=b.getFullYear();return(d>=1900&&d<=this.curyear)},validateDataErrorType:"year",validateDataErrorText:"Please enter a valid year (1900-%1).",errorTextModifier:function(b){return b.replace("%1",this.curyear)},setDateRange:function(b,d){this.minDate=b;this.maxDate=d},setFullDate:function(b){this.fullDate=b}};Varien.DOB=Class.create();Varien.DOB.prototype={initialize:function(b,g,f){var e=$$(b)[0];var d={};d.day=Element.select(e,".dob-day input")[0];d.month=Element.select(e,".dob-month input")[0];d.year=Element.select(e,".dob-year input")[0];d.full=Element.select(e,".dob-full input")[0];d.advice=Element.select(e,".validation-advice")[0];new Varien.DateElement("container",d,g,f)}};Varien.dateRangeDate=Class.create();Varien.dateRangeDate.prototype=Object.extend(new Varien.DateElement(),{validateData:function(){var b=true;if(this.minDate||this.maxValue){if(this.minDate){this.minDate=new Date(this.minDate);this.minDate.setHours(0);if(isNaN(this.minDate)){this.minDate=new Date("1/1/1900")}b=b&&(this.fullDate>=this.minDate)}if(this.maxDate){this.maxDate=new Date(this.maxDate);this.minDate.setHours(0);if(isNaN(this.maxDate)){this.maxDate=new Date()}b=b&&(this.fullDate<=this.maxDate)}if(this.maxDate&&this.minDate){this.validateDataErrorText="Please enter a valid date between %s and %s"}else{if(this.maxDate){this.validateDataErrorText="Please enter a valid date less than or equal to %s"}else{if(this.minDate){this.validateDataErrorText="Please enter a valid date equal to or greater than %s"}else{this.validateDataErrorText=""}}}}return b},validateDataErrorText:"Date should be between %s and %s",errorTextModifier:function(b){if(this.minDate){b=b.sub("%s",this.dateFormat(this.minDate))}if(this.maxDate){b=b.sub("%s",this.dateFormat(this.maxDate))}return b},dateFormat:function(b){return(b.getMonth()+1)+"/"+b.getDate()+"/"+b.getFullYear()}});Varien.FileElement=Class.create();Varien.FileElement.prototype={initialize:function(b){this.fileElement=$(b);this.hiddenElement=$(b+"_value");this.fileElement.observe("change",this.selectFile.bind(this))},selectFile:function(b){this.hiddenElement.value=this.fileElement.getValue()}};Validation.addAllThese([["validate-custom"," ",function(b,d){return d.validate()}]]);Element.addMethods({getInnerText:function(b){b=$(b);if(b.innerText&&!Prototype.Browser.Opera){return b.innerText}return b.innerHTML.stripScripts().unescapeHTML().replace(/[\n\r\s]+/g," ").strip()}});function fireEvent(d,e){if(document.createEvent){var b=document.createEvent("HTMLEvents");b.initEvent(e,true,true);return d.dispatchEvent(b)}else{var b=document.createEventObject();return d.fireEvent("on"+e,b)}}function modulo(b,f){var e=f/10000;var d=b%f;if(Math.abs(d-f)b.toFixed(2).toString().length){b=b.toFixed(2)}return b+" "+d[e]};var SessionError=Class.create();SessionError.prototype={initialize:function(b){this.errorText=b},toString:function(){return"Session Error:"+this.errorText}};Ajax.Request.addMethods({initialize:function($super,d,b){$super(b);this.transport=Ajax.getTransport();if(!d.match(new RegExp("[?&]isAjax=true",""))){d=d.match(new RegExp("\\?","g"))?d+"&isAjax=true":d+"?isAjax=true"}if(Object.isString(this.options.parameters)&&this.options.parameters.indexOf("form_key=")==-1){this.options.parameters+="&"+Object.toQueryString({form_key:FORM_KEY})}else{if(!this.options.parameters){this.options.parameters={form_key:FORM_KEY}}if(!this.options.parameters.form_key){this.options.parameters.form_key=FORM_KEY}}this.request(d)},respondToReadyState:function(b){var g=Ajax.Request.Events[b],d=new Ajax.Response(this);if(g=="Complete"){try{this._complete=true;if(d.responseText.isJSON()){var f=d.responseText.evalJSON();if(f.ajaxExpired&&f.ajaxRedirect){window.location.replace(f.ajaxRedirect);throw new SessionError("session expired")}}(this.options["on"+d.status]||this.options["on"+(this.success()?"Success":"Failure")]||Prototype.emptyFunction)(d,d.headerJSON)}catch(h){this.dispatchException(h);if(h instanceof SessionError){return}}var l=d.getHeader("Content-type");if(this.options.evalJS=="force"||(this.options.evalJS&&this.isSameOrigin()&&l&&l.match(/^\s*(text|application)\/(x-)?(java|ecma)script(;.*)?\s*$/i))){this.evalResponse()}}try{(this.options["on"+g]||Prototype.emptyFunction)(d,d.headerJSON);Ajax.Responders.dispatch("on"+g,this,d,d.headerJSON)}catch(h){this.dispatchException(h)}if(g=="Complete"){this.transport.onreadystatechange=Prototype.emptyFunction}}});Ajax.Updater.respondToReadyState=Ajax.Request.respondToReadyState;var varienLoader=new Class.create();varienLoader.prototype={initialize:function(b){this.callback=false;this.cache=$H();this.caching=b||false;this.url=false},getCache:function(b){if(this.cache.get(b)){return this.cache.get(b)}return false},load:function(b,d,f){this.url=b;this.callback=f;if(this.caching){var e=this.getCache(b);if(e){this.processResult(e);return}}if(typeof(d.updaterId)!="undefined"){new varienUpdater(d.updaterId,b,{evalScripts:true,onComplete:this.processResult.bind(this),onFailure:this._processFailure.bind(this)})}else{new Ajax.Request(b,{method:"post",parameters:d||{},onComplete:this.processResult.bind(this),onFailure:this._processFailure.bind(this)})}},_processFailure:function(b){location.href=BASE_URL},processResult:function(b){if(this.caching){this.cache.set(this.url,b)}if(this.callback){this.callback(b.responseText)}}};if(!window.varienLoaderHandler){var varienLoaderHandler=new Object()}varienLoaderHandler.handler={onCreate:function(b){if(b.options.loaderArea===false){return}jQuery("body").trigger("processStart")},onException:function(b){jQuery("body").trigger("processStop")},onComplete:function(b){jQuery("body").trigger("processStop")}};function setLoaderPosition(){var e=$("loading_mask_loader");if(e&&Prototype.Browser.IE){var d=e.getDimensions();var f=document.viewport.getDimensions();var b=document.viewport.getScrollOffsets();e.style.left=Math.floor(f.width/2+b.left-d.width/2)+"px";e.style.top=Math.floor(f.height/2+b.top-d.height/2)+"px";e.style.position="absolute"}}function toggleSelectsUnderBlock(f,b){if(Prototype.Browser.IE){var e=document.getElementsByTagName("select");for(var d=0;d');d.document.close();Event.observe(d,"load",function(){var e=d.document.getElementById("image_preview");d.resizeTo(e.width+40,e.height+80)})}}function checkByProductPriceType(b){if(b.id=="price_type"){this.productPriceType=b.value;return false}else{if(b.id=="price"&&this.productPriceType==0){return false}return true}}Event.observe(window,"load",function(){if($("price_default")&&$("price_default").checked){$("price").disabled="disabled"}});function toggleSeveralValueElements(f,e,b,d){if(e&&f){if(Object.prototype.toString.call(e)!="[object Array]"){e=[e]}e.each(function(g){toggleValueElements(f,g,b,d)})}}function toggleValueElements(l,d,f,h){if(d&&l){var n=[l];if(typeof f!="undefined"){if(Object.prototype.toString.call(f)!="[object Array]"){f=[f]}for(var g=0;g>2;l=((p&3)<<4)|(n>>4);g=((n&15)<<2)|(h>>6);f=h&63;if(isNaN(n)){g=f=64}else{if(isNaN(h)){f=64}}b=b+this._keyStr.charAt(o)+this._keyStr.charAt(l)+this._keyStr.charAt(g)+this._keyStr.charAt(f)}return b},decode:function(e){var b="";var p,n,h;var o,l,g,f;var d=0;if(typeof window.atob==="function"){return Base64._utf8_decode(window.atob(e))}e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");while(d>4);n=((l&15)<<4)|(g>>2);h=((g&3)<<6)|f;b=b+String.fromCharCode(p);if(g!=64){b=b+String.fromCharCode(n)}if(f!=64){b=b+String.fromCharCode(h)}}return Base64._utf8_decode(b)},mageEncode:function(b){return this.encode(b).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,",")},mageDecode:function(b){b=b.replace(/\-/g,"+").replace(/_/g,"/").replace(/,/g,"=");return this.decode(b)},idEncode:function(b){return this.encode(b).replace(/\+/g,":").replace(/\//g,"_").replace(/=/g,"-")},idDecode:function(b){b=b.replace(/\-/g,"=").replace(/_/g,"/").replace(/\:/g,"+");return this.decode(b)},_utf8_encode:function(d){d=d.replace(/\r\n/g,"\n");var b="";for(var f=0;f127)&&(e<2048)){b+=String.fromCharCode((e>>6)|192);b+=String.fromCharCode((e&63)|128)}else{b+=String.fromCharCode((e>>12)|224);b+=String.fromCharCode(((e>>6)&63)|128);b+=String.fromCharCode((e&63)|128)}}}return b},_utf8_decode:function(b){var d="";var e=0;var f=c1=c2=0;while(e191)&&(f<224)){c2=b.charCodeAt(e+1);d+=String.fromCharCode(((f&31)<<6)|(c2&63));e+=2}else{c2=b.charCodeAt(e+1);c3=b.charCodeAt(e+2);d+=String.fromCharCode(((f&15)<<12)|((c2&63)<<6)|(c3&63));e+=3}}}return d}};function sortNumeric(d,b){return d-b}(function(){var globals=["Prototype","Abstract","Try","Class","PeriodicalExecuter","Template","$break","Enumerable","$A","$w","$H","Hash","$R","ObjectRange","Ajax","$","Form","Field","$F","Toggle","Insertion","$continue","Position","Windows","Dialog","array","WindowUtilities","Builder","Effect","validateCreditCard","Validator","Validation","removeDelimiters","parseNumber","popWin","setLocation","setPLocation","setLanguageCode","decorateGeneric","decorateTable","decorateList","decorateDataList","parseSidUrl","formatCurrency","expandDetails","isIE","Varien","fireEvent","modulo","byteConvert","SessionError","varienLoader","varienLoaderHandler","setLoaderPosition","toggleSelectsUnderBlock","varienUpdater","setElementDisable","toggleParentVis","toggleFieldsetVis","toggleVis","imagePreview","checkByProductPriceType","toggleSeveralValueElements","toggleValueElements","submitAndReloadArea","syncOnchangeValue","updateElementAtCursor","firebugEnabled","disableElement","enableElement","disableElements","enableElements","Cookie","Fieldset","Base64","sortNumeric","Element","$$","Sizzle","Selector","Window"];globals.forEach(function(prop){window[prop]=eval(prop)})})(); \ No newline at end of file diff --git a/lib/web/mage/adminhtml/tools.js b/lib/web/mage/adminhtml/tools.js index 4c0ad162bcdbf..6dcf9206bdf09 100644 --- a/lib/web/mage/adminhtml/tools.js +++ b/lib/web/mage/adminhtml/tools.js @@ -332,12 +332,12 @@ var Base64 = { var chr1, chr2, chr3, enc1, enc2, enc3, enc4; var i = 0; + input = Base64._utf8_encode(input); + if( typeof window.btoa === "function" ){ return window.btoa(input); } - input = Base64._utf8_encode(input); - while (i < input.length) { chr1 = input.charCodeAt(i++); @@ -370,7 +370,7 @@ var Base64 = { var i = 0; if( typeof window.atob === "function" ){ - return window.atob(input); + return Base64._utf8_decode(window.atob(input)); } input = input.replace(/[^A-Za-z0-9\+\/\=]/g, ""); @@ -395,8 +395,8 @@ var Base64 = { output = output + String.fromCharCode(chr3); } } - output = Base64._utf8_decode(output); - return output; + + return Base64._utf8_decode(output); }, mageEncode: function(input){ From fed26d27ff51afb3c140d1317ce244e89eca4ba5 Mon Sep 17 00:00:00 2001 From: Yuri Kovsher Date: Wed, 18 May 2016 15:00:49 +0300 Subject: [PATCH 16/67] MAGETWO-52844: Unstable Functional Acceptance Tests --- .../InjectableTests/acceptance_unstable.xml | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/acceptance_unstable.xml diff --git a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/acceptance_unstable.xml b/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/acceptance_unstable.xml new file mode 100644 index 0000000000000..ac37fc159b40d --- /dev/null +++ b/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/acceptance_unstable.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + From 88fbc6a71ee891b7ae5da35390da73743f160381 Mon Sep 17 00:00:00 2001 From: Viktor Paladiychuk Date: Wed, 18 May 2016 18:34:37 +0300 Subject: [PATCH 17/67] MAGETWO-49175: Wrong behavior of "Client side less compilation" type --- .../Adminhtml/System/Config/WorkflowType.php | 27 +++++++ .../Model/Config/Backend/WorkflowType.php | 78 +++++++++++++++++++ .../Model/Config/Backend/WorkflowTypeTest.php | 59 ++++++++++++++ .../Developer/etc/adminhtml/system.xml | 2 + .../App/Test/Unit/Config/ValueTest.php | 34 ++++++-- 5 files changed, 192 insertions(+), 8 deletions(-) create mode 100644 app/code/Magento/Developer/Block/Adminhtml/System/Config/WorkflowType.php create mode 100644 app/code/Magento/Developer/Model/Config/Backend/WorkflowType.php create mode 100644 app/code/Magento/Developer/Test/Unit/Model/Config/Backend/WorkflowTypeTest.php diff --git a/app/code/Magento/Developer/Block/Adminhtml/System/Config/WorkflowType.php b/app/code/Magento/Developer/Block/Adminhtml/System/Config/WorkflowType.php new file mode 100644 index 0000000000000..57819598d05ef --- /dev/null +++ b/app/code/Magento/Developer/Block/Adminhtml/System/Config/WorkflowType.php @@ -0,0 +1,27 @@ +_appState->getMode() == \Magento\Framework\App\State::MODE_PRODUCTION) { + $element->setReadonly(true, true); + $element->setCanUseWebsiteValue(false); + $element->setCanUseDefaultValue(false); + $element->setCanRestoreToDefault(false); + } + return parent::render($element); + } +} \ No newline at end of file diff --git a/app/code/Magento/Developer/Model/Config/Backend/WorkflowType.php b/app/code/Magento/Developer/Model/Config/Backend/WorkflowType.php new file mode 100644 index 0000000000000..48295a444caf2 --- /dev/null +++ b/app/code/Magento/Developer/Model/Config/Backend/WorkflowType.php @@ -0,0 +1,78 @@ +cleaner = $cleaner; + } + + /** + * {@inheritdoc} + */ + public function beforeSave() + { + if ($this->isValueChanged() + && $this->_appState->getMode() == \Magento\Framework\App\State::MODE_PRODUCTION + && $this->getValue() == \Magento\Developer\Model\Config\Source\WorkflowType::CLIENT_SIDE_COMPILATION) { + + throw new \Magento\Framework\Exception\LocalizedException( + __('Client side compilation doesn\'t work in production mode') + ); + } + return parent::beforeSave(); + } + + /** + * {@inheritdoc} + */ + public function afterSave() + { + parent::afterSave(); + + if ($this->isValueChanged()) { + $this->cleaner->clearMaterializedViewFiles(); + } + return $this; + } +} diff --git a/app/code/Magento/Developer/Test/Unit/Model/Config/Backend/WorkflowTypeTest.php b/app/code/Magento/Developer/Test/Unit/Model/Config/Backend/WorkflowTypeTest.php new file mode 100644 index 0000000000000..e5ba5b5c04024 --- /dev/null +++ b/app/code/Magento/Developer/Test/Unit/Model/Config/Backend/WorkflowTypeTest.php @@ -0,0 +1,59 @@ +appStateMock = $this->getMock(State::class, [], [], '', false); + + $arguments = parent::getArguments(); + $contextArgs = $this->objectManagerHelper->getConstructArguments( + Context::class, ['appState' => $this->appStateMock] + ); + $arguments['context'] = $this->objectManagerHelper->getObject(Context::class, $contextArgs);; + return $arguments; + } + + /** + * @expectedException \Magento\Framework\Exception\LocalizedException + * @expectedExceptionMessage Client side compilation doesn't work in production mode + */ + public function testBeforeSaveSwitchedToClientSideInProductionShouldThrowException() + { + $this->appStateMock->expects($this->once()) + ->method('getMode') + ->willReturn(State::MODE_PRODUCTION); + + $this->model->setValue(\Magento\Developer\Model\Config\Source\WorkflowType::CLIENT_SIDE_COMPILATION); + $this->model->beforeSave(); + } + + /** + * @param int $callNumber + * @param string $oldValue + * @dataProvider afterSaveDataProvider + */ + public function testAfterSave($callNumber, $oldValue) + { + $this->model->setValue(\Magento\Developer\Model\Config\Source\WorkflowType::CLIENT_SIDE_COMPILATION); + parent::testAfterSave($callNumber, $oldValue); + } +} \ No newline at end of file diff --git a/app/code/Magento/Developer/etc/adminhtml/system.xml b/app/code/Magento/Developer/etc/adminhtml/system.xml index 551704598ee70..5ebc680558bf5 100644 --- a/app/code/Magento/Developer/etc/adminhtml/system.xml +++ b/app/code/Magento/Developer/etc/adminhtml/system.xml @@ -13,6 +13,8 @@ Not available in production mode Magento\Developer\Model\Config\Source\WorkflowType + Magento\Developer\Block\Adminhtml\System\Config\WorkflowType + Magento\Developer\Model\Config\Backend\WorkflowType diff --git a/lib/internal/Magento/Framework/App/Test/Unit/Config/ValueTest.php b/lib/internal/Magento/Framework/App/Test/Unit/Config/ValueTest.php index 375a30a9756e8..cab9beff35801 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/Config/ValueTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/Config/ValueTest.php @@ -7,6 +7,11 @@ class ValueTest extends \PHPUnit_Framework_TestCase { + /** + * @var string + */ + protected $class = 'Magento\Framework\App\Config\Value'; + /** * @var \Magento\Framework\App\Config\Value */ @@ -27,6 +32,11 @@ class ValueTest extends \PHPUnit_Framework_TestCase */ protected $cacheTypeListMock; + /** + * @var \Magento\Framework\TestFramework\Unit\Helper\ObjectManager + */ + protected $objectManagerHelper; + /** * @return void */ @@ -38,14 +48,10 @@ protected function setUp() ->disableOriginalConstructor() ->getMock(); - $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); - $this->model = $objectManager->getObject( - 'Magento\Framework\App\Config\Value', - [ - 'config' => $this->configMock, - 'eventDispatcher' => $this->eventManagerMock, - 'cacheTypeList' => $this->cacheTypeListMock, - ] + $this->objectManagerHelper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); + $this->model = $this->objectManagerHelper->getObject( + $this->class, + $this->getArguments() ); } @@ -200,4 +206,16 @@ public function testAfterDelete() $this->cacheTypeListMock->expects($this->once())->method('invalidate'); $this->assertInstanceOf(get_class($this->model), $this->model->afterDelete()); } + + /** + * @return array + */ + protected function getArguments() + { + return [ + 'config' => $this->configMock, + 'eventDispatcher' => $this->eventManagerMock, + 'cacheTypeList' => $this->cacheTypeListMock, + ]; + } } From 07e235e69f60cc593f5aae54d59432e41c0889c2 Mon Sep 17 00:00:00 2001 From: Viktor Paladiychuk Date: Thu, 19 May 2016 14:15:01 +0300 Subject: [PATCH 18/67] MAGETWO-49175: Wrong behavior of "Client side less compilation" type --- .../Adminhtml/System/Config/WorkflowType.php | 10 +++- .../Model/Config/Backend/WorkflowTypeTest.php | 56 +++++++++++++------ .../App/Test/Unit/Config/ValueTest.php | 34 +++-------- 3 files changed, 53 insertions(+), 47 deletions(-) diff --git a/app/code/Magento/Developer/Block/Adminhtml/System/Config/WorkflowType.php b/app/code/Magento/Developer/Block/Adminhtml/System/Config/WorkflowType.php index 57819598d05ef..abc7cc74d36fd 100644 --- a/app/code/Magento/Developer/Block/Adminhtml/System/Config/WorkflowType.php +++ b/app/code/Magento/Developer/Block/Adminhtml/System/Config/WorkflowType.php @@ -18,9 +18,13 @@ public function render(\Magento\Framework\Data\Form\Element\AbstractElement $ele { if ($this->_appState->getMode() == \Magento\Framework\App\State::MODE_PRODUCTION) { $element->setReadonly(true, true); - $element->setCanUseWebsiteValue(false); - $element->setCanUseDefaultValue(false); - $element->setCanRestoreToDefault(false); + $element->addData( + [ + 'can_use_website_value' => false, + 'can_use_default_value' => false, + 'can_restore_to_default' => false + ] + ); } return parent::render($element); } diff --git a/app/code/Magento/Developer/Test/Unit/Model/Config/Backend/WorkflowTypeTest.php b/app/code/Magento/Developer/Test/Unit/Model/Config/Backend/WorkflowTypeTest.php index e5ba5b5c04024..053053b1f384c 100644 --- a/app/code/Magento/Developer/Test/Unit/Model/Config/Backend/WorkflowTypeTest.php +++ b/app/code/Magento/Developer/Test/Unit/Model/Config/Backend/WorkflowTypeTest.php @@ -7,29 +7,53 @@ use Magento\Framework\App\State; use Magento\Framework\Model\Context; +use Magento\Developer\Model\Config\Backend\WorkflowType; +use Magento\Framework\App\State\CleanupFiles; +use Magento\Developer\Model\Config\Source\WorkflowType as SourceWorkflowType; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; -class WorkflowTypeTest extends \Magento\Framework\App\Test\Unit\Config\ValueTest +class WorkflowTypeTest extends \PHPUnit_Framework_TestCase { /** - * @var string + * @var WorkflowType */ - protected $class = 'Magento\Developer\Model\Config\Backend\WorkflowType'; + private $model; /** * @var State|\PHPUnit_Framework_MockObject_MockObject */ private $appStateMock; - protected function getArguments() + /** + * @var CleanupFiles|\PHPUnit_Framework_MockObject_MockObject + */ + private $cleanerMock; + + /** + * @var ObjectManager + */ + protected $objectManagerHelper; + + public function setUp() { $this->appStateMock = $this->getMock(State::class, [], [], '', false); - - $arguments = parent::getArguments(); + $this->objectManagerHelper = new ObjectManager($this); $contextArgs = $this->objectManagerHelper->getConstructArguments( - Context::class, ['appState' => $this->appStateMock] + Context::class, + ['appState' => $this->appStateMock] ); - $arguments['context'] = $this->objectManagerHelper->getObject(Context::class, $contextArgs);; - return $arguments; + + $this->cleanerMock = $this->getMock(CleanupFiles::class, [], [], '', false); + + $this->model = $this->objectManagerHelper->getObject( + WorkflowType::class, + [ + 'context' => $this->objectManagerHelper->getObject(Context::class, $contextArgs), + 'cleaner' => $this->cleanerMock + ] + ); + + parent::setUp(); } /** @@ -42,18 +66,14 @@ public function testBeforeSaveSwitchedToClientSideInProductionShouldThrowExcepti ->method('getMode') ->willReturn(State::MODE_PRODUCTION); - $this->model->setValue(\Magento\Developer\Model\Config\Source\WorkflowType::CLIENT_SIDE_COMPILATION); + $this->model->setValue(SourceWorkflowType::CLIENT_SIDE_COMPILATION); $this->model->beforeSave(); } - /** - * @param int $callNumber - * @param string $oldValue - * @dataProvider afterSaveDataProvider - */ - public function testAfterSave($callNumber, $oldValue) + public function testAfterSaveValueIsChangedShouldCleanViewFiles() { - $this->model->setValue(\Magento\Developer\Model\Config\Source\WorkflowType::CLIENT_SIDE_COMPILATION); - parent::testAfterSave($callNumber, $oldValue); + $this->model->setValue(SourceWorkflowType::SERVER_SIDE_COMPILATION); + $this->cleanerMock->expects($this->once())->method('clearMaterializedViewFiles'); + $this->model->afterSave(); } } \ No newline at end of file diff --git a/lib/internal/Magento/Framework/App/Test/Unit/Config/ValueTest.php b/lib/internal/Magento/Framework/App/Test/Unit/Config/ValueTest.php index cab9beff35801..375a30a9756e8 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/Config/ValueTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/Config/ValueTest.php @@ -7,11 +7,6 @@ class ValueTest extends \PHPUnit_Framework_TestCase { - /** - * @var string - */ - protected $class = 'Magento\Framework\App\Config\Value'; - /** * @var \Magento\Framework\App\Config\Value */ @@ -32,11 +27,6 @@ class ValueTest extends \PHPUnit_Framework_TestCase */ protected $cacheTypeListMock; - /** - * @var \Magento\Framework\TestFramework\Unit\Helper\ObjectManager - */ - protected $objectManagerHelper; - /** * @return void */ @@ -48,10 +38,14 @@ protected function setUp() ->disableOriginalConstructor() ->getMock(); - $this->objectManagerHelper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); - $this->model = $this->objectManagerHelper->getObject( - $this->class, - $this->getArguments() + $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); + $this->model = $objectManager->getObject( + 'Magento\Framework\App\Config\Value', + [ + 'config' => $this->configMock, + 'eventDispatcher' => $this->eventManagerMock, + 'cacheTypeList' => $this->cacheTypeListMock, + ] ); } @@ -206,16 +200,4 @@ public function testAfterDelete() $this->cacheTypeListMock->expects($this->once())->method('invalidate'); $this->assertInstanceOf(get_class($this->model), $this->model->afterDelete()); } - - /** - * @return array - */ - protected function getArguments() - { - return [ - 'config' => $this->configMock, - 'eventDispatcher' => $this->eventManagerMock, - 'cacheTypeList' => $this->cacheTypeListMock, - ]; - } } From 7c27a9c5cb6bbb0bc619bb53c0edf1dc80b51fea Mon Sep 17 00:00:00 2001 From: Viktor Paladiychuk Date: Thu, 19 May 2016 14:18:47 +0300 Subject: [PATCH 19/67] MAGETWO-49175: Wrong behavior of "Client side less compilation" type --- .../System/Config/WorkflowTypeTest.php | 103 ++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 app/code/Magento/Developer/Test/Unit/Block/Adminhtml/System/Config/WorkflowTypeTest.php diff --git a/app/code/Magento/Developer/Test/Unit/Block/Adminhtml/System/Config/WorkflowTypeTest.php b/app/code/Magento/Developer/Test/Unit/Block/Adminhtml/System/Config/WorkflowTypeTest.php new file mode 100644 index 0000000000000..7ca39a29a2fb8 --- /dev/null +++ b/app/code/Magento/Developer/Test/Unit/Block/Adminhtml/System/Config/WorkflowTypeTest.php @@ -0,0 +1,103 @@ +objectManagerHelper = new ObjectManager($this); + $this->elementMock = $this->getMock( + AbstractElement::class, + [], + [], + '', + false + ); + $this->appStateMock = $this->getMock(State::class, [], [], '', false); + + $contextArgs = $this->objectManagerHelper->getConstructArguments( + Context::class, + [ + 'appState' => $this->appStateMock + ] + ); + + $this->context = $this->objectManagerHelper->getObject(Context::class, $contextArgs); + $this->model = $this->objectManagerHelper->getObject(WorkflowType::class, ['context' => $this->context]); + parent::setUp(); + } + + + /** + * @param string $mode + * @param int $disable + * @dataProvider renderDataProvider + */ + public function testRender($mode, $disable) + { + $this->appStateMock->expects($this->once()) + ->method('getMode') + ->willReturn($mode); + + $this->elementMock->expects($this->exactly($disable))->method('setReadonly')->with(true, true); + $this->elementMock->expects($this->exactly($disable)) + ->method('addData') + ->with( + [ + 'can_use_website_value' => false, + 'can_use_default_value' => false, + 'can_restore_to_default' => false + ] + ); + + $this->model->render($this->elementMock); + } + + /** + * @return array + */ + public function renderDataProvider() + { + return [ + [State::MODE_PRODUCTION, 1], + [State::MODE_DEFAULT, 0], + [State::MODE_DEVELOPER, 0] + ]; + } +} From 667080ac036a2c355ded3c3d1c1bcc54a8380fb9 Mon Sep 17 00:00:00 2001 From: Viktor Paladiychuk Date: Thu, 19 May 2016 14:40:54 +0300 Subject: [PATCH 20/67] MAGETWO-49175: Wrong behavior of "Client side less compilation" type --- .../Unit/Block/Adminhtml/System/Config/WorkflowTypeTest.php | 2 -- app/code/Magento/Developer/composer.json | 3 ++- app/code/Magento/Developer/etc/module.xml | 3 +++ 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/Developer/Test/Unit/Block/Adminhtml/System/Config/WorkflowTypeTest.php b/app/code/Magento/Developer/Test/Unit/Block/Adminhtml/System/Config/WorkflowTypeTest.php index 7ca39a29a2fb8..2027ee174757a 100644 --- a/app/code/Magento/Developer/Test/Unit/Block/Adminhtml/System/Config/WorkflowTypeTest.php +++ b/app/code/Magento/Developer/Test/Unit/Block/Adminhtml/System/Config/WorkflowTypeTest.php @@ -38,7 +38,6 @@ class WorkflowTypeTest extends \PHPUnit_Framework_TestCase */ private $appStateMock; - public function setUp() { $this->objectManagerHelper = new ObjectManager($this); @@ -63,7 +62,6 @@ public function setUp() parent::setUp(); } - /** * @param string $mode * @param int $disable diff --git a/app/code/Magento/Developer/composer.json b/app/code/Magento/Developer/composer.json index 3856223db1f6d..072c02a8df569 100644 --- a/app/code/Magento/Developer/composer.json +++ b/app/code/Magento/Developer/composer.json @@ -4,7 +4,8 @@ "require": { "php": "~5.5.22|~5.6.0|~7.0.0", "magento/module-store": "100.0.*", - "magento/framework": "100.0.*" + "magento/framework": "100.0.*", + "magento/module-config": "100.0.2" }, "type": "magento2-module", "version": "100.0.2", diff --git a/app/code/Magento/Developer/etc/module.xml b/app/code/Magento/Developer/etc/module.xml index 1a24a918b9b81..8069b14ddea05 100644 --- a/app/code/Magento/Developer/etc/module.xml +++ b/app/code/Magento/Developer/etc/module.xml @@ -7,5 +7,8 @@ --> + + + From f30a456ab24b51c3bf548d1de1583176c03e8540 Mon Sep 17 00:00:00 2001 From: Viktor Paladiychuk Date: Thu, 19 May 2016 14:49:56 +0300 Subject: [PATCH 21/67] MAGETWO-49175: Wrong behavior of "Client side less compilation" type --- .../Unit/Block/Adminhtml/System/Config/WorkflowTypeTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Developer/Test/Unit/Block/Adminhtml/System/Config/WorkflowTypeTest.php b/app/code/Magento/Developer/Test/Unit/Block/Adminhtml/System/Config/WorkflowTypeTest.php index 2027ee174757a..a9cb60664feda 100644 --- a/app/code/Magento/Developer/Test/Unit/Block/Adminhtml/System/Config/WorkflowTypeTest.php +++ b/app/code/Magento/Developer/Test/Unit/Block/Adminhtml/System/Config/WorkflowTypeTest.php @@ -98,4 +98,4 @@ public function renderDataProvider() [State::MODE_DEVELOPER, 0] ]; } -} +} \ No newline at end of file From 4137f04e26d3e0fe66561369e7deb75fbcc4c09e Mon Sep 17 00:00:00 2001 From: Viktor Paladiychuk Date: Thu, 19 May 2016 14:50:18 +0300 Subject: [PATCH 22/67] MAGETWO-49175: Wrong behavior of "Client side less compilation" type --- .../Unit/Block/Adminhtml/System/Config/WorkflowTypeTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Developer/Test/Unit/Block/Adminhtml/System/Config/WorkflowTypeTest.php b/app/code/Magento/Developer/Test/Unit/Block/Adminhtml/System/Config/WorkflowTypeTest.php index a9cb60664feda..2027ee174757a 100644 --- a/app/code/Magento/Developer/Test/Unit/Block/Adminhtml/System/Config/WorkflowTypeTest.php +++ b/app/code/Magento/Developer/Test/Unit/Block/Adminhtml/System/Config/WorkflowTypeTest.php @@ -98,4 +98,4 @@ public function renderDataProvider() [State::MODE_DEVELOPER, 0] ]; } -} \ No newline at end of file +} From 1038941f55b5d604af1d3e19ef634a7d03ee8553 Mon Sep 17 00:00:00 2001 From: Viktor Paladiychuk Date: Thu, 19 May 2016 14:51:11 +0300 Subject: [PATCH 23/67] MAGETWO-49175: Wrong behavior of "Client side less compilation" type --- .../Developer/Block/Adminhtml/System/Config/WorkflowType.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Developer/Block/Adminhtml/System/Config/WorkflowType.php b/app/code/Magento/Developer/Block/Adminhtml/System/Config/WorkflowType.php index abc7cc74d36fd..40f1d52a9a7d2 100644 --- a/app/code/Magento/Developer/Block/Adminhtml/System/Config/WorkflowType.php +++ b/app/code/Magento/Developer/Block/Adminhtml/System/Config/WorkflowType.php @@ -28,4 +28,4 @@ public function render(\Magento\Framework\Data\Form\Element\AbstractElement $ele } return parent::render($element); } -} \ No newline at end of file +} From 52b9d2c16435b324a64cd63589f2cdc9806273c3 Mon Sep 17 00:00:00 2001 From: Viktor Paladiychuk Date: Thu, 19 May 2016 16:25:35 +0300 Subject: [PATCH 24/67] MAGETWO-49175: Wrong behavior of "Client side less compilation" type --- .../Test/Unit/Model/Config/Backend/WorkflowTypeTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Developer/Test/Unit/Model/Config/Backend/WorkflowTypeTest.php b/app/code/Magento/Developer/Test/Unit/Model/Config/Backend/WorkflowTypeTest.php index 053053b1f384c..9b1fc00b39f34 100644 --- a/app/code/Magento/Developer/Test/Unit/Model/Config/Backend/WorkflowTypeTest.php +++ b/app/code/Magento/Developer/Test/Unit/Model/Config/Backend/WorkflowTypeTest.php @@ -76,4 +76,4 @@ public function testAfterSaveValueIsChangedShouldCleanViewFiles() $this->cleanerMock->expects($this->once())->method('clearMaterializedViewFiles'); $this->model->afterSave(); } -} \ No newline at end of file +} From a7a8428e00a47d1d724e0ff87b4df890e972dc49 Mon Sep 17 00:00:00 2001 From: Roman Liukshyn Date: Fri, 3 Jun 2016 11:50:36 +0300 Subject: [PATCH 25/67] MAGETWO-53214: Wrong filtration by date in Paypal Settlement Report --- app/code/Magento/Paypal/Setup/InstallSchema.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Paypal/Setup/InstallSchema.php b/app/code/Magento/Paypal/Setup/InstallSchema.php index d55782be86279..d0a07242ad75e 100644 --- a/app/code/Magento/Paypal/Setup/InstallSchema.php +++ b/app/code/Magento/Paypal/Setup/InstallSchema.php @@ -165,7 +165,7 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con 'Report Id' )->addColumn( 'report_date', - \Magento\Framework\DB\Ddl\Table::TYPE_TIMESTAMP, + \Magento\Framework\DB\Ddl\Table::TYPE_DATE, null, [], 'Report Date' From a54254c25207565fcdf635780c3e11b7a6626747 Mon Sep 17 00:00:00 2001 From: Viktor Tymchynskyi Date: Mon, 6 Jun 2016 16:56:25 +0300 Subject: [PATCH 26/67] MAGETWO-53384: Express Checkout is always displayed on payment information step in Paypal Payments Pro Hosted Solution --- app/code/Magento/Payment/Model/MethodList.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/Payment/Model/MethodList.php b/app/code/Magento/Payment/Model/MethodList.php index df0ddb9ed4b0c..d547fe42f332c 100644 --- a/app/code/Magento/Payment/Model/MethodList.php +++ b/app/code/Magento/Payment/Model/MethodList.php @@ -61,6 +61,7 @@ protected function _canUseMethod($method, \Magento\Quote\Api\Data\CartInterface { return $this->methodSpecificationFactory->create( [ + AbstractMethod::CHECK_USE_CHECKOUT, AbstractMethod::CHECK_USE_FOR_COUNTRY, AbstractMethod::CHECK_USE_FOR_CURRENCY, AbstractMethod::CHECK_ORDER_TOTAL_MIN_MAX, From 1aa16be9c5bef50320a2c70943a7303360a02921 Mon Sep 17 00:00:00 2001 From: Viktor Tymchynskyi Date: Mon, 6 Jun 2016 17:09:46 +0300 Subject: [PATCH 27/67] MAGETWO-53384: Express Checkout is always displayed on payment information step in Paypal Payments Pro Hosted Solution - Fix unit test --- .../Magento/Payment/Test/Unit/Model/MethodListTest.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Payment/Test/Unit/Model/MethodListTest.php b/app/code/Magento/Payment/Test/Unit/Model/MethodListTest.php index b1e5bedb5a250..241f3fc4fcf53 100644 --- a/app/code/Magento/Payment/Test/Unit/Model/MethodListTest.php +++ b/app/code/Magento/Payment/Test/Unit/Model/MethodListTest.php @@ -8,8 +8,8 @@ namespace Magento\Payment\Test\Unit\Model; -use Magento\Payment\Model\Method\Free; -use \Magento\Payment\Model\MethodList; +use Magento\Payment\Model\MethodList; +use Magento\Payment\Model\Method\AbstractMethod; class MethodListTest extends \PHPUnit_Framework_TestCase { @@ -68,6 +68,12 @@ public function testGetAvailableMethods() $this->specificationFactoryMock->expects($this->atLeastOnce()) ->method('create') + ->with([ + AbstractMethod::CHECK_USE_CHECKOUT, + AbstractMethod::CHECK_USE_FOR_COUNTRY, + AbstractMethod::CHECK_USE_FOR_CURRENCY, + AbstractMethod::CHECK_ORDER_TOTAL_MIN_MAX + ]) ->will($this->returnValue($compositeMock)); $storeMethods = [$methodMock]; From 6d248d5952843ea526f68c2869bd61fd2e23f62b Mon Sep 17 00:00:00 2001 From: Bohdan Korablov Date: Mon, 6 Jun 2016 17:09:57 +0300 Subject: [PATCH 28/67] MAGETWO-50847: [Github] setup:static-content:deploy does not create all the required static assets #2976 --- app/code/Magento/Deploy/Model/Deployer.php | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/app/code/Magento/Deploy/Model/Deployer.php b/app/code/Magento/Deploy/Model/Deployer.php index 5ce8251db1e8b..5be86504d5179 100644 --- a/app/code/Magento/Deploy/Model/Deployer.php +++ b/app/code/Magento/Deploy/Model/Deployer.php @@ -17,6 +17,8 @@ use Magento\Framework\ObjectManagerInterface; use Magento\Framework\Translate\Js\Config as JsTranslationConfig; use Symfony\Component\Console\Output\OutputInterface; +use Magento\Framework\View\Asset\Minification; +use Magento\Framework\App\ObjectManager; /** * A service for deploying Magento static view files for production mode @@ -74,6 +76,11 @@ class Deployer */ private $alternativeSources; + /** + * @var Minification + */ + private $minification; + /** * Constructor * @@ -183,6 +190,9 @@ public function deploy(ObjectManagerFactory $omFactory, array $locales) $dictionaryFileName = $this->jsTranslationConfig->getDictionaryFileName(); $this->deployFile($dictionaryFileName, $area, $themePath, $locale, null); } + if ($this->getMinification()->isEnabled('js')) { + $fileManager->createMinResolverAsset(); + } $fileManager->clearBundleJsPool(); $this->bundleManager->flush(); $this->output->writeln("\nSuccessful: {$this->count} files; errors: {$this->errorCount}\n---\n"); @@ -213,6 +223,21 @@ public function deploy(ObjectManagerFactory $omFactory, array $locales) return \Magento\Framework\Console\Cli::RETURN_SUCCESS; } + /** + * Get Minification instance + * + * @deprecated + * @return Minification + */ + private function getMinification() + { + if (null === $this->minification) { + $this->minification = ObjectManager::getInstance()->get(Minification::class); + } + + return $this->minification; + } + /** * Accumulate all static view files in the application and record all found areas, themes and languages * From 05b64026af0e6dd5da1eab191c7714df8ed6ed00 Mon Sep 17 00:00:00 2001 From: Viktor Paladiychuk Date: Tue, 7 Jun 2016 14:45:49 +0300 Subject: [PATCH 29/67] MAGETWO-49175: Wrong behavior of "Client side less compilation" type --- .../Config/ClientSideLessCompilation/Renderer.php | 1 - .../Framework/View/Asset/AssetInterface.php | 8 -------- lib/internal/Magento/Framework/View/Asset/File.php | 14 +++----------- .../Magento/Framework/View/Asset/Remote.php | 11 ----------- .../Magento/Framework/View/Asset/Source.php | 13 +++++++++++-- .../Framework/View/Page/Config/Renderer.php | 1 - 6 files changed, 14 insertions(+), 34 deletions(-) diff --git a/app/code/Magento/Developer/Model/View/Page/Config/ClientSideLessCompilation/Renderer.php b/app/code/Magento/Developer/Model/View/Page/Config/ClientSideLessCompilation/Renderer.php index e89b94388fd9a..350c30932ef25 100644 --- a/app/code/Magento/Developer/Model/View/Page/Config/ClientSideLessCompilation/Renderer.php +++ b/app/code/Magento/Developer/Model/View/Page/Config/ClientSideLessCompilation/Renderer.php @@ -116,7 +116,6 @@ protected function getAssetContentType(\Magento\Framework\View\Asset\AssetInterf if (!in_array($asset->getContentType(), self::$processingTypes)) { return parent::getAssetContentType($asset); } - $asset->getSourceFile(); return $asset->getSourceContentType(); } } diff --git a/lib/internal/Magento/Framework/View/Asset/AssetInterface.php b/lib/internal/Magento/Framework/View/Asset/AssetInterface.php index e2d5b66b4a834..efeca084654e4 100644 --- a/lib/internal/Magento/Framework/View/Asset/AssetInterface.php +++ b/lib/internal/Magento/Framework/View/Asset/AssetInterface.php @@ -30,12 +30,4 @@ public function getContentType(); * @return string */ public function getSourceContentType(); - - /** - * Set source content type - * - * @param string|null $type - * @return void - */ - public function setSourceContentType($type); } diff --git a/lib/internal/Magento/Framework/View/Asset/File.php b/lib/internal/Magento/Framework/View/Asset/File.php index 9c0728cb296f2..3e23527653162 100644 --- a/lib/internal/Magento/Framework/View/Asset/File.php +++ b/lib/internal/Magento/Framework/View/Asset/File.php @@ -167,20 +167,12 @@ public function getSourceFile() */ public function getSourceContentType() { + if ($this->sourceContentType === null) { + $this->sourceContentType = $this->source->getSourceContentType($this); + } return $this->sourceContentType; } - /** - * Set source content type - * - * @param string|null $type - * @return void - */ - public function setSourceContentType($type) - { - $this->sourceContentType = $type; - } - /** * {@inheritdoc} */ diff --git a/lib/internal/Magento/Framework/View/Asset/Remote.php b/lib/internal/Magento/Framework/View/Asset/Remote.php index 367869f6ed3cf..720f75d1e0639 100644 --- a/lib/internal/Magento/Framework/View/Asset/Remote.php +++ b/lib/internal/Magento/Framework/View/Asset/Remote.php @@ -59,15 +59,4 @@ public function getSourceContentType() { return $this->getContentType(); } - - /** - * Set source content type - * - * @param string|null $type - * @return void - */ - public function setSourceContentType($type) - { - $this->contentType = $type; - } } diff --git a/lib/internal/Magento/Framework/View/Asset/Source.php b/lib/internal/Magento/Framework/View/Asset/Source.php index db663af420a37..1bde94402d1a8 100644 --- a/lib/internal/Magento/Framework/View/Asset/Source.php +++ b/lib/internal/Magento/Framework/View/Asset/Source.php @@ -142,7 +142,6 @@ private function preProcess(LocalInterface $asset) $chain = $this->createChain($asset, $dir, $path); $this->preProcessorPool->process($chain); - $asset->setSourceContentType($chain->getContentType()); $chain->assertValid(); if ($chain->isChanged()) { $dir = $this->varDir->getAbsolutePath(); @@ -152,11 +151,21 @@ private function preProcess(LocalInterface $asset) if (empty($path)) { $result = false; } else { - $result = [$dir, $path]; + $result = [$dir, $path, $chain->getContentType()]; } return $result; } + /** + * @param LocalInterface $asset + * @return string + */ + public function getSourceContentType(LocalInterface $asset) + { + list(,,$type) = $this->preProcess($asset); + return $type; + } + /** * @param LocalInterface $asset * @return bool|string diff --git a/lib/internal/Magento/Framework/View/Page/Config/Renderer.php b/lib/internal/Magento/Framework/View/Page/Config/Renderer.php index 26ab5332e1c1a..3ecd30b7e0bfa 100644 --- a/lib/internal/Magento/Framework/View/Page/Config/Renderer.php +++ b/lib/internal/Magento/Framework/View/Page/Config/Renderer.php @@ -351,7 +351,6 @@ protected function renderAssetHtml(\Magento\Framework\View\Asset\PropertyGroup $ $this->addDefaultAttributes($this->getAssetContentType($asset), $attributes) ); $result .= sprintf($template, $asset->getUrl()); - $asset->setSourceContentType(null); } } catch (\Magento\Framework\Exception\LocalizedException $e) { $this->logger->critical($e); From 3869484cfb4b9702f6f1abe16044a452f89d9d78 Mon Sep 17 00:00:00 2001 From: "Shmyheliuk, Oleksandr" Date: Wed, 8 Jun 2016 10:52:52 +0300 Subject: [PATCH 30/67] MAGETWO-53182: 'Ship to Specific Countries' is enabled with checked 'Use Default' settings for Table Rates shipping method --- .../templates/system/shipping/applicable_country.phtml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Backend/view/adminhtml/templates/system/shipping/applicable_country.phtml b/app/code/Magento/Backend/view/adminhtml/templates/system/shipping/applicable_country.phtml index 1ab29f9fc7599..b8f4bfb8f7e73 100644 --- a/app/code/Magento/Backend/view/adminhtml/templates/system/shipping/applicable_country.phtml +++ b/app/code/Magento/Backend/view/adminhtml/templates/system/shipping/applicable_country.phtml @@ -38,8 +38,12 @@ CountryModel.prototype = { //var specifErrMsgElement = $(applyCountryElement.id.replace(/sallowspecific/, 'specificerrmsg')); if (specifCountryElement) { if (applyCountryElement.value == 1) { - //if specific country element selected - specifCountryElement.enable(); + + var specifCountryUseDefaultElement = $(applyCountryElement.id + '_inherit'); + //if specific country element selected and use default checkbox not checked + if (!specifCountryUseDefaultElement || !specifCountryUseDefaultElement.checked) { + specifCountryElement.enable(); + } if (showMethodElement) { this.showElement(showMethodElement.up(1)); } From a9b0c6f2964996dd7dff0a4a94996814a69dc1b2 Mon Sep 17 00:00:00 2001 From: Bohdan Korablov Date: Wed, 8 Jun 2016 14:22:30 +0300 Subject: [PATCH 31/67] MAGETWO-52172: [TD] "Use default value" checkbox is missing for Custom Options on product form --- .../Product/Initialization/Helper.php | 34 ++++++-- .../Product/Initialization/HelperTest.php | 84 +++++++++++++++++-- .../Product/Form/Modifier/CustomOptions.php | 21 ++++- .../helper/custom-option-type-service.html | 17 ++++ 4 files changed, 140 insertions(+), 16 deletions(-) create mode 100644 app/code/Magento/Catalog/view/adminhtml/web/template/form/element/helper/custom-option-type-service.html diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Initialization/Helper.php b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Initialization/Helper.php index a869a26f64731..6d5b1d463204a 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Initialization/Helper.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Initialization/Helper.php @@ -310,22 +310,44 @@ public function mergeProductOptions($productOptions, $overwriteOptions) if (!is_array($overwriteOptions)) { return $productOptions; } - - foreach ($productOptions as $index => $option) { + + foreach ($productOptions as $optionIndex => $option) { $optionId = $option['option_id']; + $option = $this->overwriteValue($optionId, $option, $overwriteOptions); - if (!isset($overwriteOptions[$optionId])) { - continue; + if (isset($option['values']) && isset($overwriteOptions[$optionId]['values'])) { + foreach ($option['values'] as $valueIndex => $value) { + $valueId = $value['option_type_id']; + $value = $this->overwriteValue($valueId, $value, $overwriteOptions[$optionId]['values']); + $option['values'][$valueIndex] = $value; + } } + $productOptions[$optionIndex] = $option; + } + + return $productOptions; + } + + /** + * Overwrite values of fields to default, if there are option id and field name in array overwriteOptions + * + * @param int $optionId + * @param array $option + * @param array $overwriteOptions + * @return array + */ + private function overwriteValue($optionId, $option, $overwriteOptions) + { + if (isset($overwriteOptions[$optionId])) { foreach ($overwriteOptions[$optionId] as $fieldName => $overwrite) { if ($overwrite && isset($option[$fieldName]) && isset($option['default_' . $fieldName])) { - $productOptions[$index][$fieldName] = $option['default_' . $fieldName]; + $option[$fieldName] = $option['default_' . $fieldName]; } } } - return $productOptions; + return $option; } /** diff --git a/app/code/Magento/Catalog/Test/Unit/Controller/Adminhtml/Product/Initialization/HelperTest.php b/app/code/Magento/Catalog/Test/Unit/Controller/Adminhtml/Product/Initialization/HelperTest.php index 4f19d2f0117ed..389599f510f08 100644 --- a/app/code/Magento/Catalog/Test/Unit/Controller/Adminhtml/Product/Initialization/HelperTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Controller/Adminhtml/Product/Initialization/HelperTest.php @@ -306,6 +306,7 @@ public function testInitialize() * Data provider for testMergeProductOptions * * @return array + * @SuppressWarnings(PHPMD.ExcessiveMethodLength) */ public function mergeProductOptionsDataProvider() { @@ -325,15 +326,34 @@ public function mergeProductOptionsDataProvider() [ 'option_id' => '3', 'key1' => 'val1', - 'default_key1' => 'val2' + 'default_key1' => 'val2', + 'values' => [ + [ + 'option_type_id' => '2', + 'key1' => 'val1', + 'default_key1' => 'val2' + ] + ] + ] + ], + [ + 4 => [ + 'key1' => '1', + 'values' => [3 => ['key1' => 1]] ] ], - [4 => ['key1' => '1']], [ [ 'option_id' => '3', 'key1' => 'val1', - 'default_key1' => 'val2' + 'default_key1' => 'val2', + 'values' => [ + [ + 'option_type_id' => '2', + 'key1' => 'val1', + 'default_key1' => 'val2' + ] + ] ] ] ], @@ -344,17 +364,41 @@ public function mergeProductOptionsDataProvider() 'key1' => 'val1', 'key2' => 'val2', 'default_key1' => 'val3', - 'default_key2' => 'val4' + 'default_key2' => 'val4', + 'values' => [ + [ + 'option_type_id' => '2', + 'key1' => 'val1', + 'key2' => 'val2', + 'default_key1' => 'val11', + 'default_key2' => 'val22' + ] + ] + ] + ], + [ + 5 => [ + 'key1' => '0', + 'key2' => '1', + 'values' => [2 => ['key1' => 1]] ] ], - [5 => ['key1' => '0', 'key2' => '1']], [ [ 'option_id' => '5', 'key1' => 'val1', 'key2' => 'val4', 'default_key1' => 'val3', - 'default_key2' => 'val4' + 'default_key2' => 'val4', + 'values' => [ + [ + 'option_type_id' => '2', + 'key1' => 'val11', + 'key2' => 'val2', + 'default_key1' => 'val11', + 'default_key2' => 'val22' + ] + ] ] ] ], @@ -364,16 +408,38 @@ public function mergeProductOptionsDataProvider() 'option_id' => '7', 'key1' => 'val1', 'key2' => 'val2', - 'default_key1' => 'val3' + 'default_key1' => 'val3', + 'values' => [ + [ + 'option_type_id' => '2', + 'key1' => 'val1', + 'key2' => 'val2', + 'default_key1' => 'val11' + ] + ] + ] + ], + [ + 7 => [ + 'key1' => '1', + 'key2' => '1', + 'values' => [2 => ['key1' => 1, 'key2' => 1]] ] ], - [7 => ['key1' => '1', 'key2' => '1']], [ [ 'option_id' => '7', 'key1' => 'val3', 'key2' => 'val2', - 'default_key1' => 'val3' + 'default_key1' => 'val3', + 'values' => [ + [ + 'option_type_id' => '2', + 'key1' => 'val11', + 'key2' => 'val2', + 'default_key1' => 'val11' + ] + ] ] ], ], diff --git a/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/CustomOptions.php b/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/CustomOptions.php index 43ad0e0018033..8b9b452e34423 100644 --- a/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/CustomOptions.php +++ b/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/CustomOptions.php @@ -591,6 +591,22 @@ protected function getStaticTypeContainerConfig($sortOrder) */ protected function getSelectTypeGridConfig($sortOrder) { + $options = [ + 'arguments' => [ + 'data' => [ + 'config' => [ + 'imports' => [ + 'optionId' => '${ $.provider }:${ $.parentScope }.option_id', + 'optionTypeId' => '${ $.provider }:${ $.parentScope }.option_type_id', + ], + 'service' => [ + 'template' => 'Magento_Catalog/form/element/helper/custom-option-type-service', + ], + ], + ], + ], + ]; + return [ 'arguments' => [ 'data' => [ @@ -620,7 +636,10 @@ protected function getSelectTypeGridConfig($sortOrder) ], ], 'children' => [ - static::FIELD_TITLE_NAME => $this->getTitleFieldConfig(10), + static::FIELD_TITLE_NAME => $this->getTitleFieldConfig( + 10, + $this->locator->getProduct()->getStoreId() ? $options : [] + ), static::FIELD_PRICE_NAME => $this->getPriceFieldConfig(20), static::FIELD_PRICE_TYPE_NAME => $this->getPriceTypeFieldConfig(30, ['fit' => true]), static::FIELD_SKU_NAME => $this->getSkuFieldConfig(40), diff --git a/app/code/Magento/Catalog/view/adminhtml/web/template/form/element/helper/custom-option-type-service.html b/app/code/Magento/Catalog/view/adminhtml/web/template/form/element/helper/custom-option-type-service.html new file mode 100644 index 0000000000000..a3f7970e7420a --- /dev/null +++ b/app/code/Magento/Catalog/view/adminhtml/web/template/form/element/helper/custom-option-type-service.html @@ -0,0 +1,17 @@ + +
+ + +
From 959db45212f1f145e62d14bb9cf85756e82db02a Mon Sep 17 00:00:00 2001 From: Dmytro Yushkin Date: Wed, 8 Jun 2016 16:48:13 +0300 Subject: [PATCH 32/67] MAGETWO-53329: [Conflict Resolution] Express Checkout is disabled after enabling of Payflow Pro in Canada --- app/code/Magento/Paypal/etc/adminhtml/rules/payment_ca.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/code/Magento/Paypal/etc/adminhtml/rules/payment_ca.xml b/app/code/Magento/Paypal/etc/adminhtml/rules/payment_ca.xml index fb2b7456fb7c5..fc0ca6ebb6e9d 100644 --- a/app/code/Magento/Paypal/etc/adminhtml/rules/payment_ca.xml +++ b/app/code/Magento/Paypal/etc/adminhtml/rules/payment_ca.xml @@ -143,9 +143,13 @@ + wpp_ca + paypal_payflowpro_ca payflow_link_ca + wpp_ca + paypal_payflowpro_ca payflow_link_ca From 42ab8e9827499756383952622fc82158c22bf9f4 Mon Sep 17 00:00:00 2001 From: Dmytro Yushkin Date: Wed, 8 Jun 2016 17:24:05 +0300 Subject: [PATCH 33/67] MAGETWO-53364: [Conflict Resolution] Sort Order field is absent after enabling of Express Checkout for Payflow Link if it was enabled previously --- app/code/Magento/Paypal/etc/adminhtml/rules/payment_us.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/code/Magento/Paypal/etc/adminhtml/rules/payment_us.xml b/app/code/Magento/Paypal/etc/adminhtml/rules/payment_us.xml index dfbb68283daa9..554b459d3c45a 100644 --- a/app/code/Magento/Paypal/etc/adminhtml/rules/payment_us.xml +++ b/app/code/Magento/Paypal/etc/adminhtml/rules/payment_us.xml @@ -351,6 +351,7 @@ + payflow_advanced @@ -363,6 +364,7 @@ paypal_payflowpro_with_express_checkout + From be6152ff0cc355f9e997bcd07c39ccd8af6a2636 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov Date: Thu, 9 Jun 2016 14:09:03 +0300 Subject: [PATCH 34/67] MAGETWO-53937: Translation is not applied to product list widget --- .../Magento/Translation/Model/Inline/Parser.php | 16 +++++++++++++--- app/code/Magento/Translation/etc/di.xml | 6 ++++++ 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/Translation/Model/Inline/Parser.php b/app/code/Magento/Translation/Model/Inline/Parser.php index e44da486d4352..bc28e65947c16 100644 --- a/app/code/Magento/Translation/Model/Inline/Parser.php +++ b/app/code/Magento/Translation/Model/Inline/Parser.php @@ -126,6 +126,11 @@ class Parser implements \Magento\Framework\Translate\Inline\ParserInterface */ private $cacheManager; + /** + * @var array + */ + private $relatedCacheTypes; + /** * @return \Magento\Translation\Model\Inline\CacheManager * @@ -148,8 +153,9 @@ private function getCacheManger() * @param \Magento\Translation\Model\ResourceModel\StringUtilsFactory $resource * @param \Zend_Filter_Interface $inputFilter * @param \Magento\Framework\App\State $appState - * @param \Magento\Framework\App\Cache\TypeListInterface $appCache, + * @param \Magento\Framework\App\Cache\TypeListInterface $appCache * @param \Magento\Framework\Translate\InlineInterface $translateInline + * @param array $relatedCacheTypes */ public function __construct( \Magento\Translation\Model\ResourceModel\StringUtilsFactory $resource, @@ -157,7 +163,8 @@ public function __construct( \Zend_Filter_Interface $inputFilter, \Magento\Framework\App\State $appState, \Magento\Framework\App\Cache\TypeListInterface $appCache, - \Magento\Framework\Translate\InlineInterface $translateInline + \Magento\Framework\Translate\InlineInterface $translateInline, + array $relatedCacheTypes = [] ) { $this->_resourceFactory = $resource; $this->_storeManager = $storeManager; @@ -165,6 +172,7 @@ public function __construct( $this->_appState = $appState; $this->_appCache = $appCache; $this->_translateInline = $translateInline; + $this->relatedCacheTypes = $relatedCacheTypes; } /** @@ -178,7 +186,9 @@ public function processAjaxPost(array $translateParams) if (!$this->_translateInline->isAllowed()) { return ['inline' => 'not allowed']; } - $this->_appCache->invalidate(\Magento\Framework\App\Cache\Type\Translate::TYPE_IDENTIFIER); + if (!empty($this->relatedCacheTypes)) { + $this->_appCache->invalidate($this->relatedCacheTypes); + } $this->_validateTranslationParams($translateParams); $this->_filterTranslationParams($translateParams, ['custom']); diff --git a/app/code/Magento/Translation/etc/di.xml b/app/code/Magento/Translation/etc/di.xml index 0428924dbbb8d..7aa0959ce17f5 100644 --- a/app/code/Magento/Translation/etc/di.xml +++ b/app/code/Magento/Translation/etc/di.xml @@ -26,6 +26,12 @@ Magento\Framework\Filter\Input\MaliciousCode + + block_html + layout + translate + full_page + From 171c635f56e19390889b11c140237fcf0baa09a0 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov Date: Thu, 9 Jun 2016 16:20:18 +0300 Subject: [PATCH 35/67] MAGETWO-53937: Translation is not applied to product list widget --- .../Test/Unit/Model/Inline/ParserTest.php | 120 ++++++++++++++++++ 1 file changed, 120 insertions(+) create mode 100644 app/code/Magento/Translation/Test/Unit/Model/Inline/ParserTest.php diff --git a/app/code/Magento/Translation/Test/Unit/Model/Inline/ParserTest.php b/app/code/Magento/Translation/Test/Unit/Model/Inline/ParserTest.php new file mode 100644 index 0000000000000..10ef1a0ff9e5f --- /dev/null +++ b/app/code/Magento/Translation/Test/Unit/Model/Inline/ParserTest.php @@ -0,0 +1,120 @@ +objectManager = new ObjectManager($this); + $this->translateInlineMock = $this->getMockForAbstractClass('Magento\Framework\Translate\InlineInterface'); + $this->appCacheMock = $this->getMockForAbstractClass('Magento\Framework\App\Cache\TypeListInterface'); + $this->storeManagerMock = $this->getMockForAbstractClass('Magento\Store\Model\StoreManagerInterface'); + $this->storeMock = $this->getMockForAbstractClass('Magento\Store\Api\Data\StoreInterface'); + $this->storeManagerMock->expects($this->any()) + ->method('getStore') + ->willReturn($this->storeMock); + $this->resourceFactoryMock = $this->getMockBuilder('Magento\Translation\Model\ResourceModel\StringUtilsFactory') + ->setMethods(['create']) + ->getMock(); + $this->resourceMock = $this->getMockBuilder('Magento\Translation\Model\ResourceModel\StringUtils') + ->disableOriginalConstructor() + ->setMethods([]) + ->getMock(); + $this->resourceFactoryMock->expects($this->any()) + ->method('create') + ->willReturn($this->resourceMock); + $this->cacheManagerMock = $this->getMockBuilder('Magento\Translation\Model\Inline\CacheManager') + ->disableOriginalConstructor() + ->setMethods([]) + ->getMock(); + } + + public function testProcessAjaxPostNotAllowed() + { + $expected = ['inline' => 'not allowed']; + $this->translateInlineMock->expects($this->once()) + ->method('isAllowed') + ->willReturn(false); + $this->model = $this->objectManager->getObject( + Parser::class, + ['translateInline' => $this->translateInlineMock] + ); + $this->assertEquals($expected, $this->model->processAjaxPost([])); + } + + public function testProcessAjaxPost() + { + $this->translateInlineMock->expects($this->once()) + ->method('isAllowed') + ->willReturn(true); + $this->model = $this->objectManager->getObject( + Parser::class, + [ + 'cacheManager' => $this->cacheManagerMock, + 'resource' => $this->resourceFactoryMock, + 'storeManager' => $this->storeManagerMock, + 'translateInline' => $this->translateInlineMock + ] + ); + $this->model->processAjaxPost([]); + } +} From 9a4e38ef4b9c788ab481abc4906f4bdbf5986109 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov Date: Thu, 9 Jun 2016 18:18:32 +0300 Subject: [PATCH 36/67] MAGETWO-53937: Translation is not applied to product list widget --- .../Magento/Translation/Test/Unit/Model/Inline/ParserTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Translation/Test/Unit/Model/Inline/ParserTest.php b/app/code/Magento/Translation/Test/Unit/Model/Inline/ParserTest.php index 10ef1a0ff9e5f..9a3671b1683fa 100644 --- a/app/code/Magento/Translation/Test/Unit/Model/Inline/ParserTest.php +++ b/app/code/Magento/Translation/Test/Unit/Model/Inline/ParserTest.php @@ -78,7 +78,7 @@ protected function setUp() $this->resourceMock = $this->getMockBuilder('Magento\Translation\Model\ResourceModel\StringUtils') ->disableOriginalConstructor() ->setMethods([]) - ->getMock(); + ->getMock(); $this->resourceFactoryMock->expects($this->any()) ->method('create') ->willReturn($this->resourceMock); From 8e97e0c92c884896d665fb103d14eb4648060fb5 Mon Sep 17 00:00:00 2001 From: Ievgen Sentiabov Date: Mon, 13 Jun 2016 13:05:55 +0300 Subject: [PATCH 37/67] MAGETWO-54294: Stored Cards (Braintree) option available for order creation in Admin if Vault enabled = No - Added additional checking for Vault configuration --- app/code/Magento/Vault/Model/Method/Vault.php | 3 +- .../Test/Unit/Model/Method/VaultTest.php | 54 +++++++++++++++++++ 2 files changed, 56 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Vault/Model/Method/Vault.php b/app/code/Magento/Vault/Model/Method/Vault.php index 3457bc6a0a61f..aa0bead2327ea 100644 --- a/app/code/Magento/Vault/Model/Method/Vault.php +++ b/app/code/Magento/Vault/Model/Method/Vault.php @@ -576,7 +576,8 @@ public function assignData(\Magento\Framework\DataObject $data) */ public function isAvailable(\Magento\Quote\Api\Data\CartInterface $quote = null) { - return $this->getVaultProvider()->isAvailable($quote); + return $this->getVaultProvider()->isAvailable($quote) + && $this->config->getValue(self::$activeKey, $this->getStore() ?: $quote->getStoreId()); } /** diff --git a/app/code/Magento/Vault/Test/Unit/Model/Method/VaultTest.php b/app/code/Magento/Vault/Test/Unit/Model/Method/VaultTest.php index 2dcece98e770a..32e783278e130 100644 --- a/app/code/Magento/Vault/Test/Unit/Model/Method/VaultTest.php +++ b/app/code/Magento/Vault/Test/Unit/Model/Method/VaultTest.php @@ -8,8 +8,10 @@ use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; use Magento\Payment\Gateway\Command\CommandManagerInterface; use Magento\Payment\Gateway\Command\CommandManagerPoolInterface; +use Magento\Payment\Gateway\ConfigInterface; use Magento\Payment\Model\InfoInterface; use Magento\Payment\Model\MethodInterface; +use Magento\Quote\Api\Data\CartInterface; use Magento\Sales\Api\Data\OrderPaymentExtensionInterface; use Magento\Sales\Api\Data\TransactionInterface; use Magento\Sales\Model\Order\Payment; @@ -18,6 +20,10 @@ use Magento\Vault\Model\Method\Vault; use Magento\Vault\Model\VaultPaymentInterface; +/** + * Class VaultTest + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) + */ class VaultTest extends \PHPUnit_Framework_TestCase { /** @@ -209,4 +215,52 @@ public function testCapture() $model = $this->objectManager->getObject(Vault::class); $model->capture($paymentModel, 0); } + + /** + * @covers \Magento\Vault\Model\Method\Vault::isAvailable + * @dataProvider isAvailableDataProvider + */ + public function testIsAvailable($isAvailableProvider, $isActive, $expected) + { + $storeId = 1; + $quote = $this->getMockForAbstractClass(CartInterface::class); + $vaultProvider = $this->getMockForAbstractClass(MethodInterface::class); + $config = $this->getMockForAbstractClass(ConfigInterface::class); + + $vaultProvider->expects(static::once()) + ->method('isAvailable') + ->with($quote) + ->willReturn($isAvailableProvider); + + $config->expects(static::any()) + ->method('getValue') + ->with('active', $storeId) + ->willReturn($isActive); + + $quote->expects(static::any()) + ->method('getStoreId') + ->willReturn($storeId); + + /** @var Vault $model */ + $model = $this->objectManager->getObject(Vault::class, [ + 'config' => $config, + 'vaultProvider' => $vaultProvider + ]); + $actual = $model->isAvailable($quote); + static::assertEquals($expected, $actual); + } + + /** + * List of variations for testing isAvailable method + * @return array + */ + public function isAvailableDataProvider() + { + return [ + ['isAvailableProvider' => true, 'isActiveVault' => false, 'expected' => false], + ['isAvailableProvider' => false, 'isActiveVault' => false, 'expected' => false], + ['isAvailableProvider' => false, 'isActiveVault' => true, 'expected' => false], + ['isAvailableProvider' => true, 'isActiveVault' => true, 'expected' => true], + ]; + } } From be4f9c9b89aac8cd577978541ce81d7aac566d4d Mon Sep 17 00:00:00 2001 From: Roman Liukshyn Date: Mon, 13 Jun 2016 17:42:58 +0300 Subject: [PATCH 38/67] MAGETWO-54193: No Payment Type filter in Braintree Settlement report --- .../Braintree/view/adminhtml/ui_component/braintree_report.xml | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/code/Magento/Braintree/view/adminhtml/ui_component/braintree_report.xml b/app/code/Magento/Braintree/view/adminhtml/ui_component/braintree_report.xml index d1b661b2c3ecd..54bbfcd14bbc6 100644 --- a/app/code/Magento/Braintree/view/adminhtml/ui_component/braintree_report.xml +++ b/app/code/Magento/Braintree/view/adminhtml/ui_component/braintree_report.xml @@ -109,7 +109,6 @@ - From a11ba0c177551d0b074eda18305970433f839760 Mon Sep 17 00:00:00 2001 From: Elena Marchenko Date: Mon, 13 Jun 2016 17:55:53 +0300 Subject: [PATCH 39/67] MAGETWO-54306: PayPal Express Checkout tests randomly fail due to not verified buyer account --- .../Test/Block/Adminhtml/Order/History.php | 18 ++++++++++++++++++ .../AssertAuthorizationInCommentsHistory.php | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/History.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/History.php index b3b0f4eafa74c..2235122955a72 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/History.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/History.php @@ -21,6 +21,13 @@ class History extends Block */ protected $commentHistory = '.note-list-comment'; + /** + * Authorized Amount. + * + * @var string + */ + protected $authorizedAmount = '//div[@class="note-list-comment"][contains(text(), "Authorized amount of")]'; + /** * Captured Amount from IPN. * @@ -53,6 +60,17 @@ public function getCommentsHistory() return $this->_rootElement->find($this->commentHistory, Locator::SELECTOR_CSS)->getText(); } + /** + * Get the authorized amount from the comments history. + * + * @return string + */ + public function getAuthorizedAmount() + { + $this->waitCommentsHistory(); + return $this->_rootElement->find($this->authorizedAmount, Locator::SELECTOR_XPATH)->getText(); + } + /** * Get the captured amount from the comments history. * diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertAuthorizationInCommentsHistory.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertAuthorizationInCommentsHistory.php index 7495855d5351f..a6b8e8983d2b6 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertAuthorizationInCommentsHistory.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertAuthorizationInCommentsHistory.php @@ -38,7 +38,7 @@ public function processAssert( $salesOrder->open(); $salesOrder->getSalesOrderGrid()->searchAndOpen(['id' => $orderId]); - $actualAuthorizedAmount = $salesOrderView->getOrderHistoryBlock()->getCommentsHistory(); + $actualAuthorizedAmount = $salesOrderView->getOrderHistoryBlock()->getAuthorizedAmount(); \PHPUnit_Framework_Assert::assertContains( self::AUTHORIZED_AMOUNT . $prices['grandTotal'], From 6d106ee75a7cd1572812a527fa1c3a21f4d465ac Mon Sep 17 00:00:00 2001 From: Elena Marchenko Date: Mon, 13 Jun 2016 19:20:00 +0300 Subject: [PATCH 40/67] MAGETWO-50538: Add test for Authorize.net to Functional 3rd Party Tests plan --- .../Magento/Authorizenet/Test/TestCase/OnePageCheckoutTest.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/tests/functional/tests/app/Magento/Authorizenet/Test/TestCase/OnePageCheckoutTest.xml b/dev/tests/functional/tests/app/Magento/Authorizenet/Test/TestCase/OnePageCheckoutTest.xml index 2ea4873f454a3..57763d8b6363f 100644 --- a/dev/tests/functional/tests/app/Magento/Authorizenet/Test/TestCase/OnePageCheckoutTest.xml +++ b/dev/tests/functional/tests/app/Magento/Authorizenet/Test/TestCase/OnePageCheckoutTest.xml @@ -26,7 +26,7 @@ No Authorization - test_type:3rd_party_test_deprecated + test_type:3rd_party_test From 9d4418f0d42038754e8f87c2d0151671bb9df91e Mon Sep 17 00:00:00 2001 From: Roman Liukshyn Date: Tue, 14 Jun 2016 10:56:44 +0300 Subject: [PATCH 41/67] MAGETWO-54193: No Payment Type filter in Braintree Settlement report - Added localization support for report fields --- .../Model/Report/Row/TransactionMap.php | 4 +++ .../Report/Listing/Column/PaymentType.php | 12 ++++---- .../Report/Listing/Column/Status.php | 28 +++++++++---------- .../Report/Listing/Column/TransactionType.php | 4 +-- app/code/Magento/Braintree/i18n/en_US.csv | 28 +++++++++++++++++-- 5 files changed, 51 insertions(+), 25 deletions(-) diff --git a/app/code/Magento/Braintree/Model/Report/Row/TransactionMap.php b/app/code/Magento/Braintree/Model/Report/Row/TransactionMap.php index 0abae8af89fbc..c914b21893e25 100644 --- a/app/code/Magento/Braintree/Model/Report/Row/TransactionMap.php +++ b/app/code/Magento/Braintree/Model/Report/Row/TransactionMap.php @@ -115,9 +115,13 @@ public function setCustomAttribute($attributeCode, $attributeValue) */ public function getCustomAttributes() { + $shouldBeLocalized = ['paymentInstrumentType', 'type', 'status']; $output = []; foreach ($this->getMappedValues() as $key => $value) { $attribute = $this->attributeValueFactory->create(); + if(in_array($key, $shouldBeLocalized)) { + $value = __($value); + } $output[] = $attribute->setAttributeCode($key)->setValue($value); } return $output; diff --git a/app/code/Magento/Braintree/Ui/Component/Report/Listing/Column/PaymentType.php b/app/code/Magento/Braintree/Ui/Component/Report/Listing/Column/PaymentType.php index df6c2ffcd229d..489c0d4cd1e49 100644 --- a/app/code/Magento/Braintree/Ui/Component/Report/Listing/Column/PaymentType.php +++ b/app/code/Magento/Braintree/Ui/Component/Report/Listing/Column/PaymentType.php @@ -44,12 +44,12 @@ public function toOptionArray() private function getAvailablePaymentTypes() { return [ - PaymentInstrumentType::PAYPAL_ACCOUNT => __('Paypal account'), - PaymentInstrumentType::COINBASE_ACCOUNT => __('Coinbase account'), - PaymentInstrumentType::EUROPE_BANK_ACCOUNT => __('Europe bank account'), - PaymentInstrumentType::CREDIT_CARD => __('Credit card'), - PaymentInstrumentType::APPLE_PAY_CARD => __('Apple pay card'), - PaymentInstrumentType::ANDROID_PAY_CARD => __('Android pay card') + PaymentInstrumentType::PAYPAL_ACCOUNT => __(PaymentInstrumentType::PAYPAL_ACCOUNT), + PaymentInstrumentType::COINBASE_ACCOUNT => __(PaymentInstrumentType::COINBASE_ACCOUNT), + PaymentInstrumentType::EUROPE_BANK_ACCOUNT => __(PaymentInstrumentType::EUROPE_BANK_ACCOUNT), + PaymentInstrumentType::CREDIT_CARD => __(PaymentInstrumentType::CREDIT_CARD), + PaymentInstrumentType::APPLE_PAY_CARD => __(PaymentInstrumentType::APPLE_PAY_CARD), + PaymentInstrumentType::ANDROID_PAY_CARD => __(PaymentInstrumentType::ANDROID_PAY_CARD) ]; } } diff --git a/app/code/Magento/Braintree/Ui/Component/Report/Listing/Column/Status.php b/app/code/Magento/Braintree/Ui/Component/Report/Listing/Column/Status.php index f5424c6dd9b7f..ca6d6522990b4 100644 --- a/app/code/Magento/Braintree/Ui/Component/Report/Listing/Column/Status.php +++ b/app/code/Magento/Braintree/Ui/Component/Report/Listing/Column/Status.php @@ -44,20 +44,20 @@ public function toOptionArray() private function getAvailableStatuses() { return [ - Transaction::AUTHORIZATION_EXPIRED => __('Authorization expired'), - Transaction::AUTHORIZING => __('Authorizing'), - Transaction::AUTHORIZED => __('Authorized'), - Transaction::GATEWAY_REJECTED => __('Gateway rejected'), - Transaction::FAILED => __('Failed'), - Transaction::PROCESSOR_DECLINED => __('Processor declined'), - Transaction::SETTLED => __('Settled'), - Transaction::SETTLING => __('Settling'), - Transaction::SUBMITTED_FOR_SETTLEMENT => __('Submitted for settlement'), - Transaction::VOIDED => __('Voided'), - Transaction::UNRECOGNIZED => __('Unrecognized'), - Transaction::SETTLEMENT_DECLINED => __('Settlement declined'), - Transaction::SETTLEMENT_PENDING => __('Settlement pending'), - Transaction::SETTLEMENT_CONFIRMED => __('Settlement confirmed') + Transaction::AUTHORIZATION_EXPIRED => __(Transaction::AUTHORIZATION_EXPIRED), + Transaction::AUTHORIZING => __(Transaction::AUTHORIZING), + Transaction::AUTHORIZED => __(Transaction::AUTHORIZED), + Transaction::GATEWAY_REJECTED => __(Transaction::GATEWAY_REJECTED), + Transaction::FAILED => __(Transaction::FAILED), + Transaction::PROCESSOR_DECLINED => __(Transaction::PROCESSOR_DECLINED), + Transaction::SETTLED => __(Transaction::SETTLED), + Transaction::SETTLING => __(Transaction::SETTLING), + Transaction::SUBMITTED_FOR_SETTLEMENT => __(Transaction::SUBMITTED_FOR_SETTLEMENT), + Transaction::VOIDED => __(Transaction::VOIDED), + Transaction::UNRECOGNIZED => __(Transaction::UNRECOGNIZED), + Transaction::SETTLEMENT_DECLINED => __(Transaction::SETTLEMENT_DECLINED), + Transaction::SETTLEMENT_PENDING => __(Transaction::SETTLEMENT_PENDING), + Transaction::SETTLEMENT_CONFIRMED => __(Transaction::SETTLEMENT_CONFIRMED) ]; } } diff --git a/app/code/Magento/Braintree/Ui/Component/Report/Listing/Column/TransactionType.php b/app/code/Magento/Braintree/Ui/Component/Report/Listing/Column/TransactionType.php index 312b2f518b464..0fe752d423277 100644 --- a/app/code/Magento/Braintree/Ui/Component/Report/Listing/Column/TransactionType.php +++ b/app/code/Magento/Braintree/Ui/Component/Report/Listing/Column/TransactionType.php @@ -44,8 +44,8 @@ public function toOptionArray() private function getAvailableTransactionTypes() { return [ - Transaction::SALE => __('Sale'), - Transaction::CREDIT => __('Credit') + Transaction::SALE => __(Transaction::SALE), + Transaction::CREDIT => __(Transaction::CREDIT) ]; } } diff --git a/app/code/Magento/Braintree/i18n/en_US.csv b/app/code/Magento/Braintree/i18n/en_US.csv index f912e59c2edac..4cdb8538c3abf 100644 --- a/app/code/Magento/Braintree/i18n/en_US.csv +++ b/app/code/Magento/Braintree/i18n/en_US.csv @@ -140,6 +140,28 @@ Debug,Debug "liabilityShifted", "Liability Shifted" "liabilityShiftPossible", "Liability Shift Possible" "riskDataId", "Risk ID" -"riskDataDecision", "Risk Decision", -"paymentId", "Payment Id", -"payerEmail", "Payer Email", +"riskDataDecision", "Risk Decision" +"paymentId", "Payment Id" +"payerEmail", "Payer Email" +"sale","Sale" +"credit","Credit" +"authorization_expired","Authorization expired" +"authorizing","Authorizing" +"authorized","Authorized" +"gateway_rejected","Gateway rejected" +"failed","Failed" +"processor_declined","Processor declined" +"settled","Settled" +"settling","Settling" +"submitted_for_settlement","Submitted for settlement" +"voided","Voided" +"unrecognized","Unrecognized" +"settlement_declined","Settlement declined" +"settlement_pending","Settlement pending" +"settlement_confirmed","Settlement confirmed" +"paypal_account","Paypal account" +"coinbase_account","Coinbase account" +"europe_bank_accout","Europe bank account" +"credit_card","Credit card" +"apple_pay_card","Apple pay card" +"android_pay_card","Android pay card" \ No newline at end of file From 06af850348f2fd8437af7438ebf2c6fc6322860c Mon Sep 17 00:00:00 2001 From: Ievgen Sentiabov Date: Tue, 14 Jun 2016 14:58:36 +0300 Subject: [PATCH 42/67] MAGETWO-54209: Can't create shipping label with more than 1 product - Updated process packages function related to non exists shipping items in DOM tree --- .../view/adminhtml/web/order/packaging.js | 37 +++++++++++-------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/app/code/Magento/Shipping/view/adminhtml/web/order/packaging.js b/app/code/Magento/Shipping/view/adminhtml/web/order/packaging.js index 2ad2ff596a707..b3a7ea2e24956 100644 --- a/app/code/Magento/Shipping/view/adminhtml/web/order/packaging.js +++ b/app/code/Magento/Shipping/view/adminhtml/web/order/packaging.js @@ -353,7 +353,7 @@ Packaging.prototype = { var response = transport.responseText; if (response) { packagePrapareGrid.update(response); - this._processPackagePrapare(packagePrapareGrid); + this.processPackagePrepare(packagePrapareGrid); if (packagePrapareGrid.select('.grid tbody tr').length) { packageBlock.select('[data-action=package-add-items]')[0].hide(); packageBlock.select('[data-action=package-save-items]')[0].show(); @@ -692,22 +692,27 @@ Packaging.prototype = { } }, - _processPackagePrapare: function(packagePrapare) { - var itemsAll = []; - packagePrapare.select('.grid tbody tr').each(function(item) { - var qty = item.select('[name="qty"]')[0]; - var itemId = item.select('[type="checkbox"]')[0].value; - var qtyValue = 0; + processPackagePrepare: function(packagePrepare) { + var itemsAll = [], + qty, + itemId, + qtyValue = 0, + value = 1; + + packagePrepare.select('.grid tbody tr').each(function(item) { + qty = item.select('[name="qty"]')[0], + itemId = item.select('[type="checkbox"]')[0].value, + qtyValue = parseFloat(qty.value); + if (Object.isFunction(this.itemQtyCallback)) { - var value = this.itemQtyCallback(itemId); - qtyValue = ((typeof value == 'string') && (value.length == 0)) ? 0 : parseFloat(value); - if (isNaN(qtyValue) || qtyValue < 0) { - qtyValue = 1; + value = this.itemQtyCallback(itemId); + if (typeof value !== 'undefined') { + qtyValue = parseFloat(value); + qtyValue = this.validateItemQty(itemId, qtyValue); + qty.value = qtyValue; } - qtyValue = this.validateItemQty(itemId, qtyValue); - qty.value = qtyValue; } else { - var value = item.select('[name="qty"]')[0].value; + value = item.select('[name="qty"]')[0].value; qtyValue = ((typeof value == 'string') && (value.length == 0)) ? 0 : parseFloat(value); if (isNaN(qtyValue) || qtyValue < 0) { qtyValue = 1; @@ -737,10 +742,10 @@ Packaging.prototype = { this.itemsAll = itemsAll; } - packagePrapare.select('tbody input[type="checkbox"]').each(function(item){ + packagePrepare.select('tbody input[type="checkbox"]').each(function(item){ $(item).observe('change', this._observeQty); this._observeQty.call(item); - }.bind(this)) + }.bind(this)); }, _observeQty: function() { From b31e3ffa597059cf110d0822233af9634494c312 Mon Sep 17 00:00:00 2001 From: Roman Liukshyn Date: Tue, 14 Jun 2016 15:27:53 +0300 Subject: [PATCH 43/67] MAGETWO-54193: No Payment Type filter in Braintree Settlement report - Fixed unit test --- .../Unit/Model/Report/TransactionMapTest.php | 47 ++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Braintree/Test/Unit/Model/Report/TransactionMapTest.php b/app/code/Magento/Braintree/Test/Unit/Model/Report/TransactionMapTest.php index c44a67b2c61d9..9a1a76b80b8c5 100644 --- a/app/code/Magento/Braintree/Test/Unit/Model/Report/TransactionMapTest.php +++ b/app/code/Magento/Braintree/Test/Unit/Model/Report/TransactionMapTest.php @@ -11,6 +11,7 @@ use Magento\Braintree\Model\Report\Row\TransactionMap; use Magento\Framework\Api\AttributeValue; use Magento\Framework\Api\AttributeValueFactory; +use Magento\Framework\Phrase; use Magento\Store\Model\StoreManagerInterface; /** @@ -30,6 +31,11 @@ class TransactionMapTest extends \PHPUnit_Framework_TestCase */ private $attributeValueFactoryMock; + /** + * @var \Magento\Framework\Phrase\RendererInterface|\PHPUnit_Framework_MockObject_MockObject + */ + private $rendererMock; + /** * Setup */ @@ -39,6 +45,8 @@ protected function setUp() ->setMethods(['create']) ->disableOriginalConstructor() ->getMock(); + $this->rendererMock = $this->getMockBuilder('Magento\Framework\Phrase\RendererInterface') + ->getMock(); } /** @@ -65,6 +73,8 @@ public function testGetCustomAttributes($transaction) $this->transactionStub ); + Phrase::setRenderer($this->rendererMock); + /** @var AttributeValue[] $result */ $result = $map->getCustomAttributes(); @@ -77,6 +87,31 @@ public function testGetCustomAttributes($transaction) $result[6]->getValue() ); $this->assertEquals(implode(', ', $transaction['refundIds']), $result[11]->getValue()); + $this->assertEquals($transaction['merchantAccountId'], $result[1]->getValue()); + $this->assertEquals($transaction['orderId'], $result[2]->getValue()); + $this->assertEquals($transaction['amount'], $result[7]->getValue()); + $this->assertEquals($transaction['processorSettlementResponseCode'], $result[8]->getValue()); + $this->assertEquals($transaction['processorSettlementResponseText'], $result[10]->getValue()); + $this->assertEquals($transaction['settlementBatchId'], $result[12]->getValue()); + $this->assertEquals($transaction['currencyIsoCode'], $result[13]->getValue()); + + $this->rendererMock->expects($this->at(0)) + ->method('render') + ->with([$transaction['paymentInstrumentType']]) + ->willReturn('Credit card'); + $this->assertEquals('Credit card', $result[3]->getValue()->render()); + + $this->rendererMock->expects($this->at(0)) + ->method('render') + ->with([$transaction['type']]) + ->willReturn('Sale'); + $this->assertEquals('Sale', $result[5]->getValue()->render()); + + $this->rendererMock->expects($this->at(0)) + ->method('render') + ->with([$transaction['status']]) + ->willReturn('Pending for settlement'); + $this->assertEquals('Pending for settlement', $result[9]->getValue()->render()); } /** @@ -90,7 +125,17 @@ public function getConfigDataProvider() 'id' => 1, 'createdAt' => new \DateTime(), 'paypalDetails' => new PayPalDetails(['paymentId' => 10]), - 'refundIds' => [1, 2, 3, 4, 5] + 'refundIds' => [1, 2, 3, 4, 5], + 'merchantAccountId' => 'MerchantId', + 'orderId' => 1, + 'paymentInstrumentType' => 'credit_card', + 'type' => 'sale', + 'amount' => '$19.99', + 'processorSettlementResponseCode' => 1, + 'status' => 'pending_for_settlement', + 'processorSettlementResponseText' => 'sample text', + 'settlementBatchId' => 2, + 'currencyIsoCode' => 'USD' ] ] ]; From 326be14030ac42bed670428f16e967cb41d6ff8d Mon Sep 17 00:00:00 2001 From: "Shmyheliuk, Oleksandr" Date: Wed, 15 Jun 2016 12:48:26 +0300 Subject: [PATCH 44/67] MAGETWO-53182: 'Ship to Specific Countries' is enabled with checked 'Use Default' settings for Table Rates shipping method --- .../templates/system/shipping/applicable_country.phtml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/app/code/Magento/Backend/view/adminhtml/templates/system/shipping/applicable_country.phtml b/app/code/Magento/Backend/view/adminhtml/templates/system/shipping/applicable_country.phtml index b8f4bfb8f7e73..6d003c6cb6810 100644 --- a/app/code/Magento/Backend/view/adminhtml/templates/system/shipping/applicable_country.phtml +++ b/app/code/Magento/Backend/view/adminhtml/templates/system/shipping/applicable_country.phtml @@ -37,13 +37,9 @@ CountryModel.prototype = { var showMethodElement = $(applyCountryElement.id.replace(/sallowspecific/, 'showmethod')); //var specifErrMsgElement = $(applyCountryElement.id.replace(/sallowspecific/, 'specificerrmsg')); if (specifCountryElement) { - if (applyCountryElement.value == 1) { - - var specifCountryUseDefaultElement = $(applyCountryElement.id + '_inherit'); - //if specific country element selected and use default checkbox not checked - if (!specifCountryUseDefaultElement || !specifCountryUseDefaultElement.checked) { - specifCountryElement.enable(); - } + if (applyCountryElement.value == 1 && !specifCountryElement.hasAttribute('disabled')) { + //if specific country element selected + specifCountryElement.enable(); if (showMethodElement) { this.showElement(showMethodElement.up(1)); } From 3ff19bf82a2ff2e4b7c3e9223cb53083fb60c72d Mon Sep 17 00:00:00 2001 From: Bohdan Korablov Date: Thu, 16 Jun 2016 13:29:34 +0300 Subject: [PATCH 45/67] MAGETWO-54243: [Github] Directive values are not quote-escaped #3860 --- .../Block/Product/Widget/Conditions.php | 9 +- .../Block/Product/Widget/ConditionsTest.php | 178 ++++++++++++++ .../Adminhtml/Widget/LoadOptions.php | 25 ++ app/code/Magento/Widget/Model/Widget.php | 2 +- .../Adminhtml/Widget/LoadOptionsTest.php | 218 ++++++++++++++++++ .../Widget/Test/Unit/Model/WidgetTest.php | 6 +- 6 files changed, 433 insertions(+), 5 deletions(-) create mode 100644 app/code/Magento/CatalogWidget/Test/Unit/Block/Product/Widget/ConditionsTest.php create mode 100644 app/code/Magento/Widget/Test/Unit/Controller/Adminhtml/Widget/LoadOptionsTest.php diff --git a/app/code/Magento/CatalogWidget/Block/Product/Widget/Conditions.php b/app/code/Magento/CatalogWidget/Block/Product/Widget/Conditions.php index 2f74786733794..4af634c2d04a6 100644 --- a/app/code/Magento/CatalogWidget/Block/Product/Widget/Conditions.php +++ b/app/code/Magento/CatalogWidget/Block/Product/Widget/Conditions.php @@ -84,9 +84,12 @@ protected function _construct() $widget = $this->registry->registry('current_widget_instance'); if ($widget) { $widgetParameters = $widget->getWidgetParameters(); - if (isset($widgetParameters['conditions'])) { - $this->rule->loadPost($widgetParameters); - } + } elseif($widgetOptions = $this->getLayout()->getBlock('wysiwyg_widget.options')) { + $widgetParameters = $widgetOptions->getWidgetValues(); + } + + if (isset($widgetParameters['conditions'])) { + $this->rule->loadPost($widgetParameters); } } diff --git a/app/code/Magento/CatalogWidget/Test/Unit/Block/Product/Widget/ConditionsTest.php b/app/code/Magento/CatalogWidget/Test/Unit/Block/Product/Widget/ConditionsTest.php new file mode 100644 index 0000000000000..8d87c0ebf0d21 --- /dev/null +++ b/app/code/Magento/CatalogWidget/Test/Unit/Block/Product/Widget/ConditionsTest.php @@ -0,0 +1,178 @@ +objectManagerHelper = new ObjectManagerHelper($this); + $this->ruleMock = $this->getMockBuilder(Rule::class) + ->disableOriginalConstructor() + ->getMock(); + $this->registryMock = $this->getMockBuilder(Registry::class) + ->disableOriginalConstructor() + ->getMock(); + $this->layoutMock = $this->getMockForAbstractClass(LayoutInterface::class); + $this->blockMock = $this->getMockBuilder(BlockInterface::class) + ->setMethods(['getWidgetValues']) + ->getMockForAbstractClass(); + $this->contextMock = $this->getMockBuilder(Context::class) + ->disableOriginalConstructor() + ->getMock(); + $this->contextMock->expects($this->once()) + ->method('getLayout') + ->willReturn($this->layoutMock); + } + + /** + * @return void + */ + public function testConstructWithEmptyData() + { + $this->registryMock->expects($this->once()) + ->method('registry') + ->with('current_widget_instance') + ->willReturn(null); + $this->layoutMock->expects($this->once()) + ->method('getBlock') + ->with('wysiwyg_widget.options') + ->willReturn(null); + $this->blockMock->expects($this->never()) + ->method('getWidgetValues'); + $this->ruleMock->expects($this->never()) + ->method('loadPost'); + + $this->objectManagerHelper->getObject( + Conditions::class, + [ + 'context' => $this->contextMock, + 'registry' => $this->registryMock, + 'rule' => $this->ruleMock, + ] + ); + } + + /** + * @return void + */ + public function testConstructWithWidgetInstance() + { + $widgetParams = ['conditions' => 'some conditions']; + + /** @var \Magento\Widget\Model\Widget\Instance|\PHPUnit_Framework_MockObject_MockObject $widgetMock */ + $widgetMock = $this->getMockBuilder(\Magento\Widget\Model\Widget\Instance::class) + ->disableOriginalConstructor() + ->getMock(); + $widgetMock->expects($this->once()) + ->method('getWidgetParameters') + ->willReturn($widgetParams); + + $this->layoutMock->expects($this->never()) + ->method('getBlock'); + $this->blockMock->expects($this->never()) + ->method('getWidgetValues'); + $this->registryMock->expects($this->once()) + ->method('registry') + ->with('current_widget_instance') + ->willReturn($widgetMock); + $this->ruleMock->expects($this->once()) + ->method('loadPost') + ->with($widgetParams) + ->willReturnSelf(); + + $this->objectManagerHelper->getObject( + Conditions::class, + [ + 'context' => $this->contextMock, + 'registry' => $this->registryMock, + 'rule' => $this->ruleMock, + ] + ); + } + + /** + * @return void + */ + public function testConstructWithParamsFromBlock() + { + $widgetParams = ['conditions' => 'some conditions']; + + $this->registryMock->expects($this->once()) + ->method('registry') + ->with('current_widget_instance') + ->willReturn(null); + $this->layoutMock->expects($this->once()) + ->method('getBlock') + ->with('wysiwyg_widget.options') + ->willReturn($this->blockMock); + $this->blockMock->expects($this->once()) + ->method('getWidgetValues') + ->willReturn($widgetParams); + $this->ruleMock->expects($this->once()) + ->method('loadPost') + ->with($widgetParams) + ->willReturnSelf(); + + $this->objectManagerHelper->getObject( + Conditions::class, + [ + 'context' => $this->contextMock, + 'registry' => $this->registryMock, + 'rule' => $this->ruleMock, + ] + ); + } +} diff --git a/app/code/Magento/Widget/Controller/Adminhtml/Widget/LoadOptions.php b/app/code/Magento/Widget/Controller/Adminhtml/Widget/LoadOptions.php index 2919b95b468d1..d6318f53f48ab 100644 --- a/app/code/Magento/Widget/Controller/Adminhtml/Widget/LoadOptions.php +++ b/app/code/Magento/Widget/Controller/Adminhtml/Widget/LoadOptions.php @@ -6,8 +6,15 @@ */ namespace Magento\Widget\Controller\Adminhtml\Widget; +use Magento\Framework\App\ObjectManager; + class LoadOptions extends \Magento\Backend\App\Action { + /** + * @var \Magento\Widget\Helper\Conditions + */ + private $conditionsHelper; + /** * Ajax responder for loading plugin options form * @@ -25,6 +32,11 @@ public function execute() $optionsBlock->setWidgetType($request['widget_type']); } if (isset($request['values'])) { + $request['values'] = array_map('htmlspecialchars_decode', $request['values']); + if (isset($request['values']['conditions_encoded'])) { + $request['values']['conditions'] = + $this->getConditionsHelper()->decode($request['values']['conditions_encoded']); + } $optionsBlock->setWidgetValues($request['values']); } } @@ -37,4 +49,17 @@ public function execute() ); } } + + /** + * @return \Magento\Widget\Helper\Conditions + * @deprecated + */ + private function getConditionsHelper() + { + if (!$this->conditionsHelper) { + $this->conditionsHelper = ObjectManager::getInstance()->get('\Magento\Widget\Helper\Conditions'); + } + + return $this->conditionsHelper; + } } diff --git a/app/code/Magento/Widget/Model/Widget.php b/app/code/Magento/Widget/Model/Widget.php index 2235df9aff077..15ac01297b411 100644 --- a/app/code/Magento/Widget/Model/Widget.php +++ b/app/code/Magento/Widget/Model/Widget.php @@ -314,7 +314,7 @@ public function getWidgetDeclaration($type, $params = [], $asIs = true) } } if ($value) { - $directive .= sprintf(' %s="%s"', $name, $value); + $directive .= sprintf(' %s="%s"', $name, htmlspecialchars($value)); } } diff --git a/app/code/Magento/Widget/Test/Unit/Controller/Adminhtml/Widget/LoadOptionsTest.php b/app/code/Magento/Widget/Test/Unit/Controller/Adminhtml/Widget/LoadOptionsTest.php new file mode 100644 index 0000000000000..50946ed3f78dd --- /dev/null +++ b/app/code/Magento/Widget/Test/Unit/Controller/Adminhtml/Widget/LoadOptionsTest.php @@ -0,0 +1,218 @@ +objectManagerHelper = new ObjectManagerHelper($this); + $this->objectManagerMock = $this->getMockForAbstractClass(ObjectManagerInterface::class); + $this->viewMock = $this->getMockForAbstractClass(ViewInterface::class); + $this->requestMock = $this->getMockForAbstractClass(RequestInterface::class); + $this->responseMock = $this->getMockBuilder(ResponseInterface::class) + ->setMethods(['representJson']) + ->getMockForAbstractClass(); + $this->contextMock = $this->getMockBuilder(Context::class) + ->disableOriginalConstructor() + ->getMock(); + $this->contextMock->expects($this->once()) + ->method('getView') + ->willReturn($this->viewMock); + $this->contextMock->expects($this->once()) + ->method('getRequest') + ->willReturn($this->requestMock); + $this->contextMock->expects($this->once()) + ->method('getResponse') + ->willReturn($this->responseMock); + $this->contextMock->expects($this->once()) + ->method('getObjectManager') + ->willReturn($this->objectManagerMock); + $this->conditionsHelperMock = $this->getMockBuilder(ConditionsHelper::class) + ->disableOriginalConstructor() + ->getMock(); + + $this->loadOptions = $this->objectManagerHelper->getObject( + LoadOptions::class, + ['context' => $this->contextMock] + ); + $this->objectManagerHelper->setBackwardCompatibleProperty( + $this->loadOptions, + 'conditionsHelper', + $this->conditionsHelperMock + ); + } + + /** + * @return void + */ + public function dtestExecuteWithException() + { + $jsonResult = '{"error":true,"message":"Some error"}'; + $errorMessage = 'Some error'; + + /** @var \Magento\Framework\Json\Helper\Data|\PHPUnit_Framework_MockObject_MockObject $jsonDataHelperMock */ + $jsonDataHelperMock = $this->getMockBuilder('Magento\Framework\Json\Helper\Data') + ->disableOriginalConstructor() + ->getMock(); + $jsonDataHelperMock->expects($this->once()) + ->method('jsonEncode') + ->with(['error' => true, 'message' => $errorMessage]) + ->willReturn($jsonResult); + + $this->viewMock->expects($this->once()) + ->method('loadLayout') + ->willThrowException(new LocalizedException(__($errorMessage))); + $this->objectManagerMock->expects($this->once()) + ->method('get') + ->with('Magento\Framework\Json\Helper\Data') + ->willReturn($jsonDataHelperMock); + $this->responseMock->expects($this->once()) + ->method('representJson') + ->with($jsonResult) + ->willReturnArgument(0); + + $this->loadOptions->execute(); + } + + /** + * @return void + */ + public function testExecute() + { + $widgetType = 'Magento\SomeWidget'; + $conditionsEncoded = 'a:3:{s:5:"value";i:1;s:8:"operator";s:2:"==";s:9:"attribute";s:2:"id";}'; + $conditionsDecoded = [ + 'value' => 1, + 'operator' => '==', + 'attribute' => 'id', + ]; + $widgetJsonParams = '{"widget_type":"Magento\\Widget","values":{"title":""Test"", "":}}'; + $widgetArrayParams = [ + 'widget_type' => $widgetType, + 'values' => [ + 'title' => '"Test"', + 'conditions_encoded' => $conditionsEncoded, + ], + ]; + $resultWidgetArrayParams = [ + 'widget_type' => $widgetType, + 'values' => [ + 'title' => '"Test"', + 'conditions_encoded' => $conditionsEncoded, + 'conditions' => $conditionsDecoded, + ], + ]; + + /** @var \Magento\Framework\Json\Helper\Data|\PHPUnit_Framework_MockObject_MockObject $jsonDataHelperMock */ + $jsonDataHelperMock = $this->getMockBuilder('Magento\Framework\Json\Helper\Data') + ->disableOriginalConstructor() + ->getMock(); + $jsonDataHelperMock->expects($this->once()) + ->method('jsonDecode') + ->with($widgetJsonParams) + ->willReturn($widgetArrayParams); + + $this->viewMock->expects($this->once()) + ->method('loadLayout'); + $this->requestMock->expects($this->once()) + ->method('getParam') + ->with('widget') + ->willReturn($widgetJsonParams); + $this->objectManagerMock->expects($this->once()) + ->method('get') + ->with('Magento\Framework\Json\Helper\Data') + ->willReturn($jsonDataHelperMock); + + /** @var \Magento\Framework\View\Element\BlockInterface|\PHPUnit_Framework_MockObject_MockObject $blockMock */ + $blockMock = $this->getMockBuilder(\Magento\Framework\View\Element\BlockInterface::class) + ->setMethods(['setWidgetType', 'setWidgetValues']) + ->getMockForAbstractClass(); + $blockMock->expects($this->once()) + ->method('setWidgetType') + ->with($widgetType) + ->willReturnSelf(); + $blockMock->expects($this->once()) + ->method('setWidgetValues') + ->with($resultWidgetArrayParams['values']) + ->willReturnSelf(); + + /** @var \Magento\Framework\View\LayoutInterface|\PHPUnit_Framework_MockObject_MockObject $layoutMock */ + $layoutMock = $this->getMockForAbstractClass(\Magento\Framework\View\LayoutInterface::class); + $layoutMock->expects($this->once()) + ->method('getBlock') + ->with('wysiwyg_widget.options') + ->willReturn($blockMock); + + $this->conditionsHelperMock->expects($this->once()) + ->method('decode') + ->with($conditionsEncoded) + ->willReturn($conditionsDecoded); + $this->viewMock->expects($this->once()) + ->method('getLayout') + ->willReturn($layoutMock); + $this->viewMock->expects($this->once()) + ->method('renderLayout'); + + $this->loadOptions->execute(); + } +} diff --git a/app/code/Magento/Widget/Test/Unit/Model/WidgetTest.php b/app/code/Magento/Widget/Test/Unit/Model/WidgetTest.php index 2d03ac62c1563..508ff01a061f3 100644 --- a/app/code/Magento/Widget/Test/Unit/Model/WidgetTest.php +++ b/app/code/Magento/Widget/Test/Unit/Model/WidgetTest.php @@ -5,6 +5,9 @@ */ namespace Magento\Widget\Test\Unit\Model; +/** + * Test class for \Magento\Widget\Model\Widget + */ class WidgetTest extends \PHPUnit_Framework_TestCase { /** @@ -147,7 +150,7 @@ public function testGetWidgetDeclaration() ] ]; $params = [ - 'title' => 'my widget', + 'title' => 'my "widget"', 'show_pager' => '1', 'products_per_page' => '5', 'products_count' => '10', @@ -159,6 +162,7 @@ public function testGetWidgetDeclaration() ->willReturn('encoded-conditions-string'); $result = $this->widget->getWidgetDeclaration('Magento\CatalogWidget\Block\Product\ProductsList', $params); $this->assertContains('{{widget type="Magento\CatalogWidget\Block\Product\ProductsList"', $result); + $this->assertContains('title="my "widget""', $result); $this->assertContains('conditions_encoded="encoded-conditions-string"', $result); $this->assertContains('page_var_name="pasdf"}}', $result); } From c2fd296776e8ea83f349b453cfaf39126e12f276 Mon Sep 17 00:00:00 2001 From: Bohdan Korablov Date: Thu, 16 Jun 2016 13:32:31 +0300 Subject: [PATCH 46/67] MAGETWO-54243: [Github] Directive values are not quote-escaped #3860 --- .../Magento/CatalogWidget/Block/Product/Widget/Conditions.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/CatalogWidget/Block/Product/Widget/Conditions.php b/app/code/Magento/CatalogWidget/Block/Product/Widget/Conditions.php index 4af634c2d04a6..d57db33131b9d 100644 --- a/app/code/Magento/CatalogWidget/Block/Product/Widget/Conditions.php +++ b/app/code/Magento/CatalogWidget/Block/Product/Widget/Conditions.php @@ -81,6 +81,7 @@ public function __construct( */ protected function _construct() { + $widgetParameters = []; $widget = $this->registry->registry('current_widget_instance'); if ($widget) { $widgetParameters = $widget->getWidgetParameters(); From 0859c7d3e06fabf43d58139fd14350e4c7ce2de2 Mon Sep 17 00:00:00 2001 From: Bohdan Korablov Date: Fri, 17 Jun 2016 13:21:45 +0300 Subject: [PATCH 47/67] MAGETWO-54243: [Github] Directive values are not quote-escaped #3860 --- .../Adminhtml/Widget/LoadOptions.php | 7 +++-- app/code/Magento/Widget/Model/Widget.php | 2 +- .../Widget/Test/Unit/Model/WidgetTest.php | 31 ++++++++++++++++--- 3 files changed, 32 insertions(+), 8 deletions(-) diff --git a/app/code/Magento/Widget/Controller/Adminhtml/Widget/LoadOptions.php b/app/code/Magento/Widget/Controller/Adminhtml/Widget/LoadOptions.php index d6318f53f48ab..32345946c90e6 100644 --- a/app/code/Magento/Widget/Controller/Adminhtml/Widget/LoadOptions.php +++ b/app/code/Magento/Widget/Controller/Adminhtml/Widget/LoadOptions.php @@ -25,7 +25,8 @@ public function execute() try { $this->_view->loadLayout(); if ($paramsJson = $this->getRequest()->getParam('widget')) { - $request = $this->_objectManager->get('Magento\Framework\Json\Helper\Data')->jsonDecode($paramsJson); + $request = $this->_objectManager->get(\Magento\Framework\Json\Helper\Data::class) + ->jsonDecode($paramsJson); if (is_array($request)) { $optionsBlock = $this->_view->getLayout()->getBlock('wysiwyg_widget.options'); if (isset($request['widget_type'])) { @@ -45,7 +46,7 @@ public function execute() } catch (\Magento\Framework\Exception\LocalizedException $e) { $result = ['error' => true, 'message' => $e->getMessage()]; $this->getResponse()->representJson( - $this->_objectManager->get('Magento\Framework\Json\Helper\Data')->jsonEncode($result) + $this->_objectManager->get(\Magento\Framework\Json\Helper\Data::class)->jsonEncode($result) ); } } @@ -57,7 +58,7 @@ public function execute() private function getConditionsHelper() { if (!$this->conditionsHelper) { - $this->conditionsHelper = ObjectManager::getInstance()->get('\Magento\Widget\Helper\Conditions'); + $this->conditionsHelper = ObjectManager::getInstance()->get(\Magento\Widget\Helper\Conditions::class); } return $this->conditionsHelper; diff --git a/app/code/Magento/Widget/Model/Widget.php b/app/code/Magento/Widget/Model/Widget.php index 15ac01297b411..015db33aeee1f 100644 --- a/app/code/Magento/Widget/Model/Widget.php +++ b/app/code/Magento/Widget/Model/Widget.php @@ -314,7 +314,7 @@ public function getWidgetDeclaration($type, $params = [], $asIs = true) } } if ($value) { - $directive .= sprintf(' %s="%s"', $name, htmlspecialchars($value)); + $directive .= sprintf(' %s="%s"', $name, $this->escaper->escapeQuote($value)); } } diff --git a/app/code/Magento/Widget/Test/Unit/Model/WidgetTest.php b/app/code/Magento/Widget/Test/Unit/Model/WidgetTest.php index 508ff01a061f3..c7c75f038dc6f 100644 --- a/app/code/Magento/Widget/Test/Unit/Model/WidgetTest.php +++ b/app/code/Magento/Widget/Test/Unit/Model/WidgetTest.php @@ -15,6 +15,11 @@ class WidgetTest extends \PHPUnit_Framework_TestCase */ protected $dataStorageMock; + /** + * @var \Magento\Framework\Escaper|\PHPUnit_Framework_MockObject_MockObject + */ + private $escaperMock; + /** * @var \Magento\Widget\Model\Widget */ @@ -27,17 +32,24 @@ class WidgetTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->dataStorageMock = $this->getMockBuilder('Magento\Widget\Model\Config\Data') + $this->dataStorageMock = $this->getMockBuilder(\Magento\Widget\Model\Config\Data::class) ->disableOriginalConstructor() ->getMock(); - $this->conditionsHelper = $this->getMockBuilder('\Magento\Widget\Helper\Conditions') + $this->conditionsHelper = $this->getMockBuilder(\Magento\Widget\Helper\Conditions::class) ->setMethods(['encode']) ->disableOriginalConstructor() ->getMock(); + $this->escaperMock = $this->getMockBuilder(\Magento\Framework\Escaper::class) + ->disableOriginalConstructor() + ->getMock(); $objectManagerHelper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); $this->widget = $objectManagerHelper->getObject( - 'Magento\Widget\Model\Widget', - ['dataStorage' => $this->dataStorageMock, 'conditionsHelper' => $this->conditionsHelper] + \Magento\Widget\Model\Widget::class, + [ + 'dataStorage' => $this->dataStorageMock, + 'conditionsHelper' => $this->conditionsHelper, + 'escaper' => $this->escaperMock, + ] ); } @@ -160,6 +172,17 @@ public function testGetWidgetDeclaration() $this->conditionsHelper->expects($this->once())->method('encode')->with($conditions) ->willReturn('encoded-conditions-string'); + $this->escaperMock->expects($this->atLeastOnce()) + ->method('escapeQuote') + ->willReturnMap([ + ['my "widget"', false, 'my "widget"'], + ['1', false, '1'], + ['5', false, '5'], + ['10', false, '10'], + ['product/widget/content/grid.phtml', false, 'product/widget/content/grid.phtml'], + ['encoded-conditions-string', false, 'encoded-conditions-string'], + ]); + $result = $this->widget->getWidgetDeclaration('Magento\CatalogWidget\Block\Product\ProductsList', $params); $this->assertContains('{{widget type="Magento\CatalogWidget\Block\Product\ProductsList"', $result); $this->assertContains('title="my "widget""', $result); From 916acb2a81dbdcf073b28a2c0674f41c2c21f421 Mon Sep 17 00:00:00 2001 From: Olga Lytvynenko Date: Fri, 17 Jun 2016 16:30:11 +0300 Subject: [PATCH 48/67] MAGETWO-54501: Incorrect position of the calendar button in the widget conditions --- app/design/adminhtml/Magento/backend/web/css/styles-old.less | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/design/adminhtml/Magento/backend/web/css/styles-old.less b/app/design/adminhtml/Magento/backend/web/css/styles-old.less index 7cc131998b768..814e27e7115c3 100644 --- a/app/design/adminhtml/Magento/backend/web/css/styles-old.less +++ b/app/design/adminhtml/Magento/backend/web/css/styles-old.less @@ -3793,6 +3793,10 @@ border-left: none !important; } + .rule-tree ._has-datepicker + .ui-datepicker-trigger { + position: static; + } + .rule-param .label { color: #000; float: none; From 6a319abf1ce442d6eec34d4541b8317ffad9a824 Mon Sep 17 00:00:00 2001 From: Olga Lytvynenko Date: Fri, 17 Jun 2016 16:55:39 +0300 Subject: [PATCH 49/67] MAGETWO-54501: Incorrect position of the calendar button in the widget conditions --- .../adminhtml/Magento/backend/web/css/styles-old.less | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/design/adminhtml/Magento/backend/web/css/styles-old.less b/app/design/adminhtml/Magento/backend/web/css/styles-old.less index 814e27e7115c3..0a16c41d2ed7c 100644 --- a/app/design/adminhtml/Magento/backend/web/css/styles-old.less +++ b/app/design/adminhtml/Magento/backend/web/css/styles-old.less @@ -3793,8 +3793,12 @@ border-left: none !important; } - .rule-tree ._has-datepicker + .ui-datepicker-trigger { - position: static; + .rule-tree { + ._has-datepicker { + & + .ui-datepicker-trigger { + position: static; + } + } } .rule-param .label { From 1d97b181664952cb1bd2a8eaeaef080ad1cc6f3f Mon Sep 17 00:00:00 2001 From: Olga Lytvynenko Date: Fri, 17 Jun 2016 17:38:54 +0300 Subject: [PATCH 50/67] MAGETWO-54501: Incorrect position of the calendar button in the widget conditions --- app/design/adminhtml/Magento/backend/web/css/styles-old.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/design/adminhtml/Magento/backend/web/css/styles-old.less b/app/design/adminhtml/Magento/backend/web/css/styles-old.less index 0a16c41d2ed7c..bb568e183d336 100644 --- a/app/design/adminhtml/Magento/backend/web/css/styles-old.less +++ b/app/design/adminhtml/Magento/backend/web/css/styles-old.less @@ -3795,7 +3795,7 @@ .rule-tree { ._has-datepicker { - & + .ui-datepicker-trigger { + + .ui-datepicker-trigger { position: static; } } From 55f962f3d62549875ca2cd53ade698d5fa5f2c38 Mon Sep 17 00:00:00 2001 From: Elena Marchenko Date: Wed, 22 Jun 2016 13:59:58 +0300 Subject: [PATCH 51/67] MAGETWO-50538: Add test for Authorize.net to Functional 3rd Party Tests plan --- .../Test/TestCase/OnePageCheckoutTest.xml | 1 - .../Constraint/AssertTransactionDetails.php | 69 ------------------- .../tests/app/Magento/Sales/Test/etc/di.xml | 5 -- 3 files changed, 75 deletions(-) delete mode 100644 dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertTransactionDetails.php diff --git a/dev/tests/functional/tests/app/Magento/Authorizenet/Test/TestCase/OnePageCheckoutTest.xml b/dev/tests/functional/tests/app/Magento/Authorizenet/Test/TestCase/OnePageCheckoutTest.xml index 57763d8b6363f..c8cbd35427d28 100644 --- a/dev/tests/functional/tests/app/Magento/Authorizenet/Test/TestCase/OnePageCheckoutTest.xml +++ b/dev/tests/functional/tests/app/Magento/Authorizenet/Test/TestCase/OnePageCheckoutTest.xml @@ -27,7 +27,6 @@ Authorization test_type:3rd_party_test - diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertTransactionDetails.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertTransactionDetails.php deleted file mode 100644 index f793d57df1108..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertTransactionDetails.php +++ /dev/null @@ -1,69 +0,0 @@ -open(); - $salesOrder->getSalesOrderGrid()->searchAndOpen(['id' => $orderId]); - $comment = $salesOrderView->getOrderHistoryBlock()->getCommentsHistory(); - preg_match('/(ID: ")(\w+-*\w+)(")/', $comment, $matches); - if (!empty($matches[2])) { - $transactionId = $matches[2]; - } - \PHPUnit_Framework_Assert::assertNotEmpty($transactionId); - $orderForm = $salesOrderView->getOrderForm()->openTab('transactions'); - /** @var Grid $grid */ - $grid = $orderForm->getTab('transactions')->getGridBlock(); - $actualTxnIds = $grid->getIds(); - \PHPUnit_Framework_Assert::assertEquals( - $transactionDetails, - $actualTxnIds[$transactionId], - 'Incorrect transaction details for the order #' . $orderId - ); - } - - /** - * Returns string representation of successful assertion. - * - * @return string - */ - public function toString() - { - return "Message about transaction details are present in Transactions tab."; - } -} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/etc/di.xml b/dev/tests/functional/tests/app/Magento/Sales/Test/etc/di.xml index 9a8f26a0505ba..ea687be19d3c3 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/etc/di.xml +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/etc/di.xml @@ -36,9 +36,4 @@ high - - - high - - From 11ccbf88afb836901e3339093dd65737b6833e58 Mon Sep 17 00:00:00 2001 From: Viktor Tymchynskyi Date: Wed, 22 Jun 2016 17:22:37 +0300 Subject: [PATCH 52/67] MAGETWO-54192: Filtration by Created At in Braintree Settlement report - Convert date ranges for braintree reports to ISO8601 date format - Round date ranges to minutes --- .../Report/TransactionsCollectionTest.php | 38 +++ .../Report/Filters/Type/DateRangeTest.php | 251 ++++++++++++++++++ .../Report/Filters/Type/DateRange.php | 19 ++ .../ui_component/braintree_report.xml | 17 +- .../Ui/Component/Filters/Type/Date.php | 9 +- .../Unit/Component/Filters/Type/DateTest.php | 208 +++++++++------ 6 files changed, 465 insertions(+), 77 deletions(-) create mode 100644 app/code/Magento/Braintree/Test/Unit/Ui/Component/Report/Filters/Type/DateRangeTest.php create mode 100644 app/code/Magento/Braintree/Ui/Component/Report/Filters/Type/DateRange.php diff --git a/app/code/Magento/Braintree/Test/Unit/Model/Report/TransactionsCollectionTest.php b/app/code/Magento/Braintree/Test/Unit/Model/Report/TransactionsCollectionTest.php index 50488df2600c6..6024141280a02 100644 --- a/app/code/Magento/Braintree/Test/Unit/Model/Report/TransactionsCollectionTest.php +++ b/app/code/Magento/Braintree/Test/Unit/Model/Report/TransactionsCollectionTest.php @@ -184,4 +184,42 @@ public function testGetItemsWithNullLimit() $this->assertEquals(TransactionsCollection::TRANSACTION_MAXIMUM_COUNT, count($items)); $this->assertInstanceOf(DocumentInterface::class, $items[1]); } + + /** + * Add fields to filter + * + * @dataProvider addToFilterDataProvider + */ + public function testAddToFilter($field, $condition, $filterMapperCall, $expectedCondition) + { + $this->filterMapperMock->expects(static::exactly($filterMapperCall)) + ->method('getFilter') + ->with($field, $expectedCondition) + ->willReturn(new BraintreeSearchNodeStub()); + + $collection = new TransactionsCollection( + $this->entityFactoryMock, + $this->braintreeAdapterMock, + $this->filterMapperMock + ); + + static::assertInstanceOf( + TransactionsCollection::class, + $collection->addFieldToFilter($field, $condition) + ); + } + + /** + * addToFilter DataProvider + * + * @return array + */ + public function addToFilterDataProvider() + { + return [ + ['orderId', ['like' => 1], 1, ['like' => 1]], + ['type', 'sale', 1, ['eq' => 'sale']], + [['type', 'orderId'], [], 0, []], + ]; + } } diff --git a/app/code/Magento/Braintree/Test/Unit/Ui/Component/Report/Filters/Type/DateRangeTest.php b/app/code/Magento/Braintree/Test/Unit/Ui/Component/Report/Filters/Type/DateRangeTest.php new file mode 100644 index 0000000000000..b81dbe2fb036f --- /dev/null +++ b/app/code/Magento/Braintree/Test/Unit/Ui/Component/Report/Filters/Type/DateRangeTest.php @@ -0,0 +1,251 @@ +contextMock = $this->getMockForAbstractClass(ContextInterface::class); + $processor = $this->getMockBuilder(\Magento\Framework\View\Element\UiComponent\Processor::class) + ->disableOriginalConstructor() + ->getMock(); + $this->contextMock->expects(static::any()) + ->method('getProcessor') + ->willReturn($processor); + $this->uiComponentFactory = $this->getMockBuilder(UiComponentFactory::class) + ->setMethods(['create']) + ->disableOriginalConstructor() + ->getMock(); + $this->filterBuilderMock = $this->getMockBuilder(FilterBuilder::class) + ->disableOriginalConstructor() + ->getMock(); + + $this->filterModifierMock = $this->getMockBuilder(FilterModifier::class) + ->setMethods(['applyFilterModifier']) + ->disableOriginalConstructor() + ->getMock(); + + $this->dataProviderMock = $this->getMockForAbstractClass(DataProviderInterface::class); + } + + /** + * Run test prepare method + * + * @param string $name + * @param array $filterData + * @param array|null $expectedCondition + * @dataProvider getPrepareDataProvider + * @return void + */ + public function testPrepare($name, $filterData, $expectedCondition) + { + /** @var FormDate PHPUnit_Framework_MockObject_MockObject|$uiComponent */ + $uiComponent = $this->getMockBuilder(FormDate::class) + ->disableOriginalConstructor() + ->getMock(); + + $uiComponent->expects($this->any()) + ->method('getContext') + ->willReturn($this->contextMock); + + $this->contextMock->expects($this->any()) + ->method('getNamespace') + ->willReturn(DateRange::NAME); + $this->contextMock->expects($this->any()) + ->method('addComponentDefinition') + ->with(DateRange::NAME, ['extends' => DateRange::NAME]); + + $this->contextMock->expects($this->any()) + ->method('getFiltersParams') + ->willReturn($filterData); + + $this->contextMock->expects($this->any()) + ->method('getDataProvider') + ->willReturn($this->dataProviderMock); + + if ($expectedCondition !== null) { + if (is_string($filterData[$name])) { + $uiComponent->expects(static::once()) + ->method('convertDate') + ->with($filterData[$name]) + ->willReturn(new \DateTime($filterData[$name], new \DateTimeZone('UTC'))); + } else { + $uiComponent->method('convertDate') + ->willReturnMap([ + [ + $filterData[$name]['from'], 0, 0, 0, + new \DateTime($filterData[$name]['from'], new \DateTimeZone('UTC')) + ], + [ + $filterData[$name]['to'], 23, 59, 59, + new \DateTime($filterData[$name]['to'] . ' 23:59:00', new \DateTimeZone('UTC')) + ], + ]); + } + + $i=0; + switch (true) { + case is_string($filterData[$name]): + case isset($filterData[$name]['from']) && !isset($filterData[$name]['to']): + case !isset($filterData[$name]['from']) && isset($filterData[$name]['to']): + $filterMock = $this->getFilterMock( + $name, + $expectedCondition['type'], + $expectedCondition['date'], + $i + ); + $this->dataProviderMock->expects(static::once()) + ->method('addFilter') + ->with($filterMock); + break; + case isset($filterData[$name]['from']) && isset($filterData[$name]['to']): + $this->getFilterMock( + $name, + $expectedCondition['type_from'], + $expectedCondition['date_from'], + $i + ); + $filterMock = $this->getFilterMock( + $name, + $expectedCondition['type_to'], + $expectedCondition['date_to'], + $i + ); + $this->dataProviderMock->expects(static::exactly(2)) + ->method('addFilter') + ->with($filterMock); + break; + } + } + + $this->uiComponentFactory->expects($this->any()) + ->method('create') + ->with($name, DateRange::COMPONENT, ['context' => $this->contextMock]) + ->willReturn($uiComponent); + + $date = new DateRange( + $this->contextMock, + $this->uiComponentFactory, + $this->filterBuilderMock, + $this->filterModifierMock, + [], + ['name' => $name] + ); + $date->prepare(); + } + + /** + * Gets Filter mock + * + * @param string $name + * @param string $expectedType + * @param string $expectedDate + * @param int $i + * + * @return Filter|\PHPUnit_Framework_MockObject_MockObject + */ + private function getFilterMock($name, $expectedType, $expectedDate, &$i) + { + $this->filterBuilderMock->expects(static::at($i++)) + ->method('setConditionType') + ->with($expectedType) + ->willReturnSelf(); + $this->filterBuilderMock->expects(static::at($i++)) + ->method('setField') + ->with($name) + ->willReturnSelf(); + $this->filterBuilderMock->expects(static::at($i++)) + ->method('setValue') + ->with($expectedDate) + ->willReturnSelf(); + + $filterMock = $this->getMock(Filter::class); + $this->filterBuilderMock->expects(static::at($i++)) + ->method('create') + ->willReturn($filterMock); + + return $filterMock; + } + + /** + * @return array + */ + public function getPrepareDataProvider() + { + return [ + [ + 'test_date', + ['test_date' => ['from' => '11-05-2015', 'to' => null]], + ['date' => '2015-05-11T00:00:00+0000', 'type' => 'gteq'], + ], + [ + 'test_date', + ['test_date' => ['from' => null, 'to' => '11-05-2015']], + ['date' => '2015-05-11T23:59:00+0000', 'type' => 'lteq'], + ], + [ + 'test_date', + ['test_date' => ['from' => '11-05-2015', 'to' => '11-05-2015']], + [ + 'date_from' => '2015-05-11T00:00:00+0000', 'type_from' => 'gteq', + 'date_to' => '2015-05-11T23:59:00+0000', 'type_to' => 'lteq' + ], + ], + [ + 'test_date', + ['test_date' => '11-05-2015'], + ['date' => '2015-05-11T00:00:00+0000', 'type' => 'eq'], + ], + [ + 'test_date', + ['test_date' => ['from' => '', 'to' => '']], + null, + ] + ]; + } +} diff --git a/app/code/Magento/Braintree/Ui/Component/Report/Filters/Type/DateRange.php b/app/code/Magento/Braintree/Ui/Component/Report/Filters/Type/DateRange.php new file mode 100644 index 0000000000000..adbb3b78cb663 --- /dev/null +++ b/app/code/Magento/Braintree/Ui/Component/Report/Filters/Type/DateRange.php @@ -0,0 +1,19 @@ + + + + + ${ $.parentName } + + componentType = column, index = ${ $.index }:visible + + braintree_report.braintree_report.listing_top.listing_filters + ui/grid/filters/elements/group + Magento_Ui/js/grid/filters/range + date + createdAt + Created At + + + @@ -216,7 +232,6 @@ desc - dateRange date Magento_Ui/js/grid/columns/date Created At diff --git a/app/code/Magento/Ui/Component/Filters/Type/Date.php b/app/code/Magento/Ui/Component/Filters/Type/Date.php index f670f826e4e20..f5d392ea51365 100644 --- a/app/code/Magento/Ui/Component/Filters/Type/Date.php +++ b/app/code/Magento/Ui/Component/Filters/Type/Date.php @@ -23,6 +23,13 @@ class Date extends AbstractFilter */ protected $wrappedComponent; + /** + * Date format + * + * @var string + */ + protected static $dateFormat = 'Y-m-d H:i:s'; + /** * Prepare component configuration * @@ -96,7 +103,7 @@ protected function applyFilterByType($type, $value) if (!empty($value)) { $filter = $this->filterBuilder->setConditionType($type) ->setField($this->getName()) - ->setValue($value->format('Y-m-d H:i:s')) + ->setValue($value->format(static::$dateFormat)) ->create(); $this->getContext()->getDataProvider()->addFilter($filter); diff --git a/app/code/Magento/Ui/Test/Unit/Component/Filters/Type/DateTest.php b/app/code/Magento/Ui/Test/Unit/Component/Filters/Type/DateTest.php index 7000d9e091139..af53b71f18414 100644 --- a/app/code/Magento/Ui/Test/Unit/Component/Filters/Type/DateTest.php +++ b/app/code/Magento/Ui/Test/Unit/Component/Filters/Type/DateTest.php @@ -5,9 +5,11 @@ */ namespace Magento\Ui\Test\Unit\Component\Filters\Type; -use Magento\Framework\View\Element\UiComponent\ContextInterface as UiContext; +use Magento\Framework\Api\Filter; +use Magento\Framework\Api\FilterBuilder; use Magento\Framework\View\Element\UiComponent\DataProvider\DataProviderInterface; use Magento\Framework\View\Element\UiComponentFactory; +use Magento\Ui\Component\Filters\FilterModifier; use Magento\Ui\Component\Filters\Type\Date; use Magento\Framework\View\Element\UiComponent\ContextInterface; use Magento\Ui\Component\Form\Element\DataType\Date as FormDate; @@ -20,61 +22,55 @@ class DateTest extends \PHPUnit_Framework_TestCase /** * @var ContextInterface|\PHPUnit_Framework_MockObject_MockObject */ - protected $contextMock; + private $contextMock; /** * @var UiComponentFactory|\PHPUnit_Framework_MockObject_MockObject */ - protected $uiComponentFactory; + private $uiComponentFactory; /** - * @var \Magento\Framework\Api\FilterBuilder|\PHPUnit_Framework_MockObject_MockObject + * @var FilterBuilder|\PHPUnit_Framework_MockObject_MockObject */ - protected $filterBuilderMock; + private $filterBuilderMock; /** - * @var \Magento\Ui\Component\Filters\FilterModifier|\PHPUnit_Framework_MockObject_MockObject + * @var FilterModifier|\PHPUnit_Framework_MockObject_MockObject */ - protected $filterModifierMock; + private $filterModifierMock; + + + /** + * @var DataProviderInterface|\PHPUnit_Framework_MockObject_MockObject + */ + private $dataProviderMock; /** * Set up */ protected function setUp() { - $this->contextMock = $this->getMockForAbstractClass( - 'Magento\Framework\View\Element\UiComponent\ContextInterface', - [], - '', - false - ); - $processor = $this->getMockBuilder('Magento\Framework\View\Element\UiComponent\Processor') + $this->contextMock = $this->getMockForAbstractClass(ContextInterface::class); + $processor = $this->getMockBuilder(\Magento\Framework\View\Element\UiComponent\Processor::class) + ->disableOriginalConstructor() + ->getMock(); + $this->contextMock->expects(static::any()) + ->method('getProcessor') + ->willReturn($processor); + $this->uiComponentFactory = $this->getMockBuilder(UiComponentFactory::class) + ->setMethods(['create']) + ->disableOriginalConstructor() + ->getMock(); + $this->filterBuilderMock = $this->getMockBuilder(FilterBuilder::class) ->disableOriginalConstructor() ->getMock(); - $this->contextMock->expects($this->any())->method('getProcessor')->willReturn($processor); - $this->uiComponentFactory = $this->getMock( - 'Magento\Framework\View\Element\UiComponentFactory', - ['create'], - [], - '', - false - ); - $this->filterBuilderMock = $this->getMock( - 'Magento\Framework\Api\FilterBuilder', - [], - [], - '', - false - ); - - $this->filterModifierMock = $this->getMock( - 'Magento\Ui\Component\Filters\FilterModifier', - ['applyFilterModifier'], - [], - '', - false - ); + $this->filterModifierMock = $this->getMockBuilder(FilterModifier::class) + ->setMethods(['applyFilterModifier']) + ->disableOriginalConstructor() + ->getMock(); + + $this->dataProviderMock = $this->getMockForAbstractClass(DataProviderInterface::class); } /** @@ -92,7 +88,7 @@ public function testGetComponentName() [] ); - $this->assertTrue($date->getComponentName() === Date::NAME); + static::assertTrue($date->getComponentName() === Date::NAME); } /** @@ -107,13 +103,9 @@ public function testGetComponentName() public function testPrepare($name, $filterData, $expectedCondition) { /** @var FormDate $uiComponent */ - $uiComponent = $this->getMock( - 'Magento\Ui\Component\Form\Element\DataType\Date', - [], - [], - '', - false - ); + $uiComponent = $this->getMockBuilder(FormDate::class) + ->disableOriginalConstructor() + ->getMock(); $uiComponent->expects($this->any()) ->method('getContext') @@ -125,30 +117,62 @@ public function testPrepare($name, $filterData, $expectedCondition) $this->contextMock->expects($this->any()) ->method('addComponentDefinition') ->with(Date::NAME, ['extends' => Date::NAME]); + $this->contextMock->expects($this->any()) - ->method('getRequestParam') - ->with(UiContext::FILTER_VAR) + ->method('getFiltersParams') ->willReturn($filterData); - $dataProvider = $this->getMockForAbstractClass( - 'Magento\Framework\View\Element\UiComponent\DataProvider\DataProviderInterface', - [], - '', - false - ); + $this->contextMock->expects($this->any()) ->method('getDataProvider') - ->willReturn($dataProvider); + ->willReturn($this->dataProviderMock); + if ($expectedCondition !== null) { - $dataProvider->expects($this->any()) - ->method('addFilter') - ->with($expectedCondition, $name); - - $uiComponent->expects($this->any()) - ->method('getLocale') - ->willReturn($expectedCondition['locale']); - $uiComponent->expects($this->any()) - ->method('convertDate') - ->willReturnArgument(0); + if (is_string($filterData[$name])) { + $uiComponent->expects(static::once()) + ->method('convertDate') + ->with($filterData[$name]) + ->willReturn(new \DateTime($filterData[$name])); + } else { + $uiComponent->method('convertDate') + ->willReturnMap([ + [$filterData[$name]['from'], 0, 0, 0, new \DateTime($filterData[$name]['from'])], + [$filterData[$name]['to'], 23, 59, 59, new \DateTime($filterData[$name]['to'] . ' 23:59:59')], + ]); + } + + $i=0; + switch (true) { + case is_string($filterData[$name]): + case isset($filterData[$name]['from']) && !isset($filterData[$name]['to']): + case !isset($filterData[$name]['from']) && isset($filterData[$name]['to']): + $filterMock = $this->getFilterMock( + $name, + $expectedCondition['type'], + $expectedCondition['date'], + $i + ); + $this->dataProviderMock->expects(static::once()) + ->method('addFilter') + ->with($filterMock); + break; + case isset($filterData[$name]['from']) && isset($filterData[$name]['to']): + $this->getFilterMock( + $name, + $expectedCondition['type_from'], + $expectedCondition['date_from'], + $i + ); + $filterMock = $this->getFilterMock( + $name, + $expectedCondition['type_to'], + $expectedCondition['date_to'], + $i + ); + $this->dataProviderMock->expects(static::exactly(2)) + ->method('addFilter') + ->with($filterMock); + break; + } } $this->uiComponentFactory->expects($this->any()) @@ -167,6 +191,39 @@ public function testPrepare($name, $filterData, $expectedCondition) $date->prepare(); } + /** + * Gets Filter mock + * + * @param string $name + * @param string $expectedType + * @param string $expectedDate + * @param int $i + * + * @return Filter|\PHPUnit_Framework_MockObject_MockObject + */ + private function getFilterMock($name, $expectedType, $expectedDate, &$i) + { + $this->filterBuilderMock->expects(static::at($i++)) + ->method('setConditionType') + ->with($expectedType) + ->willReturnSelf(); + $this->filterBuilderMock->expects(static::at($i++)) + ->method('setField') + ->with($name) + ->willReturnSelf(); + $this->filterBuilderMock->expects(static::at($i++)) + ->method('setValue') + ->with($expectedDate) + ->willReturnSelf(); + + $filterMock = $this->getMock(Filter::class); + $this->filterBuilderMock->expects(static::at($i++)) + ->method('create') + ->willReturn($filterMock); + + return $filterMock; + } + /** * @return array */ @@ -175,26 +232,27 @@ public function getPrepareDataProvider() return [ [ 'test_date', - ['test_date' => ['from' => '11-05-2015', 'to' => '']], - ['from' => '11-05-2015', 'orig_from' => '11-05-2015', 'datetime' => true, 'locale' => 'en_US'], + ['test_date' => ['from' => '11-05-2015', 'to' => null]], + ['date' => '2015-05-11 00:00:00', 'type' => 'gteq'], ], [ 'test_date', - ['test_date' => ['from' => '', 'to' => '11-05-2015']], - ['to' => '11-05-2015', 'orig_to' => '11-05-2015', 'datetime' => true, 'locale' => 'en_US'], + ['test_date' => ['from' => null, 'to' => '11-05-2015']], + ['date' => '2015-05-11 23:59:59', 'type' => 'lteq'], ], [ 'test_date', - ['test_date' => ['from' => '10-05-2015', 'to' => '11-05-2015']], + ['test_date' => ['from' => '11-05-2015', 'to' => '11-05-2015']], [ - 'from' => '10-05-2015', - 'orig_from' => '10-05-2015', - 'to' => '11-05-2015', - 'orig_to' => '11-05-2015', - 'datetime' => true, - 'locale' => 'en_US' + 'date_from' => '2015-05-11 00:00:00', 'type_from' => 'gteq', + 'date_to' => '2015-05-11 23:59:59', 'type_to' => 'lteq' ], ], + [ + 'test_date', + ['test_date' => '11-05-2015'], + ['date' => '2015-05-11 00:00:00', 'type' => 'eq'], + ], [ 'test_date', ['test_date' => ['from' => '', 'to' => '']], From b1e95d910b86dce8b84229e7ad0a63e53431aa76 Mon Sep 17 00:00:00 2001 From: Bohdan Korablov Date: Thu, 23 Jun 2016 16:25:48 +0300 Subject: [PATCH 53/67] MAGETWO-54494: The css/email.css file processed by Less_Parser for each request --- app/code/Magento/Deploy/Model/Deployer.php | 2 +- .../View/Design/Fallback/Rule/Theme.php | 32 +++++++++ .../View/Design/Fallback/RulePool.php | 7 +- .../Fallback/Resolver/Simple.php | 1 + .../Unit/Design/Fallback/Rule/ThemeTest.php | 68 +++++++++++++------ .../Fallback/Resolver/SimpleTest.php | 5 ++ 6 files changed, 94 insertions(+), 21 deletions(-) diff --git a/app/code/Magento/Deploy/Model/Deployer.php b/app/code/Magento/Deploy/Model/Deployer.php index 5ce8251db1e8b..9eb59e33b1ae4 100644 --- a/app/code/Magento/Deploy/Model/Deployer.php +++ b/app/code/Magento/Deploy/Model/Deployer.php @@ -135,7 +135,7 @@ public function deploy(ObjectManagerFactory $omFactory, array $locales) $this->count = 0; $this->errorCount = 0; /** @var \Magento\Theme\Model\View\Design $design */ - $design = $this->objectManager->create('Magento\Theme\Model\View\Design'); + $design = $this->objectManager->get('Magento\Theme\Model\View\Design'); $design->setDesignTheme($themePath, $area); $assetRepo = $this->objectManager->create( 'Magento\Framework\View\Asset\Repository', diff --git a/lib/internal/Magento/Framework/View/Design/Fallback/Rule/Theme.php b/lib/internal/Magento/Framework/View/Design/Fallback/Rule/Theme.php index 095ac23827eba..ab0f29023e0c5 100644 --- a/lib/internal/Magento/Framework/View/Design/Fallback/Rule/Theme.php +++ b/lib/internal/Magento/Framework/View/Design/Fallback/Rule/Theme.php @@ -8,6 +8,8 @@ use Magento\Framework\Component\ComponentRegistrar; use Magento\Framework\Component\ComponentRegistrarInterface; use Magento\Framework\View\Design\ThemeInterface; +use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\App\ObjectManager; /** * Fallback Rule Theme @@ -30,6 +32,11 @@ class Theme implements RuleInterface */ private $componentRegistrar; + /** + * @var DirectoryList + */ + private $directoryList; + /** * Constructors * @@ -66,10 +73,35 @@ public function getPatternDirs(array $params) ComponentRegistrar::THEME, $theme->getFullPath() ); + + if (empty($params['theme_preprocessed_dir']) + && isset($params['file']) + && pathinfo($params['file'], PATHINFO_EXTENSION) === 'css' + ) { + $params['theme_preprocessed_dir'] = $this->getDirectoryList() + ->getPath(DirectoryList::TMP_MATERIALIZATION_DIR) + . '/source/' . $theme->getArea() . '/' . $theme->getCode() + . (isset($params['locale']) ? '/' . $params['locale'] : ''); + } + $result = array_merge($result, $this->rule->getPatternDirs($params)); } $theme = $theme->getParentTheme(); } return $result; } + + /** + * Get DirectoryList instance + * @return DirectoryList + * + * @deprecated + */ + private function getDirectoryList() + { + if (null === $this->directoryList) { + $this->directoryList = ObjectManager::getInstance()->get(DirectoryList::class); + } + return $this->directoryList; + } } diff --git a/lib/internal/Magento/Framework/View/Design/Fallback/RulePool.php b/lib/internal/Magento/Framework/View/Design/Fallback/RulePool.php index 3c6d84d76ba2c..cac1c81a0bb1a 100644 --- a/lib/internal/Magento/Framework/View/Design/Fallback/RulePool.php +++ b/lib/internal/Magento/Framework/View/Design/Fallback/RulePool.php @@ -180,7 +180,12 @@ protected function createViewFileRule() 'optionalParams' => ['locale'] ]), $this->simpleFactory - ->create(['pattern' => "/web"]) + ->create(['pattern' => "/web"]), + $this->simpleFactory + ->create([ + 'pattern' => "", + 'optionalParams' => ['theme_preprocessed_dir'] + ]), ] )] ), diff --git a/lib/internal/Magento/Framework/View/Design/FileResolution/Fallback/Resolver/Simple.php b/lib/internal/Magento/Framework/View/Design/FileResolution/Fallback/Resolver/Simple.php index 44373cf3442c5..f43842de3f3a8 100644 --- a/lib/internal/Magento/Framework/View/Design/FileResolution/Fallback/Resolver/Simple.php +++ b/lib/internal/Magento/Framework/View/Design/FileResolution/Fallback/Resolver/Simple.php @@ -120,6 +120,7 @@ private function checkFilePathAccess($fileName, $filePath) */ protected function resolveFile(RuleInterface $fallbackRule, $file, array $params = []) { + $params['file'] = $file; foreach ($fallbackRule->getPatternDirs($params) as $dir) { $path = "{$dir}/{$file}"; $dirRead = $this->readFactory->create($dir); diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Design/Fallback/Rule/ThemeTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Design/Fallback/Rule/ThemeTest.php index ff0395da6a6d2..b12c6f87ee992 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/Design/Fallback/Rule/ThemeTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/Design/Fallback/Rule/ThemeTest.php @@ -8,19 +8,26 @@ use Magento\Framework\Component\ComponentRegistrar; use Magento\Framework\Component\ComponentRegistrarInterface; use Magento\Framework\View\Design\Fallback\Rule\RuleInterface; -use \Magento\Framework\View\Design\Fallback\Rule\Theme; +use Magento\Framework\View\Design\Fallback\Rule\Theme; +use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; class ThemeTest extends \PHPUnit_Framework_TestCase { /** * @var RuleInterface|\PHPUnit_Framework_MockObject_MockObject */ - private $rule; + private $ruleMock; /** * @var ComponentRegistrarInterface|\PHPUnit_Framework_MockObject_MockObject */ - private $componentRegistrar; + private $componentRegistrarMock; + + /** + * @var DirectoryList|\PHPUnit_Framework_MockObject_MockObject + */ + private $directoryListMock; /** * @var Theme @@ -29,11 +36,17 @@ class ThemeTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->rule = $this->getMockForAbstractClass('\Magento\Framework\View\Design\Fallback\Rule\RuleInterface'); - $this->componentRegistrar = $this->getMockForAbstractClass( - '\Magento\Framework\Component\ComponentRegistrarInterface' + $this->ruleMock = $this->getMockForAbstractClass(RuleInterface::class); + $this->componentRegistrarMock = $this->getMockForAbstractClass(ComponentRegistrarInterface::class); + $this->directoryListMock = $this->getMockBuilder(DirectoryList::class) + ->disableOriginalConstructor() + ->getMock(); + $this->model = new Theme($this->ruleMock, $this->componentRegistrarMock); + (new ObjectManager($this))->setBackwardCompatibleProperty( + $this->model, + 'directoryList', + $this->directoryListMock ); - $this->model = new Theme($this->rule, $this->componentRegistrar); } /** * @expectedException \InvalidArgumentException @@ -46,37 +59,54 @@ public function testGetPatternDirsException() public function testGetPatternDirs() { - $parentTheme = $this->getMockForAbstractClass('Magento\Framework\View\Design\ThemeInterface'); - $parentTheme->expects($this->any())->method('getFullPath')->will($this->returnValue('package/parent_theme')); + $parentTheme = $this->getMockForAbstractClass(\Magento\Framework\View\Design\ThemeInterface::class); + $parentTheme->expects($this->exactly(2))->method('getFullPath')->willReturn('package/parent_theme'); + $parentTheme->expects($this->never())->method('getArea'); + $parentTheme->expects($this->never())->method('getCode'); - $theme = $this->getMockForAbstractClass('Magento\Framework\View\Design\ThemeInterface'); - $theme->expects($this->any())->method('getFullPath')->will($this->returnValue('package/current_theme')); - $theme->expects($this->any())->method('getParentTheme')->will($this->returnValue($parentTheme)); + $theme = $this->getMockForAbstractClass(\Magento\Framework\View\Design\ThemeInterface::class); + $theme->expects($this->exactly(2))->method('getFullPath')->willReturn('package/current_theme'); + $theme->expects($this->once())->method('getParentTheme')->willReturn($parentTheme); + $theme->expects($this->once())->method('getArea')->willReturn('frontend'); + $theme->expects($this->once())->method('getCode')->willReturn('luma'); - $this->componentRegistrar->expects($this->any()) + $this->componentRegistrarMock->expects($this->atLeastOnce()) ->method('getPath') - ->will($this->returnValueMap([ + ->willReturnMap([ [ComponentRegistrar::THEME, 'package/parent_theme', '/path/to/parent/theme'], [ComponentRegistrar::THEME, 'package/current_theme', '/path/to/current/theme'], - ])); + ]); + + $this->directoryListMock->expects($this->atLeastOnce()) + ->method('getPath') + ->with(DirectoryList::TMP_MATERIALIZATION_DIR) + ->willReturn('/var/view_processed'); $ruleDirsMap = [ [ - ['theme_dir' => '/path/to/current/theme'], + [ + 'file' => 'test.css', + 'theme_dir' => '/path/to/current/theme', + 'theme_preprocessed_dir' => '/var/view_processed/source/frontend/luma' + ], ['package/current_theme/path/one', 'package/current_theme/path/two'], ], [ - ['theme_dir' => '/path/to/parent/theme'], + [ + 'file' => 'test.css', + 'theme_dir' => '/path/to/parent/theme', + 'theme_preprocessed_dir' => '/var/view_processed/source/frontend/luma' + ], ['package/parent_theme/path/one', 'package/parent_theme/path/two'] ], ]; - $this->rule->expects($this->any())->method('getPatternDirs')->will($this->returnValueMap($ruleDirsMap)); + $this->ruleMock->expects($this->atLeastOnce())->method('getPatternDirs')->willReturnMap($ruleDirsMap); $expectedResult = [ 'package/current_theme/path/one', 'package/current_theme/path/two', 'package/parent_theme/path/one', 'package/parent_theme/path/two', ]; - $this->assertEquals($expectedResult, $this->model->getPatternDirs(['theme' => $theme])); + $this->assertEquals($expectedResult, $this->model->getPatternDirs(['theme' => $theme, 'file' => 'test.css'])); } } diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Design/FileResolution/Fallback/Resolver/SimpleTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Design/FileResolution/Fallback/Resolver/SimpleTest.php index 96e25f6d34f00..fe4f9a4dd7769 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/Design/FileResolution/Fallback/Resolver/SimpleTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/Design/FileResolution/Fallback/Resolver/SimpleTest.php @@ -127,6 +127,7 @@ public function resolveDataProvider() 'theme' => 'magento_theme', 'locale' => 'en_US', 'module_name' => 'Magento_Module', + 'file' => 'file.ext', ], ], 'no theme' => [ @@ -138,6 +139,7 @@ public function resolveDataProvider() 'area' => 'frontend', 'locale' => 'en_US', 'module_name' => 'Magento_Module', + 'file' => 'file.ext', ], ], 'no locale' => [ @@ -149,6 +151,7 @@ public function resolveDataProvider() 'area' => 'frontend', 'theme' => 'magento_theme', 'module_name' => 'Magento_Module', + 'file' => 'file.ext', ], ], 'no module' => [ @@ -160,6 +163,7 @@ public function resolveDataProvider() 'area' => 'frontend', 'theme' => 'magento_theme', 'locale' => 'en_US', + 'file' => 'file.ext', ], ], 'all params' => [ @@ -172,6 +176,7 @@ public function resolveDataProvider() 'theme' => 'magento_theme', 'locale' => 'en_US', 'module_name' => 'Magento_Module', + 'file' => 'file.ext', ], ], ]; From a0d097c49394fe4c345c6045951448737cdc6b98 Mon Sep 17 00:00:00 2001 From: Bohdan Korablov Date: Fri, 24 Jun 2016 16:26:39 +0300 Subject: [PATCH 54/67] MAGETWO-54494: The css/email.css file processed by Less_Parser for each request --- .../View/Design/Fallback/Rule/Theme.php | 34 +++++++++++++------ .../View/Design/Fallback/RulePool.php | 4 +-- .../Unit/Design/Fallback/Rule/ThemeTest.php | 8 ++--- 3 files changed, 30 insertions(+), 16 deletions(-) diff --git a/lib/internal/Magento/Framework/View/Design/Fallback/Rule/Theme.php b/lib/internal/Magento/Framework/View/Design/Fallback/Rule/Theme.php index ab0f29023e0c5..9a8c52ca56cac 100644 --- a/lib/internal/Magento/Framework/View/Design/Fallback/Rule/Theme.php +++ b/lib/internal/Magento/Framework/View/Design/Fallback/Rule/Theme.php @@ -74,16 +74,7 @@ public function getPatternDirs(array $params) $theme->getFullPath() ); - if (empty($params['theme_preprocessed_dir']) - && isset($params['file']) - && pathinfo($params['file'], PATHINFO_EXTENSION) === 'css' - ) { - $params['theme_preprocessed_dir'] = $this->getDirectoryList() - ->getPath(DirectoryList::TMP_MATERIALIZATION_DIR) - . '/source/' . $theme->getArea() . '/' . $theme->getCode() - . (isset($params['locale']) ? '/' . $params['locale'] : ''); - } - + $params = $this->getThemePubStaticDir($theme, $params); $result = array_merge($result, $this->rule->getPatternDirs($params)); } $theme = $theme->getParentTheme(); @@ -91,6 +82,28 @@ public function getPatternDirs(array $params) return $result; } + /** + * Get dir of Theme that contains published static view files + * + * @param ThemeInterface $theme + * @param array $params + * @return array + */ + private function getThemePubStaticDir(ThemeInterface $theme, $params = []) + { + if (empty($params['theme_pubstatic_dir']) + && isset($params['file']) + && pathinfo($params['file'], PATHINFO_EXTENSION) === 'css' + ) { + $params['theme_pubstatic_dir'] = $this->getDirectoryList() + ->getPath(DirectoryList::STATIC_VIEW) + . '/' . $theme->getArea() . '/' . $theme->getCode() + . (isset($params['locale']) ? '/' . $params['locale'] : ''); + } + + return $params; + } + /** * Get DirectoryList instance * @return DirectoryList @@ -102,6 +115,7 @@ private function getDirectoryList() if (null === $this->directoryList) { $this->directoryList = ObjectManager::getInstance()->get(DirectoryList::class); } + return $this->directoryList; } } diff --git a/lib/internal/Magento/Framework/View/Design/Fallback/RulePool.php b/lib/internal/Magento/Framework/View/Design/Fallback/RulePool.php index cac1c81a0bb1a..18ba7c3ca4bca 100644 --- a/lib/internal/Magento/Framework/View/Design/Fallback/RulePool.php +++ b/lib/internal/Magento/Framework/View/Design/Fallback/RulePool.php @@ -183,8 +183,8 @@ protected function createViewFileRule() ->create(['pattern' => "/web"]), $this->simpleFactory ->create([ - 'pattern' => "", - 'optionalParams' => ['theme_preprocessed_dir'] + 'pattern' => "", + 'optionalParams' => ['theme_pubstatic_dir'] ]), ] )] diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Design/Fallback/Rule/ThemeTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Design/Fallback/Rule/ThemeTest.php index b12c6f87ee992..a8dd6ebc9eba4 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/Design/Fallback/Rule/ThemeTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/Design/Fallback/Rule/ThemeTest.php @@ -79,15 +79,15 @@ public function testGetPatternDirs() $this->directoryListMock->expects($this->atLeastOnce()) ->method('getPath') - ->with(DirectoryList::TMP_MATERIALIZATION_DIR) - ->willReturn('/var/view_processed'); + ->with(DirectoryList::STATIC_VIEW) + ->willReturn('/pub/static'); $ruleDirsMap = [ [ [ 'file' => 'test.css', 'theme_dir' => '/path/to/current/theme', - 'theme_preprocessed_dir' => '/var/view_processed/source/frontend/luma' + 'theme_pubstatic_dir' => '/pub/static/frontend/luma' ], ['package/current_theme/path/one', 'package/current_theme/path/two'], ], @@ -95,7 +95,7 @@ public function testGetPatternDirs() [ 'file' => 'test.css', 'theme_dir' => '/path/to/parent/theme', - 'theme_preprocessed_dir' => '/var/view_processed/source/frontend/luma' + 'theme_pubstatic_dir' => '/pub/static/frontend/luma' ], ['package/parent_theme/path/one', 'package/parent_theme/path/two'] ], From 133dd81e9e5711c87c138c142959fd7acfea02af Mon Sep 17 00:00:00 2001 From: Ievgen Sentiabov Date: Wed, 29 Jun 2016 09:52:20 +0300 Subject: [PATCH 55/67] MAGETWO-54721: Not possible to use Braintree as a payment method when reward points or store credit has been applied to an order - Removed initialization with shared config - Added initialization only for active payment selection - Added teardown function --- .../frontend/web/js/view/payment/braintree.js | 16 +-------- .../view/payment/method-renderer/cc-form.js | 35 ++++++++++++------- 2 files changed, 23 insertions(+), 28 deletions(-) diff --git a/app/code/Magento/Braintree/view/frontend/web/js/view/payment/braintree.js b/app/code/Magento/Braintree/view/frontend/web/js/view/payment/braintree.js index cb0b46a25327e..3cec7f1fb8ccc 100644 --- a/app/code/Magento/Braintree/view/frontend/web/js/view/payment/braintree.js +++ b/app/code/Magento/Braintree/view/frontend/web/js/view/payment/braintree.js @@ -7,26 +7,19 @@ define( [ 'uiComponent', - 'uiRegistry', - 'Magento_Braintree/js/view/payment/adapter', 'Magento_Checkout/js/model/payment/renderer-list' ], function ( Component, - Registry, - Braintree, rendererList ) { 'use strict'; var config = window.checkoutConfig.payment, braintreeType = 'braintree', - payPalType = 'braintree_paypal', - path = 'checkout.steps.billing-step.payment.payments-list.', - components = []; + payPalType = 'braintree_paypal'; if (config[braintreeType].isActive) { - components.push(path + braintreeType); rendererList.push( { type: braintreeType, @@ -44,13 +37,6 @@ define( ); } - // setup Braintree SDK with merged configuration from all related components - if (components.length) { - Registry.get(components, function () { - Braintree.setup(); - }); - } - /** Add view logic here if needed */ return Component.extend({}); } diff --git a/app/code/Magento/Braintree/view/frontend/web/js/view/payment/method-renderer/cc-form.js b/app/code/Magento/Braintree/view/frontend/web/js/view/payment/method-renderer/cc-form.js index 6990c1e2e5a0b..7e6885ed7ef90 100644 --- a/app/code/Magento/Braintree/view/frontend/web/js/view/payment/method-renderer/cc-form.js +++ b/app/code/Magento/Braintree/view/frontend/web/js/view/payment/method-renderer/cc-form.js @@ -61,11 +61,22 @@ define( this.beforePlaceOrder(response); }, + /** + * Device data initialization + * + * @param {Object} checkout + */ + onReady: function (checkout) { + braintree.checkout = checkout; + }, + /** * Triggers on any Braintree error + * @param {Object} response */ - onError: function () { - this.paymentMethodNonce = null; + onError: function (response) { + braintree.showError($t('Payment ' + this.getTitle() + ' can\'t be initialized')); + throw response.message; }, /** @@ -90,7 +101,7 @@ define( this._super() .observe(['active']); this.validatorManager.initialize(); - this.initBraintree(); + this.initClientConfig(); return this; }, @@ -126,7 +137,7 @@ define( return; } - this.reInitBraintree(); + this.initBraintree(); }, /** @@ -146,17 +157,9 @@ define( }, /** - * Create Braintree configuration + * Init Braintree configuration */ initBraintree: function () { - this.initClientConfig(); - braintree.config = _.extend(braintree.config, this.clientConfig); - }, - - /** - * Re-init Braintree configuration - */ - reInitBraintree: function () { var intervalId = setInterval(function () { // stop loader when frame will be loaded if ($('#braintree-hosted-field-number').length) { @@ -165,6 +168,12 @@ define( } }, 500); + if (braintree.checkout) { + braintree.checkout.teardown(function () { + braintree.checkout = null; + }); + } + fullScreenLoader.startLoader(); braintree.setConfig(this.clientConfig); braintree.setup(); From fbeb026c138465d400e9599e33dc503bd3397a39 Mon Sep 17 00:00:00 2001 From: Ievgen Sentiabov Date: Thu, 30 Jun 2016 14:25:47 +0300 Subject: [PATCH 56/67] MAGETWO-54721: Not possible to use Braintree as a payment method when reward points or store credit has been applied to an order - Removed useless isSingleUse() method --- app/code/Magento/Braintree/Model/Ui/ConfigProvider.php | 1 - .../Test/Unit/Model/Ui/ConfigProviderTest.php | 1 - .../web/js/view/payment/method-renderer/cc-form.js | 10 +--------- 3 files changed, 1 insertion(+), 11 deletions(-) diff --git a/app/code/Magento/Braintree/Model/Ui/ConfigProvider.php b/app/code/Magento/Braintree/Model/Ui/ConfigProvider.php index d720b748ba819..cea02f249cbed 100644 --- a/app/code/Magento/Braintree/Model/Ui/ConfigProvider.php +++ b/app/code/Magento/Braintree/Model/Ui/ConfigProvider.php @@ -79,7 +79,6 @@ public function getConfig() 'payment' => [ self::CODE => [ 'isActive' => $this->config->isActive(), - 'isSingleUse' => !$isPayPalActive, 'clientToken' => $this->getClientToken(), 'ccTypesMapper' => $this->config->getCctypesMapper(), 'sdkUrl' => $this->config->getSdkUrl(), diff --git a/app/code/Magento/Braintree/Test/Unit/Model/Ui/ConfigProviderTest.php b/app/code/Magento/Braintree/Test/Unit/Model/Ui/ConfigProviderTest.php index a787111fa93aa..ad9f99b39afb0 100644 --- a/app/code/Magento/Braintree/Test/Unit/Model/Ui/ConfigProviderTest.php +++ b/app/code/Magento/Braintree/Test/Unit/Model/Ui/ConfigProviderTest.php @@ -154,7 +154,6 @@ public function getConfigDataProvider() 'payment' => [ ConfigProvider::CODE => [ 'isActive' => true, - 'isSingleUse' => false, 'clientToken' => self::CLIENT_TOKEN, 'ccTypesMapper' => ['visa' => 'VI', 'american-express' => 'AE'], 'sdkUrl' => self::SDK_URL, diff --git a/app/code/Magento/Braintree/view/frontend/web/js/view/payment/method-renderer/cc-form.js b/app/code/Magento/Braintree/view/frontend/web/js/view/payment/method-renderer/cc-form.js index 7e6885ed7ef90..af71eb29a158d 100644 --- a/app/code/Magento/Braintree/view/frontend/web/js/view/payment/method-renderer/cc-form.js +++ b/app/code/Magento/Braintree/view/frontend/web/js/view/payment/method-renderer/cc-form.js @@ -133,7 +133,7 @@ define( * @param {Boolean} isActive */ onActiveChange: function (isActive) { - if (!isActive || this.isSingleUse()) { + if (!isActive) { return; } @@ -318,14 +318,6 @@ define( }); return false; - }, - - /** - * Check if Braintree configured without PayPal - * @returns {Boolean} - */ - isSingleUse: function () { - return window.checkoutConfig.payment[this.getCode()].isSingleUse; } }); } From 364e3b9b0c83c9420eb2990347cfb36d552096e2 Mon Sep 17 00:00:00 2001 From: Elena Marchenko Date: Fri, 1 Jul 2016 16:18:20 +0300 Subject: [PATCH 57/67] MAGETWO-51622: Help links in Braintree configuration --- app/code/Magento/Braintree/etc/adminhtml/system.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Braintree/etc/adminhtml/system.xml b/app/code/Magento/Braintree/etc/adminhtml/system.xml index 3668cd7779fda..765260ce38291 100644 --- a/app/code/Magento/Braintree/etc/adminhtml/system.xml +++ b/app/code/Magento/Braintree/etc/adminhtml/system.xml @@ -18,6 +18,7 @@ Magento\Paypal\Block\Adminhtml\System\Config\Fieldset\Payment payment/braintree/active + https://articles.braintreepayments.com/guides/magento/configuration Magento\Config\Model\Config\Source\Yesno @@ -43,7 +44,7 @@ - Click here to login to your existing Braintree account. Or to setup a new account and accept payments on your website, click here to signup for a Braintree account.]]> + Click here to login to your existing Braintree account. Or to setup a new account and accept payments on your website, click here to signup for a Braintree account.

Powered by Braintree v.zero with Hosted Fields latest technology. Hosted Fields are small, transparent iframes that replace the sensitive credit card inputs in your checkout flow - helping you meet the latest data security requirements while ensuring your customization doesn't suffer. Find out more.]]>
1 Magento\Config\Block\System\Config\Form\Fieldset From cafeeb1df907f03aa00f30aad6acb4ef5af9644b Mon Sep 17 00:00:00 2001 From: Dmytro Yushkin Date: Fri, 1 Jul 2016 16:32:09 +0300 Subject: [PATCH 58/67] MAGETWO-54192: Filtration by Created At in Braintree Settlement report - Static tests fix --- app/code/Magento/Braintree/composer.json | 1 + .../view/adminhtml/ui_component/braintree_report.xml | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Braintree/composer.json b/app/code/Magento/Braintree/composer.json index fb833f763f370..9a86aec7a7d9d 100644 --- a/app/code/Magento/Braintree/composer.json +++ b/app/code/Magento/Braintree/composer.json @@ -17,6 +17,7 @@ "magento/module-quote": "100.2.*", "magento/module-paypal": "100.2.*", "magento/module-theme": "100.2.*", + "magento/module-ui": "100.2.*", "braintree/braintree_php": "3.7.0" }, "suggest": { diff --git a/app/code/Magento/Braintree/view/adminhtml/ui_component/braintree_report.xml b/app/code/Magento/Braintree/view/adminhtml/ui_component/braintree_report.xml index 918267997c442..031ddca7a8707 100644 --- a/app/code/Magento/Braintree/view/adminhtml/ui_component/braintree_report.xml +++ b/app/code/Magento/Braintree/view/adminhtml/ui_component/braintree_report.xml @@ -133,7 +133,7 @@
- + ${ $.parentName } @@ -148,7 +148,7 @@ Created At - + From b3321a626e5fd256a333bf4e9ea1ad41eee29270 Mon Sep 17 00:00:00 2001 From: Roman Liukshyn Date: Mon, 4 Jul 2016 12:20:25 +0300 Subject: [PATCH 59/67] MAGETWO-54193: No Payment Type filter in Braintree Settlement report - Fixed unit test --- .../Test/Unit/Model/Report/TransactionMapTest.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/app/code/Magento/Braintree/Test/Unit/Model/Report/TransactionMapTest.php b/app/code/Magento/Braintree/Test/Unit/Model/Report/TransactionMapTest.php index 9a1a76b80b8c5..cfbddd173a39f 100644 --- a/app/code/Magento/Braintree/Test/Unit/Model/Report/TransactionMapTest.php +++ b/app/code/Magento/Braintree/Test/Unit/Model/Report/TransactionMapTest.php @@ -31,6 +31,9 @@ class TransactionMapTest extends \PHPUnit_Framework_TestCase */ private $attributeValueFactoryMock; + /** @var \Magento\Framework\Phrase\RendererInterface */ + private $defaultRenderer; + /** * @var \Magento\Framework\Phrase\RendererInterface|\PHPUnit_Framework_MockObject_MockObject */ @@ -45,6 +48,7 @@ protected function setUp() ->setMethods(['create']) ->disableOriginalConstructor() ->getMock(); + $this->defaultRenderer = Phrase::getRenderer(); $this->rendererMock = $this->getMockBuilder('Magento\Framework\Phrase\RendererInterface') ->getMock(); } @@ -140,4 +144,12 @@ public function getConfigDataProvider() ] ]; } + + /** + * @return void + */ + public function tearDown() + { + \Magento\Framework\Phrase::setRenderer($this->defaultRenderer); + } } From 6c7bfb42b1ef4216dff6bc89d0979a0b11e76352 Mon Sep 17 00:00:00 2001 From: Roman Liukshyn Date: Mon, 4 Jul 2016 12:42:14 +0300 Subject: [PATCH 60/67] MAGETWO-54193: No Payment Type filter in Braintree Settlement report - Fixed unit test --- .../Test/Unit/Model/Report/TransactionMapTest.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/app/code/Magento/Braintree/Test/Unit/Model/Report/TransactionMapTest.php b/app/code/Magento/Braintree/Test/Unit/Model/Report/TransactionMapTest.php index cfbddd173a39f..34c607c88784d 100644 --- a/app/code/Magento/Braintree/Test/Unit/Model/Report/TransactionMapTest.php +++ b/app/code/Magento/Braintree/Test/Unit/Model/Report/TransactionMapTest.php @@ -12,6 +12,7 @@ use Magento\Framework\Api\AttributeValue; use Magento\Framework\Api\AttributeValueFactory; use Magento\Framework\Phrase; +use Magento\Framework\Phrase\RendererInterface; use Magento\Store\Model\StoreManagerInterface; /** @@ -31,11 +32,13 @@ class TransactionMapTest extends \PHPUnit_Framework_TestCase */ private $attributeValueFactoryMock; - /** @var \Magento\Framework\Phrase\RendererInterface */ + /** + * @var RendererInterface|\PHPUnit_Framework_MockObject_MockObject + */ private $defaultRenderer; /** - * @var \Magento\Framework\Phrase\RendererInterface|\PHPUnit_Framework_MockObject_MockObject + * @var RendererInterface|\PHPUnit_Framework_MockObject_MockObject */ private $rendererMock; @@ -49,7 +52,7 @@ protected function setUp() ->disableOriginalConstructor() ->getMock(); $this->defaultRenderer = Phrase::getRenderer(); - $this->rendererMock = $this->getMockBuilder('Magento\Framework\Phrase\RendererInterface') + $this->rendererMock = $this->getMockBuilder(RendererInterface::class) ->getMock(); } @@ -148,8 +151,8 @@ public function getConfigDataProvider() /** * @return void */ - public function tearDown() + protected function tearDown() { - \Magento\Framework\Phrase::setRenderer($this->defaultRenderer); + Phrase::setRenderer($this->defaultRenderer); } } From 175485265bdb5a5420268d0132c96bdaae65fcd7 Mon Sep 17 00:00:00 2001 From: Bohdan Korablov Date: Tue, 5 Jul 2016 14:06:27 +0300 Subject: [PATCH 61/67] MAGETWO-54737: PHP 7.0.4 Support --- app/bootstrap.php | 6 +- .../Magento/AdminNotification/composer.json | 2 +- .../AdvancedPricingImportExport/composer.json | 2 +- app/code/Magento/Authorization/composer.json | 2 +- app/code/Magento/Authorizenet/composer.json | 2 +- app/code/Magento/Backend/composer.json | 2 +- app/code/Magento/Backup/composer.json | 2 +- app/code/Magento/Braintree/composer.json | 2 +- app/code/Magento/Bundle/composer.json | 2 +- .../Magento/BundleImportExport/composer.json | 2 +- .../Magento/CacheInvalidate/composer.json | 2 +- app/code/Magento/Captcha/composer.json | 2 +- app/code/Magento/Catalog/composer.json | 2 +- .../Magento/CatalogImportExport/composer.json | 2 +- .../Magento/CatalogInventory/composer.json | 2 +- app/code/Magento/CatalogRule/composer.json | 2 +- .../CatalogRuleConfigurable/composer.json | 2 +- app/code/Magento/CatalogSearch/composer.json | 2 +- .../Magento/CatalogUrlRewrite/composer.json | 2 +- app/code/Magento/CatalogWidget/composer.json | 2 +- app/code/Magento/Checkout/composer.json | 2 +- .../Magento/CheckoutAgreements/composer.json | 2 +- app/code/Magento/Cms/composer.json | 2 +- app/code/Magento/CmsUrlRewrite/composer.json | 2 +- app/code/Magento/Config/composer.json | 2 +- .../ConfigurableImportExport/composer.json | 2 +- .../Magento/ConfigurableProduct/composer.json | 2 +- app/code/Magento/Contact/composer.json | 2 +- app/code/Magento/Cookie/composer.json | 2 +- app/code/Magento/Cron/composer.json | 2 +- app/code/Magento/CurrencySymbol/composer.json | 2 +- app/code/Magento/Customer/composer.json | 2 +- .../CustomerImportExport/composer.json | 2 +- app/code/Magento/Deploy/composer.json | 2 +- app/code/Magento/Developer/composer.json | 2 +- app/code/Magento/Dhl/composer.json | 2 +- app/code/Magento/Directory/composer.json | 2 +- app/code/Magento/Downloadable/composer.json | 2 +- .../DownloadableImportExport/composer.json | 2 +- app/code/Magento/Eav/composer.json | 2 +- app/code/Magento/Email/composer.json | 2 +- app/code/Magento/EncryptionKey/composer.json | 2 +- app/code/Magento/Fedex/composer.json | 2 +- app/code/Magento/GiftMessage/composer.json | 2 +- app/code/Magento/GoogleAdwords/composer.json | 2 +- .../Magento/GoogleAnalytics/composer.json | 2 +- .../Magento/GoogleOptimizer/composer.json | 2 +- .../Magento/GroupedImportExport/composer.json | 2 +- app/code/Magento/GroupedProduct/composer.json | 2 +- app/code/Magento/ImportExport/composer.json | 2 +- app/code/Magento/Indexer/composer.json | 2 +- app/code/Magento/Integration/composer.json | 2 +- .../Magento/LayeredNavigation/composer.json | 2 +- app/code/Magento/Marketplace/composer.json | 2 +- app/code/Magento/MediaStorage/composer.json | 2 +- app/code/Magento/Msrp/composer.json | 2 +- app/code/Magento/Multishipping/composer.json | 2 +- .../Magento/NewRelicReporting/composer.json | 2 +- app/code/Magento/Newsletter/composer.json | 2 +- .../Magento/OfflinePayments/composer.json | 2 +- .../Magento/OfflineShipping/composer.json | 2 +- app/code/Magento/PageCache/composer.json | 2 +- app/code/Magento/Payment/composer.json | 2 +- app/code/Magento/Paypal/composer.json | 2 +- app/code/Magento/Persistent/composer.json | 2 +- app/code/Magento/ProductAlert/composer.json | 2 +- app/code/Magento/ProductVideo/composer.json | 2 +- app/code/Magento/Quote/composer.json | 2 +- app/code/Magento/Reports/composer.json | 2 +- app/code/Magento/RequireJs/composer.json | 2 +- app/code/Magento/Review/composer.json | 2 +- app/code/Magento/Rss/composer.json | 2 +- app/code/Magento/Rule/composer.json | 2 +- app/code/Magento/Sales/composer.json | 2 +- app/code/Magento/SalesRule/composer.json | 2 +- app/code/Magento/SalesSequence/composer.json | 2 +- app/code/Magento/SampleData/composer.json | 2 +- app/code/Magento/Search/composer.json | 2 +- app/code/Magento/Security/composer.json | 2 +- app/code/Magento/SendFriend/composer.json | 2 +- app/code/Magento/Shipping/composer.json | 2 +- app/code/Magento/Sitemap/composer.json | 2 +- app/code/Magento/Store/composer.json | 2 +- app/code/Magento/Swagger/composer.json | 2 +- app/code/Magento/Swatches/composer.json | 2 +- .../SwatchesLayeredNavigation/composer.json | 2 +- app/code/Magento/Tax/composer.json | 2 +- .../Magento/TaxImportExport/composer.json | 2 +- app/code/Magento/Theme/composer.json | 2 +- app/code/Magento/Translation/composer.json | 2 +- app/code/Magento/Ui/composer.json | 2 +- app/code/Magento/Ups/composer.json | 2 +- app/code/Magento/UrlRewrite/composer.json | 2 +- app/code/Magento/User/composer.json | 2 +- app/code/Magento/Usps/composer.json | 2 +- app/code/Magento/Variable/composer.json | 2 +- app/code/Magento/Vault/composer.json | 2 +- app/code/Magento/Version/composer.json | 2 +- app/code/Magento/Webapi/composer.json | 2 +- app/code/Magento/WebapiSecurity/composer.json | 2 +- app/code/Magento/Weee/composer.json | 2 +- app/code/Magento/Widget/composer.json | 2 +- app/code/Magento/Wishlist/composer.json | 2 +- .../adminhtml/Magento/backend/composer.json | 2 +- .../frontend/Magento/blank/composer.json | 2 +- .../frontend/Magento/luma/composer.json | 2 +- composer.json | 2 +- composer.lock | 86 +++++++++---------- .../composer.json | 2 +- .../TestModuleJoinDirectives/composer.json | 2 +- dev/tests/functional/composer.json | 2 +- .../root/app/code/Magento/A/composer.json | 2 +- .../root/app/code/Magento/B/composer.json | 2 +- .../adminhtml/magento_basic/composer.json | 2 +- lib/internal/Magento/Framework/composer.json | 2 +- 115 files changed, 159 insertions(+), 159 deletions(-) diff --git a/app/bootstrap.php b/app/bootstrap.php index 5e693487d748d..ec60a1708dacc 100644 --- a/app/bootstrap.php +++ b/app/bootstrap.php @@ -11,14 +11,14 @@ #ini_set('display_errors', 1); /* PHP version validation */ -if (!defined('PHP_VERSION_ID') || !(PHP_VERSION_ID >= 50600 && PHP_VERSION_ID < 50700 || PHP_VERSION_ID === 70002 || PHP_VERSION_ID >= 70006)) { +if (!defined('PHP_VERSION_ID') || !(PHP_VERSION_ID >= 50600 && PHP_VERSION_ID < 50700 || PHP_VERSION_ID === 70002 || PHP_VERSION_ID === 70004 || PHP_VERSION_ID >= 70006)) { if (PHP_SAPI == 'cli') { - echo 'Magento supports PHP 5.6, 7.0.2, and 7.0.6 or later. ' . + echo 'Magento supports PHP 5.6, 7.0.2, 7.0.4, and 7.0.6 or later. ' . 'Please read http://devdocs.magento.com/guides/v1.0/install-gde/system-requirements.html'; } else { echo << -

Magento supports PHP 5.6, 7.0.2, and 7.0.6 or later. Please read +

Magento supports PHP 5.6, 7.0.2, 7.0.4, and 7.0.6 or later. Please read Magento System Requirements. diff --git a/app/code/Magento/AdminNotification/composer.json b/app/code/Magento/AdminNotification/composer.json index ae24995c35935..0a29908b77f6f 100644 --- a/app/code/Magento/AdminNotification/composer.json +++ b/app/code/Magento/AdminNotification/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-admin-notification", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/module-store": "100.2.*", "magento/module-backend": "100.2.*", "magento/module-media-storage": "100.2.*", diff --git a/app/code/Magento/AdvancedPricingImportExport/composer.json b/app/code/Magento/AdvancedPricingImportExport/composer.json index 8388c87e55d8f..65ea7524dffff 100644 --- a/app/code/Magento/AdvancedPricingImportExport/composer.json +++ b/app/code/Magento/AdvancedPricingImportExport/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-advanced-pricing-import-export", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/module-catalog": "101.1.*", "magento/module-catalog-inventory": "100.2.*", "magento/module-eav": "100.2.*", diff --git a/app/code/Magento/Authorization/composer.json b/app/code/Magento/Authorization/composer.json index c8016abf3f743..0ca367d4854df 100644 --- a/app/code/Magento/Authorization/composer.json +++ b/app/code/Magento/Authorization/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-authorization", "description": "Authorization module provides access to Magento ACL functionality.", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/module-backend": "100.2.*", "magento/framework": "100.2.*" }, diff --git a/app/code/Magento/Authorizenet/composer.json b/app/code/Magento/Authorizenet/composer.json index d880b3d2c6539..0c9e9641b6076 100644 --- a/app/code/Magento/Authorizenet/composer.json +++ b/app/code/Magento/Authorizenet/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-authorizenet", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/module-sales": "100.2.*", "magento/module-store": "100.2.*", "magento/module-quote": "100.2.*", diff --git a/app/code/Magento/Backend/composer.json b/app/code/Magento/Backend/composer.json index 5a535b1331b0f..7d428636a1f45 100644 --- a/app/code/Magento/Backend/composer.json +++ b/app/code/Magento/Backend/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-backend", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/module-store": "100.2.*", "magento/module-directory": "100.2.*", "magento/module-developer": "100.2.*", diff --git a/app/code/Magento/Backup/composer.json b/app/code/Magento/Backup/composer.json index a912e1498806f..21ed6f1780a41 100644 --- a/app/code/Magento/Backup/composer.json +++ b/app/code/Magento/Backup/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-backup", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/module-store": "100.2.*", "magento/module-backend": "100.2.*", "magento/module-cron": "100.2.*", diff --git a/app/code/Magento/Braintree/composer.json b/app/code/Magento/Braintree/composer.json index fb833f763f370..17beb93b2fc39 100644 --- a/app/code/Magento/Braintree/composer.json +++ b/app/code/Magento/Braintree/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-braintree", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/framework": "100.2.*", "magento/magento-composer-installer": "*", "magento/module-config": "100.2.*", diff --git a/app/code/Magento/Bundle/composer.json b/app/code/Magento/Bundle/composer.json index 77efd50f8ef2d..ab587044476db 100644 --- a/app/code/Magento/Bundle/composer.json +++ b/app/code/Magento/Bundle/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-bundle", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/module-store": "100.2.*", "magento/module-catalog": "101.1.*", "magento/module-tax": "100.2.*", diff --git a/app/code/Magento/BundleImportExport/composer.json b/app/code/Magento/BundleImportExport/composer.json index b176f17e0dfce..3d7900d98287c 100644 --- a/app/code/Magento/BundleImportExport/composer.json +++ b/app/code/Magento/BundleImportExport/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-bundle-import-export", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/module-catalog": "101.1.*", "magento/module-import-export": "100.2.*", "magento/module-catalog-import-export": "100.2.*", diff --git a/app/code/Magento/CacheInvalidate/composer.json b/app/code/Magento/CacheInvalidate/composer.json index 6b52555f2ac53..cafccadb41ad8 100644 --- a/app/code/Magento/CacheInvalidate/composer.json +++ b/app/code/Magento/CacheInvalidate/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-cache-invalidate", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/module-page-cache": "100.2.*", "magento/framework": "100.2.*" }, diff --git a/app/code/Magento/Captcha/composer.json b/app/code/Magento/Captcha/composer.json index 50ba19c82b8a1..9d0ce3db92aa4 100644 --- a/app/code/Magento/Captcha/composer.json +++ b/app/code/Magento/Captcha/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-captcha", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/module-store": "100.2.*", "magento/module-customer": "100.2.*", "magento/module-checkout": "100.2.*", diff --git a/app/code/Magento/Catalog/composer.json b/app/code/Magento/Catalog/composer.json index 3c401b78b2f6d..5e638922139b3 100644 --- a/app/code/Magento/Catalog/composer.json +++ b/app/code/Magento/Catalog/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-catalog", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/module-store": "100.2.*", "magento/module-eav": "100.2.*", "magento/module-cms": "101.1.*", diff --git a/app/code/Magento/CatalogImportExport/composer.json b/app/code/Magento/CatalogImportExport/composer.json index da6745e141937..7dbd7f4bc5e65 100644 --- a/app/code/Magento/CatalogImportExport/composer.json +++ b/app/code/Magento/CatalogImportExport/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-catalog-import-export", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/module-catalog": "101.1.*", "magento/module-catalog-url-rewrite": "100.2.*", "magento/module-eav": "100.2.*", diff --git a/app/code/Magento/CatalogInventory/composer.json b/app/code/Magento/CatalogInventory/composer.json index 409492667e5dd..254d8d2db4bf9 100644 --- a/app/code/Magento/CatalogInventory/composer.json +++ b/app/code/Magento/CatalogInventory/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-catalog-inventory", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/module-config": "100.2.*", "magento/module-store": "100.2.*", "magento/module-catalog": "101.1.*", diff --git a/app/code/Magento/CatalogRule/composer.json b/app/code/Magento/CatalogRule/composer.json index e89ae17b2cb1f..71eb5b49db1fc 100644 --- a/app/code/Magento/CatalogRule/composer.json +++ b/app/code/Magento/CatalogRule/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-catalog-rule", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/module-store": "100.2.*", "magento/module-rule": "100.2.*", "magento/module-catalog": "101.1.*", diff --git a/app/code/Magento/CatalogRuleConfigurable/composer.json b/app/code/Magento/CatalogRuleConfigurable/composer.json index a46ef45dc4f6c..994958bb03b86 100644 --- a/app/code/Magento/CatalogRuleConfigurable/composer.json +++ b/app/code/Magento/CatalogRuleConfigurable/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-catalog-rule-configurable", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/module-configurable-product": "100.2.*", "magento/framework": "100.2.*", "magento/magento-composer-installer": "*" diff --git a/app/code/Magento/CatalogSearch/composer.json b/app/code/Magento/CatalogSearch/composer.json index d4fda756f4d64..49756420bd230 100644 --- a/app/code/Magento/CatalogSearch/composer.json +++ b/app/code/Magento/CatalogSearch/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-catalog-search", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/module-store": "100.2.*", "magento/module-catalog": "101.1.*", "magento/module-search": "100.2.*", diff --git a/app/code/Magento/CatalogUrlRewrite/composer.json b/app/code/Magento/CatalogUrlRewrite/composer.json index 17dde501b9c6b..8fd54cbc8ee83 100644 --- a/app/code/Magento/CatalogUrlRewrite/composer.json +++ b/app/code/Magento/CatalogUrlRewrite/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-catalog-url-rewrite", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/module-backend": "100.2.*", "magento/module-catalog": "101.1.*", "magento/module-catalog-import-export": "100.2.*", diff --git a/app/code/Magento/CatalogWidget/composer.json b/app/code/Magento/CatalogWidget/composer.json index 3249aae83379a..330f46176286c 100644 --- a/app/code/Magento/CatalogWidget/composer.json +++ b/app/code/Magento/CatalogWidget/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-catalog-widget", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/module-catalog": "101.1.*", "magento/module-widget": "100.2.*", "magento/module-backend": "100.2.*", diff --git a/app/code/Magento/Checkout/composer.json b/app/code/Magento/Checkout/composer.json index 6aa7486bc5072..5545e409b65ab 100644 --- a/app/code/Magento/Checkout/composer.json +++ b/app/code/Magento/Checkout/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-checkout", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/module-store": "100.2.*", "magento/module-sales": "100.2.*", "magento/module-backend": "100.2.*", diff --git a/app/code/Magento/CheckoutAgreements/composer.json b/app/code/Magento/CheckoutAgreements/composer.json index 734922dff9322..afb706a39a25e 100644 --- a/app/code/Magento/CheckoutAgreements/composer.json +++ b/app/code/Magento/CheckoutAgreements/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-checkout-agreements", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/module-checkout": "100.2.*", "magento/module-quote": "100.2.*", "magento/module-store": "100.2.*", diff --git a/app/code/Magento/Cms/composer.json b/app/code/Magento/Cms/composer.json index 897f00d3de9b7..66f6da042e6c9 100644 --- a/app/code/Magento/Cms/composer.json +++ b/app/code/Magento/Cms/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-cms", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/module-store": "100.2.*", "magento/module-theme": "100.2.*", "magento/module-widget": "100.2.*", diff --git a/app/code/Magento/CmsUrlRewrite/composer.json b/app/code/Magento/CmsUrlRewrite/composer.json index 51e21052772f9..1ae1efd9350a7 100644 --- a/app/code/Magento/CmsUrlRewrite/composer.json +++ b/app/code/Magento/CmsUrlRewrite/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-cms-url-rewrite", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/module-store": "100.2.*", "magento/module-cms": "101.1.*", "magento/module-url-rewrite": "100.2.*", diff --git a/app/code/Magento/Config/composer.json b/app/code/Magento/Config/composer.json index 61ca2b198cb9d..bdd1a9c14ae68 100644 --- a/app/code/Magento/Config/composer.json +++ b/app/code/Magento/Config/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-config", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/framework": "100.2.*", "magento/module-store": "100.2.*", "magento/module-cron": "100.2.*", diff --git a/app/code/Magento/ConfigurableImportExport/composer.json b/app/code/Magento/ConfigurableImportExport/composer.json index af59b7c8de1bb..6c249134d2862 100644 --- a/app/code/Magento/ConfigurableImportExport/composer.json +++ b/app/code/Magento/ConfigurableImportExport/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-configurable-import-export", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/module-catalog": "101.1.*", "magento/module-catalog-import-export": "100.2.*", "magento/module-eav": "100.2.*", diff --git a/app/code/Magento/ConfigurableProduct/composer.json b/app/code/Magento/ConfigurableProduct/composer.json index aa2440aa43844..d7441f577c1db 100644 --- a/app/code/Magento/ConfigurableProduct/composer.json +++ b/app/code/Magento/ConfigurableProduct/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-configurable-product", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/module-store": "100.2.*", "magento/module-catalog": "101.1.*", "magento/module-catalog-inventory": "100.2.*", diff --git a/app/code/Magento/Contact/composer.json b/app/code/Magento/Contact/composer.json index 987eb0bc8c3d8..b541f1e7a0ed3 100644 --- a/app/code/Magento/Contact/composer.json +++ b/app/code/Magento/Contact/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-contact", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/module-config": "100.2.*", "magento/module-store": "100.2.*", "magento/module-customer": "100.2.*", diff --git a/app/code/Magento/Cookie/composer.json b/app/code/Magento/Cookie/composer.json index 5185ac86137bf..5222975723385 100644 --- a/app/code/Magento/Cookie/composer.json +++ b/app/code/Magento/Cookie/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-cookie", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/module-store": "100.2.*", "magento/framework": "100.2.*" }, diff --git a/app/code/Magento/Cron/composer.json b/app/code/Magento/Cron/composer.json index af92118f5fb58..b1155c028f919 100644 --- a/app/code/Magento/Cron/composer.json +++ b/app/code/Magento/Cron/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-cron", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/module-store": "100.2.*", "magento/framework": "100.2.*" }, diff --git a/app/code/Magento/CurrencySymbol/composer.json b/app/code/Magento/CurrencySymbol/composer.json index d3ce3e959beb6..2cdfedadf7a38 100644 --- a/app/code/Magento/CurrencySymbol/composer.json +++ b/app/code/Magento/CurrencySymbol/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-currency-symbol", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/module-config": "100.2.*", "magento/module-store": "100.2.*", "magento/module-page-cache": "100.2.*", diff --git a/app/code/Magento/Customer/composer.json b/app/code/Magento/Customer/composer.json index e845476287b79..74f0ebc2b5e00 100644 --- a/app/code/Magento/Customer/composer.json +++ b/app/code/Magento/Customer/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-customer", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/module-store": "100.2.*", "magento/module-eav": "100.2.*", "magento/module-directory": "100.2.*", diff --git a/app/code/Magento/CustomerImportExport/composer.json b/app/code/Magento/CustomerImportExport/composer.json index 8aee70d0a240b..533f40c7688e4 100644 --- a/app/code/Magento/CustomerImportExport/composer.json +++ b/app/code/Magento/CustomerImportExport/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-customer-import-export", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/module-store": "100.2.*", "magento/module-backend": "100.2.*", "magento/module-customer": "100.2.*", diff --git a/app/code/Magento/Deploy/composer.json b/app/code/Magento/Deploy/composer.json index 3d69f9864698a..05db53f039027 100644 --- a/app/code/Magento/Deploy/composer.json +++ b/app/code/Magento/Deploy/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-deploy", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/framework": "100.2.*", "magento/module-store": "100.2.*", "magento/module-theme": "100.2.*", diff --git a/app/code/Magento/Developer/composer.json b/app/code/Magento/Developer/composer.json index 40017ec827ac2..df2787403f1c1 100644 --- a/app/code/Magento/Developer/composer.json +++ b/app/code/Magento/Developer/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-developer", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/module-store": "100.2.*", "magento/framework": "100.2.*" }, diff --git a/app/code/Magento/Dhl/composer.json b/app/code/Magento/Dhl/composer.json index 46ebc809ff8d4..e88cd535952d6 100644 --- a/app/code/Magento/Dhl/composer.json +++ b/app/code/Magento/Dhl/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-dhl", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/module-config": "100.2.*", "magento/module-store": "100.2.*", "magento/module-shipping": "100.2.*", diff --git a/app/code/Magento/Directory/composer.json b/app/code/Magento/Directory/composer.json index a59ee693785da..9b3b253c26a35 100644 --- a/app/code/Magento/Directory/composer.json +++ b/app/code/Magento/Directory/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-directory", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/module-config": "100.2.*", "magento/module-store": "100.2.*", "magento/module-backend": "100.2.*", diff --git a/app/code/Magento/Downloadable/composer.json b/app/code/Magento/Downloadable/composer.json index 413bbed80e5be..8d8814740ccd1 100644 --- a/app/code/Magento/Downloadable/composer.json +++ b/app/code/Magento/Downloadable/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-downloadable", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/module-store": "100.2.*", "magento/module-catalog": "101.1.*", "magento/module-customer": "100.2.*", diff --git a/app/code/Magento/DownloadableImportExport/composer.json b/app/code/Magento/DownloadableImportExport/composer.json index 4718b8c13e952..c99a0d6d05b82 100644 --- a/app/code/Magento/DownloadableImportExport/composer.json +++ b/app/code/Magento/DownloadableImportExport/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-downloadable-import-export", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/module-catalog": "101.1.*", "magento/module-import-export": "100.2.*", "magento/module-catalog-import-export": "100.2.*", diff --git a/app/code/Magento/Eav/composer.json b/app/code/Magento/Eav/composer.json index 6fb9fb0cb2cf3..16e62a6434a26 100644 --- a/app/code/Magento/Eav/composer.json +++ b/app/code/Magento/Eav/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-eav", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/module-store": "100.2.*", "magento/module-backend": "100.2.*", "magento/module-catalog": "101.1.*", diff --git a/app/code/Magento/Email/composer.json b/app/code/Magento/Email/composer.json index 081b94e4a17d1..1b03ad7705cc6 100644 --- a/app/code/Magento/Email/composer.json +++ b/app/code/Magento/Email/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-email", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/module-theme": "100.2.*", "magento/module-config": "100.2.*", "magento/module-store": "100.2.*", diff --git a/app/code/Magento/EncryptionKey/composer.json b/app/code/Magento/EncryptionKey/composer.json index 5fcb0c936288d..6d7ff5558734a 100644 --- a/app/code/Magento/EncryptionKey/composer.json +++ b/app/code/Magento/EncryptionKey/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-encryption-key", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/module-config": "100.2.*", "magento/module-backend": "100.2.*", "magento/framework": "100.2.*" diff --git a/app/code/Magento/Fedex/composer.json b/app/code/Magento/Fedex/composer.json index 5934776c81081..d27d5c1c60d40 100644 --- a/app/code/Magento/Fedex/composer.json +++ b/app/code/Magento/Fedex/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-fedex", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/module-store": "100.2.*", "magento/module-shipping": "100.2.*", "magento/module-directory": "100.2.*", diff --git a/app/code/Magento/GiftMessage/composer.json b/app/code/Magento/GiftMessage/composer.json index ace05fc1d084b..04c620dc36db5 100644 --- a/app/code/Magento/GiftMessage/composer.json +++ b/app/code/Magento/GiftMessage/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-gift-message", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/module-store": "100.2.*", "magento/module-catalog": "101.1.*", "magento/module-checkout": "100.2.*", diff --git a/app/code/Magento/GoogleAdwords/composer.json b/app/code/Magento/GoogleAdwords/composer.json index 0ec802f837568..ad3df5c0b8b26 100644 --- a/app/code/Magento/GoogleAdwords/composer.json +++ b/app/code/Magento/GoogleAdwords/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-google-adwords", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/module-store": "100.2.*", "magento/module-sales": "100.2.*", "magento/framework": "100.2.*" diff --git a/app/code/Magento/GoogleAnalytics/composer.json b/app/code/Magento/GoogleAnalytics/composer.json index 7fdf4395f3e68..4cccc7bd0cbff 100644 --- a/app/code/Magento/GoogleAnalytics/composer.json +++ b/app/code/Magento/GoogleAnalytics/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-google-analytics", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/module-store": "100.2.*", "magento/module-sales": "100.2.*", "magento/framework": "100.2.*", diff --git a/app/code/Magento/GoogleOptimizer/composer.json b/app/code/Magento/GoogleOptimizer/composer.json index f269aad3dff69..20a48fc78060b 100644 --- a/app/code/Magento/GoogleOptimizer/composer.json +++ b/app/code/Magento/GoogleOptimizer/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-google-optimizer", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/module-store": "100.2.*", "magento/module-google-analytics": "100.2.*", "magento/module-catalog": "101.1.*", diff --git a/app/code/Magento/GroupedImportExport/composer.json b/app/code/Magento/GroupedImportExport/composer.json index 9af72d5e959cd..b036a8d5d528b 100644 --- a/app/code/Magento/GroupedImportExport/composer.json +++ b/app/code/Magento/GroupedImportExport/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-grouped-import-export", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/module-catalog": "101.1.*", "magento/module-import-export": "100.2.*", "magento/module-catalog-import-export": "100.2.*", diff --git a/app/code/Magento/GroupedProduct/composer.json b/app/code/Magento/GroupedProduct/composer.json index 944b45c7d584e..69aed21428445 100644 --- a/app/code/Magento/GroupedProduct/composer.json +++ b/app/code/Magento/GroupedProduct/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-grouped-product", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/module-store": "100.2.*", "magento/module-catalog": "101.1.*", "magento/module-catalog-inventory": "100.2.*", diff --git a/app/code/Magento/ImportExport/composer.json b/app/code/Magento/ImportExport/composer.json index 642c653dc9750..35a088cbd9c91 100644 --- a/app/code/Magento/ImportExport/composer.json +++ b/app/code/Magento/ImportExport/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-import-export", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/module-store": "100.2.*", "magento/module-backend": "100.2.*", "magento/module-eav": "100.2.*", diff --git a/app/code/Magento/Indexer/composer.json b/app/code/Magento/Indexer/composer.json index ffb0a76b34ffe..cbaab12f6ee28 100644 --- a/app/code/Magento/Indexer/composer.json +++ b/app/code/Magento/Indexer/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-indexer", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/module-backend": "100.2.*", "magento/framework": "100.2.*" }, diff --git a/app/code/Magento/Integration/composer.json b/app/code/Magento/Integration/composer.json index 17f0f616a915c..028e56472268a 100644 --- a/app/code/Magento/Integration/composer.json +++ b/app/code/Magento/Integration/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-integration", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/module-store": "100.2.*", "magento/module-backend": "100.2.*", "magento/module-customer": "100.2.*", diff --git a/app/code/Magento/LayeredNavigation/composer.json b/app/code/Magento/LayeredNavigation/composer.json index 46995fbe03d6e..99299c3e4a32c 100644 --- a/app/code/Magento/LayeredNavigation/composer.json +++ b/app/code/Magento/LayeredNavigation/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-layered-navigation", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/module-config": "100.2.*", "magento/module-catalog": "101.1.*", "magento/framework": "100.2.*" diff --git a/app/code/Magento/Marketplace/composer.json b/app/code/Magento/Marketplace/composer.json index 6f2a4cfcb47a9..2916ff94544bc 100644 --- a/app/code/Magento/Marketplace/composer.json +++ b/app/code/Magento/Marketplace/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-marketplace", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/framework": "100.2.*", "magento/module-backend": "100.2.*" }, diff --git a/app/code/Magento/MediaStorage/composer.json b/app/code/Magento/MediaStorage/composer.json index ff180cfbc6804..fa7858d5b0aff 100644 --- a/app/code/Magento/MediaStorage/composer.json +++ b/app/code/Magento/MediaStorage/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-media-storage", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/module-store": "100.2.*", "magento/module-backend": "100.2.*", "magento/module-config": "100.2.*", diff --git a/app/code/Magento/Msrp/composer.json b/app/code/Magento/Msrp/composer.json index e1edf0d8a8dde..b86374e6be277 100644 --- a/app/code/Magento/Msrp/composer.json +++ b/app/code/Magento/Msrp/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-msrp", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/module-store": "100.2.*", "magento/module-catalog": "101.1.*", "magento/module-downloadable": "100.2.*", diff --git a/app/code/Magento/Multishipping/composer.json b/app/code/Magento/Multishipping/composer.json index b97ebd181de74..8d9ac91cd05a0 100644 --- a/app/code/Magento/Multishipping/composer.json +++ b/app/code/Magento/Multishipping/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-multishipping", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/module-store": "100.2.*", "magento/module-checkout": "100.2.*", "magento/module-sales": "100.2.*", diff --git a/app/code/Magento/NewRelicReporting/composer.json b/app/code/Magento/NewRelicReporting/composer.json index 9673353984d0a..9faa17d454e50 100644 --- a/app/code/Magento/NewRelicReporting/composer.json +++ b/app/code/Magento/NewRelicReporting/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-new-relic-reporting", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/module-store": "100.2.*", "magento/module-backend": "100.2.*", "magento/module-customer": "100.2.*", diff --git a/app/code/Magento/Newsletter/composer.json b/app/code/Magento/Newsletter/composer.json index a206b86fc37ae..d6746f48dcbe5 100644 --- a/app/code/Magento/Newsletter/composer.json +++ b/app/code/Magento/Newsletter/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-newsletter", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/module-store": "100.2.*", "magento/module-customer": "100.2.*", "magento/module-widget": "100.2.*", diff --git a/app/code/Magento/OfflinePayments/composer.json b/app/code/Magento/OfflinePayments/composer.json index 707e657004e3d..52deb08ba3d90 100644 --- a/app/code/Magento/OfflinePayments/composer.json +++ b/app/code/Magento/OfflinePayments/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-offline-payments", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/module-checkout": "100.2.*", "magento/module-payment": "100.2.*", "magento/framework": "100.2.*" diff --git a/app/code/Magento/OfflineShipping/composer.json b/app/code/Magento/OfflineShipping/composer.json index 69d3f7b1eb053..e9a759057d322 100644 --- a/app/code/Magento/OfflineShipping/composer.json +++ b/app/code/Magento/OfflineShipping/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-offline-shipping", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/module-config": "100.2.*", "magento/module-store": "100.2.*", "magento/module-backend": "100.2.*", diff --git a/app/code/Magento/PageCache/composer.json b/app/code/Magento/PageCache/composer.json index 6eaf0c9731202..5c29e4fc3c970 100644 --- a/app/code/Magento/PageCache/composer.json +++ b/app/code/Magento/PageCache/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-page-cache", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/module-config": "100.2.*", "magento/module-store": "100.2.*", "magento/module-backend": "100.2.*", diff --git a/app/code/Magento/Payment/composer.json b/app/code/Magento/Payment/composer.json index a156849e24313..35ff326d916bd 100644 --- a/app/code/Magento/Payment/composer.json +++ b/app/code/Magento/Payment/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-payment", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/module-config": "100.2.*", "magento/module-store": "100.2.*", "magento/module-sales": "100.2.*", diff --git a/app/code/Magento/Paypal/composer.json b/app/code/Magento/Paypal/composer.json index b0bdb0d62f03e..bddc5d91a9458 100644 --- a/app/code/Magento/Paypal/composer.json +++ b/app/code/Magento/Paypal/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-paypal", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/module-config": "100.2.*", "magento/module-store": "100.2.*", "magento/module-checkout": "100.2.*", diff --git a/app/code/Magento/Persistent/composer.json b/app/code/Magento/Persistent/composer.json index d165344851ab2..25cc9d76acd76 100644 --- a/app/code/Magento/Persistent/composer.json +++ b/app/code/Magento/Persistent/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-persistent", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/module-store": "100.2.*", "magento/module-checkout": "100.2.*", "magento/module-customer": "100.2.*", diff --git a/app/code/Magento/ProductAlert/composer.json b/app/code/Magento/ProductAlert/composer.json index 6e143b5fb7e59..a43a522097403 100644 --- a/app/code/Magento/ProductAlert/composer.json +++ b/app/code/Magento/ProductAlert/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-product-alert", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/module-backend": "100.2.*", "magento/module-store": "100.2.*", "magento/module-catalog": "101.1.*", diff --git a/app/code/Magento/ProductVideo/composer.json b/app/code/Magento/ProductVideo/composer.json index 3ba8aef446d0c..362fd006d2690 100644 --- a/app/code/Magento/ProductVideo/composer.json +++ b/app/code/Magento/ProductVideo/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-product-video", "description": "Add Video to Products", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/module-catalog": "101.1.*", "magento/module-backend": "100.2.*", "magento/module-eav": "100.2.*", diff --git a/app/code/Magento/Quote/composer.json b/app/code/Magento/Quote/composer.json index bab6a636b5b5b..3d6fb04674bba 100644 --- a/app/code/Magento/Quote/composer.json +++ b/app/code/Magento/Quote/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-quote", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/module-store": "100.2.*", "magento/module-catalog": "101.1.*", "magento/module-customer": "100.2.*", diff --git a/app/code/Magento/Reports/composer.json b/app/code/Magento/Reports/composer.json index f6687eba4e68b..0bb989cb54ac8 100644 --- a/app/code/Magento/Reports/composer.json +++ b/app/code/Magento/Reports/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-reports", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/module-config": "100.2.*", "magento/module-store": "100.2.*", "magento/module-eav": "100.2.*", diff --git a/app/code/Magento/RequireJs/composer.json b/app/code/Magento/RequireJs/composer.json index 7948aeecebb05..8c9fed33ab730 100644 --- a/app/code/Magento/RequireJs/composer.json +++ b/app/code/Magento/RequireJs/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-require-js", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/framework": "100.2.*" }, "type": "magento2-module", diff --git a/app/code/Magento/Review/composer.json b/app/code/Magento/Review/composer.json index 29eb5cf1e568f..09f5529feabdd 100644 --- a/app/code/Magento/Review/composer.json +++ b/app/code/Magento/Review/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-review", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/module-store": "100.2.*", "magento/module-catalog": "101.1.*", "magento/module-customer": "100.2.*", diff --git a/app/code/Magento/Rss/composer.json b/app/code/Magento/Rss/composer.json index 29731136602bd..d35f0ee6ebecb 100644 --- a/app/code/Magento/Rss/composer.json +++ b/app/code/Magento/Rss/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-rss", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/module-store": "100.2.*", "magento/module-backend": "100.2.*", "magento/framework": "100.2.*", diff --git a/app/code/Magento/Rule/composer.json b/app/code/Magento/Rule/composer.json index a4bc7c0d3c7ad..95b8e6ffec2a6 100644 --- a/app/code/Magento/Rule/composer.json +++ b/app/code/Magento/Rule/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-rule", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/module-store": "100.2.*", "magento/module-eav": "100.2.*", "magento/module-catalog": "101.1.*", diff --git a/app/code/Magento/Sales/composer.json b/app/code/Magento/Sales/composer.json index d6e19280565f8..09d1a9d6b7dd4 100644 --- a/app/code/Magento/Sales/composer.json +++ b/app/code/Magento/Sales/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-sales", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/module-store": "100.2.*", "magento/module-catalog": "101.1.*", "magento/module-customer": "100.2.*", diff --git a/app/code/Magento/SalesRule/composer.json b/app/code/Magento/SalesRule/composer.json index 80a0802f2f557..fabef581762a8 100644 --- a/app/code/Magento/SalesRule/composer.json +++ b/app/code/Magento/SalesRule/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-sales-rule", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/module-config": "100.2.*", "magento/module-store": "100.2.*", "magento/module-rule": "100.2.*", diff --git a/app/code/Magento/SalesSequence/composer.json b/app/code/Magento/SalesSequence/composer.json index 5689a019806d2..eeda2be05e68f 100644 --- a/app/code/Magento/SalesSequence/composer.json +++ b/app/code/Magento/SalesSequence/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-sales-sequence", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/framework": "100.2.*" }, "type": "magento2-module", diff --git a/app/code/Magento/SampleData/composer.json b/app/code/Magento/SampleData/composer.json index 3fda6ff798d69..936bbf0d6be3a 100644 --- a/app/code/Magento/SampleData/composer.json +++ b/app/code/Magento/SampleData/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-sample-data", "description": "Sample Data fixtures", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/framework": "100.2.*" }, "suggest": { diff --git a/app/code/Magento/Search/composer.json b/app/code/Magento/Search/composer.json index a4c1fa8902390..cc95e6784526f 100644 --- a/app/code/Magento/Search/composer.json +++ b/app/code/Magento/Search/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-search", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/framework": "100.2.*", "magento/module-backend": "100.2.*", "magento/module-catalog-search": "100.2.*", diff --git a/app/code/Magento/Security/composer.json b/app/code/Magento/Security/composer.json index fd2feb9e50f2a..f64c0f0b29d28 100644 --- a/app/code/Magento/Security/composer.json +++ b/app/code/Magento/Security/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-security", "description": "Security management module", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/module-backend": "100.2.*", "magento/module-store": "100.2.*", "magento/framework": "100.2.*" diff --git a/app/code/Magento/SendFriend/composer.json b/app/code/Magento/SendFriend/composer.json index a18523b95b456..de9dbf7a84576 100644 --- a/app/code/Magento/SendFriend/composer.json +++ b/app/code/Magento/SendFriend/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-send-friend", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/module-store": "100.2.*", "magento/module-catalog": "101.1.*", "magento/module-customer": "100.2.*", diff --git a/app/code/Magento/Shipping/composer.json b/app/code/Magento/Shipping/composer.json index de12c13c7cab0..dc9ea808c0f7b 100644 --- a/app/code/Magento/Shipping/composer.json +++ b/app/code/Magento/Shipping/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-shipping", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/module-store": "100.2.*", "magento/module-catalog": "101.1.*", "magento/module-sales": "100.2.*", diff --git a/app/code/Magento/Sitemap/composer.json b/app/code/Magento/Sitemap/composer.json index 419d95a07159e..be553a4da194f 100644 --- a/app/code/Magento/Sitemap/composer.json +++ b/app/code/Magento/Sitemap/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-sitemap", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/module-store": "100.2.*", "magento/module-catalog": "101.1.*", "magento/module-eav": "100.2.*", diff --git a/app/code/Magento/Store/composer.json b/app/code/Magento/Store/composer.json index 50d54966a9b4c..b9f76f6c2c313 100644 --- a/app/code/Magento/Store/composer.json +++ b/app/code/Magento/Store/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-store", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/module-catalog": "101.1.*", "magento/module-directory": "100.2.*", "magento/module-ui": "100.2.*", diff --git a/app/code/Magento/Swagger/composer.json b/app/code/Magento/Swagger/composer.json index f30fa606c6d77..dc2d1cbee003d 100644 --- a/app/code/Magento/Swagger/composer.json +++ b/app/code/Magento/Swagger/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-swagger", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/framework": "100.2.*" }, "type": "magento2-module", diff --git a/app/code/Magento/Swatches/composer.json b/app/code/Magento/Swatches/composer.json index db3da5c4f27f4..f87fdb635cb73 100644 --- a/app/code/Magento/Swatches/composer.json +++ b/app/code/Magento/Swatches/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-swatches", "description": "Add Swatches to Products", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/module-catalog": "101.1.*", "magento/module-configurable-product": "100.2.*", "magento/module-eav": "100.2.*", diff --git a/app/code/Magento/SwatchesLayeredNavigation/composer.json b/app/code/Magento/SwatchesLayeredNavigation/composer.json index f8d7fac97dc13..9b658d0a42e61 100644 --- a/app/code/Magento/SwatchesLayeredNavigation/composer.json +++ b/app/code/Magento/SwatchesLayeredNavigation/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-swatches-layered-navigation", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/framework": "100.2.*", "magento/magento-composer-installer": "*" }, diff --git a/app/code/Magento/Tax/composer.json b/app/code/Magento/Tax/composer.json index 9063d4f039554..4553fdbb38332 100644 --- a/app/code/Magento/Tax/composer.json +++ b/app/code/Magento/Tax/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-tax", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/module-config": "100.2.*", "magento/module-store": "100.2.*", "magento/module-catalog": "101.1.*", diff --git a/app/code/Magento/TaxImportExport/composer.json b/app/code/Magento/TaxImportExport/composer.json index faa66cbaaf906..c3d09e4926e02 100644 --- a/app/code/Magento/TaxImportExport/composer.json +++ b/app/code/Magento/TaxImportExport/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-tax-import-export", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/module-tax": "100.2.*", "magento/module-backend": "100.2.*", "magento/module-directory": "100.2.*", diff --git a/app/code/Magento/Theme/composer.json b/app/code/Magento/Theme/composer.json index dad8bac7c254b..49382f9642fa5 100644 --- a/app/code/Magento/Theme/composer.json +++ b/app/code/Magento/Theme/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-theme", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/module-store": "100.2.*", "magento/module-customer": "100.2.*", "magento/module-backend": "100.2.*", diff --git a/app/code/Magento/Translation/composer.json b/app/code/Magento/Translation/composer.json index 67a0582986f68..9ea00544d8050 100644 --- a/app/code/Magento/Translation/composer.json +++ b/app/code/Magento/Translation/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-translation", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/module-backend": "100.2.*", "magento/module-developer": "100.2.*", "magento/module-store": "100.2.*", diff --git a/app/code/Magento/Ui/composer.json b/app/code/Magento/Ui/composer.json index cea9711ddda7b..43c7b7fa3011f 100644 --- a/app/code/Magento/Ui/composer.json +++ b/app/code/Magento/Ui/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-ui", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/module-backend": "100.2.*", "magento/framework": "100.2.*", "magento/module-eav": "100.2.*", diff --git a/app/code/Magento/Ups/composer.json b/app/code/Magento/Ups/composer.json index 1ddbfa2a0cb9f..ade4e738a68ef 100644 --- a/app/code/Magento/Ups/composer.json +++ b/app/code/Magento/Ups/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-ups", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/module-store": "100.2.*", "magento/module-backend": "100.2.*", "magento/module-sales": "100.2.*", diff --git a/app/code/Magento/UrlRewrite/composer.json b/app/code/Magento/UrlRewrite/composer.json index 87e4f357f4abd..ac75ecdf61b8f 100644 --- a/app/code/Magento/UrlRewrite/composer.json +++ b/app/code/Magento/UrlRewrite/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-url-rewrite", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/module-catalog": "101.1.*", "magento/module-store": "100.2.*", "magento/framework": "100.2.*", diff --git a/app/code/Magento/User/composer.json b/app/code/Magento/User/composer.json index 4cdf24ff7513d..755c47ac11476 100644 --- a/app/code/Magento/User/composer.json +++ b/app/code/Magento/User/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-user", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/module-store": "100.2.*", "magento/module-authorization": "100.2.*", "magento/module-backend": "100.2.*", diff --git a/app/code/Magento/Usps/composer.json b/app/code/Magento/Usps/composer.json index d9e575675841c..5baccddf48843 100644 --- a/app/code/Magento/Usps/composer.json +++ b/app/code/Magento/Usps/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-usps", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/module-store": "100.2.*", "magento/module-shipping": "100.2.*", "magento/module-directory": "100.2.*", diff --git a/app/code/Magento/Variable/composer.json b/app/code/Magento/Variable/composer.json index 4cedfca248c98..21f3ec1dd467f 100644 --- a/app/code/Magento/Variable/composer.json +++ b/app/code/Magento/Variable/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-variable", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/module-backend": "100.2.*", "magento/module-email": "100.2.*", "magento/module-store": "100.2.*", diff --git a/app/code/Magento/Vault/composer.json b/app/code/Magento/Vault/composer.json index f3db74c215f26..74dd568e3b45e 100644 --- a/app/code/Magento/Vault/composer.json +++ b/app/code/Magento/Vault/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-vault", "description": "", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/framework": "100.2.*", "magento/module-sales": "100.2.*", "magento/module-store": "100.2.*", diff --git a/app/code/Magento/Version/composer.json b/app/code/Magento/Version/composer.json index ca8a0ef98d808..3a97243210115 100644 --- a/app/code/Magento/Version/composer.json +++ b/app/code/Magento/Version/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-version", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/framework": "100.2.*" }, "type": "magento2-module", diff --git a/app/code/Magento/Webapi/composer.json b/app/code/Magento/Webapi/composer.json index 4cf2eb86adee0..f2796df70a8fa 100644 --- a/app/code/Magento/Webapi/composer.json +++ b/app/code/Magento/Webapi/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-webapi", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/module-store": "100.2.*", "magento/module-authorization": "100.2.*", "magento/module-integration": "100.2.*", diff --git a/app/code/Magento/WebapiSecurity/composer.json b/app/code/Magento/WebapiSecurity/composer.json index f3e02f82511d4..506975f1aa188 100644 --- a/app/code/Magento/WebapiSecurity/composer.json +++ b/app/code/Magento/WebapiSecurity/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-webapi-security", "description": "WebapiSecurity module provides option to loosen security on some webapi resources.", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/module-webapi": "100.2.*", "magento/framework": "100.2.*" }, diff --git a/app/code/Magento/Weee/composer.json b/app/code/Magento/Weee/composer.json index baa70fa352d7a..20a43510937d2 100644 --- a/app/code/Magento/Weee/composer.json +++ b/app/code/Magento/Weee/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-weee", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/module-store": "100.2.*", "magento/module-catalog": "101.1.*", "magento/module-tax": "100.2.*", diff --git a/app/code/Magento/Widget/composer.json b/app/code/Magento/Widget/composer.json index f4885500b77e1..f59c4180eb2bb 100644 --- a/app/code/Magento/Widget/composer.json +++ b/app/code/Magento/Widget/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-widget", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/module-store": "100.2.*", "magento/module-cms": "101.1.*", "magento/module-backend": "100.2.*", diff --git a/app/code/Magento/Wishlist/composer.json b/app/code/Magento/Wishlist/composer.json index 68fbc5a30c8ed..3faee8912493c 100644 --- a/app/code/Magento/Wishlist/composer.json +++ b/app/code/Magento/Wishlist/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-wishlist", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/module-store": "100.2.*", "magento/module-customer": "100.2.*", "magento/module-catalog": "101.1.*", diff --git a/app/design/adminhtml/Magento/backend/composer.json b/app/design/adminhtml/Magento/backend/composer.json index 7686e3c3ef855..29569db622d2c 100644 --- a/app/design/adminhtml/Magento/backend/composer.json +++ b/app/design/adminhtml/Magento/backend/composer.json @@ -2,7 +2,7 @@ "name": "magento/theme-adminhtml-backend", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/framework": "100.2.*" }, "type": "magento2-theme", diff --git a/app/design/frontend/Magento/blank/composer.json b/app/design/frontend/Magento/blank/composer.json index 0297d02a4ef94..27ed40860dd5b 100644 --- a/app/design/frontend/Magento/blank/composer.json +++ b/app/design/frontend/Magento/blank/composer.json @@ -2,7 +2,7 @@ "name": "magento/theme-frontend-blank", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/framework": "100.2.*" }, "type": "magento2-theme", diff --git a/app/design/frontend/Magento/luma/composer.json b/app/design/frontend/Magento/luma/composer.json index 507ed10117d69..98fe0ebf8061c 100644 --- a/app/design/frontend/Magento/luma/composer.json +++ b/app/design/frontend/Magento/luma/composer.json @@ -2,7 +2,7 @@ "name": "magento/theme-frontend-luma", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/theme-frontend-blank": "100.2.*", "magento/framework": "100.2.*" }, diff --git a/composer.json b/composer.json index e95bd4e1a226d..b3f03934a8d24 100644 --- a/composer.json +++ b/composer.json @@ -8,7 +8,7 @@ "AFL-3.0" ], "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "zendframework/zend-stdlib": "~2.4.6", "zendframework/zend-code": "~2.4.6", "zendframework/zend-server": "~2.4.6", diff --git a/composer.lock b/composer.lock index fa33302ecd436..ed5139f8ce97d 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "aff7fa6dabe298220186da680893030c", - "content-hash": "38de5bfd21f69bb1a076b127b3a80d56", + "hash": "0d43c2433a233cc53691422c767682a4", + "content-hash": "30be9134c8762409332b13ecdb12098d", "packages": [ { "name": "braintree/braintree_php", @@ -1253,16 +1253,16 @@ }, { "name": "symfony/event-dispatcher", - "version": "v2.8.7", + "version": "v2.8.8", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "2a6b8713f8bdb582058cfda463527f195b066110" + "reference": "b180b70439dca70049b6b9b7e21d75e6e5d7aca9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/2a6b8713f8bdb582058cfda463527f195b066110", - "reference": "2a6b8713f8bdb582058cfda463527f195b066110", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/b180b70439dca70049b6b9b7e21d75e6e5d7aca9", + "reference": "b180b70439dca70049b6b9b7e21d75e6e5d7aca9", "shasum": "" }, "require": { @@ -1309,20 +1309,20 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2016-06-06 11:11:27" + "time": "2016-06-29 05:29:29" }, { "name": "symfony/filesystem", - "version": "v2.8.7", + "version": "v2.8.8", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "dee379131dceed90a429e951546b33edfe7dccbb" + "reference": "7258ddd6f987053f21fa43d03430580ba54e6096" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/dee379131dceed90a429e951546b33edfe7dccbb", - "reference": "dee379131dceed90a429e951546b33edfe7dccbb", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/7258ddd6f987053f21fa43d03430580ba54e6096", + "reference": "7258ddd6f987053f21fa43d03430580ba54e6096", "shasum": "" }, "require": { @@ -1358,20 +1358,20 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2016-04-12 18:01:21" + "time": "2016-06-29 05:31:50" }, { "name": "symfony/finder", - "version": "v3.1.1", + "version": "v3.1.2", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "40d17ed287bf51a2f884c4619ce8ff2a1c5cd219" + "reference": "8201978de88a9fa0923e18601bb17f1df9c721e7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/40d17ed287bf51a2f884c4619ce8ff2a1c5cd219", - "reference": "40d17ed287bf51a2f884c4619ce8ff2a1c5cd219", + "url": "https://api.github.com/repos/symfony/finder/zipball/8201978de88a9fa0923e18601bb17f1df9c721e7", + "reference": "8201978de88a9fa0923e18601bb17f1df9c721e7", "shasum": "" }, "require": { @@ -1407,20 +1407,20 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2016-05-13 18:06:41" + "time": "2016-06-29 05:41:56" }, { "name": "symfony/process", - "version": "v2.8.7", + "version": "v2.8.8", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "115347d00c342198cdc52a7bd8bc15b5ab43500c" + "reference": "89f33c16796415ccfd8bb3cf8d520cbb79899bfe" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/115347d00c342198cdc52a7bd8bc15b5ab43500c", - "reference": "115347d00c342198cdc52a7bd8bc15b5ab43500c", + "url": "https://api.github.com/repos/symfony/process/zipball/89f33c16796415ccfd8bb3cf8d520cbb79899bfe", + "reference": "89f33c16796415ccfd8bb3cf8d520cbb79899bfe", "shasum": "" }, "require": { @@ -1456,7 +1456,7 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2016-06-06 11:11:27" + "time": "2016-06-29 05:29:29" }, { "name": "tedivm/jshrink", @@ -4189,16 +4189,16 @@ }, { "name": "symfony/config", - "version": "v2.8.7", + "version": "v2.8.8", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "a2edd59c2163c65747fc3f35d132b5a39266bd05" + "reference": "0926e69411eba491803dbafb9f1f233e2ced58d0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/a2edd59c2163c65747fc3f35d132b5a39266bd05", - "reference": "a2edd59c2163c65747fc3f35d132b5a39266bd05", + "url": "https://api.github.com/repos/symfony/config/zipball/0926e69411eba491803dbafb9f1f233e2ced58d0", + "reference": "0926e69411eba491803dbafb9f1f233e2ced58d0", "shasum": "" }, "require": { @@ -4238,20 +4238,20 @@ ], "description": "Symfony Config Component", "homepage": "https://symfony.com", - "time": "2016-06-06 11:11:27" + "time": "2016-06-29 05:31:50" }, { "name": "symfony/dependency-injection", - "version": "v2.8.7", + "version": "v2.8.8", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "2d05009d890cf1139988ff059b5b2e0eb280ed13" + "reference": "2dd85de8216079d1360b2b14988cd5cdbbb49063" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/2d05009d890cf1139988ff059b5b2e0eb280ed13", - "reference": "2d05009d890cf1139988ff059b5b2e0eb280ed13", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/2dd85de8216079d1360b2b14988cd5cdbbb49063", + "reference": "2dd85de8216079d1360b2b14988cd5cdbbb49063", "shasum": "" }, "require": { @@ -4301,20 +4301,20 @@ ], "description": "Symfony DependencyInjection Component", "homepage": "https://symfony.com", - "time": "2016-06-06 11:11:27" + "time": "2016-06-29 05:31:50" }, { "name": "symfony/stopwatch", - "version": "v3.1.1", + "version": "v3.1.2", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", - "reference": "e7238f98c90b99e9b53f3674a91757228663b04d" + "reference": "bb42806b12c5f89db4ebf64af6741afe6d8457e1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/e7238f98c90b99e9b53f3674a91757228663b04d", - "reference": "e7238f98c90b99e9b53f3674a91757228663b04d", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/bb42806b12c5f89db4ebf64af6741afe6d8457e1", + "reference": "bb42806b12c5f89db4ebf64af6741afe6d8457e1", "shasum": "" }, "require": { @@ -4350,20 +4350,20 @@ ], "description": "Symfony Stopwatch Component", "homepage": "https://symfony.com", - "time": "2016-06-06 11:42:41" + "time": "2016-06-29 05:41:56" }, { "name": "symfony/yaml", - "version": "v2.8.7", + "version": "v2.8.8", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "815fabf3f48c7d1df345a69d1ad1a88f59757b34" + "reference": "dba4bb5846798cd12f32e2d8f3f35d77045773c8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/815fabf3f48c7d1df345a69d1ad1a88f59757b34", - "reference": "815fabf3f48c7d1df345a69d1ad1a88f59757b34", + "url": "https://api.github.com/repos/symfony/yaml/zipball/dba4bb5846798cd12f32e2d8f3f35d77045773c8", + "reference": "dba4bb5846798cd12f32e2d8f3f35d77045773c8", "shasum": "" }, "require": { @@ -4399,7 +4399,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2016-06-06 11:11:27" + "time": "2016-06-29 05:29:29" }, { "name": "theseer/fdomdocument", @@ -4450,7 +4450,7 @@ "prefer-stable": true, "prefer-lowest": false, "platform": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "lib-libxml": "*", "ext-ctype": "*", "ext-gd": "*", diff --git a/dev/tests/api-functional/_files/Magento/TestModuleIntegrationFromConfig/composer.json b/dev/tests/api-functional/_files/Magento/TestModuleIntegrationFromConfig/composer.json index d6b725ffd896a..629afd442a46e 100644 --- a/dev/tests/api-functional/_files/Magento/TestModuleIntegrationFromConfig/composer.json +++ b/dev/tests/api-functional/_files/Magento/TestModuleIntegrationFromConfig/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-test-module-integration-from-config", "description": "test integration create from config", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/framework": "0.42.0-beta8", "magento/module-integration": "0.42.0-beta8" }, diff --git a/dev/tests/api-functional/_files/Magento/TestModuleJoinDirectives/composer.json b/dev/tests/api-functional/_files/Magento/TestModuleJoinDirectives/composer.json index 28b53da6cd8fa..1e2d9c0fa13dd 100644 --- a/dev/tests/api-functional/_files/Magento/TestModuleJoinDirectives/composer.json +++ b/dev/tests/api-functional/_files/Magento/TestModuleJoinDirectives/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-test-join-directives", "description": "test integration for join directives", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/framework": "0.42.0-beta8", "magento/module-sales": "0.42.0-beta8" }, diff --git a/dev/tests/functional/composer.json b/dev/tests/functional/composer.json index f90a14e5491b5..c8db587759f53 100644 --- a/dev/tests/functional/composer.json +++ b/dev/tests/functional/composer.json @@ -1,7 +1,7 @@ { "require": { "magento/mtf": "1.0.0-rc43", - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "phpunit/phpunit": "4.1.0", "phpunit/phpunit-selenium": ">=1.2" }, diff --git a/dev/tests/integration/testsuite/Magento/Setup/Console/Command/_files/root/app/code/Magento/A/composer.json b/dev/tests/integration/testsuite/Magento/Setup/Console/Command/_files/root/app/code/Magento/A/composer.json index 5bc2a54a58610..222e5ff822b04 100644 --- a/dev/tests/integration/testsuite/Magento/Setup/Console/Command/_files/root/app/code/Magento/A/composer.json +++ b/dev/tests/integration/testsuite/Magento/Setup/Console/Command/_files/root/app/code/Magento/A/composer.json @@ -1,7 +1,7 @@ { "name": "magento/module-a", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/framework": "0.1", "magento/module-b": "0.1" }, diff --git a/dev/tests/integration/testsuite/Magento/Setup/Console/Command/_files/root/app/code/Magento/B/composer.json b/dev/tests/integration/testsuite/Magento/Setup/Console/Command/_files/root/app/code/Magento/B/composer.json index 5020e9e09f61f..57944758267fd 100644 --- a/dev/tests/integration/testsuite/Magento/Setup/Console/Command/_files/root/app/code/Magento/B/composer.json +++ b/dev/tests/integration/testsuite/Magento/Setup/Console/Command/_files/root/app/code/Magento/B/composer.json @@ -1,7 +1,7 @@ { "name": "magento/module-b", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/framework": "0.74.0-beta6", "magento/module-a": "0.1" }, diff --git a/dev/tests/integration/testsuite/Magento/Widget/_files/design/adminhtml/magento_basic/composer.json b/dev/tests/integration/testsuite/Magento/Widget/_files/design/adminhtml/magento_basic/composer.json index c4eaac5c94c17..920dc1289b0cf 100644 --- a/dev/tests/integration/testsuite/Magento/Widget/_files/design/adminhtml/magento_basic/composer.json +++ b/dev/tests/integration/testsuite/Magento/Widget/_files/design/adminhtml/magento_basic/composer.json @@ -2,7 +2,7 @@ "name": "magento/admin-Magento_Catalog", "description": "N/A", "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "magento/framework": "0.1.0-alpha103" }, "type": "magento2-theme", diff --git a/lib/internal/Magento/Framework/composer.json b/lib/internal/Magento/Framework/composer.json index 43bdd86e15659..e86bed1c03faf 100644 --- a/lib/internal/Magento/Framework/composer.json +++ b/lib/internal/Magento/Framework/composer.json @@ -8,7 +8,7 @@ "AFL-3.0" ], "require": { - "php": "~5.6.0|7.0.2|~7.0.6", + "php": "~5.6.0|7.0.2|7.0.4|~7.0.6", "ext-spl": "*", "ext-dom": "*", "ext-simplexml": "*", From 2fa88360817e3004f5dfd20413f8c4bf002aff49 Mon Sep 17 00:00:00 2001 From: Oleh Posyniak Date: Tue, 5 Jul 2016 14:36:14 +0300 Subject: [PATCH 62/67] MAGETWO-52981: [Github] Setup:upgrade does not work with custom mysql port #4548 --- .../DB/Test/Unit/Adapter/Pdo/MysqlTest.php | 39 +++++++++---------- .../Model/ResourceModel/Type/Db/Pdo/Mysql.php | 3 +- 2 files changed, 20 insertions(+), 22 deletions(-) diff --git a/lib/internal/Magento/Framework/DB/Test/Unit/Adapter/Pdo/MysqlTest.php b/lib/internal/Magento/Framework/DB/Test/Unit/Adapter/Pdo/MysqlTest.php index 2d0f39ac26b3c..feff4276cfc09 100644 --- a/lib/internal/Magento/Framework/DB/Test/Unit/Adapter/Pdo/MysqlTest.php +++ b/lib/internal/Magento/Framework/DB/Test/Unit/Adapter/Pdo/MysqlTest.php @@ -526,28 +526,27 @@ public function getIndexNameDataProvider() ]; } - /** - * @test - */ - public function connectPortThrow() + public function testConfigValidation() { - $arguments = [ - 'config' => ['host' => 'localhost'], - ]; - $subject = (new ObjectManager($this))->getObject(Mysql::class, $arguments); - $this->assertInstanceOf(Mysql::class, $subject); + $subject = (new ObjectManager($this))->getObject( + Mysql::class, + [ + 'config' => ['host' => 'localhost'], + ] + ); - $arguments = [ - 'config' => ['host' => 'localhost', 'port' => '33390'], - ]; + $this->assertInstanceOf(Mysql::class, $subject); + } - try { - (new ObjectManager($this))->getObject(Mysql::class, $arguments); - $this->fail('an expected exception was not thrown'); - } catch (\InvalidArgumentException $e) { - $expected = 'MySQL adapter: Port must be configured within host (like \'localhost:33390\') ' . - 'parameter, not within port'; - $this->assertSame($expected, $e->getMessage()); - } + /** + * @expectedException \InvalidArgumentException + * @expectedExceptionMessage Port must be configured within host (like 'localhost:33390') parameter, not within port + */ + public function testConfigValidationByPortWithException() + { + (new ObjectManager($this))->getObject( + Mysql::class, + ['config' => ['host' => 'localhost', 'port' => '33390']] + ); } } diff --git a/lib/internal/Magento/Framework/Model/ResourceModel/Type/Db/Pdo/Mysql.php b/lib/internal/Magento/Framework/Model/ResourceModel/Type/Db/Pdo/Mysql.php index 3f2769e0e6605..8b6a2c23386ff 100644 --- a/lib/internal/Magento/Framework/Model/ResourceModel/Type/Db/Pdo/Mysql.php +++ b/lib/internal/Magento/Framework/Model/ResourceModel/Type/Db/Pdo/Mysql.php @@ -116,8 +116,7 @@ private function getValidConfig(array $config) if (isset($config['port'])) { throw new \InvalidArgumentException( - "MySQL adapter: Port must be configured within host (like '$config[host]:$config[port]') parameter, " . - "not within port" + "Port must be configured within host (like '$config[host]:$config[port]') parameter, not within port" ); } From e4a94c23e451e8e5f850d91b86fd1347ce05a2a0 Mon Sep 17 00:00:00 2001 From: Bohdan Korablov Date: Tue, 5 Jul 2016 14:53:42 +0300 Subject: [PATCH 63/67] MAGETWO-53777: [Github] Magento 2.1 RC1 - Error when running CLI upgrade command #4795 --- .../Magento/Setup/Console/Command/UpgradeCommand.php | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/setup/src/Magento/Setup/Console/Command/UpgradeCommand.php b/setup/src/Magento/Setup/Console/Command/UpgradeCommand.php index 577e787bdd5f2..5d82eb6380c34 100644 --- a/setup/src/Magento/Setup/Console/Command/UpgradeCommand.php +++ b/setup/src/Magento/Setup/Console/Command/UpgradeCommand.php @@ -73,16 +73,6 @@ protected function configure() */ protected function execute(InputInterface $input, OutputInterface $output) { - $areaCode = 'setup'; - /** @var \Magento\Framework\ObjectManagerInterface $objectManager */ - $objectManager = $this->objectManagerProvider->get(); - /** @var \Magento\Framework\App\State $appState */ - $appState = $objectManager->get('Magento\Framework\App\State'); - $appState->setAreaCode($areaCode); - /** @var \Magento\Framework\ObjectManager\ConfigLoaderInterface $configLoader */ - $configLoader = $objectManager->get('Magento\Framework\ObjectManager\ConfigLoaderInterface'); - $objectManager->configure($configLoader->load($areaCode)); - $keepGenerated = $input->getOption(self::INPUT_KEY_KEEP_GENERATED); $installer = $this->installerFactory->create(new ConsoleLogger($output)); $installer->updateModulesSequence($keepGenerated); From 6d13f23658d3e209ea425b8a1673dc0ce6e9ef22 Mon Sep 17 00:00:00 2001 From: Bohdan Korablov Date: Wed, 6 Jul 2016 10:46:12 +0300 Subject: [PATCH 64/67] MAGETWO-53777: [Github] Magento 2.1 RC1 - Error when running CLI upgrade command #4795 --- .../Setup/Console/Command/UpgradeCommand.php | 10 +-------- .../Console/Command/UpgradeCommandTest.php | 22 +++---------------- 2 files changed, 4 insertions(+), 28 deletions(-) diff --git a/setup/src/Magento/Setup/Console/Command/UpgradeCommand.php b/setup/src/Magento/Setup/Console/Command/UpgradeCommand.php index 5d82eb6380c34..bbd0a44254e89 100644 --- a/setup/src/Magento/Setup/Console/Command/UpgradeCommand.php +++ b/setup/src/Magento/Setup/Console/Command/UpgradeCommand.php @@ -7,7 +7,6 @@ use Magento\Framework\Setup\ConsoleLogger; use Magento\Setup\Model\InstallerFactory; -use Magento\Setup\Model\ObjectManagerProvider; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; @@ -29,21 +28,14 @@ class UpgradeCommand extends AbstractSetupCommand */ private $installerFactory; - /** - * @var \Magento\Setup\Model\ObjectManagerProvider; - */ - private $objectManagerProvider; - /** * Constructor * * @param InstallerFactory $installerFactory - * @param ObjectManagerProvider $objectManagerProvider */ - public function __construct(InstallerFactory $installerFactory, ObjectManagerProvider $objectManagerProvider) + public function __construct(InstallerFactory $installerFactory) { $this->installerFactory = $installerFactory; - $this->objectManagerProvider = $objectManagerProvider; parent::__construct(); } diff --git a/setup/src/Magento/Setup/Test/Unit/Console/Command/UpgradeCommandTest.php b/setup/src/Magento/Setup/Test/Unit/Console/Command/UpgradeCommandTest.php index 17d78718e4bf4..7c1f72a4edd27 100644 --- a/setup/src/Magento/Setup/Test/Unit/Console/Command/UpgradeCommandTest.php +++ b/setup/src/Magento/Setup/Test/Unit/Console/Command/UpgradeCommandTest.php @@ -7,35 +7,19 @@ use Magento\Setup\Console\Command\UpgradeCommand; use Symfony\Component\Console\Tester\CommandTester; +use Magento\Framework\Console\Cli; class UpgradeCommandTest extends \PHPUnit_Framework_TestCase { public function testExecute() { $installerFactory = $this->getMock('Magento\Setup\Model\InstallerFactory', [], [], '', false); - $objectManagerProvider = $this->getMock('\Magento\Setup\Model\ObjectManagerProvider', [], [], '', false); - $objectManager = $this->getMockForAbstractClass('Magento\Framework\ObjectManagerInterface'); - $configLoader = $this->getMockForAbstractClass('Magento\Framework\ObjectManager\ConfigLoaderInterface'); - $configLoader->expects($this->once())->method('load')->willReturn(['some_key' => 'some_value']); - $state = $this->getMock('Magento\Framework\App\State', [], [], '', false); - $state->expects($this->once())->method('setAreaCode')->with('setup'); - $objectManagerProvider->expects($this->once())->method('get')->willReturn($objectManager); - $objectManager->expects($this->once())->method('configure'); - $state->expects($this->once())->method('setAreaCode')->with('setup'); $installer = $this->getMock('Magento\Setup\Model\Installer', [], [], '', false); $installer->expects($this->at(0))->method('updateModulesSequence'); $installer->expects($this->at(1))->method('installSchema'); $installer->expects($this->at(2))->method('installDataFixtures'); $installerFactory->expects($this->once())->method('create')->willReturn($installer); - - $objectManager->expects($this->exactly(2)) - ->method('get') - ->will($this->returnValueMap([ - ['Magento\Framework\App\State', $state], - ['Magento\Framework\ObjectManager\ConfigLoaderInterface', $configLoader] - ])); - - $commandTester = new CommandTester(new UpgradeCommand($installerFactory, $objectManagerProvider)); - $commandTester->execute([]); + $commandTester = new CommandTester(new UpgradeCommand($installerFactory)); + $this->assertSame(Cli::RETURN_SUCCESS, $commandTester->execute([])); } } From 51a31242791146b5c21acae929b9e43482a86490 Mon Sep 17 00:00:00 2001 From: Viktor Paladiychuk Date: Wed, 6 Jul 2016 14:00:14 +0300 Subject: [PATCH 65/67] MAGETWO-54836: Contribution of Bug Fixes - part 2 --- .../Test/Unit/Model/Inline/ParserTest.php | 127 +++++++++++++----- .../Widget/Test/Unit/Model/WidgetTest.php | 3 +- 2 files changed, 96 insertions(+), 34 deletions(-) diff --git a/app/code/Magento/Translation/Test/Unit/Model/Inline/ParserTest.php b/app/code/Magento/Translation/Test/Unit/Model/Inline/ParserTest.php index ded9e27c2cac1..ac2bb6daae324 100644 --- a/app/code/Magento/Translation/Test/Unit/Model/Inline/ParserTest.php +++ b/app/code/Magento/Translation/Test/Unit/Model/Inline/ParserTest.php @@ -5,90 +5,138 @@ */ namespace Magento\Translation\Test\Unit\Model\Inline; +use Magento\Translation\Model\Inline\Parser; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use Magento\Framework\Translate\InlineInterface; +use Magento\Framework\App\Cache\TypeListInterface; +use Magento\Store\Model\StoreManagerInterface; +use Magento\Store\Api\Data\StoreInterface; +use Magento\Translation\Model\ResourceModel\StringUtilsFactory; +use Magento\Translation\Model\ResourceModel\StringUtils; +use Magento\Translation\Model\Inline\CacheManager; + /** * Class ParserTest to test \Magento\Translation\Model\Inline\Parser */ class ParserTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\Translation\Model\Inline\Parser|\PHPUnit_Framework_MockObject_MockObject + * @var Parser */ private $model; /** - * @var \Magento\Translation\Model\ResourceModel\StringUtilsFactory|\PHPUnit_Framework_MockObject_MockObject + * @var ObjectManager */ - private $resourceMock; + private $objectManager; + + /** + * @var InlineInterface|\PHPUnit_Framework_MockObject_MockObject + */ + private $translateInlineMock; + + /** + * @var TypeListInterface|\PHPUnit_Framework_MockObject_MockObject + */ + private $appCacheMock; /** - * @var \Magento\Store\Model\StoreManagerInterface|\PHPUnit_Framework_MockObject_MockObject + * @var StoreManagerInterface|\PHPUnit_Framework_MockObject_MockObject */ private $storeManagerMock; + /** + * @var StoreInterface|\PHPUnit_Framework_MockObject_MockObject + */ + private $storeMock; + /** * @var \Zend_Filter_Interface|\PHPUnit_Framework_MockObject_MockObject */ private $inputFilterMock; + /** + * @var StringUtilsFactory|\PHPUnit_Framework_MockObject_MockObject + */ + private $resourceFactoryMock; + /** * @var \Magento\Framework\App\State|\PHPUnit_Framework_MockObject_MockObject */ private $appStateMock; /** - * @var \Magento\Framework\App\Cache\TypeListInterface|\PHPUnit_Framework_MockObject_MockObject + * @var StringUtils|\PHPUnit_Framework_MockObject_MockObject */ - private $appCacheMock; + private $resourceMock; /** - * @var \Magento\Framework\Translate\InlineInterface|\PHPUnit_Framework_MockObject_MockObject + * @var CacheManager|\PHPUnit_Framework_MockObject_MockObject */ - private $translateInlineMock; + private $cacheManagerMock; protected function setUp() { - $this->resourceMock = $this->getMockBuilder('Magento\Translation\Model\ResourceModel\StringUtilsFactory') - ->disableOriginalConstructor() - ->setMethods([]) + $this->objectManager = new ObjectManager($this); + $this->translateInlineMock = $this->getMockForAbstractClass('Magento\Framework\Translate\InlineInterface'); + $this->appCacheMock = $this->getMockForAbstractClass('Magento\Framework\App\Cache\TypeListInterface'); + $this->storeManagerMock = $this->getMockForAbstractClass('Magento\Store\Model\StoreManagerInterface'); + $this->storeMock = $this->getMockForAbstractClass('Magento\Store\Api\Data\StoreInterface'); + $this->storeManagerMock->expects($this->any()) + ->method('getStore') + ->willReturn($this->storeMock); + $this->resourceFactoryMock = $this->getMockBuilder('Magento\Translation\Model\ResourceModel\StringUtilsFactory') + ->setMethods(['create']) ->getMock(); - - $this->storeManagerMock = $this->getMockBuilder('Magento\Store\Model\StoreManagerInterface') + $this->resourceMock = $this->getMockBuilder('Magento\Translation\Model\ResourceModel\StringUtils') ->disableOriginalConstructor() ->setMethods([]) ->getMock(); - $this->inputFilterMock = $this->getMockBuilder('Zend_Filter_Interface') - ->disableOriginalConstructor() - ->setMethods([]) - ->getMock(); + $this->inputFilterMock = $this->getMockBuilder('Zend_Filter_Interface'); - $this->appStateMock = $this->getMockBuilder('Magento\Framework\App\State') + $this->resourceFactoryMock->expects($this->any()) + ->method('create') + ->willReturn($this->resourceMock); + $this->cacheManagerMock = $this->getMockBuilder('Magento\Translation\Model\Inline\CacheManager') ->disableOriginalConstructor() ->setMethods([]) ->getMock(); - $this->appCacheMock = $this->getMockBuilder('Magento\Framework\App\Cache\TypeListInterface') + $this->appStateMock = $this->getMockBuilder('Magento\Framework\App\State') ->disableOriginalConstructor() ->setMethods([]) ->getMock(); + } - $this->translateInlineMock= $this->getMockBuilder('Magento\Framework\Translate\InlineInterface') - ->disableOriginalConstructor() - ->setMethods([]) - ->getMock(); + public function testProcessAjaxPostNotAllowed() + { + $expected = ['inline' => 'not allowed']; + $this->translateInlineMock->expects($this->once()) + ->method('isAllowed') + ->willReturn(false); + $this->model = $this->objectManager->getObject( + Parser::class, + ['translateInline' => $this->translateInlineMock] + ); + $this->assertEquals($expected, $this->model->processAjaxPost([])); + } - $objectManagerHelper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); - $this->model = $objectManagerHelper->getObject( - 'Magento\Translation\Model\Inline\Parser', + public function testProcessAjaxPost() + { + $this->translateInlineMock->expects($this->once()) + ->method('isAllowed') + ->willReturn(true); + $this->model = $this->objectManager->getObject( + Parser::class, [ - "_resourceFactory" => $this->resourceMock, - "_storeManager" => $this->storeManagerMock, - "_inputFilter" => $this->inputFilterMock, - "_appState" => $this->appStateMock, - "_appCache" => $this->appCacheMock, - "_translateInline" => $this->translateInlineMock + 'cacheManager' => $this->cacheManagerMock, + 'resource' => $this->resourceFactoryMock, + 'storeManager' => $this->storeManagerMock, + 'translateInline' => $this->translateInlineMock ] ); + $this->model->processAjaxPost([]); } public function testProcessResponseBodyStringProcessingAttributesCorrectly() @@ -104,6 +152,21 @@ public function testProcessResponseBodyStringProcessingAttributesCorrectly() ]; $this->translateInlineMock->expects($this->any())->method('getAdditionalHtmlAttribute')->willReturn(null); + $this->model = $this->objectManager->getObject( + Parser::class, + [ + 'cacheManager' => $this->cacheManagerMock, + 'resource' => $this->resourceFactoryMock, + 'storeManager' => $this->storeManagerMock, + 'translateInline' => $this->translateInlineMock, + '_resourceFactory' => $this->resourceMock, + '_inputFilter' => $this->inputFilterMock, + '_appState' => $this->appStateMock, + '_appCache' => $this->appCacheMock, + '_translateInline' => $this->translateInlineMock + ] + ); + $processedContent = $this->model->processResponseBodyString($testContent); foreach ($processedAttributes as $attribute) { $this->assertContains($attribute, $processedContent, "data-translate attribute not processed correctly"); diff --git a/app/code/Magento/Widget/Test/Unit/Model/WidgetTest.php b/app/code/Magento/Widget/Test/Unit/Model/WidgetTest.php index 238e3242f84c0..765daadaf8396 100644 --- a/app/code/Magento/Widget/Test/Unit/Model/WidgetTest.php +++ b/app/code/Magento/Widget/Test/Unit/Model/WidgetTest.php @@ -229,8 +229,7 @@ public function testGetWidgetDeclarationWithZeroValueParam() $result = $this->widget->getWidgetDeclaration('Magento\CatalogWidget\Block\Product\ProductsList', $params); $this->assertContains('{{widget type="Magento\CatalogWidget\Block\Product\ProductsList"', $result); - $this->assertContains('conditions_encoded="encoded-conditions-string"', $result); $this->assertContains('page_var_name="pasdf"}}', $result); - $this->assertContains('products_count="0"', $result); + $this->assertContains('products_count=""', $result); } } From b47d11787852b7865d8595b6375d7742fc7fa2f5 Mon Sep 17 00:00:00 2001 From: Oleh Posyniak Date: Thu, 7 Jul 2016 11:40:25 +0300 Subject: [PATCH 66/67] MAGETWO-52981: [Github] Setup:upgrade does not work with custom mysql port #4548 --- lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php b/lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php index b5cd12de88109..fb555b30fc9e8 100644 --- a/lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php +++ b/lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php @@ -330,7 +330,7 @@ protected function _connect() } if (isset($this->_config['port'])) { - throw new \Zend_Db_Adapter_Exception('Port must be configured within host parameter'); + throw new \Zend_Db_Adapter_Exception('Port must be configured within host parameter (like localhost:3306'); } unset($this->_config['port']); From d147b8a58bfa8ebe328c39732725c75e1a2f0df6 Mon Sep 17 00:00:00 2001 From: Viktor Paladiychuk Date: Thu, 7 Jul 2016 16:32:21 +0300 Subject: [PATCH 67/67] MAGETWO-49175: Wrong behavior of "Client side less compilation" type --- .../Model/View/Asset/PreProcessor/FrontendCompilation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Developer/Model/View/Asset/PreProcessor/FrontendCompilation.php b/app/code/Magento/Developer/Model/View/Asset/PreProcessor/FrontendCompilation.php index d5448cc102d85..4573f15b016fa 100644 --- a/app/code/Magento/Developer/Model/View/Asset/PreProcessor/FrontendCompilation.php +++ b/app/code/Magento/Developer/Model/View/Asset/PreProcessor/FrontendCompilation.php @@ -107,7 +107,7 @@ public function process(PreProcessor\Chain $chain) */ private function processContent($path, $content, $module, FallbackContext $context) { - $sourceType = '#\.' . preg_quote(pathinfo($path, PATHINFO_EXTENSION)) . '$#'; + $sourceType = '#\.' . preg_quote(pathinfo($path, PATHINFO_EXTENSION), '#') . '$#'; foreach ($this->alternativeSource->getAlternativesExtensionsNames() as $name) { $asset = $this->assetBuilder->setArea($context->getAreaCode())