Lines 25-30
use C4::Context;
Link Here
|
25 |
use C4::Koha; |
25 |
use C4::Koha; |
26 |
|
26 |
|
27 |
use Koha::Authority::Types; |
27 |
use Koha::Authority::Types; |
|
|
28 |
use Koha::AuthorisedValues; |
28 |
|
29 |
|
29 |
use List::MoreUtils qw( uniq ); |
30 |
use List::MoreUtils qw( uniq ); |
30 |
|
31 |
|
Lines 92-102
if ($op eq 'add_form') {
Link Here
|
92 |
push @kohafields, "auth_header.".$field; |
93 |
push @kohafields, "auth_header.".$field; |
93 |
} |
94 |
} |
94 |
|
95 |
|
95 |
# build authorised value list |
96 |
# build authorised value category list |
96 |
my $authorised_values = C4::Koha::GetAuthorisedValueCategories; |
97 |
my @authorised_value_categories = Koha::AuthorisedValues->new->categories; |
97 |
unshift @$authorised_values, ''; |
98 |
unshift @authorised_value_categories, ''; |
98 |
push @$authorised_values, 'branches'; |
99 |
push @authorised_value_categories, 'branches'; |
99 |
push @$authorised_values, 'itemtypes'; |
100 |
push @authorised_value_categories, 'itemtypes'; |
100 |
|
101 |
|
101 |
# build thesaurus categories list |
102 |
# build thesaurus categories list |
102 |
my @authtypes = uniq( "", map { $_->authtypecode } Koha::Authority::Types->search ); |
103 |
my @authtypes = uniq( "", map { $_->authtypecode } Koha::Authority::Types->search ); |
Lines 138-144
if ($op eq 'add_form') {
Link Here
|
138 |
$row_data{seealso} = $data->{'seealso'}; |
139 |
$row_data{seealso} = $data->{'seealso'}; |
139 |
$row_data{kohafields} = \@kohafields; |
140 |
$row_data{kohafields} = \@kohafields; |
140 |
$row_data{kohafield} = $data->{'kohafield'}; |
141 |
$row_data{kohafield} = $data->{'kohafield'}; |
141 |
$row_data{authorised_values} = $authorised_values; |
142 |
$row_data{authorised_values} = \@authorised_value_categories; |
142 |
$row_data{authorised_value} = $data->{'authorised_value'}; |
143 |
$row_data{authorised_value} = $data->{'authorised_value'}; |
143 |
$row_data{frameworkcodes} = \@authtypes; |
144 |
$row_data{frameworkcodes} = \@authtypes; |
144 |
$row_data{frameworkcode} = $data->{'frameworkcode'}; |
145 |
$row_data{frameworkcode} = $data->{'frameworkcode'}; |
Lines 167-173
if ($op eq 'add_form') {
Link Here
|
167 |
$row_data{mandatory} = 0; |
168 |
$row_data{mandatory} = 0; |
168 |
$row_data{isurl} = 0; |
169 |
$row_data{isurl} = 0; |
169 |
$row_data{kohafields} = \@kohafields, |
170 |
$row_data{kohafields} = \@kohafields, |
170 |
$row_data{authorised_values} = $authorised_values; |
171 |
$row_data{authorised_values} = \@authorised_value_categories; |
171 |
$row_data{frameworkcodes} = \@authtypes; |
172 |
$row_data{frameworkcodes} = \@authtypes; |
172 |
$row_data{value_builders} = \@value_builder; |
173 |
$row_data{value_builders} = \@value_builder; |
173 |
$row_data{row} = $i; |
174 |
$row_data{row} = $i; |
Lines 199-205
if ($op eq 'add_form') {
Link Here
|
199 |
my @tab = $input->multi_param('tab'); |
200 |
my @tab = $input->multi_param('tab'); |
200 |
my @seealso = $input->multi_param('seealso'); |
201 |
my @seealso = $input->multi_param('seealso'); |
201 |
my @ohidden = $input->multi_param('ohidden'); |
202 |
my @ohidden = $input->multi_param('ohidden'); |
202 |
my @authorised_values = $input->multi_param('authorised_value'); |
203 |
my @authorised_value_categories = $input->multi_param('authorised_value'); |
203 |
my $authtypecode = $input->param('authtypecode'); |
204 |
my $authtypecode = $input->param('authtypecode'); |
204 |
my @frameworkcodes = $input->multi_param('frameworkcode'); |
205 |
my @frameworkcodes = $input->multi_param('frameworkcode'); |
205 |
my @value_builder =$input->multi_param('value_builder'); |
206 |
my @value_builder =$input->multi_param('value_builder'); |
Lines 215-221
if ($op eq 'add_form') {
Link Here
|
215 |
my $kohafield =$kohafield[$i]; |
216 |
my $kohafield =$kohafield[$i]; |
216 |
my $tab =$tab[$i]; |
217 |
my $tab =$tab[$i]; |
217 |
my $seealso =$seealso[$i]; |
218 |
my $seealso =$seealso[$i]; |
218 |
my $authorised_value =$authorised_values[$i]; |
219 |
my $authorised_value = $authorised_value_categories[$i]; |
219 |
my $frameworkcode =$frameworkcodes[$i]; |
220 |
my $frameworkcode =$frameworkcodes[$i]; |
220 |
my $value_builder=$value_builder[$i]; |
221 |
my $value_builder=$value_builder[$i]; |
221 |
my $defaultvalue = $defaultvalue[$i]; |
222 |
my $defaultvalue = $defaultvalue[$i]; |