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

(-)a/api/v1/swagger/definitions/patron.yaml (+5 lines)
Lines 344-349 properties: Link Here
344
    description: patron's extended attributes
344
    description: patron's extended attributes
345
    items:
345
    items:
346
      $ref: "patron_extended_attribute.yaml"
346
      $ref: "patron_extended_attribute.yaml"
347
  checkouts_count:
348
    type:
349
      - integer
350
      - "null"
351
    description: Number of checkouts
347
additionalProperties: false
352
additionalProperties: false
348
required:
353
required:
349
  - surname
354
  - surname
(-)a/api/v1/swagger/paths/patrons.yaml (+1 lines)
Lines 386-391 Link Here
386
        - acquisition: "order_manage"
386
        - acquisition: "order_manage"
387
    x-koha-embed:
387
    x-koha-embed:
388
      - extended_attributes
388
      - extended_attributes
389
      - checkouts+count
389
  post:
390
  post:
390
    x-mojo-to: Patrons#add
391
    x-mojo-to: Patrons#add
391
    operationId: addPatron
392
    operationId: addPatron
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc (-4 / +26 lines)
Lines 105-110 Link Here
105
                            [% CASE 'dateexpiry' %]<th>Expires on</td>
105
                            [% CASE 'dateexpiry' %]<th>Expires on</td>
106
                            [% CASE 'borrowernotes' %]<th>Notes</th>
106
                            [% CASE 'borrowernotes' %]<th>Notes</th>
107
                            [% CASE 'phone' %]<th>Phone</th>
107
                            [% CASE 'phone' %]<th>Phone</th>
108
                            [% CASE 'checkouts' %]<th>Checkouts</th>
108
                            [% CASE 'action' %]<th>&nbsp;</th>
109
                            [% CASE 'action' %]<th>&nbsp;</th>
109
                        [% END %]
110
                        [% END %]
110
                    [% END %]
111
                    [% END %]
Lines 153-160 Link Here
153
            return map;
154
            return map;
154
        }, {});
155
        }, {});
155
156
156
        [% IF Koha.Preference('ExtendedPatronAttributes') %]
157
        [% IF Koha.Preference('ExtendedPatronAttributes') && extended_attribute_types %]
157
            let extended_attribute_types = [% To.json(attribute_type_codes || []) | $raw %];
158
            let extended_attribute_types = [% To.json(extended_attribute_types || []) | $raw %];
158
        [% END %]
159
        [% END %]
159
160
160
    </script>
161
    </script>
Lines 189-195 Link Here
189
                        [% FOR search_field IN search_fields.split(',') %]
190
                        [% FOR search_field IN search_fields.split(',') %]
190
                        {"me.[% search_field | html %]":{"like":"%"+filter+"%"}},
191
                        {"me.[% search_field | html %]":{"like":"%"+filter+"%"}},
191
                        [% END %]
192
                        [% END %]
192
                        [% IF Koha.Preference('ExtendedPatronAttributes') %]
193
                        [% IF Koha.Preference('ExtendedPatronAttributes') && extended_attribute_types %]
193
                        {
194
                        {
194
                            "extended_attributes.value": { "like": "%" + filter + "%" },
195
                            "extended_attributes.value": { "like": "%" + filter + "%" },
195
                            "extended_attributes.code": extended_attribute_types
196
                            "extended_attributes.code": extended_attribute_types
Lines 202-207 Link Here
202
                [% default_sort_column = "name" %]
203
                [% default_sort_column = "name" %]
203
            [% END %]
204
            [% END %]
204
            [% SET order_column_index = 0 %]
205
            [% SET order_column_index = 0 %]
206
            [% SET embed = ['extended_attributes'] %]
205
            patrons_table = $("#[% table_id | html %]").kohaTable({
207
            patrons_table = $("#[% table_id | html %]").kohaTable({
206
                "ajax": {
208
                "ajax": {
207
                    [% SWITCH filter %]
209
                    [% SWITCH filter %]
Lines 228-234 Link Here
228
                        return json.data;
230
                        return json.data;
229
                    }
231
                    }
230
                },
232
                },
231
                embed: ['extended_attributes'],
232
                "drawCallback": function( settings ) {
233
                "drawCallback": function( settings ) {
233
                    var api = this.api();
234
                    var api = this.api();
234
                    var data = api.data();
235
                    var data = api.data();
Lines 255-260 Link Here
255
                            [% order_column_index = loop.count - 1%]
256
                            [% order_column_index = loop.count - 1%]
256
                        [% END %]
257
                        [% END %]
257
                        [% SWITCH column %]
258
                        [% SWITCH column %]
259
                            [% CASE 'checkbox' %]
260
                            {
261
                                "data": "borrowernumber",
262
                                "searchable": true,
263
                                "orderable": true,
264
                                "render": function( data, type, row, meta ) {
265
                                    return "<input type=\"checkbox\" name="data ? escape_str($date(data) + " (" + _("%s years").format($get_age(data)) + ")") : "";
266
267
                                    return "<label for='check" + data + "' class='content_hidden'>" + _("Select patron") + "</label><input type='checkbox' id='check" + data + "' class='selection' name='borrowernumber' value='" + data + "' />",
268
                                }
269
                            }
258
                            [% CASE 'cardnumber' %]
270
                            [% CASE 'cardnumber' %]
259
                            {
271
                            {
260
                                "data": "cardnumber",
272
                                "data": "cardnumber",
Lines 373-378 Link Here
373
                                    return escape_str(data);
385
                                    return escape_str(data);
374
                                }
386
                                }
375
                            }
387
                            }
388
                            [% CASE 'checkouts' %][% embed.push('checkouts+count') %]
389
                            {
390
                                "data": "",
391
                                "searchable": false,
392
                                "orderable": false,
393
                                "render": function( data, type, row, meta ) {
394
                                    return escape_str(row.checkouts_count);
395
                                }
396
                            }
376
                            [% CASE 'action' %]
397
                            [% CASE 'action' %]
377
                            {
398
                            {
378
                                "data": function( row, type, val, meta ) {
399
                                "data": function( row, type, val, meta ) {
Lines 391-396 Link Here
391
                        [% UNLESS loop.last %],[% END %]
412
                        [% UNLESS loop.last %],[% END %]
392
                    [% END %]
413
                    [% END %]
393
                ],
414
                ],
415
                'embed': [% To.json(embed) | $raw %],
394
                "order": [[ [% order_column_index | html %], "asc" ]],
416
                "order": [[ [% order_column_index | html %], "asc" ]],
395
                'bAutoWidth': false,
417
                'bAutoWidth': false,
396
                'sPaginationType': 'full_numbers',
418
                'sPaginationType': 'full_numbers',
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/search.tt (-2 / +1 lines)
Lines 28-34 Link Here
28
</div>
28
</div>
29
29
30
[% MACRO jsinclude BLOCK %]
30
[% MACRO jsinclude BLOCK %]
31
    [% PROCESS patron_search_js table_id => 'memberresultst', categories => categories, libraries => libraries, extended_attribute_types => extended_attribute_types, columns => columns, filter => filter, selection_type => selection_type, callback => callback %]
31
    [% PROCESS patron_search_js table_id => 'memberresultst', categories => categories, libraries => libraries, extended_attribute_types => attribute_type_codes, columns => columns, filter => filter, selection_type => selection_type, callback => callback %]
32
[% END %]
32
[% END %]
33
33
34
[% SET popup_window = 1 %]
34
[% SET popup_window = 1 %]
35
- 

Return to bug 30063