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

(-)a/C4/Koha.pm (-21 lines)
Lines 52-58 BEGIN { Link Here
52
		&getitemtypeimagesrc
52
		&getitemtypeimagesrc
53
		&getitemtypeimagelocation
53
		&getitemtypeimagelocation
54
		&GetAuthorisedValues
54
		&GetAuthorisedValues
55
		&GetAuthorisedValueCategories
56
		&GetNormalizedUPC
55
		&GetNormalizedUPC
57
		&GetNormalizedISBN
56
		&GetNormalizedISBN
58
		&GetNormalizedEAN
57
		&GetNormalizedEAN
Lines 824-849 sub GetAuthorisedValues { Link Here
824
    return \@results;
823
    return \@results;
825
}
824
}
826
825
827
=head2 GetAuthorisedValueCategories
828
829
  $auth_categories = GetAuthorisedValueCategories();
830
831
Return an arrayref of all of the available authorised
832
value categories.
833
834
=cut
835
836
sub GetAuthorisedValueCategories {
837
    my $dbh = C4::Context->dbh;
838
    my $sth = $dbh->prepare("SELECT DISTINCT category FROM authorised_values ORDER BY category");
839
    $sth->execute;
840
    my @results;
841
    while (defined (my $category  = $sth->fetchrow_array) ) {
842
        push @results, $category;
843
    }
844
    return \@results;
845
}
846
847
=head2 xml_escape
826
=head2 xml_escape
848
827
849
  my $escaped_string = C4::Koha::xml_escape($string);
828
  my $escaped_string = C4::Koha::xml_escape($string);
(-)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 43-48 sub GetAuthValueDropbox { Link Here
43
    return C4::Koha::GetAuthvalueDropbox($category, $default);
44
    return C4::Koha::GetAuthvalueDropbox($category, $default);
44
}
45
}
45
46
47
sub GetCategories {
48
    my ( $self, $params ) = @_;
49
    my $selected = $params->{selected};
50
    my @categories = Koha::AuthorisedValues->new->categories;
51
    return [
52
        map {
53
            {
54
                category => $_,
55
                ( ( $selected and $selected eq $_ ) ? ( selected => 1 ) : () ),
56
            }
57
        } @categories
58
    ];
59
}
60
46
1;
61
1;
47
62
48
=head1 NAME
63
=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 / +2 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::AuthorisedValues;
31
use Koha::BiblioFrameworks;
32
use Koha::BiblioFrameworks;
32
33
33
# retrieve parameters
34
# retrieve parameters
Lines 94-106 if ($op eq 'add_form') { Link Here
94
		$data=$sth->fetchrow_hashref;
95
		$data=$sth->fetchrow_hashref;
95
	}
96
	}
96
97
97
    my @authorised_values = @{C4::Koha::GetAuthorisedValueCategories()};    # function returns array ref, dereferencing
98
    unshift @authorised_values, "";                                         # put empty value first
99
    my $authorised_value = {
100
        values  => \@authorised_values,
101
        default => $data->{'authorised_value'},
102
    };
103
104
	if ($searchfield) {
98
	if ($searchfield) {
105
        $template->param(searchfield => $searchfield);
99
        $template->param(searchfield => $searchfield);
106
		$template->param(action => "Modify tag");
100
		$template->param(action => "Modify tag");
Lines 114-120 if ($op eq 'add_form') { Link Here
114
			libopac => $data->{'libopac'},
108
			libopac => $data->{'libopac'},
115
            repeatable => $data->{'repeatable'},
109
            repeatable => $data->{'repeatable'},
116
            mandatory => $data->{'mandatory'},
110
            mandatory => $data->{'mandatory'},
117
			authorised_value => $authorised_value,
111
            authorised_value => $data->{authorised_value},
118
			frameworkcode => $frameworkcode,
112
			frameworkcode => $frameworkcode,
119
    );  # FIXME: move checkboxes to presentation layer
113
    );  # FIXME: move checkboxes to presentation layer
120
													# END $OP eq ADD_FORM
114
													# END $OP eq ADD_FORM
(-)a/admin/patron-attr-types.pl (-18 / +2 lines)
Lines 101-107 sub add_attribute_type_form { Link Here
101
        categories => $patron_categories,
101
        categories => $patron_categories,
102
        branches_loop => \@branches_loop,
102
        branches_loop => \@branches_loop,
103
    );
103
    );
104
    authorised_value_category_list($template);
105
    $template->param(classes_val_loop => GetAuthorisedValues( 'PA_CLASS'));
104
    $template->param(classes_val_loop => GetAuthorisedValues( 'PA_CLASS'));
106
}
105
}
107
106
Lines 132-139 sub error_add_attribute_type_form { Link Here
132
    $template->param(
131
    $template->param(
133
        attribute_type_form => 1,
132
        attribute_type_form => 1,
134
        confirm_op => 'add_attribute_type_confirmed',
133
        confirm_op => 'add_attribute_type_confirmed',
134
        authorised_value_category => $input->param('authorised_value_category'),
135
    );
135
    );
136
    authorised_value_category_list($template, $input->param('authorised_value_category'));
137
}
136
}
138
137
139
sub add_update_attribute_type {
138
sub add_update_attribute_type {
Lines 249-258 sub edit_attribute_type_form { Link Here
249
    if ($attr_type->display_checkout()) {
248
    if ($attr_type->display_checkout()) {
250
        $template->param(display_checkout_checked => 'checked="checked"');
249
        $template->param(display_checkout_checked => 'checked="checked"');
251
    }
250
    }
252
    authorised_value_category_list($template, $attr_type->authorised_value_category());
251
    $template->param( authorised_value_category => $attr_type->authorised_value_category() );
253
    $template->param(classes_val_loop => GetAuthorisedValues( 'PA_CLASS' ));
252
    $template->param(classes_val_loop => GetAuthorisedValues( 'PA_CLASS' ));
254
253
255
256
    my $branches = Koha::Libraries->search( {}, { order_by => ['branchname'] } )->unblessed;
254
    my $branches = Koha::Libraries->search( {}, { order_by => ['branchname'] } )->unblessed;
257
    my @branches_loop;
255
    my @branches_loop;
258
    my $selected_branches = $attr_type->branches;
256
    my $selected_branches = $attr_type->branches;
Lines 311-327 sub patron_attribute_type_list { Link Here
311
    $template->param(available_attribute_types => \@attributes_loop);
309
    $template->param(available_attribute_types => \@attributes_loop);
312
    $template->param(display_list => 1);
310
    $template->param(display_list => 1);
313
}
311
}
314
315
sub authorised_value_category_list {
316
    my $template = shift;
317
    my $selected = @_ ? shift : '';
318
319
    my $categories = GetAuthorisedValueCategories();
320
    my @list = ();
321
    foreach my $category (@$categories) {
322
        my $entry = { category => $category };
323
        $entry->{selected} = 1 if $category eq $selected;
324
        push @list, $entry;
325
    }
326
    $template->param(authorised_value_categories => \@list);
327
}
(-)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