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

(-)a/Koha/Item.pm (+5 lines)
Lines 2366-2371 sub is_denied_renewal { Link Here
2366
    return 0;
2366
    return 0;
2367
}
2367
}
2368
2368
2369
sub analytics_count {
2370
    my ($self) = @_;
2371
    return C4::Items::GetAnalyticsCount($self->itemnumber);
2372
}
2373
2369
=head3 strings_map
2374
=head3 strings_map
2370
2375
2371
Returns a map of column name to string representations including the string,
2376
Returns a map of column name to string representations including the string,
(-)a/api/v1/swagger/definitions/item.yaml (+4 lines)
Lines 288-293 properties: Link Here
288
    type:
288
    type:
289
      - object
289
      - object
290
      - "null"
290
      - "null"
291
  analytics_count:
292
    type:
293
      - integer
294
      - "null"
291
  _strings:
295
  _strings:
292
    type:
296
    type:
293
      - object
297
      - object
(-)a/api/v1/swagger/paths/biblios.yaml (+1 lines)
Lines 441-446 Link Here
441
            - bundle_items_lost+count
441
            - bundle_items_lost+count
442
            - bundle_items_not_lost+count
442
            - bundle_items_not_lost+count
443
            - course_item.course_reserves.course
443
            - course_item.course_reserves.course
444
            - analytics_count
444
            - cover_image_ids
445
            - cover_image_ids
445
            - item_group_item.item_group.description
446
            - item_group_item.item_group.description
446
            - serialitem.serial
447
            - serialitem.serial
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt (-6 / +18 lines)
Lines 2197-2202 Link Here
2197
        // For host records
2197
        // For host records
2198
        embed.push('biblio.title');
2198
        embed.push('biblio.title');
2199
2199
2200
        [% IF analyze %]
2201
            embed.push('analytics_count');
2202
        [% END %]
2203
2200
        let items_table_settings = {
2204
        let items_table_settings = {
2201
            holdings: [% TablesSettings.GetTableSettings('catalogue', 'detail','holdings_table','json') | $raw %],
2205
            holdings: [% TablesSettings.GetTableSettings('catalogue', 'detail','holdings_table','json') | $raw %],
2202
            otherholdings: [% TablesSettings.GetTableSettings('catalogue', 'detail','otherholdings_table','json')  | $raw %],
2206
            otherholdings: [% TablesSettings.GetTableSettings('catalogue', 'detail','otherholdings_table','json')  | $raw %],
Lines 2601-2613 Link Here
2601
                        return '<a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=%s">%s</a>'.format(row.biblio_id, row.biblio.title);
2605
                        return '<a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=%s">%s</a>'.format(row.biblio_id, row.biblio.title);
2602
                    }
2606
                    }
2603
                },
2607
                },
2604
                [% IF ( analyze ) %]
2608
                [% IF analyze %]
2605
                {
2609
                {
2606
                    data: "",
2610
                    data: "analytics_count",
2607
                    searchable: false, // FIXME
2611
                    searchable: false,
2608
                    orderable: true,
2612
                    orderable: false,
2613
                    render: function (data, type, row, meta) {
2614
                        if (row.analytics_count == 0) return ""
2615
                        return '<a href="/cgi-bin/koha/catalogue/search.pl?idx=hi&amp;q=%s">%s analytics</a>'.format(row.item_id, row.analytics_count);
2616
                    }
2617
                },
2618
                {
2619
                    data: "analytics_count", // create analytics link
2620
                    searchable: false,
2621
                    orderable: false,
2609
                    render: function (data, type, row, meta) {
2622
                    render: function (data, type, row, meta) {
2610
                        return ""; // FIXME Display analytic count + link
2623
                        return '<a href="/cgi-bin/koha/cataloguing/addbiblio.pl?hostbiblionumber=%s&amp;hostitemnumber=%s">Create analytics</a>'.format(row.biblio_id, row.item_id);
2611
                    }
2624
                    }
2612
                },
2625
                },
2613
                [% END %]
2626
                [% END %]
2614
- 

Return to bug 33568