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


PHP vtws_getModuleHandlerFromName函数代码示例

本文整理汇总了PHP中vtws_getModuleHandlerFromName函数的典型用法代码示例。如果您正苦于以下问题:PHP vtws_getModuleHandlerFromName函数的具体用法?PHP vtws_getModuleHandlerFromName怎么用?PHP vtws_getModuleHandlerFromName使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: getModuleMeta

 public static function getModuleMeta($moduleName, $user)
 {
     if (empty(self::$_cached_module_meta[$moduleName][$user->id])) {
         $moduleHandler = vtws_getModuleHandlerFromName($moduleName, $user);
         self::$_cached_module_meta[$moduleName][$user->id] = $moduleHandler->getMeta();
     }
     return self::$_cached_module_meta[$moduleName][$user->id];
 }
开发者ID:casati-dolibarr,项目名称:corebos,代码行数:8,代码来源:Import_ListView_Controller.php

示例2: translateReferenceFieldNamesToIds

 public function translateReferenceFieldNamesToIds($entityRecords, $user)
 {
     $entityRecordList = array();
     foreach ($entityRecords as $index => $record) {
         $entityRecordList[$record['module']][$index] = $record;
     }
     foreach ($entityRecordList as $module => $records) {
         $handler = vtws_getModuleHandlerFromName($module, $user);
         $meta = $handler->getMeta();
         $referenceFieldDetails = $meta->getReferenceFieldDetails();
         foreach ($referenceFieldDetails as $referenceFieldName => $referenceModuleDetails) {
             $recordReferenceFieldNames = array();
             foreach ($records as $index => $recordDetails) {
                 if (!empty($recordDetails[$referenceFieldName])) {
                     $recordReferenceFieldNames[] = $recordDetails[$referenceFieldName];
                 }
             }
             $entityNameIds = wsapp_getRecordEntityNameIds(array_values($recordReferenceFieldNames), $referenceModuleDetails, $user);
             if (is_array($entityNameIds)) {
                 $entityNameIds = array_change_key_case($entityNameIds, CASE_LOWER);
             }
             foreach ($records as $index => $recordInfo) {
                 if (!empty($entityNameIds[strtolower($recordInfo[$referenceFieldName])])) {
                     $recordInfo[$referenceFieldName] = $entityNameIds[strtolower($recordInfo[$referenceFieldName])];
                 } else {
                     if ($referenceFieldName == 'account_id') {
                         if ($recordInfo[$referenceFieldName] != NULL) {
                             $element['accountname'] = $recordInfo[$referenceFieldName];
                             $element['assigned_user_id'] = vtws_getWebserviceEntityId('Users', $user->id);
                             $element['module'] = "Accounts";
                             $createRecord = array($element);
                             $createRecord = $this->fillNonExistingMandatoryPicklistValues($createRecord);
                             $createRecord = $this->fillMandatoryFields($createRecord, $user);
                             foreach ($createRecord as $key => $record) {
                                 vtws_create($record['module'], $record, $user);
                             }
                             $entityNameIds = wsapp_getRecordEntityNameIds(array_values($recordReferenceFieldNames), $referenceModuleDetails, $user);
                             $recordInfo[$referenceFieldName] = $entityNameIds[$recordInfo[$referenceFieldName]];
                         }
                     } else {
                         $recordInfo[$referenceFieldName] = "";
                     }
                 }
                 $records[$index] = $recordInfo;
             }
         }
         $entityRecordList[$module] = $records;
     }
     $crmRecords = array();
     foreach ($entityRecordList as $module => $entityRecords) {
         foreach ($entityRecords as $index => $record) {
             $crmRecords[$index] = $record;
         }
     }
     return $crmRecords;
 }
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:56,代码来源:OutlookVtigerCRMHandler.php

示例3: getMeta

 /**
  *
  * @param String:ModuleName $module
  * @return EntityMeta
  */
 public function getMeta($module, $user)
 {
     $db = PearDatabase::getInstance();
     if (empty($this->moduleMetaInfo[$module])) {
         $handler = vtws_getModuleHandlerFromName($module, $user);
         $meta = $handler->getMeta();
         $this->moduleMetaInfo[$module] = $meta;
     }
     return $this->moduleMetaInfo[$module];
 }
开发者ID:hardikk,项目名称:HNH,代码行数:15,代码来源:CustomView.php

示例4: vtws_retrieve_inventory

/**
 * Retrieve inventory record with LineItems
 */
function vtws_retrieve_inventory($id)
{
    $current_user = vglobal('current_user');
    $record = vtws_retrieve($id, $current_user);
    $handler = vtws_getModuleHandlerFromName('LineItem', $user);
    $id = vtws_getIdComponents($id);
    $id = $id[1];
    $inventoryLineItems = $handler->getAllLineItemForParent($id);
    $record['LineItems'] = $inventoryLineItems;
    return $record;
}
开发者ID:rcrrich,项目名称:UpdatePackages,代码行数:14,代码来源:RetrieveInventory.php

示例5: getInstance

 /**
  * creates an instance of Vtiger_ModuleMeta_Model
  * @param <String> $name - module name
  * @param <Object> $user - Users Object
  * @return Vtiger_ModuleMeta_Model
  */
 public static function getInstance($name, $user)
 {
     $self = new Vtiger_ModuleMeta_Model();
     $self->moduleName = $name;
     $self->user = $user;
     if (!empty(self::$_cached_module_meta[$name][$user->id])) {
         $self->webserviceMeta = self::$_cached_module_meta[$name][$user->id];
         return $self;
     }
     $handler = vtws_getModuleHandlerFromName($self->moduleName, $user);
     $self->webserviceMeta = $handler->getMeta();
     self::$_cached_module_meta[$name][$user->id] = $self->webserviceMeta;
     return $self;
 }
开发者ID:cannking,项目名称:vtigercrm-debug,代码行数:20,代码来源:ModuleMeta.php

示例6: isAssignToChanged

 function isAssignToChanged($moduleName, $recordId, $user)
 {
     $wsModuleName = $this->getWsModuleName($moduleName);
     $handler = vtws_getModuleHandlerFromName($wsModuleName, $user);
     $meta = $handler->getMeta();
     $moduleOwnerFields = $meta->getOwnerFields();
     $assignToChanged = false;
     $vtEntityDelta = new VTEntityDelta();
     foreach ($moduleOwnerFields as $ownerField) {
         $assignToChanged = $vtEntityDelta->hasChanged($moduleName, $recordId, $ownerField);
         if ($assignToChanged) {
             break;
         }
     }
     return $assignToChanged;
 }
开发者ID:rcrrich,项目名称:UpdatePackages,代码行数:16,代码来源:WSAPPAssignToTracker.php

示例7: getAccessibleFields

	public function getAccessibleFields($moduleName) {
		global $current_user;

		if(empty(self::$_cached_module_meta[$moduleName][$current_user->id])) {
			$moduleHandler = vtws_getModuleHandlerFromName($moduleName, $current_user);
			self::$_cached_module_meta[$moduleName][$current_user->id] = $moduleHandler->getMeta();
		}
		$meta = self::$_cached_module_meta[$moduleName][$current_user->id];
		$moduleFields = $meta->getModuleFields();
		$accessibleFields = array();
		foreach($moduleFields as $fieldName => $fieldInstance) {
			if($fieldInstance->getPresence() === 1) {
				continue;
			}
			$accessibleFields[$fieldName] = $fieldInstance;
		}
		return $accessibleFields;
	}
开发者ID:nvh3010,项目名称:quancrm,代码行数:18,代码来源:Import_Index_Controller.php

示例8: wsapp_getRecordEntityNameIds

function wsapp_getRecordEntityNameIds($entityNames, $modules, $user)
{
    $entityMetaList = array();
    $db = PearDatabase::getInstance();
    if (empty($entityNames)) {
        return;
    }
    if (!is_array($entityNames)) {
        $entityNames = array($entityNames);
    }
    if (empty($modules)) {
        return array();
    }
    if (!is_array($modules)) {
        $modules = array($modules);
    }
    $entityNameIds = array();
    foreach ($modules as $moduleName) {
        if (empty($entityMetaList[$moduleName])) {
            $handler = vtws_getModuleHandlerFromName($moduleName, $user);
            $meta = $handler->getMeta();
            $entityMetaList[$moduleName] = $meta;
        }
        $meta = $entityMetaList[$moduleName];
        $nameFieldsArray = explode(",", $meta->getNameFields());
        if (count($nameFieldsArray) > 1) {
            $nameFields = "concat(" . implode(",' ',", $nameFieldsArray) . ")";
        } else {
            $nameFields = $nameFieldsArray[0];
        }
        $query = "SELECT " . $meta->getObectIndexColumn() . " as id,{$nameFields} as entityname FROM " . $meta->getEntityBaseTable() . " as moduleentity INNER JOIN vtiger_crmentity as crmentity WHERE {$nameFields} IN(" . generateQuestionMarks($entityNames) . ") AND crmentity.deleted=0 AND crmentity.crmid = moduleentity." . $meta->getObectIndexColumn() . "";
        $result = $db->pquery($query, $entityNames);
        $num_rows = $db->num_rows($result);
        for ($i = 0; $i < $num_rows; $i++) {
            $id = $db->query_result($result, $i, 'id');
            $entityName = $db->query_result($result, $i, 'entityname');
            $entityNameIds[decode_html($entityName)] = vtws_getWebserviceEntityId($moduleName, $id);
        }
    }
    return $entityNameIds;
}
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:41,代码来源:Utils.php

示例9: lookupMailInVtiger

 static function lookupMailInVtiger($searchTerm, $user)
 {
     $handler = vtws_getModuleHandlerFromName('Emails', $user);
     $meta = $handler->getMeta();
     $moduleFields = $meta->getModuleFields();
     $parentIdFieldInstance = $moduleFields['parent_id'];
     $referenceModules = $parentIdFieldInstance->getReferenceList();
     $filteredResult = array();
     foreach ($referenceModules as $referenceModule) {
         $referenceModuleHandler = vtws_getModuleHandlerFromName($referenceModule, $user);
         $referenceModuleMeta = $referenceModuleHandler->getMeta();
         $referenceModuleEmailFields = $referenceModuleMeta->getEmailFields();
         $referenceModuleEntityFields = $referenceModuleMeta->getNameFields();
         $referenceModuleEntityFieldsArray = explode(',', $referenceModuleEntityFields);
         $searchFieldList = array_merge($referenceModuleEmailFields, $referenceModuleEntityFieldsArray);
         if (!empty($searchFieldList) && !empty($referenceModuleEmailFields)) {
             $searchFieldListString = implode(',', $referenceModuleEmailFields);
             $where = null;
             for ($i = 0; $i < count($searchFieldList); $i++) {
                 if ($i == count($searchFieldList) - 1) {
                     $where .= sprintf($searchFieldList[$i] . " like '%s'", $searchTerm);
                 } else {
                     $where .= sprintf($searchFieldList[$i] . " like '%s' or ", $searchTerm);
                 }
             }
             if (!empty($where)) {
                 $where = "WHERE {$where}";
             }
             $result = vtws_query("select {$searchFieldListString} from {$referenceModule} {$where};", $user);
             foreach ($result as $record) {
                 foreach ($searchFieldList as $searchField) {
                     if (!empty($record[$searchField])) {
                         $filteredResult[] = array('id' => $record[$searchField], 'name' => $record[$searchField] . " - " . getTranslatedString($referenceModule), 'record' => $record['id']);
                     }
                 }
             }
         }
     }
     return $filteredResult;
 }
开发者ID:casati-dolibarr,项目名称:corebos,代码行数:40,代码来源:MailManager.php

示例10: __CreateNewEmail

 /**
  * Create new Email record (and link to given record) including attachments
  * @global Users $current_user
  * @global PearDataBase $db
  * @param  MailManager_Message_Model $mailrecord
  * @param String $module
  * @param CRMEntity $linkfocus
  * @return Integer
  */
 public function __CreateNewEmail($mailrecord, $module, $linkfocus)
 {
     $currentUserModel = Users_Record_Model::getCurrentUserModel();
     $handler = vtws_getModuleHandlerFromName('Emails', $currentUserModel);
     $meta = $handler->getMeta();
     if ($meta->hasWriteAccess() != true) {
         return false;
     }
     $recordModel = Vtiger_Record_Model::getCleanInstance('Emails');
     $recordModel->set('subject', $mailrecord->_subject);
     if (!empty($module)) {
         $recordModel->set('parent_type', $module);
     }
     if (!empty($linkfocus->id)) {
         $recordModel->set('parent_id', "{$linkfocus->id}@-1|");
     }
     $recordModel->set('description', $mailrecord->getBodyHTML());
     $recordModel->set('assigned_user_id', $currentUserModel->get('id'));
     //Opensource fix mailmanager related data
     $recordModel->set('date_start', date('Y-m-d', $mailrecord->_date));
     $recordModel->set('time_start', date('H:i', $mailrecord->_date));
     $recordModel->set('email_flag', 'MailManager');
     $from = $mailrecord->_from[0];
     $to = $mailrecord->_to[0];
     $cc = !empty($mailrecord->_cc) ? implode(',', $mailrecord->_cc) : '';
     $bcc = !empty($mailrecord->_bcc) ? implode(',', $mailrecord->_bcc) : '';
     //emails field were restructured and to,bcc and cc field are JSON arrays
     $recordModel->set('from_email', $from);
     $recordModel->set('saved_toid', $to);
     $recordModel->set('ccmail', $cc);
     $recordModel->set('bccmail', $bcc);
     $recordModel->save();
     // TODO: Handle attachments of the mail (inline/file)
     $this->__SaveAttachements($mailrecord, 'Emails', $recordModel);
     return $recordModel->getId();
 }
开发者ID:cannking,项目名称:vtigercrm-debug,代码行数:45,代码来源:Relate.php

示例11: yy_r41

 function yy_r41()
 {
     global $adb;
     if (!$this->out['meta']) {
         $module = $this->out['moduleName'];
         $handler = vtws_getModuleHandlerFromName($module, $this->user);
         $objectMeta = $handler->getMeta();
         $this->out['meta'] = $objectMeta;
         $meta = $this->out['meta'];
         $fieldcol = $meta->getFieldColumnMapping();
         $columns = array();
         if (in_array('*', $this->out['column_list'])) {
             $columns = array_values($fieldcol);
         } elseif (!in_array('count(*)', array_map(strtolower, $this->out['column_list']))) {
             foreach ($this->out['column_list'] as $ind => $field) {
                 $columns[] = $fieldcol[$field];
             }
         }
         if ($this->out['where_condition']) {
             foreach ($this->out['where_condition']['column_names'] as $ind => $field) {
                 $columns[] = $fieldcol[$field];
             }
         }
         $tables = $this->getTables($this->out, $columns);
         if (!in_array($objectMeta->getEntityBaseTable(), $tables)) {
             $tables[] = $objectMeta->getEntityBaseTable();
         }
         $defaultTableList = $objectMeta->getEntityDefaultTableList();
         foreach ($defaultTableList as $tableName) {
             if (!in_array($tableName, $tables)) {
                 array_push($tables, $tableName);
             }
         }
         $firstTable = $objectMeta->getEntityBaseTable();
         $tabNameIndex = $objectMeta->getEntityTableIndexList();
         $firstIndex = $tabNameIndex[$firstTable];
         foreach ($tables as $ind => $table) {
             if ($firstTable != $table) {
                 if (!isset($tabNameIndex[$table]) && $table == "vtiger_crmentity") {
                     $this->out['defaultJoinConditions'] = $this->out['defaultJoinConditions'] . " LEFT JOIN {$table} ON {$firstTable}.{$firstIndex}={$table}.crmid";
                 } else {
                     $this->out['defaultJoinConditions'] = $this->out['defaultJoinConditions'] . " LEFT JOIN {$table} ON {$firstTable}.{$firstIndex}={$table}.{$tabNameIndex[$table]}";
                 }
             } else {
                 $this->out['tableName'] = $table;
             }
         }
     }
 }
开发者ID:cannking,项目名称:vtigercrm-debug,代码行数:49,代码来源:VTQL_Parser.php

示例12: createEntityRecord

 public function createEntityRecord($moduleName, $entityLabel)
 {
     $moduleHandler = vtws_getModuleHandlerFromName($moduleName, $this->user);
     $moduleMeta = $moduleHandler->getMeta();
     $moduleFields = $moduleMeta->getModuleFields();
     $mandatoryFields = $moduleMeta->getMandatoryFields();
     $entityNameFieldsString = $moduleMeta->getNameFields();
     $entityNameFields = explode(',', $entityNameFieldsString);
     $fieldData = array();
     foreach ($entityNameFields as $entityNameField) {
         $entityNameField = trim($entityNameField);
         if (in_array($entityNameField, $mandatoryFields)) {
             $fieldData[$entityNameField] = $entityLabel;
         }
     }
     foreach ($mandatoryFields as $mandatoryField) {
         if (empty($fieldData[$mandatoryField])) {
             $fieldInstance = $moduleFields[$mandatoryField];
             if ($fieldInstance->getFieldDataType() == 'owner') {
                 $fieldData[$mandatoryField] = $this->user->id;
             } else {
                 $defaultValue = $fieldInstance->getDefault();
                 if (!empty($defaultValue)) {
                     $fieldData[$mandatoryField] = $defaultValue;
                 } else {
                     $fieldData[$mandatoryField] = '????';
                 }
             }
         }
     }
     $fieldData = DataTransform::sanitizeData($fieldData, $moduleMeta);
     $entityIdInfo = vtws_create($moduleName, $fieldData, $this->user);
     $focus = CRMEntity::getInstance($moduleName);
     $focus->updateMissingSeqNumber($moduleName);
     return $entityIdInfo;
 }
开发者ID:casati-dolibarr,项目名称:corebos,代码行数:36,代码来源:Import_Data_Controller.php

示例13: getWhereClause


//.........这里部分代码省略.........
                     $endDateValue = explode(' ', $values[1]);
                     if ($startDateValue[1] == '00:00:00' && ($endDateValue[1] == '00:00:00' || $endDateValue[1] == '23:59:59')) {
                         $fieldSql .= "{$fieldGlue} CAST(" . $field->getTableName() . '.' . $field->getColumnName() . " AS DATE) {$valueSql}";
                     } else {
                         $fieldSql .= "{$fieldGlue} " . $field->getTableName() . '.' . $field->getColumnName() . ' ' . $valueSql;
                     }
                 } elseif ($operator == 'between' || $operator == 'notequal' || $operator == 'a' || $operator == 'b') {
                     $fieldSql .= "{$fieldGlue} " . $field->getTableName() . '.' . $field->getColumnName() . ' ' . $valueSql;
                 } else {
                     $values = explode(' ', $value);
                     if ($values[1] == '00:00:00') {
                         $fieldSql .= "{$fieldGlue} CAST(" . $field->getTableName() . '.' . $field->getColumnName() . " AS DATE) {$valueSql}";
                     } else {
                         $fieldSql .= "{$fieldGlue} " . $field->getTableName() . '.' . $field->getColumnName() . ' ' . $valueSql;
                     }
                 }
             } else {
                 if (($baseModule == 'Events' || $baseModule == 'Calendar') && ($field->getColumnName() == 'status' || $field->getColumnName() == 'eventstatus')) {
                     $otherFieldName = 'eventstatus';
                     if ($field->getColumnName() == 'eventstatus') {
                         $otherFieldName = 'taskstatus';
                     }
                     $otherField = $moduleFieldList[$otherFieldName];
                     $specialCondition = '';
                     $specialConditionForOtherField = '';
                     $conditionGlue = ' OR ';
                     if ($conditionInfo['operator'] == 'n' || $conditionInfo['operator'] == 'k' || $conditionInfo['operator'] == 'y') {
                         $conditionGlue = ' AND ';
                         if ($conditionInfo['operator'] == 'n') {
                             $specialCondition = ' OR ' . $field->getTableName() . '.' . $field->getColumnName() . ' IS NULL ';
                             if (!empty($otherField)) {
                                 $specialConditionForOtherField = ' OR ' . $otherField->getTableName() . '.' . $otherField->getColumnName() . ' IS NULL ';
                             }
                         }
                     }
                     $otherFieldValueSql = $valueSql;
                     if ($conditionInfo['operator'] == 'ny' && !empty($otherField)) {
                         $otherFieldValueSql = "IS NOT NULL AND " . $otherField->getTableName() . '.' . $otherField->getColumnName() . " != ''";
                     }
                     $fieldSql .= "{$fieldGlue} ((" . $field->getTableName() . '.' . $field->getColumnName() . ' ' . $valueSql . " {$specialCondition}) ";
                     if (!empty($otherField)) {
                         $fieldSql .= $conditionGlue . '(' . $otherField->getTableName() . '.' . $otherField->getColumnName() . ' ' . $otherFieldValueSql . ' ' . $specialConditionForOtherField . '))';
                     } else {
                         $fieldSql .= ')';
                     }
                 } else {
                     if ($fieldName == 'birthday' && !$this->isRelativeSearchOperators($conditionInfo['operator'])) {
                         $fieldSql .= "{$fieldGlue} DATE_FORMAT(" . $field->getTableName() . '.' . $field->getColumnName() . ",'%m%d') " . $valueSql;
                     } else {
                         $fieldSql .= "{$fieldGlue} " . $field->getTableName() . '.' . $field->getColumnName() . ' ' . $valueSql;
                     }
                 }
             }
             if (($conditionInfo['operator'] == 'n' || $conditionInfo['operator'] == 'k') && ($field->getFieldDataType() == 'owner' || $field->getFieldDataType() == 'picklist')) {
                 $fieldGlue = ' AND';
             } else {
                 $fieldGlue = ' OR';
             }
         }
         $fieldSql .= ')';
         $fieldSqlList[$index] = $fieldSql;
     }
     foreach ($this->manyToManyRelatedModuleConditions as $index => $conditionInfo) {
         $relatedModuleMeta = RelatedModuleMeta::getInstance($this->meta->getTabName(), $conditionInfo['relatedModule']);
         $relationInfo = $relatedModuleMeta->getRelationMeta();
         $relatedModule = $this->meta->getTabName();
         $fieldSql = "(" . $relationInfo['relationTable'] . '.' . $relationInfo[$conditionInfo['column']] . $conditionInfo['SQLOperator'] . $conditionInfo['value'] . ")";
         $fieldSqlList[$index] = $fieldSql;
     }
     // This is added to support reference module fields
     if ($this->referenceModuleField) {
         foreach ($this->referenceModuleField as $index => $conditionInfo) {
             $handler = vtws_getModuleHandlerFromName($conditionInfo['relatedModule'], $current_user);
             $meta = $handler->getMeta();
             $fieldName = $conditionInfo['fieldName'];
             $fields = $meta->getModuleFields();
             $fieldObject = $fields[$fieldName];
             $columnName = $fieldObject->getColumnName();
             $tableName = $fieldObject->getTableName();
             $valueSQL = $this->getConditionValue($conditionInfo['value'], $conditionInfo['SQLOperator'], $fieldObject);
             $fieldSql = "(" . $tableName . $conditionInfo['referenceField'] . '.' . $columnName . ' ' . $valueSQL[0] . ")";
             $fieldSqlList[$index] = $fieldSql;
         }
     }
     // This is needed as there can be condition in different order and there is an assumption in makeGroupSqlReplacements API
     // that it expects the array in an order and then replaces the sql with its the corresponding place
     ksort($fieldSqlList);
     $groupSql = $this->makeGroupSqlReplacements($fieldSqlList, $groupSql);
     if ($this->conditionInstanceCount > 0) {
         $this->conditionalWhere = $groupSql;
         $sql .= $groupSql;
     }
     if (!$onlyWhereQuery) {
         $sql .= " AND {$baseTable}.{$baseTableIndex} > 0";
         $instance = CRMEntity::getInstance($baseModule);
         $sql .= $instance->getUserAccessConditionsQuerySR($baseModule, $current_user);
     }
     $this->whereClause = $sql;
     return $sql;
 }
开发者ID:artisan4710,项目名称:YetiForceCRM,代码行数:101,代码来源:QueryGenerator.php

示例14: fillNonExistingMandatoryPicklistValues

	public function fillNonExistingMandatoryPicklistValues($recordList){
		//Meta is cached to eliminate overhead of doing the query every time to get the meta details(retrieveMeta)
		$modulesMetaCache = array();
		foreach($recordList as $index=>$recordDetails){
			if(!array_key_exists($recordDetails['module'], $modulesMetaCache)){
				$handler = vtws_getModuleHandlerFromName($recordDetails['module'], $this->user);
				$meta = $handler->getMeta();
				$modulesMetaCache[$recordDetails['module']] = $meta;
			}
			$moduleMeta = $modulesMetaCache[$recordDetails['module']];
			$mandatoryFieldsList = $meta->getMandatoryFields();
			$moduleFields = $meta->getModuleFields();
			foreach($mandatoryFieldsList as $fieldName){
				$fieldInstance = $moduleFields[$fieldName];
				if(empty($recordDetails[$fieldName]) &&
						($fieldInstance->getFieldDataType()=="multipicklist" || $fieldInstance->getFieldDataType()=="picklist")){
					$pickListDetails = $fieldInstance->getPicklistDetails($webserviceField);
					$defaultValue = $pickListDetails[0]['value'];
					$recordDetails[$fieldName] = $defaultValue;
				}
			}
			$recordList[$index]= $recordDetails;
		}
		return $recordList;
	}
开发者ID:nvh3010,项目名称:quancrm,代码行数:25,代码来源:vtigerCRMHandler.php

示例15: vtws_updateConvertLeadStatus

function vtws_updateConvertLeadStatus($entityIds, $leadId, $user)
{
    global $adb, $log;
    $leadIdComponents = vtws_getIdComponents($leadId);
    if ($entityIds['Accounts'] != '' || $entityIds['Contacts'] != '') {
        $sql = "UPDATE vtiger_leaddetails SET converted = 1 where leadid=?";
        $result = $adb->pquery($sql, array($leadIdComponents[1]));
        if ($result === false) {
            throw new WebServiceException(WebServiceErrorCode::$FAILED_TO_MARK_CONVERTED, "Failed mark lead converted");
        }
        //updating the campaign-lead relation --Minnie
        $sql = "DELETE FROM vtiger_campaignleadrel WHERE leadid=?";
        $adb->pquery($sql, array($leadIdComponents[1]));
        $sql = "DELETE FROM vtiger_tracker WHERE item_id=?";
        $adb->pquery($sql, array($leadIdComponents[1]));
        //update the modifiedtime and modified by information for the record
        $leadModifiedTime = $adb->formatDate(date('Y-m-d H:i:s'), true);
        $crmentityUpdateSql = "UPDATE vtiger_crmentity SET modifiedtime=?, modifiedby=? WHERE crmid=?";
        $adb->pquery($crmentityUpdateSql, array($leadModifiedTime, $user->id, $leadIdComponents[1]));
    }
    $moduleArray = array('Accounts', 'Contacts', 'Potentials');
    foreach ($moduleArray as $module) {
        if (!empty($entityIds[$module])) {
            $idComponents = vtws_getIdComponents($entityIds[$module]);
            $id = $idComponents[1];
            $webserviceModule = vtws_getModuleHandlerFromName($module, $user);
            $meta = $webserviceModule->getMeta();
            $fields = $meta->getModuleFields();
            $field = $fields['isconvertedfromlead'];
            $tablename = $field->getTableName();
            $tableList = $meta->getEntityTableIndexList();
            $tableIndex = $tableList[$tablename];
            $adb->pquery("UPDATE {$tablename} SET isconvertedfromlead = ? WHERE {$tableIndex} = ?", array(1, $id));
        }
    }
}
开发者ID:nouphet,项目名称:vtigercrm-6.0.0-ja,代码行数:36,代码来源:ConvertLead.php


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