@@ -, +, @@ - adds the fact that we can enter multiple actions - fixes the fact that user information was truncated --- C4/Log.pm | 24 +++---- .../intranet-tmpl/prog/en/includes/circ-menu.inc | 2 +- .../prog/en/modules/tools/viewlog.tmpl | 73 ++++++++++++++++++++ tools/viewlog.pl | 22 ++++--- 4 files changed, 97 insertions(+), 24 deletions(-) --- a/C4/Log.pm +++ a/C4/Log.pm @@ -214,31 +214,27 @@ sub GetLogs { $query .= " AND DATE_FORMAT(timestamp, '%Y-%m-%d') >= \"".$iso_datefrom."\" " if $iso_datefrom; #fix me - mysql specific $query .= " AND DATE_FORMAT(timestamp, '%Y-%m-%d') <= \"".$iso_dateto."\" " if $iso_dateto; if($user) { - $query .= " AND user LIKE ? "; - push(@parameters,"%".$user."%"); + $query .= " AND user = ? "; + push(@parameters,$user); } if(scalar @$modules > 1 or @$modules[0] ne "") { - $query .= " AND (1 = 2"; #always false but used to build the query - foreach my $module (@$modules) { - next if $module eq ""; - $query .= " or module = ?"; - push(@parameters,$module); - } - $query .= ")"; + $query .= " AND module IN (".join(",",map {"?"} @$modules).") "; + push(@parameters,@$modules); } - if($action) { - $query .= " AND action LIKE ? "; - push(@parameters,"%".$action."%"); + if($action && scalar(@$action)) { + $query .= " AND action IN (".join(",",map {"?"} @$action).") "; + push(@parameters,@$action); } if($object) { - $query .= " AND object LIKE ? "; - push(@parameters,"%".$object."%"); + $query .= " AND object = ? "; + push(@parameters,$object); } if($info) { $query .= " AND info LIKE ? "; push(@parameters,"%".$info."%"); } + warn $query, join("/",@parameters); my $sth = $dbh->prepare($query); $sth->execute(@parameters); --- a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc +++ a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc @@ -62,7 +62,7 @@
Date | +Librarian | +Module | +Action | +Object | +Info | +
---|---|---|---|---|---|
+ | + + " title="display detail for this user."> + + " title="display detail for this librarian."> + + | ++ | + | + + " title="Display member details."> member + + + " title="Display member details."> member + + + + &biblionumber=&bi=#item">Item + + " title="Display detail for this biblio">biblio + + + + "> + + + + + + + | ++ + &biblionumber=&bi=#item" title="Display detail for this biblio">Item + + + + | +