api_get_path(WEB_CODE_PATH).'group/group.php?'.api_get_cidreq(), 'name' => get_lang('Groups'), ]; $interbreadcrumb[] = [ 'url' => api_get_path(WEB_CODE_PATH).'group/group_space.php?'.api_get_cidreq(), 'name' => get_lang('GroupSpace').' '.$group_properties['name'], ]; } $interbreadcrumb[] = [ 'url' => api_get_path(WEB_CODE_PATH).'work/work.php?'.api_get_cidreq(), 'name' => get_lang('StudentPublications'), ]; $interbreadcrumb[] = [ 'url' => api_get_path(WEB_CODE_PATH).'work/work_list_all.php?'.api_get_cidreq().'&id='.$workId, 'name' => $my_folder_data['title'], ]; $action = isset($_REQUEST['action']) ? $_REQUEST['action'] : null; $itemId = isset($_REQUEST['item_id']) ? (int) $_REQUEST['item_id'] : null; switch ($action) { case 'export_to_doc': if ($is_allowed_to_edit) { if (!empty($itemId)) { $work = get_work_data_by_id($itemId); if (!empty($work)) { Export::htmlToOdt($work['description'], $work['title']); } } } break; case 'delete': /* Delete document */ if ($itemId) { $fileDeleted = deleteWorkItem($itemId, $courseInfo); if (!$fileDeleted) { Display::addFlash( Display::return_message(get_lang('YouAreNotAllowedToDeleteThisDocument'), 'error') ); } else { Display::addFlash( Display::return_message(get_lang('TheDocumentHasBeenDeleted'), 'confirmation') ); } } break; case 'delete_correction': $result = get_work_user_list(null, null, null, null, $workId); if ($result) { foreach ($result as $item) { $workToDelete = get_work_data_by_id($item['id']); deleteCorrection($courseInfo, $workToDelete); } Display::addFlash( Display::return_message(get_lang('Deleted'), 'confirmation') ); } header('Location: '.api_get_self().'?'.api_get_cidreq().'&id='.$workId); exit; break; case 'make_visible': /* Visible */ if ($is_allowed_to_edit) { if (!empty($itemId)) { if (isset($itemId) && $itemId == 'all') { } else { makeVisible($itemId, $courseInfo); Display::addFlash( Display::return_message(get_lang('FileVisible'), 'confirmation') ); } } } break; case 'make_invisible': /* Invisible */ if (!empty($itemId)) { if (isset($itemId) && $itemId == 'all') { } else { makeInvisible($itemId, $courseInfo); Display::addFlash( Display::return_message(get_lang('FileInvisible'), 'confirmation') ); } } break; case 'export_pdf': exportAllStudentWorkFromPublication( $workId, $courseInfo, $sessionId, 'pdf' ); break; } $htmlHeadXtra[] = api_get_jquery_libraries_js(['jquery-upload']); Display::display_header(null); $documentsAddedInWork = getAllDocumentsFromWorkToString($workId, $courseInfo); $actionsLeft = ''. Display::return_icon('back.png', get_lang('BackToWorksList'), '', ICON_SIZE_MEDIUM).''; if (api_is_allowed_to_session_edit(false, true) && !empty($workId) && !$isDrhOfCourse) { $blockAddDocuments = api_get_configuration_value('block_student_publication_add_documents'); if (!$blockAddDocuments) { $actionsLeft .= ''; $actionsLeft .= Display::return_icon('new_document.png', get_lang('AddDocument'), '', ICON_SIZE_MEDIUM).''; } $actionsLeft .= ''; $actionsLeft .= Display::return_icon('addworkuser.png', get_lang('AddUsers'), '', ICON_SIZE_MEDIUM).''; $actionsLeft .= ''; $actionsLeft .= Display::return_icon('pdf.png', get_lang('Export'), '', ICON_SIZE_MEDIUM).''; $display_output = ''. Display::return_icon('exercice_uncheck.png', get_lang('ViewUsersWithoutTask'), '', ICON_SIZE_MEDIUM).""; $editLink = ''; $editLink .= Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_MEDIUM).''; $blockEdition = api_get_configuration_value('block_student_publication_edition'); if ($blockEdition && !api_is_platform_admin()) { $editLink = ''; } $actionsLeft .= $editLink; $count = get_count_work($workId); if ($count > 0) { $display_output .= ''. Display::return_icon('save_pack.png', get_lang('DownloadTasksPackage'), null, ICON_SIZE_MEDIUM).' '.get_lang('DownloadTasksPackage').''; } $actionsLeft .= $display_output; $url = api_get_path(WEB_CODE_PATH).'work/upload_corrections.php?'.api_get_cidreq().'&id='.$workId; $actionsLeft .= ''. Display::return_icon('upload_package.png', get_lang('UploadCorrectionsPackage'), '', ICON_SIZE_MEDIUM).' '.get_lang('UploadCorrectionsPackage').''; $url = api_get_path(WEB_CODE_PATH).'work/work_list_all.php?'.api_get_cidreq().'&id='.$workId.'&action=delete_correction'; $actionsLeft .= Display::toolbarButton(get_lang('DeleteCorrections'), $url, 'remove', 'danger'); } echo Display::toolbarAction('toolbar-worklist', [$actionsLeft]); $plagiarismListJqgridColumn = []; $plagiarismListJqgridLine = []; $allowAntiPlagiarism = api_get_configuration_value('allow_compilatio_tool'); if ($allowAntiPlagiarism) { $plagiarismListJqgridColumn = ['Compilatio']; $plagiarismListJqgridLine = [ [ 'name' => 'compilatio', 'index' => 'compilatio', 'width' => '40', 'align' => 'left', 'search' => 'false', 'sortable' => 'false', ], ]; } if (!empty($my_folder_data['title'])) { echo Display::page_subheader($my_folder_data['title']); } if (!empty($my_folder_data['description'])) { $contentWork = Security::remove_XSS($my_folder_data['description']); $html = ''; $html .= Display::panel($contentWork, get_lang('Description')); echo $html; } $check_qualification = (int) $my_folder_data['qualification']; $orderName = api_is_western_name_order() ? 'firstname' : 'lastname'; if (!empty($work_data['enable_qualification']) && !empty($check_qualification) ) { $type = 'simple'; $columns = [ get_lang('FullUserName'), get_lang('Title'), get_lang('Score'), get_lang('Date'), get_lang('Status'), get_lang('UploadCorrection'), ]; $columns = array_merge($columns, $plagiarismListJqgridColumn); $columns[] = get_lang('Actions'); $column_model = [ [ 'name' => 'fullname', 'index' => $orderName, 'width' => '30', 'align' => 'left', 'search' => 'true', ], [ 'name' => 'title', 'index' => 'title', 'width' => '25', 'align' => 'left', 'search' => 'false', 'wrap_cell' => 'true', ], [ 'name' => 'qualification', 'index' => 'qualification', 'width' => '15', 'align' => 'center', 'search' => 'true', ], [ 'name' => 'sent_date', 'index' => 'sent_date', 'width' => '25', 'align' => 'left', 'search' => 'true', 'wrap_cell' => 'true', ], [ 'name' => 'qualificator_id', 'index' => 'qualificator_id', 'width' => '20', 'align' => 'left', 'search' => 'true', ], [ 'name' => 'correction', 'index' => 'correction', 'width' => '30', 'align' => 'left', 'search' => 'false', 'sortable' => 'false', 'title' => 'false', ], ]; $column_model = array_merge($column_model, $plagiarismListJqgridLine); $column_model[] = [ 'name' => 'actions', 'index' => 'actions', 'width' => '25', 'align' => 'left', 'search' => 'false', 'sortable' => 'false', ]; } else { $type = 'complex'; $columns = [ get_lang('FullUserName'), get_lang('Title'), get_lang('Feedback'), get_lang('Date'), get_lang('UploadCorrection'), ]; $columns = array_merge($columns, $plagiarismListJqgridColumn); $columns[] = get_lang('Actions'); $column_model = [ [ 'name' => 'fullname', 'index' => $orderName, 'width' => '35', 'align' => 'left', 'search' => 'true', ], [ 'name' => 'title', 'index' => 'title', 'width' => '30', 'align' => 'left', 'search' => 'false', 'wrap_cell' => 'true', ], [ 'name' => 'qualification', 'index' => 'qualification', 'width' => '20', 'align' => 'center', 'search' => 'true', ], [ 'name' => 'sent_date', 'index' => 'sent_date', 'width' => '30', 'align' => 'left', 'search' => 'true', 'wrap_cell' => 'true', ], [ 'name' => 'correction', 'index' => 'correction', 'width' => '40', 'align' => 'left', 'search' => 'false', 'sortable' => 'false', 'title' => 'false', ], ]; $column_model = array_merge($column_model, $plagiarismListJqgridLine); $column_model[] = [ 'name' => 'actions', 'index' => 'actions', 'width' => '25', 'align' => 'left', 'search' => 'false', 'sortable' => 'false', ]; } $extra_params = [ 'autowidth' => 'true', 'height' => 'auto', 'sortname' => $orderName, 'sortable' => 'false', 'multiselect' => 'true', ]; $url = api_get_path(WEB_AJAX_PATH). 'model.ajax.php?a=get_work_user_list_all&work_id='.$workId.'&type='.$type.'&'.api_get_cidreq(); $workUrl = api_get_path(WEB_AJAX_PATH).'work.ajax.php?'.api_get_cidreq(); $deleteUrl = $workUrl.'&a=delete_student_work'; $showUrl = $workUrl.'&a=show_student_work'; $hideUrl = $workUrl.'&a=hide_student_work'; if ($allowAntiPlagiarism) { $extra_params['gridComplete'] = 'compilatioInit()'; } ?> '; echo '
'; $table = ''; Display::panel($table); echo '
'; $workTable = Database:: get_course_table(TABLE_STUDENT_PUBLICATION); $courseId = $courseInfo['real_id']; $formAction['analyseCompilatio'] = [ 'label' => get_lang('CompilatioStartAnalysis'), 'data-action' => get_lang('CompilatioStartAnalysis'), 'onClick' => "onclick='getMultiCompilatio()'", ]; $html = ''; echo $html; $compTable = Database::get_course_table(TABLE_PLAGIARISM); $listCompilatioDocId = []; $compilatioQuery = "SELECT * FROM $compTable WHERE c_id= $courseId"; $compilatioResult = Database::query($compilatioQuery); while ($compilatioData = Database::fetch_array($compilatioResult)) { array_push($listCompilatioDocId, $compilatioData['document_id']); } $javascriptWorkId = ''; $sql = "SELECT * FROM $workTable WHERE c_id= $courseId AND parent_id= $workId AND active = 1"; $res = Database::query($sql); while ($data = Database::fetch_array($res)) { if (in_array($data['id'], $listCompilatioDocId)) { $javascriptWorkId .= $data['id'].'a'; } } ?>