Pretty close to finished the dictionary now
authorChris Cormack <crc@liblime.com>
Mon, 29 Oct 2007 18:19:54 +0000 (13:19 -0500)
committerJoshua Ferraro <jmf@liblime.com>
Mon, 29 Oct 2007 21:11:29 +0000 (16:11 -0500)
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
C4/Reports.pm
reports/guided_reports.pl

index 336be04..a63c411 100644 (file)
@@ -458,7 +458,7 @@ sub get_column_type {
        while (my $info = $sth->fetchrow_hashref()){
                if ($info->{'COLUMN_NAME'} eq $column){
                        #column we want
-                       if ($info->{'TYPE_NAME'} eq 'CHAR'){
+                       if ($info->{'TYPE_NAME'} eq 'CHAR' || $info->{'TYPE_NAME'} eq 'VARCHAR'){
                                $info->{'TYPE_NAME'} = 'distinct';
                        }
                        return $info->{'TYPE_NAME'};            
index 2b50802..f114216 100755 (executable)
@@ -16,7 +16,7 @@
 # You should have received a copy of the GNU General Public License along with
 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
 # Suite 330, Boston, MA  02111-1307 USA
-use CGI::Carp qw(fatalsToBrowser);
+use CGI::Carp qw(fatalsToBrowser warningsToBrowser);
 use strict;
 use C4::Auth;
 use CGI;
@@ -462,8 +462,11 @@ elsif ($phase eq 'New Term step 4'){
                if ($type eq 'DATE'){
                        $tmp_hash{'date'}=1;
                }
+               if ($type eq 'TEXT'){
+                       $tmp_hash{'text'}=1;
+               }
 #              else {
-#                      die $type;#
+#                      warn $type;#
 #                      }
                push @column_loop,\%tmp_hash;
                }
@@ -535,27 +538,15 @@ elsif ($phase eq 'New Term step 5'){
 }
 
 elsif ($phase eq 'New Term step 6'){
-       # 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,
-    }
-       );
+       # Saving
        my $area = $input->param('area');
        my $definition_name=$input->param('definition_name');
        my $definition_description=$input->param('definition_description');             
        my $sql=$input->param('sql');
        save_dictionary($definition_name,$definition_description,$sql,$area);
-       $template->param( 'step_6' => 1,
-               'area' => $area,
-               'definition_name' => $definition_name,
-               'definition_description' => $definition_description,
-       );
+       $no_html=1;
+       print $input->redirect("/cgi-bin/koha/reports/guided_reports.pl?phase=View%20Dictionary");      
+
 }
 elsif ($phase eq 'Delete Definition'){
        $no_html=1;