Bugzilla – Attachment 14109 Details for
Bug 6890
Add reserves to modification logging
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 6890 - log reservation actions
Bug-6890---log-reservation-actions.patch (text/plain), 17.97 KB, created by
MJ Ray (software.coop)
on 2012-12-14 00:01:11 UTC
(
hide
)
Description:
Bug 6890 - log reservation actions
Filename:
MIME Type:
Creator:
MJ Ray (software.coop)
Created:
2012-12-14 00:01:11 UTC
Size:
17.97 KB
patch
obsolete
>From 189ed1dc7bcc098b34c3cf34f34a8a6659d66c3d Mon Sep 17 00:00:00 2001 >From: MJ Ray <mjr@phonecoop.coop> >Date: Fri, 6 Apr 2012 12:14:35 +0100 >Subject: [PATCH] Bug 6890 - log reservation actions > >C4/Reserves.pm: log reservation actions >catalogue/issuehistory.tt: link to viewlog for circulation log >tools/viewlog.tt: add HOLD and UNHOLD actions, move results table nearer top >tools/viewlog.tt: rewrite to use loopro.module and to link better >members/readingrec.tt: link to circulation log for hold/unhold info > >To test: > 1. place a few holds and release them somehow (cancel or issue); > 2. view the reading record of an affected borrower; > 3. click the link to the modification log and see the holds; > 4. click the link to an affected biblio; > 5. click to view its circulation history; > 6. click the link to the modification log and see the holds. >--- > C4/Reserves.pm | 22 +++ > .../prog/en/modules/catalogue/issuehistory.tt | 2 + > .../prog/en/modules/members/readingrec.tt | 3 + > .../intranet-tmpl/prog/en/modules/tools/viewlog.tt | 164 ++++++++++---------- > 4 files changed, 112 insertions(+), 79 deletions(-) > >diff --git a/C4/Reserves.pm b/C4/Reserves.pm >index aeccb12..9f55b4d 100644 >--- a/C4/Reserves.pm >+++ b/C4/Reserves.pm >@@ -4,6 +4,7 @@ package C4::Reserves; > # 2006 SAN Ouest Provence > # 2007-2010 BibLibre Paul POULAIN > # 2011 Catalyst IT >+# Copyright 2012 software.coop and MJ Ray > # > # This file is part of Koha. > # >@@ -29,6 +30,7 @@ use C4::Members; > use C4::Items; > use C4::Circulation; > use C4::Accounts; >+use C4::Log; > > # for _koha_notify_reserve > use C4::Members::Messaging; >@@ -200,6 +202,9 @@ sub AddReserve { > $found, $waitingdate, $expdate > ); > >+ # Record the fact that this book was reserved. >+ logaction( 'CIRCULATION', 'HOLD', $biblionumber, $borrowernumber ); >+ > # Send e-mail to librarian if syspref is active > if(C4::Context->preference("emailLibrarianWhenHoldIsPlaced")){ > my $borrower = C4::Members::GetMember(borrowernumber => $borrowernumber); >@@ -971,6 +976,11 @@ sub CancelReserve { > "; > $sth = $dbh->prepare($query); > $sth->execute( $item, $borr ); >+ >+ # Record the fact that this book was unreserved. >+ logaction( 'CIRCULATION', 'UNHOLD', $biblio, $borr ); >+ # FIXME: should look up biblionumber if not given >+ > } > else { > # removing a reserve record.... >@@ -1018,6 +1028,9 @@ sub CancelReserve { > $sth = $dbh->prepare($query); > $sth->execute( $biblio, $borr ); > >+ # Record the fact that this book was unreserved. >+ logaction( 'CIRCULATION', 'UNHOLD', $biblio, $borr ); >+ > # now fix the priority on the others.... > _FixPriority( $biblio, $borr ); > } >@@ -1087,6 +1100,9 @@ sub ModReserve { > $sth = $dbh->prepare($query); > $sth->execute( $biblio, $borrower ); > >+ # Record the fact that this book was unreserved. >+ logaction( 'CIRCULATION', 'UNHOLD', $biblio, $borrower ); >+ > } > elsif ($rank =~ /^\d+/ and $rank > 0) { > my $query = " >@@ -1107,6 +1123,9 @@ sub ModReserve { > } > } > >+ # Record the fact that this book was unreserved. >+ logaction( 'CIRCULATION', 'HOLD', $biblio, 'Modify hold for borrower '.$borrower ); >+ > _FixPriority( $biblio, $borrower, $rank); > } > } >@@ -1172,6 +1191,9 @@ sub ModReserveFill { > $sth = $dbh->prepare($query); > $sth->execute( $biblionumber, $resdate, $borrowernumber ); > >+ # Record the fact that this book was unreserved. >+ logaction( 'CIRCULATION', 'UNHOLD', $biblionumber, $borrowernumber ); >+ > # now fix the priority on the others (if the priority wasn't > # already sorted!).... > unless ( $priority == 0 ) { >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/issuehistory.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/issuehistory.tt >index dd384d6..64c42d2 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/issuehistory.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/issuehistory.tt >@@ -89,6 +89,8 @@ $(document).ready(function() { > [% END %] > </div> > >+<p>See also: <a href="/cgi-bin/koha/tools/viewlog.pl?do_it=1&modules=CIRCULATION&object=[% biblionumber |url %]">circulation log for [% title |html %]</a></p> >+ > </div> > </div> > <div class="yui-b"> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/readingrec.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/readingrec.tt >index b7c5f53..0b1b413 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/readingrec.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/readingrec.tt >@@ -85,6 +85,9 @@ > [% ELSE %] > <div class="dialog message">This patron has no circulation history.</div> > [% END %] >+ >+<p>See also: <a href="/cgi-bin/koha/tools/viewlog.pl?do_it=1&modules=CIRCULATION&info=[% borrowernumber |url %]">circulation log for [% INCLUDE 'patron-title.inc' %]</a></p> >+ > </div> > </div> > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt >index a56a10f..8e8fe6a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt >@@ -29,6 +29,89 @@ > <div class="yui-b"> > [% IF ( CAN_user_reports ) %] > <h1>Browse system logs</h1> >+ [% IF ( do_it ) %] >+ [% IF ( total ) %] >+ <h4>[% total %] lines found.</h4> >+ <table> >+ <tr> >+ <th>Date</th> >+ <th>Librarian</th> >+ <th>Module</th> >+ <th>Action</th> >+ <th>Object</th> >+ <th>Info</th> >+ </tr> >+ [% FOREACH loopro IN looprow %] >+ [% UNLESS ( loop.odd ) %]<tr class="highlight">[% ELSE %]<tr>[% END %] >+ <tr> >+ <td>[% loopro.timestamp %]</td> >+ <td> >+ [% IF ( module == 'CIRCULATION' ) %] >+ <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% loopro.user %]" title="display detail for this patron"> [% loopro.user %] </a> >+ [% ELSE %] >+ <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% loopro.user %]" title="display detail for this librarian"> [% loopro.user %] </a> >+ [% END %] >+ </td> >+ <td>[% loopro.module %]</td> >+ <td>[% loopro.action %]</td> >+ <td> >+ [% IF ( loopro.module == 'MEMBERS' ) %] >+ <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% loopro.object %]" title="Display patron details">Patron [% loopro.object %] </a> >+ [% ELSE %] >+ [% IF ( loopro.module == 'CIRCULATION' ) %] >+ <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% loopro.object %]" title="Display detail for this biblio"> >+ [% IF ( loopro.object ) %] >+ biblio [% loopro.object %] >+ [% END %] >+ </a> >+ [% ELSE %] >+ [% IF ( loopro.module == 'CATALOGUING' ) %] >+ [% IF ( info == 'item' ) %] >+ <a href="/cgi-bin/koha/catalogue/moredetail.pl?item=[% loopro.object %]&biblionumber=[% loopro.biblionumber %]&bi=[% loopro.biblioitemnumber %]#item[% loopro.object %]">Item [% loopro.object %]</a> >+ [% ELSE %] >+ <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% loopro.object %]" title="Display detail for this biblio">biblio [% loopro.object %]</a> >+ [% END %] >+ [% ELSE %] >+ [% IF ( loopro.module == 'SERIAL' ) %] >+ <a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% loopro.object %]"> [% loopro.object %] </a> >+ [% ELSE %] >+ [% IF ( loopro.module == 'AUTHORITIES' ) %] >+ <a href="/cgi-bin/koha/authorities/detail.pl?authid=[% loopro.object %]" title="Display detail for this authority">auth [% loopro.object %]</a> >+ [% ELSE %] >+ [% loopro.object %] >+ [% END %] >+ [% END %] >+ [% END %] >+ [% END %] >+ [% END %] >+ </td> >+ <td> >+ [% IF ( loopro.module == 'CIRCULATION' && ( loopro.action == 'HOLD' || loopro.action == 'UNHOLD' ) ) %] >+ <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% loopro.info |remove('\S+ ') |url %]" title="Display borrower details">Patron [% loopro.info |remove('\S+ ') |html %]</a> >+ [% ELSE %] >+ [% IF ( loopro.module == 'CIRCULATION' && loopro.info > 0 ) %] >+ <a href="/cgi-bin/koha/catalogue/moredetail.pl?item=[% loopro.info %]&biblionumber=[% loopro.biblionumber %]&bi=[% loopro.biblioitemnumber %]#item[% loopro.object %]" title="Display detail for this biblio">Item [% loopro.info |html %]</a> >+ [% ELSE %] >+ [% loopro.info |html %] >+ [% END %] >+ [% END %] >+ </td> >+ </tr> >+ [% END %] >+ </table> >+ [% ELSE %] >+ <div class="dialog alert"> >+ No log found >+ [% IF ( CATALOGUING ) %] >+ for <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% object %]">Bibliographic Record [% object %]</a> >+ [% END %] >+ [% IF ( MEMBERS ) %] >+ for <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% object %]">[% INCLUDE 'patron-title.inc' %]</a> >+ [% END %] >+ . >+ </div> >+ [% END %] >+ [% END %] > <form method="post" action="/cgi-bin/koha/tools/viewlog.pl"> > [% IF ( do_it ) %] > <input type="hidden" name="do_it" value="[% do_it %]" /> >@@ -64,6 +147,8 @@ > <option value ="MODIFY">Modify</option> > <option value="ISSUE">Checkout</option> > <option value="RETURN">Return</option> >+ <option value="HOLD">Hold</option> >+ <option value="UNHOLD">Unhold</option> > </select> > </li> > <li> >@@ -135,85 +220,6 @@ > </fieldset> > </form> > [% END %] >- [% IF ( do_it ) %] >- [% IF ( total ) %] >- <h4>[% total %] lines found.</h4> >- <table> >- <tr> >- <th>Date</th> >- <th>Librarian</th> >- <th>Module</th> >- <th>Action</th> >- <th>Object</th> >- <th>Info</th> >- </tr> >- [% FOREACH loopro IN looprow %] >- [% UNLESS ( loop.odd ) %]<tr class="highlight">[% ELSE %]<tr>[% END %] >- <tr> >- <td>[% loopro.timestamp %]</td> >- <td> >- [% IF ( module == 'CIRCULATION' ) %] >- <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% loopro.user %]" title="display detail for this user."> [% loopro.user %] </a> >- [% ELSE %] >- <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% loopro.user %]" title="display detail for this librarian."> [% loopro.user %] </a> >- [% END %] >- </td> >- <td>[% loopro.module %]</td> >- <td>[% loopro.action %]</td> >- <td> >- [% IF ( module == 'MEMBERS' ) %] >- <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% loopro.object %]" title="Display member details."> member [% loopro.object %] </a> >- [% ELSE %] >- [% IF ( module == 'CIRCULATION' ) %] >- <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% loopro.object %]" title="Display member details."> >- [% IF ( loopro.object ) %] >- member [% loopro.object %] >- [% END %] >- </a> >- [% ELSE %] >- [% IF ( module == 'CATALOGUING' ) %] >- [% IF ( info == 'item' ) %] >- <a href="/cgi-bin/koha/catalogue/moredetail.pl?item=[% loopro.object %]&biblionumber=[% loopro.biblionumber %]&bi=[% loopro.biblioitemnumber %]#item[% loopro.object %]">Item [% loopro.object %]</a> >- [% ELSE %] >- <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% loopro.object %]" title="Display detail for this biblio">biblio [% loopro.object %]</a> >- [% END %] >- [% ELSE %] >- [% IF ( module == 'SERIAL' ) %] >- <a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% loopro.object %]"> [% loopro.object %] </a> >- [% ELSE %] >- [% IF ( module == 'AUTHORITIES' ) %] >- <a href="/cgi-bin/koha/authorities/detail.pl?authid=[% loopro.object %]" title="Display detail for this authority">auth [% loopro.object %]</a> >- [% ELSE %] >- [% loopro.object %] >- [% END %] >- [% END %] >- [% END %] >- [% END %] >- [% END %] >- </td> >- <td> >- [% IF ( loopro.CIRCULATION ) %] >- <a href="/cgi-bin/koha/catalogue/moredetail.pl?item=[% loopro.info %]&biblionumber=[% loopro.biblionumber %]&bi=[% loopro.biblioitemnumber %]#item[% loopro.object %]" title="Display detail for this biblio">Item [% loopro.barcode |html %]</a> >- [% ELSE %] >- [% loopro.info |html %] >- [% END %] >- </td> >- </tr> >- [% END %] >- </table> >- [% ELSE %] >- <div class="dialog alert"> >- No log found >- [% IF ( CATALOGUING ) %] >- for <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% object %]">Bibliographic record [% object %]</a> >- [% END %] >- [% IF ( MEMBERS ) %] >- for <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% object %]">[% INCLUDE 'patron-title.inc' %]</a> >- [% END %] >- . >- </div> >- [% END %] >- [% END %] > </div> > </div> > <div class="yui-b noprint"> >-- >1.7.2.5
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 6890
:
8945
|
14109
|
21817