Bug 35597

Summary: Purchase suggestion changes aren't logged
Product: Koha Reporter: Lisette Scheer <lisette.scheer>
Component: AcquisitionsAssignee: Lucas Gass <lucas>
Status: Passed QA --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: david, kebliss, lucas, magnus, r.delahunty
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 36187    
Bug Blocks:    
Attachments: Bug 35597: logaction when modifying or deleteing suggestions
Bug 35597: logaction when modifying or deleteing suggestions
Bug 35597: logaction when modifying or deleteing suggestions
Bug 35597: Log creation on suggestion from staff or OPAC
Bug 35597: logaction when modifying or deleteing suggestions
Bug 35597: Log creation on suggestion from staff or OPAC
Bug 35597: logaction when modifying or deleteing suggestions
Bug 35597: Log creation on suggestion from staff or OPAC
Bug 35597: logaction when modifying or deleteing suggestions
Bug 35597: Log creation on suggestion from staff or OPAC
Bug 35597: Tidy Suggestions.pm
Bug 35597: logaction when modifying or deleteing suggestions
Bug 35597: Log creation on suggestion from staff or OPAC
Bug 35597: Tidy Suggestions.pm
Bug 35597: Move modification logging to Koha::Suggestion

Description Lisette Scheer 2023-12-18 23:30:18 UTC
IT would be helpful if changes to purchase suggestions were logged. Sometimes troubleshooting the cycle of a suggestion.
Comment 1 Lucas Gass 2023-12-21 23:06:11 UTC
Created attachment 160223 [details] [review]
Bug 35597: logaction when modifying or deleteing suggestions
Comment 2 Lucas Gass 2023-12-21 23:08:21 UTC
I have a patch but its not quite ready for testing. Currently it logs modifications and deletion. 

Do we want/need to also log creation of suggestions? If so, both OPAC and staff? 


This probably also needs a system preference to go with it like 'SuggestionLog' so it can be turned off if needed.
Comment 3 Lucas Gass 2023-12-22 16:09:18 UTC
Created attachment 160253 [details] [review]
Bug 35597: logaction when modifying or deleteing suggestions
Comment 4 Lucas Gass 2023-12-22 17:12:02 UTC
Created attachment 160265 [details] [review]
Bug 35597: logaction when modifying or deleteing suggestions

To test:
1. Apply patch, restart services, updatedatabase
2. Search for the system preference 'SuggestionsLog', it should be off. Turn it on.
3. Create a purhase suggestion
4. Go to Tools > Log viewer. In modules check 'Suggestions'
5. You should see your newly created suggestion.
6. Modify the suggestion and check the logs again, the modification should be logged.
7. Delete the suggestion, the deletion should be logged.
8. Do a purchase suggestion via the OPAC.
9. Check the logs to see the newly created suggestion, the interface should be OPAC.
10. Turn of SuggestionsLog
11. No changes of any kind should be logged.
Comment 5 David Nind 2023-12-26 22:40:29 UTC
Just a couple of comments from testing:

1. Since it only logs modifications and deletions, then the description for the system preference needs updating (currently says "Don't log/Log any changes to purchase suggestions (create, modify, delete).")

2. For deletions, the info column is empty - should this have the details for the suggestion before it is deleted?
Comment 6 Owen Leonard 2024-01-13 14:52:16 UTC
I think both are good points. Can it be easily expanded to include logging of suggestion creation?

Marking FQA to take it out of the queue while we wait for answers.
Comment 7 Magnus Enger 2024-01-15 10:56:39 UTC
(In reply to Lucas Gass from comment #2)
> Do we want/need to also log creation of suggestions? If so, both OPAC and
> staff? 

I would say "yes" on both counts. :-)
Comment 8 Lucas Gass 2024-01-17 17:11:52 UTC
Created attachment 161114 [details] [review]
Bug 35597: Log creation on suggestion from staff or OPAC

To test:
1. Apply patch, restart services, updatedatabase
2. Search for the system preference 'SuggestionsLog', it should be off. Turn it on.
3. Create a purhase suggestion
4. Go to Tools > Log viewer. In modules check 'Suggestions'
5. You should see your newly created suggestion.
6. Create a suggestion from the OPAC.
7. You should see your newly created OPAC suggestion.
8. Modify the suggestion and check the logs again, the modification should be logged.
9. Delete the suggestion, the deletion should be logged.
10. Do a purchase suggestion via the OPAC.
11. Check the logs to see the newly created suggestion, the interface should be OPAC.
12. Turn off SuggestionsLog
13. No changes of any kind should be logged.
Comment 9 Owen Leonard 2024-01-17 18:12:25 UTC
Created attachment 161115 [details] [review]
Bug 35597: logaction when modifying or deleteing suggestions

To test:
1. Apply patch, restart services, updatedatabase
2. Search for the system preference 'SuggestionsLog', it should be off.
   Turn it on.
3. Create a purhase suggestion
4. Go to Tools > Log viewer. In modules check 'Suggestions'
5. You should see your newly created suggestion.
6. Modify the suggestion and check the logs again, the modification
   should be logged.
7. Delete the suggestion, the deletion should be logged.
8. Do a purchase suggestion via the OPAC.
9. Check the logs to see the newly created suggestion, the interface
   should be OPAC.
10. Turn of SuggestionsLog
11. No changes of any kind should be logged.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 10 Owen Leonard 2024-01-17 18:12:28 UTC
Created attachment 161116 [details] [review]
Bug 35597: Log creation on suggestion from staff or OPAC

To test:
1. Apply patch, restart services, updatedatabase
2. Search for the system preference 'SuggestionsLog', it should be off.
   Turn it on.
3. Create a purhase suggestion
4. Go to Tools > Log viewer. In modules check 'Suggestions'
5. You should see your newly created suggestion.
6. Create a suggestion from the OPAC.
7. You should see your newly created OPAC suggestion.
8. Modify the suggestion and check the logs again, the modification
   should be logged.
9. Delete the suggestion, the deletion should be logged.
10. Do a purchase suggestion via the OPAC.
11  Check the logs to see the newly created suggestion, the interface
    should be OPAC.
12. Turn off SuggestionsLog
13. No changes of any kind should be logged.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 11 PTFS Europe Sandboxes 2024-04-09 09:41:07 UTC
Created attachment 164536 [details] [review]
Bug 35597: logaction when modifying or deleteing suggestions

To test:
1. Apply patch, restart services, updatedatabase
2. Search for the system preference 'SuggestionsLog', it should be off.
   Turn it on.
3. Create a purhase suggestion
4. Go to Tools > Log viewer. In modules check 'Suggestions'
5. You should see your newly created suggestion.
6. Modify the suggestion and check the logs again, the modification
   should be logged.
7. Delete the suggestion, the deletion should be logged.
8. Do a purchase suggestion via the OPAC.
9. Check the logs to see the newly created suggestion, the interface
   should be OPAC.
10. Turn of SuggestionsLog
11. No changes of any kind should be logged.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Ray Delahunty <lib-systems@arts.ac.uk>
Comment 12 PTFS Europe Sandboxes 2024-04-09 09:41:09 UTC
Created attachment 164537 [details] [review]
Bug 35597: Log creation on suggestion from staff or OPAC

To test:
1. Apply patch, restart services, updatedatabase
2. Search for the system preference 'SuggestionsLog', it should be off.
   Turn it on.
3. Create a purhase suggestion
4. Go to Tools > Log viewer. In modules check 'Suggestions'
5. You should see your newly created suggestion.
6. Create a suggestion from the OPAC.
7. You should see your newly created OPAC suggestion.
8. Modify the suggestion and check the logs again, the modification
   should be logged.
9. Delete the suggestion, the deletion should be logged.
10. Do a purchase suggestion via the OPAC.
11  Check the logs to see the newly created suggestion, the interface
    should be OPAC.
12. Turn off SuggestionsLog
13. No changes of any kind should be logged.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Ray Delahunty <lib-systems@arts.ac.uk>
Comment 13 Kyle M Hall 2024-05-17 12:17:21 UTC
Created attachment 166890 [details] [review]
Bug 35597: logaction when modifying or deleteing suggestions

To test:
1. Apply patch, restart services, updatedatabase
2. Search for the system preference 'SuggestionsLog', it should be off.
   Turn it on.
3. Create a purhase suggestion
4. Go to Tools > Log viewer. In modules check 'Suggestions'
5. You should see your newly created suggestion.
6. Modify the suggestion and check the logs again, the modification
   should be logged.
7. Delete the suggestion, the deletion should be logged.
8. Do a purchase suggestion via the OPAC.
9. Check the logs to see the newly created suggestion, the interface
   should be OPAC.
10. Turn of SuggestionsLog
11. No changes of any kind should be logged.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Ray Delahunty <lib-systems@arts.ac.uk>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 14 Kyle M Hall 2024-05-17 12:17:31 UTC
Created attachment 166891 [details] [review]
Bug 35597: Log creation on suggestion from staff or OPAC

To test:
1. Apply patch, restart services, updatedatabase
2. Search for the system preference 'SuggestionsLog', it should be off.
   Turn it on.
3. Create a purhase suggestion
4. Go to Tools > Log viewer. In modules check 'Suggestions'
5. You should see your newly created suggestion.
6. Create a suggestion from the OPAC.
7. You should see your newly created OPAC suggestion.
8. Modify the suggestion and check the logs again, the modification
   should be logged.
9. Delete the suggestion, the deletion should be logged.
10. Do a purchase suggestion via the OPAC.
11  Check the logs to see the newly created suggestion, the interface
    should be OPAC.
12. Turn off SuggestionsLog
13. No changes of any kind should be logged.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Ray Delahunty <lib-systems@arts.ac.uk>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 15 Kyle M Hall 2024-05-17 12:17:33 UTC
Created attachment 166892 [details] [review]
Bug 35597: Tidy Suggestions.pm

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 16 Kyle M Hall 2024-05-17 12:48:28 UTC
Created attachment 166893 [details] [review]
Bug 35597: logaction when modifying or deleteing suggestions

To test:
1. Apply patch, restart services, updatedatabase
2. Search for the system preference 'SuggestionsLog', it should be off.
   Turn it on.
3. Create a purhase suggestion
4. Go to Tools > Log viewer. In modules check 'Suggestions'
5. You should see your newly created suggestion.
6. Modify the suggestion and check the logs again, the modification
   should be logged.
7. Delete the suggestion, the deletion should be logged.
8. Do a purchase suggestion via the OPAC.
9. Check the logs to see the newly created suggestion, the interface
   should be OPAC.
10. Turn of SuggestionsLog
11. No changes of any kind should be logged.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Ray Delahunty <lib-systems@arts.ac.uk>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 17 Kyle M Hall 2024-05-17 12:48:34 UTC
Created attachment 166894 [details] [review]
Bug 35597: Log creation on suggestion from staff or OPAC

To test:
1. Apply patch, restart services, updatedatabase
2. Search for the system preference 'SuggestionsLog', it should be off.
   Turn it on.
3. Create a purhase suggestion
4. Go to Tools > Log viewer. In modules check 'Suggestions'
5. You should see your newly created suggestion.
6. Create a suggestion from the OPAC.
7. You should see your newly created OPAC suggestion.
8. Modify the suggestion and check the logs again, the modification
   should be logged.
9. Delete the suggestion, the deletion should be logged.
10. Do a purchase suggestion via the OPAC.
11  Check the logs to see the newly created suggestion, the interface
    should be OPAC.
12. Turn off SuggestionsLog
13. No changes of any kind should be logged.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Ray Delahunty <lib-systems@arts.ac.uk>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 18 Kyle M Hall 2024-05-17 12:48:36 UTC
Created attachment 166895 [details] [review]
Bug 35597: Tidy Suggestions.pm

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 19 Kyle M Hall 2024-05-17 12:48:39 UTC
Created attachment 166896 [details] [review]
Bug 35597: Move modification logging to Koha::Suggestion

Some actions such as archiving a suggestion were not being logged.
By moving the logging to Koha::Suggestion we can ensure more
modifcations will be logged.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>