Minor - format code

pull/2487/head
jmontoyaa 9 years ago
parent bc04d833ea
commit 51322bd6d8
  1. 17
      main/work/view.php
  2. 22
      main/work/work.lib.php

@ -97,22 +97,25 @@ if ((user_is_author($id) || $isDrhOfCourse || (api_is_allowed_to_edit() || api_i
Display::addFlash(Display::return_message(get_lang('Updated')));
$resultUpload = uploadWork($my_folder_data, $courseInfo, true, $work);
$resultUpload = uploadWork(
$my_folder_data,
$courseInfo,
true,
$work
);
if ($resultUpload) {
$work_table = Database:: get_course_table(
TABLE_STUDENT_PUBLICATION
);
if (isset($resultUpload['url']) && !empty($resultUpload['url'])) {
$title = isset($resultUpload['filename']) && !empty($resultUpload['filename']) ? $resultUpload['filename'] : get_lang(
'Untitled'
);
$title = isset($resultUpload['filename']) && !empty($resultUpload['filename']) ? $resultUpload['filename'] : get_lang('Untitled');
$urlToSave = Database::escape_string($resultUpload['url']);
$title = Database::escape_string($title);
$sql = "UPDATE $work_table SET
url_correction = '".$urlToSave."',
title_correction = '".$title."'
WHERE iid = ".$work['iid'];
url_correction = '".$urlToSave."',
title_correction = '".$title."'
WHERE iid = ".$work['iid'];
Database::query($sql);
Display::addFlash(
Display::return_message(get_lang('FileUploadSucces'))

@ -723,8 +723,8 @@ function build_work_move_to_selector($folders, $curdirpath, $move_file, $group_d
* @author Hugues Peeters <hugues.peeters@claroline.net>
* @author Bert Vanderkimpen
* @author Yannick Warnier <ywarnier@beeznest.org> Adaptation for work tool
* @param string $base_work_dir Base work dir (.../work)
* @param string $desiredDirName complete path of the desired name
* @param string $base_work_dir Base work dir (.../work)
* @param string $desiredDirName complete path of the desired name
*
* @return string actual directory name if it succeeds, boolean false otherwise
*/
@ -1657,7 +1657,7 @@ function get_work_user_list_from_documents(
$direction,
$workId,
$studentId = null,
$whereCondition,
$whereCondition = '',
$getCount = false
) {
if ($getCount) {
@ -3489,7 +3489,7 @@ function uploadWork($my_folder_data, $_course, $isCorrection = false, $workInfo
'error' => Display:: return_message(
get_lang('UplUploadFailedSizeIsZero'),
'error'
),
)
);
}
$updir = api_get_path(SYS_COURSE_PATH).$_course['path'].'/work/'; //directory path to upload
@ -3680,7 +3680,7 @@ function checkExistingWorkFileName($filename, $workId)
$work_table = Database :: get_course_table(TABLE_STUDENT_PUBLICATION);
$filename = Database::escape_string($filename);
$sql = "SELECT title FROM $work_table
WHERE parent_id = $workId AND title = '$filename' AND active = 1";
WHERE parent_id = $workId AND title = '$filename' AND active = 1";
$result = Database::query($sql);
return Database::fetch_assoc($result);
}
@ -4279,9 +4279,7 @@ function deleteWorkItem($item_id, $courseInfo)
{
$work_table = Database :: get_course_table(TABLE_STUDENT_PUBLICATION);
$TSTDPUBASG = Database :: get_course_table(TABLE_STUDENT_PUBLICATION_ASSIGNMENT);
$currentCourseRepositorySys = api_get_path(SYS_COURSE_PATH).$courseInfo['path'].'/';
$is_allowed_to_edit = api_is_allowed_to_edit();
$file_deleted = false;
$item_id = intval($item_id);
@ -4346,7 +4344,7 @@ function deleteWorkItem($item_id, $courseInfo)
$sessionId = empty($row['session_id']) ? 0 : $row['session_id'];
// Getting false from the following call would mean the
// time record
$removalResult = Event::eventRemoveVirtualCourseTime(
Event::eventRemoveVirtualCourseTime(
$course_id,
$row['user_id'],
$sessionId,
@ -4428,7 +4426,13 @@ function getFormWork($form, $defaults = array(), $workId = 0)
// Create the form that asks for the directory name
$form->addText('new_dir', get_lang('AssignmentName'));
$form->addHtmlEditor('description', get_lang('Description'), false, false, getWorkDescriptionToolbar());
$form->addHtmlEditor(
'description',
get_lang('Description'),
false,
false,
getWorkDescriptionToolbar()
);
$form->addButtonAdvancedSettings('advanced_params', get_lang('AdvancedParameters'));
if (!empty($defaults) && (isset($defaults['enableEndDate']) || isset($defaults['enableExpiryDate']))) {

Loading…
Cancel
Save