Bugzilla – Attachment 170143 Details for
Bug 37581
Use split button for label creator "new" operations
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37581: Use split button for label creator "new" operations
Bug-37581-Use-split-button-for-label-creator-new-o.patch (text/plain), 10.24 KB, created by
Owen Leonard
on 2024-08-07 14:52:53 UTC
(
hide
)
Description:
Bug 37581: Use split button for label creator "new" operations
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2024-08-07 14:52:53 UTC
Size:
10.24 KB
patch
obsolete
>From a49b1793c436d86622cf0c9c51d955cf29e78d18 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Tue, 6 Aug 2024 16:16:09 +0000 >Subject: [PATCH] Bug 37581: Use split button for label creator "new" > operations > >This patch modifies the "New" menu in the label creator so that it is a >split button instead of a simple menu. The primary button area will now >be a direct link to creating a new entry for whatever area you are in: >batches, labels, templates, or printer profiles. The secondary menu >offers all options. > >To test, apply the patch and go to Cataloging -> Labels. > >- On the label creator page, you should see a split button in the > toolbar. The text label should read "New label batch," and clicking it > should take you directly to creation of a new label batch. >- Clicking the secondary action of the menu item, the down-arrow, should > offer a menu of all the other "New" options. >- Confirm that the dropdown menu links all work correctly. >- Confirm that as you switch to different sections of the label creator > the default "new" action of the toolbar button changes: > - In label batches, "New label batch" > - In label layouts, "New label layout" > - In label templates, "New label template" > - In printer profiles, "New printer profiles" > - When you're on the "Print profile range" page, the default is "New > label batch" because there is no "new" action for that page, and > label batch seemed like a sensible default. > >Sponsored-by: Athens County Public Libraries >--- > .../prog/en/includes/labels-toolbar.inc | 31 +++++++++++++--- > labels/label-edit-batch.pl | 13 +++---- > labels/label-edit-layout.pl | 3 +- > labels/label-edit-profile.pl | 19 +++++----- > labels/label-edit-template.pl | 35 ++++++++++--------- > 5 files changed, 63 insertions(+), 38 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/labels-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/labels-toolbar.inc >index 982892f140..001388d66e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/labels-toolbar.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/labels-toolbar.inc >@@ -1,11 +1,32 @@ > <div id="toolbar" class="btn-toolbar"> > <div class="btn-group"> >- <button class="btn btn-default dropdown-toggle" data-toggle="dropdown"><i class="fa fa-plus"></i> New <span class="caret"></span></button> >+ [% SWITCH label_element %] >+ [% CASE "batch" %] >+ [% SET default_new = "/cgi-bin/koha/labels/label-edit-batch.pl?op=new" %] >+ [% SET new_label_element = "New label batch" %] >+ [% CASE "layout" %] >+ [% SET default_new = "/cgi-bin/koha/labels/label-edit-layout.pl?op=new" %] >+ [% SET new_label_element = "New label layout" %] >+ [% CASE "template" %] >+ [% SET default_new = "/cgi-bin/koha/labels/label-edit-template.pl?op=new" %] >+ [% SET new_label_element = "New label template" %] >+ [% CASE "profile" %] >+ [% SET default_new = "/cgi-bin/koha/labels/label-edit-profile.pl?op=new" %] >+ [% SET new_label_element = "New printer profile" %] >+ [% CASE %] >+ [% SET default_new = "/cgi-bin/koha/labels/label-edit-batch.pl?op=new" %] >+ [% SET new_label_element = "New label batch" %] >+ [% END %] >+ <a href="[% default_new | html %]" class="btn btn-default"><i class="fa fa-plus"></i> <span id="label-new">[% new_label_element | html %]</span> </a> >+ <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> >+ <span class="caret"></span> >+ <span class="sr-only">Toggle dropdown</span> >+ </button> > <ul class="dropdown-menu"> >- <li><a href="/cgi-bin/koha/labels/label-edit-batch.pl?op=new">Label batch</a></li> >- <li><a href="/cgi-bin/koha/labels/label-edit-layout.pl?op=new">Label layout</a></li> >- <li><a href="/cgi-bin/koha/labels/label-edit-template.pl?op=new">Label template</a></li> >- <li><a href="/cgi-bin/koha/labels/label-edit-profile.pl?op=new">Printer profile</a></li> >+ <li><a href="/cgi-bin/koha/labels/label-edit-batch.pl?op=new">New label batch</a></li> >+ <li><a href="/cgi-bin/koha/labels/label-edit-layout.pl?op=new">New label layout</a></li> >+ <li><a href="/cgi-bin/koha/labels/label-edit-template.pl?op=new">New label template</a></li> >+ <li><a href="/cgi-bin/koha/labels/label-edit-profile.pl?op=new">New printer profile</a></li> > </ul> > </div> > </div> >diff --git a/labels/label-edit-batch.pl b/labels/label-edit-batch.pl >index 1a8759b49b..bd8ebb987f 100755 >--- a/labels/label-edit-batch.pl >+++ b/labels/label-edit-batch.pl >@@ -133,11 +133,12 @@ $template->param( > ) if ($err ne 0); > > $template->param( >- op => $op, >- batch_id => $batch_id, >- table_loop => $table, >- duplicate_message => $duplicate_message, >- duplicate_count => $duplicate_count, >- ); >+ op => $op, >+ batch_id => $batch_id, >+ table_loop => $table, >+ duplicate_message => $duplicate_message, >+ duplicate_count => $duplicate_count, >+ label_element => "batch", >+); > > output_html_with_http_headers $cgi, $cookie, $template->output; >diff --git a/labels/label-edit-layout.pl b/labels/label-edit-layout.pl >index bb449d0ee7..325c265385 100755 >--- a/labels/label-edit-layout.pl >+++ b/labels/label-edit-layout.pl >@@ -157,6 +157,7 @@ $template->param( > scale_height => $layout->get_attr('scale_height'), > callnum_split => $layout->get_attr('callnum_split'), > format_string => $layout->get_attr('format_string'), >- layout_string => 1, # FIXME: This should not be hard-coded; It should perhaps be yet another syspref... CN >+ layout_string => 1, # FIXME: This should not be hard-coded; It should perhaps be yet another syspref... CN, >+ label_element => "layout", > ); > output_html_with_http_headers $cgi, $cookie, $template->output; >diff --git a/labels/label-edit-profile.pl b/labels/label-edit-profile.pl >index 2c1a28a51a..de92c70e92 100755 >--- a/labels/label-edit-profile.pl >+++ b/labels/label-edit-profile.pl >@@ -90,15 +90,16 @@ foreach my $unit (@$units) { > $template->param(profile_id => $profile->get_attr('profile_id')) if $profile->get_attr('profile_id') > 0; > > $template->param( >- label_template => $label_template[0]->{'template_code'} || '', >- printer_name => $profile->get_attr('printer_name'), >- paper_bin => $profile->get_attr('paper_bin'), >- offset_horz => $profile->get_attr('offset_horz'), >- offset_vert => $profile->get_attr('offset_vert'), >- creep_horz => $profile->get_attr('creep_horz'), >- creep_vert => $profile->get_attr('creep_vert'), >- units => $units, >- op => $op, >+ label_template => $label_template[0]->{'template_code'} || '', >+ printer_name => $profile->get_attr('printer_name'), >+ paper_bin => $profile->get_attr('paper_bin'), >+ offset_horz => $profile->get_attr('offset_horz'), >+ offset_vert => $profile->get_attr('offset_vert'), >+ creep_horz => $profile->get_attr('creep_horz'), >+ creep_vert => $profile->get_attr('creep_vert'), >+ units => $units, >+ op => $op, >+ label_element => "profile", > ); > > output_html_with_http_headers $cgi, $cookie, $template->output; >diff --git a/labels/label-edit-template.pl b/labels/label-edit-template.pl >index bd0ec604ab..323bb58d0d 100755 >--- a/labels/label-edit-template.pl >+++ b/labels/label-edit-template.pl >@@ -132,23 +132,24 @@ foreach my $unit (@$units) { > } > > $template->param( >- profile_list => $profile_list, >- template_id => ($label_template->get_attr('template_id') > 0) ? $label_template->get_attr('template_id') : '', >- template_code => $label_template->get_attr('template_code'), >- template_desc => $label_template->get_attr('template_desc'), >- page_width => $label_template->get_attr('page_width'), >- page_height => $label_template->get_attr('page_height'), >- label_width => $label_template->get_attr('label_width'), >- label_height => $label_template->get_attr('label_height'), >- top_text_margin => $label_template->get_attr('top_text_margin'), >- left_text_margin => $label_template->get_attr('left_text_margin'), >- top_margin => $label_template->get_attr('top_margin'), >- left_margin => $label_template->get_attr('left_margin'), >- cols => $label_template->get_attr('cols'), >- rows => $label_template->get_attr('rows'), >- col_gap => $label_template->get_attr('col_gap'), >- row_gap => $label_template->get_attr('row_gap'), >- units => $units, >+ profile_list => $profile_list, >+ template_id => ( $label_template->get_attr('template_id') > 0 ) ? $label_template->get_attr('template_id') : '', >+ template_code => $label_template->get_attr('template_code'), >+ template_desc => $label_template->get_attr('template_desc'), >+ page_width => $label_template->get_attr('page_width'), >+ page_height => $label_template->get_attr('page_height'), >+ label_width => $label_template->get_attr('label_width'), >+ label_height => $label_template->get_attr('label_height'), >+ top_text_margin => $label_template->get_attr('top_text_margin'), >+ left_text_margin => $label_template->get_attr('left_text_margin'), >+ top_margin => $label_template->get_attr('top_margin'), >+ left_margin => $label_template->get_attr('left_margin'), >+ cols => $label_template->get_attr('cols'), >+ rows => $label_template->get_attr('rows'), >+ col_gap => $label_template->get_attr('col_gap'), >+ row_gap => $label_template->get_attr('row_gap'), >+ units => $units, >+ label_element => "template", > ); > > output_html_with_http_headers $cgi, $cookie, $template->output; >-- >2.39.2
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 37581
:
170102
|
170143
|
170202