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 Profiles (Moderator: Dave Greenberg) »
  • What is needed to add activities in a profile ?
Pages: [1]

Author Topic: What is needed to add activities in a profile ?  (Read 2241 times)

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
What is needed to add activities in a profile ?
August 19, 2009, 08:10:15 am
Hi,

I would like to ask structured questions to contacts, so they can register and fill these extra fields.

Right now, I have to add these fields to the individual, create a profile XX and send a link to the registration form:
/civicrm/profile/create?gid=XX&reset=1

However, some of these fields are linked to an activity (can be a yearly survey, a recruitement, a feed back evaluation after a meeting...) not to an individual.

I wanted to create a new kind of activity (eg recruitement), with a few extra fields (experience, bla bla) and put it in the profile.

Some issues:

1) It isn't possible to create a profile for activities
2) mixing various entities (participants+individual+org) fields don't mix very well anyway.

Would it be possible to change civicrm to handle that ? Would it be difficult ?

And do you think that's useful ?

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: What is needed to add activities in a profile ?
August 19, 2009, 08:23:03 am

I needed to do something similar for my "school project". I want to allow the parent to schedule an appointment with the teacher on a specific day in one of the available meeting slots

I modeled this as an activity (since a meeting fits perfectly with the activity model!). Since the meeting slots were fixed, i created the activities before hand but left the "with contact" empty. In the profile i use the buildForm hook to inject a select html element of available slots and i use the postProcess hook to update the appropriate activity. Works quite nicely :)

I also have done something similar to embed custom data with multiple records in profiles. All the code is available here:

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

Based on what i did, i think its not a trivial project to generalize and add to CiviCRM core. in general all 1 -> n relationships have certain assumptions on how they are managed and handled and whats considered a duplicate (and hence should be updated) and whats a new record.

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: What is needed to add activities in a profile ?
August 21, 2009, 06:34:59 am
Neat !

You're proably right about the assumption on when to add vs. when to update...

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

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Profiles (Moderator: Dave Greenberg) »
  • What is needed to add activities in a profile ?

This forum was archived on 2017-11-26.