View | Details | Raw Unified | Return to bug 6890
Collapse All | Expand All

(-)a/C4/Reserves.pm (+22 lines)
Lines 4-9 package C4::Reserves; Link Here
4
#           2006 SAN Ouest Provence
4
#           2006 SAN Ouest Provence
5
#           2007-2010 BibLibre Paul POULAIN
5
#           2007-2010 BibLibre Paul POULAIN
6
#           2011 Catalyst IT
6
#           2011 Catalyst IT
7
# Copyright 2012 software.coop and MJ Ray
7
#
8
#
8
# This file is part of Koha.
9
# This file is part of Koha.
9
#
10
#
Lines 29-34 use C4::Members; Link Here
29
use C4::Items;
30
use C4::Items;
30
use C4::Circulation;
31
use C4::Circulation;
31
use C4::Accounts;
32
use C4::Accounts;
33
use C4::Log;
32
34
33
# for _koha_notify_reserve
35
# for _koha_notify_reserve
34
use C4::Members::Messaging;
36
use C4::Members::Messaging;
Lines 197-202 sub AddReserve { Link Here
197
        $found,          $waitingdate,	$expdate
199
        $found,          $waitingdate,	$expdate
198
    );
200
    );
199
201
202
    # Record the fact that this book was reserved.
203
    logaction( 'CIRCULATION', 'HOLD', $biblionumber, 'Borrower '.$borrowernumber );
204
200
    # Send e-mail to librarian if syspref is active
205
    # Send e-mail to librarian if syspref is active
201
    if(C4::Context->preference("emailLibrarianWhenHoldIsPlaced")){
206
    if(C4::Context->preference("emailLibrarianWhenHoldIsPlaced")){
202
        my $borrower = C4::Members::GetMember(borrowernumber => $borrowernumber);
207
        my $borrower = C4::Members::GetMember(borrowernumber => $borrowernumber);
Lines 968-973 sub CancelReserve { Link Here
968
        ";
973
        ";
969
        $sth = $dbh->prepare($query);
974
        $sth = $dbh->prepare($query);
970
        $sth->execute( $item, $borr );
975
        $sth->execute( $item, $borr );
976
977
        # Record the fact that this book was unreserved.
978
        logaction( 'CIRCULATION', 'UNHOLD', $biblio, 'Borrower '.$borr );
979
        # FIXME: should look up biblionumber if not given
980
971
    }
981
    }
972
    else {
982
    else {
973
        # removing a reserve record....
983
        # removing a reserve record....
Lines 1015-1020 sub CancelReserve { Link Here
1015
        $sth = $dbh->prepare($query);
1025
        $sth = $dbh->prepare($query);
1016
        $sth->execute( $biblio, $borr );
1026
        $sth->execute( $biblio, $borr );
1017
1027
1028
        # Record the fact that this book was unreserved.
1029
        logaction( 'CIRCULATION', 'UNHOLD', $biblio, 'Borrower '.$borr );
1030
1018
        # now fix the priority on the others....
1031
        # now fix the priority on the others....
1019
        _FixPriority( $biblio, $borr );
1032
        _FixPriority( $biblio, $borr );
1020
    }
1033
    }
Lines 1084-1089 sub ModReserve { Link Here
1084
        $sth = $dbh->prepare($query);
1097
        $sth = $dbh->prepare($query);
1085
        $sth->execute( $biblio, $borrower );
1098
        $sth->execute( $biblio, $borrower );
1086
        
1099
        
1100
        # Record the fact that this book was unreserved.
1101
        logaction( 'CIRCULATION', 'UNHOLD', $biblio, 'Borrower '.$borrower );
1102
1087
    }
1103
    }
1088
    elsif ($rank =~ /^\d+/ and $rank > 0) {
1104
    elsif ($rank =~ /^\d+/ and $rank > 0) {
1089
        my $query = "
1105
        my $query = "
Lines 1104-1109 sub ModReserve { Link Here
1104
            }
1120
            }
1105
        }
1121
        }
1106
1122
1123
        # Record the fact that this book was unreserved.
1124
        logaction( 'CIRCULATION', 'HOLD', $biblio, 'Modify hold for borrower '.$borrower );
1125
1107
        _FixPriority( $biblio, $borrower, $rank);
1126
        _FixPriority( $biblio, $borrower, $rank);
1108
    }
1127
    }
1109
}
1128
}
Lines 1169-1174 sub ModReserveFill { Link Here
1169
    $sth = $dbh->prepare($query);
1188
    $sth = $dbh->prepare($query);
1170
    $sth->execute( $biblionumber, $resdate, $borrowernumber );
1189
    $sth->execute( $biblionumber, $resdate, $borrowernumber );
1171
    
1190
    
1191
    # Record the fact that this book was unreserved.
1192
    logaction( 'CIRCULATION', 'UNHOLD', $biblionumber, 'Borrower '.$borrowernumber );
1193
1172
    # now fix the priority on the others (if the priority wasn't
1194
    # now fix the priority on the others (if the priority wasn't
1173
    # already sorted!)....
1195
    # already sorted!)....
1174
    unless ( $priority == 0 ) {
1196
    unless ( $priority == 0 ) {
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/issuehistory.tt (+2 lines)
Lines 77-82 Link Here
77
    [% END %]
77
    [% END %]
78
</div>
78
</div>
79
79
80
<p>See also: <a href="/cgi-bin/koha/tools/viewlog.pl?do_it=1&amp;modules=CIRCULATION&amp;object=[% biblionumber |url %]">circulation log for [% title |html %]</a></p>
81
80
</div>
82
</div>
81
</div>
83
</div>
82
<div class="yui-b">
84
<div class="yui-b">
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt (-79 / +81 lines)
Lines 29-34 Link Here
29
			<div class="yui-b">
29
			<div class="yui-b">
30
                [% IF ( CAN_user_reports ) %]
30
                [% IF ( CAN_user_reports ) %]
31
				<h1>Browse system logs</h1>
31
				<h1>Browse system logs</h1>
32
                [% IF ( do_it ) %]
33
                    [% IF ( total ) %]
34
                        <h4>[% total %] lines found.</h4>
35
                        <table>
36
                            <tr>
37
                                <th>Date</th>
38
                                <th>Librarian</th>
39
                                <th>Module</th>
40
                                <th>Action</th>
41
                                <th>Object</th>
42
                                <th>Info</th>
43
                            </tr>
44
                            [% FOREACH loopro IN looprow %]
45
                                [% UNLESS ( loop.odd ) %]<tr class="highlight">[% ELSE %]<tr>[% END %]
46
                                <tr>
47
                                    <td>[% loopro.timestamp %]</td>
48
                                    <td>
49
                                       [% IF ( module == 'CIRCULATION' ) %]
50
                                        <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% loopro.user %]" title="display detail for this user."> [% loopro.user %] </a>
51
                                        [% ELSE %]
52
                                        <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% loopro.user %]" title="display detail for this librarian."> [% loopro.user %] </a>
53
                                        [% END %]
54
                                    </td>
55
                                    <td>[% loopro.module %]</td>
56
                                    <td>[% loopro.action %]</td>
57
                                    <td>
58
                                        [% IF ( module == 'MEMBERS' ) %]
59
                                            <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% loopro.object %]" title="Display member details."> member [% loopro.object %] </a>
60
                                        [% ELSE %]
61
                                            [% IF ( module == 'CIRCULATION' ) %]
62
                                            <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% loopro.object %]" title="Display member details.">
63
                                                [% IF ( loopro.object ) %]
64
                                                    member [% loopro.object %]
65
                                                [% END %]
66
                                            </a>
67
                                            [% ELSE %]
68
                                                [% IF ( module == 'CATALOGUING' ) %]
69
                                                    [% IF ( info == 'item' ) %]
70
                                                        <a href="/cgi-bin/koha/catalogue/moredetail.pl?item=[% loopro.object %]&biblionumber=[% loopro.biblionumber %]&bi=[% loopro.biblioitemnumber %]#item[% loopro.object %]">Item [% loopro.object %]</a>
71
                                                    [% ELSE %]
72
                                                        <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% loopro.object %]" title="Display detail for this biblio">biblio [% loopro.object %]</a>
73
                                                    [% END %]
74
                                                [% ELSE %]
75
                                                    [% IF ( module == 'SERIAL' ) %]
76
                                                        <a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% loopro.object %]"> [% loopro.object %] </a>
77
                                                    [% ELSE %]
78
                                                        [% IF ( module == 'AUTHORITIES' ) %]
79
                                                            <a href="/cgi-bin/koha/authorities/detail.pl?authid=[% loopro.object %]" title="Display detail for this authority">auth [% loopro.object %]</a>
80
                                                        [% ELSE %]
81
                                                            [% loopro.object %]
82
                                                        [% END %]
83
                                                    [% END %]
84
                                                [% END %]
85
                                            [% END %]
86
                                        [% END %]
87
                                    </td>
88
                                    <td>
89
                                        [% IF ( loopro.CIRCULATIONITEM ) %]
90
                                            <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>
91
                                        [% ELSE %]
92
                                            [% loopro.info |html %]
93
                                        [% END %]
94
                                    </td>
95
                                </tr>
96
                            [% END %]
97
                        </table>
98
                    [% ELSE %]
99
                        <div class="dialog alert">
100
                            No log found
101
                            [% IF ( CATALOGUING ) %]
102
                                for <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% object %]">Bibliographic Record [% object %]</a>
103
                            [% END %]
104
                            [% IF ( MEMBERS ) %]
105
                                for <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% object %]">[% INCLUDE 'patron-title.inc' %]</a>
106
                            [% END %]
107
                            .
108
                        </div>
109
                    [% END %]
110
                [% END %]
32
				<form method="post" action="/cgi-bin/koha/tools/viewlog.pl">
111
				<form method="post" action="/cgi-bin/koha/tools/viewlog.pl">
33
					[% IF ( do_it ) %]
112
					[% IF ( do_it ) %]
34
						<input type="hidden" name="do_it" value="[% do_it %]" />
113
						<input type="hidden" name="do_it" value="[% do_it %]" />
Lines 64-69 Link Here
64
									<option value ="MODIFY">Modify</option>
143
									<option value ="MODIFY">Modify</option>
65
									<option value="ISSUE">Checkout</option>
144
									<option value="ISSUE">Checkout</option>
66
									<option value="RETURN">Return</option>
145
									<option value="RETURN">Return</option>
146
									<option value="HOLD">Hold</option>
147
									<option value="UNHOLD">Unhold</option>
67
								</select>
148
								</select>
68
							</li>
149
							</li>
69
							<li>
150
							<li>
Lines 135-219 Link Here
135
					</fieldset>
216
					</fieldset>
136
			</form>
217
			</form>
137
                [% END %]
218
                [% END %]
138
                [% IF ( do_it ) %]
139
                    [% IF ( total ) %]
140
                        <h4>[% total %] lines found.</h4>
141
                        <table>
142
                            <tr>
143
                                <th>Date</th>
144
                                <th>Librarian</th>
145
                                <th>Module</th>
146
                                <th>Action</th>
147
                                <th>Object</th>
148
                                <th>Info</th>
149
                            </tr>
150
                            [% FOREACH loopro IN looprow %]
151
                                [% UNLESS ( loop.odd ) %]<tr class="highlight">[% ELSE %]<tr>[% END %]
152
                                <tr>
153
                                    <td>[% loopro.timestamp %]</td>
154
                                    <td>
155
                                       [% IF ( module == 'CIRCULATION' ) %]
156
                                        <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% loopro.user %]" title="display detail for this user."> [% loopro.user %] </a>
157
                                        [% ELSE %]
158
                                        <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% loopro.user %]" title="display detail for this librarian."> [% loopro.user %] </a>
159
                                        [% END %]
160
                                    </td>
161
                                    <td>[% loopro.module %]</td>
162
                                    <td>[% loopro.action %]</td>
163
                                    <td>
164
                                        [% IF ( module == 'MEMBERS' ) %]
165
                                            <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% loopro.object %]" title="Display member details."> member [% loopro.object %] </a>
166
                                        [% ELSE %]
167
                                            [% IF ( module == 'CIRCULATION' ) %]
168
                                            <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% loopro.object %]" title="Display member details.">
169
                                                [% IF ( loopro.object ) %]
170
                                                    member [% loopro.object %]
171
                                                [% END %]
172
                                            </a>
173
                                            [% ELSE %]
174
                                                [% IF ( module == 'CATALOGUING' ) %]
175
                                                    [% IF ( info == 'item' ) %]
176
                                                        <a href="/cgi-bin/koha/catalogue/moredetail.pl?item=[% loopro.object %]&biblionumber=[% loopro.biblionumber %]&bi=[% loopro.biblioitemnumber %]#item[% loopro.object %]">Item [% loopro.object %]</a>
177
                                                    [% ELSE %]
178
                                                        <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% loopro.object %]" title="Display detail for this biblio">biblio [% loopro.object %]</a>
179
                                                    [% END %]
180
                                                [% ELSE %]
181
                                                    [% IF ( module == 'SERIAL' ) %]
182
                                                        <a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% loopro.object %]"> [% loopro.object %] </a>
183
                                                    [% ELSE %]
184
                                                        [% IF ( module == 'AUTHORITIES' ) %]
185
                                                            <a href="/cgi-bin/koha/authorities/detail.pl?authid=[% loopro.object %]" title="Display detail for this authority">auth [% loopro.object %]</a>
186
                                                        [% ELSE %]
187
                                                            [% loopro.object %]
188
                                                        [% END %]
189
                                                    [% END %]
190
                                                [% END %]
191
                                            [% END %]
192
                                        [% END %]
193
                                    </td>
194
                                    <td>
195
                                        [% IF ( loopro.CIRCULATION ) %]
196
                                            <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>
197
                                        [% ELSE %]
198
                                            [% loopro.info |html %]
199
                                        [% END %]
200
                                    </td>
201
                                </tr>
202
                            [% END %]
203
                        </table>
204
                    [% ELSE %]
205
                        <div class="dialog alert">
206
                            No log found
207
                            [% IF ( CATALOGUING ) %]
208
                                for <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% object %]">Bibliographic Record [% object %]</a>
209
                            [% END %]
210
                            [% IF ( MEMBERS ) %]
211
                                for <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% object %]">[% INCLUDE 'patron-title.inc' %]</a>
212
                            [% END %]
213
                            .
214
                        </div>
215
                    [% END %]
216
                [% END %]
217
			</div>
219
			</div>
218
		</div>
220
		</div>
219
		<div class="yui-b noprint">
221
		<div class="yui-b noprint">
(-)a/tools/viewlog.pl (-10 / +18 lines)
Lines 1-7 Link Here
1
#!/usr/bin/perl
1
#!/usr/bin/perl
2
2
3
# Copyright 2010 BibLibre
3
# Copyright 2010 BibLibre
4
# Copyright 2011 MJ Ray and software.coop
4
# Copyright 2011-2012 MJ Ray and software.coop
5
#
5
#
6
# This file is part of Koha.
6
# This file is part of Koha.
7
#
7
#
Lines 116-129 if ($do_it) { Link Here
116
    @data=@$results;
116
    @data=@$results;
117
    my $total = scalar @data;
117
    my $total = scalar @data;
118
    foreach my $result (@data){
118
    foreach my $result (@data){
119
	if ($result->{'info'} eq 'item'||$result->{module} eq "CIRCULATION"){
119
        if (
120
	    # get item information so we can create a working link
120
            $result->{'info'} eq 'item'
121
        my $itemnumber=$result->{'object'};
121
            || ( ( $result->{module} eq "CIRCULATION" )
122
        $itemnumber=$result->{'info'} if ($result->{module} eq "CIRCULATION");
122
                && ( $result->{'info'} =~ /^\d+$/ ) )
123
	    my $item=GetItem($itemnumber);
123
          )
124
	    $result->{'biblionumber'}=$item->{'biblionumber'};
124
        {
125
	    $result->{'biblioitemnumber'}=$item->{'biblionumber'};		
125
126
	}
126
            # get item information so we can create a working link
127
            my $itemnumber = $result->{'object'};
128
            if ( $result->{module} eq "CIRCULATION" ) {
129
              $itemnumber = $result->{'info'};
130
              $result->{CIRCULATIONITEM} = 1;
131
            }
132
            my $item = GetItem($itemnumber);
133
            $result->{'biblionumber'}     = $item->{'biblionumber'};
134
            $result->{'biblioitemnumber'} = $item->{'biblionumber'};
135
        }
127
    }
136
    }
128
    
137
    
129
    if ( $output eq "screen" ) {
138
    if ( $output eq "screen" ) {
130
- 

Return to bug 6890