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