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

PHP vtws_describe函数代码示例

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

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



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

示例1: processRetrieve

 protected function processRetrieve(Mobile_API_Request $request)
 {
     $recordid = $request->get('record');
     // Create a template record for use
     if ($this->isTemplateRecordRequest($request)) {
         $current_user = $this->getActiveUser();
         $module = $this->detectModuleName($recordid);
         $describeInfo = vtws_describe($module, $current_user);
         Mobile_WS_Utils::fixDescribeFieldInfo($module, $describeInfo);
         $this->cacheDescribeInfo($describeInfo);
         $templateRecord = array();
         foreach ($describeInfo['fields'] as $describeField) {
             $templateFieldValue = '';
             if (isset($describeField['type']) && isset($describeField['type']['defaultValue'])) {
                 $templateFieldValue = $describeField['type']['defaultValue'];
             } else {
                 if (isset($describeField['default'])) {
                     $templateFieldValue = $describeField['default'];
                 }
             }
             $templateRecord[$describeField['name']] = $templateFieldValue;
         }
         if (isset($templateRecord['assigned_user_id'])) {
             $templateRecord['assigned_user_id'] = sprintf("%sx%s", Mobile_WS_Utils::getEntityModuleWSId('Users'), $current_user->id);
         }
         // Reset the record id
         $templateRecord['id'] = $recordid;
         return $templateRecord;
     }
     // Or else delgate the action to parent
     return parent::processRetrieve($request);
 }
开发者ID:nouphet,项目名称:vtigercrm-6.0.0-ja,代码行数:32,代码来源:FetchRecordWithGrouping.php


示例2: getModuleDescribe

 static function getModuleDescribe($module)
 {
     if (!isset(self::$moduleDescribeCache[$module])) {
         global $adb, $log, $current_user;
         self::$moduleDescribeCache[$module] = vtws_describe($module, $current_user);
     }
     return self::$moduleDescribeCache[$module];
 }
开发者ID:casati-dolibarr,项目名称:corebos,代码行数:8,代码来源:Webforms.php


示例3: process

 function process(Mobile_API_Request $request)
 {
     $current_user = $this->getActiveUser();
     $module = $request->get('module');
     $describeInfo = vtws_describe($module, $current_user);
     Mobile_WS_Utils::fixDescribeFieldInfo($module, $describeInfo);
     $response = new Mobile_API_Response();
     $response->setResult(array('describe' => $describeInfo));
     return $response;
 }
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:10,代码来源:Describe.php


示例4: getFieldInfo

 function getFieldInfo($module, $fieldname)
 {
     global $current_user;
     $describe = vtws_describe($module, $current_user);
     foreach ($describe['fields'] as $index => $fieldInfo) {
         if ($fieldInfo['name'] == $fieldname) {
             return $fieldInfo;
         }
     }
     return false;
 }
开发者ID:casati-dolibarr,项目名称:corebos,代码行数:11,代码来源:ConvertLeadUI.php


示例5: processQueryResultRecord

 function processQueryResultRecord($record, $user)
 {
     parent::processQueryResultRecord($record, $user);
     if ($this->cachedDescribeInfo() === false) {
         $describeInfo = vtws_describe($this->queryModule, $user);
         $this->cacheDescribeInfo($describeInfo);
     }
     $transformedRecord = $this->transformRecordWithGrouping($record, $this->queryModule);
     // Update entity fieldnames
     $transformedRecord['labelFields'] = $this->cachedEntityFieldnames($this->queryModule);
     return $transformedRecord;
 }
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:12,代码来源:QueryWithGrouping.php


示例6: transformToBlocks

 protected function transformToBlocks($module)
 {
     $current_user = $this->getActiveUser();
     $moduleFieldGroups = Mobile_WS_Utils::gatherModuleFieldGroupInfo($module);
     $describeInfo = vtws_describe($module, $current_user);
     Mobile_WS_Utils::fixDescribeFieldInfo($module, $describeInfo, $current_user);
     $modifiedResult = array();
     $blocks = array();
     $labelFields = false;
     foreach ($moduleFieldGroups as $blocklabel => $fieldgroups) {
         $fields = array();
         foreach ($fieldgroups as $fieldname => $fieldinfo) {
             $field['name'] = $fieldname;
             $field['value'] = '';
             $field['label'] = $fieldinfo['label'];
             $field['uitype'] = $fieldinfo['uitype'];
             $field['typeofdata'] = $fieldinfo['typeofdata'];
             foreach ($describeInfo['fields'] as $describeField) {
                 if ($describeField['name'] == $fieldname) {
                     $field['type'] = '';
                     if (isset($describeField['type']) && $describeField['type'] != '') {
                         $picklistValues = $describeField['type']['picklistValues'];
                         $field['type']['value'] = array('value' => $picklistValues, 'name' => $fieldname);
                     }
                 }
             }
             if ($field['uitype'] == '51' || $field['uitype'] == '59' || $field['uitype'] == '10') {
                 $field['relatedmodule'] = Mobile_WS_Utils::getEntityName($field['name'], $module);
             }
             $fields[] = $field;
         }
         $blocks[] = array('label' => $blocklabel, 'fields' => $fields);
     }
     $sections = array();
     $moduleFieldGroupKeys = array_keys($moduleFieldGroups);
     foreach ($moduleFieldGroupKeys as $blocklabel) {
         // eliminate empty blocks
         if (isset($groups[$blocklabel]) && !empty($groups[$blocklabel])) {
             $sections[] = array('label' => $blocklabel, 'count' => count($groups[$blocklabel]));
         }
     }
     $modifiedResult = array('blocks' => $blocks, 'id' => $resultRecord['id']);
     if ($labelFields) {
         $modifiedResult['labelFields'] = $labelFields;
     }
     return $modifiedResult;
 }
开发者ID:kduqi,项目名称:corebos,代码行数:47,代码来源:Describe.php


示例7: prepareWhereClause

 function prepareWhereClause($fieldnames = false)
 {
     $whereClause = '';
     $searchString = $this->criterias['search'];
     $fieldnames = isset($this->criterias['fieldnames']) ? $this->criterias['fieldnames'] : false;
     include_once 'include/Webservices/DescribeObject.php';
     $describeInfo = vtws_describe($this->moduleName, $this->getUser());
     $fieldinfos = array();
     if ($fieldnames === false) {
         foreach ($describeInfo['fields'] as $fieldinfo) {
             $fieldmodel = new Mobile_UI_FieldModel();
             $fieldmodel->initData($fieldinfo);
             if (!$fieldmodel->isReferenceType()) {
                 $fieldinfos[$fieldinfo['name']] = $fieldmodel;
             }
         }
     } else {
         foreach ($describeInfo['fields'] as $fieldinfo) {
             if (in_array($fieldinfo['name'], $fieldnames)) {
                 $fieldmodel = new Mobile_UI_FieldModel();
                 $fieldmodel->initData($fieldinfo);
                 if (!$fieldmodel->isReferenceType()) {
                     $fieldinfos[$fieldinfo['name']] = $fieldmodel;
                 }
             }
         }
     }
     if (isset($fieldinfos['id'])) {
         unset($fieldinfos['id']);
     }
     if (!empty($fieldinfos)) {
         $fieldinfos['_'] = '';
         // Hack to build the where clause at once
         $whereClause = sprintf("WHERE %s", implode(" LIKE '%{$searchString}%' OR ", array_keys($fieldinfos)));
         $whereClause = rtrim($whereClause, 'OR _');
     }
     return $whereClause;
 }
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:38,代码来源:SearchFilter.php


示例8: getModuleDescribe

 static function getModuleDescribe($module)
 {
     if (!isset(self::$moduleDescribeCache[$module])) {
         $adb = PearDatabase::getInstance();
         $current_user = vglobal('current_user');
         $log = vglobal('log');
         self::$moduleDescribeCache[$module] = vtws_describe($module, $current_user);
     }
     return self::$moduleDescribeCache[$module];
 }
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:10,代码来源:Webforms.php


示例9: process

 function process(Mobile_API_Request $request)
 {
     $current_user = $this->getActiveUser();
     $current_user_wsid = sprintf("%sx%s", Mobile_WS_Utils::getEntityModuleWSId("Users"), $current_user->id);
     $module = $request->get('module');
     $lastSyncTime = $request->get('syncToken', 0);
     $currentPage = intval($request->get('page', 0));
     $isPrivateMode = $this->isModePrivate($request);
     $FETCH_LIMIT = Mobile::config('API_RECORD_FETCH_LIMIT');
     $startLimit = $currentPage * $FETCH_LIMIT;
     // Keep track of sync-token for futher reference
     $maxSyncTime = $lastSyncTime;
     $describeInfo = vtws_describe($module, $current_user);
     $this->cacheDescribeInfo($describeInfo);
     $hasAssignedToField = false;
     foreach ($describeInfo['fields'] as $fieldinfo) {
         if ($fieldinfo['name'] == 'assigned_user_id') {
             $hasAssignedToField = true;
             break;
         }
     }
     /////////////////////////////
     // MODIFIED RECORDS TRACKING
     /////////////////////////////
     if (empty($lastSyncTime)) {
         // No previous state information available? Lookup records recently modified
         if ($hasAssignedToField && $isPrivateMode) {
             $queryActive = sprintf("SELECT * FROM %s WHERE assigned_user_id = '%s' ORDER BY modifiedtime DESC", $module, $current_user_wsid);
         } else {
             $queryActive = sprintf("SELECT * FROM %s ORDER BY modifiedtime DESC", $module);
         }
     } else {
         // Attempt to lookup records from previous state
         if ($hasAssignedToField && $isPrivateMode) {
             $queryActive = sprintf("SELECT * FROM %s WHERE assigned_user_id = '%s' AND modifiedtime > '%s'", $module, $current_user_wsid, date("Y-m-d H:i:s", $lastSyncTime));
         } else {
             $queryActive = sprintf("SELECT * FROM %s WHERE modifiedtime > '%s'", $module, date("Y-m-d H:i:s", $lastSyncTime));
         }
     }
     // Try to fetch record with paging (one extra record fetch is attempted to determine presence of next page)
     $activeQuery = sprintf("%s LIMIT %u,%u;", $queryActive, $startLimit, $FETCH_LIMIT + 1);
     $activeResult = vtws_query($activeQuery, $current_user);
     // Determine paging
     $hasNextPage = count($activeResult) > $FETCH_LIMIT;
     // Special case handling merge Events records
     if ($module == 'Calendar') {
         $activeResult2 = vtws_query(str_replace('Calendar', 'Events', $activeQuery), $current_user);
         if (!empty($activeResult2)) {
             $activeResult = array_merge($activeResult, $activeResult2);
             if (!$hasNextPage) {
                 // If there was not Calendar next-page of records - check with Events
                 $hasNextPage = count($activeResult) > $FETCH_LIMIT;
             }
         }
         // Indicator that we fetched both Calendar+Events
         $FETCH_LIMIT *= 2;
     }
     $nextPage = 0;
     if ($hasNextPage) {
         array_pop($activeResult);
         // Avoid sending next page record now
         $nextPage = $currentPage + 1;
     }
     // Resolved record details
     $resolvedModifiedRecords = array();
     $resolvedDeletedRecords = array();
     if (!empty($activeResult)) {
         foreach ($activeResult as $recordValues) {
             $this->resolveRecordValues($recordValues, $current_user);
             $transformedRecord = $this->transformRecordWithGrouping($recordValues, $module);
             // Update entity fieldnames
             $transformedRecord['labelFields'] = $this->cachedEntityFieldnames($module);
             $resolvedModifiedRecords[] = $transformedRecord;
             $modifiedTimeInSeconds = strtotime($recordValues['modifiedtime']);
             if ($maxSyncTime < $modifiedTimeInSeconds) {
                 $maxSyncTime = $modifiedTimeInSeconds;
             }
         }
     }
     ////////////////////////////
     // DELETED RECORDS TRACKING
     ////////////////////////////
     // Only when there is previous state information and is first page
     if (!empty($lastSyncTime) && $currentPage === 0) {
         $adb = PearDatabase::getInstance();
         $queryDeletedParameters = array($module, date('Y-m-d H:i:s', $lastSyncTime));
         $andsmowneridequal = "";
         if ($hasAssignedToField) {
             if ($isPrivateMode) {
                 $queryDeletedParameters[] = $current_user->id;
                 $andsmowneridequal = " AND vtiger_crmentity.smownerid=?";
             } else {
                 $andsmowneridequal = Mobile_WS_Utils::querySecurityFromSuffix($module, $current_user);
             }
         }
         // Since Calendar and Events are merged
         if ($module == 'Calendar') {
             $queryDeleted = $adb->pquery("SELECT activityid as crmid, activitytype as setype FROM vtiger_activity\n\t\t\t\t\tINNER JOIN vtiger_crmentity ON vtiger_activity.activityid=vtiger_crmentity.crmid\n\t\t\t\t\tAND vtiger_crmentity.deleted=1 AND vtiger_crmentity.setype=? AND vtiger_crmentity.modifiedtime > ?\n\t\t\t\t\tLEFT JOIN vtiger_users ON vtiger_users.id = vtiger_crmentity.smownerid\n\t\t\t\t\tLEFT JOIN vtiger_groups ON vtiger_groups.groupid = vtiger_crmentity.smownerid WHERE 1=1\t{$andsmowneridequal} ", $queryDeletedParameters);
         } else {
             if ($module == 'Leads') {
//.........这里部分代码省略.........
开发者ID:yozhi,项目名称:YetiForceCRM,代码行数:101,代码来源:SyncModuleRecords.php


示例10: vtws_getConvertLeadFieldInfo

function vtws_getConvertLeadFieldInfo($module, $fieldname)
{
    $adb = PearDatabase::getInstance();
    $log = vglobal('log');
    $describe = vtws_describe($module, vglobal('current_user'));
    foreach ($describe['fields'] as $index => $fieldInfo) {
        if ($fieldInfo['name'] == $fieldname) {
            return $fieldInfo;
        }
    }
    return false;
}
开发者ID:rcrrich,项目名称:YetiForceCRM,代码行数:12,代码来源:ConvertLead.php


示例11: ws_describe

 public function ws_describe($module)
 {
     $currentUserModel = Users_Record_Model::getCurrentUserModel();
     if (!isset($this->wsDescribeCache[$module])) {
         $this->wsDescribeCache[$module] = vtws_describe($module, $currentUserModel);
     }
     return $this->wsDescribeCache[$module];
 }
开发者ID:cannking,项目名称:vtigercrm-debug,代码行数:8,代码来源:Relation.php


示例12: getSelectClauseFields

function getSelectClauseFields($module, $moduleMeta, $user)
{
    $moduleFieldNames = $moduleMeta->getModuleFields();
    $inventoryModules = getInventoryModules();
    if (in_array($module, $inventoryModules)) {
        $fields = vtws_describe('LineItem', $user);
        foreach ($fields['fields'] as $field) {
            unset($moduleFieldNames[$field['name']]);
        }
        foreach ($moduleFieldNames as $field => $fieldObj) {
            if (substr($field, 0, 5) == 'shtax') {
                unset($moduleFieldNames[$field]);
            }
        }
    }
    return array_keys($moduleFieldNames);
}
开发者ID:cannking,项目名称:vtigercrm-debug,代码行数:17,代码来源:GetUpdates.php


示例13: describe

 public function describe($module)
 {
     return vtws_describe($module, $this->restUser);
 }
开发者ID:DeliveryPLANET,项目名称:vTiger,代码行数:4,代码来源:OperationController.php


示例14: describeModule

 public static function describeModule($moduleName, $loadReferences = false, $nameFormat = "###")
 {
     global $current_user;
     ${${"GLOBALS"}["uhkocv"]} = array("assigned_user_id" => "smownerid");
     ${"GLOBALS"}["hkmwbevsdqg"] = "return";
     ${${"GLOBALS"}["lqknchhdhei"]} = array();
     $qtbkdju = "return";
     $jtxnyueqcz = "return";
     $siqaaqkg = "user";
     $zgsppbmobo = "a";
     $zxkoteptgi = "moduleName";
     require_once "include/Webservices/DescribeObject.php";
     $ggfktqje = "return";
     ${"GLOBALS"}["hetdnksroqie"] = "availUser";
     $vlxutd = "refFields";
     ${$vlxutd} = array();
     ${$ggfktqje} = array();
     ${"GLOBALS"}["xldevyyog"] = "sql";
     ${${"GLOBALS"}["jhobljegj"]} = vtws_describe(${$zxkoteptgi}, ${${"GLOBALS"}["cveuguwbj"]});
     ${${"GLOBALS"}["rfzzycoqwhw"]}["crmid"] = array("name" => "crmid", "label" => "ID", "mandatory" => false, "type" => array("name" => "string"), "editable" => false);
     ${"GLOBALS"}["uxurbdlld"] = "a";
     $pdiyggeicd = "group";
     $dafpvby = "sql";
     foreach (${${"GLOBALS"}["jhobljegj"]}["fields"] as ${${"GLOBALS"}["iswxctbj"]}) {
         ${"GLOBALS"}["ioqymje"] = "columnsRewrites";
         ${"GLOBALS"}["cyinkwahefe"] = "return";
         ${"GLOBALS"}["xsptvgg"] = "field";
         $hmmnqqbaqa = "field";
         $ouvgdvatp = "field";
         $ilapibb = "loadReferences";
         if (!empty(${${"GLOBALS"}["ioqymje"]}[${$ouvgdvatp}["name"]])) {
             ${"GLOBALS"}["cwpknl"] = "field";
             ${"GLOBALS"}["iogfgqnp"] = "columnsRewrites";
             ${${"GLOBALS"}["cwpknl"]}["name"] = ${${"GLOBALS"}["iogfgqnp"]}[${${"GLOBALS"}["iswxctbj"]}["name"]];
         }
         ${"GLOBALS"}["bvfqijt"] = "fieldName";
         if (${${"GLOBALS"}["xsptvgg"]}["name"] == "smownerid") {
             ${${"GLOBALS"}["iswxctbj"]}["type"]["name"] = "reference";
             ${${"GLOBALS"}["iswxctbj"]}["type"]["refersTo"] = array("Users");
         }
         if (${$hmmnqqbaqa}["type"]["name"] == "reference" && ${$ilapibb} == true) {
             foreach (${${"GLOBALS"}["iswxctbj"]}["type"]["refersTo"] as ${${"GLOBALS"}["qkbrwmmwlmib"]}) {
                 $bfzesvvbgw = "refFields";
                 ${"GLOBALS"}["nhprxyye"] = "refModule";
                 $tcivtpb = "field";
                 $objevhwcxbw = "loadedRefModules";
                 ${$bfzesvvbgw} = array_merge(${${"GLOBALS"}["novyhahuz"]}, self::describeModule(${${"GLOBALS"}["qkbrwmmwlmib"]}, false, "(" . ${$tcivtpb}["name"] . ": (" . ${${"GLOBALS"}["nhprxyye"]} . ") ###)"));
                 ${$objevhwcxbw}[${${"GLOBALS"}["qkbrwmmwlmib"]}] = "1";
             }
         }
         ${"GLOBALS"}["smqweohswsw"] = "fieldName";
         ${${"GLOBALS"}["bvfqijt"]} = str_replace("###", ${${"GLOBALS"}["iswxctbj"]}["name"], ${${"GLOBALS"}["natytqu"]});
         ${${"GLOBALS"}["cyinkwahefe"]}[${${"GLOBALS"}["smqweohswsw"]}] = ${${"GLOBALS"}["iswxctbj"]};
     }
     global $adb;
     ${${"GLOBALS"}["fbcyfklnb"]} = "SELECT id,user_name,first_name,last_name FROM vtiger_users WHERE status = 'Active'";
     ${${"GLOBALS"}["rnuyovw"]} = $adb->pquery(${${"GLOBALS"}["fbcyfklnb"]});
     while (${$siqaaqkg} = $adb->fetchByAssoc(${${"GLOBALS"}["rnuyovw"]})) {
         $drhvgcgnt = "user";
         ${"GLOBALS"}["btzurxqljzd"] = "availUser";
         ${$drhvgcgnt}["id"] = "" . ${${"GLOBALS"}["dnqjgtwktyg"]}["id"];
         ${"GLOBALS"}["qvdrvuncpd"] = "user";
         ${${"GLOBALS"}["btzurxqljzd"]}["user"][] = ${${"GLOBALS"}["qvdrvuncpd"]};
     }
     ${${"GLOBALS"}["xldevyyog"]} = "SELECT * FROM vtiger_groups ORDER BY groupname";
     ${${"GLOBALS"}["rnuyovw"]} = $adb->pquery(${$dafpvby});
     while (${$pdiyggeicd} = $adb->fetchByAssoc(${${"GLOBALS"}["rnuyovw"]})) {
         ${"GLOBALS"}["vvsqrvmpde"] = "availUser";
         $xeviiqflv = "group";
         $qthgnnjov = "group";
         ${$qthgnnjov}["groupid"] = "" . ${${"GLOBALS"}["xlifgy"]}["groupid"];
         ${${"GLOBALS"}["vvsqrvmpde"]}["group"][] = ${$xeviiqflv};
     }
     $tnrbgrlswql = "return";
     ${"GLOBALS"}["wkdeuhq"] = "return";
     ${$qtbkdju}["assigned_user_id"]["type"]["name"] = "picklist";
     ${${"GLOBALS"}["rfzzycoqwhw"]}["assigned_user_id"]["type"]["picklistValues"] = array();
     $kqtwigb = "availUser";
     ${"GLOBALS"}["mmbwcnsztet"] = "return";
     ${${"GLOBALS"}["hkmwbevsdqg"]}["assigned_user_id"]["type"]["picklistValues"][] = array("label" => "\$currentUser", "value" => "\$current_user_id");
     ${"GLOBALS"}["rqlhtitowxmp"] = "a";
     for (${${"GLOBALS"}["hysqswqyxng"]} = 0; ${$zgsppbmobo} < count(${${"GLOBALS"}["hetdnksroqie"]}["user"]); ${${"GLOBALS"}["uxurbdlld"]}++) {
         $veomxqkg = "availUser";
         ${"GLOBALS"}["byiotxbgnmr"] = "a";
         $qcresygwc = "a";
         ${"GLOBALS"}["ewwopkji"] = "return";
         ${${"GLOBALS"}["ewwopkji"]}["assigned_user_id"]["type"]["picklistValues"][] = array("label" => ${${"GLOBALS"}["qzzrbpnvz"]}["user"][${${"GLOBALS"}["byiotxbgnmr"]}]["user_name"], "value" => ${$veomxqkg}["user"][${$qcresygwc}]["id"]);
     }
     for (${${"GLOBALS"}["hysqswqyxng"]} = 0; ${${"GLOBALS"}["rqlhtitowxmp"]} < count(${$kqtwigb}["group"]); ${${"GLOBALS"}["hysqswqyxng"]}++) {
         ${"GLOBALS"}["ybunnuhkaq"] = "availUser";
         ${"GLOBALS"}["pjifasvnkay"] = "a";
         $dukyodmows = "return";
         ${$dukyodmows}["assigned_user_id"]["type"]["picklistValues"][] = array("label" => "Group: " . ${${"GLOBALS"}["qzzrbpnvz"]}["group"][${${"GLOBALS"}["pjifasvnkay"]}]["groupname"], "value" => ${${"GLOBALS"}["ybunnuhkaq"]}["group"][${${"GLOBALS"}["hysqswqyxng"]}]["groupid"]);
     }
     ${${"GLOBALS"}["mmbwcnsztet"]}["smownerid"] = ${$tnrbgrlswql}["assigned_user_id"];
     ${${"GLOBALS"}["rfzzycoqwhw"]} = array_merge(${${"GLOBALS"}["wkdeuhq"]}, ${${"GLOBALS"}["novyhahuz"]});
     return ${$jtxnyueqcz};
 }
开发者ID:Wasage,项目名称:werpa,代码行数:98,代码来源:VtUtils.php


示例15: describeModule

 public static function describeModule($moduleName, $loadReferences = false, $nameFormat = "###")
 {
     global $current_user;
     $columnsRewrites = array("assigned_user_id" => "smownerid");
     $loadedRefModules = array();
     require_once "include/Webservices/DescribeObject.php";
     $refFields = array();
     $return = array();
     $describe = vtws_describe($moduleName, $current_user);
     $return["crmid"] = array("name" => "crmid", "label" => "ID", "mandatory" => false, "type" => array("name" => "string"), "editable" => false);
     /** Current User mit aufnehmen! */
     $describe["fields"][] = array('name' => 'current_user', 'label' => 'current user ', 'mandatory' => false, 'type' => array('name' => 'reference', 'refersTo' => array(0 => 'Users')));
     foreach ($describe["fields"] as $field) {
         if (!empty($columnsRewrites[$field["name"]])) {
             $field["name"] = $columnsRewrites[$field["name"]];
         }
         if ($field["name"] == "smownerid") {
             $field["type"]["name"] = "reference";
             $field["type"]["refersTo"] = array("Users");
         }
         if ($field["type"]["name"] == "reference" && $loadReferences == true) {
             foreach ($field["type"]["refersTo"] as $refModule) {
                 #if(!empty($loadedRefModules[$refModule])) continue;
                 $refFields = array_merge($refFields, self::describeModule($refModule, false, "(" . $field["name"] . ": (" . $refModule . ") ###)"));
                 #var_dump($refFields);
                 $loadedRefModules[$refModule] = "1";
             }
         }
         $fieldName = str_replace("###", $field["name"], $nameFormat);
         $return[$fieldName] = $field;
     }
     /** Assigned Users */
     global $adb;
     $sql = "SELECT id,user_name,first_name,last_name FROM vtiger_users WHERE status = 'Active'";
     $result = $adb->query($sql);
     while ($user = $adb->fetchByAssoc($result)) {
         $user["id"] = "19x" . $user["id"];
         $availUser["user"][] = $user;
     }
     $sql = "SELECT * FROM vtiger_groups ORDER BY groupname";
     $result = $adb->query($sql);
     while ($group = $adb->fetchByAssoc($result)) {
         $group["groupid"] = "20x" . $group["groupid"];
         $availUser["group"][] = $group;
     }
     /** Assigned Users End */
     $return["assigned_user_id"]["type"]["name"] = "picklist";
     $return["assigned_user_id"]["type"]["picklistValues"] = array();
     $return["assigned_user_id"]["type"]["picklistValues"][] = array("label" => '$currentUser', "value" => '$current_user_id');
     for ($a = 0; $a < count($availUser["user"]); $a++) {
         $return["assigned_user_id"]["type"]["picklistValues"][] = array("label" => $availUser["user"][$a]["user_name"], "value" => $availUser["user"][$a]["id"]);
     }
     for ($a = 0; $a < count($availUser["group"]); $a++) {
         $return["assigned_user_id"]["type"]["picklistValues"][] = array("label" => "Group: " . $availUser["group"][$a]["groupname"], "value" => $availUser["group"][$a]["groupid"]);
     }
     $return["smownerid"] = $return["assigned_user_id"];
     $return = array_merge($return, $refFields);
     return $return;
 }
开发者ID:Neodracir,项目名称:VtigerCRM-Tools,代码行数:59,代码来源:VtUtils.php


示例16: getTabid

 * All Rights Reserved.
* 
 ********************************************************************************/
require_once 'include/utils/CommonUtils.php';
require_once 'include/Webservices/DescribeObject.php';
require_once 'include/Webservices/Query.php';
require_once 'modules/Tooltip/TooltipUtils.php';
global $current_user, $log;
$modname = $_REQUEST['modname'];
$id = $_REQUEST['id'];
$fieldname = $_REQUEST['fieldname'];
$tabid = getTabid($modname);
$result = ToolTipExists($fieldname, $tabid);
if ($result !== false) {
    //get tooltip information
    $viewid = 1;
    //viewid is 1 by default
    $descObject = vtws_describe($modname, $current_user);
    $id = vtws_getWebserviceEntityId($modname, $id);
    $sql = "select * from {$modname} where id ='{$id}';";
    $result = vtws_query($sql, $current_user);
    if (empty($result)) {
        exit(0);
    }
    $result = vttooltip_processResult($result, $descObject);
    $text = getToolTipText($viewid, $fieldname, $modname, $result);
    $tip = getToolTip($text);
    echo $tip;
} else {
    echo false;
}
开发者ID:hbsman,项目名称:vtigercrm-5.3.0-ja,代码行数:31,代码来源:ComputeTooltip.php


示例17: webforms_init

function webforms_init()
{
    global $defaultUserName, $defaultUserAccessKey, $defaultOwner, $adb, $enableAppKeyValidation, $application_unique_key;
    try {
        $active = vtlib_isModuleActive('Webforms');
        if ($active === false) {
            webforms_returnError(array('code' => "WEBFORMS_DISABLED", 'message' => 'Webforms module is disabled'), 'Webforms');
        }
        if ($enableAppKeyValidation == true) {
            if ($application_unique_key !== $_REQUEST['appKey']) {
                webforms_returnError(array('code' => "WEBFORMS_INVALID_APPKEY", 'message' => 'AppKey provided is invalid'), null);
                return;
            }
        }
        $module = $_REQUEST['moduleName'];
        $challengeResult = vtws_getchallenge($defaultUserName);
        $challengeToken = $challengeResult['token'];
        $user = vtws_login($defaultUserName, md5($challengeToken . $defaultUserAccessKey));
        $describeResult = vtws_describe($module, $user);
        $fields = $describeResult['fields'];
        $assignedUser = new Users();
        $ownerId = $assignedUser->retrieve_user_id($defaultOwner);
        $userData = webforms_getUserData(vtws_getId(VtigerWebserviceObject::fromName($adb, "Users")->getEntityId(), $ownerId), $fields, $_REQUEST);
        if ($userData === null) {
            webforms_returnError(array('code' => "WEBFORMS_INVALID_DATA", 'message' => 'data provided is invalid'), $module);
            return;
        }
        if (sizeof($userData) < 1) {
            webforms_returnError(array('code' => "WEBFORMS_INVALID_DATA", 'message' => 'data provided is invalid'), $module);
            return;
        }
        $createResult = vtws_create($module, $userData, $user);
        webforms_returnSuccess($createResult, $module);
    } catch (WebServiceException $e) {
        webforms_returnError($e, $module);
    }
}
开发者ID:latechdirect,项目名称:vtiger,代码行数:37,代码来源:post.php


示例18: ws_describe

 function ws_describe($module)
 {
     global $current_user;
     if (!isset($this->wsDescribeCache[$module])) {
         $this->wsDescribeCache[$module] = vtws_describe($module, $current_user);
     }
     return $this->wsDescribeCache[$module];
 }
开发者ID:casati-dolibarr,项目名称:corebos,代码行数:8,代码来源:RelationController.php


示例19: getRelatedFieldInfo

 function getRelatedFieldInfo($fieldname)
 {
     global $current_user;
     list($module, $fieldname) = explode('.', $fieldname);
     if (count($this->relatedfieldsinfo) == 0 or !isset($this->relatedfieldsinfo[$module])) {
         $wsfieldsinfo = vtws_describe($module, $current_user);
         $this->relatedfieldsinfo[$module] = $wsfieldsinfo['fields'];
     }
     // PHP 5.5 search and get fieldinfo
     //$ret = array_search($fieldname, array_column($this->fieldsinfo, 'name'));
     // PHP 5.4 search and get fieldinfo
     foreach ($this->relatedfieldsinfo[$module] as $ret => $finfo) {
         if ($finfo['name'] == $fieldname) {
             break;
         }
     }
     if ($this->relatedfieldsinfo[$module][$ret]['uitype'] == 10) {
         $refmod = $this->relatedfieldsinfo[$module][$ret]['type']['refersTo'][0];
         $rmod = CRMEntity::getInstance($refmod);
         $WSCodeID = vtws_getEntityId($refmod);
         $this->relatedfieldsinfo[$module][$ret]['searchin'] = $refmod;
         $this->relatedfieldsinfo[$module][$ret]['searchby'] = $refmod . $rmod->list_link_field;
         $this->relatedfieldsinfo[$module][$ret]['searchwsid'] = $WSCodeID;
     }
     return $this->relatedfieldsinfo[$module][$ret];
 }
开发者ID:kduqi,项目名称:corebos,代码行数:26,代码来源:MasterDetailLayout.php


示例20: describeModule

 public static function describeModule($moduleName, $loadReferences = false, $nameFormat = "###")
 {
     $njvnrsum = "columnsRewrites";
     $mtaybnledl = "loadedRefModules";
     $orczvnbuiln = "group";
     $pbckrdxmth = "a";
     global $current_user;
     ${$njvnrsum} = array("assigned_user_id" => "smownerid");
     $jdjebjlfpls = "return";
     ${$mtaybnledl} = array();
     ${"GLOBALS"}["rokdcf"] = "field";
     ${"GLOBALS"}["sjrrszbigbbf"] = "sql";
     require_once "include/Webservices/DescribeObject.php";
     ${"GLOBALS"}["nrnwqogf"] = "describe";
     $xhtoiwb = "return";
     ${"GLOBALS"}["qjkyhsy"] = "sql";
     $usdzmolkylfy = "refFields";
     $mbkpxqw = "current_user";
     ${"GLOBALS"}["pkbpbb"] = "result";
     ${$usdzmolkylfy} = array();
     ${$jdjebjlfpls} = array();
     ${${"GLOBALS"}["hiqrlje"]} = vtws_describe(${${"GLOBALS"}["rmjjxlks"]}, ${$mbkpxqw});
     ${${"GLOBALS"}["ruafhkaxlbyo"]}["crmid"] = array("name" => "crmid", "label" => "ID", "mandatory" => false, "type" => array("name" => "string"), "editable" => false);
     ${"GLOBALS"}["tyltrbqwoy"] = "return";
     ${"GLOBALS"}["gllkwzi"] = "a";
     $hhuhndyv = "sql";
     $magaqi = "a";
     ${${"GLOBALS"}["nrnwqogf"]}["fields"][] = array("name" => "current_user", "label" => "current user ", "mandatory" => false, "type" => array("name" => "reference", "refersTo" => array(0 => "Users")));
     $zegdrxt = "a";
     foreach (${${"GLOBALS"}["hiqrlje"]}["fields"] as ${${"GLOBALS"}["rokdcf"]}) {
         ${"GLOBALS"}["bmbiwfkgxbv"] = "field";
         $wljmjylij = "field";
         if (!empty(${${"GLOBALS"}["wemdcvibwn"]}[${$wljmjylij}["name"]])) {
             $klhpwk = "field";
             ${"GLOBALS"}["nvfjjvry"] = "columnsRewrites";
             ${$klhpwk}["name"] = ${${"GLOBALS"}["nvfjjvry"]}[${${"GLOBALS"}["eswxvskrqln"]}["name"]];
         }
         if (${${"GLOBALS"}["bmbiwfkgxbv"]}["name"] == "smownerid") {
             ${${"GLOBALS"}["eswxvskrqln"]}["type"]["name"] = "reference";
             ${${"GLOBALS"}["eswxvskrqln"]}["type"]["refersTo"] = array("Users");
         }
         $bstjdip = "field";
         ${"GLOBALS"}["yvglwctcoe"] = "field";
         if (${$bstjdip}["type"]["name"] == "reference" && ${${"GLOBALS"}["ocesovi"]} == true) {
             $whhxfdys = "field";
             foreach (${$whhxfdys}["type"]["refersTo"] as ${${"GLOBALS"}["gwtudtcinna"]}) {
                 ${"GLOBALS"}["nriwzcs"] = "refModule";
                 ${"GLOBALS"}["vnhofmbv"] = "refFields";
                 ${"GLOBALS"}["powkdtrxv"] = "field";
                 ${"GLOBALS"}["jdahwmd"] = "loadedRefModules";
                 $eoltltdwkwg = "refFields";
                 ${$eoltltdwkwg} = array_merge(${${"GLOBALS"}["vnhofmbv"]}, self::describeModule(${${"GLOBALS"}["gwtudtcinna"]}, false, "(" . ${${"GLOBALS"}["powkdtrxv"]}["name"] . ": (" . ${${"GLOBALS"}["gwtudtcinna"]} . ") ###)"));
                 ${${"GLOBALS"}["jdahwmd"]}[${${"GLOBALS"}["nriwzcs"]}] = "1";
             }
         }
         $xbayueyvmsmu = "fieldName";
         ${$xbayueyvmsmu} = str_replace("###", ${${"GLOBALS"}["yvglwctcoe"]}["name"], ${${"GLOBALS"}["kdguivtwgeh"]});
         ${${"GLOBALS"}["ruafhkaxlbyo"]}[${${"GLOBALS"}["qnguut"]}] = ${${"GLOBALS"}["eswxvskrqln"]};
     }
     $fwwzqpyql = "return";
     global $adb;
     ${${"GLOBALS"}["skzqqfb"]} = array( 

鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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