<?php
/**
* This file is part of contao-weinanlieferung-bundle.
*
* (c) vonRotenberg
*
* @license commercial
*/
use Contao\DC_Table;
use Contao\DataContainer;
$GLOBALS['TL_DCA']['tl_vr_wa_standort'] = array
(
// Config
'config' => array
(
'dataContainer' => DC_Table::class,
'ctable' => array('tl_vr_wa_slot','tl_vr_wa_slottypes'),
'enableVersioning' => true,
'sql' => array
(
'keys' => array
(
'id' => 'primary'
)
)
),
// List
'list' => array
(
'sorting' => array
(
'mode' => DataContainer::MODE_SORTABLE,
'fields' => array('title'),
'flag' => DataContainer::SORT_INITIAL_LETTER_ASC,
'panelLayout' => 'sort,search,limit'
),
'label' => array(
'fields' => array('title'),
'format' => '%s'
),
'global_operations' => array
(
/*'rebsorte' => array
(
'href' => 'table=tl_vr_wa_rebsorte',
'class' => 'header_rebsorte',
),
'leseart' => array
(
'href' => 'table=tl_vr_wa_leseart',
'class' => 'header_leseart',
),
'lage' => array
(
'href' => 'table=tl_vr_wa_lage',
'class' => 'header_lage',
),*/
'all' => array
(
'href' => 'act=select',
'class' => 'header_edit_all',
'attributes' => 'onclick="Backend.getScrollOffset()" accesskey="e"'
)
),
'operations' => array
(
'edit' => array
(
'href' => 'table=tl_vr_wa_slot',
'icon' => '/bundles/vonrotenbergweinanlieferung/images/icons/calendar.svg',
),
'slottypes' => array
(
'href' => 'table=tl_vr_wa_slottypes',
'icon' => '/bundles/vonrotenbergweinanlieferung/images/icons/stack.svg',
),
'editheader' => array
(
'href' => 'table=tl_vr_wa_standort&act=edit',
'icon' => 'header.svg'
),
'copy' => array
(
'href' => 'act=paste&mode=copy',
'icon' => 'copy.svg'
),
'cut' => array
(
'href' => 'act=paste&mode=cut',
'icon' => 'cut.svg',
'attributes' => 'onclick="Backend.getScrollOffset()"'
),
'delete' => array
(
'href' => 'act=delete',
'icon' => 'delete.gif',
),
'show' => array
(
'icon' => 'show.gif',
),
)
),
// Palettes
'palettes' => array
(
'__selector__' => ['nc_enable'],
'default' => '{title_legend},title;{units_legend},units,disable_base_unit;{notification_legend},nc_enable'
),
// Subpalettes
'subpalettes' => array
(
'nc_enable' => 'nc_notification,nc_notification_slots,nc_notification_groups'
),
// Fields
'fields' => array
(
'id' => array
(
'sql' => "int(10) unsigned NOT NULL auto_increment"
),
'tstamp' => array
(
'sql' => "int(10) unsigned NOT NULL default 0"
),
'title' => array
(
'exclude' => true,
'sorting' => true,
'flag' => DataContainer::SORT_INITIAL_LETTER_ASC,
'inputType' => 'text',
'eval' => array
(
'mandatory' => true,
'maxlength' => 255
),
'sql' => "varchar(255) NOT NULL default ''"
),
'units' => array
(
'exclude' => true,
'inputType' => 'checkbox',
'foreignKey' => "tl_vr_wa_units.title",
'eval' => array
(
'mandatory' => false,
'multiple' => true,
'tl_class' => 'clr w50'
),
'sql' => "blob NULL",
'relation' => array
(
'type' => 'hasMany',
'load' => 'lazy'
)
),
'disable_base_unit' => array
(
'exclude' => true,
'inputType' => 'checkbox',
'eval' => array('tl_class'=>'w50'),
'sql' => "char(1) NOT NULL default ''"
),
'nc_enable' => array
(
'exclude' => true,
'inputType' => 'checkbox',
'eval' => array('tl_class'=>'clr w50 m12','submitOnChange'=>true),
'sql' => "char(1) NOT NULL default ''"
),
'nc_notification' => array
(
'exclude' => true,
'inputType' => 'select',
'eval' => array('mandatory'=>false,'includeBlankOption'=>true, 'chosen'=>true, 'tl_class'=>'w50'),
'sql' => "int(10) unsigned NOT NULL default '0'"
),
'nc_notification_slots' => array
(
'exclude' => true,
'inputType' => 'select',
'eval' => array('mandatory'=>false,'includeBlankOption'=>true, 'chosen'=>true, 'tl_class'=>'w50'),
'sql' => "int(10) unsigned NOT NULL default '0'"
),
'nc_notification_groups' => array
(
'exclude' => true,
'inputType' => 'checkbox',
'foreignKey' => 'tl_member_group.name',
'eval' => array('mandatory'=>true, 'multiple'=>true,'tl_class'=>'clr'),
'sql' => "blob NULL",
'relation' => array('type'=>'hasMany', 'load'=>'lazy')
)
)
);