Browse Source

Fix add ticket button when "ticket_allow_student_add" setting is on

BT#13392
jmontoyaa 7 years ago
parent
commit
9960e32962
1 changed files with 5 additions and 2 deletions
  1. 5 2
      main/ticket/tickets.php

+ 5 - 2
main/ticket/tickets.php

@@ -228,7 +228,8 @@ if (!empty($projectId)) {
         )
     );
 
-    if (api_is_platform_admin()) {
+    // Add link
+    if (api_get_setting('ticket_allow_student_add') == 'true' || api_is_platform_admin()) {
         $actionRight = Display::url(
             Display::return_icon(
                 'add.png',
@@ -236,10 +237,12 @@ if (!empty($projectId)) {
                 null,
                 ICON_SIZE_MEDIUM
             ),
-            api_get_path(WEB_CODE_PATH).'ticket/new_ticket.php?project_id='.$projectId,
+            api_get_path(WEB_CODE_PATH) . 'ticket/new_ticket.php?project_id=' . $projectId,
             ['title' => get_lang('Add')]
         );
+    }
 
+    if (api_is_platform_admin()) {
         $actionRight .= Display::url(
             Display::return_icon(
                 'export_excel.png',