From 7b160048bf0a8035b55db08654b7e2a22c294e6e Mon Sep 17 00:00:00 2001 From: Chris Brame Date: Tue, 8 Jan 2019 00:20:31 -0500 Subject: [PATCH] chore(settings): custom date formats --- src/controllers/api/v1/tickets.js | 12 ++-- src/controllers/api/v1/users.js | 6 +- src/controllers/settings.js | 20 +++---- src/helpers/hbs/helpers.js | 15 ++++- src/helpers/viewdata/index.js | 58 +++++++++++++------ src/middleware/middleware.js | 10 ++-- .../js/angularjs/controllers/settings.js | 47 ++++++++++++++- src/public/js/modules/chat.js | 2 +- src/public/js/modules/helpers.js | 28 +++++++++ src/public/js/modules/ui.js | 21 ++++--- src/public/js/pages/dashboard.js | 5 +- src/public/js/pages/messages.js | 4 +- src/sass/partials/tickets.sass | 2 +- src/sass/partials/trutab.sass | 1 + src/sass/partials/ui.sass | 1 + src/settings/settingsUtil.js | 3 + src/views/layout/main.hbs | 2 +- src/views/messages.hbs | 10 ++-- src/views/partials/noticeAlertWindow.hbs | 2 +- src/views/partials/topbar/messages.hbs | 2 +- src/views/partials/topbar/notifications.hbs | 2 +- src/views/partials/viewAllNotifications.hbs | 2 +- src/views/settings.hbs | 58 ++++++++++++++++--- src/views/subviews/printticket.hbs | 11 +++- .../report_TicketsByGroup.hbs | 2 +- .../report_TicketsByPriorities.hbs | 2 +- .../report_TicketsByStatus.hbs | 2 +- .../report_TicketsByTags.hbs | 2 +- .../report_TicketsByTypes.hbs | 2 +- .../report_TicketsByUsers.hbs | 2 +- src/views/subviews/singleticket.hbs | 47 +++++++++++---- src/views/tickets.hbs | 16 ++--- 32 files changed, 297 insertions(+), 102 deletions(-) diff --git a/src/controllers/api/v1/tickets.js b/src/controllers/api/v1/tickets.js index 356eef146..c167948fe 100644 --- a/src/controllers/api/v1/tickets.js +++ b/src/controllers/api/v1/tickets.js @@ -45,8 +45,8 @@ function buildGraphData(arr, days, callback) { if (_.isFunction(callback)) return callback(graphData); - else - return graphData; + + return graphData; } function buildAvgResponse(ticketArray, callback) { @@ -71,8 +71,8 @@ function buildAvgResponse(ticketArray, callback) { if (_.isFunction(callback)) return callback(cbObj); - else - return cbObj; + + return cbObj; } /** @@ -420,8 +420,8 @@ apiTickets.createPublicTicket = function(req, res) { if (defaultType.value) return next(null, defaultType.value, group, savedUser); - else - return next('Failed: Invalid Default Ticket Type.'); + + return next('Failed: Invalid Default Ticket Type.'); }); }, diff --git a/src/controllers/api/v1/users.js b/src/controllers/api/v1/users.js index a51dfc753..9efb65358 100644 --- a/src/controllers/api/v1/users.js +++ b/src/controllers/api/v1/users.js @@ -866,8 +866,10 @@ apiUsers.checkEmail = function(req, res) { UserSchema.getUserByEmail(email, function(err, users) { if (err) return res.status(400).json({success: false, error: err.message}); - if (!_.isNull(users)) return res.json({success: true, exist: true}); - else return res.json({success: true, exist: false}); + if (!_.isNull(users)) + return res.json({success: true, exist: true}); + + return res.json({success: true, exist: false}); }); }; diff --git a/src/controllers/settings.js b/src/controllers/settings.js index 811c3b3bf..4a97eaa8e 100644 --- a/src/controllers/settings.js +++ b/src/controllers/settings.js @@ -24,7 +24,7 @@ var settingsController = {}; settingsController.content = {}; -function initViewContant(view, req) { +function initViewContent(view, req) { var content = {}; content.title = 'Settings'; content.nav = 'settings'; @@ -69,7 +69,7 @@ function renderView(res, content) { settingsController.general = function(req, res) { if (!checkPerms(req, 'settings:view')) return res.redirect('/'); - var content = initViewContant('general', req); + var content = initViewContent('general', req); renderView(res, content); }; @@ -77,7 +77,7 @@ settingsController.general = function(req, res) { settingsController.appearance = function(req, res) { if (!checkPerms(req, 'settings:view')) return res.redirect('/'); - var content = initViewContant('appearance', req); + var content = initViewContent('appearance', req); renderView(res, content); }; @@ -85,7 +85,7 @@ settingsController.appearance = function(req, res) { settingsController.ticketSettings = function(req, res) { if (!checkPerms(req, 'settings:tickets')) return res.redirect('/settings'); - var content = initViewContant('tickets', req); + var content = initViewContent('tickets', req); renderView(res, content); }; @@ -93,7 +93,7 @@ settingsController.ticketSettings = function(req, res) { settingsController.mailerSettings = function(req, res) { if (!checkPerms(req, 'settings:mailer')) return res.redirect('/settings'); - var content = initViewContant('mailer', req); + var content = initViewContent('mailer', req); renderView(res, content); }; @@ -101,7 +101,7 @@ settingsController.mailerSettings = function(req, res) { settingsController.notificationsSettings = function(req, res) { if (!checkPerms(req, 'settings:notifications')) return res.redirect('/settings'); - var content = initViewContant('notifications', req); + var content = initViewContent('notifications', req); renderView(res, content); }; @@ -109,7 +109,7 @@ settingsController.notificationsSettings = function(req, res) { settingsController.tpsSettings = function(req, res) { if (!checkPerms(req, 'settings:tps')) return res.redirect('/settings'); - var content = initViewContant('tps', req); + var content = initViewContent('tps', req); renderView(res, content); }; @@ -117,7 +117,7 @@ settingsController.tpsSettings = function(req, res) { settingsController.backupSettings = function(req, res) { if (!checkPerms(req, 'settings:backup')) return res.redirect('/settings'); - var content = initViewContant('backup', req); + var content = initViewContent('backup', req); renderView(res, content); }; @@ -125,7 +125,7 @@ settingsController.backupSettings = function(req, res) { settingsController.legal = function(req, res) { if (!checkPerms(req, 'settings:legal')) return res.redirect('/settings'); - var content = initViewContant('legal', req); + var content = initViewContent('legal', req); renderView(res, content); }; @@ -133,7 +133,7 @@ settingsController.legal = function(req, res) { settingsController.logs = function(req, res) { if (!checkPerms(req, 'settings:logs')) return res.redirect('/settings'); - var content = initViewContant('logs', req); + var content = initViewContent('logs', req); var fs = require('fs'), path = require('path'), diff --git a/src/helpers/hbs/helpers.js b/src/helpers/hbs/helpers.js index 27657c6eb..fada606a1 100644 --- a/src/helpers/hbs/helpers.js +++ b/src/helpers/hbs/helpers.js @@ -27,6 +27,15 @@ require('moment-duration-format'); // The module to be exported var helpers = { + concat: function(a, b, space, comma) { + if (space && (comma === false || _.isObject(comma))) + return a.toString() + ' ' + b.toString(); + else if (comma === true) + return a.toString() + ', ' + b.toString(); + else + return a.toString() + b.toString(); + }, + contains: function (str, pattern, options) { if (str.indexOf(pattern) !== -1) return options.fn(this); @@ -481,7 +490,9 @@ var helpers = { return moment.duration(duration, parseFormat).format('Y [year], M [month], d [day], h [hour], m [min]', { trim: 'both'}); }, - calendarDate: function(date) { + calendarDate: function(date, fallback) { + if (_.isObject(fallback)) + fallback = 'll [at] LT'; moment.updateLocale('en', { calendar: { sameDay: '[Today at] LT', @@ -489,7 +500,7 @@ var helpers = { nextDay: '[Tomorrow at] LT', lastWeek: '[Last] ddd [at] LT', nextWeek: 'ddd [at] LT', - sameElse: 'L' + sameElse: fallback } }); return moment.utc(date).tz(global.timezone).calendar(); diff --git a/src/helpers/viewdata/index.js b/src/helpers/viewdata/index.js index e3d4340c0..5703c3af8 100644 --- a/src/helpers/viewdata/index.js +++ b/src/helpers/viewdata/index.js @@ -33,14 +33,38 @@ viewController.getData = function(request, cb) { return callback(); }, function(callback) { - settingSchema.getSetting('gen:shortDateFormat', function(err, setting) { - if (!err && setting && setting.value) - viewdata.shortDateFormat = setting.value; - else - viewdata.shortDateFormat = 'MM/DD/YYYY'; - - return callback(); - }); + async.parallel([ + function(done) { + settingSchema.getSetting('gen:timeFormat', function(err, setting) { + if (!err && setting && setting.value) + viewdata.timeFormat = setting.value; + else + viewdata.timeFormat = 'hh:mma'; + + return done(); + }); + }, + function(done) { + settingSchema.getSetting('gen:shortDateFormat', function(err, setting) { + if (!err && setting && setting.value) + viewdata.shortDateFormat = setting.value; + else + viewdata.shortDateFormat = 'MM/DD/YYYY'; + + return done(); + }); + }, + function(done) { + settingSchema.getSetting('gen:longDateFormat', function(err, setting) { + if (!err && setting && setting.value) + viewdata.longDateFormat = setting.value; + else + viewdata.longDateFormat = 'MM/DD/YYYY h:mma'; + + return done(); + }); + } + ], callback); }, function(callback) { viewdata.ticketSettings = {}; @@ -151,16 +175,16 @@ viewController.getData = function(request, cb) { if (!viewdata.hasCustomFavicon) { viewdata.favicon = '/img/favicon.ico'; return callback(); - } else { - settingSchema.getSetting('gen:customfaviconfilename', function(err, faviconFilename) { - if (!err && faviconFilename && !_.isUndefined(faviconFilename.value)) - viewdata.favicon = '/assets/' + faviconFilename.value; - else - viewdata.favicon = '/img/favicon.ico'; - - return callback(); - }); } + + settingSchema.getSetting('gen:customfaviconfilename', function(err, faviconFilename) { + if (!err && faviconFilename && !_.isUndefined(faviconFilename.value)) + viewdata.favicon = '/assets/' + faviconFilename.value; + else + viewdata.favicon = '/img/favicon.ico'; + + return callback(); + }); }); }, function(callback) { diff --git a/src/middleware/middleware.js b/src/middleware/middleware.js index 446f0caf6..043639a6a 100644 --- a/src/middleware/middleware.js +++ b/src/middleware/middleware.js @@ -92,12 +92,12 @@ middleware.redirectIfUser = function(req, res, next) { middleware.ensurel2Auth = function(req, res, next) { if (req.session.l2auth === 'totp') { - if (req.user) - {if (req.user.role !== 'user') + if (req.user) { + if (req.user.role !== 'user') return res.redirect('/dashboard'); - else - return res.redirect('/tickets');} - else + + return res.redirect('/tickets'); + } else return next(); } else return res.redirect('/l2auth'); diff --git a/src/public/js/angularjs/controllers/settings.js b/src/public/js/angularjs/controllers/settings.js index 7d15c385b..91f4b485c 100644 --- a/src/public/js/angularjs/controllers/settings.js +++ b/src/public/js/angularjs/controllers/settings.js @@ -23,9 +23,10 @@ define([ 'moment', 'moment_timezone', 'velocity', - 'history'], + 'history', + 'angularjs/services'], function(angular, _, $, helpers, ui, UIkit, EasyMDE, moment) { - return angular.module('trudesk.controllers.settings', ['ngSanitize']) + return angular.module('trudesk.controllers.settings', ['ngSanitize', 'trudesk.services.settings']) .directive('selectize', function($timeout) { return { restrict: 'A', @@ -44,7 +45,7 @@ define([ } }; }) - .controller('settingsCtrl', function($scope, $http, $timeout, $log, $window) { + .controller('settingsCtrl', function(SettingsService, $scope, $http, $timeout, $log, $window) { var mdeToolbarItems = [ { name: 'bold', @@ -108,6 +109,11 @@ define([ var privacyPolicyMDE = null; $scope.init = function() { + // Set using Service due to handlebars escaping backslashes + $scope.timeFormat = SettingsService.getSettings().timeFormat.value; + $scope.shortDateFormat = SettingsService.getSettings().shortDateFormat.value; + $scope.longDateFormat = SettingsService.getSettings().longDateFormat.value; + var $uploadButton = $('#logo-upload-select').parent(); var uploadLogoSettings = { action: '/settings/general/uploadlogo', @@ -540,6 +546,23 @@ define([ }); }; + $scope.saveTimeFormatClicked = function() { + $http.put('/api/v1/settings', { + name: 'gen:timeFormat', + value: $scope.timeFormat + }, { + headers: { + 'Content-Type': 'application/json' + } + }).then(function successCallback() { + SettingsService.getSettings().timeFormat.value = $scope.timeFormat; + helpers.UI.showSnackbar('Setting Saved.', false); + }, function errorCallback(err) { + helpers.showSnackbar('Error: ' + err, true); + $log.error(err); + }); + }; + $scope.saveShortDateFormatClicked = function() { $http.put('/api/v1/settings', { name: 'gen:shortDateFormat', @@ -549,6 +572,24 @@ define([ 'Content-Type': 'application/json' } }).then(function successCallback() { + SettingsService.getSettings().shortDateFormat.value = $scope.shortDateFormat; + helpers.UI.showSnackbar('Setting Saved.', false); + }, function errorCallback(err) { + helpers.showSnackbar('Error: ' + err, true); + $log.error(err); + }); + }; + + $scope.saveLongDateFormatClicked = function() { + $http.put('/api/v1/settings', { + name: 'gen:longDateFormat', + value: $scope.longDateFormat + }, { + headers: { + 'Content-Type': 'application/json' + } + }).then(function successCallback() { + SettingsService.getSettings().longDateFormat.value = $scope.longDateFormat; helpers.UI.showSnackbar('Setting Saved.', false); }, function errorCallback(err) { helpers.showSnackbar('Error: ' + err, true); diff --git a/src/public/js/modules/chat.js b/src/public/js/modules/chat.js index ff72822f0..758628b59 100644 --- a/src/public/js/modules/chat.js +++ b/src/public/js/modules/chat.js @@ -528,7 +528,7 @@ define('modules/chat',[ html += ''; html += '
'; if (userMeta && userMeta.deletedAt) - html += '
Conversation deleted at ' + moment(userMeta.deletedAt).format('MM.D.YY \\at h:mma') + '
'; + html += '
Conversation deleted at ' + moment(userMeta.deletedAt).format(helpers.getShortDateFormat() + ' ' + helpers.getTimeFormat()) + '
'; html += '
'; html += '
'; html += '
'; diff --git a/src/public/js/modules/helpers.js b/src/public/js/modules/helpers.js index 9722fb766..a8ae82a93 100644 --- a/src/public/js/modules/helpers.js +++ b/src/public/js/modules/helpers.js @@ -1254,6 +1254,27 @@ function($, _, moment, UIkit, CountUp, Waves, Selectize, Snackbar, ROLES, Cookie return timezone; }; + helpers.getTimeFormat = function() { + if (window.trudeskSettingsService) + return window.trudeskSettingsService.getSettings().timeFormat.value; + else + return 'hh:mma'; + }; + + helpers.getCalendarDate = function(date) { + moment.updateLocale('en', { + calendar: { + sameDay: '[Today at] LT', + lastDay: '[Yesterday at] LT', + nextDay: '[Tomorrow at] LT', + lastWeek: '[Last] ddd [at] LT', + nextWeek: 'ddd [at] LT', + sameElse: helpers.getShortDateFormat() + } + }); + return moment.utc(date).tz(this.getTimezone()).calendar(); + }; + helpers.getShortDateFormat = function() { if (window.trudeskSettingsService) return window.trudeskSettingsService.getSettings().shortDateFormat.value; @@ -1261,6 +1282,13 @@ function($, _, moment, UIkit, CountUp, Waves, Selectize, Snackbar, ROLES, Cookie return 'MM/DD/YYYY'; }; + helpers.getLongDateFormat = function() { + if (window.trudeskSettingsService) + return window.trudeskSettingsService.getSettings().longDateFormat.value; + else + return 'MM/DD/YYYY h:mma'; + }; + helpers.formatDate = function(date, format) { var timezone = this.getTimezone(); if (!timezone) diff --git a/src/public/js/modules/ui.js b/src/public/js/modules/ui.js index 0d219f1e3..dfb0674ec 100644 --- a/src/public/js/modules/ui.js +++ b/src/public/js/modules/ui.js @@ -15,6 +15,7 @@ define('modules/ui', [ 'jquery', 'underscore', + 'uikit', 'modules/helpers', 'modules/navigation', 'modules/socket.io/noticeUI', @@ -22,7 +23,7 @@ define('modules/ui', [ 'modules/socket.io/logs.io', 'history' -], function($, _, helpers, nav, noticeUI, ticketsUI, logsIO) { +], function($, _, UIKit, helpers, nav, noticeUI, ticketsUI, logsIO) { var socketUi = {}, socket; @@ -737,7 +738,8 @@ define('modules/ui', [ '
' + '

Re: ' + ticket.subject + '

' + '' + item.owner.fullname + ' <' + item.owner.email + '>' + - '' + + '
' + + '' + '

' + item.comment + '

' + '
' + '
' + @@ -770,8 +772,10 @@ define('modules/ui', [ '
' + '

Re: ' + ticket.subject + '

' + '' + item.owner.fullname + ' <' + item.owner.email + '>' + - '' + - 'NOTE' + + '
' + + '' + + '
' + + 'NOTE' + '

' + item.note + '

' + '
' + '
' + @@ -810,7 +814,8 @@ define('modules/ui', [ '
' + '

Re: ' + ticket.subject + '

' + '' + comment.owner.fullname + ' <' + comment.owner.email + '>' + - '' + + '
' + + '' + '

' + comment.comment + '

' + '
' + '
' + @@ -848,8 +853,10 @@ define('modules/ui', [ '
' + '

Re: ' + ticket.subject + '

' + '' + note.owner.fullname + ' <' + note.owner.email + '>' + - '' + - 'NOTE' + + '
' + + '' + + '
' + + 'NOTE' + '

' + note.note + '

' + '
' + '
' + diff --git a/src/public/js/pages/dashboard.js b/src/public/js/pages/dashboard.js index 513bfa63d..db7d51667 100644 --- a/src/public/js/pages/dashboard.js +++ b/src/public/js/pages/dashboard.js @@ -103,7 +103,10 @@ define('pages/dashboard', [ method: 'GET', success: function (_data) { var lastUpdated = $('#lastUpdated').find('span'); - lastUpdated.text(_data.lastUpdated); + + var formatString = helpers.getLongDateFormat() + ' ' + helpers.getTimeFormat(); + var formated = moment(_data.lastUpdated, 'MM/DD/YYYY hh:mm:ssa').format(formatString); + lastUpdated.text(formated); if (!_data.data) { console.log('[trudesk:dashboard:getData] Error - Invalid Graph Data'); diff --git a/src/public/js/pages/messages.js b/src/public/js/pages/messages.js index 718b80e19..25ef0e5a3 100644 --- a/src/public/js/pages/messages.js +++ b/src/public/js/pages/messages.js @@ -186,14 +186,14 @@ define('pages/messages', [ if (left) { html += '
'; - html += ''; + html += ''; html += '
'; html += '

' + message.body + '

'; html += '
'; html += '
'; } else { html += '
'; - html += '
'; + html += '
'; html += '

' + message.body + '

'; html += '
'; html += '
'; diff --git a/src/sass/partials/tickets.sass b/src/sass/partials/tickets.sass index 1f2e19fda..be0a9ed88 100644 --- a/src/sass/partials/tickets.sass +++ b/src/sass/partials/tickets.sass @@ -337,7 +337,7 @@ div#accountsTable_wrapper font-family: $fontFamily font-size: 12px color: automatic-text-color($page_content_bg, 'muted') - display: block + //display: block margin-bottom: 4px margin-left: 2px diff --git a/src/sass/partials/trutab.sass b/src/sass/partials/trutab.sass index 4f74ca803..b04a02f9c 100644 --- a/src/sass/partials/trutab.sass +++ b/src/sass/partials/trutab.sass @@ -53,6 +53,7 @@ $size: 16px .uk-badge background: $accent_color !important + color: #fff .tru-tab-highlighter position: absolute diff --git a/src/sass/partials/ui.sass b/src/sass/partials/ui.sass index 6689c4751..3a6f09946 100644 --- a/src/sass/partials/ui.sass +++ b/src/sass/partials/ui.sass @@ -344,6 +344,7 @@ label.md-label padding: 2px 4px +borderRadius(2px) line-height: 12px + color: rgba(0,0,0,0.75) .uk-progress background: pre-color($page_content_right_bg) diff --git a/src/settings/settingsUtil.js b/src/settings/settingsUtil.js index 4856d78e0..67e94bde7 100644 --- a/src/settings/settingsUtil.js +++ b/src/settings/settingsUtil.js @@ -48,7 +48,10 @@ util.getSettings = function(callback) { s.siteTitle = parseSetting(settings, 'gen:sitetitle', 'Trudesk'); s.siteUrl = parseSetting(settings, 'gen:siteurl', ''); s.timezone = parseSetting(settings, 'gen:timezone', 'America/New_York'); + s.timeFormat = parseSetting(settings, 'gen:timeFormat', 'hh:mma'); s.shortDateFormat = parseSetting(settings, 'gen:shortDateFormat', 'MM/DD/YYYY'); + s.longDateFormat = parseSetting(settings, 'gen:longDateFormat', 'MM/DD/YYYY h:mma'); + s.hasCustomLogo = parseSetting(settings, 'gen:customlogo', false); s.customLogoFilename = parseSetting(settings, 'gen:customlogofilename', ''); s.hasCustomPageLogo = parseSetting(settings, 'gen:custompagelogo', false); diff --git a/src/views/layout/main.hbs b/src/views/layout/main.hbs index 5c2105935..9c9ba4c6e 100644 --- a/src/views/layout/main.hbs +++ b/src/views/layout/main.hbs @@ -129,7 +129,7 @@ font-weight: 500; text-align: center; padding-top: 7px;" {{#if data.common.notice}} class="" {{else}} class="uk-hidden" {{/if}}> - {{formatDate data.common.notice.activeDate "MM/DD/YYYY HH:mm"}} - Important: {{data.common.notice.message}} + {{formatDate data.common.notice.activeDate (concat data.common.shortDateFormat data.common.timeFormat true true)}} - Important: {{data.common.notice.message}}
{{> topbar }} diff --git a/src/views/messages.hbs b/src/views/messages.hbs index 4dd8d18bd..90d1fb391 100644 --- a/src/views/messages.hbs +++ b/src/views/messages.hbs @@ -105,9 +105,9 @@ {{#if data.conversation}}
- Conversation Started on {{formatDate data.conversation.createdAt 'MMM Do YYYY \at h:mma'}} + Conversation Started on {{formatDate data.conversation.createdAt (concat data.common.longDateFormat data.common.timeFormat true true)}} {{#if data.conversation.requestingUserMeta.deletedAt}} - Conversation Deleted at {{formatDate data.conversation.requestingUserMeta.deletedAt 'MMM Do YYYY \at h:mma'}} + Conversation Deleted at {{formatDate data.conversation.requestingUserMeta.deletedAt (concat data.common.longDateFormat data.common.timeFormat true true)}} {{/if}}
@@ -121,13 +121,13 @@ src="/uploads/users/{{owner.image}}" data-userid="{{owner._id}}" data-uk-tooltip="{pos:'left', animation: false}" - title="{{formatDate createdAt 'MM/DD/YY h:mma'}}"/> + title="{{formatDate createdAt (concat ../data.common.shortDateFormat ../data.common.timeFormat true) }}"/> {{else}} + title="{{formatDate createdAt (concat ../data.common.shortDateFormat ../data.common.timeFormat true)}}"/> {{/if}}

{{{body}}}

@@ -135,7 +135,7 @@
{{else}}
-
+

{{{body}}}

diff --git a/src/views/partials/noticeAlertWindow.hbs b/src/views/partials/noticeAlertWindow.hbs index f2dc29e38..cea329431 100644 --- a/src/views/partials/noticeAlertWindow.hbs +++ b/src/views/partials/noticeAlertWindow.hbs @@ -7,7 +7,7 @@

{{data.common.notice.name}}

-

{{formatDate data.common.notice.activeDate "MM/DD/YYYY HH:mm"}} - Important: {{data.common.notice.message}}

+

{{formatDate data.common.notice.activeDate (concat data.common.shortDateFormat data.common.timeFormat true true)}} - Important: {{data.common.notice.message}}

diff --git a/src/views/partials/topbar/messages.hbs b/src/views/partials/topbar/messages.hbs index abd72b863..d87510038 100644 --- a/src/views/partials/topbar/messages.hbs +++ b/src/views/partials/topbar/messages.hbs @@ -20,7 +20,7 @@ {{recentMessage}}
- +
diff --git a/src/views/partials/topbar/notifications.hbs b/src/views/partials/topbar/notifications.hbs index 7436ad2a4..cb55c621d 100644 --- a/src/views/partials/topbar/notifications.hbs +++ b/src/views/partials/topbar/notifications.hbs @@ -23,7 +23,7 @@ {{message}}
- +
diff --git a/src/views/partials/viewAllNotifications.hbs b/src/views/partials/viewAllNotifications.hbs index 4d4a0a9e7..2f9b2f2fd 100644 --- a/src/views/partials/viewAllNotifications.hbs +++ b/src/views/partials/viewAllNotifications.hbs @@ -25,7 +25,7 @@
- + {{/each}} diff --git a/src/views/settings.hbs b/src/views/settings.hbs index 149de3894..3cfd67baa 100644 --- a/src/views/settings.hbs +++ b/src/views/settings.hbs @@ -2,7 +2,6 @@ siteTitle='{{data.settings.siteTitle.value}}'; siteUrl='{{data.settings.siteUrl.value}}'; selectedTimezone='{{data.settings.timezone.value}}'; - shortDateFormat='{{data.settings.shortDateFormat.value}}'; defaultTicketType='{{data.settings.defaultTicketType.value}}'; minSubjectLength={{data.settings.minSubjectLength.value}}; @@ -171,17 +170,60 @@
-
Short Date Format
+
Time & Date Fromat
- Set the format for short dates. Moment.js Format Options + Moment.js Format Options
-
- -
-
- +
+
+
+
+
+
+
+
Time Format
+

Set the format for time.

+
+
+
+ +
+
+ +
+
+
+
+
+
Sort Date Format
+

Set the format for short dates.

+
+
+
+ +
+
+ +
+
+
+
+
+
Long Date Format
+

Set the format for long dates.

+
+
+
+ +
+
+ +
+
+
+
diff --git a/src/views/subviews/printticket.hbs b/src/views/subviews/printticket.hbs index 8f75b4a13..a8955b9e6 100644 --- a/src/views/subviews/printticket.hbs +++ b/src/views/subviews/printticket.hbs @@ -101,7 +101,10 @@

{{data.ticket.subject}}

{{{data.ticket.owner.fullname}}} <{{{data.ticket.owner.email}}}> - +
+ +
+
{{{data.ticket.issue}}}
@@ -118,7 +121,9 @@

Re: {{../data.ticket.subject}}

{{{owner.fullname}}} <{{{owner.email}}}> - +
+ +

{{{comment}}}

@@ -131,7 +136,7 @@ {{#foreach data.ticket.history}}
{{description}}
-
By {{owner.fullname}} at {{formatDate date "MMM DD, h:mma"}}
+
By {{owner.fullname}} - {{formatDate date (concat ../data.common.longDateFormat ../data.common.timeFormat true true)}}

diff --git a/src/views/subviews/reports/generate_partials/report_TicketsByGroup.hbs b/src/views/subviews/reports/generate_partials/report_TicketsByGroup.hbs index ba01aea95..cde56c9ab 100644 --- a/src/views/subviews/reports/generate_partials/report_TicketsByGroup.hbs +++ b/src/views/subviews/reports/generate_partials/report_TicketsByGroup.hbs @@ -29,7 +29,7 @@
-
-
-
-
-
- {{#each data.ticket.history}}
- + Action by: {{owner.fullname}}

{{description}}

@@ -245,9 +245,13 @@

{{data.ticket.subject}}

- + {{{data.ticket.owner.fullname}}} <{{{data.ticket.owner.email}}}> - +
+ +
    {{#each data.ticket.attachments}}
  • @@ -340,9 +344,15 @@

    Re: {{../data.ticket.subject}}

    {{{owner.fullname}}} <{{{owner.email}}}> - +
    + {{#is isNote true}} - NOTE +
    + NOTE {{/is}}
    {{#is isNote true}} @@ -418,8 +428,14 @@

    Re: {{../data.ticket.subject}}

    {{{owner.fullname}}} <{{{owner.email}}}> - - NOTE +
    + +
    + NOTE

    {{{note}}}

    @@ -496,7 +512,12 @@

    Re: {{../data.ticket.subject}}

    {{{owner.fullname}}} <{{{owner.email}}}> - +
    +

    {{{comment}}}

    @@ -573,8 +594,14 @@

    Re: {{../data.ticket.subject}}

    {{{owner.fullname}}} <{{{owner.email}}}> - - NOTE +
    + +
    + NOTE

    {{{note}}}

    diff --git a/src/views/tickets.hbs b/src/views/tickets.hbs index 9a8c669ac..5aa7ea31e 100644 --- a/src/views/tickets.hbs +++ b/src/views/tickets.hbs @@ -129,7 +129,7 @@ New {{uid}} {{subject}} - {{{formatDate date "MMM DD, YY"}}} + {{{formatDate date ../data.common.shortDateFormat}}} {{owner.fullname}} {{group.name}} @@ -141,7 +141,7 @@ {{#isNotNull updated}} - {{formatDate updated "MMM DD \at h:mma"}} + {{formatDate updated (concat ../data.common.shortDateFormat ../data.common.timeFormat true true)}} {{else}} -- {{/isNotNull}} @@ -162,7 +162,7 @@ Open {{uid}} {{subject}} - {{{formatDate date "MMM DD, YY"}}} + {{{formatDate date ../data.common.shortDateFormat}}} {{owner.fullname}} {{group.name}} @@ -174,7 +174,7 @@ {{#isNotNull updated}} - {{formatDate updated "MMM DD \at h:mma"}} + {{formatDate updated (concat ../data.common.shortDateFormat ../data.common.timeFormat true)}} {{else}} -- {{/isNotNull}} @@ -195,7 +195,7 @@ Pending {{uid}} {{subject}} - {{{formatDate date "MMM DD, YY"}}} + {{{formatDate date ../data.common.shortDateFormat}}} {{owner.fullname}} {{group.name}} @@ -207,7 +207,7 @@ {{#isNotNull updated}} - {{formatDate updated "MMM DD \at h:mma"}} + {{formatDate updated ../data.common.longDateFormat}} {{else}} -- {{/isNotNull}} @@ -223,7 +223,7 @@ Closed {{uid}} {{subject}} - {{{formatDate date "MMM DD, YY"}}} + {{{formatDate date ../data.common.shortDateFormat}}} {{owner.fullname}} {{group.name}} @@ -235,7 +235,7 @@ {{#isNotNull updated}} - {{formatDate updated "MMM DD \at h:mma"}} + {{formatDate updated ../data.common.longDateFormat}} {{else}} -- {{/isNotNull}}