Skip to content

Commit

Permalink
Fix setDefault on status id smart group formvalues
Browse files Browse the repository at this point in the history
  • Loading branch information
jitendrapurohit committed Jan 3, 2017
1 parent 041022c commit 86ddc1c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion CRM/Activity/BAO/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,13 @@ public static function buildSearchForm(&$form) {
$form->addSelect('status_id',
array('entity' => 'activity', 'multiple' => 'multiple', 'option_url' => NULL, 'placeholder' => ts('- any -'))
);
$form->setDefaults(array('status_id' => array($activityStatus['Completed'], $activityStatus['Scheduled'])));
$ssID = $form->get('ssID');
$status = array($activityStatus['Completed'], $activityStatus['Scheduled']);
if (!empty($ssID) && !empty($form->_formValues['activity_status_id'])) {
$status = $form->_formValues['activity_status_id'];
}
$form->setDefaults(array('status_id' => $status));

$form->addElement('text', 'activity_text', ts('Activity Text'), CRM_Core_DAO::getAttribute('CRM_Contact_DAO_Contact', 'sort_name'));

$form->addRadio('activity_option', '', CRM_Core_SelectValues::activityTextOptions());
Expand Down

0 comments on commit 86ddc1c

Please sign in to comment.