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

(-)a/Koha/ILL/Request.pm (+16 lines)
Lines 1404-1409 sub get_type_disclaimer_date { Link Here
1404
    return $attr->value;
1404
    return $attr->value;
1405
}
1405
}
1406
1406
1407
=head3 manager
1408
1409
    my $manager = $request->manager();
1410
1411
Return the Koha::Patron object found by $self->managedby
1412
1413
=cut
1414
1415
sub manager {
1416
    my ($self) = @_;
1417
1418
    my $manager_rs = $self->_result->manager;
1419
    return unless $manager_rs;
1420
    return Koha::Patron->_new_from_dbic($manager_rs);
1421
}
1422
1407
=head3 check_limits
1423
=head3 check_limits
1408
1424
1409
    my $ok = $requests->check_limits( {
1425
    my $ok = $requests->check_limits( {
(-)a/Koha/Schema/Result/Illrequest.pm (+12 lines)
Lines 469-474 __PACKAGE__->belongs_to( Link Here
469
  },
469
  },
470
);
470
);
471
471
472
__PACKAGE__->belongs_to(
473
    "manager",
474
    "Koha::Schema::Result::Borrower",
475
    { borrowernumber => "managedby" },
476
    {
477
        is_deferrable => 1,
478
        join_type     => "LEFT",
479
        on_delete     => "CASCADE",
480
        on_update     => "CASCADE",
481
    },
482
);
483
472
=head2 koha_object_class
484
=head2 koha_object_class
473
485
474
Missing POD for koha_object_class.
486
Missing POD for koha_object_class.
(-)a/admin/columns_settings.yml (+3 lines)
Lines 1156-1161 modules: Link Here
1156
              columnname: orderid
1156
              columnname: orderid
1157
            -
1157
            -
1158
              columnname: patron
1158
              columnname: patron
1159
            -
1160
              columnname: managedby
1161
              is_hidden: 1
1159
            -
1162
            -
1160
              columnname: biblio_id
1163
              columnname: biblio_id
1161
            -
1164
            -
(-)a/api/v1/swagger/definitions/ill_request.yaml (+9 lines)
Lines 18-23 properties: Link Here
18
    type:
18
    type:
19
      - integer
19
      - integer
20
      - "null"
20
      - "null"
21
  managedby:
22
    type:
23
      - integer
24
      - "null"
21
    description: Internal patron id
25
    description: Internal patron id
22
  due_date:
26
  due_date:
23
    type:
27
    type:
Lines 140-145 properties: Link Here
140
      - object
144
      - object
141
      - "null"
145
      - "null"
142
    description: The linked patron object (x-koha-embed)
146
    description: The linked patron object (x-koha-embed)
147
  manager:
148
    type:
149
      - object
150
      - "null"
151
    description: The linked patron object (x-koha-embed)
143
  _strings:
152
  _strings:
144
    type:
153
    type:
145
      - object
154
      - object
(-)a/api/v1/swagger/paths/ill_requests.yaml (+1 lines)
Lines 31-36 Link Here
31
            - library
31
            - library
32
            - id_prefix
32
            - id_prefix
33
            - patron
33
            - patron
34
            - manager
34
        collectionFormat: csv
35
        collectionFormat: csv
35
    produces:
36
    produces:
36
      - application/json
37
      - application/json
(-)a/ill/ill-requests.pl (+1 lines)
Lines 305-310 if ($backends_available) { Link Here
305
                    ? $params->{status_alias}
305
                    ? $params->{status_alias}
306
                    : "-1";
306
                    : "-1";
307
                $request->status_alias($alias);
307
                $request->status_alias($alias);
308
                $request->managedby( $params->{managedby} );
308
                $request->store;
309
                $request->store;
309
                my $backend_result = {
310
                my $backend_result = {
310
                    error   => 0,
311
                    error   => 0,
(-)a/installer/data/mysql/kohastructure.sql (+3 lines)
Lines 3760-3765 DROP TABLE IF EXISTS `illrequests`; Link Here
3760
CREATE TABLE `illrequests` (
3760
CREATE TABLE `illrequests` (
3761
  `illrequest_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ILL request number',
3761
  `illrequest_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ILL request number',
3762
  `borrowernumber` int(11) DEFAULT NULL COMMENT 'Patron associated with request',
3762
  `borrowernumber` int(11) DEFAULT NULL COMMENT 'Patron associated with request',
3763
  `managedby` int(11) DEFAULT NULL COMMENT 'Staff member manager of request',
3763
  `biblio_id` int(11) DEFAULT NULL COMMENT 'Potential bib linked to request',
3764
  `biblio_id` int(11) DEFAULT NULL COMMENT 'Potential bib linked to request',
3764
  `deleted_biblio_id` int(11) DEFAULT NULL COMMENT 'Deleted bib linked to request',
3765
  `deleted_biblio_id` int(11) DEFAULT NULL COMMENT 'Deleted bib linked to request',
3765
  `due_date` datetime DEFAULT NULL COMMENT 'Custom date due specified by backend, leave NULL for default date_due calculation',
3766
  `due_date` datetime DEFAULT NULL COMMENT 'Custom date due specified by backend, leave NULL for default date_due calculation',
Lines 3781-3786 CREATE TABLE `illrequests` ( Link Here
3781
  `batch_id` int(11) DEFAULT NULL COMMENT 'Optional ID of batch that this request belongs to',
3782
  `batch_id` int(11) DEFAULT NULL COMMENT 'Optional ID of batch that this request belongs to',
3782
  PRIMARY KEY (`illrequest_id`),
3783
  PRIMARY KEY (`illrequest_id`),
3783
  KEY `illrequests_bnfk` (`borrowernumber`),
3784
  KEY `illrequests_bnfk` (`borrowernumber`),
3785
  KEY `illrequests_manfk` (`managedby`),
3784
  KEY `illrequests_bcfk_2` (`branchcode`),
3786
  KEY `illrequests_bcfk_2` (`branchcode`),
3785
  KEY `illrequests_safk` (`status_alias`),
3787
  KEY `illrequests_safk` (`status_alias`),
3786
  KEY `illrequests_bibfk` (`biblio_id`),
3788
  KEY `illrequests_bibfk` (`biblio_id`),
Lines 3788-3793 CREATE TABLE `illrequests` ( Link Here
3788
  CONSTRAINT `illrequests_bcfk_2` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE ON UPDATE CASCADE,
3790
  CONSTRAINT `illrequests_bcfk_2` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE ON UPDATE CASCADE,
3789
  CONSTRAINT `illrequests_bibfk` FOREIGN KEY (`biblio_id`) REFERENCES `biblio` (`biblionumber`) ON DELETE SET NULL ON UPDATE CASCADE,
3791
  CONSTRAINT `illrequests_bibfk` FOREIGN KEY (`biblio_id`) REFERENCES `biblio` (`biblionumber`) ON DELETE SET NULL ON UPDATE CASCADE,
3790
  CONSTRAINT `illrequests_bnfk` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE,
3792
  CONSTRAINT `illrequests_bnfk` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE,
3793
  CONSTRAINT `illrequests_manfk` FOREIGN KEY (`managedby`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE,
3791
  CONSTRAINT `illrequests_ibfk` FOREIGN KEY (`batch_id`) REFERENCES `illbatches` (`ill_batch_id`) ON DELETE SET NULL ON UPDATE CASCADE,
3794
  CONSTRAINT `illrequests_ibfk` FOREIGN KEY (`batch_id`) REFERENCES `illbatches` (`ill_batch_id`) ON DELETE SET NULL ON UPDATE CASCADE,
3792
  CONSTRAINT `illrequests_safk` FOREIGN KEY (`status_alias`) REFERENCES `authorised_values` (`authorised_value`) ON DELETE SET NULL ON UPDATE CASCADE
3795
  CONSTRAINT `illrequests_safk` FOREIGN KEY (`status_alias`) REFERENCES `authorised_values` (`authorised_value`) ON DELETE SET NULL ON UPDATE CASCADE
3793
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
3796
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/ill-list-table.inc (+1 lines)
Lines 19-24 Link Here
19
            <th scope="col" data-datatype="related-object" data-related="extended_attributes" data-related-key="type" data-related-value="type" data-related-search-on="value">Request type</th>
19
            <th scope="col" data-datatype="related-object" data-related="extended_attributes" data-related-key="type" data-related-value="type" data-related-search-on="value">Request type</th>
20
            <th scope="col">Order ID</th>
20
            <th scope="col">Order ID</th>
21
            <th scope="col">Patron</th>
21
            <th scope="col">Patron</th>
22
            <th scope="col">Managed by</th>
22
            <th scope="col">Bibliographic record ID</th>
23
            <th scope="col">Bibliographic record ID</th>
23
            <th scope="col">Library</th>
24
            <th scope="col">Library</th>
24
            <th scope="col">Status</th>
25
            <th scope="col">Status</th>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt (+16 lines)
Lines 7-12 Link Here
7
[% USE TablesSettings %]
7
[% USE TablesSettings %]
8
[% USE Price %]
8
[% USE Price %]
9
[% PROCESS 'i18n.inc' %]
9
[% PROCESS 'i18n.inc' %]
10
[% PROCESS 'manageable-mixin.inc' %]
10
[% SET footerjs = 1 %]
11
[% SET footerjs = 1 %]
11
[% INCLUDE 'doc-head-open.inc' %]
12
[% INCLUDE 'doc-head-open.inc' %]
12
<title
13
<title
Lines 391-396 Link Here
391
                                <label for="borrowernumber">Patron ID:</label>
392
                                <label for="borrowernumber">Patron ID:</label>
392
                                <input name="borrowernumber" id="borrowernumber" type="text" value="[% request.borrowernumber | html %]" />
393
                                <input name="borrowernumber" id="borrowernumber" type="text" value="[% request.borrowernumber | html %]" />
393
                            </li>
394
                            </li>
395
                            [% PROCESS select_manager_form
396
                                manager => request.manager
397
                                required_permission => CAN_user_ill
398
                            %]
394
                            <li class="biblio_id">
399
                            <li class="biblio_id">
395
                                <label for="biblio_id" class="biblio_id">Bibliographic record ID:</label>
400
                                <label for="biblio_id" class="biblio_id">Bibliographic record ID:</label>
396
                                <input name="biblio_id" id="biblio_id" type="text" value="[% request.biblio_id | html %]" />
401
                                <input name="biblio_id" id="biblio_id" type="text" value="[% request.biblio_id | html %]" />
Lines 642-647 Link Here
642
                                    <a href="[% borrowerlink | url %]" title="View borrower details"> [% request.patron.firstname _ " " _ request.patron.surname _ " [" _ request.patron.cardnumber _ "]" | html %] </a>
647
                                    <a href="[% borrowerlink | url %]" title="View borrower details"> [% request.patron.firstname _ " " _ request.patron.surname _ " [" _ request.patron.cardnumber _ "]" | html %] </a>
643
                                </li>
648
                                </li>
644
                            [% END %]
649
                            [% END %]
650
                            [% PROCESS select_manager_show
651
                                manager => request.manager
652
                                display => "fieldset"
653
                            %]
645
                            [% IF request.biblio_id %]
654
                            [% IF request.biblio_id %]
646
                                <li class="biblio_id">
655
                                <li class="biblio_id">
647
                                    <span class="label biblio_id">Bibliographic record ID:</span>
656
                                    <span class="label biblio_id">Bibliographic record ID:</span>
Lines 1117-1122 Link Here
1117
    [% INCLUDE 'js-patron-format.inc' %]
1126
    [% INCLUDE 'js-patron-format.inc' %]
1118
    [% INCLUDE 'calendar.inc' %]
1127
    [% INCLUDE 'calendar.inc' %]
1119
    [% INCLUDE 'select2.inc' %]
1128
    [% INCLUDE 'select2.inc' %]
1129
    [% IF op == 'edit_action' %]
1130
        [% INCLUDE 'select_manager.inc'
1131
            add_modal => 1
1132
            manager => request.manager
1133
            filter => 'ill_users'
1134
        %]
1135
    [% END %]
1120
    [% IF metadata_enrichment_services %]
1136
    [% IF metadata_enrichment_services %]
1121
        <script>
1137
        <script>
1122
            var ill_check_availability_syspref = '[% Koha.Preference('ILLCheckAvailability') | html %]';
1138
            var ill_check_availability_syspref = '[% Koha.Preference('ILLCheckAvailability') | html %]';
(-)a/koha-tmpl/intranet-tmpl/prog/js/ill-list-table.js (-1 / +12 lines)
Lines 294-299 $(document).ready(function () { Link Here
294
                "library",
294
                "library",
295
                "id_prefix",
295
                "id_prefix",
296
                "patron",
296
                "patron",
297
                "manager",
297
            ],
298
            ],
298
            order: [[0, "desc"]],
299
            order: [[0, "desc"]],
299
            stateSave: true, // remember state on page reload
300
            stateSave: true, // remember state on page reload
Lines 411-416 $(document).ready(function () { Link Here
411
                            : "";
412
                            : "";
412
                    },
413
                    },
413
                },
414
                },
415
                {
416
                    data: "manager.firstname:manager.surname:manager.cardnumber",
417
                    render: function (data, type, row, meta) {
418
                        return row.manager
419
                            ? $patron_to_html(row.manager, {
420
                                  display_cardnumber: true,
421
                                  url: true,
422
                              })
423
                            : __("Nobody");
424
                    },
425
                },
414
                {
426
                {
415
                    data: "biblio_id",
427
                    data: "biblio_id",
416
                    orderable: true,
428
                    orderable: true,
417
- 

Return to bug 40504