// the first line of the csv file with the column headers
@ -590,10 +590,10 @@ class MySpace {
foreach ($course_data as $key => $course) {
$course_code = $course[0];
$course_title = $course[1];
$csv_row = array();
$csv_row[] = $course_title;
// getting all the courses of the session
$sql = "SELECT * FROM $tbl_user AS u INNER JOIN $tbl_course_rel_user AS cu ON cu.user_id = u.user_id WHERE cu.course_code = '".$course_code."' AND ISNULL(cu.role);";
error_log('New LP - In learnpath::first() - Last item seen is ' . $this->last_item_seen . ' of type ' . $this->items[$this->last_item_seen]->get_type(), 0);
if(self::debug>2){error_log('New LP - In learnpathItem::get_status() - Returning db value '.$row['status'],0);}
@ -1108,7 +1108,7 @@ class learnpathItem {
if (empty($this->title)) {return '';}
return $this->title;
}
/**
* Returns the total time used to see that item
* @return integer Total time
@ -1233,7 +1233,7 @@ class learnpathItem {
}*/
// if we don't init start time here, the time is sometimes calculated from the las start time
$this->current_start_time = time();
//error_log('New LP - reinit blocked by setting',0);
}
}
@ -1260,7 +1260,7 @@ class learnpathItem {
* @param integer The user ID. In some cases like Dokeos quizzes, it's necessary to have the user ID to query other tables (like the results of quizzes)
* @return boolean True if the list of prerequisites given is entirely satisfied, false otherwise
*/
function parse_prereq($prereqs_string, $items, $refs_list,$user_id){
function parse_prereq($prereqs_string, $items, $refs_list,$user_id){
if(self::debug>0){error_log('New LP - In learnpathItem::parse_prereq() for learnpath '.$this->lp_id.' with string '.$prereqs_string,0);}
//deal with &, |, ~, =, <>, {}, ,, X*, () in reverse order
$this->prereq_alert = '';
@ -1287,9 +1287,9 @@ class learnpathItem {
}
}
}
//parenthesis removed, now look for ORs as it is the lesser-priority binary operator (= always uses one text operand)
if (strpos($prereqs_string,"|")===false) {
if (strpos($prereqs_string,"|")===false) {
if(self::debug>1){error_log('New LP - Didnt find any OR, looking for AND',0);}
* @return mixed True if the course was successfully deleted, WSError otherwise
@ -28,10 +28,10 @@ class WSCourse extends WS {
return true;
}
}
/**
* Deletes a course
*
*
* @param string API secret key
* @param string Course id field name
* @param string Course id value
@ -47,10 +47,10 @@ class WSCourse extends WS {
}
}
}
/**
* Deletes multiple courses
*
*
* @param string API secret key
* @param array Array of courses with elements of the form array('course_id_field_name' => 'name_of_field', 'course_id_value' => 'value')
* @return array Array with elements like array('course_id_value' => 'value', 'result' => array('code' => 0, 'message' => 'Operation was successful')). Note that if the result array contains a code different
@ -77,10 +77,10 @@ class WSCourse extends WS {
return $results;
}
}
/**
* Creates a course (helper method)
*
*
* @param string Title
* @param string Category code
* @param string Wanted code. If it's not defined, it will be generated automatically
return new WSError(202, 'There was an error creating the course');
} else {
// Update extra fields
@ -122,10 +122,10 @@ class WSCourse extends WS {
return $course_info['id'];
}
}
/**
* Creates a course
*
*
* @param string API secret key
* @param string Title
* @param string Category code
@ -153,10 +153,10 @@ class WSCourse extends WS {
}
}
}
/**
* Create multiple courses
*
*
* @param string API secret key
* @param array Courses to be created, with elements following the structure presented in CreateCourse
* @return array Array with elements of the form array('course_id_value' => 'original value sent', 'course_id_generated' => 'value_generated', 'result' => array('code' => 0, 'message' => 'Operation was successful'))
@ -186,10 +186,10 @@ class WSCourse extends WS {
return $results;
}
}
/**
* Edits a course (helper method)
*
*
* @param string Course id field name
* @param string Course id value
* @param string Title
@ -253,10 +253,10 @@ class WSCourse extends WS {
return true;
}
}
/**
* Edits a course
*
*
* @param string API secret key
* @param string Course id field name
* @param string Course id value
@ -282,10 +282,10 @@ class WSCourse extends WS {
}
}
}
/**
* List courses
*
*
* @param string API secret key
* @param string Course id field name. Use "chamilo_course_id" to use internal id
* @return array An array with elements of the form ('id' => 'Course internal id', 'code' => 'Course code', 'title' => 'Course title', 'language' => 'Course language', 'visibility' => 'Course visibility',
* Web services available for the User module. This class extends the WS class
*/
class WSUser extends WS {
/**
* Enables or disables a user
*
*
* @param string User id field name
* @param string User id value
* @param int Set to 1 to enable and to 0 to disable
@ -29,10 +29,10 @@ class WSUser extends WS {
}
}
}
/**
* Enables or disables multiple users
*
*
* @param array Users
* @param int Set to 1 to enable and to 0 to disable
* @return array Array of results
@ -53,10 +53,10 @@ class WSUser extends WS {
}
return $results;
}
/**
* Disables a user
*
*
* @param string API secret key
* @param string User id field name. Use "chamilo_user_id" as the field name if you want to use the internal user_id
* @param string User id value
@ -73,10 +73,10 @@ class WSUser extends WS {
}
}
}
/**
* Disables multiple users
*
*
* @param string API secret key
* @param array Array of users with elements of the form array('user_id_field_name' => 'name_of_field', 'user_id_value' => 'value')
* @return array Array with elements like array('user_id_value' => 'value', 'result' => array('code' => 0, 'message' => 'Operation was successful')). Note that if the result array contains a code different
@ -91,10 +91,10 @@ class WSUser extends WS {
return $this->changeUsersActiveState($users, 0);
}
}
/**
* Enables a user
*
*
* @param string API secret key
* @param string User id field name. Use "chamilo_user_id" as the field name if you want to use the internal user_id
* @param string User id value
@ -110,10 +110,10 @@ class WSUser extends WS {
}
}
}
/**
* Enables multiple users
*
*
* @param string API secret key
* @param array Array of users with elements of the form array('user_id_field_name' => 'name_of_field', 'user_id_value' => 'value')
* @return array Array with elements like array('user_id_value' => 'value', 'result' => array('code' => 0, 'message' => 'Operation was successful')). Note that if the result array contains a code different
@ -128,10 +128,10 @@ class WSUser extends WS {
return $this->changeUsersActiveState($users, 1);
}
}
/**
* Deletes a user (helper method)
*
*
* @param string User id field name. Use "chamilo_user_id" as the field name if you want to use the internal user_id
* @param string User id value
* @return mixed True if user was successfully deleted, WSError otherwise
@ -148,10 +148,10 @@ class WSUser extends WS {
}
}
}
/**
* Deletes a user
*
*
* @param string API secret key
* @param string User id field name. Use "chamilo_user_id" as the field name if you want to use the internal user_id
* @param string User id value
@ -167,10 +167,10 @@ class WSUser extends WS {
}
}
}
/**
* Deletes multiple users
*
*
* @param string API secret key
* @param array Array of users with elements of the form array('user_id_field_name' => 'name_of_field', 'user_id_value' => 'value')
* @return array Array with elements like array('user_id_value' => 'value', 'result' => array('code' => 0, 'message' => 'Operation was successful')). Note that if the result array contains a code different
@ -197,16 +197,16 @@ class WSUser extends WS {
return $results;
}
}
/**
* Creates a user (helper method)
*
*
* @param string User first name
* @param string User last name
* @param int User status
* @param string Login name
* @param string Password (encrypted or not)
* @param string Encrypt method. Leave blank if you are passing the password in clear text, set to the encrypt method used to encrypt the password otherwise. Remember
* @param string Encrypt method. Leave blank if you are passing the password in clear text, set to the encrypt method used to encrypt the password otherwise. Remember
* to include the salt in the extra fields if you are encrypting the password
* @param string User id field name. Use "chamilo_user_id" as the field name if you want to use the internal user_id
* @param string User id value. Leave blank if you are using the internal user_id
return new WSError(102, 'This username is already taken');
@ -241,17 +241,17 @@ class WSUser extends WS {
return $result;
}
}
/**
* Creates a user
*
*
* @param string API secret key
* @param string User first name
* @param string User last name
* @param int User status
* @param string Login name
* @param string Password (encrypted or not)
* @param string Encrypt method. Leave blank if you are passing the password in clear text, set to the encrypt method used to encrypt the password otherwise. Remember
* @param string Encrypt method. Leave blank if you are passing the password in clear text, set to the encrypt method used to encrypt the password otherwise. Remember
* to include the salt in the extra fields if you are encrypting the password
* @param string User id field name. Use "chamilo_user_id" as the field name if you want to use the internal user_id
* @param string User id value. Leave blank if you are using the internal user_id
@ -277,10 +277,10 @@ class WSUser extends WS {
}
}
}
/**
* Creates multiple users
*
*
* @param string API secret key
* @param array Users array. Each member of this array must follow the structure imposed by the CreateUser method
* @return array Array with elements of the form array('user_id_value' => 'original value sent', 'user_id_generated' => 'value_generated', 'result' => array('code' => 0, 'message' => 'Operation was successful'))
@ -309,10 +309,10 @@ class WSUser extends WS {
return $results;
}
}
/**
* Edits user info (helper method)
*
*
* @param string User id field name. Use "chamilo_user_id" in order to use internal system id
return new WSError(103, 'The encryption of the password is invalid');
@ -353,10 +353,10 @@ class WSUser extends WS {
}
}
}
/**
* Edits user info
*
*
* @param string API secret key
* @param string User id field name. Use "chamilo_user_id" in order to use internal system id
* @param string User id value
@ -384,10 +384,10 @@ class WSUser extends WS {
}
}
}
/**
* Edits multiple users
*
*
* @param string API secret key
* @param array Users array. Each member of this array must follow the structure imposed by the EditUser method
* @return array Array with elements like array('user_id_value' => 'value', 'result' => array('code' => 0, 'message' => 'Operation was successful')). Note that if the result array contains a code different
@ -1872,7 +1872,7 @@ if ($_GET['action']=='recentchanges') {
//$sql='SELECT * FROM '.$tbl_wiki.', '.$tbl_wiki_conf.' WHERE '.$tbl_wiki_conf.'.page_id='.$tbl_wiki.'.page_id AND visibility=1 AND '.$tbl_wiki.'.'.$groupfilter.' ORDER BY dtime DESC'; // new version
Database::query('UPDATE '.$work_table.' SET description = '."'".Database::escape_string($_POST['description'])."'".', qualification = '."'".Database::escape_string($_POST['qualification']['qualification'])."'".',weight = '."'".Database::escape_string($_POST['weight']['weight'])."'".' WHERE id = '."'".$row['id']."'");
Database::query('UPDATE '.Database :: get_main_table(TABLE_MAIN_GRADEBOOK_LINK).' SET weight = '."'".Database::escape_string($_POST['weight']['weight'])."'".' WHERE course_code = '."'".api_get_course_id()."'".' AND ref_id = '."'".$row['id']."'".'');
//we are changing the current work and we want add them into gradebook
if (isset($_POST['make_calification']) && $_POST['make_calification'] == 1) {
@ -678,8 +678,8 @@ if (!empty($_REQUEST['delete2'])) {
if (!empty ($_REQUEST['move'])) {
$folders = array();
$session_id = api_get_session_id();
$session_id == 0 ? $withsession = " AND session_id = 0 " : $withsession = " AND session_id='".$session_id."'";
$session_id == 0 ? $withsession = " AND session_id = 0 " : $withsession = " AND session_id='".$session_id."'";
$sql = "SELECT id, url FROM $work_table WHERE url LIKE '/%' AND post_group_id = '".(empty($_SESSION['toolgroup'])?0:intval($_SESSION['toolgroup']))."'".$withsession;
@ -885,7 +885,7 @@ if ($ctok == $_POST['sec_token']) { //check the token inserted into the form
$parent_id = '';
$active = '';
$user_id = api_get_user_id();
$sql = Database::query('SELECT id FROM '.Database::get_course_table(TABLE_STUDENT_PUBLICATION).' WHERE url = '."'/".Database::escape_string($_GET['curdirpath'])."' AND filetype='folder' LIMIT 1");
if (Database::num_rows($sql) > 0) {
$dir_row = Database::fetch_array($sql);
@ -1132,8 +1132,8 @@ if ($is_special > 0) {
if ($homework['ends_on'] != '0000-00-00 00:00:00' && $difference2 <0){
$has_ended = true;
}
if ($homework['expires_on'] == '0000-00-00 00:00:00') {
$has_expiry_date = false;
if ($homework['expires_on'] == '0000-00-00 00:00:00') {