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 CiviEvent (Moderator: Yashodha Chaku) »
  • Proposal for a new RSVP type: pre-filled registration forms
Pages: [1]

Author Topic: Proposal for a new RSVP type: pre-filled registration forms  (Read 855 times)

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Proposal for a new RSVP type: pre-filled registration forms
March 29, 2010, 03:10:39 am
I modified the doc and I'm willing to code to handle the  checksum if this is ok for you.

http://wiki.civicrm.org/confluence/display/CRM/RSVP-style+Event+Registration


Any suggestion or warnings if this is going to be more complicated than thought welcome.

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

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: Proposal for a new RSVP type: pre-filled registration forms
March 29, 2010, 07:09:05 am

i think it is relatively easy. I'd follow the contribution model and make changes in similar places :)

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

marc

  • Guest
Re: Proposal for a new RSVP type: pre-filled registration forms
March 29, 2010, 07:16:35 am
I have just tried to create the appropriate URL to send out in the emails using the template:

http://my-website.com/civicrm/event/register?id=5&reset=1&cid={contact.contact_id}&{contact.checksum}

and I get:

http://my-website.com/civicrm/event/register?id=5&reset=1&cid=<mycid>&cs=<checksum>&id=<mycid>

As you can see, by asking for the {contact.checksum}, I get the cs=<checksum>&id=<mycid>. This creates a conflict between the event-id and the contact id associated with the checksum.

Is there a way around this, ie fetch only checksum, and does CRM_Contact_BAO_Contact_Permission::validateOnlyChecksum need a contactId, despite the function's name?

Marc

marc

  • Guest
Re: Proposal for a new RSVP type: pre-filled registration forms
March 29, 2010, 07:50:48 am
Following Lobo's suggestion, it seems that I got it working by really just mildly tampering with the contribute code:
Quote
        $session =& CRM_Core_Session::singleton( );
            $contactID = $session->get( 'userID' );
            $id = CRM_Utils_Request::retrieve( 'id', 'Positive', $this, false, $userID );
        //get the userChecksum and contact id
        $userChecksum = CRM_Utils_Request::retrieve( 'cs', 'String', $this );
        $linkID    = CRM_Utils_Request::retrieve( 'cid', 'Positive', $this );

        $validUser = false;
        if ( $contactID ) {
            //check for authenticated  user.
            $validUser = true;
        } else if ( $userChecksum ) {
            //check for anonymous user.
            require_once 'CRM/Contact/BAO/Contact/Utils.php';
            $validUser = CRM_Contact_BAO_Contact_Utils::validChecksum( $linkID, $userChecksum );

            //make sure cid is same as pledge contact id
            $contactID = $linkID;
        }
       

The only thing to note is that it is important at the moment to put the link with the id of the event at the end like so:

http://my-website.com/civicrm/event/register?cid={contact.contact_id}&{contact.checksum}&id=5&reset=1

since the {contact.checksum} bit creates an &id=<mycid> bit that is otherwise interpreted as the event id.

Marc

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviEvent (Moderator: Yashodha Chaku) »
  • Proposal for a new RSVP type: pre-filled registration forms

This forum was archived on 2017-11-26.