<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.5 |
+ | CiviCRM version 4.6 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2014 |
+ | Copyright CiviCRM LLC (c) 2004-2015 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
| 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$
*
*/
class CRM_Campaign_Form_Survey extends CRM_Core_Form {
/**
- * The id of the object being edited
+ * The id of the object being edited.
*
* @var int
*/
protected $_surveyId;
/**
- * Action
+ * Action.
*
* @var int
*/
protected $_action;
/**
- * SurveyTitle
+ * SurveyTitle.
*
* @var string
*/
CRM_Utils_System::permissionDenied();
}
- $this->_action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 'add', 'REQUEST');
+ $this->_action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 'add', 'REQUEST');
$this->_surveyId = CRM_Utils_Request::retrieve('id', 'Positive', $this, FALSE);
if ($this->_surveyId) {
}
/**
- * Build the form object
- *
- * @param null
+ * Build the form object.
*
* @return void
- * @access public
*/
public function buildQuickForm() {
$session = CRM_Core_Session::singleton();
$buttons = array(
array(
'type' => 'upload',
- 'name' => ts('Continue >>'),
+ 'name' => ts('Continue'),
'spacing' => ' ',
'isDefault' => TRUE,
),
);
}
- $buttons[] =
- array(
- 'type' => 'cancel',
- 'name' => ts('Cancel'),
- );
+ $buttons[] = array(
+ 'type' => 'cancel',
+ 'name' => ts('Cancel'),
+ );
$this->addButtons($buttons);
$url = CRM_Utils_System::url('civicrm/campaign', 'reset=1&subPage=survey');
$session->replaceUserContext($url);
}
- function endPostProcess() {
+ public function endPostProcess() {
// make submit buttons keep the current working tab opened.
if ($this->_action & (CRM_Core_Action::UPDATE | CRM_Core_Action::ADD)) {
$tabTitle = $className = CRM_Utils_String::getClassName($this->_name);
if ($tabTitle == 'Main') {
$tabTitle = 'Main settings';
}
- $subPage = strtolower($className);
+ $subPage = strtolower($className);
CRM_Core_Session::setStatus(ts("'%1' have been saved.", array(1 => $tabTitle)), ts('Saved'), 'success');
$this->postProcessHook();
- if ($this->_action & CRM_Core_Action::ADD)
+ if ($this->_action & CRM_Core_Action::ADD) {
CRM_Utils_System::redirect(CRM_Utils_System::url("civicrm/survey/configure/questions",
- "action=update&reset=1&id={$this->_surveyId}"));
-
+ "action=update&reset=1&id={$this->_surveyId}"));
+ }
if ($this->controller->getButtonName('submit') == "_qf_{$className}_upload_done") {
CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/campaign', 'reset=1&subPage=survey'));
}
- else if ($this->controller->getButtonName('submit') == "_qf_{$className}_upload_next") {
+ elseif ($this->controller->getButtonName('submit') == "_qf_{$className}_upload_next") {
$subPage = CRM_Campaign_Form_Survey_TabHeader::getNextTab($this);
CRM_Utils_System::redirect(CRM_Utils_System::url("civicrm/survey/configure/{$subPage}",
- "action=update&reset=1&id={$this->_surveyId}"));
+ "action=update&reset=1&id={$this->_surveyId}"));
}
else {
CRM_Utils_System::redirect(CRM_Utils_System::url("civicrm/survey/configure/{$subPage}",
- "action=update&reset=1&id={$this->_surveyId}"));
+ "action=update&reset=1&id={$this->_surveyId}"));
}
}
}
/**
* @return string
*/
- function getTemplateFileName() {
- if ($this->controller->getPrint() || $this->getVar('_surveyId') <= 0 ) {
+ public function getTemplateFileName() {
+ if ($this->controller->getPrint() || $this->getVar('_surveyId') <= 0) {
return parent::getTemplateFileName();
}
else {
return 'CRM/Campaign/Form/Survey/Tab.tpl';
}
}
-}
+}