當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Vtiger_DetailView_Model::getWidgets方法代碼示例

本文整理匯總了PHP中Vtiger_DetailView_Model::getWidgets方法的典型用法代碼示例。如果您正苦於以下問題:PHP Vtiger_DetailView_Model::getWidgets方法的具體用法?PHP Vtiger_DetailView_Model::getWidgets怎麽用?PHP Vtiger_DetailView_Model::getWidgets使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Vtiger_DetailView_Model的用法示例。


在下文中一共展示了Vtiger_DetailView_Model::getWidgets方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getWidgets

 /**
  * Function to get the detail view widgets
  * @return <Array> - List of widgets , where each widget is an Vtiger_Link_Model
  */
 public function getWidgets()
 {
     $userPrivilegesModel = Users_Privileges_Model::getCurrentUserPrivilegesModel();
     $widgetLinks = parent::getWidgets();
     $widgets = array();
     $helpDeskInstance = Vtiger_Module_Model::getInstance('HelpDesk');
     if ($userPrivilegesModel->hasModuleActionPermission($helpDeskInstance->getId(), 'DetailView')) {
         $createPermission = $userPrivilegesModel->hasModuleActionPermission($helpDeskInstance->getId(), 'EditView');
         $widgets[] = array('linktype' => 'DETAILVIEWWIDGET', 'linklabel' => 'HelpDesk', 'linkName' => $helpDeskInstance->getName(), 'linkurl' => 'module=' . $this->getModuleName() . '&view=Detail&record=' . $this->getRecord()->getId() . '&relatedModule=HelpDesk&mode=showRelatedRecords&page=1&limit=5', 'action' => $createPermission == true ? array('Add') : array(), 'actionURL' => $helpDeskInstance->getQuickCreateUrl());
     }
     $projectMileStoneInstance = Vtiger_Module_Model::getInstance('ProjectMilestone');
     if ($userPrivilegesModel->hasModuleActionPermission($projectMileStoneInstance->getId(), 'DetailView')) {
         $createPermission = $userPrivilegesModel->hasModuleActionPermission($projectMileStoneInstance->getId(), 'EditView');
         $widgets[] = array('linktype' => 'DETAILVIEWWIDGET', 'linklabel' => 'LBL_MILESTONES', 'linkName' => $projectMileStoneInstance->getName(), 'linkurl' => 'module=' . $this->getModuleName() . '&view=Detail&record=' . $this->getRecord()->getId() . '&relatedModule=ProjectMilestone&mode=showRelatedRecords&page=1&limit=5', 'action' => $createPermission == true ? array('Add') : array(), 'actionURL' => $projectMileStoneInstance->getQuickCreateUrl());
     }
     $projectTaskInstance = Vtiger_Module_Model::getInstance('ProjectTask');
     if ($userPrivilegesModel->hasModuleActionPermission($projectTaskInstance->getId(), 'DetailView')) {
         $createPermission = $userPrivilegesModel->hasModuleActionPermission($projectTaskInstance->getId(), 'EditView');
         $widgets[] = array('linktype' => 'DETAILVIEWWIDGET', 'linklabel' => 'LBL_TASKS', 'linkName' => $projectTaskInstance->getName(), 'linkurl' => 'module=' . $this->getModuleName() . '&view=Detail&record=' . $this->getRecord()->getId() . '&relatedModule=ProjectTask&mode=showRelatedRecords&page=1&limit=5', 'action' => $createPermission == true ? array('Add') : array(), 'actionURL' => $projectTaskInstance->getQuickCreateUrl());
     }
     $documentsInstance = Vtiger_Module_Model::getInstance('Documents');
     if ($userPrivilegesModel->hasModuleActionPermission($documentsInstance->getId(), 'DetailView')) {
         $createPermission = $userPrivilegesModel->hasModuleActionPermission($documentsInstance->getId(), 'EditView');
         $widgets[] = array('linktype' => 'DETAILVIEWWIDGET', 'linklabel' => 'Documents', 'linkName' => $documentsInstance->getName(), 'linkurl' => 'module=' . $this->getModuleName() . '&view=Detail&record=' . $this->getRecord()->getId() . '&relatedModule=Documents&mode=showRelatedRecords&page=1&limit=5', 'action' => $createPermission == true ? array('Add') : array(), 'actionURL' => $documentsInstance->getQuickCreateUrl());
     }
     foreach ($widgets as $widgetDetails) {
         $widgetLinks[] = Vtiger_Link_Model::getInstanceFromValues($widgetDetails);
     }
     return $widgetLinks;
 }
開發者ID:cannking,項目名稱:vtigercrm-debug,代碼行數:34,代碼來源:DetailView.php


注:本文中的Vtiger_DetailView_Model::getWidgets方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。