From: Coleman Watts Date: Mon, 7 Mar 2016 02:08:36 +0000 (-0500) Subject: CRM-17607 - Fix document showing up as activity type X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=056878d2a50c185e25967393df343ef0a256fc97;p=civicrm-core.git CRM-17607 - Fix document showing up as activity type --- diff --git a/CRM/Activity/Form/Activity.php b/CRM/Activity/Form/Activity.php index 32dc72b26c..9100fc80f2 100644 --- a/CRM/Activity/Form/Activity.php +++ b/CRM/Activity/Form/Activity.php @@ -133,6 +133,10 @@ class CRM_Activity_Form_Activity extends CRM_Contact_Form_Task { * form fields based on their requirement */ public function setFields() { + // Remove print document activity type + $unwanted = CRM_Core_OptionGroup::values('activity_type', FALSE, FALSE, FALSE, "AND v.name = 'Print PDF Letter'"); + $activityTypes = array_diff_key(CRM_Core_PseudoConstant::ActivityType(FALSE), $unwanted); + $this->_fields = array( 'subject' => array( 'type' => 'text', @@ -198,7 +202,7 @@ class CRM_Activity_Form_Activity extends CRM_Contact_Form_Task { 'followup_activity_type_id' => array( 'type' => 'select', 'label' => ts('Followup Activity'), - 'attributes' => array('' => '- ' . ts('select activity') . ' -') + CRM_Core_PseudoConstant::ActivityType(FALSE), + 'attributes' => array('' => '- ' . ts('select activity') . ' -') + $activityTypes, 'extra' => array('class' => 'crm-select2'), ), // Add optional 'Subject' field for the Follow-up Activiity, CRM-4491 @@ -210,12 +214,6 @@ class CRM_Activity_Form_Activity extends CRM_Contact_Form_Task { ), ), ); - - if (($this->_context == 'standalone') && - ($printPDF = CRM_Utils_Array::key('Print PDF Letter', $this->_fields['followup_activity_type_id']['attributes'])) - ) { - unset($this->_fields['followup_activity_type_id']['attributes'][$printPDF]); - } } /**