Bug Fix : Blocker 2017
[koha_gimpoz] / reports / dictionary.pl
index addb01a..56949aa 100755 (executable)
@@ -80,7 +80,7 @@ elsif ($phase eq 'New Term step 2'){
 elsif ($phase eq 'New Term step 3'){
        # Choosing the columns
        my $area = $input->param('areas');
-       my $columns = get_columns($area);
+       my $columns = get_columns($area,$input);
        my $definition_name=$input->param('definition_name');
        my $definition_description=$input->param('definition_description');             
        $template->param( 'step_3' => 1,
@@ -109,7 +109,7 @@ elsif ($phase eq 'New Term step 4'){
                        $tmp_hash{'distinct'} = 1;
                          
                }
-               if ($type eq 'DATE'){
+               if ($type eq 'DATE' || $type eq 'DATETIME'){
                        $tmp_hash{'date'}=1;
                }
                if ($type eq 'TEXT'){
@@ -133,7 +133,9 @@ elsif ($phase eq 'New Term step 4'){
 
 elsif ($phase eq 'New Term step 5'){
        # Confirmation screen
+       my $areas = C4::Reports::get_report_areas();
        my $area = $input->param('area');
+    my $areaname = $areas->[$area - 1]->{'name'};
        my $columnstring = $input->param('columnstring');
        my $definition_name=$input->param('definition_name');
        my $definition_description=$input->param('definition_description');     
@@ -169,6 +171,7 @@ elsif ($phase eq 'New Term step 5'){
        }
        $template->param( 'step_5' => 1,
                'area' => $area,
+               'areaname' => $areaname,
                'definition_name' => $definition_name,
                'definition_description' => $definition_description,
                'query' => $query_criteria,
@@ -185,7 +188,7 @@ elsif ($phase eq 'New Term step 6'){
        my $sql=$input->param('sql');
        save_dictionary($definition_name,$definition_description,$sql,$area);
        $no_html=1;
-       print $input->redirect("/cgi-bin/koha/reports/guided_reports.pl?phase=View%20Dictionary");      
+       print $input->redirect("/cgi-bin/koha/reports/dictionary.pl?phase=View%20Dictionary");  
 
 }
 elsif ($phase eq 'Delete Definition'){