当前位置: 首页>>代码示例>>PHP>>正文


PHP Vtiger_Functions::getEntityModuleInfo方法代码示例

本文整理汇总了PHP中Vtiger_Functions::getEntityModuleInfo方法的典型用法代码示例。如果您正苦于以下问题:PHP Vtiger_Functions::getEntityModuleInfo方法的具体用法?PHP Vtiger_Functions::getEntityModuleInfo怎么用?PHP Vtiger_Functions::getEntityModuleInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Vtiger_Functions的用法示例。


在下文中一共展示了Vtiger_Functions::getEntityModuleInfo方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getName

	/**
	 * Function to get the Display Name for the record
	 * @return <String> - Entity Display Name for the record
	 */
	public function getName()
	{
		$entityData = Vtiger_Functions::getEntityModuleInfo('Users');
		$colums = [];
		foreach (explode(',', $entityData['fieldname']) as &$fieldname) {
			$colums[] = $this->get($fieldname);
		}
		return implode(' ', $colums);
	}
开发者ID:rubichcube,项目名称:YetiForceCRM,代码行数:13,代码来源:Privileges.php

示例2: getUsersAndGroupForModuleList

 public function getUsersAndGroupForModuleList($module, $view)
 {
     $currentUser = Users_Record_Model::getCurrentUserModel();
     $db = PearDatabase::getInstance();
     $userEntityInfo = Vtiger_Functions::getEntityModuleInfo('Users');
     $table = $userEntityInfo['tablename'];
     $columnsName = explode(',', $userEntityInfo['fieldname']);
     $queryGenerator = new QueryGenerator($module, $currentUser);
     $queryGenerator->initForCustomViewById($view);
     $queryGenerator->setFields(['assigned_user_id']);
     $queryGenerator->addCustomColumn('vtiger_groups.groupname');
     foreach ($columnsName as &$column) {
         $queryGenerator->addCustomColumn($table . '.' . $column);
     }
     $listQuery = $queryGenerator->getQuery('SELECT DISTINCT');
     $listQuery .= ' ORDER BY last_name ASC, first_name ASC';
     $result = $db->query($listQuery);
     $users = $group = [];
     while ($row = $db->fetch_array($result)) {
         if (isset($row['groupname'])) {
             $group[$row['smownerid']] = $row['groupname'];
         } else {
             $name = '';
             foreach ($columnsName as &$column) {
                 $name .= $row[$column] . ' ';
             }
             $users[$row['smownerid']] = trim($name);
         }
     }
     return ['users' => $users, 'group' => $group];
 }
开发者ID:awflu,项目名称:YetiForceCRM,代码行数:31,代码来源:Record.php

示例3: initialize2

 /**
  * Initialize more information of this instance
  * @access private
  */
 function initialize2()
 {
     $entitydata = Vtiger_Functions::getEntityModuleInfo($this->name);
     if ($entitydata) {
         $this->basetable = $entitydata['tablename'];
         $this->basetableid = $entitydata['entityidfield'];
     }
 }
开发者ID:cin-system,项目名称:cinrepo,代码行数:12,代码来源:ModuleBasic.php

示例4: getUserName

	public function getUserName($id)
	{
		if (key_exists($id, self::$users)) {
			return self::$users[$id];
		}
		$entityData = Vtiger_Functions::getEntityModuleInfo('Users');
		$user = new Users();
		$currentUser = $user->retrieveCurrentUserInfoFromFile($id);
		$colums = [];
		foreach (explode(',', $entityData['fieldname']) as &$fieldname) {
			$colums[] = $currentUser->column_fields[$fieldname];
		}
		$name = implode(' ', $colums);
		self::$users[$id] = $name;
		return $name;
	}
开发者ID:rubichcube,项目名称:YetiForceCRM,代码行数:16,代码来源:Module.php

示例5: getHeaderLinks

 /**
  * Function to get the list of Header Links
  * @return <Array> - List of Vtiger_Link_Model instances
  */
 public function getHeaderLinks(Vtiger_Request $request)
 {
     $userModel = Users_Record_Model::getCurrentUserModel();
     $headerLinks = [];
     if ($userModel->isAdminUser()) {
         if ($request->get('parent') != 'Settings') {
             $headerLinks[] = ['linktype' => 'HEADERLINK', 'linklabel' => 'LBL_SYSTEM_SETTINGS', 'linkurl' => 'index.php?module=Vtiger&parent=Settings&view=Index', 'glyphicon' => 'glyphicon glyphicon-cog'];
         } else {
             $headerLinks[] = ['linktype' => 'HEADERLINK', 'linklabel' => 'LBL_USER_PANEL', 'linkurl' => 'index.php', 'glyphicon' => 'glyphicon glyphicon-user'];
         }
     }
     //TODO To remove in the future
     if (SysSecurity::getBoolean('SHOW_MY_PREFERENCES')) {
         $headerLinks[] = ['linktype' => 'HEADERLINK', 'linklabel' => 'LBL_MY_PREFERENCES', 'linkurl' => $userModel->getPreferenceDetailViewUrl(), 'glyphicon' => 'glyphicon glyphicon-tasks'];
     }
     $headerLinks[] = ['linktype' => 'HEADERLINK', 'linklabel' => 'LBL_SIGN_OUT', 'linkurl' => 'index.php?module=Users&parent=Settings&action=Logout', 'glyphicon' => 'glyphicon glyphicon-off'];
     require 'user_privileges/switchUsers.php';
     $baseUserId = $userModel->getId();
     if (Vtiger_Session::has('baseUserId') && Vtiger_Session::get('baseUserId') != '') {
         $baseUserId = Vtiger_Session::get('baseUserId');
     }
     if (key_exists($baseUserId, $switchUsers)) {
         $childlinks = [];
         if (Vtiger_Session::has('baseUserId') && Vtiger_Session::get('baseUserId') != '') {
             $entityData = Vtiger_Functions::getEntityModuleInfo('Users');
             $user = new Users();
             $currentUser = $user->retrieveCurrentUserInfoFromFile($baseUserId);
             $colums = [];
             foreach (explode(',', $entityData['fieldname']) as $fieldname) {
                 $colums[] = $currentUser->column_fields[$fieldname];
             }
             $userName = implode(' ', $colums);
             $childlinks[] = ['linktype' => 'HEADERLINK', 'linklabel' => $userName, 'linkurl' => '?module=Users&action=SwitchUsers&id=' . $baseUserId, 'linkicon' => ''];
             $childlinks[] = ['linktype' => 'HEADERLINK', 'linklabel' => NULL];
         }
         foreach ($switchUsers[$baseUserId] as $userid => $userName) {
             if ($userid != $baseUserId) {
                 $childlinks[] = ['linktype' => 'HEADERLINK', 'linklabel' => $userName, 'linkurl' => '?module=Users&action=SwitchUsers&id=' . $userid, 'linkicon' => ''];
             }
         }
         $customHeaderLinks = ['linktype' => 'HEADERLINK', 'linklabel' => 'SwitchUsers', 'linkurl' => '', 'glyphicon' => 'glyphicon glyphicon-transfer', 'nocaret' => true, 'childlinks' => $childlinks];
         if (count($childlinks)) {
             array_push($headerLinks, $customHeaderLinks);
         }
     }
     $headerLinkInstances = [];
     foreach ($headerLinks as $headerLink) {
         $headerLinkInstance = Vtiger_Link_Model::getInstanceFromValues($headerLink);
         if (isset($headerLink['childlinks'])) {
             foreach ($headerLink['childlinks'] as $childLink) {
                 $headerLinkInstance->addChildLink(Vtiger_Link_Model::getInstanceFromValues($childLink));
             }
         }
         $headerLinkInstances[] = $headerLinkInstance;
     }
     $headerLinks = Vtiger_Link_Model::getAllByType(Vtiger_Link::IGNORE_MODULE, ['HEADERLINK']);
     foreach ($headerLinks as $headerType => $headerLinks) {
         foreach ($headerLinks as $headerLink) {
             $headerLinkInstances[] = Vtiger_Link_Model::getInstanceFromLinkObject($headerLink);
         }
     }
     return $headerLinkInstances;
 }
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:67,代码来源:Header.php


注:本文中的Vtiger_Functions::getEntityModuleInfo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。