Skip to content

Commit

Permalink
Merge pull request civicrm#13613 from colemanw/openCampaignWidget
Browse files Browse the repository at this point in the history
Auto-open campaign widget and sort by start date
  • Loading branch information
eileenmcnaughton authored Feb 16, 2019
2 parents 2d73915 + 33ccf43 commit f386cb1
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions CRM/Campaign/BAO/Campaign.php
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,7 @@ public static function addCampaign(&$form, $connectedCampaignId = NULL) {
$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) {
Expand Down
1 change: 1 addition & 0 deletions CRM/Campaign/Form/Petition.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ public function buildQuickForm() {
$this->addEntityRef('campaign_id', ts('Campaign'), [
'entity' => 'campaign',
'create' => TRUE,
'select' => ['minimumInputLength' => 0],
]);

$customContactProfiles = CRM_Core_BAO_UFGroup::getProfiles(array('Individual'));
Expand Down
1 change: 1 addition & 0 deletions CRM/Campaign/Form/Survey/Main.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ public function buildQuickForm() {
$this->addEntityRef('campaign_id', ts('Campaign'), [
'entity' => 'campaign',
'create' => TRUE,
'select' => ['minimumInputLength' => 0],
]);

// script / instructions
Expand Down
1 change: 1 addition & 0 deletions api/v3/Campaign.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
];
Expand Down

0 comments on commit f386cb1

Please sign in to comment.