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


PHP SearchForm::retrieveSearchDefs方法代码示例

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


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

示例1: getListViewData


//.........这里部分代码省略.........
                     foreach ($idIndex[$child_id] as $index) {
                         $rows[$index]['parent_name'] = $parent_data['parent_name'];
                     }
                 }
             }
         }
         $pageData = array();
         reset($rows);
         while ($row = current($rows)) {
             $temp = clone $seed;
             $dataIndex = count($data);
             $temp->setupCustomFields($temp->module_dir);
             $temp->loadFromRow($row);
             if (empty($this->seed->assigned_user_id) && !empty($temp->assigned_user_id)) {
                 $this->seed->assigned_user_id = $temp->assigned_user_id;
             }
             if ($idIndex[$row[$id_field]][0] == $dataIndex) {
                 $pageData['tag'][$dataIndex] = $temp->listviewACLHelper();
             } else {
                 $pageData['tag'][$dataIndex] = $pageData['tag'][$idIndex[$row[$id_field]][0]];
             }
             $data[$dataIndex] = $temp->get_list_view_data($filter_fields);
             $detailViewAccess = $temp->ACLAccess('DetailView');
             $editViewAccess = $temp->ACLAccess('EditView');
             $pageData['rowAccess'][$dataIndex] = array('view' => $detailViewAccess, 'edit' => $editViewAccess);
             $additionalDetailsAllow = $this->additionalDetails && $detailViewAccess && (file_exists('modules/' . $temp->module_dir . '/metadata/additionalDetails.php') || file_exists('custom/modules/' . $temp->module_dir . '/metadata/additionalDetails.php'));
             $additionalDetailsEdit = $editViewAccess;
             if ($additionalDetailsAllow) {
                 if ($this->additionalDetailsAjax) {
                     $ar = $this->getAdditionalDetailsAjax($data[$dataIndex]['ID']);
                 } else {
                     $additionalDetailsFile = 'modules/' . $this->seed->module_dir . '/metadata/additionalDetails.php';
                     if (file_exists('custom/modules/' . $this->seed->module_dir . '/metadata/additionalDetails.php')) {
                         $additionalDetailsFile = 'custom/modules/' . $this->seed->module_dir . '/metadata/additionalDetails.php';
                     }
                     require_once $additionalDetailsFile;
                     $ar = $this->getAdditionalDetails($data[$dataIndex], (empty($this->additionalDetailsFunction) ? 'additionalDetails' : $this->additionalDetailsFunction) . $this->seed->object_name, $additionalDetailsEdit);
                 }
                 $pageData['additionalDetails'][$dataIndex] = $ar['string'];
                 $pageData['additionalDetails']['fieldToAddTo'] = $ar['fieldToAddTo'];
             }
             next($rows);
         }
     }
     $nextOffset = -1;
     $prevOffset = -1;
     $endOffset = -1;
     if ($count > $limit) {
         $nextOffset = $offset + $limit;
     }
     if ($offset > 0) {
         $prevOffset = $offset - $limit;
         if ($prevOffset < 0) {
             $prevOffset = 0;
         }
     }
     $totalCount = $count + $offset;
     if ($count >= $limit && $totalCounted) {
         $totalCount = $this->getTotalCount($main_query);
     }
     SugarVCR::recordIDs($this->seed->module_dir, array_keys($idIndex), $offset, $totalCount);
     $module_names = array('Prospects' => 'Targets');
     $endOffset = floor(($totalCount - 1) / $limit) * $limit;
     $pageData['ordering'] = $order;
     $pageData['ordering']['sortOrder'] = $this->getReverseSortOrder($pageData['ordering']['sortOrder']);
     $pageData['urls'] = $this->generateURLS($pageData['ordering']['sortOrder'], $offset, $prevOffset, $nextOffset, $endOffset, $totalCounted);
     $pageData['offsets'] = array('current' => $offset, 'next' => $nextOffset, 'prev' => $prevOffset, 'end' => $endOffset, 'total' => $totalCount, 'totalCounted' => $totalCounted);
     $pageData['bean'] = array('objectName' => $seed->object_name, 'moduleDir' => $seed->module_dir, 'moduleName' => strtr($seed->module_dir, $module_names));
     $pageData['stamp'] = $this->stamp;
     $pageData['access'] = array('view' => $this->seed->ACLAccess('DetailView'), 'edit' => $this->seed->ACLAccess('EditView'));
     $pageData['idIndex'] = $idIndex;
     if (!$this->seed->ACLAccess('ListView')) {
         $pageData['error'] = 'ACL restricted access';
     }
     $queryString = '';
     if (isset($_REQUEST["searchFormTab"]) && $_REQUEST["searchFormTab"] == "advanced_search" || isset($_REQUEST["type_basic"]) && (count($_REQUEST["type_basic"] > 1) || $_REQUEST["type_basic"][0] != "") || isset($_REQUEST["module"]) && $_REQUEST["module"] == "MergeRecords") {
         $queryString = "-advanced_search";
     } else {
         if (isset($_REQUEST["searchFormTab"]) && $_REQUEST["searchFormTab"] == "basic_search") {
             if ($seed->module_dir == "Reports") {
                 $searchMetaData = SearchFormReports::retrieveReportsSearchDefs();
             } else {
                 $searchMetaData = SearchForm::retrieveSearchDefs($seed->module_dir);
             }
             $basicSearchFields = array();
             if (isset($searchMetaData['searchdefs']) && isset($searchMetaData['searchdefs'][$seed->module_dir]['layout']['basic_search'])) {
                 $basicSearchFields = $searchMetaData['searchdefs'][$seed->module_dir]['layout']['basic_search'];
             }
             foreach ($basicSearchFields as $basicSearchField) {
                 $field_name = is_array($basicSearchField) && isset($basicSearchField['name']) ? $basicSearchField['name'] : $basicSearchField;
                 $field_name .= "_basic";
                 if (isset($_REQUEST[$field_name]) && (!is_array($basicSearchField) || !isset($basicSearchField['type']) || $basicSearchField['type'] == 'text' || $basicSearchField['type'] == 'name')) {
                     $queryString = htmlentities($_REQUEST[$field_name]);
                     break;
                 }
             }
         }
     }
     return array('data' => $data, 'pageData' => $pageData, 'query' => $queryString);
 }
开发者ID:sha2ers,项目名称:sugarcrm-example,代码行数:101,代码来源:ListViewData.php

示例2: prepareSearchForm

 function prepareSearchForm()
 {
     $this->searchForm = null;
     //search
     $view = 'basic_search';
     if (!empty($_REQUEST['search_form_view']) && $_REQUEST['search_form_view'] == 'advanced_search') {
         $view = $_REQUEST['search_form_view'];
     }
     $this->headers = true;
     if (!empty($_REQUEST['search_form_only']) && $_REQUEST['search_form_only']) {
         $this->headers = false;
     } elseif (!isset($_REQUEST['search_form']) || $_REQUEST['search_form'] != 'false') {
         if (isset($_REQUEST['searchFormTab']) && $_REQUEST['searchFormTab'] == 'advanced_search') {
             $view = 'advanced_search';
         } else {
             $view = 'basic_search';
         }
     }
     $this->use_old_search = true;
     if (file_exists('modules/' . $this->module . '/SearchForm.html') && !file_exists('modules/' . $this->module . '/metadata/searchdefs.php') || file_exists('custom/modules/' . $this->module . '/SearchForm.html') && !file_exists('custom/modules/' . $this->module . '/metadata/searchdefs.php')) {
         require_once 'include/SearchForm/SearchForm.php';
         $this->searchForm = new SearchForm($this->module, $this->seed);
     } else {
         $this->use_old_search = false;
         require_once 'include/SearchForm/SearchForm2.php';
         $searchMetaData = SearchForm::retrieveSearchDefs($this->module);
         $this->searchForm = $this->getSearchForm2($this->seed, $this->module, $this->action);
         $this->searchForm->setup($searchMetaData['searchdefs'], $searchMetaData['searchFields'], 'SearchFormGeneric.tpl', $view, $this->listViewDefs);
         $this->searchForm->lv = $this->lv;
     }
 }
开发者ID:auf,项目名称:crm_auf_org,代码行数:31,代码来源:view.list.php


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