Format code, fixing PHP warnings, removing old comments.

1.9.x
Julio Montoya 11 years ago
parent 5ec80ca496
commit 0a62f50e93
  1. 6
      main/admin/access_url_add_users_to_url.php
  2. 20
      main/admin/access_url_check_user_session.php
  3. 9
      main/admin/access_url_edit.php
  4. 2
      main/admin/access_url_edit_course_category_to_url.php
  5. 20
      main/admin/access_url_edit_courses_to_url.php
  6. 4
      main/admin/access_url_edit_users_to_url.php
  7. 9
      main/admin/access_urls.php
  8. 2
      main/admin/add_courses_to_session.php
  9. 3
      main/admin/add_courses_to_usergroup.php
  10. 1
      main/admin/add_many_session_to_category.php
  11. 3
      main/admin/add_sessions_to_promotion.php
  12. 35
      main/admin/add_sessions_to_usergroup.php
  13. 4
      main/admin/add_users_to_group.php
  14. 2
      main/admin/archive_cleanup.php
  15. 7
      main/admin/configure_extensions.php
  16. 6
      main/admin/course_import.php
  17. 1
      main/admin/course_request_accepted.php
  18. 6
      main/admin/course_request_rejected.php
  19. 1
      main/admin/dashboard_add_users_to_user.php
  20. 34
      main/admin/group_add.php
  21. 3
      main/admin/statistics/index.php
  22. 14
      main/gradebook/lib/be/category.class.php
  23. 1
      main/gradebook/lib/fe/linkform.class.php
  24. 2
      main/group/group.php
  25. 6
      main/group/group_creation.php

@ -12,13 +12,13 @@
$language_file = 'admin';
$cidReset = true;
require_once '../inc/global.inc.php';
$this_section=SECTION_PLATFORM_ADMIN;
$this_section = SECTION_PLATFORM_ADMIN;
require_once api_get_path(LIBRARY_PATH).'urlmanager.lib.php';
api_protect_global_admin_script();
if (!api_get_multiple_access_url()) {
header('Location: index.php');
exit;
header('Location: index.php');
exit;
}
$form_sent = 0;

@ -34,14 +34,14 @@ $url_id = api_get_current_access_url_id();
$action = $_GET['action'];
switch($action) {
case 'add_user_to_url':
case 'add_user_to_url':
$user_id = $_REQUEST['user_id'];
$result = UrlManager::add_user_to_url($user_id, $url_id);
$user_info = api_get_user_info($user_id);
if ($result) {
$message = Display::return_message(get_lang('UserAdded').' '.api_get_person_name($user_info['firstname'], $user_info['lastname']), 'confirm');
}
break;
break;
}
Display::display_header($tool_name);
@ -69,7 +69,7 @@ if ($show_users_with_problems) {
foreach($session_list as $session_item) {
$session_id = $session_item['id'];
$html .= '<h3>'.$session_item['name'].'</h3>';
$access_where = "(access_url_id = $url_id OR access_url_id is null )";
if ($show_users_with_problems) {
$access_where = "(access_url_id is null)";
@ -85,24 +85,24 @@ foreach($session_list as $session_item) {
$result = Database::query($sql);
$users = Database::store_result($result);
if (!empty($users)) {
$html .= '<table class="data_table"><tr><th>'.get_lang('User').'<th>'.get_lang('Actions').'</th></tr>';
$html .= '<table class="data_table"><tr><th>'.get_lang('User').'<th>'.get_lang('Actions').'</th></tr>';
foreach ($users as $user) {
$user_link = '';
if (!empty($user['user_id'])) {
$user_link = '<a href="'.api_get_path(WEB_CODE_PATH).'admin/user_information.php?user_id='.intval($user['user_id']).'">'.api_htmlentities(api_get_person_name($user['firstname'], $user['lastname']),ENT_QUOTES,$charset).' ('.$user['username'].')</a>';
$user_link = '<a href="'.api_get_path(WEB_CODE_PATH).'admin/user_information.php?user_id='.intval($user['user_id']).'">'.Security::remove_XSS(api_get_person_name($user['firstname'], $user['lastname'])).' ('.$user['username'].')</a>';
}
$link_to_add_user_in_url = '';
if ($multiple_url_is_on) {
if ($user['access_url_id'] != $url_id) {
if ($user['access_url_id'] != $url_id) {
$user_link .= ' '.Display::return_icon('warning.png', get_lang('UserNotAddedInURL'), array(), ICON_SIZE_MEDIUM);
$add = Display::return_icon('add.png', get_lang('AddUsersToURL'), array(), ICON_SIZE_MEDIUM);
$add = Display::return_icon('add.png', get_lang('AddUsersToURL'), array(), ICON_SIZE_MEDIUM);
$link_to_add_user_in_url = '<a href="'.api_get_self().'?'.Security::remove_XSS($_SERVER['QUERY_STRING']).'&action=add_user_to_url&id_session='.$id_session.'&user_id='.$user['user_id'].'">'.$add.'</a>';
}
}
}
$html .= '<tr>
<td>

@ -111,8 +111,8 @@ $form->addRule('url', '', 'maxlength',254);
$form->addElement('textarea','description',get_lang('Description'));
//the first url with id = 1 will be always active
if ($_GET['url_id'] != 1) {
$form->addElement('checkbox','active', null, get_lang('Active'));
if (isset($_GET['url_id']) && $_GET['url_id'] != 1) {
$form->addElement('checkbox','active', null, get_lang('Active'));
}
$defaults['url']='http://';
@ -132,14 +132,15 @@ if (isset($_GET['url_id'])) {
$submit_name = get_lang('AddUrl');
}
if (!$_configuration['multiple_access_urls']) {
header('Location: index.php');
if (!api_is_multiple_url_enabled()) {
header('Location: index.php');
exit;
}
$tool_name = get_lang('AddUrl');
$interbreadcrumb[] = array ("url" => 'index.php', "name" => get_lang('PlatformAdmin'));
$interbreadcrumb[] = array ("url" => 'access_urls.php', "name" => get_lang('MultipleAccessURLs'));
Display :: display_header($tool_name);
if (isset ($_GET['action'])) {

@ -184,7 +184,7 @@ if (!empty($errorMsg)) {
<table border="0" cellpadding="5" cellspacing="0" width="100%">
<!-- Users -->
<tr>
<td align="center"><b><?php echo get_lang('CourseCategoryInPlatform') ?></b>
<td align="center"><b><?php echo get_lang('CourseCategoryInPlatform') ?> :</b>
</td>
<td></td>
<td align="center"><b><?php printf(get_lang('CourseCategoryListInX'),$url_selected); ?></b></td>

@ -46,14 +46,13 @@ if(isset($_REQUEST['add_type']) && $_REQUEST['add_type']!='') {
}
$access_url_id=1;
if(isset($_REQUEST['access_url_id']) && $_REQUEST['access_url_id']!=''){
if (isset($_REQUEST['access_url_id']) && $_REQUEST['access_url_id']!='') {
$access_url_id = Security::remove_XSS($_REQUEST['access_url_id']);
}
$xajax -> processRequests();
$htmlHeadXtra[] = $xajax->getJavascript('../inc/lib/xajax/');
$htmlHeadXtra[] = '
<script type="text/javascript">
$htmlHeadXtra[] = '<script>
function add_user_to_url(code, content) {
document.getElementById("course_to_add").value = "";
@ -67,7 +66,7 @@ function add_user_to_url(code, content) {
}
function send() {
if (document.formulaire.access_url_id.value!=0) {
if (document.formulaire.access_url_id.value != 0) {
document.formulaire.form_sent.value=0;
document.formulaire.add_type.value=\''.$add_type.'\';
document.formulaire.submit();
@ -93,16 +92,16 @@ if (isset($_POST['form_sent']) && $_POST['form_sent']) {
$form_sent=$_POST['form_sent'];
$course_list=$_POST['course_list'];
if(!is_array($course_list)) {
if (!is_array($course_list)) {
$course_list=array();
}
if($form_sent == 1) {
if ($form_sent == 1) {
if ($access_url_id==0) {
header('Location: access_url_edit_users_to_url.php?action=show_message&message='.get_lang('SelectURL'));
}
elseif(is_array($course_list) ) {
UrlManager::update_urls_rel_course($course_list,$access_url_id);
UrlManager::update_urls_rel_course($course_list, $access_url_id);
header('Location: access_urls.php?action=show_message&message='.get_lang('CoursesWereEdited'));
}
}
@ -196,6 +195,7 @@ $url_list = UrlManager::get_url_data();
if(!empty($errorMsg)) {
Display::display_normal_message($errorMsg); //main API
}
?>
<table border="0" cellpadding="5" cellspacing="0" width="100%">
@ -318,11 +318,6 @@ function valide(){
var options = document.getElementById('destination_users').options;
for (i = 0 ; i<options.length ; i++)
options[i].selected = true;
/*
var options = document.getElementById('destination_classes').options;
for (i = 0 ; i<options.length ; i++)
options[i].selected = true;
*/
document.forms.formulaire.submit();
}
@ -362,7 +357,6 @@ function makepost(select){
return ret;
}
-->
</script>
<?php
Display::display_footer();

@ -24,6 +24,7 @@ $this_section = SECTION_PLATFORM_ADMIN;
// Access restrictions
api_protect_global_admin_script();
if (!api_get_multiple_access_url()) {
header('Location: index.php');
exit;
@ -52,8 +53,7 @@ if (isset($_REQUEST['access_url_id']) && $_REQUEST['access_url_id'] != '') {
$xajax->processRequests();
$htmlHeadXtra[] = $xajax->getJavascript('../inc/lib/xajax/');
$htmlHeadXtra[] = '
<script type="text/javascript">
$htmlHeadXtra[] = '<script>
function add_user_to_url(code, content) {
document.getElementById("user_to_add").value = "";
document.getElementById("ajax_list_users").innerHTML = "";

@ -1,10 +1,11 @@
<?php
/* For licensing terms, see /license.txt */
/**
* @package chamilo.admin
* @author Julio Montoya <gugli100@gmail.com>
*/
* Frontend script for multiple access urls
* @package chamilo.admin
* @author Julio Montoya <gugli100@gmail.com>
* @author Yannick Warnier <yannick.warnier@beeznest.com>
*/
// name of the language file that needs to be included
$language_file = 'admin';
$cidReset = true;

@ -56,7 +56,7 @@ function add_course_to_session(code, content) {
document.getElementById("ajax_list_courses_single").innerHTML = "";
destination = document.getElementById("destination");
for (i=0;i<destination.length;i++) {
if(destination.options[i].text == content) {
if (destination.options[i].text == content) {
return false;
}
}

@ -39,8 +39,7 @@ if (isset($_REQUEST['add_type']) && $_REQUEST['add_type']!=''){
$add = isset($_GET['add']) ? Security::remove_XSS($_GET['add']) : null;
$htmlHeadXtra[] = $xajax->getJavascript('../inc/lib/xajax/');
$htmlHeadXtra[] = '
<script>
$htmlHeadXtra[] = '<script>
function add_user_to_session (code, content) {
document.getElementById("user_to_add").value = "";
document.getElementById("ajax_list_users_single").innerHTML = "";

@ -71,7 +71,6 @@ function add_course_to_session (code, content) {
}
function send() {
if (document.formulaire.CategorySessionId.value!=0) {
//alert(document.formulaire.CategorySessionId.value);
document.formulaire.formSent.value=0;
document.formulaire.submit();
}

@ -38,8 +38,7 @@ if (isset($_REQUEST['add_type']) && $_REQUEST['add_type']!=''){
}
$htmlHeadXtra[] = $xajax->getJavascript('../inc/lib/xajax/');
$htmlHeadXtra[] = '
<script>
$htmlHeadXtra[] = '<script>
function add_user_to_session (code, content) {
document.getElementById("user_to_add").value = "";

@ -41,8 +41,7 @@ if(isset($_REQUEST['add_type']) && $_REQUEST['add_type']!=''){
}
$htmlHeadXtra[] = $xajax->getJavascript('../inc/lib/xajax/');
$htmlHeadXtra[] = '
<script type="text/javascript">
$htmlHeadXtra[] = '<script>
function add_user_to_session (code, content) {
document.getElementById("user_to_add").value = "";
@ -80,9 +79,9 @@ function display_advanced_search () {
}
function validate_filter() {
document.formulaire.add_type.value = \''.$add_type.'\';
document.formulaire.form_sent.value=0;
document.formulaire.submit();
document.formulaire.add_type.value = \''.$add_type.'\';
document.formulaire.form_sent.value=0;
document.formulaire.submit();
}
</script>';
@ -92,9 +91,9 @@ $errorMsg = '';
$sessions=array();
$usergroup = new UserGroup();
$id = intval($_GET['id']);
if($_POST['form_sent']) {
$form_sent = $_POST['form_sent'];
$elements_posted = $_POST['elements_in_name'];
if (isset($_POST['form_sent']) && $_POST['form_sent']) {
$form_sent = $_POST['form_sent'];
$elements_posted = $_POST['elements_in_name'];
if (!is_array($elements_posted)) {
$elements_posted = array();
}
@ -102,7 +101,7 @@ if($_POST['form_sent']) {
//added a parameter to send emails when registering a user
$usergroup->subscribe_sessions_to_usergroup($id, $elements_posted);
header('Location: usergroups.php');
exit;
exit;
}
}
$data = $usergroup->get($id);
@ -113,9 +112,9 @@ $session_list = SessionManager::get_sessions_list(array(), array('name'));
$elements_not_in = $elements_in= array();
if (!empty($session_list)) {
foreach($session_list as $session) {
if (in_array($session['id'], $session_list_in)) {
$elements_in[$session['id']] = $session['name'];
foreach($session_list as $session) {
if (in_array($session['id'], $session_list_in)) {
$elements_in[$session['id']] = $session['name'];
} else {
$elements_not_in[$session['id']] = $session['name'];
}
@ -130,7 +129,7 @@ function search_sessions($needle,$type) {
global $tbl_user,$elements_in;
$xajax_response = new XajaxResponse();
$return = '';
if (isset($needle) && !empty($type)) {
if (!empty($needle) && !empty($type)) {
// xajax send utf8 datas... datas in db can be non-utf8 datas
$charset = api_get_system_encoding();
@ -147,8 +146,7 @@ function search_sessions($needle,$type) {
' LIMIT 11';*/
} else if ($type == 'searchbox') {
$session_list = SessionManager::get_sessions_list(array('s.name LIKE' => "%$needle%"));
}
else {
} else {
$session_list = SessionManager::get_sessions_list(array('s.name LIKE' => "$needle%"));
}
$i=0;
@ -270,10 +268,10 @@ if(!empty($errorMsg)) {
<input type="text" id="user_to_add" onkeyup="xajax_search_users(this.value,'single')" />
<div id="ajax_list_users_single"></div>
<?php
} else {
} else {
?>
<div id="ajax_list_multiple">
<?php echo Display::select('elements_not_in_name',$elements_not_in, '',array('style'=>'width:360px', 'multiple'=>'multiple','id'=>'elements_not_in','size'=>'15px'),false); ?>
<?php echo Display::select('elements_not_in_name',$elements_not_in, '',array('style'=>'width:360px', 'multiple'=>'multiple','id'=>'elements_not_in','size'=>'15px'),false); ?>
</div>
<?php
}
@ -360,7 +358,6 @@ function valide(){
document.forms.formulaire.submit();
}
function loadUsersInSelect(select){
var xhr_object = null;
@ -372,7 +369,6 @@ function loadUsersInSelect(select){
else // XMLHttpRequest non supporté par le navigateur
alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest...");
//xhr_object.open("GET", "loadUsersInSelect.ajax.php?id_session=<?php echo $id_session ?>&letter="+select.options[select.selectedIndex].text, false);
xhr_object.open("POST", "loadUsersInSelect.ajax.php");
xhr_object.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
@ -400,7 +396,6 @@ function makepost(select){
return ret;
}
-->
</script>
<?php
Display::display_footer();

@ -182,10 +182,6 @@ $htmlHeadXtra[] = $xajax->getJavascript('../inc/lib/xajax/');
$htmlHeadXtra[] = '
<script>
function add_user (code, content) {
// document.getElementById("user_to_add").value = "";
//document.getElementById("ajax_list_users_single").innerHTML = "";
destination = document.getElementById("destination_users");
for (i=0;i<destination.length;i++) {
if (destination.options[i].text == content) {

@ -19,7 +19,7 @@ $this_section = SECTION_PLATFORM_ADMIN;
api_protect_admin_script(true);
// setting breadcrumbs
$interbreadcrumb[]=array('url' => 'index.php','name' => get_lang('PlatformAdmin'));
$interbreadcrumb[] = array('url' => 'index.php','name' => get_lang('PlatformAdmin'));
$form = new FormValidator('archive_cleanup_form');
$form->addElement('style_submit_button','proceed', get_lang('ArchiveDirCleanupProceedButton'),'class="save"');

@ -26,7 +26,7 @@ if (isset($_POST['activeExtension'])) {
WHERE variable="service_visio"
AND subkey="active"';
$rs = Database::query($sql);
if(Database::affected_rows()>0) {
if (Database::affected_rows($rs)>0) {
// select all the courses and insert the tool inside
$sql = 'SELECT id FROM '.Database::get_main_table(TABLE_MAIN_COURSE);
$rs = Database::query($sql);
@ -105,7 +105,7 @@ if (isset($_POST['activeExtension'])) {
$rs = Database::query($sql);
if(Database::affected_rows()>0){
if (Database::affected_rows($rs)>0){
$message = get_lang('ServiceActivated');
}
@ -441,8 +441,7 @@ Display::display_header($nameTool);
</div>
*/
/*
<!-- SEARCH -->
<div id="main_search">
<div id="extension_header_search" class="accordion_header">

@ -155,7 +155,7 @@ require_once api_get_path(LIBRARY_PATH).'fileManage.lib.php';
require_once api_get_path(LIBRARY_PATH).'import.lib.php';
$defined_auth_sources[] = PLATFORM_AUTH_SOURCE;
if (is_array($extAuthSource)) {
if (isset($extAuthSource) && is_array($extAuthSource)) {
$defined_auth_sources = array_merge($defined_auth_sources, array_keys($extAuthSource));
}
@ -166,7 +166,7 @@ $interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdm
set_time_limit(0);
Display :: display_header($tool_name);
if ($_POST['formSent']) {
if (isset($_POST['formSent']) && $_POST['formSent']) {
if (empty($_FILES['import_file']['tmp_name'])) {
$error_message = get_lang('UplUploadFailed');
Display :: display_error_message($error_message, false);
@ -187,7 +187,7 @@ if ($_POST['formSent']) {
}
}
if (count($errors) != 0) {
if (isset($errors) && count($errors) != 0) {
$error_message = '<ul>';
foreach ($errors as $index => $error_course) {
$error_message .= '<li>'.get_lang('Line').' '.$error_course['line'].': <strong>'.$error_course['error'].'</strong>: ';

@ -100,6 +100,7 @@ function get_number_of_requests() {
function get_request_data($from, $number_of_items, $column, $direction) {
$keyword = Database::escape_string(trim($_GET['keyword']));
$course_request_table = Database :: get_main_table(TABLE_MAIN_COURSE_REQUEST);
$sql = "SELECT id AS col0,
code AS col1,
title AS col2,

@ -48,9 +48,9 @@ $keyword = Database::escape_string(trim($_GET['keyword']));
if ($course_validation_feature) {
/**
* Acceptance and creation of the requested course.
*/
/**
* Acceptance and creation of the requested course.
*/
if (!empty($accept_course_request)) {
$course_request_code = CourseRequestManager::get_course_request_code($accept_course_request);
$course_id = CourseRequestManager::accept_course_request($accept_course_request);

@ -11,7 +11,6 @@ $language_file = 'admin';
// resetting the course id
$cidReset = true;
// including some necessary dokeos files
require_once '../inc/global.inc.php';
require_once '../inc/lib/xajax/xajax.inc.php';

@ -5,7 +5,7 @@
*/
// Language files that should be included
$language_file = array('admin', 'registration','userInfo');
$language_file = array('admin', 'registration', 'userInfo');
$cidReset = true;
@ -36,10 +36,10 @@ function text_longitud(){
// Database table definitions
if (!empty($_GET['message'])) {
$message = urldecode($_GET['message']);
$message = urldecode($_GET['message']);
}
$interbreadcrumb[] = array ('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
$tool_name = get_lang('AddGroups');
// Create the form
@ -47,25 +47,35 @@ $form = new FormValidator('group_add');
$form->addElement('header', $tool_name);
// name
$form->addElement('text', 'name', get_lang('Name'), array('size'=>60, 'maxlength'=>120));
$form->addElement('text', 'name', get_lang('Name'), array('size' => 60, 'maxlength' => 120));
$form->applyFilter('name', 'html_filter');
$form->applyFilter('name', 'trim');
$form->addRule('name', get_lang('ThisFieldIsRequired'), 'required');
// Description
$form->addElement('textarea', 'description', get_lang('Description'), array('rows'=>3, 'cols'=>58, 'onKeyDown' => "text_longitud()", 'onKeyUp' => "text_longitud()"));
$form->addElement(
'textarea',
'description',
get_lang('Description'),
array('rows' => 3, 'cols' => 58, 'onKeyDown' => "text_longitud()", 'onKeyUp' => "text_longitud()")
);
$form->applyFilter('description', 'html_filter');
$form->applyFilter('description', 'trim');
// url
$form->addElement('text', 'url', get_lang('URL'), array('size'=>35));
$form->addElement('text', 'url', get_lang('URL'), array('size' => 35));
$form->applyFilter('url', 'html_filter');
$form->applyFilter('url', 'trim');
// Picture
$form->addElement('file', 'picture', get_lang('AddPicture'));
$allowed_picture_types = array ('jpg', 'jpeg', 'png', 'gif');
$form->addRule('picture', get_lang('OnlyImagesAllowed').' ('.implode(',', $allowed_picture_types).')', 'filetype', $allowed_picture_types);
$allowed_picture_types = array('jpg', 'jpeg', 'png', 'gif');
$form->addRule(
'picture',
get_lang('OnlyImagesAllowed').' ('.implode(',', $allowed_picture_types).')',
'filetype',
$allowed_picture_types
);
//Group Parentship
$groups = array();
@ -77,8 +87,8 @@ $form->addElement('select', 'parent_group', get_lang('GroupParentship'), $groups
// Status
$status = array();
$status[GROUP_PERMISSION_OPEN] = get_lang('Open');
$status[GROUP_PERMISSION_CLOSED] = get_lang('Closed');
$status[GROUP_PERMISSION_OPEN] = get_lang('Open');
$status[GROUP_PERMISSION_CLOSED] = get_lang('Closed');
$form->addElement('select', 'visibility', get_lang('GroupPermissions'), $status);
@ -153,8 +163,8 @@ if( $form->validate()) {
// Display form
Display::display_header($tool_name);
//api_display_tool_title($tool_name);
if(!empty($message)){
Display::display_normal_message(stripslashes($message));
if (!empty($message)) {
Display::display_normal_message(stripslashes($message));
}
$form->display();

@ -81,7 +81,6 @@ switch ($_REQUEST['report']) {
case 'courselastvisit':
Statistics::print_course_last_visit();
break;
//---
case 'users':
// total amount of users
Statistics::print_stats(
@ -135,4 +134,4 @@ switch ($_REQUEST['report']) {
break;
}
Display::display_footer();
Display::display_footer();

@ -54,7 +54,7 @@ class Category implements GradebookItem
public function get_certificate_min_score()
{
if(!empty($this->certificate_min_score)) {
if (!empty($this->certificate_min_score)) {
return $this->certificate_min_score;
} else {
return null;
@ -116,7 +116,7 @@ class Category implements GradebookItem
$this->certificate_min_score = $min_score;
}
public function set_parent_id ($parent)
public function set_parent_id($parent)
{
$this->parent = intval($parent);
}
@ -245,7 +245,7 @@ class Category implements GradebookItem
) {
//if the category given is explicitly 0 (not null), then create
// a root category object (in memory)
if (isset($id) && (int)$id === 0 ) {
if (isset($id) && (int)$id === 0) {
$cats = array();
$cats[] = Category::create_root_category();
@ -269,7 +269,7 @@ class Category implements GradebookItem
$sql .= ' WHERE';
}
$sql .= ' user_id = '.intval($user_id);
$paramcount ++;
$paramcount++;
}
if (isset($course_code)) {
@ -296,7 +296,7 @@ class Category implements GradebookItem
if (empty($session_id)) {
$sql .= ' AND (session_id IS NULL OR session_id = 0) ';
} else {
$sql .= ' AND session_id = '.(int) $session_id.' ';
$sql .= ' AND session_id = '.(int)$session_id.' ';
}
//}
$paramcount ++;
@ -310,7 +310,7 @@ class Category implements GradebookItem
$sql .= ' WHERE ';
}
$sql .= ' parent_id = '.intval($parent_id);
$paramcount ++;
$paramcount++;
}
if (isset($visible)) {
@ -380,7 +380,7 @@ class Category implements GradebookItem
*/
public function add()
{
if (isset($this->name) && '-1'==$this->name) {
if (isset($this->name) && '-1' == $this->name) {
return false;
}

@ -76,6 +76,7 @@ class LinkForm extends FormValidator
$select = $this->addElement('select', 'select_link', get_lang('ChooseLink'), null, array('onchange' => 'document.create_link.submit()'));
$linkTypes = LinkFactory::get_all_types();
$select->addoption('['.get_lang('ChooseLink').']', 0);
$courseCode = $this->category_object->get_course_code();

@ -192,7 +192,6 @@ $group_cats = GroupManager::get_categories(api_get_course_id());
echo '</div>';
/* List all categories */
if (api_get_setting('allow_group_categories') == 'true') {
foreach ($group_cats as $index => $category) {
$group_list = GroupManager :: get_group_list($category['id']);
@ -233,7 +232,6 @@ if (api_get_setting('allow_group_categories') == 'true') {
} else {
$group_list = GroupManager::get_group_list();
GroupManager::process_groups($group_list);
}
if (!isset($_GET['origin']) || $_GET['origin'] != 'learnpath') {

@ -57,19 +57,19 @@ if (isset($_POST['action'])) {
exit;
break;
case 'create_virtual_groups':
$ids = GroupManager :: create_groups_from_virtual_courses();
$ids = GroupManager::create_groups_from_virtual_courses();
$msg = urlencode(count($ids).' '.get_lang('GroupsAdded'));
header('Location: group.php?action=show_msg&msg='.$msg);
exit;
break;
case 'create_subgroups':
GroupManager :: create_subgroups($_POST['base_group'], $_POST['number_of_groups']);
GroupManager::create_subgroups($_POST['base_group'], $_POST['number_of_groups']);
$msg = urlencode($_POST['number_of_groups'].' '.get_lang('GroupsAdded'));
header('Location: group.php?action=show_msg&msg='.$msg);
exit;
break;
case 'create_class_groups':
$ids = GroupManager :: create_class_groups($_POST['group_category']);
$ids = GroupManager::create_class_groups($_POST['group_category']);
$msg = urlencode(count($ids).' '.get_lang('GroupsAdded'));
header('Location: group.php?action=show_msg&msg='.$msg);
exit;

Loading…
Cancel
Save