Commit | Line | Data |
---|---|---|
6a488035 TO |
1 | <?php |
2 | /* | |
3 | +--------------------------------------------------------------------+ | |
fee14197 | 4 | | CiviCRM version 5 | |
6a488035 | 5 | +--------------------------------------------------------------------+ |
6b83d5bd | 6 | | Copyright CiviCRM LLC (c) 2004-2019 | |
6a488035 TO |
7 | +--------------------------------------------------------------------+ |
8 | | This file is a part of CiviCRM. | | |
9 | | | | |
10 | | CiviCRM is free software; you can copy, modify, and distribute it | | |
11 | | under the terms of the GNU Affero General Public License | | |
12 | | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. | | |
13 | | | | |
14 | | CiviCRM is distributed in the hope that it will be useful, but | | |
15 | | WITHOUT ANY WARRANTY; without even the implied warranty of | | |
16 | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | | |
17 | | See the GNU Affero General Public License for more details. | | |
18 | | | | |
19 | | You should have received a copy of the GNU Affero General Public | | |
20 | | License and the CiviCRM Licensing Exception along | | |
21 | | with this program; if not, contact CiviCRM LLC | | |
22 | | at info[AT]civicrm[DOT]org. If you have questions about the | | |
23 | | GNU Affero General Public License or the licensing of CiviCRM, | | |
24 | | see the CiviCRM license FAQ at http://civicrm.org/licensing | | |
25 | +--------------------------------------------------------------------+ | |
d25dd0ee | 26 | */ |
6a488035 TO |
27 | |
28 | /** | |
29 | * | |
30 | * @package CRM | |
6b83d5bd | 31 | * @copyright CiviCRM LLC (c) 2004-2019 |
6a488035 TO |
32 | */ |
33 | ||
34 | /** | |
35 | * This class is used to retrieve and display a range of | |
36 | * contacts that match the given criteria (specifically for | |
37 | * results of advanced search options. | |
6a488035 TO |
38 | */ |
39 | class CRM_Member_Selector_Search extends CRM_Core_Selector_Base implements CRM_Core_Selector_API { | |
40 | ||
41 | /** | |
42 | * This defines two actions- View and Edit. | |
43 | * | |
44 | * @var array | |
6a488035 | 45 | */ |
971e129b | 46 | public static $_links = NULL; |
6a488035 TO |
47 | |
48 | /** | |
100fef9d | 49 | * We use desc to remind us what that column is, name is used in the tpl |
6a488035 TO |
50 | * |
51 | * @var array | |
6a488035 | 52 | */ |
971e129b | 53 | public static $_columnHeaders; |
6a488035 TO |
54 | |
55 | /** | |
56 | * Properties of contact we're interested in displaying | |
57 | * @var array | |
6a488035 | 58 | */ |
971e129b | 59 | public static $_properties = [ |
6a488035 TO |
60 | 'contact_id', |
61 | 'membership_id', | |
62 | 'contact_type', | |
63 | 'sort_name', | |
64 | 'membership_type', | |
65 | 'join_date', | |
66 | 'membership_start_date', | |
67 | 'membership_end_date', | |
68 | 'membership_source', | |
69 | 'status_id', | |
70 | 'member_is_test', | |
71 | 'owner_membership_id', | |
72 | 'membership_status', | |
73 | 'member_campaign_id', | |
be2fb01f | 74 | ]; |
6a488035 TO |
75 | |
76 | /** | |
100fef9d | 77 | * Are we restricting ourselves to a single contact |
6a488035 | 78 | * |
d51c6add | 79 | * @var bool |
6a488035 TO |
80 | */ |
81 | protected $_single = FALSE; | |
82 | ||
83 | /** | |
100fef9d | 84 | * Are we restricting ourselves to a single contact |
6a488035 | 85 | * |
d51c6add | 86 | * @var bool |
6a488035 TO |
87 | */ |
88 | protected $_limit = NULL; | |
89 | ||
90 | /** | |
100fef9d | 91 | * What context are we being invoked from |
6a488035 | 92 | * |
6a488035 TO |
93 | * @var string |
94 | */ | |
95 | protected $_context = NULL; | |
96 | ||
97 | /** | |
100fef9d | 98 | * QueryParams is the array returned by exportValues called on |
6a488035 TO |
99 | * the HTML_QuickForm_Controller for that page. |
100 | * | |
101 | * @var array | |
6a488035 TO |
102 | */ |
103 | public $_queryParams; | |
104 | ||
105 | /** | |
fe482240 | 106 | * Represent the type of selector. |
6a488035 TO |
107 | * |
108 | * @var int | |
6a488035 TO |
109 | */ |
110 | protected $_action; | |
111 | ||
112 | /** | |
fe482240 | 113 | * The additional clause that we restrict the search with. |
6a488035 TO |
114 | * |
115 | * @var string | |
116 | */ | |
117 | protected $_memberClause = NULL; | |
118 | ||
119 | /** | |
fe482240 | 120 | * The query object. |
6a488035 TO |
121 | * |
122 | * @var string | |
123 | */ | |
124 | protected $_query; | |
125 | ||
126 | /** | |
fe482240 | 127 | * Class constructor. |
6a488035 | 128 | * |
b2363ea8 TO |
129 | * @param array $queryParams |
130 | * Array of parameters for query. | |
fd31fa4c | 131 | * @param \const|int $action - action of search basic or advanced. |
b2363ea8 TO |
132 | * @param string $memberClause |
133 | * If the caller wants to further restrict the search (used in memberships). | |
134 | * @param bool $single | |
135 | * Are we dealing only with one contact?. | |
136 | * @param int $limit | |
137 | * How many memberships do we want returned. | |
6a488035 | 138 | * |
fd31fa4c EM |
139 | * @param string $context |
140 | * | |
141 | * @return \CRM_Member_Selector_Search | |
fd31fa4c | 142 | */ |
317fceb4 | 143 | public function __construct( |
500cfe81 | 144 | &$queryParams, |
b09fe5ed | 145 | $action = CRM_Core_Action::NONE, |
6a488035 | 146 | $memberClause = NULL, |
b09fe5ed TO |
147 | $single = FALSE, |
148 | $limit = NULL, | |
149 | $context = 'search' | |
6a488035 TO |
150 | ) { |
151 | // submitted form values | |
152 | $this->_queryParams = &$queryParams; | |
153 | ||
353ffa53 TO |
154 | $this->_single = $single; |
155 | $this->_limit = $limit; | |
6a488035 TO |
156 | $this->_context = $context; |
157 | ||
158 | $this->_memberClause = $memberClause; | |
159 | ||
160 | // type of selector | |
161 | $this->_action = $action; | |
162 | ||
163 | $this->_query = new CRM_Contact_BAO_Query($this->_queryParams, | |
164 | CRM_Member_BAO_Query::defaultReturnProperties(CRM_Contact_BAO_Query::MODE_MEMBER, | |
165 | FALSE | |
166 | ), | |
167 | NULL, FALSE, FALSE, | |
168 | CRM_Contact_BAO_Query::MODE_MEMBER | |
169 | ); | |
170 | $this->_query->_distinctComponentClause = " civicrm_membership.id"; | |
171 | $this->_query->_groupByComponentClause = " GROUP BY civicrm_membership.id "; | |
172 | } | |
6a488035 TO |
173 | |
174 | /** | |
175 | * This method returns the links that are given for each search row. | |
3d469574 | 176 | * |
177 | * Currently the links added for each row are | |
6a488035 TO |
178 | * |
179 | * - View | |
180 | * - Edit | |
181 | * | |
da6b46f4 | 182 | * @param string $status |
3d469574 | 183 | * @param bool $isPaymentProcessor |
da6b46f4 EM |
184 | * @param null $accessContribution |
185 | * @param null $qfKey | |
186 | * @param null $context | |
187 | * @param bool $isCancelSupported | |
188 | * | |
6a488035 | 189 | * @return array |
6a488035 | 190 | */ |
317fceb4 | 191 | public static function &links( |
500cfe81 | 192 | $status = 'all', |
6a488035 TO |
193 | $isPaymentProcessor = NULL, |
194 | $accessContribution = NULL, | |
b09fe5ed TO |
195 | $qfKey = NULL, |
196 | $context = NULL, | |
197 | $isCancelSupported = FALSE | |
6a488035 TO |
198 | ) { |
199 | $extraParams = NULL; | |
200 | if ($context == 'search') { | |
201 | $extraParams .= '&compContext=membership'; | |
202 | } | |
203 | if ($qfKey) { | |
204 | $extraParams .= "&key={$qfKey}"; | |
205 | } | |
206 | ||
207 | if (!self::$_links['view']) { | |
be2fb01f CW |
208 | self::$_links['view'] = [ |
209 | CRM_Core_Action::VIEW => [ | |
6a488035 TO |
210 | 'name' => ts('View'), |
211 | 'url' => 'civicrm/contact/view/membership', | |
212 | 'qs' => 'reset=1&id=%%id%%&cid=%%cid%%&action=view&context=%%cxt%%&selectedChild=member' . $extraParams, | |
213 | 'title' => ts('View Membership'), | |
be2fb01f CW |
214 | ], |
215 | ]; | |
6a488035 TO |
216 | } |
217 | if (!isset(self::$_links['all']) || !self::$_links['all']) { | |
be2fb01f CW |
218 | $extraLinks = [ |
219 | CRM_Core_Action::UPDATE => [ | |
6a488035 TO |
220 | 'name' => ts('Edit'), |
221 | 'url' => 'civicrm/contact/view/membership', | |
222 | 'qs' => 'reset=1&action=update&id=%%id%%&cid=%%cid%%&context=%%cxt%%' . $extraParams, | |
223 | 'title' => ts('Edit Membership'), | |
be2fb01f CW |
224 | ], |
225 | CRM_Core_Action::DELETE => [ | |
6a488035 TO |
226 | 'name' => ts('Delete'), |
227 | 'url' => 'civicrm/contact/view/membership', | |
228 | 'qs' => 'reset=1&action=delete&id=%%id%%&cid=%%cid%%&context=%%cxt%%' . $extraParams, | |
229 | 'title' => ts('Delete Membership'), | |
be2fb01f CW |
230 | ], |
231 | CRM_Core_Action::RENEW => [ | |
6a488035 TO |
232 | 'name' => ts('Renew'), |
233 | 'url' => 'civicrm/contact/view/membership', | |
234 | 'qs' => 'reset=1&action=renew&id=%%id%%&cid=%%cid%%&context=%%cxt%%' . $extraParams, | |
235 | 'title' => ts('Renew Membership'), | |
be2fb01f CW |
236 | ], |
237 | CRM_Core_Action::FOLLOWUP => [ | |
6a488035 TO |
238 | 'name' => ts('Renew-Credit Card'), |
239 | 'url' => 'civicrm/contact/view/membership', | |
240 | 'qs' => 'action=renew&reset=1&cid=%%cid%%&id=%%id%%&context=%%cxt%%&mode=live' . $extraParams, | |
241 | 'title' => ts('Renew Membership Using Credit Card'), | |
be2fb01f CW |
242 | ], |
243 | ]; | |
6a488035 TO |
244 | if (!$isPaymentProcessor || !$accessContribution) { |
245 | //unset the renew with credit card when payment | |
246 | //processor is not available or user not permitted to make contributions | |
247 | unset($extraLinks[CRM_Core_Action::FOLLOWUP]); | |
248 | } | |
249 | ||
250 | self::$_links['all'] = self::$_links['view'] + $extraLinks; | |
251 | } | |
252 | ||
253 | if ($isCancelSupported) { | |
be2fb01f | 254 | self::$_links['all'][CRM_Core_Action::DISABLE] = [ |
6a488035 TO |
255 | 'name' => ts('Cancel Auto-renewal'), |
256 | 'url' => 'civicrm/contribute/unsubscribe', | |
257 | 'qs' => 'reset=1&mid=%%id%%&context=%%cxt%%' . $extraParams, | |
e300cf31 | 258 | 'title' => ts('Cancel Auto Renew Subscription'), |
be2fb01f | 259 | ]; |
6a488035 TO |
260 | } |
261 | elseif (isset(self::$_links['all'][CRM_Core_Action::DISABLE])) { | |
262 | unset(self::$_links['all'][CRM_Core_Action::DISABLE]); | |
263 | } | |
264 | ||
265 | return self::$_links[$status]; | |
266 | } | |
6a488035 TO |
267 | |
268 | /** | |
100fef9d | 269 | * Getter for array of the parameters required for creating pager. |
6a488035 | 270 | * |
3d469574 | 271 | * @param int $action |
c490a46a | 272 | * @param array $params |
6a488035 | 273 | */ |
00be9182 | 274 | public function getPagerParams($action, &$params) { |
6a488035 TO |
275 | $params['status'] = ts('Member') . ' %%StatusMessage%%'; |
276 | $params['csvString'] = NULL; | |
277 | if ($this->_limit) { | |
278 | $params['rowCount'] = $this->_limit; | |
279 | } | |
280 | else { | |
281 | $params['rowCount'] = CRM_Utils_Pager::ROWCOUNT; | |
282 | } | |
283 | ||
284 | $params['buttonTop'] = 'PagerTopButton'; | |
285 | $params['buttonBottom'] = 'PagerBottomButton'; | |
286 | } | |
6a488035 TO |
287 | |
288 | /** | |
289 | * Returns total number of rows for the query. | |
290 | * | |
3d469574 | 291 | * @param int $action |
6a488035 | 292 | * |
a6c01b45 CW |
293 | * @return int |
294 | * Total number of rows | |
6a488035 | 295 | */ |
00be9182 | 296 | public function getTotalCount($action) { |
6a488035 TO |
297 | return $this->_query->searchQuery(0, 0, NULL, |
298 | TRUE, FALSE, | |
299 | FALSE, FALSE, | |
300 | FALSE, | |
301 | $this->_memberClause | |
302 | ); | |
303 | } | |
304 | ||
305 | /** | |
fe482240 | 306 | * Returns all the rows in the given offset and rowCount. |
6a488035 | 307 | * |
3f8d2862 | 308 | * @param string $action |
b2363ea8 TO |
309 | * The action being performed. |
310 | * @param int $offset | |
311 | * The row number to start from. | |
312 | * @param int $rowCount | |
313 | * The number of rows to return. | |
314 | * @param string $sort | |
315 | * The sql string that describes the sort order. | |
3f8d2862 | 316 | * @param string $output |
b2363ea8 | 317 | * What should the result set include (web/email/csv). |
6a488035 | 318 | * |
6bb529e7 | 319 | * @return array |
a6c01b45 | 320 | * the total number of rows for this action |
6a488035 | 321 | */ |
00be9182 | 322 | public function &getRows($action, $offset, $rowCount, $sort, $output = NULL) { |
6a488035 TO |
323 | // check if we can process credit card registration |
324 | $processors = CRM_Core_PseudoConstant::paymentProcessor(FALSE, FALSE, | |
325 | "billing_mode IN ( 1, 3 )" | |
326 | ); | |
327 | if (count($processors) > 0) { | |
328 | $this->_isPaymentProcessor = TRUE; | |
329 | } | |
330 | else { | |
331 | $this->_isPaymentProcessor = FALSE; | |
332 | } | |
333 | ||
334 | // Only show credit card membership signup and renewal if user has CiviContribute permission | |
335 | if (CRM_Core_Permission::access('CiviContribute')) { | |
336 | $this->_accessContribution = TRUE; | |
337 | } | |
338 | else { | |
339 | $this->_accessContribution = FALSE; | |
340 | } | |
341 | ||
342 | //get all campaigns. | |
343 | $allCampaigns = CRM_Campaign_BAO_Campaign::getCampaigns(NULL, NULL, FALSE, FALSE, FALSE, TRUE); | |
344 | ||
345 | $result = $this->_query->searchQuery($offset, $rowCount, $sort, | |
346 | FALSE, FALSE, | |
347 | FALSE, FALSE, | |
348 | FALSE, | |
349 | $this->_memberClause | |
350 | ); | |
351 | ||
352 | // process the result of the query | |
be2fb01f | 353 | $rows = []; |
6a488035 TO |
354 | |
355 | //CRM-4418 check for view, edit, delete | |
be2fb01f | 356 | $permissions = [CRM_Core_Permission::VIEW]; |
6a488035 TO |
357 | if (CRM_Core_Permission::check('edit memberships')) { |
358 | $permissions[] = CRM_Core_Permission::EDIT; | |
359 | } | |
360 | if (CRM_Core_Permission::check('delete in CiviMember')) { | |
361 | $permissions[] = CRM_Core_Permission::DELETE; | |
362 | } | |
363 | $mask = CRM_Core_Action::mask($permissions); | |
364 | ||
365 | while ($result->fetch()) { | |
be2fb01f | 366 | $row = []; |
6a488035 TO |
367 | |
368 | // the columns we are interested in | |
369 | foreach (self::$_properties as $property) { | |
370 | if (property_exists($result, $property)) { | |
371 | $row[$property] = $result->$property; | |
372 | } | |
373 | } | |
374 | ||
375 | //carry campaign on selectors. | |
376 | $row['campaign'] = CRM_Utils_Array::value($result->member_campaign_id, $allCampaigns); | |
377 | $row['campaign_id'] = $result->member_campaign_id; | |
378 | ||
a7488080 | 379 | if (!empty($row['member_is_test'])) { |
cd355351 | 380 | $row['membership_type'] = CRM_Core_TestEntity::appendTestText($row['membership_type']); |
6a488035 TO |
381 | } |
382 | ||
383 | $row['checkbox'] = CRM_Core_Form::CB_PREFIX . $result->membership_id; | |
384 | ||
385 | if (!isset($result->owner_membership_id)) { | |
386 | // unset renew and followup link for deceased membership | |
387 | $currentMask = $mask; | |
388 | if ($result->membership_status == 'Deceased') { | |
389 | $currentMask = $currentMask & ~CRM_Core_Action::RENEW & ~CRM_Core_Action::FOLLOWUP; | |
390 | } | |
391 | ||
392 | $isCancelSupported = CRM_Member_BAO_Membership::isCancelSubscriptionSupported($row['membership_id']); | |
f8d3033b | 393 | $links = self::links('all', |
394 | $this->_isPaymentProcessor, | |
395 | $this->_accessContribution, | |
396 | $this->_key, | |
397 | $this->_context, | |
398 | $isCancelSupported | |
399 | ); | |
400 | ||
53e0b84e E |
401 | // check permissions |
402 | $finTypeId = CRM_Core_DAO::getFieldValue('CRM_Member_DAO_MembershipType', $result->membership_type_id, 'financial_type_id'); | |
403 | $finType = CRM_Contribute_PseudoConstant::financialType($finTypeId); | |
40c655aa | 404 | if (CRM_Financial_BAO_FinancialType::isACLFinancialTypeStatus() |
66af7c48 PN |
405 | && !CRM_Core_Permission::check('edit contributions of type ' . $finType) |
406 | ) { | |
53e0b84e E |
407 | unset($links[CRM_Core_Action::UPDATE]); |
408 | } | |
40c655aa | 409 | if (CRM_Financial_BAO_FinancialType::isACLFinancialTypeStatus() && |
66af7c48 PN |
410 | !CRM_Core_Permission::check('delete contributions of type ' . $finType) |
411 | ) { | |
53e0b84e E |
412 | unset($links[CRM_Core_Action::DELETE]); |
413 | } | |
414 | $row['action'] = CRM_Core_Action::formLink($links, | |
6a488035 | 415 | $currentMask, |
be2fb01f | 416 | [ |
6a488035 TO |
417 | 'id' => $result->membership_id, |
418 | 'cid' => $result->contact_id, | |
419 | 'cxt' => $this->_context, | |
be2fb01f | 420 | ], |
6957f0a9 | 421 | ts('Renew') . '...', |
87dab4a4 AH |
422 | FALSE, |
423 | 'membership.selector.row', | |
424 | 'Membership', | |
425 | $result->membership_id | |
6a488035 TO |
426 | ); |
427 | } | |
428 | else { | |
f8d3033b | 429 | $links = self::links('view'); |
53e0b84e | 430 | $row['action'] = CRM_Core_Action::formLink($links, $mask, |
be2fb01f | 431 | [ |
6a488035 TO |
432 | 'id' => $result->membership_id, |
433 | 'cid' => $result->contact_id, | |
434 | 'cxt' => $this->_context, | |
be2fb01f | 435 | ], |
87dab4a4 AH |
436 | ts('more'), |
437 | FALSE, | |
438 | 'membership.selector.row', | |
439 | 'Membership', | |
440 | $result->membership_id | |
6a488035 TO |
441 | ); |
442 | } | |
443 | ||
6bb529e7 MW |
444 | // Display Auto-renew status on page (0=disabled, 1=enabled, 2=enabled, but error |
445 | if (!empty($result->membership_recur_id)) { | |
446 | if (CRM_Member_BAO_Membership::isSubscriptionCancelled($row['membership_id'])) { | |
447 | $row['auto_renew'] = 2; | |
448 | } | |
449 | else { | |
450 | $row['auto_renew'] = 1; | |
451 | } | |
452 | } | |
453 | else { | |
454 | $row['auto_renew'] = 0; | |
6a488035 | 455 | } |
6a488035 | 456 | |
b09fe5ed | 457 | $row['contact_type'] = CRM_Contact_BAO_Contact_Utils::getImage($result->contact_sub_type ? $result->contact_sub_type : $result->contact_type, FALSE, $result->contact_id |
6a488035 TO |
458 | ); |
459 | ||
460 | $rows[] = $row; | |
461 | } | |
462 | ||
463 | return $rows; | |
464 | } | |
465 | ||
466 | /** | |
1054415f | 467 | * @inheritDoc |
6a488035 | 468 | */ |
6a488035 TO |
469 | public function getQILL() { |
470 | return $this->_query->qill(); | |
471 | } | |
472 | ||
473 | /** | |
3d469574 | 474 | * Returns the column headers as an array of tuples. |
475 | * | |
6a488035 TO |
476 | * (name, sortName (key to the sort array)) |
477 | * | |
b2363ea8 TO |
478 | * @param string $action |
479 | * The action being performed. | |
3f8d2862 | 480 | * @param string $output |
b2363ea8 | 481 | * What should the result set include (web/email/csv). |
6a488035 | 482 | * |
a6c01b45 CW |
483 | * @return array |
484 | * the column headers that need to be displayed | |
6a488035 TO |
485 | */ |
486 | public function &getColumnHeaders($action = NULL, $output = NULL) { | |
487 | if (!isset(self::$_columnHeaders)) { | |
be2fb01f CW |
488 | self::$_columnHeaders = [ |
489 | [ | |
6a488035 | 490 | 'name' => ts('Type'), |
33a5a53d | 491 | 'sort' => 'membership_type', |
6a488035 | 492 | 'direction' => CRM_Utils_Sort::DONTCARE, |
be2fb01f CW |
493 | ], |
494 | [ | |
353ffa53 | 495 | 'name' => ts('Member Since'), |
6a488035 TO |
496 | 'sort' => 'join_date', |
497 | 'direction' => CRM_Utils_Sort::DESCENDING, | |
be2fb01f CW |
498 | ], |
499 | [ | |
6a488035 TO |
500 | 'name' => ts('Start Date'), |
501 | 'sort' => 'membership_start_date', | |
502 | 'direction' => CRM_Utils_Sort::DONTCARE, | |
be2fb01f CW |
503 | ], |
504 | [ | |
6a488035 TO |
505 | 'name' => ts('End Date'), |
506 | 'sort' => 'membership_end_date', | |
507 | 'direction' => CRM_Utils_Sort::DONTCARE, | |
be2fb01f CW |
508 | ], |
509 | [ | |
6a488035 TO |
510 | 'name' => ts('Source'), |
511 | 'sort' => 'membership_source', | |
512 | 'direction' => CRM_Utils_Sort::DONTCARE, | |
be2fb01f CW |
513 | ], |
514 | [ | |
6a488035 | 515 | 'name' => ts('Status'), |
33a5a53d | 516 | 'sort' => 'membership_status', |
6a488035 | 517 | 'direction' => CRM_Utils_Sort::DONTCARE, |
be2fb01f CW |
518 | ], |
519 | [ | |
6a488035 | 520 | 'name' => ts('Auto-renew?'), |
be2fb01f CW |
521 | ], |
522 | ['desc' => ts('Actions')], | |
523 | ]; | |
6a488035 TO |
524 | |
525 | if (!$this->_single) { | |
be2fb01f CW |
526 | $pre = [ |
527 | ['desc' => ts('Contact Type')], | |
528 | [ | |
6a488035 TO |
529 | 'name' => ts('Name'), |
530 | 'sort' => 'sort_name', | |
531 | 'direction' => CRM_Utils_Sort::DONTCARE, | |
be2fb01f CW |
532 | ], |
533 | ]; | |
6a488035 TO |
534 | self::$_columnHeaders = array_merge($pre, self::$_columnHeaders); |
535 | } | |
536 | } | |
537 | return self::$_columnHeaders; | |
538 | } | |
539 | ||
bb3a214a | 540 | /** |
3d469574 | 541 | * Alphabet query. |
542 | * | |
bb3a214a EM |
543 | * @return mixed |
544 | */ | |
00be9182 | 545 | public function alphabetQuery() { |
52cda5dc | 546 | return $this->_query->alphabetQuery(); |
6a488035 TO |
547 | } |
548 | ||
bb3a214a | 549 | /** |
3d469574 | 550 | * Get query. |
551 | * | |
bb3a214a EM |
552 | * @return string |
553 | */ | |
00be9182 | 554 | public function &getQuery() { |
6a488035 TO |
555 | return $this->_query; |
556 | } | |
557 | ||
558 | /** | |
100fef9d | 559 | * Name of export file. |
6a488035 | 560 | * |
b2363ea8 TO |
561 | * @param string $output |
562 | * Type of output. | |
6a488035 | 563 | * |
a6c01b45 CW |
564 | * @return string |
565 | * name of the file | |
6a488035 | 566 | */ |
00be9182 | 567 | public function getExportFileName($output = 'csv') { |
6a488035 TO |
568 | return ts('CiviCRM Member Search'); |
569 | } | |
96025800 | 570 | |
6a488035 | 571 | } |