• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP getEntityFieldNames函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: getFullNameFromArray

 static function getFullNameFromArray($module, $fieldValues)
 {
     $entityInfo = getEntityFieldNames($module);
     $fieldsName = $entityInfo['fieldname'];
     $displayName = self::getCurrentUserEntityFieldNameDisplay($module, $fieldsName, $fieldValues);
     return $displayName;
 }
开发者ID:yozhi,项目名称:YetiForceCRM,代码行数:7,代码来源:Deprecated.php


示例2: array

    $models = $_REQUEST['models'];
    global $log, $current_user;
    $log->debug('klm2 ' . $val_cond);
    $model_values = array();
    $model_values = json_decode($models);
    $nr = count($model_values);
    $mv = $model_values[$nr - 1];
    $focus = CRMEntity::getInstance("{$pointing_module}");
    $focus->retrieve_entity_info($mv->id, $pointing_module);
    $focus->id = $mv->id;
    $focus->mode = 'edit';
    for ($j = 0; $j < sizeof($col); $j++) {
        $focus->column_fields["{$col[$j]}"] = $mv->{$col}[$j];
        // all chosen columns
    }
    $entity_field_arr = getEntityFieldNames($pointing_module);
    $entity_field = $entity_field_arr["fieldname"];
    if (is_array($entity_field)) {
        $entityname = $entity_field[0];
    } else {
        $entityname = $entity_field;
    }
    $log->debug('albana2 ' . $entityname);
    $focus->column_fields["{$entityname}"] = $mv->{$col}[0] . ' ' . $mv->{$col}[1];
    //  the entityname field
    $log->debug('klm3 ' . $pointing_field_name . ' ' . $id);
    $focus->column_fields["assigned_user_id"] = $focus->column_fields["assigned_user_id"];
    $focus->save("{$pointing_module}");
} elseif ($kaction == 'delete') {
    require_once 'modules/' . $pointing_module . '/' . $pointing_module . '.php';
    $models = $_REQUEST['models'];
开发者ID:evolutivo,项目名称:test,代码行数:31,代码来源:kendo_block_project.php


示例3: getReferenceFieldColumnList

 function getReferenceFieldColumnList($moduleName, $fieldInfo)
 {
     $adb = PearDatabase::getInstance();
     $columnsSqlList = array();
     $fieldInstance = WebserviceField::fromArray($adb, $fieldInfo);
     $referenceModuleList = $fieldInstance->getReferenceList();
     $reportSecondaryModules = explode(':', $this->secondarymodule);
     if ($moduleName != $this->primarymodule && in_array($this->primarymodule, $referenceModuleList)) {
         $entityTableFieldNames = getEntityFieldNames($this->primarymodule);
         $entityTableName = $entityTableFieldNames['tablename'];
         $entityFieldNames = $entityTableFieldNames['fieldname'];
         $columnList = array();
         if (is_array($entityFieldNames)) {
             foreach ($entityFieldNames as $entityColumnName) {
                 $columnList["{$entityColumnName}"] = "{$entityTableName}.{$entityColumnName}";
             }
         } else {
             $columnList[] = "{$entityTableName}.{$entityFieldNames}";
         }
         if (count($columnList) > 1) {
             $columnSql = getSqlForNameInDisplayFormat($columnList, $this->primarymodule);
         } else {
             $columnSql = implode('', $columnList);
         }
         $columnsSqlList[] = $columnSql;
     } else {
         foreach ($referenceModuleList as $referenceModule) {
             $entityTableFieldNames = getEntityFieldNames($referenceModule);
             $entityTableName = $entityTableFieldNames['tablename'];
             $entityFieldNames = $entityTableFieldNames['fieldname'];
             $referenceTableName = '';
             $dependentTableName = '';
             if ($moduleName == 'HelpDesk' && $referenceModule == 'Accounts') {
                 $referenceTableName = 'vtiger_accountRelHelpDesk';
             } elseif ($moduleName == 'HelpDesk' && $referenceModule == 'Contacts') {
                 $referenceTableName = 'vtiger_contactdetailsRelHelpDesk';
             } elseif ($moduleName == 'HelpDesk' && $referenceModule == 'Products') {
                 $referenceTableName = 'vtiger_productsRel';
             } elseif ($moduleName == 'HelpDesk' && $referenceModule == 'Project') {
                 $referenceTableName = 'vtiger_projectRelHelpDesk';
             } elseif ($moduleName == 'Calendar' && $referenceModule == 'Accounts') {
                 $referenceTableName = 'vtiger_accountRelCalendar';
             } elseif ($moduleName == 'Calendar' && $referenceModule == 'Contacts') {
                 $referenceTableName = 'vtiger_contactdetailsCalendar';
             } elseif ($moduleName == 'Calendar' && $referenceModule == 'Leads') {
                 $referenceTableName = 'vtiger_leaddetailsRelCalendar';
             } elseif ($moduleName == 'Calendar' && $referenceModule == 'Potentials') {
                 $referenceTableName = 'vtiger_potentialRelCalendar';
             } elseif ($moduleName == 'Calendar' && $referenceModule == 'Invoice') {
                 $referenceTableName = 'vtiger_invoiceRelCalendar';
             } elseif ($moduleName == 'Calendar' && $referenceModule == 'Quotes') {
                 $referenceTableName = 'vtiger_quotesRelCalendar';
             } elseif ($moduleName == 'Calendar' && $referenceModule == 'PurchaseOrder') {
                 $referenceTableName = 'vtiger_purchaseorderRelCalendar';
             } elseif ($moduleName == 'Calendar' && $referenceModule == 'SalesOrder') {
                 $referenceTableName = 'vtiger_salesorderRelCalendar';
             } elseif ($moduleName == 'Calendar' && $referenceModule == 'HelpDesk') {
                 $referenceTableName = 'vtiger_troubleticketsRelCalendar';
             } elseif ($moduleName == 'Calendar' && $referenceModule == 'Campaigns') {
                 $referenceTableName = 'vtiger_campaignRelCalendar';
             } elseif ($moduleName == 'Contacts' && $referenceModule == 'Accounts') {
                 $referenceTableName = 'vtiger_accountContacts';
             } elseif ($moduleName == 'Contacts' && $referenceModule == 'Contacts') {
                 $referenceTableName = 'vtiger_contactdetailsContacts';
             } elseif ($moduleName == 'Accounts' && $referenceModule == 'Accounts') {
                 $referenceTableName = 'vtiger_accountAccounts';
             } elseif ($moduleName == 'Campaigns' && $referenceModule == 'Products') {
                 $referenceTableName = 'vtiger_productsCampaigns';
             } elseif ($moduleName == 'Faq' && $referenceModule == 'Products') {
                 $referenceTableName = 'vtiger_productsFaq';
             } elseif ($moduleName == 'Invoice' && $referenceModule == 'SalesOrder') {
                 $referenceTableName = 'vtiger_salesorderInvoice';
             } elseif ($moduleName == 'Invoice' && $referenceModule == 'Contacts') {
                 $referenceTableName = 'vtiger_contactdetailsInvoice';
             } elseif ($moduleName == 'Invoice' && $referenceModule == 'Accounts') {
                 $referenceTableName = 'vtiger_accountInvoice';
             } elseif ($moduleName == 'Potentials' && $referenceModule == 'Campaigns') {
                 $referenceTableName = 'vtiger_campaignPotentials';
             } elseif ($moduleName == 'Products' && $referenceModule == 'Vendors') {
                 $referenceTableName = 'vtiger_vendorRelProducts';
             } elseif ($moduleName == 'PurchaseOrder' && $referenceModule == 'Contacts') {
                 $referenceTableName = 'vtiger_contactdetailsPurchaseOrder';
             } elseif ($moduleName == 'PurchaseOrder' && $referenceModule == 'Vendors') {
                 $referenceTableName = 'vtiger_vendorRelPurchaseOrder';
             } elseif ($moduleName == 'Quotes' && $referenceModule == 'Potentials') {
                 $referenceTableName = 'vtiger_potentialRelQuotes';
             } elseif ($moduleName == 'Quotes' && $referenceModule == 'Accounts') {
                 $referenceTableName = 'vtiger_accountQuotes';
             } elseif ($moduleName == 'SalesOrder' && $referenceModule == 'Potentials') {
                 $referenceTableName = 'vtiger_potentialRelSalesOrder';
             } elseif ($moduleName == 'SalesOrder' && $referenceModule == 'Accounts') {
                 $referenceTableName = 'vtiger_accountSalesOrder';
             } elseif ($moduleName == 'SalesOrder' && $referenceModule == 'Contacts') {
                 $referenceTableName = 'vtiger_contactdetailsSalesOrder';
             } elseif ($moduleName == 'SalesOrder' && $referenceModule == 'Quotes') {
                 $referenceTableName = 'vtiger_quotesSalesOrder';
             } elseif ($moduleName == 'Potentials' && $referenceModule == 'Contacts') {
                 $referenceTableName = 'vtiger_contactdetailsPotentials';
             } elseif ($moduleName == 'Potentials' && $referenceModule == 'Accounts') {
                 $referenceTableName = 'vtiger_accountPotentials';
//.........这里部分代码省略.........
开发者ID:rcrrich,项目名称:UpdatePackages,代码行数:101,代码来源:ReportRun.php


示例4: getEntityTypeFromName

 public static function getEntityTypeFromName($entityName, $modules = false)
 {
     global $adb;
     if ($modules == false) {
         $modules = array();
         $result = $adb->pquery('SELECT modulename FROM vtiger_entityname', array());
         $noOfModules = $adb->num_rows($result);
         for ($i = 0; $i < $noOfModules; ++$i) {
             $modules[] = $adb->query_result($result, $i, 'modulename');
         }
     }
     foreach ($modules as $referenceModule) {
         $entityFieldInfo = getEntityFieldNames($referenceModule);
         $tableName = $entityFieldInfo['tablename'];
         $fieldsName = $entityFieldInfo['fieldname'];
         if (is_array($fieldsName)) {
             $concatSql = 'CONCAT(' . implode(",' ',", $fieldsName) . ')';
         } else {
             $concatSql = $fieldsName;
         }
         $entityQuery = "SELECT 1 FROM {$tableName} WHERE {$concatSql} = ?";
         $entityResult = $adb->pquery($entityQuery, array($entityName));
         $num_rows = $adb->num_rows($entityResult);
         if ($num_rows > 0) {
             return $referenceModule;
         }
     }
 }
开发者ID:casati-dolibarr,项目名称:corebos,代码行数:28,代码来源:CustomReportUtils.php


示例5: 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 {
                 if (!in_array($mandatoryField, $entityNameFields) && $fieldInstance->getFieldDataType() != 'reference') {
                     $fieldData[$mandatoryField] = '????';
                 }
             }
         }
     }
     $fieldData = DataTransform::sanitizeData($fieldData, $moduleMeta);
     $entityIdInfo = vtws_create($moduleName, $fieldData, $this->user);
     $adb = PearDatabase::getInstance();
     $entityIdComponents = vtws_getIdComponents($entityIdInfo['id']);
     $recordId = $entityIdComponents[1];
     $entityfields = getEntityFieldNames($moduleName);
     switch ($moduleName) {
         case 'HelpDesk':
             $entityfields['fieldname'] = array('ticket_title');
             break;
         case 'Documents':
             $entityfields['fieldname'] = array('notes_title');
             break;
         case 'Documents':
             $entityfields['fieldname'] = array('notes_title');
             break;
     }
     $label = '';
     if (is_array($entityfields['fieldname'])) {
         foreach ($entityfields['fieldname'] as $field) {
             $label .= $fieldData[$field] . " ";
         }
     } else {
         $label = $fieldData[$entityfields['fieldname']];
     }
     $label = trim($label);
     $adb->pquery('UPDATE vtiger_crmentity SET label=? WHERE crmid=?', array($label, $recordId));
     $recordModel = Vtiger_Record_Model::getCleanInstance($moduleName);
     $focus = $recordModel->getEntity();
     $focus->id = $recordId;
     $focus->column_fields = $fieldData;
     $this->entityData[] = VTEntityData::fromCRMEntity($focus);
     $focus->updateMissingSeqNumber($moduleName);
     return $entityIdInfo;
 }
开发者ID:cannking,项目名称:vtigercrm-debug,代码行数:62,代码来源:Data.php


示例6: createRecords


//.........这里部分代码省略.........
                 }
                 $query = $queryGenerator->getQuery();
                 $duplicatesResult = $adb->query($query);
                 $noOfDuplicates = $adb->num_rows($duplicatesResult);
                 if ($noOfDuplicates > 0) {
                     if ($mergeType == Import_Utils_Helper::$AUTO_MERGE_IGNORE) {
                         $entityInfo['status'] = self::$IMPORT_RECORD_SKIPPED;
                     } elseif ($mergeType == Import_Utils_Helper::$AUTO_MERGE_OVERWRITE || $mergeType == Import_Utils_Helper::$AUTO_MERGE_MERGEFIELDS) {
                         for ($index = 0; $index < $noOfDuplicates - 1; ++$index) {
                             $duplicateRecordId = $adb->query_result($duplicatesResult, $index, $fieldColumnMapping['id']);
                             $entityId = vtws_getId($moduleObjectId, $duplicateRecordId);
                             vtws_delete($entityId, $this->user);
                         }
                         $baseRecordId = $adb->query_result($duplicatesResult, $noOfDuplicates - 1, $fieldColumnMapping['id']);
                         $baseEntityId = vtws_getId($moduleObjectId, $baseRecordId);
                         if ($mergeType == Import_Utils_Helper::$AUTO_MERGE_OVERWRITE) {
                             $fieldData = $this->transformForImport($fieldData, $moduleMeta);
                             $fieldData['id'] = $baseEntityId;
                             $entityInfo = vtws_update($fieldData, $this->user);
                             $entityInfo['status'] = self::$IMPORT_RECORD_UPDATED;
                         }
                         if ($mergeType == Import_Utils_Helper::$AUTO_MERGE_MERGEFIELDS) {
                             $filteredFieldData = array();
                             foreach ($fieldData as $fieldName => $fieldValue) {
                                 if (!empty($fieldValue)) {
                                     $filteredFieldData[$fieldName] = $fieldValue;
                                 }
                             }
                             // Custom handling for default values & mandatory fields
                             // need to be taken care than normal import as we merge
                             // existing record values with newer values.
                             $fillDefault = false;
                             $mandatoryValueChecks = false;
                             $existingFieldValues = vtws_retrieve($baseEntityId, $this->user);
                             $defaultFieldValues = $this->getDefaultFieldValues($moduleMeta);
                             foreach ($existingFieldValues as $fieldName => $fieldValue) {
                                 if (empty($fieldValue) && empty($filteredFieldData[$fieldName]) && !empty($defaultFieldValues[$fieldName])) {
                                     $filteredFieldData[$fieldName] = $defaultFieldValues[$fieldName];
                                 }
                             }
                             $filteredFieldData = $this->transformForImport($filteredFieldData, $moduleMeta, $fillDefault, $mandatoryValueChecks);
                             $filteredFieldData['id'] = $baseEntityId;
                             $entityInfo = vtws_revise($filteredFieldData, $this->user);
                             $entityInfo['status'] = self::$IMPORT_RECORD_MERGED;
                         }
                     } else {
                         $createRecord = true;
                     }
                 } else {
                     $createRecord = true;
                 }
             } else {
                 $createRecord = true;
             }
             if ($createRecord) {
                 $fieldData = $this->transformForImport($fieldData, $moduleMeta);
                 if ($fieldData == null) {
                     $entityInfo = null;
                 } else {
                     try {
                         $entityInfo = vtws_create($moduleName, $fieldData, $this->user);
                     } catch (Exception $e) {
                     }
                 }
             }
         }
         if ($entityInfo == null) {
             $entityInfo = array('id' => null, 'status' => self::$IMPORT_RECORD_FAILED);
         } else {
             if ($createRecord) {
                 $entityInfo['status'] = self::$IMPORT_RECORD_CREATED;
                 $entityIdComponents = vtws_getIdComponents($entityInfo['id']);
                 $recordId = $entityIdComponents[1];
                 $entityfields = getEntityFieldNames($this->module);
                 switch ($this->module) {
                     case 'HelpDesk':
                         $entityfields['fieldname'] = array('ticket_title');
                         break;
                     case 'Documents':
                         $entityfields['fieldname'] = array('notes_title');
                         break;
                 }
                 $label = '';
                 if (is_array($entityfields['fieldname'])) {
                     foreach ($entityfields['fieldname'] as $field) {
                         $label .= $fieldData[$field] . " ";
                     }
                 } else {
                     $label = $fieldData[$entityfields['fieldname']];
                 }
                 $label = trim($label);
                 $adb->pquery('UPDATE vtiger_crmentity SET label=? WHERE crmid=?', array($label, $recordId));
             }
         }
         $this->importedRecordInfo[$rowId] = $entityInfo;
         $this->updateImportStatus($rowId, $entityInfo);
     }
     unset($result);
     return true;
 }
开发者ID:nouphet,项目名称:vtigercrm-6.0.0-ja,代码行数:101,代码来源:Data.php


示例7: getRelatedTo


//.........这里部分代码省略.........
        $module_icon = '<img src="themes/images/' . $parent_module . '.gif" alt="' . $app_strings[$parent_module] . '" title="' . $app_strings[$parent_module] . '" border=0 align=center> ';
    }
    $action = "DetailView";
    if ($parent_module == 'Accounts') {
        $parent_query = "SELECT accountname FROM vtiger_account WHERE accountid=?";
        $parent_result = $adb->pquery($parent_query, array($parent_id));
        $parent_name = textlength_check($adb->query_result($parent_result, 0, "accountname"));
    }
    if ($parent_module == 'Leads') {
        $parent_query = "SELECT firstname,lastname FROM vtiger_leaddetails WHERE leadid=?";
        $parent_result = $adb->pquery($parent_query, array($parent_id));
        $parent_name = getFullNameFromQResult($parent_result, 0, "Leads");
    }
    if ($parent_module == 'Potentials') {
        $parent_query = "SELECT potentialname FROM vtiger_potential WHERE potentialid=?";
        $parent_result = $adb->pquery($parent_query, array($parent_id));
        $parent_name = textlength_check($adb->query_result($parent_result, 0, "potentialname"));
    }
    if ($parent_module == 'Products') {
        $parent_query = "SELECT productname FROM vtiger_products WHERE productid=?";
        $parent_result = $adb->pquery($parent_query, array($parent_id));
        $parent_name = $adb->query_result($parent_result, 0, "productname");
    }
    if ($parent_module == 'Quotes') {
        $parent_query = "SELECT subject FROM vtiger_quotes WHERE quoteid=?";
        $parent_result = $adb->pquery($parent_query, array($parent_id));
        $parent_name = $adb->query_result($parent_result, 0, "subject");
    }
    if ($parent_module == 'PurchaseOrder') {
        $parent_query = "SELECT subject FROM vtiger_purchaseorder WHERE purchaseorderid=?";
        $parent_result = $adb->pquery($parent_query, array($parent_id));
        $parent_name = $adb->query_result($parent_result, 0, "subject");
    }
    if ($parent_module == 'Invoice') {
        $parent_query = "SELECT subject FROM vtiger_invoice WHERE invoiceid=?";
        $parent_result = $adb->pquery($parent_query, array($parent_id));
        $parent_name = $adb->query_result($parent_result, 0, "subject");
    }
    if ($parent_module == 'SalesOrder') {
        $parent_query = "SELECT subject FROM vtiger_salesorder WHERE salesorderid=?";
        $parent_result = $adb->pquery($parent_query, array($parent_id));
        $parent_name = $adb->query_result($parent_result, 0, "subject");
    }
    if ($parent_module == 'Contacts' && ($module == 'Emails' || $module == 'HelpDesk')) {
        $parent_query = "SELECT firstname,lastname FROM vtiger_contactdetails WHERE contactid=?";
        $parent_result = $adb->pquery($parent_query, array($parent_id));
        $parent_name = getFullNameFromQResult($parent_result, 0, "Contacts");
    }
    if ($parent_module == 'Vendors' && ($module == 'Emails' || $module == 'Calendar')) {
        //MSL
        $parent_query = "SELECT vendorname FROM vtiger_vendor WHERE vendorid=?";
        $parent_result = $adb->pquery($parent_query, array($parent_id));
        $parent_name = $adb->query_result($parent_result, 0, "vendorname");
    }
    if ($parent_module == 'Project' && $module == 'Emails') {
        $parent_query = "SELECT projectid,projectname FROM vtiger_project WHERE projectid=?";
        $parent_result = $adb->pquery($parent_query, array($parent_id));
        $parent_name = $adb->query_result($parent_result, 0, "projectname");
    }
    if ($parent_module == 'ProjectTask' && $module == 'Emails') {
        $parent_query = "SELECT projecttaskid,projecttaskname FROM vtiger_projecttask WHERE projecttaskid=?";
        $parent_result = $adb->pquery($parent_query, array($parent_id));
        $parent_name = $adb->query_result($parent_result, 0, "projecttaskname");
    }
    if ($parent_module == 'Potentials' && $module == 'Emails') {
        $parent_query = "SELECT potentialid,potentialname FROM vtiger_potential WHERE potentialid=?";
        $parent_result = $adb->pquery($parent_query, array($parent_id));
        $parent_name = $adb->query_result($parent_result, 0, "potentialname");
    }
    if ($parent_module == 'HelpDesk') {
        $parent_query = "SELECT title FROM vtiger_troubletickets WHERE ticketid=?";
        $parent_result = $adb->pquery($parent_query, array($parent_id));
        $parent_name = $adb->query_result($parent_result, 0, "title");
        //if(strlen($parent_name) > 25)
        //{
        $parent_name = textlength_check($parent_name);
        //}
    }
    if ($parent_module == 'Campaigns') {
        $parent_query = "SELECT campaignname FROM vtiger_campaign WHERE campaignid=?";
        $parent_result = $adb->pquery($parent_query, array($parent_id));
        $parent_name = $adb->query_result($parent_result, 0, "campaignname");
        //if(strlen($parent_name) > 25)
        //{
        $parent_name = textlength_check($parent_name);
        //}
    }
    //added by rdhital for better emails - Raju
    if ($parent_module == 'Multiple') {
        $parent_value = $parent_name;
    } else {
        $parent_value = $module_icon . "<a href='index.php?module=" . $parent_module . "&action=" . $action . "&record=" . $parent_id . "&parenttab=" . $tabname . "'>" . textlength_check($parent_name) . "</a>";
        $modMetaInfo = getEntityFieldNames($parent_module);
        $modEName = is_array($modMetaInfo['fieldname']) ? $modMetaInfo['fieldname'][0] : $modMetaInfo['fieldname'];
        $parent_value .= "<span type='vtlib_metainfo' vtrecordid='{$parent_id}' vtfieldname='{$modEName}' vtmodule='{$parent_module}' style='display:none;'></span>";
    }
    //code added by raju ends
    $log->debug("Exiting getRelatedTo method ...");
    return $parent_value;
}
开发者ID:jgjermeni,项目名称:corebos,代码行数:101,代码来源:ListViewUtils.php


示例8: getSqlForNameInDisplayFormat

function getSqlForNameInDisplayFormat($input, $module, $glue = ' ')
{
    $entity_field_info = getEntityFieldNames($module);
    $tableName = $entity_field_info['tablename'];
    $fieldsName = $entity_field_info['fieldname'];
    if (is_array($fieldsName)) {
        foreach ($fieldsName as $key => $value) {
            $formattedNameList[] = $input[$value];
        }
        $formattedNameListString = implode(",'" . $glue . "',", $formattedNameList);
    } else {
        $formattedNameListString = $input[$fieldsName];
    }
    $sqlString = concatNamesSql($formattedNameListString);
    return $sqlString;
}
开发者ID:shamimhasan,项目名称:Vtiger-CRM-5.4.0,代码行数:16,代码来源:CommonUtils.php


示例9: getNameFields

 public function getNameFields()
 {
     global $adb;
     $data = getEntityFieldNames(getTabModuleName($this->getEffectiveTabId()));
     $fieldNames = '';
     if ($data) {
         $fieldNames = $data['fieldname'];
         if (is_array($fieldNames)) {
             $fieldNames = implode(',', $fieldNames);
         }
     }
     return $fieldNames;
 }
开发者ID:Wasage,项目名称:werpa,代码行数:13,代码来源:VtigerCRMObjectMeta.php


示例10: getListViewEntries


//.........这里部分代码省略.........
                        $arr_evo_actions = explode(' |##| ', $value);
                        for ($fvalues = 0; $fvalues < sizeof($arr_evo_actions); $fvalues++) {
                            $roleid = $arr_evo_actions[$fvalues];
                            $rolename = getRoleName($roleid);
                            $content[$fvalues] = $rolename;
                        }
                    }
                    $value = textlength_check(implode(', ', $content));
                } elseif ($field->getFieldDataType() == 'skype') {
                    $value = $value != "" ? "<a href='skype:{$value}?call'>" . textlength_check($value) . "</a>" : "";
                } elseif ($field->getFieldDataType() == 'phone') {
                    if ($useAsterisk == 'true') {
                        $value = "<a href='javascript:;' onclick='startCall(&quot;{$value}&quot;, " . "&quot;{$recordId}&quot;)'>" . textlength_check($value) . "</a>";
                    } else {
                        $value = textlength_check($value);
                    }
                } elseif ($field->getFieldDataType() == 'reference') {
                    $referenceFieldInfoList = $this->queryGenerator->getReferenceFieldInfoList();
                    if (getTabid($currentModule) != $field->getTabId()) {
                        $modrel = getTabModuleName($field->getTabId());
                        $fieldName = str_replace($modrel . '.', "", $fieldName);
                    }
                    $moduleList = $referenceFieldInfoList[$fieldName];
                    if (count($moduleList) == 1) {
                        $parentModule = $moduleList[0];
                    } else {
                        $parentModule = $this->typeList[$value];
                    }
                    if (!empty($value) && !empty($this->nameList[$fieldName]) && !empty($parentModule)) {
                        $parentMeta = $this->queryGenerator->getMeta($parentModule);
                        $value = textlength_check($this->nameList[$fieldName][$value]);
                        if ($parentMeta->isModuleEntity() && $parentModule != "Users") {
                            $value = "<a href='index.php?module={$parentModule}&action=DetailView&" . "record={$rawValue}' title='" . getTranslatedString($parentModule, $parentModule) . "'>{$value}</a>";
                            $modMetaInfo = getEntityFieldNames($parentModule);
                            $fieldName = is_array($modMetaInfo['fieldname']) ? $modMetaInfo['fieldname'][0] : $modMetaInfo['fieldname'];
                            // vtlib customization: For listview javascript triggers
                            $value = "{$value} <span type='vtlib_metainfo' vtrecordid='{$rawValue}' vtfieldname=" . "'{$fieldName}' vtmodule='{$parentModule}' style='display:none;'></span>";
                        }
                    } else {
                        $value = '--';
                    }
                } elseif ($field->getFieldDataType() == 'owner') {
                    if ($fieldName != 'assigned_user_id' && strstr($fieldName, ".assigned_user_id")) {
                        $value = textlength_check($this->ownerNameListrel[$fieldName][$value]);
                    } else {
                        $value = textlength_check($this->ownerNameList[$fieldName][$value]);
                    }
                } elseif ($field->getUIType() == 25) {
                    //TODO clean request object reference.
                    $contactId = $_REQUEST['record'];
                    $emailId = $this->db->query_result($result, $i, "activityid");
                    $result1 = $this->db->pquery("SELECT access_count FROM vtiger_email_track WHERE " . "crmid=? AND mailid=?", array($contactId, $emailId));
                    $value = $this->db->query_result($result1, 0, "access_count");
                    if (!$value) {
                        $value = 0;
                    }
                } elseif ($field->getUIType() == 8) {
                    if (!empty($value)) {
                        $temp_val = html_entity_decode($value, ENT_QUOTES, $default_charset);
                        $json = new Zend_Json();
                        $value = vt_suppressHTMLTags(implode(',', $json->decode($temp_val)));
                    }
                } elseif (in_array($uitype, array(7, 9, 90))) {
                    $value = "<span align='right'>" . textlength_check($value) . "</div>";
                } elseif ($field->getUIType() == 55) {
                    $value = getTranslatedString($value, $currentModule);
开发者ID:kikojover,项目名称:corebos,代码行数:67,代码来源:ListViewController.php


示例11: search_query

 function search_query($result)
 {
     global $log;
     require_once 'include/utils/CommonUtils.php';
     $search_module = $result['Search']['module'][0]['modulename'];
     //$search_table=$result['Search'][0]['tablename'];
     $search_module_info = getEntityFieldNames($search_module);
     $select = "SELECT * from " . $search_module_info['tablename'] . " join vtiger_crmentity on \n        crmid=" . $search_module_info['tablename'] . "." . $search_module_info['entityidfield'] . " where deleted=0 and ";
     $rules = $result['Search']['rules'];
     for ($r = 0; $r < sizeof($rules); $r++) {
         $expected_values = '';
         $where = '';
         for ($rr = 0; $rr < sizeof($rules[$r]); $rr++) {
             $rule_field = trim($rules[$r][$rr]['field']);
             $rule_operator = $rules[$r][$rr]['operator'];
             $rule_alter_rule = $rules[$r][$rr]['alter_expectedvalue'];
             for ($f = 0; $f < sizeof($result['Search']['fields']); $f++) {
                 $fieldname = trim($result['Search']['fields'][$f]['fieldname']);
                 if ($rule_field === $fieldname) {
                     if ($where != '') {
                         $where .= " " . $rule_operator . " ";
                         $expected_values .= ',';
                     }
                     if ($rule_alter_rule['alter_operator'] != '') {
                         $expected_values .= $rule_alter_rule['alter_value'];
                     } else {
                         $expected_values .= $result['Search']['fields'][$f]['expectedvalue'];
                     }
                     $where .= " " . $fieldname . $result['Search']['fields'][$f]['operator'] . "? ";
                     $f = sizeof($result['Search']['fields']) + 1;
                 }
             }
         }
         $sql_array[] = array('select' => $select, 'where' => $where, 'expectedvalues' => $expected_values, 'update' => $result['Update']);
     }
     return $sql_array;
 }
开发者ID:kduqi,项目名称:corebos,代码行数:37,代码来源:cbMap_processes.php


示例12: getDisplaySQL

 public function getDisplaySQL($module, &$join_array, &$columns_array)
 {
     $entity_field_info = getEntityFieldNames($module);
     if (in_array($this->params["field_uitype"], array("52", "53", "77"))) {
         $join_tablename_alias = $this->params["join_tablename_alias"];
     } else {
         $join_tablename_alias = $this->params["join_tablename_alias"];
     }
     $fieldid_alias = "";
     if ($this->params["fieldid"] != "") {
         $fieldid_alias = "_" . $this->params["fieldid"];
     }
     $fld_cond = "";
     if (in_array($this->params["field_uitype"], array("52", "53", "77"))) {
         // User Names Start
         // first name | last name -> syntax
         $fld_cond .= "CASE WHEN vtiger_users{$fieldid_alias}.id IS NOT NULL THEN CONCAT(vtiger_users{$fieldid_alias}.first_name,IF(vtiger_users{$fieldid_alias}.first_name != '' AND vtiger_users{$fieldid_alias}.first_name IS NOT NULL,' ',''),vtiger_users{$fieldid_alias}.last_name) WHEN vtiger_groups{$fieldid_alias}.groupid IS NOT NULL THEN vtiger_groups{$fieldid_alias}.groupname END ";
         // last name | first name -> syntax
         // $fld_cond .= "CASE WHEN vtiger_users$fieldid_alias.id IS NOT NULL THEN CONCAT(vtiger_users$fieldid_alias.last_name,IF(vtiger_users$fieldid_alias.first_name != '' AND vtiger_users$fieldid_alias.first_name IS NOT NULL,' ',''),vtiger_users$fieldid_alias.first_name) WHEN vtiger_groups$fieldid_alias.groupid IS NOT NULL THEN vtiger_groups$fieldid_alias.groupname END ";
         // User Names End
         $display = $fld_cond . " AS " . $this->params["columnname"] . $fieldid_alias;
         $fld_string_h = "";
     } else {
         if (is_array($entity_field_info["fieldname"])) {
             $fld_cond .= "CONCAT(";
             $wi = 0;
             foreach ($entity_field_info["fieldname"] as $fieldvalue) {
                 $fld_cond .= $join_tablename_alias . "." . $fieldvalue;
                 if ($wi == 0) {
                     $fld_cond .= ",' ',";
                 }
                 $wi++;
             }
             $fld_cond .= ") ";
             $display = $fld_cond . " AS " . $this->params["columnname"] . $fieldid_alias;
         } else {
             $fld_cond .= $join_tablename_alias . "." . $entity_field_info["fieldname"];
             $display = $fld_cond . " AS " . $this->params["columnname"] . $fieldid_alias;
         }
         // $fld_string_h = $join_tablename_alias.".";
         $fld_string_h = "";
     }
     $display_arr["display"] = $display;
     $display_arr["fld_string"] = $fld_string_h . $this->params["columnname"] . $fieldid_alias;
     $hrefid = $join_tablename_alias . "." . $entity_field_info["entityidfield"] . " AS " . $this->params["columnname"] . $fieldid_alias . "_hid";
     $display_arr["hrefid"] = $hrefid;
     $display_arr["fld_cond"] = $fld_cond;
     return $display_arr;
 }
开发者ID:cin-system,项目名称:cinrepo,代码行数:49,代码来源:UIFactory.php


示例13: getDetailViewOutputHtml

/** This function returns the detail view form vtiger_field and and its properties in array format.
 * Param $uitype - UI type of the vtiger_field
 * Param $fieldname - Form vtiger_field name
 * Param $fieldlabel - Form vtiger_field label name
 * Param $col_fields - array contains the vtiger_fieldname and values
 * Param $generatedtype - Field generated type (default is 1)
 * Param $tabid - vtiger_tab id to which the Field belongs to (default is "")
 * Return type is an array
 */
function getDetailViewOutputHtml($uitype, $fieldname, $fieldlabel, $col_fields, $generatedtype, $tabid = '', $module = '')
{
    global $log;
    $log->debug("Entering getDetailViewOutputHtml(" . $uitype . "," . $fieldname . "," . $fieldlabel . "," . $col_fields . "," . $generatedtype . "," . $tabid . ") method ...");
    global $adb;
    global $mod_strings;
    global $app_strings;
    global $current_user;
    global $theme;
    $theme_path = "themes/" . $theme . "/";
    $image_path = $theme_path . "images/";
    $fieldlabel = from_html($fieldlabel);
    $custfld = '';
    $value = '';
    $arr_data = array();
    $label_fld = array();
    $data_fld = array();
    require 'user_privileges/user_privileges_' . $current_user->id . '.php';
    require 'user_privileges/sharing_privileges_' . $current_user->id . '.php';
    // vtlib customization: New uitype to handle relation between modules
    if ($uitype == '10') {
        $fieldlabel = getTranslatedString($fieldlabel, $module);
        $parent_id = $col_fields[$fieldname];
        if (!empty($parent_id)) {
            $parent_module = getSalesEntityType($parent_id);
            $valueTitle = getTranslatedString($parent_module, $parent_module);
            $displayValueArray = getEntityName($parent_module, $parent_id);
            if (!empty($displayValueArray)) {
                foreach ($displayValueArray as $key => $value) {
                    $displayValue = $value;
                }
            }
            // vtlib customization: For listview javascript triggers
            $modMetaInfo = getEntityFieldNames($parent_module);
            $modEName = is_array($modMetaInfo['fieldname']) ? $modMetaInfo['fieldname'][0] : $modMetaInfo['fieldname'];
            $vtlib_metainfo = "<span type='vtlib_metainfo' vtrecordid='{$parent_id}' vtfieldname=" . "'{$modEName}' vtmodule='{$parent_module}' style='display:none;'></span>";
            // END
            $label_fld = array($fieldlabel, "<a href='index.php?module={$parent_module}&action=DetailView&record={$parent_id}' title='{$valueTitle}'>{$displayValue}</a>{$vtlib_metainfo}");
        } else {
            $moduleSpecificMessage = 'MODULE_NOT_SELECTED';
            if ($mod_strings[$moduleSpecificMessage] != "") {
                $moduleSpecificMessage = $mod_strings[$moduleSpecificMessage];
            }
            $label_fld = array($fieldlabel, '');
        }
    } else {
        if ($uitype == 99) {
            $label_fld[] = getTranslatedString($fieldlabel, $module);
            $label_fld[] = $col_fields[$fieldname];
            if ($fieldname == 'confirm_password') {
                return null;
            }
        } elseif ($uitype == 116 || $uitype == 117) {
            $label_fld[] = getTranslatedString($fieldlabel, $module);
            $label_fld[] = getCurrencyName($col_fields[$fieldname]);
            $pick_query = "select * from vtiger_currency_info where currency_status = 'Active' and deleted=0";
            $pickListResult = $adb->pquery($pick_query, array());
            $noofpickrows = $adb->num_rows($pickListResult);
            //Mikecrowe fix to correctly default for custom pick lists
            $options = array();
            $found = false;
            for ($j = 0; $j < $noofpickrows; $j++) {
                $pickListValue = $adb->query_result($pickListResult, $j, 'currency_name');
                $currency_id = $adb->query_result($pickListResult, $j, 'id');
                if ($col_fields[$fieldname] == $currency_id) {
                    $chk_val = "selected";
                    $found = true;
                } else {
                    $chk_val = '';
                }
                $options[$currency_id] = array($pickListValue => $chk_val);
            }
            $label_fld["options"] = $options;
        } elseif ($uitype == 13 || $uitype == 104) {
            $label_fld[] = getTranslatedString($fieldlabel, $module);
            $label_fld[] = $col_fields[$fieldname];
        } elseif ($uitype == 16) {
            $label_fld[] = getTranslatedString($fieldlabel, $module);
            $label_fld[] = getTranslatedString($col_fields[$fieldname], $module);
            $fieldname = $adb->sql_escape_string($fieldname);
            $pick_query = "select {$fieldname} from vtiger_{$fieldname} order by sortorderid";
            $params = array();
            $pickListResult = $adb->pquery($pick_query, $params);
            $noofpickrows = $adb->num_rows($pickListResult);
            $options = array();
            $count = 0;
            $found = false;
            for ($j = 0; $j < $noofpickrows; $j++) {
                $pickListValue = decode_html($adb->query_result($pickListResult, $j, strtolower($fieldname)));
                $col_fields[$fieldname] = decode_html($col_fields[$fieldname]);
                if ($col_fields[$fieldname] == $pickListValue) {
//.........这里部分代码省略.........
开发者ID:jaimeaga84,项目名称:corebos,代码行数:101,代码来源:DetailViewUtils.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP getEntityName函数代码示例发布时间:2022-05-15
下一篇:
PHP getEntityField函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap