Bugzilla – Attachment 103799 Details for
Bug 22515
OPACViewOthersSuggestions if set to Show will only show when patron has made a suggestion
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22515: Improve logic determining how to show OPAC suggestions
Bug-22515-Improve-logic-determining-how-to-show-OP.patch (text/plain), 5.33 KB, created by
Lucas Gass (lukeg)
on 2020-04-27 17:13:08 UTC
(
hide
)
Description:
Bug 22515: Improve logic determining how to show OPAC suggestions
Filename:
MIME Type:
Creator:
Lucas Gass (lukeg)
Created:
2020-04-27 17:13:08 UTC
Size:
5.33 KB
patch
obsolete
>From 19638ebbeca6fd50a25f90910c20843665554f11 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Mon, 27 Apr 2020 13:20:23 +0000 >Subject: [PATCH] Bug 22515: Improve logic determining how to show OPAC > suggestions > >This patch makes changes to the OPAC suggestions view so that the logic >around logged in users and the OPACViewOthersSuggestions preference is >more specific. > >To reproduce the bug you should have pending purchase susggestions in >your system from more than one patron. > >1. Set the OPACViewOthersSuggestions preference to "Show." >2. Log in to the OPAC as a user who has not submitted any suggestions. >3. Follow the link to the purchase suggestions page from the menu under > the search bar. >4. The page will say that there are no purchase suggestions. >5. Add "?suggested_by_anyone=1" to the end of the page URL. >6. You should see suggestions from other users. > >To test, apply the patch and repeat steps 2-3 above. The suggestions >page should show other patrons' suggestions. > >Test with different combinations of factors: > > - Logged in user, OPACViewOthersSuggestions off > - No logged in user, OPACViewOthersSuggestions on > - No logged in user, OPACViewOthersSuggestions off > >Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> >--- > koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc | 6 ++---- > .../opac-tmpl/bootstrap/en/modules/opac-suggestions.tt | 18 +++++++++++++++--- > 2 files changed, 17 insertions(+), 7 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc >index 6be6e8b8f1..45d50deea9 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc >@@ -309,10 +309,8 @@ > [% IF Koha.Preference( 'OpacTopissue' ) == 1 %]<li><a href="/cgi-bin/koha/opac-topissues.pl">Most popular</a></li>[% END %] > [% IF Koha.Preference('SearchEngine') == 'Elasticsearch' && Koha.Preference( 'OpacBrowseSearch' ) == 1 %]<li><a href="/cgi-bin/koha/opac-browse.pl">Browse search</a></li>[% END %] > [% IF Koha.Preference( 'suggestion' ) == 1 %] >- [% IF Koha.Preference( 'AnonSuggestions' ) == 1 %] >- <li><a href="/cgi-bin/koha/opac-suggestions.pl">Purchase suggestions</a></li> >- [% ELSIF ( ( Koha.Preference( 'OPACViewOthersSuggestions' ) == 1 ) ) %] >- <li><a href="/cgi-bin/koha/opac-suggestions.pl">Purchase suggestions</a></li> >+ [% IF Koha.Preference( 'AnonSuggestions' ) == 1 || Koha.Preference( 'OPACViewOthersSuggestions' ) == 1 %] >+ <li><a href="/cgi-bin/koha/opac-suggestions.pl?suggested_by_anyone=1">Purchase suggestions</a></li> > [% END %] > [% END %] > [% Koha.Preference('OpacMoreSearches') | $raw %] >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 b1cf132113..581c845110 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt >@@ -393,10 +393,22 @@ > [% END %] > </form> > [% ELSE %] >- [% UNLESS Koha.Preference( 'OPACViewOthersSuggestions' ) or loggedinusername %] >- <p>You are not authorized to see pending purchase suggestions.</p> >+ [% IF Koha.Preference( 'OPACViewOthersSuggestions' ) %] >+ [% IF ( loggedinusername ) %] >+ [% IF ( suggested_by_anyone ) %] >+ <p>There are no pending purchase suggestions.</p> >+ [% ELSE %] >+ <p>You have no pending purchase suggestions. <a href="/cgi-bin/koha/opac-suggestions.pl?suggested_by_anyone=1">View all suggestions</a></p> >+ [% END %] >+ [% ELSE %] >+ <p>There are no pending purchase suggestions.</p> >+ [% END %] > [% ELSE %] >- <p>There are no pending purchase suggestions.</p> >+ [% IF ( loggedinusername ) %] >+ <p>You have no pending purchase suggestions.</p> >+ [% ELSE %] >+ <p>You are not authorized to see pending purchase suggestions.</p> >+ [% END %] > [% END %] > [% IF ( loggedinusername || ( Koha.Preference( 'AnonSuggestions' ) == 1 ) ) %] > [% IF ( Koha.Preference('MaxTotalSuggestions') != '' && patrons_total_suggestions_count >= Koha.Preference('MaxTotalSuggestions') ) %] >-- >2.11.0
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 22515
:
103797
|
103799
|
104206