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) »
  • Discussion (deprecated) »
  • Feature Requests and Suggestions »
  • Usability Improvements (Moderator: Dave Greenberg) »
  • Extension for selection of Address' Location Type when ceratig PDF Letters
Pages: [1]

Author Topic: Extension for selection of Address' Location Type when ceratig PDF Letters  (Read 519 times)

Fabian_SYSTOPIA

  • I post occasionally
  • **
  • Posts: 74
  • Karma: 3
  • CiviCRM version: 4.3.x, 4.4.x
  • CMS version: Drupal 7.x
  • MySQL version: 5.4.10
  • PHP version: 5.4.10
Extension for selection of Address' Location Type when ceratig PDF Letters
February 20, 2015, 07:45:28 am
Background
In CiviCRM you can have mutiple location types for postal addresses. Whenever you want to create a PDF-Letter, CiviCRM will use the primary Address. In order to use address data of a specific location type you would need to create custom tokens.

Even if you have a custom token for a certain address' location type, you would have to make sure that all selected contacts have a postal address of the location type - or include some logic (fallback address).

For a specific use case, this is probably not to hard to implement, e.g. by using custom hooks and tokens as described in Coleman's Blogpost: https://civicrm.org/blogs/colemanw/create-your-own-tokens-fun-and-profit

However this requires that you have a static, pre-defined logic - any changes require the adaption of existing or creation of new hooks/tokens. Especially for smaller organisations that can be a problem as it requires (expensive) technical services.

Outline of extension functionality
In order for normal users to be flexible when creating pdf letters there should be an option in the pdf-creation page where you can select the location type you would like to use and to define one or two fallback options.

Alternatively/in addition to that there could be a settings page on which you can define desired behaviour.

Within the HTML-Editor, users could then use some kind of "smart tokens" that would incorporate the user's selection regarding the location types.

An advanced feature would be that for contacts who do not have an address of the selected type(s) no PDF-Letters would be generated but a list of those contacts would be displayed instead.

Feedback/questions
  • do you think this is a feature required by many users?
  • if yes - could it even make sense to aim at an integration with the CiviCRM core (in the long run)?
  • do you know any examples of similar approaches?
  • do you think the approach described above is appropriate to tackle the problem?
  • any input, suggestions or additional features?
  • does it make sense to take a closer look at the (similar) 4.6 feature for mailings that is currently developed?
  • ...

Best Regards
Fabian

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Extension for selection of Address' Location Type when ceratig PDF Letters
February 20, 2015, 11:53:08 am
The civitoken extension here https://github.com/eileenmcnaughton/nz.co.fuzion.civitoken offers up different locations of phones - https://github.com/eileenmcnaughton/nz.co.fuzion.civitoken/blob/master/tokens/phones.inc - which is hard-coded - but before I actually looked at the code I was going to tell you it calculated the locations on the fly by looking up enabled locations :-)
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Fabian_SYSTOPIA

  • I post occasionally
  • **
  • Posts: 74
  • Karma: 3
  • CiviCRM version: 4.3.x, 4.4.x
  • CMS version: Drupal 7.x
  • MySQL version: 5.4.10
  • PHP version: 5.4.10
Re: Extension for selection of Address' Location Type when ceratig PDF Letters
February 22, 2015, 10:49:37 pm
Thanks Eileen - I will definitely tell Björn to have look at your Extension's code ^^

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Discussion (deprecated) »
  • Feature Requests and Suggestions »
  • Usability Improvements (Moderator: Dave Greenberg) »
  • Extension for selection of Address' Location Type when ceratig PDF Letters

This forum was archived on 2017-11-26.