View | Details | Raw Unified | Return to bug 15803
Collapse All | Expand All

(-)a/C4/Koha.pm (-21 lines)
Lines 53-59 BEGIN { Link Here
53
		&getitemtypeimagesrc
53
		&getitemtypeimagesrc
54
		&getitemtypeimagelocation
54
		&getitemtypeimagelocation
55
		&GetAuthorisedValues
55
		&GetAuthorisedValues
56
		&GetAuthorisedValueCategories
57
		&GetKohaAuthorisedValues
56
		&GetKohaAuthorisedValues
58
		&GetKohaAuthorisedValuesFromField
57
		&GetKohaAuthorisedValuesFromField
59
    &GetKohaAuthorisedValuesMapping
58
    &GetKohaAuthorisedValuesMapping
Lines 1063-1088 sub GetAuthorisedValues { Link Here
1063
    return \@results;
1062
    return \@results;
1064
}
1063
}
1065
1064
1066
=head2 GetAuthorisedValueCategories
1067
1068
  $auth_categories = GetAuthorisedValueCategories();
1069
1070
Return an arrayref of all of the available authorised
1071
value categories.
1072
1073
=cut
1074
1075
sub GetAuthorisedValueCategories {
1076
    my $dbh = C4::Context->dbh;
1077
    my $sth = $dbh->prepare("SELECT DISTINCT category FROM authorised_values ORDER BY category");
1078
    $sth->execute;
1079
    my @results;
1080
    while (defined (my $category  = $sth->fetchrow_array) ) {
1081
        push @results, $category;
1082
    }
1083
    return \@results;
1084
}
1085
1086
=head2 GetAuthorisedValueByCode
1065
=head2 GetAuthorisedValueByCode
1087
1066
1088
$authorised_value = GetAuthorisedValueByCode( $category, $authvalcode, $opac );
1067
$authorised_value = GetAuthorisedValueByCode( $category, $authvalcode, $opac );
(-)a/Koha/Template/Plugin/AuthorisedValues.pm (+15 lines)
Lines 22-27 use Template::Plugin; Link Here
22
use base qw( Template::Plugin );
22
use base qw( Template::Plugin );
23
23
24
use C4::Koha;
24
use C4::Koha;
25
use Koha::AuthorisedValues;
25
26
26
sub GetByCode {
27
sub GetByCode {
27
    my ( $self, $category, $code, $opac ) = @_;
28
    my ( $self, $category, $code, $opac ) = @_;
Lines 38-43 sub GetAuthValueDropbox { Link Here
38
    return C4::Koha::GetAuthvalueDropbox($category, $default);
39
    return C4::Koha::GetAuthvalueDropbox($category, $default);
39
}
40
}
40
41
42
sub GetCategories {
43
    my ( $self, $params ) = @_;
44
    my $selected = $params->{selected};
45
    my @categories = Koha::AuthorisedValues->new->categories;
46
    return [
47
        map {
48
            {
49
                category => $_,
50
                ( ( $selected and $selected eq $_ ) ? ( selected => 1 ) : () ),
51
            }
52
        } @categories
53
    ];
54
}
55
41
1;
56
1;
42
57
43
=head1 NAME
58
=head1 NAME
(-)a/admin/aqbudgets.pl (-19 / +6 lines)
Lines 153-177 if ($op eq 'add_form') { Link Here
153
        $row{selected} = 1 if $budget and $thisbranch eq $budget->{'budget_branchcode'};
153
        $row{selected} = 1 if $budget and $thisbranch eq $budget->{'budget_branchcode'};
154
        push @branchloop_select, \%row;
154
        push @branchloop_select, \%row;
155
    }
155
    }
156
    
156
157
    # populates the YUI planning button
157
    # populates the planning button
158
    my $categories = GetAuthorisedValueCategories();
158
    $template->param(
159
    my @auth_cats_loop1 = ();
159
        sort1_auth => $budget->{sort1_authcat},
160
    foreach my $category (@$categories) {
160
        sort2_auth => $budget->{sort2_authcat},
161
        my $entry = { category => $category,
161
    );
162
                        selected => ( $budget and $budget->{sort1_authcat} eq $category ? 1 : 0 ),
163
                    };
164
        push @auth_cats_loop1, $entry;
165
    }
166
    my @auth_cats_loop2 = ();
167
    foreach my $category (@$categories) {
168
        my $entry = { category => $category,
169
                        selected => ( $budget and $budget->{sort2_authcat} eq $category ? 1 : 0 ),
170
                    };
171
        push @auth_cats_loop2, $entry;
172
    }
173
    $template->param(authorised_value_categories1 => \@auth_cats_loop1);
174
    $template->param(authorised_value_categories2 => \@auth_cats_loop2);
175
162
176
    if($budget->{'budget_permission'}){
163
    if($budget->{'budget_permission'}){
177
        my $budget_permission = "budget_perm_".$budget->{'budget_permission'};
164
        my $budget_permission = "budget_perm_".$budget->{'budget_permission'};
(-)a/admin/auth_subfields_structure.pl (-9 / +10 lines)
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];
(-)a/admin/auth_tag_structure.pl (-8 / +1 lines)
Lines 92-104 if ($op eq 'add_form') { Link Here
92
        $data=$sth->fetchrow_hashref;
92
        $data=$sth->fetchrow_hashref;
93
    }
93
    }
94
94
95
    my @authorised_values = @{C4::Koha::GetAuthorisedValueCategories()};    # function returns array ref, dereferencing
96
    unshift @authorised_values, "";                                         # put empty value first
97
    my $authorised_value = {
98
        values  => \@authorised_values,
99
        default => $data->{'authorised_value'},
100
    };
101
102
    if ($searchfield) {
95
    if ($searchfield) {
103
        $template->param('searchfield' => $searchfield);
96
        $template->param('searchfield' => $searchfield);
104
        $template->param('heading_modify_tag_p' => 1);
97
        $template->param('heading_modify_tag_p' => 1);
Lines 110-116 if ($op eq 'add_form') { Link Here
110
                            libopac => $data->{'libopac'},
103
                            libopac => $data->{'libopac'},
111
                            repeatable => "".$data->{'repeatable'},
104
                            repeatable => "".$data->{'repeatable'},
112
                            mandatory => "".$data->{'mandatory'},
105
                            mandatory => "".$data->{'mandatory'},
113
                            authorised_value => $authorised_value,
106
                            authorised_value => $data->{authorised_value},
114
                            authtypecode => $authtypecode,
107
                            authtypecode => $authtypecode,
115
                            );
108
                            );
116
                                                    # END $OP eq ADD_FORM
109
                                                    # END $OP eq ADD_FORM
(-)a/admin/items_search_field.pl (-3 lines)
Lines 21-27 use CGI; Link Here
21
21
22
use C4::Auth;
22
use C4::Auth;
23
use C4::Output;
23
use C4::Output;
24
use C4::Koha;
25
24
26
use Koha::Item::Search::Field qw(GetItemSearchField ModItemSearchField);
25
use Koha::Item::Search::Field qw(GetItemSearchField ModItemSearchField);
27
26
Lines 53-63 if ($op eq 'mod') { Link Here
53
}
52
}
54
53
55
my $field = GetItemSearchField($name);
54
my $field = GetItemSearchField($name);
56
my $authorised_values_categories = C4::Koha::GetAuthorisedValueCategories();
57
55
58
$template->param(
56
$template->param(
59
    field => $field,
57
    field => $field,
60
    authorised_values_categories => $authorised_values_categories,
61
);
58
);
62
59
63
output_html_with_http_headers $cgi, $cookie, $template->output;
60
output_html_with_http_headers $cgi, $cookie, $template->output;
(-)a/admin/items_search_fields.pl (-3 lines)
Lines 21-27 use CGI; Link Here
21
21
22
use C4::Auth;
22
use C4::Auth;
23
use C4::Output;
23
use C4::Output;
24
use C4::Koha;
25
24
26
use Koha::Item::Search::Field qw(AddItemSearchField GetItemSearchFields DelItemSearchField);
25
use Koha::Item::Search::Field qw(AddItemSearchField GetItemSearchFields DelItemSearchField);
27
26
Lines 71-81 if ($op eq 'add') { Link Here
71
}
70
}
72
71
73
my @fields = GetItemSearchFields();
72
my @fields = GetItemSearchFields();
74
my $authorised_values_categories = C4::Koha::GetAuthorisedValueCategories();
75
73
76
$template->param(
74
$template->param(
77
    fields => \@fields,
75
    fields => \@fields,
78
    authorised_values_categories => $authorised_values_categories,
79
);
76
);
80
77
81
output_html_with_http_headers $cgi, $cookie, $template->output;
78
output_html_with_http_headers $cgi, $cookie, $template->output;
(-)a/admin/marctagstructure.pl (-8 / +3 lines)
Lines 28-33 use C4::Output; Link Here
28
use C4::Context;
28
use C4::Context;
29
29
30
use Koha::Cache;
30
use Koha::Cache;
31
use Koha::BiblioFrameworks;
32
use Koha::AuthorisedValues;
31
33
32
# retrieve parameters
34
# retrieve parameters
33
my $input = new CGI;
35
my $input = new CGI;
Lines 103-115 if ($op eq 'add_form') { Link Here
103
		$data=$sth->fetchrow_hashref;
105
		$data=$sth->fetchrow_hashref;
104
	}
106
	}
105
107
106
    my @authorised_values = @{C4::Koha::GetAuthorisedValueCategories()};    # function returns array ref, dereferencing
107
    unshift @authorised_values, "";                                         # put empty value first
108
    my $authorised_value = {
109
        values  => \@authorised_values,
110
        default => $data->{'authorised_value'},
111
    };
112
113
	if ($searchfield) {
108
	if ($searchfield) {
114
        $template->param(searchfield => $searchfield);
109
        $template->param(searchfield => $searchfield);
115
		$template->param(action => "Modify tag");
110
		$template->param(action => "Modify tag");
Lines 123-129 if ($op eq 'add_form') { Link Here
123
			libopac => $data->{'libopac'},
118
			libopac => $data->{'libopac'},
124
            repeatable => $data->{'repeatable'},
119
            repeatable => $data->{'repeatable'},
125
            mandatory => $data->{'mandatory'},
120
            mandatory => $data->{'mandatory'},
126
			authorised_value => $authorised_value,
121
            authorised_value => $data->{authorised_value},
127
			frameworkcode => $frameworkcode,
122
			frameworkcode => $frameworkcode,
128
    );  # FIXME: move checkboxes to presentation layer
123
    );  # FIXME: move checkboxes to presentation layer
129
													# END $OP eq ADD_FORM
124
													# END $OP eq ADD_FORM
(-)a/admin/patron-attr-types.pl (-18 / +2 lines)
Lines 98-104 sub add_attribute_type_form { Link Here
98
        categories => GetBorrowercategoryList,
98
        categories => GetBorrowercategoryList,
99
        branches_loop => \@branches_loop,
99
        branches_loop => \@branches_loop,
100
    );
100
    );
101
    authorised_value_category_list($template);
102
    $template->param(classes_val_loop => GetAuthorisedValues( 'PA_CLASS'));
101
    $template->param(classes_val_loop => GetAuthorisedValues( 'PA_CLASS'));
103
}
102
}
104
103
Lines 129-136 sub error_add_attribute_type_form { Link Here
129
    $template->param(
128
    $template->param(
130
        attribute_type_form => 1,
129
        attribute_type_form => 1,
131
        confirm_op => 'add_attribute_type_confirmed',
130
        confirm_op => 'add_attribute_type_confirmed',
131
        authorised_value_category => $input->param('authorised_value_category'),
132
    );
132
    );
133
    authorised_value_category_list($template, $input->param('authorised_value_category'));
134
}
133
}
135
134
136
sub add_update_attribute_type {
135
sub add_update_attribute_type {
Lines 246-255 sub edit_attribute_type_form { Link Here
246
    if ($attr_type->display_checkout()) {
245
    if ($attr_type->display_checkout()) {
247
        $template->param(display_checkout_checked => 'checked="checked"');
246
        $template->param(display_checkout_checked => 'checked="checked"');
248
    }
247
    }
249
    authorised_value_category_list($template, $attr_type->authorised_value_category());
248
    $template->param( authorised_value_category => $attr_type->authorised_value_category() );
250
    $template->param(classes_val_loop => GetAuthorisedValues( 'PA_CLASS' ));
249
    $template->param(classes_val_loop => GetAuthorisedValues( 'PA_CLASS' ));
251
250
252
253
    my $branches = GetBranches;
251
    my $branches = GetBranches;
254
    my @branches_loop;
252
    my @branches_loop;
255
    my $selected_branches = $attr_type->branches;
253
    my $selected_branches = $attr_type->branches;
Lines 306-322 sub patron_attribute_type_list { Link Here
306
    $template->param(available_attribute_types => \@attributes_loop);
304
    $template->param(available_attribute_types => \@attributes_loop);
307
    $template->param(display_list => 1);
305
    $template->param(display_list => 1);
308
}
306
}
309
310
sub authorised_value_category_list {
311
    my $template = shift;
312
    my $selected = @_ ? shift : '';
313
314
    my $categories = GetAuthorisedValueCategories();
315
    my @list = ();
316
    foreach my $category (@$categories) {
317
        my $entry = { category => $category };
318
        $entry->{selected} = 1 if $category eq $selected;
319
        push @list, $entry;
320
    }
321
    $template->param(authorised_value_categories => \@list);
322
}
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/admin-items-search-field-form.inc (-7 / +1 lines)
Lines 50-62 Link Here
50
    <label for="authorised_values_category">Authorised values category: </label>
50
    <label for="authorised_values_category">Authorised values category: </label>
51
    <select id="authorised_values_category" name="authorised_values_category">
51
    <select id="authorised_values_category" name="authorised_values_category">
52
      <option value="">- None -</option>
52
      <option value="">- None -</option>
53
      [% FOREACH category IN authorised_values_categories %]
53
      [% PROCESS options_for_authorised_value_categories authorised_value_categories => AuthorisedValues.GetCategories( selected => field.authorised_values_category ) %]
54
        [% IF field && field.authorised_values_category == category %]
55
          <option value="[% category %]" selected="selected">[% category %]</option>
56
        [% ELSE %]
57
          <option value="[% category %]">[% category %]</option>
58
        [% END %]
59
      [% END %]
60
    </select>
54
    </select>
61
  </li>
55
  </li>
62
</ol>
56
</ol>
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/doc-head-close.inc (+1 lines)
Lines 43-48 Link Here
43
<script type="text/javascript" src="[% interface %]/[% theme %]/js/staff-global.js"></script>
43
<script type="text/javascript" src="[% interface %]/[% theme %]/js/staff-global.js"></script>
44
44
45
[% INCLUDE 'validator-strings.inc' %]
45
[% INCLUDE 'validator-strings.inc' %]
46
[% PROCESS 'html_helpers.inc' %]
46
[% IF ( IntranetUserJS ) %]
47
[% IF ( IntranetUserJS ) %]
47
    <script type="text/javascript">
48
    <script type="text/javascript">
48
    //<![CDATA[
49
    //<![CDATA[
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc (+9 lines)
Line 0 Link Here
1
[% BLOCK options_for_authorised_value_categories %]
2
    [% FOREACH avc IN authorised_value_categories %]
3
        [% IF avc.selected %]
4
            <option value="[% avc.category %]" selected="selected">[% avc.category %]</option>
5
        [% ELSE %]
6
            <option value="[% avc.category %]">[% avc.category %]</option>
7
        [% END %]
8
    [% END %]
9
[% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgets.tt (-22 / +3 lines)
Lines 1-3 Link Here
1
[% USE AuthorisedValues %]
1
[% USE Price %]
2
[% USE Price %]
2
[% INCLUDE 'doc-head-open.inc' %]
3
[% INCLUDE 'doc-head-open.inc' %]
3
<title>Koha &rsaquo; Administration &rsaquo; Funds[% IF op == 'add_form' %] &rsaquo; [% IF ( budget_id ) %]Modify fund[% IF ( budget_name ) %] '[% budget_name %]'[% END %][% ELSE %]Add fund [% END %][% END %]</title>
4
<title>Koha &rsaquo; Administration &rsaquo; Funds[% IF op == 'add_form' %] &rsaquo; [% IF ( budget_id ) %]Modify fund[% IF ( budget_name ) %] '[% budget_name %]'[% END %][% ELSE %]Add fund [% END %][% END %]</title>
Lines 574-607 var MSG_PARENT_BENEATH_BUDGET = "- " + _("New budget-parent is beneath budget") Link Here
574
    <label  style="white-space: nowrap;" for="authorised_value_category1">Statistic 1 done on: </label>
575
    <label  style="white-space: nowrap;" for="authorised_value_category1">Statistic 1 done on: </label>
575
        <select name="sort1_authcat" id="authorised_value_category1">
576
        <select name="sort1_authcat" id="authorised_value_category1">
576
            <option value=""></option>
577
            <option value=""></option>
577
            [% FOREACH authorised_value_categories IN authorised_value_categories1 %]
578
            [% PROCESS options_for_authorised_value_categories authorised_value_categories => AuthorisedValues.GetCategories( selected => sort1_authcat ) %]
578
                [% IF ( authorised_value_categories.selected ) %]
579
                    <option value="[% authorised_value_categories.category %]" selected="selected">
580
                        [% authorised_value_categories.category %]
581
                    </option>
582
                [% ELSE %]
583
                    <option value="[% authorised_value_categories.category %]">
584
                        [% authorised_value_categories.category %]
585
                    </option>
586
                [% END %]
587
            [% END %]
588
        </select>
579
        </select>
589
    </li>
580
    </li>
590
    <li>
581
    <li>
591
    <label  style="white-space: nowrap;" for="authorised_value_category2">Statistic 2 done on: </label>
582
    <label  style="white-space: nowrap;" for="authorised_value_category2">Statistic 2 done on: </label>
592
        <select name="sort2_authcat" id="authorised_value_category2">
583
        <select name="sort2_authcat" id="authorised_value_category2">
593
            <option value=""></option>
584
            <option value=""></option>
594
            [% FOREACH authorised_value_categories IN authorised_value_categories2 %]
585
            [% PROCESS options_for_authorised_value_categories authorised_value_categories => AuthorisedValues.GetCategories( selected => sort2_authcat ) %]
595
                [% IF ( authorised_value_categories.selected ) %]
596
                    <option value="[% authorised_value_categories.category %]" selected="selected">
597
                        [% authorised_value_categories.category %]
598
                    </option>
599
                [% ELSE %]
600
                    <option value="[% authorised_value_categories.category %]">
601
                        [% authorised_value_categories.category %]
602
                    </option>
603
                [% END %]
604
            [% END %]
605
        </select>
586
        </select>
606
    </li>
587
    </li>
607
    </ol>
588
    </ol>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/auth_tag_structure.tt (-7 / +3 lines)
Lines 1-3 Link Here
1
[% USE AuthorisedValues %]
1
[% INCLUDE 'doc-head-open.inc' %]
2
[% INCLUDE 'doc-head-open.inc' %]
2
<title>Koha &rsaquo; Administration &rsaquo; Authority MARC framework [% IF ( add_form ) %][% IF ( use_heading_flags_p ) %]
3
<title>Koha &rsaquo; Administration &rsaquo; Authority MARC framework [% IF ( add_form ) %][% IF ( use_heading_flags_p ) %]
3
    [% IF ( heading_modify_tag_p ) %]&rsaquo; [% IF ( authtypecode ) %][% authtypecode %] Framework[% ELSE %]Default framework[% END %] &rsaquo; Modify tag[% END %]
4
    [% IF ( heading_modify_tag_p ) %]&rsaquo; [% IF ( authtypecode ) %][% authtypecode %] Framework[% ELSE %]Default framework[% END %] &rsaquo; Modify tag[% END %]
Lines 114-126 Link Here
114
        </li>
115
        </li>
115
        <li><label for="authorised_value">Authorized value: </label>
116
        <li><label for="authorised_value">Authorized value: </label>
116
            <select name="authorised_value" id="authorised_value" size="1">
117
            <select name="authorised_value" id="authorised_value" size="1">
117
            [% FOREACH value IN authorised_value.values %]
118
                <option value=""></option>
118
                [% IF ( value == authorised_value.default ) %]
119
                [% PROCESS options_for_authorised_value_categories authorised_value_categories => AuthorisedValues.GetCategories( selected => authorised_value ) %]
119
                    <option value="[% value %]" selected="selected">[% value %]</option>
120
                [% ELSE %]
121
                    <option value="[% value %]">[% value %]</option>
122
                [% END %]
123
            [% END %]
124
            </select>
120
            </select>
125
            (if you select a value here, the indicators will be limited to the authorized value list)
121
            (if you select a value here, the indicators will be limited to the authorized value list)
126
        </li>
122
        </li>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/items_search_field.tt (+1 lines)
Lines 1-3 Link Here
1
[% USE AuthorisedValues %]
1
[% INCLUDE 'doc-head-open.inc' %]
2
[% INCLUDE 'doc-head-open.inc' %]
2
  <title>Koha &rsaquo; Administration &rsaquo; Item search fields</title>
3
  <title>Koha &rsaquo; Administration &rsaquo; Item search fields</title>
3
  [% INCLUDE 'doc-head-close.inc' %]
4
  [% INCLUDE 'doc-head-close.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/items_search_fields.tt (+1 lines)
Lines 1-3 Link Here
1
[% USE AuthorisedValues %]
1
[% INCLUDE 'doc-head-open.inc' %]
2
[% INCLUDE 'doc-head-open.inc' %]
2
  <title>Koha &rsaquo; Administration &rsaquo; Item search fields</title>
3
  <title>Koha &rsaquo; Administration &rsaquo; Item search fields</title>
3
  [% INCLUDE 'doc-head-close.inc' %]
4
  [% INCLUDE 'doc-head-close.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marctagstructure.tt (-7 / +3 lines)
Lines 1-3 Link Here
1
[% USE AuthorisedValues %]
1
[% INCLUDE 'doc-head-open.inc' %]
2
[% INCLUDE 'doc-head-open.inc' %]
2
<title>Koha &rsaquo; Administration &rsaquo;
3
<title>Koha &rsaquo; Administration &rsaquo;
3
[% IF ( add_form ) %]MARC frameworks &rsaquo; [% action %] [% searchfield %][% END %]
4
[% IF ( add_form ) %]MARC frameworks &rsaquo; [% action %] [% searchfield %][% END %]
Lines 95-107 $(document).ready(function() { Link Here
95
    </li>
96
    </li>
96
    <li><label for="authorised_value">Authorized value: </label>
97
    <li><label for="authorised_value">Authorized value: </label>
97
        <select name="authorised_value" id="authorised_value" size="1">
98
        <select name="authorised_value" id="authorised_value" size="1">
98
        [% FOREACH value IN authorised_value.values %]
99
            <option value=""></option>
99
        [% IF ( value == authorised_value.default ) %]
100
            [% PROCESS options_for_authorised_value_categories authorised_value_categories => AuthorisedValues.GetCategories( selected => authorised_value ) %]
100
            <option value="[% value %]" selected="selected">[% value %]</option>
101
        [% ELSE %]
102
            <option value="[% value %]">[% value %]</option>
103
        [% END %]
104
        [% END %]
105
        </select>
101
        </select>
106
        (if you select a value here, the indicators will be limited to the authorized value list)</li>
102
        (if you select a value here, the indicators will be limited to the authorized value list)</li>
107
</ol></fieldset> 
103
</ol></fieldset> 
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/patron-attr-types.tt (-11 / +2 lines)
Lines 1-3 Link Here
1
[% USE AuthorisedValues %]
1
[% INCLUDE 'doc-head-open.inc' %]
2
[% INCLUDE 'doc-head-open.inc' %]
2
<title>Koha &rsaquo; Administration &rsaquo; Patron attribute types
3
<title>Koha &rsaquo; Administration &rsaquo; Patron attribute types
3
[% IF ( attribute_type_form ) %]
4
[% IF ( attribute_type_form ) %]
Lines 142-158 $(document).ready(function() { Link Here
142
        <li><label for="authorised_value_category">Authorized value category: </label>
143
        <li><label for="authorised_value_category">Authorized value category: </label>
143
            <select name="authorised_value_category" id="authorised_value_category">
144
            <select name="authorised_value_category" id="authorised_value_category">
144
                <option value=""></option>
145
                <option value=""></option>
145
                [% FOREACH authorised_value_categorie IN authorised_value_categories %]
146
                [% PROCESS options_for_authorised_value_categories authorised_value_categories => AuthorisedValues.GetCategories( selected => authorised_value_category ) %]
146
                    [% IF ( authorised_value_categorie.selected ) %]
147
                        <option value="[% authorised_value_categorie.category %]" selected="selected">
148
                            [% authorised_value_categorie.category %]
149
                        </option>
150
                    [% ELSE %]
151
                        <option value="[% authorised_value_categorie.category %]">
152
                            [% authorised_value_categorie.category %]
153
                        </option>
154
                    [% END %]
155
                [% END %]
156
            </select>
147
            </select>
157
            <span>Authorized value category; if one is selected, the patron record input page will only allow values 
148
            <span>Authorized value category; if one is selected, the patron record input page will only allow values 
158
                  to be chosen from the authorized value list.  However, an authorized value list is not 
149
                  to be chosen from the authorized value list.  However, an authorized value list is not 
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/add_fields.tt (-7 / +2 lines)
Lines 1-3 Link Here
1
[% USE AuthorisedValues %]
1
[% INCLUDE 'doc-head-open.inc' %]
2
[% INCLUDE 'doc-head-open.inc' %]
2
<title>Koha &rsaquo; Serials &rsaquo; Manage new fields for subscriptions
3
<title>Koha &rsaquo; Serials &rsaquo; Manage new fields for subscriptions
3
  [% IF op == "list" %] &rsaquo; List of fields
4
  [% IF op == "list" %] &rsaquo; List of fields
Lines 136-148 Link Here
136
            <label for="av">Authorised value category: </label>
137
            <label for="av">Authorised value category: </label>
137
            <select name="authorised_value_category">
138
            <select name="authorised_value_category">
138
              <option value="">None</option>
139
              <option value="">None</option>
139
              [% FOR category IN categories %]
140
              [% PROCESS options_for_authorised_value_categories authorised_value_categories => AuthorisedValues.GetCategories( selected => field.authorised_value_category ) %]
140
                [% IF field.authorised_value_category == category %]
141
                  <option value="[% category %]" selected="selected">[% category %]</option>
142
                [% ELSE %]
143
                  <option value="[% category %]">[% category %]</option>
144
                [% END %]
145
              [% END %]
146
            </select>
141
            </select>
147
          </li>
142
          </li>
148
          <li>
143
          <li>
(-)a/serials/add_fields.pl (-3 lines)
Lines 101-107 if ( $op eq 'delete' ) { Link Here
101
}
101
}
102
102
103
if ( $op eq 'add_form' ) {
103
if ( $op eq 'add_form' ) {
104
    my $categories = C4::Koha::GetAuthorisedValueCategories();
105
    my $field;
104
    my $field;
106
    if ( $field_id ) {
105
    if ( $field_id ) {
107
        $field = Koha::AdditionalField->new( { id => $field_id } )->fetch;
106
        $field = Koha::AdditionalField->new( { id => $field_id } )->fetch;
Lines 109-115 if ( $op eq 'add_form' ) { Link Here
109
108
110
    $template->param(
109
    $template->param(
111
        field => $field,
110
        field => $field,
112
        categories => $categories,
113
    );
111
    );
114
}
112
}
115
113
116
- 

Return to bug 15803