Bugzilla – Attachment 8945 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]
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.pl: be more cautious in assuming info field in CIRCULATION is
C4Reservespm-log-reservation-actions-catalogueissu.patch (text/plain), 18.00 KB, created by
MJ Ray (software.coop)
on 2012-04-06 11:17:17 UTC
(
hide
)
Description:
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.pl: be more cautious in assuming info field in CIRCULATION is
Filename:
MIME Type:
Creator:
MJ Ray (software.coop)
Created:
2012-04-06 11:17:17 UTC
Size:
18.00 KB
patch
obsolete
>From c6a2168d6ec379a3854bd6216e373bf2f317c4d4 Mon Sep 17 00:00:00 2001 >From: MJ Ray <mjr@phonecoop.coop> >Date: Fri, 6 Apr 2012 12:14:35 +0100 >Subject: [PATCH] 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.pl: be more cautious in assuming info field in CIRCULATION is an itemnumber > >http://bugs.koha-community.org/show_bug.cgi?id=6890 >--- > C4/Reserves.pm | 22 +++ > .../prog/en/modules/catalogue/issuehistory.tt | 2 + > .../intranet-tmpl/prog/en/modules/tools/viewlog.tt | 160 ++++++++++---------- > tools/viewlog.pl | 27 +++- > 4 files changed, 123 insertions(+), 88 deletions(-) > >diff --git a/C4/Reserves.pm b/C4/Reserves.pm >index 930d524..cf9f446 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; >@@ -197,6 +199,9 @@ sub AddReserve { > $found, $waitingdate, $expdate > ); > >+ # Record the fact that this book was reserved. >+ logaction( 'CIRCULATION', 'HOLD', $biblionumber, 'Borrower '.$borrowernumber ); >+ > # Send e-mail to librarian if syspref is active > if(C4::Context->preference("emailLibrarianWhenHoldIsPlaced")){ > my $borrower = C4::Members::GetMember(borrowernumber => $borrowernumber); >@@ -968,6 +973,11 @@ sub CancelReserve { > "; > $sth = $dbh->prepare($query); > $sth->execute( $item, $borr ); >+ >+ # Record the fact that this book was unreserved. >+ logaction( 'CIRCULATION', 'UNHOLD', $biblio, 'Borrower '.$borr ); >+ # FIXME: should look up biblionumber if not given >+ > } > else { > # removing a reserve record.... >@@ -1015,6 +1025,9 @@ sub CancelReserve { > $sth = $dbh->prepare($query); > $sth->execute( $biblio, $borr ); > >+ # Record the fact that this book was unreserved. >+ logaction( 'CIRCULATION', 'UNHOLD', $biblio, 'Borrower '.$borr ); >+ > # now fix the priority on the others.... > _FixPriority( $biblio, $borr ); > } >@@ -1084,6 +1097,9 @@ sub ModReserve { > $sth = $dbh->prepare($query); > $sth->execute( $biblio, $borrower ); > >+ # Record the fact that this book was unreserved. >+ logaction( 'CIRCULATION', 'UNHOLD', $biblio, 'Borrower '.$borrower ); >+ > } > elsif ($rank =~ /^\d+/ and $rank > 0) { > my $query = " >@@ -1104,6 +1120,9 @@ sub ModReserve { > } > } > >+ # Record the fact that this book was unreserved. >+ logaction( 'CIRCULATION', 'HOLD', $biblio, 'Modify hold for borrower '.$borrower ); >+ > _FixPriority( $biblio, $borrower, $rank); > } > } >@@ -1169,6 +1188,9 @@ sub ModReserveFill { > $sth = $dbh->prepare($query); > $sth->execute( $biblionumber, $resdate, $borrowernumber ); > >+ # Record the fact that this book was unreserved. >+ logaction( 'CIRCULATION', 'UNHOLD', $biblionumber, 'Borrower '.$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 14d823c..ab81a52 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/issuehistory.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/issuehistory.tt >@@ -77,6 +77,8 @@ > [% 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/tools/viewlog.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt >index 8449341..b1e04c7 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,85 @@ > <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 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.CIRCULATIONITEM ) %] >+ <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 %] >+ </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 +143,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 +216,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.info |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"> >diff --git a/tools/viewlog.pl b/tools/viewlog.pl >index d42503e..8ea463d 100755 >--- a/tools/viewlog.pl >+++ b/tools/viewlog.pl >@@ -1,7 +1,7 @@ > #!/usr/bin/perl > > # Copyright 2010 BibLibre >-# Copyright 2011 MJ Ray and software.coop >+# Copyright 2011-2012 MJ Ray and software.coop > # > # This file is part of Koha. > # >@@ -116,14 +116,23 @@ if ($do_it) { > @data=@$results; > my $total = scalar @data; > foreach my $result (@data){ >- if ($result->{'info'} eq 'item'||$result->{module} eq "CIRCULATION"){ >- # get item information so we can create a working link >- my $itemnumber=$result->{'object'}; >- $itemnumber=$result->{'info'} if ($result->{module} eq "CIRCULATION"); >- my $item=GetItem($itemnumber); >- $result->{'biblionumber'}=$item->{'biblionumber'}; >- $result->{'biblioitemnumber'}=$item->{'biblionumber'}; >- } >+ if ( >+ $result->{'info'} eq 'item' >+ || ( ( $result->{module} eq "CIRCULATION" ) >+ && ( $result->{'info'} =~ /^\d+$/ ) ) >+ ) >+ { >+ >+ # get item information so we can create a working link >+ my $itemnumber = $result->{'object'}; >+ if ( $result->{module} eq "CIRCULATION" ) { >+ $itemnumber = $result->{'info'}; >+ $result->{CIRCULATIONITEM} = 1; >+ } >+ my $item = GetItem($itemnumber); >+ $result->{'biblionumber'} = $item->{'biblionumber'}; >+ $result->{'biblioitemnumber'} = $item->{'biblionumber'}; >+ } > } > > if ( $output eq "screen" ) { >-- >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