In Bug 30515, we are discussing adding a new system preference UsePatronPreferencesForOverdueNotices to let patrons control which overdue messages are sent by mail in their messaging preferences. For many libraries it would still be necessary to set a certain overdue notice (say the third overdue notice) as "mandatory for print message". Jonathan suggested to reuse the aforementioned pref and make it multivaluated with 3 values possible: ODUE, ODUE2, ODUE3. Then: - if at least one is selected then patrons can edit it/them - if none selected, we don't allow the patrons to modify any This would be the simplest way to extend the functionality of Bug 30515.
Created attachment 186799 [details] [review] Bug 40791: Allow choice of which Overdue messages can be patron preferences In Bug 30515, we are discussing adding a new system preference UsePatronPreferencesForOverdueNotices to let patrons control which overdue messages are sent by mail in their messaging preferences. For many libraries it would still be necessary to set a certain overdue notice (say the third overdue notice) as "mandatory for print message". On this patch we reuse the aforementioned pref and make it multivaluated with 3 values possible: Overdue1, Overdue2 and Overdue 3. Then: - if at least one is selected then patrons can edit it/them - if none selected, we don't allow the patrons to modify any Test plan: Select 2 values of the pref and confirm that it does not appear from the messaging form (staff and opac) Run the cronjob script and confirm that the patron's preferences are taken into account for the 2 values you selected.
After applying the patch, "updatedatabase" warns: Use of uninitialized value $type in string ne at /kohadevbox/koha/installer/data/mysql/atomicupdate/bug_40791.pl line 13. Don't know if that's important. QA passes with no fails.
Created attachment 187245 [details] [review] Bug 40791: Allow choice of which Overdue messages can be patron preferences In Bug 30515, we are discussing adding a new system preference UsePatronPreferencesForOverdueNotices to let patrons control which overdue messages are sent by mail in their messaging preferences. For many libraries it would still be necessary to set a certain overdue notice (say the third overdue notice) as "mandatory for print message". On this patch we reuse the aforementioned pref and make it multivaluated with 3 values possible: Overdue1, Overdue2 and Overdue 3. Then: - if at least one is selected then patrons can edit it/them - if none selected, we don't allow the patrons to modify any Test plan: Select 2 values of the pref and confirm that it does not appear from the messaging form (staff and opac) Run the cronjob script and confirm that the patron's preferences are taken into account for the 2 values you selected. Signed-off-by: Philip Orr <philip.orr@lmscloud.de>
For the test plan: 1. You will need three different ODUE.. notices 2. make sure they all have different "Email" and "Print" content, this way it is easier to spot later 3. Set up overdue notice triggers with all three set to print for a certain patron type 4. Select the first two in UsePatronPreferencesForOverdueNotices 5. build three test cases for patrons of that type with overdue items 6. on one of them, in their messaging prefs, set both "overdue 1" and "overdue 2" to mail and make sure they have a mail address entered in their data 6a. this patron should get 1 and 2 per mail and 3 per print 7. on another, give them a mail address but do not check any boxes in their messaging prefs 7a. this patron should get all 3 per print 8. on the third patron, set the preferences but make sure they don't have a mail address 8a. this patron should also get all 3 per print 9. run overdue_notices.pl and gather_print_notices.pl 10. check if each patron got the proper transport type for their notices. (I also tested checking only "overdue 1" and leaving "overdue 2" unchecked, that also results as expected in 1 = mail and 2 and 3 = both print.) Works as expected.
(In reply to Philip Orr from comment #2) > After applying the patch, "updatedatabase" warns: > > Use of uninitialized value $type in string ne at > /kohadevbox/koha/installer/data/mysql/atomicupdate/bug_40791.pl line 13. > > Don't know if that's important. > QA passes with no fails. Hum I don't see this warning. It means that "type" for UsePatronPreferencesForOverdueNotices in not defined. It is supposed to be "YesNo". It could happen if this db rev is run before the one from 30515, but it should not happen as they are run in order. Koha/Installer.pm 75 my $update_dir = $intranetdir . '/installer/data/mysql/atomicupdate/'; 76 opendir( my $dirh, $update_dir ); 77 my @stuff = sort readdir $dirh;