Bugzilla – Attachment 184060 Details for
Bug 40366
Update the label export process to avoid Greybox modal
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 40366: Update the label export process to avoid Greybox modal
Bug-40366-Update-the-label-export-process-to-avoid.patch (text/plain), 11.22 KB, created by
Owen Leonard
on 2025-07-14 18:16:13 UTC
(
hide
)
Description:
Bug 40366: Update the label export process to avoid Greybox modal
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2025-07-14 18:16:13 UTC
Size:
11.22 KB
patch
obsolete
>From 5e92365c210fd00b56361332c953ee7b4b1a814d Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >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 >--- > .../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' %] >-<title >- >[% FILTER collapse %] >- [% t("Label printing/exporting") | html %] >- › [% t("Label creator") | html %] › [% t("Tools") | html %] › [% t("Koha") | html %] >- [% END %]</title >-> >+<title> >+ [% FILTER collapse %] >+ [% t("Label export") | html %] >+ › [% t("Label creator") | html %] › [% t("Cataloging") | html %] › [% t("Koha") | html %] >+ [% END %] >+</title> > [% INCLUDE 'doc-head-close.inc' popup => 1 %] > <style> > table { >@@ -22,13 +23,33 @@ > </style> > </head> > >-<body id="labels_label-print" class="tools labels"> >-<div class="main container-fluid"> >- [% INCLUDE 'messages.inc' %] >- <h1>Label printing/exporting</h1> >+<body id="labels_label-export-batch" class="tools labels"> >+[% WRAPPER 'header.inc' %] >+ [% INCLUDE 'cat-search.inc' %] >+[% END %] >+ >+[% WRAPPER 'sub-header.inc' %] >+ [% WRAPPER breadcrumbs %] >+ [% WRAPPER breadcrumb_item %] >+ <a href="/cgi-bin/koha/cataloguing/cataloging-home.pl">Cataloging</a> >+ [% END %] >+ [% WRAPPER breadcrumb_item %] >+ <a href="/cgi-bin/koha/labels/label-home.pl">Label creator</a> >+ [% END %] >+ [% WRAPPER breadcrumb_item %] >+ <a href="/cgi-bin/koha/labels/label-manage.pl?label_element=batch">Label batches</a> >+ [% END %] >+ [% WRAPPER breadcrumb_item bc_active= 1 %] >+ <span>Label export</span> >+ [% END %] >+ [% END #/ WRAPPER breadcrumbs %] >+[% END #/ WRAPPER sub-header.inc %] >+ >+[% WRAPPER 'main-container.inc' %] >+ <h1>Label export</h1> > [% IF ( batches ) %] > <form method="get"> >- <h3>Click on the following links to download the exported batch(es).</h3> >+ <h3>Click any of the following links to download the exported batch</h3> > [% IF warn_empty_range %] > <div class="alert alert-warning"> > <p>Some or all of the barcodes in the range you have selected have no corresponding items.</p> >@@ -39,11 +60,14 @@ > <fieldset> > [% IF ( batche.label_ids ) %] > <legend>[% IF ( batche.label_count == 1 ) %][% batche.label_count | html %] single label[% ELSE %][% batche.label_count | html %] single labels[% END %]</legend> >- <a >- class="document pdf" >- href="/cgi-bin/koha/labels/label-create-pdf.pl?batch_id=[% batche.batch_id | html %]&template_id=[% batche.template_id | html %]&layout_id=[% batche.layout_id | html %]&start_label=[% batche.start_label | html %][% batche.label_ids | html %]" >- >Download as PDF</a >- > >+ <p> >+ <a >+ class="document pdf" >+ href="/cgi-bin/koha/labels/label-create-pdf.pl?batch_id=[% batche.batch_id | html %]&template_id=[% batche.template_id | html %]&layout_id=[% batche.layout_id | html %]&start_label=[% batche.start_label | html %][% batche.label_ids | html %]" >+ > >+ Download as PDF >+ </a> >+ </p> > > <p > ><a >@@ -117,7 +141,7 @@ > </fieldset> > [% END %] > <fieldset class="action"> >- <input type="button" class="gb-close" value="Done" /> >+ <a href="/cgi-bin/koha/labels/label-manage.pl?label_element=batch" class="btn btn-default">Return to label batches</a> > </fieldset> > </form> > [% ELSE %] >@@ -127,7 +151,11 @@ > [% ELSIF ( item_numbers ) %] > [% IF ( item_count == 1 ) %]<span>Exporting 1 label</span>[% ELSE %]<span>Exporting [% item_count | html %] labels</span>[% END %] > [% ELSE %] >- [% IF ( multi_batch_count == 1 ) %]<span>1 batch to export</span>[% ELSE %]<span>[% multi_batch_count | html %] batches to export</span>[% END %] >+ [% IF ( multi_batch_count == 1 ) %] >+ <span>1 batch to export</span> >+ [% ELSE %] >+ <span>[% multi_batch_count | html %] batches to export</span> >+ [% END %] > [% END %] > </h3> > <form name="exporting" method="post" action="/cgi-bin/koha/labels/label-print.pl"> >@@ -176,22 +204,9 @@ > </fieldset> > </form> > [% END %] >-</div> >-<!-- /.main.container-fluid --> >+[% END %] > > [% MACRO jsinclude BLOCK %] >- [% Asset.js("js/tools-menu.js") | $raw %] >- [% INCLUDE 'greybox.inc' %] >- <script> >- function Done() { >- window.location = "[% referer | html %]"; >- }; >- $(document).ready(function(){ >- $(".gb-close").on("click",function(){ >- parent.parent.GB_hide(); >- }); >- }); >- </script> > [% END %] > >-[% INCLUDE 'popup-bottom.inc' %] >+[% INCLUDE 'intranet-bottom.inc' %] >-- >2.39.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 40366
:
184060
|
184062
|
184162
|
184169