From 405b5942b68d8531fc885e474ad1a653e27075a5 Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Thu, 21 Jul 2016 22:06:33 -0400 Subject: [PATCH 1/8] #439 Fix events that span multiple months --- internal-api/dao/calendar_dao.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/internal-api/dao/calendar_dao.php b/internal-api/dao/calendar_dao.php index 2e8ae644..be7ba8dd 100644 --- a/internal-api/dao/calendar_dao.php +++ b/internal-api/dao/calendar_dao.php @@ -3,6 +3,9 @@ function get_events($start, $end, $hesk_settings, $staff = true) { global $hesk_settings, $hesklang; + $start_time_sql = "CONVERT_TZ(FROM_UNIXTIME(" . hesk_dbEscape($start) . " / 1000), @@session.time_zone, '+00:00')"; + $end_time_sql = "CONVERT_TZ(FROM_UNIXTIME(" . hesk_dbEscape($end) . " / 1000), @@session.time_zone, '+00:00')"; + $sql = "SELECT `events`.*, `categories`.`name` AS `category_name`, `categories`.`color` AS `category_color` "; if ($staff) { @@ -17,8 +20,7 @@ function get_events($start, $end, $hesk_settings, $staff = true) { $sql .= "LEFT JOIN `" . hesk_dbEscape($hesk_settings['db_pfix']) . "calendar_event_reminder` AS `reminders` ON `reminders`.`user_id` = " . intval($_SESSION['id']) . " AND `reminders`.`event_id` = `events`.`id`"; } - $sql .= "WHERE `start` >= CONVERT_TZ(FROM_UNIXTIME(" . hesk_dbEscape($start) - . " / 1000), @@session.time_zone, '+00:00') AND `end` <= CONVERT_TZ(FROM_UNIXTIME(" . hesk_dbEscape($end) . " / 1000), @@session.time_zone, '+00:00') AND `categories`.`usage` <> 1"; + $sql .= "WHERE NOT (`end` < {$start_time_sql} AND `start` > {$end_time_sql}) AND `categories`.`usage` <> 1"; if (!$staff) { $sql .= " AND `categories`.`type` = '0'"; From 0838e1de494fc396d517fb8f9cd796ae9e925269 Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Thu, 21 Jul 2016 22:17:06 -0400 Subject: [PATCH 2/8] Fix some API doc stuff --- api/common_api_doc.php | 3 ++- api/ticket/index.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/api/common_api_doc.php b/api/common_api_doc.php index c829a7a6..53506de9 100644 --- a/api/common_api_doc.php +++ b/api/common_api_doc.php @@ -15,7 +15,8 @@ /** * @apiDefine noTokenProvided 400 Bad Request * No `X-Auth-Token` was provided. - * + */ +/** * @apiDefine canManUsers Protected (Can Manage Users) * A protected API can only be utilized by users with a valid `X-Auth-Token` and have the 'can_man_users' permission (or is an admin) */ \ No newline at end of file diff --git a/api/ticket/index.php b/api/ticket/index.php index f4f7c9c8..ad8cf76a 100644 --- a/api/ticket/index.php +++ b/api/ticket/index.php @@ -16,7 +16,7 @@ hesk_dbConnect(); $request_method = $_SERVER['REQUEST_METHOD']; /** - * @api {get} /ticket Retrieve a ticket (staff-side) + * @api {get} /ticket Retrieve a ticket (customer-side) * @apiVersion 0.0.0 * @apiName GetTicket * @apiGroup Ticket From 25be22303048083aac0e5d1cce036c18edf40642 Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Sun, 24 Jul 2016 21:39:36 -0400 Subject: [PATCH 3/8] #443 Fix typo --- admin/calendar.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/admin/calendar.php b/admin/calendar.php index 96c7bade..314ae6a4 100644 --- a/admin/calendar.php +++ b/admin/calendar.php @@ -187,7 +187,7 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php'); + title="">
Date: Sun, 24 Jul 2016 21:44:44 -0400 Subject: [PATCH 4/8] #440 Notifications and autoassign are enums, not ints --- admin/manage_users.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/admin/manage_users.php b/admin/manage_users.php index 4b0e6c51..a07f532f 100644 --- a/admin/manage_users.php +++ b/admin/manage_users.php @@ -906,8 +906,8 @@ function toggle_active() // Revoke any manager rights hesk_dbQuery("UPDATE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "categories` SET `manager` = 0 WHERE `manager` = " . intval($myuser)); - $notificationSql = ", `autoassign` = 0, `notify_new_unassigned` = 0, `notify_new_my` = 0, `notify_reply_unassigned` = 0, - `notify_reply_my` = 0, `notify_assigned` = 0, `notify_pm` = 0, `notify_note` = 0, `notify_note_unassigned` = 0, `notify_overdue_unassigned` = 0"; + $notificationSql = ", `autoassign` = '0', `notify_new_unassigned` = '0', `notify_new_my` = '0', `notify_reply_unassigned` = '0', + `notify_reply_my` = '0', `notify_assigned` = '0', `notify_pm` = '0', `notify_note` = '0', `notify_note_unassigned` = '0', `notify_overdue_unassigned` = '0'"; } hesk_dbQuery("UPDATE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "users` SET `active` = '" . $active . "'" . $notificationSql . " WHERE `id` = '" . intval($myuser) . "'"); From 64bd766249974b1b379c4e1efaf514a068dd931e Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Sun, 24 Jul 2016 21:51:01 -0400 Subject: [PATCH 5/8] Remove margin on blockquotes in messages --- css/mods-for-hesk.css | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/css/mods-for-hesk.css b/css/mods-for-hesk.css index 765e2297..5bae2052 100644 --- a/css/mods-for-hesk.css +++ b/css/mods-for-hesk.css @@ -101,7 +101,11 @@ button.dropdown-submit { } .ticketMessageBottom > .message { - margin-bottom: 0px; + margin-bottom: 0; +} + +.ticketMessageBottom > blockquote { + margin-bottom: 0; } .message > * { From 85861897a56179c359d1271a376b58d0bf45aaa6 Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Sun, 24 Jul 2016 21:58:24 -0400 Subject: [PATCH 6/8] Fix calendar reminder cron job --- cron/calendar_reminders.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cron/calendar_reminders.php b/cron/calendar_reminders.php index b45ddf2f..1f170ff5 100644 --- a/cron/calendar_reminders.php +++ b/cron/calendar_reminders.php @@ -78,7 +78,11 @@ if (hesk_dbNumRows($rs) > 0 && !$skip_events) { $successful_emails = 0; $failed_emails = 0; -while ($row = hesk_dbFetchAssoc($rs) && !$skip_events) { +while ($row = hesk_dbFetchAssoc($rs)) { + if ($skip_events) { + return true; + } + if (mfh_sendCalendarReminder($row, $modsForHesk_settings)) { $reminders_to_flag[] = $row['reminder_id']; $successful_emails++; From 262e0b5fc7ef68b82908d00364235d1572607f87 Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Sun, 24 Jul 2016 22:00:47 -0400 Subject: [PATCH 7/8] Update installer --- install/install_functions.inc.php | 2 +- install/mods-for-hesk/ajax/install-database-ajax.php | 2 ++ install/mods-for-hesk/installModsForHesk.php | 1 + install/mods-for-hesk/js/version-scripts.js | 3 +++ install/mods-for-hesk/modsForHesk.php | 1 + install/mods-for-hesk/sql/installSql.php | 8 ++++++++ 6 files changed, 16 insertions(+), 1 deletion(-) diff --git a/install/install_functions.inc.php b/install/install_functions.inc.php index f3c57fda..0f226a4d 100644 --- a/install/install_functions.inc.php +++ b/install/install_functions.inc.php @@ -37,7 +37,7 @@ if (!defined('IN_SCRIPT')) {die('Invalid attempt');} // We will be installing this HESK version: define('HESK_NEW_VERSION','2.6.7'); -define('MODS_FOR_HESK_NEW_VERSION','2.6.2'); +define('MODS_FOR_HESK_NEW_VERSION','2.6.3'); 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 4a39bd6e..10fd519e 100644 --- a/install/mods-for-hesk/ajax/install-database-ajax.php +++ b/install/mods-for-hesk/ajax/install-database-ajax.php @@ -64,6 +64,8 @@ if ($version == 2) { execute261Scripts(); } elseif ($version == 29) { execute262Scripts(); +} elseif ($version == 30) { + execute263Scripts(); } 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 76e3ec1b..f74b3e00 100644 --- a/install/mods-for-hesk/installModsForHesk.php +++ b/install/mods-for-hesk/installModsForHesk.php @@ -38,6 +38,7 @@ $buildToVersionMap = array( 27 => '2.6.0', 28 => '2.6.1', 29 => '2.6.2', + 30 => '2.6.3', ); function echoInitialVersionRows($version, $build_to_version_map) diff --git a/install/mods-for-hesk/js/version-scripts.js b/install/mods-for-hesk/js/version-scripts.js index ce2973b4..bd02e29a 100644 --- a/install/mods-for-hesk/js/version-scripts.js +++ b/install/mods-for-hesk/js/version-scripts.js @@ -83,6 +83,9 @@ function processUpdates(startingVersion) { } else if (startingVersion < 29) { startVersionUpgrade('262'); executeUpdate(29, '262', '2.6.2'); + } else if (startingVersion < 30) { + startVersionUpgrade('263'); + executeUpdate(30, '263', '2.6.3'); } else { installationFinished(); } diff --git a/install/mods-for-hesk/modsForHesk.php b/install/mods-for-hesk/modsForHesk.php index fc26f38f..fc892928 100644 --- a/install/mods-for-hesk/modsForHesk.php +++ b/install/mods-for-hesk/modsForHesk.php @@ -117,6 +117,7 @@ hesk_dbConnect();