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


PHP Vtiger_Module_Model::getName方法代碼示例

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


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

示例1: getRelationQuery

 /**
  * Function to get relation query for particular module with function name
  * @param <record> $recordId
  * @param <String> $functionName
  * @param Vtiger_Module_Model $relatedModule
  * @return <String>
  */
 public function getRelationQuery($recordId, $functionName, $relatedModule, $relationModel = false)
 {
     if ($functionName === 'get_activities') {
         $focus = CRMEntity::getInstance($this->getName());
         $focus->id = $recordId;
         $entityIds = $focus->getRelatedContactsIds();
         $entityIds[] = $recordId;
         $entityIds = implode(',', $entityIds);
         $userNameSql = getSqlForNameInDisplayFormat(array('first_name' => 'vtiger_users.first_name', 'last_name' => 'vtiger_users.last_name'), 'Users');
         $query = "SELECT CASE WHEN (vtiger_users.user_name not like '') THEN {$userNameSql} ELSE vtiger_groups.groupname END AS user_name,\n\t\t\t\t\t\tvtiger_crmentity.*, vtiger_activity.activitytype, vtiger_activity.subject, vtiger_activity.date_start, vtiger_activity.time_start,\n\t\t\t\t\t\tvtiger_activity.recurringtype, vtiger_activity.due_date, vtiger_activity.time_end, vtiger_activity.visibility, \n\t\t\t\t\t\tvtiger_activity.status AS status\n\t\t\t\t\t\tFROM vtiger_activity\n\t\t\t\t\t\tINNER JOIN vtiger_crmentity ON vtiger_crmentity.crmid = vtiger_activity.activityid\n\t\t\t\t\t\tLEFT JOIN vtiger_users ON vtiger_users.id = vtiger_crmentity.smownerid\n\t\t\t\t\t\tLEFT JOIN vtiger_groups ON vtiger_groups.groupid = vtiger_crmentity.smownerid\n\t\t\t\t\t\tWHERE vtiger_crmentity.deleted = 0 AND vtiger_activity.link IN (" . $entityIds . ')';
         $time = vtlib_purify($_REQUEST['time']);
         if ($time == 'current') {
             $stateActivityLabels = Calendar_Module_Model::getComponentActivityStateLabel('current');
             $query .= " AND (vtiger_activity.activitytype NOT IN ('Emails') AND vtiger_activity.status IN ('" . implode("','", $stateActivityLabels) . "'))";
         }
         if ($time == 'history') {
             $stateActivityLabels = Calendar_Module_Model::getComponentActivityStateLabel('history');
             $query .= " AND (vtiger_activity.activitytype NOT IN ('Emails') AND vtiger_activity.status IN ('" . implode("','", $stateActivityLabels) . "'))";
         }
         $relatedModuleName = $relatedModule->getName();
         $query .= $this->getSpecificRelationQuery($relatedModuleName);
         $instance = CRMEntity::getInstance($relatedModuleName);
         $securityParameter = $instance->getUserAccessConditionsQuerySR($relatedModuleName, false, $recordId);
         if ($securityParameter != '') {
             $query .= $securityParameter;
         }
         // There could be more than one contact for an activity.
         $query .= ' GROUP BY vtiger_activity.activityid';
     } elseif ($functionName === 'get_mails' && $relatedModule->getName() == 'OSSMailView') {
         $query = OSSMailView_Record_Model::getMailsQuery($recordId, $relatedModule->getName());
     } else {
         $query = parent::getRelationQuery($recordId, $functionName, $relatedModule, $relationModel);
     }
     return $query;
 }
開發者ID:nikdejan,項目名稱:YetiForceCRM,代碼行數:42,代碼來源:Module.php

示例2: getRelationQuery

 /**
  * Function to get relation query for particular module with function name
  * @param <record> $recordId
  * @param <String> $functionName
  * @param Vtiger_Module_Model $relatedModule
  * @return <String>
  */
 public function getRelationQuery($recordId, $functionName, $relatedModule, $relationModel = false)
 {
     if ($functionName === 'get_activities') {
         $userNameSql = getSqlForNameInDisplayFormat(array('first_name' => 'vtiger_users.first_name', 'last_name' => 'vtiger_users.last_name'), 'Users');
         $query = "SELECT CASE WHEN (vtiger_users.user_name not like '') THEN {$userNameSql} ELSE vtiger_groups.groupname END AS user_name,\n\t\t\t\t\t\tvtiger_crmentity.*, vtiger_activity.activitytype, vtiger_activity.subject, vtiger_activity.date_start, vtiger_activity.time_start,\n\t\t\t\t\t\tvtiger_activity.recurringtype, vtiger_activity.due_date, vtiger_activity.time_end, vtiger_activity.visibility,\n\t\t\t\t\t\tCASE WHEN (vtiger_activity.activitytype = 'Task') THEN (vtiger_activity.status) ELSE (vtiger_activity.eventstatus) END AS status\n\t\t\t\t\t\tFROM vtiger_activity\n\t\t\t\t\t\tINNER JOIN vtiger_crmentity ON vtiger_crmentity.crmid = vtiger_activity.activityid\n\t\t\t\t\t\tLEFT JOIN vtiger_users ON vtiger_users.id = vtiger_crmentity.smownerid\n\t\t\t\t\t\tLEFT JOIN vtiger_groups ON vtiger_groups.groupid = vtiger_crmentity.smownerid\n\t\t\t\t\t\t\tWHERE vtiger_crmentity.deleted = 0 AND vtiger_activity.process = " . $recordId;
         $time = vtlib_purify($_REQUEST['time']);
         if ($time == 'current') {
             $query .= " AND ((vtiger_activity.activitytype='Task' and vtiger_activity.status not in ('Completed','Deferred'))\n\t\t\t\tOR (vtiger_activity.activitytype not in ('Emails','Task') and vtiger_activity.eventstatus not in ('','Held')))";
         }
         if ($time == 'history') {
             $query .= " AND ((vtiger_activity.activitytype='Task' and vtiger_activity.status in ('Completed','Deferred'))\n\t\t\t\tOR (vtiger_activity.activitytype not in ('Emails','Task') and  vtiger_activity.eventstatus in ('','Held')))";
         }
         $relatedModuleName = $relatedModule->getName();
         $query .= $this->getSpecificRelationQuery($relatedModuleName);
         $instance = CRMEntity::getInstance($relatedModuleName);
         $securityParameter = $instance->getUserAccessConditionsQuerySR($relatedModuleName);
         if ($securityParameter != '') {
             $sql .= $securityParameter;
         }
     } elseif ($functionName === 'get_mails' && $relatedModule->getName() == 'OSSMailView') {
         $query = OSSMailView_Record_Model::getMailsQuery($recordId, $relatedModule->getName());
     } else {
         $query = parent::getRelationQuery($recordId, $functionName, $relatedModule, $relationModel);
     }
     return $query;
 }
開發者ID:rcrrich,項目名稱:UpdatePackages,代碼行數:33,代碼來源:Module.php

示例3: getRelationQuery

 /**
  * Function to get relation query for particular module with function name
  * @param <record> $recordId
  * @param <String> $functionName
  * @param Vtiger_Module_Model $relatedModule
  * @return <String>
  */
 public function getRelationQuery($recordId, $functionName, $relatedModule, $relationModel = false)
 {
     if ($functionName === 'get_mails' && $relatedModule->getName() == 'OSSMailView') {
         $query = OSSMailView_Record_Model::getMailsQuery($recordId, $relatedModule->getName());
     } else {
         $query = parent::getRelationQuery($recordId, $functionName, $relatedModule, $relationModel);
     }
     return $query;
 }
開發者ID:HoererUndFlamme,項目名稱:YetiForceCRM,代碼行數:16,代碼來源:Module.php

示例4: getRelationQuery

 /**
  * Function to get relation query for particular module with function name
  * @param <record> $recordId
  * @param <String> $functionName
  * @param Vtiger_Module_Model $relatedModule
  * @return <String>
  */
 public function getRelationQuery($recordId, $functionName, $relatedModule)
 {
     if ($functionName === 'get_activities') {
         $focus = CRMEntity::getInstance($this->getName());
         $focus->id = $recordId;
         $entityIds = $focus->getRelatedContactsIds();
         $entityIds = implode(',', $entityIds);
         $userNameSql = getSqlForNameInDisplayFormat(array('first_name' => 'vtiger_users.first_name', 'last_name' => 'vtiger_users.last_name'), 'Users');
         $query = "SELECT CASE WHEN (vtiger_users.user_name not like '') THEN {$userNameSql} ELSE vtiger_groups.groupname END AS user_name,\n\t\t\t\t\t\tvtiger_crmentity.*, vtiger_activity.activitytype, vtiger_activity.subject, vtiger_activity.date_start, vtiger_activity.time_start,\n\t\t\t\t\t\tvtiger_activity.recurringtype, vtiger_activity.due_date, vtiger_activity.time_end, vtiger_activity.visibility, vtiger_seactivityrel.crmid AS parent_id,\n\t\t\t\t\t\tCASE WHEN (vtiger_activity.activitytype = 'Task') THEN (vtiger_activity.status) ELSE (vtiger_activity.eventstatus) END AS status\n\t\t\t\t\t\tFROM vtiger_activity\n\t\t\t\t\t\tINNER JOIN vtiger_crmentity ON vtiger_crmentity.crmid = vtiger_activity.activityid\n\t\t\t\t\t\tLEFT JOIN vtiger_seactivityrel ON vtiger_seactivityrel.activityid = vtiger_activity.activityid\n\t\t\t\t\t\tLEFT JOIN vtiger_cntactivityrel ON vtiger_cntactivityrel.activityid = vtiger_activity.activityid\n\t\t\t\t\t\tLEFT JOIN vtiger_users ON vtiger_users.id = vtiger_crmentity.smownerid\n\t\t\t\t\t\tLEFT JOIN vtiger_groups ON vtiger_groups.groupid = vtiger_crmentity.smownerid\n\t\t\t\t\t\t\tWHERE vtiger_crmentity.deleted = 0 AND vtiger_activity.activitytype <> 'Emails'\n\t\t\t\t\t\t\t\tAND (vtiger_seactivityrel.crmid = " . $recordId;
         if ($entityIds) {
             $query .= " OR vtiger_cntactivityrel.contactid IN (" . $entityIds . "))";
         } else {
             $query .= ")";
         }
         $relatedModuleName = $relatedModule->getName();
         $query .= $this->getSpecificRelationQuery($relatedModuleName);
         $nonAdminQuery = $this->getNonAdminAccessControlQueryForRelation($relatedModuleName);
         if ($nonAdminQuery) {
             $query = appendFromClauseToQuery($query, $nonAdminQuery);
         }
         // There could be more than one contact for an activity.
         $query .= ' GROUP BY vtiger_activity.activityid';
     } else {
         $query = parent::getRelationQuery($recordId, $functionName, $relatedModule);
     }
     return $query;
 }
開發者ID:cannking,項目名稱:vtigercrm-debug,代碼行數:34,代碼來源:Module.php

示例5: getRelationQuery

	/**
	 * Function to get relation query for particular module with function name
	 * @param <record> $recordId
	 * @param <String> $functionName
	 * @param Vtiger_Module_Model $relatedModule
	 * @return <String>
	 */
	public function getRelationQuery($recordId, $functionName, $relatedModule, $relationModel = false)
	{
		if ($functionName === 'get_activities') {
			$userNameSql = getSqlForNameInDisplayFormat(array('first_name' => 'vtiger_users.first_name', 'last_name' => 'vtiger_users.last_name'), 'Users');

			$query = "SELECT CASE WHEN (vtiger_users.user_name not like '') THEN $userNameSql ELSE vtiger_groups.groupname END AS user_name,
						vtiger_crmentity.*, vtiger_activity.activitytype, vtiger_activity.subject, vtiger_activity.date_start, vtiger_activity.time_start,
						vtiger_activity.recurringtype, vtiger_activity.due_date, vtiger_activity.time_end, vtiger_activity.visibility,
						CASE WHEN (vtiger_activity.activitytype = 'Task') THEN (vtiger_activity.status) ELSE (vtiger_activity.eventstatus) END AS status
						FROM vtiger_activity
						INNER JOIN vtiger_crmentity ON vtiger_crmentity.crmid = vtiger_activity.activityid
						LEFT JOIN vtiger_users ON vtiger_users.id = vtiger_crmentity.smownerid
						LEFT JOIN vtiger_groups ON vtiger_groups.groupid = vtiger_crmentity.smownerid
							WHERE vtiger_crmentity.deleted = 0 AND vtiger_activity.process = " . $recordId;
			$time = vtlib_purify($_REQUEST['time']);
			if ($time == 'current') {
				$stateActivityLabels = Calendar_Module_Model::getComponentActivityStateLabel('current');
				$query .= " AND (vtiger_activity.activitytype NOT IN ('Emails') AND vtiger_activity.status IN ('" . implode("','", $stateActivityLabels) . "'))";
			}
			if ($time == 'history') {
				$stateActivityLabels = Calendar_Module_Model::getComponentActivityStateLabel('history');
				$query .= " AND (vtiger_activity.activitytype NOT IN ('Emails') AND vtiger_activity.status IN ('" . implode("','", $stateActivityLabels) . "'))";
			}
			$relatedModuleName = $relatedModule->getName();
			$query .= $this->getSpecificRelationQuery($relatedModuleName);
			$instance = CRMEntity::getInstance($relatedModuleName);
			$securityParameter = $instance->getUserAccessConditionsQuerySR($relatedModuleName, false, $recordId);
			if ($securityParameter != '')
				$query .= $securityParameter;
		} elseif ($functionName === 'get_mails' && $relatedModule->getName() == 'OSSMailView') {
			$query = OSSMailView_Record_Model::getMailsQuery($recordId, $relatedModule->getName());
		} else {
			$query = parent::getRelationQuery($recordId, $functionName, $relatedModule, $relationModel);
		}

		return $query;
	}
開發者ID:rubichcube,項目名稱:YetiForceCRM,代碼行數:44,代碼來源:Module.php

示例6: getRelationQuery

 /**
  * Function to get relation query for particular module with function name
  * @param <record> $recordId
  * @param <String> $functionName
  * @param Vtiger_Module_Model $relatedModule
  * @return <String>
  */
 public function getRelationQuery($recordId, $functionName, $relatedModule)
 {
     if ($functionName === 'get_activities') {
         $userNameSql = getSqlForNameInDisplayFormat(array('first_name' => 'vtiger_users.first_name', 'last_name' => 'vtiger_users.last_name'), 'Users');
         $query = "SELECT CASE WHEN (vtiger_users.user_name not like '') THEN {$userNameSql} ELSE vtiger_groups.groupname END AS user_name,\n\t\t\t\t\t\tvtiger_crmentity.*, vtiger_activity.activitytype, vtiger_activity.subject, vtiger_activity.date_start, vtiger_activity.time_start,\n\t\t\t\t\t\tvtiger_activity.recurringtype, vtiger_activity.due_date, vtiger_activity.time_end, vtiger_activity.visibility, vtiger_seactivityrel.crmid AS parent_id,\n\t\t\t\t\t\tCASE WHEN (vtiger_activity.activitytype = 'Task') THEN (vtiger_activity.status) ELSE (vtiger_activity.eventstatus) END AS status\n\t\t\t\t\t\tFROM vtiger_activity\n\t\t\t\t\t\tINNER JOIN vtiger_crmentity ON vtiger_crmentity.crmid = vtiger_activity.activityid\n\t\t\t\t\t\tLEFT JOIN vtiger_seactivityrel ON vtiger_seactivityrel.activityid = vtiger_activity.activityid\n\t\t\t\t\t\tLEFT JOIN vtiger_cntactivityrel ON vtiger_cntactivityrel.activityid = vtiger_activity.activityid\n\t\t\t\t\t\tLEFT JOIN vtiger_users ON vtiger_users.id = vtiger_crmentity.smownerid\n\t\t\t\t\t\tLEFT JOIN vtiger_groups ON vtiger_groups.groupid = vtiger_crmentity.smownerid\n\t\t\t\t\t\t\tWHERE vtiger_crmentity.deleted = 0 AND vtiger_activity.activitytype = 'Task'\n\t\t\t\t\t\t\t\tAND vtiger_seactivityrel.crmid = " . $recordId;
         $relatedModuleName = $relatedModule->getName();
         $query .= $this->getSpecificRelationQuery($relatedModuleName);
         $nonAdminQuery = $this->getNonAdminAccessControlQueryForRelation($relatedModuleName);
         if ($nonAdminQuery) {
             $query = appendFromClauseToQuery($query, $nonAdminQuery);
         }
     } else {
         $query = parent::getRelationQuery($recordId, $functionName, $relatedModule);
     }
     return $query;
 }
開發者ID:cannking,項目名稱:vtigercrm-debug,代碼行數:23,代碼來源:Module.php

示例7: getRelationQuery

 /**
  * Function to get relation query for particular module with function name
  * @param <record> $recordId
  * @param <String> $functionName
  * @param Vtiger_Module_Model $relatedModule
  * @return <String>
  */
 public function getRelationQuery($recordId, $functionName, $relatedModule, $relationModel = false)
 {
     if ($functionName === 'get_activities') {
         $focus = CRMEntity::getInstance($this->getName());
         $focus->id = $recordId;
         $entityIds = $focus->getRelatedContactsIds();
         $entityIds[] = $recordId;
         $entityIds = implode(',', $entityIds);
         $userNameSql = getSqlForNameInDisplayFormat(array('first_name' => 'vtiger_users.first_name', 'last_name' => 'vtiger_users.last_name'), 'Users');
         $query = "SELECT CASE WHEN (vtiger_users.user_name not like '') THEN {$userNameSql} ELSE vtiger_groups.groupname END AS user_name,\n\t\t\t\t\t\tvtiger_crmentity.*, vtiger_activity.activitytype, vtiger_activity.subject, vtiger_activity.date_start, vtiger_activity.time_start,\n\t\t\t\t\t\tvtiger_activity.recurringtype, vtiger_activity.due_date, vtiger_activity.time_end, vtiger_activity.visibility, \n\t\t\t\t\t\tCASE WHEN (vtiger_activity.activitytype = 'Task') THEN (vtiger_activity.status) ELSE (vtiger_activity.eventstatus) END AS status\n\t\t\t\t\t\tFROM vtiger_activity\n\t\t\t\t\t\tINNER JOIN vtiger_crmentity ON vtiger_crmentity.crmid = vtiger_activity.activityid\n\t\t\t\t\t\tLEFT JOIN vtiger_users ON vtiger_users.id = vtiger_crmentity.smownerid\n\t\t\t\t\t\tLEFT JOIN vtiger_groups ON vtiger_groups.groupid = vtiger_crmentity.smownerid\n\t\t\t\t\t\tWHERE vtiger_crmentity.deleted = 0 AND vtiger_activity.link IN (" . $entityIds . ')';
         $time = vtlib_purify($_REQUEST['time']);
         if ($time == 'current') {
             $query .= " AND ((vtiger_activity.activitytype='Task' and vtiger_activity.status not in ('Completed','Deferred'))\n\t\t\t\tOR (vtiger_activity.activitytype not in ('Emails','Task') and vtiger_activity.eventstatus not in ('','Held')))";
         }
         if ($time == 'history') {
             $query .= " AND ((vtiger_activity.activitytype='Task' and vtiger_activity.status in ('Completed','Deferred'))\n\t\t\t\tOR (vtiger_activity.activitytype not in ('Emails','Task') and  vtiger_activity.eventstatus in ('','Held')))";
         }
         $relatedModuleName = $relatedModule->getName();
         $query .= $this->getSpecificRelationQuery($relatedModuleName);
         $instance = CRMEntity::getInstance($relatedModuleName);
         $securityParameter = $instance->getUserAccessConditionsQuerySR($relatedModuleName);
         if ($securityParameter != '') {
             $query .= $securityParameter;
         }
         // There could be more than one contact for an activity.
         $query .= ' GROUP BY vtiger_activity.activityid';
     } elseif ($functionName === 'get_dependents_list' && $relatedModule->getName() == 'OutsourcedProducts') {
         $query = parent::getRelationQuery($recordId, $functionName, $relatedModule, $relationModel);
         $query .= " OR potential IN (SELECT potentialid FROM vtiger_potential INNER JOIN vtiger_crmentity ON vtiger_crmentity.crmid = vtiger_potential.potentialid WHERE vtiger_crmentity.deleted = 0 AND related_to = '{$recordId}')";
     } elseif ($functionName === 'get_mails' && $relatedModule->getName() == 'OSSMailView') {
         $query = OSSMailView_Record_Model::getMailsQuery($recordId, $relatedModule->getName());
     } else {
         $query = parent::getRelationQuery($recordId, $functionName, $relatedModule, $relationModel);
     }
     return $query;
 }
開發者ID:rcrrich,項目名稱:UpdatePackages,代碼行數:43,代碼來源:Module.php

示例8: getRelationQuery

 /**
  * Function to get relation query for particular module with function name
  * @param <record> $recordId
  * @param <String> $functionName
  * @param Vtiger_Module_Model $relatedModule
  * @return <String>
  */
 public function getRelationQuery($recordId, $functionName, $relatedModule)
 {
     $relatedModuleName = $relatedModule->getName();
     $focus = CRMEntity::getInstance($this->getName());
     $focus->id = $recordId;
     $result = $focus->{$functionName}($recordId, $this->getId(), $relatedModule->getId());
     $query = $result['query'] . ' ' . $this->getSpecificRelationQuery($relatedModuleName);
     $nonAdminQuery = $this->getNonAdminAccessControlQueryForRelation($relatedModuleName);
     //modify query if any module has summary fields, those fields we are displayed in related list of that module
     $relatedListFields = $relatedModule->getConfigureRelatedListFields();
     if ($relatedModuleName == 'Documents') {
         $relatedListFields['filelocationtype'] = 'filelocationtype';
         $relatedListFields['filestatus'] = 'filestatus';
     }
     if (count($relatedListFields) > 0) {
         $currentUser = Users_Record_Model::getCurrentUserModel();
         $queryGenerator = new QueryGenerator($relatedModuleName, $currentUser);
         $queryGenerator->setFields($relatedListFields);
         $selectColumnSql = $queryGenerator->getSelectClauseColumnSQL();
         $newQuery = spliti('FROM', $query);
         $selectColumnSql = 'SELECT DISTINCT vtiger_crmentity.crmid,' . $selectColumnSql;
         $query = $selectColumnSql . ' FROM ' . $newQuery[1];
     }
     if ($nonAdminQuery) {
         $query = appendFromClauseToQuery($query, $nonAdminQuery);
     }
     return $query;
 }
開發者ID:cannking,項目名稱:vtigercrm-debug,代碼行數:35,代碼來源:Module.php

示例9: getRelationQuery

 /**
  * Function to get relation query for particular module with function name
  * @param <record> $recordId
  * @param <String> $functionName
  * @param Vtiger_Module_Model $relatedModule
  * @return <String>
  */
 public function getRelationQuery($recordId, $functionName, $relatedModule, $relationModel = false)
 {
     $relatedModuleName = $relatedModule->getName();
     $focus = CRMEntity::getInstance($this->getName());
     $focus->id = $recordId;
     $result = $focus->{$functionName}($recordId, $this->getId(), $relatedModule->getId());
     $query = $result['query'] . ' ' . $this->getSpecificRelationQuery($relatedModuleName);
     //modify query if any module has summary fields, those fields we are displayed in related list of that module
     $relatedListFields = array();
     if ($relationModel) {
         $relatedListFields = $relationModel->getRelationFields(true, true);
     }
     if (count($relatedListFields) == 0) {
         $relatedListFields = $relatedModule->getConfigureRelatedListFields();
         if ($relatedModuleName == 'Documents') {
             $relatedListFields['filelocationtype'] = 'filelocationtype';
             $relatedListFields['filestatus'] = 'filestatus';
         }
     }
     if (count($relatedListFields) > 0) {
         $currentUser = Users_Record_Model::getCurrentUserModel();
         $queryGenerator = new QueryGenerator($relatedModuleName, $currentUser);
         $queryGenerator->setFields($relatedListFields);
         $selectColumnSql = $queryGenerator->getSelectClauseColumnSQL();
         $newQuery = spliti('FROM', $query);
         $selectColumnSql = 'SELECT DISTINCT vtiger_crmentity.crmid,' . $selectColumnSql;
         $query = $selectColumnSql . ' FROM ' . $newQuery[1];
     }
     $instance = CRMEntity::getInstance($relatedModuleName);
     $securityParameter = $instance->getUserAccessConditionsQuerySR($relatedModuleName, false, $recordId);
     if ($securityParameter != '') {
         $query .= $securityParameter;
     }
     return $query;
 }
開發者ID:noclav,項目名稱:UpdatePackages,代碼行數:42,代碼來源:Module.php

示例10: getRelationQuery

 /**
  * Function to get relation query for particular module with function name
  * @param <record> $recordId
  * @param <String> $functionName
  * @param Vtiger_Module_Model $relatedModule
  * @return <String>
  */
 public function getRelationQuery($recordId, $functionName, $relatedModule, $relationModel = false)
 {
     $relatedModuleName = $relatedModule->getName();
     $focus = CRMEntity::getInstance($this->getName());
     $focus->id = $recordId;
     switch ($functionName) {
         case 'get_many_to_many':
             $query = $this->getRelationQueryM2M($recordId, $relatedModule, $relationModel);
             break;
         case 'get_activities':
             $query = $this->getRelationQueryForActivities($recordId, $relatedModule, $relationModel);
             break;
         default:
             $result = $focus->{$functionName}($recordId, $this->getId(), $relatedModule->getId());
             $query = $result['query'] . ' ' . $this->getSpecificRelationQuery($relatedModuleName);
             break;
     }
     //modify query if any module has summary fields, those fields we are displayed in related list of that module
     $relatedListFields = [];
     if ($relationModel) {
         $relatedListFields = $relationModel->getRelationFields(true, true);
     }
     if (count($relatedListFields) == 0) {
         $relatedListFields = $relatedModule->getConfigureRelatedListFields();
         if ($relatedModuleName == 'Documents') {
             $relatedListFields['filelocationtype'] = 'filelocationtype';
             $relatedListFields['filestatus'] = 'filestatus';
         }
     }
     if (count($relatedListFields) > 0) {
         $currentUser = Users_Record_Model::getCurrentUserModel();
         $queryGenerator = new QueryGenerator($relatedModuleName, $currentUser);
         $queryGenerator->setFields($relatedListFields);
         if ($relationModel->showCreatorDetail()) {
             $queryGenerator->setCustomColumn('rel_created_user');
             $queryGenerator->setCustomColumn('rel_created_time');
         }
         if ($relationModel->showComment()) {
             $queryGenerator->setCustomColumn('rel_comment');
         }
         $selectColumnSql = $queryGenerator->getSelectClauseColumnSQL();
         $query = str_replace('FROM', 'from', $query);
         $newQuery = explode('from', $query);
         $selectColumnSql = 'SELECT DISTINCT vtiger_crmentity.crmid,' . $selectColumnSql;
         $query = $selectColumnSql . ' FROM ' . $newQuery[1];
     }
     $instance = CRMEntity::getInstance($relatedModuleName);
     $securityParameter = $instance->getUserAccessConditionsQuerySR($relatedModuleName, false, $recordId);
     if ($securityParameter != '') {
         $query .= $securityParameter;
     }
     return $query;
 }
開發者ID:HoererUndFlamme,項目名稱:YetiForceCRM,代碼行數:60,代碼來源:Module.php


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