'name' => CRM_Contact_BAO_SavedSearch::getName($this->_ssID, 'title'),
'search_custom_id' => $search_custom_id,
];
- $this->assign_by_ref('savedSearch', $savedSearchValues);
- $this->assign('ssID', $this->_ssID);
}
+ $this->assign('savedSearch', $savedSearchValues ?? NULL);
+ $this->assign('ssID', $this->_ssID);
if ($this->_context === 'smog') {
// CRM-11788, we might want to do this for all of search where force=1
$this->expectedSmartyVariables[] = $elementName;
}
+ /**
+ * Add an expected smarty variable to the array.
+ *
+ * @param array $elementNames
+ */
+ public function addExpectedSmartyVariables(array $elementNames): void {
+ foreach ($elementNames as $elementName) {
+ // Duplicates don't actually matter....
+ $this->addExpectedSmartyVariable($elementName);
+ }
+ }
+
/**
* Render form and return contents.
*
$this->handleForcedSearch();
}
$this->_formValues = $this->getFormValues();
+ // For searchResultsTasks.tpl.
+ $this->addExpectedSmartyVariables(['savedSearch', 'selectorLabel']);
}
/**
'id' => $this->_ssID,
'name' => CRM_Contact_BAO_SavedSearch::getName($this->_ssID, 'title'),
];
- $this->assign_by_ref('savedSearch', $savedSearchValues);
- $this->assign('ssID', $this->_ssID);
}
+ $this->assign('savedSearch', $savedSearchValues ?? NULL);
+ $this->assign('ssID', $this->_ssID);
$this->addTaskMenu($tasks);
}
<tr>
<td style="width: 40%;">
{if !empty($savedSearch.name)}{$savedSearch.name} ({ts}smart group{/ts}) - {/if}
- {ts count=$pager->_totalItems plural='%count Results'}%count Result{/ts}{if !empty($selectorLabel)} - {$selectorLabel}{/if}
+ {ts count=$pager->_totalItems plural='%count Results'}%count Result{/ts}{if $selectorLabel} - {$selectorLabel}{/if}
{if $context == 'Event' && $participantCount && ( $pager->_totalItems ne $participantCount ) }
<br />{ts}Actual participant count{/ts} : {$participantCount} {help id="id-actual_participant_count" file="CRM/Event/Form/Search/Results.hlp"}
{/if}