Lines 79-116
if ( $op eq 'add_form' ) {
Link Here
|
79 |
# Choosing the values |
79 |
# Choosing the values |
80 |
my @columns = $input->multi_param('columns'); |
80 |
my @columns = $input->multi_param('columns'); |
81 |
my $columnstring = join( ',', @columns ); |
81 |
my $columnstring = join( ',', @columns ); |
|
|
82 |
my $forbidden = Koha::Report->new->check_columns( undef, \@columns ); |
82 |
my @column_loop; |
83 |
my @column_loop; |
83 |
foreach my $column (@columns) { |
84 |
foreach my $column (@columns) { |
84 |
my %tmp_hash; |
85 |
unless ($forbidden) { |
85 |
$tmp_hash{'name'} = $column; |
86 |
my %tmp_hash; |
86 |
my $type = get_column_type($column); |
87 |
$tmp_hash{'name'} = $column; |
87 |
if ( $type eq 'distinct' ) { |
88 |
my $type = get_column_type($column); |
88 |
my $values = get_distinct_values($column); |
89 |
if ( $type eq 'distinct' ) { |
89 |
$tmp_hash{'values'} = $values; |
90 |
my $values = get_distinct_values($column); |
90 |
$tmp_hash{'distinct'} = 1; |
91 |
$tmp_hash{'values'} = $values; |
|
|
92 |
$tmp_hash{'distinct'} = 1; |
91 |
|
93 |
|
|
|
94 |
} |
95 |
if ( $type eq 'DATE' || $type eq 'DATETIME' ) { |
96 |
$tmp_hash{'date'} = 1; |
97 |
} |
98 |
if ( $type eq 'TEXT' || $type eq 'MEDIUMTEXT' ) { |
99 |
$tmp_hash{'text'} = 1; |
100 |
} |
101 |
push @column_loop, \%tmp_hash; |
92 |
} |
102 |
} |
93 |
if ( $type eq 'DATE' || $type eq 'DATETIME' ) { |
|
|
94 |
$tmp_hash{'date'} = 1; |
95 |
} |
96 |
if ( $type eq 'TEXT' || $type eq 'MEDIUMTEXT' ) { |
97 |
$tmp_hash{'text'} = 1; |
98 |
} |
99 |
|
100 |
# else { |
101 |
# warn $type;# |
102 |
# } |
103 |
push @column_loop, \%tmp_hash; |
104 |
} |
103 |
} |
105 |
|
104 |
|
106 |
$template->param( |
105 |
if (@column_loop) { |
107 |
'step_4' => 1, |
106 |
$template->param( |
108 |
'area' => $area, |
107 |
'step_4' => 1, |
109 |
'definition_name' => $definition_name, |
108 |
'area' => $area, |
110 |
'definition_description' => $definition_description, |
109 |
'definition_name' => $definition_name, |
111 |
'columns' => \@column_loop, |
110 |
'definition_description' => $definition_description, |
112 |
'columnstring' => $columnstring, |
111 |
'columns' => \@column_loop, |
113 |
); |
112 |
'columnstring' => $columnstring, |
|
|
113 |
); |
114 |
} else { |
115 |
my $columns = get_columns( $area, $input ); |
116 |
$template->param( |
117 |
'step_3' => 1, |
118 |
'area' => $area, |
119 |
'definition_name' => $definition_name, |
120 |
'definition_description' => $definition_description, |
121 |
'columns' => \@column_loop, |
122 |
'columnstring' => $columnstring, |
123 |
'passworderr' => 1, |
124 |
); |
125 |
} |
114 |
|
126 |
|
115 |
} elsif ( $op eq 'cud-add_form_5' ) { |
127 |
} elsif ( $op eq 'cud-add_form_5' ) { |
116 |
|
128 |
|
117 |
- |
|
|