Bugzilla – Attachment 52063 Details for
Bug 15803
Koha::AuthorisedValues - Remove GetAuthorisedValueCategories
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15803: Koha::AuthorisedValues - Remove C4::Koha::GetAuthorisedValueCategories
Bug-15803-KohaAuthorisedValues---Remove-C4KohaGetA.patch (text/plain), 27.30 KB, created by
Jonathan Druart
on 2016-06-05 17:05:57 UTC
(
hide
)
Description:
Bug 15803: Koha::AuthorisedValues - Remove C4::Koha::GetAuthorisedValueCategories
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2016-06-05 17:05:57 UTC
Size:
27.30 KB
patch
obsolete
>From 2b78d9ebd62555cc044e2b9606b8b419312e23d2 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 11 Feb 2016 11:26:35 +0000 >Subject: [PATCH] Bug 15803: Koha::AuthorisedValues - Remove > C4::Koha::GetAuthorisedValueCategories > >The subroutine C4::Koha::GetAuthorisedValueCategories just retrieves all >the authorised value categories. >We already have a method in the Koha::AuthorisedValues module to do this >job, let's use it! > >Technical explanations: >The new subroutine of the AuthorisedValues TT plugin will allow to get >the authorised value categories from the templates. >The new html_helpers include file will get rid of the if selected else >end statements. Bug 15758 already uses this file, see the commit >description for more informations. > >Test plan: >1/ Create or edit a new fund (aqbudgets.pl), the fields "statistic 1" >and "statistic 2" should be correctly filled with the list of authorised >value categories >2/ Edit subfields for a biblio and authority framework. >The "Authorized value" dropdown list should be correctly filled on both >pages >3/ Create new items search fields (from the administration area), same >as previously, the authorised value category dropdown list should be >correctly filled >4/ Add and edit patron attribute types, check the authorised value >category list. >--- > C4/Koha.pm | 21 ------------------ > Koha/Template/Plugin/AuthorisedValues.pm | 15 +++++++++++++ > admin/aqbudgets.pl | 25 ++++++---------------- > admin/auth_subfields_structure.pl | 19 ++++++++-------- > admin/auth_tag_structure.pl | 9 +------- > admin/items_search_field.pl | 3 --- > admin/items_search_fields.pl | 3 --- > admin/marctagstructure.pl | 10 ++------- > admin/patron-attr-types.pl | 20 ++--------------- > .../en/includes/admin-items-search-field-form.inc | 8 +------ > .../prog/en/includes/doc-head-close.inc | 1 + > .../prog/en/includes/html_helpers.inc | 9 ++++++++ > .../prog/en/modules/admin/aqbudgets.tt | 25 +++------------------- > .../prog/en/modules/admin/auth_tag_structure.tt | 10 +++------ > .../prog/en/modules/admin/items_search_field.tt | 1 + > .../prog/en/modules/admin/items_search_fields.tt | 1 + > .../prog/en/modules/admin/marctagstructure.tt | 10 +++------ > .../prog/en/modules/admin/patron-attr-types.tt | 13 ++--------- > .../prog/en/modules/serials/add_fields.tt | 9 ++------ > serials/add_fields.pl | 2 -- > 20 files changed, 62 insertions(+), 152 deletions(-) > create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc > >diff --git a/C4/Koha.pm b/C4/Koha.pm >index c8291bf..dae1641 100644 >--- a/C4/Koha.pm >+++ b/C4/Koha.pm >@@ -51,7 +51,6 @@ BEGIN { > &getitemtypeimagesrc > &getitemtypeimagelocation > &GetAuthorisedValues >- &GetAuthorisedValueCategories > &GetKohaAuthorisedValues > &GetKohaAuthorisedValuesFromField > &GetKohaAuthorisedValuesMapping >@@ -940,26 +939,6 @@ sub GetAuthorisedValues { > return \@results; > } > >-=head2 GetAuthorisedValueCategories >- >- $auth_categories = GetAuthorisedValueCategories(); >- >-Return an arrayref of all of the available authorised >-value categories. >- >-=cut >- >-sub GetAuthorisedValueCategories { >- my $dbh = C4::Context->dbh; >- my $sth = $dbh->prepare("SELECT DISTINCT category FROM authorised_values ORDER BY category"); >- $sth->execute; >- my @results; >- while (defined (my $category = $sth->fetchrow_array) ) { >- push @results, $category; >- } >- return \@results; >-} >- > =head2 GetAuthorisedValueByCode > > $authorised_value = GetAuthorisedValueByCode( $category, $authvalcode, $opac ); >diff --git a/Koha/Template/Plugin/AuthorisedValues.pm b/Koha/Template/Plugin/AuthorisedValues.pm >index 62565e0..34a9bbb 100644 >--- a/Koha/Template/Plugin/AuthorisedValues.pm >+++ b/Koha/Template/Plugin/AuthorisedValues.pm >@@ -22,6 +22,7 @@ use Template::Plugin; > use base qw( Template::Plugin ); > > use C4::Koha; >+use Koha::AuthorisedValues; > > sub GetByCode { > my ( $self, $category, $code, $opac ) = @_; >@@ -38,6 +39,20 @@ sub GetAuthValueDropbox { > return C4::Koha::GetAuthvalueDropbox($category, $default); > } > >+sub GetCategories { >+ my ( $self, $params ) = @_; >+ my $selected = $params->{selected}; >+ my @categories = Koha::AuthorisedValues->new->categories; >+ return [ >+ map { >+ { >+ category => $_, >+ ( ( $selected and $selected eq $_ ) ? ( selected => 1 ) : () ), >+ } >+ } @categories >+ ]; >+} >+ > 1; > > =head1 NAME >diff --git a/admin/aqbudgets.pl b/admin/aqbudgets.pl >index 0e6b744..84a7d4b 100755 >--- a/admin/aqbudgets.pl >+++ b/admin/aqbudgets.pl >@@ -153,25 +153,12 @@ if ($op eq 'add_form') { > $row{selected} = 1 if $budget and $thisbranch eq $budget->{'budget_branchcode'}; > push @branchloop_select, \%row; > } >- >- # populates the YUI planning button >- my $categories = GetAuthorisedValueCategories(); >- my @auth_cats_loop1 = (); >- foreach my $category (@$categories) { >- my $entry = { category => $category, >- selected => ( $budget and $budget->{sort1_authcat} eq $category ? 1 : 0 ), >- }; >- push @auth_cats_loop1, $entry; >- } >- my @auth_cats_loop2 = (); >- foreach my $category (@$categories) { >- my $entry = { category => $category, >- selected => ( $budget and $budget->{sort2_authcat} eq $category ? 1 : 0 ), >- }; >- push @auth_cats_loop2, $entry; >- } >- $template->param(authorised_value_categories1 => \@auth_cats_loop1); >- $template->param(authorised_value_categories2 => \@auth_cats_loop2); >+ >+ # populates the planning button >+ $template->param( >+ sort1_auth => $budget->{sort1_authcat}, >+ sort2_auth => $budget->{sort2_authcat}, >+ ); > > if($budget->{'budget_permission'}){ > my $budget_permission = "budget_perm_".$budget->{'budget_permission'}; >diff --git a/admin/auth_subfields_structure.pl b/admin/auth_subfields_structure.pl >index ffa74f2..0ba7677 100755 >--- a/admin/auth_subfields_structure.pl >+++ b/admin/auth_subfields_structure.pl >@@ -25,6 +25,7 @@ use C4::Context; > use C4::Koha; > > use Koha::Authority::Types; >+use Koha::AuthorisedValues; > > use List::MoreUtils qw( uniq ); > >@@ -92,11 +93,11 @@ if ($op eq 'add_form') { > push @kohafields, "auth_header.".$field; > } > >- # build authorised value list >- my $authorised_values = C4::Koha::GetAuthorisedValueCategories; >- unshift @$authorised_values, ''; >- push @$authorised_values, 'branches'; >- push @$authorised_values, 'itemtypes'; >+ # build authorised value category list >+ my @authorised_value_categories = Koha::AuthorisedValues->new->categories; >+ unshift @authorised_value_categories, ''; >+ push @authorised_value_categories, 'branches'; >+ push @authorised_value_categories, 'itemtypes'; > > # build thesaurus categories list > my @authtypes = uniq( "", map { $_->authtypecode } Koha::Authority::Types->search ); >@@ -138,7 +139,7 @@ if ($op eq 'add_form') { > $row_data{seealso} = $data->{'seealso'}; > $row_data{kohafields} = \@kohafields; > $row_data{kohafield} = $data->{'kohafield'}; >- $row_data{authorised_values} = $authorised_values; >+ $row_data{authorised_values} = \@authorised_value_categories; > $row_data{authorised_value} = $data->{'authorised_value'}; > $row_data{frameworkcodes} = \@authtypes; > $row_data{frameworkcode} = $data->{'frameworkcode'}; >@@ -167,7 +168,7 @@ if ($op eq 'add_form') { > $row_data{mandatory} = 0; > $row_data{isurl} = 0; > $row_data{kohafields} = \@kohafields, >- $row_data{authorised_values} = $authorised_values; >+ $row_data{authorised_values} = \@authorised_value_categories; > $row_data{frameworkcodes} = \@authtypes; > $row_data{value_builders} = \@value_builder; > $row_data{row} = $i; >@@ -199,7 +200,7 @@ if ($op eq 'add_form') { > my @tab = $input->multi_param('tab'); > my @seealso = $input->multi_param('seealso'); > my @ohidden = $input->multi_param('ohidden'); >- my @authorised_values = $input->multi_param('authorised_value'); >+ my @authorised_value_categories = $input->multi_param('authorised_value'); > my $authtypecode = $input->param('authtypecode'); > my @frameworkcodes = $input->multi_param('frameworkcode'); > my @value_builder =$input->multi_param('value_builder'); >@@ -215,7 +216,7 @@ if ($op eq 'add_form') { > my $kohafield =$kohafield[$i]; > my $tab =$tab[$i]; > my $seealso =$seealso[$i]; >- my $authorised_value =$authorised_values[$i]; >+ my $authorised_value = $authorised_value_categories[$i]; > my $frameworkcode =$frameworkcodes[$i]; > my $value_builder=$value_builder[$i]; > my $defaultvalue = $defaultvalue[$i]; >diff --git a/admin/auth_tag_structure.pl b/admin/auth_tag_structure.pl >index 710ff91..fbe69de 100755 >--- a/admin/auth_tag_structure.pl >+++ b/admin/auth_tag_structure.pl >@@ -92,13 +92,6 @@ if ($op eq 'add_form') { > $data=$sth->fetchrow_hashref; > } > >- my @authorised_values = @{C4::Koha::GetAuthorisedValueCategories()}; # function returns array ref, dereferencing >- unshift @authorised_values, ""; # put empty value first >- my $authorised_value = { >- values => \@authorised_values, >- default => $data->{'authorised_value'}, >- }; >- > if ($searchfield) { > $template->param('searchfield' => $searchfield); > $template->param('heading_modify_tag_p' => 1); >@@ -110,7 +103,7 @@ if ($op eq 'add_form') { > libopac => $data->{'libopac'}, > repeatable => "".$data->{'repeatable'}, > mandatory => "".$data->{'mandatory'}, >- authorised_value => $authorised_value, >+ authorised_value => $data->{authorised_value}, > authtypecode => $authtypecode, > ); > # END $OP eq ADD_FORM >diff --git a/admin/items_search_field.pl b/admin/items_search_field.pl >index a544959..c1f6c0c 100755 >--- a/admin/items_search_field.pl >+++ b/admin/items_search_field.pl >@@ -21,7 +21,6 @@ use CGI; > > use C4::Auth; > use C4::Output; >-use C4::Koha; > > use Koha::Item::Search::Field qw(GetItemSearchField ModItemSearchField); > >@@ -53,11 +52,9 @@ if ($op eq 'mod') { > } > > my $field = GetItemSearchField($name); >-my $authorised_values_categories = C4::Koha::GetAuthorisedValueCategories(); > > $template->param( > field => $field, >- authorised_values_categories => $authorised_values_categories, > ); > > output_html_with_http_headers $cgi, $cookie, $template->output; >diff --git a/admin/items_search_fields.pl b/admin/items_search_fields.pl >index 1ebf243..f93f0bb 100755 >--- a/admin/items_search_fields.pl >+++ b/admin/items_search_fields.pl >@@ -21,7 +21,6 @@ use CGI; > > use C4::Auth; > use C4::Output; >-use C4::Koha; > > use Koha::Item::Search::Field qw(AddItemSearchField GetItemSearchFields DelItemSearchField); > >@@ -71,11 +70,9 @@ if ($op eq 'add') { > } > > my @fields = GetItemSearchFields(); >-my $authorised_values_categories = C4::Koha::GetAuthorisedValueCategories(); > > $template->param( > fields => \@fields, >- authorised_values_categories => $authorised_values_categories, > ); > > output_html_with_http_headers $cgi, $cookie, $template->output; >diff --git a/admin/marctagstructure.pl b/admin/marctagstructure.pl >index 8fa0739..1ffe839 100755 >--- a/admin/marctagstructure.pl >+++ b/admin/marctagstructure.pl >@@ -29,6 +29,7 @@ use C4::Context; > > use Koha::Cache; > use Koha::BiblioFrameworks; >+use Koha::AuthorisedValues; > > # retrieve parameters > my $input = new CGI; >@@ -94,13 +95,6 @@ if ($op eq 'add_form') { > $data=$sth->fetchrow_hashref; > } > >- my @authorised_values = @{C4::Koha::GetAuthorisedValueCategories()}; # function returns array ref, dereferencing >- unshift @authorised_values, ""; # put empty value first >- my $authorised_value = { >- values => \@authorised_values, >- default => $data->{'authorised_value'}, >- }; >- > if ($searchfield) { > $template->param(searchfield => $searchfield); > $template->param(action => "Modify tag"); >@@ -114,7 +108,7 @@ if ($op eq 'add_form') { > libopac => $data->{'libopac'}, > repeatable => $data->{'repeatable'}, > mandatory => $data->{'mandatory'}, >- authorised_value => $authorised_value, >+ authorised_value => $data->{authorised_value}, > frameworkcode => $frameworkcode, > ); # FIXME: move checkboxes to presentation layer > # END $OP eq ADD_FORM >diff --git a/admin/patron-attr-types.pl b/admin/patron-attr-types.pl >index ceb1184..2b8e969 100755 >--- a/admin/patron-attr-types.pl >+++ b/admin/patron-attr-types.pl >@@ -98,7 +98,6 @@ sub add_attribute_type_form { > categories => GetBorrowercategoryList, > branches_loop => \@branches_loop, > ); >- authorised_value_category_list($template); > $template->param(classes_val_loop => GetAuthorisedValues( 'PA_CLASS')); > } > >@@ -129,8 +128,8 @@ sub error_add_attribute_type_form { > $template->param( > attribute_type_form => 1, > confirm_op => 'add_attribute_type_confirmed', >+ authorised_value_category => $input->param('authorised_value_category'), > ); >- authorised_value_category_list($template, $input->param('authorised_value_category')); > } > > sub add_update_attribute_type { >@@ -246,10 +245,9 @@ sub edit_attribute_type_form { > if ($attr_type->display_checkout()) { > $template->param(display_checkout_checked => 'checked="checked"'); > } >- authorised_value_category_list($template, $attr_type->authorised_value_category()); >+ $template->param( authorised_value_category => $attr_type->authorised_value_category() ); > $template->param(classes_val_loop => GetAuthorisedValues( 'PA_CLASS' )); > >- > my $branches = GetBranches; > my @branches_loop; > my $selected_branches = $attr_type->branches; >@@ -306,17 +304,3 @@ sub patron_attribute_type_list { > $template->param(available_attribute_types => \@attributes_loop); > $template->param(display_list => 1); > } >- >-sub authorised_value_category_list { >- my $template = shift; >- my $selected = @_ ? shift : ''; >- >- my $categories = GetAuthorisedValueCategories(); >- my @list = (); >- foreach my $category (@$categories) { >- my $entry = { category => $category }; >- $entry->{selected} = 1 if $category eq $selected; >- push @list, $entry; >- } >- $template->param(authorised_value_categories => \@list); >-} >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/admin-items-search-field-form.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/admin-items-search-field-form.inc >index a886a8b..fd39a47 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/admin-items-search-field-form.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/admin-items-search-field-form.inc >@@ -50,13 +50,7 @@ > <label for="authorised_values_category">Authorised values category: </label> > <select id="authorised_values_category" name="authorised_values_category"> > <option value="">- None -</option> >- [% FOREACH category IN authorised_values_categories %] >- [% IF field && field.authorised_values_category == category %] >- <option value="[% category %]" selected="selected">[% category %]</option> >- [% ELSE %] >- <option value="[% category %]">[% category %]</option> >- [% END %] >- [% END %] >+ [% PROCESS options_for_authorised_value_categories authorised_value_categories => AuthorisedValues.GetCategories( selected => field.authorised_values_category ) %] > </select> > </li> > </ol> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/doc-head-close.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/doc-head-close.inc >index 43236f9..ab15b02 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/doc-head-close.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/doc-head-close.inc >@@ -43,6 +43,7 @@ > <script type="text/javascript" src="[% interface %]/[% theme %]/js/staff-global.js"></script> > > [% INCLUDE 'validator-strings.inc' %] >+[% PROCESS 'html_helpers.inc' %] > [% IF ( IntranetUserJS ) %] > <script type="text/javascript"> > //<![CDATA[ >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc >new file mode 100644 >index 0000000..1ee5b5f >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc >@@ -0,0 +1,9 @@ >+[% BLOCK options_for_authorised_value_categories %] >+ [% FOREACH avc IN authorised_value_categories %] >+ [% IF avc.selected %] >+ <option value="[% avc.category %]" selected="selected">[% avc.category %]</option> >+ [% ELSE %] >+ <option value="[% avc.category %]">[% avc.category %]</option> >+ [% END %] >+ [% END %] >+[% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgets.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgets.tt >index 2719a43..cc99733 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgets.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgets.tt >@@ -1,3 +1,4 @@ >+[% USE AuthorisedValues %] > [% USE Price %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Administration › Funds[% IF op == 'add_form' %] › [% IF ( budget_id ) %]Modify fund[% IF ( budget_name ) %] '[% budget_name %]'[% END %][% ELSE %]Add fund [% END %][% END %]</title> >@@ -574,34 +575,14 @@ var MSG_PARENT_BENEATH_BUDGET = "- " + _("New budget-parent is beneath budget") > <label style="white-space: nowrap;" for="authorised_value_category1">Statistic 1 done on: </label> > <select name="sort1_authcat" id="authorised_value_category1"> > <option value=""></option> >- [% FOREACH authorised_value_categories IN authorised_value_categories1 %] >- [% IF ( authorised_value_categories.selected ) %] >- <option value="[% authorised_value_categories.category %]" selected="selected"> >- [% authorised_value_categories.category %] >- </option> >- [% ELSE %] >- <option value="[% authorised_value_categories.category %]"> >- [% authorised_value_categories.category %] >- </option> >- [% END %] >- [% END %] >+ [% PROCESS options_for_authorised_value_categories authorised_value_categories => AuthorisedValues.GetCategories( selected => sort1_authcat ) %] > </select> > </li> > <li> > <label style="white-space: nowrap;" for="authorised_value_category2">Statistic 2 done on: </label> > <select name="sort2_authcat" id="authorised_value_category2"> > <option value=""></option> >- [% FOREACH authorised_value_categories IN authorised_value_categories2 %] >- [% IF ( authorised_value_categories.selected ) %] >- <option value="[% authorised_value_categories.category %]" selected="selected"> >- [% authorised_value_categories.category %] >- </option> >- [% ELSE %] >- <option value="[% authorised_value_categories.category %]"> >- [% authorised_value_categories.category %] >- </option> >- [% END %] >- [% END %] >+ [% PROCESS options_for_authorised_value_categories authorised_value_categories => AuthorisedValues.GetCategories( selected => sort2_authcat ) %] > </select> > </li> > </ol> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/auth_tag_structure.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/auth_tag_structure.tt >index a6b76c8..9e01b5b 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/auth_tag_structure.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/auth_tag_structure.tt >@@ -1,3 +1,4 @@ >+[% USE AuthorisedValues %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Administration › Authority MARC framework [% IF ( add_form ) %][% IF ( use_heading_flags_p ) %] > [% IF ( heading_modify_tag_p ) %]› [% IF ( authtypecode ) %][% authtypecode %] Framework[% ELSE %]Default framework[% END %] › Modify tag[% END %] >@@ -114,13 +115,8 @@ > </li> > <li><label for="authorised_value">Authorized value: </label> > <select name="authorised_value" id="authorised_value" size="1"> >- [% FOREACH value IN authorised_value.values %] >- [% IF ( value == authorised_value.default ) %] >- <option value="[% value %]" selected="selected">[% value %]</option> >- [% ELSE %] >- <option value="[% value %]">[% value %]</option> >- [% END %] >- [% END %] >+ <option value=""></option> >+ [% PROCESS options_for_authorised_value_categories authorised_value_categories => AuthorisedValues.GetCategories( selected => authorised_value ) %] > </select> > (if you select a value here, the indicators will be limited to the authorized value list) > </li> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/items_search_field.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/items_search_field.tt >index ed1f9c5..5a69d71 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/items_search_field.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/items_search_field.tt >@@ -1,3 +1,4 @@ >+[% USE AuthorisedValues %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Administration › Item search fields</title> > [% INCLUDE 'doc-head-close.inc' %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/items_search_fields.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/items_search_fields.tt >index caaf1ae..a67f081 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/items_search_fields.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/items_search_fields.tt >@@ -1,3 +1,4 @@ >+[% USE AuthorisedValues %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Administration › Item search fields</title> > [% INCLUDE 'doc-head-close.inc' %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marctagstructure.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marctagstructure.tt >index e720372..df2334d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marctagstructure.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marctagstructure.tt >@@ -1,3 +1,4 @@ >+[% USE AuthorisedValues %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Administration › > [% IF ( add_form ) %]MARC frameworks › [% action %] [% searchfield %][% END %] >@@ -95,13 +96,8 @@ $(document).ready(function() { > </li> > <li><label for="authorised_value">Authorized value: </label> > <select name="authorised_value" id="authorised_value" size="1"> >- [% FOREACH value IN authorised_value.values %] >- [% IF ( value == authorised_value.default ) %] >- <option value="[% value %]" selected="selected">[% value %]</option> >- [% ELSE %] >- <option value="[% value %]">[% value %]</option> >- [% END %] >- [% END %] >+ <option value=""></option> >+ [% PROCESS options_for_authorised_value_categories authorised_value_categories => AuthorisedValues.GetCategories( selected => authorised_value ) %] > </select> > (if you select a value here, the indicators will be limited to the authorized value list)</li> > </ol></fieldset> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/patron-attr-types.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/patron-attr-types.tt >index 384fc57..7f86c30 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/patron-attr-types.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/patron-attr-types.tt >@@ -1,3 +1,4 @@ >+[% USE AuthorisedValues %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Administration › Patron attribute types > [% IF ( attribute_type_form ) %] >@@ -142,17 +143,7 @@ $(document).ready(function() { > <li><label for="authorised_value_category">Authorized value category: </label> > <select name="authorised_value_category" id="authorised_value_category"> > <option value=""></option> >- [% FOREACH authorised_value_categorie IN authorised_value_categories %] >- [% IF ( authorised_value_categorie.selected ) %] >- <option value="[% authorised_value_categorie.category %]" selected="selected"> >- [% authorised_value_categorie.category %] >- </option> >- [% ELSE %] >- <option value="[% authorised_value_categorie.category %]"> >- [% authorised_value_categorie.category %] >- </option> >- [% END %] >- [% END %] >+ [% PROCESS options_for_authorised_value_categories authorised_value_categories => AuthorisedValues.GetCategories( selected => authorised_value_category ) %] > </select> > <span>Authorized value category; if one is selected, the patron record input page will only allow values > to be chosen from the authorized value list. However, an authorized value list is not >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/add_fields.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/add_fields.tt >index 51d5b06..5f90da6 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/add_fields.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/add_fields.tt >@@ -1,3 +1,4 @@ >+[% USE AuthorisedValues %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Serials › Manage new fields for subscriptions > [% IF op == "list" %] › List of fields >@@ -136,13 +137,7 @@ > <label for="av">Authorised value category: </label> > <select name="authorised_value_category"> > <option value="">None</option> >- [% FOR category IN categories %] >- [% IF field.authorised_value_category == category %] >- <option value="[% category %]" selected="selected">[% category %]</option> >- [% ELSE %] >- <option value="[% category %]">[% category %]</option> >- [% END %] >- [% END %] >+ [% PROCESS options_for_authorised_value_categories authorised_value_categories => AuthorisedValues.GetCategories( selected => field.authorised_value_category ) %] > </select> > </li> > <li> >diff --git a/serials/add_fields.pl b/serials/add_fields.pl >index 9451a1b..317f299 100755 >--- a/serials/add_fields.pl >+++ b/serials/add_fields.pl >@@ -101,7 +101,6 @@ if ( $op eq 'delete' ) { > } > > if ( $op eq 'add_form' ) { >- my $categories = C4::Koha::GetAuthorisedValueCategories(); > my $field; > if ( $field_id ) { > $field = Koha::AdditionalField->new( { id => $field_id } )->fetch; >@@ -109,7 +108,6 @@ if ( $op eq 'add_form' ) { > > $template->param( > field => $field, >- categories => $categories, > ); > } > >-- >2.8.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 15803
:
47927
|
52063
|
54257
|
54731
|
56497
|
56540
|
56960