library: proxy URL overrides, restore Quick Add header links

- OPAC_URL / STAFF_URL let Quick Add build correct links behind a reverse proxy
- restore the Catalogue/Staff header links (lost when the init block was
  rewritten) and verify them in the browser test

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013wi3ZSot4XbUViwRFgLpRf
This commit is contained in:
Claude
2026-11-06 11:09:11 +00:00
parent 76866e8bbc
commit 49c35f765b
3 changed files with 13 additions and 2 deletions
+7 -1
View File
@@ -294,7 +294,9 @@
input.focus();
}
const printLink = (from, to) => 'http://' + location.hostname + ':' + staffPort +
let staffBase = '';
const staffRoot = () => staffBase || ('http://' + location.hostname + ':' + staffPort);
const printLink = (from, to) => staffRoot() +
'/cgi-bin/koha/labels/label-print.pl?from=' + encodeURIComponent(from) + '&to=' + encodeURIComponent(to);
function rangeNote(text, from, to) {
@@ -370,6 +372,10 @@
const s = await api('/api/state');
types = s.types; if (!types[type]) type = 'BOOK'; typeButtons();
staffPort = s.staff_port; settings = s.settings || {}; shelf = settings.location || '';
staffBase = s.staff_url || '';
$('lnk-opac').href = s.opac_url ? s.opac_url + '/' : 'http://' + location.hostname + ':' + s.opac_port + '/';
$('lnk-staff').href = staffRoot() + '/';
$('lnk-labels').href = staffRoot() + '/cgi-bin/koha/labels/label-edit-range.pl';
if (s.locations && s.locations.length) {
const sel = $('shelf');
sel.replaceChildren(el('option', { value: '' }, '(not set / all in one place)'),