Modifications to viewlog.pl to keep it in the context from which it was called.
authorChris Nighswonger <cnighswonger@foundations.edu>
Wed, 19 Mar 2008 11:29:27 +0000 (07:29 -0400)
committerJoshua Ferraro <jmf@liblime.com>
Wed, 19 Mar 2008 20:44:45 +0000 (15:44 -0500)
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tmpl
tools/viewlog.pl

index 4c7010c..06ac666 100644 (file)
 
 <form method="post" action="/cgi-bin/koha/tools/viewlog.pl">
 
+           <!-- TMPL_IF NAME="do_it" --><input type="hidden" name="do_it" value="<!--TMPL_VAR NAME="do_it" -->" /><!-- /TMPL_IF -->
+           <input type="hidden" name="module" value="<!--TMPL_VAR NAME="module" -->" />
+           <input type="hidden" name="action" value="<!--TMPL_VAR NAME="action" -->" />
+           <input type="hidden" name="object" value="<!--TMPL_VAR NAME="object" -->" />
+           <input type="hidden" name="src" value="<!--TMPL_VAR NAME="src" -->" />
 <fieldset>
     <legend>Additional parameters</legend>
         <p>
@@ -39,7 +44,7 @@
                                //      }
                                //      if (dateFrom > today) { 
                                //              alert("The starting date cannot be in the future.");
-                               //              document.getElementById(from_id).select();
+                           //          document.getElementById(from_id).select();
                                //              return false;
                                //      }
                                // }
        </tr>
        <tr>
            <td>
-            <input type="submit" value="filter" />
+            <input type="submit" value="Apply Filter" />
             <input type="hidden" name="do_it" value="1" />
            </td>
            <td>
index 7ae10e2..b5505d2 100755 (executable)
@@ -27,6 +27,7 @@ use C4::Dates;
 use C4::Output;
 use C4::Log;
 use C4::Items;
+use Data::Dumper;
 
 use vars qw($debug);
 
@@ -41,6 +42,7 @@ plugin that shows a stats on borrowers
 =cut
 
 my $input    = new CGI;
+
 $debug or $debug = $input->param('debug') || 0;
 my $do_it    = $input->param('do_it');
 my $module   = $input->param("module");
@@ -67,29 +69,27 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
     }
 );
 
-warn "Source of call was $src";
-
 if ($src eq 'circ') {   # if we were called from circulation, use the circulation menu and get data to populate it -fbcit
     use C4::Members;
     my $borrowernumber = $object;
     my $data = GetMember($borrowernumber,'borrowernumber');
     my ($picture, $dberror) = GetPatronImage($data->{'cardnumber'});
     $template->param( picture => 1 ) if $picture;
-    $template->param(   menu => 1,
-                        title => $data->{'title'},
-                        initials => $data->{'initials'},
-                        surname => $data->{'surname'},
-                        borrowernumber => $borrowernumber,
-                        firstname => $data->{'firstname'},
-                        cardnumber => $data->{'cardnumber'},
-                        categorycode => $data->{'categorycode'},
-                        address => $data->{'address'},
-                        address2 => $data->{'address2'},
-                        city => $data->{'city'},
-                        phone => $data->{'phone'},
-                        phonepro => $data->{'phonepro'},
-                        email => $data->{'email'},
-                        branchcode => $data->{'branchcode'},
+    $template->param(   menu            => 1,
+                        title           => $data->{'title'},
+                        initials        => $data->{'initials'},
+                        surname         => $data->{'surname'},
+                        borrowernumber  => $borrowernumber,
+                        firstname       => $data->{'firstname'},
+                        cardnumber      => $data->{'cardnumber'},
+                        categorycode    => $data->{'categorycode'},
+                        address         => $data->{'address'},
+                        address2        => $data->{'address2'},
+                        city            => $data->{'city'},
+                        phone           => $data->{'phone'},
+                        phonepro        => $data->{'phonepro'},
+                        email           => $data->{'email'},
+                        branchcode      => $data->{'branchcode'},
     );
 }
 
@@ -103,6 +103,7 @@ if ($do_it) {
 
     my $results = GetLogs($datefrom,$dateto,$user,$module,$action,$object,$info);
     my $total = scalar @$results;
+    warn "Total records retrieved = $total";
     foreach my $result (@$results){
        if ($result->{'info'} eq 'item'){
            # get item information so we can create a working link
@@ -127,6 +128,7 @@ if ($do_it) {
             object   => $object,
             action   => $action,
             info     => $info,
+            src      => $src,
         );
         output_html_with_http_headers $input, $cookie, $template->output;
     } else {