From d2a7de2e1391c54bc4156d1b6fc546cf445d91e9 Mon Sep 17 00:00:00 2001 From: Franz Holzinger Date: Fri, 27 Sep 2024 11:19:16 +0200 Subject: [PATCH 1/4] next version 2.15.16 --- ext_emconf.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext_emconf.php b/ext_emconf.php index 10583f535..1b85ad01f 100644 --- a/ext_emconf.php +++ b/ext_emconf.php @@ -6,7 +6,7 @@ 'title' => 'Shop System', 'description' => 'Advanced versions at ttproducts.de. Documented in the E-Book "Der TYPO3-Webshop" - Shop with listing in multiple languages, with order tracking, product variants, support for transactor extension, bill, creditpoint and voucher system.', 'state' => 'stable', - 'version' => '2.15.15', + 'version' => '2.15.16', 'manual' => true, 'author' => 'Franz Holzinger', 'author_company' => 'jambage.com', From 39c9aafd2107e8e16acd282606c3ea001ef97d7d Mon Sep 17 00:00:00 2001 From: Franz Holzinger Date: Sat, 28 Sep 2024 10:00:14 +0200 Subject: [PATCH 2/4] add missing parameter for voucher --- control/class.tx_ttproducts_main.php | 2 +- model/class.tx_ttproducts_order.php | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/control/class.tx_ttproducts_main.php b/control/class.tx_ttproducts_main.php index 201affbe2..33267ee6b 100644 --- a/control/class.tx_ttproducts_main.php +++ b/control/class.tx_ttproducts_main.php @@ -468,7 +468,7 @@ public function run(&$cObj, $pibaseClass, &$errorCode, $content = '', $bRunAjax $voucher = $tablesObj->get('voucher'); if (is_object($voucher) && $voucher->isEnabled()) { $recs = tx_ttproducts_control_basket::getRecs(); - $voucher->doProcessing($recs); + $voucher->doProcessing($recs, $basketObj->getCalculatedArray(), $feUserRecord); } if (!empty($voucher)) { diff --git a/model/class.tx_ttproducts_order.php b/model/class.tx_ttproducts_order.php index d274928c9..a05f69002 100644 --- a/model/class.tx_ttproducts_order.php +++ b/model/class.tx_ttproducts_order.php @@ -853,14 +853,14 @@ public function putData( $bOnlyStatusChange ) { $tablesObj = GeneralUtility::makeInstance('tx_ttproducts_tables'); - $voucherObj = $tablesObj->get('voucher'); + $voucher = $tablesObj->get('voucher'); if ( - is_object($voucherObj) && + is_object($voucher) && $status == 1 && - $voucherObj->isEnabled() + $voucher->isEnabled() ) { - $voucherObj->delete($feUserRecord); + $voucher->delete($feUserRecord); } // get credit card info From 09a421f0b4f59f06738ac383ee23b36c15cff9a6 Mon Sep 17 00:00:00 2001 From: Franz Holzinger Date: Tue, 1 Oct 2024 16:16:50 +0200 Subject: [PATCH 3/4] - --- model/class.tx_ttproducts_table_base.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/model/class.tx_ttproducts_table_base.php b/model/class.tx_ttproducts_table_base.php index 71920d912..782c38ab8 100644 --- a/model/class.tx_ttproducts_table_base.php +++ b/model/class.tx_ttproducts_table_base.php @@ -110,7 +110,7 @@ public function init($funcTablename): bool debug($tablename, 'Table not found in $GLOBALS[\'TCA\']: ' . $tablename . ' in file class.tx_ttproducts_table_base.php'); // keep this $errorText = 'ERROR in the setup of "tt_products.table.' . $funcTablename . '": wrong table name "' . $tablename . '".'; $lastUnderscore = strrpos($tablename, '_'); - $extName = substr($tablename, 0, $lastUnderscore); + $extName = ($lastUnderscore ? substr($tablename, 0, $lastUnderscore) : $tablename); if (strpos($extName, 'tx') === 0) { $errorText .= '
Consider to install the extension "' . $extName . '" or change this setup.'; } From 7c690c2efdab3b1fcd7f3470f910fd123c7df164 Mon Sep 17 00:00:00 2001 From: Franz Holzinger Date: Wed, 2 Oct 2024 19:51:34 +0200 Subject: [PATCH 4/4] replace GeneralUtility::_GP ... --- Classes/Api/ActivityApi.php | 40 ++++++++++++------- Classes/Api/ParameterApi.php | 14 +++++++ Classes/Controller/ActivityController.php | 6 ++- api/class.tx_ttproducts_ts.php | 3 +- .../class.tx_ttproducts_control_access.php | 10 +++-- .../class.tx_ttproducts_control_command.php | 2 +- .../class.tx_ttproducts_control_product.php | 2 +- .../class.tx_ttproducts_control_search.php | 2 +- control/class.tx_ttproducts_javascript.php | 2 +- control/class.tx_ttproducts_main.php | 10 ++--- hooks/class.tx_ttproducts_ws_flexslider.php | 4 +- lib/class.tx_ttproducts_tracking.php | 2 +- marker/class.tx_ttproducts_marker.php | 19 +++------ model/class.tx_ttproducts_basket.php | 12 +++--- view/class.tx_ttproducts_basket_view.php | 2 +- view/class.tx_ttproducts_cat_view.php | 2 +- view/class.tx_ttproducts_list_view.php | 14 +++---- view/class.tx_ttproducts_single_view.php | 2 +- view/class.tx_ttproducts_url_view.php | 2 +- 19 files changed, 87 insertions(+), 63 deletions(-) diff --git a/Classes/Api/ActivityApi.php b/Classes/Api/ActivityApi.php index af00504d3..983c701fd 100644 --- a/Classes/Api/ActivityApi.php +++ b/Classes/Api/ActivityApi.php @@ -42,6 +42,7 @@ use TYPO3\CMS\Core\SingletonInterface; use TYPO3\CMS\Core\Utility\GeneralUtility; +use JambageCom\TtProducts\Api\ParameterApi; class ActivityApi implements SingletonInterface { @@ -66,12 +67,17 @@ public function init($codes = []): void if (empty($codes)) { return; } + $parameterApi = GeneralUtility::makeInstance(ParameterApi::class); + // $request = $parameterApi->getRequest(); + $activityArray = []; $subActivity = $this->subActivity; - $update = GeneralUtility::_POST('products_update') || GeneralUtility::_POST('products_update_x'); - $info = GeneralUtility::_POST('products_info') || GeneralUtility::_POST('products_info_x'); - $payment = GeneralUtility::_POST('products_payment') || GeneralUtility::_POST('products_payment_x'); - $gpVars = GeneralUtility::_GP(TT_PRODUCTS_EXT); + $update = $parameterApi->getParameter('products_update') || $parameterApi->getParameter('products_update_x'); + $info = $parameterApi->getParameter('products_info') || $parameterApi->getParameter('products_info_x'); + $payment = $parameterApi->getParameter('products_payment') || $parameterApi->getParameter('products_payment_x'); + + $gpVars = $parameterApi->getParameter(TT_PRODUCTS_EXT); + debug($gpVars, '$gpVars'); if ( !$update && @@ -98,31 +104,35 @@ public function init($codes = []): void } } - if (GeneralUtility::_GP('products_clear_basket') || GeneralUtility::_GP('products_clear_basket_x')) { + if ($parameterApi->getParameter('products_clear_basket') || $parameterApi->getParameter('products_clear_basket_x')) { $activityArray['products_clear_basket'] = true; } - if (GeneralUtility::_GP('products_overview') || GeneralUtility::_GP('products_overview_x')) { + + if ($parameterApi->getParameter('products_overview') || $parameterApi->getParameter('products_overview_x')) { $activityArray['products_overview'] = true; } if (!$update) { - if (GeneralUtility::_GP('products_payment') || GeneralUtility::_GP('products_payment_x')) { + if ($parameterApi->getParameter('products_payment') || $parameterApi->getParameter('products_payment_x')) { $activityArray['products_payment'] = true; - } elseif (GeneralUtility::_GP('products_info') || GeneralUtility::_GP('products_info_x')) { + } elseif ($parameterApi->getParameter('products_info') || $parameterApi->getParameter('products_info_x')) { $activityArray['products_info'] = true; } } - if (GeneralUtility::_GP('products_customized_payment') || GeneralUtility::_GP('products_customized_payment_x')) { + if ($parameterApi->getParameter('products_customized_payment') || $parameterApi->getParameter('products_customized_payment_x')) { $activityArray['products_customized_payment'] = true; } - if (GeneralUtility::_GP('products_verify') || GeneralUtility::_GP('products_verify_x')) { + + if ($parameterApi->getParameter('products_verify') || $parameterApi->getParameter('products_verify_x')) { $activityArray['products_verify'] = true; } - if (GeneralUtility::_GP('products_finalize') || GeneralUtility::_GP('products_finalize_x')) { + + if ($parameterApi->getParameter('products_finalize') || $parameterApi->getParameter('products_finalize_x')) { $activityArray['products_finalize'] = true; } + $codeActivityArray = []; $isBasketCode = false; if (is_array($codes)) { @@ -132,7 +142,7 @@ public function init($codes = []): void $codeActivityArray['products_basket'] = true; $isBasketCode = true; break; - case 'INFO': + case 'INFO': // neu if ( !( !empty($activityArray['products_verify']) || @@ -158,7 +168,7 @@ public function init($codes = []): void } if (!empty($activityArray['products_verify'])) { - $isBasketCode = true; + $isBasketCode = true; // neu, damit verify gesetzt bleibt, wenn vorhanden } break; case 'FINALIZE': @@ -218,8 +228,7 @@ public function fixCountry($infoObj, $basketExtra, $conf): void ) { $overwrite = ControlApi::isOverwriteMode($infoArray); - $needsDeliveryAddress = - \tx_ttproducts_control_basket::needsDeliveryAddresss($basketExtra); + $needsDeliveryAddress = \tx_ttproducts_control_basket::needsDeliveryAddresss($basketExtra); $infoObj->mapPersonIntoDelivery( $basketExtra, $overwrite, @@ -276,6 +285,7 @@ public function transformActivities($activities) $codeActivities['products_basket'] = false; } } + $sortedCodeActivities = []; foreach ($codeActivityArray as $activity) { // You must keep the order of activities. if (isset($codeActivities[$activity])) { diff --git a/Classes/Api/ParameterApi.php b/Classes/Api/ParameterApi.php index 708105e68..e7a5f445a 100644 --- a/Classes/Api/ParameterApi.php +++ b/Classes/Api/ParameterApi.php @@ -116,6 +116,20 @@ public function getParameter($param) return $value; } + public function getPostParameter($param) + { + $request = $this->getRequest(); + $value = $request->getParsedBody()[$param] ?? null; + return $value; + } + + public function getGetParameter($param) + { + $request = $this->getRequest(); + $value = $request->getQueryParams()[$param] ?? null; + return $value; + } + public function getParameterMerged($param) { $request = $this->getRequest(); diff --git a/Classes/Controller/ActivityController.php b/Classes/Controller/ActivityController.php index 53b740e6c..af01fcaee 100644 --- a/Classes/Controller/ActivityController.php +++ b/Classes/Controller/ActivityController.php @@ -340,6 +340,7 @@ public function getErrorLabel( $languageKey = ''; $context = GeneralUtility::makeInstance(Context::class); $languageSubpath = '/Resources/Private/Language/'; + $parameterApi = GeneralUtility::makeInstance(ParameterApi::class); if ($checkRequired || $checkAllowed) { $check = ($checkRequired ?: $checkAllowed); @@ -444,7 +445,7 @@ public function getErrorLabel( } elseif ( $pidagb && empty($_REQUEST['recs']['personinfo']['agb']) && - empty(GeneralUtility::_GET('products_payment')) && + empty($parameterApi->getGetParameter('products_payment')) && empty($infoArray['billing']['agb']) ) { // so AGB has not been accepted @@ -519,6 +520,7 @@ public function getContent( $config = $cnf->getConfig(); $paymentScript = false; $feUserRecord = CustomerApi::getFeUserRecord(); + $parameterApi = GeneralUtility::makeInstance(ParameterApi::class); if ($checkBasket && !$basketEmpty) { $basketConf = $cnf->getBasketConf('minPrice'); // check the basket limits @@ -662,7 +664,7 @@ public function getContent( ( empty($pidagb) || !empty($_REQUEST['recs']['personinfo']['agb']) || - ($isPayment && GeneralUtility::_GET('products_payment')) || + ($isPayment && $parameterApi->getGetParameter('products_payment')) || !empty($infoArray['billing']['agb']) ) ) { diff --git a/api/class.tx_ttproducts_ts.php b/api/class.tx_ttproducts_ts.php index c8fa777e4..c088106c6 100644 --- a/api/class.tx_ttproducts_ts.php +++ b/api/class.tx_ttproducts_ts.php @@ -190,7 +190,8 @@ public function processMemo(): void { $funcTablename = 'tt_products'; $conf = $GLOBALS['TSFE']->tmpl->setup['plugin.'][TT_PRODUCTS_EXT . '.'] ?? []; - $piVars = GeneralUtility::_GPmerged('tt_products'); + $parameterApi = GeneralUtility::makeInstance(ParameterApi::class); + $piVars = $parameterApi->getParameterMerged('tt_products'); tx_ttproducts_control_memo::process($funcTablename, $piVars, $conf); } diff --git a/control/class.tx_ttproducts_control_access.php b/control/class.tx_ttproducts_control_access.php index c0fd3ae08..220f121d6 100644 --- a/control/class.tx_ttproducts_control_access.php +++ b/control/class.tx_ttproducts_control_access.php @@ -40,6 +40,8 @@ use TYPO3\CMS\Core\SingletonInterface; use TYPO3\CMS\Core\Utility\GeneralUtility; +use JambageCom\TtProducts\Api\ParameterApi; + class tx_ttproducts_control_access implements SingletonInterface { public static function getVariables( @@ -53,7 +55,8 @@ public static function getVariables( throw new Exception('ERROR in tt_products: The setup "update_code" must not be empty'); } - $updateCode = GeneralUtility::_GP('update_code') ?? ''; + $parameterApi = GeneralUtility::makeInstance(ParameterApi::class); + $updateCode = $parameterApi->getParameter('update_code') ?? ''; $bRequireBEAdmin = ($conf['shopAdmin'] == 'BE'); $bIsAllowed = self::isAllowed($bRequireBEAdmin); @@ -68,7 +71,7 @@ public static function getVariables( $updateCode = ''; // the update code must not be used if it is wrong } - $trackingCode = GeneralUtility::_GP('tracking') ?? ''; + $trackingCode = $parameterApi->getParameter('tracking'); } public static function isAllowed($bRequireBEAdmin) @@ -90,7 +93,8 @@ public static function isValidUpdateCode($bRequireBEAdmin, $password, &$updateCo $result = false; if (self::isAllowed($bRequireBEAdmin)) { - $updateCode = GeneralUtility::_GP('update_code') ?? ''; + $parameterApi = GeneralUtility::makeInstance(ParameterApi::class); + $updateCode = $parameterApi->getParameter('update_code'); if ($updateCode == $password) { $result = true; // Means that the administrator of the website is authenticated. diff --git a/control/class.tx_ttproducts_control_command.php b/control/class.tx_ttproducts_control_command.php index a668165ec..38d7f0492 100644 --- a/control/class.tx_ttproducts_control_command.php +++ b/control/class.tx_ttproducts_control_command.php @@ -91,7 +91,7 @@ public static function doProcessing( $pidListObj->setPageArray(); $postVar = self::getCommandVar(); - $cmdData = GeneralUtility::_GP($postVar); + $cmdData = $parameterApi->getParameter($postVar) ?? []; switch ($theCode) { case 'DOWNLOAD': diff --git a/control/class.tx_ttproducts_control_product.php b/control/class.tx_ttproducts_control_product.php index c7a894ccf..83d493b51 100644 --- a/control/class.tx_ttproducts_control_product.php +++ b/control/class.tx_ttproducts_control_product.php @@ -56,7 +56,7 @@ public static function getPresetVariantArray( $basketVar = $parameterApi->getBasketVar(); $presetVariantArray = []; - $basketArray = GeneralUtility::_GP($basketVar); + $basketArray = $parameterApi->getParameter($basketVar); if ( isset($basketArray) && is_array($basketArray) && diff --git a/control/class.tx_ttproducts_control_search.php b/control/class.tx_ttproducts_control_search.php index 18a488541..365b27ef2 100644 --- a/control/class.tx_ttproducts_control_search.php +++ b/control/class.tx_ttproducts_control_search.php @@ -107,7 +107,7 @@ public function init(&$content, &$conf, &$config, $cObj, $pibaseClass, &$error_c $markerObj = GeneralUtility::makeInstance('tx_ttproducts_marker'); $markerObj->init( $conf, - $piVars + $piVars['backPID'] ?? $parameterApi->getParameter('backPID') ); $searchViewObj = GeneralUtility::makeInstance('tx_ttproducts_search_view'); diff --git a/control/class.tx_ttproducts_javascript.php b/control/class.tx_ttproducts_javascript.php index 8af723443..2e8b03023 100644 --- a/control/class.tx_ttproducts_javascript.php +++ b/control/class.tx_ttproducts_javascript.php @@ -248,7 +248,7 @@ public function set( $code .= ' '; foreach ($ajaxConf as $k => $actConf) { - $pVar = GeneralUtility::_GP($k); + $pVar = $parameterApi->getParameter($k); if (isset($pVar) && is_array($actConf[$pVar . '.'])) { foreach ($actConf[$pVar . '.'] as $k2 => $v2) { $code .= 'conf[' . $k2 . '] = ' . $v2 . '; '; diff --git a/control/class.tx_ttproducts_main.php b/control/class.tx_ttproducts_main.php index 33267ee6b..52037457d 100644 --- a/control/class.tx_ttproducts_main.php +++ b/control/class.tx_ttproducts_main.php @@ -199,7 +199,7 @@ public function init( if (count($requiredArray)) { foreach ($requiredArray as $k => $pivar) { if ($pivar && $pivar != 'empty') { - $gpVar = GeneralUtility::_GP($pivar); + $gpVar = $parameterApi->getParameter($pivar); if ( !isset($piVars[$pivar]) && !isset($gpVar) @@ -399,7 +399,7 @@ public function run(&$cObj, $pibaseClass, &$errorCode, $content = '', $bRunAjax } } $updateMode = 0; - if (GeneralUtility::_GP('mode_update')) { + if ($parameterApi->getParameter('mode_update')) { $updateMode = 1; } @@ -1165,7 +1165,7 @@ public function products_tracking( $templateSuffix, $theCode, $conf - ) { // GeneralUtility::_GP('tracking') + ) { $cnf = GeneralUtility::makeInstance('tx_ttproducts_config'); $urlObj = GeneralUtility::makeInstance('tx_ttproducts_url_view'); $updateCode = ''; @@ -1206,7 +1206,7 @@ public function products_tracking( $tracking->init( $cObj ); - $orderRecord = GeneralUtility::_GP('orderRecord'); + $orderRecord = $parameterApi->getParameter('orderRecord'); if ( !empty($_REQUEST['userNotification']) && isset($orderRecord) && @@ -1349,7 +1349,7 @@ public function products_display( $bSingleFromList ) { $extVars = $piVars['variants'] ?? ''; - $extVars = ($extVars ?: GeneralUtility::_GP('ttp_extvars')); + $extVars = ($extVars ?? $parameterApi->getParameter('ttp_extvars')); $showAmount = $cnf->getBasketConf('view', 'showAmount'); if (!count($this->tt_product_single)) { diff --git a/hooks/class.tx_ttproducts_ws_flexslider.php b/hooks/class.tx_ttproducts_ws_flexslider.php index aa8f4639c..ab7021f7a 100644 --- a/hooks/class.tx_ttproducts_ws_flexslider.php +++ b/hooks/class.tx_ttproducts_ws_flexslider.php @@ -38,6 +38,7 @@ */ use TYPO3\CMS\Core\Utility\GeneralUtility; use WapplerSystems\WsFlexslider\Controller\FlexsliderController; +use JambageCom\TtProducts\Api\ParameterApi; class tx_ttproducts_ws_flexslider { @@ -48,7 +49,8 @@ public function getUid( ) { $uid = 0; - $params = GeneralUtility::_GP('tt_products'); + $parameterApi = GeneralUtility::makeInstance(ParameterApi::class); + $params = $parameterApi->getParameter('tt_products'); if (isset($params) && is_array($params)) { $uid = $params['cat']; } diff --git a/lib/class.tx_ttproducts_tracking.php b/lib/class.tx_ttproducts_tracking.php index 79427b38b..0168a3f3a 100644 --- a/lib/class.tx_ttproducts_tracking.php +++ b/lib/class.tx_ttproducts_tracking.php @@ -372,7 +372,7 @@ public function getTrackingInformation( $recipient, $status_log_element, $statusCodeArray, - GeneralUtility::_GP('tracking'), + $parameterApi->getParameter('tracking'), $orderRow, $orderData, $templateCode, diff --git a/marker/class.tx_ttproducts_marker.php b/marker/class.tx_ttproducts_marker.php index 96785520b..bcdc71124 100644 --- a/marker/class.tx_ttproducts_marker.php +++ b/marker/class.tx_ttproducts_marker.php @@ -61,7 +61,7 @@ class tx_ttproducts_marker implements SingletonInterface * * @param array array urls which should be overridden with marker key as index */ - public function init($conf, $piVars) + public function init($conf, $backPID) { $this->markerArray = ['CATEGORY', 'PRODUCT', 'ARTICLE']; $markerFile = $conf['markerFile'] ?? ''; @@ -104,7 +104,7 @@ public function init($conf, $piVars) } $locallang = $languageObj->getLocallang(); $LLkey = $languageObj->getLocalLangKey(); - $this->setGlobalMarkerArray($conf, $piVars, $locallang, $LLkey); + $this->setGlobalMarkerArray($conf, $backPID, $locallang, $LLkey); $errorCode = $this->getErrorCode(); return !is_array($errorCode) || (count($errorCode) == 0) ? true : false; @@ -148,7 +148,7 @@ public function replaceGlobalMarkers(&$content, $markerArray = []) /** * getting the global markers. */ - public function setGlobalMarkerArray($conf, $piVars, $locallang, $LLkey): void + public function setGlobalMarkerArray($conf, $backPID, $locallang, $LLkey): void { $cObj = GeneralUtility::makeInstance(ContentObjectRenderer::class); $markerArray = []; @@ -184,20 +184,11 @@ public function setGlobalMarkerArray($conf, $piVars, $locallang, $LLkey): void $markerArray['###PID_' . strtoupper($function) . '###'] = intval($conf['PID' . $function] ?? 0); } $markerArray['###SHOPADMIN_EMAIL###'] = $conf['orderEmail_from'] ?? 'undefined'; - $lang = GeneralUtility::_GET('L'); - - if ($lang != '') { - $markerArray['###LANGPARAM###'] = '&L=' . $lang; - } else { - $markerArray['###LANGPARAM###'] = ''; - } - $markerArray['###LANG###'] = $lang; + $markerArray['###LANG###'] = ''; $markerArray['###LANGUAGE###'] = $GLOBALS['TSFE']->config['config']['language'] ?? ''; $markerArray['###LOCALE_ALL###'] = $GLOBALS['TSFE']->config['config']['locale_all'] ?? ''; - $backPID = $piVars['backPID'] ?? ''; - $backPID = ($backPID ?: GeneralUtility::_GP('backPID')); - $backPID = ($backPID ?: (!empty($conf['PIDlistDisplay']) ? $conf['PIDlistDisplay'] : $GLOBALS['TSFE']->id ?? 0)); + $backPID = ($backPID ?: $conf['PIDlistDisplay'] ?? ($GLOBALS['TSFE']->id ?? 0)); $markerArray['###BACK_PID###'] = $backPID; // Call all addGlobalMarkers hooks at the end of this method diff --git a/model/class.tx_ttproducts_basket.php b/model/class.tx_ttproducts_basket.php index 35d00f9fc..be3cede00 100644 --- a/model/class.tx_ttproducts_basket.php +++ b/model/class.tx_ttproducts_basket.php @@ -88,7 +88,7 @@ public function init( $parameterApi = GeneralUtility::makeInstance(ParameterApi::class); $basketApi = GeneralUtility::makeInstance(BasketApi::class); $piVars = $parameterApi->getPiVars(); - $gpVars = GeneralUtility::_GP('tt_products'); + $gpVars = $parameterApi->getParameter('tt_products'); $payment = false; if (isset($gpVars)) { @@ -130,7 +130,7 @@ public function init( $inputConf['where'] && !empty($inputConf['name']) ) { - $radioUid = GeneralUtility::_GP($inputConf['name']); + $radioUid = $gpVars[$inputConf['name']] ?? 0; if ($radioUid) { $rowArray = $viewTableObj->get('', 0, false, $inputConf['where']); @@ -156,11 +156,11 @@ public function init( if (isset($this->basketExt['gift']) && is_array($this->basketExt['gift'])) { $this->giftnumber = count($this->basketExt['gift']) + 1; } - $newGiftData = GeneralUtility::_GP('ttp_gift'); + $newGiftData = $gpVars['ttp_gift'] ?? 0; $extVars = $piVars['variants'] ?? ''; - $extVars = ($extVars ?: GeneralUtility::_GP('ttp_extvars')); + $extVars = ($extVars ?: $gpVars['ttp_extvars'] ?? 0); $uid = $piVars['product'] ?? ''; - $uid = ($uid ?: GeneralUtility::_GP('tt_products')); + $uid = ($uid ?: $gpVars['tt_products'] ?? 0); $sameGiftData = true; $identGiftnumber = 0; @@ -188,7 +188,7 @@ public function init( } if ($newGiftData) { - $giftnumber = GeneralUtility::_GP('giftnumber'); + $giftnumber = $gpVars['giftnumber'] ?? 0; if ($updateMode) { $basketExt['gift'][$giftnumber] = $newGiftData; $giftcount = intval($basketExt['gift'][$giftnumber]['item'][$uid][$extVars]); diff --git a/view/class.tx_ttproducts_basket_view.php b/view/class.tx_ttproducts_basket_view.php index af805235e..d6625985f 100644 --- a/view/class.tx_ttproducts_basket_view.php +++ b/view/class.tx_ttproducts_basket_view.php @@ -790,7 +790,7 @@ public function getView( ); // for receipt from DIBS script - $markerArray['###TRANSACT_CODE###'] = GeneralUtility::_GP('transact'); + $markerArray['###TRANSACT_CODE###'] = $parameterApi->getParameter('transact'); $markerArray['###CUR_SYM###'] = ' ' . ($bHtml ? htmlentities($conf['currencySymbol'], ENT_QUOTES) : $conf['currencySymbol']); $discountValue = tx_ttproducts_basket_calculate::getRealDiscount($calculatedArray, true); diff --git a/view/class.tx_ttproducts_cat_view.php b/view/class.tx_ttproducts_cat_view.php index 8e7d0fd3b..6951b9778 100644 --- a/view/class.tx_ttproducts_cat_view.php +++ b/view/class.tx_ttproducts_cat_view.php @@ -174,7 +174,7 @@ public function printView( // Fill marker arrays $backPID = $piVars['backPID'] ?? ''; - $backPID = ($backPID ?: GeneralUtility::_GP('backPID')); + $backPID = ($backPID ?: $parameterApi->getParameter('backPID')); $basketPID = $this->conf['PIDbasket']; $pid = $backPID; diff --git a/view/class.tx_ttproducts_list_view.php b/view/class.tx_ttproducts_list_view.php index 16dc45b37..2b306472b 100644 --- a/view/class.tx_ttproducts_list_view.php +++ b/view/class.tx_ttproducts_list_view.php @@ -170,10 +170,10 @@ public function advanceProduct( public function getSearchParams(&$queryString): void { $parameterApi = GeneralUtility::makeInstance(ParameterApi::class); - $sword = GeneralUtility::_GP('sword'); + $sword = $parameterApi->getParameter('sword'); if (!isset($sword)) { - $sword = GeneralUtility::_GP('swords'); + $sword = $parameterApi->getParameter('swords'); } if ($sword) { @@ -572,15 +572,15 @@ public function printView( $htmlSwords = ''; if ($calllevel == 0) { - $sword = GeneralUtility::_GP('sword'); - $sword ??= GeneralUtility::_GP('swords'); + $sword = $parameterApi->getParameter('sword'); + $sword ??= $parameterApi->getParameter('swords'); if (!isset($sword)) { - $postVars = GeneralUtility::_POST($prefixId); + $postVars = $parameterApi->getPostParameter($prefixId); $sword = $postVars['sword'] ?? null; if (!isset($sword)) { - $getVars = GeneralUtility::_GET($prefixId); + $getVars = $parameterApi->getGetParameter($prefixId); $sword = $getVars['sword'] ?? null; } } @@ -759,7 +759,7 @@ public function printView( if (!empty($piVars['newitemdays'])) { $newitemdays = $piVars['newitemdays']; } - $newitemdays = ($newitemdays ?: GeneralUtility::_GP('newitemdays')); + $newitemdays = ($newitemdays ?: $parameterApi->getParameter('newitemdays')); if ( ($newitemdays || $theCode == 'LISTNEWITEMS') && diff --git a/view/class.tx_ttproducts_single_view.php b/view/class.tx_ttproducts_single_view.php index 13813dda0..c347a139e 100644 --- a/view/class.tx_ttproducts_single_view.php +++ b/view/class.tx_ttproducts_single_view.php @@ -430,7 +430,7 @@ public function printView( } $backPID = $piVars['backPID'] ?? ''; - $backPID = ($backPID ?: GeneralUtility::_GP('backPID')); + $backPID = ($backPID ?: $parameterApi->getParameter('backPID')); $basketPID = $this->conf['PIDbasket']; $bNeedSingleParams = false; diff --git a/view/class.tx_ttproducts_url_view.php b/view/class.tx_ttproducts_url_view.php index 4db39e032..75174896e 100644 --- a/view/class.tx_ttproducts_url_view.php +++ b/view/class.tx_ttproducts_url_view.php @@ -296,7 +296,7 @@ public function addQueryStringParam(&$queryString, $param, $bUsePrefix = false): $prefixId = $parameterApi->getPrefixId(); $temp = $piVars[$param] ?? ''; - $temp = ($temp ?: (GeneralUtility::_GP($param) && ($param != 'pid') ? GeneralUtility::_GP($param) : 0)); + $temp = ($temp ?: ($parameterApi->getParameter($param) && ($param != 'pid') ? $parameterApi->getParameter($param) : 0)); if ($temp) { if ($bUsePrefix) {