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