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) »
  • show custom php fields on the confirmation page.
Pages: [1]

Author Topic: show custom php fields on the confirmation page.  (Read 973 times)

Yoda_Oz

  • I post occasionally
  • **
  • Posts: 107
  • Karma: 2
  • CiviCRM version: 3.3.3
  • CMS version: Joomla 1.5.22
show custom php fields on the confirmation page.
June 23, 2010, 05:42:25 am
i have a custom php in a particular contribution form. it is basically a contact reference that shows organisations and then creates a relationship to the person filling in the form.
1. i need this to be mandatory, but i don't know how to do that in the php.
2. i also need to know the token or field name or whatever has the $ before it to make it show up on the confirm page.


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: show custom php fields on the confirmation page.
June 23, 2010, 08:03:58 am
Quote
1. i need this to be mandatory, but i don't know how to do that in the php.
Since you are already using custom php, you can modify the code to make it required. Check other places in CiviCRM where there is required field logic.

Quote
2. i also need to know the token or field name or whatever has the $ before it to make it show up on the confirm page.
You will have to assign this field to template ( smarty) and then modify templates to show it on confirmation and also thank your page.

HTh
Kurund
Found this reply helpful? Support CiviCRM

Yoda_Oz

  • I post occasionally
  • **
  • Posts: 107
  • Karma: 2
  • CiviCRM version: 3.3.3
  • CMS version: Joomla 1.5.22
Re: show custom php fields on the confirmation page.
June 23, 2010, 09:57:12 am
really sorry but ive just been searching for the last few hours on both those things and i cant find it anywhere!

ive even tried trial and error with the code but i just can't work either of these things out.

any chance you could point me in the right direction please?

Yoda_Oz

  • I post occasionally
  • **
  • Posts: 107
  • Karma: 2
  • CiviCRM version: 3.3.3
  • CMS version: Joomla 1.5.22
Re: show custom php fields on the confirmation page.
June 24, 2010, 05:17:42 am
well, i think i've sorted the mandatory field thing. please tell me if this is the right way to go about it:
the line with the +++ to the left of it is what i added...
Code: [Select]
$session            = & CRM_Core_Session::singleton( );
        $contactID          = $this->_userID;
        $contributionID     = $_GET['id'];
        $pastContributionID = $session->get( 'pastContributionID' );
       
        $dataURL = CRM_Utils_System::url( 'civicrm/ajax/contactlist',
                                          'excludePerm=1&org=1',
                                          false, null, false );
        $this->assign( 'organizatonDataURL', $dataURL );
        if ( in_array($contributionID, self::$_contribution_id) || in_array($session->get( 'pastContributionID' ), self::$_contribution_id)) {
            $this->add('text', 'existing_organization_id', ts('Select Organization ') );
 +++           $this->addRule( 'existing_organization_id', ts('%1 is a required field.', array(1 => ts('Club'))), 'required' );
        }

i still don't have the faintest on how to get this field to show up on the confirmation and the thank you pages though. i still need some help with that one please :)

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: show custom php fields on the confirmation page.
June 24, 2010, 05:35:23 am
Looks good to me.

Kurund
Found this reply helpful? Support CiviCRM

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • show custom php fields on the confirmation page.

This forum was archived on 2017-11-26.