CRM_Core_DAO::getAttribute('CRM_Core_DAO_OptionValue', 'description')
);
-
$this->add('checkbox', 'is_active', ts('Enabled?'));
if ($this->_action == CRM_Core_Action::UPDATE &&
CRM_Campaign_BAO_Survey::retrieve($params, $this->_surveyDetails);
}
- $orderClause = false;
+ $orderClause = FALSE;
$buttonName = $this->controller->getButtonName();
if ( $buttonName == '_qf_Interview_submit_orderBy' && !empty($_POST['order_bys'])) {
$orderByParams = CRM_Utils_Array::value('order_bys', $_POST);
}
- elseif ( CRM_Core_OptionGroup::getValue('activity_type','WalkList') == $this->_surveyDetails['activity_type_id'] ) {
+ elseif ( CRM_Core_OptionGroup::getValue('activity_type', 'WalkList') == $this->_surveyDetails['activity_type_id'] ) {
$orderByParams =
array(
1 => array(
}
}
-
//get the contact read only fields to display.
$readOnlyFields = array_merge(array(
'contact_type' => '',
$this->assign('surveyValues', $this->_surveyValues);
$result = CRM_Campaign_BAO_Survey::getReportID($this->_surveyId);
- $this->assign("instanceId",$result);
+ $this->assign("instanceId", $result);
//get the survey result options.
$this->_resultOptions = $this->get('resultOptions');
}
public function validateIds() {
- $required = array('surveyId' => ts('Could not find Survey.'),
+ $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.'),
'resultOptions' => ts('Oops. It looks like there is no response option configured.'),
$this->assign('surveyTypeId', $this->_surveyTypeId);
$options =
- array('' => ' - none - ',
+ array(
+ '' => ' - none - ',
'civicrm_address.street_name' => 'Street Name',
'civicrm_address.street_number%2' => 'Odd / Even Street Number',
'civicrm_address.street_number' => 'Street Number',
}
$buttons = array(
- array('type' => 'cancel',
+ array(
+ 'type' => 'cancel',
'name' => ts('Done'),
'subName' => 'interview',
'isDefault' => TRUE,
}
}
- if ( CRM_Core_OptionGroup::getValue('activity_type','WalkList') == $this->_surveyDetails['activity_type_id'] ) {
+ if ( CRM_Core_OptionGroup::getValue('activity_type', 'WalkList') == $this->_surveyDetails['activity_type_id'] ) {
$defaults['order_bys'] =
array(
1 => array(
$statusIds
);
$this->_contactIds = array();
- foreach ($surveyActivities as $val) $this->_contactIds[$val['voter_id']] = $val['voter_id'];
+ foreach ($surveyActivities as $val) { $this->_contactIds[$val['voter_id']] = $val['voter_id'];
+ }
$this->set('contactIds', $this->_contactIds);
}
}
$this->assign('hasExistingGroups', $hasExistingGroups);
$buttons = array(
- array('type' => 'done',
+ array(
+ 'type' => 'done',
'name' => ts('Reserve'),
'subName' => 'reserve',
'isDefault' => TRUE,
$title = trim($fields['newGroupName']);
$name = CRM_Utils_String::titleToVar($title);
$query = 'select count(*) from civicrm_group where name like %1 OR title like %2';
- $grpCnt = CRM_Core_DAO::singleValueQuery($query, array(1 => array($name, 'String'),
+ $grpCnt = CRM_Core_DAO::singleValueQuery($query, array(
+ 1 => array($name, 'String'),
2 => array($title, 'String'),
));
if ($grpCnt) {
foreach ($this->_contactIds as $cid) {
$subject = ts('%1', array(1 => $this->_surveyDetails['title'])) . ' - ' . ts('Respondent Reservation');
$session = CRM_Core_Session::singleton();
- $activityParams = array('source_contact_id' => $session->get('userID'),
+ $activityParams = array(
+ 'source_contact_id' => $session->get('userID'),
'assignee_contact_id' => array($this->_interviewerId),
'target_contact_id' => array($cid),
'source_record_id' => $this->_surveyId,
*
* @return void
*/
- public function preProcess() {}
+ public function preProcess() {
+ }
/**
* Build the form object
CRM_Core_Permission::check('administer CiviCampaign')
) {
$shortCuts = array_merge($shortCuts, array(
- array('path' => 'civicrm/campaign/add',
+ array(
+ 'path' => 'civicrm/campaign/add',
'query' => "reset=1&action=add",
'ref' => 'new-campaign',
'title' => ts('Campaign'),
$groups = CRM_Utils_Array::value('group', $params);
if ($campaignId && CRM_Utils_System::isNull($groups)) {
$campaignGroups = CRM_Campaign_BAO_Campaign::getCampaignGroups($campaignId);
- foreach ($campaignGroups as $id => $group) $params['group'][$id] = 1;
+ foreach ($campaignGroups as $id => $group) { $params['group'][$id] = 1;
+ }
}
//apply filter of survey contact type for search.
// get the data table params.
$dataTableParams = array(
- 'sEcho' => array('name' => 'sEcho',
+ 'sEcho' => array(
+ 'name' => 'sEcho',
'type' => 'Integer',
'default' => 0,
),
$$pName = $pValues['default'];
if (!empty($_POST[$pValues['name']])) {
$$pName = CRM_Utils_Type::escape($_POST[$pValues['name']], $pValues['type']);
- if ($pName == 'sort')$$pName = $selectorCols[$$pName];
+ if ($pName == 'sort') { $$pName = $selectorCols[$$pName];
+ }
}
}
);
while ($result->fetch()) {
$contactID = $result->contact_id;
- $typeImage = CRM_Contact_BAO_Contact_Utils::getImage($result->contact_sub_type ?
- $result->contact_sub_type : $result->contact_type,
+ $typeImage = CRM_Contact_BAO_Contact_Utils::getImage($result->contact_sub_type ? $result->contact_sub_type : $result->contact_type,
FALSE,
$result->contact_id
);
$currentCampaigns = CRM_Campaign_BAO_Campaign::getCampaigns();
$campaigns = CRM_Campaign_BAO_Campaign::getCampaigns(NULL, NULL, TRUE, FALSE, TRUE);
$options = array(
- array('value' => '',
+ array(
+ 'value' => '',
'title' => ts('- select -'),
));
foreach ($campaigns as $value => $title) {
$campGroups = CRM_Core_PseudoConstant::group();
}
$groups = array(
- array('value' => '',
+ array(
+ 'value' => '',
'title' => ts('- select -'),
));
foreach ($campGroups as $grpId => $title) {
// get the data table params.
$dataTableParams = array(
- 'sEcho' => array('name' => 'sEcho',
+ 'sEcho' => array(
+ 'name' => 'sEcho',
'type' => 'Integer',
'default' => 0,
),
// get the data table params.
$dataTableParams = array(
- 'sEcho' => array('name' => 'sEcho',
+ 'sEcho' => array(
+ 'name' => 'sEcho',
'type' => 'Integer',
'default' => 0,
),
// get the data table params.
$dataTableParams = array(
- 'sEcho' => array('name' => 'sEcho',
+ 'sEcho' => array(
+ 'name' => 'sEcho',
'type' => 'Integer',
'default' => 0,
),
}
if ($reportID = CRM_Campaign_BAO_Survey::getReportID($sid)) {
- $url = CRM_Utils_System::url("civicrm/report/instance/{$reportID}",'reset=1');
+ $url = CRM_Utils_System::url("civicrm/report/instance/{$reportID}", 'reset=1');
$surveysData[$sid]['title'] = "<a href='{$url}' title='View Survey Report'>{$surveysData[$sid]['title']}</a>";
}
}
}
CRM_Core_Resources::singleton()
->addScriptFile('civicrm', 'templates/CRM/common/TabHeader.js', 1, 'html-header')
- ->addSetting(array('tabSettings' => array(
+ ->addSetting(array(
+ 'tabSettings' => array(
'active' => strtolower(CRM_Utils_Array::value('subPage', $_GET, 'campaign')),
)));
}
*/
public function run() {
CRM_Utils_System::addHTMLHead('<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">');
-
+
$contact_id = CRM_Utils_Request::retrieve('cid', 'Integer', CRM_Core_DAO::$_nullObject);
$subscribe_id = CRM_Utils_Request::retrieve('sid', 'Integer', CRM_Core_DAO::$_nullObject);
$hash = CRM_Utils_Request::retrieve('h', 'String', CRM_Core_DAO::$_nullObject);
* 2 = send a confirmation request email
*/
-
return parent::run();
}
}
}
public function browse() {
- $this->_tabs = array('reserve' => ts('Reserve Respondents'),
+ $this->_tabs = array(
+ 'reserve' => ts('Reserve Respondents'),
'interview' => ts('Interview Respondents'),
);
CRM_Core_Resources::singleton()
->addScriptFile('civicrm', 'templates/CRM/common/TabHeader.js', 1, 'html-header')
- ->addSetting(array('tabSettings' => array(
+ ->addSetting(array(
+ 'tabSettings' => array(
'active' => strtolower(CRM_Utils_Array::value('subPage', $_GET, 'reserve')),
)));
}
* @param bool|string $name pseudoconstant to be flushed
*/
public static function flush($name = 'cache') {
- if (isset(self::$$name)) {
+ if (isset(self::$$name)) {
self::$$name = NULL;
- }
+ }
}
}
@access public
*/
function __construct(&$queryParams,
- $action = CRM_Core_Action::NONE,
+ $action = CRM_Core_Action::NONE,
$surveyClause = NULL,
- $single = FALSE,
- $limit = NULL,
- $context = 'search'
+ $single = FALSE,
+ $limit = NULL,
+ $context = 'search'
) {
// submitted form values
$this->_queryParams = &$queryParams;
$this->_campaignFromClause
);
-
// process the result of the query
$rows = array();
- While ($result->fetch()) {
+ while ($result->fetch()) {
$this->_query->convertToPseudoNames($result);
$row = array();
// the columns we are interested in
if (!$this->_single) {
$contactDetails = array(
- array('name' => ts('Contact Name'),
+ array(
+ 'name' => ts('Contact Name'),
'sort' => 'sort_name',
'direction' => CRM_Utils_Sort::ASCENDING,
),
- array('name' => ts('Street Number'),
+ array(
+ 'name' => ts('Street Number'),
'sort' => 'street_number',
),
- array('name' => ts('Street Name'),
+ array(
+ 'name' => ts('Street Name'),
'sort' => 'street_name',
),
array('name' => ts('Street Address')),
- array('name' => ts('City'),
+ array(
+ 'name' => ts('City'),
'sort' => 'city',
),
- array('name' => ts('Postal Code'),
+ array(
+ 'name' => ts('Postal Code'),
'sort' => 'postal_code',
),
- array('name' => ts('State'),
+ array(
+ 'name' => ts('State'),
'sort' => 'state_province_name',
),
array('name' => ts('Country')),
*/
public static function &tasks() {
if (!(self::$_tasks)) {
- self::$_tasks = array(1 => array(
+ self::$_tasks = array(
+ 1 => array(
'title' => ts('Record Respondents Interview'),
'class' => array(
'CRM_Campaign_Form_Task_Interview',