<?php
I have a custom CType called theme_section_columns which has children records also from the tt_content table.
The relation parent -> child is made using the field tx_theme_tt_content.
This is the configuration:
$tca = array(
.....
'types' => array(
'theme_section_columns' => array(
'showitem' => '
--palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.general;general,
--palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.headers;header,
tx_theme_tt_content,
--div--;LLL:EXT:cms/locallang_ttc.xlf:tabs.access,
--palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.visibility;visibility,
--palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.access;access,
--div--;LLL:EXT:cms/locallang_ttc.xlf:tabs.extended,
'
),
.....
'columns' => array(
'tx_theme_tt_content' => array(
'label' => 'LLL:EXT:theme/Resources/Private/Language/Backend.xlf:content_element',
'config' => array(
'type' => 'inline',
'foreign_table' => 'tt_content',
'foreign_field' => 'tx_theme_tt_content',
'appearance' => array(
'useSortable' => TRUE,
'showSynchronizationLink' => TRUE,
'showAllLocalizationLink' => TRUE,
'showPossibleLocalizationRecords' => TRUE,
'showRemovedLocalizationRecords' => FALSE,
'expandSingle' => TRUE,
'enabledControls' => array(
'localize' => TRUE,
),
),
'behaviour' => array(
'localizationMode' => 'select',
'mode' => 'select',
'localizeChildrenAtParentLocalization' => TRUE,
),
),
),
),
),
);
Everything works as expected, except one thing. In backend list module all tt_content elements are shown, including the children of theme_section_columns.
Is there a way to hide in the list module, the content elements which have a value in tx_theme_tt_content field?
The listmod extension does what I want:
http://typo3.org/extensions/repository/view/listmod
Related
I want to show a grid or editable table in my tab in the admin section
I managed to do the module and three tabs are been displayed .In one of the tab i want to show a editable grid i.e in the CHECKS tab
As shown in the below image,in the chek tab section i want to show a grid
In the constructor of my admin controller of my module ()
ie in addhealthcheckconfig\controllers\admin\HealthCheckConfigController.php
I am setting the field options to populate the tab ,below is my code:
$this->fields_options = array(
'appearance' => array(
'title' => $this->l('Manage your Health Check '),
'icon' => 'icon-html5',
'tabs' => array(
'TAB1' => $this->l('SUPPORT_GROUPS'),
'TAB2' => $this->l('CHECKS'),
'TAB3' => $this->l('REPORT RECIPIENTS'),
),
'fields' => array(
'SUPPORT_GROUPS' => array(
'title' => $this->l('SUPPORT GROUPS'),
'hint' => $this->l('Manage your Support Groups here'),
'type' => 'fields_list',
'name' => 'PS_LOGO',
'tab' => 'TAB1'
),
'CHECKS' => array(
'title' => $this->l('LIST OF AVAILABLE CHECKS '),
'hint' => $this->l('List of Available checks will be displayed here !!'),
'type' => 'text',
'list' => $this->fields_list = array(
'code' => array(
'title' => $this->l('code'),
'align' => 'text-center',
'remove_onclick' => true,
'search' => false,
),
'description' => array(
'title' => $this->l('description'),
'align' => 'text-center',
'remove_onclick' => true,
'search' => false,
),
'category' => array(
'title' => $this->l('category'),
'align' => 'text-center',
'remove_onclick' => true,
'search' => false,
),
),
'tab' => 'TAB2'
),
'REPORT_RECIPIENTS' => array(
'title' => $this->l('REPORT RECIPIENTS '),
'hint' => $this->l('List of Available checks will be displayed here !!'),
'tab' => 'TAB3'
),
) ));
In the TAB2 Section i am not sure what i need to put in the 'type' section , I tried with list , but yet I can not achieve what I am trying to do , also i am not sure how to assign the $this->fields_list to that type correctly
How to achieve this editable db grid in my tab ?
First of all excuse my bad english.
I got a problem with my select-field in the BE. I would like to prefill (preselect) all of the available items.
Code in ext_tables.php:
'teilnehmer' => array(
'exclude' => 0,
'label' => 'LLL:EXT:kiwanisext/Resources/Private/Language/locallang_db.xlf:tx_kiwanisext_domain_model_veranstaltung.teilnehmer',
'config' => array(
'type' => 'select',
'foreign_table' => 'fe_users',
'MM' => 'tx_kiwanisext_veranstaltung_user_mm',
'size' => 10,
'autoSizeMax' => 30,
'maxitems' => 9999,
'multiple' => 0,
'wizards' => array(
'_PADDING' => 1,
'_VERTICAL' => 1,
'edit' => array(
'type' => 'popup',
'title' => 'Edit',
'script' => 'wizard_edit.php',
'icon' => 'edit2.gif',
'popup_onlyOpenIfSelected' => 1,
'JSopenParams' => 'height=350,width=580,status=0,menubar=0,scrollbars=1',
),
'add' => Array(
'type' => 'script',
'title' => 'Create new',
'icon' => 'add.gif',
'params' => array(
'table' => 'fe_users',
'pid' => '###CURRENT_PID###',
'setValue' => 'prepend'
),
'script' => 'wizard_add.php',
),
),
),
),
I found nothing helpful in the documentation.
Any hint, tip or help will be much appreciated!
Its not possible to do that with plain TCA config, afaik. You can however define a default value wich will be selected (if none is defines, 1st item will be selected).
'default' => 'myValue'
But to preselect multiple values at once, you have to use JavaScript I guess.
This code worked for me in typo3 6.2. I have a selectbox filled with database records.
I want the records with ID's 1 ans 2 to be preselected in the selectbox:
'thematique' => array(
'exclude' => 0,
'label' => 'LLL:EXT:dk_actus/locallang_db.xml:tx_dkactus_thematique',
'config' => array(
'type' => 'select',
'foreign_table' => 'tx_dkactus_thematique',
'foreign_table_where' => 'ORDER BY tx_dkactus_thematique.uid',
'size' => 10,
'minitems' => 0,
'maxitems' => 99,
'default' => '1,2',
),
),
In orangehrm3.1 I want to customize view leave request page. If leave request day is greater than 3 I need to hide Actions list box for supervisor.
How do I do this?
Currently editing in LeaveListConfigurationFactory.php
$leaveRequestService = new LeaveRequestService();
$header7->populateFromArray(array(
'name' => 'Actions',
'width' => '10%',
'isSortable' => false,
'isExportable' => false,
'elementType' => 'leaveListAction',
'textAlignmentStyle' => 'left',
'elementProperty' => array(
'classPattern' => 'select_action quotaSelect',
'defaultOption' => array('label' => 'Select Action', 'value' => ''),
'hideIfEmpty' => true,
'options' => array($leaveRequestService, 'getLeaveRequestActions', array(self::RECORD, self::$loggedInEmpNumber)),
'namePattern' => 'select_leave_action_{id}',
'idPattern' => 'select_leave_action_{id}',
'hasHiddenField' => true,
'hiddenFieldName' => '{eimId}-{leaveTypeId}',
'hiddenFieldId' => '{eimId}-{leaveTypeId}',
'hiddenFieldValueGetter' => 'getNumberOfDays',
'hiddenFieldClass' => 'quotaHolder',
'placeholderGetters' => array(
'id' => 'getId',
'eimId' => 'getEmpNumber',
'leaveTypeId' => 'getLeaveTypeId'
),
),
));
I'm trying to add a mass action to Customer grid to set a customer group (which will simulate subgroups) but the group assignment will have a limited time period.
I'm using Magento ver. 1.4.2.0.
In Customer grid definiton (in my class which extends Mage_Adminhtml_Block_Customer_Grid) I'm adding mass action like this:
/*...*/
$this->getMassactionBlock()->addItem('set_subgroup', array(
'label' => Mage::helper('customersubgroup')->__('Set Customer Subgroup'),
'url' => $this->getUrl('adminhtml/customersubgroup/massSetSubgroup'),
'additional' => array(
'subgroup' => array(
'name' => 'subgroup',
'type' => 'select',
'class' => 'required-entry',
'label' => Mage::helper('customer')->__('Group'),
'values' => $subgroups
),
'valid_from' => array(
'name' => 'valid_from',
'type' => 'date',
'class' => 'required-entry',
'label' => Mage::helper('customersubgroup')->__('Valid From'),
'gmtoffset' => true,
'format' => '%d.%m.%Y'
),
'valid_to' => array(
'name' => 'valid_to',
'type' => 'date',
'class' => 'required-entry',
'label' => Mage::helper('customersubgroup')->__('Valid To'),
'gmtoffset' => true,
'format' => '%d.%m.%Y'
)
)
));
/*...*/
There should be a customer group selectbox and two date fields as additional parameters of this mass action.
The date fields are rendered as text inputs but without a datepicker functionality (no calendar icon). Is it possible to add this functionality somehow?
Thanks in advance.
I should probably shoot myself to the head right now. I've forgotten the image property in item definition:
/*...*/
$this->getMassactionBlock()->addItem('set_subgroup', array(
'label' => Mage::helper('customersubgroup')->__('Set Customer Subgroup'),
'url' => $this->getUrl('adminhtml/customersubgroup/massSetSubgroup'),
'additional' => array(
'subgroup' => array(
'name' => 'subgroup',
'type' => 'select',
'class' => 'required-entry',
'label' => Mage::helper('customer')->__('Group'),
'values' => $subgroups
),
'valid_from' => array(
'name' => 'valid_from',
'type' => 'date',
'class' => 'required-entry',
'label' => Mage::helper('customersubgroup')->__('Valid From'),
'gmtoffset' => true,
'image' => '/skin/adminhtml/default/default/images/grid-cal.gif',
'format' => '%d.%m.%Y'
),
'valid_to' => array(
'name' => 'valid_to',
'type' => 'date',
'class' => 'required-entry',
'label' => Mage::helper('customersubgroup')->__('Valid To'),
'gmtoffset' => true,
'image' => '/skin/adminhtml/default/default/images/grid-cal.gif',
'format' => '%d.%m.%Y'
)
)
));
/*...*/
So YES, it is possible.
For the title field,I want to return node.title,but what I tried is not working:
return array('og' => array('name' => 'og',
'join' => array('left' => array('table' => 'node',
'field' => 'nid'
),
'right' => array('field' => 'nid'
),
),
'fields' => array(
'title' => array('name' => t('OG: Group: Group name'),
'table' => 'node',
'handler' => 'og_handler_field_title',
'help' => t('show group name.'),
'sortable' => true,
'sort_handler' => 'views_og_query_ogname',
'notafield' => false,
),
I haven't used views for Drupal 5, so I might be a bit off. But when you make a join on the node, you shouldn't actually need to create the node title field yourself. You should instead be able get it directly from the node table like you would for a normal node.
Your field declarations should only be for the fields you have in the table you want to integrate into views.