---- Reported by oleonard@myacpl.org 2008-03-26 08:47:48 ---- Many blog systems have a feature where the admin gets an email when someone posts a new comment that needs to be moderated. It would be nice to incorporate this into Koha. Ideally, you could set an email address in system preferences where notifications should be sent (since the Koha administrator is probably not the one approving comments). The body of the email would contain the comments, and offer a direct link to approve or delete the comment. --- Bug imported by chris@bigballofwax.co.nz 2010-05-21 00:36 UTC --- This bug was previously known as _bug_ 1985 at http://bugs.koha.org/cgi-bin/bugzilla3/show_bug.cgi?id=1985 Actual time not defined. Setting to 0.0
Created attachment 33916 [details] [review] Bug 1985 - Email notification of new OPAC comments This feature adds YAS 'CommentModeratorsEmail', where an email (template code COMMENT_CREATED) is sent when a borrower creates/modifies an comment/review. The syspref is empty by default and no email is sent when the syspref is empty. This feature is needed because we want to alert our content moderators to take action when needed. Usually it is our librarians who write reviews and this improvement makes the process of moving Koha reviews to our CMS more smooth. TEST SETUP: -1. Run updatedatabase.pl to add the syspref and the new letter template. 0. Go to admin/preferences.pl?tab=opac, and set the 'CommentModeratorsEmail'-syspref to your email-address. TEST PLAN: 1. Log in to OPAC and find any Biblio. 2. Make a comment/review for it. 3. Check the koha.message_queue-table for any letter_code = 'COMMENT_CREATED'. You should see the reasonable default message. You can change the message in tools/letter.pl.
Pending unit tests. I might not be able to do them in a while because I am quite busy with other issues.
Created attachment 33918 [details] [review] Bug 1985 - Email notification of new OPAC comments This feature adds YAS 'CommentModeratorsEmail', where an email (template code COMMENT_CREATED) is sent when a borrower creates/modifies an comment/review. The syspref is empty by default and no email is sent when the syspref is empty. This feature is needed because we want to alert our content moderators to take action when needed. Usually it is our librarians who write reviews and this improvement makes the process of moving Koha reviews to our CMS more smooth. TEST SETUP: -1. Run updatedatabase.pl to add the syspref and the new letter template. 0. Go to admin/preferences.pl?tab=opac, and set the 'CommentModeratorsEmail'-syspref to your email-address. TEST PLAN: 1. Log in to OPAC and find any Biblio. 2. Make a comment/review for it. 3. Check the koha.message_queue-table for any letter_code = 'COMMENT_CREATED'. You should see the reasonable default message. You can change the message in tools/letter.pl.
Comment on attachment 33918 [details] [review] Bug 1985 - Email notification of new OPAC comments Review of attachment 33918 [details] [review]: ----------------------------------------------------------------- ::: C4/Review.pm @@ +81,4 @@ > (?,?,?,0,now())"; > my $sth = $dbh->prepare($query); > $sth->execute( $borrowernumber, $biblionumber, $review); > + I hope this isn't white space. Please consider: git config --global core.whitespace trailing-space,space-before-tab git config --global apply.whitespace fix @@ +203,5 @@ > + my $borrowernumber = shift; > + > + my $moderatorEmail = C4::Context->preference('CommentModeratorsEmail'); > + if (not($moderatorEmail)) { > + return undef; I think this will fail the koha qa tests. No need to be explicit with the undef;
See my comments in comment 4 as to why I changed this to Failed QA.
I have run the QA script on it and there is indeed: "return" statement with explicit "undef" at line 207, column 9. See page 199 of PBP. (Severity: 5) There are also some other things that need to be fixed - Olli, can you provide a follow-up please fixing those?
Created attachment 36065 [details] [review] Bug 1985 - Email notification of new OPAC comments This feature adds YAS 'CommentModeratorsEmail', where an email (template code COMMENT_CREATED) is sent when a borrower creates/modifies an comment/review. The syspref is empty by default and no email is sent when the syspref is empty. This feature is needed because we want to alert our content moderators to take action when needed. Usually it is our librarians who write reviews and this improvement makes the process of moving Koha reviews to our CMS more smooth. TEST SETUP: -1. Run updatedatabase.pl to add the syspref and the new letter template. 0. Go to admin/preferences.pl?tab=opac, and set the 'CommentModeratorsEmail'-syspref to your email-address. TEST PLAN: 1. Log in to OPAC and find any Biblio. 2. Make a comment/review for it. 3. Check the koha.message_queue-table for any letter_code = 'COMMENT_CREATED'. You should see the reasonable default message. You can change the message in tools/letter.pl.
(In reply to M. Tompsett from comment #4) > I think this will fail the koha qa tests. No need to be explicit with the > undef; Does this mean the patch work as expected? The failed QA status should not be used to raise QA issues when the bug is on the NSO step. It removes the patch from the NSO queue and won't be tested. However you can use it if the patch does not work as expected. This kind of issues will be caught on the QA step and can be fixed by the QAer.
The last patch now passes the qa script.
Comment on attachment 36065 [details] [review] Bug 1985 - Email notification of new OPAC comments Review of attachment 36065 [details] [review]: ----------------------------------------------------------------- ::: C4/Review.pm @@ +200,5 @@ > + > +=cut > + > +sub SendReviewAlert { > + my $review = shift; Olli, this $review is not used in the subroutine.
I tested this patch on a sandbox : 1. set syspref CommentModeratorsEmail with my email adress 2. go to public interface and add a comment on a book 3. go to saved reports to check to table message_queue : I have a new record with the letter_code ''COMMENT_CREATED' : Ok, it works ! 4. Go to notices and slips to change the message of ''COMMENT_CREATED' model : in email tab, I try to add the title of the book in the message (<<biblio.title>>) and the biblionumber (<<biblio.biblionumber>>) 5. Go to the opac and add a new comment on an other book 6. go to saved reports to check to table message_queue : I don't retrieve the title of the book and the biblionumber in the email : it's a pity because it can be usefull informations for the librarian.
I think that may be a cronjob configuration problem. I'll recheck this.
Another reason this is currently failed qa. This modifies C4/Review.pm without adding any tests. Don't worry, the patch I'm working on for this will handle comment #11 and add tests.
Created attachment 36516 [details] [review] Bug 1985 - Email notification of new OPAC comments This feature adds YAS 'CommentModeratorsEmail', where an email (template code COMMENT_CREATED) is sent when a borrower creates/modifies an comment/review. The syspref is empty by default and no email is sent when the syspref is empty. This feature is needed because we want to alert our content moderators to take action when needed. Usually it is our librarians who write reviews and this improvement makes the process of moving Koha reviews to our CMS more smooth. TEST SETUP: -1. Run updatedatabase.pl to add the syspref and the new letter template. 0. Go to admin/preferences.pl?tab=opac, and set the 'CommentModeratorsEmail'-syspref to your email-address. TEST PLAN: 1. Log in to OPAC and find any Biblio. 2. Make a comment/review for it. 3. Check the koha.message_queue-table for any letter_code = 'COMMENT_CREATED'. You should see the reasonable default message. You can change the message in tools/letter.pl.
Created attachment 36517 [details] [review] Bug 1985 - Add missing table variables, tweak License, and cleanup In comment #11, it was mentioned that title and biblionumber from the biblio table were not available as variables in the letter. This corrects this by converting the parameter list to a hashref, and adding the missing biblio number. It also cleans up the license on C4/Review.pm to be in line with the current coding guidelines license. Also strict and warning have been changed to the 'Use Modern::Perl;' now. TEST PLAN --------- 1) Create test branch and apply patch 2) run installer/data/mysql/updatedatabase.pl -- this will add the required default letter. 3) In the staff client: a) set the CommentModeratorsEmail system preference. -- not setting it will mean you won't get any queued letters. b) modify the COMMENT_CREATED default letter as desired. -- feel free to add other things. 4) In the OPAC: a) Log in b) Find something c) Click on the 'Comments' tab -- Holdings/Title notes/Comments (#) is at the bottom d) Click 'Post or edit your comments on this item' e) In the window that pops up, type your comment. f) Click 'Submit and close this window'. g) Click 'Edit' and repeat steps e and f again. 5) In a mysql client: a) Open the koha database b) SELECT * FROM message_queue WHERE letter_code='COMMENT_CREATED'; -- There should be at least two. -- They should be able to contain the borrower number, biblio title, and other borrower and biblio related things. -- Comments are at a biblio level, so items, and issues don't make sense as variables for the letter. 6) prove -v t/db_dependent/Review.t 6) Run the koha qa test tool.
Obviously item numbers and the like don't make sense in the context of this bug, but fixing what is listed for what reports would require a separate enhancement.
And by the way, comment 10 is still a valid issue. I figure it might be useful to include it in the letter in the future, but no code was added to make that possible.
Created attachment 36521 [details] [review] Bug 1985 - Email notification of new OPAC comments This feature adds YAS 'CommentModeratorsEmail', where an email (template code COMMENT_CREATED) is sent when a borrower creates/modifies an comment/review. The syspref is empty by default and no email is sent when the syspref is empty. This feature is needed because we want to alert our content moderators to take action when needed. Usually it is our librarians who write reviews and this improvement makes the process of moving Koha reviews to our CMS more smooth. TEST SETUP: -1. Run updatedatabase.pl to add the syspref and the new letter template. 0. Go to admin/preferences.pl?tab=opac, and set the 'CommentModeratorsEmail'-syspref to your email-address. TEST PLAN: 1. Log in to OPAC and find any Biblio. 2. Make a comment/review for it. 3. Check the koha.message_queue-table for any letter_code = 'COMMENT_CREATED'. You should see the reasonable default message. You can change the message in tools/letter.pl.
Created attachment 36522 [details] [review] Bug 1985 - tweak License and lots of cleanup In comment #11, it was mentioned that title and biblionumber from the biblio table were not available as variables in the letter. This corrects this by converting the parameter list to a hashref, and adding the missing biblio number. It also cleans up the license on C4/Review.pm to be in line with the current coding guidelines license. Also strict and warning have been changed to the 'Use Modern::Perl;' now. Additionally, <<reviews.reviewid>> is now usable in the letter, as is <<StaffBaseURL>>. These were required additions, because comment #1 expressly says there should be a direct link to approve or delete. I also included a review everything link, since there could be multiple comments outstanding. The default letter was tweaked as well to reflect these changes. TEST PLAN --------- 1) Create test branch and apply patch 2) run installer/data/mysql/updatedatabase.pl -- this will add the required default letter. 3) In the staff client: a) set the CommentModeratorsEmail system preference. -- not setting it will mean you won't get any queued letters. b) modify the COMMENT_CREATED default letter as desired. -- feel free to add other things. 4) In the OPAC: a) Log in b) Find something c) Click on the 'Comments' tab -- Holdings/Title notes/Comments (#) is at the bottom d) Click 'Post or edit your comments on this item' e) In the window that pops up, type your comment. f) Click 'Submit and close this window'. g) Click 'Edit' and repeat steps e and f again. 5) In a mysql client: a) Open the koha database b) SELECT * FROM message_queue WHERE letter_code='COMMENT_CREATED'; -- There should be at least two. -- They should be able to contain the borrower number, biblio title, and other borrower and biblio related things. -- Comments are at a biblio level, so items, and issues don't make sense as variables for the letter. 6) prove -v t/db_dependent/Review.t 7) Run the koha qa test tool.
Ignore comments #10 and #17. My second commit covers all that. :)
I have just tested it. Everything is fine except that <<staffClientBaseURL>> isn't filled in the email : ... BEGIN COMMENT --- A lire absolument --- END COMMENT --- To approve: http:///cgi-bin/koha/review/reviewswaiting.pl?op=approve&reviewid=10 To delete: http:///cgi-bin/koha/review/reviewswaiting.pl?op=delete&reviewid=10 Or to review all comments: http:///cgi-bin/koha/review/reviewswaiting.pl Check it out! Your library.
(In reply to Koha Team Lyon 3 from comment #21) > I have just tested it. Everything is fine except that <<staffClientBaseURL>> > isn't filled in the email : > ... > BEGIN COMMENT --- A lire absolument --- END COMMENT --- To approve: > http:///cgi-bin/koha/review/reviewswaiting.pl?op=approve&reviewid=10 To > delete: http:///cgi-bin/koha/review/reviewswaiting.pl?op=delete&reviewid=10 > Or to review all comments: http:///cgi-bin/koha/review/reviewswaiting.pl > Check it out! Your library. Not to ask the obvious question, but did you set staffClientBaseURL?
Created attachment 36613 [details] [review] [SIGNED OFF] Bug 1985 - Email notification of new OPAC comments This feature adds YAS 'CommentModeratorsEmail', where an email (template code COMMENT_CREATED) is sent when a borrower creates/modifies an comment/review. The syspref is empty by default and no email is sent when the syspref is empty. This feature is needed because we want to alert our content moderators to take action when needed. Usually it is our librarians who write reviews and this improvement makes the process of moving Koha reviews to our CMS more smooth. TEST SETUP: -1. Run updatedatabase.pl to add the syspref and the new letter template. 0. Go to admin/preferences.pl?tab=opac, and set the 'CommentModeratorsEmail'-syspref to your email-address. TEST PLAN: 1. Log in to OPAC and find any Biblio. 2. Make a comment/review for it. 3. Check the koha.message_queue-table for any letter_code = 'COMMENT_CREATED'. You should see the reasonable default message. You can change the message in tools/letter.pl. NOTE: Tested in conjunction with my patch. However, this piece alone: - lacked unit tests since it modified C4/Review.pm - failed to provide the desired links in the email message, as mentioned in comment #1. - failed to pass biblionumber information for use in the letter as mentioned in comment #11. - passed $review, when it was really id that should have been passed and used to implement the inclusion of reviews.reviewid and other reviews table fields. Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Created attachment 36614 [details] [review] Bug 1985 - tweak License and lots of cleanup In comment #11, it was mentioned that title and biblionumber from the biblio table were not available as variables in the letter. This corrects this by converting the parameter list to a hashref, and adding the missing biblio number. It also cleans up the license on C4/Review.pm to be in line with the current coding guidelines license. Also strict and warning have been changed to the 'Use Modern::Perl;' now. Additionally, <<reviews.reviewid>> is now usable in the letter, as is <<staffClientBaseURL>>. These were required additions, because comment #1 expressly says there should be a direct link to approve or delete. I also included a review everything link, since there could be multiple comments outstanding. The default letter was tweaked as well to reflect these changes. TEST PLAN --------- 1) Create test branch and apply patch 2) run installer/data/mysql/updatedatabase.pl -- this will add the required default letter. 3) In the staff client: a) set the CommentModeratorsEmail system preference. -- not setting it will mean you won't get any queued letters. a) set the staffClientBaseURL system preference. -- not setting it will mean your email links won't be valid (i.e http:///...). b) modify the COMMENT_CREATED default letter as desired. -- feel free to add other things. 4) In the OPAC: a) Log in b) Find something c) Click on the 'Comments' tab -- Holdings/Title notes/Comments (#) is at the bottom d) Click 'Post or edit your comments on this item' e) In the window that pops up, type your comment. f) Click 'Submit and close this window'. g) Click 'Edit' and repeat steps e and f again. 5) In a mysql client: a) Open the koha database b) SELECT * FROM message_queue WHERE letter_code='COMMENT_CREATED'; -- There should be at least two. -- They should be able to contain the borrower number, biblio title, and other borrower and biblio related things. -- Comments are at a biblio level, so items, and issues don't make sense as variables for the letter. 6) prove -v t/db_dependent/Review.t 7) Run the koha qa test tool. NOTE: Improved the test plan to make staffClientBaseURL obvious. Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Yes, you're right :-) I forgot to set the staffClientBaseURL syspref ... I'll test one more time
Tested on a sandbox : - go to OPAC to add a comment without filling the syspref CommentModeratorsEmail : nothing is added in message_queue table : OK - set syspref CommentModeratorsEmail with my email adress and set the syspref staffClientBaseURL - add a comment on OPAC - try SELECT * FROM message_queue WHERE letter_code='COMMENT_CREATED'; I have a new record : OK - reedit the comment on the OPAC - try the SQL request : 2 records : Ok - go to notices and slips : try to change the model - go to the OPAC : add a new comment - retry the SQL reequest : I have a new record with the change I made in the model : OK It works as it is described in the test plan but I have a remarks in the url to manage the comments : in the model, it's : http://<<staffClientBaseURL>>/cgi-bin/koha/review/reviewswaiting.pl? but the right URL is http://<<staffClientBaseURL>>/cgi-bin/koha/reviewS/reviewswaiting.pl? (there's a S and the end of review)
Created attachment 36628 [details] [review] Bug 1985 - Email notification of new OPAC comments This feature adds YAS 'CommentModeratorsEmail', where an email (template code COMMENT_CREATED) is sent when a borrower creates/modifies an comment/review. The syspref is empty by default and no email is sent when the syspref is empty. This feature is needed because we want to alert our content moderators to take action when needed. Usually it is our librarians who write reviews and this improvement makes the process of moving Koha reviews to our CMS more smooth. TEST SETUP: -1. Run updatedatabase.pl to add the syspref and the new letter template. 0. Go to admin/preferences.pl?tab=opac, and set the 'CommentModeratorsEmail'-syspref to your email-address. TEST PLAN: 1. Log in to OPAC and find any Biblio. 2. Make a comment/review for it. 3. Check the koha.message_queue-table for any letter_code = 'COMMENT_CREATED'. You should see the reasonable default message. You can change the message in tools/letter.pl. NOTE: Tested in conjunction with my patch. However, this piece alone: - lacked unit tests since it modified C4/Review.pm - failed to provide the desired links in the email message, as mentioned in comment #1. - failed to pass biblionumber information for use in the letter as mentioned in comment #11. - passed $review, when it was really id that should have been passed and used to implement the inclusion of reviews.reviewid and other reviews table fields. Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Created attachment 36629 [details] [review] Bug 1985 - tweak License and lots of cleanup In comment #11, it was mentioned that title and biblionumber from the biblio table were not available as variables in the letter. This corrects this by converting the parameter list to a hashref, and adding the missing biblio number. It also cleans up the license on C4/Review.pm to be in line with the current coding guidelines license. Also strict and warning have been changed to the 'Use Modern::Perl;' now. Additionally, <<reviews.reviewid>> is now usable in the letter, as is <<staffClientBaseURL>>. These were required additions, because comment #1 expressly says there should be a direct link to approve or delete. I also included a review everything link, since there could be multiple comments outstanding. The default letter was tweaked as well to reflect these changes. Fixed bad URLs as noted in comment #26. TEST PLAN --------- 1) Create test branch and apply patch 2) run installer/data/mysql/updatedatabase.pl -- this will add the required default letter. 3) In the staff client: a) set the CommentModeratorsEmail system preference. -- not setting it will mean you won't get any queued letters. a) set the staffClientBaseURL system preference. -- not setting it will mean your email links won't be valid (i.e http:///...). b) modify the COMMENT_CREATED default letter as desired. -- feel free to add other things. 4) In the OPAC: a) Log in b) Find something c) Click on the 'Comments' tab -- Holdings/Title notes/Comments (#) is at the bottom d) Click 'Post or edit your comments on this item' e) In the window that pops up, type your comment. f) Click 'Submit and close this window'. g) Click 'Edit' and repeat steps e and f again. 5) In a mysql client: a) Open the koha database b) SELECT * FROM message_queue WHERE letter_code='COMMENT_CREATED'; -- There should be at least two. -- They should be able to contain the borrower number, biblio title, and other borrower and biblio related things. -- Comments are at a biblio level, so items, and issues don't make sense as variables for the letter. -- Confirm the URLs are valid by pasting into a browser. 6) prove -v t/db_dependent/Review.t 7) Run the koha qa test tool. Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Patch tested with a sandbox, by sonia bouis <sonia.bouis@univ-lyon3.fr>
Created attachment 36643 [details] [review] Bug 13635: Unimarc - On editing a notice, the title should be displayed The title method of MARC::Record does not deal with UNIMARC, it should not be called if the marc flavour is UNIMARC. Test plan: On an unimarc installation, edit a notice, with this patch you should see "Editing TITLE (Record number BIBLIONUMBER)" Without, the title was not displayed. Same in the breadcrumbs. Bug 13635: Remove another useless call There is another call to the title method in additem.pl without any check on the marc flavour. But here the title variable sent to the template is redefined 3 lines later. So it can be simply removed. Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Tested on UNIMARC install, editing a 'record' (not notice) does not show title on breadcrumbs, status bar or page title. With patch it does! No koha-qa errors. Signed-off-by: joel aloi <aloi54@live.fr> Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com> Signed-off-by: sonia bouis <sonia.bouis@univ-lyon3.fr>
Created attachment 36644 [details] [review] Bug 1985 - Email notification of new OPAC comments This feature adds YAS 'CommentModeratorsEmail', where an email (template code COMMENT_CREATED) is sent when a borrower creates/modifies an comment/review. The syspref is empty by default and no email is sent when the syspref is empty. This feature is needed because we want to alert our content moderators to take action when needed. Usually it is our librarians who write reviews and this improvement makes the process of moving Koha reviews to our CMS more smooth. TEST SETUP: -1. Run updatedatabase.pl to add the syspref and the new letter template. 0. Go to admin/preferences.pl?tab=opac, and set the 'CommentModeratorsEmail'-syspref to your email-address. TEST PLAN: 1. Log in to OPAC and find any Biblio. 2. Make a comment/review for it. 3. Check the koha.message_queue-table for any letter_code = 'COMMENT_CREATED'. You should see the reasonable default message. You can change the message in tools/letter.pl. NOTE: Tested in conjunction with my patch. However, this piece alone: - lacked unit tests since it modified C4/Review.pm - failed to provide the desired links in the email message, as mentioned in comment #1. - failed to pass biblionumber information for use in the letter as mentioned in comment #11. - passed $review, when it was really id that should have been passed and used to implement the inclusion of reviews.reviewid and other reviews table fields. Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: sonia bouis <sonia.bouis@univ-lyon3.fr>
Created attachment 36645 [details] [review] Bug 1985 - tweak License and lots of cleanup In comment #11, it was mentioned that title and biblionumber from the biblio table were not available as variables in the letter. This corrects this by converting the parameter list to a hashref, and adding the missing biblio number. It also cleans up the license on C4/Review.pm to be in line with the current coding guidelines license. Also strict and warning have been changed to the 'Use Modern::Perl;' now. Additionally, <<reviews.reviewid>> is now usable in the letter, as is <<staffClientBaseURL>>. These were required additions, because comment #1 expressly says there should be a direct link to approve or delete. I also included a review everything link, since there could be multiple comments outstanding. The default letter was tweaked as well to reflect these changes. Fixed bad URLs as noted in comment #26. TEST PLAN --------- 1) Create test branch and apply patch 2) run installer/data/mysql/updatedatabase.pl -- this will add the required default letter. 3) In the staff client: a) set the CommentModeratorsEmail system preference. -- not setting it will mean you won't get any queued letters. a) set the staffClientBaseURL system preference. -- not setting it will mean your email links won't be valid (i.e http:///...). b) modify the COMMENT_CREATED default letter as desired. -- feel free to add other things. 4) In the OPAC: a) Log in b) Find something c) Click on the 'Comments' tab -- Holdings/Title notes/Comments (#) is at the bottom d) Click 'Post or edit your comments on this item' e) In the window that pops up, type your comment. f) Click 'Submit and close this window'. g) Click 'Edit' and repeat steps e and f again. 5) In a mysql client: a) Open the koha database b) SELECT * FROM message_queue WHERE letter_code='COMMENT_CREATED'; -- There should be at least two. -- They should be able to contain the borrower number, biblio title, and other borrower and biblio related things. -- Comments are at a biblio level, so items, and issues don't make sense as variables for the letter. -- Confirm the URLs are valid by pasting into a browser. 6) prove -v t/db_dependent/Review.t 7) Run the koha qa test tool. Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: sonia bouis <sonia.bouis@univ-lyon3.fr>
I've done again all the tests (until point 6 but I think point 6 and 7 can be done at the QA step ?) Everything works correctly
Created attachment 36677 [details] [review] [PASSED-QA] Bug 1985 - Email notification of new OPAC comments This feature adds YAS 'CommentModeratorsEmail', where an email (template code COMMENT_CREATED) is sent when a borrower creates/modifies an comment/review. The syspref is empty by default and no email is sent when the syspref is empty. This feature is needed because we want to alert our content moderators to take action when needed. Usually it is our librarians who write reviews and this improvement makes the process of moving Koha reviews to our CMS more smooth. TEST SETUP: -1. Run updatedatabase.pl to add the syspref and the new letter template. 0. Go to admin/preferences.pl?tab=opac, and set the 'CommentModeratorsEmail'-syspref to your email-address. TEST PLAN: 1. Log in to OPAC and find any Biblio. 2. Make a comment/review for it. 3. Check the koha.message_queue-table for any letter_code = 'COMMENT_CREATED'. You should see the reasonable default message. You can change the message in tools/letter.pl. NOTE: Tested in conjunction with my patch. However, this piece alone: - lacked unit tests since it modified C4/Review.pm - failed to provide the desired links in the email message, as mentioned in comment #1. - failed to pass biblionumber information for use in the letter as mentioned in comment #11. - passed $review, when it was really id that should have been passed and used to implement the inclusion of reviews.reviewid and other reviews table fields. Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: sonia bouis <sonia.bouis@univ-lyon3.fr> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Created attachment 36678 [details] [review] [PASSED-QA] Bug 1985 - tweak License and lots of cleanup In comment #11, it was mentioned that title and biblionumber from the biblio table were not available as variables in the letter. This corrects this by converting the parameter list to a hashref, and adding the missing biblio number. It also cleans up the license on C4/Review.pm to be in line with the current coding guidelines license. Also strict and warning have been changed to the 'Use Modern::Perl;' now. Additionally, <<reviews.reviewid>> is now usable in the letter, as is <<staffClientBaseURL>>. These were required additions, because comment #1 expressly says there should be a direct link to approve or delete. I also included a review everything link, since there could be multiple comments outstanding. The default letter was tweaked as well to reflect these changes. Fixed bad URLs as noted in comment #26. TEST PLAN --------- 1) Create test branch and apply patch 2) run installer/data/mysql/updatedatabase.pl -- this will add the required default letter. 3) In the staff client: a) set the CommentModeratorsEmail system preference. -- not setting it will mean you won't get any queued letters. a) set the staffClientBaseURL system preference. -- not setting it will mean your email links won't be valid (i.e http:///...). b) modify the COMMENT_CREATED default letter as desired. -- feel free to add other things. 4) In the OPAC: a) Log in b) Find something c) Click on the 'Comments' tab -- Holdings/Title notes/Comments (#) is at the bottom d) Click 'Post or edit your comments on this item' e) In the window that pops up, type your comment. f) Click 'Submit and close this window'. g) Click 'Edit' and repeat steps e and f again. 5) In a mysql client: a) Open the koha database b) SELECT * FROM message_queue WHERE letter_code='COMMENT_CREATED'; -- There should be at least two. -- They should be able to contain the borrower number, biblio title, and other borrower and biblio related things. -- Comments are at a biblio level, so items, and issues don't make sense as variables for the letter. -- Confirm the URLs are valid by pasting into a browser. 6) prove -v t/db_dependent/Review.t 7) Run the koha qa test tool. Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: sonia bouis <sonia.bouis@univ-lyon3.fr> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
One more addition is required for this to pass qa. Can you please add the new notice to all the translations?
ARG! Kyle, did you have to make me notice another bug? :P I'm cleaning it up (bug 13808). In the mean time, I'll just add this notice into every language as a separate patch.
Created attachment 36720 [details] [review] Bug 1985 - Follow up: Add sample letter to other languages As per comment #36, the letter COMMENT_CREATED has been added to the other languages. TEST PLAN --------- 0) Back up your letters table 1) In your mysql client after selected your Koha database, Run this: SET foreign_key_checks = 0; truncate letter; source installer/data/mysql/de-DE/mandatory/sample_notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; truncate letter; source installer/data/mysql/es-ES/mandatory/sample_notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; truncate letter; source installer/data/mysql/fr-FR/1-Obligatoire/sample_notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; truncate letter; source installer/data/mysql/it-IT/necessari/notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; truncate letter; source installer/data/mysql/nb-NO/1-Obligatorisk/sample_notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; truncate letter; source installer/data/mysql/pl-PL/mandatory/sample_notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; truncate letter; source installer/data/mysql/ru-RU/mandatory/sample_notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; truncate letter; source installer/data/mysql/uk-UA/mandatory/sample_notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; truncate letter; source installer/data/mysql/en/mandatory/sample_notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; -- there should be 9 counts of 1. 2) Restore your letters table.
Created attachment 38908 [details] [review] Bug 1985 - Email notification of new OPAC comments This feature adds YAS 'CommentModeratorsEmail', where an email (template code COMMENT_CREATED) is sent when a borrower creates/modifies an comment/review. The syspref is empty by default and no email is sent when the syspref is empty. This feature is needed because we want to alert our content moderators to take action when needed. Usually it is our librarians who write reviews and this improvement makes the process of moving Koha reviews to our CMS more smooth. TEST SETUP: -1. Run updatedatabase.pl to add the syspref and the new letter template. 0. Go to admin/preferences.pl?tab=opac, and set the 'CommentModeratorsEmail'-syspref to your email-address. TEST PLAN: 1. Log in to OPAC and find any Biblio. 2. Make a comment/review for it. 3. Check the koha.message_queue-table for any letter_code = 'COMMENT_CREATED'. You should see the reasonable default message. You can change the message in tools/letter.pl. NOTE: Tested in conjunction with my patch. However, this piece alone: - lacked unit tests since it modified C4/Review.pm - failed to provide the desired links in the email message, as mentioned in comment #1. - failed to pass biblionumber information for use in the letter as mentioned in comment #11. - passed $review, when it was really id that should have been passed and used to implement the inclusion of reviews.reviewid and other reviews table fields. Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: sonia bouis <sonia.bouis@univ-lyon3.fr> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Created attachment 38909 [details] [review] Bug 1985 - tweak License and lots of cleanup In comment #11, it was mentioned that title and biblionumber from the biblio table were not available as variables in the letter. This corrects this by converting the parameter list to a hashref, and adding the missing biblio number. It also cleans up the license on C4/Review.pm to be in line with the current coding guidelines license. Also strict and warning have been changed to the 'Use Modern::Perl;' now. Additionally, <<reviews.reviewid>> is now usable in the letter, as is <<staffClientBaseURL>>. These were required additions, because comment #1 expressly says there should be a direct link to approve or delete. I also included a review everything link, since there could be multiple comments outstanding. The default letter was tweaked as well to reflect these changes. Fixed bad URLs as noted in comment #26. TEST PLAN --------- 1) Create test branch and apply patch 2) run installer/data/mysql/updatedatabase.pl -- this will add the required default letter. 3) In the staff client: a) set the CommentModeratorsEmail system preference. -- not setting it will mean you won't get any queued letters. a) set the staffClientBaseURL system preference. -- not setting it will mean your email links won't be valid (i.e http:///...). b) modify the COMMENT_CREATED default letter as desired. -- feel free to add other things. 4) In the OPAC: a) Log in b) Find something c) Click on the 'Comments' tab -- Holdings/Title notes/Comments (#) is at the bottom d) Click 'Post or edit your comments on this item' e) In the window that pops up, type your comment. f) Click 'Submit and close this window'. g) Click 'Edit' and repeat steps e and f again. 5) In a mysql client: a) Open the koha database b) SELECT * FROM message_queue WHERE letter_code='COMMENT_CREATED'; -- There should be at least two. -- They should be able to contain the borrower number, biblio title, and other borrower and biblio related things. -- Comments are at a biblio level, so items, and issues don't make sense as variables for the letter. -- Confirm the URLs are valid by pasting into a browser. 6) prove -v t/db_dependent/Review.t 7) Run the koha qa test tool. Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: sonia bouis <sonia.bouis@univ-lyon3.fr> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Created attachment 38910 [details] [review] Bug 1985 - Follow up: Add sample letter to other languages As per comment #36, the letter COMMENT_CREATED has been added to the other languages. TEST PLAN --------- 0) Back up your letters table 1) In your mysql client after selected your Koha database, Run this: SET foreign_key_checks = 0; truncate letter; source installer/data/mysql/de-DE/mandatory/sample_notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; truncate letter; source installer/data/mysql/es-ES/mandatory/sample_notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; truncate letter; source installer/data/mysql/fr-FR/1-Obligatoire/sample_notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; truncate letter; source installer/data/mysql/it-IT/necessari/notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; truncate letter; source installer/data/mysql/nb-NO/1-Obligatorisk/sample_notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; truncate letter; source installer/data/mysql/pl-PL/mandatory/sample_notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; truncate letter; source installer/data/mysql/ru-RU/mandatory/sample_notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; truncate letter; source installer/data/mysql/uk-UA/mandatory/sample_notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; truncate letter; source installer/data/mysql/en/mandatory/sample_notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; -- there should be 9 counts of 1. 2) Restore your letters table.
This is a rebase. The last patch (Follow up: Add sample letter to other languages) is what addresses Kyle's comment #36. The first two patches have passed QA, the last one needs sign off. prove xt/sample_notices.t might be in order too. :) If there is a failure, check if bug 14119 has been applied, since I discovered a problem elsewhere. :)
Created attachment 39062 [details] [review] [SIGNED-OFF] Bug 1985: Follow up - Add sample letter to other languages As per comment #36, the letter COMMENT_CREATED has been added to the other languages. TEST PLAN --------- 0) Back up your letters table 1) In your mysql client after selected your Koha database, Run this: SET foreign_key_checks = 0; truncate letter; source installer/data/mysql/de-DE/mandatory/sample_notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; truncate letter; source installer/data/mysql/es-ES/mandatory/sample_notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; truncate letter; source installer/data/mysql/fr-FR/1-Obligatoire/sample_notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; truncate letter; source installer/data/mysql/it-IT/necessari/notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; truncate letter; source installer/data/mysql/nb-NO/1-Obligatorisk/sample_notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; truncate letter; source installer/data/mysql/pl-PL/mandatory/sample_notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; truncate letter; source installer/data/mysql/ru-RU/mandatory/sample_notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; truncate letter; source installer/data/mysql/uk-UA/mandatory/sample_notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; truncate letter; source installer/data/mysql/en/mandatory/sample_notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; -- there should be 9 counts of 1. 2) Restore your letters table. Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Sample letter in all languages No errors
Comment on attachment 38909 [details] [review] Bug 1985 - tweak License and lots of cleanup Review of attachment 38909 [details] [review]: ----------------------------------------------------------------- ::: t/db_dependent/Review.t @@ +21,5 @@ > +$biblionumber = $row->{'biblionumber'} if $row; > + > +SKIP: { > + skip "Missing borrowers or biblios",13 > + unless $biblionumber and $borrowernumber; You have to generate the data you want! Try TestBuilder, it will do that for you.
Comment on attachment 38908 [details] [review] Bug 1985 - Email notification of new OPAC comments Review of attachment 38908 [details] [review]: ----------------------------------------------------------------- ::: C4/Review.pm @@ +83,5 @@ > $sth->execute( $borrowernumber, $biblionumber, $review); > + > + unless ($sth->err()) { > + SendReviewAlert( $review, $borrowernumber ); > + } else ? What happen if an error occurs?
I'm setting this back to Olli-Antti Kivilahti, since I have no more time to follow up on this, and it was his initially.
We are migrating to a national OPAC (finna.fi) as we speak and OPAC stuff is no longer relevant for us! Thanks for signing off.
I'm close to a resurrection of this.
Created attachment 63746 [details] [review] Bug 1985: Fix whitespace in opac/opac-review.pl $ git diff -w origin/master -- should have no differences
Created attachment 63747 [details] [review] Bug 1985: Introduction of review alerts In comment #11, it was mentioned that title and biblionumber from the biblio table were not available as variables in the letter. This corrects this by converting the parameter list to a hashref, and adding the missing biblio number. It also cleans up the license on C4/Review.pm to be in line with the current coding guidelines license. Also strict and warning have been changed to the 'Use Modern::Perl;' now. Additionally, <<reviews.reviewid>> is now usable in the letter, as is <<staffClientBaseURL>>. These were required additions, because comment #1 expressly says there should be a direct link to approve or delete. I also included a review everything link, since there could be multiple comments outstanding. The default letter was tweaked as well to reflect these changes. Fixed bad URLs as noted in comment #26. TEST PLAN --------- 1) Create test branch and apply patch 2) run installer/data/mysql/updatedatabase.pl -- this will add the required default letter. 3) In the staff client: a) set the CommentModeratorsEmail system preference. -- not setting it will mean you won't get any queued letters. a) set the staffClientBaseURL system preference. -- not setting it will mean your email links won't be valid (i.e http:///...). b) modify the COMMENT_CREATED default letter as desired. -- feel free to add other things. 4) In the OPAC: a) Log in b) Find something c) Click on the 'Comments' tab -- Holdings/Title notes/Comments (#) is at the bottom d) Click 'Post or edit your comments on this item' e) In the window that pops up, type your comment. f) Click 'Submit and close this window'. g) Click 'Edit' and repeat steps e and f again. 5) In a mysql client: a) Open the koha database b) SELECT * FROM message_queue WHERE letter_code='COMMENT_CREATED'; -- There should be at least two. -- They should be able to contain the borrower number, biblio title, and other borrower and biblio related things. -- Comments are at a biblio level, so items, and issues don't make sense as variables for the letter. -- Confirm the URLs are valid by pasting into a browser. 6) prove -v t/db_dependent/Koha/Reviews.t -- six new tests should run. 7) Run the koha qa test tool.
Created attachment 63748 [details] [review] Bug 1985: Follow up - Add sample letter to other languages As per comment #36, the letter COMMENT_CREATED has been added to the other languages. TEST PLAN --------- 0) Back up your letters table 1) In your mysql client after selected your Koha database, Run this: SET foreign_key_checks = 0; truncate letter; source installer/data/mysql/de-DE/mandatory/sample_notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; truncate letter; source installer/data/mysql/es-ES/mandatory/sample_notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; truncate letter; source installer/data/mysql/fr-FR/1-Obligatoire/sample_notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; truncate letter; source installer/data/mysql/it-IT/necessari/notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; truncate letter; source installer/data/mysql/nb-NO/1-Obligatorisk/sample_notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; truncate letter; source installer/data/mysql/pl-PL/mandatory/sample_notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; truncate letter; source installer/data/mysql/ru-RU/mandatory/sample_notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; truncate letter; source installer/data/mysql/uk-UA/mandatory/sample_notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; truncate letter; source installer/data/mysql/en/mandatory/sample_notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; -- there should be 9 counts of 1. 2) Restore your letters table.
Created attachment 63749 [details] [review] Bug 1985: perlcritic After the patch is applied: Code is not tidy at line 1, column 1. See page 33 of PBP. (Severity: 1) Main code has high complexity score (27) at line 1, column 1. Consider refactoring. (Severity: 3) No package-scoped "$VERSION" variable found at line 1, column 1. See page 404 of PBP. (Severity: 2) Regular expression without "/s" flag at line 77, column 30. See pages 240,241 of PBP. (Severity: 2) Regular expression without "/m" flag at line 77, column 30. See page 237 of PBP. (Severity: 2)
Created attachment 63750 [details] [review] Bug 1985: perltidy opac/opac-review.pl
Created attachment 63751 [details] [review] Bug 1985: perlcritic
Created attachment 63752 [details] [review] Bug 1985: perltidy Koha/Review.pm
If you apply everything and run the test plans in comment #50 and comment #51, then it should suffice.
(In reply to M. Tompsett from comment #56) > If you apply everything and run the test plans in comment #50 and comment > #51, then it should suffice. Generally running perlcritic -1 {file}, and ignoring some things, with the default perlcritic. This puts the code at a higher perlcritic level than just -5 as used by the koha qa test tools.
(In reply to M. Tompsett from comment #57) > (In reply to M. Tompsett from comment #56) > > If you apply everything and run the test plans in comment #50 and comment > > #51, then it should suffice. > > Generally running perlcritic -1 {file}, and ignoring some things, with the > default perlcritic. This puts the code at a higher perlcritic level than > just -5 as used by the koha qa test tools. We are not following perlcritic -1, this patch is out of the scope of this bug report.
(In reply to Jonathan Druart from comment #58) > We are not following perlcritic -1, this patch is out of the scope of this > bug report. While you are correct about scope creep for the last 4 patches, I do believe the first 3 are fine and should not creep it as far as I recall.
Comment on attachment 63749 [details] [review] Bug 1985: perlcritic Obsoleting because beyond enhancement scope, so as to not distract people who might sign off.
Comment on attachment 63750 [details] [review] Bug 1985: perltidy opac/opac-review.pl Obsoleting because beyond enhancement scope, so as to not distract people who might sign off.
Comment on attachment 63751 [details] [review] Bug 1985: perlcritic Obsoleting because beyond enhancement scope, so as to not distract people who might sign off.
Comment on attachment 63752 [details] [review] Bug 1985: perltidy Koha/Review.pm Obsoleting because beyond enhancement scope, so as to not distract people who might sign off.
Tested all patches together, followed test plan from comment #50, works as expected. Will sign off.
Created attachment 63761 [details] [review] Bug 1985: Fix whitespace in opac/opac-review.pl $ git diff -w origin/master -- should have no differences Signed-off-by: Marc Véron <veron@veron.ch>
Created attachment 63762 [details] [review] Bug 1985: Introduction of review alerts In comment #11, it was mentioned that title and biblionumber from the biblio table were not available as variables in the letter. This corrects this by converting the parameter list to a hashref, and adding the missing biblio number. It also cleans up the license on C4/Review.pm to be in line with the current coding guidelines license. Also strict and warning have been changed to the 'Use Modern::Perl;' now. Additionally, <<reviews.reviewid>> is now usable in the letter, as is <<staffClientBaseURL>>. These were required additions, because comment #1 expressly says there should be a direct link to approve or delete. I also included a review everything link, since there could be multiple comments outstanding. The default letter was tweaked as well to reflect these changes. Fixed bad URLs as noted in comment #26. TEST PLAN --------- 1) Create test branch and apply patch 2) run installer/data/mysql/updatedatabase.pl -- this will add the required default letter. 3) In the staff client: a) set the CommentModeratorsEmail system preference. -- not setting it will mean you won't get any queued letters. a) set the staffClientBaseURL system preference. -- not setting it will mean your email links won't be valid (i.e http:///...). b) modify the COMMENT_CREATED default letter as desired. -- feel free to add other things. 4) In the OPAC: a) Log in b) Find something c) Click on the 'Comments' tab -- Holdings/Title notes/Comments (#) is at the bottom d) Click 'Post or edit your comments on this item' e) In the window that pops up, type your comment. f) Click 'Submit and close this window'. g) Click 'Edit' and repeat steps e and f again. 5) In a mysql client: a) Open the koha database b) SELECT * FROM message_queue WHERE letter_code='COMMENT_CREATED'; -- There should be at least two. -- They should be able to contain the borrower number, biblio title, and other borrower and biblio related things. -- Comments are at a biblio level, so items, and issues don't make sense as variables for the letter. -- Confirm the URLs are valid by pasting into a browser. 6) prove -v t/db_dependent/Koha/Reviews.t -- six new tests should run. 7) Run the koha qa test tool. Signed-off-by: Marc Véron <veron@veron.ch>
Created attachment 63763 [details] [review] Bug 1985: Follow up - Add sample letter to other languages As per comment #36, the letter COMMENT_CREATED has been added to the other languages. TEST PLAN --------- 0) Back up your letters table 1) In your mysql client after selected your Koha database, Run this: SET foreign_key_checks = 0; truncate letter; source installer/data/mysql/de-DE/mandatory/sample_notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; truncate letter; source installer/data/mysql/es-ES/mandatory/sample_notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; truncate letter; source installer/data/mysql/fr-FR/1-Obligatoire/sample_notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; truncate letter; source installer/data/mysql/it-IT/necessari/notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; truncate letter; source installer/data/mysql/nb-NO/1-Obligatorisk/sample_notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; truncate letter; source installer/data/mysql/pl-PL/mandatory/sample_notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; truncate letter; source installer/data/mysql/ru-RU/mandatory/sample_notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; truncate letter; source installer/data/mysql/uk-UA/mandatory/sample_notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; truncate letter; source installer/data/mysql/en/mandatory/sample_notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; -- there should be 9 counts of 1. 2) Restore your letters table. Signed-off-by: Marc Véron <veron@veron.ch>
Created attachment 74760 [details] [review] Bug 1985: Fix whitespace in opac/opac-review.pl $ git diff -w origin/master -- should have no differences Signed-off-by: Marc Véron <veron@veron.ch>
Created attachment 74761 [details] [review] Bug 1985: Send email alert when comment posted. In comment #11, it was mentioned that title and biblionumber from the biblio table were not available as variables in the letter. This corrects this by converting the parameter list to a hashref, and adding the missing biblio number. It also cleans up the license on C4/Review.pm to be in line with the current coding guidelines license. Also strict and warning have been changed to the 'Use Modern::Perl;' now. Additionally, <<reviews.reviewid>> is now usable in the letter, as is <<staffClientBaseURL>>. These were required additions, because comment #1 expressly says there should be a direct link to approve or delete. I also included a review everything link, since there could be multiple comments outstanding. The default letter was tweaked as well to reflect these changes. Fixed bad URLs as noted in comment #26. TEST PLAN --------- 1) Create test branch and apply patch 2) run installer/data/mysql/updatedatabase.pl -- this will add the required default letter. 3) In the staff client: a) set the CommentModeratorsEmail system preference. -- not setting it will mean you won't get any queued letters. a) set the staffClientBaseURL system preference. -- not setting it will mean your email links won't be valid (i.e http:///...). b) modify the COMMENT_CREATED default letter as desired. -- feel free to add other things. 4) In the OPAC: a) Log in b) Find something c) Click on the 'Comments' tab -- Holdings/Title notes/Comments (#) is at the bottom d) Click 'Post or edit your comments on this item' e) In the window that pops up, type your comment. f) Click 'Submit and close this window'. g) Click 'Edit' and repeat steps e and f again. 5) In a mysql client: a) Open the koha database b) SELECT * FROM message_queue WHERE letter_code='COMMENT_CREATED'; -- There should be at least two. -- They should be able to contain the borrower number, biblio title, and other borrower and biblio related things. -- Comments are at a biblio level, so items, and issues don't make sense as variables for the letter. -- Confirm the URLs are valid by pasting into a browser. 6) prove -v t/db_dependent/Koha/Reviews.t -- six new tests should run. 7) Run the koha qa test tool.
Created attachment 74762 [details] [review] Bug 1985: Follow up - Add sample letter to other languages As per comment #36, the letter COMMENT_CREATED has been added to the other languages. TEST PLAN --------- 0) Back up your letters table 1) In your mysql client after selected your Koha database, Run this: SET foreign_key_checks = 0; truncate letter; source installer/data/mysql/de-DE/mandatory/sample_notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; truncate letter; source installer/data/mysql/es-ES/mandatory/sample_notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; truncate letter; source installer/data/mysql/fr-FR/1-Obligatoire/sample_notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; truncate letter; source installer/data/mysql/it-IT/necessari/notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; truncate letter; source installer/data/mysql/nb-NO/1-Obligatorisk/sample_notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; truncate letter; source installer/data/mysql/pl-PL/mandatory/sample_notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; truncate letter; source installer/data/mysql/ru-RU/mandatory/sample_notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; truncate letter; source installer/data/mysql/uk-UA/mandatory/sample_notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; truncate letter; source installer/data/mysql/en/mandatory/sample_notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; -- there should be 9 counts of 1. 2) Restore your letters table. Signed-off-by: Marc Véron <veron@veron.ch>
Created attachment 74763 [details] [review] Bug 1985: Send email alert when comment posted. In comment #11, it was mentioned that title and biblionumber from the biblio table were not available as variables in the letter. This corrects this by converting the parameter list to a hashref, and adding the missing biblio number. It also cleans up the license on C4/Review.pm to be in line with the current coding guidelines license. Also strict and warning have been changed to the 'Use Modern::Perl;' now. Additionally, <<reviews.reviewid>> is now usable in the letter, as is <<staffClientBaseURL>>. These were required additions, because comment #1 expressly says there should be a direct link to approve or delete. I also included a review everything link, since there could be multiple comments outstanding. The default letter was tweaked as well to reflect these changes. Fixed bad URLs as noted in comment #26. TEST PLAN --------- 1) Create test branch and apply patch 2) run installer/data/mysql/updatedatabase.pl -- this will add the required default letter. 3) In the staff client: a) set the CommentModeratorsEmail system preference. -- not setting it will mean you won't get any queued letters. a) set the staffClientBaseURL system preference. -- not setting it will mean your email links won't be valid (i.e http:///...). b) modify the COMMENT_CREATED default letter as desired. -- feel free to add other things. 4) In the OPAC: a) Log in b) Find something c) Click on the 'Comments' tab -- Holdings/Title notes/Comments (#) is at the bottom d) Click 'Post or edit your comments on this item' e) In the window that pops up, type your comment. f) Click 'Submit and close this window'. g) Click 'Edit' and repeat steps e and f again. 5) In a mysql client: a) Open the koha database b) SELECT * FROM message_queue WHERE letter_code='COMMENT_CREATED'; -- There should be at least two. -- They should be able to contain the borrower number, biblio title, and other borrower and biblio related things. -- Comments are at a biblio level, so items, and issues don't make sense as variables for the letter. -- Confirm the URLs are valid by pasting into a browser. 6) prove -v t/db_dependent/Koha/Reviews.t -- six new tests should run. 7) Run the koha qa test tool.
Created attachment 74764 [details] [review] Bug 1985: Follow up - Add sample letter to other languages As per comment #36, the letter COMMENT_CREATED has been added to the other languages. TEST PLAN --------- 0) Back up your letters table 1) In your mysql client after selected your Koha database, Run this: SET foreign_key_checks = 0; truncate letter; source installer/data/mysql/de-DE/mandatory/sample_notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; truncate letter; source installer/data/mysql/es-ES/mandatory/sample_notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; truncate letter; source installer/data/mysql/fr-FR/1-Obligatoire/sample_notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; truncate letter; source installer/data/mysql/it-IT/necessari/notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; truncate letter; source installer/data/mysql/nb-NO/1-Obligatorisk/sample_notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; truncate letter; source installer/data/mysql/pl-PL/mandatory/sample_notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; truncate letter; source installer/data/mysql/ru-RU/mandatory/sample_notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; truncate letter; source installer/data/mysql/uk-UA/mandatory/sample_notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; truncate letter; source installer/data/mysql/en/mandatory/sample_notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; -- there should be 9 counts of 1. 2) Restore your letters table. Signed-off-by: Marc Véron <veron@veron.ch>
Created attachment 74769 [details] [review] Bug 1985: Fix whitespace in opac/opac-review.pl $ git diff -w origin/master -- should have no differences Signed-off-by: Marc Véron <veron@veron.ch>
Created attachment 74770 [details] [review] Bug 1985: Send email alert when comment posted. Many blog systems have a feature where the admin gets an email when someone posts a new comment that needs to be moderated. It would be nice to incorporate this into Koha. Ideally, you could set an email address in system preferences where notifications should be sent (since the Koha administrator is probably not the one approving comments). The body of the email would contain the comments, and offer a direct link to approve or delete the comment. The authorship was corrected to Olli-Antti Kivilahti. In comment #11, it was mentioned that title and biblionumber from the biblio table were not available as variables in the letter. This corrects this by converting the parameter list to a hashref, and adding the missing biblio number. It also cleans up the license on C4/Review.pm to be in line with the current coding guidelines license. Also strict and warning have been changed to the 'Use Modern::Perl;' now. Additionally, <<reviews.reviewid>> is now usable in the letter, as is <<staffClientBaseURL>>. These were required additions, because comment #1 expressly says there should be a direct link to approve or delete. I also included a review everything link, since there could be multiple comments outstanding. The default letter was tweaked as well to reflect these changes. Fixed bad URLs as noted in comment #26. TEST PLAN --------- 1) Create test branch and apply patch 2) run installer/data/mysql/updatedatabase.pl -- this will add the required default letter. 3) In the staff client: a) set the CommentModeratorsEmail system preference. -- not setting it will mean you won't get any queued letters. a) set the staffClientBaseURL system preference. -- not setting it will mean your email links won't be valid (i.e http:///...). b) modify the COMMENT_CREATED default letter as desired. -- feel free to add other things. 4) In the OPAC: a) Log in b) Find something c) Click on the 'Comments' tab -- Holdings/Title notes/Comments (#) is at the bottom d) Click 'Post or edit your comments on this item' e) In the window that pops up, type your comment. f) Click 'Submit and close this window'. g) Click 'Edit' and repeat steps e and f again. 5) In a mysql client: a) Open the koha database b) SELECT * FROM message_queue WHERE letter_code='COMMENT_CREATED'; -- There should be at least two. -- They should be able to contain the borrower number, biblio title, and other borrower and biblio related things. -- Comments are at a biblio level, so items, and issues don't make sense as variables for the letter. -- Confirm the URLs are valid by pasting into a browser. 6) prove -v t/db_dependent/Koha/Reviews.t -- six new tests should run. 7) Run the koha qa test tool.
Created attachment 74771 [details] [review] Bug 1985: Follow up - Add sample letter to other languages As per comment #36, the letter COMMENT_CREATED has been added to the other languages. TEST PLAN --------- 0) Back up your letters table 1) In your mysql client after selected your Koha database, Run this: SET foreign_key_checks = 0; truncate letter; source installer/data/mysql/de-DE/mandatory/sample_notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; truncate letter; source installer/data/mysql/es-ES/mandatory/sample_notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; truncate letter; source installer/data/mysql/fr-FR/1-Obligatoire/sample_notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; truncate letter; source installer/data/mysql/it-IT/necessari/notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; truncate letter; source installer/data/mysql/nb-NO/1-Obligatorisk/sample_notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; truncate letter; source installer/data/mysql/pl-PL/mandatory/sample_notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; truncate letter; source installer/data/mysql/ru-RU/mandatory/sample_notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; truncate letter; source installer/data/mysql/uk-UA/mandatory/sample_notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; truncate letter; source installer/data/mysql/en/mandatory/sample_notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; -- there should be 9 counts of 1. 2) Restore your letters table. Left signed off, even though uk-UA was rebased. Signed-off-by: Marc Véron <veron@veron.ch>
The middle patch was rebased by manual entry, hence the "Needs Signoff". The first patch was untouched, and the last only needed a minor tweak to rebased properly.
Patch no longer applies, sorry.
Created attachment 91190 [details] [review] Bug 1985: Fix whitespace in opac/opac-review.pl $ git diff -w origin/master -- should have no differences Signed-off-by: Marc Véron <veron@veron.ch>
Created attachment 91191 [details] [review] Bug 1985: Send email alert when comment posted. Many blog systems have a feature where the admin gets an email when someone posts a new comment that needs to be moderated. It would be nice to incorporate this into Koha. Ideally, you could set an email address in system preferences where notifications should be sent (since the Koha administrator is probably not the one approving comments). The body of the email would contain the comments, and offer a direct link to approve or delete the comment. The authorship was corrected to Olli-Antti Kivilahti. In comment #11, it was mentioned that title and biblionumber from the biblio table were not available as variables in the letter. This corrects this by converting the parameter list to a hashref, and adding the missing biblio number. It also cleans up the license on C4/Review.pm to be in line with the current coding guidelines license. Also strict and warning have been changed to the 'Use Modern::Perl;' now. Additionally, <<reviews.reviewid>> is now usable in the letter, as is <<staffClientBaseURL>>. These were required additions, because comment #1 expressly says there should be a direct link to approve or delete. I also included a review everything link, since there could be multiple comments outstanding. The default letter was tweaked as well to reflect these changes. Fixed bad URLs as noted in comment #26. TEST PLAN --------- 1) Create test branch and apply patch 2) run installer/data/mysql/updatedatabase.pl -- this will add the required default letter. 3) In the staff client: a) set the CommentModeratorsEmail system preference. -- not setting it will mean you won't get any queued letters. a) set the staffClientBaseURL system preference. -- not setting it will mean your email links won't be valid (i.e http:///...). b) modify the COMMENT_CREATED default letter as desired. -- feel free to add other things. 4) In the OPAC: a) Log in b) Find something c) Click on the 'Comments' tab -- Holdings/Title notes/Comments (#) is at the bottom d) Click 'Post or edit your comments on this item' e) In the window that pops up, type your comment. f) Click 'Submit and close this window'. g) Click 'Edit' and repeat steps e and f again. 5) In a mysql client: a) Open the koha database b) SELECT * FROM message_queue WHERE letter_code='COMMENT_CREATED'; -- There should be at least two. -- They should be able to contain the borrower number, biblio title, and other borrower and biblio related things. -- Comments are at a biblio level, so items, and issues don't make sense as variables for the letter. -- Confirm the URLs are valid by pasting into a browser. 6) prove -v t/db_dependent/Koha/Reviews.t -- six new tests should run. 7) Run the koha qa test tool.
Created attachment 91192 [details] [review] Bug 1985: Follow up - Add sample letter to other languages As per comment #36, the letter COMMENT_CREATED has been added to the other languages. TEST PLAN --------- 0) Back up your letters table 1) In your mysql client after selected your Koha database, Run this: SET foreign_key_checks = 0; truncate letter; source installer/data/mysql/de-DE/mandatory/sample_notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; truncate letter; source installer/data/mysql/es-ES/mandatory/sample_notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; truncate letter; source installer/data/mysql/fr-FR/1-Obligatoire/sample_notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; truncate letter; source installer/data/mysql/it-IT/necessari/notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; truncate letter; source installer/data/mysql/nb-NO/1-Obligatorisk/sample_notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; truncate letter; source installer/data/mysql/pl-PL/mandatory/sample_notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; truncate letter; source installer/data/mysql/ru-RU/mandatory/sample_notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; truncate letter; source installer/data/mysql/uk-UA/mandatory/sample_notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; truncate letter; source installer/data/mysql/en/mandatory/sample_notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; -- there should be 9 counts of 1. 2) Restore your letters table. Left signed off, even though uk-UA was rebased. Signed-off-by: Marc Véron <veron@veron.ch>
Found some issues with the StaffClientBaseUrl. http://http:// :(
Created attachment 91193 [details] [review] Bug 1985: Fix whitespace in opac/opac-review.pl $ git diff -w origin/master -- should have no differences Signed-off-by: Marc Véron <veron@veron.ch>
Created attachment 91194 [details] [review] Bug 1985: Send email alert when comment posted. Many blog systems have a feature where the admin gets an email when someone posts a new comment that needs to be moderated. It would be nice to incorporate this into Koha. Ideally, you could set an email address in system preferences where notifications should be sent (since the Koha administrator is probably not the one approving comments). The body of the email would contain the comments, and offer a direct link to approve or delete the comment. The authorship was corrected to Olli-Antti Kivilahti. In comment #11, it was mentioned that title and biblionumber from the biblio table were not available as variables in the letter. This corrects this by converting the parameter list to a hashref, and adding the missing biblio number. It also cleans up the license on C4/Review.pm to be in line with the current coding guidelines license. Also strict and warning have been changed to the 'Use Modern::Perl;' now. Additionally, <<reviews.reviewid>> is now usable in the letter, as is <<staffClientBaseURL>>. These were required additions, because comment #1 expressly says there should be a direct link to approve or delete. I also included a review everything link, since there could be multiple comments outstanding. The default letter was tweaked as well to reflect these changes. Fixed bad URLs as noted in comment #26. TEST PLAN --------- 1) Create test branch and apply patch 2) run installer/data/mysql/updatedatabase.pl -- this will add the required default letter. 3) In the staff client: a) set the CommentModeratorsEmail system preference. -- not setting it will mean you won't get any queued letters. a) set the staffClientBaseURL system preference. -- not setting it will mean your email links won't be valid (i.e http:///...). b) modify the COMMENT_CREATED default letter as desired. -- feel free to add other things. 4) In the OPAC: a) Log in b) Find something c) Click on the 'Comments' tab -- Holdings/Title notes/Comments (#) is at the bottom d) Click 'Post or edit your comments on this item' e) In the window that pops up, type your comment. f) Click 'Submit and close this window'. g) Click 'Edit' and repeat steps e and f again. 5) In a mysql client: a) Open the koha database b) SELECT * FROM message_queue WHERE letter_code='COMMENT_CREATED'; -- There should be at least two. -- They should be able to contain the borrower number, biblio title, and other borrower and biblio related things. -- Comments are at a biblio level, so items, and issues don't make sense as variables for the letter. -- Confirm the URLs are valid by pasting into a browser. 6) prove -v t/db_dependent/Koha/Reviews.t -- six new tests should run. 7) Run the koha qa test tool.
Created attachment 91195 [details] [review] Bug 1985: (follow-up) correct http:// in staff URL
Created attachment 91196 [details] [review] Bug 1985: (follow-up) Add letter to other languages As per comment #36, the letter COMMENT_CREATED has been added to the other languages. TEST PLAN --------- 0) Back up your letters table 1) In your mysql client after selected your Koha database, Run this: SET foreign_key_checks = 0; truncate letter; source installer/data/mysql/de-DE/mandatory/sample_notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; truncate letter; source installer/data/mysql/es-ES/mandatory/sample_notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; truncate letter; source installer/data/mysql/fr-FR/1-Obligatoire/sample_notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; truncate letter; source installer/data/mysql/it-IT/necessari/notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; truncate letter; source installer/data/mysql/nb-NO/1-Obligatorisk/sample_notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; truncate letter; source installer/data/mysql/pl-PL/mandatory/sample_notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; truncate letter; source installer/data/mysql/ru-RU/mandatory/sample_notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; truncate letter; source installer/data/mysql/uk-UA/mandatory/sample_notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; truncate letter; source installer/data/mysql/en/mandatory/sample_notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; -- there should be 9 counts of 1. 2) Restore your letters table. Left signed off, even though uk-UA was rebased. Signed-off-by: Marc Véron <veron@veron.ch>
Created attachment 91197 [details] [review] Bug 1985: (follow-up) fix staff URL in other letters
Created attachment 91198 [details] [review] Bug 1985: (follow-up) Fix Reviews.t logic Read the tests to make sure they make sense. Before the patch is applied, they don't. $nb_of_approved_reviews + 2 did not make sense, because the three reviews added were not approved. search->count counts everything, so the use of approved+3 didn't make sense. Rather than duplicate the search->count test, changed the first one to reflect that the added reviews were all unapproved. Before applying patch, prove fails. After applying patch, prove passes.
Created attachment 91818 [details] [review] Bug 1985: Fix whitespace in opac/opac-review.pl $ git diff -w origin/master -- should have no differences Signed-off-by: Marc Véron <veron@veron.ch> Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Created attachment 91819 [details] [review] Bug 1985: Send email alert when comment posted. Many blog systems have a feature where the admin gets an email when someone posts a new comment that needs to be moderated. It would be nice to incorporate this into Koha. Ideally, you could set an email address in system preferences where notifications should be sent (since the Koha administrator is probably not the one approving comments). The body of the email would contain the comments, and offer a direct link to approve or delete the comment. The authorship was corrected to Olli-Antti Kivilahti. In comment #11, it was mentioned that title and biblionumber from the biblio table were not available as variables in the letter. This corrects this by converting the parameter list to a hashref, and adding the missing biblio number. It also cleans up the license on C4/Review.pm to be in line with the current coding guidelines license. Also strict and warning have been changed to the 'Use Modern::Perl;' now. Additionally, <<reviews.reviewid>> is now usable in the letter, as is <<staffClientBaseURL>>. These were required additions, because comment #1 expressly says there should be a direct link to approve or delete. I also included a review everything link, since there could be multiple comments outstanding. The default letter was tweaked as well to reflect these changes. Fixed bad URLs as noted in comment #26. TEST PLAN --------- 1) Create test branch and apply patch 2) run installer/data/mysql/updatedatabase.pl -- this will add the required default letter. 3) In the staff client: a) set the CommentModeratorsEmail system preference. -- not setting it will mean you won't get any queued letters. a) set the staffClientBaseURL system preference. -- not setting it will mean your email links won't be valid (i.e http:///...). b) modify the COMMENT_CREATED default letter as desired. -- feel free to add other things. 4) In the OPAC: a) Log in b) Find something c) Click on the 'Comments' tab -- Holdings/Title notes/Comments (#) is at the bottom d) Click 'Post or edit your comments on this item' e) In the window that pops up, type your comment. f) Click 'Submit and close this window'. g) Click 'Edit' and repeat steps e and f again. 5) In a mysql client: a) Open the koha database b) SELECT * FROM message_queue WHERE letter_code='COMMENT_CREATED'; -- There should be at least two. -- They should be able to contain the borrower number, biblio title, and other borrower and biblio related things. -- Comments are at a biblio level, so items, and issues don't make sense as variables for the letter. -- Confirm the URLs are valid by pasting into a browser. 6) prove -v t/db_dependent/Koha/Reviews.t -- six new tests should run. 7) Run the koha qa test tool. Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Created attachment 91820 [details] [review] Bug 1985: (follow-up) correct http:// in staff URL Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Created attachment 91821 [details] [review] Bug 1985: (follow-up) Add letter to other languages As per comment #36, the letter COMMENT_CREATED has been added to the other languages. TEST PLAN --------- 0) Back up your letters table 1) In your mysql client after selected your Koha database, Run this: SET foreign_key_checks = 0; truncate letter; source installer/data/mysql/de-DE/mandatory/sample_notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; truncate letter; source installer/data/mysql/es-ES/mandatory/sample_notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; truncate letter; source installer/data/mysql/fr-FR/1-Obligatoire/sample_notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; truncate letter; source installer/data/mysql/it-IT/necessari/notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; truncate letter; source installer/data/mysql/nb-NO/1-Obligatorisk/sample_notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; truncate letter; source installer/data/mysql/pl-PL/mandatory/sample_notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; truncate letter; source installer/data/mysql/ru-RU/mandatory/sample_notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; truncate letter; source installer/data/mysql/uk-UA/mandatory/sample_notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; truncate letter; source installer/data/mysql/en/mandatory/sample_notices.sql SELECT COUNT(*) FROM letter where code='COMMENT_CREATED'; -- there should be 9 counts of 1. 2) Restore your letters table. Left signed off, even though uk-UA was rebased. Signed-off-by: Marc Véron <veron@veron.ch> Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Created attachment 91822 [details] [review] Bug 1985: (follow-up) fix staff URL in other letters Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Created attachment 91823 [details] [review] Bug 1985: (follow-up) Fix Reviews.t logic Read the tests to make sure they make sense. Before the patch is applied, they don't. $nb_of_approved_reviews + 2 did not make sense, because the three reviews added were not approved. search->count counts everything, so the use of approved+3 didn't make sense. Rather than duplicate the search->count test, changed the first one to reflect that the added reviews were all unapproved. Before applying patch, prove fails. After applying patch, prove passes. Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
QA review: 1) Letter text +We want to inform you that borrower <<borrowers.cardnumber>> has just created a new comment on <<biblio.title>>, which is biblionumber <<biblio.biblionumber>>. Instead of telling the biblionumber in the text, why not add a link to the record instead? To make this title more distinguishable we could also make use of the new fields (subtitle, parts, number). These seem a bit unusual and very developery for formatting: +--- BEGIN COMMENT --- +<<reviews.review>> +--- END COMMENT --- I think using standard formatting or just ----- would work better here. Signing a letter to the libray with 'the library' seems a little odd to me :) 2) Convert database update to .perl The RM will be happier. 3) Capitalization +('CommentModeratorsEmail','','','The email address where to send a notification (template code COMMENT_CREATED) when a Borrower adds/modifies a review/comment for a Biblio. Set to empty to disable sending email notifications.','Textarea'), Biblio and Borrower... Same for the description in the SQL statements.
Thx for taking this up - also impressed with letters added for all translations :)
4) Method naming I believe we agreed on lower case using _ for dividing words for all methods in the new Koha namespace. SendReviewAlert