@@ -, +, @@ ILL_STATUS_ALIAS categories list --- Koha/Illrequest.pm | 8 ++++---- Koha/Illrequest/Logger.pm | 2 +- .../atomicupdate/bug_32799_ill_status_alias.pl | 14 ++++++++++++++ installer/data/mysql/mandatory/auth_val_cat.sql | 2 +- .../prog/en/modules/admin/authorised_values.tt | 2 ++ .../admin/preferences/interlibrary_loans.pref | 2 +- .../prog/en/modules/ill/ill-requests.tt | 2 +- t/db_dependent/Illrequests.t | 8 ++++---- 8 files changed, 28 insertions(+), 12 deletions(-) create mode 100755 installer/data/mysql/atomicupdate/bug_32799_ill_status_alias.pl --- a/Koha/Illrequest.pm +++ a/Koha/Illrequest.pm @@ -158,11 +158,11 @@ sub statusalias { my ( $self ) = @_; return unless $self->status_alias; # We can't know which result is the right one if there are multiple - # ILLSTATUS authorised values with the same authorised_value column value + # ILL_STATUS_ALIAS authorised values with the same authorised_value column value # so we just use the first return Koha::AuthorisedValues->search( { - category => 'ILLSTATUS', + category => 'ILL_STATUS_ALIAS', authorised_value => $self->SUPER::status_alias }, {}, @@ -256,11 +256,11 @@ sub status_alias { return $ret; } # We can't know which result is the right one if there are multiple - # ILLSTATUS authorised values with the same authorised_value column value + # ILL_STATUS_ALIAS authorised values with the same authorised_value column value # so we just use the first my $alias = Koha::AuthorisedValues->search( { - category => 'ILLSTATUS', + category => 'ILL_STATUS_ALIAS', authorised_value => $self->SUPER::status_alias }, {}, --- a/Koha/Illrequest/Logger.pm +++ a/Koha/Illrequest/Logger.pm @@ -252,7 +252,7 @@ sub get_request_logs { $notice_hash->{$notice->{code}} = $notice; } # Populate a lookup table for status aliases - my $aliases = C4::Koha::GetAuthorisedValues('ILLSTATUS'); + my $aliases = C4::Koha::GetAuthorisedValues('ILL_STATUS_ALIAS'); my $alias_hash; foreach my $alias(@{$aliases}) { $alias_hash->{$alias->{authorised_value}} = $alias; --- a/installer/data/mysql/atomicupdate/bug_32799_ill_status_alias.pl +++ a/installer/data/mysql/atomicupdate/bug_32799_ill_status_alias.pl @@ -0,0 +1,14 @@ +use Modern::Perl; + +return { + bug_number => "32799", + description => "Rename ILLSTATUS authorised value category", + up => sub { + my ($args) = @_; + my ($dbh, $out) = @$args{qw(dbh out)}; + # Do you stuffs here + $dbh->do(q{UPDATE authorised_value_categories SET category_name = "ILL_STATUS_ALIAS" WHERE category_name = "ILLSTATUS"}); + # Print useful stuff here + say $out "Renamed authorised value category 'ILLSTATUS' to 'ILL_STATUS_ALIAS'";; + }, +}; --- a/installer/data/mysql/mandatory/auth_val_cat.sql +++ a/installer/data/mysql/mandatory/auth_val_cat.sql @@ -63,7 +63,7 @@ INSERT IGNORE INTO authorised_value_categories( category_name ) VALUES -- For Interlibrary loans INSERT IGNORE INTO authorised_value_categories( category_name ) VALUES - ('ILLSTATUS'); + ('ILL_STATUS_ALIAS'); -- For Claims returned INSERT IGNORE INTO authorised_value_categories( category_name ) VALUES --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tt @@ -535,6 +535,8 @@

General holdings: type of unit designator

[% CASE 'HOLD_CANCELLATION' %]

Reasons why a hold might have been cancelled

+ [% CASE 'ILL_STATUS_ALIAS' %] +

ILL request status aliases used by the interlibrary loans module

[% CASE 'AR_CANCELLATION' %]

Reasons why an article request might have been cancelled

[% CASE 'HSBND_FREQ' %] --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/interlibrary_loans.pref +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/interlibrary_loans.pref @@ -37,7 +37,7 @@ Interlibrary loans: - "ILL statuses that are considered finished and should not be displayed in the ILL module: " - pref: ILLHiddenRequestStatuses class: multi - - (separated with |). If left empty, all ILL requests will be displayed. The request codes can be found in the ILLSTATUS authorized value category. + - (separated with |). If left empty, all ILL requests will be displayed. The request codes are defined in the backends and additional aliases can be configured via the ILL_STATUS_ALIAS authorized value category. Notifications: - - "Send these ILL notices to staff when appropriate:" --- a/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt @@ -422,7 +422,7 @@ [% END %] [% request.capabilities.$stat.name | html %] - [% FOREACH alias IN AuthorisedValues.Get('ILLSTATUS') %] + [% FOREACH alias IN AuthorisedValues.Get('ILL_STATUS_ALIAS') %] [% IF alias.authorised_value == current_alias %]