Moin,
ich bin dabei das Backend Modul zu erweitern und möchte die Ausgabe im Backend, um den Inhalt einer 2. DCA bzw Tabelle erweitern.
Das Modul ist soweit registriert und die Ausgabe der ersten Tabelle "tl_filialen" funktioniert soweit.
das DCA dazu:PHP-Code:<?php declare(strict_types=1);
//Backend Modul
$GLOBALS['BE_MOD']['module_test_group'] = [
'module_test_table' => [
'tables' => ['tl_filialen', 'tl_wochentag_uhrzeit']
]
];
Nun möchte ich eine zweite Tabelle einbinden. Oben der Config hab ich das soweit gemacht.PHP-Code:<?php declare(strict_types=1);
$GLOBALS['TL_DCA']['tl_filialen'] = array
(
'config' => array(
'dataContainer' => 'Table',
'ctable' => array('tl_wochentag_uhrzeit'), // Verknüpfte Tabelle
'enableVersioning' => true,
'sql' => array(
'keys' => array(
'id' => 'primary',
),
),
),
'list' => array(
'sorting' => array(
'mode' => 2, // Sortierreihenfolge: Aufsteigend
'fields' => array('name'), // Sortierfeld
'flag' => 1, // Sortierpfeil anzeigen
'panelLayout' => 'filter;search,limit',
),
'label' => array(
'fields' => array('name', 'adresse'),
'format' => '%s (%s)', // Anzeigeformat in der Liste
),
'global_operations' => array(
'all' => array(
'label' => &$GLOBALS['TL_LANG']['MSC']['all'],
'href' => 'act=select',
'class' => 'header_edit_all',
'attributes' => 'onclick="Backend.getScrollOffset();" accesskey="e"',
),
),
'operations' => array(
'edit' => array(
'label' => &$GLOBALS['TL_LANG']['tl_filialen']['edit'],
'href' => 'act=edit',
'icon' => 'edit.gif',
),
'delete' => array(
'label' => &$GLOBALS['TL_LANG']['tl_filialen']['delete'],
'href' => 'act=delete',
'icon' => 'delete.gif',
'attributes' => 'onclick="if(!confirm(\'' . $GLOBALS['TL_LANG']['MSC']['deleteConfirm'] . '\'))return false;Backend.getScrollOffset();"',
),
'show' => array(
'label' => &$GLOBALS['TL_LANG']['tl_filialen']['show'],
'href' => 'act=show',
'icon' => 'show.gif',
),
),
),
'palettes' => array(
'default' => '{title_legend},name,adresse,description;{opening_hours_legend}',
),
'fields' => array(
'id' => array(
'sql' => "int(10) unsigned NOT NULL auto_increment",
),
'tstamp' => array(
'sql' => "int(10) unsigned NOT NULL default '0'",
),
'name' => array(
'label' => &$GLOBALS['TL_LANG']['tl_filialen']['name'],
'inputType' => 'text',
'eval' => array('mandatory' => true, 'maxlength' => 255),
'sql' => "varchar(255) NOT NULL default ''",
),
'adresse' => array(
'label' => &$GLOBALS['TL_LANG']['tl_filialen']['adresse'],
'inputType' => 'text',
'eval' => array('mandatory' => true, 'maxlength' => 255),
'sql' => "varchar(255) NOT NULL default ''",
),
'description' => array(
'label' => &$GLOBALS['TL_LANG']['tl_filialen']['description'],
'inputType' => 'textarea',
'eval' => array('rte' => 'tinyMCE', 'helpwizard' => true),
'sql' => "text NOT NULL default ''",
),
),
);
Im DCA für das die zweite Tabelle hab ich Fremdschlüssel gekennzeichnet.
Sieht so aus:
Ziel ist es:PHP-Code:<?php declare(strict_types=1);
$GLOBALS['TL_DCA']['tl_wochentag_uhrzeit'] = array(
'config' => array(
'dataContainer' => 'Table',
'ptable' => 'tl_filialen', // Verknüpfte Tabelle (Filialen)
'sql' => array(
'keys' => array(
'id' => 'primary',
'filiale_id' => 'index',
),
),
),
'list' => array(
'sorting' => array(
'mode' => 4, // Details anzeigen
'fields' => array('wochentag'),
'headerFields' => array('name'), // Name der zugehörigen Filiale anzeigen
'flag' => 11, // 1: Sortierbar, 2: Aufsteigend, 8: Sortierpfeil, 11: Sortierbar und Aufsteigend
'panelLayout' => 'filter;search,limit',
'child_record_callback' => array('tl_wochentag_uhrzeit')
),
'label' => array(
'fields' => array('wochentag', 'uhrzeit_von', 'uhrzeit_bis'),
'format' => '%s: %s - %s', // Anzeigeformat in der Liste
),
'global_operations' => array(
'all' => array(
'label' => &$GLOBALS['TL_LANG']['MSC']['all'],
'href' => 'act=select',
'class' => 'header_edit_all',
'attributes' => 'onclick="Backend.getScrollOffset();" accesskey="e"',
),
),
'operations' => array(
'edit' => array(
'label' => &$GLOBALS['TL_LANG']['tl_wochentag_uhrzeit']['edit'],
'href' => 'act=edit',
'icon' => 'edit.gif',
),
'delete' => array(
'label' => &$GLOBALS['TL_LANG']['tl_wochentag_uhrzeit']['delete'],
'href' => 'act=delete',
'icon' => 'delete.gif',
'attributes' => 'onclick="if(!confirm(\'' . $GLOBALS['TL_LANG']['MSC']['deleteConfirm'] . '\'))return false;Backend.getScrollOffset();"',
),
'show' => array(
'label' => &$GLOBALS['TL_LANG']['tl_wochentag_uhrzeit']['show'],
'href' => 'act=show',
'icon' => 'show.gif',
),
),
),
'palettes' => array(
'default' => '{title_legend},title;{opening_hours_legend},weekday,opening_time,closing_time',
),
'fields' => array(
'id' => array(
'sql' => "int(10) unsigned NOT NULL auto_increment",
),
'pid' => array
(
'sql' => "int(10) unsigned NOT NULL default 0",
),
'tstamp' => array(
'sql' => "int(10) unsigned NOT NULL default '0'",
),
'filiale_id' => array(
'label' => &$GLOBALS['TL_LANG']['tl_wochentag_uhrzeit']['filiale_id'],
'exclude' => true,
'inputType' => 'select',
'foreignKey' => 'tl_filialen.title',
'eval' => array('tl_class' => 'w50', 'chosen' => true, 'mandatory' => true),
'sql' => "int(10) unsigned NOT NULL default 0",
'relation' => array('type' => 'hasOne', 'load' => 'eager'),
),
'wochentag' => array(
'label' => &$GLOBALS['TL_LANG']['tl_wochentag_uhrzeit']['wochentag'],
'inputType' => 'select',
'options' => array(
'montag' => 'Montag',
'dienstag' => 'Dienstag',
'mittwoch' => 'Mittwoch',
'donnerstag' => 'Donnerstag',
'freitag' => 'Freitag',
'samstag' => 'Samstag',
'sonntag' => 'Sonntag',
),
'eval' => array('tl_class' => 'w50', 'includeBlankOption' => true),
'sql' => "varchar(255) NOT NULL",
),
'uhrzeit_von' => array(
'label' => &$GLOBALS['TL_LANG']['tl_wochentag_uhrzeit']['uhrzeit_von'],
'inputType' => 'text',
'eval' => array('rgxp' => 'time', 'tl_class' => 'w50', 'maxlength' => 8),
'sql' => "varchar(8) NOT NULL",
),
'uhrzeit_bis' => array(
'label' => &$GLOBALS['TL_LANG']['tl_wochentag_uhrzeit']['uhrzeit_bis'],
'inputType' => 'text',
'eval' => array('rgxp' => 'time', 'tl_class' => 'w50', 'maxlength' => 8),
'sql' => "varchar(8) NOT NULL",
),
),
);
Ich möchte im Backend Filialen anlegen, anschließend Werktage mit Öffnungszeiten an die Filialen binden. Dies versuch ich quasi über die Filiale_id.
im Backend bekomm ich nur die Ausgabe für tl_filialen.php
Von tl_wochentag_uhrzeit.php taucht nichts auf.
Beide Tabellen sind angelegt und die languages php Dateien sind angepasst. Woran liegt das?

 
			
 
			
			 DCA für 2 Tabellen ausgeben
 DCA für 2 Tabellen ausgeben
				 
					
					
					
						 Zitieren
Zitieren Zitat von do_while
 Zitat von do_while
					
 
 