From 0153a903065317ec07fcb312fad97b1334a0a187 Mon Sep 17 00:00:00 2001 From: Matt Blenkinsop Date: Tue, 13 May 2025 16:25:42 +0000 Subject: [PATCH] Bug 33430: (follow-up) Restore sorting to table Signed-off-by: Fridolin Somers --- 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 = '%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 = '%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 = '%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 = '%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