Bug 9103: overdue_notices.pl should use AutoEmailPrimaryAddress syspref
authorFridolyn SOMERS <fridolyn.somers@biblibre.com>
Mon, 19 Nov 2012 12:58:16 +0000 (13:58 +0100)
committerJared Camins-Esakov <jcamins@cpbibliography.com>
Wed, 20 Mar 2013 02:50:39 +0000 (22:50 -0400)
commit7061e74676d17c4a306a9bec07bdb02597850817
tree51d6ae8a4e1108d1af87bfdae7fb54a9e30d7fdd
parent9b95795edcfd7d6593bbd0ad56df68be628cae74
Bug 9103: overdue_notices.pl should use AutoEmailPrimaryAddress syspref

Script overdue_notices.pl creates a printed letter if borrower as no email.
Actually, unless --email option is used, first valid email of borrower is used. Email field should depend on AutoEmailPrimaryAddress syspref like in other letter creations.

Signed-off-by: MJ Ray <mjr@phonecoop.coop>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
All tests and QA script pass.

Following test plan from Julien Sicot from Bugzilla:

- with patron's email address specified on "primary email"
  field AND syspref "AutoEmailPrimaryAddress" on "home"
  => notice sent to patron | OK

- with patron's email address specified on "secondary email"
  field AND syspref "AutoEmailPrimaryAddress" on "work"
  => notice sent to patron | OK

- with patron's email address specified on "alternate email"
  field AND syspref "AutoEmailPrimaryAddress" on "alternate"
  => notice sent to patron | OK

- with patron's email address specified on "secondary email"
  OR "alternate email" field AND syspref "AutoEmailPrimaryAddress" on "home"
  => no notice sent to patron, overdue notice sent to koha admin | OK

- with patron's email address specified on "primary email" OR
- with patron's email address specified on "primary email" field
  AND syspref "AutoEmailPrimaryAddress" on "home"
  => notice sent to patron | OK

- with patron's email address specified on "secondary email" field
  AND syspref "AutoEmailPrimaryAddress" on "work"
  => notice sent to patron | OK

- with patron's email address specified on "alternate email" field
  AND syspref "AutoEmailPrimaryAddress" on "alternate"
  => notice sent to patron | OK

- with patron's email address specified on "secondary email"
  OR "alternate email" field AND syspref "AutoEmailPrimaryAddress"
  on "home"
  => no notice sent to patron, overdue notice sent to koha admin | OK

- with patron's email address specified on "primary email"
  OR "secondary email" field AND syspref "AutoEmailPrimaryAddress"
  on "alternate"
  => no notice sent to patron, overdue notice sent to koha admin | OK

- with patron's email address specified on "primary email"
  OR "secondary email" OR "alternate email" field and syspref
  "AutoEmailPrimaryAddress" on "first valid" => notice sent to patron | OK"secondary email" field AND syspref "AutoEmailPrimaryAddress" on "alternate" => no notice sent to patron, overdue notice sent to koha admin | OK

- with patron's email address specified on "primary email" OR
  "secondary email" OR "alternate email" field and syspref
  "AutoEmailPrimaryAddress" on "first valid" => notice sent to patron | OK

Note: Options for AutoEmailPrimaryAddress should be like the field names  on
the patron form (primary, secondary...), but this is outside the scope of this
patch.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
C4/Letters.pm
C4/Members.pm
C4/Reserves.pm
misc/cronjobs/overdue_notices.pl