Bug 3203 - Some Letters template variables are not available to certain notice types
Summary: Some Letters template variables are not available to certain notice types
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Notices (show other bugs)
Version: master
Hardware: All All
: PATCH-Sent (DO NOT USE) normal (vote)
Assignee: Henri-Damien LAURENT
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-05-08 12:32 UTC by Chris Cormack
Modified: 2013-12-05 20:04 UTC (History)
9 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Patch with contents of branch (10.96 KB, patch)
2011-02-17 12:19 UTC, Colin Campbell
Details | Diff | Splinter Review
Signed-off patch (6.42 KB, patch)
2011-03-27 17:12 UTC, Jared Camins-Esakov
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Cormack 2010-05-21 01:07:38 UTC


---- Reported by rch@liblime.com 2009-05-08 00:32:08 ----

digest type notices do not know what library they belong to, yet the interface allows the user to add branches.branchname.

I assume it would make sense to add this as the patron's registration branch. 

advance_notices types do not parse items.content.

digest types know the special variable <<count>> though it's not listed in the variable list.

Ultimately, we define message_attributes but we hard-code special meanings in certain letter_codes.  Only variables available to a given letter type should be listed in the interface.

Minimally, advance_notices should probably handle items.content and parse the 'branches' variables.



---- Additional Comments From cookie.wolfrom@liblime.com 2009-08-25 22:43:37 ----

account details message does not handle branch variables



---- Additional Comments From katrin.fischer@bsz-bw.de 2009-12-01 09:55:28 ----


account details message does not handle branch variables 
- this is still true for Koha 3.01.00.061. 

Also not all fields from borrowers work: 

Because the library does not set OPAC Login for all of its users,
we changed the standard template from <<borrowers.userid>> to <<borrowers.cardnumber>>.

Output in email: 

Cardnumber:  <<borrowers.cardnumber>>










---- Additional Comments From jwagner@ptfs.com 2010-05-12 11:56:22 ----

The fix for this bug can be pulled from the public git repoisitory at http://github.com/Koha-PTFS, branch http://bugs.koha.org/cgi-bin/bugzilla3/show_bug.cgi?id=3203



---- Additional Comments From jwagner@ptfs.com 2010-05-12 12:06:50 ----

Note: The fix allows for use of some specific item fields in advance notices, such as <<items.date_due>>, <<items.itemcallnumber>>.  It also allows use of date due or issue date in the checkin/checkout/item due notices.  Some sample notice text:

Advance notice:

Dear <<borrowers.firstname>> <<borrowers.surname>>,

The following item will be due in three days:

<<biblio.title>>
Due: <<items.date_due>>     <<items.itemcallnumber>>     <<items.barcode>>


Checkin notice:

The following items have been checked in:
----

<<biblio.title>> <<biblio.author>>
<<items.itemcallnumber>>
Due Date: <<items.date_due>>
Barcode: <<items.barcode>>


Checkout notice:

Dear <<borrowers.firstname>> <<borrowers.surname>>,

The following item has been checked out to you. If this is an interlibrary loan, a hold item, or a book you requested the library purchase, the item is available for pick-up at the reference desk in the library.
----

<<biblio.title>> <<biblio.author>>
<<items.itemcallnumber>>
Due Date: <<items.date_due>>
Barcode: <<items.barcode>>
 




--- Bug imported by chris@bigballofwax.co.nz 2010-05-21 01:07 UTC  ---

This bug was previously known as _bug_ 3203 at http://bugs.koha.org/cgi-bin/bugzilla3/show_bug.cgi?id=3203
This bug blocked bug(s) 3383.

Actual time not defined. Setting to 0.0
The original reporter of this bug does not have
   an account here. Reassigning to the person who moved
   it here: chris@bigballofwax.co.nz.
   Previous reporter was rch@liblime.com.
CC member bchurch@ptfs.com does not have an account here
CC member jwagner@ptfs.com does not have an account here
CC member maria.laude@liblime.com does not have an account here

Comment 1 Colin Campbell 2010-12-15 18:03:51 UTC
I've taken the mods from the branch Jane refers to and rebased them against master. They are in the branch bug_3203 at git://github.com/colinsc/koha.git

I'd be grateful if someone could test them.
Comment 2 Marcel de Rooy 2011-02-17 11:16:49 UTC
(In reply to comment #1)
> I've taken the mods from the branch Jane refers to and rebased them against
> master. They are in the branch bug_3203 at git://github.com/colinsc/koha.git
> I'd be grateful if someone could test them.

Could you attach a patch file to this bug?
Comment 3 Colin Campbell 2011-02-17 12:19:45 UTC
Created attachment 3173 [details] [review]
Patch with contents of branch

Squashed the branch into a single commit
Comment 4 Marcel de Rooy 2011-02-17 12:53:45 UTC
Thanks. Patch applies. Will test it now..
Comment 5 Marcel de Rooy 2011-02-21 07:34:13 UTC
Have spent some time on this one. With a circulation notice, PREDUE, items.content is replaced but the additional items fields are not replaced. As you can see with some extra debug prints, the parseletter routine is not called for items at all.
 
[marcel@RKM004 testclone]$ ./misc/cronjobs/advance_notices.pl -c -m 3 -v -n
getting upcoming due issues at ./misc/cronjobs/advance_notices.pl line 119.
found 1 issues at ./misc/cronjobs/advance_notices.pl line 121.
examining 197 upcoming due items at ./misc/cronjobs/advance_notices.pl line 140.
MR:25
parseletter: table=borrowers
parseletter: table=branches
parseletter: table=biblio
parseletter: table=biblioitems
2011-02-18      3 stoleti nizozemsk kresby 1400-1700 : 439 C 40        Aachen, Hans von,
 <<items.barcode>> <<items.itemcallnumber>> <<items.date_due>> <<items.issuedate>>
 
An additional question about the new lines on pk2 CHECKIN in Letters.pm: Code seems to make an improper[?] use of this fourth parameter. But I wonder where this fourth parameter is passed to the routine. Couldn't find it at first glance.
Comment 6 Jared Camins-Esakov 2011-03-27 17:12:15 UTC
Created attachment 3444 [details] [review]
Signed-off patch
Comment 7 Chris Cormack 2011-03-28 08:28:53 UTC
Patch pushed, please test
Comment 8 Marcel de Rooy 2011-03-28 08:34:28 UTC
Do I overlook something here?
Patch and signoff are quite DIFFerent ???
Comment 9 Katrin Fischer 2011-03-28 08:39:47 UTC
There was a new patch from Ian Walls that Jared Camins-Esakov signed-off.
Comment 10 MJ Ray (software.coop) 2011-04-09 09:25:42 UTC
This bug is mentioned in:
Bug 3203: ACCTDETAIL notices don't parse	branches or borrowers tokens http://lists.koha-community.org/pipermail/koha-patches/2011-March/014239.html
Comment 11 Jared Camins-Esakov 2012-12-31 00:23:11 UTC
There have been no further reports of problems so I am marking this bug resolved.