Commit d7c5e6c3 authored by colemanw's avatar colemanw

#561 - Convert activity followup form date field

parent 9360fd2c
......@@ -2409,9 +2409,7 @@ AND cl.modified_id = c.id
$followupParams['target_contact_id'] = $params['target_contact_id'];
}
$followupParams['activity_date_time'] = CRM_Utils_Date::processDate($params['followup_date'],
$params['followup_date_time']
);
$followupParams['activity_date_time'] = $params['followup_date'];
$followupActivity = self::create($followupParams);
return $followupActivity;
......
......@@ -757,7 +757,7 @@ class CRM_Activity_Form_Activity extends CRM_Contact_Form_Task {
);
// Add followup date.
$this->addDateTime('followup_date', ts('in'), FALSE, array('formatType' => 'activityDateTime'));
$this->add('datepicker', 'followup_date', ts('in'));
// Only admins and case-workers can change the activity source
if (!CRM_Core_Permission::check('administer CiviCRM') && $this->_context != 'caseActivity') {
......@@ -872,7 +872,7 @@ class CRM_Activity_Form_Activity extends CRM_Contact_Form_Task {
}
if (!empty($fields['followup_activity_type_id']) && empty($fields['followup_date'])) {
$errors['followup_date_time'] = ts('Followup date is a required field.');
$errors['followup_date'] = ts('Followup date is a required field.');
}
// Activity type is mandatory if subject or follow-up date is specified for an Follow-up activity, CRM-4515.
if ((!empty($fields['followup_activity_subject']) || !empty($fields['followup_date'])) && empty($fields['followup_activity_type_id'])) {
......
......@@ -316,7 +316,7 @@ class CRM_Contact_Form_Task_EmailCommon {
);
//add followup date
$form->addDateTime('followup_date', ts('in'), FALSE, array('formatType' => 'activityDateTime'));
$form->add('datepicker', 'followup_date', ts('in'));
foreach ($fields as $field => $values) {
if (!empty($fields[$field])) {
......@@ -502,7 +502,6 @@ class CRM_Contact_Form_Task_EmailCommon {
$params['followup_activity_type_id'] = $formValues['followup_activity_type_id'];
$params['followup_activity_subject'] = $formValues['followup_activity_subject'];
$params['followup_date'] = $formValues['followup_date'];
$params['followup_date_time'] = $formValues['followup_date_time'];
$params['target_contact_id'] = $form->_contactIds;
$params['followup_assignee_contact_id'] = explode(',', $formValues['followup_assignee_contact_id']);
$followupActivity = CRM_Activity_BAO_Activity::createFollowupActivity($activityId, $params);
......
......@@ -6,8 +6,9 @@
<table class="form-layout-compressed">
<tr class="crm-{$type}activity-form-block-followup_activity_type_id">
<td class="label">{ts}Schedule Follow-up Activity{/ts}</td>
<td>{$form.followup_activity_type_id.html}&nbsp;&nbsp;{ts}on{/ts}
{include file="CRM/common/jcalendar.tpl" elementName=followup_date}
<td>
{$form.followup_activity_type_id.html}&nbsp;&nbsp;
{ts}on{/ts} {$form.followup_date.html}
</td>
</tr>
<tr class="crm-{$type}activity-form-block-followup_activity_subject">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment