From dd388dbe5ea09342b5b3559dc3c8b6ec64fb3ce2 Mon Sep 17 00:00:00 2001 From: Yanick Witschi Date: Tue, 3 Jun 2014 08:18:34 +0200 Subject: [PATCH 01/42] Starting 2.1.3 branch --- system/modules/isotope/docs/CHANGELOG-2.1.md | 4 ++++ system/modules/isotope/library/Isotope/Isotope.php | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/system/modules/isotope/docs/CHANGELOG-2.1.md b/system/modules/isotope/docs/CHANGELOG-2.1.md index 62f77ad3f7..9aeee0fed3 100644 --- a/system/modules/isotope/docs/CHANGELOG-2.1.md +++ b/system/modules/isotope/docs/CHANGELOG-2.1.md @@ -1,6 +1,10 @@ Isotope eCommerce Changelog =========================== +Version 2.1.3-stable (2014-??-??) +--------------------------------- + + Version 2.1.2-stable (2014-06-02) --------------------------------- diff --git a/system/modules/isotope/library/Isotope/Isotope.php b/system/modules/isotope/library/Isotope/Isotope.php index 389f729219..0b97ceaaec 100644 --- a/system/modules/isotope/library/Isotope/Isotope.php +++ b/system/modules/isotope/library/Isotope/Isotope.php @@ -36,7 +36,7 @@ class Isotope extends \Controller /** * Isotope version */ - const VERSION = '2.1.2'; + const VERSION = '2.1.3'; /** * True if the system has been initialized From 3094cbe349c5c9bc40727b29c251158eebc52135 Mon Sep 17 00:00:00 2001 From: Yanick Witschi Date: Tue, 3 Jun 2014 08:26:05 +0200 Subject: [PATCH 02/42] Composer dependencies (#1124) --- composer.json | 7 ++----- system/modules/isotope/docs/CHANGELOG-2.1.md | 2 ++ 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/composer.json b/composer.json index af96b0af44..c5a0b83604 100644 --- a/composer.json +++ b/composer.json @@ -16,8 +16,8 @@ ], "require":{ "php":">=5.3.2", - "contao/core":"~3.2.2", - "contao-community-alliance/composer-installer":"*", + "contao/core":">=3.2.2,<3.4", + "contao-community-alliance/composer-plugin":"2.*", "contao-legacy/conditionalselectmenu":"2.*", "contao-legacy/namespaceclassloader":">=1.0.1,<2.0", "terminal42/dcawizard":">=2.0.2,<3.0", @@ -51,9 +51,6 @@ "runonce": [ "system/modules/isotope/config/upgrade.php" ] - }, - "branch-alias": { - "dev-release/2.1.0": "2.1.x-dev" } } } diff --git a/system/modules/isotope/docs/CHANGELOG-2.1.md b/system/modules/isotope/docs/CHANGELOG-2.1.md index 9aeee0fed3..64f434e148 100644 --- a/system/modules/isotope/docs/CHANGELOG-2.1.md +++ b/system/modules/isotope/docs/CHANGELOG-2.1.md @@ -4,6 +4,8 @@ Isotope eCommerce Changelog Version 2.1.3-stable (2014-??-??) --------------------------------- +### Fixed +- Composer dependencies (#1124) Version 2.1.2-stable (2014-06-02) --------------------------------- From 43c1639c88ea7e26024337895d5b0b60ba7a88ef Mon Sep 17 00:00:00 2001 From: Yanick Witschi Date: Wed, 4 Jun 2014 18:39:44 +0200 Subject: [PATCH 03/42] Date added was not updated when copying a product in the back end (#1126) --- system/modules/isotope/dca/tl_iso_product.php | 1 + system/modules/isotope/docs/CHANGELOG-2.1.md | 1 + .../library/Isotope/Backend/Product/DcaManager.php | 12 ++++++++++++ 3 files changed, 14 insertions(+) diff --git a/system/modules/isotope/dca/tl_iso_product.php b/system/modules/isotope/dca/tl_iso_product.php index ae6b38b47f..6b5864f38b 100755 --- a/system/modules/isotope/dca/tl_iso_product.php +++ b/system/modules/isotope/dca/tl_iso_product.php @@ -40,6 +40,7 @@ 'oncopy_callback' => array ( array('Isotope\Backend\Product\Category', 'updateSorting'), + array('Isotope\Backend\Product\DcaManager', 'updateDateAdded'), ), 'onsubmit_callback' => array ( diff --git a/system/modules/isotope/docs/CHANGELOG-2.1.md b/system/modules/isotope/docs/CHANGELOG-2.1.md index 64f434e148..fe642133ad 100644 --- a/system/modules/isotope/docs/CHANGELOG-2.1.md +++ b/system/modules/isotope/docs/CHANGELOG-2.1.md @@ -6,6 +6,7 @@ Version 2.1.3-stable (2014-??-??) ### Fixed - Composer dependencies (#1124) +- Date added was not updated when copying a product in the back end (#1126) Version 2.1.2-stable (2014-06-02) --------------------------------- diff --git a/system/modules/isotope/library/Isotope/Backend/Product/DcaManager.php b/system/modules/isotope/library/Isotope/Backend/Product/DcaManager.php index 3dc8e41658..560d15083b 100644 --- a/system/modules/isotope/library/Isotope/Backend/Product/DcaManager.php +++ b/system/modules/isotope/library/Isotope/Backend/Product/DcaManager.php @@ -77,6 +77,18 @@ public function updateNewRecord($strTable, $insertID, $arrSet, $dc) \Database::getInstance()->prepare("UPDATE $strTable SET gid=?, type=?, dateAdded=? WHERE id=?")->execute($intGroup, $intType, time(), $insertID); } + /** + * Update dateAdded on copy + * @param integer + * @param object + * @link http://www.contao.org/callbacks.html#oncopy_callback + */ + public function updateDateAdded($insertId, $dc) + { + $strTable = Product::getTable(); + \Database::getInstance()->prepare("UPDATE $strTable SET dateAdded=? WHERE id=?")->execute(time(), $insertId); + } + /** * Add custom attributes to tl_iso_product DCA */ From 7a6e100b6e1744aa8891be20905c055b29b20a42 Mon Sep 17 00:00:00 2001 From: Andreas Schempp Date: Fri, 6 Jun 2014 23:04:47 +0200 Subject: [PATCH 04/42] Prevent possible SQL injection issue Not really a problem because the input values are (currently) always validated against the really available options. --- system/modules/isotope/library/Isotope/Model/Attribute.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/system/modules/isotope/library/Isotope/Model/Attribute.php b/system/modules/isotope/library/Isotope/Model/Attribute.php index 85a061a2c9..eb0144dc0b 100644 --- a/system/modules/isotope/library/Isotope/Model/Attribute.php +++ b/system/modules/isotope/library/Isotope/Model/Attribute.php @@ -240,13 +240,13 @@ public function getOptionsForVariants(array $arrIds, array $arrOptions = array() $strWhere = ''; foreach ($arrOptions as $field => $value) { - $strWhere .= " AND $field='$value'"; + $strWhere .= " AND $field=?"; } - return \Database::getInstance()->execute(" + return \Database::getInstance()->prepare(" SELECT DISTINCT " . $this->field_name . " FROM tl_iso_product WHERE id IN (" . implode(',', $arrIds) . ") " . $strWhere . " - ")->fetchEach($this->field_name); + ")->execute($arrOptions)->fetchEach($this->field_name); } From 0c9d1ba5c0c4d06d8b089281bd6129424321e52d Mon Sep 17 00:00:00 2001 From: Andreas Schempp Date: Tue, 10 Jun 2014 08:14:34 +0200 Subject: [PATCH 05/42] Finally fixed the product filter jumpTo (#1068) --- system/modules/isotope/docs/CHANGELOG-2.1.md | 1 + system/modules/isotope/library/Isotope/Module/ProductFilter.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/system/modules/isotope/docs/CHANGELOG-2.1.md b/system/modules/isotope/docs/CHANGELOG-2.1.md index fe642133ad..4c77b76795 100644 --- a/system/modules/isotope/docs/CHANGELOG-2.1.md +++ b/system/modules/isotope/docs/CHANGELOG-2.1.md @@ -7,6 +7,7 @@ Version 2.1.3-stable (2014-??-??) ### Fixed - Composer dependencies (#1124) - Date added was not updated when copying a product in the back end (#1126) +- Another error when setting a redirect page for product search (#1068) Version 2.1.2-stable (2014-06-02) --------------------------------- diff --git a/system/modules/isotope/library/Isotope/Module/ProductFilter.php b/system/modules/isotope/library/Isotope/Module/ProductFilter.php index 2d0d113272..154def3952 100755 --- a/system/modules/isotope/library/Isotope/Module/ProductFilter.php +++ b/system/modules/isotope/library/Isotope/Module/ProductFilter.php @@ -194,7 +194,7 @@ protected function generateSearch() // Include \Environment::base or the URL would not work on the index page \Controller::redirect( \Environment::get('base') . - $this->getRelated('jumpTo')->getFrontendUrl() . + $this->objModel->getRelated('jumpTo')->getFrontendUrl() . '?' . $_SERVER['QUERY_STRING'] ); } From 3e2658cb156736ad55190a9d1408e2a27f9226e7 Mon Sep 17 00:00:00 2001 From: Andreas Schempp Date: Tue, 10 Jun 2014 09:11:14 +0200 Subject: [PATCH 06/42] Disable variant checkbox if no variant attributes are available in product type (#1114) --- system/modules/isotope/docs/CHANGELOG-2.1.md | 2 ++ .../library/Isotope/Backend/ProductType/Permission.php | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/system/modules/isotope/docs/CHANGELOG-2.1.md b/system/modules/isotope/docs/CHANGELOG-2.1.md index 4c77b76795..3737c32504 100644 --- a/system/modules/isotope/docs/CHANGELOG-2.1.md +++ b/system/modules/isotope/docs/CHANGELOG-2.1.md @@ -8,6 +8,8 @@ Version 2.1.3-stable (2014-??-??) - Composer dependencies (#1124) - Date added was not updated when copying a product in the back end (#1126) - Another error when setting a redirect page for product search (#1068) +- Disable variant checkbox if no variant attributes are available in product type (#1114) + Version 2.1.2-stable (2014-06-02) --------------------------------- diff --git a/system/modules/isotope/library/Isotope/Backend/ProductType/Permission.php b/system/modules/isotope/library/Isotope/Backend/ProductType/Permission.php index f64a78a8ab..0f785b1566 100755 --- a/system/modules/isotope/library/Isotope/Backend/ProductType/Permission.php +++ b/system/modules/isotope/library/Isotope/Backend/ProductType/Permission.php @@ -59,7 +59,11 @@ public static function check() \System::loadLanguageFile('explain'); unset($GLOBALS['TL_DCA']['tl_iso_producttype']['subpalettes']['variants']); - $GLOBALS['TL_DCA']['tl_iso_producttype']['fields']['variants']['input_field_callback'] = function() { + $GLOBALS['TL_DCA']['tl_iso_producttype']['fields']['variants']['input_field_callback'] = function($dc) { + + // Make sure variants are disabled in this product type (see #1114) + \Database::getInstance()->prepare("UPDATE " . $dc->table . " SET variants='' WHERE id=?")->execute($dc->id); + return '

'.$GLOBALS['TL_LANG']['XPL']['noVariantAttributes'].'

'; }; } From 517c133bc0dc4588881e529a92d06998e193a491 Mon Sep 17 00:00:00 2001 From: Andreas Schempp Date: Tue, 10 Jun 2014 11:21:39 +0200 Subject: [PATCH 07/42] CS --- .../isotope/library/Isotope/Model/Product/Standard.php | 6 ++++-- .../modules/isotope/library/Isotope/Model/RequestCache.php | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/system/modules/isotope/library/Isotope/Model/Product/Standard.php b/system/modules/isotope/library/Isotope/Model/Product/Standard.php index 0eb2e5b207..3e0b3d8bea 100644 --- a/system/modules/isotope/library/Isotope/Model/Product/Standard.php +++ b/system/modules/isotope/library/Isotope/Model/Product/Standard.php @@ -100,11 +100,13 @@ class Standard extends Product implements IsotopeProduct, WeightAggregate */ public function isPublished() { + $time = time(); + if (!$this->arrData['published']) { return false; - } elseif ($this->arrData['start'] > 0 && $this->arrData['start'] > time()) { + } elseif ($this->arrData['start'] != '' && $this->arrData['start'] > $time) { return false; - } elseif ($this->arrData['stop'] > 0 && $this->arrData['stop'] < time()) { + } elseif ($this->arrData['stop'] != '' && $this->arrData['stop'] < $time) { return false; } diff --git a/system/modules/isotope/library/Isotope/Model/RequestCache.php b/system/modules/isotope/library/Isotope/Model/RequestCache.php index 55a339cacc..43ac7f1420 100644 --- a/system/modules/isotope/library/Isotope/Model/RequestCache.php +++ b/system/modules/isotope/library/Isotope/Model/RequestCache.php @@ -522,6 +522,7 @@ public static function buildSqlFilters(array $arrFilters) . (BE_USER_LOGGED_IN === true ? '' : " AND $t.published='1' AND ($t.start='' OR $t.start<$time) AND ($t.stop='' OR $t.stop>$time)") . ") ) "; + $arrValues = array_merge($arrValues, $arrValues, $arrValues); } From 9530a7ca1182c9294e13439bbc6d51d8affc5c8e Mon Sep 17 00:00:00 2001 From: Andreas Schempp Date: Tue, 10 Jun 2014 11:22:15 +0200 Subject: [PATCH 08/42] Product variants did show up even if product was unpublished (#1120) --- system/modules/isotope/docs/CHANGELOG-2.1.md | 1 + .../library/Isotope/Model/Product/Standard.php | 13 +++++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/system/modules/isotope/docs/CHANGELOG-2.1.md b/system/modules/isotope/docs/CHANGELOG-2.1.md index 3737c32504..4191d85e28 100644 --- a/system/modules/isotope/docs/CHANGELOG-2.1.md +++ b/system/modules/isotope/docs/CHANGELOG-2.1.md @@ -9,6 +9,7 @@ Version 2.1.3-stable (2014-??-??) - Date added was not updated when copying a product in the back end (#1126) - Another error when setting a redirect page for product search (#1068) - Disable variant checkbox if no variant attributes are available in product type (#1114) +- Product variants did show up even if product was unpublished (#1120) Version 2.1.2-stable (2014-06-02) diff --git a/system/modules/isotope/library/Isotope/Model/Product/Standard.php b/system/modules/isotope/library/Isotope/Model/Product/Standard.php index 3e0b3d8bea..1061ff8799 100644 --- a/system/modules/isotope/library/Isotope/Model/Product/Standard.php +++ b/system/modules/isotope/library/Isotope/Model/Product/Standard.php @@ -851,10 +851,6 @@ public function setRow(array $arrData) $this->setRow($objParent->row()); - $this->arrData['id'] = $arrData['id']; - $this->arrData['pid'] = $arrData['pid']; - $this->arrData['inherit'] = $arrData['inherit']; - // Set all variant attributes, except if they are inherited foreach (array_diff($this->getVariantAttributes(), $this->getInheritedFields()) as $attribute) { @@ -865,6 +861,15 @@ public function setRow(array $arrData) } } + $this->arrData['id'] = $arrData['id']; + $this->arrData['pid'] = $arrData['pid']; + $this->arrData['inherit'] = $arrData['inherit']; + + // Make sure publishing settings match product and variant + $this->arrData['published'] = $objParent->published ? $arrData['published'] : ''; + $this->arrData['start'] = ($objParent->start != '' && ($arrData['start'] == '' || $objParent->start > $arrData['start'])) ? $objParent->start : $arrData['start']; + $this->arrData['stop'] = ($objParent->stop != '' && ($arrData['stop'] == '' || $objParent->stop < $arrData['stop'])) ? $objParent->stop : $arrData['stop']; + return $this; } From e6a2865fc4cf6e6e072ccaaee6cb84985c676072 Mon Sep 17 00:00:00 2001 From: Andreas Schempp Date: Tue, 10 Jun 2014 12:19:27 +0200 Subject: [PATCH 09/42] Fixed fields not being inherited to code move --- .../isotope/library/Isotope/Model/Product/Standard.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/system/modules/isotope/library/Isotope/Model/Product/Standard.php b/system/modules/isotope/library/Isotope/Model/Product/Standard.php index 1061ff8799..d623e5d137 100644 --- a/system/modules/isotope/library/Isotope/Model/Product/Standard.php +++ b/system/modules/isotope/library/Isotope/Model/Product/Standard.php @@ -851,6 +851,10 @@ public function setRow(array $arrData) $this->setRow($objParent->row()); + $this->arrData['id'] = $arrData['id']; + $this->arrData['pid'] = $arrData['pid']; + $this->arrData['inherit'] = $arrData['inherit']; + // Set all variant attributes, except if they are inherited foreach (array_diff($this->getVariantAttributes(), $this->getInheritedFields()) as $attribute) { @@ -861,10 +865,6 @@ public function setRow(array $arrData) } } - $this->arrData['id'] = $arrData['id']; - $this->arrData['pid'] = $arrData['pid']; - $this->arrData['inherit'] = $arrData['inherit']; - // Make sure publishing settings match product and variant $this->arrData['published'] = $objParent->published ? $arrData['published'] : ''; $this->arrData['start'] = ($objParent->start != '' && ($arrData['start'] == '' || $objParent->start > $arrData['start'])) ? $objParent->start : $arrData['start']; From 5a5f5c22b5d08e006bfd19b2f9080fa74c18c8c7 Mon Sep 17 00:00:00 2001 From: Andreas Schempp Date: Tue, 10 Jun 2014 12:20:20 +0200 Subject: [PATCH 10/42] Added ticket ID to code change --- .../modules/isotope/library/Isotope/Model/Product/Standard.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/modules/isotope/library/Isotope/Model/Product/Standard.php b/system/modules/isotope/library/Isotope/Model/Product/Standard.php index d623e5d137..692d397a5b 100644 --- a/system/modules/isotope/library/Isotope/Model/Product/Standard.php +++ b/system/modules/isotope/library/Isotope/Model/Product/Standard.php @@ -865,7 +865,7 @@ public function setRow(array $arrData) } } - // Make sure publishing settings match product and variant + // Make sure publishing settings match product and variant (see #1120) $this->arrData['published'] = $objParent->published ? $arrData['published'] : ''; $this->arrData['start'] = ($objParent->start != '' && ($arrData['start'] == '' || $objParent->start > $arrData['start'])) ? $objParent->start : $arrData['start']; $this->arrData['stop'] = ($objParent->stop != '' && ($arrData['stop'] == '' || $objParent->stop < $arrData['stop'])) ? $objParent->stop : $arrData['stop']; From adae65a64b441fe3916eb643e7deebaa68452a0d Mon Sep 17 00:00:00 2001 From: Andreas Schempp Date: Thu, 26 Jun 2014 17:14:07 +0200 Subject: [PATCH 11/42] CS --- .../isotope/library/Isotope/CheckoutStep/Address.php | 2 +- .../isotope/library/Isotope/CheckoutStep/BillingAddress.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/system/modules/isotope/library/Isotope/CheckoutStep/Address.php b/system/modules/isotope/library/Isotope/CheckoutStep/Address.php index b3cbb2c233..aa64ad8ae8 100644 --- a/system/modules/isotope/library/Isotope/CheckoutStep/Address.php +++ b/system/modules/isotope/library/Isotope/CheckoutStep/Address.php @@ -285,7 +285,7 @@ protected function getAddressOptions() * Get address object for a selected option * @param string * @param bool - * @return Isotope\Model\Address + * @return \Isotope\Model\Address */ protected function getAddressForOption($varValue, $blnValidate) { diff --git a/system/modules/isotope/library/Isotope/CheckoutStep/BillingAddress.php b/system/modules/isotope/library/Isotope/CheckoutStep/BillingAddress.php index 180ad328f1..2334ba70e9 100644 --- a/system/modules/isotope/library/Isotope/CheckoutStep/BillingAddress.php +++ b/system/modules/isotope/library/Isotope/CheckoutStep/BillingAddress.php @@ -106,7 +106,7 @@ protected function getAddressOptions() * Get address object for a selected option * @param string * @param bool - * @return Isotope\Model\Address + * @return \Isotope\Model\Address */ protected function getAddressForOption($varValue, $blnValidate) { @@ -130,7 +130,7 @@ protected function getAddressForOption($varValue, $blnValidate) /** * Get default address for this collection and address type - * @return Isotope\Model\Address + * @return \Isotope\Model\Address */ protected function getDefaultAddress() { @@ -178,7 +178,7 @@ protected function getAddressCountries() /** * Get the current address (from Cart) for this address type - * @return Isotope\Model\Address + * @return \Isotope\Model\Address */ protected function getAddress() { From 6bf2b0b3136f6239eb6ccef12324aa1828e31dc0 Mon Sep 17 00:00:00 2001 From: Andreas Schempp Date: Thu, 26 Jun 2014 17:33:14 +0200 Subject: [PATCH 12/42] URLs for Sparkasse and Worldpay payment methods were incorrectly generated (#1141 and #1142) --- system/modules/isotope/docs/CHANGELOG-2.1.md | 1 + .../library/Isotope/Model/Payment/Sparkasse.php | 11 ++++++----- .../library/Isotope/Model/Payment/Worldpay.php | 5 +++-- .../isotope/library/Isotope/Module/Checkout.php | 12 ++++++++---- 4 files changed, 18 insertions(+), 11 deletions(-) diff --git a/system/modules/isotope/docs/CHANGELOG-2.1.md b/system/modules/isotope/docs/CHANGELOG-2.1.md index 4191d85e28..dd54f59a71 100644 --- a/system/modules/isotope/docs/CHANGELOG-2.1.md +++ b/system/modules/isotope/docs/CHANGELOG-2.1.md @@ -10,6 +10,7 @@ Version 2.1.3-stable (2014-??-??) - Another error when setting a redirect page for product search (#1068) - Disable variant checkbox if no variant attributes are available in product type (#1114) - Product variants did show up even if product was unpublished (#1120) +- URLs for Sparkasse and Worldpay payment methods were incorrectly generated (#1141 and #1142) Version 2.1.2-stable (2014-06-02) diff --git a/system/modules/isotope/library/Isotope/Model/Payment/Sparkasse.php b/system/modules/isotope/library/Isotope/Model/Payment/Sparkasse.php index 6c6b6e225f..cd185d7f84 100644 --- a/system/modules/isotope/library/Isotope/Model/Payment/Sparkasse.php +++ b/system/modules/isotope/library/Isotope/Model/Payment/Sparkasse.php @@ -16,6 +16,7 @@ use Isotope\Interfaces\IsotopePayment; use Isotope\Interfaces\IsotopeProductCollection; use Isotope\Model\ProductCollection\Order; +use Isotope\Module\Checkout; /** * Class Sparkasse @@ -76,10 +77,10 @@ public function processPostsale(IsotopeProductCollection $objOrder) $objOrder->save(); - $objPage = $this->getPageDetails((int) $arrData['sessionid']); + $strUrl = Checkout::generateUrlForStep('complete', $objOrder, \PageModel::findWithDetails((int) $arrData['sessionid'])); // 200 OK - $objResponse = new Response('redirecturls=' . \Environment::get('base') . \Controller::generateFrontendUrl($objPage->row(), '/step/complete/uid/' . $objOrder->uniqid, $objPage->language)); + $objResponse = new Response('redirecturls=' . \Environment::get('base') . $strUrl); $objResponse->send(); } @@ -158,14 +159,14 @@ private function calculateHash($arrData) /** * Redirect the Sparkasse server to our error page - * @param arary + * @param array */ private function redirectError($arrData) { - $objPage = $this->getPageDetails((int) $arrData['sessionid']); + $strUrl = Checkout::generateUrlForStep('failed', null, \PageModel::findWithDetails((int) $arrData['sessionid'])); // 200 OK - $objResponse = new Response('redirecturlf=' . \Environment::get('base') . \Controller::generateFrontendUrl($objPage->row(), '/step/failed', $objPage->language) . '?reason=' . $arrData['directPosErrorMessage']); + $objResponse = new Response('redirecturlf=' . \Environment::get('base') . $strUrl . '?reason=' . $arrData['directPosErrorMessage']); $objResponse->send(); } } diff --git a/system/modules/isotope/library/Isotope/Model/Payment/Worldpay.php b/system/modules/isotope/library/Isotope/Model/Payment/Worldpay.php index e899bf6c06..c2f0f90192 100644 --- a/system/modules/isotope/library/Isotope/Model/Payment/Worldpay.php +++ b/system/modules/isotope/library/Isotope/Model/Payment/Worldpay.php @@ -15,6 +15,7 @@ use Isotope\Interfaces\IsotopePayment; use Isotope\Interfaces\IsotopeProductCollection; use Isotope\Model\ProductCollection\Order; +use Isotope\Module\Checkout; use Isotope\Translation; @@ -137,7 +138,7 @@ public function checkoutForm(IsotopeProductCollection $objOrder, \Module $objMod protected function postsaleError() { $objPage = \PageModel::findWithDetails((int) \Input::post('M_pageId')); - $strUrl = \Environment::get('base') . \Controller::generateFrontendUrl($objPage->row(), '/step/failed', $objPage->language); + $strUrl = \Environment::get('base') . Checkout::generateUrlForStep('failed', null, $objPage); // Output a HTML page to redirect the client from WorldPay back to the shop echo ' @@ -163,7 +164,7 @@ protected function postsaleError() protected function postsaleSuccess($objOrder) { $objPage = \PageModel::findWithDetails((int) \Input::post('M_pageId')); - $strUrl = \Environment::get('base') . \Controller::generateFrontendUrl($objPage->row(), '/step/complete', $objPage->language) . '?uid=' . $objOrder->uniqid; + $strUrl = \Environment::get('base') . Checkout::generateUrlForStep('complete', $objOrder, $objPage); // Output a HTML page to redirect the client from WorldPay back to the shop echo ' diff --git a/system/modules/isotope/library/Isotope/Module/Checkout.php b/system/modules/isotope/library/Isotope/Module/Checkout.php index e4702050a5..78f54f039e 100755 --- a/system/modules/isotope/library/Isotope/Module/Checkout.php +++ b/system/modules/isotope/library/Isotope/Module/Checkout.php @@ -503,7 +503,7 @@ protected function generateStepNavigation(array $arrStepKeys) * @param string * @param IsotopeProductCollection */ - public static function redirectToStep($strStep, IsotopeProductCollection $objCollection=null) + public static function redirectToStep($strStep, IsotopeProductCollection $objCollection = null) { \Controller::redirect(static::generateUrlForStep($strStep, $objCollection)); } @@ -512,17 +512,21 @@ public static function redirectToStep($strStep, IsotopeProductCollection $objCol * Generate frontend URL for current page including the given checkout step * @param string * @param IsotopeProductCollection + * @param \PageModel $objPage * @return string */ - public static function generateUrlForStep($strStep, IsotopeProductCollection $objCollection=null) + public static function generateUrlForStep($strStep, IsotopeProductCollection $objCollection = null, \PageModel $objTarget = null) { - global $objPage; + if (null === $objTarget) { + global $objPage; + $objTarget = $objPage; + } if (!$GLOBALS['TL_CONFIG']['useAutoItem'] || !in_array('step', $GLOBALS['TL_AUTO_ITEM'])) { $strStep = 'step/' . $strStep; } - $strUrl = \Controller::generateFrontendUrl($objPage->row(), '/' . $strStep); + $strUrl = \Controller::generateFrontendUrl($objTarget->row(), '/' . $strStep, $objTarget->language); if (null !== $objCollection) { $strUrl = \Haste\Util\Url::addQueryString('uid=' . $objCollection->uniqid, $strUrl); From 1bc98cf98951e11e60bfd2780a0409393621d163 Mon Sep 17 00:00:00 2001 From: Andreas Schempp Date: Thu, 26 Jun 2014 17:38:35 +0200 Subject: [PATCH 13/42] CDATA statement in javascript caused issue in Sparkasse payment method (#1140) --- system/modules/isotope/docs/CHANGELOG-2.1.md | 1 + .../isotope/library/Isotope/Model/Payment/Sparkasse.php | 4 +--- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/system/modules/isotope/docs/CHANGELOG-2.1.md b/system/modules/isotope/docs/CHANGELOG-2.1.md index dd54f59a71..17a47dee15 100644 --- a/system/modules/isotope/docs/CHANGELOG-2.1.md +++ b/system/modules/isotope/docs/CHANGELOG-2.1.md @@ -11,6 +11,7 @@ Version 2.1.3-stable (2014-??-??) - Disable variant checkbox if no variant attributes are available in product type (#1114) - Product variants did show up even if product was unpublished (#1120) - URLs for Sparkasse and Worldpay payment methods were incorrectly generated (#1141 and #1142) +- CDATA statement in javascript caused issue in Sparkasse payment method (#1140) Version 2.1.2-stable (2014-06-02) diff --git a/system/modules/isotope/library/Isotope/Model/Payment/Sparkasse.php b/system/modules/isotope/library/Isotope/Model/Payment/Sparkasse.php index cd185d7f84..659c1451ca 100644 --- a/system/modules/isotope/library/Isotope/Model/Payment/Sparkasse.php +++ b/system/modules/isotope/library/Isotope/Model/Payment/Sparkasse.php @@ -133,10 +133,8 @@ public function checkoutForm(IsotopeProductCollection $objOrder, \Module $objMod $strUrl .= implode('&', $arrUrl); return " -

" . $GLOBALS['TL_LANG']['MSC']['pay_with_redirect'][0] . "

" . $GLOBALS['TL_LANG']['MSC']['pay_with_redirect'][1] . "

From fadd27e37cf2005bd2ae77f49370026bd6e4e78a Mon Sep 17 00:00:00 2001 From: Yanick Witschi Date: Thu, 26 Jun 2014 18:03:32 +0200 Subject: [PATCH 14/42] Front end javascript was not compatible with IE8 (#1155) --- system/modules/isotope/assets/js/isotope.js | 33 +++++++++++++++++++ .../modules/isotope/assets/js/isotope.min.js | 2 +- system/modules/isotope/docs/CHANGELOG-2.1.md | 1 + 3 files changed, 35 insertions(+), 1 deletion(-) diff --git a/system/modules/isotope/assets/js/isotope.js b/system/modules/isotope/assets/js/isotope.js index f27e3c539c..6dc4a7813b 100644 --- a/system/modules/isotope/assets/js/isotope.js +++ b/system/modules/isotope/assets/js/isotope.js @@ -1,3 +1,36 @@ +/** + * EventListener Polyfill for IE8 + * @see https://gist.github.com/jonathantneal/3748027 + */ +!window.addEventListener && (function (WindowPrototype, DocumentPrototype, ElementPrototype, addEventListener, removeEventListener, dispatchEvent, registry) { + WindowPrototype[addEventListener] = DocumentPrototype[addEventListener] = ElementPrototype[addEventListener] = function (type, listener) { + var target = this; + + registry.unshift([target, type, listener, function (event) { + event.currentTarget = target; + event.preventDefault = function () { event.returnValue = false }; + event.stopPropagation = function () { event.cancelBubble = true }; + event.target = event.srcElement || target; + + listener.call(target, event); + }]); + + this.attachEvent("on" + type, registry[0][3]); + }; + + WindowPrototype[removeEventListener] = DocumentPrototype[removeEventListener] = ElementPrototype[removeEventListener] = function (type, listener) { + for (var index = 0, register; register = registry[index]; ++index) { + if (register[0] == this && register[1] == type && register[2] == listener) { + return this.detachEvent("on" + type, registry.splice(index, 1)[0][3]); + } + } + }; + + WindowPrototype[dispatchEvent] = DocumentPrototype[dispatchEvent] = ElementPrototype[dispatchEvent] = function (eventObject) { + return this.fireEvent("on" + eventObject.type, eventObject); + }; +})(Window.prototype, HTMLDocument.prototype, Element.prototype, "addEventListener", "removeEventListener", "dispatchEvent", []); + /** * Isotope eCommerce for Contao Open Source CMS * diff --git a/system/modules/isotope/assets/js/isotope.min.js b/system/modules/isotope/assets/js/isotope.min.js index c0afc4e6ad..13c57beb69 100644 --- a/system/modules/isotope/assets/js/isotope.min.js +++ b/system/modules/isotope/assets/js/isotope.min.js @@ -1 +1 @@ -var Isotope={};(function(){Isotope.toggleAddressFields=function(a,b){if(a.value=="0"&&a.checked){document.getElementById(b).style.display="block"}else{document.getElementById(b).style.display="none"}};Isotope.displayBox=function(d,e){var c=document.getElementById("iso_ajaxBox");var b=document.getElementById("iso_ajaxOverlay");if(!b){b=document.createElement("div");b.setAttribute("id","iso_ajaxOverlay");document.body.appendChild(b)}if(!c){c=document.createElement("div");c.setAttribute("id","iso_ajaxBox");document.body.appendChild(c)}if(e){b.addEventListener("click",Isotope.hideBox,false);c.addEventListener("click",Isotope.hideBox,false);if(!c.className.search(/btnClose/)!=-1){c.className=c.className+" btnClose"}}var a=window.getScroll().y;b.style.display="block";c.innerHTML=d;c.style.display="block";c.style.top=((a+100)+"px")};Isotope.hideBox=function(){var b=document.getElementById("iso_ajaxBox");var a=document.getElementById("iso_ajaxOverlay");if(a){a.style.display="none";a.removeEventListener("click",Isotope.hideBox,false)}if(b){b.style.display="none";b.removeEventListener("click",Isotope.hideBox,false);b.className=b.className.replace(/ ?btnClose/,"")}};Isotope.inlineGallery=function(d,a){var b;var c=d.parentNode;var e=c.parentNode.children;for(b=0;b0){for(d=0;d0){for(d=0;d Date: Thu, 26 Jun 2014 17:58:41 +0200 Subject: [PATCH 15/42] CS --- .../library/Isotope/Backend/Attribute/Callback.php | 7 ++++--- .../isotope/library/Isotope/Backend/Product/Alias.php | 4 ++-- .../library/Isotope/Backend/Product/DcaManager.php | 8 ++++++-- .../isotope/library/Isotope/Backend/Product/Label.php | 2 ++ 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/system/modules/isotope/library/Isotope/Backend/Attribute/Callback.php b/system/modules/isotope/library/Isotope/Backend/Attribute/Callback.php index aa8056eba3..271b9c2499 100755 --- a/system/modules/isotope/library/Isotope/Backend/Attribute/Callback.php +++ b/system/modules/isotope/library/Isotope/Backend/Attribute/Callback.php @@ -12,6 +12,7 @@ namespace Isotope\Backend\Attribute; +use Isotope\DatabaseUpdater; class Callback extends \Backend { @@ -39,7 +40,7 @@ public function disableFieldName($dc) /** * Hide certain options if this is a variant option - * @param DataContainer + * @param \DataContainer */ public function prepareForVariantOptions($dc) { @@ -57,7 +58,7 @@ public function prepareForVariantOptions($dc) * @param mixed * @param object * @return mixed - * @throws Exception + * @throws \Exception */ public function validateFieldName($varValue, $dc) { @@ -88,7 +89,7 @@ public function updateDatabase($dc) $GLOBALS['TL_CONFIG']['bypassCache'] = true; $this->loadDataContainer('tl_iso_product', true); - $objUpdater = new \Isotope\DatabaseUpdater(); + $objUpdater = new DatabaseUpdater(); $objUpdater->autoUpdateTables(array('tl_iso_product')); } diff --git a/system/modules/isotope/library/Isotope/Backend/Product/Alias.php b/system/modules/isotope/library/Isotope/Backend/Product/Alias.php index 8d94f3fa6f..3ec7f1c8d4 100755 --- a/system/modules/isotope/library/Isotope/Backend/Product/Alias.php +++ b/system/modules/isotope/library/Isotope/Backend/Product/Alias.php @@ -19,9 +19,9 @@ class Alias extends \Backend /** * Autogenerate a product alias if it has not been set yet * @param mixed - * @param DataContainer + * @param \DataContainer * @return string - * @throws Exception + * @throws \Exception */ public function save($varValue, \DataContainer $dc) { diff --git a/system/modules/isotope/library/Isotope/Backend/Product/DcaManager.php b/system/modules/isotope/library/Isotope/Backend/Product/DcaManager.php index 560d15083b..f7079a8f3b 100644 --- a/system/modules/isotope/library/Isotope/Backend/Product/DcaManager.php +++ b/system/modules/isotope/library/Isotope/Backend/Product/DcaManager.php @@ -98,9 +98,9 @@ protected function addAttributes() $arrData['attributes'] = array(); // Write attributes from database to DCA + /** @var \Isotope\Model\Attribute[] $objAttributes */ if (($objAttributes = Attribute::findAll(array('column' => array(Attribute::getTable() . ".type!=''")))) !== null) { - while ($objAttributes->next()) { - $objAttribute = $objAttributes->current(); + foreach ($objAttributes as $objAttribute) { if (null !== $objAttribute) { $objAttribute->saveToDCA($arrData); @@ -140,6 +140,7 @@ protected function checkFeatures() $blnShowPrice = false; $arrAttributes = array(); + /** @var \Isotope\Model\ProductType[] $objProductTypes */ if (($objProductTypes = ProductType::findAllUsed()) !== null) { foreach ($objProductTypes as $objType) { @@ -257,6 +258,7 @@ public function buildPaletteString() $arrTypes = ProductType::findAllUsed() ? : array(); } + /** @var \Isotope\Model\ProductType $objType */ foreach ($arrTypes as $objType) { // Enable advanced prices if ($blnSingleRecord && $objType->hasAdvancedPrices()) { @@ -436,6 +438,8 @@ protected static function getPagesBreadcrumb() $arrIds = array(); $arrLinks = array(); + + /** @var \BackendUser $objUser */ $objUser = \BackendUser::getInstance(); // Generate breadcrumb trail diff --git a/system/modules/isotope/library/Isotope/Backend/Product/Label.php b/system/modules/isotope/library/Isotope/Backend/Product/Label.php index e21eb3036d..e9ecccc89c 100644 --- a/system/modules/isotope/library/Isotope/Backend/Product/Label.php +++ b/system/modules/isotope/library/Isotope/Backend/Product/Label.php @@ -62,6 +62,7 @@ public function generate($row, $label, $dc, $args) case 'name': $args[$i] = $objProduct->name; + /** @var \Isotope\Model\ProductType $objProductType */ if ($row['pid'] == 0 && ($objProductType = ProductType::findByPk($row['type'])) !== null && $objProductType->hasVariants()) { // Add a variants link $args[$i] = sprintf('%s', ampersand(\Environment::get('request')) . '&id=' . $row['id'], specialchars($GLOBALS['TL_LANG'][$dc->table]['showVariants']), $args[$i]); @@ -72,6 +73,7 @@ public function generate($row, $label, $dc, $args) $objPrice = ProductPrice::findPrimaryByProduct($row['id']); if (null !== $objPrice) { + /** @var \Isotope\Model\TaxClass $objTax */ $objTax = $objPrice->getRelated('tax_class'); $strTax = (null === $objTax ? '' : ' (' . $objTax->getLabel() . ')'); From 8ffb694031f34bac89848da28829b517ce49ce1a Mon Sep 17 00:00:00 2001 From: Andreas Schempp Date: Thu, 26 Jun 2014 18:02:51 +0200 Subject: [PATCH 16/42] Database::executeUncached is deprecated --- system/modules/isotope/drivers/DC_ProductData.php | 14 +++++++------- .../library/Isotope/Backend/Group/Callback.php | 4 ++-- .../library/Isotope/Backend/Product/Category.php | 4 ++-- .../library/Isotope/Backend/Product/Price.php | 10 +++++----- .../Isotope/Backend/ProductPrice/Callback.php | 4 ++-- .../Isotope/Backend/ProductType/Callback.php | 4 ++-- .../library/Isotope/Backend/SubtableVersion.php | 4 ++-- .../isotope/library/Isotope/Model/ProductCache.php | 2 +- 8 files changed, 23 insertions(+), 23 deletions(-) diff --git a/system/modules/isotope/drivers/DC_ProductData.php b/system/modules/isotope/drivers/DC_ProductData.php index 442a96c6de..f4dac3edee 100644 --- a/system/modules/isotope/drivers/DC_ProductData.php +++ b/system/modules/isotope/drivers/DC_ProductData.php @@ -378,9 +378,9 @@ protected function getNewPosition($mode, $pid = null, $insertInto = false) $this->set['pid'] = $pid; } // Else insert the current record after the parent record elseif ($pid > 0) { - $objParentRecord = $this->Database->prepare("SELECT * FROM " . $this->strTable . " WHERE id=?") + $objParentRecord = \Database::getInstance()->prepare("SELECT * FROM " . $this->strTable . " WHERE id=?") ->limit(1) - ->executeUncached($pid); + ->execute($pid); if ($objParentRecord->numRows) { $this->set['pid'] = $objParentRecord->pid; @@ -414,9 +414,9 @@ public function edit($intID = false, $ajaxId = false) $this->blnEditLanguage = false; // Get the current record - $objRow = $this->Database->prepare("SELECT * FROM " . $this->strTable . " WHERE id=?") + $objRow = \Database::getInstance()->prepare("SELECT * FROM " . $this->strTable . " WHERE id=?") ->limit(1) - ->executeUncached($this->intId); + ->execute($this->intId); // Redirect if there is no record with the given ID if ($objRow->numRows < 1) { @@ -931,9 +931,9 @@ public function editAll($intId = false, $ajaxId = false) $formFields = array(); // Get the field values - $objRow = $this->Database->prepare("SELECT * FROM " . $this->strTable . " WHERE id=?") + $objRow = \Database::getInstance()->prepare("SELECT * FROM " . $this->strTable . " WHERE id=?") ->limit(1) - ->executeUncached($this->intId); + ->execute($this->intId); // Store the active record $this->objActiveRecord = $objRow; @@ -2270,7 +2270,7 @@ public function copyFallback() $this->createInitialVersion($this->strTable, $intLanguageId); $arrRow = $this->Database->execute("SELECT " . implode(',', $arrDuplicate) . " FROM {$this->strTable} WHERE id={$this->intId}")->fetchAssoc(); - $this->Database->prepare("UPDATE {$this->strTable} %s WHERE id=$intLanguageId")->set($arrRow)->executeUncached(); + \Database::getInstance()->prepare("UPDATE {$this->strTable} %s WHERE id=$intLanguageId")->set($arrRow)->execute(); $this->createNewVersion($this->strTable, $intLanguageId); \System::log(sprintf('A new version of record ID %s (table %s) has been created', $intLanguageId, $this->strTable), 'DC_ProductData copyFallback()', TL_GENERAL); diff --git a/system/modules/isotope/library/Isotope/Backend/Group/Callback.php b/system/modules/isotope/library/Isotope/Backend/Group/Callback.php index eb4aa48596..74e82689d9 100644 --- a/system/modules/isotope/library/Isotope/Backend/Group/Callback.php +++ b/system/modules/isotope/library/Isotope/Backend/Group/Callback.php @@ -92,7 +92,7 @@ public function checkPermission($dc) if ($this->User->inherit == 'custom' || !$this->User->groups[0]) { $objUser = \Database::getInstance()->prepare("SELECT iso_groups, iso_groupp FROM tl_user WHERE id=?") ->limit(1) - ->executeUncached($this->User->id); + ->execute($this->User->id); $arrPermissions = deserialize($objUser->iso_groupp); @@ -107,7 +107,7 @@ public function checkPermission($dc) elseif ($this->User->groups[0] > 0) { $objGroup = \Database::getInstance()->prepare("SELECT iso_groups, iso_groupp FROM tl_user_group WHERE id=?") ->limit(1) - ->executeUncached($this->User->groups[0]); + ->execute($this->User->groups[0]); $arrPermissions = deserialize($objGroup->iso_groupp); diff --git a/system/modules/isotope/library/Isotope/Backend/Product/Category.php b/system/modules/isotope/library/Isotope/Backend/Product/Category.php index ff03925567..7657c9804d 100644 --- a/system/modules/isotope/library/Isotope/Backend/Product/Category.php +++ b/system/modules/isotope/library/Isotope/Backend/Product/Category.php @@ -74,7 +74,7 @@ public function restoreVersion($intId, $strTable, $arrData, $intVersion) \Database::getInstance()->query("DELETE FROM " . ProductCategory::getTable() . " WHERE pid=$intId"); foreach ($arrData as $arrRow) { - \Database::getInstance()->prepare("INSERT INTO " . ProductCategory::getTable() . " %s")->set($arrRow)->executeUncached(); + \Database::getInstance()->prepare("INSERT INTO " . ProductCategory::getTable() . " %s")->set($arrRow)->execute(); } } } @@ -117,7 +117,7 @@ public function save($varValue, \DataContainer $dc) if (!empty($arrIds)) { foreach ($arrIds as $id) { - $sorting = (int) \Database::getInstance()->executeUncached("SELECT MAX(sorting) AS sorting FROM $table WHERE page_id=$id")->sorting + 128; + $sorting = (int) \Database::getInstance()->execute("SELECT MAX(sorting) AS sorting FROM $table WHERE page_id=$id")->sorting + 128; \Database::getInstance()->query("INSERT INTO $table (pid,tstamp,page_id,sorting) VALUES ({$dc->id}, $time, $id, $sorting)"); } diff --git a/system/modules/isotope/library/Isotope/Backend/Product/Price.php b/system/modules/isotope/library/Isotope/Backend/Product/Price.php index 0874e4c34d..30fc9a0ad1 100644 --- a/system/modules/isotope/library/Isotope/Backend/Product/Price.php +++ b/system/modules/isotope/library/Isotope/Backend/Product/Price.php @@ -67,11 +67,11 @@ public function restoreVersion($intId, $strTable, $arrData, $intVersion) \Database::getInstance()->query("DELETE FROM " . ProductPrice::getTable() . " WHERE pid=$intId"); foreach ($arrData['prices'] as $arrRow) { - \Database::getInstance()->prepare("INSERT INTO " . ProductPrice::getTable() . " %s")->set($arrRow)->executeUncached(); + \Database::getInstance()->prepare("INSERT INTO " . ProductPrice::getTable() . " %s")->set($arrRow)->execute(); } foreach ($arrData['tiers'] as $arrRow) { - \Database::getInstance()->prepare("INSERT INTO tl_iso_product_pricetier %s")->set($arrRow)->executeUncached(); + \Database::getInstance()->prepare("INSERT INTO tl_iso_product_pricetier %s")->set($arrRow)->execute(); } } } @@ -119,7 +119,7 @@ public function save($varValue, \DataContainer $dc) if ($objPrice->numRows && $objPrice->id > 0) { if ($objPrice->price != $strPrice) { - \Database::getInstance()->prepare("UPDATE tl_iso_product_pricetier SET tstamp=$time, price=? WHERE id=?")->executeUncached($strPrice, $objPrice->id); + \Database::getInstance()->prepare("UPDATE tl_iso_product_pricetier SET tstamp=$time, price=? WHERE id=?")->execute($strPrice, $objPrice->id); $dc->createNewVersion = true; } @@ -127,7 +127,7 @@ public function save($varValue, \DataContainer $dc) if ($objPrice->tax_class != $intTax) { \Database::getInstance()->prepare( "UPDATE " . ProductPrice::getTable() . " SET tstamp=$time, tax_class=? WHERE id=? - ")->executeUncached($intTax, $objPrice->pid); + ")->execute($intTax, $objPrice->pid); $dc->createNewVersion = true; } @@ -150,7 +150,7 @@ public function save($varValue, \DataContainer $dc) \Database::getInstance()->prepare(" INSERT INTO tl_iso_product_pricetier (pid,tstamp,min,price) VALUES (?,?,1,?) - ")->executeUncached($intPrice, $time, $strPrice); + ")->execute($intPrice, $time, $strPrice); $dc->createNewVersion = true; } diff --git a/system/modules/isotope/library/Isotope/Backend/ProductPrice/Callback.php b/system/modules/isotope/library/Isotope/Backend/ProductPrice/Callback.php index 10d3dafd2e..5e773518be 100644 --- a/system/modules/isotope/library/Isotope/Backend/ProductPrice/Callback.php +++ b/system/modules/isotope/library/Isotope/Backend/ProductPrice/Callback.php @@ -174,13 +174,13 @@ public function saveTiers($varValue, $dc) if (!empty($arrUpdate)) { foreach ($arrUpdate as $min => $price) { - \Database::getInstance()->prepare("UPDATE tl_iso_product_pricetier SET tstamp=$time, price=? WHERE pid={$dc->id} AND min=?")->executeUncached($price, $min); + \Database::getInstance()->prepare("UPDATE tl_iso_product_pricetier SET tstamp=$time, price=? WHERE pid={$dc->id} AND min=?")->execute($price, $min); } } if (!empty($arrInsert)) { foreach ($arrInsert as $min => $price) { - \Database::getInstance()->prepare("INSERT INTO tl_iso_product_pricetier (pid,tstamp,min,price) VALUES ({$dc->id}, $time, ?, ?)")->executeUncached($min, $price); + \Database::getInstance()->prepare("INSERT INTO tl_iso_product_pricetier (pid,tstamp,min,price) VALUES ({$dc->id}, $time, ?, ?)")->execute($min, $price); } } } diff --git a/system/modules/isotope/library/Isotope/Backend/ProductType/Callback.php b/system/modules/isotope/library/Isotope/Backend/ProductType/Callback.php index 9998e40675..9819bb80a9 100755 --- a/system/modules/isotope/library/Isotope/Backend/ProductType/Callback.php +++ b/system/modules/isotope/library/Isotope/Backend/ProductType/Callback.php @@ -74,7 +74,7 @@ public function checkPermission() $arrAccess = deserialize($objUser->iso_product_types); $arrAccess[] = \Input::get('id'); - \Database::getInstance()->prepare("UPDATE tl_user SET iso_product_types=? WHERE id=?")->executeUncached(serialize($arrAccess), $this->User->id); + \Database::getInstance()->prepare("UPDATE tl_user SET iso_product_types=? WHERE id=?")->execute(serialize($arrAccess), $this->User->id); } } // Add permissions on group level elseif ($this->User->groups[0] > 0) { @@ -85,7 +85,7 @@ public function checkPermission() $arrAccess = deserialize($objGroup->iso_product_types); $arrAccess[] = \Input::get('id'); - \Database::getInstance()->prepare("UPDATE tl_user_group SET iso_product_types=? WHERE id=?")->executeUncached(serialize($arrAccess), $this->User->groups[0]); + \Database::getInstance()->prepare("UPDATE tl_user_group SET iso_product_types=? WHERE id=?")->execute(serialize($arrAccess), $this->User->groups[0]); } } diff --git a/system/modules/isotope/library/Isotope/Backend/SubtableVersion.php b/system/modules/isotope/library/Isotope/Backend/SubtableVersion.php index 5e5220fc2f..0769387f0d 100644 --- a/system/modules/isotope/library/Isotope/Backend/SubtableVersion.php +++ b/system/modules/isotope/library/Isotope/Backend/SubtableVersion.php @@ -27,7 +27,7 @@ public static function initialize($strTable, $intId, $strSubtable, $arrData) { $objVersion = \Database::getInstance()->prepare("SELECT COUNT(*) AS count FROM tl_version WHERE fromTable=? AND pid=?") ->limit(1) - ->executeUncached($strSubtable, $intId); + ->execute($strSubtable, $intId); if ($objVersion->count < 1) { static::create($strTable, $intId, $strSubtable, $arrData); @@ -45,7 +45,7 @@ public static function create($strTable, $intId, $strSubtable, $arrData) { $objVersion = \Database::getInstance()->prepare("SELECT * FROM tl_version WHERE pid=? AND fromTable=? ORDER BY version DESC") ->limit(1) - ->executeUncached($intId, $strTable); + ->execute($intId, $strTable); // Parent table must have a version if ($objVersion->numRows == 0) { diff --git a/system/modules/isotope/library/Isotope/Model/ProductCache.php b/system/modules/isotope/library/Isotope/Model/ProductCache.php index 12e65b19c2..2bfc81525f 100644 --- a/system/modules/isotope/library/Isotope/Model/ProductCache.php +++ b/system/modules/isotope/library/Isotope/Model/ProductCache.php @@ -108,7 +108,7 @@ public static function deleteForPageAndModuleOrExpired($intPage, $intModule) \Database::getInstance()->prepare(" DELETE FROM " . static::$strTable . " WHERE (page_id=? AND module_id=? AND requestcache_id=? AND keywords=? AND groups=?) OR (expires>0 AND expires<$time) - ")->executeUncached($intPage, $intModule, (int) \Input::get('isorc'), (string) \Input::get('keywords'), static::getCacheableGroups()); + ")->execute($intPage, $intModule, (int) \Input::get('isorc'), (string) \Input::get('keywords'), static::getCacheableGroups()); } /** From c0db5379094bb5f9e5b5007925e3626d4faa2fc6 Mon Sep 17 00:00:00 2001 From: Andreas Schempp Date: Thu, 26 Jun 2014 18:19:54 +0200 Subject: [PATCH 17/42] Order of fields in product type was not applied to palette (#1135) --- system/modules/isotope/docs/CHANGELOG-2.1.md | 1 + .../Isotope/Backend/Product/DcaManager.php | 17 +++++++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/system/modules/isotope/docs/CHANGELOG-2.1.md b/system/modules/isotope/docs/CHANGELOG-2.1.md index 0500337c82..e14a46bc30 100644 --- a/system/modules/isotope/docs/CHANGELOG-2.1.md +++ b/system/modules/isotope/docs/CHANGELOG-2.1.md @@ -13,6 +13,7 @@ Version 2.1.3-stable (2014-??-??) - URLs for Sparkasse and Worldpay payment methods were incorrectly generated (#1141 and #1142) - CDATA statement in javascript caused issue in Sparkasse payment method (#1140) - Front end javascript was not compatible with IE8 (#1155) +- Order of fields in product type was not applied to palette (#1135) Version 2.1.2-stable (2014-06-02) diff --git a/system/modules/isotope/library/Isotope/Backend/Product/DcaManager.php b/system/modules/isotope/library/Isotope/Backend/Product/DcaManager.php index f7079a8f3b..ac62d72726 100644 --- a/system/modules/isotope/library/Isotope/Backend/Product/DcaManager.php +++ b/system/modules/isotope/library/Isotope/Backend/Product/DcaManager.php @@ -260,12 +260,15 @@ public function buildPaletteString() /** @var \Isotope\Model\ProductType $objType */ foreach ($arrTypes as $objType) { + // Enable advanced prices if ($blnSingleRecord && $objType->hasAdvancedPrices()) { $arrFields['prices']['exclude'] = $arrFields['price']['exclude']; $arrFields['prices']['attributes'] = $arrFields['price']['attributes']; $arrFields['price'] = $arrFields['prices']; - } // Register callback to version/restore a price + } + + // Register callback to version/restore a price else { $GLOBALS['TL_DCA']['tl_iso_product']['config']['onversion_callback'][] = array('Isotope\Backend\Product\Price', 'createVersion'); $GLOBALS['TL_DCA']['tl_iso_product']['config']['onrestore_callback'][] = array('Isotope\Backend\Product\Price', 'restoreVersion'); @@ -273,6 +276,8 @@ public function buildPaletteString() $arrInherit = array(); $arrPalette = array(); + $arrLegends = array(); + $arrLegendOrder = array(); if ($blnVariants) { $arrConfig = deserialize($objType->variant_attributes, true); @@ -302,7 +307,8 @@ public function buildPaletteString() continue; } - $arrPalette[$arrConfig[$name]['legend']][] = $name; + $arrLegendOrder[$arrConfig[$name]['position']] = $arrConfig[$name]['legend']; + $arrPalette[$arrConfig[$name]['legend']][$arrConfig[$name]['position']] = $name; // Apply product type attribute config if ($arrConfig[$name]['tl_class'] != '') { @@ -326,10 +332,13 @@ public function buildPaletteString() } } - $arrLegends = array(); + ksort($arrLegendOrder); + $arrLegendOrder = array_unique($arrLegendOrder); // Build - foreach ($arrPalette as $legend => $fields) { + foreach ($arrLegendOrder as $legend) { + $fields = $arrPalette[$legend]; + ksort($fields); $arrLegends[] = '{' . $legend . '},' . implode(',', $fields); } From f020de5c65f0ac4cddd1b6cd97ceae8235858e2f Mon Sep 17 00:00:00 2001 From: Andreas Schempp Date: Thu, 26 Jun 2014 18:28:52 +0200 Subject: [PATCH 18/42] Edit-multiple failed in Contao 3.3 (#1150) --- system/modules/isotope/docs/CHANGELOG-2.1.md | 1 + system/modules/isotope/drivers/DC_ProductData.php | 12 ++++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/system/modules/isotope/docs/CHANGELOG-2.1.md b/system/modules/isotope/docs/CHANGELOG-2.1.md index e14a46bc30..e70ffd240e 100644 --- a/system/modules/isotope/docs/CHANGELOG-2.1.md +++ b/system/modules/isotope/docs/CHANGELOG-2.1.md @@ -14,6 +14,7 @@ Version 2.1.3-stable (2014-??-??) - CDATA statement in javascript caused issue in Sparkasse payment method (#1140) - Front end javascript was not compatible with IE8 (#1155) - Order of fields in product type was not applied to palette (#1135) +- Edit-multiple failed in Contao 3.3 (#1150) Version 2.1.2-stable (2014-06-02) diff --git a/system/modules/isotope/drivers/DC_ProductData.php b/system/modules/isotope/drivers/DC_ProductData.php index f4dac3edee..88bd1c27c4 100644 --- a/system/modules/isotope/drivers/DC_ProductData.php +++ b/system/modules/isotope/drivers/DC_ProductData.php @@ -909,7 +909,11 @@ public function editAll($intId = false, $ajaxId = false) if (is_array($fields) && !empty($fields) && \Input::get('fields')) { $class = 'tl_tbox block'; - $this->checkForTinyMce(); + + // @deprecated Has been removed in Contao 3.3 with TinyMCE 4 + if (version_compare(VERSION, '3.3', '<')) { + $this->checkForTinyMce(); + } // Walk through each record foreach ($ids as $id) { @@ -1175,7 +1179,11 @@ public function overrideAll() if (is_array($fields) && !empty($fields) && \Input::get('fields')) { $class = 'tl_tbox block'; $formFields = array(); - $this->checkForTinyMce(); + + // @deprecated Has been removed in Contao 3.3 with TinyMCE 4 + if (version_compare(VERSION, '3.3', '<')) { + $this->checkForTinyMce(); + } // Save record if (\Input::post('FORM_SUBMIT') == $this->strTable) { From 82dc64b3a9b8dcc7615bba88201e39cc0e5bd321 Mon Sep 17 00:00:00 2001 From: Andreas Schempp Date: Thu, 26 Jun 2014 18:48:32 +0200 Subject: [PATCH 19/42] Fixed icon for copy fallback --- system/modules/isotope/assets/css/backend.css | 2 +- system/modules/isotope/assets/css/backend.min.css | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/system/modules/isotope/assets/css/backend.css b/system/modules/isotope/assets/css/backend.css index 917cc28213..4f4311c5c7 100644 --- a/system/modules/isotope/assets/css/backend.css +++ b/system/modules/isotope/assets/css/backend.css @@ -31,7 +31,7 @@ .header_iso_copy { - background-image:url(../../../themes/default/images/copy.gif); + background-image:url(../../../../themes/default/images/copy.gif); background-position:left center; background-repeat:no-repeat; padding:2px 0 3px 20px; diff --git a/system/modules/isotope/assets/css/backend.min.css b/system/modules/isotope/assets/css/backend.min.css index 5f2217de02..3f796c8a43 100644 --- a/system/modules/isotope/assets/css/backend.min.css +++ b/system/modules/isotope/assets/css/backend.min.css @@ -1 +1 @@ -.header_import_assets{padding:2px 0 3px 20px;background-image:url("../images/image--plus.png");background-position:left center;background-repeat:no-repeat}.header_import_mail{padding:2px 0 3px 20px;background-image:url("../images/inbox-download.png");background-position:left center;background-repeat:no-repeat}.header_iso_copy{background-image:url(../../../themes/default/images/copy.gif);background-position:left center;background-repeat:no-repeat;padding:2px 0 3px 20px}.header_iso_groups{padding:2px 0 3px 20px;background-image:url("../images/folders.png");background-position:left center;background-repeat:no-repeat}body.popup .header_back{display:none}.tl_mediamanager th,.tl_mediamanager td{padding:2px 10px 0 0}.tl_mediamanager td.col_0{text-align:center;vertical-align:middle}.tl_mediamanager input.tl_text_2{width:220px}.tl_mediamanager textarea{height:40px;width:250px}.tl_mediamanager .radio_container span{display:block}.tl_mediamanager img{position:relative;top:1px}.tl_mediamanager .upload_container{margin-top:8px}.tl_mediamanager .qq-hide{display:none}.tl_mediamanager .qq-upload-drop-area{width:700px;padding:56px 0;margin-bottom:12px;text-align:center;border:3px dashed #dbdbdb;border-left:none;border-right:0;background-color:#f7f7f7;width:100%;position:relative;top:0;left:0;z-index:2}.tl_mediamanager .qq-upload-drop-area span{font-size:16px;color:grey}.tl_mediamanager .qq-upload-button{padding:3px;margin:-3px}.tl_mediamanager .qq-upload-button .tl_submit{display:inline-block;font-family:"Trebuchet MS",Verdana,sans-serif;font-size:12px}.tl_mediamanager .qq-upload-button:focus .tl_submit,.tl_mediamanager .qq-upload-button:hover .tl_submit{box-shadow:0 0 3px #aaa}.tl_mediamanager .qq-edit-filename{display:none}.tl_mediamanager .qq-upload-size{color:#b3b3b3}.tl_mediamanager .qq-upload-list{margin:8px 0 8px 16px}.tl_mediamanager .qq-upload-list li{line-height:14px;list-style-type:square}.tl_mediamanager .qq-upload-success{color:#8ab858}.tl_mediamanager .qq-upload-fail{color:#c55}#ctrl_attributes tr:hover td,#ctrl_variant_attributes tr:hover td,#ctrl_address_fields tr:hover td{background-color:#ebfdd7}table.multicolumnwizard{width:663px}table.multicolumnwizard .operations{white-space:nowrap}.mod_iso_orderdetails .info_container{float:left;width:200px;border:1px dotted #ccc;padding:10px;margin:0 10px 10px 0}.mod_iso_orderdetails .info_container h3{margin-top:0;margin-bottom:5px}.mod_iso_orderdetails table{margin-top:20px;border-top:1px dotted #ccc;width:100%}.mod_iso_orderdetails tbody td{padding:5px;border-bottom:1px dotted #ccc;vertical-align:top}.mod_iso_orderdetails ul{margin:0;padding:0;padding-left:10px}.mod_iso_orderdetails li{margin-left:10px;padding:0;list-style-type:disc}.mod_iso_orderdetails .price{text-align:right}.mod_iso_orderdetails tfoot td{text-align:right;padding:5px 5px 0 5px}.w50h{height:auto}.hide_sort_hint .sort_hint{display:none}.iso_filter{line-height:28px}.iso_filter .tl_submit.active{border:1px solid #b8b8b8;background:#eee;background-image:-moz-linear-gradient(bottom,#ccc 0,#ffd 60%);background-image:-webkit-linear-gradient(bottom,#ccc 0,#ffd 60%);background-image:-o-linear-gradient(bottom,#ccc 0,#ffd 60%);background-image:-ms-linear-gradient(bottom,#ccc 0,#ffd 60%);background-image:linear-gradient(bottom,#ccc 0,#ffd 60%)}.iso_filter .styled_select{margin-top:4px}.iso_listing_container th.col_images{font-size:0;width:60px}.iso_listing_container td.col_images{height:50px}.tl_listing_container .col_order_status{padding:0}.tl_listing_container .col_order_status span{display:block;padding:2px 5px 3px;border-radius:2px}.iso_operations{width:110px;white-space:normal}.iso_operations a{display:inline-block;margin-bottom:4px}.tl_productdata .tl_file{min-height:36px}.tl_productdata .tl_file .tl_left a,.product_tree .tl_file .tl_left a{float:left;margin-top:10px}.tl_productdata .tl_file .tl_left a.tl_tip,.product_tree .tl_file .tl_left a.tl_tip{float:none}.tl_productdata .tl_file .tl_right,.product_tree .tl_file .tl_right{height:auto;text-align:right}.tl_productdata label,.tl_productdata .tl_folder .tl_left{line-height:18px}.iso_product{margin-top:2px;margin-bottom:2px;width:500px;text-indent:0}.iso_product .thumbnail{padding-right:5px;float:left;width:34px;height:34px}.iso_product ul{margin-left:34px}.iso_product p{font-weight:bold;margin:0 0 5px 0;padding:0}.iso_product p span{font-weight:normal}.tree_view .iso_product a{float:none;margin-top:0}h3.inherit,.tl_checkbox_single_container.inherit{background-color:#f8f8f8;padding:2px 2px 2px 0;margin:14px 0 1px 0}body.iso_be_overview .tip-wrap{margin-left:30px!important;margin-top:70px}.be_iso_overview .item a{display:block;width:105px;height:70px;margin:15px 0;padding:5px;border-radius:5px;float:left;text-align:center}.be_iso_overview .item a.disabled{pointer-events:none;cursor:default}.be_iso_overview .item span{display:block}.be_iso_overview .item a.disabled img{filter:url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'grayscale\'><feColorMatrix type=\'matrix\' values=\'0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0\'/></filter></svg>#grayscale");filter:gray;-webkit-filter:grayscale(100%)}.be_iso_introduction .left{float:left;width:400px;padding:0 10px;background:#eff5fa}.be_iso_introduction .left strong{color:#1899ad}.be_iso_introduction .right{width:250px;margin-left:441px}.iso_importassets li{list-style-type:inherit} \ No newline at end of file +.header_import_assets{padding:2px 0 3px 20px;background-image:url("../images/image--plus.png");background-position:left center;background-repeat:no-repeat}.header_import_mail{padding:2px 0 3px 20px;background-image:url("../images/inbox-download.png");background-position:left center;background-repeat:no-repeat}.header_iso_copy{background-image:url(../../../../themes/default/images/copy.gif);background-position:left center;background-repeat:no-repeat;padding:2px 0 3px 20px}.header_iso_groups{padding:2px 0 3px 20px;background-image:url("../images/folders.png");background-position:left center;background-repeat:no-repeat}body.popup .header_back{display:none}.tl_mediamanager th,.tl_mediamanager td{padding:2px 10px 0 0}.tl_mediamanager td.col_0{text-align:center;vertical-align:middle}.tl_mediamanager input.tl_text_2{width:220px}.tl_mediamanager textarea{height:40px;width:250px}.tl_mediamanager .radio_container span{display:block}.tl_mediamanager img{position:relative;top:1px}.tl_mediamanager .upload_container{margin-top:8px}.tl_mediamanager .qq-hide{display:none}.tl_mediamanager .qq-upload-drop-area{width:700px;padding:56px 0;margin-bottom:12px;text-align:center;border:3px dashed #dbdbdb;border-left:none;border-right:0;background-color:#f7f7f7;width:100%;position:relative;top:0;left:0;z-index:2}.tl_mediamanager .qq-upload-drop-area span{font-size:16px;color:grey}.tl_mediamanager .qq-upload-button{padding:3px;margin:-3px}.tl_mediamanager .qq-upload-button .tl_submit{display:inline-block;font-family:"Trebuchet MS",Verdana,sans-serif;font-size:12px}.tl_mediamanager .qq-upload-button:focus .tl_submit,.tl_mediamanager .qq-upload-button:hover .tl_submit{box-shadow:0 0 3px #aaa}.tl_mediamanager .qq-edit-filename{display:none}.tl_mediamanager .qq-upload-size{color:#b3b3b3}.tl_mediamanager .qq-upload-list{margin:8px 0 8px 16px}.tl_mediamanager .qq-upload-list li{line-height:14px;list-style-type:square}.tl_mediamanager .qq-upload-success{color:#8ab858}.tl_mediamanager .qq-upload-fail{color:#c55}#ctrl_attributes tr:hover td,#ctrl_variant_attributes tr:hover td,#ctrl_address_fields tr:hover td{background-color:#ebfdd7}table.multicolumnwizard{width:663px}table.multicolumnwizard .operations{white-space:nowrap}.mod_iso_orderdetails .info_container{float:left;width:200px;border:1px dotted #ccc;padding:10px;margin:0 10px 10px 0}.mod_iso_orderdetails .info_container h3{margin-top:0;margin-bottom:5px}.mod_iso_orderdetails table{margin-top:20px;border-top:1px dotted #ccc;width:100%}.mod_iso_orderdetails tbody td{padding:5px;border-bottom:1px dotted #ccc;vertical-align:top}.mod_iso_orderdetails ul{margin:0;padding:0;padding-left:10px}.mod_iso_orderdetails li{margin-left:10px;padding:0;list-style-type:disc}.mod_iso_orderdetails .price{text-align:right}.mod_iso_orderdetails tfoot td{text-align:right;padding:5px 5px 0 5px}.w50h{height:auto}.hide_sort_hint .sort_hint{display:none}.iso_filter{line-height:28px}.iso_filter .tl_submit.active{border:1px solid #b8b8b8;background:#eee;background-image:-moz-linear-gradient(bottom,#ccc 0,#ffd 60%);background-image:-webkit-linear-gradient(bottom,#ccc 0,#ffd 60%);background-image:-o-linear-gradient(bottom,#ccc 0,#ffd 60%);background-image:-ms-linear-gradient(bottom,#ccc 0,#ffd 60%);background-image:linear-gradient(bottom,#ccc 0,#ffd 60%)}.iso_filter .styled_select{margin-top:4px}.iso_listing_container th.col_images{font-size:0;width:60px}.iso_listing_container td.col_images{height:50px}.tl_listing_container .col_order_status{padding:0}.tl_listing_container .col_order_status span{display:block;padding:2px 5px 3px;border-radius:2px}.iso_operations{width:110px;white-space:normal}.iso_operations a{display:inline-block;margin-bottom:4px}.tl_productdata .tl_file{min-height:36px}.tl_productdata .tl_file .tl_left a,.product_tree .tl_file .tl_left a{float:left;margin-top:10px}.tl_productdata .tl_file .tl_left a.tl_tip,.product_tree .tl_file .tl_left a.tl_tip{float:none}.tl_productdata .tl_file .tl_right,.product_tree .tl_file .tl_right{height:auto;text-align:right}.tl_productdata label,.tl_productdata .tl_folder .tl_left{line-height:18px}.iso_product{margin-top:2px;margin-bottom:2px;width:500px;text-indent:0}.iso_product .thumbnail{padding-right:5px;float:left;width:34px;height:34px}.iso_product ul{margin-left:34px}.iso_product p{font-weight:bold;margin:0 0 5px 0;padding:0}.iso_product p span{font-weight:normal}.tree_view .iso_product a{float:none;margin-top:0}h3.inherit,.tl_checkbox_single_container.inherit{background-color:#f8f8f8;padding:2px 2px 2px 0;margin:14px 0 1px 0}body.iso_be_overview .tip-wrap{margin-left:30px!important;margin-top:70px}.be_iso_overview .item a{display:block;width:105px;height:70px;margin:15px 0;padding:5px;border-radius:5px;float:left;text-align:center}.be_iso_overview .item a.disabled{pointer-events:none;cursor:default}.be_iso_overview .item span{display:block}.be_iso_overview .item a.disabled img{filter:url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'grayscale\'><feColorMatrix type=\'matrix\' values=\'0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0\'/></filter></svg>#grayscale");filter:gray;-webkit-filter:grayscale(100%)}.be_iso_introduction .left{float:left;width:400px;padding:0 10px;background:#eff5fa}.be_iso_introduction .left strong{color:#1899ad}.be_iso_introduction .right{width:250px;margin-left:441px}.iso_importassets li{list-style-type:inherit} \ No newline at end of file From 8e025a53071619390402b9542e28087743a91ddf Mon Sep 17 00:00:00 2001 From: Andreas Schempp Date: Thu, 26 Jun 2014 18:53:53 +0200 Subject: [PATCH 20/42] CS --- .../library/Isotope/Model/ProductCollectionSurcharge.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/system/modules/isotope/library/Isotope/Model/ProductCollectionSurcharge.php b/system/modules/isotope/library/Isotope/Model/ProductCollectionSurcharge.php index edf66a2c0d..58fac5e46d 100644 --- a/system/modules/isotope/library/Isotope/Model/ProductCollectionSurcharge.php +++ b/system/modules/isotope/library/Isotope/Model/ProductCollectionSurcharge.php @@ -333,7 +333,10 @@ public static function findForCollection(IsotopeProductCollection $objCollection } } + /** @var \Isotope\Model\ProductCollectionSurcharge $objSurcharge */ foreach ($arrPreTax as $objSurcharge) { + + /** @var \Isotope\Model\TaxClass $objTaxClass */ $objTaxClass = TaxClass::findByPk($objSurcharge->tax_class); // Skip products without tax class @@ -343,6 +346,7 @@ public static function findForCollection(IsotopeProductCollection $objCollection $fltPrice = $objSurcharge->total_price; + /** @var \Isotope\Model\TaxRate $objIncludes */ if (($objIncludes = $objTaxClass->getRelated('includes')) !== null) { if ($objIncludes->isApplicable($fltPrice, $arrAddresses)) { $fltTax = $objIncludes->calculateAmountIncludedInPrice($fltPrice); @@ -372,6 +376,8 @@ public static function findForCollection(IsotopeProductCollection $objCollection } if (($objRates = $objTaxClass->getRelated('rates')) !== null) { + + /** @var \Isotope\Model\TaxRate $objTaxRate */ foreach ($objRates as $objTaxRate) { if ($objTaxRate->isApplicable($fltPrice, $arrAddresses)) { @@ -430,6 +436,7 @@ protected static function buildSurcharge($strClass, $strLabel, $objSource, Isoto { $intTaxClass = $objSource->tax_class; + /** @var \Isotope\Model\ProductCollectionSurcharge $objSurcharge */ $objSurcharge = new $strClass(); $objSurcharge->label = ($strLabel . ' (' . $objSource->getLabel() . ')'); $objSurcharge->price = ($objSource->isPercentage() ? $objSource->getPercentage() . '%' : ' '); From d57672f30765fa8991587f468d0839a5fb21f708 Mon Sep 17 00:00:00 2001 From: Andreas Schempp Date: Thu, 26 Jun 2014 19:14:14 +0200 Subject: [PATCH 21/42] Copy fallback language was not working (#1151) --- system/modules/isotope/docs/CHANGELOG-2.1.md | 1 + .../isotope/library/Isotope/Backend/Product/DcaManager.php | 4 +--- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/system/modules/isotope/docs/CHANGELOG-2.1.md b/system/modules/isotope/docs/CHANGELOG-2.1.md index e70ffd240e..66466b0b21 100644 --- a/system/modules/isotope/docs/CHANGELOG-2.1.md +++ b/system/modules/isotope/docs/CHANGELOG-2.1.md @@ -15,6 +15,7 @@ Version 2.1.3-stable (2014-??-??) - Front end javascript was not compatible with IE8 (#1155) - Order of fields in product type was not applied to palette (#1135) - Edit-multiple failed in Contao 3.3 (#1150) +- Copy fallback language was not working (#1151) Version 2.1.2-stable (2014-06-02) diff --git a/system/modules/isotope/library/Isotope/Backend/Product/DcaManager.php b/system/modules/isotope/library/Isotope/Backend/Product/DcaManager.php index ac62d72726..a412320963 100644 --- a/system/modules/isotope/library/Isotope/Backend/Product/DcaManager.php +++ b/system/modules/isotope/library/Isotope/Backend/Product/DcaManager.php @@ -224,8 +224,6 @@ public function addBreadcrumb() /** * Build palette for the current product type/variant - * @param object - * @return void */ public function buildPaletteString() { @@ -250,7 +248,7 @@ public function buildPaletteString() $objType = ProductType::findByPk(($objProduct->pid > 0 ? $objProduct->parent_type : $objProduct->type)); $arrTypes = null === $objType ? array() : array($objType); - if ($objProduct->pid > 0 || ($act != 'edit' && $act != 'show')) { + if ($objProduct->pid > 0 || ($act != 'edit' && $act != 'copyFallback' && $act != 'show')) { $blnVariants = true; } } From a2bb14b5192cdcc1f5ef59e9328e0a42e36e44ad Mon Sep 17 00:00:00 2001 From: Andreas Schempp Date: Thu, 26 Jun 2014 19:43:42 +0200 Subject: [PATCH 22/42] CS --- .../isotope/library/Isotope/Model/Product.php | 18 +++++++++--------- .../library/Isotope/Model/ProductPrice.php | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/system/modules/isotope/library/Isotope/Model/Product.php b/system/modules/isotope/library/Isotope/Model/Product.php index d8e5991703..036faab852 100644 --- a/system/modules/isotope/library/Isotope/Model/Product.php +++ b/system/modules/isotope/library/Isotope/Model/Product.php @@ -79,7 +79,7 @@ public static function unsetActive() /** * Find all published products * @param array - * @return \Collection + * @return \Model\Collection */ public static function findPublished(array $arrOptions = array()) { @@ -91,7 +91,7 @@ public static function findPublished(array $arrOptions = array()) * @param mixed * @param mixed * @param array - * @return \Collection + * @return \Model\Collection */ public static function findPublishedBy($arrColumns, $arrValues, array $arrOptions = array()) { @@ -116,7 +116,7 @@ public static function findPublishedBy($arrColumns, $arrValues, array $arrOption * Find a single product by primary key * @param int * @param array - * @return \Collection + * @return \Model\Collection */ public static function findPublishedByPk($intId, array $arrOptions = array()) { @@ -158,7 +158,7 @@ public static function findPublishedByIdOrAlias($varId, array $arrOptions = arra * Find products by IDs * @param array * @param array - * @return \Collection + * @return \Model\Collection */ public static function findPublishedByIds(array $arrIds, array $arrOptions = array()) { @@ -173,7 +173,7 @@ public static function findPublishedByIds(array $arrIds, array $arrOptions = arr * Return collection of published product variants by product PID * @param int * @param array - * @return \Collection + * @return \Model\Collection */ public static function findPublishedByPid($intPid, array $arrOptions = array()) { @@ -184,7 +184,7 @@ public static function findPublishedByPid($intPid, array $arrOptions = array()) * Return collection of published products by categories * @param array * @param array - * @return \Collection + * @return \Model\Collection */ public static function findPublishedByCategories(array $arrCategories, array $arrOptions = array()) { @@ -195,7 +195,7 @@ public static function findPublishedByCategories(array $arrCategories, array $ar * Find a single frontend-available product by primary key * @param int * @param array - * @return \Collection + * @return \Model\Collection */ public static function findAvailableByPk($intId, array $arrOptions = array()) { @@ -212,7 +212,7 @@ public static function findAvailableByPk($intId, array $arrOptions = array()) * Find a single frontend-available product by its ID or alias * @param mixed The ID or alias * @param array An optional options array - * @return \Product|null The model or null if the result is empty + * @return Product|null The model or null if the result is empty */ public static function findAvailableByIdOrAlias($varId, array $arrOptions = array()) { @@ -229,7 +229,7 @@ public static function findAvailableByIdOrAlias($varId, array $arrOptions = arra * Find frontend-available products by IDs * @param array * @param array - * @return \Collection + * @return \Model\Collection */ public static function findAvailableByIds(array $arrIds, array $arrOptions = array()) { diff --git a/system/modules/isotope/library/Isotope/Model/ProductPrice.php b/system/modules/isotope/library/Isotope/Model/ProductPrice.php index 9b8344fa04..a2aeb08555 100644 --- a/system/modules/isotope/library/Isotope/Model/ProductPrice.php +++ b/system/modules/isotope/library/Isotope/Model/ProductPrice.php @@ -276,7 +276,7 @@ public static function findPrimaryByProduct($intProduct, array $arrOptions = arr * Find primary price for multiple product/variant IDs * @param array * @param array - * @return Model\Collection|null + * @return \Model\Collection|null */ public static function findPrimaryByProductIds(array $arrIds, array $arrOptions = array()) { @@ -303,7 +303,7 @@ public static function findPrimaryByProductIds(array $arrIds, array $arrOptions * Find advanced price for multiple product/variant IDs * @param array * @param IsotopeProductCollection - * @return Model\Collection|null + * @return \Model\Collection|null */ public static function findAdvancedByProductIdsAndCollection(array $arrIds, IsotopeProductCollection $objCollection) { From 8798d4798e785735e0fe7ad8af87f1f813918ba7 Mon Sep 17 00:00:00 2001 From: Andreas Schempp Date: Thu, 26 Jun 2014 19:44:31 +0200 Subject: [PATCH 23/42] Fixed multiple join aliases --- system/modules/isotope/library/Isotope/Model/Product.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/modules/isotope/library/Isotope/Model/Product.php b/system/modules/isotope/library/Isotope/Model/Product.php index 036faab852..2553b0086b 100644 --- a/system/modules/isotope/library/Isotope/Model/Product.php +++ b/system/modules/isotope/library/Isotope/Model/Product.php @@ -429,7 +429,7 @@ protected static function buildFindQuery(array $arrOptions) if (is_array($arrOptions['joinAliases']) && ($key = array_search($arrConfig['table'], $arrOptions['joinAliases'])) !== false) { $strJoinAlias = $key; - unset($arrJoinAliases[$key]); + unset($arrOptions['joinAliases'][$key]); } else { ++$intCount; $strJoinAlias = 'j' . $intCount; From dd1ae7832e93efb90d473d441230b8e2280f1a5b Mon Sep 17 00:00:00 2001 From: Andreas Schempp Date: Thu, 26 Jun 2014 20:00:48 +0200 Subject: [PATCH 24/42] From price was not shown for variants with price tiers (#1146) --- system/modules/isotope/docs/CHANGELOG-2.1.md | 1 + .../isotope/library/Isotope/Collection/ProductPrice.php | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/system/modules/isotope/docs/CHANGELOG-2.1.md b/system/modules/isotope/docs/CHANGELOG-2.1.md index 66466b0b21..fd491c8d06 100644 --- a/system/modules/isotope/docs/CHANGELOG-2.1.md +++ b/system/modules/isotope/docs/CHANGELOG-2.1.md @@ -57,6 +57,7 @@ Version 2.1.1-stable (2014-05-20) - Do not generate sitemap links for unpublished pages (#1092) - Wrong column count in collection template (#1091) - Remove page parameter on product filter action (#1098) +- From price was not shown for variants with price tiers (#1146) Version 2.1.0-stable (2014-04-01) diff --git a/system/modules/isotope/library/Isotope/Collection/ProductPrice.php b/system/modules/isotope/library/Isotope/Collection/ProductPrice.php index 68d94d5eb0..5a90033e6e 100644 --- a/system/modules/isotope/library/Isotope/Collection/ProductPrice.php +++ b/system/modules/isotope/library/Isotope/Collection/ProductPrice.php @@ -87,18 +87,21 @@ public function generate($blnShowTiers=false) $fltPrice = null; $fltOriginalPrice = null; - $blnShowFrom = false; + $arrPrices = array(); foreach ($this->arrModels as $objPrice) { $fltNew = $blnShowTiers ? $objPrice->getLowestAmount() : $objPrice->getAmount(); + $arrPrices[] = $fltNew; if (null === $fltPrice || $fltNew < $fltPrice) { - $blnShowFrom = (null !== $fltPrice); $fltPrice = $fltNew; $fltOriginalPrice = $objPrice->getOriginalAmount(); } } + $arrPrices = array_unique($arrPrices); + $blnShowFrom = count($arrPrices) > 1; + if ($blnShowFrom) { return sprintf($GLOBALS['TL_LANG']['MSC']['priceRangeLabel'], Isotope::formatPriceWithCurrency($fltPrice)); } elseif ($fltPrice < $fltOriginalPrice) { From fa0f673e93eb1d60577faa9b90192e1bb77da793 Mon Sep 17 00:00:00 2001 From: Andreas Schempp Date: Thu, 26 Jun 2014 20:01:13 +0200 Subject: [PATCH 25/42] CS --- .../modules/isotope/library/Isotope/Model/Product/Standard.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/modules/isotope/library/Isotope/Model/Product/Standard.php b/system/modules/isotope/library/Isotope/Model/Product/Standard.php index 692d397a5b..6a2a3ca5a6 100644 --- a/system/modules/isotope/library/Isotope/Model/Product/Standard.php +++ b/system/modules/isotope/library/Isotope/Model/Product/Standard.php @@ -288,7 +288,7 @@ public function getProductId() /** * Get product price model * @param IsotopeProductCollection - * @return IsotopePrice + * @return \Isotope\Interfaces\IsotopePrice */ public function getPrice(IsotopeProductCollection $objCollection = null) { From 8a8bc445f1f229ac7e5545ebeb87b710b8a5b0db Mon Sep 17 00:00:00 2001 From: Andreas Schempp Date: Thu, 26 Jun 2014 20:37:30 +0200 Subject: [PATCH 26/42] Incorrect tax free total in product collection template --- system/modules/isotope/docs/CHANGELOG-2.1.md | 1 + .../modules/isotope/library/Isotope/Model/ProductCollection.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/system/modules/isotope/docs/CHANGELOG-2.1.md b/system/modules/isotope/docs/CHANGELOG-2.1.md index fd491c8d06..c8e7a40bf6 100644 --- a/system/modules/isotope/docs/CHANGELOG-2.1.md +++ b/system/modules/isotope/docs/CHANGELOG-2.1.md @@ -58,6 +58,7 @@ Version 2.1.1-stable (2014-05-20) - Wrong column count in collection template (#1091) - Remove page parameter on product filter action (#1098) - From price was not shown for variants with price tiers (#1146) +- Incorrect tax free total in product collection template Version 2.1.0-stable (2014-04-01) diff --git a/system/modules/isotope/library/Isotope/Model/ProductCollection.php b/system/modules/isotope/library/Isotope/Model/ProductCollection.php index b7d4907686..447b7ab1ea 100644 --- a/system/modules/isotope/library/Isotope/Model/ProductCollection.php +++ b/system/modules/isotope/library/Isotope/Model/ProductCollection.php @@ -1274,7 +1274,7 @@ protected function generateItem(ProductCollectionItem $objItem) 'price' => Isotope::formatPriceWithCurrency($objItem->getPrice()), 'tax_free_price' => Isotope::formatPriceWithCurrency($objItem->getTaxFreePrice()), 'total' => Isotope::formatPriceWithCurrency($objItem->getTotalPrice()), - 'tax_free_total' => Isotope::formatPriceWithCurrency($objItem->getTaxFreeTotalPrice() * $objItem->quantity), + 'tax_free_total' => Isotope::formatPriceWithCurrency($objItem->getTaxFreeTotalPrice()), 'tax_id' => $objItem->tax_id, 'hasProduct' => $blnHasProduct, 'product' => $objProduct, From 57bb7be8c739407a960f2d5d9a1496f0e7f49a9b Mon Sep 17 00:00:00 2001 From: Andreas Schempp Date: Thu, 26 Jun 2014 21:09:23 +0200 Subject: [PATCH 27/42] CS and incorrect namespace declarations --- .../Isotope/Interfaces/IsotopePayment.php | 10 ++++---- .../Interfaces/IsotopeProductCollection.php | 8 +++---- .../isotope/library/Isotope/Isotope.php | 10 ++++---- .../isotope/library/Isotope/Model/Payment.php | 10 ++++---- .../Isotope/Model/ProductCollection.php | 24 ++++++++++--------- .../Isotope/Model/ProductCollectionItem.php | 4 ++-- .../library/Isotope/Model/ProductPrice.php | 2 ++ 7 files changed, 36 insertions(+), 32 deletions(-) diff --git a/system/modules/isotope/library/Isotope/Interfaces/IsotopePayment.php b/system/modules/isotope/library/Isotope/Interfaces/IsotopePayment.php index 61865d0d4a..0755cb6d11 100644 --- a/system/modules/isotope/library/Isotope/Interfaces/IsotopePayment.php +++ b/system/modules/isotope/library/Isotope/Interfaces/IsotopePayment.php @@ -20,16 +20,16 @@ interface IsotopePayment { /** * Process payment on checkout confirmation page. - * @param IsotopeProductCollection The order being places - * @param Module The checkout module instance + * @param IsotopeProductCollection $objOrder The order being places + * @param \Module $objModule The checkout module instance * @return mixed */ public function processPayment(IsotopeProductCollection $objOrder, \Module $objModule); /** * Return a html form for checkout or false - * @param IsotopeProductCollection The order being places - * @param Module The checkout module instance + * @param IsotopeProductCollection $objOrder The order being places + * @param \Module $objModule The checkout module instance * @return mixed */ public function checkoutForm(IsotopeProductCollection $objOrder, \Module $objModule); @@ -38,7 +38,7 @@ public function checkoutForm(IsotopeProductCollection $objOrder, \Module $objMod * Return information or advanced features in the backend. * * Use this function to present advanced features or basic payment information for an order in the backend. - * @param integer Order ID + * @param integer $orderId Order ID * @return string */ public function backendInterface($orderId); diff --git a/system/modules/isotope/library/Isotope/Interfaces/IsotopeProductCollection.php b/system/modules/isotope/library/Isotope/Interfaces/IsotopeProductCollection.php index 2dea2cb72a..4e282ffd42 100644 --- a/system/modules/isotope/library/Isotope/Interfaces/IsotopeProductCollection.php +++ b/system/modules/isotope/library/Isotope/Interfaces/IsotopeProductCollection.php @@ -89,7 +89,7 @@ public function getLatestItem(); * Return all items in the collection * @param callable * @param bool - * @return array + * @return \Isotope\Model\ProductCollectionItem[] */ public function getItems($varCallable = null, $blnNoCache = false); @@ -119,8 +119,8 @@ public function addProduct(IsotopeProduct $objProduct, $intQuantity, array $arrC /** * Update a product collection item - * @param object The product object - * @param array The property(ies) to adjust + * @param object $objItem The product object + * @param array $arrSet The property(ies) to adjust * @return bool */ public function updateItem(ProductCollectionItem $objItem, $arrSet); @@ -149,7 +149,7 @@ public function deleteItemById($intId); /** * Find surcharges for the current collection - * @return array + * @return \Isotope\Model\ProductCollectionSurcharge[] */ public function getSurcharges(); } diff --git a/system/modules/isotope/library/Isotope/Isotope.php b/system/modules/isotope/library/Isotope/Isotope.php index 0b97ceaaec..5a20ea6137 100644 --- a/system/modules/isotope/library/Isotope/Isotope.php +++ b/system/modules/isotope/library/Isotope/Isotope.php @@ -46,19 +46,19 @@ class Isotope extends \Controller /** * Current cart instance - * @var Isotope\Model\ProductCollection\Cart + * @var \Isotope\Model\ProductCollection\Cart */ protected static $objCart; /** * Current config instance - * @var Isotope\Model\Config + * @var \Isotope\Model\Config */ protected static $objConfig; /** * Current request cache instance - * @var Isotope\Model\RequestCache + * @var \Isotope\Model\RequestCache */ protected static $objRequestCache; @@ -99,7 +99,7 @@ public static function initialize() /** * Get the currently active Isotope cart - * @return Isotope\Model\ProductCollection\Cart|null + * @return \Isotope\Model\ProductCollection\Cart|null */ public static function getCart() { @@ -126,7 +126,7 @@ public static function setCart(Cart $objCart) /** * Get the currently active Isotope configuration - * @return Isotope\Model\Config + * @return \Isotope\Model\Config */ public static function getConfig() { diff --git a/system/modules/isotope/library/Isotope/Model/Payment.php b/system/modules/isotope/library/Isotope/Model/Payment.php index 883e0ec935..2fa10f4790 100644 --- a/system/modules/isotope/library/Isotope/Model/Payment.php +++ b/system/modules/isotope/library/Isotope/Model/Payment.php @@ -137,7 +137,7 @@ public function isPercentage() /** * Return percentage amount (if applicable) * @return float - * @throws UnexpectedValueException + * @throws \UnexpectedValueException */ public function getPercentage() { @@ -189,8 +189,8 @@ public function getLabel() /** * Return a html form for checkout or false - * @param IsotopeProductCollection The order being places - * @param Module The checkout module instance + * @param IsotopeProductCollection $objOrder The order being places + * @param \Module $objModule The checkout module instance * @return bool */ public function checkoutForm(IsotopeProductCollection $objOrder, \Module $objModule) @@ -203,7 +203,7 @@ public function checkoutForm(IsotopeProductCollection $objOrder, \Module $objMod * Return information or advanced features in the backend. * * Use this function to present advanced features or basic payment information for an order in the backend. - * @param integer Order ID + * @param integer $orderId Order ID * @return string */ public function backendInterface($orderId) @@ -239,7 +239,7 @@ public function checkoutReview() /** * Get the checkout surcharge for this payment method - * @return Isotope\Model\ProductCollectionSurcharge\Payment|null + * @return \Isotope\Model\ProductCollectionSurcharge\Payment|null */ public function getSurcharge($objCollection) { diff --git a/system/modules/isotope/library/Isotope/Model/ProductCollection.php b/system/modules/isotope/library/Isotope/Model/ProductCollection.php index 447b7ab1ea..3ff0586dd5 100644 --- a/system/modules/isotope/library/Isotope/Model/ProductCollection.php +++ b/system/modules/isotope/library/Isotope/Model/ProductCollection.php @@ -17,6 +17,7 @@ use Haste\Units\Mass\Scale; use Haste\Units\Mass\Weighable; use Haste\Units\Mass\WeightAggregate; +use Isotope\Interfaces\IsotopeAttribute; use Isotope\Interfaces\IsotopePayment; use Isotope\Interfaces\IsotopeProduct; use Isotope\Interfaces\IsotopeProductCollection; @@ -63,7 +64,7 @@ abstract class ProductCollection extends TypeAgent /** * Cache product items in this collection - * @var array + * @var \Isotope\Model\ProductCollectionItem[] */ protected $arrItems; @@ -139,7 +140,7 @@ public function updateDatabase($blnCreate=true) /** * Mark a field as modified - * @param $strKey The field key + * @param string $strKey The field key */ public function markModified($strKey) { @@ -155,7 +156,7 @@ public function markModified($strKey) $this->arrSurcharges = null; $this->arrCache = array(); - return parent::markModified($strKey); + parent::markModified($strKey); } /** @@ -684,7 +685,7 @@ public function getLastModification() * Return all items in the collection * @param callable * @param bool - * @return array + * @return \Isotope\Model\ProductCollectionItem[] */ public function getItems($varCallable = null, $blnNoCache = false) { @@ -692,9 +693,9 @@ public function getItems($varCallable = null, $blnNoCache = false) $this->arrItems = array(); if (($objItems = ProductCollectionItem::findBy('pid', $this->id)) !== null) { - while ($objItems->next()) { - $objItem = $objItems->current(); + /** @var \Isotope\Model\ProductCollectionItem $objItem */ + foreach ($objItems as $objItem) { if ($this->isLocked()) { $objItem->lock(); @@ -866,6 +867,7 @@ public function updateItemById($intId, $arrSet) return false; } + /** @var \Isotope\Model\ProductCollectionItem $objItem */ $objItem = $arrItems[$intId]; // !HOOK: additional functionality when updating a product in the collection @@ -958,7 +960,7 @@ public function deleteItemById($intId) /** * Find surcharges for the current collection - * @return array + * @return \Isotope\Model\ProductCollectionSurcharge[] */ public function getSurcharges() { @@ -1137,7 +1139,7 @@ public function addToTemplate(\Isotope\Template $objTemplate, array $arrConfig = $objTemplate->subtotal = Isotope::formatPriceWithCurrency($this->getSubtotal()); $objTemplate->total = Isotope::formatPriceWithCurrency($this->getTotal()); - $objTemplate->generateAttribute = function ($strAttribute, $objItem) { + $objTemplate->generateAttribute = function ($strAttribute, ProductCollectionItem $objItem) { if (!$objItem->hasProduct()) { return ''; @@ -1152,7 +1154,7 @@ public function addToTemplate(\Isotope\Template $objTemplate, array $arrConfig = return $objAttribute->generate($objItem->getProduct()); }; - $objTemplate->getGallery = function ($strAttribute, $objItem) use ($arrConfig, &$arrGalleries) { + $objTemplate->getGallery = function ($strAttribute, ProductCollectionItem $objItem) use ($arrConfig, &$arrGalleries) { if (!$objItem->hasProduct()) { return new \Isotope\Model\Gallery\Standard(); @@ -1365,7 +1367,7 @@ protected function generateDocumentNumber($strPrefix, $intDigits) /** * Prevent modifying a locked collection - * @throws BadMethodCallException + * @throws \BadMethodCallException */ protected function ensureNotLocked() { @@ -1424,7 +1426,7 @@ public static function createFromCollection(IsotopeProductCollection $objSource) /** * Method that returns a closure to sort product collection items * @param string - * @return Closure + * @return \Closure|null */ public static function getItemsSortingCallable($strOrderBy = 'asc_id') { diff --git a/system/modules/isotope/library/Isotope/Model/ProductCollectionItem.php b/system/modules/isotope/library/Isotope/Model/ProductCollectionItem.php index 1c2cdaaa7d..dd4d329051 100644 --- a/system/modules/isotope/library/Isotope/Model/ProductCollectionItem.php +++ b/system/modules/isotope/library/Isotope/Model/ProductCollectionItem.php @@ -30,7 +30,7 @@ class ProductCollectionItem extends \Model /** * Cache the current product - * @var IsotopeProduct|false + * @var \Isotope\Interfaces\IsotopeProduct|false */ protected $objProduct = false; @@ -97,7 +97,7 @@ public function lock() /** * Get the product related to this item - * @return IsotopeProduct|null + * @return \Isotope\Interfaces\IsotopeProduct|null */ public function getProduct($blnNoCache = false) { diff --git a/system/modules/isotope/library/Isotope/Model/ProductPrice.php b/system/modules/isotope/library/Isotope/Model/ProductPrice.php index a2aeb08555..1571812e78 100644 --- a/system/modules/isotope/library/Isotope/Model/ProductPrice.php +++ b/system/modules/isotope/library/Isotope/Model/ProductPrice.php @@ -94,6 +94,7 @@ public function getNetAmount($intQuantity = 1) { $fltAmount = $this->getValueForTier($intQuantity); + /** @var \Isotope\Model\TaxClass $objTaxClass */ if (($objTaxClass = $this->getRelated('tax_class')) !== null) { $fltAmount = $objTaxClass->calculateNetPrice($fltAmount); } @@ -110,6 +111,7 @@ public function getGrossAmount($intQuantity = 1) { $fltAmount = $this->getValueForTier($intQuantity); + /** @var \Isotope\Model\TaxClass $objTaxClass */ if (($objTaxClass = $this->getRelated('tax_class')) !== null) { $fltAmount = $objTaxClass->calculateGrossPrice($fltAmount); } From 90523a4b0d7b780e55c6b5ca56597a2eb8f8eb29 Mon Sep 17 00:00:00 2001 From: Andreas Schempp Date: Thu, 26 Jun 2014 23:14:02 +0200 Subject: [PATCH 28/42] CS --- system/modules/isotope/library/Isotope/Isotope.php | 5 +++-- .../library/Isotope/Model/ProductCollectionSurcharge.php | 8 ++++++++ .../isotope/library/Isotope/Model/RelatedProduct.php | 2 +- .../isotope/library/Isotope/Model/RequestCache.php | 1 + system/modules/isotope/library/Isotope/Model/Shipping.php | 2 +- system/modules/isotope/library/Isotope/Model/TaxClass.php | 5 +++++ .../modules/isotope/library/Isotope/Model/TypeAgent.php | 7 ++++--- 7 files changed, 23 insertions(+), 7 deletions(-) diff --git a/system/modules/isotope/library/Isotope/Isotope.php b/system/modules/isotope/library/Isotope/Isotope.php index 5a20ea6137..da4decc345 100644 --- a/system/modules/isotope/library/Isotope/Isotope.php +++ b/system/modules/isotope/library/Isotope/Isotope.php @@ -220,6 +220,7 @@ public static function calculatePrice($fltPrice, $objSource, $strField, $intTaxC } // Possibly add/subtract tax + /** @var TaxClass $objTaxClass */ if (($objTaxClass = TaxClass::findByPk($intTaxClass)) !== null) { $fltPrice = $objTaxClass->calculatePrice($fltPrice); } @@ -230,8 +231,8 @@ public static function calculatePrice($fltPrice, $objSource, $strField, $intTaxC /** * Rounds a price according to store config settings - * @param float original value - * @param bool apply rounding increment + * @param float $fltValue original value + * @param bool $blnApplyRoundingIncrement apply rounding increment * @return float rounded value */ public static function roundPrice($fltValue, $blnApplyRoundingIncrement = true) diff --git a/system/modules/isotope/library/Isotope/Model/ProductCollectionSurcharge.php b/system/modules/isotope/library/Isotope/Model/ProductCollectionSurcharge.php index 58fac5e46d..9a584465bf 100644 --- a/system/modules/isotope/library/Isotope/Model/ProductCollectionSurcharge.php +++ b/system/modules/isotope/library/Isotope/Model/ProductCollectionSurcharge.php @@ -239,6 +239,8 @@ public static function findForCollection(IsotopeProductCollection $objCollection } } + /** @var \Isotope\Model\ProductCollection\Order $objCollection */ + /** @var Tax[] $arrTaxes */ $arrTaxes = array(); $arrAddresses = array('billing' => $objCollection->getBillingAddress(), 'shipping' => $objCollection->getShippingAddress()); @@ -249,6 +251,8 @@ public static function findForCollection(IsotopeProductCollection $objCollection } $objProduct = $objItem->getProduct(); + + /** @var \Isotope\Model\TaxClass $objTaxClass */ $objTaxClass = $objProduct->getPrice() ? $objProduct->getPrice()->getRelated('tax_class') : null; // Skip products without tax class @@ -259,10 +263,12 @@ public static function findForCollection(IsotopeProductCollection $objCollection $arrTaxIds = array(); $fltPrice = $objItem->getTotalPrice(); + /** @var \Isotope\Model\ProductCollectionSurcharge $objSurcharge */ foreach ($arrPreTax as $objSurcharge) { $fltPrice += $objSurcharge->getAmountForCollectionItem($objItem); } + /** @var \Isotope\Model\TaxRate $objIncludes */ if (($objIncludes = $objTaxClass->getRelated('includes')) !== null) { if ($objIncludes->isApplicable($fltPrice, $arrAddresses)) { $fltTax = $objIncludes->calculateAmountIncludedInPrice($fltPrice); @@ -288,6 +294,8 @@ public static function findForCollection(IsotopeProductCollection $objCollection } if (($objRates = $objTaxClass->getRelated('rates')) !== null) { + + /** @var \Isotope\Model\TaxRate $objTaxRate */ foreach ($objRates as $objTaxRate) { if ($objTaxRate->isApplicable($fltPrice, $arrAddresses)) { diff --git a/system/modules/isotope/library/Isotope/Model/RelatedProduct.php b/system/modules/isotope/library/Isotope/Model/RelatedProduct.php index bd8f87d398..8c782ffc5c 100644 --- a/system/modules/isotope/library/Isotope/Model/RelatedProduct.php +++ b/system/modules/isotope/library/Isotope/Model/RelatedProduct.php @@ -36,7 +36,7 @@ class RelatedProduct extends \Model * @param IsotopeProduct * @param array * @param array - * @return Model\Collection|null + * @return \Model\Collection|null */ public static function findByProductAndCategories(IsotopeProduct $objProduct, array $arrCategories, array $arrOptions = array()) { diff --git a/system/modules/isotope/library/Isotope/Model/RequestCache.php b/system/modules/isotope/library/Isotope/Model/RequestCache.php index 43ac7f1420..fec1917dae 100644 --- a/system/modules/isotope/library/Isotope/Model/RequestCache.php +++ b/system/modules/isotope/library/Isotope/Model/RequestCache.php @@ -479,6 +479,7 @@ public static function buildSqlFilters(array $arrFilters) $arrGroups = array(); // Initiate native SQL filtering + /** @var \Isotope\RequestCache\Filter $objFilter */ foreach ($arrFilters as $k => $objFilter) { if ($objFilter->hasGroup() && $arrGroups[$objFilter->getGroup()] !== false) { if ($objFilter->isDynamicAttribute()) { diff --git a/system/modules/isotope/library/Isotope/Model/Shipping.php b/system/modules/isotope/library/Isotope/Model/Shipping.php index b5419684d7..921d41e878 100644 --- a/system/modules/isotope/library/Isotope/Model/Shipping.php +++ b/system/modules/isotope/library/Isotope/Model/Shipping.php @@ -141,7 +141,7 @@ public function isPercentage() /** * Return percentage amount (if applicable) * @return float - * @throws UnexpectedValueException + * @throws \UnexpectedValueException */ public function getPercentage() { diff --git a/system/modules/isotope/library/Isotope/Model/TaxClass.php b/system/modules/isotope/library/Isotope/Model/TaxClass.php index f9d5e474de..24178c7262 100644 --- a/system/modules/isotope/library/Isotope/Model/TaxClass.php +++ b/system/modules/isotope/library/Isotope/Model/TaxClass.php @@ -52,6 +52,7 @@ public function calculatePrice($fltPrice, $arrAddresses = null) $arrAddresses = array('billing' => Isotope::getCart()->getBillingAddress(), 'shipping' => Isotope::getCart()->getShippingAddress()); } + /** @var \Isotope\Model\TaxRate $objIncludes */ if (($objIncludes = $this->getRelated('includes')) !== null && !$objIncludes->isApplicable($fltPrice, $arrAddresses)) { $fltPrice -= $objIncludes->calculateAmountIncludedInPrice($fltPrice); } @@ -68,6 +69,7 @@ public function calculatePrice($fltPrice, $arrAddresses = null) */ public function calculateNetPrice($fltPrice) { + /** @var \Isotope\Model\TaxRate $objIncludes */ if (($objIncludes = $this->getRelated('includes')) !== null) { $fltPrice -= $objIncludes->calculateAmountIncludedInPrice($fltPrice); } @@ -88,11 +90,14 @@ public function calculateGrossPrice($fltPrice, $arrAddresses = null) $arrAddresses = array('billing' => Isotope::getCart()->getBillingAddress(), 'shipping' => Isotope::getCart()->getShippingAddress()); } + /** @var \Isotope\Model\TaxRate $objIncludes */ if (($objIncludes = $this->getRelated('includes')) !== null && !$objIncludes->isApplicable($fltPrice, $arrAddresses)) { $fltPrice -= $objIncludes->calculateAmountIncludedInPrice($fltPrice); } if (($objRates = $this->getRelated('rates')) !== null) { + + /** @var \Isotope\Model\TaxRate $objTaxRate */ foreach ($objRates as $objTaxRate) { if ($objTaxRate->isApplicable($fltPrice, $arrAddresses)) { $fltPrice += $objTaxRate->calculateAmountAddedToPrice($fltPrice); diff --git a/system/modules/isotope/library/Isotope/Model/TypeAgent.php b/system/modules/isotope/library/Isotope/Model/TypeAgent.php index 95c91dc123..e8ba04b99e 100644 --- a/system/modules/isotope/library/Isotope/Model/TypeAgent.php +++ b/system/modules/isotope/library/Isotope/Model/TypeAgent.php @@ -275,7 +275,7 @@ public static function createModelFromDbResult(\Database\Result $objResult) * Create array of models and return a collection of them * @param Database\Result * @param string - * @return Model\Collection + * @return \Model\Collection */ protected static function createCollectionFromDbResult(\Database\Result $objResult, $strTable = null) { @@ -301,10 +301,10 @@ protected static function createCollectionFromDbResult(\Database\Result $objResu /** * Build model based on database result - * @param Database_Result + * @param \Database\Result * @deprecated use createModelFromDbResult in Contao 3.3 */ - public static function buildModelType(\Database_Result $objResult = null) + public static function buildModelType(\Database\Result $objResult = null) { if (null === $objResult) { return null; @@ -314,6 +314,7 @@ public static function buildModelType(\Database_Result $objResult = null) $intPk = $objResult->$strPk; // Try to load from the registry + /** @var \Model $objModel */ $objModel = \Model\Registry::getInstance()->fetch(static::$strTable, $intPk); if ($objModel !== null) { From 30c0f186ee1c6819cc9c847b383f54a6ace8ccab Mon Sep 17 00:00:00 2001 From: Andreas Schempp Date: Thu, 26 Jun 2014 23:29:36 +0200 Subject: [PATCH 29/42] Tax free total for surcharge was always empty (#1149) --- system/modules/isotope/docs/CHANGELOG-2.1.md | 1 + .../Model/ProductCollectionSurcharge.php | 30 +++++++++++++++---- 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/system/modules/isotope/docs/CHANGELOG-2.1.md b/system/modules/isotope/docs/CHANGELOG-2.1.md index c8e7a40bf6..92a6c868a5 100644 --- a/system/modules/isotope/docs/CHANGELOG-2.1.md +++ b/system/modules/isotope/docs/CHANGELOG-2.1.md @@ -59,6 +59,7 @@ Version 2.1.1-stable (2014-05-20) - Remove page parameter on product filter action (#1098) - From price was not shown for variants with price tiers (#1146) - Incorrect tax free total in product collection template +- Tax free total for surcharge was always empty (#1149) Version 2.1.0-stable (2014-04-01) diff --git a/system/modules/isotope/library/Isotope/Model/ProductCollectionSurcharge.php b/system/modules/isotope/library/Isotope/Model/ProductCollectionSurcharge.php index 9a584465bf..2894986714 100644 --- a/system/modules/isotope/library/Isotope/Model/ProductCollectionSurcharge.php +++ b/system/modules/isotope/library/Isotope/Model/ProductCollectionSurcharge.php @@ -445,16 +445,34 @@ protected static function buildSurcharge($strClass, $strLabel, $objSource, Isoto $intTaxClass = $objSource->tax_class; /** @var \Isotope\Model\ProductCollectionSurcharge $objSurcharge */ - $objSurcharge = new $strClass(); - $objSurcharge->label = ($strLabel . ' (' . $objSource->getLabel() . ')'); - $objSurcharge->price = ($objSource->isPercentage() ? $objSource->getPercentage() . '%' : ' '); + $objSurcharge = new $strClass(); + $objSurcharge->label = ($strLabel . ' (' . $objSource->getLabel() . ')'); + $objSurcharge->price = ($objSource->isPercentage() ? $objSource->getPercentage() . '%' : ' '); $objSurcharge->total_price = $objSource->getPrice(); - $objSurcharge->tax_class = $intTaxClass; - $objSurcharge->before_tax = ($intTaxClass ? true : false); - $objSurcharge->addToTotal = true; + $objSurcharge->tax_free_total_price = $objSource->total_price; + $objSurcharge->tax_class = $intTaxClass; + $objSurcharge->before_tax = ($intTaxClass ? true : false); + $objSurcharge->addToTotal = true; if ($intTaxClass == -1) { $objSurcharge->applySplittedTax($objCollection, $objSource); + } elseif ($objSurcharge->tax_class > 0) { + + /** @var \Isotope\Model\TaxClass $objTaxClass */ + if (($objTaxClass = TaxClass::findByPk($objSurcharge->tax_class)) !== null) { + + /** @var \Isotope\Model\TaxRate $objIncludes */ + if (($objIncludes = $objTaxClass->getRelated('includes')) !== null) { + + $fltPrice = $objSurcharge->total_price; + $arrAddresses = array('billing' => $objCollection->getBillingAddress(), 'shipping' => $objCollection->getShippingAddress()); + + if ($objIncludes->isApplicable($fltPrice, $arrAddresses)) { + $fltTax = $objIncludes->calculateAmountIncludedInPrice($fltPrice); + $objSurcharge->tax_free_total_price = $fltPrice - $fltTax; + } + } + } } return $objSurcharge; From 14b633b67863aefb52db04b19bedd1b9739d33a3 Mon Sep 17 00:00:00 2001 From: Andreas Schempp Date: Thu, 26 Jun 2014 23:30:49 +0200 Subject: [PATCH 30/42] Fixed changelog --- system/modules/isotope/docs/CHANGELOG-2.1.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/system/modules/isotope/docs/CHANGELOG-2.1.md b/system/modules/isotope/docs/CHANGELOG-2.1.md index 92a6c868a5..1493aeb1fc 100644 --- a/system/modules/isotope/docs/CHANGELOG-2.1.md +++ b/system/modules/isotope/docs/CHANGELOG-2.1.md @@ -16,6 +16,9 @@ Version 2.1.3-stable (2014-??-??) - Order of fields in product type was not applied to palette (#1135) - Edit-multiple failed in Contao 3.3 (#1150) - Copy fallback language was not working (#1151) +- From price was not shown for variants with price tiers (#1146) +- Incorrect tax free total in product collection template +- Tax free total for surcharge was always empty (#1149) Version 2.1.2-stable (2014-06-02) @@ -57,9 +60,6 @@ Version 2.1.1-stable (2014-05-20) - Do not generate sitemap links for unpublished pages (#1092) - Wrong column count in collection template (#1091) - Remove page parameter on product filter action (#1098) -- From price was not shown for variants with price tiers (#1146) -- Incorrect tax free total in product collection template -- Tax free total for surcharge was always empty (#1149) Version 2.1.0-stable (2014-04-01) From 8dbcd6bcaa69145f2fd54e6ae25527932af7d23f Mon Sep 17 00:00:00 2001 From: Andreas Schempp Date: Thu, 26 Jun 2014 23:48:13 +0200 Subject: [PATCH 31/42] Tax free total for surcharge was not available in collection template --- system/modules/isotope/docs/CHANGELOG-2.1.md | 1 + system/modules/isotope/library/Isotope/Frontend.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/system/modules/isotope/docs/CHANGELOG-2.1.md b/system/modules/isotope/docs/CHANGELOG-2.1.md index 1493aeb1fc..51be695f32 100644 --- a/system/modules/isotope/docs/CHANGELOG-2.1.md +++ b/system/modules/isotope/docs/CHANGELOG-2.1.md @@ -19,6 +19,7 @@ Version 2.1.3-stable (2014-??-??) - From price was not shown for variants with price tiers (#1146) - Incorrect tax free total in product collection template - Tax free total for surcharge was always empty (#1149) +- Tax free total for surcharge was not available in collection template Version 2.1.2-stable (2014-06-02) diff --git a/system/modules/isotope/library/Isotope/Frontend.php b/system/modules/isotope/library/Isotope/Frontend.php index 40c68b3eef..619ab76977 100644 --- a/system/modules/isotope/library/Isotope/Frontend.php +++ b/system/modules/isotope/library/Isotope/Frontend.php @@ -370,9 +370,9 @@ public static function formatSurcharges($arrSurcharges) $arrReturn[$k] = $objSurcharge->row(); $arrReturn[$k]['price'] = Isotope::formatPriceWithCurrency($objSurcharge->price); $arrReturn[$k]['total_price'] = Isotope::formatPriceWithCurrency($objSurcharge->total_price); + $arrReturn[$k]['tax_free_total_price'] = Isotope::formatPriceWithCurrency($objSurcharge->tax_free_total_price); $arrReturn[$k]['rowClass'] = trim('foot_' . (++$i) . ' ' . $objSurcharge->rowClass); $arrReturn[$k]['tax_id'] = $objSurcharge->getTaxNumbers(); - } return $arrReturn; From d849419bb294c3a56fdec8ef321564b065ffcf42 Mon Sep 17 00:00:00 2001 From: Andreas Schempp Date: Thu, 26 Jun 2014 23:56:04 +0200 Subject: [PATCH 32/42] Tax free subtotal of order was shown as total in product collection template --- system/modules/isotope/docs/CHANGELOG-2.1.md | 1 + .../modules/isotope/library/Isotope/Model/ProductCollection.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/system/modules/isotope/docs/CHANGELOG-2.1.md b/system/modules/isotope/docs/CHANGELOG-2.1.md index 51be695f32..4d335d6ae9 100644 --- a/system/modules/isotope/docs/CHANGELOG-2.1.md +++ b/system/modules/isotope/docs/CHANGELOG-2.1.md @@ -20,6 +20,7 @@ Version 2.1.3-stable (2014-??-??) - Incorrect tax free total in product collection template - Tax free total for surcharge was always empty (#1149) - Tax free total for surcharge was not available in collection template +- Tax free subtotal of order was shown as total in product collection template Version 2.1.2-stable (2014-06-02) diff --git a/system/modules/isotope/library/Isotope/Model/ProductCollection.php b/system/modules/isotope/library/Isotope/Model/ProductCollection.php index 3ff0586dd5..7e94f1d489 100644 --- a/system/modules/isotope/library/Isotope/Model/ProductCollection.php +++ b/system/modules/isotope/library/Isotope/Model/ProductCollection.php @@ -624,7 +624,7 @@ public function getTotal() public function getTaxFreeTotal() { if ($this->isLocked()) { - return $this->tax_free_subtotal; + return $this->tax_free_total; } if (!isset($this->arrCache['taxFreeTotal'])) { From e226044cf974923accd9dfd87fdf7c7ee3c815c3 Mon Sep 17 00:00:00 2001 From: Andreas Schempp Date: Fri, 27 Jun 2014 00:00:27 +0200 Subject: [PATCH 33/42] CS --- .../library/Isotope/Model/ProductCollection/Order.php | 7 +++++++ .../library/Isotope/Model/ProductCollectionItem.php | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/system/modules/isotope/library/Isotope/Model/ProductCollection/Order.php b/system/modules/isotope/library/Isotope/Model/ProductCollection/Order.php index c488ffca2a..d770e519f9 100644 --- a/system/modules/isotope/library/Isotope/Model/ProductCollection/Order.php +++ b/system/modules/isotope/library/Isotope/Model/ProductCollection/Order.php @@ -54,6 +54,7 @@ public function isPaid() } // Otherwise we check the orderstatus checkbox + /** @var OrderStatus $objStatus */ $objStatus = $this->getRelated('order_status'); return (null !== $objStatus && $objStatus->isPaid()) ? true : false; @@ -65,6 +66,7 @@ public function isPaid() */ public function getStatusLabel() { + /** @var OrderStatus $objStatus */ $objStatus = $this->getRelated('order_status'); return (null === $objStatus) ? '' : $objStatus->getName(); @@ -76,6 +78,7 @@ public function getStatusLabel() */ public function getStatusAlias() { + /** @var OrderStatus $objStatus */ $objStatus = $this->getRelated('order_status'); return (null === $objStatus) ? $this->order_status : $objStatus->getAlias(); @@ -171,6 +174,7 @@ public function checkout() \System::log('New order ID ' . $this->id . ' has been placed', __METHOD__, TL_ACCESS); // Add downloads from products to the collection + /** @var ProductCollectionDownload[] $arrDownloads */ $arrDownloads = ProductCollectionDownload::createForProductsInCollection($this); foreach ($arrDownloads as $objDownload) { $objDownload->save(); @@ -183,6 +187,8 @@ public function checkout() // Delete all other orders that relate to the current cart if (($objOrders = static::findSiblingsBy('source_collection_id', $this)) !== null) { + + /** @var Order $objOrder */ foreach ($objOrders as $objOrder) { if (!$objOrder->isLocked()) { $objOrder->delete(); @@ -444,6 +450,7 @@ public function getNotificationTokens($intNotification) $arrTokens['cart_text'] = strip_tags(Haste::getInstance()->call('replaceInsertTags', array($objTemplate->parse(), true))); // Generate and "attach" document + /** @var \Isotope\Interfaces\IsotopeDocument $objDocument */ if ($objNotification->iso_document > 0 && (($objDocument = Document::findByPk($objNotification->iso_document)) !== null)) { $strFilePath = $objDocument->outputToFile($this, TL_ROOT . '/system/tmp'); $arrTokens['document'] = str_replace(TL_ROOT . '/', '', $strFilePath); diff --git a/system/modules/isotope/library/Isotope/Model/ProductCollectionItem.php b/system/modules/isotope/library/Isotope/Model/ProductCollectionItem.php index dd4d329051..290916be89 100644 --- a/system/modules/isotope/library/Isotope/Model/ProductCollectionItem.php +++ b/system/modules/isotope/library/Isotope/Model/ProductCollectionItem.php @@ -222,7 +222,7 @@ public function getTaxFreeTotalPrice() /** * Return downloads associated with this product collection item - * @return array + * @return ProductCollectionDownload[] */ public function getDownloads() { From 01ff2690d6e22f30a6b52118cd6829985d046718 Mon Sep 17 00:00:00 2001 From: Yanick Witschi Date: Fri, 27 Jun 2014 10:56:34 +0200 Subject: [PATCH 34/42] Collection template did not correctly display variant attributes in text mode (#1125) --- system/modules/isotope/docs/CHANGELOG-2.1.md | 3 ++- .../isotope/templates/collection/iso_collection_default.html5 | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/system/modules/isotope/docs/CHANGELOG-2.1.md b/system/modules/isotope/docs/CHANGELOG-2.1.md index 4d335d6ae9..6f7308f539 100644 --- a/system/modules/isotope/docs/CHANGELOG-2.1.md +++ b/system/modules/isotope/docs/CHANGELOG-2.1.md @@ -20,7 +20,8 @@ Version 2.1.3-stable (2014-??-??) - Incorrect tax free total in product collection template - Tax free total for surcharge was always empty (#1149) - Tax free total for surcharge was not available in collection template -- Tax free subtotal of order was shown as total in product collection template +- Tax free subtotal of order was shown as total in product collection template +- Collection template did not correctly display variant attributes in text mode (#1125) Version 2.1.2-stable (2014-06-02) diff --git a/system/modules/isotope/templates/collection/iso_collection_default.html5 b/system/modules/isotope/templates/collection/iso_collection_default.html5 index 63c2085ce7..2006a9ec2d 100644 --- a/system/modules/isotope/templates/collection/iso_collection_default.html5 +++ b/system/modules/isotope/templates/collection/iso_collection_default.html5 @@ -1,7 +1,7 @@ textOnly): ?> items as $item ): ?> - ( $option): ?>: ): x = + (: ): x = -------------------- From 999a0829ee1a075d130f35eec37f6ff92c349118 Mon Sep 17 00:00:00 2001 From: Yanick Witschi Date: Fri, 27 Jun 2014 11:49:40 +0200 Subject: [PATCH 35/42] Payone cannot handle correctly URL encoded URLs (#1137) --- system/modules/isotope/docs/CHANGELOG-2.1.md | 1 + .../isotope/library/Isotope/Model/Payment/Payone.php | 12 ++++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/system/modules/isotope/docs/CHANGELOG-2.1.md b/system/modules/isotope/docs/CHANGELOG-2.1.md index 6f7308f539..332434a1a2 100644 --- a/system/modules/isotope/docs/CHANGELOG-2.1.md +++ b/system/modules/isotope/docs/CHANGELOG-2.1.md @@ -22,6 +22,7 @@ Version 2.1.3-stable (2014-??-??) - Tax free total for surcharge was not available in collection template - Tax free subtotal of order was shown as total in product collection template - Collection template did not correctly display variant attributes in text mode (#1125) +- Payone cannot handle correctly URL encoded URLs (#1137) Version 2.1.2-stable (2014-06-02) diff --git a/system/modules/isotope/library/Isotope/Model/Payment/Payone.php b/system/modules/isotope/library/Isotope/Model/Payment/Payone.php index 4531373346..c09248ef50 100644 --- a/system/modules/isotope/library/Isotope/Model/Payment/Payone.php +++ b/system/modules/isotope/library/Isotope/Model/Payment/Payone.php @@ -78,6 +78,9 @@ public function checkoutForm(IsotopeProductCollection $objOrder, \Module $objMod { $i = 0; + $strSuccessUrl = \Environment::get('base') . $objModule->generateUrlForStep('complete', $objOrder); + $strBackUrl = \Environment::get('base') . $objModule->generateUrlForStep('failed'); + $arrData = array ( 'aid' => $this->payone_aid, @@ -89,8 +92,8 @@ public function checkoutForm(IsotopeProductCollection $objOrder, \Module $objMod 'reference' => $objOrder->id, 'display_name' => 'no', 'display_address' => 'no', - 'successurl' => \Environment::get('base') . $objModule->generateUrlForStep('complete', $objOrder), - 'backurl' => \Environment::get('base') . $objModule->generateUrlForStep('failed'), + 'successurl' => $strSuccessUrl, + 'backurl' => $strBackUrl, 'amount' => ($objOrder->getTotal() * 100), 'currency' => $objOrder->currency, ); @@ -141,6 +144,11 @@ function($option) { $arrData = array_map('urlencode', $arrData); $strHash = md5(implode('', $arrData) . $this->payone_key); + // Do not encode URLs because Payone does not properly decode POST values (whatever...) + // Only do this at this point so the URL encoded version is used for the md5 hash + $arrData['successurl'] = $strSuccessUrl; + $arrData['backurl'] = $strBackUrl; + $objTemplate = new \Isotope\Template('iso_payment_payone'); $objTemplate->id = $this->id; $objTemplate->data = $arrData; From f400e0e802681d0bd15df03cb76c1cf5af8c8ea7 Mon Sep 17 00:00:00 2001 From: Yanick Witschi Date: Fri, 27 Jun 2014 14:28:53 +0200 Subject: [PATCH 36/42] Revert "Payone cannot handle correctly URL encoded URLs (#1137)" This reverts commit 999a0829ee1a075d130f35eec37f6ff92c349118. --- system/modules/isotope/docs/CHANGELOG-2.1.md | 1 - .../isotope/library/Isotope/Model/Payment/Payone.php | 12 ++---------- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/system/modules/isotope/docs/CHANGELOG-2.1.md b/system/modules/isotope/docs/CHANGELOG-2.1.md index 332434a1a2..6f7308f539 100644 --- a/system/modules/isotope/docs/CHANGELOG-2.1.md +++ b/system/modules/isotope/docs/CHANGELOG-2.1.md @@ -22,7 +22,6 @@ Version 2.1.3-stable (2014-??-??) - Tax free total for surcharge was not available in collection template - Tax free subtotal of order was shown as total in product collection template - Collection template did not correctly display variant attributes in text mode (#1125) -- Payone cannot handle correctly URL encoded URLs (#1137) Version 2.1.2-stable (2014-06-02) diff --git a/system/modules/isotope/library/Isotope/Model/Payment/Payone.php b/system/modules/isotope/library/Isotope/Model/Payment/Payone.php index c09248ef50..4531373346 100644 --- a/system/modules/isotope/library/Isotope/Model/Payment/Payone.php +++ b/system/modules/isotope/library/Isotope/Model/Payment/Payone.php @@ -78,9 +78,6 @@ public function checkoutForm(IsotopeProductCollection $objOrder, \Module $objMod { $i = 0; - $strSuccessUrl = \Environment::get('base') . $objModule->generateUrlForStep('complete', $objOrder); - $strBackUrl = \Environment::get('base') . $objModule->generateUrlForStep('failed'); - $arrData = array ( 'aid' => $this->payone_aid, @@ -92,8 +89,8 @@ public function checkoutForm(IsotopeProductCollection $objOrder, \Module $objMod 'reference' => $objOrder->id, 'display_name' => 'no', 'display_address' => 'no', - 'successurl' => $strSuccessUrl, - 'backurl' => $strBackUrl, + 'successurl' => \Environment::get('base') . $objModule->generateUrlForStep('complete', $objOrder), + 'backurl' => \Environment::get('base') . $objModule->generateUrlForStep('failed'), 'amount' => ($objOrder->getTotal() * 100), 'currency' => $objOrder->currency, ); @@ -144,11 +141,6 @@ function($option) { $arrData = array_map('urlencode', $arrData); $strHash = md5(implode('', $arrData) . $this->payone_key); - // Do not encode URLs because Payone does not properly decode POST values (whatever...) - // Only do this at this point so the URL encoded version is used for the md5 hash - $arrData['successurl'] = $strSuccessUrl; - $arrData['backurl'] = $strBackUrl; - $objTemplate = new \Isotope\Template('iso_payment_payone'); $objTemplate->id = $this->id; $objTemplate->data = $arrData; From 84c680c61080acaedb70bbd7b7310f2c932a9494 Mon Sep 17 00:00:00 2001 From: Yanick Witschi Date: Fri, 27 Jun 2014 14:29:43 +0200 Subject: [PATCH 37/42] Payone cannot handle correctly URL encoded values --- system/modules/isotope/docs/CHANGELOG-2.1.md | 1 + system/modules/isotope/library/Isotope/Model/Payment/Payone.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/system/modules/isotope/docs/CHANGELOG-2.1.md b/system/modules/isotope/docs/CHANGELOG-2.1.md index 6f7308f539..5e6fe4cd80 100644 --- a/system/modules/isotope/docs/CHANGELOG-2.1.md +++ b/system/modules/isotope/docs/CHANGELOG-2.1.md @@ -22,6 +22,7 @@ Version 2.1.3-stable (2014-??-??) - Tax free total for surcharge was not available in collection template - Tax free subtotal of order was shown as total in product collection template - Collection template did not correctly display variant attributes in text mode (#1125) +- Payone cannot handle correctly URL encoded values (#1137) Version 2.1.2-stable (2014-06-02) diff --git a/system/modules/isotope/library/Isotope/Model/Payment/Payone.php b/system/modules/isotope/library/Isotope/Model/Payment/Payone.php index 4531373346..9b4aec0d4b 100644 --- a/system/modules/isotope/library/Isotope/Model/Payment/Payone.php +++ b/system/modules/isotope/library/Isotope/Model/Payment/Payone.php @@ -138,7 +138,7 @@ function($option) { ksort($arrData); - $arrData = array_map('urlencode', $arrData); + // Do not urlencode values because Payone does not properly decode POST values (whatever...) $strHash = md5(implode('', $arrData) . $this->payone_key); $objTemplate = new \Isotope\Template('iso_payment_payone'); From cfa0e9180a6076307da6fc0bd906ac9975a27559 Mon Sep 17 00:00:00 2001 From: Andreas Schempp Date: Fri, 27 Jun 2014 10:50:41 +0200 Subject: [PATCH 38/42] Fixed HTML markup of MediaManager widget --- system/modules/isotope/library/Isotope/Widget/MediaManager.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/modules/isotope/library/Isotope/Widget/MediaManager.php b/system/modules/isotope/library/Isotope/Widget/MediaManager.php index 1e3e7518e7..ae5f634143 100755 --- a/system/modules/isotope/library/Isotope/Widget/MediaManager.php +++ b/system/modules/isotope/library/Isotope/Widget/MediaManager.php @@ -385,7 +385,7 @@ public function generate() return $return.' - ' . $upload . ($blnIsAjax ? '' : ''); + ' . $upload . (!$blnIsAjax ? '' : ''); } /** From b877e0948c95c9c931841e4ac2f598f03dc2cbcf Mon Sep 17 00:00:00 2001 From: Andreas Schempp Date: Fri, 27 Jun 2014 11:45:16 +0200 Subject: [PATCH 39/42] prices field is no longer in palettes --- .../isotope/library/Isotope/Backend/Product/DcaManager.php | 1 - 1 file changed, 1 deletion(-) diff --git a/system/modules/isotope/library/Isotope/Backend/Product/DcaManager.php b/system/modules/isotope/library/Isotope/Backend/Product/DcaManager.php index a412320963..3903ea2f3a 100644 --- a/system/modules/isotope/library/Isotope/Backend/Product/DcaManager.php +++ b/system/modules/isotope/library/Isotope/Backend/Product/DcaManager.php @@ -349,7 +349,6 @@ public function buildPaletteString() if ($act !== 'edit') { $arrFields['inherit']['exclude'] = true; - $arrFields['prices']['exclude'] = true; } // Remove non-active fields from multi-selection From 4b15631e64b84768123791cdd742ae94ad601726 Mon Sep 17 00:00:00 2001 From: Andreas Schempp Date: Fri, 27 Jun 2014 14:43:01 +0200 Subject: [PATCH 40/42] Inherited fields can now be multi-edited --- system/modules/isotope/dca/tl_iso_product.php | 2 +- system/modules/isotope/docs/CHANGELOG-2.1.md | 3 +++ .../Isotope/Backend/Product/DcaManager.php | 6 +----- .../Isotope/Widget/InheritCheckBox.php | 21 ++++++++++++++----- 4 files changed, 21 insertions(+), 11 deletions(-) diff --git a/system/modules/isotope/dca/tl_iso_product.php b/system/modules/isotope/dca/tl_iso_product.php index 6b5864f38b..88f3933038 100755 --- a/system/modules/isotope/dca/tl_iso_product.php +++ b/system/modules/isotope/dca/tl_iso_product.php @@ -310,7 +310,7 @@ 'label' => &$GLOBALS['TL_LANG']['tl_iso_product']['inherit'], 'exclude' => true, 'inputType' => 'inheritCheckbox', - 'eval' => array('multiple'=>true, 'doNotShow'=>true), + 'eval' => array('multiple'=>true), 'attributes' => array('systemColumn'=>true), 'sql' => "blob NULL", ), diff --git a/system/modules/isotope/docs/CHANGELOG-2.1.md b/system/modules/isotope/docs/CHANGELOG-2.1.md index 5e6fe4cd80..850a202947 100644 --- a/system/modules/isotope/docs/CHANGELOG-2.1.md +++ b/system/modules/isotope/docs/CHANGELOG-2.1.md @@ -4,6 +4,9 @@ Isotope eCommerce Changelog Version 2.1.3-stable (2014-??-??) --------------------------------- +### Improved +- Inherited fields can now be multi-edited + ### Fixed - Composer dependencies (#1124) - Date added was not updated when copying a product in the back end (#1126) diff --git a/system/modules/isotope/library/Isotope/Backend/Product/DcaManager.php b/system/modules/isotope/library/Isotope/Backend/Product/DcaManager.php index 3903ea2f3a..1afafb21ac 100644 --- a/system/modules/isotope/library/Isotope/Backend/Product/DcaManager.php +++ b/system/modules/isotope/library/Isotope/Backend/Product/DcaManager.php @@ -324,7 +324,7 @@ public function buildPaletteString() } else { // Hide field from "show" option - if (!isset($arrField['attributes']) || $arrField['inputType'] != '') { + if (!isset($arrField['attributes']) || $arrField['inputType'] != '' && $name != 'inherit') { $arrFields[$name]['eval']['doNotShow'] = true; } } @@ -347,10 +347,6 @@ public function buildPaletteString() $GLOBALS['TL_DCA']['tl_iso_product']['palettes'][($blnVariants ? 'default' : $objType->id)] = ($blnVariants ? 'inherit,' : '') . implode(';', $arrLegends); } - if ($act !== 'edit') { - $arrFields['inherit']['exclude'] = true; - } - // Remove non-active fields from multi-selection if ($blnVariants && !$blnSingleRecord) { $arrInclude = empty($arrPalette) ? array() : call_user_func_array('array_merge', $arrPalette); diff --git a/system/modules/isotope/library/Isotope/Widget/InheritCheckBox.php b/system/modules/isotope/library/Isotope/Widget/InheritCheckBox.php index 4af674d702..d7ed1e2ec8 100644 --- a/system/modules/isotope/library/Isotope/Widget/InheritCheckBox.php +++ b/system/modules/isotope/library/Isotope/Widget/InheritCheckBox.php @@ -46,6 +46,8 @@ public function validate() */ public function generate() { + $strJS = ''; + $blnCheckAll = true; $arrFields = array(); $arrOptions = array(); @@ -57,23 +59,32 @@ public function generate() // Add a "no entries found" message if there are no options if (empty($arrOptions)) { $arrOptions[] = '

' . $GLOBALS['TL_LANG']['MSC']['noResult'] . '

'; + $blnCheckAll = false; } - $strJS = " + if (\Input::get('act') == 'edit') { + $strJS = " "; + } - return sprintf('
%s
%s%s', + return sprintf('
%s%s%s%s%s%s
%s%s', $this->strId, - 'tl_checkbox_container', - (strlen($this->strClass) ? ' ' . $this->strClass : ''), + (($this->strClass != '') ? ' ' . $this->strClass : ''), + ($this->mandatory ? ' ' : ''), + $this->strLabel, + ($this->mandatory ? '*' : ''), + $this->xlabel, + $this->strName, + ($blnCheckAll ? '
' : ''), str_replace('

', '', implode('
', $arrOptions)), $this->wizard, - $strJS); + $strJS + ); } From d7ccfce4cfb98ffb8dab6d2fd3c249524421c3cb Mon Sep 17 00:00:00 2001 From: Andreas Schempp Date: Mon, 30 Jun 2014 10:09:45 +0200 Subject: [PATCH 41/42] Transifex sync --- .../modules/isotope/languages/fa/default.php | 6 +++ .../isotope/languages/fa/tl_iso_product.php | 1 + .../modules/isotope/languages/fi/default.php | 39 +++++++++++++++++++ .../isotope/languages/fi/iso_upgrade.php | 17 ++++++++ .../isotope/languages/fi/tl_iso_product.php | 17 ++++++++ 5 files changed, 80 insertions(+) create mode 100644 system/modules/isotope/languages/fi/default.php create mode 100644 system/modules/isotope/languages/fi/iso_upgrade.php create mode 100644 system/modules/isotope/languages/fi/tl_iso_product.php diff --git a/system/modules/isotope/languages/fa/default.php b/system/modules/isotope/languages/fa/default.php index d00cd34e22..9bcdc4ab23 100644 --- a/system/modules/isotope/languages/fa/default.php +++ b/system/modules/isotope/languages/fa/default.php @@ -20,11 +20,13 @@ $GLOBALS['TL_LANG']['MSC']['undefinedLanguage'] = 'تعریف نشده'; $GLOBALS['TL_LANG']['MSC']['filterByGroups'] = 'گروه‌ها'; $GLOBALS['TL_LANG']['MSC']['filterByPages'] = 'صفحه‌ها'; +$GLOBALS['TL_LANG']['MSC']['mmNoUploads'] = 'هیچ فایل بارگیری نشد.'; $GLOBALS['TL_LANG']['MSC']['quantity'] = 'تعداد'; $GLOBALS['TL_LANG']['MSC']['detailLabel'] = 'دیدن جزئیات'; $GLOBALS['TL_LANG']['MSC']['searchTermsLabel'] = 'کلیدواژه‌ها'; $GLOBALS['TL_LANG']['MSC']['submitLabel'] = 'ارسال'; $GLOBALS['TL_LANG']['MSC']['buttonLabel']['update'] = 'بروزرسانی'; +$GLOBALS['TL_LANG']['MSC']['buttonLabel']['add_to_cart'] = 'افزودن به سبد'; $GLOBALS['TL_LANG']['MSC']['previousStep'] = 'بازگشت'; $GLOBALS['TL_LANG']['MSC']['nextStep'] = 'ادامه'; $GLOBALS['TL_LANG']['MSC']['confirmOrder'] = 'سفارش'; @@ -47,3 +49,7 @@ $GLOBALS['TL_LANG']['MSC']['checkout_payment'] = 'پرداخت'; $GLOBALS['TL_LANG']['CTE']['isotope'] = 'Isotope eCommerce'; $GLOBALS['TL_LANG']['CCT']['delta'] = 'Delta'; +$GLOBALS['TL_LANG']['ATTR']['downloads'][0] = 'بارگیری‌ها'; +$GLOBALS['TL_LANG']['CUR']['IQD'] = 'IQD - دینار عراق'; +$GLOBALS['TL_LANG']['CUR']['IRR'] = 'IRR - ریال ایران'; +$GLOBALS['TL_LANG']['CUR']['JPY'] = 'JPY - ین'; diff --git a/system/modules/isotope/languages/fa/tl_iso_product.php b/system/modules/isotope/languages/fa/tl_iso_product.php index 9267ffe512..dfc7e00357 100644 --- a/system/modules/isotope/languages/fa/tl_iso_product.php +++ b/system/modules/isotope/languages/fa/tl_iso_product.php @@ -14,4 +14,5 @@ * @license http://www.gnu.org/licenses/lgpl-3.0.html */ +$GLOBALS['TL_LANG']['tl_iso_product']['downloads'][0] = 'بارگیری‌ها'; $GLOBALS['TL_LANG']['tl_iso_product']['price_tiers']['min'] = 'تعداد'; diff --git a/system/modules/isotope/languages/fi/default.php b/system/modules/isotope/languages/fi/default.php new file mode 100644 index 0000000000..0e461c859d --- /dev/null +++ b/system/modules/isotope/languages/fi/default.php @@ -0,0 +1,39 @@ + Date: Mon, 30 Jun 2014 10:10:11 +0200 Subject: [PATCH 42/42] Release 2.1.3 --- system/modules/isotope/docs/CHANGELOG-2.1.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/modules/isotope/docs/CHANGELOG-2.1.md b/system/modules/isotope/docs/CHANGELOG-2.1.md index 850a202947..c8c62a2e42 100644 --- a/system/modules/isotope/docs/CHANGELOG-2.1.md +++ b/system/modules/isotope/docs/CHANGELOG-2.1.md @@ -1,7 +1,7 @@ Isotope eCommerce Changelog =========================== -Version 2.1.3-stable (2014-??-??) +Version 2.1.3-stable (2014-06-30) --------------------------------- ### Improved