@ -304,15 +308,16 @@ function getWorkList($id, $my_folder_data, $add_in_where_query)
// Get list from database
if ($is_allowed_to_edit) {
$active_condition = ' active IN (0, 1)';
$sql_get_publications_list = "SELECT * FROM $work_table
$sql = "SELECT * FROM $work_table
WHERE c_id = $course_id $add_in_where_query $condition_session AND $active_condition AND (parent_id = 0) $contains_file_query ";
if (!empty($group_id)) {
$sql_get_publications_list .= " AND post_group_id = '".$group_id."' ";
$sql .= " AND post_group_id = '".$group_id."' ";
}
$sql_get_publications_list .= " ORDER BY sent_date DESC";
$sql .= " ORDER BY sent_date DESC";
} else {
if (!empty($group_id)) {
$group_query = " WHERE c_id = $course_id AND post_group_id = '".$group_id."' "; // set to select only messages posted by the user's group
// set to select only messages posted by the user's group
$group_query = " WHERE c_id = $course_id AND post_group_id = '".$group_id."' ";
$subdirs_query = "AND parent_id = 0";
} else {
$group_query = " WHERE c_id = $course_id AND post_group_id = '0' ";
@ -320,12 +325,14 @@ function getWorkList($id, $my_folder_data, $add_in_where_query)
}
//@todo how we can active or not an assignment?
$active_condition = ' AND active IN (1,0)';
$sql_get_publications_list = "SELECT * FROM $work_table $group_query $subdirs_query $add_in_where_query $active_condition $condition_session ORDER BY title";