Minor - format code.

pull/2487/head
jmontoyaa 9 years ago
parent 4ed250c3bf
commit ac1f515aac
  1. 21
      main/user/add_users_to_session.php
  2. 29
      main/user/class.php

@ -1,5 +1,6 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
/** /**
* @package chamilo.admin * @package chamilo.admin
*/ */
@ -15,16 +16,24 @@ $xajax->registerFunction('search_users');
// setting the section (for the tabs) // setting the section (for the tabs)
$this_section = SECTION_PLATFORM_ADMIN; $this_section = SECTION_PLATFORM_ADMIN;
$id_session = intval($_GET['id_session']); $id_session = intval($_GET['id_session']);
SessionManager::protect_teacher_session_edit($id_session); SessionManager::protect_teacher_session_edit($id_session);
// setting breadcrumbs // setting breadcrumbs
if (api_is_platform_admin()) { if (api_is_platform_admin()) {
$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin')); $interbreadcrumb[] = array(
$interbreadcrumb[] = array('url' => 'session_list.php', 'name' => get_lang('SessionList')); 'url' => 'index.php',
$interbreadcrumb[] = array('url' => "resume_session.php?id_session=".$id_session, "name" => get_lang('SessionOverview')); 'name' => get_lang('PlatformAdmin')
);
$interbreadcrumb[] = array(
'url' => 'session_list.php',
'name' => get_lang('SessionList')
);
$interbreadcrumb[] = array(
'url' => "resume_session.php?id_session=".$id_session,
"name" => get_lang('SessionOverview')
);
} }
$allowTutors = api_get_setting('allow_tutors_to_assign_students_to_session'); $allowTutors = api_get_setting('allow_tutors_to_assign_students_to_session');
$extra_field_list = []; $extra_field_list = [];
@ -64,15 +73,12 @@ if ($allowTutors == 'true') {
function search_users($needle, $type) function search_users($needle, $type)
{ {
global $id_session; global $id_session;
$tbl_user = Database::get_main_table(TABLE_MAIN_USER); $tbl_user = Database::get_main_table(TABLE_MAIN_USER);
$tbl_session_rel_user = Database::get_main_table(TABLE_MAIN_SESSION_USER); $tbl_session_rel_user = Database::get_main_table(TABLE_MAIN_SESSION_USER);
$xajax_response = new xajaxResponse(); $xajax_response = new xajaxResponse();
$return = ''; $return = '';
if (!empty($needle) && !empty($type)) { if (!empty($needle) && !empty($type)) {
//normal behaviour //normal behaviour
if ($type == 'any_session' && $needle == 'false') { if ($type == 'any_session' && $needle == 'false') {
$type = 'multiple'; $type = 'multiple';
@ -217,7 +223,6 @@ if ($allowTutors == 'true') {
function add_user_to_session (code, content) { function add_user_to_session (code, content) {
document.getElementById("user_to_add").value = ""; document.getElementById("user_to_add").value = "";
document.getElementById("ajax_list_users_single").innerHTML = ""; document.getElementById("ajax_list_users_single").innerHTML = "";
destination = document.getElementById("destination_users"); destination = document.getElementById("destination_users");
for (i=0;i<destination.length;i++) { for (i=0;i<destination.length;i++) {

@ -1,5 +1,6 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
/** /**
* @package chamilo.user * @package chamilo.user
*/ */
@ -48,13 +49,25 @@ if (api_is_allowed_to_edit()) {
$actionsLeft .= '<a href="class.php?'.api_get_cidreq().'&type=registered">'. $actionsLeft .= '<a href="class.php?'.api_get_cidreq().'&type=registered">'.
Display::return_icon('back.png', get_lang("Classes"), array(), ICON_SIZE_MEDIUM).'</a>'; Display::return_icon('back.png', get_lang("Classes"), array(), ICON_SIZE_MEDIUM).'</a>';
$form = new FormValidator('groups', 'post', api_get_self(), '', '', FormValidator::LAYOUT_INLINE); $form = new FormValidator(
'groups',
'post',
api_get_self(),
'',
[],
FormValidator::LAYOUT_INLINE
);
$options = [ $options = [
-1 => get_lang('All'), -1 => get_lang('All'),
1 => get_lang('SocialGroups'), 1 => get_lang('SocialGroups'),
0 => get_lang('Classes') 0 => get_lang('Classes')
]; ];
$form->addSelect('group_filter', get_lang('Groups'), $options, ['id' => 'group_filter']); $form->addSelect(
'group_filter',
get_lang('Groups'),
$options,
['id' => 'group_filter']
);
$form->setDefaults(['group_filter' => $groupFilter]); $form->setDefaults(['group_filter' => $groupFilter]);
$actionsRight = $form->returnForm(); $actionsRight = $form->returnForm();
} }
@ -89,7 +102,6 @@ if (api_is_allowed_to_edit()) {
} }
//jqgrid will use this URL to do the selects //jqgrid will use this URL to do the selects
$url = api_get_path(WEB_AJAX_PATH).'model.ajax.php?a=get_usergroups_teacher&type='.$type.'&group_filter='.$groupFilter; $url = api_get_path(WEB_AJAX_PATH).'model.ajax.php?a=get_usergroups_teacher&type='.$type.'&group_filter='.$groupFilter;
//The order is important you need to check the the $column variable in the model.ajax.php file //The order is important you need to check the the $column variable in the model.ajax.php file
@ -146,7 +158,16 @@ Display :: display_header($tool_name, "User");
$(function() { $(function() {
<?php <?php
// grid definition see the $usergroup>display() function // grid definition see the $usergroup>display() function
echo Display::grid_js('usergroups', $url, $columns, $columnModel, $extraParams, array(), '', true); echo Display::grid_js(
'usergroups',
$url,
$columns,
$columnModel,
$extraParams,
array(),
'',
true
);
?> ?>
}); });
</script> </script>

Loading…
Cancel
Save