From a4de4886d9fb5dea64ce633fd996953bc356fa25 Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Tue, 2 Feb 2016 13:01:51 -0500 Subject: [PATCH 1/7] #471 Update knowledgebase for 2.6.6 --- admin/manage_knowledgebase.php | 85 +++++++++++++++++++++++----------- 1 file changed, 57 insertions(+), 28 deletions(-) diff --git a/admin/manage_knowledgebase.php b/admin/manage_knowledgebase.php index 44162e0b..250e4ba2 100644 --- a/admin/manage_knowledgebase.php +++ b/admin/manage_knowledgebase.php @@ -1,7 +1,7 @@


+
-
-
- +
'; + } + ?>
+
@@ -1127,18 +1138,23 @@ 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(); - for ($i=1;$i<=3;$i++) - { - $att = hesk_uploadFile($i, false); - if ( ! empty($att)) - { - $attachments[$i] = $att; - } - } $myattachments=''; + if ($hesk_settings['attachments']['use']) + { + require_once(HESK_PATH . 'inc/attachments.inc.php'); + + for ($i=1; $i<=$hesk_settings['attachments']['max_number']; $i++) + { + $att = hesk_uploadFile($i); + if ( ! empty($att)) + { + $attachments[$i] = $att; + } + } + } + /* Any errors? */ if (count($hesk_error_buffer)) { @@ -1447,10 +1463,11 @@ function edit_article()


+
'; } - ?> - -
-
- + // New attachments + if ($hesk_settings['attachments']['use']) + { + for ($i=1;$i<=$hesk_settings['attachments']['max_number'];$i++) + { + echo '
'; + } + } + ?> +
+ +
@@ -1952,18 +1976,23 @@ 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(); - for ($i=1;$i<=3;$i++) - { - $att = hesk_uploadFile($i, false); - if ( ! empty($att)) - { - $attachments[$i] = $att; - } - } $myattachments=''; + if ($hesk_settings['attachments']['use']) + { + require_once(HESK_PATH . 'inc/attachments.inc.php'); + + for ($i=1; $i<=$hesk_settings['attachments']['max_number']; $i++) + { + $att = hesk_uploadFile($i); + if ( ! empty($att)) + { + $attachments[$i] = $att; + } + } + } + /* Any errors? */ if (count($hesk_error_buffer)) { From c54aeb6fa0414b648c85bcd9160364e316e85cac Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Tue, 2 Feb 2016 13:03:02 -0500 Subject: [PATCH 2/7] #471 Update download_attachment for 2.6.6 --- download_attachment.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/download_attachment.php b/download_attachment.php index 59ec5758..ec265e4d 100755 --- a/download_attachment.php +++ b/download_attachment.php @@ -1,7 +1,7 @@ Date: Tue, 2 Feb 2016 13:06:48 -0500 Subject: [PATCH 3/7] #471 Update common to 2.6.6 --- inc/common.inc.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inc/common.inc.php b/inc/common.inc.php index 90dbf58e..54d53595 100644 --- a/inc/common.inc.php +++ b/inc/common.inc.php @@ -1,7 +1,7 @@ Date: Tue, 2 Feb 2016 13:09:41 -0500 Subject: [PATCH 4/7] #471 Update headers to 2.6.6 for all other files --- admin/admin_main.php | 2 +- admin/admin_reply_ticket.php | 2 +- admin/admin_settings.php | 2 +- admin/admin_settings_save.php | 2 +- admin/admin_submit_ticket.php | 2 +- admin/admin_ticket.php | 2 +- admin/banned_emails.php | 2 +- admin/banned_ips.php | 2 +- admin/change_status.php | 2 +- admin/delete_tickets.php | 2 +- admin/edit_note.php | 2 +- admin/edit_post.php | 2 +- admin/export.php | 2 +- admin/find_tickets.php | 2 +- admin/index.php | 2 +- admin/lock.php | 2 +- admin/mail.php | 2 +- admin/manage_canned.php | 2 +- admin/manage_categories.php | 2 +- admin/manage_permission_templates.php | 2 +- admin/manage_ticket_templates.php | 2 +- admin/manage_users.php | 2 +- admin/new_ticket.php | 2 +- admin/options.php | 2 +- admin/password.php | 2 +- admin/profile.php | 2 +- admin/reports.php | 2 +- admin/service_messages.php | 2 +- admin/show_tickets.php | 2 +- change_status.php | 2 +- hesk_javascript.js | 2 +- inc/admin_functions.inc.php | 2 +- inc/attachments.inc.php | 2 +- inc/email_functions.inc.php | 2 +- inc/header.inc.php | 2 +- inc/headerAdmin.inc.php | 2 +- inc/knowledgebase_functions.inc.php | 2 +- inc/pipe_functions.inc.php | 2 +- inc/posting_functions.inc.php | 2 +- inc/print_tickets.inc.php | 2 +- inc/profile_functions.inc.php | 2 +- inc/show_admin_nav.inc.php | 2 +- inc/show_search_form.inc.php | 2 +- inc/status_functions.inc.php | 2 +- inc/ticket_list.inc.php | 2 +- index.php | 2 +- knowledgebase.php | 2 +- print.php | 2 +- reply_ticket.php | 2 +- submit_ticket.php | 2 +- suggest_articles.php | 2 +- suggest_email.php | 2 +- ticket.php | 2 +- 53 files changed, 53 insertions(+), 53 deletions(-) diff --git a/admin/admin_main.php b/admin/admin_main.php index ea556516..51711d66 100644 --- a/admin/admin_main.php +++ b/admin/admin_main.php @@ -1,7 +1,7 @@ Date: Tue, 2 Feb 2016 13:22:08 -0500 Subject: [PATCH 5/7] #471 Update installer --- inc/header.inc.php | 2 +- inc/headerAdmin.inc.php | 2 +- install/install_functions.inc.php | 4 +- .../ajax/install-database-ajax.php | 2 + install/mods-for-hesk/installModsForHesk.php | 103 ++++++------------ install/mods-for-hesk/js/version-scripts.js | 3 + install/mods-for-hesk/modsForHesk.php | 54 +++++---- install/mods-for-hesk/sql/installSql.php | 9 ++ 8 files changed, 84 insertions(+), 95 deletions(-) diff --git a/inc/header.inc.php b/inc/header.inc.php index e6e80149..d530a0cf 100644 --- a/inc/header.inc.php +++ b/inc/header.inc.php @@ -29,7 +29,7 @@ *******************************************************************************/ // Define the current build -define('MODS_FOR_HESK_BUILD', 24); +define('MODS_FOR_HESK_BUILD', 25); /* Check if this is a valid include */ if (!defined('IN_SCRIPT')) { diff --git a/inc/headerAdmin.inc.php b/inc/headerAdmin.inc.php index 4256ab55..11f74bf0 100644 --- a/inc/headerAdmin.inc.php +++ b/inc/headerAdmin.inc.php @@ -29,7 +29,7 @@ *******************************************************************************/ // Define the current build -define('MODS_FOR_HESK_BUILD', 24); +define('MODS_FOR_HESK_BUILD', 25); /* Check if this is a valid include */ if (!defined('IN_SCRIPT')) { diff --git a/install/install_functions.inc.php b/install/install_functions.inc.php index 9512e75a..02c357f3 100644 --- a/install/install_functions.inc.php +++ b/install/install_functions.inc.php @@ -36,8 +36,8 @@ if (!defined('IN_SCRIPT')) {die('Invalid attempt');} // We will be installing this HESK version: -define('HESK_NEW_VERSION','2.6.5'); -define('MODS_FOR_HESK_NEW_VERSION','2.5.3'); +define('HESK_NEW_VERSION','2.6.6'); +define('MODS_FOR_HESK_NEW_VERSION','2.5.4'); define('REQUIRE_PHP_VERSION','5.0.0'); define('REQUIRE_MYSQL_VERSION','5.0.7'); diff --git a/install/mods-for-hesk/ajax/install-database-ajax.php b/install/mods-for-hesk/ajax/install-database-ajax.php index 0ccc408c..85d1a9cb 100644 --- a/install/mods-for-hesk/ajax/install-database-ajax.php +++ b/install/mods-for-hesk/ajax/install-database-ajax.php @@ -54,6 +54,8 @@ if ($version == 2) { execute252Scripts(); } elseif ($version == 24) { execute253Scripts(); +} elseif ($version == 25) { + execute254Scripts(); } else { $response = 'The version "' . $version . '" was not recognized. Check the value submitted and try again.'; print $response; diff --git a/install/mods-for-hesk/installModsForHesk.php b/install/mods-for-hesk/installModsForHesk.php index 3e9075fb..1b9d7390 100644 --- a/install/mods-for-hesk/installModsForHesk.php +++ b/install/mods-for-hesk/installModsForHesk.php @@ -9,76 +9,39 @@ if (!isset($_GET['v'])) { } $startingVersion = intval($_GET['v']); -function echoInitialVersionRows($version) +$buildToVersionMap = array( + 2 => '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' +); + +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'); - } - if ($version < 24) { - printRow('2.5.3'); + foreach ($build_to_version_map as $build => $display_text) { + if ($version < $build) { + printRow($display_text); + } } } @@ -133,7 +96,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 6f5c4b2a..44eee536 100644 --- a/install/mods-for-hesk/js/version-scripts.js +++ b/install/mods-for-hesk/js/version-scripts.js @@ -68,6 +68,9 @@ function processUpdates(startingVersion) { } 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 { installationFinished(); } diff --git a/install/mods-for-hesk/modsForHesk.php b/install/mods-for-hesk/modsForHesk.php index a95229f9..24c90bcc 100644 --- a/install/mods-for-hesk/modsForHesk.php +++ b/install/mods-for-hesk/modsForHesk.php @@ -119,7 +119,7 @@ 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 ' . $version . ' installed. @@ -130,6 +130,18 @@ hesk_dbConnect(); } ?>

+
+ + 2.5.3 +
btn-block disablable" href="installModsForHesk.php?v=21">2.5.0
+
+
+ +
btn-block disablable" href="installModsForHesk.php?v=20">2.4.2
-
-
- -
btn-block disablable" href="installModsForHesk.php?v=17">2.3.2
+
+
+ +
btn-block disablable" href="installModsForHesk.php?v=16">2.3.1
-
-
- -
btn-block disablable" href="installModsForHesk.php?v=13">2.2.0
+
+
+ +
btn-block disablable" href="installModsForHesk.php?v=12">2.1.1
-
-
- -
btn-block disablable" href="installModsForHesk.php?v=9">2.0.0
+
+
+ +
btn-block disablable" href="installModsForHesk.php?v=8">1.7.0
-
-
- -
1.5.0
-
- 1.4.1 -

+
+ 1.4.1 +
1.4.0 diff --git a/install/mods-for-hesk/sql/installSql.php b/install/mods-for-hesk/sql/installSql.php index 000a4248..e436617e 100644 --- a/install/mods-for-hesk/sql/installSql.php +++ b/install/mods-for-hesk/sql/installSql.php @@ -702,4 +702,13 @@ function execute253Scripts() 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'"); } \ No newline at end of file From 1afa0ad639e451f8b23ad7934c8a4f490627ab62 Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Tue, 2 Feb 2016 21:13:15 -0500 Subject: [PATCH 6/7] Fix installer --- install/mods-for-hesk/modsForHesk.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install/mods-for-hesk/modsForHesk.php b/install/mods-for-hesk/modsForHesk.php index 24c90bcc..df76f7ee 100644 --- a/install/mods-for-hesk/modsForHesk.php +++ b/install/mods-for-hesk/modsForHesk.php @@ -133,10 +133,10 @@ hesk_dbConnect();