Bugzilla – Attachment 85403 Details for
Bug 14567
Add an elasticsearch driven browse interface to the OPAC
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14567: (follow-up) Add fixes and make syspref controlled
Bug-14567-follow-up-Add-fixes-and-make-syspref-con.patch (text/plain), 7.43 KB, created by
Nick Clemens (kidclamp)
on 2019-02-20 18:22:29 UTC
(
hide
)
Description:
Bug 14567: (follow-up) Add fixes and make syspref controlled
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2019-02-20 18:22:29 UTC
Size:
7.43 KB
patch
obsolete
>From 3eaa7844d599bc1299f340827a505c77bc0e3507 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Wed, 20 Feb 2019 18:19:28 +0000 >Subject: [PATCH] Bug 14567: (follow-up) Add fixes and make syspref controlled > >To test: >1 - Apply patches >2 - Run updatedatabase >3 - Browse to http://localhost:8080/cgi-bin/koha/opac-browse.pl >4 - Should see "Feature not enabled" >5 - Activate the pref >6 - Reload, page should now load and be in the nav at top of page >7 - Switch to zebra - page not enabled again, link gone >--- > .../atomicupdate/bug_14567_add_es_catalog_browse_syspref.perl | 10 ++++++++++ > installer/data/mysql/sysprefs.sql | 1 + > .../prog/en/modules/admin/preferences/searching.pref | 7 +++++++ > koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss | 4 ++-- > koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc | 1 + > koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-browse.tt | 6 +++++- > opac/opac-browse.pl | 2 +- > 7 files changed, 27 insertions(+), 4 deletions(-) > create mode 100644 installer/data/mysql/atomicupdate/bug_14567_add_es_catalog_browse_syspref.perl > >diff --git a/installer/data/mysql/atomicupdate/bug_14567_add_es_catalog_browse_syspref.perl b/installer/data/mysql/atomicupdate/bug_14567_add_es_catalog_browse_syspref.perl >new file mode 100644 >index 0000000000..ff6a26c702 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_14567_add_es_catalog_browse_syspref.perl >@@ -0,0 +1,10 @@ >+$DBversion = 'XXX'; >+if( CheckVersion( $DBversion ) ) { >+ $dbh->do(q{ >+ INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) >+ VALUES >+ ('BrowseInterface', '0',NULL, "Elasticsearch only: add a page allowing users to 'browse' all items in the collection",'YesNo') >+ }); >+ SetVersion( $DBversion ); >+ print "Upgrade to $DBversion done (Bug 14567: Add BrowseInterface syspref)\n"; >+} >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index d142b14a0e..3210082950 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/installer/data/mysql/sysprefs.sql >@@ -99,6 +99,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('BorrowersTitles','Mr|Mrs|Miss|Ms',NULL,'Define appropriate Titles for patrons','free'), > ('BorrowerUnwantedField','',NULL,'Name the fields you don\'t need to store for a patron\'s account','free'), > ('BranchTransferLimitsType','ccode','itemtype|ccode','When using branch transfer limits, choose whether to limit by itemtype or collection code.','Choice'), >+('BrowseInterface', '0',NULL, "Elasticsearch only: add a page allowing users to 'browse' all items in the collection",'YesNo'), > ('BrowseResultSelection','0',NULL,'Enable/Disable browsing search results fromt the bibliographic record detail page in staff client','YesNo'), > ('CalculateFinesOnReturn','1','','Switch to control if overdue fines are calculated on return or not','YesNo'), > ('CalendarFirstDayOfWeek','0','0|1|2|3|4|5|6','Select the first day of week to use in the calendar.','Choice'), >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref >index 8d8e17426d..7c4330947c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref >@@ -85,6 +85,13 @@ Searching: > yes: Enable > no: Disable > - "browsing search results from the bibliographic record detail page in staff client." >+ - >+ - pref: BrowseInterface >+ default: 0 >+ choices: >+ yes: Enable >+ no: Disable >+ - "(Elasticsearch only) Enable the interface allowing to browse all holdings." > Search Form: > - > - Load the unlogged history to the next user. >diff --git a/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss b/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss >index 29c61296c5..90a4ba5da2 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss >+++ b/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss >@@ -3364,7 +3364,7 @@ $star-selected: #EDB867; > } > #browse-searchresults, #browse-selectionsearch { > border: 1px solid #E3E3E3; >- .border-radius-all(4px); >+ border-radius: 4px; > padding: 0; > overflow-y: auto; > max-height: 31em; >@@ -3424,7 +3424,7 @@ $star-selected: #EDB867; > border: 1px solid #E8E8E8; > text-align: left; > padding: 0.5em; >- .border-radius-all(3px); >+ border-radius: 3px; > } > .loading { > text-align: center; >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc >index 9466c2d9c6..f3665eb3aa 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc >@@ -277,6 +277,7 @@ > [% IF Koha.Preference( 'TagsEnabled' ) == 1 %]<li><a href="/cgi-bin/koha/opac-tags.pl">Tag cloud</a></li>[% END %] > [% IF Koha.Preference( 'OpacCloud' ) == 1 %]<li><a href="/cgi-bin/koha/opac-tags_subject.pl">Subject cloud</a></li>[% END %] > [% 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( 'BrowseInterface' ) == 1 %]<li><a href="/cgi-bin/koha/opac-browse.pl">Browse interface</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> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-browse.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-browse.tt >index 8cd0ba65bf..4fbd5e8685 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-browse.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-browse.tt >@@ -8,7 +8,6 @@ > [% INCLUDE 'bodytag.inc' bodyid='opac-browser' %] > [% INCLUDE 'masthead.inc' %] > >- > <div class="main"> > <ul class="breadcrumb"> > <li><a href="/cgi-bin/koha/opac-main.pl">Home</a> >@@ -19,6 +18,7 @@ > > <div class="container-fluid"> > <div class="row-fluid"> >+ [% IF Koha.Preference('SearchEngine') == 'Elasticsearch' && Koha.Preference('BrowseInterface') %] > [% IF ( OpacNav || OpacNavBottom ) %] > > <div class="span2"> >@@ -81,8 +81,12 @@ > </div><!-- / .results-wrapper --> > </div><!-- / .userbrowser --> > </div><!-- / .span10 --> >+ [% ELSE %] >+ <h3>This feature is not enabled</h3> >+ [% END %] > </div><!-- / .row-fluid --> > </div><!-- / .container-fluid --> >+<div > </div><!-- / .main --> > [% INCLUDE 'opac-bottom.inc' %] > [% BLOCK jsinclude %] >diff --git a/opac/opac-browse.pl b/opac/opac-browse.pl >index 29524f10e8..0aba326860 100755 >--- a/opac/opac-browse.pl >+++ b/opac/opac-browse.pl >@@ -20,7 +20,7 @@ > # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. > > use Modern::Perl; >-use CGI; >+use CGI qw ( -utf8 ); > > use C4::Auth; > use C4::Context; >-- >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 14567
:
41096
|
41804
|
41805
|
41806
|
56253
|
56254
|
56255
|
56256
|
56262
|
56263
|
56264
|
56270
|
56271
|
56272
|
56273
|
57141
|
61660
|
64477
|
64478
|
64779
|
69614
|
83127
|
83128
|
85401
|
85402
|
85403
|
85887
|
85888
|
86453
|
98509
|
99060
|
99292
|
99298