X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FCampaign%2FForm%2FCampaign.php;h=55127b05b9079d7a5d5b8feb717a0732798dd951;hb=d44c681d9105af668449d16d9f53832d7982f47e;hp=b46d808dc829eb12dd6e4dab41d8c6160ce4f8ac;hpb=4a8df013afdba3cc2808b721a47e2aec3edc4b61;p=civicrm-core.git diff --git a/CRM/Campaign/Form/Campaign.php b/CRM/Campaign/Form/Campaign.php index b46d808dc8..55127b05b9 100644 --- a/CRM/Campaign/Form/Campaign.php +++ b/CRM/Campaign/Form/Campaign.php @@ -131,12 +131,12 @@ class CRM_Campaign_Form_Campaign extends CRM_Core_Form { } /** - * This function sets the default values for the form. Note that in edit/view mode + * Set default values for the form. Note that in edit/view mode * the default values are retrieved from the database * * @access public * - * @return void + * @return array */ function setDefaultValues() { $defaults = $this->_values; @@ -240,36 +240,31 @@ class CRM_Campaign_Form_Campaign extends CRM_Core_Form { // add campaign status $this->addSelect('status_id'); - // add External Identifire Element - $this->add('text', 'external_identifier', ts('External Id'), + // add External Identifier Element + $this->add('text', 'external_identifier', ts('External ID'), CRM_Core_DAO::getAttribute('CRM_Campaign_DAO_Campaign', 'external_identifier'), FALSE ); // add Campaign Parent Id - $campaigns = CRM_Campaign_BAO_Campaign::getCampaigns(CRM_Utils_Array::value('parent_id', $this->_values), - $this->_campaignId - ); + $campaigns = CRM_Campaign_BAO_Campaign::getCampaigns(CRM_Utils_Array::value('parent_id', $this->_values), $this->_campaignId); if (!empty($campaigns)) { - $this->addElement('select', 'parent_id', ts('Parent Id'), - array( - '' => ts('- select Parent -')) + $campaigns + $this->addElement('select', 'parent_id', ts('Parent ID'), + array('' => ts('- select Parent -')) + $campaigns, + array('class' => 'crm-select2') ); } - + $groups = CRM_Core_PseudoConstant::nestedGroup(); //get the campaign groups. - $groups = CRM_Core_PseudoConstant::group(); - - $inG = &$this->addElement('advmultiselect', 'includeGroups', - ts('Include Group(s)') . ' ', + $this->add('select', 'includeGroups', + ts('Include Group(s)'), $groups, + FALSE, array( - 'size' => 5, - 'style' => 'width:240px', - 'class' => 'advmultiselect', + 'multiple' => TRUE, + 'class' => 'crm-select2 huge', + 'placeholder' => ts('- none -'), ) ); - $inG->setButtonAttributes('add', array('value' => ts('Add >>'))); - $inG->setButtonAttributes('remove', array('value' => ts('<< Remove'))); $this->addWysiwyg('goal_general', ts('Campaign Goals'), array('rows' => 2, 'cols' => 40)); $this->add('text', 'goal_revenue', ts('Revenue Goal'), array('size' => 8, 'maxlength' => 12)); @@ -307,7 +302,7 @@ class CRM_Campaign_Form_Campaign extends CRM_Core_Form { * @param $files * @param $errors * - * @return void + * @return bool|array * @access public * @see valid_date */