From 795638844f1a71e39edcfbc3773a023d6ed397e8 Mon Sep 17 00:00:00 2001 From: Patrick Cool Date: Tue, 10 Nov 2009 16:21:36 +0100 Subject: [PATCH 1/4] remove two debug messages --- main/work/work.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/main/work/work.php b/main/work/work.php index ce093809a8..a3b49d3cad 100644 --- a/main/work/work.php +++ b/main/work/work.php @@ -402,7 +402,6 @@ if (!empty ($_POST['changeProperties'])) { $query = "SELECT * FROM " . $table_course_setting . " WHERE variable = 'student_delete_own_publication'"; $result = Database::query($query, __FILE__, __LINE__); $number_of_setting = Database::num_rows($result); - echo $number_of_setting; if ($number_of_setting == 1){ $query = "UPDATE " . $table_course_setting . " SET value='" . Database::escape_string($_POST['student_delete_own_publication']) . "' WHERE variable='student_delete_own_publication'"; @@ -411,7 +410,6 @@ if (!empty ($_POST['changeProperties'])) { $query = "INSERT INTO " . $table_course_setting . " (variable, value, category) VALUES ('student_delete_own_publication','" . Database::escape_string($_POST['student_delete_own_publication']) . "','work')"; Database::query($query, __FILE__, __LINE__); } - echo $query; $_course['show_score'] = $uploadvisibledisabled; } else { From 6a3f1c1f5444678e6c496b1819bf6621f35faf49 Mon Sep 17 00:00:00 2001 From: Arthur Portugal Date: Tue, 10 Nov 2009 10:30:35 -0500 Subject: [PATCH 2/4] Added to admin glossary term --- main/lang/english/admin.inc.php | 2 ++ main/lang/spanish/admin.inc.php | 2 ++ 2 files changed, 4 insertions(+) diff --git a/main/lang/english/admin.inc.php b/main/lang/english/admin.inc.php index c0db682550..b877b629d8 100644 --- a/main/lang/english/admin.inc.php +++ b/main/lang/english/admin.inc.php @@ -1091,4 +1091,6 @@ $IsNotAdministrator = "Is not administrator"; $AddTimeLimit = "Add time limit"; $EditTimeLimit = "Edit time limit"; $TheTimeLimitsAreReferential = "The time limit of a category is referential, will not affect the boundaries of a training session"; +$ShowGlossaryInExtraToolsTitle = "Show the glossary terms in extra tools"; +$ShowGlossaryInExtraToolsComment = "From here you can configure how to add the glossary terms in extra tools as learning path and exercice tool"; ?> \ No newline at end of file diff --git a/main/lang/spanish/admin.inc.php b/main/lang/spanish/admin.inc.php index 699f6fd966..f58232b129 100644 --- a/main/lang/spanish/admin.inc.php +++ b/main/lang/spanish/admin.inc.php @@ -1091,4 +1091,6 @@ $IsNotAdministrator = "No es administrador"; $AddTimeLimit = "Añadir límite de tiempo"; $EditTimeLimit = "Editar límite de tiempo"; $TheTimeLimitsAreReferential = "El plazo de una categoría es referencial, no afectará a los límites de una sesión de formación"; +$ShowGlossaryInExtraToolsTitle = "Muestra los términos del glosario en las herramientas lecciones(scorm) y ejercicios"; +$ShowGlossaryInExtraToolsComment = "Desde aquí usted puede configurar como añadir los términos del glosario en herramientas como lecciones(scorm) y ejercicios"; ?> \ No newline at end of file From e3654cee6f55ce054627aeb95fe2550aff4de31f Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Tue, 10 Nov 2009 12:44:56 -0500 Subject: [PATCH 3/4] Fixing #5566 --- whoisonline.php | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/whoisonline.php b/whoisonline.php index 5a8f3db56f..0d451972d0 100644 --- a/whoisonline.php +++ b/whoisonline.php @@ -231,36 +231,36 @@ function display_individual_user($user_id) { $big_image_height = $big_image_size[1]; $url_big_image = $big_image.'?rnd='.time(); echo '
'; - global $user_anonymous; - if (api_get_setting('allow_social_tool') == 'true' && api_get_user_id() <> $user_anonymous && api_get_user_id() <> 0) { - echo '
'; - echo ''.get_lang('ViewSharedProfile').''; - echo '
'; - - $user_anonymous = api_get_anonymous_id(); - - if ($safe_user_id != api_get_user_id() && !api_is_anonymous($safe_user_id)) { - $user_relation = UserFriend::get_relation_between_contacts(api_get_user_id(), $safe_user_id); - if ($user_relation == 0 || $user_relation == 6) { - echo ''.Display :: return_icon('add_multiple_users.gif', get_lang('SocialInvitationToFriends')).' '.get_lang('SendInvitation').'
- '.Display :: return_icon('mail_send.png', get_lang('SendAMessage')).' '.get_lang('SendAMessage').''; - } else { - echo ''.Display :: return_icon('mail_send.png', get_lang('SendAMessage')).' '.get_lang('SendAMessage').''; - } - } - - - - } } else { echo Display::return_icon('unknown.jpg', get_lang('Unknown')); echo '
'; } + + echo '
'.$status.'
'; + + global $user_anonymous; + if (api_get_setting('allow_social_tool') == 'true' && api_get_user_id() <> $user_anonymous && api_get_user_id() <> 0) { + echo '
'; + echo ''.get_lang('ViewSharedProfile').''; + echo '
'; + + $user_anonymous = api_get_anonymous_id(); + + if ($safe_user_id != api_get_user_id() && !api_is_anonymous($safe_user_id)) { + $user_relation = UserFriend::get_relation_between_contacts(api_get_user_id(), $safe_user_id); + if ($user_relation == 0 || $user_relation == 6) { + echo ''.Display :: return_icon('add_multiple_users.gif', get_lang('SocialInvitationToFriends')).' '.get_lang('SendInvitation').'
+ '.Display :: return_icon('mail_send.png', get_lang('SendAMessage')).' '.get_lang('SendAMessage').''; + } else { + echo ''.Display :: return_icon('mail_send.png', get_lang('SendAMessage')).' '.get_lang('SendAMessage').''; + } + } + } if (api_get_setting('show_email_addresses') == 'true') { echo Display::encrypted_mailto_link($user_object->email,$user_object->email).'
'; } - echo $status.'
'; + echo ''; if ($user_object->competences) { echo '
'.get_lang('MyCompetences').'
'; From 7a56e3674f402040cad8454a7c33f1c745abf8a0 Mon Sep 17 00:00:00 2001 From: Cristian Fasanando Date: Tue, 10 Nov 2009 12:57:05 -0500 Subject: [PATCH 4/4] Implemented content in course description from a session is only visible in that session - DT#5496 --- main/course_description/index.php | 87 +++++++++++-------- main/inc/lib/add_course.lib.inc.php | 1 + .../migrate-db-1.8.6.1-1.8.6.2-pre.sql | 3 +- .../install/update-db-1.8.6.1-1.8.6.2.inc.php | 26 ++++++ 4 files changed, 78 insertions(+), 39 deletions(-) diff --git a/main/course_description/index.php b/main/course_description/index.php index 6223cadbdc..58d1dd2113 100644 --- a/main/course_description/index.php +++ b/main/course_description/index.php @@ -36,19 +36,20 @@ include_once api_get_path(LIBRARY_PATH).'WCAG/WCAG_rendering.php'; $interbreadcrumb[] = array ("url" => "index.php", "name" => get_lang('CourseProgram')); +$description_type = isset ($_REQUEST['description_type']) ? Security::remove_XSS($_REQUEST['description_type']) : null; $description_id = isset ($_REQUEST['description_id']) ? Security::remove_XSS($_REQUEST['description_id']) : null; $action = isset($_GET['action'])?Security::remove_XSS($_GET['action']):''; $edit = isset($_POST['edit'])?Security::remove_XSS($_POST['edit']):''; $add = isset($_POST['add'])?Security::remove_XSS($_POST['add']):''; -if(intval($description_id) == 1) $interbreadcrumb[] = array ("url" => "#", "name" => get_lang('GeneralDescription')); -if(intval($description_id) == 2) $interbreadcrumb[] = array ("url" => "#", "name" => get_lang('Objectives')); -if(intval($description_id) == 3) $interbreadcrumb[] = array ("url" => "#", "name" => get_lang('Topics')); -if(intval($description_id) == 4) $interbreadcrumb[] = array ("url" => "#", "name" => get_lang('Methodology')); -if(intval($description_id) == 5) $interbreadcrumb[] = array ("url" => "#", "name" => get_lang('CourseMaterial')); -if(intval($description_id) == 6) $interbreadcrumb[] = array ("url" => "#", "name" => get_lang('HumanAndTechnicalResources')); -if(intval($description_id) == 7) $interbreadcrumb[] = array ("url" => "#", "name" => get_lang('Assessment')); -if(intval($description_id) >= 8) $interbreadcrumb[] = array ("url" => "#", "name" => get_lang('NewBloc')); +if(intval($description_type) == 1) $interbreadcrumb[] = array ("url" => "#", "name" => get_lang('GeneralDescription')); +if(intval($description_type) == 2) $interbreadcrumb[] = array ("url" => "#", "name" => get_lang('Objectives')); +if(intval($description_type) == 3) $interbreadcrumb[] = array ("url" => "#", "name" => get_lang('Topics')); +if(intval($description_type) == 4) $interbreadcrumb[] = array ("url" => "#", "name" => get_lang('Methodology')); +if(intval($description_type) == 5) $interbreadcrumb[] = array ("url" => "#", "name" => get_lang('CourseMaterial')); +if(intval($description_type) == 6) $interbreadcrumb[] = array ("url" => "#", "name" => get_lang('HumanAndTechnicalResources')); +if(intval($description_type) == 7) $interbreadcrumb[] = array ("url" => "#", "name" => get_lang('Assessment')); +if(intval($description_type) >= 8) $interbreadcrumb[] = array ("url" => "#", "name" => get_lang('NewBloc')); api_protect_course_script(true); $nameTools = get_lang('CourseProgram'); @@ -129,17 +130,25 @@ $default_description_title_editable[7] = true; */ $condition_session = api_get_session_condition($session_id, false); +$current_session_id = api_get_session_id(); + + +$sql = "SELECT description_type,title FROM $tbl_course_description $condition_session ORDER BY description_type "; -$sql = "SELECT id,title FROM $tbl_course_description $condition_session ORDER BY id "; $result = Database::query($sql, __FILE__, __LINE__); while ($row = Database::fetch_array($result)) { - $default_description_titles[$row['id']] = $row['title']; + $default_description_titles[$row['description_type']] = $row['title']; } -if (api_is_allowed_to_edit(null,true) && !is_null($description_id) || $action =='add') { +$actions = array('add','delete','edit'); + +if ((api_is_allowed_to_edit(null,true) && !is_null($description_type)) || in_array($action,$actions)) { + $description_id = intval($description_id); + $description_type = intval($description_type); + // Delete a description block - if ($action == 'delete') { + if ($action == 'delete') { $sql = "DELETE FROM $tbl_course_description WHERE id='".$description_id."'"; Database::query($sql, __FILE__, __LINE__); //update item_property (delete) @@ -148,31 +157,32 @@ if (api_is_allowed_to_edit(null,true) && !is_null($description_id) || $action == } // Add or edit a description block else { - if (!empty($description_id)) { - $sql = "SELECT * FROM $tbl_course_description WHERE id='".$description_id."'"; - $result = Database::query($sql, __FILE__, __LINE__); + + if (!empty($description_type)) { + $sql = "SELECT * FROM $tbl_course_description WHERE description_type='$description_type' AND session_id='$current_session_id'"; + $result = Database::query($sql, __FILE__, __LINE__); if ($description = Database::fetch_array($result)) { - $default_description_titles[$description_id] = $description['title']; + $default_description_titles[$description_type] = $description['title']; $description_content = $description['content']; } else { - $current_title = $default_description_titles[$description_id]; + $current_title = $default_description_titles[$description_type]; } } else { - $sql = "SELECT MAX(id) as MAX FROM $tbl_course_description $condition_session"; + $sql = "SELECT MAX(description_type) as MAX FROM $tbl_course_description $condition_session"; $result = Database::query($sql, __FILE__, __LINE__); $max= Database::fetch_array($result); - $description_id = $max['MAX']+1; - if ($description_id < ADD_BLOCK) { - $description_id=8; - } + $description_type = $max['MAX']+1; + if ($description_type < ADD_BLOCK) { + $description_type=8; + } } //Se borro: echo '