Minor - format code.

1.9.x
Julio Montoya 11 years ago
parent ae24a5721a
commit 7f16171f09
  1. 6
      main/admin/session_edit.php
  2. 15
      main/admin/session_list.php
  3. 10
      main/inc/ajax/model.ajax.php
  4. 7
      main/inc/lib/sessionmanager.lib.php

@ -354,7 +354,11 @@ if (!empty($return)) {
<?php echo get_lang('SessionVisibility') ?> <br /> <?php echo get_lang('SessionVisibility') ?> <br />
<select name="session_visibility" style="width:250px;"> <select name="session_visibility" style="width:250px;">
<?php <?php
$visibility_list = array(SESSION_VISIBLE_READ_ONLY=>get_lang('SessionReadOnly'), SESSION_VISIBLE=>get_lang('SessionAccessible'), SESSION_INVISIBLE=>api_ucfirst(get_lang('SessionNotAccessible'))); $visibility_list = array(
SESSION_VISIBLE_READ_ONLY => get_lang('SessionReadOnly'),
SESSION_VISIBLE => get_lang('SessionAccessible'),
SESSION_INVISIBLE => api_ucfirst(get_lang('SessionNotAccessible'))
);
foreach($visibility_list as $key=>$item): ?> foreach($visibility_list as $key=>$item): ?>
<option value="<?php echo $key; ?>" <?php if($key == $infos['visibility']) echo 'selected="selected"'; ?>><?php echo $item; ?></option> <option value="<?php echo $key; ?>" <?php if($key == $infos['visibility']) echo 'selected="selected"'; ?>><?php echo $item; ?></option>
<?php endforeach; ?> <?php endforeach; ?>

@ -4,9 +4,6 @@
* List sessions in an efficient and usable way * List sessions in an efficient and usable way
* @package chamilo.admin * @package chamilo.admin
*/ */
/**
* Code
*/
$language_file = array('admin', 'courses'); $language_file = array('admin', 'courses');
$cidReset = true; $cidReset = true;
@ -36,7 +33,8 @@ $interbreadcrumb[]=array("url" => "index.php","name" => get_lang('PlatformAdmin'
$tool_name = get_lang('SessionList'); $tool_name = get_lang('SessionList');
Display::display_header($tool_name); Display::display_header($tool_name);
$error_message = ''; // Avoid conflict with the global variable $error_msg (array type) in add_course.conf.php. $error_message = '';
// Avoid conflict with the global variable $error_msg (array type) in add_course.conf.php.
if (isset($_GET['action']) && $_GET['action'] == 'show_message') { if (isset($_GET['action']) && $_GET['action'] == 'show_message') {
$error_message = Security::remove_XSS($_GET['message']); $error_message = Security::remove_XSS($_GET['message']);
} }
@ -111,7 +109,8 @@ $column_model = array(
array('name'=>'date_start', 'index'=>'s.date_start', 'width'=>'40', 'align'=>'left', 'search' => 'true'), array('name'=>'date_start', 'index'=>'s.date_start', 'width'=>'40', 'align'=>'left', 'search' => 'true'),
array('name'=>'date_end', 'index'=>'s.date_end', 'width'=>'40', 'align'=>'left', 'search' => 'true'), array('name'=>'date_end', 'index'=>'s.date_end', 'width'=>'40', 'align'=>'left', 'search' => 'true'),
array('name'=>'coach_name', 'index'=>'coach_name', 'width'=>'80', 'align'=>'left', 'search' => 'false'), array('name'=>'coach_name', 'index'=>'coach_name', 'width'=>'80', 'align'=>'left', 'search' => 'false'),
array('name'=>'status', 'index'=>'session_active','width'=>'50', 'align'=>'left', 'search' => 'true', 'stype'=>'select', array('name'=>'status', 'index'=>'session_active','width'=>'45',
'align'=>'left', 'search' => 'true', 'stype'=>'select',
//for the bottom bar //for the bottom bar
'searchoptions' => array( 'searchoptions' => array(
'defaultValue' => ':', 'defaultValue' => ':',
@ -122,9 +121,11 @@ $column_model = array(
'value' => ':'.get_lang('All').';1:'.get_lang('Active').';0:'.get_lang('Inactive') 'value' => ':'.get_lang('All').';1:'.get_lang('Active').';0:'.get_lang('Inactive')
) )
), ),
array('name'=>'visibility', 'index'=>'visibility', 'width'=>'40', 'align'=>'left', 'search' => 'false'), array('name'=>'visibility', 'index'=>'visibility', 'width'=>'45', 'align'=>'left', 'search' => 'false'),
array('name'=>'actions', 'index'=>'actions', 'width'=>'100', 'align'=>'left','formatter'=>'action_formatter','sortable'=>'false', 'search' => 'false') array('name'=>'actions', 'index'=>'actions', 'width'=>'90',
'align'=>'left','formatter'=>'action_formatter','sortable'=>'false', 'search' => 'false')
); );
//Autowidth //Autowidth
$extra_params['autowidth'] = 'true'; $extra_params['autowidth'] = 'true';

@ -725,7 +725,15 @@ switch ($action) {
break; break;
case 'get_sessions': case 'get_sessions':
$columns = array( $columns = array(
'name', 'nbr_courses', 'nbr_users', 'category_name', 'date_start','date_end', 'coach_name', 'session_active', 'visibility' 'name',
'nbr_courses',
'nbr_users',
'category_name',
'date_start',
'date_end',
'coach_name',
'session_active',
'visibility'
); );
// Rename Category_name // Rename Category_name

@ -363,7 +363,9 @@ class SessionManager
$extraJoin = null; $extraJoin = null;
if (api_is_session_admin() && api_get_setting('allow_session_admins_to_manage_all_sessions') == 'false') { if (api_is_session_admin() &&
api_get_setting('allow_session_admins_to_manage_all_sessions') == 'false'
) {
$where .= " AND ( $where .= " AND (
s.session_admin_id = $user_id OR s.session_admin_id = $user_id OR
sru.id_user = '$user_id' AND sru.id_user = '$user_id' AND
@ -386,7 +388,8 @@ class SessionManager
} }
$options['where'] = str_replace( $options['where'] = str_replace(
array("AND session_active = '1' )", " AND ( session_active = '1' )"), array(') GROUP BY s.name HAVING session_active = 1 ', " GROUP BY s.name HAVING session_active = 1 ") array("AND session_active = '1' )", " AND ( session_active = '1' )"),
array(') GROUP BY s.name HAVING session_active = 1 ', " GROUP BY s.name HAVING session_active = 1 ")
, $options['where'] , $options['where']
); );

Loading…
Cancel
Save