Bugzilla – Attachment 146487 Details for
Bug 32799
ILLSTATUS authorized value category name is confusing
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32799: Rename ILLSTATUS authorised value category to ILL_STATUS_ALIAS
Bug-32799-Rename-ILLSTATUS-authorised-value-catego.patch (text/plain), 9.10 KB, created by
Pedro Amorim
on 2023-02-10 15:45:57 UTC
(
hide
)
Description:
Bug 32799: Rename ILLSTATUS authorised value category to ILL_STATUS_ALIAS
Filename:
MIME Type:
Creator:
Pedro Amorim
Created:
2023-02-10 15:45:57 UTC
Size:
9.10 KB
patch
obsolete
>From db9fe750c91d146951a5a0501bdd29f66601dbb7 Mon Sep 17 00:00:00 2001 >From: Katrin Fischer <katrin.fischer.83@web.de> >Date: Thu, 9 Feb 2023 21:08:53 +0000 >Subject: [PATCH] Bug 32799: Rename ILLSTATUS authorised value category to > ILL_STATUS_ALIAS > >To test: >1) Activate the IllModule system preference >2) Install a backend (BLDSS or FreeForm) following the wiki instructions: >3) Configure some authorised values for ILLSTATUS >4) Apply patch >5) Run database update >6) Verify your configured values have been updated to ILL_STATUS_ALIAS >7) Add another ILL_STATUS_ALIAS: there should now be an explanation in the > categories list >8) Go to the ILL module and add a new request >9) Edit the request, verify that your status alias show in the status list >10) Set one of your status and save >11) Verify that the ILL requests list search filters show your status alias >12) Manage the request again and verify that the ILL request log shows the > status descriptions correctly >13) Verify the description of the ILLHiddenRequestStatuses has > been updated with the new authorised value category > >Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com> >--- > 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 > >diff --git a/Koha/Illrequest.pm b/Koha/Illrequest.pm >index 723b11843e..d160c152b8 100644 >--- a/Koha/Illrequest.pm >+++ b/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 > }, > {}, >diff --git a/Koha/Illrequest/Logger.pm b/Koha/Illrequest/Logger.pm >index 31f1704446..6aff15765d 100644 >--- a/Koha/Illrequest/Logger.pm >+++ b/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; >diff --git a/installer/data/mysql/atomicupdate/bug_32799_ill_status_alias.pl b/installer/data/mysql/atomicupdate/bug_32799_ill_status_alias.pl >new file mode 100755 >index 0000000000..c3df54b8f7 >--- /dev/null >+++ b/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'";; >+ }, >+}; >diff --git a/installer/data/mysql/mandatory/auth_val_cat.sql b/installer/data/mysql/mandatory/auth_val_cat.sql >index 4162f94f13..5d04b3214c 100644 >--- a/installer/data/mysql/mandatory/auth_val_cat.sql >+++ b/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 >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tt >index 922a7069a9..1e06bbcef3 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tt >@@ -535,6 +535,8 @@ > <p>General holdings: type of unit designator</p> > [% CASE 'HOLD_CANCELLATION' %] > <p>Reasons why a hold might have been cancelled</p> >+ [% CASE 'ILL_STATUS_ALIAS' %] >+ <p>ILL request status aliases used by the interlibrary loans module</p> > [% CASE 'AR_CANCELLATION' %] > <p>Reasons why an article request might have been cancelled</p> > [% CASE 'HSBND_FREQ' %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/interlibrary_loans.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/interlibrary_loans.pref >index 1b65089039..2f724d4151 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/interlibrary_loans.pref >+++ b/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 <a href="/cgi-bin/koha/admin/authorised_values.pl?searchfield=ILLSTATUS">ILLSTATUS</a> 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 <a href="/cgi-bin/koha/admin/authorised_values.pl?searchfield=ILL_STATUS_ALIAS">ILL_STATUS_ALIAS</a> authorized value category. > Notifications: > - > - "Send these ILL notices to staff when appropriate:" >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt >index 5e6c7fc0dd..c8170b61c3 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt >@@ -422,7 +422,7 @@ > [% END %] > [% request.capabilities.$stat.name | html %] > </option> >- [% FOREACH alias IN AuthorisedValues.Get('ILLSTATUS') %] >+ [% FOREACH alias IN AuthorisedValues.Get('ILL_STATUS_ALIAS') %] > [% IF alias.authorised_value == current_alias %] > <option value="[% alias.authorised_value | html %]" selected> > [% ELSE %] >diff --git a/t/db_dependent/Illrequests.t b/t/db_dependent/Illrequests.t >index f33181ce1a..65c1bc6fa5 100755 >--- a/t/db_dependent/Illrequests.t >+++ b/t/db_dependent/Illrequests.t >@@ -1517,7 +1517,7 @@ subtest 'Custom statuses' => sub { > > my $cat = Koha::AuthorisedValueCategories->search( > { >- category_name => 'ILLSTATUS' >+ category_name => 'ILL_STATUS_ALIAS' > } > ); > >@@ -1526,7 +1526,7 @@ subtest 'Custom statuses' => sub { > { > class => 'Koha::AuthorisedValueCategory', > value => { >- category_name => 'ILLSTATUS' >+ category_name => 'ILL_STATUS_ALIAS' > } > } > ); >@@ -1536,12 +1536,12 @@ subtest 'Custom statuses' => sub { > { > class => 'Koha::AuthorisedValues', > value => { >- category => 'ILLSTATUS' >+ category => 'ILL_STATUS_ALIAS' > } > } > ); > >- is($av->category, 'ILLSTATUS', >+ is($av->category, 'ILL_STATUS_ALIAS', > "Successfully created authorised value for custom status"); > > my $ill_req = $builder->build_object( >-- >2.30.2
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 32799
:
146452
|
146453
|
146487
|
147171