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


PHP Vtiger_Functions::getCRMRecordLabel方法代码示例

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


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

示例1: getDisplayValue

 /**
  * Getting value to display
  * @param type $value
  * @return type
  */
 public function getDisplayValue($value)
 {
     if ($value != 0) {
         return Vtiger_Functions::getCRMRecordLabel($value);
     }
     return '';
 }
开发者ID:noclav,项目名称:UpdatePackages,代码行数:12,代码来源:Reference.php

示例2: wf_combine_comments

 function wf_combine_comments($crmid)
 {
     global $adb, $default_charset;
     $sql = "SELECT *\n           FROM\n               vtiger_modcomments\n           INNER JOIN vtiger_crmentity\n               ON (vtiger_crmentity.crmid = vtiger_modcomments.modcommentsid)\n           INNER JOIN vtiger_users\n               ON (vtiger_users.id = vtiger_crmentity.smownerid)\n           WHERE related_to = " . $crmid . " AND vtiger_crmentity.deleted = 0 ORDER BY createdtime DESC";
     $result = $adb->query($sql, true);
     $html = "";
     while ($row = $adb->fetchByAssoc($result)) {
         if (!empty($row['customer'])) {
         }
         $html .= "<div style='font-size:12px;'><strong>Kommentar von " . (!empty($row['customer']) ? Vtiger_Functions::getCRMRecordLabel($row['customer']) : $row["first_name"] . " " . $row["last_name"]) . " geschrieben " . date("d.m.Y H:i:s", strtotime($row["createdtime"])) . "</strong><br>";
         $html .= nl2br($row["commentcontent"]) . "</div><br><br>";
     }
     return $html;
 }
开发者ID:cin-system,项目名称:cinrepo,代码行数:14,代码来源:_comments.inc.php

示例3: getBreadcrumbs

 public static function getBreadcrumbs()
 {
     $breadcrumbs = false;
     $request = new Vtiger_Request($_REQUEST, $_REQUEST);
     $currentUser = Users_Record_Model::getCurrentUserModel();
     $userPrivModel = Users_Privileges_Model::getCurrentUserPrivilegesModel();
     $roleMenu = 'user_privileges/menu_' . filter_var($userPrivModel->get('roleid'), FILTER_SANITIZE_NUMBER_INT) . '.php';
     if (file_exists($roleMenu)) {
         require $roleMenu;
     } else {
         require 'user_privileges/menu_0.php';
     }
     if (count($menus) == 0) {
         require 'user_privileges/menu_0.php';
     }
     if ($request->get('parent') == 'Settings') {
         $moduleName = 'Settings:';
     }
     $breadcrumbsOn = $purl = false;
     $moduleName .= $module = $request->get('module');
     $view = $request->get('view');
     if ($request->get('parent') != '' && $request->get('parent') != 'Settings') {
         $parentMenu = self::getParentMenu($parentList, $request->get('parent'), $module);
         if (count($parentMenu) > 0) {
             $breadcrumbs = array_reverse($parentMenu);
         }
     } elseif ($request->get('parent') == 'Settings') {
         $breadcrumbs[] = ['name' => vtranslate('LBL_VIEW_SETTINGS', $moduleName)];
     }
     $breadcrumbs[] = ['name' => vtranslate($module, $moduleName)];
     if ($view == 'Edit' && $request->get('record') == '') {
         $breadcrumbs[] = ['name' => vtranslate('LBL_VIEW_CREATE', $moduleName)];
     } elseif ($view != '' && $view != 'index' && $view != 'Index') {
         $breadcrumbs[] = ['name' => vtranslate('LBL_VIEW_' . strtoupper($view), $moduleName)];
     } elseif ($view == '') {
         $breadcrumbs[] = ['name' => vtranslate('LBL_HOME', $moduleName)];
     }
     if ($request->get('record') != '') {
         $recordLabel = Vtiger_Functions::getCRMRecordLabel($request->get('record'));
         if ($recordLabel != '') {
             $breadcrumbs[] = ['name' => $recordLabel];
         }
     }
     return $breadcrumbs;
 }
开发者ID:rcrrich,项目名称:UpdatePackages,代码行数:45,代码来源:Menu.php

示例4: process

 function process($data)
 {
     $adb = PearDatabase::getInstance();
     $html = '';
     if ($data['record'] != '') {
         $vtEntityDelta = new VTEntityDelta();
         $delta = $vtEntityDelta->getEntityDelta($data['module'], $data['record']);
         if (count($delta) == 0) {
             return '';
         }
         $tabid = getTabid($data['module']);
         $html = '<ul>';
         foreach ($delta as $fieldName => $values) {
             if ($fieldName != 'modifiedtime' && in_array($fieldName, array('record_id', 'record_module')) == false && strstr($fieldName, 'label') === false) {
                 $result = $adb->pquery("SELECT uitype,fieldlabel FROM vtiger_field WHERE fieldname = ? AND tabid = ?", array($fieldName, $tabid), true);
                 $fieldlabel = $adb->query_result_raw($result, 0, 'fieldlabel');
                 $uitype = $adb->query_result_raw($result, 0, 'uitype');
                 $oldValue = $values['oldValue'];
                 if ($oldValue == '') {
                     $oldValue = 'LBL_NULL_VALUE';
                 }
                 $currentValue = $values['currentValue'];
                 if ($currentValue == '') {
                     $currentValue = 'LBL_NULL_VALUE';
                 }
                 if ($uitype == 10 && $oldValue != 'LBL_NULL_VALUE' && $currentValue != 'LBL_NULL_VALUE') {
                     $oldValue = Vtiger_Functions::getCRMRecordLabel($oldValue);
                     $currentValue = Vtiger_Functions::getCRMRecordLabel($currentValue);
                 } elseif (in_array($uitype, array('53', '52', '77')) && $oldValue != 'LBL_NULL_VALUE' && $currentValue != 'LBL_NULL_VALUE') {
                     $oldValue = Vtiger_Functions::getOwnerRecordLabel($oldValue);
                     $currentValue = Vtiger_Functions::getOwnerRecordLabel($currentValue);
                 } elseif ($uitype == 56 && $oldValue != 'LBL_NULL_VALUE' && $currentValue != 'LBL_NULL_VALUE') {
                     $oldValue = $oldValue == 1 ? vtranslate('LBL_YES', $data['module']) : vtranslate('LBL_NO', $data['module']);
                     $currentValue = $currentValue == 1 ? vtranslate('LBL_YES', $data['module']) : vtranslate('LBL_NO', $data['module']);
                 } else {
                     $oldValue = vtranslate($oldValue, $data['module']);
                     $currentValue = vtranslate($currentValue, $data['module']);
                 }
                 $html .= '<li>' . vtranslate('LBL_CHANGED', $data['module']) . ' <strong>' . vtranslate($fieldlabel, $data['module']) . '</strong> ' . vtranslate('LBL_FROM') . ' <i>' . $oldValue . '</i> ' . vtranslate('LBL_TO') . ' <i>' . $currentValue . '</i></li>';
             }
         }
         $html .= '</ul>';
         return $html;
     }
 }
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:45,代码来源:ChangesList.php

示例5: process

 public function process(Vtiger_Request $request)
 {
     $adb = PearDatabase::getInstance();
     $moduleName = $request->getModule();
     $id = $request->get('id');
     $sourceModule = $request->get('sourceModule');
     $sourceData = array();
     if (isRecordExists($id)) {
         $record = Vtiger_Record_Model::getInstanceById($id, $sourceModule);
         $entity = $record->getEntity();
         $sourceData = $entity->column_fields;
         if ($sourceModule == 'HelpDesk') {
             $sourceData['contact_label'] = Vtiger_Functions::getCRMRecordLabel($sourceData['contact_id']);
             if (Vtiger_Functions::getCRMRecordType($sourceData['parent_id']) != 'Accounts') {
                 unset($sourceData['parent_id']);
             } else {
                 $sourceData['account_label'] = Vtiger_Functions::getCRMRecordLabel($sourceData['parent_id']);
             }
         } else {
             if ($sourceModule == 'Project') {
                 $ifExist = $adb->query("select * from vtiger_account where accountid = " . $sourceData['linktoaccountscontacts'] . "", true, "Błąd podczas pobierania danych z vtiger_crmentityrel");
                 if ($adb->num_rows($ifExist) > 0) {
                     $sourceData['account_label'] = Vtiger_Functions::getCRMRecordLabel($sourceData['linktoaccountscontacts']);
                 } else {
                     $sourceData['contact_label'] = Vtiger_Functions::getCRMRecordLabel($sourceData['linktoaccountscontacts']);
                 }
             }
         }
     }
     if ($sourceData === false) {
         $result = array('success' => false, 'message' => vtranslate('LBL_FAILED_TO_IMPORT_INFO', $moduleName));
     } else {
         $result = array('success' => true, 'sourceData' => $sourceData);
     }
     $response = new Vtiger_Response();
     $response->setResult($result);
     $response->emit();
 }
开发者ID:rcrrich,项目名称:UpdatePackages,代码行数:38,代码来源:GetTCInfo.php

示例6: beforeGetTaskform

 public function beforeGetTaskform($data)
 {
     $pplkpxdfnevl = "viewer";
     $iuekfubh = "data";
     ${${"GLOBALS"}["cgfmjwwpip"]} = \PearDatabase::getInstance();
     list(${${"GLOBALS"}["nhsboiruw"]}, ${$pplkpxdfnevl}) = ${$iuekfubh};
     ${"GLOBALS"}["kqvmnsqcq"] = "productCache";
     $viewer->assign("availTaxes", getAllTaxes("available"));
     $viewer->assign("availCurrency", getAllCurrencies());
     ${${"GLOBALS"}["kqvmnsqcq"]} = array();
     foreach (${${"GLOBALS"}["nhsboiruw"]}[$this->field] as ${${"GLOBALS"}["lbltvfz"]}) {
         if (!empty(${${"GLOBALS"}["lbltvfz"]}["productid"])) {
             ${"GLOBALS"}["bcfngarcjdy"] = "product";
             ${${"GLOBALS"}["djmvvsgdvdv"]} = \Vtiger_Record_Model::getInstanceById(${${"GLOBALS"}["lbltvfz"]}["productid"]);
             $kkoeiyxt = "productCache";
             ${$kkoeiyxt}[${${"GLOBALS"}["bcfngarcjdy"]}["productid"]] = array("data" => $dataObj->getData(), "tax" => $dataObj->getTaxes(), "label" => \Vtiger_Functions::getCRMRecordLabel(${${"GLOBALS"}["lbltvfz"]}["productid"]));
         }
     }
     $viewer->assign("productCache", ${${"GLOBALS"}["nmqsaly"]});
     $viewer->assign("selectedProducts", ${${"GLOBALS"}["nhsboiruw"]}[$this->field]);
     $viewer->assign("additionalProductFields", \Workflow\VTInventoryEntity::getAdditionalProductFields());
     $this->addInlineJS("");
     $viewer->assign("ProductChooser", $viewer->fetch("modules/Settings/Workflow2/helpers/ProductChooser.tpl"));
 }
开发者ID:cin-system,项目名称:vtigercrm-cin,代码行数:24,代码来源:ProductChooser.php

示例7: beforeGetTaskform

 public function beforeGetTaskform($viewer)
 {
     global $adb, $current_language, $mod_strings;
     $viewer->assign("related_modules", VtUtils::getEntityModules(true));
     $search_module = $this->get("search_module");
     if (!empty($_POST["task"]["search_module"])) {
         $parts = explode("#~#", $_POST["task"]["search_module"]);
     } elseif (!empty($search_module)) {
         if ($search_module != -1) {
             $parts = explode("#~#", $search_module);
         }
     } else {
         return;
     }
     if (!empty($parts)) {
         $viewer->assign("related_tabid", $parts[1]);
         $search_module_name = VtUtils::getModuleName($parts[1]);
         #$workflowSettings = $this->getWorkflow()->getSettings();
         $workflows = $workflows = Workflow2::getWorkflowsForModule($search_module_name, 1);
         $viewer->assign("workflows", $workflows);
         $fields = VtUtils::getFieldsWithBlocksForModule($search_module_name);
         $viewer->assign("sort_fields", $fields);
         $moduleObj = \Vtiger_Module_Model::getInstance($search_module_name);
         $viewer->assign('productCache', array());
         if ($moduleObj instanceof \Inventory_Module_Model) {
             $viewer->assign('searchByProduct', true);
             $product = $this->get('products');
             if (!empty($product)) {
                 //$dataObj = \Vtiger_Record_Model::getInstanceById($product);
                 $productCache[$product] = array('label' => \Vtiger_Functions::getCRMRecordLabel($product));
                 $viewer->assign('productCache', $productCache);
             }
         }
         $views = array();
         $allviews = \CustomView_Record_Model::getAll($search_module_name);
         foreach ($allviews as $view) {
             $views[$view->get('cvid')] = $view->get('viewname');
         }
         $viewer->assign('customviews', $views);
     }
 }
开发者ID:cin-system,项目名称:vtigercrm-cin,代码行数:41,代码来源:WfTaskExecExtWorkflow.php

示例8: computeCRMRecordLabels

 static function computeCRMRecordLabels($module, $ids, $search = false)
 {
     $adb = PearDatabase::getInstance();
     if (!is_array($ids)) {
         $ids = [$ids];
     }
     if ($module == 'Events') {
         $module = 'Calendar';
     }
     if ($module) {
         $entityDisplay = [];
         if ($ids) {
             if ($module == 'Groups') {
                 $metainfo = ['tablename' => 'vtiger_groups', 'entityidfield' => 'groupid', 'fieldname' => 'groupname'];
             } else {
                 $metainfo = self::getEntityModuleInfo($module);
             }
             $table = $metainfo['tablename'];
             $idcolumn = $metainfo['entityidfield'];
             $columnsName = explode(',', $metainfo['fieldname']);
             $columnsSearch = explode(',', $metainfo['searchcolumn']);
             $columns = array_unique(array_merge($columnsName, $columnsSearch));
             $moduleInfo = self::getModuleFieldInfos($module);
             $moduleInfoExtend = [];
             if (count($moduleInfo) > 0) {
                 foreach ($moduleInfo as $field => $fieldInfo) {
                     $moduleInfoExtend[$fieldInfo['columnname']] = $fieldInfo;
                 }
             }
             $leftJoin = '';
             $leftJoinTables = [];
             $paramsCol = [];
             $focus = CRMEntity::getInstance($module);
             foreach (array_filter($columns) as $column) {
                 if (array_key_exists($column, $moduleInfoExtend)) {
                     $paramsCol[] = $column;
                     if ($moduleInfoExtend[$column]['tablename'] != $table && !in_array($moduleInfoExtend[$column]['tablename'], $leftJoinTables)) {
                         $otherTable = $moduleInfoExtend[$column]['tablename'];
                         $leftJoinTables[] = $otherTable;
                         $focusTables = $focus->tab_name_index;
                         $leftJoin .= ' LEFT JOIN ' . $otherTable . ' ON ' . $otherTable . '.' . $focusTables[$otherTable] . ' = ' . $table . '.' . $focusTables[$table];
                     }
                 }
             }
             $paramsCol[] = $idcolumn;
             $sql = sprintf('SELECT ' . implode(',', $paramsCol) . ' AS id FROM %s ' . $leftJoin . ' WHERE %s IN (%s)', $table, $idcolumn, generateQuestionMarks($ids));
             $result = $adb->pquery($sql, $ids);
             for ($i = 0; $i < $adb->num_rows($result); $i++) {
                 $row = $adb->raw_query_result_rowdata($result, $i);
                 $label_name = [];
                 $label_search = [];
                 foreach ($columnsName as $columnName) {
                     if ($moduleInfoExtend && in_array($moduleInfoExtend[$columnName]['uitype'], [10, 51, 75, 81])) {
                         $label_name[] = Vtiger_Functions::getCRMRecordLabel($row[$columnName]);
                     } else {
                         $label_name[] = $row[$columnName];
                     }
                 }
                 if ($search) {
                     foreach ($columnsSearch as $columnName) {
                         if ($moduleInfoExtend && in_array($moduleInfoExtend[$columnName]['uitype'], [10, 51, 75, 81])) {
                             $label_search[] = Vtiger_Functions::getCRMRecordLabel($row[$columnName]);
                         } else {
                             $label_search[] = $row[$columnName];
                         }
                     }
                     $entityDisplay[$row['id']] = ['name' => implode(' ', $label_name), 'search' => implode(' ', $label_search)];
                 } else {
                     $entityDisplay[$row['id']] = trim(implode(' ', $label_name));
                 }
             }
         }
         return $entityDisplay;
     }
 }
开发者ID:reeid,项目名称:YetiForceCRM,代码行数:75,代码来源:Functions.php

示例9: getParentName

function getParentName($parent_id)
{
    return Vtiger_Functions::getCRMRecordLabel($parent_id);
}
开发者ID:jmangarret,项目名称:vtigercrm,代码行数:4,代码来源:CommonUtils.php

示例10: findRecordsById

 public function findRecordsById($ids)
 {
     $return = false;
     if (!empty($ids) && $ids != '0') {
         $recordModelMailScanner = Vtiger_Record_Model::getCleanInstance('OSSMailScanner');
         $config = $recordModelMailScanner->getConfig('email_list');
         if (strpos($ids, ',')) {
             $idsArray = explode(",", $ids);
         } else {
             $idsArray[0] = $ids;
         }
         foreach ($idsArray as $id) {
             $module = Vtiger_Functions::getCRMRecordType($id);
             $label = Vtiger_Functions::getCRMRecordLabel($id);
             $return .= '<a href="index.php?module=' . $module . '&view=Detail&record=' . $id . '" target="' . $config['target'] . '"> ' . $label . '</a>,';
         }
     }
     return trim($return, ',');
 }
开发者ID:noclav,项目名称:UpdatePackages,代码行数:19,代码来源:Record.php

示例11: findCrmRecordsByMessage_id

 public function findCrmRecordsByMessage_id($params, $metod)
 {
     $adb = PearDatabase::getInstance();
     $id = false;
     if ($params['crmid']) {
         $id = $params['crmid'];
     } else {
         $result = $adb->pquery("SELECT ossmailviewid FROM vtiger_ossmailview WHERE id = ? AND mbox = ?", array($params['uid'], $params['folder']), true);
         if ($adb->num_rows($result) > 0) {
             $id = $adb->query_result_raw($result, 0, 'ossmailviewid');
         }
     }
     if ($id) {
         if ($metod != 'all') {
         }
         $result = $adb->pquery("SELECT * FROM vtiger_crmentityrel WHERE (vtiger_crmentityrel.crmid = ?) OR ( vtiger_crmentityrel.relcrmid = ? )", array($id, $id), true);
         for ($i = 0; $i < $adb->num_rows($result); $i++) {
             $module = $adb->query_result($result, $i, 'module');
             $relmodule = $adb->query_result($result, $i, 'relmodule');
             $crmid = $adb->query_result($result, $i, 'crmid');
             $relcrmid = $adb->query_result($result, $i, 'relcrmid');
             if ($module != 'OSSMailView') {
                 if (isRecordExists($crmid)) {
                     $return[$module]['record'] = array('crmid' => $crmid, 'module' => $module, 'label' => Vtiger_Functions::getCRMRecordLabel($crmid));
                     $return[$module]['rows'][] = array('crmid' => $crmid, 'module' => $module, 'label' => Vtiger_Functions::getCRMRecordLabel($crmid));
                 }
             } elseif ($relmodule != 'OSSMailView') {
                 if (isRecordExists($relcrmid)) {
                     $return[$relmodule]['record'] = array('crmid' => $relcrmid, 'module' => $relmodule, 'label' => Vtiger_Functions::getCRMRecordLabel($relcrmid));
                     $return[$relmodule]['rows'][] = array('crmid' => $relcrmid, 'module' => $relmodule, 'label' => Vtiger_Functions::getCRMRecordLabel($relcrmid));
                 }
             }
         }
     }
     return $return;
 }
开发者ID:rcrrich,项目名称:UpdatePackages,代码行数:36,代码来源:Record.php

示例12: getAssignedProjectsTasks

 /**
  * Function returns the Calendar Events for the module
  * @param <String> $mode - upcoming/overdue mode
  * @param <Vtiger_Paging_Model> $pagingModel - $pagingModel
  * @param <String> $user - all/userid
  * @param <String> $recordId - record id
  * @return <Array>
  */
 function getAssignedProjectsTasks($mode, $pagingModel, $user, $recordId = false)
 {
     $currentUser = Users_Record_Model::getCurrentUserModel();
     $db = PearDatabase::getInstance();
     if (!$user) {
         $user = $currentUser->getId();
     }
     $nowInUserFormat = Vtiger_Datetime_UIType::getDisplayDateTimeValue(date('Y-m-d H:i:s'));
     $nowInDBFormat = Vtiger_Datetime_UIType::getDBDateTimeValue($nowInUserFormat);
     list($currentDate, $currentTime) = explode(' ', $nowInDBFormat);
     $instance = CRMEntity::getInstance('ProjectTask');
     $UserAccessConditions = $instance->getUserAccessConditionsQuerySR('ProjectTask');
     $params = array();
     $query = "SELECT vtiger_crmentity.crmid, vtiger_crmentity.smownerid, vtiger_crmentity.setype, vtiger_projecttask.*\n\t\t\tFROM vtiger_projecttask\n\t\t\tINNER JOIN vtiger_crmentity ON vtiger_crmentity.crmid = vtiger_projecttask.projecttaskid\n\t\t\tWHERE vtiger_crmentity.deleted=0 AND vtiger_crmentity.smcreatorid = ?";
     $params[] = $currentUser->getId();
     $query .= $UserAccessConditions;
     if ($mode === 'upcoming') {
         $query .= " AND targetenddate >= ?";
     } elseif ($mode === 'overdue') {
         $query .= " AND targetenddate < ?";
     }
     $params[] = $currentDate;
     $accessibleUsers = $currentUser->getAccessibleUsers();
     $accessibleGroups = $currentUser->getAccessibleGroups();
     if ($user != 'all' && $user != '' && (array_key_exists($user, $accessibleUsers) || array_key_exists($user, $accessibleGroups))) {
         $query .= " AND vtiger_crmentity.smownerid = ?";
         $params[] = $user;
     }
     $query .= " ORDER BY targetenddate LIMIT ?, ?";
     $params[] = $pagingModel->getStartIndex();
     $params[] = $pagingModel->getPageLimit() + 1;
     $result = $db->pquery($query, $params);
     $numOfRows = $db->num_rows($result);
     $projecttasks = array();
     for ($i = 0; $i < $numOfRows; $i++) {
         $row = $db->query_result_rowdata($result, $i);
         $model = Vtiger_Record_Model::getCleanInstance('ProjectTask');
         $model->setData($row);
         $model->setId($row['crmid']);
         if ($row['projectid']) {
             if (isRecordExists($row['projectid'])) {
                 $record = Vtiger_Record_Model::getInstanceById($row['projectid'], 'Project');
                 if (isRecordExists($record->get('linktoaccountscontacts'))) {
                     $model->set('account', '<a href="index.php?module=' . Vtiger_Functions::getCRMRecordType($record->get('linktoaccountscontacts')) . '&view=Detail&record=' . $record->get('linktoaccountscontacts') . '">' . Vtiger_Functions::getCRMRecordLabel($record->get('linktoaccountscontacts')) . '</a>');
                 }
             }
         }
         $projecttasks[] = $model;
     }
     $pagingModel->calculatePageRange($projecttasks);
     if ($numOfRows > $pagingModel->getPageLimit()) {
         array_pop($projecttasks);
         $pagingModel->set('nextPageExists', true);
     } else {
         $pagingModel->set('nextPageExists', false);
     }
     return $projecttasks;
 }
开发者ID:rcrrich,项目名称:UpdatePackages,代码行数:66,代码来源:Module.php

示例13: getMenu


//.........这里部分代码省略.........
                         for ($k = 0; count($res) > $k; $k++) {
                             $prefix = substr($res[$k], 0, strpos($res[$k], "*"));
                             $value = substr($res[$k], 6);
                             //	echo '<pre>';print_r($value);echo '</pre>';exit;
                             if (Users_Record_Model::getCurrentUserModel()->get('language') == $prefix) {
                                 $subName = $value;
                             }
                         }
                     } elseif ($langfiedpick) {
                         $res = explode('#', $langfiedpick);
                         for ($k = 0; count($res) > $k; $k++) {
                             $prefix = substr($res[$k], 0, strpos($res[$k], "*"));
                             $value = substr($res[$k], 6);
                             //	echo '<pre>';print_r($value);echo '</pre>';exit;
                             if (Users_Record_Model::getCurrentUserModel()->get('language') == $prefix) {
                                 $subName = $value;
                             }
                         }
                     }
                     if ($newWindow == 1) {
                         $newWindow = '*_blank*';
                     } else {
                         $newWindow = '';
                     }
                     switch (intval($type)) {
                         case 0:
                             $model = Vtiger_Module_Model::getInstance($subNameOrg);
                             if ($model) {
                                 $url = $model->getDefaultUrl();
                             } else {
                                 // usuń nieistniejącą pozycję
                                 $recordModel = Vtiger_Record_Model::getCleanInstance('OSSMenuManager');
                                 $recordModel->deleteMenu($subId);
                                 $url = false;
                             }
                             break;
                         case 1:
                         case 2:
                         case 3:
                         case 4:
                         default:
                             $url = $db->query_result_raw($subResult, $j, 'url');
                     }
                     if ($url !== false) {
                         $url = $newWindow . $url;
                         $menuStructure[$name][$j] = array('name' => $subName, 'mod' => $subNameOrg, 'link' => $url, 'sizeicon_first' => $subsizeicon_first, 'sizeicon_second' => $subsizeicon_second, 'locationiconname' => $locationiconname);
                     }
                     $moduleName = Vtiger_Functions::getModuleName($tabId);
                     $excludedViews = array("DashBoard", 'index', 'Index');
                     $purl = false;
                     if ($request->get('module') != '' && $request->get('module') == $moduleName && vglobal('breadcrumbs') && $request->get('parent') == '') {
                         $breadcrumbs[] = array('lable' => vtranslate($name, 'OSSMenuManager'));
                         $breadcrumbs[] = array('lable' => vtranslate($subName, $moduleName), 'url' => $url, 'class' => 'moduleColor_' . $moduleName);
                         if ($request->get('view') == 'Edit' && $request->get('record') == '') {
                             $breadcrumbs[] = array('lable' => vtranslate('LBL_VIEW_CREATE', $moduleName));
                         } elseif (!in_array($request->get('view'), $excludedViews)) {
                             $breadcrumbs[] = array('lable' => vtranslate('LBL_VIEW_' . strtoupper($request->get('view')), $moduleName));
                         }
                         if ($request->get('record') != '') {
                             $recordLabel = Vtiger_Functions::getCRMRecordLabel($request->get('record'));
                             if ($recordLabel != '') {
                                 $breadcrumbs[] = array('lable' => $recordLabel);
                             }
                         }
                     } elseif (vglobal('breadcrumbs') && $request->get('module') != '' && $request->get('parent') == '') {
                         $parts = parse_url($url);
                         parse_str($parts['query'], $purl);
                         if ($request->get('module') == $purl['module'] && $request->get('view') == $purl['view'] && $request->get('viewname') == $purl['viewname']) {
                             $breadcrumbs[] = array('lable' => vtranslate($name, 'OSSMenuManager'));
                             $breadcrumbs[] = array('lable' => vtranslate($request->get('module'), $request->get('module')), 'url' => 'index.php?module=' . $request->get('module') . '&view=List', 'class' => 'moduleColor_' . $request->get('module'));
                             if ($request->get('view') != 'List') {
                                 $breadcrumbs[] = array('lable' => vtranslate($subName, $moduleName), 'url' => $url);
                             }
                         }
                     }
                 }
             }
             $menuStructureGroupe[$name]['iconf'] = $sizeicon_first;
             $menuStructureGroupe[$name]['picon'] = $locationicon;
             $menuStructureGroupe[$name]['icons'] = $sizeicon_second;
         }
         if (vglobal('breadcrumbs') && count($breadcrumbs) == 0 && $request->get('module') != '' && $request->get('parent') == '') {
             $breadcrumbs[] = array('lable' => vtranslate($request->get('module'), $request->get('module')), 'url' => 'index.php?module=' . $request->get('module') . '&view=List', 'class' => 'moduleColor_' . $request->get('module'));
             if ($request->get('view') == 'Edit' && $request->get('record') == '') {
                 $breadcrumbs[] = array('lable' => vtranslate('LBL_VIEW_CREATE', $request->get('module')));
             } else {
                 $breadcrumbs[] = array('lable' => vtranslate('LBL_VIEW_' . strtoupper($request->get('view')), $request->get('module')));
             }
             if ($request->get('record') != '') {
                 $recordLabel = Vtiger_Functions::getCRMRecordLabel($request->get('record'));
                 if ($recordLabel != '') {
                     $breadcrumbs[] = array('lable' => $recordLabel);
                 }
             }
         }
         return array('structure' => $menuStructure, 'icons' => $menuStructureGroupe, 'breadcrumbs' => $breadcrumbs);
     } else {
         return array();
     }
 }
开发者ID:rcrrich,项目名称:UpdatePackages,代码行数:101,代码来源:Record.php

示例14: computeCRMRecordLabels

 static function computeCRMRecordLabels($module, $ids, $search = false)
 {
     global $adb;
     if (!is_array($ids)) {
         $ids = array($ids);
     }
     if ($module == 'Events') {
         $module = 'Calendar';
     }
     if ($module) {
         $entityDisplay = array();
         if ($ids) {
             if ($module == 'Groups') {
                 $metainfo = array('tablename' => 'vtiger_groups', 'entityidfield' => 'groupid', 'fieldname' => 'groupname');
                 /*} else if ($module == 'DocumentFolders') { 
                 		$metainfo = array('tablename' => 'vtiger_attachmentsfolder','entityidfield' => 'folderid','fieldname' => 'foldername'); */
             } else {
                 $metainfo = self::getEntityModuleInfo($module);
             }
             $table = $metainfo['tablename'];
             $idcolumn = $metainfo['entityidfield'];
             $columns_name = explode(',', $metainfo['fieldname']);
             $columns_search = explode(',', $metainfo['searchcolumn']);
             $columns = array_unique(array_merge($columns_name, $columns_search));
             $sql = sprintf('SELECT ' . implode(',', array_filter($columns)) . ', %s AS id FROM %s WHERE %s IN (%s)', $idcolumn, $table, $idcolumn, generateQuestionMarks($ids));
             $result = $adb->pquery($sql, $ids);
             $ModuleInfo = self::getModuleFieldInfos($module);
             while ($row = $adb->fetch_array($result)) {
                 $label_name = array();
                 $label_search = array();
                 foreach ($columns_name as $columnName) {
                     $fieldObiect = $ModuleInfo[$columnName];
                     if (in_array($fieldObiect['uitype'], array(10, 51, 75, 81))) {
                         $label_name[] = Vtiger_Functions::getCRMRecordLabel($row[$columnName]);
                     } else {
                         $label_name[] = $row[$columnName];
                     }
                 }
                 if ($search) {
                     foreach ($columns_search as $columnName) {
                         $fieldObiect = $ModuleInfo[$columnName];
                         if (in_array($fieldObiect['uitype'], array(10, 51, 75, 81))) {
                             $label_search[] = Vtiger_Functions::getCRMRecordLabel($row[$columnName]);
                         } else {
                             $label_search[] = $row[$columnName];
                         }
                     }
                     $entityDisplay[$row['id']] = array('name' => implode(' ', $label_name), 'search' => implode(' ', $label_search));
                 } else {
                     $entityDisplay[$row['id']] = implode(' ', $label_name);
                 }
             }
         }
         return $entityDisplay;
     }
 }
开发者ID:rcrrich,项目名称:UpdatePackages,代码行数:56,代码来源:Functions.php

示例15: findCrmDetail

 function findCrmDetail($params, $metod)
 {
     $OSSMailViewModel = Vtiger_Record_Model::getCleanInstance('OSSMailView');
     $Array = $OSSMailViewModel->findCrmRecordsByMessage_id($params, $metod);
     if (count($Array['Potentials'])) {
         $crmid = $Array['Potentials']['record']['crmid'];
         $module = $Array['Potentials']['record']['module'];
         $PotentialsRecord_Model = Vtiger_Record_Model::getInstanceById($crmid, $module);
         $related_to = $PotentialsRecord_Model->get('related_to');
         $contact_id = $PotentialsRecord_Model->get('contact_id');
         if ($related_to != 0 && $related_to != '') {
             $Array['Potentials']['Accounts'] = array('crmid' => $related_to, 'label' => Vtiger_Functions::getCRMRecordLabel($related_to));
         }
         if ($contact_id != 0 && $contact_id != '') {
             $Array['Potentials']['Contacts'] = array('crmid' => $contact_id, 'label' => Vtiger_Functions::getCRMRecordLabel($contact_id));
         }
     }
     if (count($Array['Project'])) {
         $crmid = $Array['Project']['record']['crmid'];
         $module = $Array['Project']['record']['module'];
         $ProjectRecord_Model = Vtiger_Record_Model::getInstanceById($crmid, $module);
         $acc_cont = $ProjectRecord_Model->get('linktoaccountscontacts');
         if ($acc_cont != 0 && $acc_cont != '') {
             $Array['Project']['RelRecord'] = array('crmid' => $acc_cont, 'label' => Vtiger_Functions::getCRMRecordLabel($acc_cont), 'module' => Vtiger_Functions::getCRMRecordType($acc_cont));
         }
     }
     if (count($Array['HelpDesk'])) {
         $crmid = $Array['HelpDesk']['record']['crmid'];
         $module = $Array['HelpDesk']['record']['module'];
         $HelpDeskRecord_Model = Vtiger_Record_Model::getInstanceById($crmid, $module);
         $parent_id = $HelpDeskRecord_Model->get('parent_id');
         $contact_id = $HelpDeskRecord_Model->get('contact_id');
         if ($parent_id != 0 && $parent_id != '') {
             $Array['HelpDesk']['Accounts'] = array('crmid' => $parent_id, 'label' => Vtiger_Functions::getCRMRecordLabel($parent_id));
         }
         if ($contact_id != 0 && $contact_id != '') {
             $Array['HelpDesk']['Contacts'] = array('crmid' => $contact_id, 'label' => Vtiger_Functions::getCRMRecordLabel($contact_id));
         }
     }
     return $Array;
 }
开发者ID:rcrrich,项目名称:UpdatePackages,代码行数:41,代码来源:Record.php


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