From 41124ff12aacfad0edf54721aa38d1f029f8c63b Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Fri, 30 May 2025 14:28:23 +0000 Subject: [PATCH] Bug 40036: Add reason back to status column and add classes/data attributes To test: 0. APPLY PATCH 1. Make a few AVs for SUGGEST ( reason ) and SUGGEST_STATUS ( status ). 2. Make some new suggestions and give them new statues w/ a reason. 3. The reason should display, in parentheses, in the status column. 4. There should be a status class and a reason class for each. --- .../prog/en/modules/suggestion/suggestion.tt | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt index 00e7c6ea0d9..c6b25551d24 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt @@ -1490,14 +1490,19 @@ searchable: false, orderable: true, render: function (data, type, row, meta) { - if(row.status === 'ASKED') return '%s'.format(_("Pending")); - if(row.status === 'ACCEPTED') return '%s'.format(_("Accepted")); - if(row.status === 'ORDERED') return '%s'.format(_("Ordered")); - if(row.status === 'REJECTED') return '%s'.format(_("Rejected")); - if(row.status === 'CHECKED') return '%s'.format(_("Checked")); - if(row.status === 'AVAILABLE') return '%s'.format(_("Available")); - if(row._strings.status.str) return '%s'.format(row._strings.status.str); - return '%s'.format(_("Status unknown")); + let node = ''; + if(row.status === 'ASKED') node += '%s'.format(_("Pending")); + else if(row.status === 'ACCEPTED') node += '%s'.format(_("Accepted")); + else if(row.status === 'ORDERED') node += '%s'.format(_("Ordered")); + else if(row.status === 'REJECTED') node += '%s'.format(_("Rejected")); + else if(row.status === 'CHECKED') node += '%s'.format(_("Checked")); + else if(row.status === 'AVAILABLE') node += '%s'.format(_("Available")); + else if(row._strings.status.str) node += '%s'.format(row._strings.status.str); + else node += '%s'.format(_("Status unknown")); + if ( row.reason ) { + node += '
('+ row.reason +')
'; + } + return node; }, }, { -- 2.39.5