X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FCampaign%2FForm%2FSurvey%2FMain.php;h=2a7090f649835d84b91101750e2b4e517c48a979;hb=6e1a96bec4660bb24e8f6f8202a04ef5139fda8b;hp=84ab2f6a47a464657c17c56b1a5ff47862bb1fe6;hpb=29d98e1314e345f1b9044f5359c2d0a67f380d21;p=civicrm-core.git diff --git a/CRM/Campaign/Form/Survey/Main.php b/CRM/Campaign/Form/Survey/Main.php index 84ab2f6a47..2a7090f649 100644 --- a/CRM/Campaign/Form/Survey/Main.php +++ b/CRM/Campaign/Form/Survey/Main.php @@ -3,7 +3,7 @@ +--------------------------------------------------------------------+ | CiviCRM version 4.6 | +--------------------------------------------------------------------+ - | Copyright CiviCRM LLC (c) 2004-2014 | + | Copyright CiviCRM LLC (c) 2004-2015 | +--------------------------------------------------------------------+ | This file is a part of CiviCRM. | | | @@ -23,12 +23,12 @@ | GNU Affero General Public License or the licensing of CiviCRM, | | see the CiviCRM license FAQ at http://civicrm.org/licensing | +--------------------------------------------------------------------+ -*/ + */ /** * * @package CRM - * @copyright CiviCRM LLC (c) 2004-2014 + * @copyright CiviCRM LLC (c) 2004-2015 * $Id$ * */ @@ -40,19 +40,26 @@ class CRM_Campaign_Form_Survey_Main extends CRM_Campaign_Form_Survey { /* values - * - * @var array - */ + * + * @var array + */ public $_values; /** - * Context + * Context. * * @var string */ protected $_context; + /** + * Explicitly declare the entity api name. + */ + public function getDefaultEntity() { + return 'Survey'; + } + public function preProcess() { parent::preProcess(); @@ -104,8 +111,6 @@ class CRM_Campaign_Form_Survey_Main extends CRM_Campaign_Form_Survey { * Set default values for the form. Note that in edit/view mode * the default values are retrieved from the database * - * @param null - * * @return array * array of default values */ @@ -141,9 +146,7 @@ class CRM_Campaign_Form_Survey_Main extends CRM_Campaign_Form_Survey { } /** - * Build the form object - * - * @param null + * Build the form object. * * @return void */ @@ -163,7 +166,7 @@ class CRM_Campaign_Form_Survey_Main extends CRM_Campaign_Form_Survey { $this->add('select', 'campaign_id', ts('Campaign'), array('' => ts('- select -')) + $campaigns); // script / instructions - $this->addWysiwyg('instructions', ts('Instructions for interviewers'), array('rows' => 5, 'cols' => 40)); + $this->add('wysiwyg', 'instructions', ts('Instructions for interviewers'), array('rows' => 5, 'cols' => 40)); // release frequency $this->add('text', 'release_frequency', ts('Release Frequency'), CRM_Core_DAO::getAttribute('CRM_Campaign_DAO_Survey', 'release_frequency')); @@ -188,9 +191,7 @@ class CRM_Campaign_Form_Survey_Main extends CRM_Campaign_Form_Survey { } /** - * Process the form - * - * @param null + * Process the form. * * @return void */ @@ -229,7 +230,7 @@ class CRM_Campaign_Form_Survey_Main extends CRM_Campaign_Form_Survey { 1 => array( $this->_values['result_id'], 'Positive', - ) + ), ) ); // delete option group if no any survey is using it. @@ -240,4 +241,5 @@ class CRM_Campaign_Form_Survey_Main extends CRM_Campaign_Form_Survey { parent::endPostProcess(); } + }