From 02a09e9af49b6e303f753c328c1fe1943c7d1f0c Mon Sep 17 00:00:00 2001 From: Aleisha Amohia Date: Mon, 20 Nov 2017 02:12:08 +0000 Subject: [PATCH] Bug 19532: UseRecalls syspref This patch adds a syspref to control the usability of the recalls feature Test the following: Staff side /includes/circ-menu.inc /includes/circ-nav.inc /includes/members-menu.inc /admin/preferences/circulation.pref /circ/circulation-home.tt /circ/circulation.tt /circ/recalls_overdue.tt /circ/recalls_queue.tt /circ/recalls_waiting.tt /members/moremember.tt /members/recallshistory.tt OPAC /includes/usermenu.inc /opac-recall.tt /opac-recalls.tt /opac-user.tt /members/recallshistory.pl /opac/opac-detail.pl Signed-off-by: Nick Clemens --- .../bug_19532_-_add_Recalls_syspref.sql | 1 + installer/data/mysql/sysprefs.sql | 1 + .../intranet-tmpl/prog/en/includes/circ-menu.inc | 4 ++- .../intranet-tmpl/prog/en/includes/circ-nav.inc | 8 ++++-- .../prog/en/includes/members-menu.inc | 3 ++ .../en/modules/admin/preferences/circulation.pref | 17 +++++++---- .../prog/en/modules/circ/circulation.tt | 4 +-- .../prog/en/modules/circ/recalls_overdue.tt | 6 ++-- .../prog/en/modules/circ/recalls_queue.tt | 33 +++++++++------------- .../prog/en/modules/circ/recalls_waiting.tt | 5 +++- .../prog/en/modules/members/moremember.tt | 5 +++- .../prog/en/modules/members/recallshistory.tt | 11 +++++--- .../opac-tmpl/bootstrap/en/includes/usermenu.inc | 12 ++++---- .../opac-tmpl/bootstrap/en/modules/opac-recall.tt | 4 +++ .../opac-tmpl/bootstrap/en/modules/opac-recalls.tt | 6 ++-- .../opac-tmpl/bootstrap/en/modules/opac-user.tt | 4 +-- members/recallshistory.pl | 24 ++++++++++++++-- opac/opac-detail.pl | 2 +- 18 files changed, 100 insertions(+), 50 deletions(-) create mode 100644 installer/data/mysql/atomicupdate/bug_19532_-_add_Recalls_syspref.sql diff --git a/installer/data/mysql/atomicupdate/bug_19532_-_add_Recalls_syspref.sql b/installer/data/mysql/atomicupdate/bug_19532_-_add_Recalls_syspref.sql new file mode 100644 index 0000000000..43813957de --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_19532_-_add_Recalls_syspref.sql @@ -0,0 +1 @@ +INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES ('UseRecalls','1',NULL,'Enable or disable recalls','YesNo'); diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index 247b0f2a52..84be5094c4 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -602,6 +602,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('UseICU','0','1','Tell Koha if ICU indexing is in use for Zebra or not.','YesNo'), ('UseKohaPlugins','0','','Enable or disable the ability to use Koha Plugins.','YesNo'), ('UseQueryParser','0',NULL,'If enabled, try to use QueryParser for queries.','YesNo'), +('UseRecalls', '1', NULL, 'Enable or disable recalls', 'YesNo'), ('UseTransportCostMatrix','0','','Use Transport Cost Matrix when filling holds','YesNo'), ('UseWYSIWYGinSystemPreferences','0','','Show WYSIWYG editor when editing certain HTML system preferences.','YesNo'), ('viewISBD','1','','Allow display of ISBD view of bibiographic records','YesNo'), diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc index 290911cada..2d9b2abdcb 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc @@ -124,6 +124,8 @@ [% IF Koha.Preference('ILLModule') && CAN_user_ill %]
  • Interlibrary loans
  • [% END %] -
  • Recalls history
  • + [% IF Koha.Preference('UseRecalls') %] +
  • Recalls history
  • + [% END %] [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-nav.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-nav.inc index 17be2aee81..32c499612e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-nav.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-nav.inc @@ -39,9 +39,11 @@ [% IF Koha.Preference('OnSiteCheckouts') %]
  • Pending on-site checkouts
  • [% END %] -
  • Recalls queue
  • -
  • Overdue recalls
  • -
  • Recalls awaiting pickup
  • + [% IF Koha.Preference('UseRecalls') %] +
  • Recalls queue
  • +
  • Overdue recalls
  • +
  • Recalls awaiting pickup
  • + [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/members-menu.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/members-menu.inc index 190bd4fb37..fa089a0f63 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/members-menu.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/members-menu.inc @@ -23,6 +23,9 @@ [% IF Koha.Preference('HouseboundModule') %] [% IF houseboundview %]
  • [% ELSE %]
  • [% END %]Housebound
  • [% END %] + [% IF Koha.Preference('UseRecalls') %] +
  • Recalls history
  • + [% END %] [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref index 52d582ed26..53c7ccfd62 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref @@ -160,11 +160,6 @@ Circulation: Checkout Policy: - - - Mark a recall as problematic if it has been waiting to be picked up for - - pref: RecallsMaxPickUpDelay - - class: integer - - days. - - - pref: AllowTooManyOverride choices: yes: Allow @@ -955,6 +950,18 @@ Circulation: yes: Enable no: Disable - "housebound module" + Recalls: + - + - pref: UseRecalls + choices: + yes: Use + no: "Don't use" + - recalls + - + - Mark a recall as problematic if it has been waiting to be picked up for + - pref: RecallsMaxPickupDelay + - class: integer + - days. Article Requests: - - pref: ArticleRequests diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt index 93538ce03e..a973169cb5 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -819,7 +819,7 @@ No patron matched [% message | html %] [% END %] - [% IF recalls.count %] + [% IF Koha.Preference('UseRecalls') && recalls.count %]
  • [% recalls.count %] Recall(s)
  • [% END %] @@ -934,7 +934,7 @@ No patron matched [% message | html %] [% END %] -[% IF recalls.count %] +[% IF Koha.Preference('UseRecalls') && recalls.count %] [% INCLUDE 'recalls.inc' %] [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/recalls_overdue.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/recalls_overdue.tt index 494cfdce1b..1138375263 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/recalls_overdue.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/recalls_overdue.tt @@ -27,7 +27,7 @@

    Overdue recalls

    - + [% IF Koha.Preference('UseRecalls') %] [% IF recalls.count %]
    @@ -102,7 +102,9 @@
    There are no overdue recalls.
    [% END %] - + [% ELSE %] +
    Recalls have not been enabled. Enable the UseRecalls system preference to use recalls.
    + [% END %]
    diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/recalls_queue.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/recalls_queue.tt index 5d28ac11af..00cb25e92b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/recalls_queue.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/recalls_queue.tt @@ -27,27 +27,22 @@

    Recalls queue

    - - [% IF recalls.count %] - - - - - Select all - - [% INCLUDE 'recalls-reports.inc' %] - -
    - -
    - - + [% IF Koha.Preference('UseRecalls') %] + [% IF recalls.count %] +
    + + Select all + [% INCLUDE 'recalls-reports.inc' %] +
    + +
    +
    + [% ELSE %] +
    No recalls have been made.
    + [% END %] [% ELSE %] - -
    No recalls have been made.
    - +
    Recalls have not been enabled. Enable the UseRecalls system preference to use recalls.
    [% END %] -
    diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/recalls_waiting.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/recalls_waiting.tt index ddd0bd2f65..6a061bfb55 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/recalls_waiting.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/recalls_waiting.tt @@ -39,7 +39,7 @@

    Recalls awaiting pickup

    - + [% IF Koha.Preference('UseRecalls') %] [% IF recalls.size > 0 %]
    @@ -152,6 +152,9 @@ [% END %] + [% ELSE %] +
    Recalls have not been enabled. Enable the UseRecalls system preference to use recalls.
    + [% END %]
    diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt index ee8b60f7ee..a0b6825c01 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt @@ -661,6 +661,9 @@ [% END %] [% END %] + [% IF Koha.Preference('UseRecalls') && recalls.count %] +
  • [% recalls.count %] Recall(s)
  • + [% END %] [% IF Koha.Preference('ArticleRequests') %]
  • [% patron.article_requests_current.count | html %] Article requests @@ -777,7 +780,7 @@ [% END %] [% # /div#reserves %] [% END %] - [% IF recalls %] + [% IF Koha.Preferernce('UseRecalls') && recalls %] [% INCLUDE 'recalls.inc' %] [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/recallshistory.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/recallshistory.tt index a7ee266d3e..93c96a10f3 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/recallshistory.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/recallshistory.tt @@ -1,7 +1,7 @@ [% USE KohaDates %] [% USE Koha %] [% INCLUDE 'doc-head-open.inc' %] -Recalls history for [% patron.firstname %] [% patron.surname %] +Recalls history for [% INCLUDE 'patron-title.inc' %] [% INCLUDE 'doc-head-close.inc' %] [% INCLUDE 'datatables.inc' %] @@ -14,7 +14,7 @@
    @@ -26,8 +26,11 @@

    Recalls history

    - [% INCLUDE 'recalls.inc' %] - + [% IF Koha.Preference('UseRecalls') %] + [% INCLUDE 'recalls.inc' %] + [% ELSE %] +
    Recalls have not been enabled. Enable the UseRecalls system preference to use recalls.
    + [% END %]
    diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/usermenu.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/usermenu.inc index 5d60740351..78afc99fcf 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/usermenu.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/usermenu.inc @@ -124,12 +124,14 @@ your interlibrary loan requests
  • [% END %] - [% IF ( recallsview ) %] -
  • - [% ELSE %] -
  • + [% IF Koha.Preference('UseRecalls') %] + [% IF ( recallsview ) %] +
  • + [% ELSE %] +
  • + [% END %] + your recalls history
  • [% END %] - your recalls history [% END %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-recall.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-recall.tt index e5c5805db2..b45d3ec7c8 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-recall.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-recall.tt @@ -24,6 +24,7 @@

    Recall an item

    + [% IF Koha.Preference('UseRecalls') %] [% IF error %]
    [% IF error == 'notloggedin' %] @@ -52,6 +53,9 @@ [% END %] [% END %] + [% ELSE %] + Recalls have not been enabled. Please contact your library. + [% END %]
    diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-recalls.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-recalls.tt index cb6e382539..395784fbd0 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-recalls.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-recalls.tt @@ -26,7 +26,7 @@

    Recalls history

    - + [% IF Koha.Preference('UseRecalls') %] [% IF RECALLS.count %]
    @@ -113,7 +113,9 @@
    [% END # / # RECALLS.count %] - + [% ELSE %] + Recalls have not been enabled. Please contact your library. + [% END %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt index 5514e64702..139def8ccf 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt @@ -159,7 +159,7 @@ [% END %] [% IF ( RESERVES.count ) %]
  • Holds ([% RESERVES.count | html %])
  • [% END %] - [% IF ( RECALLS.count ) %]
  • Recalls ([% RECALLS.count | html %])
  • [% END %] + [% IF ( Koha.Preference('UseRecalls') && RECALLS.count ) %]
  • Recalls ([% RECALLS.count | html %])
  • [% END %] [% IF Koha.Preference('ArticleRequests') && borrower.article_requests_current %]
  • Article requests ([% borrower.article_requests_current.count | html %])
  • [% END %] [% IF ( OverDriveCirculation ) %]
  • OverDrive Account
  • @@ -783,7 +783,7 @@ [% END # / #RESERVES.count %] - [% IF RECALLS.count %] + [% IF Koha.Preference('UseRecalls') && RECALLS.count %]
    diff --git a/members/recallshistory.pl b/members/recallshistory.pl index 3a6bc2f308..4e42529a9a 100755 --- a/members/recallshistory.pl +++ b/members/recallshistory.pl @@ -44,10 +44,30 @@ my $recalls = Koha::Recalls->search({ borrowernumber => $loggedinuser }); my $patron = Koha::Patrons->find($loggedinuser); +$template->param( picture => 1 ) if $patron->image; + $template->param( recalls => $recalls, - patron => $patron, - recallsview => 1 + recallsview => 1, + borrowernumber => $loggedinuser, + title => $patron->title, + initials => $patron->initials, + surname => $patron->surname, + firstname => $patron->firstname, + cardnumber => $patron->cardnumber, + categorycode => $patron->categorycode, + category_type => $patron->category->category_type, + categoryname => $patron->category->description, + address => $patron->address, + streetnumber => $patron->streetnumber, + streettype => $patron->streettype, + address2 => $patron->address2, + city => $patron->city, + zipcode => $patron->zipcode, + country => $patron->country, + phone => $patron->phone, + email => $patron->email, + branchcode => $patron->branchcode ); output_html_with_http_headers $input, $cookie, $template->output; diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl index d020df3de7..c7f1743b3e 100755 --- a/opac/opac-detail.pl +++ b/opac/opac-detail.pl @@ -709,7 +709,7 @@ if ( not $viewallitems and @items > $max_items_to_display ) { if grep /^$itm->{itemnumber}$/, @itemnumbers_on_order; } - if ( $itm->{datedue} && $borrowernumber && $itm->{borrowernumber} != $borrowernumber ) { + if ( $itm->{datedue} && $borrowernumber && $itm->{borrowernumber} != $borrowernumber && C4::Context->preference('UseRecalls') ) { $itm->{avail_for_recall} = 1; } -- 2.11.0
    Recalls ([% RECALLS.count %])