@@ -560,7 +564,11 @@ echo mfh_get_hidden_fields_for_language(array('error_loading_events',
'event_updated',
'error_updating_event',
'ticket_due_date_updated',
- 'error_updating_ticket_due_date'));
+ 'error_updating_ticket_due_date',
+ 'critical',
+ 'high',
+ 'medium',
+ 'low'));
?>
diff --git a/api/BusinessLogic/Calendar/CalendarEvent.php b/api/BusinessLogic/Calendar/CalendarEvent.php
index 9e974b01..91a45761 100644
--- a/api/BusinessLogic/Calendar/CalendarEvent.php
+++ b/api/BusinessLogic/Calendar/CalendarEvent.php
@@ -18,6 +18,4 @@ class CalendarEvent extends AbstractEvent {
public $reminderValue;
public $reminderUnits;
-
- public $recurringRule;
}
\ No newline at end of file
diff --git a/api/BusinessLogic/Calendar/TicketEvent.php b/api/BusinessLogic/Calendar/TicketEvent.php
index e2e7102f..95bf621d 100644
--- a/api/BusinessLogic/Calendar/TicketEvent.php
+++ b/api/BusinessLogic/Calendar/TicketEvent.php
@@ -15,4 +15,6 @@ class TicketEvent extends AbstractEvent {
public $owner;
public $priority;
+
+ public $status;
}
\ No newline at end of file
diff --git a/api/Controllers/Calendar/CalendarController.php b/api/Controllers/Calendar/CalendarController.php
index 2c84270a..4b7ab9cd 100644
--- a/api/Controllers/Calendar/CalendarController.php
+++ b/api/Controllers/Calendar/CalendarController.php
@@ -5,6 +5,7 @@ namespace Controllers\Calendar;
use BusinessLogic\Calendar\CalendarEvent;
use BusinessLogic\Calendar\CalendarHandler;
+use BusinessLogic\Calendar\RecurringRule;
use BusinessLogic\Calendar\ReminderUnit;
use BusinessLogic\Calendar\SearchEventsFilter;
use BusinessLogic\Categories\CategoryHandler;
@@ -16,6 +17,7 @@ use BusinessLogic\ValidationModel;
use Controllers\JsonRetriever;
use DataAccess\Settings\ModsForHeskSettingsGateway;
use RRule\RRule;
+use RRule\RSet;
class CalendarController extends \BaseClass {
function get() {
@@ -118,7 +120,6 @@ class CalendarController extends \BaseClass {
$event->categoryId = Helpers::safeArrayGet($json, 'categoryId');
$event->reminderValue = Helpers::safeArrayGet($json, 'reminderValue');
$event->reminderUnits = ReminderUnit::getByName(Helpers::safeArrayGet($json, 'reminderUnits'));
- $event->recurringRule = Helpers::safeArrayGet($json, 'recurringRule');
return $event;
}
diff --git a/api/DataAccess/Calendar/CalendarGateway.php b/api/DataAccess/Calendar/CalendarGateway.php
index ddb263e6..1693e23d 100644
--- a/api/DataAccess/Calendar/CalendarGateway.php
+++ b/api/DataAccess/Calendar/CalendarGateway.php
@@ -86,13 +86,16 @@ class CalendarGateway extends CommonDao {
$sql = "SELECT `tickets`.`id` AS `id`, `trackid`, `subject`, `due_date`, `category`, `categories`.`name` AS `category_name`, `categories`.`background_color` AS `background_color`,
`categories`.`foreground_color` AS `foreground_color`, `categories`.`display_border_outline` AS `display_border`,
CASE WHEN `due_date` < '{$currentDate}' THEN 1 ELSE 0 END AS `overdue`, `owner`.`name` AS `owner_name`, `tickets`.`owner` AS `owner_id`,
- `tickets`.`priority` AS `priority`
+ `tickets`.`priority` AS `priority`, `text_to_status_xref`.`text` AS `status_name`
FROM `" . hesk_dbEscape($heskSettings['db_pfix']) . "tickets` AS `tickets`
INNER JOIN `" . hesk_dbEscape($heskSettings['db_pfix']) . "categories` AS `categories`
ON `categories`.`id` = `tickets`.`category`
AND `categories`.`usage` <> 2
LEFT JOIN `" . hesk_dbEscape($heskSettings['db_pfix']) . "users` AS `owner`
ON `tickets`.`owner` = `owner`.`id`
+ LEFT JOIN `" . hesk_dbEscape($heskSettings['db_pfix']) . "text_to_status_xref` AS `text_to_status_xref`
+ ON `tickets`.`status` = `text_to_status_xref`.`status_id`
+ AND `text_to_status_xref`.`language` = '" . hesk_dbEscape($heskSettings['language']) . "'
WHERE `due_date` >= {$startTimeSql}
AND `due_date` <= {$endTimeSql}
AND `status` IN (SELECT `id` FROM `" . hesk_dbEscape($heskSettings['db_pfix']) . "statuses` WHERE `IsClosed` = 0)
@@ -129,6 +132,7 @@ class CalendarGateway extends CommonDao {
$event->displayBorder = Helpers::boolval($row['display_border']);
$event->owner = $row['owner_name'];
$event->priority = Priority::getByValue($row['priority']);
+ $event->status = $row['status_name'];
$events[] = $event;
}
diff --git a/js/calendar/mods-for-hesk-calendar-admin-readonly.js b/js/calendar/mods-for-hesk-calendar-admin-readonly.js
index 7290189e..51f2b763 100644
--- a/js/calendar/mods-for-hesk-calendar-admin-readonly.js
+++ b/js/calendar/mods-for-hesk-calendar-admin-readonly.js
@@ -62,7 +62,8 @@ $(document).ready(function() {
.find('.popover-owner span').text(event.owner).end()
.find('.popover-subject span').text(event.subject).end()
.find('.popover-category span').text(event.categoryName).end()
- .find('.popover-priority span').text(event.priority);
+ .find('.popover-priority span').text(event.priority)
+ .find('.popover-status span').text(event.status).end();
} else {
if (event.location === '') {
$contents.find('.popover-location').hide();
@@ -125,7 +126,13 @@ $(document).ready(function() {
});
function buildEvent(id, dbObject) {
- if (dbObject.type == 'TICKET') {
+ var priorities = [];
+ priorities['CRITICAL'] = mfhLang.text('critical');
+ priorities['HIGH'] = mfhLang.text('high');
+ priorities['MEDIUM'] = mfhLang.text('medium');
+ priorities['LOW'] = mfhLang.text('low');
+
+ if (dbObject.type === 'TICKET') {
return {
title: dbObject.title,
subject: dbObject.subject,
@@ -141,8 +148,9 @@ function buildEvent(id, dbObject) {
categoryName: dbObject.categoryName,
className: 'category-' + dbObject.categoryId,
owner: dbObject.owner,
- priority: dbObject.priority,
- fontIconMarkup: getIcon(dbObject)
+ priority: priorities[dbObject.priority],
+ fontIconMarkup: getIcon(dbObject),
+ status: dbObject.status
};
}
diff --git a/js/calendar/mods-for-hesk-calendar.js b/js/calendar/mods-for-hesk-calendar.js
index 48fac68f..7551e2d7 100644
--- a/js/calendar/mods-for-hesk-calendar.js
+++ b/js/calendar/mods-for-hesk-calendar.js
@@ -66,7 +66,8 @@ $(document).ready(function() {
.find('.popover-owner span').text(event.owner).end()
.find('.popover-subject span').text(event.subject).end()
.find('.popover-category span').text(event.categoryName).end()
- .find('.popover-priority span').text(event.priority);
+ .find('.popover-priority span').text(event.priority).end()
+ .find('.popover-status span').text(event.status).end();
} else {
if (event.allDay) {
endDate = event.end.clone();
@@ -298,6 +299,13 @@ function removeFromCalendar(id) {
}
function buildEvent(id, dbObject) {
+ var priorities = [];
+ priorities['CRITICAL'] = mfhLang.text('critical');
+ priorities['HIGH'] = mfhLang.text('high');
+ priorities['MEDIUM'] = mfhLang.text('medium');
+ priorities['LOW'] = mfhLang.text('low');
+
+
if (dbObject.type === 'TICKET') {
return {
id: id,
@@ -315,8 +323,9 @@ function buildEvent(id, dbObject) {
categoryName: dbObject.categoryName,
className: 'category-' + dbObject.categoryId,
owner: dbObject.owner,
- priority: dbObject.priority,
- fontIconMarkup: getIcon(dbObject)
+ priority: priorities[dbObject.priority],
+ fontIconMarkup: getIcon(dbObject),
+ status: dbObject.status
};
}