Minor - fix session search see BT#15834

pull/3063/head
Julio 6 years ago
parent c8a94ab57a
commit 25d7d85562
  1. 2
      load_search.php
  2. 5
      main/inc/ajax/model.ajax.php
  3. 10
      main/inc/lib/sessionmanager.lib.php

@ -923,7 +923,7 @@ if (!empty($filterToSend)) {
}
$filterToSend = json_encode($filterToSend);
$url = api_get_path(WEB_AJAX_PATH).'model.ajax.php?a=get_sessions&_search=true&load_extra_field='.$extraFieldListToString.'&_force_search=true&rows=20&page=1&sidx=&sord=asc&filters2='.$filterToSend;
$url .= '&lang='.$lang;
//$url .= '&lang='.$lang;
} else {
$url = api_get_path(WEB_AJAX_PATH).'model.ajax.php?a=get_sessions&_search=true&load_extra_field='.$extraFieldListToString.'&_force_search=true&rows=20&page=1&sidx=&sord=asc';
}

@ -139,8 +139,7 @@ $overwriteColumnHeaderExport = [];
if (!empty($searchString)) {
$search = 'true';
}
if (($search || $forceSearch) && ($search !== 'false')) {
if (($search === 'true' || $forceSearch === 'true')) {
$whereCondition = ' 1 = 1 ';
$whereConditionInForm = getWhereClause(
$searchField,
@ -678,6 +677,7 @@ switch ($action) {
case 'get_sessions':
$list_type = isset($_REQUEST['list_type']) ? $_REQUEST['list_type'] : 'simple';
$language = isset($_REQUEST['lang']) ? $_REQUEST['lang'] : '';
$session_columns = SessionManager::getGridColumns($list_type);
$columns = $session_columns['simple_column_name'];
@ -691,7 +691,6 @@ switch ($action) {
$extraFieldsToLoad[] = $fieldData;
}
}
if ($list_type === 'simple') {
$count = SessionManager::get_sessions_admin(
['where' => $whereCondition, 'extra' => $extra_fields],

@ -459,10 +459,11 @@ class SessionManager
/**
* Gets the admin session list callback of the session/session_list.php page.
*
* @param array $options order and limit keys
* @param bool $get_count Whether to get all the results or only the count
* @param array $columns
* @param array $extraFieldsToLoad
* @param array $options order and limit keys
* @param bool $get_count Whether to get all the results or only the count
* @param array $columns
* @param array $extraFieldsToLoad
* @param string $language
*
* @return mixed Integer for number of rows, or array of results
* @assert ([],true) !== false
@ -604,7 +605,6 @@ class SessionManager
$orderedCategories[$category['id']] = $category['name'];
}
}
$result = Database::query($query);
$formatted_sessions = [];
if (Database::num_rows($result)) {

Loading…
Cancel
Save