From 056878d2a50c185e25967393df343ef0a256fc97 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Sun, 6 Mar 2016 21:08:36 -0500 Subject: [PATCH] CRM-17607 - Fix document showing up as activity type --- CRM/Activity/Form/Activity.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) 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]); - } } /** -- 2.25.1