// this option should be available only during add mode
if ($this->_action != CRM_Core_Action::UPDATE) {
- $this->add('advcheckbox', 'is_multi_activity', ts('Create a separate activity for each contact.'));
+ $this->addRadio(
+ 'separation',
+ ts('Activity Separation'),
+ array(
+ 'separate' => ts('Create separate activities for each contact'),
+ 'combined' => ts('Create one activity with all contacts together'),
+ )
+ );
}
$this->addRule('duration',
if ((!empty($fields['followup_activity_subject']) || !empty($fields['followup_date'])) && empty($fields['followup_activity_type_id'])) {
$errors['followup_activity_subject'] = ts('Follow-up Activity type is a required field.');
}
+ $actionIsAdd = $self->_action == CRM_Core_Action::ADD;
+ $hasMultipleTargetContacts = !empty($fields['target_contact_id']) && strpos($fields['target_contact_id'], ',') !== FALSE;
+ $separationFieldIsEmpty = empty($fields['separation']);
+ if ($actionIsAdd && $hasMultipleTargetContacts && $separationFieldIsEmpty) {
+ $errors['separation'] = ts('Activity Separation is a required field.');
+ }
return $errors;
}
$this->_activityId
);
+ $params['is_multi_activity'] = CRM_Utils_Array::value('separation', $params) == 'separate';
+
$activity = array();
if (!empty($params['is_multi_activity']) &&
!CRM_Utils_Array::crmIsEmptyArray($params['target_contact_id'])
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
*}
-{htxt id="id-is_multi_activity-title"}
- {ts}Create Separate Activity Records?{/ts}
+{htxt id="separation-title"}
+ {ts}Activity Separation{/ts}
{/htxt}
-{htxt id="id-is_multi_activity"}
- <p>{ts}By default a single activity record will be created and linked to all the contacts listed above. However, if you think you might be editing the activity later - and entering different information for different contacts - check this box to create separate activity records.{/ts}</p>
+{htxt id="separation"}
+ <p>{ts}With separate activities, you can enter different activity information for different contacts after creating the activities.{/ts}</p>
+ <p>{ts}With a single activity, the activity information cannot be customized for each contact.{/ts}</p>
{/htxt}
{htxt id="assignee_contact_id"}
<td class="label">{$form.target_contact_id.label}</td>
<td class="view-value">
{$form.target_contact_id.html}
- {if $action eq 1 or $single eq false}
- <div class="crm-is-multi-activity-wrapper">
- {$form.is_multi_activity.html} {$form.is_multi_activity.label} {help id="id-is_multi_activity"}
- </div>
- {/if}
</td>
</tr>
+ {if $action eq 1 or $single eq false}
+ <tr class="crm-activity-form-block-separation crm-is-multi-activity-wrapper">
+ <td class="label">{$form.separation.label}</td>
+ <td>{$form.separation.html} {help id="separation"}</td>
+ </tr>
+ {/if}
+
<tr class="crm-activity-form-block-assignee_contact_id">
<td class="label">
{$form.assignee_contact_id.label}