feat: Implement admin-only specialties management interface
Playwright Tests / test (push) Canceled after 0s
Playwright Tests / test (push) Canceled after 0s
- Added MailerAttachmentPolicy for validating email attachments against server rules. - Introduced fis.specialties.js for managing hidden maintenance actions via an admin interface. - Created fis.specialties.scss for styling the specialties management UI. - Added German localization for specialties management in fis.specialties_txt_de.js. - Developed CSS for specialties management in fis.specialties.css. - Implemented server-side stored procedure fds__admin_backupAndClearInvoiceFile for backing up and clearing invoice files. - Created fds__invoice_file_backups table to store backup records of invoice files.
This commit is contained in:
@@ -12,21 +12,23 @@
|
||||
})();
|
||||
|
||||
/* "Administration" is a single sidemenu dropdown (ocmsmenu supports nested items via `itm`)
|
||||
containing three buttons — Benutzerverwaltung (fn=usr), Gruppenverwaltung (fn=usrgrp) and
|
||||
Systemüberwachung (fn=admin) — all restricted to users whose fds_sys authorization exceeds 4.
|
||||
One auth check gates the whole dropdown; it (and therefore all module scripts) is only added
|
||||
after that check resolves, so lower-privileged users never see it or fetch any module's code.
|
||||
Called from fis_main_go.js once the DOM (and the initial main menu) is ready. */
|
||||
containing four buttons — Benutzerverwaltung (fn=usr), Gruppenverwaltung (fn=usrgrp),
|
||||
Systemüberwachung (fn=admin) and Spezialfunktionen (fn=specialties) — all restricted to users
|
||||
whose fds_sys authorization exceeds 4. One auth check gates the whole dropdown; it (and
|
||||
therefore all module scripts) is only added after that check resolves, so lower-privileged
|
||||
users never see it or fetch any module's code. Called from fis_main_go.js once the DOM (and
|
||||
the initial main menu) is ready. Returns a promise that settles once the menu is final. */
|
||||
$fis.addAdminMenuButtonsIfAuthorized = function () {
|
||||
if ($('#m_admin_grp').length > 0) { return; } // idempotent
|
||||
$fis.getAuth('fds_sys').then(function (auth) {
|
||||
if ($('#m_admin_grp').length > 0) { return Promise.resolve(); } // idempotent
|
||||
return $fis.getAuth('fds_sys').then(function (auth) {
|
||||
if ((auth || -1) > 4 && $('#m_admin_grp').length === 0) {
|
||||
$ocms.ocmsmenu.push({
|
||||
lbl: $t.m_admin, id: 'm_admin_grp', ico: 'glyphicon glyphicon-cog',
|
||||
itm: [
|
||||
{ lbl: $t.m_usr, id: 'm_usr', fnc: 'init:usr', ico: 'glyphicon glyphicon-user' },
|
||||
{ lbl: $t.m_usrgrp, id: 'm_usrgrp', fnc: 'init:usrgrp', ico: 'glyphicon glyphicon-list' },
|
||||
{ lbl: $t.m_admin_status, id: 'm_admin', fnc: 'init:admin', ico: 'glyphicon glyphicon-dashboard' }
|
||||
{ lbl: $t.m_admin_status, id: 'm_admin', fnc: 'init:admin', ico: 'glyphicon glyphicon-dashboard' },
|
||||
{ lbl: $t.m_specialties, id: 'm_specialties', fnc: 'init:specialties', ico: 'glyphicon glyphicon-wrench' }
|
||||
]
|
||||
});
|
||||
/* Re-render the main menu cleanly: drop the previously generated menu list
|
||||
@@ -35,4 +37,23 @@ $fis.addAdminMenuButtonsIfAuthorized = function () {
|
||||
$('#mainmenu').ocmsmenu($ocms.ocmsmenu);
|
||||
}
|
||||
}).catch(function () { /* auth lookup failed → leave the menu unchanged */ });
|
||||
};
|
||||
|
||||
/* Deep link: the server renders the same SPA shell for every /{fn} URL (IntranetController.Index
|
||||
ignores fn), so opening e.g. /specialties directly would otherwise just show the dashboard.
|
||||
Opens the module named by the first path segment — but only one the user's menu actually
|
||||
offers (`init:<fn>` item, incl. the admin dropdown), so arbitrary paths, /do/… links and
|
||||
pre-auth flows never trigger a module load. Must run after the admin menu settled. */
|
||||
$fis.openModuleFromPath = function () {
|
||||
let fn = (window.location.pathname.split('/')[1] || '').toLowerCase();
|
||||
if (!/^[a-z]+$/.test(fn) || fn === 'home') { return; }
|
||||
let offered = false;
|
||||
let scan = function (items) {
|
||||
$.each(items || [], function (i, it) {
|
||||
if (it.fnc === 'init:' + fn) { offered = true; }
|
||||
if (it.itm) { scan(it.itm); }
|
||||
});
|
||||
};
|
||||
scan($ocms.ocmsmenu);
|
||||
if (offered) { $ocms.init(fn); }
|
||||
};
|
||||
Reference in New Issue
Block a user