Use red background for overdue tickets
This commit is contained in:
parent
df57eaaa9a
commit
38aeb64407
@ -84,6 +84,10 @@ $(document).ready(function() {
|
|||||||
$(this).popover('destroy');
|
$(this).popover('destroy');
|
||||||
},
|
},
|
||||||
eventRender: function(event, element) {
|
eventRender: function(event, element) {
|
||||||
|
if (event.type === 'TICKET' && moment(event.start).endOf("day").isBefore(moment())) {
|
||||||
|
$('[data-date="' + event.start.format('YYYY-MM-DD') + '"]').css('background', '#f2dede');
|
||||||
|
}
|
||||||
|
|
||||||
if (event.fontIconMarkup !== undefined) {
|
if (event.fontIconMarkup !== undefined) {
|
||||||
element.find('span.fc-title').html(event.fontIconMarkup + ' ' + element.find('span.fc-title').text());
|
element.find('span.fc-title').html(event.fontIconMarkup + ' ' + element.find('span.fc-title').text());
|
||||||
}
|
}
|
||||||
|
@ -102,6 +102,10 @@ $(document).ready(function() {
|
|||||||
$cell.attr('title', 'Click to add event');
|
$cell.attr('title', 'Click to add event');
|
||||||
},
|
},
|
||||||
eventRender: function(event, element) {
|
eventRender: function(event, element) {
|
||||||
|
if (event.type === 'TICKET' && moment(event.start).endOf("day").isBefore(moment())) {
|
||||||
|
$('[data-date="' + event.start.format('YYYY-MM-DD') + '"]').css('background', '#f2dede');
|
||||||
|
}
|
||||||
|
|
||||||
if (event.fontIconMarkup !== undefined) {
|
if (event.fontIconMarkup !== undefined) {
|
||||||
element.find('span.fc-title').html(event.fontIconMarkup + ' ' + element.find('span.fc-title').text());
|
element.find('span.fc-title').html(event.fontIconMarkup + ' ' + element.find('span.fc-title').text());
|
||||||
}
|
}
|
||||||
@ -273,7 +277,7 @@ function buildEvent(id, dbObject) {
|
|||||||
owner: dbObject.owner,
|
owner: dbObject.owner,
|
||||||
priority: dbObject.priority,
|
priority: dbObject.priority,
|
||||||
textColor: calculateTextColor(dbObject.categoryColor),
|
textColor: calculateTextColor(dbObject.categoryColor),
|
||||||
fontIconMarkup: getIcon(dbObject, calculateTextColor(dbObject.categoryColor))
|
fontIconMarkup: getIcon(dbObject)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -297,14 +301,11 @@ function buildEvent(id, dbObject) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
function getIcon(dbObject, textColor) {
|
function getIcon(dbObject) {
|
||||||
console.log(textColor);
|
|
||||||
var endOfDay = moment(dbObject.startTime).endOf("day");
|
var endOfDay = moment(dbObject.startTime).endOf("day");
|
||||||
|
|
||||||
var iconColor = textColor === 'white' ? '' : 'color: red';
|
|
||||||
|
|
||||||
if (moment(endOfDay).isBefore(moment())) {
|
if (moment(endOfDay).isBefore(moment())) {
|
||||||
return '<i class="fa fa-exclamation-triangle" style="' + iconColor + '"></i>';
|
return '<i class="fa fa-exclamation-triangle"></i>';
|
||||||
}
|
}
|
||||||
|
|
||||||
return '<i class="fa fa-ticket"></i>';
|
return '<i class="fa fa-ticket"></i>';
|
||||||
@ -436,8 +437,7 @@ function respondToDragAndDrop(event, delta, revertFunc) {
|
|||||||
},
|
},
|
||||||
success: function() {
|
success: function() {
|
||||||
event.fontIconMarkup = getIcon({
|
event.fontIconMarkup = getIcon({
|
||||||
startTime: event.start,
|
startTime: event.start
|
||||||
textColor: event.textColor
|
|
||||||
});
|
});
|
||||||
$('#calendar').fullCalendar('updateEvent', event);
|
$('#calendar').fullCalendar('updateEvent', event);
|
||||||
$.jGrowl($('#lang_ticket_due_date_updated').text(), { theme: 'alert-success', closeTemplate: '' });
|
$.jGrowl($('#lang_ticket_due_date_updated').text(), { theme: 'alert-success', closeTemplate: '' });
|
||||||
|
Loading…
x
Reference in New Issue
Block a user