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

(-)a/Koha/Ticket.pm (+34 lines)
Lines 179-184 sub to_api_mapping { Link Here
179
    return { id => 'ticket_id', };
179
    return { id => 'ticket_id', };
180
}
180
}
181
181
182
=head3 strings_map
183
184
=cut
185
186
sub strings_map {
187
    my ( $self, $params ) = @_;
188
189
    my $strings = {};
190
191
    if ( defined $self->status ) {
192
        my $av = Koha::AuthorisedValues->search(
193
            {
194
                category         => 'TICKET_STATUS',
195
                authorised_value => $self->status,
196
            }
197
        );
198
199
        my $status_str =
200
              $av->count
201
            ? $params->{public}
202
                ? $av->next->opac_description
203
                : $av->next->lib
204
            : $self->status;
205
206
        $strings->{status} = {
207
            category => 'TICKET_STATUS',
208
            str      => $status_str,
209
            type     => 'av',
210
        };
211
    }
212
213
    return $strings;
214
}
215
182
=head3 _type
216
=head3 _type
183
217
184
=cut
218
=cut
(-)a/Koha/Ticket/Update.pm (+34 lines)
Lines 68-73 sub to_api_mapping { Link Here
68
    return { id => 'update_id', };
68
    return { id => 'update_id', };
69
}
69
}
70
70
71
=head3 strings_map
72
73
=cut
74
75
sub strings_map {
76
    my ( $self, $params ) = @_;
77
78
    my $strings = {};
79
80
    if ( defined $self->status ) {
81
        my $av = Koha::AuthorisedValues->search(
82
            {
83
                category         => 'TICKET_STATUS',
84
                authorised_value => $self->status,
85
            }
86
        );
87
88
        my $status_str =
89
              $av->count
90
            ? $params->{public}
91
                ? $av->next->opac_description
92
                : $av->next->lib
93
            : $self->status;
94
95
        $strings->{status} = {
96
            category => 'TICKET_STATUS',
97
            str      => $status_str,
98
            type     => 'av',
99
        };
100
    }
101
102
    return $strings;
103
}
104
71
=head3 _type
105
=head3 _type
72
106
73
=cut
107
=cut
(-)a/api/v1/swagger/definitions/ticket.yaml (+5 lines)
Lines 68-73 properties: Link Here
68
      - integer
68
      - integer
69
      - "null"
69
      - "null"
70
    description: Number of updates
70
    description: Number of updates
71
  _strings:
72
    type:
73
      - object
74
      - "null"
75
    description: A list of stringified coded values
71
additionalProperties: false
76
additionalProperties: false
72
required:
77
required:
73
  - source
78
  - source
(-)a/api/v1/swagger/paths/tickets.yaml (+2 lines)
Lines 28-33 Link Here
28
            - resolver
28
            - resolver
29
            - biblio
29
            - biblio
30
            - updates+count
30
            - updates+count
31
            - +strings
31
        collectionFormat: csv
32
        collectionFormat: csv
32
    responses:
33
    responses:
33
      "200":
34
      "200":
Lines 237-242 Link Here
237
          type: string
238
          type: string
238
          enum:
239
          enum:
239
            - user
240
            - user
241
            - +strings
240
        collectionFormat: csv
242
        collectionFormat: csv
241
    responses:
243
    responses:
242
      "200":
244
      "200":
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/concerns.tt (-1 / +2 lines)
Lines 103-108 Link Here
103
                    "resolver",
103
                    "resolver",
104
                    "biblio",
104
                    "biblio",
105
                    "updates+count",
105
                    "updates+count",
106
                    "+strings"
106
                ],
107
                ],
107
                'emptyTable': '<div class="dialog message">' + _("Congratulations, there are no catalog concerns.") + '</div>',
108
                'emptyTable': '<div class="dialog message">' + _("Congratulations, there are no catalog concerns.") + '</div>',
108
                "columnDefs": [{
109
                "columnDefs": [{
Lines 167-173 Link Here
167
                                result += '<span class="clearfix">' + $datetime(row.resolved_date) + '</span>';
168
                                result += '<span class="clearfix">' + $datetime(row.resolved_date) + '</span>';
168
                            } else {
169
                            } else {
169
                                if (row.status) {
170
                                if (row.status) {
170
                                    result += row.status;
171
                                    result += row._strings.status ? escape_str(row._strings.status.str) : "";
171
                                } else {
172
                                } else {
172
                                    result += _("Open");
173
                                    result += _("Open");
173
                                }
174
                                }
(-)a/koha-tmpl/intranet-tmpl/prog/js/modals/display_ticket.js (-7 / +8 lines)
Lines 33-39 $(document).ready(function () { Link Here
33
            url: "/api/v1/tickets/" + ticket_id + "/updates",
33
            url: "/api/v1/tickets/" + ticket_id + "/updates",
34
            method: "GET",
34
            method: "GET",
35
            headers: {
35
            headers: {
36
                "x-koha-embed": "user",
36
                "x-koha-embed": ["user", "+strings"],
37
            },
37
            },
38
        })
38
        })
39
            .success(function (data) {
39
            .success(function (data) {
Lines 65-77 $(document).ready(function () { Link Here
65
                        }) +
65
                        }) +
66
                        " (" +
66
                        " (" +
67
                        $datetime(item.date) +
67
                        $datetime(item.date) +
68
                        ")</span>";
68
                        ")";
69
                    if (item.status) {
69
                    if (item.status) {
70
                        updates +=
70
                        updates += '<span class="wrapfix pull-right">';
71
                            '<span class="pull-right">' +
71
                        updates += item._strings.status
72
                            item.status +
72
                            ? escape_str(item._strings.status.str)
73
                            "</span>";
73
                            : "";
74
                        updates += "</span>";
74
                    }
75
                    }
76
                    updates += "</span>";
75
                    updates += "</div>";
77
                    updates += "</div>";
76
                });
78
                });
77
                updates_display.html(updates);
79
                updates_display.html(updates);
78
- 

Return to bug 35628