The following issue summary comes from the CiviCRM discussion board - see http://forum.civicrm.org/index.php/topic,28877.0.html

CiviCRM webform does not honour the CiviCampaign petition data model - it simply sets the activity type to "Petition Signature", and does not assign a survey ID. Therefore, result cannot be integrated with the CiviCampaign workflow tools.

This issue captures the following features:

  1. Using Ajax, auto-load survey/petition entities associated with the selected campaign
  2. Assign the user-selected survey/petition to the activity

I have a working solution which is forthcoming for review.

Comments

mmikitka’s picture

mmikitka’s picture

Assigned: mmikitka » Unassigned
Status: Active » Needs review
colemanw’s picture

Status: Needs review » Needs work

Thanks for the patch. It will be good to get this module fully working with the survey/petition workflow.

Some comments/suggestions:

  1. A statement like if ($act_types[$activity_type] === 'Survey' || $act_types[$activity_type] === 'Petition Signature') will only work in the English language, and only if the labels haven't been changed. I think it would be better and more flexible to check the component type for the activity.
  2. The "Ignore Default Activity Subject" checkbox is unnecessary IMO. It would be simpler to just set the "Default Activity Subject" text based on the chosen survey with a tiny bit of jQuery (but still allow the user to edit it after doing so).
  3. The patch does not function correctly if the survey is not associated with a campaign, even though this is not required by the core CiviCRM UI. This seems to be a blocker.
  4. I get fatal errors when switching activity types or campaigns in the Webform CiviCRM backend. DB error: no such field.
mmikitka’s picture

Attached is an updated patch which resolves issue #4.

As for the other issues:

#1: I don't fully understand - what variable/method are you referring to?
#2: I agree, but I find the code hard to understand and I want to make minimal changes.
#3: No progress on this. Still in the queue.

colemanw’s picture

Status: Needs work » Needs review

I've revised your patch and committed a version that fixes issues 1-3.
See http://drupalcode.org/project/webform_civicrm.git/commitdiff/ac48311?hp=...

To explain:

  1. Added a way to grab only campaign-related activities, and check against that rather than checking the title
  2. Doing it via js is much more minimal than adding the extra setting, so I did it that way
  3. Made campaign id optional in the search

Please try it out and see if everything works as expected.

colemanw’s picture

Can you please give a thumbs up on this issue? I'd like to get a release out.

colemanw’s picture

Status: Needs review » Closed (fixed)

No reply, but it seems good to me. Closing issue.

mmikitka’s picture

Hi Coleman: Sorry for the delayed response. I tested the patch, and all is well. Thanks for the contribution.

matt