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}"); } // start display
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}"); } $lv->export = false; $lv->show_mass_update_form = false; $lv->show_action_dropdown = false; $lv->delete = false; $lv->select = false; $lv->setup($seedCase, 'modules/KBDocuments/AdminSearchListView.tpl', $where, $params); $lv->show_mass_update_form = false; $savedSearchName = empty($_REQUEST['saved_search_select_name']) ? '' : ' - ' . $_REQUEST['saved_search_select_name']; $ret_str = $lv->display(false); $json = getJSONobj(); return $ret_str; }
$whereClauses = array(); $error = ''; /////////////////////////////////////////////////////////////////////////////// //// //// SEARCH FORM FUNCTIONALITY //// SEARCH QUERY GENERATION $storeQuery = new StoreQuery(); if (!isset($_REQUEST['query'])) { //_pp('loading: '.$currentModule.'Group'); //_pp($current_user->user_preferences[$currentModule.'GroupQ']); $storeQuery->loadQuery($currentModule . 'Group'); $storeQuery->populateRequest(); } else { //_pp($current_user->user_preferences[$currentModule.'GroupQ']); //_pp('saving: '.$currentModule.'Group'); $storeQuery->saveFromGet($currentModule . 'Group'); } if (isset($_REQUEST['query'])) { // we have a query if (isset($_REQUEST['email_type'])) { $email_type = $_REQUEST['email_type']; } if (isset($_REQUEST['assigned_to'])) { $assigned_to = $_REQUEST['assigned_to']; } if (isset($_REQUEST['status'])) { $status = $_REQUEST['status']; } if (isset($_REQUEST['name'])) { $name = $_REQUEST['name']; }
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('Calls'); $storeQuery->populateRequest(); } else { $storeQuery->saveFromGet('Calls'); } if (isset($_REQUEST['query'])) { // we have a query // first save columns $current_user->setPreference('ListViewDisplayColumns', $displayColumns, 0, 'Calls'); $searchForm->populateFromRequest(); // gathers search field inputs from $_REQUEST $where_clauses = $searchForm->generateSearchWhere(true, "Calls"); // 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}"); } // start display
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('Meetings'); $storeQuery->populateRequest(); } else { $storeQuery->saveFromGet('Meetings'); } if (isset($_REQUEST['query'])) { // we have a query // first save columns $current_user->setPreference('ListViewDisplayColumns', $displayColumns, 0, 'Meetings'); $searchForm->populateFromRequest(); // gathers search field inputs from $_REQUEST $where_clauses = $searchForm->generateSearchWhere(true, "Meetings"); // 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}"); } // start display
$params['sortOrder'] = $_REQUEST['sortOrder']; } } $params['orderBy'] = ''; $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('Calendar'); $storeQuery->populateRequest(); } else { $storeQuery->saveFromGet('Calendar'); } global $timedate; //jc: bug 14616 - dates need to specificy the end of the current date in order to get tasks // that are scheduled to start today $today = $timedate->to_db_date(date($timedate->get_date_format() . " H:m:s"), false) . " 23:59:59"; $today = $timedate->handle_offset($today, $timedate->dbDayFormat, true) . " 23:59:59"; //end bug 14616 $where = "(tasks.assigned_user_id='{$current_user->id}' and tasks.status<>'Completed' and tasks.status<>'Deferred'"; $where .= "and (tasks.date_start is NULL or tasks.date_start <= '{$today}'))"; $lv->export = false; $lv->delete = false; $lv->select = false; $lv->mailMerge = false; $lv->multiSelect = false; $lv->setup($seedTask, 'include/ListView/ListViewGeneric.tpl', $where, $params);
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('Tasks'); $storeQuery->populateRequest(); } else { $storeQuery->saveFromGet('Tasks'); } if (isset($_REQUEST['query'])) { // we have a query // first save columns $current_user->setPreference('ListViewDisplayColumns', $displayColumns, 0, 'Tasks'); $searchForm->populateFromRequest(); // gathers search field inputs from $_REQUEST $where_clauses = $searchForm->generateSearchWhere(true, "Tasks"); // 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}"); } // start display