Sending a fix due a bug with works and groups see BT#3240

skala
Julio Montoya 13 years ago
parent 0255058bf3
commit 677fc5ec72
  1. 6
      main/work/work.lib.php
  2. 15
      main/work/work.php

@ -7,7 +7,7 @@
* @author Patrick Cool <patrick.cool@UGent.be>, Ghent University - ability for course admins to specify wether uploaded documents are visible or invisible by default.
* @author Roan Embrechts, code refactoring and virtual course support
* @author Frederic Vauthier, directories management
* @author Julio Montoya <gugli100@gmail.com> BeezNest 2011 LOTS of bug fixes
* @author Julio Montoya <gugli100@gmail.com> BeezNest 2011 LOTS of bug fixes
* @todo this lib should be convert in a static class and moved to main/inc/lib
*/
/**
@ -51,7 +51,7 @@ function display_action_links($id, $cur_dir_path, $always_show_tool_options, $al
}
if (!$always_show_upload_form && api_is_allowed_to_session_edit(false, true) && (isset($cur_dir_path) && (!empty($cur_dir_path) && $cur_dir_path != '/') )) {
$display_output .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&amp;id='.$id.'&amp;curdirpath='.$cur_dir_path.'&amp;action=upload_form&amp;origin='.$origin.'&amp;gradebook='.$gradebook.'">';
$display_output .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&id='.$id.'&curdirpath='.$cur_dir_path.'&action=upload_form&origin='.$origin.'&gradebook='.$gradebook.'">';
$display_output .= Display::return_icon('upload_file.png', get_lang('UploadADocument'),'','32').'</a>';
}
@ -449,7 +449,7 @@ function display_student_publications_list($id, $link_target_parameter, $dateFor
//$table_header[] = array('RealDate', true);
$table_data = array();
$dirs_list = get_subdirs_list($work_dir);
$dirs_list = get_subdirs_list($work_dir);
$my_sub_dir = str_replace('work/', '', $sub_course_dir);

@ -194,10 +194,14 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST' && !sizeof($_POST)) {
//toolgroup comes from group. the but of tis variable is to limit post to the group of the student
//if (!api_is_course_admin()) {
if (!empty ($_GET['toolgroup'])) {
$toolgroup = Database::escape_string($_GET['toolgroup']);
api_session_register('toolgroup');
}
if (isset($_GET['toolgroup'])) {
$toolgroup = Database::escape_string($_GET['toolgroup']);
api_session_register('toolgroup');
}
$toolgroup = isset($_SESSION['toolgroup']) ? $_SESSION['toolgroup'] : api_get_group_id();
//}
$display_upload_form = false;
@ -386,7 +390,7 @@ switch ($action) {
}
}
$form = new FormValidator('form', 'POST', api_get_self() . "?action=upload&id=".$work_id."curdirpath=" . rtrim(Security :: remove_XSS($curdirpath),'/') . "&gradebook=".Security::remove_XSS($_GET['gradebook'])."&origin=$origin", '', 'enctype="multipart/form-data"');
$form = new FormValidator('form', 'POST', api_get_self() . "?action=upload&id=".$work_id."&curdirpath=" . rtrim(Security :: remove_XSS($curdirpath),'/') . "&gradebook=".Security::remove_XSS($_GET['gradebook'])."&origin=$origin", '', 'enctype="multipart/form-data"');
// form title
if ($item_id) {
@ -1303,6 +1307,7 @@ switch ($action) {
if (!empty($my_folder_data['description'])) {
echo '<p><div><strong>'.get_lang('Description').':</strong><p>'.Security::remove_XSS($my_folder_data['description'], STUDENT).'</p></div></p>';
}
if ($display_list_users_without_publication) {
display_list_users_without_publication($my_folder_data['id']);
} else {

Loading…
Cancel
Save