Bug 35604: Multiple QA followups

Multiple fixes:
- File permmissions
- Capitalization
- Translatability
- Use of console.log
- Atomic update description typo fix
- Remove occurrences of 'auto' and 'automatic':
  User testing reported that making a UI distinction between 'regular' and 'automatic' ILL requests is redundant.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Pedro Amorim 2025-03-25 16:43:11 +00:00 committed by Katrin Fischer
parent 1afd6c124d
commit c083d6e690
No known key found for this signature in database
GPG Key ID: 0EF6E2C03357A834
11 changed files with 15 additions and 31 deletions

View File

@ -17,11 +17,7 @@
[% END %]
[% IF whole.stage == "form" %]
[% IF Koha.Preference('AutoILLBackendPriority') %]
<h2>Create an automatic ILL request</h2>
[% ELSE %]
<h2>Create a manual ILL request</h2>
[% END %]
<h2>Create an ILL request</h2>
<form id="create_form" method="POST" action="">
[% INCLUDE 'csrf-token.inc' %]
<fieldset class="rows">

View File

@ -30,11 +30,7 @@
[% SET opac = whole.value.other.opac %]
[% IF whole.stage == "form" %]
[% IF Koha.Preference('AutoILLBackendPriority') %]
<h2>Create an automatic ILL request</h2>
[% ELSE %]
<h2>Create a manual ILL request</h2>
[% END %]
<h2>Create an ILL request</h2>
<form id="create_form" method="POST" action="">
[% INCLUDE 'csrf-token.inc' %]
<fieldset class="rows">

4
installer/data/mysql/atomicupdate/bug_35604.pl Normal file → Executable file
View File

@ -3,13 +3,13 @@ use Koha::Installer::Output qw(say_warning say_success say_info);
return {
bug_number => "35604",
description => "Add new AutoILLBackendPriority system preferences",
description => "Add new AutoILLBackendPriority system preference",
up => sub {
my ($args) = @_;
my ( $dbh, $out ) = @$args{qw(dbh out)};
$dbh->do(
q{ INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES ('AutoILLBackendPriority','',NULL,'Set the automatic backend selection priority','ILLBackends'); }
q{ INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES ('AutoILLBackendPriority','',NULL,'Set the automatic backend selection priority','ill-backends'); }
);
say_success( $out, "Added new system preference 'AutoILLBackendPriority'" );
},

View File

@ -93,7 +93,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `
('AutoCreateAuthorities','0',NULL,'Automatically create authorities that do not exist when cataloging records.','YesNo'),
('AutoCreditNumber', '', '', 'Automatically generate a number for account credits', 'Choice'),
('AutoEmailNewUser','0',NULL,'Send an email to newly created patrons.','YesNo'),
('AutoILLBackendPriority','',NULL,'Set the automatic backend selection priority','ILLBackends'),
('AutoILLBackendPriority','',NULL,'Set the automatic backend selection priority','ill-backends'),
('AutoLinkBiblios','0',NULL,'If enabled, link biblio to authorities on creation and edit','YesNo'),
('AutomaticCheckinAutoFill','0',NULL,'Automatically fill the next hold with an automatic check in.','YesNo'),
('AutomaticConfirmTransfer','0',NULL,'Defines whether transfers should be automatically confirmed at checkin if modal dismissed','YesNo'),

View File

@ -3,7 +3,7 @@
<div id="toolbar" class="btn-toolbar ill-toolbar">
[% IF backends_available %]
[% IF Koha.Preference('AutoILLBackendPriority') %]
<a id="ill-new" class="btn btn-default" href="/cgi-bin/koha/ill/ill-requests.pl?method=create&amp;backend=Standard"> <i class="fa fa-plus"></i> New auto ILL request </a>
<a id="ill-new" class="btn btn-default" href="/cgi-bin/koha/ill/ill-requests.pl?method=create&amp;backend=Standard"> <i class="fa fa-plus"></i> New ILL request </a>
[% ELSIF backends.size > 1 %]
<div class="dropdown btn-group">
<button class="btn btn-default dropdown-toggle" type="button" id="ill-backend-dropdown" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="true"> <i class="fa fa-plus"></i> New ILL request </button>

View File

@ -34,7 +34,7 @@ $(document).ready(function () {
__("Verification timed out.")
);
} else {
let message = "Error";
let message = __("Error");
if (request.hasOwnProperty("responseJSON")) {
if (request.responseJSON.error) {
message = request.responseJSON.error;
@ -61,12 +61,8 @@ $(document).ready(function () {
function getBackendsAvailability(auto_backends, metadata) {
let promises = [];
for (const auto_backend of auto_backends) {
try {
const prom = getBackendAvailability(auto_backend, metadata);
promises.push(prom);
} catch (e) {
console.log(e);
}
const prom = getBackendAvailability(auto_backend, metadata);
promises.push(prom);
}
Promise.allSettled(promises).then(() => {
let auto_backend = auto_backends.find(backend => backend.available);

View File

@ -118,7 +118,7 @@
[% IF can_patron_place_ill_in_opac %]
<div id="illrequests-create-button" class="dropdown btn-group">
[% IF Koha.Preference('AutoILLBackendPriority') %]
<a id="ill-new" class="btn btn-primary" href="/cgi-bin/koha/opac-illrequests.pl?method=create&amp;backend=Standard"> <i class="fa fa-plus" aria-hidden="true"></i> Create a new auto request </a>
<a id="ill-new" class="btn btn-primary" href="/cgi-bin/koha/opac-illrequests.pl?method=create&amp;backend=Standard"> <i class="fa fa-plus" aria-hidden="true"></i> Create a new request </a>
[% ELSIF backends.size > 1 %]
<button class="btn btn-primary dropdown-toggle" type="button" id="ill-backend-dropdown" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
<i class="fa fa-plus" aria-hidden="true"></i> Create a new request <span class="caret"></span>

View File

@ -445,9 +445,9 @@
[% END %]
[% IF Koha.Preference( 'ILLModule' ) == 1 && loggedinusername %]
[% IF Koha.Preference( 'AutoILLBackendPriority' ) %]
<li>Make an automatic <a href="/cgi-bin/koha/opac-illrequests.pl?op=create&backend=Standard">Interlibrary loan request</a></li>
<li>Make an <a href="/cgi-bin/koha/opac-illrequests.pl?op=create&amp;backend=Standard">interlibrary loan request</a></li>
[% ELSE %]
<li>Make an <a href="/cgi-bin/koha/opac-illrequests.pl?op=create">Interlibrary loan request</a></li>
<li>Make an <a href="/cgi-bin/koha/opac-illrequests.pl?op=create">interlibrary loan request</a></li>
[% END %]
[% END %]
</ul>

View File

@ -34,7 +34,7 @@ $(document).ready(function () {
__("Verification timed out.")
);
} else {
let message = "Error";
let message = __("Error");
if (request.hasOwnProperty("responseJSON")) {
if (request.responseJSON.error) {
message = request.responseJSON.error;
@ -61,12 +61,8 @@ $(document).ready(function () {
function getBackendsAvailability(auto_backends, metadata) {
let promises = [];
for (const auto_backend of auto_backends) {
try {
const prom = getBackendAvailability(auto_backend, metadata);
promises.push(prom);
} catch (e) {
console.log(e);
}
const prom = getBackendAvailability(auto_backend, metadata);
promises.push(prom);
}
Promise.allSettled(promises).then(() => {
let auto_backend = auto_backends.find(backend => backend.available);

0
t/db_dependent/Koha/ILL/Backends.t Normal file → Executable file
View File

0
t/db_dependent/Koha/ILL/Request/Workflow/ConfirmAuto.t Normal file → Executable file
View File