+
@@ -490,18 +490,12 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
- Date[!] |
- Description[!] |
+ |
+ |
-
-
- 2018-01-24 |
- Description |
-
-
+
-
Fill this in
@@ -595,7 +589,9 @@ echo mfh_get_hidden_fields_for_language(array('error_loading_events',
'critical',
'high',
'medium',
- 'low'));
+ 'low',
+ 'audit_event_created',
+ 'audit_event_updated'));
?>
@@ -610,6 +606,12 @@ echo mfh_get_hidden_fields_for_language(array('error_loading_events',
?>
+
calendarGateway->updateEvent($calendarEvent, $userContext, $heskSettings);
+ $this->auditTrailGateway->insertAuditTrailRecord($calendarEvent->id,
+ AuditTrailEntityType::CALENDAR_EVENT,
+ 'audit_event_updated',
+ DateTimeHelpers::heskDate($heskSettings),
+ array(0 => $userContext->name . ' (' . $userContext->username . ')'), $heskSettings);
+
$eventFilter = new SearchEventsFilter();
$eventFilter->eventId = $calendarEvent->id;
$eventFilter->reminderUserId = $userContext->id;
@@ -45,12 +51,6 @@ class CalendarHandler extends \BaseClass {
$event = $events[0];
- $this->auditTrailGateway->insertAuditTrailRecord($event->id,
- AuditTrailEntityType::CALENDAR_EVENT,
- 'audit_event_updated',
- DateTimeHelpers::heskDate($heskSettings),
- array(0 => $userContext->name . ' (' . $userContext->username . ')'), $heskSettings);
-
return $event;
}
diff --git a/api/DataAccess/Calendar/CalendarGateway.php b/api/DataAccess/Calendar/CalendarGateway.php
index 3561631c..39c73c44 100644
--- a/api/DataAccess/Calendar/CalendarGateway.php
+++ b/api/DataAccess/Calendar/CalendarGateway.php
@@ -14,7 +14,6 @@ use BusinessLogic\Tickets\AuditTrail;
use BusinessLogic\Tickets\AuditTrailEntityType;
use Core\Constants\Priority;
use DataAccess\CommonDao;
-use DataAccess\Logging\LoggingGateway;
class CalendarGateway extends CommonDao {
/**
diff --git a/inc/headerAdmin.inc.php b/inc/headerAdmin.inc.php
index 3f7df57d..37976b7b 100644
--- a/inc/headerAdmin.inc.php
+++ b/inc/headerAdmin.inc.php
@@ -78,6 +78,7 @@ header('X-UA-Compatible: IE=edge');
+
'
+ fontIconMarkup: '
',
+ auditTrail: dbObject.auditTrail
};
}
@@ -472,6 +474,24 @@ function displayEditModal(date) {
$form.find('select[name="category"] option[value="' + date.categoryId + '"]').prop('selected', true);
+ var $auditTrail = $('#edit-history');
+ if (date.auditTrail.length === 0) {
+ $('.nav-tabs[role="tablist"]').hide();
+ } else {
+ $('.nav-tabs[role="tablist"]').show();
+
+ var $historyTable = $('#history-table');
+ $historyTable.html('');
+ $.each(date.auditTrail, function() {
+ var $template = $($('#audit-trail-template').html());
+ $template.find('[data-property="date"]').text(this.date).end()
+ .find('[data-property="description"]').text(vsprintf(mfhLang.text(this.languageKey), this.replacementValues));
+
+ $historyTable.append($template);
+ });
+ }
+ $('#edit-modal-tabs').find('a:first').tab('show');
+
$('#edit-event-modal').modal('show');
}
@@ -536,6 +556,7 @@ function respondToDragAndDrop(event, delta, revertFunc) {
end += ' ' + event.end.format('HH:mm:ss');
}
var data = {
+ id: event.id,
title: event.title,
location: event.location,
startTime: start,
@@ -557,8 +578,9 @@ function respondToDragAndDrop(event, delta, revertFunc) {
'X-Internal-Call': true,
'X-HTTP-Method-Override': 'PUT'
},
- success: function() {
- mfhAlert.success(mfhLang.text('event_updated'));
+ success: function(updatedEvent) {
+ removeFromCalendar(updatedEvent.id);
+ addToCalendar(updatedEvent.id, updatedEvent, $('#lang_event_updated').text());
},
error: function() {
mfhAlert.error(mfhLang.text('error_updating_event'));
diff --git a/js/sprintf.min.js b/js/sprintf.min.js
new file mode 100644
index 00000000..11ea3642
--- /dev/null
+++ b/js/sprintf.min.js
@@ -0,0 +1,3 @@
+/*! sprintf-js v1.1.0 | Copyright (c) 2007-present, Alexandru Marasteanu
| BSD-3-Clause */
+!function(e){"use strict";function t(){var e=arguments[0],r=t.cache;return r[e]||(r[e]=t.parse(e)),t.format.call(null,r[e],arguments)}function r(e){return"number"==typeof e?"number":"string"==typeof e?"string":Object.prototype.toString.call(e).slice(8,-1).toLowerCase()}function n(e,t){return t>=0&&t<=7&&i[e]?i[e][t]:Array(t+1).join(e)}var s={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[\+\-]/};t.format=function(e,a){var i,o,l,c,p,f,u,g=1,_=e.length,d="",b=[],h=!0,x="";for(o=0;o<_;o++)if("string"===(d=r(e[o])))b[b.length]=e[o];else if("array"===d){if(c=e[o],c[2])for(i=a[g],l=0;l=0),c[8]){case"b":i=parseInt(i,10).toString(2);break;case"c":i=String.fromCharCode(parseInt(i,10));break;case"d":case"i":i=parseInt(i,10);break;case"j":i=JSON.stringify(i,null,c[6]?parseInt(c[6]):0);break;case"e":i=c[7]?parseFloat(i).toExponential(c[7]):parseFloat(i).toExponential();break;case"f":i=c[7]?parseFloat(i).toFixed(c[7]):parseFloat(i);break;case"g":i=c[7]?parseFloat(i).toPrecision(c[7]):parseFloat(i);break;case"o":i=i.toString(8);break;case"s":i=String(i),i=c[7]?i.substring(0,c[7]):i;break;case"t":i=String(!!i),i=c[7]?i.substring(0,c[7]):i;break;case"T":i=r(i),i=c[7]?i.substring(0,c[7]):i;break;case"u":i=parseInt(i,10)>>>0;break;case"v":i=i.valueOf(),i=c[7]?i.substring(0,c[7]):i;break;case"x":i=parseInt(i,10).toString(16);break;case"X":i=parseInt(i,10).toString(16).toUpperCase()}s.json.test(c[8])?b[b.length]=i:(!s.number.test(c[8])||h&&!c[3]?x="":(x=h?"+":"-",i=i.toString().replace(s.sign,"")),f=c[4]?"0"===c[4]?"0":c[4].charAt(1):" ",u=c[6]-(x+i).length,p=c[6]&&u>0?n(f,u):"",b[b.length]=c[5]?x+i+p:"0"===f?x+p+i:p+x+i)}return b.join("")},t.cache=Object.create(null),t.parse=function(e){for(var t=e,r=[],n=[],a=0;t;){if(null!==(r=s.text.exec(t)))n[n.length]=r[0];else if(null!==(r=s.modulo.exec(t)))n[n.length]="%";else{if(null===(r=s.placeholder.exec(t)))throw new SyntaxError("[sprintf] unexpected placeholder");if(r[2]){a|=1;var i=[],o=r[2],l=[];if(null===(l=s.key.exec(o)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(i[i.length]=l[1];""!==(o=o.substring(l[0].length));)if(null!==(l=s.key_access.exec(o)))i[i.length]=l[1];else{if(null===(l=s.index_access.exec(o)))throw new SyntaxError("[sprintf] failed to parse named argument key");i[i.length]=l[1]}r[2]=i}else a|=2;if(3===a)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");n[n.length]=r}t=t.substring(r[0].length)}return n};var a=function(e,r,n){return n=(r||[]).slice(0),n.splice(0,0,e),t.apply(null,n)},i={0:["","0","00","000","0000","00000","000000","0000000"]," ":[""," "," "," "," "," "," "," "],_:["","_","__","___","____","_____","______","_______"]};"undefined"!=typeof exports&&(exports.sprintf=t,exports.vsprintf=a),void 0!==e&&(e.sprintf=t,e.vsprintf=a,"function"==typeof define&&define.amd&&define(function(){return{sprintf:t,vsprintf:a}}))}("undefined"==typeof window?this:window);
+//# sourceMappingURL=sprintf.min.js.map