added documents by default for a course in session - partial DT#5377

skala
Cristian Fasanando 16 years ago
parent 5fab375967
commit 97479457c2
  1. 2
      main/document/document.php
  2. 8
      main/inc/lib/document.lib.php

@ -576,7 +576,7 @@ if($is_allowed_to_edit || $group_member_with_upload_rights) // TEACHER ONLY
}
//update item_property to change visibility
if(api_item_property_update($_course, TOOL_DOCUMENT, $update_id, $visibility_command, $_user['user_id']))
if(api_item_property_update($_course, TOOL_DOCUMENT, $update_id, $visibility_command, $_user['user_id'],null,null,null,null,$current_session_id))
{
Display::display_confirmation_message(get_lang("ViMod"));
}

@ -521,15 +521,17 @@ class DocumentManager {
//condition for the session
$current_session_id = api_get_session_id();
$is_session_into_category = api_is_session_in_category($current_session_id,'20091U');
$condition_session = " AND id_session = (SELECT IFNULL((SELECT DISTINCT id_session FROM $TABLE_ITEMPROPERTY WHERE ref = last.ref AND id_session = '$current_session_id'),0))";
/*
$is_session_into_category = api_is_session_in_category($current_session_id,'20091U');
$condition_session = "";
if ($is_session_into_category) {
$condition_session = " AND id_session = (SELECT IFNULL((SELECT DISTINCT id_session FROM $TABLE_ITEMPROPERTY WHERE ref = last.ref AND id_session = '$current_session_id'),0))";
} else {
$condition_session = " AND id_session = '$current_session_id' ";
}
*/
$sql_session_id = "SELECT IFNULL((SELECT DISTINCT id_session FROM $TABLE_ITEMPROPERTY WHERE ref = last.ref AND id_session = '$current_session_id'),0)";
@ -542,7 +544,7 @@ class DocumentManager {
AND ".$to_field." = ".$to_value."
AND last.visibility".$visibility_bit . $condition_session;
$result = Database::query($sql);
$result = Database::query($sql,__FILE__,__LINE__);
if ($result && Database::num_rows($result) != 0)
{

Loading…
Cancel
Save