Fixing bug when uploading assignments due the new DB changes

skala
Julio Montoya 14 years ago
parent 25c5780787
commit f4c715d1cf
  1. 6
      main/work/work.lib.php
  2. 8
      main/work/work.php

@ -488,11 +488,11 @@ function display_student_publications_list($id, $link_target_parameter, $dateFor
WHERE "; WHERE ";
if (!empty($_SESSION['toolgroup'])) { if (!empty($_SESSION['toolgroup'])) {
$sql_select_directory .= " prop.c_id = $course_id AND work.c_id = $course_id AND work.post_group_id = '".$_SESSION['toolgroup']."' "; // set to select only messages posted by the user's group $sql_select_directory .= " work.post_group_id = '".$_SESSION['toolgroup']."' "; // set to select only messages posted by the user's group
} else { } else {
$sql_select_directory .= " prop.c_id = $course_id AND work.c_id = $course_id AND work.post_group_id = '0' "; $sql_select_directory .= " work.post_group_id = '0' ";
} }
$sql_select_directory .= " AND work.url LIKE BINARY '".$mydir_temp."' AND work.filetype = 'folder' AND prop.tool='work' $condition_session"; $sql_select_directory .= " AND prop.c_id = $course_id AND work.c_id = $course_id AND work.url LIKE BINARY '".$mydir_temp."' AND work.filetype = 'folder' AND prop.tool='work' $condition_session";
$result = Database::query($sql_select_directory); $result = Database::query($sql_select_directory);
$row = Database::fetch_array($result); $row = Database::fetch_array($result);

@ -332,8 +332,6 @@ if (!empty ($_POST['changeProperties'])) {
$result = Database::query($query); $result = Database::query($query);
$number_of_setting = Database::num_rows($result); $number_of_setting = Database::num_rows($result);
if ($number_of_setting == 1) { 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' and c_id = $course_id"; $query = "UPDATE " . $table_course_setting . " SET value='" . Database::escape_string($_POST['student_delete_own_publication']) . "' WHERE variable='student_delete_own_publication' and c_id = $course_id";
Database::query($query); Database::query($query);
@ -863,7 +861,7 @@ if (isset($_POST['sec_token']) && $ctok == $_POST['sec_token']) { //check the to
$result = Database::query("SHOW FIELDS FROM " . $work_table . " LIKE 'sent_date'"); $result = Database::query("SHOW FIELDS FROM " . $work_table . " LIKE 'sent_date'");
if (!Database::num_rows($result)) { if (!Database::num_rows($result)) {
Database::query("ALTER TABLE " . $work_table . " ADD sent_date DATETIME NOT NULL"); Database::query("ALTER TABLE " . $work_table . " ADD sent_date DATETIME NOT NULL WHERE c_id = $course_id ");
} }
$active = '1'; $active = '1';
@ -884,8 +882,8 @@ if (isset($_POST['sec_token']) && $ctok == $_POST['sec_token']) { //check the to
Database::query($sql_add_publication); Database::query($sql_add_publication);
$Id = Database::insert_id(); $id = Database::insert_id();
api_item_property_update($_course, 'work', $Id, 'DocumentAdded', $user_id); api_item_property_update($_course, 'work', $id, 'DocumentAdded', $user_id);
$succeed = true; $succeed = true;
// update all the parents in the table item propery // update all the parents in the table item propery

Loading…
Cancel
Save