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) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Event Registration and profile
Pages: [1]

Author Topic: Event Registration and profile  (Read 5306 times)

TravelingPharaoh

  • I post occasionally
  • **
  • Posts: 39
  • Karma: 3
    • Traveling journey of a developer
  • CiviCRM version: 4.1.2
  • CMS version: Drupal 7
Event Registration and profile
November 15, 2009, 09:02:45 pm
I want my Drupal users to have access to modify the event registration profile after they have already registered.  Either just the profile or the whole event registration, without giving them access to civicrm.  Is there a way to do this?

Like the way the wollowing link can be seen civicrm/contact/view/participant?reset=1&action=update&id=52&cid=107

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: Event Registration and profile
November 16, 2009, 01:11:17 am
If user has access to CiviCRM and CiviEvent he can modify his contact record.

Kurund
Found this reply helpful? Support CiviCRM

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: Event Registration and profile
November 16, 2009, 06:38:46 am

I dont think there is an easy way for users to modify their "event registration profile" AFTER they have registered without giving them a LOT of access

If the event registration profile is just an individual profile, then you can expose that profile as an independent profile. But most event profiles are not individual profiles :(

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

TravelingPharaoh

  • I post occasionally
  • **
  • Posts: 39
  • Karma: 3
    • Traveling journey of a developer
  • CiviCRM version: 4.1.2
  • CMS version: Drupal 7
Re: Event Registration and profile
November 16, 2009, 10:20:40 am
there is an api to rebuild a profile but it requires the userId, do you think its would use it as the participant to retrieve it?

How do you go to the custom table in the case when its a participant?  using the participant and event id?

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Event Registration and profile
November 16, 2009, 10:57:34 am
What do you mean by rebuild a profile ?

You want the custom fields of the participants or the custom fields of the contact ?

X+
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

TravelingPharaoh

  • I post occasionally
  • **
  • Posts: 39
  • Karma: 3
    • Traveling journey of a developer
  • CiviCRM version: 4.1.2
  • CMS version: Drupal 7
Re: Event Registration and profile
November 16, 2009, 11:17:44 am
I meant build an html profile for participants custom fields.

The real problem is that a participant might not have the information required for this profile when he registers to the event, so we want him to update it later.

TravelingPharaoh

  • I post occasionally
  • **
  • Posts: 39
  • Karma: 3
    • Traveling journey of a developer
  • CiviCRM version: 4.1.2
  • CMS version: Drupal 7
Re: Event Registration and profile
November 16, 2009, 10:40:12 pm
I've managed to create the profile HTML by extracting how the its done by the profile API without the filter for the contact.  But It doesn't populate it with any data, if the register option is 1 then it creates empty fields otherwise doesn't create html.

How can I populate the data in the HTML? or is there another function to do that?

this is what I did

   $controller =& new CRM_Core_Controller_Simple( 'CRM_Profile_Form_Dynamic',
   ts('Dynamic Form Creator'),$action );
   // if ( $reset ) {
      // $controller->reset( );
   // }
   $controller->set( 'gid'     , $profile_id );
   $controller->set( 'id'      , $participant_id );
   $controller->set( 'register', 0 );
   $controller->set( 'skipPermission', 1 );
   //if ( $ctype ) {
      $controller->set( 'ctype'   , 'Participant' );
   //}
   $controller->process( );
   $controller->setEmbedded( true );
   $controller->run( );
   
   $template =& CRM_Core_Smarty::singleton( );

   $templateFile = "CRM/Profile/Form/{$profile_id}/Dynamic.tpl";
   if ( ! $template->template_exists( $templateFile ) ) {
      $templateFile = "CRM/Profile/Form/Dynamic.tpl";
   }
   $output=trim( $template->fetch( $templateFile ) );

TwoMice

  • I post frequently
  • ***
  • Posts: 214
  • Karma: 16
    • Emphanos
  • CiviCRM version: Always current stable version
  • CMS version: Drupal 7
Re: Event Registration and profile
May 15, 2010, 10:08:19 pm
I know the thread is a little old, but I must ask if you had any luck with any of this.  This is also a requirement in my current project, for basically the same reasons (user may not have all the info at time of initial registration).  I thought the profile APIs would do the trick, but sounds like you had trouble with it.

So if that doesn't work, what's left -- hard-code a form with the fields you need?  Ick.  Emulate the profile creation logic and substitute your own permission logic? Less icky, but not ideal.

I'd like to hear how you finally dealt with the issue, if at all.

Thanks,
Allen
Please consider contributing to help improve CiviCRM with the Make it Happen! initiative.

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Event Registration and profile
May 16, 2010, 02:30:25 am
You can already use profiles to edit, and with checksum, you can let it be used by the end user.

The only thing missing I think is that this only works on contact datas, but you'd like to have it I'm assuming is on participant fields.

Instead of developing your own interface, it might be easier to add on the existing profile edit the code needed so it handles the participants data ?

X+
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

TwoMice

  • I post frequently
  • ***
  • Posts: 214
  • Karma: 16
    • Emphanos
  • CiviCRM version: Always current stable version
  • CMS version: Drupal 7
Re: Event Registration and profile
May 16, 2010, 07:19:37 am
xavier,

Quote
Instead of developing your own interface, it might be easier to add on the existing profile edit the code needed so it handles the participants data ?

Is that feasible?  Sure, I'd love to see CiviCRM native support for "edit my registration", but Lobo's comment in this thread makes me think this could be a pretty complex modification.  I wonder if it will even be possible in 3.1 without breaking something in 3.2.  :(

I'll need this capability one way or another before 3.2 stable is released (which I'm guessing is not "June 2010"), but I'm still interested in getting it into civi core if that's possible.

If I were to start working on it, any clues on where to look?  CRM_Core_BAO_UFGroup?  Something under CRM_UF?

Thanks,
Allen

Please consider contributing to help improve CiviCRM with the Make it Happen! initiative.

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Event Registration and profile
May 16, 2010, 08:19:43 am
lobo:

what would be the complexity of changing profile to be able to save/pre-load the profiles with an extra param participantid so it can handle both participant fields & contact fields ?

The function on creation (not modif) exists already for the event registration), and you can already modify status or role with RSVP types of event (not quite sure the RSVP works still, got to read the chapter again).


I'd start with the profile edit form CRM/Profile/Form/Edit.php, use it with a profile that does have both contacts & participants, try to add a participantid in the url and see where it goes.

X+

-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

TravelingPharaoh

  • I post occasionally
  • **
  • Posts: 39
  • Karma: 3
    • Traveling journey of a developer
  • CiviCRM version: 4.1.2
  • CMS version: Drupal 7
Re: Event Registration and profile
May 16, 2010, 07:24:09 pm
I ended up building a drupal form for the profile fields, populate them and access the database directly.  But certainly would be great to be able to access a participant profile from drupal, or at least to build one.  in my case the user could be registered to multiple events, so I had to create  agroup for every event the user participated in.

Quote from: TwoMice on May 15, 2010, 10:08:19 pm
I know the thread is a little old, but I must ask if you had any luck with any of this.  This is also a requirement in my current project, for basically the same reasons (user may not have all the info at time of initial registration).  I thought the profile APIs would do the trick, but sounds like you had trouble with it.

So if that doesn't work, what's left -- hard-code a form with the fields you need?  Ick.  Emulate the profile creation logic and substitute your own permission logic? Less icky, but not ideal.

I'd like to hear how you finally dealt with the issue, if at all.

Thanks,
Allen

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: Event Registration and profile
May 16, 2010, 07:54:04 pm
Quote from: xavier on May 16, 2010, 08:19:43 am
what would be the complexity of changing profile to be able to save/pre-load the profiles with an extra param participantid so it can handle both participant fields & contact fields ?

to generalize it for all objects (participant, contribution, member, activity) etc is a wee bit more complicated, but definitely doable

starting off with viewing / editing participant + contact profiles seems a reasonable first step

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

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Event Registration and profile

This forum was archived on 2017-11-26.