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) »
  • Handling expenses forms on civicrm
Pages: [1]

Author Topic: Handling expenses forms on civicrm  (Read 2424 times)

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Handling expenses forms on civicrm
August 13, 2009, 06:06:27 am
Hi,

On some events, some participants (eg speakers) are going to be reimbursed their cost (eg. food/hotel/transport).

The goal is to let them fill a form with the right fields (eg total amount to be reimbursed, bank number...) and let them fill the form directly.

My idea was to:
-add these fields (total, bank account...) to the participant profile (all the participants to this type of event, not only the speakers, and have it mostly empty)
- create a profile with these fields (rw) and some extra fields (eg. name/email) on read only
- create a custom template for the profile so you can't edit if the satus is not "waiting for datas from the participant" (ie. can't be modified if status == "expense claim approved"
- send the speakers a link to the participant form (profile) and use the "authentication" token to let them edit it without having a login/pwd


What do you think ? Will it work or do you have a better idea ?

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: Handling expenses forms on civicrm
August 13, 2009, 06:23:11 am

sounds like a good plan. only problem is profiles dont allow you to view / edit participant fields in "profile" mode :(

so a slightly different version along the same lines:

1. create a contact profile

2. ensure that the link u send out also includes the participantID so u know what participant record to edit

3. store this participantID in the session in the buildform hook (u'll retrieve this in postProcess). Also add your custom fields in this hook. And display them in custom templates.

4. in postProcess store the values

luckily for you, i just did somethign similar to handle a multi-record custom group. The code is here:

http://svn.civicrm.org/sfschool/trunk/drupal/

in specific check the ExtendedCare.php file and the custom template or profile edit 4

lobo

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

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Handling expenses forms on civicrm
August 13, 2009, 06:32:14 am
Thanks to put me in the right track.

Quote from: Donald Lobo on August 13, 2009, 06:23:11 am

2. ensure that the link u send out also includes the participantID so u know what participant record to edit


Raising the question: "is the participantID available as a token somehow in the mail/civicmail " ?
Assuming no, I'm guessing I need to
- add a hook on the template token to retrieve the participant id from contact id+event id
- or (easier) pass the event id as a parameter (constant no matter the contact) and retrieve the participant id within the hook you describe

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: Handling expenses forms on civicrm
August 13, 2009, 06:51:26 am

In 3.0 participantID is exposed to the final email. CiviMail does not expose participantID since each contact can have multiple ids (but as always you can expose it via the wonders of the hook!)

using an eventID is a great alternative and keeps the code simpler :)

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

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Handling expenses forms on civicrm
August 13, 2009, 07:23:16 am
Is there only 0 or 1 participantid for each contactid,event id or are they some edge cases (eg. with the test registration/different status/import...) ?
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

Kiran Jagtap

  • Ask me questions
  • ****
  • Posts: 533
  • Karma: 51
Re: Handling expenses forms on civicrm
August 14, 2009, 12:23:21 am
If i am not wrong -
1. Import process is respecting 1 - 1 mapping ( contact - event registration ).
( code is here : CRM_Event_BAO_Participant::checkDuplicate( ) )

2. online registration process require matching on ( event id, participant role id ) also we ignore test participants.
( http://issues.civicrm.org/jira/browse/CRM-3907 )
( code is here : CRM_Event_Form_Registration_Register::checkRegistration( ) )

3. In case of offline registration admin can register same contact multiple times to same event.
( there is no check )

kiran

 
You Are Designed To Choose... Defined By Choice.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviEvent (Moderator: Yashodha Chaku) »
  • Handling expenses forms on civicrm

This forum was archived on 2017-11-26.