Skip to content
Snippets Groups Projects
Commit 07fb2af6 authored by Uma's avatar Uma
Browse files

Merge branch 'Add_Event_columns_into_customview' into 'master'

Add event columns into customview

It's not possible to select Events columns to calendar list view.
Add Event columns to list custom view definition

See merge request !600
parents 84d66819 f284ab09
No related branches found
No related tags found
No related merge requests found
......@@ -41,6 +41,25 @@ class Calendar_FilterRecordStructure_Model extends Vtiger_FilterRecordStructure_
}
}
$eventsModuleModel = Vtiger_Module_Model::getInstance('Events');
$eventsStructureModel = Vtiger_RecordStructure_Model::getInstanceForModule($eventsModuleModel, Vtiger_RecordStructure_Model::RECORD_STRUCTURE_MODE_FILTER);
$blockModelList = $eventsStructureModel->getModule()->getBlocks();
foreach ($blockModelList as $blockLabel => $blockModel) {
$fieldModelList = $blockModel->getFields();
if ($fieldModelList) {
$values[vtranslate($blockLabel, 'Events')] = array();
foreach ($fieldModelList as $fieldName => $fieldModel) {
if ($fieldModel->isViewableInFilterView()) {
$newFieldModel = clone $fieldModel;
if ($recordExists) {
$newFieldModel->set('fieldvalue', $recordModel->get($fieldName));
}
$values[vtranslate($blockLabel, 'Events')][$fieldName] = $newFieldModel;
}
}
}
}
//All the reference fields should also be sent
$fields = $moduleModel->getFieldsByType(array('reference'));
foreach ($fields as $parentFieldName => $field) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment