PHP-Code:
use Contao\DC_Table;
use Contao\DataContainer;
$GLOBALS['TL_DCA']['tl_gs_volunteer'] = [
'config' => [
'dataContainer' => DC_TABLE::class,
'enableVersioning' => true,
'ctable' => ['tl_gs_volunteercontact'],
'sql' => [
'keys' => [
'id' => 'primary',
'vid' => 'unique'
]
]
],
'list' => [
'sorting' => [
'mode' => DataContainer::MODE_SORTABLE,
'fields' => ['lastname'],
'flag' => DataContainer::SORT_INITIAL_LETTER_ASC,
'panelLayout' => 'filter;sort,search,limit',
'fields' => ['lastname']
],
'label' => [
'fields' => ['vid', 'lastname', 'firstname'],
'showColumns' => true
],
'global_operations' => [
'all' => [
'href' => 'act=select',
'class' => 'header_edit_all',
'attributes' => 'onclick="Backend.getScrollOffset();" accesskey="e"'
],
],
'operations' => [
'edit' => [
'href' => 'act=edit',
'icon' => 'edit.svg'
],
'editContacts' => [
'href' => 'table=tl_gs_volunteercontact',
'icon' => 'article.svg'
],
'copy' => [
'href' => 'act=copy',
'icon' => 'copy.svg'
],
'delete' => [
'href' => 'act=delete',
'icon' => 'delete.svg',
'attributes' => 'onclick="if (!confirm(\'' . ($GLOBALS['TL_LANG']['MSC']['deleteConfirm'] ?? '') . '\')) return false; Backend.getScrollOffset();"'
],
'show' => [
'href' => 'act=show',
'icon' => 'show.svg'
],
]
],
'fields' => [
'id' => [
'sql' => "int(10) unsigned NOT NULL auto_increment",
],
'tstamp' => [
'sql' => "int(10) unsigned NOT NULL default '0'",
],
'vid' => [
'inputType' => 'text',
'search' => true,
'eval' => [
'rgxp' => 'natural',
'tl_class' => 'w50'
],
'sql' => "int(10) unsigned NULL"
],
'salutation' => [
'inputType' => 'select',
'options' => [
'mr' => 'Herr',
'mrs' => 'Frau',
'mx' => 'Divers'
],
'eval' => [
'includeBlankOption' => true,
'tl_class' => 'clr w50'
],
'sql' => "varchar(4) NOT NULL default ''"
],
'firstname' => [
'inputType' => 'text',
'search' => true,
'sorting' => true,
'eval' => [
'maxlength' => 255,
'tl_class' => 'clr w50',
'mandatory' => true
],
'sql' => "varchar(255) NOT NULL default ''",
],
'lastname' => [
'inputType' => 'text',
'search' => true,
'sorting' => true,
'eval' => [
'maxlength' => 255,
'tl_class' => 'w50',
'mandatory' => true
],
'sql' => "varchar(255) NOT NULL default ''",
],
'birthdate' => [
'inputType' => 'text',
'eval' => [
'maxlength' => 255,
'tl_class' => 'w50 wizard',
'rgxp' => 'date',
'datepicker' => true
],
'sql' => "varchar(10) NOT NULL default ''"
],
'street' => [
'inputType' => 'text',
'eval' => [
'maxlength' => 255,
'tl_class' => 'clr w50',
'mandatory' => true
],
'sql' => "varchar(255) NOT NULL default ''",
],
'housenumber' => [
'inputType' => 'text',
'eval' => [
'maxlength' => 8,
'tl_class' => 'w50',
'mandatory' => true
],
'sql' => "varchar(8) NOT NULL default ''",
],
'zipcode' => [
'inputType' => 'text',
'eval' => [
'maxlength' => 5,
'tl_class' => 'w50',
'mandatory' => true,
'rgxp' => 'natural'
],
'sql' => "int(5) unsigned NULL",
],
'city' => [
'inputType' => 'text',
'eval' => [
'maxlength' => 255,
'tl_class' => 'w50',
'mandatory' => true
],
'sql' => "varchar(255) NOT NULL default ''",
],
'email' => [
'inputType' => 'text',
'eval' => [
'maxlength' => 255,
'tl_class' => 'w50',
'rgxp' => 'email'
],
'sql' => "varchar(255) NOT NULL default ''",
],
'phone_private' => [
'inputType' => 'text',
'eval' => [
'maxlength' => 32,
'tl_class' => 'w50',
'rgxp' => 'phone'
],
'sql' => "varchar(32) NOT NULL default ''",
],
'phone_work' => [
'inputType' => 'text',
'eval' => [
'maxlength' => 32,
'tl_class' => 'w50',
'rgxp' => 'phone'
],
'sql' => "varchar(32) NOT NULL default ''",
],
'fax' => [
'inputType' => 'text',
'eval' => [
'maxlength' => 32,
'tl_class' => 'w50',
'rgxp' => 'phone'
],
'sql' => "varchar(32) NOT NULL default ''",
],
'joined' => [
'inputType' => 'checkbox',
'filter' => true,
'eval' => [
'submitOnChange' => true,
'tl_class' => 'w50'
],
'sql' => "char(1) NOT NULL default ''"
],
'joindate' => [
'inputType' => 'text',
'eval' => [
'maxlength' => 255,
'tl_class' => 'w50 wizard',
'rgxp' => 'date',
'datepicker' => true
],
'sql' => "varchar(10) NOT NULL default ''"
],
'active' => [
'inputType' => 'checkbox',
'filter' => true,
'eval' => [
'submitOnChange' => true,
'tl_class' => 'w50'
],
'sql' => "char(1) NOT NULL default ''"
],
'startdate' => [
'inputType' => 'text',
'eval' => [
'maxlength' => 255,
'tl_class' => 'w50 wizard',
'rgxp' => 'date',
'datepicker' => true
],
'sql' => "varchar(10) NOT NULL default ''"
],
'archived' => [
'inputType' => 'checkbox',
'filter' => true,
'eval' => [
'submitOnChange' => true,
'tl_class' => 'w50'
],
'sql' => "char(1) NOT NULL default ''"
],
'archivedate' => [
'inputType' => 'text',
'eval' => [
'maxlength' => 255,
'tl_class' => 'w50 wizard',
'rgxp' => 'date',
'datepicker' => true
],
'sql' => "varchar(10) NOT NULL default ''"
],
'interested' => [
'inputType' => 'checkbox',
'filter' => true,
'eval' => [
'submitOnChange' => true,
'tl_class' => 'w50'
],
'sql' => "char(1) NOT NULL default ''"
],
'authorized' => [
'inputType' => 'checkbox',
'filter' => true,
'eval' => [
'submitOnChange' => true,
'tl_class' => 'w50'
],
'sql' => "char(1) NOT NULL default ''"
],
'address' => [
'inputType' => 'text'
],
'deceased' => [
'inputType' => 'checkbox',
'filter' => true,
'eval' => [
'submitOnChange' => true,
'tl_class' => 'w50'
],
'sql' => "char(1) NOT NULL default ''"
],
'deathdate' => [
'inputType' => 'text',
'eval' => [
'maxlength' => 255,
'tl_class' => 'w50 wizard',
'rgxp' => 'date',
'datepicker' => true
],
'sql' => "varchar(10) NOT NULL default ''"
]
],
'palettes' => [
'__selector__' => ['differentBirthname', 'deceased', 'archived', 'joined', 'active'],
'default' => '{title_volunteer},vid,salutation,firstname,lastname,birthdate;{title_address},street,housenumber,zipcode,city;{title_contact},phone_private,phone_work,fax,email;{title_joined},joined;{title_active},active;{title_archive},archived;{title_status},interested,authorized;{title_deceased},deceased'
],
'subpalettes' => [
'differentBirthname' => 'birthname',
'deceased' => 'deathdate',
'archived' => 'archivedate',
'joined' => 'joindate',
'active' => 'startdate'
]
];
PHP-Code:
use Contao\DC_Table;
use Contao\DataContainer;
$GLOBALS['TL_DCA']['tl_gs_volunteercontact'] = [
'config' => [
'dataContainer' => DC_TABLE::class,
'enableVersioning' => true,
'ptable' => 'tl_gs_volunteer',
'sql' => [
'keys' => [
'id' => 'primary',
'pid' => 'index'
]
]
],
'list' => [
'sorting' => [
'mode' => DataContainer::MODE_PARENT,
'headerFields' => ['vid', 'firstname', 'lastname'],
'fields' => ['contactdate'],
'flag' => DataContainer::SORT_INITIAL_LETTER_ASC,
'panelLayout' => 'filter;sort,search,limit',
'fields' => ['contactdate']
],
'label' => [
'fields' => ['contactdate', 'contactnotice'],
'showColumns' => true
],
'global_operations' => [
'all' => [
'href' => 'act=select',
'class' => 'header_edit_all',
'attributes' => 'onclick="Backend.getScrollOffset();" accesskey="e"'
],
],
'operations' => [
'edit' => [
'href' => 'act=edit',
'icon' => 'edit.svg'
],
'copy' => [
'href' => 'act=copy',
'icon' => 'copy.svg'
],
'delete' => [
'href' => 'act=delete',
'icon' => 'delete.svg',
'attributes' => 'onclick="if (!confirm(\'' . ($GLOBALS['TL_LANG']['MSC']['deleteConfirm'] ?? '') . '\')) return false; Backend.getScrollOffset();"'
],
'show' => [
'href' => 'act=show',
'icon' => 'show.svg'
],
]
],
'fields' => [
'id' => [
'sql' => "int(10) unsigned NOT NULL auto_increment",
],
'tstamp' => [
'sql' => "int(10) unsigned NOT NULL default '0'",
],
'pid' => [
'sql' => "int(10) unsigned NOT NULL default '0'",
],
'contactdate' => [
'inputType' => 'text',
'eval' => [
'maxlength' => 255,
'tl_class' => 'w50 wizard',
'rgxp' => 'date',
'datepicker' => true
],
'sql' => "varchar(10) NOT NULL default ''"
],
'contactnotice' => [
'inputType' => 'textarea',
'eval' => [
'tl_class' => 'clr'
],
'sql' => "text NULL"
],
],
'palettes' => [
'default' => '{title_volunteercontact},contactdate,contactnotice'
]
];
Lesezeichen