skala
Julio Montoya 16 years ago
commit 75a7fe5d8f
  1. 1
      license.txt
  2. 38
      main/inc/lib/course.lib.php
  3. 22
      main/user/subscribe_class.php
  4. 21
      main/user/subscribe_user.php
  5. 7
      main/user/tags/tags.php
  6. 2
      main/user/user.php
  7. 21
      main/user/userInfo.php
  8. 22
      main/user/userInfoLib.php
  9. 24
      main/user/user_add.php

@ -7,6 +7,7 @@ Copyright (c) 2003-2007 Ghent University (UGent)
Copyright (c) 2001 Universite catholique de Louvain (UCL)
Copyright (c) 2003-2008 Vrije Universiteit Brussel (VUB)
Copyright (c) 2004-2008 Hoogeschool Gent (HoGent)
Copyright (c) Bart Mollet, Hogeschool Gent
Copyright (c) Facultad de Matematicas, UADY (México) (Message plugin)
For a full list of contributors detaining copyrights over parts of

@ -2142,5 +2142,41 @@ class CourseManager {
$row = Database::fetch_row($rs);
return $row[0];
}
/**
* Subscribes "courses" to user (Dashboard feature)
* @param int user id
* @param string Course code
* @param int relation type
* @return
**/
public static function suscribe_courses_to_user($user_id, $course_list, $relation_stype) {
if ($user_id!= strval(intval($user_id))) return false;
$tbl_course = Database::get_main_table(TABLE_MAIN_COURSE);
$tbl_course_rel_user = Database::get_main_table(TABLE_MAIN_COURSE_USER);
$tbl_user = Database::get_main_table(TABLE_MAIN_USER);
$sql = "SELECT course_code FROM $tbl_course_rel_user WHERE user_id = $user_id AND relation_type = 1 ";
$result = Database::query($sql,__FILE__,__LINE__);
$existing_courses = array();
while($row = Database::fetch_array($result)){
$existing_courses[] = $row['course_code'];
}
//Deleting existing session_rel_user with relation ship = 1 only
foreach ($existing_courses as $existing_course) {
$existing_course = Database::escape_string($existing_course);
$sql = "DELETE FROM $tbl_course_rel_user WHERE course_code = '$existing_course' AND user_id = $user_id AND relation_type = 1 ";
Database::query($sql,__FILE__,__LINE__);
}
foreach ($course_list as $course_code) {
// for each session
$course_code = Database::escape_string($course_code);
$insert_sql = "INSERT IGNORE INTO $tbl_course_rel_user(course_code,user_id,relation_type) VALUES('$course_code','$user_id','1')";
Database::query($insert_sql,__FILE__,__LINE__);
}
}
} //end class CourseManager

@ -1,26 +1,6 @@
<?php
// $Id: subscribe_class.php 8213 2006-03-15 15:52:12Z turboke $
/*
==============================================================================
Dokeos - elearning and course management software
Copyright (c) 2004-2005 Dokeos S.A.
Copyright (c) Bart Mollet, Hogeschool Gent
For a full list of contributors, see "credits.txt".
The full license can be read in "license.txt".
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
See the GNU General Public License for more details.
Contact address: Dokeos, 44 rue des palais, B-1030 Brussels, Belgium
Mail: info@dokeos.com
==============================================================================
*/
/* For licensing terms, see /license.txt */
/**
==============================================================================
* This script allows teachers to subscribe existing classes to their course.

@ -1,24 +1,5 @@
<?php // $Id: subscribe_user.php 20412 2009-05-08 16:09:34Z herodoto $
/*
==============================================================================
Dokeos - elearning and course management software
Copyright (c) 2004-2009 Dokeos SPRL
Copyright (c) 2003 Ghent University (UGent)
For a full list of contributors, see "credits.txt".
The full license can be read in "license.txt".
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
See the GNU General Public License for more details.
Contact: Dokeos, rue Notre Dame, 152, B-1140 Evere, Belgium, info@dokeos.com
==============================================================================
*/
/* For licensing terms, see /license.txt
/**
==============================================================================

@ -1,7 +0,0 @@
<?php
/* For licensing terms, see /dokeos_license.txt */
require_once '../inc/global.inc.php';
require_once api_get_path(LIBRARY_PATH).'usermanager.lib.php';
$field_id = intval($_GET['field_id']);
$tag = $_GET['tag'];
echo UserManager::get_tags($tag,$field_id,'json');

@ -1,5 +1,5 @@
<?php
/* For licensing terms, see /dokeos_license.txt */
/* For licensing terms, see /license.txt */
/**
==============================================================================

@ -1,24 +1,5 @@
<?php // $Id: userInfo.php 20951 2009-05-23 19:07:59Z ivantcholakov $
/*
==============================================================================
Dokeos - elearning and course management software
Copyright (c) 2004-2008 Dokeos SPRL
Copyright (c) 2003 Ghent University (UGent)
For a full list of contributors, see "credits.txt".
The full license can be read in "license.txt".
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
See the GNU General Public License for more details.
Contact: Dokeos, rue Notre Dame, 152, B-1140 Evere, Belgium, info@dokeos.com
==============================================================================
*/
/* For licensing terms, see /license.txt */
/**
==============================================================================

@ -1,25 +1,5 @@
<?php
/*
==============================================================================
Dokeos - elearning and course management software
Copyright (c) 2004 Dokeos S.A.
Copyright (c) 2003 Ghent University (UGent)
Copyright (c) 2001 Universite catholique de Louvain (UCL)
For a full list of contributors, see "credits.txt".
The full license can be read in "license.txt".
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
See the GNU General Public License for more details.
Contact: Dokeos, 181 rue Royale, B-1000 Brussels, Belgium, info@dokeos.com
==============================================================================
*/
/* For licensing terms, see /license.txt */
/**
==============================================================================
* @package dokeos.user

@ -1,27 +1,5 @@
<?php
/*
==============================================================================
Dokeos - elearning and course management software
Copyright (c) 2004 Dokeos S.A.
Copyright (c) 2003 Ghent University (UGent)
Copyright (c) 2001 Universite catholique de Louvain (UCL)
For a full list of contributors, see "credits.txt".
The full license can be read in "license.txt".
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
See the GNU General Public License for more details.
Contact: Dokeos, 181 rue Royale, B-1000 Brussels, Belgium, info@dokeos.com
==============================================================================
*/
// TODO: Is this file deprecated?
/* For licensing terms, see /license.txt*/
/**
==============================================================================

Loading…
Cancel
Save