<?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$
*
*/
}
// when custom data is included in form.
- if (CRM_Utils_Array::value('hidden_custom', $_POST)) {
+ if (!empty($_POST['hidden_custom'])) {
$this->set('type', 'Campaign');
$this->set('subType', CRM_Utils_Array::value('campaign_type_id', $_POST));
$this->set('entityId', $this->_campaignId);
*
* @access public
*
- * @return None
+ * @return void
*/
function setDefaultValues() {
$defaults = $this->_values;
return CRM_Custom_Form_CustomData::buildQuickForm($this);
}
- //campaign types.
- $campaignTypes = CRM_Campaign_PseudoConstant::campaignType();
-
//lets assign custom data type and subtype.
$this->assign('customDataType', 'Campaign');
$this->assign('entityID', $this->_campaignId);
$this->addDateTime('end_date', ts('End Date'), FALSE, array('formatType' => 'activityDateTime'));
// add campaign type
- $this->add('select', 'campaign_type_id', ts('Campaign Type'),
- array(
- '' => ts('- select -')) + $campaignTypes, TRUE,
- array('onChange' => "CRM.buildCustomData( 'Campaign', this.value );")
- );
+ $this->addSelect('campaign_type_id', array('onChange' => "CRM.buildCustomData( 'Campaign', this.value );"), TRUE);
// add campaign status
- $campaignStatus = CRM_Campaign_PseudoConstant::campaignStatus();
- $this->addElement('select', 'status_id', ts('Campaign Status'),
- array(
- '' => ts('- select -')) + $campaignStatus
- );
+ $this->addSelect('status_id');
// add External Identifire Element
$this->add('text', 'external_identifier', ts('External Id'),
* This function is used to add the rules (mainly global rules) for form.
* All local rules are added near the element
*
- * @return None
+ * @return void
* @access public
* @see valid_date
*/
*
* @access public
*
- * @return None
+ * @return void
*/
public function postProcess() {
// store the submitted values in an array