diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 37f3f099..e174429b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -21,8 +21,8 @@ If you have already completed any of these steps in the past (such as creating a - Check for unnecessary whitespace using the `git diff --check` command. If there is trailing whitespace, your pull request will be denied. ## Submitting Changes - - Sign the [Contributor License Agreement](https://www.clahub.com/agreements/mkoch227/Mods-for-HESK) - Push your changes to a topic branch in your fork of the repository - Submit a pull request to the official Mods for HESK repository (mkoch227/Mods-for-HESK) + - If necessary, sign the Contributor License Agreement by checking the "status checks" area of your pull request. - The owner of Mods for HESK will then inspect and test the code in the pull request. Feedback will be given via GitHub comments. - The owner of Mods for HESK expects responses within two weeks of the original comment. If there is no feedback within that time range, the pull request will be considered abandoned and subsequently will be closed. diff --git a/README.md b/README.md index 9b2e2897..bb7aa473 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ -## [Mods for HESK](http://mods-for-hesk.mkochcs.com) [![Number of Downloads](https://img.shields.io/github/downloads/mkoch227/Mods-for-HESK/latest/total.svg)](https://www.github.com/mkoch227/Mods-for-HESK/releases) [![Open Issues](https://img.shields.io/github/issues-raw/mkoch227/Mods-for-HESK.svg)](https://www.github.com/mkoch227/Mods-for-HESK/issues) [![Current Release](https://img.shields.io/github/release/mkoch227/Mods-for-HESK.svg)](https://www.github.com/mkoch227/Mods-for-HESK/releases) [![Project Status](http://stillmaintained.com/mkoch227/Mods-for-HESK.png)](https://www.github.com/mkoch227/Mods-for-HESK) +## [Mods for HESK](http://mods-for-hesk.mkochcs.com) [![Number of Downloads](https://img.shields.io/github/downloads/mkoch227/Mods-for-HESK/latest/total.svg)](https://www.github.com/mkoch227/Mods-for-HESK/releases) [![Open Issues](https://img.shields.io/github/issues-raw/mkoch227/Mods-for-HESK.svg)](https://www.github.com/mkoch227/Mods-for-HESK/issues) [![Current Release](https://img.shields.io/github/release/mkoch227/Mods-for-HESK.svg)](https://www.github.com/mkoch227/Mods-for-HESK/releases) [![Project Status](https://img.shields.io/badge/status-maintained-brightgreen.svg)](https://www.github.com/mkoch227/Mods-for-HESK) [![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/mkoch227/Mods-for-HESK/blob/master/LICENSE) [![Join the chat at https://gitter.im/mkoch227/Mods-for-HESK](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/mkoch227/Mods-for-HESK?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) -Mods for HESK is a set of modifications for [HESK](http://www.hesk.com) v2.6.5, a free and popular helpdesk solution. +Mods for HESK is a set of modifications for [HESK](http://www.hesk.com) v2.6.x, a free and popular helpdesk solution. ## Features diff --git a/admin/admin_main.php b/admin/admin_main.php index ea556516..8a6a4141 100644 --- a/admin/admin_main.php +++ b/admin/admin_main.php @@ -1,7 +1,7 @@
- diff --git a/admin/admin_settings_save.php b/admin/admin_settings_save.php index 5df75af1..d0a30b47 100644 --- a/admin/admin_settings_save.php +++ b/admin/admin_settings_save.php @@ -1,7 +1,7 @@ 1) ? $tmp : 1; /* List of private messages */ diff --git a/admin/manage_canned.php b/admin/manage_canned.php index 466c836a..b96ee0e9 100644 --- a/admin/manage_canned.php +++ b/admin/manage_canned.php @@ -1,7 +1,7 @@


+

'; - } + for ($i=1;$i<=$hesk_settings['attachments']['max_number'];$i++) + { + echo '
'; + } ?>
- +
@@ -1136,30 +1147,34 @@ function save_article() /* Article attachments */ define('KB',1); require_once(HESK_PATH . 'inc/posting_functions.inc.php'); - require_once(HESK_PATH . 'inc/attachments.inc.php'); $attachments = array(); $use_legacy_attachments = hesk_POST('use-legacy-attachments', 0); - - if ($use_legacy_attachments) { - for ($i=1;$i<=3;$i++) { - $att = hesk_uploadFile($i, false); - if ( ! empty($att)) { - $attachments[$i] = $att; - } - } - } else { - // The user used the new drag-and-drop system. - $temp_attachment_ids = hesk_POST_array('attachment-ids'); - foreach ($temp_attachment_ids as $temp_attachment_id) { - // Simply get the temp info and move it to the attachments table - $temp_attachment = mfh_getTemporaryAttachment($temp_attachment_id); - $attachments[] = $temp_attachment; - mfh_deleteTemporaryAttachment($temp_attachment_id); - } - } - $myattachments=''; + if ($hesk_settings['attachments']['use']) { + require_once(HESK_PATH . 'inc/attachments.inc.php'); + + if ($use_legacy_attachments) { + for ($i=1; $i<=$hesk_settings['attachments']['max_number']; $i++) + { + $att = hesk_uploadFile($i); + if ( ! empty($att)) + { + $attachments[$i] = $att; + } + } + } else { + // The user used the new drag-and-drop system. + $temp_attachment_ids = hesk_POST_array('attachment-ids'); + foreach ($temp_attachment_ids as $temp_attachment_id) { + // Simply get the temp info and move it to the attachments table + $temp_attachment = mfh_getTemporaryAttachment($temp_attachment_id); + $attachments[] = $temp_attachment; + mfh_deleteTemporaryAttachment($temp_attachment_id); + } + } + } + /* Any errors? */ if (count($hesk_error_buffer)) { @@ -1468,10 +1483,11 @@ function edit_article()


+

'; - } + // New attachments + if ($hesk_settings['attachments']['use']) + { + for ($i=1;$i<=$hesk_settings['attachments']['max_number'];$i++) + { + echo '
'; + } + } ?>
+ + ?> + + +
@@ -1983,33 +2009,33 @@ function new_article() /* Article attachments */ define('KB',1); require_once(HESK_PATH . 'inc/posting_functions.inc.php'); - require_once(HESK_PATH . 'inc/attachments.inc.php'); $attachments = array(); - $use_legacy_attachments = hesk_POST('use-legacy-attachments', 0); - - if ($use_legacy_attachments) { - for ($i=1; $i<=3; $i++) - { - $att = hesk_uploadFile($i, false); - if ( ! empty($att)) - { - $attachments[$i] = $att; - } - } - } else { - // The user used the new drag-and-drop system. - $temp_attachment_ids = hesk_POST_array('attachment-ids'); - foreach ($temp_attachment_ids as $temp_attachment_id) { - // Simply get the temp info and move it to the attachments table - $temp_attachment = mfh_getTemporaryAttachment($temp_attachment_id); - $attachments[] = $temp_attachment; - mfh_deleteTemporaryAttachment($temp_attachment_id); - } - } - $myattachments=''; + if ($hesk_settings['attachments']['use']) { + require_once(HESK_PATH . 'inc/attachments.inc.php'); + if ($use_legacy_attachments) { + for ($i=1; $i<=$hesk_settings['attachments']['max_number']; $i++) + { + $att = hesk_uploadFile($i); + if ( ! empty($att)) + { + $attachments[$i] = $att; + } + } + } else { + // The user used the new drag-and-drop system. + $temp_attachment_ids = hesk_POST_array('attachment-ids'); + foreach ($temp_attachment_ids as $temp_attachment_id) { + // Simply get the temp info and move it to the attachments table + $temp_attachment = mfh_getTemporaryAttachment($temp_attachment_id); + $attachments[] = $temp_attachment; + mfh_deleteTemporaryAttachment($temp_attachment_id); + } + } + } + /* Any errors? */ if (count($hesk_error_buffer)) { diff --git a/admin/manage_permission_templates.php b/admin/manage_permission_templates.php index a6950ad0..a802152c 100644 --- a/admin/manage_permission_templates.php +++ b/admin/manage_permission_templates.php @@ -1,7 +1,7 @@ 255) { + if (strlen($myuser['signature']) > 1000) { $hesk_error_buffer .= '
  • ' . $hesklang['signature_long'] . '
  • '; } diff --git a/admin/new_ticket.php b/admin/new_ticket.php index 2054f833..89157377 100644 --- a/admin/new_ticket.php +++ b/admin/new_ticket.php @@ -1,7 +1,7 @@ 255) { + if (strlen($_SESSION['new']['signature']) > 1000) { $hesk_error_buffer .= '
  • ' . $hesklang['signature_long'] . '
  • '; } diff --git a/admin/reports.php b/admin/reports.php index 1324d06e..c69568bc 100644 --- a/admin/reports.php +++ b/admin/reports.php @@ -1,7 +1,7 @@
    + data-sitekey=""> +
     
    ' . $hesklang['sec_img'] . ' ' . '' . $hesklang['reload'] . '' . - '
     
    '; + '
     
    '; } - echo ''; + echo ''; } ?> diff --git a/install/install.php b/install/install.php index 439916e7..e1d186e2 100644 --- a/install/install.php +++ b/install/install.php @@ -1,7 +1,7 @@ 'Pre-1.4.0', + 3 => '1.4.0', + 4 => '1.4.1', + 5 => '1.5.0', + 6 => '1.6.0', + 7 => '1.6.1', + 8 => '1.7.0', + 9 => '2.0.0', + 10 => '2.0.1', + 11 => '2.1.0', + 12 => '2.1.1', + 13 => '2.2.0', + 14 => '2.2.1', + 15 => '2.3.0', + 16 => '2.3.1', + 17 => '2.3.2', + 18 => '2.4.0', + 19 => '2.4.1', + 20 => '2.4.2', + 21 => '2.5.0', + 22 => '2.5.1', + 23 => '2.5.2', + 24 => '2.5.3', + 25 => '2.5.4', + 26 => '2.5.5', +); + +function echoInitialVersionRows($version, $build_to_version_map) { - if ($version < 2) { - printRow('Pre-1.4.0'); - } - if ($version < 3) { - printRow('1.4.0'); - } - if ($version < 4) { - printRow('1.4.1'); - } - if ($version < 5) { - printRow('1.5.0'); - } - if ($version < 6) { - printRow('1.6.0'); - } - if ($version < 7) { - printRow('1.6.1'); - } - if ($version < 8) { - printRow('1.7.0'); - } - if ($version < 9) { - printRow('2.0.0'); - } - if ($version < 10) { - printRow('2.0.1'); - } - if ($version < 11) { - printRow('2.1.0'); - } - if ($version < 12) { - printRow('2.1.1'); - } - if ($version < 13) { - printRow('2.2.0'); - } - if ($version < 14) { - printRow('2.2.1'); - } - if ($version < 15) { - printRow('2.3.0'); - } - if ($version < 16) { - printRow('2.3.1'); - } - if ($version < 17) { - printRow('2.3.2'); - } - if ($version < 18) { - printRow('2.4.0'); - } - if ($version < 19) { - printRow('2.4.1'); - } - if ($version < 20) { - printRow('2.4.2'); - } - if ($version < 21) { - printRow('2.5.0'); - } - if ($version < 22) { - printRow('2.5.1'); - } - if ($version < 23) { - printRow('2.5.2'); + foreach ($build_to_version_map as $build => $display_text) { + if ($version < $build) { + printRow($display_text); + } } } @@ -130,7 +97,7 @@ function printRow($version) - +
    diff --git a/install/mods-for-hesk/js/version-scripts.js b/install/mods-for-hesk/js/version-scripts.js index 424ef110..5a6369a7 100644 --- a/install/mods-for-hesk/js/version-scripts.js +++ b/install/mods-for-hesk/js/version-scripts.js @@ -65,6 +65,15 @@ function processUpdates(startingVersion) { } else if (startingVersion < 23) { startVersionUpgrade('252'); executeUpdate(23, '252', '2.5.2'); + } else if (startingVersion < 24) { + startVersionUpgrade('253'); + executeUpdate(24, '253', '2.5.3'); + } else if (startingVersion < 25) { + startVersionUpgrade('254'); + executeUpdate(25, '254', '2.5.4'); + } else if (startingVersion < 26) { + startVersionUpgrade('255'); + executeUpdate(26, '255', '2.5.5'); } else { installationFinished(); } diff --git a/install/mods-for-hesk/modsForHesk.php b/install/mods-for-hesk/modsForHesk.php index 712de220..d3fa7e53 100644 --- a/install/mods-for-hesk/modsForHesk.php +++ b/install/mods-for-hesk/modsForHesk.php @@ -119,10 +119,10 @@ hesk_dbConnect();

    What version of Mods for HESK do you currently have installed?


    '; echo '
    '; - echo '

    Mods for HESK has detected that you currently have ' . $version . ' installed. + echo '

    Mods for HESK has detected that you currently have version ' . $version . ' installed. The button you should click to upgrade has been highlighted for you. However, if Mods for HESK selected the wrong version, click here to reset them.

    '; echo '
    '; @@ -130,6 +130,42 @@ hesk_dbConnect(); } ?>
    +
    + + 2.5.4 +
    +
    + + 2.5.3 +
    +
    + + 2.5.2 +
    btn-block disablable" href="installModsForHesk.php?v=22">2.5.1
    +
    +
    + +
    btn-block disablable" href="installModsForHesk.php?v=19">2.4.1
    -
    -
    - -
    btn-block disablable" href="installModsForHesk.php?v=18">2.4.0
    +
    +
    + +
    btn-block disablable" href="installModsForHesk.php?v=15">2.3.0
    -
    -
    - -
    btn-block disablable" href="installModsForHesk.php?v=14">2.2.1
    +
    +
    + +
    btn-block disablable" href="installModsForHesk.php?v=11">2.1.0
    -
    -
    - -
    btn-block disablable" href="installModsForHesk.php?v=10">2.0.1
    +
    +
    + +
    btn-block disablable" href="installModsForHesk.php?v=7">1.6.1
    -
    -
    - -
    btn-block disablable" href="installModsForHesk.php?v=6">1.6.0
    +
    +
    + +
    1.5.0 @@ -363,14 +403,14 @@ hesk_dbConnect(); 1.4.0
    -
    -
    - -
    1.3.0
    +
    +
    + +
    1.2.4 diff --git a/install/mods-for-hesk/sql/installSql.php b/install/mods-for-hesk/sql/installSql.php index 831f9bec..4624ed78 100644 --- a/install/mods-for-hesk/sql/installSql.php +++ b/install/mods-for-hesk/sql/installSql.php @@ -695,12 +695,44 @@ function execute252Scripts() executeQuery("UPDATE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "settings` SET `Value` = '2.5.2' WHERE `Key` = 'modsForHeskVersion'"); } +// Version 2.5.3 +function execute253Scripts() +{ + global $hesk_settings; + hesk_dbConnect(); + + executeQuery("UPDATE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "settings` SET `Value` = '2.5.3' WHERE `Key` = 'modsForHeskVersion'"); +} + +// Version 2.5.4 +function execute254Scripts() +{ + global $hesk_settings; + hesk_dbConnect(); + + executeQuery("UPDATE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "settings` SET `Value` = '2.5.4' WHERE `Key` = 'modsForHeskVersion'"); +} + +// Version 2.5.5 +function execute255Scripts() +{ + updateVersion('2.5.5'); +} + +function updateVersion($version) { + global $hesk_settings; + + hesk_dbConnect(); + + executeQuery("UPDATE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "settings` SET `Value` = '{$version}' WHERE `Key` = 'modsForHeskVersion'"); +} + // Version 2.6.0 function execute260Scripts() { global $hesk_settings; hesk_dbConnect(); - + executeQuery("INSERT INTO `" . hesk_dbEscape($hesk_settings['db_pfix']) . "settings` (`Key`, `Value`) VALUES ('public_api', '1')"); executeQuery("CREATE TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "logging` ( `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY, diff --git a/knowledgebase.php b/knowledgebase.php index daedd989..c8fd3ebc 100644 --- a/knowledgebase.php +++ b/knowledgebase.php @@ -1,7 +1,7 @@
    '; - hesk_process_messages($hesk_error_buffer, 'ticket.php?track=' . $trackingID . $hesk_settings['e_param'] . '&Refresh=' . rand(10000, 99999)); + hesk_process_messages($hesk_error_buffer,'ticket.php'); } // Check if this IP is temporarily locked out @@ -155,7 +159,7 @@ hesk_verifyEmailMatch($trackingID, $my_email, $ticket['email']); /* Ticket locked? */ if ($ticket['locked']) { - hesk_process_messages($hesklang['tislock2'], 'ticket.php?track=' . $trackingID . $hesk_settings['e_param'] . '&Refresh=' . rand(10000, 99999)); + hesk_process_messages($hesklang['tislock2'],'ticket.php'); exit(); } @@ -239,6 +243,5 @@ else { hesk_cleanSessionVars('ticket_message'); /* Show the ticket and the success message */ -hesk_process_messages($hesklang['reply_submitted_success'], 'ticket.php?track=' . $trackingID . $hesk_settings['e_param'] . '&Refresh=' . rand(10000, 99999), 'SUCCESS'); +hesk_process_messages($hesklang['reply_submitted_success'],'ticket.php','SUCCESS'); exit(); -?> diff --git a/submit_ticket.php b/submit_ticket.php index fb9e18af..25f8920b 100644 --- a/submit_ticket.php +++ b/submit_ticket.php @@ -1,7 +1,7 @@
    -
    +