Skip to content

Commit

Permalink
* compatibility for PHP 7.2
Browse files Browse the repository at this point in the history
* compatibility with MySQL strict mode
  • Loading branch information
franzholz committed Mar 25, 2019
1 parent b7d8ee4 commit 010601e
Show file tree
Hide file tree
Showing 153 changed files with 1,628 additions and 1,954 deletions.
5 changes: 3 additions & 2 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
2019-03-09 Franz Holzinger <[email protected]>
2019-03-25 Franz Holzinger <[email protected]>
* compatibility for PHP 7.2
* compatibility with MySQL strict mode

2019-02-20 Franz Holzinger <[email protected]>
* change hook tx_double6 into JambageCom\Div2007\Hooks\Evaluation\Double6
Expand Down Expand Up @@ -598,7 +599,7 @@
* tt_address table can be used for manufacturer with the new address field of tt_products

2007-02-09 Franz Holzinger <[email protected]>
* fix bug 4940: $TSFE->reqCHash() must not be called. The new parameter useCacheHash must be passed to all link functions in the fh_library 0.0.16.
* fix bug 4940: $GLOBALS['TSFE']->reqCHash() must not be called. The new parameter useCacheHash must be passed to all link functions in the fh_library 0.0.16.

2007-01-16 Franz Holzinger <[email protected]>
* fix CSS issue: check the recs array for $this->infoArray in lib/class.tx_ttproducts_address.php
Expand Down
4 changes: 2 additions & 2 deletions Classes/Hooks/StatusProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
use JambageCom\Div2007\Utility\StatusUtility;

/**
* Hook into the backend module "Reports" checking the configuration required for agency
* Hook into the backend module "Reports" checking the configuration required for tt_products
*/
class StatusProvider extends \JambageCom\Div2007\Base\StatusProviderBase
{
Expand All @@ -32,7 +32,7 @@ class StatusProvider extends \JambageCom\Div2007\Base\StatusProviderBase
protected $extensionName = 'Shop System (' . TT_PRODUCTS_EXT . ')';

public function getGlobalVariables () {
$result = null;
$result = '';

if (
(
Expand Down
15 changes: 8 additions & 7 deletions Configuration/TCA/Overrides/fe_users.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
<?php

if (!defined ('TYPO3_MODE')) {
die ('Access denied.');
}
defined('TYPO3_MODE') || die('Access denied.');

$temporaryColumns = array (
'tt_products_memoItems' => array (
Expand All @@ -13,7 +10,7 @@
'size' => '50',
'max' => '256',
'eval' => 'null',
'default' => NULL,
'default' => ''
)
),
'tt_products_memodam' => array (
Expand All @@ -24,7 +21,7 @@
'size' => '50',
'max' => '256',
'eval' => 'null',
'default' => NULL,
'default' => '',
)
),
'tt_products_discount' => array (
Expand All @@ -50,6 +47,7 @@
'size' => '5',
'max' => '20',
'eval' => 'trim,integer',
'default' => 0
)
),
'tt_products_vouchercode' => array (
Expand All @@ -58,7 +56,8 @@
'config' => array (
'type' => 'input',
'size' => '20',
'max' => '256'
'max' => '256',
'default' => ''
)
),
'tt_products_vat' => array (
Expand All @@ -82,6 +81,7 @@
),
'size' => 1,
'maxitems' => 1,
'default' => 0
)
),
'tt_products_organisation_form' => array (
Expand Down Expand Up @@ -121,6 +121,7 @@
),
'size' => 1,
'maxitems' => 1,
'default' => 'U'
)
),
);
Expand Down
13 changes: 5 additions & 8 deletions Configuration/TCA/Overrides/pages.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
<?php

if (!defined ('TYPO3_MODE')) {
die ('Access denied.');
}
defined('TYPO3_MODE') || die('Access denied.');

$imageFile = PATH_TTPRODUCTS_ICON_TABLE_REL . 'tt_products.gif';

Expand All @@ -12,10 +9,10 @@
// add folder icon
$pageType = 'ttpproduct';

$addToModuleSelection = TRUE;
$addToModuleSelection = true;
foreach ($GLOBALS['TCA']['pages']['columns']['module']['config']['items'] as $item) {
if ($item['1'] == $pageType) {
$addToModuleSelection = FALSE;
$addToModuleSelection = false;
break;
}
}
Expand Down Expand Up @@ -57,10 +54,10 @@ class_exists($callingClassName) &&
);
}

$addToModuleSelection = TRUE;
$addToModuleSelection = true;
foreach ($GLOBALS['TCA']['pages']['columns']['module']['config']['items'] as $item) {
if ($item['1'] == $pageType) {
$addToModuleSelection = FALSE;
$addToModuleSelection = false;
continue;
}
}
Expand Down
6 changes: 1 addition & 5 deletions Configuration/TCA/Overrides/pages_language_overlay.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
<?php

if (!defined ('TYPO3_MODE')) {
die ('Access denied.');
}

defined('TYPO3_MODE') || die('Access denied.');

$table = 'pages_language_overlay';

Expand Down
4 changes: 1 addition & 3 deletions Configuration/TCA/Overrides/sys_products_cards.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?php
if (!defined ('TYPO3_MODE')) {
die ('Access denied.');
}
defined('TYPO3_MODE') || die('Access denied.');

$table = 'sys_products_cards';

Expand Down
5 changes: 1 addition & 4 deletions Configuration/TCA/Overrides/sys_products_orders.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
<?php

if (!defined ('TYPO3_MODE')) {
die ('Access denied.');
}
defined('TYPO3_MODE') || die('Access denied.');

$table = 'sys_products_orders';

Expand Down
140 changes: 67 additions & 73 deletions Configuration/TCA/Overrides/tt_products.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
<?php

if (!defined ('TYPO3_MODE')) {
die ('Access denied.');
}
defined('TYPO3_MODE') || die('Access denied.');

$table = 'tt_products';
$bSelectTaxMode = FALSE;
$bSelectTaxMode = false;

if (
version_compare(TYPO3_version, '8.7.0', '<')
Expand All @@ -20,81 +17,81 @@

if (
defined('STATIC_INFO_TABLES_TAXES_EXT') &&
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded(STATIC_INFO_TABLES_TAXES_EXT)
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded(STATIC_INFO_TABLES_TAXES_EXT)
) {
$eInfo = tx_div2007_alpha5::getExtensionInfo_fh003(STATIC_INFO_TABLES_TAXES_EXT);

if (is_array($eInfo)) {
$sittVersion = $eInfo['version'];
if (version_compare($sittVersion, '0.3.0', '>=')) {
$bSelectTaxMode = TRUE;
}
}
$eInfo = tx_div2007_alpha5::getExtensionInfo_fh003(STATIC_INFO_TABLES_TAXES_EXT);

if (is_array($eInfo)) {
$sittVersion = $eInfo['version'];
if (version_compare($sittVersion, '0.3.0', '>=')) {
$bSelectTaxMode = true;
}
}
}


if ($bSelectTaxMode) {
$whereTaxCategory = \TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields('static_tax_categories');

$temporaryColumns = array (
'tax_id' => array (
'exclude' => 0,
'label' => 'LLL:EXT:' . STATIC_INFO_TABLES_TAXES_EXT . '/locallang_db.xml:static_taxes.tx_rate_id',
'config' => array (
'type' => 'select',
'renderType' => 'selectSingle',
'items' => array (
array('LLL:EXT:' . STATIC_INFO_TABLES_TAXES_EXT . '/locallang_db.xml:static_taxes.tx_rate_id.I.0', '0'),
array('LLL:EXT:' . STATIC_INFO_TABLES_TAXES_EXT . '/locallang_db.xml:static_taxes.tx_rate_id.I.1', '1'),
array('LLL:EXT:' . STATIC_INFO_TABLES_TAXES_EXT . '/locallang_db.xml:static_taxes.tx_rate_id.I.2', '2'),
array('LLL:EXT:' . STATIC_INFO_TABLES_TAXES_EXT . '/locallang_db.xml:static_taxes.tx_rate_id.I.3', '3'),
array('LLL:EXT:' . STATIC_INFO_TABLES_TAXES_EXT . '/locallang_db.xml:static_taxes.tx_rate_id.I.4', '4'),
array('LLL:EXT:' . STATIC_INFO_TABLES_TAXES_EXT . '/locallang_db.xml:static_taxes.tx_rate_id.I.5', '5'),
),
)
),
);


\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns(
$table,
$temporaryColumns
);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes(
$table,
'tax_id',
'',
'replace:tax_dummy'
);

$GLOBALS['TCA'][$table]['interface']['showRecordFieldList'] = str_replace(',tax,', ',tax,tax_id,', $GLOBALS['TCA'][$table]['interface']['showRecordFieldList']);
$whereTaxCategory = \TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields('static_tax_categories');

$temporaryColumns = array (
'tax_id' => array (
'exclude' => 0,
'label' => 'LLL:EXT:' . STATIC_INFO_TABLES_TAXES_EXT . '/locallang_db.xml:static_taxes.tx_rate_id',
'config' => array (
'type' => 'select',
'renderType' => 'selectSingle',
'items' => array (
array('LLL:EXT:' . STATIC_INFO_TABLES_TAXES_EXT . '/locallang_db.xml:static_taxes.tx_rate_id.I.0', '0'),
array('LLL:EXT:' . STATIC_INFO_TABLES_TAXES_EXT . '/locallang_db.xml:static_taxes.tx_rate_id.I.1', '1'),
array('LLL:EXT:' . STATIC_INFO_TABLES_TAXES_EXT . '/locallang_db.xml:static_taxes.tx_rate_id.I.2', '2'),
array('LLL:EXT:' . STATIC_INFO_TABLES_TAXES_EXT . '/locallang_db.xml:static_taxes.tx_rate_id.I.3', '3'),
array('LLL:EXT:' . STATIC_INFO_TABLES_TAXES_EXT . '/locallang_db.xml:static_taxes.tx_rate_id.I.4', '4'),
array('LLL:EXT:' . STATIC_INFO_TABLES_TAXES_EXT . '/locallang_db.xml:static_taxes.tx_rate_id.I.5', '5'),
),
'default' => 0
)
),
);

\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns(
$table,
$temporaryColumns
);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes(
$table,
'tax_id',
'',
'replace:tax_dummy'
);

$GLOBALS['TCA'][$table]['interface']['showRecordFieldList'] = str_replace(',tax,', ',tax,tax_id,', $GLOBALS['TCA'][$table]['interface']['showRecordFieldList']);
}



switch ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][TT_PRODUCTS_EXT]['articleMode']) {
case '1':
$GLOBALS['TCA'][$table]['columns']['article_uid'] = array (
'exclude' => 1,
'label' => 'LLL:EXT:' . TT_PRODUCTS_EXT . '/locallang_db.xml:tt_products.article_uid',
'config' => array (
'type' => 'group',
'internal_type' => 'db',
'allowed' => 'tt_products_articles',
'MM' => 'tt_products_products_mm_articles',
'foreign_table' => 'tt_products_articles',
'foreign_table_where' => ' ORDER BY tt_products_articles.title',
'size' => 10,
'selectedListStyle' => 'width:450px',
'minitems' => 0,
'maxitems' => 1000,
)
);
break;
case '2':
// leave the settings of article_uid
break;
case '1':
$GLOBALS['TCA'][$table]['columns']['article_uid'] = array (
'exclude' => 1,
'label' => 'LLL:EXT:' . TT_PRODUCTS_EXT . '/locallang_db.xml:tt_products.article_uid',
'config' => array (
'type' => 'group',
'internal_type' => 'db',
'allowed' => 'tt_products_articles',
'MM' => 'tt_products_products_mm_articles',
'foreign_table' => 'tt_products_articles',
'foreign_table_where' => ' ORDER BY tt_products_articles.title',
'size' => 10,
'selectedListStyle' => 'width:450px',
'minitems' => 0,
'maxitems' => 1000,
'default' => 0
)
);
break;
case '2':
// leave the settings of article_uid
break;
case '0':
default:
unset($GLOBALS['TCA'][$table]['columns']['article_uid']);
Expand All @@ -104,8 +101,6 @@
break;
}



$addressTable = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][TT_PRODUCTS_EXT]['addressTable'];

if (!$addressTable) {
Expand All @@ -122,6 +117,7 @@
'size' => 1,
'minitems' => 0,
'maxitems' => 1,
'default' => 0
)
);

Expand All @@ -134,8 +130,6 @@
'before:price'
);



$orderBySortingTablesArray = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][TT_PRODUCTS_EXT]['orderBySortingTables']);
if (
!empty($orderBySortingTablesArray) &&
Expand Down
Loading

0 comments on commit 010601e

Please sign in to comment.