From 41711aa1340bcf4017c6bd7d4282daaa01471a60 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Mon, 14 Jul 2025 17:32:25 +0000 Subject: [PATCH] Bug 40366: Update the label export process to avoid Greybox modal This patch updates the label export process to eliminate the use of the Greybox modal, opting to move from page to page through the process. Tangentially related: I updated the DataTables table configuration of the tables on the label batch management page and label batch edit page in order to remove the DataTables "Export" button because of the possibility that its presence might be confusing. To test apply the patch and go to Cataloging -> Label creator. - Create more than one batch add multiple items to each. - From the label batches page, test the process of exporting labels, observing at each step the page title and breadcrumbs. - Check a box next to a single batch and click the "Export selected" button at the bottom. - Check multiple boxes and click "Export selected." - Click "Edit" on one of the batches - In the list of items, check one or more checkboxes, and click "Export select items." - Click an individual "Export" button from the list of items. - Click "Export full batch" - In each case, you should be forwarded to a new page for choosing label options. - After submitting the form, you should be forwarded to another page where you have options for downloading the batch as a PDF, CSV, or XML. - Test the new "Return to label batches" to confirm that it takes you to the label batches page. Sponsored-by: Athens County Public Libraries Signed-off-by: Caroline Cyr La Rose --- .../en/modules/labels/label-edit-batch.tt | 7 +- .../en/modules/labels/label-edit-range.tt | 2 +- .../prog/en/modules/labels/label-manage.tt | 3 +- .../prog/en/modules/labels/label-print.tt | 81 +++++++++++-------- 4 files changed, 55 insertions(+), 38 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-batch.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-batch.tt index aca2b0a4511..68c60a9c14d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-batch.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-batch.tt @@ -315,9 +315,9 @@ alert(_("Please select at least one label to export.")); return; // no batch selected } - return GB_showCenter(_("Export labels"), "/cgi-bin/koha/labels/label-print.pl?batch_id=[% batch_id | html %]&" + getstr, 400, 800); + location.href = "/cgi-bin/koha/labels/label-print.pl?batch_id=[% batch_id | html %]&" + getstr; } else if (mode == 'batch') { - return GB_showCenter(_("Export labels"), "/cgi-bin/koha/labels/label-print.pl?batch_id=[% batch_id | html %]", 400, 800); + location.href = "/cgi-bin/koha/labels/label-print.pl?batch_id=[% batch_id | html %]"; } else { // some pass-through error trapping just in case... } @@ -347,6 +347,7 @@ $("#description").hide(); [% END %] $("#batcht").kohaTable({ + dom: '<"dt-info"i><"top pager"<"table_entries"lp><"table_controls"f>>tr<"bottom pager"ip>', autoWidth: false, order: [[0, "asc"]], pagingType: "full", @@ -379,7 +380,7 @@ e.preventDefault(); var label_id = $(this).data("label-id"); var batch_id = $(this).data("batch-id"); - GB_showCenter(_("Export labels"),"/cgi-bin/koha/labels/label-print.pl?batch_id=" + batch_id + "&label_id=" + label_id, 400, 800); + location.href = "/cgi-bin/koha/labels/label-print.pl?batch_id=" + batch_id + "&label_id=" + label_id; }); $("#savedesc").click(function(event){ event.preventDefault(); // prevent form submission diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-range.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-range.tt index d901797855b..11c7881f002 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-range.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-range.tt @@ -61,7 +61,7 @@ var str = ""; str += "from=" + document.getElementById("from-input").value + "&"; str += "to=" + document.getElementById("to-input").value; - return GB_showCenter("Export labels", "/cgi-bin/koha/labels/label-print.pl?" + str, 400, 800); + location.href = "/cgi-bin/koha/labels/label-print.pl?" + str; } function checkTwoValue(_from, _to, _id) { diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-manage.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-manage.tt index 1d87edfb4f0..853fe5dc61b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-manage.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-manage.tt @@ -180,7 +180,7 @@ alert(_("Please select at least one batch to export.")); return; // no batch selected } - return GB_showCenter(_("Export labels"), "/cgi-bin/koha/labels/label-print.pl?" + getstr, 400, 800); + location.href = "/cgi-bin/koha/labels/label-print.pl?" + getstr; } function selected_layout(op) { var selected = new Array; @@ -216,6 +216,7 @@ return confirmDelete( _("Are you sure you want to delete this?") ); }); $("#labels-table").kohaTable({ + dom: '<"dt-info"i><"top pager"<"table_entries"lp><"table_controls"f>>tr<"bottom pager"ip>', pagingType: "full", order: [[1, "asc"]], }); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-print.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-print.tt index 13a88037a26..6bb88091a2b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-print.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-print.tt @@ -1,12 +1,13 @@ [% USE raw %] +[% PROCESS 'i18n.inc' %] [% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] -[% FILTER collapse %] - [% t("Label printing/exporting") | html %] - › [% t("Label creator") | html %] › [% t("Tools") | html %] › [% t("Koha") | html %] - [% END %] + + [% FILTER collapse %] + [% t("Label export") | html %] + › [% t("Label creator") | html %] › [% t("Cataloging") | html %] › [% t("Koha") | html %] + [% END %] + [% INCLUDE 'doc-head-close.inc' popup => 1 %] - -
- [% INCLUDE 'messages.inc' %] -

Label printing/exporting

+ +[% WRAPPER 'header.inc' %] + [% INCLUDE 'cat-search.inc' %] +[% END %] + +[% WRAPPER 'sub-header.inc' %] + [% WRAPPER breadcrumbs %] + [% WRAPPER breadcrumb_item %] + Cataloging + [% END %] + [% WRAPPER breadcrumb_item %] + Label creator + [% END %] + [% WRAPPER breadcrumb_item %] + Label batches + [% END %] + [% WRAPPER breadcrumb_item bc_active= 1 %] + Label export + [% END %] + [% END #/ WRAPPER breadcrumbs %] +[% END #/ WRAPPER sub-header.inc %] + +[% WRAPPER 'main-container.inc' %] +

Label export

[% IF ( batches ) %]
-

Click on the following links to download the exported batch(es).

+

Click any of the following links to download the exported batch

[% IF warn_empty_range %]

Some or all of the barcodes in the range you have selected have no corresponding items.

@@ -39,11 +60,14 @@
[% IF ( batche.label_ids ) %] [% IF ( batche.label_count == 1 ) %][% batche.label_count | html %] single label[% ELSE %][% batche.label_count | html %] single labels[% END %] - Download as PDF +

+ + Download as PDF + +

[% END %]

- + Return to label batches
[% ELSE %] @@ -127,7 +151,11 @@ [% ELSIF ( item_numbers ) %] [% IF ( item_count == 1 ) %]Exporting 1 label[% ELSE %]Exporting [% item_count | html %] labels[% END %] [% ELSE %] - [% IF ( multi_batch_count == 1 ) %]1 batch to export[% ELSE %][% multi_batch_count | html %] batches to export[% END %] + [% IF ( multi_batch_count == 1 ) %] + 1 batch to export + [% ELSE %] + [% multi_batch_count | html %] batches to export + [% END %] [% END %]
@@ -176,22 +204,9 @@
[% END %] -
- +[% END %] [% MACRO jsinclude BLOCK %] - [% Asset.js("js/tools-menu.js") | $raw %] - [% INCLUDE 'greybox.inc' %] - [% END %] -[% INCLUDE 'popup-bottom.inc' %] +[% INCLUDE 'intranet-bottom.inc' %] -- 2.43.0