Skip to content

Commit

Permalink
Merge branch 'hotfix/2.2.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
aschempp committed Mar 17, 2015
2 parents 7b6f965 + cb65b39 commit 465ab1b
Show file tree
Hide file tree
Showing 23 changed files with 169 additions and 72 deletions.
2 changes: 1 addition & 1 deletion system/modules/isotope/dca/tl_iso_config.php
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@
(
'label' => &$GLOBALS['TL_LANG']['tl_iso_config']['cartMinSubtotal'],
'exclude' => true,
'default' => '',
'default' => '0.00',
'inputType' => 'text',
'eval' => array('mandatory'=>true, 'maxlength'=>13, 'rgpx'=>'price', 'tl_class'=>'w50'),
'sql' => "decimal(12,2) NOT NULL default '0.00'",
Expand Down
6 changes: 3 additions & 3 deletions system/modules/isotope/dca/tl_iso_gallery.php
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@
'label' => $GLOBALS['TL_LANG']['tl_iso_gallery']['main_watermark_position'],
'exclude' => true,
'inputType' => 'select',
'options' => $GLOBALS['TL_CROP']['crop'],
'options' => array('left_top', 'center_top', 'right_top', 'left_center', 'center_center', 'right_center', 'left_bottom', 'center_bottom', 'right_bottom'),
'reference' => $GLOBALS['TL_LANG']['MSC'],
'eval' => array('tl_class'=>'w50'),
'sql' => "varchar(16) NOT NULL default ''",
Expand All @@ -242,7 +242,7 @@
'label' => $GLOBALS['TL_LANG']['tl_iso_gallery']['gallery_watermark_position'],
'exclude' => true,
'inputType' => 'select',
'options' => $GLOBALS['TL_CROP']['crop'],
'options' => array('left_top', 'center_top', 'right_top', 'left_center', 'center_center', 'right_center', 'left_bottom', 'center_bottom', 'right_bottom'),
'reference' => $GLOBALS['TL_LANG']['MSC'],
'eval' => array('tl_class'=>'w50'),
'sql' => "varchar(16) NOT NULL default ''",
Expand All @@ -260,7 +260,7 @@
'label' => $GLOBALS['TL_LANG']['tl_iso_gallery']['lightbox_watermark_position'],
'exclude' => true,
'inputType' => 'select',
'options' => $GLOBALS['TL_CROP']['crop'],
'options' => array('left_top', 'center_top', 'right_top', 'left_center', 'center_center', 'right_center', 'left_bottom', 'center_bottom', 'right_bottom'),
'reference' => $GLOBALS['TL_LANG']['MSC'],
'eval' => array('tl_class'=>'w50'),
'sql' => "varchar(16) NOT NULL default ''",
Expand Down
18 changes: 18 additions & 0 deletions system/modules/isotope/docs/CHANGELOG-2.1.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,24 @@
Isotope eCommerce Changelog
===========================

Version 2.1.12-stable (2015-03-17)
----------------------------------

### Improved
- Better Postfinance postsale handling
- Only filter by groups if one is set (fixes #1373)
- Check transaction status for PayOne payments (#1392)
- Better logging when notification for order status was not found (#1391)

### Fixed
- Filter fields could overwrite product properties if property was not customer defined/variant option
- Added missing collection ID to template (#1394)
- Default value for tl_iso_config.cartMinSubtotal was empty instead of decimal (#1367)
- Month and week reports were not correctly sorted across years (#1359)
- Category scope "product" in product list module should not be cached (#1383)
- Warning if products are not assigned to any category (#1398)


Version 2.1.11-stable (2015-02-10)
----------------------------------

Expand Down
12 changes: 12 additions & 0 deletions system/modules/isotope/docs/CHANGELOG-2.2.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
Isotope eCommerce Changelog
===========================

Version 2.2.3-stable (2015-03-17)
---------------------------------

### Improved
- Only generate messages module if necessary (fixes #1374)

### Fixed
- Gallery watermark positions were not available in Contao 3.4 (#1365)
- Labels for foreignKey fields were not shown in product attribute view (#1389)
- Manual product sorting (drag&drop) was broken in 2.2.1 (#1388)


Version 2.2.2-stable (2015-02-10)
---------------------------------

Expand Down
2 changes: 1 addition & 1 deletion system/modules/isotope/drivers/DC_ProductData.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ public function showAll()
$this->procedure[] = "language=''";

// Display products filtered by group
if (!$this->intId) {
if (!$this->intId && $this->intGroupId > 0) {
$this->procedure[] = "gid IN(" . implode(',', array_map('intval', \Database::getInstance()->getChildRecords(array($this->intGroupId), \Isotope\Model\Group::getTable(), false, array($this->intGroupId)))) . ")";
}

Expand Down
2 changes: 1 addition & 1 deletion system/modules/isotope/drivers/DC_TablePageId.php
Original file line number Diff line number Diff line change
Expand Up @@ -964,7 +964,7 @@ protected function parentView()
</ul>
<script>
Isotope.makePageViewSortable("ul_' . CURRENT_ID . '");
Isotope.makeParentViewSortable("ul_' . CURRENT_ID . '");
</script>';
}

Expand Down
2 changes: 1 addition & 1 deletion system/modules/isotope/languages/de/tl_iso_payment.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
$GLOBALS['TL_LANG']['tl_iso_payment']['config_ids'][0] = 'Konfigurationen';
$GLOBALS['TL_LANG']['tl_iso_payment']['config_ids'][1] = 'Diese Bezahlmethode kann auf bestimmte Shopkonfigurationen beschränkt werden.';
$GLOBALS['TL_LANG']['tl_iso_payment']['price'][0] = 'Preis';
$GLOBALS['TL_LANG']['tl_iso_payment']['price'][1] = 'Geben Sie Preis oder einen prozentualen Wert ein (z. B. "10" oder "10 %").';
$GLOBALS['TL_LANG']['tl_iso_payment']['price'][1] = 'Geben Sie Preis oder einen prozentualen Wert ein (z. B. "10" oder "10%").';
$GLOBALS['TL_LANG']['tl_iso_payment']['tax_class'][0] = 'Steuerklasse';
$GLOBALS['TL_LANG']['tl_iso_payment']['tax_class'][1] = 'Bitte wählen Sie eine Steuerklasse für diesen Preis.';
$GLOBALS['TL_LANG']['tl_iso_payment']['trans_type'][0] = 'Transaktions-Typ';
Expand Down
2 changes: 1 addition & 1 deletion system/modules/isotope/languages/it/modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,6 @@
$GLOBALS['TL_LANG']['IMD']['notifications'][1] = 'Usa il Centro Notifiche per gestire le email etc. per Isotope eCommerce.';
$GLOBALS['TL_LANG']['IMD']['documents'][0] = 'Documenti';
$GLOBALS['TL_LANG']['IMD']['documents'][1] = 'Definire i documenti.';
$GLOBALS['TL_LANG']['IMD']['miscellaneous'] = 'Eterogeneo';
$GLOBALS['TL_LANG']['IMD']['miscellaneous'] = 'Varie';
$GLOBALS['TL_LANG']['IMD']['labels'][0] = 'Traduzioni';
$GLOBALS['TL_LANG']['IMD']['labels'][1] = 'Sostituire etichette fornite per alcune lingue.';
14 changes: 13 additions & 1 deletion system/modules/isotope/library/Isotope/Frontend.php
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,10 @@ public function storeCurrentArticle($objRow)
*/
public static function getPagesInCurrentRoot(array $arrPages, $objMember = null)
{
if (empty($arrPages)) {
return $arrPages;
}

global $objPage;

// $objPage not available, we don't know if the page is allowed
Expand All @@ -531,7 +535,15 @@ public static function getPagesInCurrentRoot(array $arrPages, $objMember = null)
$arrGroups = deserialize($objMember->groups, true);
}

foreach (array_diff($arrPages, $arrAvailable, $arrUnavailable) as $intPage) {
if (!isset($arrAvailable[$intMember])) {
$arrAvailable[$intMember] = array();
}

if (!isset($arrUnavailable[$intMember])) {
$arrUnavailable[$intMember] = array();
}

foreach (array_diff($arrPages, $arrUnavailable[$intMember], $arrUnavailable[$intMember]) as $intPage) {
$objPageDetails = \PageModel::findWithDetails($intPage);

// Page is not in the current root
Expand Down
2 changes: 1 addition & 1 deletion system/modules/isotope/library/Isotope/Isotope.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class Isotope extends \Controller
/**
* Isotope version
*/
const VERSION = '2.2.2';
const VERSION = '2.2.3';

/**
* True if the system has been initialized
Expand Down
19 changes: 19 additions & 0 deletions system/modules/isotope/library/Isotope/Message.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ public static function add($strMessage, $strType)
*/
public static function generate()
{
if (static::isEmpty()) {
return '';
}

$objModule = new Messages(new \ModuleModel());
$objModule->type = 'iso_message';

Expand Down Expand Up @@ -158,6 +162,21 @@ public static function reset()
}
}

/**
* Returns true if there are no messages defined
*
* @return bool
*/
public static function isEmpty()
{
foreach (static::getTypes() as $strType) {
if (!empty($_SESSION[$strType])) {
return false;
}
}

return true;
}

/**
* Return all available message types
Expand Down
12 changes: 8 additions & 4 deletions system/modules/isotope/library/Isotope/Model/Attribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,16 +192,20 @@ public function saveToDCA(array &$arrData)
}

// Prepare options
if ($this->optionsSource == 'foreignKey') {
if ($this->optionsSource == 'foreignKey' && !$this->isVariantOption()) {
$arrField['foreignKey'] = $this->parseForeignKey($this->foreignKey, $GLOBALS['TL_LANGUAGE']);
unset($arrField['options']);
unset($arrField['reference']);

}

// @deprecated remove in Isotope 3.0
elseif ($this->optionsSource == 'attribute') {
$arrOptions = deserialize($this->options);
elseif ($this->optionsSource == 'attribute' || ($this->optionsSource == 'foreignKey' && $this->isVariantOption())) {
if ($this->optionsSource == 'foreignKey') {
$arrKey = explode('.', $this->foreignKey, 2);
$arrOptions = \Database::getInstance()->execute("SELECT id AS value, {$arrKey[1]} AS label FROM {$arrKey[0]} ORDER BY label")->fetchAllAssoc();
} else {
$arrOptions = deserialize($this->options);
}

if (!empty($arrOptions) && is_array($arrOptions)) {
$arrField['default'] = array();
Expand Down
6 changes: 3 additions & 3 deletions system/modules/isotope/library/Isotope/Model/Payment/PSP.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ public function getPostsaleOrder()
return null;
}

return Order::findByPk($this->getRequestData('orderID'));
return Order::findByPk((int) $this->getRequestData('orderID'));
}

/**
Expand Down Expand Up @@ -223,10 +223,10 @@ protected function preparePSPParams($objOrder, $objModule)
private function getRequestData($strKey)
{
if ($this->psp_http_method == 'GET') {
return \Input::get($strKey);
return $_GET[$strKey];
}

return \Input::post($strKey);
return $_POST[$strKey];
}


Expand Down
16 changes: 12 additions & 4 deletions system/modules/isotope/library/Isotope/Model/Payment/Payone.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,15 @@ public function processPostsale(IsotopeProductCollection $objOrder)
die('TSOK');
}

if (\Input::post('txaction') != 'paid'
&& \Input::post('currency') != $objOrder->currency
&& \Input::post('balance') > 0
// Ignore all except these actions
if (\Input::post('txaction') != 'appointed'
&& \Input::post('txaction') != 'capture'
&& \Input::post('txaction') != 'paid'
) {
die('TSOK');
}

if (\Input::post('currency') != $objOrder->currency || \Input::post('balance') > 0) {
\System::log('PayOne order data mismatch for Order ID "' . \Input::post('invoice') . '"', __METHOD__, TL_ERROR);
die('TSOK');
}
Expand All @@ -50,7 +55,10 @@ public function processPostsale(IsotopeProductCollection $objOrder)
die('TSOK');
}

$objOrder->date_paid = time();
if (\Input::post('txaction') == 'paid') {
$objOrder->date_paid = time();
}

$objOrder->updateOrderStatus($this->new_order_status);

$objOrder->save();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,24 @@ class Postfinance extends PSP
(
'AAVADDRESS',
'AAVCHECK',
'AAVMAIL',
'AAVNAME',
'AAVPHONE',
'AAVZIP',
'ACCEPTANCE',
'ALIAS',
'AMOUNT',
'BIC',
'BIN',
'BRAND',
'CARDNO',
'CCCTY',
'CN',
'COLLECTOR_BIC',
'COLLECTOR_IBAN',
'COMPLUS',
'CREATION_STATUS',
'CREDITDEBIT',
'CURRENCY',
'CVCCHECK',
'DCC_COMMPERCENTAGE',
Expand All @@ -66,25 +73,27 @@ class Postfinance extends PSP
'DIGESTCARDNO',
'ECI',
'ED',
'EMAIL',
'ENCCARDNO',
'FXAMOUNT',
'FXCURRENCY',
'IP',
'IPCTY',
'MANDATEID',
'MOBILEMODE',
'NBREMAILUSAGE',
'NBRIPUSAGE',
'NBRIPUSAGE_ALLTX',
'NBRUSAGE',
'NCERROR',
'NCERRORCARDNO',
'NCERRORCN',
'NCERRORCVC',
'NCERRORED',
'ORDERID',
'PAYID',
'PAYMENT_REFERENCE',
'PM',
'SCO_CATEGORY',
'SCORING',
'SEQUENCETYPE',
'SIGNDATE',
'STATUS',
'SUBBRAND',
'SUBSCRIPTION_ID',
Expand Down
49 changes: 29 additions & 20 deletions system/modules/isotope/library/Isotope/Model/ProductCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -1266,6 +1266,7 @@ public function addToTemplate(\Template $objTemplate, array $arrConfig = array()
$arrGalleries = array();
$arrItems = $this->addItemsToTemplate($objTemplate, $arrConfig['sorting']);

$objTemplate->id = $this->id;
$objTemplate->collection = $this;
$objTemplate->config = ($this->getRelated('config_id') || Isotope::getConfig());
$objTemplate->surcharges = \Isotope\Frontend::formatSurcharges($this->getSurcharges());
Expand Down Expand Up @@ -1480,30 +1481,38 @@ protected function generateDocumentNumber($strPrefix, $intDigits)
// Lock tables so no other order can get the same ID
\Database::getInstance()->lockTables(array(static::$strTable => 'WRITE'));

// Retrieve the highest available order ID
$objMax = \Database::getInstance()->prepare("
SELECT document_number
FROM " . static::$strTable . "
WHERE
type=?
" . ($strPrefix != '' ? " AND document_number LIKE '$strPrefix%'" : '') . "
AND store_id=?
ORDER BY CAST(" . ($strPrefix != '' ? "SUBSTRING(document_number, " . ($intPrefix+1) . ")" : 'document_number') . " AS UNSIGNED) DESC
")->limit(1)->execute(
array_search(get_called_class(), static::getModelTypes()),
Isotope::getCart()->store_id
);
try {
// Retrieve the highest available order ID
$objMax = \Database::getInstance()->prepare("
SELECT document_number
FROM " . static::$strTable . "
WHERE
type=?
" . ($strPrefix != '' ? " AND document_number LIKE '$strPrefix%'" : '') . "
AND store_id=?
ORDER BY CAST(" . ($strPrefix != '' ? "SUBSTRING(document_number, " . ($intPrefix + 1) . ")" : 'document_number') . " AS UNSIGNED) DESC
")->limit(1)->execute(
array_search(get_called_class(), static::getModelTypes()),
$this->store_id
);

$intMax = (int) substr($objMax->document_number, $intPrefix);
$intMax = (int) substr($objMax->document_number, $intPrefix);

$this->arrData['document_number'] = $strPrefix . str_pad($intMax + 1, $intDigits, '0', STR_PAD_LEFT);
}
$this->arrData['document_number'] = $strPrefix . str_pad($intMax + 1, $intDigits, '0', STR_PAD_LEFT);

\Database::getInstance()->prepare("
UPDATE " . static::$strTable . " SET document_number=? WHERE id=?
")->execute($this->arrData['document_number'], $this->id);

\Database::getInstance()->prepare("
UPDATE " . static::$strTable . " SET document_number=? WHERE id=?
")->execute($this->arrData['document_number'], $this->id);
\Database::getInstance()->unlockTables();

\Database::getInstance()->unlockTables();
} catch (\Exception $e) {
// Make sure tables are always unlocked
\Database::getInstance()->unlockTables();

throw $e;
}
}

return $this->arrData['document_number'];
}
Expand Down
Loading

0 comments on commit 465ab1b

Please sign in to comment.