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

(-)a/C4/Koha.pm (-21 lines)
Lines 51-57 BEGIN { Link Here
51
		&getitemtypeimagesrc
51
		&getitemtypeimagesrc
52
		&getitemtypeimagelocation
52
		&getitemtypeimagelocation
53
		&GetAuthorisedValues
53
		&GetAuthorisedValues
54
		&GetAuthorisedValueCategories
55
		&GetKohaAuthorisedValues
54
		&GetKohaAuthorisedValues
56
		&GetKohaAuthorisedValuesFromField
55
		&GetKohaAuthorisedValuesFromField
57
    &GetKohaAuthorisedValuesMapping
56
    &GetKohaAuthorisedValuesMapping
Lines 987-1012 sub GetAuthorisedValues { Link Here
987
    return \@results;
986
    return \@results;
988
}
987
}
989
988
990
=head2 GetAuthorisedValueCategories
991
992
  $auth_categories = GetAuthorisedValueCategories();
993
994
Return an arrayref of all of the available authorised
995
value categories.
996
997
=cut
998
999
sub GetAuthorisedValueCategories {
1000
    my $dbh = C4::Context->dbh;
1001
    my $sth = $dbh->prepare("SELECT DISTINCT category FROM authorised_values ORDER BY category");
1002
    $sth->execute;
1003
    my @results;
1004
    while (defined (my $category  = $sth->fetchrow_array) ) {
1005
        push @results, $category;
1006
    }
1007
    return \@results;
1008
}
1009
1010
=head2 GetAuthorisedValueByCode
989
=head2 GetAuthorisedValueByCode
1011
990
1012
$authorised_value = GetAuthorisedValueByCode( $category, $authvalcode, $opac );
991
$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 (-18 / +5 lines)
Lines 140-163 if ($op eq 'add_form') { Link Here
140
    }
140
    }
141
    $budget_parent = GetBudget($budget_parent_id);
141
    $budget_parent = GetBudget($budget_parent_id);
142
142
143
    # populates the YUI planning button
143
    # populates the planning button
144
    my $categories = GetAuthorisedValueCategories();
144
    $template->param(
145
    my @auth_cats_loop1 = ();
145
        sort1_auth => $budget->{sort1_authcat},
146
    foreach my $category (@$categories) {
146
        sort2_auth => $budget->{sort2_authcat},
147
        my $entry = { category => $category,
147
    );
148
                        selected => ( $budget and $budget->{sort1_authcat} eq $category ? 1 : 0 ),
149
                    };
150
        push @auth_cats_loop1, $entry;
151
    }
152
    my @auth_cats_loop2 = ();
153
    foreach my $category (@$categories) {
154
        my $entry = { category => $category,
155
                        selected => ( $budget and $budget->{sort2_authcat} eq $category ? 1 : 0 ),
156
                    };
157
        push @auth_cats_loop2, $entry;
158
    }
159
    $template->param(authorised_value_categories1 => \@auth_cats_loop1);
160
    $template->param(authorised_value_categories2 => \@auth_cats_loop2);
161
148
162
    if($budget->{'budget_permission'}){
149
    if($budget->{'budget_permission'}){
163
        my $budget_permission = "budget_perm_".$budget->{'budget_permission'};
150
        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::Caches;
30
use Koha::Caches;
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 100-106 sub add_attribute_type_form { Link Here
100
        categories => $patron_categories,
100
        categories => $patron_categories,
101
        branches_loop => \@branches_loop,
101
        branches_loop => \@branches_loop,
102
    );
102
    );
103
    authorised_value_category_list($template);
104
    $template->param(classes_val_loop => GetAuthorisedValues( 'PA_CLASS'));
103
    $template->param(classes_val_loop => GetAuthorisedValues( 'PA_CLASS'));
105
}
104
}
106
105
Lines 131-138 sub error_add_attribute_type_form { Link Here
131
    $template->param(
130
    $template->param(
132
        attribute_type_form => 1,
131
        attribute_type_form => 1,
133
        confirm_op => 'add_attribute_type_confirmed',
132
        confirm_op => 'add_attribute_type_confirmed',
133
        authorised_value_category => $input->param('authorised_value_category'),
134
    );
134
    );
135
    authorised_value_category_list($template, $input->param('authorised_value_category'));
136
}
135
}
137
136
138
sub add_update_attribute_type {
137
sub add_update_attribute_type {
Lines 248-257 sub edit_attribute_type_form { Link Here
248
    if ($attr_type->display_checkout()) {
247
    if ($attr_type->display_checkout()) {
249
        $template->param(display_checkout_checked => 'checked="checked"');
248
        $template->param(display_checkout_checked => 'checked="checked"');
250
    }
249
    }
251
    authorised_value_category_list($template, $attr_type->authorised_value_category());
250
    $template->param( authorised_value_category => $attr_type->authorised_value_category() );
252
    $template->param(classes_val_loop => GetAuthorisedValues( 'PA_CLASS' ));
251
    $template->param(classes_val_loop => GetAuthorisedValues( 'PA_CLASS' ));
253
252
254
255
    my $branches = Koha::Libraries->search( {}, { order_by => ['branchname'] } )->unblessed;
253
    my $branches = Koha::Libraries->search( {}, { order_by => ['branchname'] } )->unblessed;
256
    my @branches_loop;
254
    my @branches_loop;
257
    my $selected_branches = $attr_type->branches;
255
    my $selected_branches = $attr_type->branches;
Lines 309-325 sub patron_attribute_type_list { Link Here
309
    $template->param(available_attribute_types => \@attributes_loop);
307
    $template->param(available_attribute_types => \@attributes_loop);
310
    $template->param(display_list => 1);
308
    $template->param(display_list => 1);
311
}
309
}
312
313
sub authorised_value_category_list {
314
    my $template = shift;
315
    my $selected = @_ ? shift : '';
316
317
    my $categories = GetAuthorisedValueCategories();
318
    my @list = ();
319
    foreach my $category (@$categories) {
320
        my $entry = { category => $category };
321
        $entry->{selected} = 1 if $category eq $selected;
322
        push @list, $entry;
323
    }
324
    $template->param(authorised_value_categories => \@list);
325
}
(-)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/html_helpers.inc (+10 lines)
Lines 7-9 Link Here
7
        [% END%]
7
        [% END%]
8
    [% END %]
8
    [% END %]
9
[% END %]
9
[% END %]
10
11
[% BLOCK options_for_authorised_value_categories %]
12
    [% FOREACH avc IN authorised_value_categories %]
13
        [% IF avc.selected %]
14
            <option value="[% avc.category %]" selected="selected">[% avc.category %]</option>
15
        [% ELSE %]
16
            <option value="[% avc.category %]">[% avc.category %]</option>
17
        [% END %]
18
    [% END %]
19
[% 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 Branches %]
2
[% USE Branches %]
2
[% USE Price %]
3
[% USE Price %]
3
[% INCLUDE 'doc-head-open.inc' %]
4
[% INCLUDE 'doc-head-open.inc' %]
Lines 594-627 var MSG_PARENT_BENEATH_BUDGET = "- " + _("New budget-parent is beneath budget") Link Here
594
    <label  style="white-space: nowrap;" for="authorised_value_category1">Statistic 1 done on: </label>
595
    <label  style="white-space: nowrap;" for="authorised_value_category1">Statistic 1 done on: </label>
595
        <select name="sort1_authcat" id="authorised_value_category1">
596
        <select name="sort1_authcat" id="authorised_value_category1">
596
            <option value=""></option>
597
            <option value=""></option>
597
            [% FOREACH authorised_value_categories IN authorised_value_categories1 %]
598
            [% PROCESS options_for_authorised_value_categories authorised_value_categories => AuthorisedValues.GetCategories( selected => sort1_authcat ) %]
598
                [% IF ( authorised_value_categories.selected ) %]
599
                    <option value="[% authorised_value_categories.category %]" selected="selected">
600
                        [% authorised_value_categories.category %]
601
                    </option>
602
                [% ELSE %]
603
                    <option value="[% authorised_value_categories.category %]">
604
                        [% authorised_value_categories.category %]
605
                    </option>
606
                [% END %]
607
            [% END %]
608
        </select>
599
        </select>
609
    </li>
600
    </li>
610
    <li>
601
    <li>
611
    <label  style="white-space: nowrap;" for="authorised_value_category2">Statistic 2 done on: </label>
602
    <label  style="white-space: nowrap;" for="authorised_value_category2">Statistic 2 done on: </label>
612
        <select name="sort2_authcat" id="authorised_value_category2">
603
        <select name="sort2_authcat" id="authorised_value_category2">
613
            <option value=""></option>
604
            <option value=""></option>
614
            [% FOREACH authorised_value_categories IN authorised_value_categories2 %]
605
            [% PROCESS options_for_authorised_value_categories authorised_value_categories => AuthorisedValues.GetCategories( selected => sort2_authcat ) %]
615
                [% IF ( authorised_value_categories.selected ) %]
616
                    <option value="[% authorised_value_categories.category %]" selected="selected">
617
                        [% authorised_value_categories.category %]
618
                    </option>
619
                [% ELSE %]
620
                    <option value="[% authorised_value_categories.category %]">
621
                        [% authorised_value_categories.category %]
622
                    </option>
623
                [% END %]
624
            [% END %]
625
        </select>
606
        </select>
626
    </li>
607
    </li>
627
    </ol>
608
    </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 100-112 $(document).ready(function() { Link Here
100
    </li>
101
    </li>
101
    <li><label for="authorised_value">Authorized value: </label>
102
    <li><label for="authorised_value">Authorized value: </label>
102
        <select name="authorised_value" id="authorised_value" size="1">
103
        <select name="authorised_value" id="authorised_value" size="1">
103
        [% FOREACH value IN authorised_value.values %]
104
            <option value=""></option>
104
        [% IF ( value == authorised_value.default ) %]
105
            [% PROCESS options_for_authorised_value_categories authorised_value_categories => AuthorisedValues.GetCategories( selected => authorised_value ) %]
105
            <option value="[% value %]" selected="selected">[% value %]</option>
106
        [% ELSE %]
107
            <option value="[% value %]">[% value %]</option>
108
        [% END %]
109
        [% END %]
110
        </select>
106
        </select>
111
        (if you select a value here, the indicators will be limited to the authorized value list)</li>
107
        (if you select a value here, the indicators will be limited to the authorized value list)</li>
112
</ol></fieldset> 
108
</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