From 45975f4087462d3b2ae06bca11fe70ae0127db3a Mon Sep 17 00:00:00 2001 From: Yohann Dufour Date: Mon, 4 Aug 2014 16:09:35 +0200 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 Signed-off-by: Lucie Signed-off-by: Kyle M Hall Signed-off-by: Tomas Cohen Arazi --- C4/Auth.pm | 2 ++ Koha/Borrower/Debarments.pm | 2 +- .../prog/en/includes/borrower_debarments.inc | 2 ++ .../intranet-tmpl/prog/en/includes/circ-menu.inc | 3 +++ koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.tt | 3 +++ .../intranet-tmpl/prog/en/includes/members-menu.inc | 3 +++ .../prog/en/modules/admin/preferences/patrons.pref | 6 ++++++ .../intranet-tmpl/prog/en/modules/intranet-main.tt | 11 ++++++++++- .../opac-tmpl/bootstrap/en/includes/usermenu.inc | 9 +++++++++ mainpage.pl | 3 +++ 10 files changed, 42 insertions(+), 2 deletions(-) diff --git a/C4/Auth.pm b/C4/Auth.pm index 0e1b03f233..4b027011b0 100644 --- a/C4/Auth.pm +++ b/C4/Auth.pm @@ -421,6 +421,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 { @@ -532,6 +533,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 2c91af2453..9efdc42d03 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 8d6ac33886..aea088950d 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 1bf87463f9..ee9818b40b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc @@ -91,6 +91,9 @@ [% IF ( CAN_user_borrowers ) %] [% IF ( suggestionsview ) %]
  • [% ELSE %]
  • [% END %]Purchase suggestions
  • [% END %] + [% 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 3a8c4a2730..5c953a5266 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.tt @@ -92,6 +92,9 @@ in the global namespace %] [% IF ( CAN_user_borrowers ) %] [% IF ( suggestionsview ) %]
  • [% ELSE %]
  • [% END %]Purchase
    suggestions
  • [% 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 9bd528516b..e7e87720a3 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 4784f27eee..30533b59ac 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 @@ -132,6 +132,12 @@ Patrons: - pref: CardnumberLength - "characters long. The length can be a single number to specify an exact length, a range separated by a comma (i.e., 'Min,Max'), or a maximum with no minimum (i.e., ',Max')." - "If 'cardnumber' is included in the BorrowerMandatoryField list, the minimum length, if not specified here, defaults to one." + - + - pref: useDischarge + choices: + yes: Allows + no: "Don't allow" + - librarians to discharge borrowers and borrowers to request a discharge. "Norwegian patron database": - - pref: NorwegianPatronDBEnable 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 c34ca850d3..844052685b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt @@ -111,7 +111,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 ) %]
    @@ -143,6 +145,13 @@
    [% END %] + [% IF CAN_user_borrowers && pending_discharge_requests %] +
    + Discharge requests pending: + [% pending_discharge_requests %] +
    + [% END %] +
    [% END %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/usermenu.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/usermenu.inc index 182543b3b6..2c896fa7fc 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/usermenu.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/usermenu.inc @@ -95,6 +95,15 @@ [% END %] your lists [% END %] + + [% IF Koha.Preference( 'useDischarge' ) == 1 %] + [% IF ( dischargeview ) %] +
  • + [% ELSE %] +
  • + [% END %] + ask for a discharge
  • + [% END %] [% END %] diff --git a/mainpage.pl b/mainpage.pl index 09450f6a2d..1ccffad867 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::Borrower::Discharge; my $query = new CGI; @@ -65,12 +66,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::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, ); # -- 2.39.5