Add status to ticket popover on calendar
This commit is contained in:
parent
78cb2de9b6
commit
770a01a970
@ -545,6 +545,10 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
|
||||
<strong><?php echo $hesklang['category']; ?></strong>
|
||||
<span></span>
|
||||
</div>
|
||||
<div class="popover-status">
|
||||
<strong><?php echo $hesklang['status']; ?></strong>
|
||||
<span></span>
|
||||
</div>
|
||||
<div class="popover-priority">
|
||||
<strong><?php echo $hesklang['priority']; ?></strong>
|
||||
<span></span>
|
||||
@ -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'));
|
||||
?>
|
||||
<div style="display: none">
|
||||
<p id="setting_first_day_of_week"><?php echo $modsForHesk_settings['first_day_of_week']; ?></p>
|
||||
|
@ -18,6 +18,4 @@ class CalendarEvent extends AbstractEvent {
|
||||
public $reminderValue;
|
||||
|
||||
public $reminderUnits;
|
||||
|
||||
public $recurringRule;
|
||||
}
|
@ -15,4 +15,6 @@ class TicketEvent extends AbstractEvent {
|
||||
public $owner;
|
||||
|
||||
public $priority;
|
||||
|
||||
public $status;
|
||||
}
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
};
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user