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'
),
),
));
Related
I want to show marketplace dropdown name in magento grid but what i write in my code that display marketplace value.Bellow is my code
protected function _prepareColumns()
{
$this->addColumn('marketplace', array(
'header' => Mage::helper('adminhtml')->__('Marketplace'),
'align' =>'right',
'width' => '10px',
'index' => 'marketplace',
));
$this->addColumn('action',
array(
'header' => Mage::helper('adminhtml')->__('Action'),
'width' => '100px',
'type' => 'action',
'getter' => 'getId',
'actions' => array(array(
'caption' => Mage::helper('adminhtml')->__('Edit'),
'url' => array('base' => '*/*/edit'),
'field' => 'id'
)),
'filter' => false,
'sortable' => false,
'index' => 'id',
));
return parent::_prepareColumns();
}
could anyone please point out what i am doing wrong as i do not have much experience in magento.
Thanking you all in advance
add field type for market place like...
$this->addColumn('marketplace', array(
'header' => Mage::helper('adminhtml')->__('Marketplace'),
'align' =>'right',
'width' => '10px',
'index' => 'marketplace'
'type' => 'options',
'options' => array(
6 => '6',
5 => '4',
4 => '4',
3 => '3',
2 => '2',
1 => '1'
),
));
How can i create one-to-many relationship with my custom module. And add subpanel to Campaign module
Campaign vardefs
$dictionary["Campaign"]["fields"]["costs"] =
array (
'name' => 'costs',
'type' => 'link',
'relationship' => 'campaign_costs',
'module'=>'Costs',
'bean_name'=>'Costs',
'source'=>'non-db',
'vname'=>'LBL_AUCTIONS',
);
$dictionary['Campaign']['relationships']['campaign_costs'] =
array (
'lhs_module'=> 'Campaigns',
'lhs_table'=> 'campaigns',
'lhs_key' => 'id',
'rhs_module'=> 'Costs',
'rhs_table'=> 'cots',
'rhs_key' => 'campaign_id',
'relationship_type'=>'one-to-many'
);
layout_defs properties
$layout_defs["Campaigns"]["subpanel_setup"]["campaign_costs"] = array (
'order' => 2,
'module' => 'Costs',
'subpanel_name' => 'default',
'sort_order' => 'desc',
'sort_by' => 'date_entered',
'title_key' => 'LBL_SUBPANEL_COSTS',
'get_subpanel_data' => 'costs', //имя поля link
'top_buttons' =>
array (
0 =>
array (
'widget_class' => 'SubPanelTopButtonQuickCreate',
),
1 =>
array (
'widget_class' => 'SubPanelTopSelectButton',
'mode' => 'MultiSelect',
),
),
);
Custom module vardefs
$dictionary['Costs']['fields']['campaign_id'] =
array (
'required' => false,
'name' => 'campaign_id',
'vname' => '',
'type' => 'id',
'massupdate' => 0,
'importable' => 'true',
'audited' => 0,
'len' => 36,
);
$dictionary['Costs']['fields']['campaign_name'] =
array (
'required' => false,
'source' => 'non-db',
'name' => 'campaign_name',
'vname' => 'LBL_CAMPAIGN_NAME',
'type' => 'relate',
'massupdate' => 0,
'comments' => '',
'help' => '',
'audited' => 1,
'len' => '100',
'id_name' => 'campaign_id',
'ext2' => 'Campaigns',
'module' => 'Campaigns',
'rname' => 'name',
'studio' => 'visible',
);
The relationship is added, but subpanel doesn't appear at campaigns module.
In your $dictionary["Campaign"]["fields"]["costs"], change bean_name from Costs to Cost.
I take it you have enabled the subpanel in the admin-menu? (index.php?module=Administration&action=ConfigureTabs)
Does your error-logs say anything?
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',
),
),
I'm having issues generating a stacked bar chart using drupal cms.
I'm making use of this api to generate chart
(https://drupal.org/project/google_chart_tools)
as shown:
> $settings['chart']['chartOne'] = array(
>
'header' => array('Teachers', 'Student'),
'rows' => array(array(20, 100)),
'columns' => array('people'),
'chartType' => 'BarChart',
'containerId' => 'content1',
'options' => array(
'forceIFrame' => FALSE,
'title' => 'School',
'width' => 800,
'height' => 400,
'isstacked' => TRUE
)
how can i make it on the chart such that?
example :
10 out of 20 teachers are male and the other 10 are female
50 out of 100 students are male and the other 50 are female
Tried modifying the following and getting only teachers but empty students:
> $settings['chart']['chartOne'] = array(
>
'header' => array('Teachers', 'Students'),
'rows' => array(array(10),array(10)), array(array(50),array(50)),
'columns' => array('Male', 'Female'),
'chartType' => 'BarChart',
'containerId' => 'content1',
'options' => array(
'forceIFrame' => FALSE,
'title' => 'School',
'width' => 800,
'height' => 400,
'isstacked' => TRUE
)
Output Results : http://i.stack.imgur.com/V86qQ.png
Answer from the OP which was originally posted into the question
$settings['chart']['chartOne'] = array(
'header' => array('Teachers', 'Students'),
'rows' => array(array(10,50),array(10,50)),
'columns' => array('Male', 'Female'),
'chartType' => 'BarChart',
'containerId' => 'content1',
'options' => array(
'forceIFrame' => FALSE,
'title' => 'School',
'width' => 800,
'height' => 400,
'isstacked' => TRUE
)
I'm trying to force the CJuiDatepicker to hide after I select the date. Nothing works. How could I achieve it?
Here's my actual code:
$this->widget('zii.widgets.jui.CJuiDatePicker', array(
'model' => $model,
'attribute' => 'confirmStart',
'options' => array(
'format' => 'yyyy-mm-dd',
'showButtonPanel' => false,
'onSelect' => 'js:function() {
$("#Projects_confirmStart").datepicker("hide");
}
',
),
));
It is working fine in my test Yii app. Check your program with mozilla firebug. You may get error in console when you select the date. May be your datepicker functionality is effecting by some other plugins/scripts.
This work for me.
$this->widget('zii.widgets.jui.CJuiDatePicker', array(
'model' => $model,
'attribute' => 'fechaAdq',
'language' => 'es',
'i18nScriptFile' => 'jquery-ui-i18n.min.js',
'htmlOptions' => array(
'id' => 'FMAIDetalleAdq_fechaAdq',
'size' => '10', * *'onChange' => 'jQuery("#FMAIDetalleAdq_fechaAdq").datepicker("hide")' * *
) ,
'defaultOptions' => array(
'showOn' => 'focus',
'showOtherMonths' => true,
'selectOtherMonths' => true,
'changeMonth' => true,
'changeYear' => true,
'showButtonPanel' => true,
) ,
'options' => array(
'showAnim' => 'fold',
'format' => 'dd-mm-yyyy',
'language' => 'es',
) ,
) , true);