Bugzilla – Attachment 52997 Details for
Bug 15128
Add ability to limit the number of open purchase suggestions a patron can make
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15128 (QA Followup) Display all purchase suggestions whether or not suggestion was added Correct enforcement of 0 limit
Bug-15128-QA-Followup-Display-all-purchase-suggest.patch (text/plain), 5.59 KB, created by
Nick Clemens
on 2016-06-30 14:22:07 UTC
(
hide
)
Description:
Bug 15128 (QA Followup) Display all purchase suggestions whether or not suggestion was added Correct enforcement of 0 limit
Filename:
MIME Type:
Creator:
Nick Clemens
Created:
2016-06-30 14:22:07 UTC
Size:
5.59 KB
patch
obsolete
>From 43340e4231885ee0a1638fa7118b9d2dc6e1c560 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Thu, 30 Jun 2016 10:20:39 -0400 >Subject: [PATCH] Bug 15128 (QA Followup) Display all purchase suggestions > whether or not suggestion was added Correct enforcement of 0 limit > >--- > .../opac-tmpl/bootstrap/en/modules/opac-suggestions.tt | 6 +++--- > opac/opac-suggestions.pl | 14 +++++++------- > 2 files changed, 10 insertions(+), 10 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt >index 3764852..a6a515a 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt >@@ -28,7 +28,7 @@ > <div class="span10"> > <div id="usersuggestions" class="maincontent"> > [% IF ( op_add ) %] >- [% IF ( Koha.Preference('MaxOpenSuggestions') && patrons_pending_suggestions_count >= Koha.Preference('MaxOpenSuggestions') ) %] >+ [% IF ( Koha.Preference('MaxOpenSuggestions') != '' && patrons_pending_suggestions_count >= Koha.Preference('MaxOpenSuggestions') ) %] > <h1 class="TooManySuggestions">You cannot place any more suggestions</h1> > <h2 class="TooManySuggestionsText">You have reached your limit of suggestions you can place at this time ([% Koha.Preference('MaxOpenSuggestions') %]). Once the library has processed those suggestions you will be able to place more.</h2> > [% ELSE %] >@@ -152,7 +152,7 @@ > <input type="hidden" name="op" value="delete_confirm" /> > [% IF ( loggedinusername || ( Koha.Preference( 'AnonSuggestions' ) == 1 ) ) %] > <div id="toolbar" class="toolbar clearfix"> >- [% IF ( Koha.Preference('MaxOpenSuggestions') && patrons_pending_suggestions_count >= Koha.Preference('MaxOpenSuggestions') ) %] >+ [% IF ( Koha.Preference('MaxOpenSuggestions') != '' && patrons_pending_suggestions_count >= Koha.Preference('MaxOpenSuggestions') ) %] > <p class="TooManySuggestionsText">You have reached your limit of suggestions you can place at this time ([% Koha.Preference('MaxOpenSuggestions') %]).</br>Once the library has processed those suggestions you will be able to place more.</p> > [% ELSE %] > <a class="new" href="/cgi-bin/koha/opac-suggestions.pl?op=add">New purchase suggestion</a> >@@ -256,7 +256,7 @@ > <p>There are no pending purchase suggestions.</p> > [% END %] > [% IF ( loggedinusername || ( Koha.Preference( 'AnonSuggestions' ) == 1 ) ) %] >- [% IF ( Koha.Preference('MaxOpenSuggestions') && patrons_pending_suggestions_count >= Koha.Preference('MaxOpenSuggestions') ) %] >+ [% IF ( Koha.Preference('MaxOpenSuggestions') != '' && patrons_pending_suggestions_count >= Koha.Preference('MaxOpenSuggestions') ) %] > <p class="TooManySuggestionsText">You have reached your limit of suggestions you can place at this time.</br>Once the library has processed those suggestions you will be able to place more</p> > [% ELSE %] > <p><a class="new" href="/cgi-bin/koha/opac-suggestions.pl?op=add">New purchase suggestion</a></p> >diff --git a/opac/opac-suggestions.pl b/opac/opac-suggestions.pl >index ff64dcb..26bc4f8 100755 >--- a/opac/opac-suggestions.pl >+++ b/opac/opac-suggestions.pl >@@ -119,7 +119,7 @@ if ( $borrowernumber ) { > > my $suggestions_loop = &SearchSuggestion($suggestion); > if ( $op eq "add_confirm" ) { >- if ( $patrons_pending_suggestions_count >= C4::Context->preference("MaxOpenSuggestions") ) #only check limit for signed in borrowers >+ if ( C4::Context->preference("MaxOpenSuggestions") ne '' && $patrons_pending_suggestions_count >= C4::Context->preference("MaxOpenSuggestions") ) #only check limit for signed in borrowers > { > push @messages, { type => 'error', code => 'too_many' }; > } >@@ -148,14 +148,14 @@ if ( $op eq "add_confirm" ) { > $suggestion->{branchcode} = $input->param('branchcode') || C4::Context->userenv->{"branch"}; > > &NewSuggestion($suggestion); >- >- # delete empty fields, to avoid filter in "SearchSuggestion" >- foreach my $field ( qw( title author publishercode copyrightdate place collectiontitle isbn STATUS ) ) { >- delete $suggestion->{$field}; #clear search filters (except borrower related) to show all suggestions after placing a new one >- } >- $suggestions_loop = &SearchSuggestion($suggestion); > push @messages, { type => 'info', code => 'success_on_inserted' }; >+ >+ } >+ # delete empty fields, to avoid filter in "SearchSuggestion" and load all suggestions for display >+ foreach my $field ( qw( title author publishercode copyrightdate place collectiontitle isbn STATUS ) ) { >+ delete $suggestion->{$field}; #clear search filters (except borrower related) to show all suggestions after placing a new one > } >+ $suggestions_loop = &SearchSuggestion($suggestion); > $op = 'else'; > } > >-- >2.1.4
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 15128
:
52452
|
52502
|
52596
|
52610
|
52611
|
52623
|
52624
|
52625
|
52626
|
52715
|
52716
|
52717
|
52718
|
52719
|
52720
|
52721
|
52722
|
52997
|
53033
|
53034
|
53037
|
53038
|
53039
|
53040
|
53041
|
53042
|
53043
|
53044
|
53045