|
|
|
@ -3,7 +3,6 @@ |
|
|
|
|
/* For licensing terms, see /license.txt */ |
|
|
|
|
|
|
|
|
|
require_once '../../inc/global.inc.php'; |
|
|
|
|
require_once '../../work/work.lib.php'; |
|
|
|
|
|
|
|
|
|
ini_set('soap.wsdl_cache_enabled', 0); |
|
|
|
|
ini_set('default_socket_timeout', '1000'); |
|
|
|
@ -92,7 +91,7 @@ function sendDocument($documentId, $courseInfo) |
|
|
|
|
|
|
|
|
|
compilatioUpdateWorkDocument($documentId, $courseId); |
|
|
|
|
$workTable = Database::get_course_table(TABLE_STUDENT_PUBLICATION); |
|
|
|
|
$query = "SELECT * FROM $workTable |
|
|
|
|
$query = "SELECT * FROM $workTable |
|
|
|
|
WHERE id = $documentId AND c_id= $courseId"; |
|
|
|
|
$sqlResult = Database::query($query); |
|
|
|
|
$doc = Database::fetch_object($sqlResult); |
|
|
|
@ -162,7 +161,7 @@ function getWorkTitle($docId, $courseId) |
|
|
|
|
$courseId = (int) $courseId; |
|
|
|
|
|
|
|
|
|
$workTable = Database::get_course_table(TABLE_STUDENT_PUBLICATION); |
|
|
|
|
$sql = "SELECT title FROM $workTable |
|
|
|
|
$sql = "SELECT title FROM $workTable |
|
|
|
|
WHERE c_id= $courseId AND id = $docId"; |
|
|
|
|
$res = Database::query($sql); |
|
|
|
|
if (Database::num_rows($res) > 0) { |
|
|
|
@ -228,7 +227,7 @@ function compilatioUpdateWorkDocument($docId, $courseId) |
|
|
|
|
$newestFilename = $shortFilename.'_'.$cleanWorkTitle; |
|
|
|
|
rename($coursePath.$urlFile, $coursePath.$work_folder.$newestFilename); |
|
|
|
|
/*rename the db's input with the extension*/ |
|
|
|
|
$sql = "UPDATE $workTable SET url='".$work_folder.$newestFilename."' |
|
|
|
|
$sql = "UPDATE $workTable SET url='".$work_folder.$newestFilename."' |
|
|
|
|
WHERE c_id=$courseId AND id=$docId"; |
|
|
|
|
Database::query($sql); |
|
|
|
|
} |
|
|
|
|