<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.4 |
+ | CiviCRM version 4.5 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2013 |
+ | Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2013
+ * @copyright CiviCRM LLC (c) 2004-2014
* $Id$
*
*/
*
* @access public
*
- * @return void
+ * @return array
*/
function setDefaultValues() {
$defaults = $this->_values;
// 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));
* This function is used to add the rules (mainly global rules) for form.
* All local rules are added near the element
*
- * @return void
+ * @param $fields
+ * @param $files
+ * @param $errors
+ *
+ * @return bool|array
* @access public
* @see valid_date
*/