From 0ac0e9be166441ac360b3f8f7d5f5b6d19a67ea4 Mon Sep 17 00:00:00 2001
From: Lucas Gass <lucas@bywatersolutions.com>
Date: Wed, 1 Feb 2023 16:52:30 +0000
Subject: [PATCH] Bug 32774: Add suggester category column to suggestion tables

To test:
1. Apply patch
2. Restart_all
3. Make some suggestions
4. Go to  Acquisitions > Suggestions management
5. Notice the new 'Suggester category' column which included the patron category of the suggester.
6. Put some suggestions in different statuses and make sure you see the new column on each of the tables.
7. Go to Table settings and make sure you can properly hide the new column and any other column in the table.

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
---
 admin/columns_settings.yml                                      | 2 ++
 .../intranet-tmpl/prog/en/modules/suggestion/suggestion.tt      | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/admin/columns_settings.yml b/admin/columns_settings.yml
index d4da6b08ab..ab77e5ee28 100644
--- a/admin/columns_settings.yml
+++ b/admin/columns_settings.yml
@@ -174,6 +174,8 @@ modules:
               columnname: suggestion
             -
               columnname: suggested_by
+            -
+              columnname: suggester_category
             -
               columnname: suggested_on
             -
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 bfaef57f43..8959d39584 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt
@@ -747,6 +747,7 @@
                                             <th class="NoSort noExport">&nbsp;</th>
                                             <th class="anti-the">Suggestion</th>
                                             <th>Suggested by</th>
+                                            <th>Suggester category</th>
                                             <th>Suggested on</th>
                                             <th>Patron reason</th>
                                             <th>Managed by</th>
@@ -808,6 +809,7 @@
                                                     [% SET suggester = s.suggester %]
                                                     <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% suggester.borrowernumber | uri %]">[% suggester.surname | html %][% IF suggester.firstname %], [% suggester.firstname | html %][% END %] [% IF suggester.cardnumber %]([% suggester.cardnumber | html %])[% END %]</a>
                                                 </td>
+                                                <td>[% suggester.category.description | html %] ([% suggester.categorycode | html %])</td>
                                                 <td data-order="[% s.suggesteddate | html %]">
                                                     [% IF ( s.suggesteddate ) %][% s.suggesteddate | $KohaDates %][% END %]
                                                 </td>
-- 
2.30.2