diff --git a/main/work/work.lib.php b/main/work/work.lib.php
index 32c2deb50b..9655894c0f 100644
--- a/main/work/work.lib.php
+++ b/main/work/work.lib.php
@@ -224,14 +224,15 @@ function display_student_publications_list($work_dir,$sub_course_dir,$currentCou
if (!empty($_SESSION['toolgroup']))
{
$group_query = " WHERE post_group_id = '".$_SESSION['toolgroup']."' "; // set to select only messages posted by the user's group
+ $subdirs_query = "AND url NOT LIKE '$sub_course_dir%/%'";
}
else
{
$group_query = '';
+ $subdirs_query = "WHERE url NOT LIKE '$sub_course_dir%/%'";
}
- $sql_get_publications_list = "SELECT * FROM $work_table $group_query ORDER BY id";
+ $sql_get_publications_list = "SELECT * FROM $work_table $group_query $subdirs_query ORDER BY id";
}
- //echo $sql_get_publications_list;
$sql_result = api_sql_query($sql_get_publications_list,__FILE__,__LINE__);
$table_header[] = array(get_lang('Title'),true);
@@ -252,28 +253,25 @@ function display_student_publications_list($work_dir,$sub_course_dir,$currentCou
$mydir = $my_sub_dir.$dir;
$action = '';
//display info depending on the permissions
- if( $is_allowed_to_edit)
- {
- $row = array();
- $class = '';
- $url = implode("/", array_map("rawurlencode", explode("/", $work->url)));
- $row[] = '
'.$dir.'';
- $row[] = '';
- $row[] = '';
- $row[] = '';
- if( $is_allowed_to_edit)
- {
- //$action .= '
';
- $action .= '
';
- $row[] = $action;
- }else{
- $row[] = "";
- }
- $table_data[] = $row;
+ $row = array();
+ $class = '';
+ $url = implode("/", array_map("rawurlencode", explode("/", $work->url)));
+ $row[] = '
'.$dir.'';
+ $row[] = '';
+ $row[] = '';
+ $row[] = '';
+ if( $is_allowed_to_edit)
+ {
+ //$action .= '
';
+ $action .= '
';
+ $row[] = $action;
+ }else{
+ $row[] = "";
}
+ $table_data[] = $row;
}
while( $work = mysql_fetch_object($sql_result))
{