Commit 33ccf435 authored by colemanw's avatar colemanw

Auto-open campaign widget and sort by start date

parent 9493687a
......@@ -602,6 +602,7 @@ INNER JOIN civicrm_group grp ON ( grp.id = campgrp.entity_id )
$campaign = $form->addEntityRef('campaign_id', ts('Campaign'), [
'entity' => 'campaign',
'create' => TRUE,
'select' => ['minimumInputLength' => 0],
]);
//lets freeze when user does not has access or campaign is disabled.
if (!$isCampaignEnabled || !$hasAccessCampaign) {
......
......@@ -193,6 +193,7 @@ class CRM_Campaign_Form_Petition extends CRM_Core_Form {
$this->addEntityRef('campaign_id', ts('Campaign'), [
'entity' => 'campaign',
'create' => TRUE,
'select' => ['minimumInputLength' => 0],
]);
$customContactProfiles = CRM_Core_BAO_UFGroup::getProfiles(array('Individual'));
......
......@@ -132,6 +132,7 @@ class CRM_Campaign_Form_Survey_Main extends CRM_Campaign_Form_Survey {
$this->addEntityRef('campaign_id', ts('Campaign'), [
'entity' => 'campaign',
'create' => TRUE,
'select' => ['minimumInputLength' => 0],
]);
// script / instructions
......
......@@ -100,6 +100,7 @@ function _civicrm_api3_campaign_getlist_params(&$request) {
$fieldsToReturn = ['title', 'campaign_type_id', 'status_id', 'start_date', 'end_date'];
$request['params']['return'] = array_unique(array_merge($fieldsToReturn, $request['extra']));
if (empty($request['params']['id'])) {
$request['params']['options']['sort'] = 'start_date DESC, title';
$request['params'] += [
'is_active' => 1,
];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment