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 CiviContribute (Moderator: Donald Lobo) »
  • Collecting address info for Honoree?
Pages: [1]

Author Topic: Collecting address info for Honoree?  (Read 3431 times)

neuromusic

  • Guest
Collecting address info for Honoree?
December 11, 2008, 10:41:32 am
I have an honoree field in my donation page and would like to collect a physical address for the honoree as well.

Any ideas how I can do this?

Thanks!
Justin

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Collecting address info for Honoree?
December 11, 2008, 12:41:13 pm

You'll need to make some code changes to do this. If you are interested in doing so, contact us on IRC and we can help you get started

http://embed.mibbit.com/?server=irc.freenode.net&channel=%23civicrm&forcePrompt=true

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

jpickerill

  • Guest
Re: Collecting address info for Honoree?
December 16, 2009, 03:13:20 pm
Quote from: Donald Lobo on December 11, 2008, 12:41:13 pm

You'll need to make some code changes to do this. If you are interested in doing so, contact us on IRC and we can help you get started

http://embed.mibbit.com/?server=irc.freenode.net&channel=%23civicrm&forcePrompt=true

lobo

I'm also interested in making this same customization. However, whenever I try to access IRC via the above link, my connection gets terminated.

Any help is much appreciated.

Thanks,
Joe

jpickerill

  • Guest
Re: Collecting address info for Honoree?
December 22, 2009, 09:50:11 am
I tried the following with no success. Am I even close?

Once again, any help is appreciated.

Change made to administrator/components/com_civicrm/civicrm/CRM/Contribution/Main.php

Code: [Select]
function buildHonorBlock(  ) {
        $this->assign("honor_block_is_active",true);
        $this->set("honor_block_is_active",true);

        $this->assign("honor_block_title", CRM_Utils_Array::value( 'honor_block_title', $this->_values ));
        $this->assign("honor_block_text", CRM_Utils_Array::value( 'honor_block_text', $this->_values ) );

        $attributes  = CRM_Core_DAO::getAttribute('CRM_Contact_DAO_Contact');
        $extraOption = array('onclick' =>"enableHonorType();");
        // radio button for Honor Type
        $honorOptions = array( );
        $honor =CRM_Core_PseudoConstant::honor( );
        foreach ($honor as $key => $var) {
            $honorTypes[$key] = HTML_QuickForm::createElement('radio', null, null, $var, $key, $extraOption );
        }
        $this->addGroup($honorTypes, 'honor_type_id', null);
       
        // prefix
        $this->addElement('select', 'honor_prefix_id', ts('Prefix'), array('' => ts('- prefix -')) + CRM_Core_PseudoConstant::individualPrefix());
        // first_name
        $this->addElement('text', 'honor_first_name', ts('First Name'), $attributes['first_name'] );
       
        //last_name
        $this->addElement('text', 'honor_last_name', ts('Last Name'), $attributes['last_name'] );

//jpick addition
        $this->addElement('text', 'honor_street_address', ts('Street Address'), $attributes['street_address'] );

//jpick addition
        $this->addElement('text', 'honor_city', ts('City'), $attributes['city'] );

//jpick addition
        $this->addElement('text', 'honor_state', ts('State'), $attributes['state'] );

//jpick addition
        $this->addElement('text', 'honor_postal', ts('Zip Code'), $attributes['postal'] );
       
        //email
        $this->addElement('text', 'honor_email', ts('Email Address'));
        $this->addRule( "honor_email", ts('Honoree Email is not valid.'), 'email' );
    }


Changes made to administrator/components/com_civicrm/civicrm/CRM/Contribution/Confirm.php

@ line 962:

       
Code: [Select]
//assign to template for email reciept
        $honor_block_is_active = $this->get( 'honor_block_is_active');
       
        $this->assign('honor_block_is_active', $honor_block_is_active );
        $this->assign("honor_block_title", $this->_values['honor_block_title'] );
       
        require_once "CRM/Core/PseudoConstant.php";
        $prefix = CRM_Core_PseudoConstant::individualPrefix();
        $honorType = CRM_Core_PseudoConstant::honor( );
        $this->assign("honor_type",       $honorType[$params["honor_type_id"]]);
        $this->assign("honor_prefix",     $prefix[$params["honor_prefix_id"]]);
        $this->assign("honor_first_name", $params["honor_first_name"]);
        $this->assign("honor_last_name",  $params["honor_last_name"]);
$this->assign("honor_street_address",      $params["honor_street_address"]);
$this->assign("honor_city",      $params["honor_city"]);
$this->assign("honor_state",      $params["honor_state"]);
$this->assign("honor_postal",      $params["honor_postal"]);
        $this->assign("honor_email",      $params["honor_email"]);
       
        //create honoree contact
        require_once 'CRM/Contribute/BAO/Contribution.php';
        return CRM_Contribute_BAO_Contribution::createHonorContact( $params );


Changes made to administrator/components/com_civicrm/civicrm/CRM/Contribution/ThankYou.php

@ line 100:

Code: [Select]
$honor_block_is_active = $this->get( 'honor_block_is_active');
        if ( $honor_block_is_active &&
             ( ( ! empty( $params["honor_first_name"] ) && ! empty( $params["honor_last_name"] ) ) ||
               ( ! empty( $params["honor_email"] ) ) ) ) {
            $this->assign( 'honor_block_is_active', $honor_block_is_active );
            $this->assign( 'honor_block_title', CRM_Utils_Array::value( 'honor_block_title', $this->_values ) );
         
            require_once "CRM/Core/PseudoConstant.php";
            $prefix = CRM_Core_PseudoConstant::individualPrefix();
            $honor  = CRM_Core_PseudoConstant::honor( );             
            $this->assign( 'honor_type',       $honor[$params["honor_type_id"]] );
            $this->assign( 'honor_prefix',     ($params["honor_prefix_id"]) ? $prefix[$params["honor_prefix_id"]] : ' ');
            $this->assign( 'honor_first_name', $params["honor_first_name"] );
            $this->assign( 'honor_last_name',  $params["honor_last_name"] );
    $this->assign("honor_street_address",      $params["honor_street_address"]);
    $this->assign("honor_city",      $params["honor_city"]);
    $this->assign("honor_state",      $params["honor_state"]);
    $this->assign("honor_postal",      $params["honor_postal"]);
            $this->assign("honor_email",      $params["honor_email"]);
       
        }


Changes Made in administrator/components/com_civicrm/civicrm/templates/CRM/Contribute/Form/Contribution/Honor.tpl

Code: [Select]
{if $honor_block_is_active}
    <div class="header-dark">
        {ts}{$honor_block_title}{/ts}
    </div>
    <div class="display-block">
         <strong>{$honor_type}  : </strong>
         {$honor_prefix}&nbsp;{$honor_first_name}&nbsp;{$honor_last_name}<br />
         <strong>Street Address: </strong>{$honor_street_address}<br />
         <strong>City:</strong>{$honor_city}<br />
         <strong>State: </strong>{$honor_state}<br />
         <strong>Zip Code: </strong>{$honor_postal}<br />
         <strong>Email      : </strong>{$honor_email}<br />
    </div>

{/if}


Changes Made in administrator/components/com_civicrm/civicrm/templates/CRM/Contribute/Form/Contribution/ReceiptMessage.tpl

Code: [Select]
{if $honor_block_is_active }
===========================================================
{$honor_type}
===========================================================
{$honor_prefix} {$honor_first_name} {$honor_last_name}
{$honor_street_address}
{$honor_city}, {$honor_state} {$honor_postal}
{if $honor_email}
{ts}Honoree Email{/ts}: {$honor_email}
{/if}

{/if}

mrl586

  • I post occasionally
  • **
  • Posts: 63
  • Karma: 2
  • CiviCRM version: 4.0
  • CMS version: Drupal 7.0
  • MySQL version: 5.5.9
  • PHP version: 5.3.5
Re: Collecting address info for Honoree?
December 28, 2009, 06:58:58 pm
Quote from: jpickerill on December 16, 2009, 03:13:20 pm
Quote from: Donald Lobo on December 11, 2008, 12:41:13 pm

You'll need to make some code changes to do this. If you are interested in doing so, contact us on IRC and we can help you get started

http://embed.mibbit.com/?server=irc.freenode.net&channel=%23civicrm&forcePrompt=true

lobo

I'm also interested in making this same customization. However, whenever I try to access IRC via the above link, my connection gets terminated.

Any help is much appreciated.

Thanks,
Joe
Try this url: http://webchat.freenode.net/

merrante

  • Guest
Re: Collecting address info for Honoree?
December 23, 2010, 08:22:44 am
Can some one help me with this. I need to capture a mailing address of the honoree. Thanks.

indykids

  • I’m new here
  • *
  • Posts: 15
  • Karma: 2
  • CiviCRM version: 4.x
  • CMS version: wordpress
  • MySQL version: 4
  • PHP version: 4
Re: Collecting address info for Honoree?
December 27, 2011, 12:30:27 pm
hi,

Would a new custom profile with custom fields called "Donation Honoree Information" do what you want?

Eliet Henderson

  • I post occasionally
  • **
  • Posts: 49
  • Karma: 4
  • CiviCRM version: 4.4.7
  • CMS version: Drupal 7
  • MySQL version: 5.0
  • PHP version: 5.2
Re: Collecting address info for Honoree?
December 27, 2011, 02:53:04 pm

Hi -- We are using a profile and custom data fields to capture honoree information, rather than try to customize the built-in function for recording in honor/memory of gifts (as indykids suggests). I made custom data fields for recipient name, email, postal address and gift instructions (for entering things like "Please deliver by Dec 25th"). Then I put these custom data fields in a profile and displayed that on the contribution page.

This does NOT automatically look up the recipient contact and record the gift as in honor of the recipient. It just stores the entered data on the contribution record, then we manually add a soft credit to the contribution, set up a relationship between donor and recipient, etc.

Here's our contribution page where you can see it in action: https://baykeeper.org/civicrm/contribute/transact?reset=1&id=15

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Collecting address info for Honoree?
December 27, 2011, 05:24:56 pm
The baykeepers have the right idea, except for the manual data entry part :(

I'd be stoked about CiviCRM using a profile for honoree. The name and email fields are too problematic. People just type in whatever they want. Some recent examples from my site:

FN: My  LN: Mom
FN: Jared LN: And Emily
FN: Mrs. LN: Smith
FN: Paul LN: And Family

You bet I was banging my head on the wall when I found those contacts in our database!
Try asking your question on the new CiviCRM help site.

Eliet Henderson

  • I post occasionally
  • **
  • Posts: 49
  • Karma: 4
  • CiviCRM version: 4.4.7
  • CMS version: Drupal 7
  • MySQL version: 5.0
  • PHP version: 5.2
Re: Collecting address info for Honoree?
December 28, 2011, 10:15:55 am

I agree about problems with the current function for collecting in honor/memory of data. For example, if someone is making a gift in honor of an existing contact, and enters the contact's current email address, it overwrites the contact's first and last name with whatever the donor types in -- so Susan Smith becomes BFF Susiekins. Though it requires the manual data entry, the profile setup we're using prevents that kind of data loss.

I know that some folks are working on a "on behalf of individual" profile, similar to the on behalf of organization profile: http://forum.civicrm.org/index.php/topic,21367.0.html. I don't know whether that functionality has the same potential for overwriting existing data.

indykids

  • I’m new here
  • *
  • Posts: 15
  • Karma: 2
  • CiviCRM version: 4.x
  • CMS version: wordpress
  • MySQL version: 4
  • PHP version: 4
Re: Collecting address info for Honoree?
January 03, 2012, 04:36:07 pm
Hi, similar to Baykeeper, that's how we solved the honoree issue, too. Sorry, I wasn't suggesting to modify the existing honoree functionality. In fact, does anyone know how to disable the built-in honoree fields? That is, when I manually enter a gift, I see my custom fields for recording honoree info. But then below these fields, there are Civi's built-in Honoree fields (first name, last name, email). Any way to "hide" or "disable" this built-in section? I fear during data entry it will create confusion and entry error. Thanks for any hints!

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Collecting address info for Honoree?
January 04, 2012, 06:15:07 am
indykids: why not just turn off the honoree option for your contribution form?

All: While I'm glad you've found a temporary workaround for the problem, I think that in general we shouldn't be circumventing core civi functionality when there's something about it we don't like, but instead we should help improve it so that it works well for us. Could either of you put up a little seed money for a MIH for honoree profiles?

PS: Eliet's comment about "BFF Susiekins" inspired me to use hook_civicrm_pre() to send me an email every time a contact's name is significantly changed -- that should really cut down on any name-swapping shenanigans.
Try asking your question on the new CiviCRM help site.

indykids

  • I’m new here
  • *
  • Posts: 15
  • Karma: 2
  • CiviCRM version: 4.x
  • CMS version: wordpress
  • MySQL version: 4
  • PHP version: 4
Re: Collecting address info for Honoree?
January 04, 2012, 09:10:43 am
Hi colemanw,

To answer your question, turning off honoree option hides it on the form, but not when manually entering a new contribution record via Contributions > New Contribution. You'll still see an "Honoree Info" section there with fields to fill out. It's this that I'm wondering if possible to hide.

I like the approach of beefing up core functionality. If resources free up on my end, I'd be happy to suggest it to decision makers at my org.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • Collecting address info for Honoree?

This forum was archived on 2017-11-26.