Created attachment 130048 [details] [review] Bug 29997: Allow to send email notification when a serial issue is late This patch adds the ability to define, for each subscription, a letter that will be sent whenever an issue is automatically marked as late by the script misc/cronjobs/serialsUpdate.pl. If no letter is defined for a subscription, then no letter will be sent. The letter will be sent to the subscription's manager (the staff member who created or last modified the subscription). Test plan: 1. Create a letter in Tools › Notices & slips for module "Serials". Fill the Email template. 2. Create a new subscription, with a grace period of 1 day, and set the new field "Late issue notification" to the letter you just created. Set the first issue publication date and subscription start date to two days ago 3. Run `misc/cronjobs/serialsUpdate.pl -v -c`. 4. The first serial issue of your subscription should have been automatically marked as late. Now verify that the table message_queue contains a new message corresponding to this serial issue. The message's contents should be what you defined in step 1. The message should be addressed to the subscription's manager (you) Technical note: The "subscription" table contained a column named "librarian", which contained the userid of the patron who created or last modified the subscription, but there was no foreign key constraint referencing the borrowers table. So this patch also adds a new column "manager_id" which contains the borrowernumber of the patron who created or last modified the subscription, and it also adds the foreign key constraint. The atomicupdate script tries to fill the new "manager_id" column by searching patrons by their "userid", which might fail, so it's normal to have some NULL values in "manager_id" at the end. The "librarian" column is removed at the end of the script
Created attachment 143637 [details] [review] Bug 29997: Allow to send email notification when a serial issue is late This patch adds the ability to define, for each subscription, a letter that will be sent whenever an issue is automatically marked as late by the script misc/cronjobs/serialsUpdate.pl. If no letter is defined for a subscription, then no letter will be sent. The letter will be sent to the subscription's manager (the staff member who created or last modified the subscription). Test plan: 1. Run updatedatabase.pl and update_dbix_class_files.pl 2. Create a letter in Tools › Notices & slips for module "Serials". Fill the Email template. 3. Create a new subscription, with a grace period of 1 day, and set the new field "Late issue notification" to the letter you just created. Set the first issue publication date and subscription start date to two days ago 4. Run `misc/cronjobs/serialsUpdate.pl -v -c`. 5. The first serial issue of your subscription should have been automatically marked as late. Now verify that the table message_queue contains a new message corresponding to this serial issue. The message's contents should be what you defined in step 1. The message should be addressed to the subscription's manager (you) Technical note: The "subscription" table contained a column named "librarian", which contained the userid of the patron who created or last modified the subscription, but there was no foreign key constraint referencing the borrowers table. So this patch also adds a new column "manager_id" which contains the borrowernumber of the patron who created or last modified the subscription, and it also adds the foreign key constraint. The atomicupdate script tries to fill the new "manager_id" column by searching patrons by their "userid", which might fail, so it's normal to have some NULL values in "manager_id" at the end. The "librarian" column is removed at the end of the script
Patch rebased on master + fixed a bug (hardcoded letter code)
Created attachment 156796 [details] [review] Bug 29997: Allow to send email notification when a serial issue is late This patch adds the ability to define, for each subscription, a letter that will be sent whenever an issue is automatically marked as late by the script misc/cronjobs/serialsUpdate.pl. If no letter is defined for a subscription, then no letter will be sent. The letter will be sent to the subscription's manager (the staff member who created or last modified the subscription). Test plan: 1. Run updatedatabase.pl and update_dbix_class_files.pl 2. Create a letter in Tools › Notices & slips for module "Serials". Fill the Email template. 3. Create a new subscription, with a grace period of 1 day, and set the new field "Late issue notification" to the letter you just created. Set the first issue publication date and subscription start date to two days ago 4. Run `misc/cronjobs/serialsUpdate.pl -v -c`. 5. The first serial issue of your subscription should have been automatically marked as late. Now verify that the table message_queue contains a new message corresponding to this serial issue. The message's contents should be what you defined in step 1. The message should be addressed to the subscription's manager (you) Technical note: The "subscription" table contained a column named "librarian", which contained the userid of the patron who created or last modified the subscription, but there was no foreign key constraint referencing the borrowers table. So this patch also adds a new column "manager_id" which contains the borrowernumber of the patron who created or last modified the subscription, and it also adds the foreign key constraint. The atomicupdate script tries to fill the new "manager_id" column by searching patrons by their "userid", which might fail, so it's normal to have some NULL values in "manager_id" at the end. The "librarian" column is removed at the end of the script
Patch rebased on master
Could you fixed the bug. Applying: Bug 29997: Allow to send email notification when a serial issue is late error: sha1 information is lacking or useless (C4/Serials.pm). error: could not build fake ancestor Patch failed at 0001 Bug 29997: Allow to send email notification when a serial issue is late Thanks
Created attachment 175388 [details] [review] Bug 29997: Allow to send email notification when a serial issue is late This patch adds the ability to define, for each subscription, a letter that will be sent whenever an issue is automatically marked as late by the script misc/cronjobs/serialsUpdate.pl. If no letter is defined for a subscription, then no letter will be sent. The letter will be sent to the subscription's manager (the staff member who created or last modified the subscription). Test plan: 1. Run updatedatabase.pl and update_dbix_class_files.pl 2. Create a letter in Tools › Notices & slips for module "Serials". Fill the Email template. 3. Create a new subscription, with a grace period of 1 day, and set the new field "Late issue notification" to the letter you just created. Set the first issue publication date and subscription start date to two days ago 4. Run `misc/cronjobs/serialsUpdate.pl -v -c`. 5. The first serial issue of your subscription should have been automatically marked as late. Now verify that the table message_queue contains a new message corresponding to this serial issue. The message's contents should be what you defined in step 1. The message should be addressed to the subscription's manager (you) Technical note: The "subscription" table contained a column named "librarian", which contained the userid of the patron who created or last modified the subscription, but there was no foreign key constraint referencing the borrowers table. So this patch also adds a new column "manager_id" which contains the borrowernumber of the patron who created or last modified the subscription, and it also adds the foreign key constraint. The atomicupdate script tries to fill the new "manager_id" column by searching patrons by their "userid", which might fail, so it's normal to have some NULL values in "manager_id" at the end. The "librarian" column is removed at the end of the script Sponsored-by: Écoles Nationales Supérieures d'Architecture
Patch rebased