src/Rhyme/WMassArtsHub/Resources/contao/dca/tl_artshub_submission_space.php line 330

Open in your IDE?
  1. <?php
  2. /**
  3.  * Copyright (c) 2020 Rhyme Digital LLC (https://rhyme.digital)
  4.  *
  5.  * @license LGPL-3.0-or-later
  6.  */
  7. namespace {
  8.     use Rhyme\WMassArtsHub\Backend\SubmissionSpace\Callbacks;
  9.     use Contao\System;
  10.     System::loadLanguageFile('default');
  11.     /**
  12.      * Table tl_artshub_submission_space
  13.      */
  14.     $GLOBALS['TL_DCA']['tl_artshub_submission_space'] = array
  15.     (
  16.         // Config
  17.         'config' => array
  18.         (
  19.             'dataContainer'               => 'Table',
  20.             'enableVersioning'            => true,
  21.             'sql' => array
  22.             (
  23.                 'keys' => array
  24.                 (
  25.                     'id' => 'primary',
  26.                 )
  27.             )
  28.         ),
  29.         // List
  30.         'list' => array
  31.         (
  32.             'sorting' => array
  33.             (
  34.                 'mode'                    => 2,
  35.                 'flag'                    => 8,
  36.                 'fields'                  => ['space_available_date'],
  37.                 'panelLayout'             => 'sort,filter;search,limit'
  38.             ),
  39.             'label' => array
  40.             (
  41.                 'fields'                  => array('title'),
  42.                 'format'                  => '%s'
  43.             ),
  44.             'global_operations' => array
  45.             (
  46.                 'all' => array
  47.                 (
  48.                     'label'               => &$GLOBALS['TL_LANG']['MSC']['all'],
  49.                     'href'                => 'act=select',
  50.                     'class'               => 'header_edit_all',
  51.                     'attributes'          => 'onclick="Backend.getScrollOffset()" accesskey="e"'
  52.                 )
  53.             ),
  54.             'operations' => array
  55.             (
  56.                 'edit' => array
  57.                 (
  58.                     'label'               => &$GLOBALS['TL_LANG']['tl_artshub_submission_space']['edit'],
  59.                     'href'                => 'act=edit',
  60.                     'icon'                => 'edit.gif'
  61.                 ),
  62.                 'copy' => array
  63.                 (
  64.                     'label'               => &$GLOBALS['TL_LANG']['tl_artshub_submission_space']['copy'],
  65.                     'href'                => 'act=copy',
  66.                     'icon'                => 'copy.gif',
  67.                 ),
  68.                 'cut' => array
  69.                 (
  70.                     'label'               => &$GLOBALS['TL_LANG']['tl_page']['cut'],
  71.                     'href'                => 'act=paste&amp;mode=cut',
  72.                     'icon'                => 'cut.svg',
  73.                     'attributes'          => 'onclick="Backend.getScrollOffset()"',
  74.                 ),
  75.                 'delete' => array
  76.                 (
  77.                     'label'               => &$GLOBALS['TL_LANG']['tl_artshub_submission_space']['delete'],
  78.                     'href'                => 'act=delete',
  79.                     'icon'                => 'delete.gif',
  80.                     'attributes'          => 'onclick="if(!confirm(\'' $GLOBALS['TL_LANG']['MSC']['deleteConfirm'] . '\'))return false;Backend.getScrollOffset()"',
  81.                 ),
  82.                 'toggle' => array
  83.                 (
  84.                     'label'               => &$GLOBALS['TL_LANG']['tl_artshub_submission_space']['toggle'],
  85.                     'icon'                => 'visible.svg',
  86.                     'attributes'          => 'onclick="Backend.getScrollOffset();return AjaxRequest.toggleVisibility(this,%s)"',
  87.                     'button_callback'     => array(Callbacks::class, 'toggleIcon')
  88.                 ),
  89.                 'show' => array
  90.                 (
  91.                     'label'               => &$GLOBALS['TL_LANG']['tl_artshub_submission_space']['show'],
  92.                     'href'                => 'act=show',
  93.                     'icon'                => 'show.gif'
  94.                 )
  95.             )
  96.         ),
  97.         // Palettes
  98.         'palettes' => array
  99.         (
  100.             'default'                     => '{general_legend},title,alias,submissionDate,space_type,submitted_by,status;{details_legend},description,space_price,space_size,space_available_date,profiles;{contact_legend},contact_name,contact_phone,contact_email,contact_url;{location_legend},street,street_2,city,state,postal,latitude,longitude;{images_legend},images;{publishing_legend},published,start,stop;'
  101.         ),
  102.         // Subpalettes
  103.         'subpalettes' => array
  104.         (
  105.         ),
  106.         // Fields
  107.         'fields' => array
  108.         (
  109.             'id' => array
  110.             (
  111.                 'sql'                     => "int(10) unsigned NOT NULL auto_increment"
  112.             ),
  113.             'tstamp' => array
  114.             (
  115.                 'sql'                     => "int(10) unsigned NOT NULL default '0'"
  116.             ),
  117.             'lead_id' => array
  118.             (
  119.                 'sql'                     => "int(10) unsigned NOT NULL default '0'"
  120.             ),
  121.             'submissionDate' => array
  122.             (
  123.                 'exclude'                 => true,
  124.                 'inputType'               => 'text',
  125.                 'eval'                    => array('rgxp'=>'date''mandatory'=>true'doNotCopy'=>true'datepicker'=>true'tl_class'=>'w50 wizard'),
  126.                 'sql'                     => "int(10) unsigned NULL"
  127.             ),
  128.             'title' => array
  129.             (
  130.                 'exclude'                 => true,
  131.                 'search'                  => true,
  132.                 'inputType'               => 'text',
  133.                 'eval'                    => array('mandatory'=>true'maxlength'=>255'tl_class'=>'w50'),
  134.                 'sql'                     => "varchar(255) NOT NULL default ''"
  135.             ),
  136.             'alias' => array
  137.             (
  138.                 'exclude'                 => true,
  139.                 'inputType'               => 'text',
  140.                 'eval'                    => array('rgxp'=>'alias''doNotCopy'=>true'maxlength'=>128'tl_class'=>'w50'),
  141.                 'save_callback' => array
  142.                 (
  143.                     array(Callbacks::class, 'generateAlias')
  144.                 ),
  145.                 'sql'                     => "varchar(128) BINARY NOT NULL default ''"
  146.             ),
  147.             'space_type' => array
  148.             (
  149.                 'exclude' => true,
  150.                 'default' => '',
  151.                 'filter' => true,
  152.                 'inputType' => 'select',
  153.                 'options' => array('space_needed''space_available'),
  154.                 'reference' => $GLOBALS['TL_LANG']['tl_artshub_submission_space'],
  155.                 'eval' => array('tl_class' => 'w50 clr'),
  156.                 'sql' => "varchar(32) NOT NULL default ''"
  157.             ),
  158.             'submitted_by' => array
  159.             (
  160.                 'exclude' => true,
  161.                 'search' => true,
  162.                 'inputType' => 'text',
  163.                 'eval' => array('doNotCopy' => true'tl_class' => 'w50 clr'),
  164.                 'sql' => "varchar(255) NOT NULL default ''",
  165.             ),
  166.             'status' => array
  167.             (
  168.                 'exclude' => true,
  169.                 'default' => '',
  170.                 'filter' => true,
  171.                 'inputType' => 'select',
  172.                 'options' => array('''approved''rejected'),
  173.                 'reference' => $GLOBALS['TL_LANG']['MSC']['status_options'],
  174.                 'eval' => array('tl_class' => 'w50''readonly' => true'disabled' => true),
  175.                 'sql' => "varchar(32) NOT NULL default ''"
  176.             ),
  177.             'profiles' => array
  178.             (
  179.                 'exclude' => true,
  180.                 'search' => true,
  181.                 'filter' => true,
  182.                 'inputType' => 'artshubProfileItemSelector',
  183.                 'foreignKey' => 'tl_artshub_profile_item.name',
  184.                 'eval' => array('multiple' => true'chosen' => true'includeBlankOption' => true'tl_class' => 'w50'),
  185.                 'sql' => "blob NULL",
  186.                 'relation' => array('type' => 'hasMany''load' => 'lazy'),
  187.             ),
  188.             'contact_name' => array
  189.             (
  190.                 'exclude' => true,
  191.                 'search' => true,
  192.                 'inputType' => 'text',
  193.                 'eval' => array('maxlength' => 255'tl_class' => 'w50'),
  194.                 'sql' => "varchar(128) NOT NULL default ''"
  195.             ),
  196.             'contact_phone' => array
  197.             (
  198.                 'exclude' => true,
  199.                 'search' => true,
  200.                 'inputType' => 'text',
  201.                 'eval' => array('maxlength' => 255'tl_class' => 'w50'),
  202.                 'sql' => "varchar(32) NOT NULL default ''"
  203.             ),
  204.             'contact_email' => array
  205.             (
  206.                 'exclude' => true,
  207.                 'search' => true,
  208.                 'inputType' => 'text',
  209.                 'eval' => array('maxlength' => 255'tl_class' => 'w50'),
  210.                 'sql' => "varchar(255) NOT NULL default ''"
  211.             ),
  212.             'contact_url' => array
  213.             (
  214.                 'exclude' => true,
  215.                 'search' => true,
  216.                 'inputType' => 'text',
  217.                 'eval' => array('maxlength' => 255'tl_class' => 'w50'),
  218.                 'sql' => "varchar(255) NOT NULL default ''"
  219.             ),
  220.             'space_price' => array
  221.             (
  222.                 'exclude' => true,
  223.                 'search' => true,
  224.                 'inputType' => 'text',
  225.                 'eval' => array('maxlength' => 255'tl_class' => 'w50'),
  226.                 'sql' => "varchar(32) NOT NULL default ''"
  227.             ),
  228.             'space_size' => array
  229.             (
  230.                 'exclude' => true,
  231.                 'search' => true,
  232.                 'inputType' => 'text',
  233.                 'eval' => array('maxlength' => 255'tl_class' => 'w50'),
  234.                 'sql' => "varchar(32) NOT NULL default ''"
  235.             ),
  236.             'space_available_date' => array
  237.             (
  238.                 'exclude'                 => true,
  239.                 'inputType'               => 'text',
  240.                 'eval'                    => array('rgxp'=>'date''datepicker'=>true'tl_class'=>'w50 wizard'),
  241.                 'sql'                     => "int(10) unsigned NULL"
  242.             ),
  243.             'description' => array
  244.             (
  245.                 'exclude'                 => true,
  246.                 'search'                  => true,
  247.                 'inputType'               => 'textarea',
  248.                 'eval'                    => array('mandatory'=>true'rte'=>'tinyMCE''helpwizard'=>true),
  249.                 'attributes'              => array('fe_search'=>true),
  250.                 'explanation'             => 'insertTags',
  251.                 'sql'                     => "mediumtext NULL"
  252.             ),
  253.             'street' => array
  254.             (
  255.                 'exclude'                 => true,
  256.                 'search'                  => true,
  257.                 'inputType'               => 'text',
  258.                 'eval'                    => array('maxlength'=>255'tl_class'=>'w50'),
  259.                 'sql'                     => "varchar(255) NOT NULL default ''"
  260.             ),
  261.             'postal' => array
  262.             (
  263.                 'exclude'                 => true,
  264.                 'search'                  => true,
  265.                 'inputType'               => 'text',
  266.                 'eval'                    => array('maxlength'=>32,  'tl_class'=>'w50'),
  267.                 'sql'                     => "varchar(32) NOT NULL default ''"
  268.             ),
  269.             'city' => array
  270.             (
  271.                 'exclude'                 => true,
  272.                 'filter'                  => true,
  273.                 'search'                  => true,
  274.                 'sorting'                 => true,
  275.                 'inputType'               => 'text',
  276.                 'default'                 => '',
  277.                 'eval'                    => array('maxlength'=>255'tl_class'=>'w50'),
  278.                 'sql'                     => "varchar(255) NOT NULL default ''"
  279.             ),
  280.             'county' => array
  281.             (
  282.                 'exclude'                 => true,
  283.                 'filter'                  => true,
  284.                 'search'                  => true,
  285.                 'sorting'                 => true,
  286.                 'inputType'               => 'text',
  287.                 'default'                 => '',
  288.                 'eval'                    => array('maxlength'=>255'tl_class'=>'w50'),
  289.                 'sql'                     => "varchar(255) NOT NULL default ''"
  290.             ),
  291.             'state' => array
  292.             (
  293.                 'exclude'                 => true,
  294.                 'sorting'                 => true,
  295.                 'inputType'               => 'text',
  296.                 'default'                 => 'MA',
  297.                 'eval'                    => array('maxlength'=>2'tl_class'=>'w50'),
  298.                 'sql'                     => "varchar(2) NOT NULL default ''"
  299.             ),
  300.             'latitude' => array
  301.             (
  302.                 'exclude'                 => true,
  303.                 'search'                  => true,
  304.                 'inputType'               => 'text',
  305.                 'eval'                    => array('maxlength'=>255'tl_class'=>'w50' ),
  306.                 'sql'                     => "varchar(255) NOT NULL default ''"
  307.             ),
  308.             'longitude' => array
  309.             (
  310.                 'exclude'                 => true,
  311.                 'search'                  => true,
  312.                 'inputType'               => 'text',
  313.                 'eval'                    => array('maxlength'=>255'tl_class'=>'w50' ),
  314.                 'sql'                     => "varchar(255) NOT NULL default ''"
  315.             ),
  316.             'images' => array
  317.             (
  318.                 'exclude'                 => true,
  319.                 'inputType'               => 'fileTree',
  320.                 'eval'                    => array('multiple'=>true'fieldType'=>'checkbox''orderField'=>'orderImages''files'=>true'isGallery'=>true'extensions'=>\Contao\Config::get('validImageTypes'), 'tl_class'=>'clr''path'=>\Contao\Config::get('uploadPath').'/media'),
  321.                 'sql'                     => "blob NULL",
  322.             ),
  323.             'orderImages' => array
  324.             (
  325.                 'label'                   => &$GLOBALS['TL_LANG']['MSC']['sortOrder'],
  326.                 'sql'                     => "blob NULL"
  327.             ),
  328.             'published' => array
  329.             (
  330.                 'exclude'                 => true,
  331.                 'filter'                  => true,
  332.                 'inputType'               => 'checkbox',
  333.                 'eval'                    => array('tl_class'=>'w50 m12'),
  334.                 'sql'                     => "char(1) NOT NULL default ''"
  335.             ),
  336.             'start' => array
  337.             (
  338.                 'exclude'                 => true,
  339.                 'inputType'               => 'text',
  340.                 'eval'                    => array('rgxp'=>'datim''datepicker'=>true'tl_class'=>'clr w50 wizard'),
  341.                 'sql'                     => "varchar(10) NOT NULL default ''"
  342.             ),
  343.             'stop' => array
  344.             (
  345.                 'exclude'                 => true,
  346.                 'inputType'               => 'text',
  347.                 'eval'                    => array('rgxp'=>'datim''datepicker'=>true'tl_class'=>'w50 wizard'),
  348.                 'sql'                     => "varchar(10) NOT NULL default ''"
  349.             ),
  350.         )
  351.     );
  352. }