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

(-)a/Koha/ERM/EUsage/CounterLog.pm (-6 / +6 lines)
Lines 32-48 Koha::ERM::EUsage::CounterLog - Koha ErmCounterLog Object class Link Here
32
=cut
32
=cut
33
33
34
34
35
=head3 borrowernumber
35
=head3 patron
36
36
37
Return the borrower for this counter_file
37
Return the patron for this counter_file
38
38
39
=cut
39
=cut
40
40
41
sub borrowernumber {
41
sub patron {
42
    my ($self) = @_;
42
    my ($self) = @_;
43
    my $borrowers_rs = $self->_result->borrowernumber;
43
    my $patrons_rs = $self->_result->patron;
44
    return unless $borrowers_rs;
44
    return unless $patrons_rs;
45
    return Koha::Patron->_new_from_dbic($borrowers_rs);
45
    return Koha::Patron->_new_from_dbic($patrons_rs);
46
}
46
}
47
47
48
48
(-)a/Koha/Schema/Result/ErmCounterLog.pm (+11 lines)
Lines 181-186 __PACKAGE__->belongs_to( Link Here
181
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2023-11-30 17:43:57
181
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2023-11-30 17:43:57
182
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:fEB6HZDsjTTJVWlnW+y/Ng
182
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:fEB6HZDsjTTJVWlnW+y/Ng
183
183
184
__PACKAGE__->belongs_to(
185
    "patron",
186
    "Koha::Schema::Result::Borrower",
187
    { borrowernumber => "borrowernumber" },
188
    {
189
        is_deferrable => 1,
190
        join_type     => "LEFT",
191
        on_delete     => "CASCADE",
192
        on_update     => "CASCADE",
193
    },
194
);
184
195
185
sub koha_object_class {
196
sub koha_object_class {
186
    'Koha::ERM::EUsage::CounterLog';
197
    'Koha::ERM::EUsage::CounterLog';
(-)a/api/v1/swagger/definitions/erm_counter_log.yaml (-3 / +7 lines)
Lines 11-20 properties: Link Here
11
    - integer
11
    - integer
12
    - "null"
12
    - "null"
13
  borrowernumber:
13
  borrowernumber:
14
    type: object
14
    description: borrowernumber of the counter log
15
    description: patron object
16
    type:
15
    type:
17
    - object
16
    - integer
18
    - "null"
17
    - "null"
19
  importdate:
18
  importdate:
20
    type: string
19
    type: string
Lines 35-40 properties: Link Here
35
    type: 
34
    type: 
36
    - integer
35
    - integer
37
    - "null"
36
    - "null"
37
  patron:
38
    description: patron object for the importer
39
    type:
40
    - object
41
    - "null"
38
42
39
additionalProperties: false
43
additionalProperties: false
40
required:
44
required:
(-)a/api/v1/swagger/paths/erm_counter_logs.yaml (-1 / +1 lines)
Lines 21-27 Link Here
21
        items:
21
        items:
22
          type: string
22
          type: string
23
          enum:
23
          enum:
24
            - borrowernumber
24
            - patron
25
      - $ref: "../swagger.yaml#/parameters/match"
25
      - $ref: "../swagger.yaml#/parameters/match"
26
      - $ref: "../swagger.yaml#/parameters/order_by"
26
      - $ref: "../swagger.yaml#/parameters/order_by"
27
      - $ref: "../swagger.yaml#/parameters/page"
27
      - $ref: "../swagger.yaml#/parameters/page"
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/UsageStatisticsDataProvidersCounterLogs.vue (-5 / +4 lines)
Lines 41-47 export default { Link Here
41
            tableOptions: {
41
            tableOptions: {
42
                columns: this.getTableColumns(),
42
                columns: this.getTableColumns(),
43
                options: {
43
                options: {
44
                    embed: "borrowernumber",
44
                    embed: "patron",
45
                },
45
                },
46
                url: () => this.table_url(),
46
                url: () => this.table_url(),
47
                table_settings: this.counter_log_table_settings,
47
                table_settings: this.counter_log_table_settings,
Lines 139-147 export default { Link Here
139
                {
139
                {
140
                    title: __("Imported by"),
140
                    title: __("Imported by"),
141
                    render: function (data, type, row, meta) {
141
                    render: function (data, type, row, meta) {
142
                        const borrower = row.borrowernumber
142
                        const { patron } = row
143
                        const importer = borrower
143
                        const importer = patron
144
                            ? `<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=${borrower.patron_id}">${borrower.firstname} ${borrower.surname}</a>`
144
                            ? `<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=${patron.patron_id}">${patron.firstname} ${patron.surname}</a>`
145
                            : "Cronjob"
145
                            : "Cronjob"
146
                        return importer
146
                        return importer
147
                    },
147
                    },
148
- 

Return to bug 36627