Skip to content

Commit 010601e

Browse files
committed
* compatibility for PHP 7.2
* compatibility with MySQL strict mode
1 parent b7d8ee4 commit 010601e

File tree

153 files changed

+1628
-1954
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

153 files changed

+1628
-1954
lines changed

ChangeLog

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
2019-03-09 Franz Holzinger <franz@ttproducts.de>
1+
2019-03-25 Franz Holzinger <franz@ttproducts.de>
22
* compatibility for PHP 7.2
3+
* compatibility with MySQL strict mode
34

45
2019-02-20 Franz Holzinger <franz@ttproducts.de>
56
* change hook tx_double6 into JambageCom\Div2007\Hooks\Evaluation\Double6
@@ -598,7 +599,7 @@
598599
* tt_address table can be used for manufacturer with the new address field of tt_products
599600

600601
2007-02-09 Franz Holzinger <franz@fholzinger.com>
601-
* 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.
602+
* 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.
602603

603604
2007-01-16 Franz Holzinger <franz@fholzinger.com>
604605
* fix CSS issue: check the recs array for $this->infoArray in lib/class.tx_ttproducts_address.php

Classes/Hooks/StatusProvider.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
use JambageCom\Div2007\Utility\StatusUtility;
1818

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

3434
public function getGlobalVariables () {
35-
$result = null;
35+
$result = '';
3636

3737
if (
3838
(

Configuration/TCA/Overrides/fe_users.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
<?php
2-
3-
if (!defined ('TYPO3_MODE')) {
4-
die ('Access denied.');
5-
}
2+
defined('TYPO3_MODE') || die('Access denied.');
63

74
$temporaryColumns = array (
85
'tt_products_memoItems' => array (
@@ -13,7 +10,7 @@
1310
'size' => '50',
1411
'max' => '256',
1512
'eval' => 'null',
16-
'default' => NULL,
13+
'default' => ''
1714
)
1815
),
1916
'tt_products_memodam' => array (
@@ -24,7 +21,7 @@
2421
'size' => '50',
2522
'max' => '256',
2623
'eval' => 'null',
27-
'default' => NULL,
24+
'default' => '',
2825
)
2926
),
3027
'tt_products_discount' => array (
@@ -50,6 +47,7 @@
5047
'size' => '5',
5148
'max' => '20',
5249
'eval' => 'trim,integer',
50+
'default' => 0
5351
)
5452
),
5553
'tt_products_vouchercode' => array (
@@ -58,7 +56,8 @@
5856
'config' => array (
5957
'type' => 'input',
6058
'size' => '20',
61-
'max' => '256'
59+
'max' => '256',
60+
'default' => ''
6261
)
6362
),
6463
'tt_products_vat' => array (
@@ -82,6 +81,7 @@
8281
),
8382
'size' => 1,
8483
'maxitems' => 1,
84+
'default' => 0
8585
)
8686
),
8787
'tt_products_organisation_form' => array (
@@ -121,6 +121,7 @@
121121
),
122122
'size' => 1,
123123
'maxitems' => 1,
124+
'default' => 'U'
124125
)
125126
),
126127
);

Configuration/TCA/Overrides/pages.php

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
<?php
2-
3-
if (!defined ('TYPO3_MODE')) {
4-
die ('Access denied.');
5-
}
2+
defined('TYPO3_MODE') || die('Access denied.');
63

74
$imageFile = PATH_TTPRODUCTS_ICON_TABLE_REL . 'tt_products.gif';
85

@@ -12,10 +9,10 @@
129
// add folder icon
1310
$pageType = 'ttpproduct';
1411

15-
$addToModuleSelection = TRUE;
12+
$addToModuleSelection = true;
1613
foreach ($GLOBALS['TCA']['pages']['columns']['module']['config']['items'] as $item) {
1714
if ($item['1'] == $pageType) {
18-
$addToModuleSelection = FALSE;
15+
$addToModuleSelection = false;
1916
break;
2017
}
2118
}
@@ -57,10 +54,10 @@ class_exists($callingClassName) &&
5754
);
5855
}
5956

60-
$addToModuleSelection = TRUE;
57+
$addToModuleSelection = true;
6158
foreach ($GLOBALS['TCA']['pages']['columns']['module']['config']['items'] as $item) {
6259
if ($item['1'] == $pageType) {
63-
$addToModuleSelection = FALSE;
60+
$addToModuleSelection = false;
6461
continue;
6562
}
6663
}

Configuration/TCA/Overrides/pages_language_overlay.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
<?php
2-
3-
if (!defined ('TYPO3_MODE')) {
4-
die ('Access denied.');
5-
}
6-
2+
defined('TYPO3_MODE') || die('Access denied.');
73

84
$table = 'pages_language_overlay';
95

Configuration/TCA/Overrides/sys_products_cards.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
<?php
2-
if (!defined ('TYPO3_MODE')) {
3-
die ('Access denied.');
4-
}
2+
defined('TYPO3_MODE') || die('Access denied.');
53

64
$table = 'sys_products_cards';
75

Configuration/TCA/Overrides/sys_products_orders.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
<?php
2-
3-
if (!defined ('TYPO3_MODE')) {
4-
die ('Access denied.');
5-
}
2+
defined('TYPO3_MODE') || die('Access denied.');
63

74
$table = 'sys_products_orders';
85

Configuration/TCA/Overrides/tt_products.php

Lines changed: 67 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
<?php
2-
3-
if (!defined ('TYPO3_MODE')) {
4-
die ('Access denied.');
5-
}
2+
defined('TYPO3_MODE') || die('Access denied.');
63

74
$table = 'tt_products';
8-
$bSelectTaxMode = FALSE;
5+
$bSelectTaxMode = false;
96

107
if (
118
version_compare(TYPO3_version, '8.7.0', '<')
@@ -20,81 +17,81 @@
2017

2118
if (
2219
defined('STATIC_INFO_TABLES_TAXES_EXT') &&
23-
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded(STATIC_INFO_TABLES_TAXES_EXT)
20+
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded(STATIC_INFO_TABLES_TAXES_EXT)
2421
) {
25-
$eInfo = tx_div2007_alpha5::getExtensionInfo_fh003(STATIC_INFO_TABLES_TAXES_EXT);
26-
27-
if (is_array($eInfo)) {
28-
$sittVersion = $eInfo['version'];
29-
if (version_compare($sittVersion, '0.3.0', '>=')) {
30-
$bSelectTaxMode = TRUE;
31-
}
32-
}
22+
$eInfo = tx_div2007_alpha5::getExtensionInfo_fh003(STATIC_INFO_TABLES_TAXES_EXT);
23+
24+
if (is_array($eInfo)) {
25+
$sittVersion = $eInfo['version'];
26+
if (version_compare($sittVersion, '0.3.0', '>=')) {
27+
$bSelectTaxMode = true;
28+
}
29+
}
3330
}
3431

3532

3633
if ($bSelectTaxMode) {
37-
$whereTaxCategory = \TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields('static_tax_categories');
38-
39-
$temporaryColumns = array (
40-
'tax_id' => array (
41-
'exclude' => 0,
42-
'label' => 'LLL:EXT:' . STATIC_INFO_TABLES_TAXES_EXT . '/locallang_db.xml:static_taxes.tx_rate_id',
43-
'config' => array (
44-
'type' => 'select',
45-
'renderType' => 'selectSingle',
46-
'items' => array (
47-
array('LLL:EXT:' . STATIC_INFO_TABLES_TAXES_EXT . '/locallang_db.xml:static_taxes.tx_rate_id.I.0', '0'),
48-
array('LLL:EXT:' . STATIC_INFO_TABLES_TAXES_EXT . '/locallang_db.xml:static_taxes.tx_rate_id.I.1', '1'),
49-
array('LLL:EXT:' . STATIC_INFO_TABLES_TAXES_EXT . '/locallang_db.xml:static_taxes.tx_rate_id.I.2', '2'),
50-
array('LLL:EXT:' . STATIC_INFO_TABLES_TAXES_EXT . '/locallang_db.xml:static_taxes.tx_rate_id.I.3', '3'),
51-
array('LLL:EXT:' . STATIC_INFO_TABLES_TAXES_EXT . '/locallang_db.xml:static_taxes.tx_rate_id.I.4', '4'),
52-
array('LLL:EXT:' . STATIC_INFO_TABLES_TAXES_EXT . '/locallang_db.xml:static_taxes.tx_rate_id.I.5', '5'),
53-
),
54-
)
55-
),
56-
);
57-
58-
59-
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns(
60-
$table,
61-
$temporaryColumns
62-
);
63-
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes(
64-
$table,
65-
'tax_id',
66-
'',
67-
'replace:tax_dummy'
68-
);
69-
70-
$GLOBALS['TCA'][$table]['interface']['showRecordFieldList'] = str_replace(',tax,', ',tax,tax_id,', $GLOBALS['TCA'][$table]['interface']['showRecordFieldList']);
34+
$whereTaxCategory = \TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields('static_tax_categories');
35+
36+
$temporaryColumns = array (
37+
'tax_id' => array (
38+
'exclude' => 0,
39+
'label' => 'LLL:EXT:' . STATIC_INFO_TABLES_TAXES_EXT . '/locallang_db.xml:static_taxes.tx_rate_id',
40+
'config' => array (
41+
'type' => 'select',
42+
'renderType' => 'selectSingle',
43+
'items' => array (
44+
array('LLL:EXT:' . STATIC_INFO_TABLES_TAXES_EXT . '/locallang_db.xml:static_taxes.tx_rate_id.I.0', '0'),
45+
array('LLL:EXT:' . STATIC_INFO_TABLES_TAXES_EXT . '/locallang_db.xml:static_taxes.tx_rate_id.I.1', '1'),
46+
array('LLL:EXT:' . STATIC_INFO_TABLES_TAXES_EXT . '/locallang_db.xml:static_taxes.tx_rate_id.I.2', '2'),
47+
array('LLL:EXT:' . STATIC_INFO_TABLES_TAXES_EXT . '/locallang_db.xml:static_taxes.tx_rate_id.I.3', '3'),
48+
array('LLL:EXT:' . STATIC_INFO_TABLES_TAXES_EXT . '/locallang_db.xml:static_taxes.tx_rate_id.I.4', '4'),
49+
array('LLL:EXT:' . STATIC_INFO_TABLES_TAXES_EXT . '/locallang_db.xml:static_taxes.tx_rate_id.I.5', '5'),
50+
),
51+
'default' => 0
52+
)
53+
),
54+
);
55+
56+
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns(
57+
$table,
58+
$temporaryColumns
59+
);
60+
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes(
61+
$table,
62+
'tax_id',
63+
'',
64+
'replace:tax_dummy'
65+
);
7166

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

7470

7571

7672
switch ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][TT_PRODUCTS_EXT]['articleMode']) {
77-
case '1':
78-
$GLOBALS['TCA'][$table]['columns']['article_uid'] = array (
79-
'exclude' => 1,
80-
'label' => 'LLL:EXT:' . TT_PRODUCTS_EXT . '/locallang_db.xml:tt_products.article_uid',
81-
'config' => array (
82-
'type' => 'group',
83-
'internal_type' => 'db',
84-
'allowed' => 'tt_products_articles',
85-
'MM' => 'tt_products_products_mm_articles',
86-
'foreign_table' => 'tt_products_articles',
87-
'foreign_table_where' => ' ORDER BY tt_products_articles.title',
88-
'size' => 10,
89-
'selectedListStyle' => 'width:450px',
90-
'minitems' => 0,
91-
'maxitems' => 1000,
92-
)
93-
);
94-
break;
95-
case '2':
96-
// leave the settings of article_uid
97-
break;
73+
case '1':
74+
$GLOBALS['TCA'][$table]['columns']['article_uid'] = array (
75+
'exclude' => 1,
76+
'label' => 'LLL:EXT:' . TT_PRODUCTS_EXT . '/locallang_db.xml:tt_products.article_uid',
77+
'config' => array (
78+
'type' => 'group',
79+
'internal_type' => 'db',
80+
'allowed' => 'tt_products_articles',
81+
'MM' => 'tt_products_products_mm_articles',
82+
'foreign_table' => 'tt_products_articles',
83+
'foreign_table_where' => ' ORDER BY tt_products_articles.title',
84+
'size' => 10,
85+
'selectedListStyle' => 'width:450px',
86+
'minitems' => 0,
87+
'maxitems' => 1000,
88+
'default' => 0
89+
)
90+
);
91+
break;
92+
case '2':
93+
// leave the settings of article_uid
94+
break;
9895
case '0':
9996
default:
10097
unset($GLOBALS['TCA'][$table]['columns']['article_uid']);
@@ -104,8 +101,6 @@
104101
break;
105102
}
106103

107-
108-
109104
$addressTable = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][TT_PRODUCTS_EXT]['addressTable'];
110105

111106
if (!$addressTable) {
@@ -122,6 +117,7 @@
122117
'size' => 1,
123118
'minitems' => 0,
124119
'maxitems' => 1,
120+
'default' => 0
125121
)
126122
);
127123

@@ -134,8 +130,6 @@
134130
'before:price'
135131
);
136132

137-
138-
139133
$orderBySortingTablesArray = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][TT_PRODUCTS_EXT]['orderBySortingTables']);
140134
if (
141135
!empty($orderBySortingTablesArray) &&

0 commit comments

Comments
 (0)