Loading src/Helpers/customParser.js +2 −2 Original line number Diff line number Diff line Loading @@ -189,7 +189,7 @@ define([ privatePdf = data.privateInternalUrl, result = ''; if (!(!pdfUrl || (privatePdf && Credentials.get('userRole') !== 'ROLE_ADMINISTRATOR'))) { if (pdfUrl && (!privatePdf || Credentials.userIsEditor())) { if (privatePdf) { result = '<i title="' + i18n.privateInternalUrl + '" class="documentPrivateInternalUrlIcon"></i>'; } else { Loading Loading @@ -243,7 +243,7 @@ define([ imgSrc = imgSrcPrefix + imagePath; var mustUseCredentials = useCredentials && typeof useCredentials === 'boolean'; if (mustUseCredentials && Credentials.get('userRole') !== 'ROLE_GUEST') { if (mustUseCredentials && !Credentials.userIsGuest()) { imgSrc += '?access_token=' + Credentials.get('accessToken'); } } Loading src/Helpers/legacy.js +2 −3 Original line number Diff line number Diff line Loading @@ -528,10 +528,9 @@ define([ 'SafeUrl': function(url, text, title) { var userRole = Credentials.get("userRole"), result; var result; if (userRole === "ROLE_ADMINISTRATOR" || userRole === "ROLE_OAG" || userRole === "ROLE_COLLABORATOR") { if (Credentials.userIsEditor()) { result = "<a href=" + url + " target='_blank' title='" + title + "'>" + text + "</a>"; } else { result = text; Loading src/Helpers/string.js +14 −16 Original line number Diff line number Diff line Loading @@ -10,6 +10,18 @@ define([ 'use strict'; var _dateFormat = function(value, mainFormat, altFormat) { if (!value) { return; } var format = ['en'].includes(dojoConfig.locale) ? altFormat : mainFormat, formatted = moment(value).format(format); return new handlebars.SafeString(formatted); }; return { bold: function(text) { Loading Loading @@ -48,26 +60,12 @@ define([ 'Date': function(value) { if (!value) { return; } var format = dojoConfig.locale === 'en' ? 'MM/DD/YYYY' : 'DD/MM/YYYY', formatted = moment(value).format(format); return new handlebars.SafeString(formatted); return _dateFormat(value, 'DD/MM/YYYY', 'MM/DD/YYYY'); }, DateTime: function(value) { if (!value) { return; } var format = dojoConfig.locale === 'en' ? 'MM/DD/YYYY HH:mm:ss' : 'DD/MM/YYYY HH:mm:ss', formatted = moment(value).format(format); return new handlebars.SafeString(formatted); return _dateFormat(value, 'DD/MM/YYYY HH:mm:ss', 'MM/DD/YYYY HH:mm:ss'); }, TextURL: function(url, text, title) { Loading Loading
src/Helpers/customParser.js +2 −2 Original line number Diff line number Diff line Loading @@ -189,7 +189,7 @@ define([ privatePdf = data.privateInternalUrl, result = ''; if (!(!pdfUrl || (privatePdf && Credentials.get('userRole') !== 'ROLE_ADMINISTRATOR'))) { if (pdfUrl && (!privatePdf || Credentials.userIsEditor())) { if (privatePdf) { result = '<i title="' + i18n.privateInternalUrl + '" class="documentPrivateInternalUrlIcon"></i>'; } else { Loading Loading @@ -243,7 +243,7 @@ define([ imgSrc = imgSrcPrefix + imagePath; var mustUseCredentials = useCredentials && typeof useCredentials === 'boolean'; if (mustUseCredentials && Credentials.get('userRole') !== 'ROLE_GUEST') { if (mustUseCredentials && !Credentials.userIsGuest()) { imgSrc += '?access_token=' + Credentials.get('accessToken'); } } Loading
src/Helpers/legacy.js +2 −3 Original line number Diff line number Diff line Loading @@ -528,10 +528,9 @@ define([ 'SafeUrl': function(url, text, title) { var userRole = Credentials.get("userRole"), result; var result; if (userRole === "ROLE_ADMINISTRATOR" || userRole === "ROLE_OAG" || userRole === "ROLE_COLLABORATOR") { if (Credentials.userIsEditor()) { result = "<a href=" + url + " target='_blank' title='" + title + "'>" + text + "</a>"; } else { result = text; Loading
src/Helpers/string.js +14 −16 Original line number Diff line number Diff line Loading @@ -10,6 +10,18 @@ define([ 'use strict'; var _dateFormat = function(value, mainFormat, altFormat) { if (!value) { return; } var format = ['en'].includes(dojoConfig.locale) ? altFormat : mainFormat, formatted = moment(value).format(format); return new handlebars.SafeString(formatted); }; return { bold: function(text) { Loading Loading @@ -48,26 +60,12 @@ define([ 'Date': function(value) { if (!value) { return; } var format = dojoConfig.locale === 'en' ? 'MM/DD/YYYY' : 'DD/MM/YYYY', formatted = moment(value).format(format); return new handlebars.SafeString(formatted); return _dateFormat(value, 'DD/MM/YYYY', 'MM/DD/YYYY'); }, DateTime: function(value) { if (!value) { return; } var format = dojoConfig.locale === 'en' ? 'MM/DD/YYYY HH:mm:ss' : 'DD/MM/YYYY HH:mm:ss', formatted = moment(value).format(format); return new handlebars.SafeString(formatted); return _dateFormat(value, 'DD/MM/YYYY HH:mm:ss', 'MM/DD/YYYY HH:mm:ss'); }, TextURL: function(url, text, title) { Loading