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


PHP StoreQuery::saveFromRequest方法代码示例

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


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

示例1: action_massupdate

 /**
  * Perform the actual massupdate.
  */
 protected function action_massupdate()
 {
     if (!empty($_REQUEST['massupdate']) && $_REQUEST['massupdate'] == 'true' && (!empty($_REQUEST['uid']) || !empty($_REQUEST['entire']))) {
         if (!empty($_REQUEST['Delete']) && $_REQUEST['Delete'] == 'true' && !$this->bean->ACLAccess('delete') || (empty($_REQUEST['Delete']) || $_REQUEST['Delete'] != 'true') && !$this->bean->ACLAccess('save')) {
             ACLController::displayNoAccess(true);
             sugar_cleanup(true);
         }
         set_time_limit(0);
         //I'm wondering if we will set it never goes timeout here.
         // until we have more efficient way of handling MU, we have to disable the limit
         $GLOBALS['db']->setQueryLimit(0);
         require_once "include/MassUpdate.php";
         require_once 'modules/MySettings/StoreQuery.php';
         $seed = loadBean($_REQUEST['module']);
         $mass = new MassUpdate();
         $mass->setSugarBean($seed);
         if (isset($_REQUEST['entire']) && empty($_POST['mass'])) {
             $mass->generateSearchWhere($_REQUEST['module'], $_REQUEST['current_query_by_page']);
         }
         $mass->handleMassUpdate();
         $storeQuery = new StoreQuery();
         //restore the current search. to solve bug 24722 for multi tabs massupdate.
         $temp_req = array('current_query_by_page' => $_REQUEST['current_query_by_page'], 'return_module' => $_REQUEST['return_module'], 'return_action' => $_REQUEST['return_action']);
         if ($_REQUEST['return_module'] == 'Emails') {
             if (!empty($_REQUEST['type']) && !empty($_REQUEST['ie_assigned_user_id'])) {
                 $this->req_for_email = array('type' => $_REQUEST['type'], 'ie_assigned_user_id' => $_REQUEST['ie_assigned_user_id']);
                 // Specifically for My Achieves
             }
         }
         $_REQUEST = array();
         $_REQUEST = unserialize(base64_decode($temp_req['current_query_by_page']));
         unset($_REQUEST[$seed->module_dir . '2_' . strtoupper($seed->object_name) . '_offset']);
         //after massupdate, the page should redirect to no offset page
         $storeQuery->saveFromRequest($_REQUEST['module']);
         $_REQUEST = array('return_module' => $temp_req['return_module'], 'return_action' => $temp_req['return_action']);
         //for post_massupdate, to go back to original page.
     } else {
         sugar_die("You must massupdate at least one record");
     }
 }
开发者ID:sunmo,项目名称:snowlotus,代码行数:43,代码来源:SugarController.php

示例2: display


//.........这里部分代码省略.........
                 $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;
     $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 (file_exists('modules/' . $this->module . '/SearchForm.html')) {
         require_once 'include/SearchForm/SearchForm.php';
         $searchForm = new SearchForm($this->module, $this->seed);
     } else {
         $use_old_search = false;
         require_once 'include/SearchForm/SearchForm2.php';
         if (file_exists('custom/modules/' . $this->module . '/metadata/searchdefs.php')) {
             require_once 'custom/modules/' . $this->module . '/metadata/searchdefs.php';
         } elseif (!empty($metafiles[$this->module]['searchdefs'])) {
             require_once $metafiles[$this->module]['searchdefs'];
         } elseif (file_exists('modules/' . $this->module . '/metadata/searchdefs.php')) {
             require_once 'modules/' . $this->module . '/metadata/searchdefs.php';
         }
         if (!empty($metafiles[$this->module]['searchfields'])) {
             require_once $metafiles[$this->module]['searchfields'];
开发者ID:sysraj86,项目名称:carnivalcrm,代码行数:67,代码来源:view.list.php

示例3: elseif

        $saved_search->retrieveSavedSearch($_REQUEST['saved_search_select']);
        $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']);
    }
}
require_once 'modules/MySettings/StoreQuery.php';
$storeQuery = new StoreQuery();
if (!isset($_REQUEST['query'])) {
    $storeQuery->loadQuery('Users');
    $storeQuery->populateRequest();
} else {
    $storeQuery->saveFromRequest('Users');
}
$displayColumns = array();
// check $_REQUEST if new display columns from post
if (!empty($_REQUEST['displayColumns'])) {
    foreach (explode('|', $_REQUEST['displayColumns']) as $num => $col) {
        if (!empty($listViewDefs['Users'][$col])) {
            $displayColumns[$col] = $listViewDefs['Users'][$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['Users'] as $col => $params) {
开发者ID:klr2003,项目名称:sourceread,代码行数:31,代码来源:ListView.php

示例4: 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

示例5: 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

示例6: action_massupdate

 /**
  * Perform the actual massupdate.
  */
 protected function action_massupdate()
 {
     global $app_strings;
     if (!empty($_REQUEST['massupdate']) && $_REQUEST['massupdate'] == 'true' && (!empty($_REQUEST['uid']) || !empty($_REQUEST['entire']))) {
         if (!empty($_REQUEST['Delete']) && $_REQUEST['Delete'] == 'true' && !$this->bean->ACLAccess('delete') || (empty($_REQUEST['Delete']) || $_REQUEST['Delete'] != 'true') && !$this->bean->ACLAccess('save')) {
             ACLController::displayNoAccess(true);
             sugar_cleanup(true);
         }
         set_time_limit(0);
         //I'm wondering if we will set it never goes timeout here.
         // until we have more efficient way of handling MU, we have to disable the limit
         $GLOBALS['db']->setQueryLimit(0);
         require_once 'modules/MySettings/StoreQuery.php';
         $seed = BeanFactory::getBean($_REQUEST['module']);
         SugarAutoLoader::requireWithCustom('include/MassUpdate.php');
         $massUpdateClass = SugarAutoLoader::customClass('MassUpdate');
         $mass = new $massUpdateClass();
         $mass->setSugarBean($seed);
         if (isset($_REQUEST['entire']) && empty($_POST['mass'])) {
             $mass->generateSearchWhere($_REQUEST['module'], $_REQUEST['current_query_by_page']);
         }
         $arr = $mass->handleMassUpdate();
         $storeQuery = new StoreQuery();
         //restore the current search. to solve bug 24722 for multi tabs massupdate.
         $temp_req = array('current_query_by_page' => $_REQUEST['current_query_by_page'], 'return_module' => $_REQUEST['return_module'], 'return_action' => $_REQUEST['return_action']);
         if (!empty($_POST['mass'])) {
             $total_records = count($_POST['mass']);
             $failed_update = count($arr);
             $successful_update = $total_records - $failed_update;
             if ($successful_update == $total_records) {
                 //show succesful deletion message if this is a delete update
                 if (!empty($_REQUEST['Delete'])) {
                     $massupdate_status = $app_strings['TPL_MASSDELETE_SUCCESS'];
                     $massupdate_status = str_replace("{{num}}", $successful_update, $massupdate_status);
                 } else {
                     //show succesful update message if this is not a delete request
                     $massupdate_status = $app_strings['LBL_MASS_UPDATE_SUCCESS'];
                 }
             } else {
                 if (!empty($_REQUEST['Delete'])) {
                     $massupdate_status = $app_strings['TPL_MASSDELETE_SUCCESS'];
                 } else {
                     $massupdate_status = $app_strings['TPL_MASSUPDATE_SUCCESS'];
                 }
                 $massupdate_status .= " " . $app_strings['TPL_MASSUPDATE_WARNING_PERMISSION'];
                 $massupdate_status = str_replace("{{num}}", $successful_update, $massupdate_status);
                 $massupdate_status = str_replace("{{remain}}", $failed_update, $massupdate_status);
             }
             $temp_req['updated_records'] = $massupdate_status;
         }
         if ($_REQUEST['return_module'] == 'Emails') {
             if (!empty($_REQUEST['type']) && !empty($_REQUEST['ie_assigned_user_id'])) {
                 $this->req_for_email = array('type' => $_REQUEST['type'], 'ie_assigned_user_id' => $_REQUEST['ie_assigned_user_id']);
                 // Specifically for My Achieves
             }
         }
         $_REQUEST = array();
         $_REQUEST = unserialize(base64_decode($temp_req['current_query_by_page']));
         unset($_REQUEST[$seed->module_dir . '2_' . strtoupper($seed->object_name) . '_offset']);
         //after massupdate, the page should redirect to no offset page
         $storeQuery->saveFromRequest($_REQUEST['module']);
         $_REQUEST = array('return_module' => $temp_req['return_module'], 'return_action' => $temp_req['return_action'], 'updated_records' => $temp_req['updated_records']);
         //for post_massupdate, to go back to original page.
     } else {
         sugar_die("You must massupdate at least one record");
     }
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:70,代码来源:SugarController.php

示例7: elseif

        $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']);
    }
}
require_once 'modules/MySettings/StoreQuery.php';
$storeQuery = new StoreQuery();
if (!isset($_REQUEST['query']) && empty($_GET['favorite'])) {
    // when we click the 'My Favorate Reports', it should not populate the StoredQuery
    $storeQuery->loadQuery($currentModule);
    $storeQuery->populateRequest();
} else {
    $storeQuery->saveFromRequest($currentModule);
}
// setup for search form
$thisMod = 'Reports';
$searchForm = new SearchFormReports($thisMod, $savedReportsSeed);
$searchForm->tabs = array(array('title' => $app_strings['LNK_BASIC_SEARCH'], 'link' => $thisMod . '|basic_search', 'key' => $thisMod . '|basic_search'), array('title' => $app_strings['LNK_ADVANCED_SEARCH'], 'link' => $thisMod . '|advanced_search', 'key' => $thisMod . '|advanced_search'));
$searchForm->populateFromRequest();
$searchForm->searchFields['module'] = $searchForm->searchFields['report_module'];
unset($searchForm->searchFields['report_module']);
$where_clauses = $searchForm->generateSearchWhere();
include 'include/modules.php';
$ACLAllowedModules = getACLAllowedModules();
$ACLUnAllowedModules = getACLDisAllowedModules();
$ACLAllowedModulesKeys = array_keys($ACLAllowedModules);
$listViewDefsNewArray = array();
$listViewDefsNewArray = sugarArrayMerge($listViewDefsNewArray, $listViewDefs);
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:31,代码来源:ListView.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::saveFromRequest方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。