diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 05e2a432..22ba8e8b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,8 +5,6 @@ stages: - deploy before_script: - - apt-get update - - apt-get install zip unzip - cd api - php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" - php composer-setup.php @@ -24,9 +22,11 @@ deploy: when: manual stage: deploy script: + - apt-get update + - apt-get install zip unzip - composer install --no-dev - cd ../ci - bash build_zip.sh artifacts: paths: - - release.zip \ No newline at end of file + - release.zip diff --git a/README.md b/README.md index a53bd5d5..ea4cdd5d 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,6 @@ Mods for HESK is a set of modifications for [HESK](https://www.hesk.com) v2.7.x,
  • Custom service message icons
  • Permission templates
  • Request users location in tickets
  • -
  • Category managers
  • Show number of merged tickets in ticket search view
  • Enable / disable staff members
  • More-restricted settings page access
  • diff --git a/admin/admin_reply_ticket.php b/admin/admin_reply_ticket.php index 96ab9f9f..aa373e96 100644 --- a/admin/admin_reply_ticket.php +++ b/admin/admin_reply_ticket.php @@ -39,9 +39,7 @@ hesk_dbConnect(); hesk_isLoggedIn(); /* Check permissions for this feature */ -if (!isset($_REQUEST['isManager']) || !$_REQUEST['isManager']) { - hesk_checkPermission('can_reply_tickets'); -} +hesk_checkPermission('can_reply_tickets'); /* A security check */ # hesk_token_check('POST'); @@ -281,7 +279,7 @@ if ($time_worked == '00:00:00') { $sql .= ",`time_worked` = ADDTIME(`time_worked`,'" . hesk_dbEscape($time_worked) . "') "; } -if (!empty($_POST['assign_self']) && (hesk_checkPermission('can_assign_self', 0) || (isset($_REQUEST['isManager']) && $_REQUEST['isManager']))) { +if (!empty($_POST['assign_self']) && (hesk_checkPermission('can_assign_self', 0))) { $revision = sprintf($hesklang['thist2'], hesk_date(), $_SESSION['name'] . ' (' . $_SESSION['user'] . ')', $_SESSION['name'] . ' (' . $_SESSION['user'] . ')'); $sql .= " , `owner`=" . intval($_SESSION['id']) . ", `history`=CONCAT(`history`,'" . hesk_dbEscape($revision) . "') "; } diff --git a/admin/admin_ticket.php b/admin/admin_ticket.php index 899d37e6..3f7dfbf5 100644 --- a/admin/admin_ticket.php +++ b/admin/admin_ticket.php @@ -107,33 +107,14 @@ if ($ticket['lastreplier']) { } /* Get category name and ID */ -$result = hesk_dbQuery("SELECT `id`, `name`, `manager` FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "categories` WHERE `id`='" . intval($ticket['category']) . "' LIMIT 1"); +$result = hesk_dbQuery("SELECT `id`, `name` FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "categories` WHERE `id`='" . intval($ticket['category']) . "' LIMIT 1"); /* If this category has been deleted use the default category with ID 1 */ if (hesk_dbNumRows($result) != 1) { - $result = hesk_dbQuery("SELECT `id`, `name`, `manager` FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "categories` WHERE `id`='1' LIMIT 1"); + $result = hesk_dbQuery("SELECT `id`, `name` FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "categories` WHERE `id`='1' LIMIT 1"); } $category = hesk_dbFetchAssoc($result); -$managerRS = hesk_dbQuery('SELECT * FROM `' . hesk_dbEscape($hesk_settings['db_pfix']) . 'users` WHERE `id` = ' . intval($_SESSION['id'])); -$managerRow = hesk_dbFetchAssoc($managerRS); -$isManager = $managerRow['id'] == $category['manager']; -if ($isManager) { - $can_del_notes = - $can_reply = - $can_delete = - $can_edit = - $can_archive = - $can_assign_self = - $can_view_unassigned = - $can_change_own_cat = - $can_change_cat = - $can_ban_emails = - $can_unban_emails = - $can_ban_ips = - $can_unban_ips = - $can_resolve = true; -} /* Is this user allowed to view tickets inside this category? */ hesk_okCategory($category['id']); @@ -973,9 +954,6 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php'); '; - if ($isManager) { - echo ''; - } echo ' @@ -999,15 +977,12 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php'); '; - if ($isManager) { - echo ''; - } echo ' '; echo '

    ' . $hesklang['owner'] . '

    '; - if (hesk_checkPermission('can_assign_others', 0) || $isManager) { + if (hesk_checkPermission('can_assign_others', 0)) { echo '
    @@ -1250,15 +1225,14 @@ require_once(HESK_PATH . 'inc/footer.inc.php'); function hesk_getAdminButtons($category_id) { - global $hesk_settings, $hesklang, $modsForHesk_settings, $ticket, $reply, $trackingID, $can_edit, $can_archive, $can_delete, $can_resolve, $isManager; + global $hesk_settings, $hesklang, $modsForHesk_settings, $ticket, $reply, $trackingID, $can_edit, $can_archive, $can_delete, $can_resolve; $options = ''; /* Edit post */ if ($can_edit) { $tmp = $reply ? '&reply=' . $reply['id'] : ''; - $mgr = $isManager ? '&isManager=true' : ''; - $options .= ' ' . $hesklang['edit'] . ' '; + $options .= ' ' . $hesklang['edit'] . ' '; } @@ -1304,13 +1278,12 @@ function hesk_getAdminButtons($category_id) $isTicketClosed = $isTicketClosedRow['IsClosed']; $isClosable = $isTicketClosedRow['Closable'] == 'yes' || $isTicketClosedRow['Closable'] == 'sonly'; - $mgr = $isManager ? '&isManager=1' : ''; if ($isTicketClosed == 0 && $isClosable && $can_resolve) // Ticket is still open { - $options .= ' + $options .= ' ' . $hesklang['close_action'] . ' '; } elseif ($isTicketClosed == 1) { - $options .= ' + $options .= ' ' . $hesklang['open_action'] . ' '; } @@ -1496,7 +1469,7 @@ function hesk_getAdminButtons($category_id) function hesk_getAdminButtonsInTicket($reply = 0, $white = 1) { - global $hesk_settings, $hesklang, $ticket, $reply, $trackingID, $can_edit, $can_archive, $can_delete, $isManager; + global $hesk_settings, $hesklang, $ticket, $reply, $trackingID, $can_edit, $can_archive, $can_delete; $options = $reply ? '' : '
    '; @@ -1519,8 +1492,7 @@ function hesk_getAdminButtonsInTicket($reply = 0, $white = 1) /* Edit post */ if ($can_edit) { $tmp = $reply ? '&reply=' . $reply['id'] : ''; - $mgr = $isManager ? '&isManager=true' : ''; - $options .= ' ' . $hesklang['edtt'] . ' '; + $options .= ' ' . $hesklang['edtt'] . ' '; } @@ -1834,7 +1806,7 @@ function hesk_printTicketReplies() function hesk_printReplyForm() { - global $hesklang, $hesk_settings, $ticket, $admins, $can_options, $can_resolve, $options, $can_assign_self, $isManager, $modsForHesk_settings; + global $hesklang, $hesk_settings, $ticket, $admins, $can_options, $can_resolve, $options, $can_assign_self, $modsForHesk_settings; // Force assigning a ticket before allowing to reply? if ($hesk_settings['require_owner'] && ! $ticket['owner']) @@ -2056,9 +2028,6 @@ function hesk_printReplyForm()
    - - -
    diff --git a/admin/change_status.php b/admin/change_status.php index 42d002f1..d1d6551a 100644 --- a/admin/change_status.php +++ b/admin/change_status.php @@ -26,10 +26,8 @@ hesk_isLoggedIn(); $modsForHesk_settings = mfh_getSettings(); /* Check permissions for this feature */ -if (!isset($_REQUEST['isManager']) || !$_REQUEST['isManager']) { - hesk_checkPermission('can_view_tickets'); - hesk_checkPermission('can_reply_tickets'); -} +hesk_checkPermission('can_view_tickets'); +hesk_checkPermission('can_reply_tickets'); /* A security check */ hesk_token_check(); diff --git a/admin/edit_post.php b/admin/edit_post.php index ee3a9e19..7dcdda44 100644 --- a/admin/edit_post.php +++ b/admin/edit_post.php @@ -32,10 +32,8 @@ hesk_dbConnect(); hesk_isLoggedIn(); /* Check permissions for this feature */ -if (!isset($_REQUEST['isManager']) || !$_REQUEST['isManager']) { - hesk_checkPermission('can_view_tickets'); - hesk_checkPermission('can_edit_tickets'); -} +hesk_checkPermission('can_view_tickets'); +hesk_checkPermission('can_edit_tickets'); $modsForHesk_settings = mfh_getSettings(); /* Ticket ID */ @@ -61,9 +59,7 @@ if (defined('HESK_DEMO')) { } /* Is this user allowed to view tickets inside this category? */ -if (!isset($_REQUEST['isManager']) || !$_REQUEST['isManager']) { - hesk_okCategory($ticket['category']); -} +hesk_okCategory($ticket['category']); if (hesk_isREQUEST('reply')) { $tmpvar['id'] = intval(hesk_REQUEST('reply')) or die($hesklang['id_not_valid']); @@ -630,9 +626,6 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php'); ?> - - - diff --git a/admin/manage_categories.php b/admin/manage_categories.php index c90aebc8..6ddce2d4 100644 --- a/admin/manage_categories.php +++ b/admin/manage_categories.php @@ -16,6 +16,7 @@ define('HESK_PATH', '../'); define('VALIDATOR', 1); define('PAGE_TITLE', 'ADMIN_CATEGORIES'); define('MFH_PAGE_LAYOUT', 'TOP_ONLY'); +define('EXTRA_JS', ''); /* Get all the required files and functions */ require(HESK_PATH . 'hesk_settings.inc.php'); @@ -84,349 +85,84 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php'); ' . $mycat['name'] . ''; -} ?>
    -
    -
    -

    - -

    -
    - -
    -
    -
    -
    -
    - - -
    - - data-error="" - required> -
    -
    -
    -
    -
    - - -
    - - -
    -
    -
    - -
    - -
    -
    -
    -
    - -
    - -
    -
    -
    - -
    -
    - -
        -
    - -
    -
    -
    -
    - -
    - -
    -
    -
    - - -
    - -
    -
    -
    - -
    - -
    -
    -
    -
    -
    - - - -
    +
    +
    +

    + +

    +
    +
    - -
    -
    -
    -
    -

    - -

    -
    -
    -
    -
    - - - - - - - - - - - - - +
    ' - ', - 1 => '', - 2 => '  ' - ); - - while ($mycat = hesk_dbFetchAssoc($res)) { - $j++; - - if (isset($_SESSION['selcat2']) && $mycat['id'] == $_SESSION['selcat2']) { - $color = 'admin_green'; - unset($_SESSION['selcat2']); - } else { - $color = $i ? 'admin_white' : 'admin_gray'; - } - - $tmp = $i ? 'White' : 'Blue'; - $style = 'background: ' . $mycat['background_color']; - $backgroundVolatile = 'background-volatile'; - if ($mycat['foreground_color'] != 'AUTO') { - $style .= '; color: ' . $mycat['foreground_color']; - $backgroundVolatile = ''; - - if ($mycat['display_border_outline']) { - $style .= '; border: solid 1px ' . $mycat['foreground_color']; - } - } - - if ($mycat['foreground_color'] == 'AUTO') { - $mycat['foreground_color'] = ''; - } - - $i = $i ? 0 : 1; - - /* Number of tickets and graph width */ - $all = isset($tickets_all[$mycat['id']]) ? $tickets_all[$mycat['id']] : 0; - $width_all = 0; - if ($tickets_total && $all) { - $width_all = round(($all / $tickets_total) * 100); - } - - /* Deleting category with ID 1 (default category) is not allowed */ - if ($mycat['id'] == 1) { - $remove_code = ' '; - } else { - $remove_code = ' '; - } - - /* Is category private or public? */ - if ($mycat['type']) { - $type_code = ''; - } else { - $type_code = ''; - } - - /* Is auto assign enabled? */ - if ($hesk_settings['autoassign']) { - if ($mycat['autoassign']) { - $autoassign_code = ''; - } else { - $autoassign_code = ''; - } - } else { - $autoassign_code = ''; - } - - echo ' -
    - - - - - - - - - - '; - - } // End while - ?> -
    ' . $mycat['id'] . '' . $mycat['name'] . '' . $priorities[$mycat['priority']]['formatted'] . '' . $all . ' -
    -
    -
    -
    -
    ' . $usage[$mycat['usage']] . '' . get_manager($mycat['manager'], $users) . ' - - ' . $autoassign_code . ' - ' . $type_code . ' '; - - if ($orderBy != 'name' && $num > 1) { - if ($j == 1) { - echo '  '; - } elseif ($j == $num) { - echo ' '; - } else { - echo ' - -   - '; - } - } - echo ''; - echo $remove_code . '
    +
    +
    + +
    +
    + + + + + + + + + + + + + + + + +
    +
    +
    +
    +
    + +
    -
    -
    +
    - -