Exemplo n.º 1
0
 /**
  * Function that returns all the fields for the module
  * @return <Array of Vtiger_Field_Model> - list of field models
  */
 public function getFields()
 {
     if (empty($this->fields)) {
         $fieldList = array();
         $blocks = $this->getBlocks();
         $blockId = array();
         foreach ($blocks as $block) {
             //to skip events hardcoded block id
             if ($block->get('id') == 'EVENT_INVITE_USER_BLOCK_ID') {
                 continue;
             }
             $blockId[] = $block->get('id');
         }
         if (count($blockId) > 0) {
             $fieldList = Settings_LayoutEditor_Field_Model::getInstanceFromBlockIdList($blockId, $moduleModel);
         }
         //To handle special case for invite users
         if ($this->getName() == 'Events') {
             $blockModel = new Settings_LayoutEditor_Block_Model();
             $blockModel->set('id', 'EVENT_INVITE_USER_BLOCK_ID');
             $blockModel->set('label', 'LBL_INVITE_USER_BLOCK');
             $blockModel->set('module', $this);
             $fieldModel = new Settings_LayoutEditor_Field_Model();
             $fieldModel->set('name', 'selectedusers');
             $fieldModel->set('label', 'LBL_INVITE_USERS');
             $fieldModel->set('block', $blockModel);
             $fieldModel->setModule($this);
             $fieldList[] = $fieldModel;
         }
         $this->fields = $fieldList;
     }
     return $this->fields;
 }