Bugzilla – Attachment 182485 Details for
Bug 33430
Use REST API for suggestions tables
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33430: (follow-up) Restore sorting to table
Bug-33430-follow-up-Restore-sorting-to-table.patch (text/plain), 7.75 KB, created by
Fridolin Somers
on 2025-05-15 09:06:04 UTC
(
hide
)
Description:
Bug 33430: (follow-up) Restore sorting to table
Filename:
MIME Type:
Creator:
Fridolin Somers
Created:
2025-05-15 09:06:04 UTC
Size:
7.75 KB
patch
obsolete
>From 0153a903065317ec07fcb312fad97b1334a0a187 Mon Sep 17 00:00:00 2001 >From: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> >Date: Tue, 13 May 2025 16:25:42 +0000 >Subject: [PATCH] Bug 33430: (follow-up) Restore sorting to table > >Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> >--- > Koha/Schema/Result/Borrower.pm | 8 +++++++ > Koha/Schema/Result/Suggestion.pm | 24 +++++++++++++++++++ > .../prog/en/modules/suggestion/suggestion.tt | 20 ++++++++-------- > 3 files changed, 42 insertions(+), 10 deletions(-) > >diff --git a/Koha/Schema/Result/Borrower.pm b/Koha/Schema/Result/Borrower.pm >index 02e8cdb520..2e1a5e9d51 100644 >--- a/Koha/Schema/Result/Borrower.pm >+++ b/Koha/Schema/Result/Borrower.pm >@@ -2238,6 +2238,14 @@ __PACKAGE__->has_many( > { cascade_copy => 0, cascade_delete => 0 }, > ); > >+__PACKAGE__->belongs_to( >+ "category", >+ "Koha::Schema::Result::Category", >+ { "foreign.categorycode" => "self.categorycode" }, >+ { is_deferrable => 1, on_delete => "RESTRICT", on_update => "RESTRICT" }, >+); >+ >+ > =head2 koha_objects_class > > Missing POD for koha_objects_class. >diff --git a/Koha/Schema/Result/Suggestion.pm b/Koha/Schema/Result/Suggestion.pm >index 969c040798..fad47cdd92 100644 >--- a/Koha/Schema/Result/Suggestion.pm >+++ b/Koha/Schema/Result/Suggestion.pm >@@ -596,6 +596,30 @@ __PACKAGE__->belongs_to( > }, > ); > >+__PACKAGE__->belongs_to( >+ "library", >+ "Koha::Schema::Result::Branch", >+ { "foreign.branchcode" => "self.branchcode" }, >+ { >+ is_deferrable => 1, >+ join_type => "LEFT", >+ on_delete => "SET NULL", >+ on_update => "CASCADE", >+ }, >+); >+ >+__PACKAGE__->belongs_to( >+ "fund", >+ "Koha::Schema::Result::Aqbudget", >+ { budget_id => "budgetid" }, >+ { >+ is_deferrable => 1, >+ join_type => "LEFT", >+ on_delete => "SET NULL", >+ on_update => "CASCADE", >+ }, >+); >+ > __PACKAGE__->add_columns( > '+archived' => { is_boolean => 1 }, > ); >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 84499b5cae..ce2e9702b3 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt >@@ -1351,7 +1351,7 @@ > { > data: "me.title", > searchable: true, >- orderable: false, >+ orderable: true, > render: function (data, type, row, meta) { > let node = '<a href="suggestion.pl?suggestionid=%s&op=show" title="%s">%s'.format(row.suggestion_id, _("suggestion"), row.title); > if(row.author) node += ', by %s'.format(row.author); >@@ -1372,7 +1372,7 @@ > { > data: "suggester.surname:suggester.firstname:suggester.cardnumber", > searchable: true, >- orderable: false, >+ orderable: true, > render: function (data, type, row, meta) { > let suggester = row.suggester; > let node = '<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=%s">%s'.format(suggester.patron_id, suggester.surname); >@@ -1385,7 +1385,7 @@ > { > data: "suggester.category.name", > searchable: false, >- orderable: false, >+ orderable: true, > render: function (data, type, row, meta) { > return escape_str(row.suggester.category.name); > }, >@@ -1399,9 +1399,9 @@ > }, > }, > { >- data: "", >+ data: "patron_reason", > searchable: false, >- orderable: false, >+ orderable: true, > render: function (data, type, row, meta) { > return escape_str(row._strings.patron_reason.str ? row._strings.patron_reason.str : ''); > }, >@@ -1409,7 +1409,7 @@ > { > data: "manager.surname:manager.firstname", > searchable: true, >- orderable: false, >+ orderable: true, > render: function (data, type, row, meta) { > let node = '<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=%s">%s'.format(row.manager.patron_id, row.manager.surname); > if(row.manager.firstname) node += ', %s'.format(row.manager.firstname); >@@ -1428,7 +1428,7 @@ > { > data: "last_modifier.surname:last_modifier.firstname", > searchable: true, >- orderable: false, >+ orderable: true, > render: function (data, type, row, meta) { > let node = '<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=%s">%s'.format(row.last_modifier.patron_id, row.last_modifier.surname); > if(row.last_modifier.firstname) node += ', %s'.format(row.last_modifier.firstname); >@@ -1455,7 +1455,7 @@ > { > data: "library.name", > searchable: false, >- orderable: false, >+ orderable: true, > render: function (data, type, row, meta) { > return escape_str(row.library.name ? row.library.name : ''); > }, >@@ -1463,7 +1463,7 @@ > { > data: "fund.name", > searchable: false, >- orderable: false, >+ orderable: true, > render: function (data, type, row, meta) { > return escape_str(row.fund ? row.fund.name : ''); > }, >@@ -1471,7 +1471,7 @@ > { > data: "staff_note", > searchable: false, >- orderable: false, >+ orderable: true, > render: function (data, type, row, meta) { > return escape_str(row.staff_note ? row.staff_note : ''); > }, >-- >2.43.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 33430
:
182146
|
182147
|
182148
|
182149
|
182150
|
182161
|
182196
|
182197
|
182198
|
182199
|
182200
|
182202
|
182203
|
182204
|
182205
|
182206
|
182207
|
182208
|
182209
|
182210
|
182211
|
182339
|
182340
|
182341
|
182342
|
182343
|
182428
|
182429
|
182430
|
182431
|
182432
|
182433
|
182434
|
182478
|
182480
|
182481
|
182482
|
182483
|
182484
|
182485
|
182486
|
182487
|
182493
|
182494
|
182495
|
182496
|
182497
|
182498
|
182499
|
182500
|
182577
|
182578