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

(-)a/Koha/ILL/Backend/intra-includes/create.inc (-5 / +1 lines)
Lines 17-27 Link Here
17
[% END %]
17
[% END %]
18
18
19
[% IF whole.stage == "form" %]
19
[% IF whole.stage == "form" %]
20
[% IF Koha.Preference('AutoILLBackendPriority') %]
20
<h2>Create an ILL request</h2>
21
  <h2>Create an automatic ILL request</h2>
22
[% ELSE %]
23
  <h2>Create a manual ILL request</h2>
24
[% END %]
25
<form id="create_form" method="POST" action="">
21
<form id="create_form" method="POST" action="">
26
  [% INCLUDE 'csrf-token.inc' %]
22
  [% INCLUDE 'csrf-token.inc' %]
27
  <fieldset class="rows">
23
  <fieldset class="rows">
(-)a/Koha/ILL/Backend/opac-includes/create.inc (-5 / +1 lines)
Lines 30-40 Link Here
30
[% SET opac = whole.value.other.opac %]
30
[% SET opac = whole.value.other.opac %]
31
31
32
[% IF whole.stage == "form" %]
32
[% IF whole.stage == "form" %]
33
[% IF Koha.Preference('AutoILLBackendPriority') %]
33
<h2>Create an ILL request</h2>
34
  <h2>Create an automatic ILL request</h2>
35
[% ELSE %]
36
  <h2>Create a manual ILL request</h2>
37
[% END %]
38
<form id="create_form" method="POST" action="">
34
<form id="create_form" method="POST" action="">
39
  [% INCLUDE 'csrf-token.inc' %]
35
  [% INCLUDE 'csrf-token.inc' %]
40
    <fieldset class="rows">
36
    <fieldset class="rows">
(-)a/installer/data/mysql/atomicupdate/bug_35604.pl (-2 / +2 lines)
Lines 3-15 use Koha::Installer::Output qw(say_warning say_success say_info); Link Here
3
3
4
return {
4
return {
5
    bug_number  => "35604",
5
    bug_number  => "35604",
6
    description => "Add new AutoILLBackendPriority system preferences",
6
    description => "Add new AutoILLBackendPriority system preference",
7
    up          => sub {
7
    up          => sub {
8
        my ($args) = @_;
8
        my ($args) = @_;
9
        my ( $dbh, $out ) = @$args{qw(dbh out)};
9
        my ( $dbh, $out ) = @$args{qw(dbh out)};
10
10
11
        $dbh->do(
11
        $dbh->do(
12
            q{ INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES ('AutoILLBackendPriority','',NULL,'Set the automatic backend selection priority','ILLBackends'); }
12
            q{ INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES ('AutoILLBackendPriority','',NULL,'Set the automatic backend selection priority','ill-backends'); }
13
        );
13
        );
14
        say_success( $out, "Added new system preference 'AutoILLBackendPriority'" );
14
        say_success( $out, "Added new system preference 'AutoILLBackendPriority'" );
15
    },
15
    },
(-)a/installer/data/mysql/mandatory/sysprefs.sql (-1 / +1 lines)
Lines 93-99 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
93
('AutoCreateAuthorities','0',NULL,'Automatically create authorities that do not exist when cataloging records.','YesNo'),
93
('AutoCreateAuthorities','0',NULL,'Automatically create authorities that do not exist when cataloging records.','YesNo'),
94
('AutoCreditNumber', '', '', 'Automatically generate a number for account credits', 'Choice'),
94
('AutoCreditNumber', '', '', 'Automatically generate a number for account credits', 'Choice'),
95
('AutoEmailNewUser','0',NULL,'Send an email to newly created patrons.','YesNo'),
95
('AutoEmailNewUser','0',NULL,'Send an email to newly created patrons.','YesNo'),
96
('AutoILLBackendPriority','',NULL,'Set the automatic backend selection priority','ILLBackends'),
96
('AutoILLBackendPriority','',NULL,'Set the automatic backend selection priority','ill-backends'),
97
('AutoLinkBiblios','0',NULL,'If enabled, link biblio to authorities on creation and edit','YesNo'),
97
('AutoLinkBiblios','0',NULL,'If enabled, link biblio to authorities on creation and edit','YesNo'),
98
('AutomaticCheckinAutoFill','0',NULL,'Automatically fill the next hold with an automatic check in.','YesNo'),
98
('AutomaticCheckinAutoFill','0',NULL,'Automatically fill the next hold with an automatic check in.','YesNo'),
99
('AutomaticConfirmTransfer','0',NULL,'Defines whether transfers should be automatically confirmed at checkin if modal dismissed','YesNo'),
99
('AutomaticConfirmTransfer','0',NULL,'Defines whether transfers should be automatically confirmed at checkin if modal dismissed','YesNo'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/ill-toolbar.inc (-1 / +1 lines)
Lines 3-9 Link Here
3
    <div id="toolbar" class="btn-toolbar ill-toolbar">
3
    <div id="toolbar" class="btn-toolbar ill-toolbar">
4
        [% IF backends_available %]
4
        [% IF backends_available %]
5
            [% IF Koha.Preference('AutoILLBackendPriority') %]
5
            [% IF Koha.Preference('AutoILLBackendPriority') %]
6
                <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>
6
                <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>
7
            [% ELSIF backends.size > 1 %]
7
            [% ELSIF backends.size > 1 %]
8
                <div class="dropdown btn-group">
8
                <div class="dropdown btn-group">
9
                    <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>
9
                    <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>
(-)a/koha-tmpl/intranet-tmpl/prog/js/ill-autobackend.js (-7 / +3 lines)
Lines 34-40 $(document).ready(function () { Link Here
34
                        __("Verification timed out.")
34
                        __("Verification timed out.")
35
                    );
35
                    );
36
                } else {
36
                } else {
37
                    let message = "Error";
37
                    let message = __("Error");
38
                    if (request.hasOwnProperty("responseJSON")) {
38
                    if (request.hasOwnProperty("responseJSON")) {
39
                        if (request.responseJSON.error) {
39
                        if (request.responseJSON.error) {
40
                            message = request.responseJSON.error;
40
                            message = request.responseJSON.error;
Lines 61-72 $(document).ready(function () { Link Here
61
    function getBackendsAvailability(auto_backends, metadata) {
61
    function getBackendsAvailability(auto_backends, metadata) {
62
        let promises = [];
62
        let promises = [];
63
        for (const auto_backend of auto_backends) {
63
        for (const auto_backend of auto_backends) {
64
            try {
64
            const prom = getBackendAvailability(auto_backend, metadata);
65
                const prom = getBackendAvailability(auto_backend, metadata);
65
            promises.push(prom);
66
                promises.push(prom);
67
            } catch (e) {
68
                console.log(e);
69
            }
70
        }
66
        }
71
        Promise.allSettled(promises).then(() => {
67
        Promise.allSettled(promises).then(() => {
72
            let auto_backend = auto_backends.find(backend => backend.available);
68
            let auto_backend = auto_backends.find(backend => backend.available);
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-illrequests.tt (-1 / +1 lines)
Lines 118-124 Link Here
118
                            [% IF can_patron_place_ill_in_opac %]
118
                            [% IF can_patron_place_ill_in_opac %]
119
                                <div id="illrequests-create-button" class="dropdown btn-group">
119
                                <div id="illrequests-create-button" class="dropdown btn-group">
120
                                    [% IF Koha.Preference('AutoILLBackendPriority') %]
120
                                    [% IF Koha.Preference('AutoILLBackendPriority') %]
121
                                        <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>
121
                                        <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>
122
                                    [% ELSIF backends.size > 1 %]
122
                                    [% ELSIF backends.size > 1 %]
123
                                        <button class="btn btn-primary dropdown-toggle" type="button" id="ill-backend-dropdown" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
123
                                        <button class="btn btn-primary dropdown-toggle" type="button" id="ill-backend-dropdown" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
124
                                            <i class="fa fa-plus" aria-hidden="true"></i> Create a new request <span class="caret"></span>
124
                                            <i class="fa fa-plus" aria-hidden="true"></i> Create a new request <span class="caret"></span>
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt (-2 / +2 lines)
Lines 445-453 Link Here
445
                                [% END %]
445
                                [% END %]
446
                                [% IF Koha.Preference( 'ILLModule' ) == 1 && loggedinusername %]
446
                                [% IF Koha.Preference( 'ILLModule' ) == 1 && loggedinusername %]
447
                                    [% IF Koha.Preference( 'AutoILLBackendPriority' ) %]
447
                                    [% IF Koha.Preference( 'AutoILLBackendPriority' ) %]
448
                                        <li>Make an automatic <a href="/cgi-bin/koha/opac-illrequests.pl?op=create&backend=Standard">Interlibrary loan request</a></li>
448
                                        <li>Make an <a href="/cgi-bin/koha/opac-illrequests.pl?op=create&amp;backend=Standard">interlibrary loan request</a></li>
449
                                    [% ELSE %]
449
                                    [% ELSE %]
450
                                        <li>Make an <a href="/cgi-bin/koha/opac-illrequests.pl?op=create">Interlibrary loan request</a></li>
450
                                        <li>Make an <a href="/cgi-bin/koha/opac-illrequests.pl?op=create">interlibrary loan request</a></li>
451
                                    [% END %]
451
                                    [% END %]
452
                                [% END %]
452
                                [% END %]
453
                            </ul>
453
                            </ul>
(-)a/koha-tmpl/opac-tmpl/bootstrap/js/ill-autobackend.js (-7 / +3 lines)
Lines 34-40 $(document).ready(function () { Link Here
34
                        __("Verification timed out.")
34
                        __("Verification timed out.")
35
                    );
35
                    );
36
                } else {
36
                } else {
37
                    let message = "Error";
37
                    let message = __("Error");
38
                    if (request.hasOwnProperty("responseJSON")) {
38
                    if (request.hasOwnProperty("responseJSON")) {
39
                        if (request.responseJSON.error) {
39
                        if (request.responseJSON.error) {
40
                            message = request.responseJSON.error;
40
                            message = request.responseJSON.error;
Lines 61-72 $(document).ready(function () { Link Here
61
    function getBackendsAvailability(auto_backends, metadata) {
61
    function getBackendsAvailability(auto_backends, metadata) {
62
        let promises = [];
62
        let promises = [];
63
        for (const auto_backend of auto_backends) {
63
        for (const auto_backend of auto_backends) {
64
            try {
64
            const prom = getBackendAvailability(auto_backend, metadata);
65
                const prom = getBackendAvailability(auto_backend, metadata);
65
            promises.push(prom);
66
                promises.push(prom);
67
            } catch (e) {
68
                console.log(e);
69
            }
70
        }
66
        }
71
        Promise.allSettled(promises).then(() => {
67
        Promise.allSettled(promises).then(() => {
72
            let auto_backend = auto_backends.find(backend => backend.available);
68
            let auto_backend = auto_backends.find(backend => backend.available);

Return to bug 35604