CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Add membership Token on PDF letters
Pages: [1]

Author Topic: Add membership Token on PDF letters  (Read 651 times)

jchnews

  • I post occasionally
  • **
  • Posts: 41
  • Karma: 0
  • CiviCRM version: 4.2
  • CMS version: Wordpress
  • MySQL version: 5.1
  • PHP version: 5.3.x
Add membership Token on PDF letters
February 25, 2013, 08:41:02 am
Hello,

I want to use advanced search to print PDF letter for contact which will include :
Membership type
Membership start date
Membership end date
amount
current date

I have see that some variable are use in system message
But they are not available as Token for my need.

Could you please tell me where i have to put my php request to add these informations in the default tokens

is it in getTokenDetails function in CRM/utils/token.php ?

Thanks

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Add membership Token on PDF letters
February 26, 2013, 03:29:39 am
Membership related tokens are not available for print PDF letter. So you will have to use hooks for implementing this functionality

Check following hooks:
http://wiki.civicrm.org/confluence/display/CRMDOC42/hook_civicrm_tokens
http://wiki.civicrm.org/confluence/display/CRMDOC42/hook_civicrm_tokenValues

Hth
Kurund
Found this reply helpful? Support CiviCRM

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: Add membership Token on PDF letters
February 26, 2013, 12:21:12 pm
Eileen says
we used tokens
https://github.com/eileenmcnaughton/tokens/blob/master/latestcurrentmembership.inc
You can see the 4 set up @ the top
requires the civitoken module too (there is a d6 & d7 one)
Also on my github (because I got sick of doing a whole module for one token)

---

not much point my fleshing out the above as it won't make it any clearer ;-)
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

johns

  • I’m new here
  • *
  • Posts: 20
  • Karma: 1
    • Free Software Foundation
  • CiviCRM version: 4.3
  • CMS version: Drupal
Re: Add membership Token on PDF letters
November 18, 2013, 02:14:26 pm
That code worked for us on 4.3.4, thanks!
Support free software by supporting the Free Software Foundation: http://u.fsf.org/buildusup

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Add membership Token on PDF letters

This forum was archived on 2017-11-26.