Show number of users in session - ref #4522

skala
Hubert Borderiou 13 years ago
parent 90ac4ce56b
commit b6172ebe78
  1. 4
      main/admin/session_list.php
  2. 2
      main/inc/ajax/model.ajax.php
  3. 4
      main/inc/lib/sessionmanager.lib.php

@ -37,9 +37,8 @@ if (isset($_REQUEST['keyword'])) {
$url = api_get_path(WEB_AJAX_PATH).'model.ajax.php?a=get_sessions&_search=true&rows=20&page=1&sidx=&sord=asc&filters=&searchField=name&searchString='.Security::remove_XSS($_REQUEST['keyword']).'&searchOper=bw';
}
//The order is important you need to check the the $column variable in the model.ajax.php file
$columns = array(get_lang('Name'), get_lang('NumberOfCourses'), get_lang('SessionCategoryName'),
$columns = array(get_lang('Name'), get_lang('NumberOfCourses'), get_lang('NumberOfUsers'), get_lang('SessionCategoryName'),
get_lang('StartDate'), get_lang('EndDate'), get_lang('Coach'), get_lang('Status'), get_lang('Visibility'), get_lang('Actions'));
//$activeurl = '?sidx=session_active';
@ -47,6 +46,7 @@ $columns = array(get_lang('Name'), get_lang('NumberOfCourses'), get_lang(
$column_model = array(
array('name'=>'name', 'index'=>'name', 'width'=>'120', 'align'=>'left', 'search' => 'true'),
array('name'=>'nbr_courses', 'index'=>'nbr_courses', 'width'=>'30', 'align'=>'left', 'search' => 'true'),
array('name'=>'nbr_users', 'index'=>'nbr_users', 'width'=>'30', 'align'=>'left', 'search' => 'true'),
array('name'=>'category_name', 'index'=>'category_name', 'width'=>'70', 'align'=>'left', 'search' => 'true'),
array('name'=>'date_start', 'index'=>'date_start', 'width'=>'40', 'align'=>'left', 'search' => 'true'),
array('name'=>'date_end', 'index'=>'date_end', 'width'=>'40', 'align'=>'left', 'search' => 'true'),

@ -195,7 +195,7 @@ switch ($action) {
break;
case 'get_sessions':
$columns = array('name', 'nbr_courses','category_name', 'date_start','date_end', 'coach_name', 'session_active', 'visibility');
$columns = array('name', 'nbr_courses', 'nbr_users', 'category_name', 'date_start','date_end', 'coach_name', 'session_active', 'visibility');
$result = SessionManager::get_sessions_admin(array('where'=> $where_condition, 'order'=>"$sidx $sord", 'limit'=> "$start , $limit"));
break;
case 'get_timelines':

@ -231,7 +231,7 @@ class SessionManager {
('$today' < s.date_end AND '0000-00-00' = s.date_start)
, 1, 0)
as session_active,
s.name, nbr_courses, s.date_start, s.date_end, $coach_name, sc.name as category_name, s.visibility, u.user_id, s.id";
s.name, nbr_courses, nbr_users, s.date_start, s.date_end, $coach_name, sc.name as category_name, s.visibility, u.user_id, s.id";
$query = "$select FROM $tbl_session s
LEFT JOIN $tbl_session_category sc ON s.session_category_id = sc.id
@ -260,7 +260,6 @@ class SessionManager {
$query .= " ORDER BY ".$options['order']." LIMIT ".$options['limit'];
// echo $query;
$result = Database::query($query);
$formatted_sessions = array();
if (Database::num_rows($result)) {
@ -302,6 +301,7 @@ class SessionManager {
$formatted_sessions[] = $session;
}
}
return $formatted_sessions;
}

Loading…
Cancel
Save