More work on the dictionary, nearly have all the interface done
authorChris Cormack <crc@liblime.com>
Mon, 29 Oct 2007 18:19:51 +0000 (13:19 -0500)
committerJoshua Ferraro <jmf@liblime.com>
Mon, 29 Oct 2007 21:11:24 +0000 (16:11 -0500)
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tmpl
reports/guided_reports.pl

index 82a10c3..2db2d77 100644 (file)
@@ -24,6 +24,7 @@
                <input type="submit" name="phase" value="Used saved"/>
                <input type="submit" name="phase" value="Create report from SQL"/>
                <input type="submit" name="phase" value="Create Compound Report"/>
+               <input type="submit" name="phase" value="View Dictionary"/>
        </form>
 <!-- /TMPL_IF -->
 
index 0c01539..fe5bc03 100755 (executable)
@@ -22,7 +22,7 @@ use C4::Auth;
 use CGI;
 use C4::Output;
 use C4::Reports;
-
+use CGI::Carp qw(fatalsToBrowser);
 =head1 NAME
 
 Script to control the guided report creation
@@ -341,6 +341,95 @@ elsif ($phase eq 'Save Compound'){
        );
 }
 
+elsif ($phase eq 'View Dictionary'){
+       # view the dictionary we use to set up abstract variables such as all borrowers over fifty who live in a certain town
+       ( $template, $borrowernumber, $cookie ) = get_template_and_user(
+    {
+        template_name   => "reports/dictionary.tmpl",
+        query           => $input,
+        type            => "intranet",
+        authnotrequired => 0,
+        flagsrequired   => { editcatalogue => 1 },
+        debug           => 1,
+    }
+       );
+       my $areas = C4::Reports::get_report_areas();
+       $template->param( 'areas' => $areas ,
+       'start_dictionary' => 1,
+       );
+}
+elsif ($phase eq 'Add New Definition'){
+       # display form allowing them to add a new definition
+       ( $template, $borrowernumber, $cookie ) = get_template_and_user(
+    {
+        template_name   => "reports/dictionary.tmpl",
+        query           => $input,
+        type            => "intranet",
+        authnotrequired => 0,
+        flagsrequired   => { editcatalogue => 1 },
+        debug           => 1,
+    }
+       );
+       $template->param( 'new_dictionary' => 1,
+       );
+}
+
+elsif ($phase eq 'New Term step 2'){
+       # Choosing the area
+       ( $template, $borrowernumber, $cookie ) = get_template_and_user(
+    {
+        template_name   => "reports/dictionary.tmpl",
+        query           => $input,
+        type            => "intranet",
+        authnotrequired => 0,
+        flagsrequired   => { editcatalogue => 1 },
+        debug           => 1,
+    }
+       );
+       my $areas = C4::Reports::get_report_areas();
+       $template->param( 'step_2' => 1,
+               'areas' => $areas,
+       );
+       my $definition_name=$input->param('definition_name');
+       my $definition_description=$input->param('definition_description');             
+}
+
+elsif ($phase eq 'New Term step 3'){
+       # Choosing the columns
+       ( $template, $borrowernumber, $cookie ) = get_template_and_user(
+    {
+        template_name   => "reports/dictionary.tmpl",
+        query           => $input,
+        type            => "intranet",
+        authnotrequired => 0,
+        flagsrequired   => { editcatalogue => 1 },
+        debug           => 1,
+    }
+       );
+       my $area = $input->param('areas');
+       my $columns = get_columns($area);
+       $template->param( 'step_3' => 1,
+               'area' => $area,
+               'columns' => $columns,
+       );
+}
+
+elsif ($phase eq 'New Term step 4'){
+       # Choosing the columns
+       ( $template, $borrowernumber, $cookie ) = get_template_and_user(
+    {
+        template_name   => "reports/dictionary.tmpl",
+        query           => $input,
+        type            => "intranet",
+        authnotrequired => 0,
+        flagsrequired   => { editcatalogue => 1 },
+        debug           => 1,
+    }
+       );
+       $template->param( 'step_4' => 1,
+       );
+}
+
 
 if (!$no_html){
        output_html_with_http_headers $input, $cookie, $template->output;