Browse Source

Minor - Fix block edit link BT#14985

Julio Montoya 6 years ago
parent
commit
357ba56b85
1 changed files with 9 additions and 2 deletions
  1. 9 2
      main/work/work_list_all.php

+ 9 - 2
main/work/work_list_all.php

@@ -170,6 +170,7 @@ $actionsLeft = '<a href="'.api_get_path(WEB_CODE_PATH).'work/work.php?'.api_get_
 
 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 .= '<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>';
@@ -184,8 +185,14 @@ if (api_is_allowed_to_session_edit(false, true) && !empty($workId) && !$isDrhOfC
     $display_output = '<a href="'.api_get_path(WEB_CODE_PATH).'work/work_missing.php?'.api_get_cidreq().'&amp;id='.$workId.'&amp;list=without">'.
     Display::return_icon('exercice_uncheck.png', get_lang('ViewUsersWithoutTask'), '', ICON_SIZE_MEDIUM)."</a>";
 
-    $actionsLeft .= '<a href="'.api_get_path(WEB_CODE_PATH).'work/edit_work.php?'.api_get_cidreq().'&id='.$workId.'">';
-    $actionsLeft .= Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_MEDIUM).'</a>';
+    $editLink = '<a href="'.api_get_path(WEB_CODE_PATH).'work/edit_work.php?'.api_get_cidreq().'&id='.$workId.'">';
+    $editLink .= Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_MEDIUM).'</a>';
+
+    $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) {