From 6d792ff2b05c88e5deb1c254bf8279146f03c590 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 11 Oct 2017 19:06:17 -0300 Subject: [PATCH] Bug 19290: Browse selected bibliographic records - Staff interface MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch adds the same feature as bug 10858 for the OPAC interface: after a search, librarians will be able to browse selected results. The results can be selected from several pages. By extension it is possible to add results from several pages to a list or the cart. When at least one result is selected, a new "Browse selected records" button becomes usable and change the behaviour of the existing browser. The whole feature can be turned off with the pref BrowseResultSelection. Test plan: - Launch a search (on the staff interface) - Check some biblios - Go on another page - Check some biblios - Come back to a page you already check results and confirm that they are still checked - Click on the "Browse selected records" button - Check that you are able to browse results you had checked. You can also: - add them to the cart - add them to a list QA note: the browsers at the OPAC and the one at the staff interface are completely different That's why the code is not mimicking what has been done on bug 10858. The behaviour must stay the same anyway. Signed-off-by: Séverine QUEUNE Signed-off-by: Séverine QUEUNE --- installer/data/mysql/atomicupdate/bug_19290.sql | 1 + installer/data/mysql/sysprefs.sql | 1 + koha-tmpl/intranet-tmpl/js/browser.js | 2 +- .../intranet-tmpl/prog/en/includes/js_includes.inc | 1 + .../prog/en/includes/page-numbers.inc | 10 +-- .../en/modules/admin/preferences/searching.pref | 7 +++ .../prog/en/modules/catalogue/detail.tt | 3 +- .../prog/en/modules/catalogue/results.tt | 60 ++++++++++++++++-- koha-tmpl/intranet-tmpl/prog/js/basket.js | 48 +++++++++----- koha-tmpl/intranet-tmpl/prog/js/cart.js | 2 + koha-tmpl/intranet-tmpl/prog/js/commons.js | 73 ++++++++++++++++++++++ 11 files changed, 181 insertions(+), 27 deletions(-) create mode 100644 installer/data/mysql/atomicupdate/bug_19290.sql create mode 100644 koha-tmpl/intranet-tmpl/prog/js/commons.js diff --git a/installer/data/mysql/atomicupdate/bug_19290.sql b/installer/data/mysql/atomicupdate/bug_19290.sql new file mode 100644 index 0000000..67a64df --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_19290.sql @@ -0,0 +1 @@ +INSERT IGNORE INTO systempreferences (`variable`, `value`, `options`, `explanation`, `type`) VALUES ('BrowseResultSelection','0',NULL,'Enable/Disable browsing search results fromt the bibliographic record detail page in staff client','YesNo'); diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index 1cb1ae1..b30e80f 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -90,6 +90,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'), +('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'), ('canreservefromotherbranches','1','','With Independent branches on, can a user from one library place a hold on an item from another library','YesNo'), diff --git a/koha-tmpl/intranet-tmpl/js/browser.js b/koha-tmpl/intranet-tmpl/js/browser.js index 1557243..7e40785 100644 --- a/koha-tmpl/intranet-tmpl/js/browser.js +++ b/koha-tmpl/intranet-tmpl/js/browser.js @@ -102,7 +102,7 @@ KOHA.browser = function (searchid, biblionumber) { } else { nextbutton = '' + BROWSER_NEXT + ' »'; } - $('#menu').before('
' + prevbutton + nextbutton + '
'); + $('#menu').before('
' + prevbutton + nextbutton + '
'); $('a#browse-previous').click(function (ev) { ev.preventDefault(); browseRecords(-1); diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/js_includes.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/js_includes.inc index 8207456..dbab30b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/js_includes.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/js_includes.inc @@ -21,6 +21,7 @@ + [% INCLUDE 'validator-strings.inc' %] [% IF ( IntranetUserJS ) %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/page-numbers.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/page-numbers.inc index 1c9bd33..af4bc09 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/page-numbers.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/page-numbers.inc @@ -1,18 +1,18 @@ [% IF ( PAGE_NUMBERS ) %][% END %] 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 0178468..ad28e82 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 @@ -78,6 +78,13 @@ Searching: yes: Keep no: "Don't keep" - patron search history in the staff client. + - + - pref: BrowseResultSelection + default: 0 + choices: + yes: Enable + no: Disable + - "browsing search results fromt the bibliographic record detail page in staff client." Search Form: - - Load the unlogged history to the next user. diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt index be5932b..5ce3ecf 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -1043,7 +1043,8 @@ [% INCLUDE 'browser-strings.inc' %] +