Lines 26-31
use C4::Context;
Link Here
|
26 |
use C4::Koha; |
26 |
use C4::Koha; |
27 |
|
27 |
|
28 |
use Koha::Authority::Types; |
28 |
use Koha::Authority::Types; |
|
|
29 |
use Koha::AuthorisedValues; |
29 |
|
30 |
|
30 |
use List::MoreUtils qw( uniq ); |
31 |
use List::MoreUtils qw( uniq ); |
31 |
|
32 |
|
Lines 95-105
if ($op eq 'add_form') {
Link Here
|
95 |
push @kohafields, "auth_header.".$field; |
96 |
push @kohafields, "auth_header.".$field; |
96 |
} |
97 |
} |
97 |
|
98 |
|
98 |
# build authorised value list |
99 |
# build authorised value category list |
99 |
my $authorised_values = C4::Koha::GetAuthorisedValueCategories; |
100 |
my @authorised_value_categories = Koha::AuthorisedValues->new->categories; |
100 |
unshift @$authorised_values, ''; |
101 |
unshift @authorised_value_categories, ''; |
101 |
push @$authorised_values, 'branches'; |
102 |
push @authorised_value_categories, 'branches'; |
102 |
push @$authorised_values, 'itemtypes'; |
103 |
push @authorised_value_categories, 'itemtypes'; |
103 |
|
104 |
|
104 |
# build thesaurus categories list |
105 |
# build thesaurus categories list |
105 |
my @authtypes = uniq( "", map { $_->authtypecode } Koha::Authority::Types->search ); |
106 |
my @authtypes = uniq( "", map { $_->authtypecode } Koha::Authority::Types->search ); |
Lines 154-160
if ($op eq 'add_form') {
Link Here
|
154 |
}; |
155 |
}; |
155 |
$row_data{authorised_value} = { |
156 |
$row_data{authorised_value} = { |
156 |
id => "authorised_value$i", |
157 |
id => "authorised_value$i", |
157 |
values => $authorised_values, |
158 |
values => \@authorised_value_categories, |
158 |
default => $data->{'authorised_value'}, |
159 |
default => $data->{'authorised_value'}, |
159 |
}; |
160 |
}; |
160 |
$row_data{frameworkcode} = { |
161 |
$row_data{frameworkcode} = { |
Lines 233-239
if ($op eq 'add_form') {
Link Here
|
233 |
}; |
234 |
}; |
234 |
$row_data{authorised_value} = { |
235 |
$row_data{authorised_value} = { |
235 |
id => "authorised_value", |
236 |
id => "authorised_value", |
236 |
values => $authorised_values, |
237 |
values => \@authorised_value_categories, |
237 |
default => "", |
238 |
default => "", |
238 |
}; |
239 |
}; |
239 |
$row_data{frameworkcode} = { |
240 |
$row_data{frameworkcode} = { |
Lines 279-285
if ($op eq 'add_form') {
Link Here
|
279 |
my @ohidden = $input->param('ohidden'); |
280 |
my @ohidden = $input->param('ohidden'); |
280 |
#my @ihidden = $input->param('ihidden'); |
281 |
#my @ihidden = $input->param('ihidden'); |
281 |
#my @ehidden = $input->param('ehidden'); |
282 |
#my @ehidden = $input->param('ehidden'); |
282 |
my @authorised_values = $input->param('authorised_value'); |
283 |
my @authorised_value_categories = $input->param('authorised_value'); |
283 |
my $authtypecode = $input->param('authtypecode'); |
284 |
my $authtypecode = $input->param('authtypecode'); |
284 |
my @frameworkcodes = $input->param('frameworkcode'); |
285 |
my @frameworkcodes = $input->param('frameworkcode'); |
285 |
my @value_builder =$input->param('value_builder'); |
286 |
my @value_builder =$input->param('value_builder'); |
Lines 295-301
if ($op eq 'add_form') {
Link Here
|
295 |
my $kohafield =$kohafield[$i]; |
296 |
my $kohafield =$kohafield[$i]; |
296 |
my $tab =$tab[$i]; |
297 |
my $tab =$tab[$i]; |
297 |
my $seealso =$seealso[$i]; |
298 |
my $seealso =$seealso[$i]; |
298 |
my $authorised_value =$authorised_values[$i]; |
299 |
my $authorised_value = $authorised_value_categories[$i]; |
299 |
my $frameworkcode =$frameworkcodes[$i]; |
300 |
my $frameworkcode =$frameworkcodes[$i]; |
300 |
my $value_builder=$value_builder[$i]; |
301 |
my $value_builder=$value_builder[$i]; |
301 |
my $defaultvalue = $defaultvalue[$i]; |
302 |
my $defaultvalue = $defaultvalue[$i]; |