From 7a08f46e04b404246a607be05e32126a9031e80a Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 8 Jan 2014 18:41:07 +0100 Subject: [PATCH] Bug 8007: Discharge - Glue This patch adds: - links to the new pages. - syspref description - links on the main page (intranet) - the DISCHARGE type for debarment --- C4/Auth.pm | 2 ++ Koha/Borrower/Debarments.pm | 2 +- .../intranet-tmpl/prog/en/includes/borrower_debarments.inc | 2 ++ koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc | 3 +++ koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.tt | 3 +++ koha-tmpl/intranet-tmpl/prog/en/includes/members-menu.inc | 3 +++ .../prog/en/modules/admin/preferences/patrons.pref | 6 ++++++ koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt | 11 ++++++++++- koha-tmpl/opac-tmpl/prog/en/includes/usermenu.inc | 4 +++- mainpage.pl | 3 +++ 10 files changed, 36 insertions(+), 3 deletions(-) diff --git a/C4/Auth.pm b/C4/Auth.pm index 00eeeef..d96dbb8 100644 --- a/C4/Auth.pm +++ b/C4/Auth.pm @@ -363,6 +363,7 @@ sub get_template_and_user { EnableBorrowerFiles => C4::Context->preference('EnableBorrowerFiles'), UseKohaPlugins => C4::Context->preference('UseKohaPlugins'), UseCourseReserves => C4::Context->preference("UseCourseReserves"), + useDischarge => C4::Context->preference('useDischarge'), ); } else { @@ -468,6 +469,7 @@ sub get_template_and_user { OPACLocalCoverImages => C4::Context->preference("OPACLocalCoverImages"), PatronSelfRegistration => C4::Context->preference("PatronSelfRegistration"), PatronSelfRegistrationDefaultCategory => C4::Context->preference("PatronSelfRegistrationDefaultCategory"), + useDischarge => C4::Context->preference('useDischarge'), ); $template->param(OpacPublic => '1') if ($user || C4::Context->preference("OpacPublic")); diff --git a/Koha/Borrower/Debarments.pm b/Koha/Borrower/Debarments.pm index 0febc20..f81142b 100644 --- a/Koha/Borrower/Debarments.pm +++ b/Koha/Borrower/Debarments.pm @@ -131,7 +131,7 @@ sub DelDebarment { my $success = ModDebarment({ borrower_debarment_id => $borrower_debarment_id, expiration => $expiration, - type => $type, ## enum('FINES','OVERDUES','MANUAL') + type => $type, ## enum('FINES','OVERDUES','MANUAL','DISCHARGE') comment => $comment, }); diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/borrower_debarments.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/borrower_debarments.inc index cea3416..37dd08e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/borrower_debarments.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/borrower_debarments.inc @@ -47,6 +47,8 @@ Overdues [% CASE 'SUSPENSION' %] Suspension + [% CASE 'DISCHARGE' %] + Discharge [% END %] [% d.comment %] 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 5687d01..f13cbf9 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc @@ -84,6 +84,9 @@ [% IF ( borrower_files ) %]
  • [% ELSE %]
  • [% END %]Files
  • [% END %] [% IF ( suggestions ) %]
  • [% ELSE %]
  • [% END %]Purchase
    suggestions
  • + [% IF CAN_user_borrowers && useDischarge %] + [% IF dischargeview %]
  • [% ELSE %]
  • [% END %]Discharge
  • + [% END %] [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.tt b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.tt index 7f8cb48..3634417 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.tt @@ -82,6 +82,9 @@ in the global namespace %] [% IF EnableBorrowerFiles %] [% IF ( borrower_files ) %]
  • [% ELSE %]
  • [% END %]Files
  • [% END %] + [% IF CAN_user_borrowers && useDischarge %] + [% IF dischargeview %]
  • [% ELSE %]
  • [% END %]Discharge
  • + [% END %] [% 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 9bd5285..e7e8772 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/members-menu.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/members-menu.inc @@ -19,6 +19,9 @@ [% IF EnableBorrowerFiles %] [% IF ( borrower_files ) %]
  • [% ELSE %]
  • [% END %]Files
  • [% END %] + [% IF CAN_user_borrowers && useDischarge %] + [% IF dischargeview %]
  • [% ELSE %]
  • [% END %]Discharge
  • + [% END %] [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref index 74d14af..df6161a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref @@ -139,3 +139,9 @@ Patrons: yes: Do no: "Don't" - enable the ability to upload and attach arbitrary files to a borrower record. + - + - pref: useDischarge + choices: + yes: Allows + no: "Don't allow" + - librarians to discharge borrowers and borrowers to request a discharge. diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt index 8fc64fc..7c8b0e2 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt @@ -106,7 +106,9 @@ [% IF ( ( CAN_user_tools_moderate_comments && pendingcomments ) || ( CAN_user_tools_moderate_tags && pendingtags ) || ( CAN_user_borrowers && pending_borrower_modifications ) - || ( CAN_user_acquisition && pendingsuggestions ) ) %] + || ( CAN_user_acquisition && pendingsuggestions ) + || ( CAN_user_borrowers && pending_discharge_requests ) + ) %]
    [% IF ( CAN_user_acquisition && pendingsuggestions ) %]
    @@ -138,6 +140,13 @@
    [% END %] + [% IF CAN_user_borrowers && pending_discharge_requests %] +
    + Discharge requests pending: + [% pending_discharge_requests %] +
    + [% END %] +
    [% END %] diff --git a/koha-tmpl/opac-tmpl/prog/en/includes/usermenu.inc b/koha-tmpl/opac-tmpl/prog/en/includes/usermenu.inc index 5a07d95..196e03a 100644 --- a/koha-tmpl/opac-tmpl/prog/en/includes/usermenu.inc +++ b/koha-tmpl/opac-tmpl/prog/en/includes/usermenu.inc @@ -32,7 +32,9 @@ [% IF ( virtualshelves ) %] [% IF ( listsview ) %]
  • [% ELSE %]
  • [% END %]my lists
  • [% END %] - + [% IF useDischarge %] + [% IF dischargeview %]
  • [% ELSE %]
  • [% END %]ask for a discharge
  • + [% END %] [% END %][% ELSE %][% END %] diff --git a/mainpage.pl b/mainpage.pl index 4159618..035eb65 100755 --- a/mainpage.pl +++ b/mainpage.pl @@ -29,6 +29,7 @@ use C4::Review qw/numberofreviews/; use C4::Suggestions qw/CountSuggestion/; use C4::Tags qw/get_count_by_tag_status/; use Koha::Borrower::Modifications; +use Koha::Service::Borrower::Discharge; my $query = new CGI; @@ -61,12 +62,14 @@ my $pendingtags = get_count_by_tag_status(0); my $pendingsuggestions = CountSuggestion("ASKED"); my $pending_borrower_modifications = Koha::Borrower::Modifications->GetPendingModificationsCount( $branch ); +my $pending_discharge_requests = Koha::Service::Borrower::Discharge::count({ pending => 1 }); $template->param( pendingcomments => $pendingcomments, pendingtags => $pendingtags, pendingsuggestions => $pendingsuggestions, pending_borrower_modifications => $pending_borrower_modifications, + pending_discharge_requests => $pending_discharge_requests, ); # -- 1.7.10.4