<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.5 |
+ | CiviCRM version 4.6 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
class CRM_Campaign_Form_Task_Interview extends CRM_Campaign_Form_Task {
/**
- * the title of the group
+ * The title of the group
*
* @var string
*/
protected $_title;
/**
- * variable to store redirect path
+ * Variable to store redirect path
*
*/
private $_userContext;
private $_allowAjaxReleaseButton;
/**
- * build all the data structures needed to build the form
+ * Build all the data structures needed to build the form
*
* @return void
* @access public
*/
- function preProcess() {
+ public function preProcess() {
$this->_votingTab = $this->get('votingTab');
$this->_reserveToInterview = $this->get('reserveToInterview');
if ($this->_reserveToInterview || $this->_votingTab) {
elseif ( CRM_Core_OptionGroup::getValue('activity_type','WalkList') == $this->_surveyDetails['activity_type_id'] ) {
$orderByParams =
array(
- 1 =>
- array(
+ 1 => array(
'column' => 'civicrm_address.street_name',
'order' => 'ASC',
),
- 2 =>
- array(
+ 2 => array(
'column' => 'civicrm_address.street_number%2',
'order' => 'ASC',
),
- 3 =>
- array(
+ 3 => array(
'column' => 'civicrm_address.street_number',
'order' => 'ASC',
),
- 4 =>
- array(
+ 4 => array(
'column' => 'contact_a.sort_name',
'order' => 'ASC',
),
CRM_Utils_System::setTitle(ts('Record %1 Responses', array(1 => $activityTypes[$this->_surveyTypeId])));
}
- function validateIds() {
+ public function validateIds() {
$required = array('surveyId' => ts('Could not find Survey.'),
'interviewerId' => ts('Could not find Interviewer.'),
'contactIds' => ts('No respondents are currently reserved for you to interview.'),
}
/**
- * Build the form
+ * Build the form object
*
* @access public
*
* @return void
*/
- function buildQuickForm() {
+ public function buildQuickForm() {
$this->assign('surveyTypeId', $this->_surveyTypeId);
$options =
}
/**
- * This function sets the default values for the form.
+ * Set default values for the form.
*
* @access public
*
* @return void
*/
- function setDefaultValues() {
+ public function setDefaultValues() {
//load default data for only contact fields.
$contactFields = $defaults = array();
foreach ($this->_surveyFields as $name => $field) {
if ( CRM_Core_OptionGroup::getValue('activity_type','WalkList') == $this->_surveyDetails['activity_type_id'] ) {
$defaults['order_bys'] =
array(
- 1 =>
- array(
+ 1 => array(
'column' => 'civicrm_address.street_name',
'order' => 'ASC',
),
- 2 =>
- array(
+ 2 => array(
'column' => 'civicrm_address.street_number%2',
'order' => 'ASC',
),
- 3 =>
- array(
+ 3 => array(
'column' => 'civicrm_address.street_number',
'order' => 'ASC',
),
- 4 =>
- array(
+ 4 => array(
'column' => 'contact_a.sort_name',
'order' => 'ASC',
),
}
/**
- * process the form after the input has been submitted and validated
+ * Process the form after the input has been submitted and validated
*
* @access public
*
}
/**
- * @param $params
+ * @param array $params
*
* @return mixed
*/
- static function registerInterview($params) {
+ public static function registerInterview($params) {
$activityId = CRM_Utils_Array::value('activity_id', $params);
$surveyTypeId = CRM_Utils_Array::value('activity_type_id', $params);
if (!is_array($params) || !$surveyTypeId || !$activityId) {
return $activityId;
}
- function getVoterIds() {
+ public function getVoterIds() {
if (!$this->_interviewerId) {
$session = CRM_Core_Session::singleton();
$this->_interviewerId = $session->get('userID');
}
}
- function filterVoterIds() {
+ public function filterVoterIds() {
//do the cleanup later on.
if (!is_array($this->_contactIds)) {
return;