Should fix disk space in works see #3918

skala
Yoselyn Castillo 13 years ago
parent 4654420d7b
commit bf3eb29ba1
  1. 47
      main/work/work.php

@ -579,24 +579,33 @@ switch ($action) {
$title = get_lang('Untitled'); $title = get_lang('Untitled');
} }
$active = '1'; $documents_total_space = DocumentManager::documents_total_space();
$sql_add_publication = "INSERT INTO " . $work_table . " SET $course_max_space = DocumentManager::get_course_quota();
c_id = $course_id , $total_size = $filesize + $documents_total_space;
url = '" . $url . "', if ($total_size > $course_max_space) {
title = '" . Database::escape_string($title) . "', $error_message = get_lang('IsNotPosibleSaveTheDocument');
description = '" . Database::escape_string($description) . "', } else {
author = '" . Database::escape_string($authors) . "',
contains_file = '".$contains_file."', $active = '1';
active = '" . $active . "', $sql_add_publication = "INSERT INTO " . $work_table . " SET
accepted = '1', c_id = $course_id ,
post_group_id = '".$group_id."', url = '" . $url . "',
sent_date = '".api_get_utc_datetime()."', title = '" . Database::escape_string($title) . "',
parent_id = '".$work_id."' , description = '" . Database::escape_string($description) . "',
session_id = '".intval($id_session)."' , author = '" . Database::escape_string($authors) . "',
user_id = '".$user_id."'"; contains_file = '".$contains_file."',
//var_dump($sql_add_publication);exit; active = '" . $active . "',
Database::query($sql_add_publication); accepted = '1',
$id = Database::insert_id(); post_group_id = '".$group_id."',
sent_date = '".api_get_utc_datetime()."',
parent_id = '".$work_id."' ,
session_id = '".intval($id_session)."' ,
user_id = '".$user_id."'";
//var_dump($sql_add_publication);exit;
Database::query($sql_add_publication);
$id = Database::insert_id();
}
if ($id) { if ($id) {
api_item_property_update($course_info, 'work', $id, 'DocumentAdded', $user_id, api_get_group_id()); api_item_property_update($course_info, 'work', $id, 'DocumentAdded', $user_id, api_get_group_id());
/* /*
@ -1176,4 +1185,4 @@ switch ($action) {
if ($origin != 'learnpath') { if ($origin != 'learnpath') {
//we are not in the learning path tool //we are not in the learning path tool
Display :: display_footer(); Display :: display_footer();
} }
Loading…
Cancel
Save