Bugzilla – Attachment 109511 Details for
Bug 26350
Librarians can request discharge on behalf of patron
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26350: Librarians can request discharge on behalf of patron
Bug-26350-Librarians-can-request-discharge-on-beha.patch (text/plain), 3.12 KB, created by
Dobrica Pavlinusic
on 2020-09-02 12:31:49 UTC
(
hide
)
Description:
Bug 26350: Librarians can request discharge on behalf of patron
Filename:
MIME Type:
Creator:
Dobrica Pavlinusic
Created:
2020-09-02 12:31:49 UTC
Size:
3.12 KB
patch
obsolete
>From 62864555505c9d55f6bdf54e061a489aba9d6b8a Mon Sep 17 00:00:00 2001 >From: Dobrica Pavlinusic <dpavlin@rot13.org> >Date: Wed, 2 Sep 2020 10:59:22 +0200 >Subject: [PATCH] Bug 26350: Librarians can request discharge on behalf of > patron > >While deploying discharges in our library we figured out that librarians >need ability to request discharge document on behalf of patrons from >intranet page. > >It was logical to add another option on Discharge patron tab. > >It nicely addresses Bug 16466 since it shows status of pending >discharge instead of button to issue new discharge. > >To test: >1. apply patch >2. make sure that useDischarge is enabled in administration >3. verify that "Request new discharge" button is availabe, click on it >4. after page reload, message "Patron has pending discharge request." > will appear >5. click on "Generate discharge" to approve discharge and generate > pdf (this is unchanged compared to exsting workflow) >--- > .../prog/en/modules/members/discharge.tt | 7 +++++++ > members/discharge.pl | 21 +++++++++++++++++++++ > 2 files changed, 28 insertions(+) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/discharge.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/discharge.tt >index 692e4942f4..d25b059aa6 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/discharge.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/discharge.tt >@@ -41,6 +41,13 @@ > <p>Patron has holds. They will be cancelled if the discharge is generated.</p> > [% END %] > <form method="post"> >+ [% IF pending %] >+ <p>Patron has pending discharge request.</p> >+ [% ELSIF is_discharged %] >+ <p>Patron is discharged.</p> >+ [% ELSIF can_be_discharged %] >+ <p><input type="submit" value="Request new discharge" name="request" /></p> >+ [% END %] > <input type="submit" value="Generate discharge" name="discharge" /> > <input type="hidden" value="[% patron.borrowernumber | html %]" name="borrowernumber" /> > </form> >diff --git a/members/discharge.pl b/members/discharge.pl >index f4a70236b4..b37d2d54b5 100755 >--- a/members/discharge.pl >+++ b/members/discharge.pl >@@ -66,8 +66,29 @@ my $can_be_discharged = Koha::Patron::Discharge::can_be_discharged({ > borrowernumber => $borrowernumber > }); > >+my $is_discharged = Koha::Patron::Discharge::is_discharged({borrowernumber => $loggedinuser}); >+ >+my $pending = Koha::Patron::Discharge::count({ >+ borrowernumber => $borrowernumber, >+ pending => 1, >+}); >+ >+$template->param( can_be_discharged => $can_be_discharged ); >+$template->param( is_discharged => $is_discharged ); >+$template->param( pending => $pending ); >+ >+if ( ! $pending and $can_be_discharged and $input->param('request') ) { >+ my $success = Koha::Patron::Discharge::request({ >+ borrowernumber => $borrowernumber, >+ }); >+ if ( $success ) { >+ $template->param( pending => 1 ); >+ } >+} >+ > # Generating discharge if needed > if ( $input->param('discharge') and $can_be_discharged ) { >+ > my $is_discharged = Koha::Patron::Discharge::is_discharged({ > borrowernumber => $borrowernumber, > }); >-- >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 26350
:
109511
|
109516
|
109545
|
109557