Bugzilla – Attachment 172248 Details for
Bug 33260
Show message queue on staff interface and make notices printable
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33260: (follow-up) Remove patron search as primary action
Bug-33260-follow-up-Remove-patron-search-as-primar.patch (text/plain), 8.54 KB, created by
Martin Renvoize (ashimema)
on 2024-10-01 08:25:58 UTC
(
hide
)
Description:
Bug 33260: (follow-up) Remove patron search as primary action
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2024-10-01 08:25:58 UTC
Size:
8.54 KB
patch
obsolete
>From b18bd2b783dcc9819e4b8ce617b289c3c69a9eb4 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Tue, 1 Oct 2024 09:24:23 +0100 >Subject: [PATCH] Bug 33260: (follow-up) Remove patron search as primary action > >This is a 'Notices' display tool, it doesn't make sense to me to >replicate the 'Patrons' search interface as the primary action of the >tool. >--- > .../prog/en/modules/tools/notices.tt | 54 +++----------- > tools/notices.pl | 72 +++++++++---------- > 2 files changed, 45 insertions(+), 81 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/notices.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/notices.tt >index 8ae7fe0f48c..9f0e0d90d7d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/notices.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/notices.tt >@@ -7,10 +7,6 @@ > [% PROCESS 'i18n.inc' %] > [% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %] >-[% PROCESS "patron-search.inc" %] >-[% SET libraries = Branches.all %] >-[% SET categories = Categories.all.unblessed %] >-[% SET columns = ['name', 'cardnumber', 'dateofbirth', 'category', 'branch', 'address', 'phone'] %] > <title>[% FILTER collapse %] > [% t("Notices management") | html %] › > [% t("Tools") | html %] › >@@ -50,9 +46,16 @@ > > <h1>Notices management</h1> > >- <div class="dialog message">Printing a notice will mark it as sent.</div> >+ <div class="page-section bg-warning">Printing a notice will mark it as sent.</div> >+ >+ [% IF notices.count == 0 %] >+ >+ <div class="page-section bg-info"> >+ No sent notices were found with those search parameters. >+ </div> >+ >+ [% ELSE %] > >- [% IF notices && notices.count > 0 %] > <div class="page-section"> > <span id="checkbox_actions"><a href="#" class="select_all"><i class="fa fa-check"></i> Select all</a> | <a href="#" class="clear_all"><i class="fa fa-remove"></i> Clear all</a></span> > <form id="print_multiple" action="/cgi-bin/koha/tools/print_notice.pl" method="post" target="_blank"> >@@ -92,30 +95,6 @@ > </form> > </div> > >- [% ELSE %] >- >- Use the search form on the left to find sent notices, or go directly to a patron's notices. >- >- [% WRAPPER tabs id= "notices_patronsearch" %] >- [% WRAPPER tabs_nav %] >- [% WRAPPER tab_item tabname= "notices_patronsearch_pane" bt_active= 1 %] <span>Patrons</span> [% END %] >- [% END %] >- [% WRAPPER tab_panels %] >- [% WRAPPER tab_panel tabname="notices_patronsearch_pane" bt_active= 1 %] >- [% PROCESS patron_search_filters_simple %] >- [% PROCESS patron_search_table table_id => 'table_borrowers', open_on_row_click => 1 %] >- [% END %] >- [% END %] >- [% END %] >- >- [% IF notices && notices.count == 0 %] >- >- <div class="dialog message"> >- No sent notices were found with those search parameters. >- </div> >- >- [% END %] >- > [% END %] > > </main> >@@ -124,9 +103,7 @@ > <div class="col-md-2 order-md-1 order-sm-1"> > <aside> > <fieldset class="sidebar brief"> >- <form id="notices-search" action="/cgi-bin/koha/tools/notices.pl" method="post"> >- [% INCLUDE 'csrf-token.inc' %] >- <input type="hidden" name="op" value="cud-search"> >+ <form id="notices-search" action="/cgi-bin/koha/tools/notices.pl" method="get"> > <h3>Search filters</h3> > <ol> > <li> >@@ -248,7 +225,6 @@ > [% INCLUDE 'datatables.inc' %] > > <script> >- table_settings = [% TablesSettings.GetColumns( 'circ', 'circulation', 'table_borrowers', 'json' ) | $raw %]; > $(document).ready(function() { > $("#notices").dataTable($.extend(true, {}, dataTablesDefaults, { > "aoColumnDefs": [ >@@ -273,13 +249,6 @@ > $("#noticeModal .modal-body").html(""); > }); > >- $("#notices_patronsearch").on("submit", filter); >- [% UNLESS notices %] >- [% IF ( Koha.Preference('PatronAutoComplete') ) %] >- patron_autocomplete($(".search_patron_filter"), { 'link-to': 'notices' }); >- [% END %] >- [% END %] >- > $("#print_multiple_button").click(function(e){ > var selected_notices = $("#print_multiple").find("input[name='message_ids']:checked"); > if ( selected_notices.length == 0 ) { >@@ -304,9 +273,6 @@ > }); > }); > </script> >- >- [% SET search_results_block_id = 'notices_patronsearch_pane_panel' %] [%# adjusting variable for patron-search.inc %] >- [% PROCESS patron_search_js table_id => 'table_borrowers', categories => categories, libraries => libraries, columns => columns, open_on_row_click => 1, on_click_url => '/cgi-bin/koha/members/notices.pl?', redirect_if_one_result => 1, redirect_url => '/cgi-bin/koha/members/notices.pl?', redirect_if_attribute_equal => 'cardnumber' %] > [% END %] > > [% INCLUDE 'intranet-bottom.inc' %] >diff --git a/tools/notices.pl b/tools/notices.pl >index a241593636b..4e687ae2c37 100755 >--- a/tools/notices.pl >+++ b/tools/notices.pl >@@ -39,47 +39,45 @@ unless ( C4::Context->preference('NoticesManagement') ) { > > my $op = $query->param('op'); > >-if ( $op and $op eq 'cud-search' ) { >- my $letter_code = $query->param('letter_code') || undef; >- my $categorycode = $query->param('categorycode') || undef; >- my $branchcode = $query->param('branchcode') || undef; >- my $from = $query->param('from') || undef; >- my $to = $query->param('to') || undef; >- my $status = $query->param('status') || undef; >+my $letter_code = $query->param('letter_code') || undef; >+my $categorycode = $query->param('categorycode') || undef; >+my $branchcode = $query->param('branchcode') || undef; >+my $from = $query->param('from') || undef; >+my $to = $query->param('to') || undef; >+my $status = $query->param('status') || undef; > >- my %where = (); >- $where{'me.letter_code'} = $letter_code if ($letter_code); >- $where{'borrowernumber.categorycode'} = $categorycode if ($categorycode); >- $where{'borrowernumber.branchcode'} = $branchcode if ($branchcode); >- if ($from) { >- if ($to) { >- $where{'me.time_queued'} = [ >- -and => { '<=', $to }, >- { '>=', $from } >- ]; >- } else { >- $where{'me.time_queued'} = { '>=', $from }; >- } >- } elsif ($to) { >- $where{'me.time_queued'} = { '<=', $to }; >+my %where = (); >+$where{'me.letter_code'} = $letter_code if ($letter_code); >+$where{'borrowernumber.categorycode'} = $categorycode if ($categorycode); >+$where{'borrowernumber.branchcode'} = $branchcode if ($branchcode); >+if ($from) { >+ if ($to) { >+ $where{'me.time_queued'} = [ >+ -and => { '<=', $to }, >+ { '>=', $from } >+ ]; >+ } else { >+ $where{'me.time_queued'} = { '>=', $from }; > } >- $where{'me.status'} = $status if ($status); >+} elsif ($to) { >+ $where{'me.time_queued'} = { '<=', $to }; >+} >+$where{'me.status'} = $status if ($status); > >- my $notices = Koha::Notice::Messages->search_limited( >- {%where}, >- { order_by => { -desc => 'time_queued' } } >- ); >+my $notices = Koha::Notice::Messages->search_limited( >+ {%where}, >+ { order_by => { -desc => 'time_queued' } } >+); > >- $template->param( >- notices => $notices, >- letter_code => $letter_code, >- categorycode => $categorycode, >- branchcode => $branchcode, >- from => $from, >- to => $to, >- status => $status, >- ); >-} >+$template->param( >+ notices => $notices, >+ letter_code => $letter_code, >+ categorycode => $categorycode, >+ branchcode => $branchcode, >+ from => $from, >+ to => $to, >+ status => $status, >+); > > $template->param( > letters => Koha::Notice::Templates->search( >-- >2.46.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 33260
:
148437
|
148438
|
148439
|
148440
|
148943
|
149009
|
149413
|
149581
|
149593
|
149594
|
149595
|
149596
|
149597
|
149598
|
150346
|
150347
|
154927
|
154928
|
157383
|
157384
|
157385
|
157386
|
158852
|
158853
|
158854
|
158855
|
162570
|
162571
|
162572
|
162573
|
162574
|
162624
|
162625
|
162677
|
162678
|
162679
|
162680
|
162681
|
164783
|
164784
|
164785
|
164786
|
164787
|
165238
|
165239
|
165717
|
165939
|
165946
|
165947
|
165948
|
165949
|
165950
|
165951
|
166020
|
166178
|
166335
|
166336
|
166337
|
166338
|
166339
|
166340
|
166341
|
166342
|
166343
|
166344
|
166345
|
166362
|
166363
|
166364
|
166365
|
166366
|
166367
|
166368
|
166369
|
166370
|
166371
|
166372
|
166373
|
167909
|
167910
|
167911
|
167912
|
167913
|
167914
|
167915
|
167916
|
167917
|
167918
|
167919
|
167920
|
172247
|
172248
|
172303
|
172307
|
172308
|
172309
|
172310
|
172311
|
172312
|
172313
|
172314
|
172315
|
172316
|
172317
|
172318
|
172319
|
172320
|
172321
|
172322
|
172342
|
172343
|
172344
|
172345
|
172346
|
172347
|
172348
|
172349
|
172350
|
172351
|
172352
|
172353
|
172354
|
172355
|
172356
|
172357
|
172358
|
172359
|
172379
|
175501
|
175502
|
175503
|
175504
|
175505
|
175506
|
175507
|
175508
|
175509
|
175510
|
175511
|
175512
|
175513
|
175514
|
175515
|
175516
|
175517
|
175518
|
175519
|
175520
|
175521
|
175522
|
175523
|
175524
|
175525
|
175530
|
175537
|
175538
|
175539
|
175540
|
175541
|
175542
|
175543
|
175544
|
175545
|
175546
|
175547
|
175548
|
175549
|
175550
|
175551
|
175552
|
175553
|
175554
|
175555
|
175556
|
175557
|
175558
|
175559
|
175560
|
175561
|
175562
|
175563
|
175730
|
175731
|
175732
|
175733
|
175734
|
175735
|
175736
|
175737
|
175738
|
175739
|
175740
|
175741
|
175742
|
175743
|
175744
|
175745
|
175746
|
175747
|
175748
|
175749
|
175750
|
175751
|
175752
|
175753
|
175754
|
175755
|
175756
|
178733
|
178734
|
178735
|
178736
|
178737
|
178738
|
178739
|
178740
|
178741
|
178742
|
178743
|
178744
|
178745
|
178746
|
178747
|
178748
|
178749
|
178750
|
178751
|
178752
|
178753
|
178754
|
178755
|
178756
|
178757
|
178758
|
178759