Add setting "block_student_publication_add_documents" BT#14986

Block "add documents" in student publication feature
pull/2729/head
Julio Montoya 7 years ago
parent c8980da9bd
commit 501dcbe38a
  1. 3
      main/install/configuration.dist.php
  2. 5
      main/work/add_document.php
  3. 7
      main/work/work_list_all.php

@ -978,6 +978,9 @@ VALUES (2, 13, 'session_courses_read_only_mode', 'Lock Course In Session', 1, 1,
// Block student publication edition BT#14985
// $_configuration['block_student_publication_edition'] = false;
// Block student publication add documents BT#14986
//$_configuration['block_student_publication_add_documents'] = false;
// Enable system to manage e-mail templates in users registration forms
/*CREATE TABLE mail_template(
id int not null primary key auto_increment,

@ -14,6 +14,11 @@ if (empty($workId)) {
api_not_allowed(true);
}
$blockAddDocuments = api_get_configuration_value('block_student_publication_add_documents');
if ($blockAddDocuments) {
api_not_allowed(true);
}
$my_folder_data = get_work_data_by_id($workId);
if (empty($my_folder_data)) {
api_not_allowed(true);

@ -169,8 +169,11 @@ $actionsLeft = '<a href="'.api_get_path(WEB_CODE_PATH).'work/work.php?'.api_get_
Display::return_icon('back.png', get_lang('BackToWorksList'), '', ICON_SIZE_MEDIUM).'</a>';
if (api_is_allowed_to_session_edit(false, true) && !empty($workId) && !$isDrhOfCourse) {
$actionsLeft .= '<a href="'.api_get_path(WEB_CODE_PATH).'work/add_document.php?'.api_get_cidreq().'&id='.$workId.'">';
$actionsLeft .= Display::return_icon('new_document.png', get_lang('AddDocument'), '', ICON_SIZE_MEDIUM).'</a>';
$blockAddDocuments = api_get_configuration_value('block_student_publication_add_documents');
if (!$blockAddDocuments) {
$actionsLeft .= '<a href="'.api_get_path(WEB_CODE_PATH).'work/add_document.php?'.api_get_cidreq().'&id='.$workId.'">';
$actionsLeft .= Display::return_icon('new_document.png', get_lang('AddDocument'), '', ICON_SIZE_MEDIUM).'</a>';
}
$actionsLeft .= '<a href="'.api_get_path(WEB_CODE_PATH).'work/add_user.php?'.api_get_cidreq().'&id='.$workId.'">';
$actionsLeft .= Display::return_icon('addworkuser.png', get_lang('AddUsers'), '', ICON_SIZE_MEDIUM).'</a>';

Loading…
Cancel
Save