yay! the reporter spits out csv and excel now ... html tomorrow (with any luck)
[Evergreen.git] / Open-ILS / src / perlmods / OpenILS / WWW / Reporter.pm
index ecbb273..d9d4ecc 100644 (file)
@@ -55,12 +55,18 @@ sub child_init {
 sub handler {
 
        my $apache = shift;
+       return Apache2::Const::DECLINED if (-e $apache->filename);
+
        my $cgi = CGI->new;
 
        my $path = $apache->path_info;
        (my $ttk = $path) =~ s{^/?([a-zA-Z0-9_]+).*?$}{$1}o;
 
-       $ttk = "s1" unless $ttk;
+       $ttk = $apache->filename unless $ttk;
+       $ttk = "dashboard" unless $ttk;
+
+       $ttk = (split '/', $ttk)[-1];
+       
        my $user;
 
        # if the user is not logged in via cookie, route them to the login page
@@ -68,6 +74,7 @@ sub handler {
                $ttk = "login";
        }
 
+
        print "Content-type: text/html; charset=utf-8\n\n";
 
        _process_template(
@@ -91,7 +98,7 @@ sub _process_template {
        my $apache                      = $params{apache}                       || undef;
        my $param_hash          = $params{params}                       || {};
        $$param_hash{dtype_xform_map} = $OpenILS::WWW::Reporter::dtype_xform_map;
-       $$param_hash{dtype_xform} = $OpenILS::WWW::Reporter::dtype_xform;
+       $$param_hash{dtype_xforms} = $OpenILS::WWW::Reporter::dtype_xforms;
 
        my $template;