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

(-)a/api/v1/swagger/definitions/illrequest.yaml (-1 / +1 lines)
Lines 128-134 properties: Link Here
128
    description: The request's current status
128
    description: The request's current status
129
  status_alias:
129
  status_alias:
130
    type:
130
    type:
131
      - string
131
      - object
132
      - "null"
132
      - "null"
133
    description: The ID of a user defined status for this request
133
    description: The ID of a user defined status for this request
134
  updated:
134
  updated:
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/ill-batch-modal.inc (-3 / +4 lines)
Lines 18-25 Link Here
18
                                    value="" />
18
                                    value="" />
19
                                </li>
19
                                </li>
20
                                <li id="batch_patron">
20
                                <li id="batch_patron">
21
                                    <label class="required" for="cardnumber">Card number, username or surname:</label>
21
                                    <label class="required" for="batchcardnumber">Card number, username or surname:</label>
22
                                    <input type="text" autocomplete="off" name="cardnumber" id="cardnumber" type="text" value="" />
22
                                    <input type="text" autocomplete="off" name="batchcardnumber" id="batchcardnumber" type="text" value="" />
23
                                    <span id="patron_link"></span>
23
                                    <span id="patron_link"></span>
24
                                </li>
24
                                </li>
25
                                <li id="batch_branch">
25
                                <li id="batch_branch">
Lines 65-71 Link Here
65
                        </div>
65
                        </div>
66
                    </div>
66
                    </div>
67
                    <div id="create-requests" style="display:none">
67
                    <div id="create-requests" style="display:none">
68
                        <button id="create-requests-button" type="button" class="btn btn-xs btn-success">Add items to batch</button>
68
                        <button id="create-requests-button" type="button" class="btn btn-xs btn-primary">Add items to batch</button>
69
                    </div>
69
                    </div>
70
                    <table id="identifier-table" style="display:none">
70
                    <table id="identifier-table" style="display:none">
71
                        <thead>
71
                        <thead>
Lines 74-79 Link Here
74
                                <th scope="col">Identifier value</th>
74
                                <th scope="col">Identifier value</th>
75
                                <th scope="col">Metadata</th>
75
                                <th scope="col">Metadata</th>
76
                                <th scope="col">Request ID</th>
76
                                <th scope="col">Request ID</th>
77
                                <th scope="col">Request Status</th>
77
                                <th scope="col"></th>
78
                                <th scope="col"></th>
78
                            </tr>
79
                            </tr>
79
                        </thead>
80
                        </thead>
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/ill-toolbar.inc (-1 / +1 lines)
Lines 32-38 Link Here
32
                <i class="fa fa-list"></i> List requests
32
                <i class="fa fa-list"></i> List requests
33
            </a>
33
            </a>
34
        [% END %]
34
        [% END %]
35
        [% IF have_batch.size > 0 %]
35
        [% IF have_batch.size > 0 && metadata_enrichment_services %]
36
        <div id="ill-batch">
36
        <div id="ill-batch">
37
            <div class="dropdown btn-group">
37
            <div class="dropdown btn-group">
38
                <button class="btn btn-default dropdown-toggle" type="button" id="ill-batch-backend-dropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
38
                <button class="btn btn-default dropdown-toggle" type="button" id="ill-batch-backend-dropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/ill_batch_statuses.tt (-2 / +2 lines)
Lines 132-138 Link Here
132
                                [% FOREACH status IN statuses %]
132
                                [% FOREACH status IN statuses %]
133
                                <tr>
133
                                <tr>
134
                                    <td>[% status.name | html %]</td>
134
                                    <td>[% status.name | html %]</td>
135
                                    <td>[% name.code | html %]</td>
135
                                    <td>[% status.code | html %]</td>
136
                                    <td>[% status.is_system ? "Yes" : "No" | html %]</td>
136
                                    <td>[% status.is_system ? "Yes" : "No" | html %]</td>
137
                                    <td class="actions">
137
                                    <td class="actions">
138
                                        <a class="btn btn-default btn-xs" href="/cgi-bin/koha/admin/ill_batch_statuses.pl?op=add_form&amp;code=[% status.code | uri %]"><i class="fa fa-pencil"></i> Edit</a>
138
                                        <a class="btn btn-default btn-xs" href="/cgi-bin/koha/admin/ill_batch_statuses.pl?op=add_form&amp;code=[% status.code | uri %]"><i class="fa fa-pencil"></i> Edit</a>
Lines 146-152 Link Here
146
                        </table>
146
                        </table>
147
                    [% ELSE %]
147
                    [% ELSE %]
148
                        <div class="dialog message">
148
                        <div class="dialog message">
149
                            There are no batch statuses defined. <a href="/cgi-bin/koha/admin/debit_types.pl?op=add_form">Create new batch status</a>
149
                            There are no batch statuses defined. <a href="/cgi-bin/koha/admin/ill_batch_statuses.pl?op=add_form">Create new batch status</a>
150
                        </div>
150
                        </div>
151
                    [% END %]
151
                    [% END %]
152
                [% END %]
152
                [% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/js/ill-batch-modal.js (-19 / +25 lines)
Lines 1-4 Link Here
1
(function () {
1
(function () {
2
    // Bail if there aren't any metadata enrichment plugins installed
3
    if (typeof metadata_enrichment_services === 'undefined') {
4
        console.log('No metadata enrichment plugins found.')
5
        return;
6
    }
7
2
    window.addEventListener('load', onload);
8
    window.addEventListener('load', onload);
3
9
4
    // Delay between API requests
10
    // Delay between API requests
Lines 7-13 Link Here
7
    // Elements we work frequently with
13
    // Elements we work frequently with
8
    var textarea = document.getElementById("identifiers_input");
14
    var textarea = document.getElementById("identifiers_input");
9
    var nameInput = document.getElementById("name");
15
    var nameInput = document.getElementById("name");
10
    var cardnumberInput = document.getElementById("cardnumber");
16
    var cardnumberInput = document.getElementById("batchcardnumber");
11
    var branchcodeSelect = document.getElementById("branchcode");
17
    var branchcodeSelect = document.getElementById("branchcode");
12
    var processButton = document.getElementById("process_button");
18
    var processButton = document.getElementById("process_button");
13
    var createButton = document.getElementById("button_create_batch");
19
    var createButton = document.getElementById("button_create_batch");
Lines 21-27 Link Here
21
    var createRequestsButton = document.getElementById('create-requests-button');
27
    var createRequestsButton = document.getElementById('create-requests-button');
22
    var statusesSelect = document.getElementById('statuscode');
28
    var statusesSelect = document.getElementById('statuscode');
23
29
24
25
    // We need a data structure keyed on identifier type, which tells us how to parse that
30
    // We need a data structure keyed on identifier type, which tells us how to parse that
26
    // identifier type and what services can get its metadata. We receive an array of
31
    // identifier type and what services can get its metadata. We receive an array of
27
    // available services
32
    // available services
Lines 299-304 Link Here
299
                tableContent.data = tableContent.data.map(function (row) {
304
                tableContent.data = tableContent.data.map(function (row) {
300
                    if (row.value === identifier) {
305
                    if (row.value === identifier) {
301
                        row.requestId = data.illrequest_id;
306
                        row.requestId = data.illrequest_id;
307
                        row.requestStatus = data.status;
302
                    }
308
                    }
303
                    return row;
309
                    return row;
304
                });
310
                });
Lines 893-898 Link Here
893
        return data.requestId || '-';
899
        return data.requestId || '-';
894
    }
900
    }
895
901
902
    function createRequestStatus(x, y, data) {
903
        return data.requestStatus || '-';
904
    }
905
896
    function buildTable(identifiers) {
906
    function buildTable(identifiers) {
897
        table = KohaTable('identifier-table', {
907
        table = KohaTable('identifier-table', {
898
            processing: true,
908
            processing: true,
Lines 918-926 Link Here
918
                },
928
                },
919
                {
929
                {
920
                    data: 'requestId',
930
                    data: 'requestId',
921
                    width: '13%',
931
                    width: '6.5%',
922
                    render: createRequestId
932
                    render: createRequestId
923
                },
933
                },
934
                {
935
                    data: 'requestStatus',
936
                    width: '6.5%',
937
                    render: createRequestStatus
938
                },
924
                {
939
                {
925
                    width: '18%',
940
                    width: '18%',
926
                    render: createActions,
941
                    render: createActions,
Lines 1021-1043 Link Here
1021
    }
1036
    }
1022
1037
1023
    function patronAutocomplete() {
1038
    function patronAutocomplete() {
1024
        // Add autocomplete for patron selection
1039
        patron_autocomplete(
1025
        $('#batch-form #cardnumber').autocomplete({
1040
            $('#batch-form #batchcardnumber'),
1026
            appendTo: '#batch-form',
1041
            {
1027
            source: "/cgi-bin/koha/circ/ysearch.pl",
1042
              'on-select-callback': function( event, ui ) {
1028
            minLength: 3,
1043
                $("#batch-form #batchcardnumber").val( ui.item.cardnumber );
1029
            select: function (event, ui) {
1030
                var field = ui.item.cardnumber;
1031
                $('#batch-form #cardnumber').val(field)
1032
                return false;
1044
                return false;
1045
              }
1033
            }
1046
            }
1034
        })
1047
          );
1035
            .data("ui-autocomplete")._renderItem = function (ul, item) {
1036
                return $("<li></li>")
1037
                    .data("ui-autocomplete-item", item)
1038
                    .append("<a>" + item.surname + ", " + item.firstname + " (" + item.cardnumber + ") <small>" + item.address + " " + item.city + " " + item.zipcode + " " + item.country + "</small></a>")
1039
                    .appendTo(ul);
1040
            };
1041
    };
1048
    };
1042
1049
1043
    function createPatronLink() {
1050
    function createPatronLink() {
1044
- 

Return to bug 30719