Bug 31374

Summary: Add a non-public note column to the suggestions table
Product: Koha Reporter: Lucas Gass <lucas>
Component: AcquisitionsAssignee: Lucas Gass <lucas>
Status: CLOSED FIXED QA Contact: Katrin Fischer <katrin.fischer>
Severity: enhancement    
Priority: P5 - low CC: david, paul.thornton
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Medium patch
Documentation contact: Documentation submission:
Text to go in the release notes:
This enhancement adds a non-public notes field to the suggestions tables in the staff interface. It is displayed by default in the suggestion management tables, and is configurable using the table settings.
Version(s) released in:
22.11.00
Attachments: Bug 31374: Database/Schema update
Bug 31374: Add non-public note to template
Bug 31374: Add privatenote column to table settings
Bug 31374: Update API spec
Bug 31374: Update Suggestion.pm
Bug 31374: Database/Schema update
Bug 31374: Add non-public note to template
Bug 31374: Add privatenote column to table settings
Bug 31374: Update API spec
Bug 31374: Update Suggestion.pm
Bug 31374: (follow-up) change private note to staff_note and reorder columns
Bug 31374: Database/Schema update
Bug 31374: Add non-public note to template
Bug 31374: Add privatenote column to table settings
Bug 31374: Update API spec
Bug 31374: Update Suggestion.pm
Bug 31374: (follow-up) change private note to staff_note and reorder columns
Bug 31374: (QA follow-up) Fix typo collumn in database update

Description Lucas Gass 2022-08-16 20:16:25 UTC
Some libraries would like to have a non-public note field when entering suggestions so they can add suggestion notes that would not be visible to the public.
Comment 1 Lucas Gass 2022-08-16 20:41:47 UTC
Created attachment 139212 [details] [review]
Bug 31374: Database/Schema update
Comment 2 Lucas Gass 2022-08-16 20:47:47 UTC
Created attachment 139213 [details] [review]
Bug 31374: Add non-public note to template
Comment 3 Lucas Gass 2022-08-16 20:51:46 UTC
Created attachment 139214 [details] [review]
Bug 31374: Add privatenote column to table settings
Comment 4 Lucas Gass 2022-08-16 20:56:47 UTC
Created attachment 139216 [details] [review]
Bug 31374: Update API spec
Comment 5 Lucas Gass 2022-08-19 16:22:20 UTC
Created attachment 139508 [details] [review]
Bug 31374: Update Suggestion.pm

To test:
1. Apply patch and restart services
2. Go to Acquistions -> Suggestions -> New Purchase suggestion
3. Notice the new 'Non-public notes:' textarea
4. Make sure you 'Set a patron' so we can later look at the suggestion from the OPAC
5. Make a new suggestion and make sure you add some Non-public notes
6. Back on the 'Suggestions management' page you should see a new column for 'Non-public note'
7. Go to table settings and make sure you can properly hide the column
8. Change the status and make sure it shows up on the table with all statuses (pending, accepted, rejected, etc )
9. Check the API by going to (/api/v1/suggestions). Your suggestion should show up and 'privatenote' should include your non-public note.
10. Log in to the OPAC as the patron we set the suggestion to earlier. You should not see anything related to the non-public note displaying from the OPAC
Comment 6 David Nind 2022-08-20 00:00:13 UTC
Created attachment 139526 [details] [review]
Bug 31374: Database/Schema update

Signed-off-by: David Nind <david@davidnind.com>
Comment 7 David Nind 2022-08-20 00:00:18 UTC
Created attachment 139527 [details] [review]
Bug 31374: Add non-public note to template

Signed-off-by: David Nind <david@davidnind.com>
Comment 8 David Nind 2022-08-20 00:00:23 UTC
Created attachment 139528 [details] [review]
Bug 31374: Add privatenote column to table settings

Signed-off-by: David Nind <david@davidnind.com>
Comment 9 David Nind 2022-08-20 00:00:28 UTC
Created attachment 139529 [details] [review]
Bug 31374: Update API spec

Signed-off-by: David Nind <david@davidnind.com>
Comment 10 David Nind 2022-08-20 00:00:33 UTC
Created attachment 139530 [details] [review]
Bug 31374: Update Suggestion.pm

To test:
1. Apply patch and restart services
2. Go to Acquistions -> Suggestions -> New Purchase suggestion
3. Notice the new 'Non-public notes:' textarea
4. Make sure you 'Set a patron' so we can later look at the suggestion from the OPAC
5. Make a new suggestion and make sure you add some Non-public notes
6. Back on the 'Suggestions management' page you should see a new column for 'Non-public note'
7. Go to table settings and make sure you can properly hide the column
8. Change the status and make sure it shows up on the table with all statuses (pending, accepted, rejected, etc )
9. Check the API by going to (/api/v1/suggestions). Your suggestion should show up and 'privatenote' should include your non-public note.
10. Log in to the OPAC as the patron we set the suggestion to earlier. You should not see anything related to the non-public note displaying from the OPAC

Signed-off-by: David Nind <david@davidnind.com>
Comment 11 David Nind 2022-08-20 00:08:19 UTC
Testing notes (using koha-testing-docker):

- For step 1 in the test plan, run the updatedatabase command as well.
Comment 12 Katrin Fischer 2022-08-20 09:41:10 UTC
Hi Lucas,

could we discuss renaming the database column? It's now: privatenote

We don't use private as a term in any of the other tables or the GUI so I am hesitating to use completely new terminology here.

What about: staff_note? If I see correctly we already have some of those in kohastructure.sql 

git grep note *.sql


The second thing is me wondering if we should keep the status as the last column of the table, moving the new column forward by one. ... happy to hear your thoughts about that one!

Otherwise this works really well!
Comment 13 Lucas Gass 2022-08-22 14:53:28 UTC
Cait,

Thanks for looking at this one. I was unsure when I named the DB column privatenote, I am happy to change it to 'staff_note'.

As for the order of where the column lives, I sort of arbitrarily put it where I put it. I will move it to be right before 'Status'?
Comment 14 Lucas Gass 2022-08-22 22:22:19 UTC
Created attachment 139627 [details] [review]
Bug 31374: (follow-up) change private note to staff_note and reorder columns
Comment 15 Lucas Gass 2022-08-26 13:57:59 UTC
Since I only changed the column names I am keeping David's sign-off and setting this one to 'Signed-off'.
Comment 16 Katrin Fischer 2022-08-27 14:51:38 UTC
Created attachment 139858 [details] [review]
Bug 31374: Database/Schema update

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 17 Katrin Fischer 2022-08-27 14:51:42 UTC
Created attachment 139859 [details] [review]
Bug 31374: Add non-public note to template

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 18 Katrin Fischer 2022-08-27 14:51:47 UTC
Created attachment 139860 [details] [review]
Bug 31374: Add privatenote column to table settings

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 19 Katrin Fischer 2022-08-27 14:51:52 UTC
Created attachment 139861 [details] [review]
Bug 31374: Update API spec

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 20 Katrin Fischer 2022-08-27 14:51:56 UTC
Created attachment 139862 [details] [review]
Bug 31374: Update Suggestion.pm

To test:
1. Apply patch and restart services
2. Go to Acquistions -> Suggestions -> New Purchase suggestion
3. Notice the new 'Non-public notes:' textarea
4. Make sure you 'Set a patron' so we can later look at the suggestion from the OPAC
5. Make a new suggestion and make sure you add some Non-public notes
6. Back on the 'Suggestions management' page you should see a new column for 'Non-public note'
7. Go to table settings and make sure you can properly hide the column
8. Change the status and make sure it shows up on the table with all statuses (pending, accepted, rejected, etc )
9. Check the API by going to (/api/v1/suggestions). Your suggestion should show up and 'privatenote' should include your non-public note.
10. Log in to the OPAC as the patron we set the suggestion to earlier. You should not see anything related to the non-public note displaying from the OPAC

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 21 Katrin Fischer 2022-08-27 14:52:00 UTC
Created attachment 139863 [details] [review]
Bug 31374: (follow-up) change private note to staff_note and reorder columns

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 22 Katrin Fischer 2022-08-27 14:52:06 UTC
Created attachment 139864 [details] [review]
Bug 31374: (QA follow-up) Fix typo collumn in database update

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 23 Tomás Cohen Arazi 2022-09-07 20:46:18 UTC
Pushed to master for 22.11.

Nice work everyone, thanks!
Comment 24 Lucas Gass 2022-10-31 19:44:57 UTC
Enhancement will not be backported to the 22.05.x series
Comment 25 Katrin Fischer 2023-10-05 16:11:38 UTC
*** Bug 23134 has been marked as a duplicate of this bug. ***