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

(-)a/C4/Koha.pm (-21 lines)
Lines 56-62 BEGIN { Link Here
56
		&getitemtypeimagesrc
56
		&getitemtypeimagesrc
57
		&getitemtypeimagelocation
57
		&getitemtypeimagelocation
58
		&GetAuthorisedValues
58
		&GetAuthorisedValues
59
		&GetAuthorisedValueCategories
60
                &IsAuthorisedValueCategory
59
                &IsAuthorisedValueCategory
61
		&GetKohaAuthorisedValues
60
		&GetKohaAuthorisedValues
62
		&GetKohaAuthorisedValuesFromField
61
		&GetKohaAuthorisedValuesFromField
Lines 1100-1125 sub GetAuthorisedValues { Link Here
1100
    return \@results;
1099
    return \@results;
1101
}
1100
}
1102
1101
1103
=head2 GetAuthorisedValueCategories
1104
1105
  $auth_categories = GetAuthorisedValueCategories();
1106
1107
Return an arrayref of all of the available authorised
1108
value categories.
1109
1110
=cut
1111
1112
sub GetAuthorisedValueCategories {
1113
    my $dbh = C4::Context->dbh;
1114
    my $sth = $dbh->prepare("SELECT DISTINCT category FROM authorised_values ORDER BY category");
1115
    $sth->execute;
1116
    my @results;
1117
    while (defined (my $category  = $sth->fetchrow_array) ) {
1118
        push @results, $category;
1119
    }
1120
    return \@results;
1121
}
1122
1123
=head2 IsAuthorisedValueCategory
1102
=head2 IsAuthorisedValueCategory
1124
1103
1125
    $is_auth_val_category = IsAuthorisedValueCategory($category);
1104
    $is_auth_val_category = IsAuthorisedValueCategory($category);
(-)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 152-176 if ($op eq 'add_form') { Link Here
152
        $row{selected} = 1 if $budget and $thisbranch eq $budget->{'budget_branchcode'};
152
        $row{selected} = 1 if $budget and $thisbranch eq $budget->{'budget_branchcode'};
153
        push @branchloop_select, \%row;
153
        push @branchloop_select, \%row;
154
    }
154
    }
155
    
155
156
    # populates the YUI planning button
156
    # populates the planning button
157
    my $categories = GetAuthorisedValueCategories();
157
    $template->param(
158
    my @auth_cats_loop1 = ();
158
        sort1_auth => $budget->{sort1_authcat},
159
    foreach my $category (@$categories) {
159
        sort2_auth => $budget->{sort2_authcat},
160
        my $entry = { category => $category,
160
    );
161
                        selected => ( $budget and $budget->{sort1_authcat} eq $category ? 1 : 0 ),
162
                    };
163
        push @auth_cats_loop1, $entry;
164
    }
165
    my @auth_cats_loop2 = ();
166
    foreach my $category (@$categories) {
167
        my $entry = { category => $category,
168
                        selected => ( $budget and $budget->{sort2_authcat} eq $category ? 1 : 0 ),
169
                    };
170
        push @auth_cats_loop2, $entry;
171
    }
172
    $template->param(authorised_value_categories1 => \@auth_cats_loop1);
173
    $template->param(authorised_value_categories2 => \@auth_cats_loop2);
174
161
175
    if($budget->{'budget_permission'}){
162
    if($budget->{'budget_permission'}){
176
        my $budget_permission = "budget_perm_".$budget->{'budget_permission'};
163
        my $budget_permission = "budget_perm_".$budget->{'budget_permission'};
(-)a/admin/auth_subfields_structure.pl (-9 / +10 lines)
Lines 26-31 use C4::Context; Link Here
26
use C4::Koha;
26
use C4::Koha;
27
27
28
use Koha::Authority::Types;
28
use Koha::Authority::Types;
29
use Koha::AuthorisedValues;
29
30
30
use List::MoreUtils qw( uniq );
31
use List::MoreUtils qw( uniq );
31
32
Lines 95-105 if ($op eq 'add_form') { Link Here
95
		push @kohafields, "auth_header.".$field;
96
		push @kohafields, "auth_header.".$field;
96
	}
97
	}
97
	
98
	
98
        # build authorised value list
99
        # build authorised value category list
99
        my $authorised_values = C4::Koha::GetAuthorisedValueCategories;
100
        my @authorised_value_categories = Koha::AuthorisedValues->new->categories;
100
        unshift @$authorised_values, '';
101
        unshift @authorised_value_categories, '';
101
        push @$authorised_values, 'branches';
102
        push @authorised_value_categories, 'branches';
102
        push @$authorised_values, 'itemtypes';
103
        push @authorised_value_categories, 'itemtypes';
103
104
104
        # build thesaurus categories list
105
        # build thesaurus categories list
105
        my @authtypes = uniq( "", map { $_->authtypecode } Koha::Authority::Types->search );
106
        my @authtypes = uniq( "", map { $_->authtypecode } Koha::Authority::Types->search );
Lines 154-160 if ($op eq 'add_form') { Link Here
154
                    };
155
                    };
155
        $row_data{authorised_value} = {
156
        $row_data{authorised_value} = {
156
                    id      => "authorised_value$i",
157
                    id      => "authorised_value$i",
157
                    values  => $authorised_values,
158
                    values  => \@authorised_value_categories,
158
                    default => $data->{'authorised_value'},
159
                    default => $data->{'authorised_value'},
159
        };
160
        };
160
        $row_data{frameworkcode} = {
161
        $row_data{frameworkcode} = {
Lines 233-239 if ($op eq 'add_form') { Link Here
233
                    };
234
                    };
234
        $row_data{authorised_value} = {
235
        $row_data{authorised_value} = {
235
                    id      => "authorised_value",
236
                    id      => "authorised_value",
236
                    values  => $authorised_values,
237
                    values  => \@authorised_value_categories,
237
                    default => "",
238
                    default => "",
238
        };
239
        };
239
        $row_data{frameworkcode} = {
240
        $row_data{frameworkcode} = {
Lines 279-285 if ($op eq 'add_form') { Link Here
279
	my @ohidden		= $input->param('ohidden');
280
	my @ohidden		= $input->param('ohidden');
280
	#my @ihidden		= $input->param('ihidden');
281
	#my @ihidden		= $input->param('ihidden');
281
	#my @ehidden		= $input->param('ehidden');
282
	#my @ehidden		= $input->param('ehidden');
282
	my @authorised_values	= $input->param('authorised_value');
283
    my @authorised_value_categories = $input->param('authorised_value');
283
	my $authtypecode	= $input->param('authtypecode');
284
	my $authtypecode	= $input->param('authtypecode');
284
	my @frameworkcodes	= $input->param('frameworkcode');
285
	my @frameworkcodes	= $input->param('frameworkcode');
285
	my @value_builder	=$input->param('value_builder');
286
	my @value_builder	=$input->param('value_builder');
Lines 295-301 if ($op eq 'add_form') { Link Here
295
		my $kohafield		=$kohafield[$i];
296
		my $kohafield		=$kohafield[$i];
296
		my $tab				=$tab[$i];
297
		my $tab				=$tab[$i];
297
		my $seealso				=$seealso[$i];
298
		my $seealso				=$seealso[$i];
298
		my $authorised_value		=$authorised_values[$i];
299
        my $authorised_value = $authorised_value_categories[$i];
299
		my $frameworkcode		=$frameworkcodes[$i];
300
		my $frameworkcode		=$frameworkcodes[$i];
300
		my $value_builder=$value_builder[$i];
301
		my $value_builder=$value_builder[$i];
301
        my $defaultvalue = $defaultvalue[$i];
302
        my $defaultvalue = $defaultvalue[$i];
(-)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 29-34 use C4::Context; Link Here
29
29
30
use Koha::Cache;
30
use Koha::Cache;
31
use Koha::BiblioFrameworks;
31
use Koha::BiblioFrameworks;
32
use Koha::AuthorisedValues;
32
33
33
# retrieve parameters
34
# retrieve parameters
34
my $input = new CGI;
35
my $input = new CGI;
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 (-17 / +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
    pa_classes($template);
101
    pa_classes($template);
103
}
102
}
104
103
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 254-260 sub edit_attribute_type_form { Link Here
254
    if ($attr_type->display_checkout()) {
253
    if ($attr_type->display_checkout()) {
255
        $template->param(display_checkout_checked => 'checked="checked"');
254
        $template->param(display_checkout_checked => 'checked="checked"');
256
    }
255
    }
257
    authorised_value_category_list($template, $attr_type->authorised_value_category());
256
    $template->param( authorised_value_category => $attr_type->authorised_value_category() );
258
    pa_classes( $template, $attr_type->class );
257
    pa_classes( $template, $attr_type->class );
259
258
260
259
Lines 312-331 sub patron_attribute_type_list { Link Here
312
    $template->param(display_list => 1);
311
    $template->param(display_list => 1);
313
}
312
}
314
313
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
}
328
329
sub pa_classes {
314
sub pa_classes {
330
    my $template = shift;
315
    my $template = shift;
331
    my $selected = @_ ? shift : '';
316
    my $selected = @_ ? shift : '';
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/admin-items-search-field-form.inc (-7 / +1 lines)
Lines 46-58 Link Here
46
    <label for="authorised_values_category">Authorised values category</label>
46
    <label for="authorised_values_category">Authorised values category</label>
47
    <select name="authorised_values_category">
47
    <select name="authorised_values_category">
48
      <option value="">- None -</option>
48
      <option value="">- None -</option>
49
      [% FOREACH category IN authorised_values_categories %]
49
      [% PROCESS options_for_authorised_value_categories authorised_value_categories => AuthorisedValues.GetCategories( selected => field.authorised_values_category ) %]
50
        [% IF field && field.authorised_values_category == category %]
51
          <option value="[% category %]" selected="selected">[% category %]</option>
52
        [% ELSE %]
53
          <option value="[% category %]">[% category %]</option>
54
        [% END %]
55
      [% END %]
56
    </select>
50
    </select>
57
  </li>
51
  </li>
58
</ul>
52
</ul>
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/doc-head-close.inc (+1 lines)
Lines 28-33 Link Here
28
<script type="text/javascript" src="[% themelang %]/js/staff-global.js"></script>
28
<script type="text/javascript" src="[% themelang %]/js/staff-global.js"></script>
29
29
30
[% INCLUDE 'validator-strings.inc' %]
30
[% INCLUDE 'validator-strings.inc' %]
31
[% PROCESS 'html_helpers.inc' %]
31
[% IF ( IntranetUserJS ) %]
32
[% IF ( IntranetUserJS ) %]
32
    <script type="text/javascript">
33
    <script type="text/javascript">
33
    //<![CDATA[
34
    //<![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 573-606 var MSG_PARENT_BENEATH_BUDGET = "- " + _("New budget-parent is beneath budget") Link Here
573
    <label  style="white-space: nowrap;" for="authorised_value_category1">Statistic 1 done on: </label>
574
    <label  style="white-space: nowrap;" for="authorised_value_category1">Statistic 1 done on: </label>
574
        <select name="sort1_authcat" id="authorised_value_category1">
575
        <select name="sort1_authcat" id="authorised_value_category1">
575
            <option value=""></option>
576
            <option value=""></option>
576
            [% FOREACH authorised_value_categories IN authorised_value_categories1 %]
577
            [% PROCESS options_for_authorised_value_categories authorised_value_categories => AuthorisedValues.GetCategories( selected => sort1_authcat ) %]
577
                [% IF ( authorised_value_categories.selected ) %]
578
                    <option value="[% authorised_value_categories.category %]" selected="selected">
579
                        [% authorised_value_categories.category %]
580
                    </option>
581
                [% ELSE %]
582
                    <option value="[% authorised_value_categories.category %]">
583
                        [% authorised_value_categories.category %]
584
                    </option>
585
                [% END %]
586
            [% END %]
587
        </select>
578
        </select>
588
    </li>
579
    </li>
589
    <li>
580
    <li>
590
    <label  style="white-space: nowrap;" for="authorised_value_category2">Statistic 2 done on: </label>
581
    <label  style="white-space: nowrap;" for="authorised_value_category2">Statistic 2 done on: </label>
591
        <select name="sort2_authcat" id="authorised_value_category2">
582
        <select name="sort2_authcat" id="authorised_value_category2">
592
            <option value=""></option>
583
            <option value=""></option>
593
            [% FOREACH authorised_value_categories IN authorised_value_categories2 %]
584
            [% PROCESS options_for_authorised_value_categories authorised_value_categories => AuthorisedValues.GetCategories( selected => sort2_authcat ) %]
594
                [% IF ( authorised_value_categories.selected ) %]
595
                    <option value="[% authorised_value_categories.category %]" selected="selected">
596
                        [% authorised_value_categories.category %]
597
                    </option>
598
                [% ELSE %]
599
                    <option value="[% authorised_value_categories.category %]">
600
                        [% authorised_value_categories.category %]
601
                    </option>
602
                [% END %]
603
            [% END %]
604
        </select>
585
        </select>
605
    </li>
586
    </li>
606
    </ol>
587
    </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; Items search fields</title>
3
  <title>Koha &rsaquo; Administration &rsaquo; Items 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; Items search fields</title>
3
  <title>Koha &rsaquo; Administration &rsaquo; Items 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 (-9 / +5 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 63-69 $(document).ready(function() { Link Here
63
    <form action="[% script_name %]" name="Aform" method="post" class="validated">
64
    <form action="[% script_name %]" name="Aform" method="post" class="validated">
64
	
65
	
65
      <fieldset class="rows"><legend>[% IF ( use_heading_flags_p ) %][% IF ( heading_modify_tag_p ) %]Modify tag <input type="hidden" name="modif" value="1" />[% searchfield %][% END %][% IF ( heading_add_tag_p ) %]Add tag[% END %][% ELSE %][% action %][% END %]</legend>  <input type="hidden" name="op" value="add_validate" />
66
      <fieldset class="rows"><legend>[% IF ( use_heading_flags_p ) %][% IF ( heading_modify_tag_p ) %]Modify tag <input type="hidden" name="modif" value="1" />[% searchfield %][% END %][% IF ( heading_add_tag_p ) %]Add tag[% END %][% ELSE %][% action %][% END %]</legend>  <input type="hidden" name="op" value="add_validate" />
66
	<input type="hidden" name="frameworkcode" value="[% framework.frameworkcode %]" />
67
    <input type="hidden" name="frameworkcode" value="[% framework.frameworkcode %]" />
67
68
68
        <ol>
69
        <ol>
69
            <li>
70
            <li>
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> 
Lines 120-126 $(document).ready(function() { Link Here
120
    <p>Description: [% liblibrarian %]</p>
116
    <p>Description: [% liblibrarian %]</p>
121
    <form action="[% script_name %]" method="post">
117
    <form action="[% script_name %]" method="post">
122
	<input type="hidden" name="op" value="delete_confirmed" />
118
	<input type="hidden" name="op" value="delete_confirmed" />
123
	<input type="hidden" name="searchfield" value="[% searchfield %]" /><input type="hidden" name="frameworkcode" value="[% framework.frameworkcode %]" />
119
    <input type="hidden" name="searchfield" value="[% searchfield %]" /><input type="hidden" name="frameworkcode" value="[% framework.frameworkcode %]" />
124
    <input type="submit" class="approve" value="Yes, delete this tag" /></form>
120
    <input type="submit" class="approve" value="Yes, delete this tag" /></form>
125
	
121
	
126
    <form action="[% script_name %]" method="get"><input type="hidden" name="frameworkcode" value="[% framework.frameworkcode %]" /><input type="submit" value="No, do not delete" class="deny" /></form></div>
122
    <form action="[% script_name %]" method="get"><input type="hidden" name="frameworkcode" value="[% framework.frameworkcode %]" /><input type="submit" value="No, do not delete" class="deny" /></form></div>
(-)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 175-191 function CheckAttributeTypeForm(f) { Link Here
175
        <li><label for="authorised_value_category">Authorized value category: </label>
176
        <li><label for="authorised_value_category">Authorized value category: </label>
176
            <select name="authorised_value_category" id="authorised_value_category">
177
            <select name="authorised_value_category" id="authorised_value_category">
177
                <option value=""></option>
178
                <option value=""></option>
178
                [% FOREACH authorised_value_categorie IN authorised_value_categories %]
179
                [% PROCESS options_for_authorised_value_categories authorised_value_categories => AuthorisedValues.GetCategories( selected => authorised_value_category ) %]
179
                    [% IF ( authorised_value_categorie.selected ) %]
180
                        <option value="[% authorised_value_categorie.category %]" selected="selected">
181
                            [% authorised_value_categorie.category %]
182
                        </option>
183
                    [% ELSE %]
184
                        <option value="[% authorised_value_categorie.category %]">
185
                            [% authorised_value_categorie.category %]
186
                        </option>
187
                    [% END %]
188
                [% END %]
189
            </select>
180
            </select>
190
            <span>Authorized value category; if one is selected, the patron record input page will only allow values 
181
            <span>Authorized value category; if one is selected, the patron record input page will only allow values 
191
                  to be chosen from the authorized value list.  However, an authorized value list is not 
182
                  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 132-144 Link Here
132
            <label for="av">Authorised value category: </label>
133
            <label for="av">Authorised value category: </label>
133
            <select name="authorised_value_category">
134
            <select name="authorised_value_category">
134
              <option value="">None</option>
135
              <option value="">None</option>
135
              [% FOR category IN categories %]
136
              [% PROCESS options_for_authorised_value_categories authorised_value_categories => AuthorisedValues.GetCategories( selected => field.authorised_value_category ) %]
136
                [% IF field.authorised_value_category == category %]
137
                  <option value="[% category %]" selected="selected">[% category %]</option>
138
                [% ELSE %]
139
                  <option value="[% category %]">[% category %]</option>
140
                [% END %]
141
              [% END %]
142
            </select>
137
            </select>
143
          </li>
138
          </li>
144
          <li>
139
          <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