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


PHP QueryGenerator::getReferenceFieldNameList方法代码示例

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


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

示例1: getListViewHeader

 public function getListViewHeader($focus, $module, $sort_qry = '', $sorder = '', $orderBy = '', $skipActions = false)
 {
     global $log, $singlepane_view, $theme, $current_user;
     $arrow = '';
     $qry = getURLstring($focus);
     $theme_path = "themes/" . $theme . "/";
     $image_path = $theme_path . "images/";
     $header = array();
     //Get the vtiger_tabid of the module
     $tabid = getTabid($module);
     $tabname = getParentTab();
     require 'user_privileges/user_privileges_' . $current_user->id . '.php';
     $fields = $this->queryGenerator->getFields();
     $whereFields = $this->queryGenerator->getWhereFields();
     $meta = $this->queryGenerator->getMeta($this->queryGenerator->getModule());
     $moduleFields = $meta->getModuleFields();
     $accessibleFieldList = array_keys($moduleFields);
     if ($this->queryGenerator->getReferenceFieldInfoList()) {
         $accessibleFieldList = array_merge($this->queryGenerator->getReferenceFieldNameList(), $accessibleFieldList);
     }
     $listViewFields = array_intersect($fields, $accessibleFieldList);
     //Added on 14-12-2005 to avoid if and else check for every list
     //vtiger_field for arrow image and change order
     $change_sorder = array('ASC' => 'DESC', 'DESC' => 'ASC');
     $arrow_gif = array('ASC' => 'arrow_down.gif', 'DESC' => 'arrow_up.gif');
     foreach ($listViewFields as $fieldName) {
         if (!empty($moduleFields[$fieldName])) {
             $field = $moduleFields[$fieldName];
         } else {
             $field = $this->queryGenerator->getReferenceField($fieldName, false);
             if (is_null($field)) {
                 continue;
             }
         }
         if (in_array($field->getColumnName(), $focus->sortby_fields)) {
             if ($orderBy == $field->getColumnName()) {
                 $temp_sorder = $change_sorder[$sorder];
                 $arrow = "&nbsp;<img src ='" . vtiger_imageurl($arrow_gif[$sorder], $theme) . "' border='0'>";
             } else {
                 $temp_sorder = 'ASC';
             }
             $label = getTranslatedString($field->getFieldLabelKey(), $module);
             //added to display vtiger_currency symbol in listview header
             if ($label == 'Amount') {
                 $label .= ' (' . getTranslatedString('LBL_IN', $module) . ' ' . $user_info['currency_symbol'] . ')';
             }
             if ($field->getUIType() == '9') {
                 $label .= ' (%)';
             }
             if ($module == 'Users' && $fieldName == 'User Name') {
                 $name = "<a href='javascript:;' onClick='getListViewEntries_js(\"" . $module . "\",\"parenttab=" . $tabname . "&order_by=" . $field->getColumnName() . "&sorder=" . $temp_sorder . $sort_qry . "\");' class='listFormHeaderLinks'>" . getTranslatedString('LBL_LIST_USER_NAME_ROLE', $module) . "" . $arrow . "</a>";
             } else {
                 if ($this->isHeaderSortingEnabled()) {
                     $name = "<a href='javascript:;' onClick='getListViewEntries_js(\"" . $module . "\",\"parenttab=" . $tabname . "&foldername=Default&order_by=" . $field->getColumnName() . "&start=" . (isset($_SESSION['lvs'][$module]['start']) ? $_SESSION['lvs'][$module]['start'] : '') . "&sorder=" . $temp_sorder . "" . $sort_qry . "\");' class='listFormHeaderLinks'>" . $label . "" . $arrow . "</a>";
                 } else {
                     $name = $label;
                 }
             }
             $arrow = '';
         } else {
             $name = getTranslatedString($field->getFieldLabelKey(), $module);
         }
         //added to display vtiger_currency symbol in related listview header
         if ($name == 'Amount') {
             $name .= ' (' . getTranslatedString('LBL_IN') . ' ' . $user_info['currency_symbol'] . ')';
         }
         $header[] = $name;
     }
     //Added for Action - edit and delete link header in listview
     if (!$skipActions && (isPermitted($module, "EditView", "") == 'yes' || isPermitted($module, "Delete", "") == 'yes')) {
         $header[] = getTranslatedString("LBL_ACTION", $module);
     }
     $header = cbEventHandler::do_filter('corebos.filter.listview.header', $header);
     return $header;
 }
开发者ID:casati-dolibarr,项目名称:corebos,代码行数:75,代码来源:ListViewController.php


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