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


PHP StoreQuery::populateRequest方法代码示例

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


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

示例1: testPopulateRequestOverride

 function testPopulateRequestOverride()
 {
     $_REQUEST['lvso'] = 'desc';
     $_REQUEST['foo'] = 'bar';
     $sq = new StoreQuery();
     $sq->loadQuery("Contacts");
     //StoreQuery should override foo while leaving lvso untouched
     $sq->query['lvso'] = 'asc';
     $sq->query['foo'] = 'overridden';
     $sq->populateRequest();
     $this->assertEquals($_REQUEST['lvso'], 'desc');
     $this->assertEquals($_REQUEST['foo'], 'overridden');
 }
开发者ID:jgera,项目名称:sugarcrm_dev,代码行数:13,代码来源:StoreQueryTest.php

示例2: testAdvancedSearchWithCommaSeparatedBugNumbers

 public function testAdvancedSearchWithCommaSeparatedBugNumbers()
 {
     $_REQUEST = array();
     $storeQuery = new StoreQuery();
     $query['action'] = 'index';
     $query['module'] = 'Bugs';
     $query['orderBy'] = 'BUG_NUMBER';
     $query['sortOrder'] = 'ASC';
     $query['query'] = 'true';
     $query['searchFormTab'] = 'advanced_search';
     $query['showSSDIV'] = 'no';
     $query['bug_number_advanced'] = '1,2,3,4,5';
     $query['name_advanced'] = '';
     $query['status_advanced'][] = 'Assigned';
     $query['favorites_only_advanced'] = '0';
     $query['search_module'] = 'Bug';
     $query['saved_search_action'] = 'save';
     $query['displayColumns'] = 'BUG_NUMBER|NAME|STATUS|TYPE|PRIORITY|FIXED_IN_RELEASE_NAME|ASSIGNED_USER_NAME';
     $storeQuery->query = $query;
     $storeQuery->populateRequest();
     $this->assertEquals('1,2,3,4,5', $_REQUEST['bug_number_advanced'], "Assert that bug search string 1,2,3,4,5 was not formatted");
 }
开发者ID:jgera,项目名称:sugarcrm_dev,代码行数:22,代码来源:Bug44908Test.php

示例3: get_admin_fts_list

function get_admin_fts_list($where, $isMultiSelect = false)
{
    global $app_strings, $app_list_strings, $current_language, $sugar_version, $sugar_config, $current_user;
    global $urlPrefix, $currentModule, $theme;
    $current_module_strings = return_module_language($current_language, 'KBDocuments');
    // focus_list is the means of passing data to a ListView.
    global $focus_list;
    require_once 'include/ListView/ListViewSmarty.php';
    require_once SugarAutoLoader::loadWithMetafiles('KBDocuments', 'listviewdefs');
    require_once 'modules/KBDocuments/KBListViewData.php';
    global $app_strings;
    global $app_list_strings;
    global $current_language;
    $current_module_strings = return_module_language($current_language, 'KBDocuments');
    global $urlPrefix;
    global $currentModule;
    global $theme;
    global $current_user;
    // focus_list is the means of passing data to a ListView.
    global $focus_list;
    // setup quicksearch
    //require_once('include/QuickSearchDefaults.php');
    //$qsd = new QuickSearchDefaults();
    // clear the display columns back to default when clear query is called
    if (!empty($_REQUEST['clear_query']) && $_REQUEST['clear_query'] == 'true') {
        $current_user->setPreference('ListViewDisplayColumns', array(), 0, $currentModule);
    }
    $savedDisplayColumns = $current_user->getPreference('ListViewDisplayColumns', $currentModule);
    // get user defined display columns
    $json = getJSONobj();
    $seedCase = BeanFactory::getBean('KBDocuments');
    // seed bean
    // setup listview smarty
    $lv = new ListViewSmarty();
    $lv->lvd = new KBListViewData();
    $lv->export = false;
    $lv->select = false;
    $lv->delete = false;
    $_REQUEST['action'] = 'index';
    $displayColumns = array();
    // check $_REQUEST if new display columns from post
    if (!empty($_REQUEST['displayColumns'])) {
        foreach (explode('|', $_REQUEST['displayColumns']) as $num => $col) {
            if (!empty($listViewDefs['KBDocuments'][$col])) {
                $displayColumns[$col] = $listViewDefs['KBDocuments'][$col];
            }
        }
    } elseif (!empty($savedDisplayColumns)) {
        // use user defined display columns from preferences
        $displayColumns = $savedDisplayColumns;
    } else {
        // use columns defined in listviewdefs for default display columns
        foreach ($listViewDefs['KBDocuments'] as $col => $params) {
            if (!empty($params['default']) && $params['default']) {
                $displayColumns[$col] = $params;
            }
        }
    }
    $params = array('massupdate' => true);
    // setup ListViewSmarty params
    if (!empty($_REQUEST['orderBy'])) {
        // order by coming from $_REQUEST
        $params['orderBy'] = $_REQUEST['orderBy'];
        $params['overrideOrder'] = true;
        if (!empty($_REQUEST['sortOrder'])) {
            $params['sortOrder'] = $_REQUEST['sortOrder'];
        }
    }
    //make sure the column names (array keys) are in upper case
    $displayColumns = array_change_key_case($displayColumns, CASE_UPPER);
    $lv->displayColumns = $displayColumns;
    // use the stored query if there is one
    if (!isset($where)) {
        $where = "";
    }
    require_once 'modules/MySettings/StoreQuery.php';
    $storeQuery = new StoreQuery();
    if (!isset($_REQUEST['query'])) {
        $storeQuery->loadQuery($currentModule);
        $storeQuery->populateRequest();
    } else {
        $storeQuery->saveFromGet($currentModule);
    }
    if (isset($_REQUEST['query'])) {
        // we have a query
        // first save columns
        $current_user->setPreference('ListViewDisplayColumns', $displayColumns, 0, $currentModule);
        if (!empty($_SERVER['HTTP_REFERER']) && preg_match('/action=EditView/', $_SERVER['HTTP_REFERER'])) {
            // from EditView cancel
            $searchForm->populateFromArray($storeQuery->query);
        } else {
            $searchForm->populateFromRequest();
        }
        $where_clauses = $searchForm->generateSearchWhere(true, "kbdocuments");
        // builds the where clause from search field inputs
        if (count($where_clauses) > 0) {
            $where = implode(' and ', $where_clauses);
        }
        $GLOBALS['log']->info("Here is the where clause for the list view: {$where}");
    }
//.........这里部分代码省略.........
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:101,代码来源:SearchUtils.php

示例4: StoreQuery

            break;
        case 'saved_views':
            echo $searchForm->displaySavedViews($listViewDefs, $lv, false);
            break;
    }
    return;
}
// use the stored query if there is one
if (!isset($where)) {
    $where = "";
}
require_once 'modules/MySettings/StoreQuery.php';
$storeQuery = new StoreQuery();
if (!isset($_REQUEST['query'])) {
    $storeQuery->loadQuery($currentModule);
    $storeQuery->populateRequest();
} else {
    $storeQuery->saveFromGet($currentModule);
}
if (isset($_REQUEST['query'])) {
    // we have a query
    // first save columns
    $current_user->setPreference('ListViewDisplayColumns', $displayColumns, 0, $currentModule);
    $searchForm->populateFromRequest();
    // gathers search field inputs from $_REQUEST
    $where_clauses = $searchForm->generateSearchWhere(true, "Products");
    // builds the where clause from search field inputs
    if (count($where_clauses) > 0) {
        $where = implode(' and ', $where_clauses);
    }
    $GLOBALS['log']->info("Here is the where clause for the list view: {$where}");
开发者ID:BackupTheBerlios,项目名称:livealphaprint,代码行数:31,代码来源:ListView.php

示例5: display

 function display()
 {
     if (!$this->bean->ACLAccess('list')) {
         ACLController::displayNoAccess();
         return;
     }
     $module = $GLOBALS['module'];
     $metadataFile = null;
     $foundViewDefs = false;
     if (file_exists('custom/modules/' . $module . '/metadata/listviewdefs.php')) {
         $metadataFile = 'custom/modules/' . $module . '/metadata/listviewdefs.php';
         $foundViewDefs = true;
     } else {
         if (file_exists('custom/modules/' . $module . '/metadata/metafiles.php')) {
             require_once 'custom/modules/' . $module . '/metadata/metafiles.php';
             if (!empty($metafiles[$module]['listviewdefs'])) {
                 $metadataFile = $metafiles[$module]['listviewdefs'];
                 $foundViewDefs = true;
             }
         } elseif (file_exists('modules/' . $module . '/metadata/metafiles.php')) {
             require_once 'modules/' . $module . '/metadata/metafiles.php';
             if (!empty($metafiles[$module]['listviewdefs'])) {
                 $metadataFile = $metafiles[$module]['listviewdefs'];
                 $foundViewDefs = true;
             }
         }
     }
     if (!$foundViewDefs && file_exists('modules/' . $module . '/metadata/listviewdefs.php')) {
         $metadataFile = 'modules/' . $module . '/metadata/listviewdefs.php';
     }
     require_once $metadataFile;
     $seed = $this->bean;
     if (!empty($this->bean->object_name) && isset($_REQUEST[$module . '2_' . strtoupper($this->bean->object_name) . '_offset'])) {
         //if you click the pagination button, it will poplate the search criteria here
         if (!empty($_REQUEST['current_query_by_page'])) {
             //The code support multi browser tabs pagination
             $blockVariables = array('mass', 'uid', 'massupdate', 'delete', 'merge', 'selectCount', 'request_data', 'current_query_by_page', $module . '2_' . strtoupper($this->bean->object_name) . '_ORDER_BY');
             if (isset($_REQUEST['lvso'])) {
                 $blockVariables[] = 'lvso';
             }
             $current_query_by_page = unserialize(base64_decode($_REQUEST['current_query_by_page']));
             foreach ($current_query_by_page as $search_key => $search_value) {
                 if ($search_key != $module . '2_' . strtoupper($this->bean->object_name) . '_offset' && !in_array($search_key, $blockVariables)) {
                     if (!is_array($search_value)) {
                         $_REQUEST[$search_key] = $GLOBALS['db']->quoteForEmail($search_value);
                     } else {
                         foreach ($search_value as $key => &$val) {
                             $val = $GLOBALS['db']->quoteForEmail($val);
                         }
                         $_REQUEST[$search_key] = $search_value;
                     }
                 }
             }
         }
     }
     if (!empty($_REQUEST['saved_search_select']) && $_REQUEST['saved_search_select'] != '_none') {
         if (empty($_REQUEST['button']) && (empty($_REQUEST['clear_query']) || $_REQUEST['clear_query'] != 'true')) {
             $this->saved_search = loadBean('SavedSearch');
             $this->saved_search->retrieveSavedSearch($_REQUEST['saved_search_select']);
             $this->saved_search->populateRequest();
         } elseif (!empty($_REQUEST['button'])) {
             // click the search button, after retrieving from saved_search
             $_SESSION['LastSavedView'][$_REQUEST['module']] = '';
             unset($_REQUEST['saved_search_select']);
             unset($_REQUEST['saved_search_select_name']);
         }
     }
     $lv = new ListViewSmarty();
     $displayColumns = array();
     if (!empty($_REQUEST['displayColumns'])) {
         foreach (explode('|', $_REQUEST['displayColumns']) as $num => $col) {
             if (!empty($listViewDefs[$module][$col])) {
                 $displayColumns[$col] = $listViewDefs[$module][$col];
             }
         }
     } else {
         foreach ($listViewDefs[$module] as $col => $params) {
             if (!empty($params['default']) && $params['default']) {
                 $displayColumns[$col] = $params;
             }
         }
     }
     global $current_user;
     if (!is_admin($current_user)) {
         $params = array('massupdate' => false);
         $lv->export = false;
     } else {
         $params = array('massupdate' => true, 'export' => true);
     }
     if (!empty($_REQUEST['orderBy'])) {
         $params['orderBy'] = $_REQUEST['orderBy'];
         $params['overrideOrder'] = true;
         if (!empty($_REQUEST['sortOrder'])) {
             $params['sortOrder'] = $_REQUEST['sortOrder'];
         }
     }
     $lv->displayColumns = $displayColumns;
     $this->seed = $seed;
     $this->module = $module;
     $searchForm = null;
//.........这里部分代码省略.........
开发者ID:sysraj86,项目名称:carnivalcrm,代码行数:101,代码来源:view.list.php

示例6: testStoreQuerySaveAndPopulate

 public function testStoreQuerySaveAndPopulate()
 {
     global $current_user, $timedate;
     $storeQuery = new StoreQuery();
     //Simulate a search request here
     $_REQUEST = array('module' => 'Opportunities', 'action' => 'index', 'searchFormTab' => 'advanced_search', 'query' => true, 'name_advanced' => '', 'account_name_advanced' => '', 'amount_advanced_range_choice' => '=', 'range_amount_advanced' => '', 'start_range_amount_advanced' => '', 'end_range_amount_advanced' => '', 'date_closed_advanced_range_choice' => '=', 'range_date_closed_advanced' => '09/01/2008', 'start_range_date_closed_advanced' => '', 'end_range_date_closed_advanced' => '', 'next_step_advanced' => '', 'update_fields_team_name_advanced_collection' => '', 'team_name_advanced_new_on_update' => false, 'team_name_advanced_allow_update' => '', 'team_name_advanced_allowed_to_check' => false, 'team_name_advanced_collection_0' => '', 'id_team_name_advanced_collection_0' => '', 'team_name_advanced_type' => 'any', 'favorites_only_advanced' => 0, 'showSSDIV' => 'no', 'saved_search_name' => '', 'search_module' => '', 'saved_search_action' => '', 'displayColumns' => 'NAME|ACCOUNT_NAME|SALES_STAGE|AMOUNT_USDOLLAR|DATE_CLOSED|ASSIGNED_USER_NAME|DATE_ENTERED', 'hideTabs' => 'OPPORTUNITY_TYPE|LEAD_SOURCE|NEXT_STEP|PROBABILITY|CREATED_BY_NAME|TEAM_NAME|MODIFIED_BY_NAME', 'orderBy' => 'NAME', 'sortOrder' => 'ASC', 'button' => 'Search', 'saved_search_select' => '_none', 'sugar_user_theme' => 'Sugar', 'ModuleBuilder' => 'helpHidden=true', 'Contacts_divs' => 'quotes_v=#', 'sugar_theme_gm_current' => 'All', 'globalLinksOpen' => 'true', 'SQLiteManager_currentLangue' => '2', 'PHPSESSID' => 'b8e4b4b955ef3c4b29291779751b5fca');
     $storeQuery->saveFromRequest('Opportunities');
     $storedSearch = StoreQuery::getStoredQueryForUser('Opportunities');
     $this->assertEquals($storedSearch['range_date_closed_advanced'], '2008-09-01', 'Assert that search date 09/02/2008 was saved in db format 2008-09-01');
     //Test that value is converted to user date preferences when retrieved
     unset($_REQUEST['range_date_closed_advanced']);
     $storeQuery->loadQuery('Opportunities');
     $storeQuery->populateRequest();
     $this->assertTrue(isset($_REQUEST['range_date_closed_advanced']), 'Assert that the field was correctly populated');
     $this->assertEquals($_REQUEST['range_date_closed_advanced'], '09/01/2008', 'Assert that search date in db_format 2008-09-01 was converted to user date preference 09/01/2008');
     //Now say the user changes his date preferences and switches back to this StoredQuery
     $current_user->setPreference('datef', 'Y.m.d', 0, 'global');
     $current_user->save();
     //Now when we reload this store query, the $_REQUEST array should be populated with new user date preference
     unset($_REQUEST['range_date_closed_advanced']);
     $storeQuery->loadQuery('Opportunities');
     $storeQuery->populateRequest();
     $this->assertTrue(isset($_REQUEST['range_date_closed_advanced']), 'Assert that the field was correctly populated');
     $this->assertEquals($_REQUEST['range_date_closed_advanced'], '2008.09.01', 'Assert that search date in db_format 2008-09-01 was converted to user date preference 2008.09.01');
 }
开发者ID:nickpro,项目名称:sugarcrm_dev,代码行数:25,代码来源:Bug42378Test.php

示例7: testStoreQuerySaveAndPopulate

 public function testStoreQuerySaveAndPopulate()
 {
     global $current_user, $timedate;
     $storeQuery = new StoreQuery();
     //Simulate a search request here
     $_REQUEST = array('module' => 'Opportunities', 'action' => 'index', 'searchFormTab' => 'advanced_search', 'query' => true, 'name_advanced' => '', 'account_name_advanced' => '', 'amount_advanced_range_choice' => '=', 'range_amount_advanced' => '', 'start_range_amount_advanced' => '$9,500.00', 'end_range_amount_advanced' => '$45,900.00', 'date_closed_advanced_range_choice' => '=', 'range_date_closed_advanced' => '', 'start_range_date_closed_advanced' => '', 'end_range_date_closed_advanced' => '', 'next_step_advanced' => '', 'update_fields_team_name_advanced_collection' => '', 'team_name_advanced_new_on_update' => false, 'team_name_advanced_allow_update' => '', 'team_name_advanced_allowed_to_check' => false, 'team_name_advanced_collection_0' => '', 'id_team_name_advanced_collection_0' => '', 'team_name_advanced_type' => 'any', 'favorites_only_advanced' => 0, 'showSSDIV' => 'no', 'saved_search_name' => '', 'search_module' => '', 'saved_search_action' => '', 'displayColumns' => 'NAME|ACCOUNT_NAME|SALES_STAGE|AMOUNT_USDOLLAR|DATE_CLOSED|ASSIGNED_USER_NAME|DATE_ENTERED', 'hideTabs' => 'OPPORTUNITY_TYPE|LEAD_SOURCE|NEXT_STEP|PROBABILITY|CREATED_BY_NAME|TEAM_NAME|MODIFIED_BY_NAME', 'orderBy' => 'NAME', 'sortOrder' => 'ASC', 'button' => 'Search', 'saved_search_select' => '_none', 'sugar_user_theme' => 'Sugar', 'ModuleBuilder' => 'helpHidden=true', 'Contacts_divs' => 'quotes_v=#', 'sugar_theme_gm_current' => 'All', 'globalLinksOpen' => 'true', 'SQLiteManager_currentLangue' => '2', 'PHPSESSID' => 'b8e4b4b955ef3c4b29291779751b5fca');
     $storeQuery->saveFromRequest('Opportunities');
     $storedSearch = StoreQuery::getStoredQueryForUser('Opportunities');
     $this->assertEquals($storedSearch['start_range_amount_advanced'], 9500.0, 'Assert that start range amount $9,500.00 was saved unformatted as 9500.00');
     $this->assertEquals($storedSearch['end_range_amount_advanced'], 45900.0, 'Assert that end range amount $45,900.00 was saved unformatted as 45900.00');
     //Test that value is converted to user's numer formatting
     unset($_REQUEST['start_range_amount_advanced']);
     unset($_REQUEST['end_range_amount_advanced']);
     $storeQuery->loadQuery('Opportunities');
     $storeQuery->populateRequest();
     $this->assertTrue(isset($_REQUEST['start_range_amount_advanced']), 'Assert that the start_range_amount_advanced field was correctly populated');
     $this->assertEquals('$9,500.00', $_REQUEST['start_range_amount_advanced'], 'Assert that start_range_amount_advanced value was converted to $9,500.00');
     $this->assertTrue(isset($_REQUEST['end_range_amount_advanced']), 'Assert that the end_range_amount_advanced field was correctly populated');
     $this->assertEquals('$45,900.00', $_REQUEST['end_range_amount_advanced'], 'Assert that end_range_amount_advanced value was converted to $45,900.00');
     //Now say the user changes his number preferences and switches back to this StoredQuery
     $current_user->setPreference('num_grp_sep', '.');
     $current_user->setPreference('dec_sep', ',');
     $current_user->save();
     //Force reset on dec_sep and num_grp_sep because the dec_sep and num_grp_sep values are stored as static variables
     get_number_seperators(true);
     //Now when we reload this store query, the $_REQUEST array should be populated with new user date preference
     unset($_REQUEST['start_range_amount_advanced']);
     unset($_REQUEST['end_range_amount_advanced']);
     $storeQuery->loadQuery('Opportunities');
     $storeQuery->populateRequest();
     $this->assertTrue(isset($_REQUEST['start_range_amount_advanced']), 'Assert that the start_range_amount_advanced field was correctly populated');
     $this->assertEquals('$9.500,00', $_REQUEST['start_range_amount_advanced'], 'Assert that start_range_amount_advanced value was converted to $9.500,00');
     $this->assertTrue(isset($_REQUEST['end_range_amount_advanced']), 'Assert that the end_range_amount_advanced field was correctly populated');
     $this->assertEquals('$45.900,00', $_REQUEST['end_range_amount_advanced'], 'Assert that end_range_amount_advanced value was converted to $45.900,00');
     //Okay so now what happens if they don't specify currency or separator or decimal values?
     $_REQUEST['start_range_amount_advanced'] = 9500;
     $_REQUEST['end_range_amount_advanced'] = 45900;
     $storeQuery->saveFromRequest('Opportunities');
     $storeQuery->loadQuery('Opportunities');
     $storeQuery->populateRequest();
     $this->assertTrue(isset($_REQUEST['start_range_amount_advanced']), 'Assert that the start_range_amount_advanced field was correctly populated');
     $this->assertEquals(9500, $_REQUEST['start_range_amount_advanced'], 'Assert that start_range_amount_advanced value remained as is (9500)');
     $this->assertTrue(isset($_REQUEST['end_range_amount_advanced']), 'Assert that the end_range_amount_advanced field was correctly populated');
     $this->assertEquals(45900, $_REQUEST['end_range_amount_advanced'], 'Assert that end_range_amount_advanced value remained as is (45900)');
 }
开发者ID:nickpro,项目名称:sugarcrm_dev,代码行数:45,代码来源:Bug42915Test.php

示例8: display

 function display()
 {
     if (!$this->bean->ACLAccess('list')) {
         ACLController::displayNoAccess();
         return;
     }
     $module = $GLOBALS['module'];
     $metadataFile = SugarAutoLoader::loadWithMetafiles($module, 'listviewdefs');
     require_once $metadataFile;
     $this->bean->ACLFilterFieldList($listViewDefs[$module], array("owner_override" => true));
     $seed = $this->bean;
     if (!empty($this->bean->object_name) && isset($_REQUEST[$module . '2_' . strtoupper($this->bean->object_name) . '_offset'])) {
         //if you click the pagination button, it will populate the search criteria here
         if (!empty($_REQUEST['current_query_by_page'])) {
             //The code support multi browser tabs pagination
             $blockVariables = array('mass', 'uid', 'massupdate', 'delete', 'merge', 'selectCount', 'request_data', 'current_query_by_page', $module . '2_' . strtoupper($this->bean->object_name) . '_ORDER_BY');
             if (isset($_REQUEST['lvso'])) {
                 $blockVariables[] = 'lvso';
             }
             $current_query_by_page = unserialize(base64_decode($_REQUEST['current_query_by_page']));
             foreach ($current_query_by_page as $search_key => $search_value) {
                 if ($search_key != $module . '2_' . strtoupper($this->bean->object_name) . '_offset' && !in_array($search_key, $blockVariables)) {
                     if (!is_array($search_value)) {
                         $_REQUEST[$search_key] = $GLOBALS['db']->quote($search_value);
                     } else {
                         foreach ($search_value as $key => &$val) {
                             $val = $GLOBALS['db']->quote($val);
                         }
                         $_REQUEST[$search_key] = $search_value;
                     }
                 }
             }
         }
     }
     if (!empty($_REQUEST['saved_search_select']) && $_REQUEST['saved_search_select'] != '_none') {
         if (empty($_REQUEST['button']) && (empty($_REQUEST['clear_query']) || $_REQUEST['clear_query'] != 'true')) {
             $this->saved_search = BeanFactory::getBean('SavedSearch');
             $this->saved_search->retrieveSavedSearch($_REQUEST['saved_search_select']);
             $this->saved_search->populateRequest();
         } elseif (!empty($_REQUEST['button'])) {
             // click the search button, after retrieving from saved_search
             $_SESSION['LastSavedView'][$_REQUEST['module']] = '';
             unset($_REQUEST['saved_search_select']);
             unset($_REQUEST['saved_search_select_name']);
         }
     }
     $lv = new ListViewSmarty();
     $displayColumns = array();
     if (!empty($_REQUEST['displayColumns'])) {
         foreach (explode('|', $_REQUEST['displayColumns']) as $num => $col) {
             if (!empty($listViewDefs[$module][$col])) {
                 $displayColumns[$col] = $listViewDefs[$module][$col];
             }
         }
     } else {
         foreach ($listViewDefs[$module] as $col => $params) {
             if (!empty($params['default']) && $params['default']) {
                 $displayColumns[$col] = $params;
             }
         }
     }
     $params = array('massupdate' => true, 'export' => true);
     if (!empty($_REQUEST['orderBy'])) {
         $params['orderBy'] = $_REQUEST['orderBy'];
         $params['overrideOrder'] = true;
         if (!empty($_REQUEST['sortOrder'])) {
             $params['sortOrder'] = $_REQUEST['sortOrder'];
         }
     }
     $lv->displayColumns = $displayColumns;
     $this->seed = $seed;
     $this->module = $module;
     $searchForm = null;
     $storeQuery = new StoreQuery();
     if (!isset($_REQUEST['query'])) {
         $storeQuery->loadQuery($this->module);
         $storeQuery->populateRequest();
     } else {
         $storeQuery->saveFromRequest($this->module);
     }
     //search
     $view = 'basic_search';
     if (!empty($_REQUEST['search_form_view'])) {
         $view = $_REQUEST['search_form_view'];
     }
     $headers = true;
     if (!empty($_REQUEST['search_form_only']) && $_REQUEST['search_form_only']) {
         $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';
         }
     }
     $use_old_search = true;
     if (SugarAutoLoader::existing('modules/' . $this->module . '/SearchForm.html')) {
         require_once 'include/SearchForm/SearchForm.php';
         $searchForm = new SearchForm($this->module, $this->seed);
     } else {
//.........这里部分代码省略.........
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:101,代码来源:view.list.php


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