Some libraries would like to be able to connect an arbitrary number of comments to each ILL request. This could be comments from the patron, messages between different librarians working on the same ILLS, comments about what other libraries have been tried before the current one etc. This would require a new table with fields like - unique ID - text of the comment - borrowernumber of the librarian who made the comment - timestamp Maybe it would be possible to include comments from the OPAC too? Not sure if that makes sense.
Two important things to decide on here: - Should it be possible to edit comments? - Should it be possible to delete comments? I lean towards "no" for both questions, because it makes the code simpler and it means the comments are historically correct.
Created attachment 69234 [details] [review] Bug 18591 - Allow any number of comments on ILLs This patch makes it possible to add arbitrary comments to ILL requests. Comments are read only and displayed in chronological order. Comments can be added by librarians, but also added automatically based on comments in the different protocols, so that comments from the lending library can also be added. To test: - Enable the ILL module ("ILLModule" syspref + config in koha-conf.xml) - Install the Dummy backend from here: https://github.com/PTFS-Europe/Dummy - Create a Dummy ILL request - Add comments to the request, checking that the name and borrowernumber of the person that added the comment is displayed ok - Check that the displayed date and time the comment was submitted follows the "dateformat" syspref - On the "List requests" page, check that the correct number of comments is displayed in the "Comments" column - Check that the tests pass: prove t/db_dependent/Illcomments.t
Created attachment 69272 [details] [review] Bug 18591 - Database updates
Created attachment 69273 [details] [review] Bug 18591 - Database updates
Created attachment 69274 [details] [review] Update Schema - DO NOT PUSH
Created attachment 69275 [details] [review] Bug 18591 - Allow any number of comments on ILLs This patch makes it possible to add arbitrary comments to ILL requests. Comments are read only and displayed in chronological order. Comments can be added by librarians, but also added automatically based on comments in the different protocols, so that comments from the lending library can also be added. To test: - Enable the ILL module ("ILLModule" syspref + config in koha-conf.xml) - Install the Dummy backend from here: https://github.com/PTFS-Europe/Dummy - Create a Dummy ILL request - Add comments to the request, checking that the name and borrowernumber of the person that added the comment is displayed ok - Check that the displayed date and time the comment was submitted follows the "dateformat" syspref - On the "List requests" page, check that the correct number of comments is displayed in the "Comments" column - Check that the tests pass: prove t/db_dependent/Illcomments.t
Comment on attachment 69273 [details] [review] Bug 18591 - Database updates Review of attachment 69273 [details] [review]: ----------------------------------------------------------------- ::: installer/data/mysql/kohastructure.sql @@ +4194,5 @@ > + CONSTRAINT illcomments_ifk > + FOREIGN KEY (illrequest_id) > + REFERENCES illrequests ( illrequest_id ) > + ON UPDATE CASCADE ON DELETE CASCADE > +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; utf8mb4, not just utf8. see bug 18336. I haven't tried yet, but this patch might not apply because of this.
Created attachment 74964 [details] [review] Bug 18591 - Database updates
Created attachment 74965 [details] [review] Update Schema - DO NOT PUSH
Created attachment 74966 [details] [review] Bug 18591 - Allow any number of comments on ILLs This patch makes it possible to add arbitrary comments to ILL requests. Comments are read only and displayed in chronological order. Comments can be added by librarians, but also added automatically based on comments in the different protocols, so that comments from the lending library can also be added. To test: - Enable the ILL module ("ILLModule" syspref + config in koha-conf.xml) - Install the Dummy backend from here: https://github.com/PTFS-Europe/Dummy - Create a Dummy ILL request - Add comments to the request, checking that the name and borrowernumber of the person that added the comment is displayed ok - Check that the displayed date and time the comment was submitted follows the "dateformat" syspref - On the "List requests" page, check that the correct number of comments is displayed in the "Comments" column - Check that the tests pass: prove t/db_dependent/Illcomments.t
Updated patches, using utf8mb4, are available now!
Created attachment 79518 [details] [review] Bug 18591 - Database updates Signed-off-by: andrew.isherwood@ptfs-europe.com
Created attachment 79519 [details] [review] Bug 18591 - Allow any number of comments on ILLs This patch makes it possible to add arbitrary comments to ILL requests. Comments are read only and displayed in chronological order. Comments can be added by librarians, but also added automatically based on comments in the different protocols, so that comments from the lending library can also be added. To test: - Enable the ILL module ("ILLModule" syspref + config in koha-conf.xml) - Install the Dummy backend from here: https://github.com/PTFS-Europe/Dummy - Create a Dummy ILL request - Add comments to the request, checking that the name and borrowernumber of the person that added the comment is displayed ok - Check that the displayed date and time the comment was submitted follows the "dateformat" syspref - On the "List requests" page, check that the correct number of comments is displayed in the "Comments" column - Check that the tests pass: prove t/db_dependent/Illcomments.t Signed-off-by: andrew.isherwood@ptfs-europe.com
Created attachment 80077 [details] [review] Update Schema - DO NOT PUSH
Created attachment 80078 [details] [review] Bug 18591 - Database updates Signed-off-by: andrew.isherwood@ptfs-europe.com
Created attachment 80079 [details] [review] Bug 18591 - Allow any number of comments on ILLs This patch makes it possible to add arbitrary comments to ILL requests. Comments are read only and displayed in chronological order. Comments can be added by librarians, but also added automatically based on comments in the different protocols, so that comments from the lending library can also be added. To test: - Enable the ILL module ("ILLModule" syspref + config in koha-conf.xml) - Install the Dummy backend from here: https://github.com/PTFS-Europe/Dummy - Create a Dummy ILL request - Add comments to the request, checking that the name and borrowernumber of the person that added the comment is displayed ok - Check that the displayed date and time the comment was submitted follows the "dateformat" syspref - On the "List requests" page, check that the correct number of comments is displayed in the "Comments" column - Check that the tests pass: prove t/db_dependent/Illcomments.t Signed-off-by: andrew.isherwood@ptfs-europe.com
Created attachment 80081 [details] [review] Bug 18591: (follow-up) Add missing html filters
Created attachment 80084 [details] [review] Bug 18591: (follow-up) Add more POD
Created attachment 80101 [details] [review] Bug 18591: Database updates Signed-off-by: andrew.isherwood@ptfs-europe.com
Created attachment 80102 [details] [review] Bug 18591: Allow any number of comments on ILLs This patch makes it possible to add arbitrary comments to ILL requests. Comments are read only and displayed in chronological order. Comments can be added by librarians, but also added automatically based on comments in the different protocols, so that comments from the lending library can also be added. To test: - Enable the ILL module ("ILLModule" syspref + config in koha-conf.xml) - Install the Dummy backend from here: https://github.com/PTFS-Europe/Dummy - Create a Dummy ILL request - Add comments to the request, checking that the name and borrowernumber of the person that added the comment is displayed ok - Check that the displayed date and time the comment was submitted follows the "dateformat" syspref - On the "List requests" page, check that the correct number of comments is displayed in the "Comments" column - Check that the tests pass: prove t/db_dependent/Illcomments.t Signed-off-by: andrew.isherwood@ptfs-europe.com
Created attachment 80103 [details] [review] Bug 18591: (follow-up) Add missing html filters
Created attachment 80104 [details] [review] Bug 18591: (QA follow-up) Fix merge error in kohastructure.sql
Created attachment 80105 [details] [review] Bug 18591: (follow-up) Add more POD
Created attachment 80227 [details] [review] Bug 18591: Database updates Signed-off-by: andrew.isherwood@ptfs-europe.com Bug 18591: (QA follow-up) Fix merge error in kohastructure.sql
Created attachment 80228 [details] [review] Bug 18591: Allow any number of comments on ILLs This patch makes it possible to add arbitrary comments to ILL requests. Comments are read only and displayed in chronological order. Comments can be added by librarians, but also added automatically based on comments in the different protocols, so that comments from the lending library can also be added. To test: - Enable the ILL module ("ILLModule" syspref + config in koha-conf.xml) - Install the Dummy backend from here: https://github.com/PTFS-Europe/Dummy - Create a Dummy ILL request - Add comments to the request, checking that the name and borrowernumber of the person that added the comment is displayed ok - Check that the displayed date and time the comment was submitted follows the "dateformat" syspref - On the "List requests" page, check that the correct number of comments is displayed in the "Comments" column - Check that the tests pass: prove t/db_dependent/Illcomments.t Signed-off-by: andrew.isherwood@ptfs-europe.com
Created attachment 80229 [details] [review] Bug 18591: (follow-up) Add missing html filters
Created attachment 80230 [details] [review] Bug 18591: (follow-up) Add more POD
Comment on attachment 80104 [details] [review] Bug 18591: (QA follow-up) Fix merge error in kohastructure.sql This patch was squashed into https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=80227
I had to squash: https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=80101 and https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=80104 as the problem in the first was causing it to fail to apply before it got to the second which fixed the problem. So now they're a single patch which should apply correctly
Couple issues: 1 - Requests existing before this patch throw datatables errors when viewing requests: DataTables warning: table id=ill-requests - Requested unknown parameter 'comments' for row 0, column 8. For more information about this error, please see http://datatables.net/tn/4 2 - Instead of entering a borrowernumber, enter some letters in that field when creating a request - Internal server error 3 - Enter an invalid borrowernumner - Internal server error Ideally I think we should use a patron search here and not rely on the user to come up with borrowernumbers
Thanks for that Nick. I think items 2 & 3 are not related to this enhancement, they appear to be pre-existing bugs in the ILL module. I'll create bugs for them. #1 is an interesting one, I'd expect the "comments" property to be available, even if it didn't exist when the request was available. Since it's seemingly a datatables problem, I'll take an initial look and see what's going on. If it's a problem in the original patches, I'll perhaps throw it in Magnus' direction :-)
I've started looking into this. Problems #2 & #3 both appear to be problems with the Dummy backend. This backend hasn't seen any maintenance for over a year and has now been replaced by the FreeForm backend as a "simple, no dependency" backend. I'll update the test plan accordingly. Still looking at #1
To test: - Enable the ILL module ("ILLModule" syspref + config in koha-conf.xml) - Install the FreeForm backend from here: https://github.com/PTFS-Europe/koha-ill-freeform - Create a FreeForm ILL request - Add comments to the request, checking that the name and borrowernumber of the person that added the comment is displayed ok - Check that the displayed date and time the comment was submitted follows the "dateformat" syspref - On the "List requests" page, check that the correct number of comments is displayed in the "Comments" column - Check that the tests pass: prove t/db_dependent/Illcomments.t
(In reply to Nick Clemens from comment #30) > Couple issues: > 1 - Requests existing before this patch throw datatables errors when viewing > requests: > DataTables warning: table id=ill-requests - Requested unknown parameter > 'comments' for row 0, column 8. For more information about this error, > please see http://datatables.net/tn/4 I've not been able to replicate this at all Nick. I started with no requests at all and without the bug applied. I created a couple of requests, obviously lacking comments. I then applied the bug. The request list displayed perfectly, showing the number of comments as 0 for each request. I then created a request without any problem. Did you definitely run the database update and regenerated the schema after applying the bug? Sorry, I'm *sure* you did, but I thought it was worth mentioning.
(In reply to Andrew Isherwood from comment #34) > Did you definitely run the database update and regenerated the schema after > applying the bug? Sorry, I'm *sure* you did, but I thought it was worth > mentioning. Never be too sure - I can't recreate now either, moving back to PQA
Awesome work all! Pushed to master for 18.11
Enhancement, will not be backported to 18.05.x series.