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

(-)a/C4/Log.pm (-1 / +2 lines)
Lines 4-9 package C4::Log; Link Here
4
4
5
5
6
# Copyright 2000-2002 Katipo Communications
6
# Copyright 2000-2002 Katipo Communications
7
# Copyright 2011 MJ Ray and software.coop
7
#
8
#
8
# This file is part of Koha.
9
# This file is part of Koha.
9
#
10
#
Lines 217-223 sub GetLogs { Link Here
217
    	$query .= " AND user = ? ";
218
    	$query .= " AND user = ? ";
218
    	push(@parameters,$user);
219
    	push(@parameters,$user);
219
    }
220
    }
220
    if(scalar @$modules > 1 or @$modules[0] ne "") {
221
    if($modules && scalar(@$modules)) {
221
    	$query .= " AND module IN (".join(",",map {"?"} @$modules).") ";
222
    	$query .= " AND module IN (".join(",",map {"?"} @$modules).") ";
222
	push(@parameters,@$modules);
223
	push(@parameters,@$modules);
223
    }
224
    }
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt (-80 / +5 lines)
Lines 59-69 Link Here
59
								<label for="action">Action:</label>
59
								<label for="action">Action:</label>
60
								<select name="action" id="action">
60
								<select name="action" id="action">
61
									<option value ="">All</option>
61
									<option value ="">All</option>
62
									<option value ="add">Add</option>
62
									<option value ="ADD">Add</option>
63
									<option value ="del">Delete</option>
63
									<option value ="DELETE">Delete</option>
64
									<option value ="mod">Modify</option>
64
									<option value ="MODIFY">Modify</option>
65
									<option value="issue">Checkout</option>
65
									<option value="ISSUE">Checkout</option>
66
									<option value="return">Return</option>
66
									<option value="RETURN">Return</option>
67
								</select>
67
								</select>
68
							</li>
68
							</li>
69
							<li>
69
							<li>
Lines 133-213 Link Here
133
						<input type="submit" value="Submit" />
133
						<input type="submit" value="Submit" />
134
						<input type="hidden" name="do_it" value="1" />
134
						<input type="hidden" name="do_it" value="1" />
135
					</fieldset>
135
					</fieldset>
136
					[% IF ( do_it ) %]
137
						[% IF ( total ) %]
138
							<h4>[% total %] lines found.</h4>
139
							<table>
140
								<tr>
141
									<th>Date</th>
142
									<th>Librarian</th>
143
									<th>Module</th>
144
									<th>Action</th>
145
									<th>Object</th>
146
									<th>Info</th>
147
								</tr>
148
								[% FOREACH loopro IN looprow %]
149
									[% UNLESS ( loop.odd ) %]<tr class="highlight">[% ELSE %]<tr>[% END %]
150
										<td>[% loopro.timestamp %]</td>
151
										<td>
152
											<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% loopro.user %]" title="display detail for this librarian."> [% loopro.user %] </a>
153
										</td>
154
										<td>[% loopro.module %]</td>
155
										<td>[% loopro.action %]</td>
156
										<td>
157
											[% IF ( module == 'MEMBERS' ) %]
158
												<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% loopro.object %]" title="Display member details."> member [% loopro.object %] </a>
159
											[% ELSE %]
160
												[% IF ( module == 'CIRCULATION' ) %]
161
													<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% loopro.object %]" title="Display member details.">
162
														[% IF ( loopro.object ) %]
163
															member [% loopro.object %]
164
														[% END %]
165
													</a>
166
												[% ELSE %]
167
													[% IF ( module == 'CATALOGUING' ) %]
168
														[% IF ( info == 'item' ) %]
169
															<a href="/cgi-bin/koha/catalogue/moredetail.pl?item=[% loopro.object %]&amp;biblionumber=[% loopro.biblionumber %]&amp;bi=[% loopro.biblioitemnumber %]#item[% loopro.object %]">Item [% loopro.object %]</a>
170
														[% ELSE %]
171
															<a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% loopro.object %]" title="Display detail for this biblio">biblio [% loopro.object %]</a>
172
														[% END %]
173
													[% ELSE %]
174
														[% IF ( module == 'SERIAL' ) %]
175
															<a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% loopro.object %]"> [% loopro.object %] </a>
176
														[% ELSE %]
177
															[% IF ( module == 'AUTHORITIES' ) %]
178
																<a href="/cgi-bin/koha/authorities/detail.pl?authid=[% loopro.object %]" title="Display detail for this authority">auth [% loopro.object %]</a>
179
															[% ELSE %]
180
																[% loopro.object %]
181
															[% END %]
182
														[% END %]
183
													[% END %]
184
												[% END %]
185
											[% END %]
186
										</td>
187
										<td>
188
											[% IF ( loopro.CIRCULATION ) %]
189
												<a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% loopro.info %]" title="Display detail for this biblio">biblio [% loopro.info |html %]</a>
190
											[% ELSE %]
191
												[% loopro.info |html %]
192
											[% END %]
193
										</td>
194
									</tr>
195
								[% END %]
196
							</table>
197
						[% ELSE %]
198
							<div class="dialog alert">
199
								No log found
200
								[% IF ( CATALOGUING ) %]
201
									for <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% object %]">Bibliographic Record [% object %]</a>
202
								[% END %]
203
								[% IF ( MEMBERS ) %]
204
									for <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% object %]">[% firstname %] [% surname %] ([% cardnumber %])</a>
205
								[% END %]
206
								.
207
							</div>
208
						[% END %]
209
					[% END %]
210
211
				</form>
136
				</form>
212
                [% END %]
137
                [% END %]
213
                [% IF ( do_it ) %]
138
                [% IF ( do_it ) %]
(-)a/t/db_dependent/Log.t (+32 lines)
Line 0 Link Here
1
#!/usr/bin/perl
2
#
3
# Copyright 2011 MJ Ray and software.coop
4
# This Koha test module is a stub!  
5
# Add more tests here!!!
6
7
use strict;
8
use warnings;
9
use Test::More tests => 3;
10
use C4::Log;
11
12
BEGIN {
13
	use_ok('C4::Log');
14
}
15
my $success;
16
17
eval {
18
    # FIXME: US formatted date hardcoded into test for now
19
    $success = GetLogs("","","",undef,undef,"","");
20
} or do {
21
    diag($@);
22
    $success = 0;
23
};
24
ok($success, "GetLogs returns results for an open search");
25
eval {
26
    # FIXME: US formatted date hardcoded into test for now
27
    $success = GetLogs("09/01/2011","10/01/2011","",undef,undef,"","");
28
} or do {
29
    diag($@);
30
    $success = 0;
31
};
32
ok($success, "GetLogs accepts dates in an All-matching search");
(-)a/tools/viewlog.pl (-2 / +5 lines)
Lines 1-6 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
#
5
#
5
# This file is part of Koha.
6
# This file is part of Koha.
6
#
7
#
Lines 105-111 $template->param( Link Here
105
if ($do_it) {
106
if ($do_it) {
106
107
107
    my @data;
108
    my @data;
108
    my $results = GetLogs($datefrom,$dateto,$user,\@modules,\@action,$object,$info);
109
    my ($results,$modules,$action);
110
    if ($action[0] ne '') { $action = \@action; } # match All means no limit
111
    if ($modules[0] ne '') { $modules = \@modules; } # match All means no limit
112
    $results = GetLogs($datefrom,$dateto,$user,$modules,$action,$object,$info);
109
    @data=@$results;
113
    @data=@$results;
110
    my $total = scalar @data;
114
    my $total = scalar @data;
111
    foreach my $result (@data){
115
    foreach my $result (@data){
112
- 

Return to bug 6460