Skip to content

Commit

Permalink
Merge pull request #261 from franzholz/develop
Browse files Browse the repository at this point in the history
change slug as default ''
  • Loading branch information
franzholz authored May 16, 2024
2 parents 0487377 + 7c584b4 commit cd5e8d2
Show file tree
Hide file tree
Showing 14 changed files with 36 additions and 24 deletions.
1 change: 1 addition & 0 deletions Classes/Controller/ActivityController.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ class ActivityController implements SingletonInterface
public function init($pibaseClass, $funcTablename, $useArticles): void
{
$this->pibaseClass = $pibaseClass;
$pibaseObj = GeneralUtility::makeInstance('' . $this->pibaseClass);
$this->cObj = $pibaseObj->getContentObjectRenderer();
$cnf = GeneralUtility::makeInstance('tx_ttproducts_config');
$this->conf = $cnf->conf;
Expand Down
1 change: 0 additions & 1 deletion Configuration/TCA/sys_products_orders.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@
'generatorOptions' => [
'fields' => ['name', 'crdate'],
'fieldSeparator' => '_',
'prefixParentPageSlug' => false,
'replacements' => [
'/' => '-',
],
Expand Down
1 change: 0 additions & 1 deletion Configuration/TCA/tt_products.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@
'generatorOptions' => [
'fields' => ['title', 'itemnumber'],
'fieldSeparator' => '_',
'prefixParentPageSlug' => false,
'replacements' => [
'/' => '-',
],
Expand Down
1 change: 0 additions & 1 deletion Configuration/TCA/tt_products_articles.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@
'generatorOptions' => [
'fields' => ['title', 'itemnumber'],
'fieldSeparator' => '_',
'prefixParentPageSlug' => false,
'replacements' => [
'/' => '-',
],
Expand Down
1 change: 0 additions & 1 deletion Configuration/TCA/tt_products_articles_language.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,6 @@
'generatorOptions' => [
'fields' => ['title', 'article_uid'],
'fieldSeparator' => '_',
'prefixParentPageSlug' => false,
'replacements' => [
'/' => '-',
],
Expand Down
1 change: 0 additions & 1 deletion Configuration/TCA/tt_products_cat.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@
'generatorOptions' => [
'fields' => ['title', 'catid'],
'fieldSeparator' => '_',
'prefixParentPageSlug' => false,
'replacements' => [
'/' => '-',
],
Expand Down
1 change: 0 additions & 1 deletion Configuration/TCA/tt_products_cat_language.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@
'generatorOptions' => [
'fields' => ['title', 'cat_uid'],
'fieldSeparator' => '_',
'prefixParentPageSlug' => false,
'replacements' => [
'/' => '-',
],
Expand Down
1 change: 0 additions & 1 deletion Configuration/TCA/tt_products_downloads.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@
'generatorOptions' => [
'fields' => ['title', 'author'],
'fieldSeparator' => '_',
'prefixParentPageSlug' => false,
'replacements' => [
'/' => '-',
],
Expand Down
1 change: 0 additions & 1 deletion Configuration/TCA/tt_products_downloads_language.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@
'generatorOptions' => [
'fields' => ['title', 'parent_uid'],
'fieldSeparator' => '_',
'prefixParentPageSlug' => false,
'replacements' => [
'/' => '-',
],
Expand Down
1 change: 0 additions & 1 deletion Configuration/TCA/tt_products_language.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,6 @@
'generatorOptions' => [
'fields' => ['title', 'itemnumber'],
'fieldSeparator' => '_',
'prefixParentPageSlug' => false,
'replacements' => [
'/' => '-',
],
Expand Down
16 changes: 8 additions & 8 deletions ext_tables.sql
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ CREATE TABLE tt_products (
fe_group varchar(255) DEFAULT '0' NOT NULL,
title tinytext,
subtitle mediumtext,
slug varchar(2048),
slug varchar(2048) DEFAULT '' NOT NULL,
keyword mediumtext,
prod_uid int(11) DEFAULT '0' NOT NULL,
accessory_uid int(11) DEFAULT '0' NOT NULL,
Expand Down Expand Up @@ -256,7 +256,7 @@ CREATE TABLE tt_products_cat (
fe_group varchar(255) DEFAULT '0' NOT NULL,
title tinytext,
subtitle mediumtext,
slug varchar(2048),
slug varchar(2048) DEFAULT '' NOT NULL,
catid varchar(40) DEFAULT '' NOT NULL,
keyword mediumtext,
note text,
Expand Down Expand Up @@ -304,7 +304,7 @@ CREATE TABLE tt_products_cat_language (
fe_group varchar(255) DEFAULT '0' NOT NULL,
title tinytext,
subtitle mediumtext,
slug varchar(2048),
slug varchar(2048) DEFAULT '' NOT NULL,
keyword mediumtext,
note text,
note2 text,
Expand Down Expand Up @@ -365,7 +365,7 @@ CREATE TABLE tt_products_articles (
fe_group varchar(255) DEFAULT '0' NOT NULL,
title varchar(80) DEFAULT '' NOT NULL,
subtitle varchar(80) DEFAULT '' NOT NULL,
slug varchar(2048),
slug varchar(2048) DEFAULT '' NOT NULL,
keyword mediumtext,
itemnumber varchar(120) DEFAULT '' NOT NULL,
price decimal(19,2) DEFAULT '0.00' NOT NULL,
Expand Down Expand Up @@ -432,7 +432,7 @@ CREATE TABLE tt_products_articles_language (
fe_group varchar(255) DEFAULT '0' NOT NULL,
title varchar(80) DEFAULT '' NOT NULL,
subtitle varchar(80) DEFAULT '' NOT NULL,
slug varchar(2048),
slug varchar(2048) DEFAULT '' NOT NULL,
keyword mediumtext,
article_uid int(11) DEFAULT '0' NOT NULL,
note text,
Expand Down Expand Up @@ -759,7 +759,7 @@ CREATE TABLE tt_products_downloads (
endtime int(11) DEFAULT '0' NOT NULL,
fe_group varchar(255) DEFAULT '0' NOT NULL,
title tinytext,
slug varchar(2048),
slug varchar(2048) DEFAULT '' NOT NULL,
marker varchar(255) DEFAULT '' NOT NULL,
note text,
path varchar(255) DEFAULT '' NOT NULL,
Expand Down Expand Up @@ -815,7 +815,7 @@ CREATE TABLE tt_products_downloads_language (
fe_group varchar(255) DEFAULT '0' NOT NULL,
parent_uid int(11) DEFAULT '0' NOT NULL,
title tinytext,
slug varchar(2048),
slug varchar(2048) DEFAULT '' NOT NULL,
note text,

PRIMARY KEY (uid),
Expand Down Expand Up @@ -877,7 +877,7 @@ CREATE TABLE sys_products_orders (
name varchar(80) DEFAULT '' NOT NULL,
first_name varchar(50) DEFAULT '' NOT NULL,
last_name varchar(50) DEFAULT '' NOT NULL,
slug varchar(2048),
slug varchar(2048) DEFAULT '' NOT NULL,
salutation int(11) DEFAULT '0' NOT NULL,
company varchar(80) DEFAULT '' NOT NULL,
vat_id varchar(20) DEFAULT '' NOT NULL,
Expand Down
30 changes: 26 additions & 4 deletions lib/class.tx_ttproducts_form_div.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,19 @@ public static function createSelect(

foreach ($valueArray as $key => $parts) {
if (is_array($parts)) {
$selectKey = $parts['value'];
$selectValue = $parts['label'];
if (
isset($parts['value']) &&
isset($parts['label'])
) {
$selectKey = $parts['value'];
$selectValue = $parts['label'];
} else if (
isset($parts['0']) &&
isset($parts['1'])
) {
$selectKey = $parts['1'];
$selectValue = $parts['0'];
}
} else {
$selectKey = $key;
$selectValue = $parts;
Expand Down Expand Up @@ -125,12 +136,22 @@ public static function createSelect(

switch ($type) {
case 'select':
$inputTextArray = ['<option value="' . htmlspecialchars($valueText, $flags) . '"' . $selectedText . '>', '</option>'];
$inputTextArray = [
'<option value="' . htmlspecialchars($valueText, $flags) . '"' . $selectedText . '>',
'</option>'
];
break;
case 'checkbox':
case 'radio':
$preParamArray['type'] = $type;
$inputText = self::createTag('input', $name, $valueText, $preParamArray, $paramArray);
$inputText =
self::createTag(
'input',
$name,
$valueText,
$preParamArray,
$paramArray
);

if ($layout == '') {
$inputText .= ' ' . $nameText . '<br ' . ($useXHTML ? '/' : '') . '>';
Expand All @@ -151,6 +172,7 @@ public static function createSelect(
if (is_array($imageFileArray) && isset($imageFileArray[$key])) {
$tmpText = str_replace('###IMAGE###', $imageFileArray[$key], $tmpText);
}

if (is_array($keyMarkerArray) && isset($keyMarkerArray[$key])) {
$tmpText = $templateService->substituteMarkerArray(
$tmpText,
Expand Down
2 changes: 1 addition & 1 deletion model/class.tx_ttproducts_table_base.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ abstract class tx_ttproducts_table_base implements SingletonInterface
public $conf;
public $config;
public $tableObj; // object of the type tx_table_db
public $defaultFieldArray = ['uid' => 'uid', 'pid' => 'pid']; // fields which must always be read in
public $defaultFieldArray = ['uid' => 'uid', 'pid' => 'pid', 'sorting' => 'sorting']; // fields which must always be read in
public $relatedFromTableArray = [];
public $fieldArray = []; // field replacements
protected $insertRowArray; // array of stored insert records
Expand Down
2 changes: 0 additions & 2 deletions view/class.tx_ttproducts_list_view.php
Original file line number Diff line number Diff line change
Expand Up @@ -1389,8 +1389,6 @@ public function printView(
if (!$selectConf['orderBy']) {
$selectConf['orderBy'] = $conf['orderBy'];
}
$tmpArray = GeneralUtility::trimExplode(',', $selectConf['orderBy']);
$orderByArray[$funcTablename] = $tmpArray[0]; // $orderByProduct

if ($useCategories) {
$orderByCat = $tableConfArray[$categoryFuncTablename]['orderBy'];
Expand Down

0 comments on commit cd5e8d2

Please sign in to comment.