Commit | Line | Data |
---|---|---|
6a488035 TO |
1 | <?php |
2 | /* | |
3 | +--------------------------------------------------------------------+ | |
06b69b18 | 4 | | CiviCRM version 4.5 | |
6a488035 | 5 | +--------------------------------------------------------------------+ |
06b69b18 | 6 | | Copyright CiviCRM LLC (c) 2004-2014 | |
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 | +--------------------------------------------------------------------+ | |
26 | */ | |
27 | ||
28 | /** | |
29 | * | |
30 | * | |
31 | * @package CRM | |
06b69b18 | 32 | * @copyright CiviCRM LLC (c) 2004-2014 |
6a488035 TO |
33 | * $Id$ |
34 | * | |
35 | */ | |
36 | ||
37 | /** | |
38 | * This class generates form components for processing a participation fee block | |
39 | */ | |
40 | class CRM_Event_Form_EventFees { | |
41 | ||
42 | /** | |
43 | * Function to set variables up before form is built | |
44 | * | |
77b97be7 EM |
45 | * @param $form |
46 | * | |
6a488035 TO |
47 | * @return void |
48 | * @access public | |
49 | */ | |
50 | static function preProcess(&$form) { | |
51 | //as when call come from register.php | |
52 | if (!$form->_eventId) { | |
53 | $form->_eventId = CRM_Utils_Request::retrieve('eventId', 'Positive', $form); | |
54 | } | |
55 | ||
56 | $form->_pId = CRM_Utils_Request::retrieve('participantId', 'Positive', $form); | |
57 | $form->_discountId = CRM_Utils_Request::retrieve('discountId', 'Positive', $form); | |
58 | ||
59 | $form->_fromEmails = CRM_Event_BAO_Event::getFromEmailIds($form->_eventId); | |
60 | ||
61 | //CRM-6907 set event specific currency. | |
62 | if ($form->_eventId && | |
63 | ($currency = CRM_Core_DAO::getFieldValue('CRM_Event_DAO_Event', $form->_eventId, 'currency')) | |
64 | ) { | |
65 | $config = CRM_Core_Config::singleton(); | |
66 | $config->defaultCurrency = $currency; | |
67 | } | |
68 | } | |
69 | ||
70 | /** | |
71 | * This function sets the default values for the form in edit/view mode | |
72 | * the default values are retrieved from the database | |
73 | * | |
74 | * @access public | |
75 | * | |
dd244018 EM |
76 | * @param $form |
77 | * | |
355ba699 | 78 | * @return void |
6a488035 TO |
79 | */ |
80 | static function setDefaultValues(&$form) { | |
81 | $defaults = array(); | |
82 | ||
83 | if ($form->_eventId) { | |
84 | //get receipt text and financial type | |
c2be40dc | 85 | $returnProperities = array( 'confirm_email_text', 'financial_type_id', 'campaign_id', 'start_date' ); |
6a488035 TO |
86 | $details = array(); |
87 | CRM_Core_DAO::commonRetrieveAll('CRM_Event_DAO_Event', 'id', $form->_eventId, $details, $returnProperities); | |
a7488080 | 88 | if (!empty($details[$form->_eventId]['financial_type_id'])) { |
6a488035 TO |
89 | $defaults[$form->_pId]['financial_type_id'] = $details[$form->_eventId]['financial_type_id']; |
90 | } | |
91 | } | |
92 | ||
93 | if ($form->_pId) { | |
94 | $ids = array(); | |
95 | $params = array('id' => $form->_pId); | |
96 | ||
97 | CRM_Event_BAO_Participant::getValues($params, $defaults, $ids); | |
98 | if ($form->_action == CRM_Core_Action::UPDATE) { | |
99 | $discounts = array(); | |
100 | if (!empty($form->_values['discount'])) { | |
101 | foreach ($form->_values['discount'] as $key => $value) { | |
8567d0f8 | 102 | $value = current($value); |
6a488035 TO |
103 | $discounts[$key] = $value['name']; |
104 | } | |
105 | } | |
106 | ||
8cc574cf | 107 | if ($form->_discountId && !empty($discounts[$defaults[$form->_pId]['discount_id']])) { |
6a488035 TO |
108 | $form->assign('discount', $discounts[$defaults[$form->_pId]['discount_id']]); |
109 | } | |
110 | ||
111 | $form->assign('fee_amount', CRM_Utils_Array::value('fee_amount', $defaults[$form->_pId])); | |
112 | $form->assign('fee_level', CRM_Utils_Array::value('fee_level', $defaults[$form->_pId])); | |
113 | } | |
114 | $defaults[$form->_pId]['send_receipt'] = 0; | |
115 | } | |
116 | else { | |
18eaa61b | 117 | $defaults[$form->_pId]['send_receipt'] = (strtotime(CRM_Utils_Array::value('start_date', $details[$form->_eventId])) >= time()) ? 1 : 0; |
8cc574cf | 118 | if ($form->_eventId && !empty($details[$form->_eventId]['confirm_email_text'])) { |
6a488035 TO |
119 | //set receipt text |
120 | $defaults[$form->_pId]['receipt_text'] = $details[$form->_eventId]['confirm_email_text']; | |
121 | } | |
122 | ||
123 | list($defaults[$form->_pId]['receive_date']) = CRM_Utils_Date::setDateDefaults(); | |
124 | } | |
125 | ||
f55dc004 | 126 | //CRM-11601 we should keep the record contribution |
6a488035 | 127 | //true by default while adding participant |
d96cf288 | 128 | if ($form->_action == CRM_Core_Action::ADD && !$form->_mode && $form->_isPaidEvent) { |
6a488035 TO |
129 | $defaults[$form->_pId]['record_contribution'] = 1; |
130 | } | |
77b97be7 | 131 | |
d96cf288 | 132 | //CRM-13420 |
a7488080 | 133 | if (empty($defaults['payment_instrument_id'])) { |
d96cf288 DG |
134 | $defaults[$form->_pId]['payment_instrument_id'] = key(CRM_Core_OptionGroup::values('payment_instrument', FALSE, FALSE, FALSE, 'AND is_default = 1')); |
135 | } | |
6a488035 | 136 | if ($form->_mode) { |
6a488035 TO |
137 | $config = CRM_Core_Config::singleton(); |
138 | // set default country from config if no country set | |
a7488080 | 139 | if (empty($defaults[$form->_pId]["billing_country_id-{$form->_bltID}"])) { |
6a488035 TO |
140 | $defaults[$form->_pId]["billing_country_id-{$form->_bltID}"] = $config->defaultContactCountry; |
141 | } | |
142 | ||
a7488080 | 143 | if (empty($defaults["billing_state_province_id-{$form->_bltID}"])) { |
cc44e307 | 144 | $defaults[$form->_pId]["billing_state_province_id-{$form->_bltID}"] = $config->defaultContactStateProvince; |
145 | } | |
146 | ||
147 | $billingDefaults = $form->getProfileDefaults('Billing', $form->_contactId); | |
148 | $defaults[$form->_pId] = array_merge($defaults[$form->_pId], $billingDefaults); | |
149 | ||
6a488035 TO |
150 | // // hack to simplify credit card entry for testing |
151 | // $defaults[$form->_pId]['credit_card_type'] = 'Visa'; | |
152 | // $defaults[$form->_pId]['credit_card_number'] = '4807731747657838'; | |
153 | // $defaults[$form->_pId]['cvv2'] = '000'; | |
154 | // $defaults[$form->_pId]['credit_card_exp_date'] = array( 'Y' => '2012', 'M' => '05' ); | |
155 | } | |
156 | ||
8567d0f8 PN |
157 | |
158 | // if user has selected discount use that to set default | |
159 | if (isset($form->_discountId)) { | |
160 | $defaults[$form->_pId]['discount_id'] = $form->_discountId; | |
161 | ||
162 | //hack to set defaults for already selected discount value | |
163 | if ($form->_action == CRM_Core_Action::UPDATE && !$form->_originalDiscountId) { | |
164 | $form->_originalDiscountId = $defaults[$form->_pId]['discount_id']; | |
165 | if ($form->_originalDiscountId) { | |
166 | $defaults[$form->_pId]['discount_id'] = $form->_originalDiscountId; | |
167 | } | |
168 | } | |
169 | $discountId = $form->_discountId; | |
170 | } | |
171 | else { | |
172 | $discountId = CRM_Core_BAO_Discount::findSet($form->_eventId, 'civicrm_event'); | |
173 | } | |
8ef12e64 | 174 | |
8567d0f8 PN |
175 | if ($discountId) { |
176 | $priceSetId = CRM_Core_DAO::getFieldValue('CRM_Core_BAO_Discount', $discountId, 'price_set_id'); | |
177 | } | |
178 | else { | |
9da8dc8c | 179 | $priceSetId = CRM_Price_BAO_PriceSet::getFor('civicrm_event', $form->_eventId); |
8567d0f8 PN |
180 | } |
181 | ||
182 | if (($form->_action == CRM_Core_Action::ADD) && $form->_eventId && $discountId) { | |
183 | // this case is for add mode, where we show discount automatically | |
184 | $defaults[$form->_pId]['discount_id'] = $discountId; | |
185 | } | |
186 | ||
187 | ||
188 | if ($priceSetId) { | |
6a488035 TO |
189 | // get price set default values, CRM-4090 |
190 | if (in_array(get_class($form), | |
191 | array( | |
192 | 'CRM_Event_Form_Participant', | |
193 | 'CRM_Event_Form_Registration_Register', | |
194 | 'CRM_Event_Form_Registration_AdditionalParticipant', | |
195 | ) | |
196 | )) { | |
197 | $priceSetValues = self::setDefaultPriceSet($form->_pId, $form->_eventId); | |
198 | if (!empty($priceSetValues)) { | |
199 | $defaults[$form->_pId] = array_merge($defaults[$form->_pId], $priceSetValues); | |
200 | } | |
201 | } | |
8ef12e64 | 202 | |
8cc574cf | 203 | if ($form->_action == CRM_Core_Action::ADD && !empty($form->_priceSet['fields'])) { |
6a488035 TO |
204 | foreach ($form->_priceSet['fields'] as $key => $val) { |
205 | foreach ($val['options'] as $keys => $values) { | |
206 | if ($values['is_default']) { | |
8cc574cf | 207 | if (get_class($form) != 'CRM_Event_Form_Participant' && !empty($values['is_full'])) { |
6a488035 TO |
208 | continue; |
209 | } | |
210 | ||
211 | if ($val['html_type'] == 'CheckBox') { | |
212 | $defaults[$form->_pId]["price_{$key}"][$keys] = 1; | |
213 | } | |
214 | else { | |
215 | $defaults[$form->_pId]["price_{$key}"] = $keys; | |
216 | } | |
217 | } | |
218 | } | |
219 | } | |
220 | } | |
221 | ||
222 | $form->assign('totalAmount', CRM_Utils_Array::value('fee_amount', $defaults[$form->_pId])); | |
223 | if ($form->_action == CRM_Core_Action::UPDATE) { | |
224 | $fee_level = $defaults[$form->_pId]['fee_level']; | |
225 | CRM_Event_BAO_Participant::fixEventLevel($fee_level); | |
226 | $form->assign('fee_level', $fee_level); | |
227 | $form->assign('fee_amount', CRM_Utils_Array::value('fee_amount', $defaults[$form->_pId])); | |
228 | } | |
229 | } | |
6a488035 TO |
230 | |
231 | //CRM-4453 | |
a7488080 | 232 | if (!empty($defaults[$form->_pId]['participant_fee_currency'])) { |
6a488035 TO |
233 | $form->assign('fee_currency', $defaults[$form->_pId]['participant_fee_currency']); |
234 | } | |
235 | ||
236 | // CRM-4395 | |
237 | if ($contriId = $form->get('onlinePendingContributionId')) { | |
238 | $contribution = new CRM_Contribute_DAO_Contribution(); | |
239 | $contribution->id = $contriId; | |
240 | $contribution->find( true ); | |
241 | foreach( array('financial_type_id', 'payment_instrument_id','contribution_status_id', 'receive_date', 'total_amount' ) as $f ) { | |
242 | if ($f == 'receive_date') { | |
243 | list($defaults[$form->_pId]['receive_date']) = CRM_Utils_Date::setDateDefaults($contribution->$f); | |
244 | } | |
245 | else { | |
246 | $defaults[$form->_pId][$f] = $contribution->$f; | |
247 | } | |
248 | } | |
249 | } | |
250 | return $defaults[$form->_pId]; | |
251 | } | |
252 | ||
253 | /** | |
254 | * This function sets the default values for price set. | |
255 | * | |
256 | * @access public | |
257 | * | |
77b97be7 EM |
258 | * @param $participantID |
259 | * @param null $eventID | |
260 | * @param bool $includeQtyZero | |
261 | * | |
355ba699 | 262 | * @return void |
6a488035 | 263 | */ |
8d13d078 | 264 | static function setDefaultPriceSet($participantID, $eventID = NULL, $includeQtyZero = TRUE) { |
6a488035 TO |
265 | $defaults = array(); |
266 | if (!$eventID && $participantID) { | |
267 | $eventID = CRM_Core_DAO::getFieldValue('CRM_Event_DAO_Participant', $participantID, 'event_id'); | |
268 | } | |
269 | if (!$participantID || !$eventID) { | |
270 | return $defaults; | |
271 | } | |
272 | ||
273 | // get price set ID. | |
9da8dc8c | 274 | $priceSetID = CRM_Price_BAO_PriceSet::getFor('civicrm_event', $eventID); |
6a488035 TO |
275 | if (!$priceSetID) { |
276 | return $defaults; | |
277 | } | |
278 | ||
279 | // use line items for setdefault price set fields, CRM-4090 | |
8d13d078 | 280 | $lineItems[$participantID] = CRM_Price_BAO_LineItem::getLineItems($participantID, 'participant', NULL, $includeQtyZero); |
6a488035 TO |
281 | |
282 | if (is_array($lineItems[$participantID]) && | |
283 | !CRM_Utils_System::isNull($lineItems[$participantID]) | |
284 | ) { | |
285 | ||
286 | $priceFields = $htmlTypes = $optionValues = array(); | |
287 | foreach ($lineItems[$participantID] as $lineId => $items) { | |
288 | $priceFieldId = CRM_Utils_Array::value('price_field_id', $items); | |
289 | $priceOptionId = CRM_Utils_Array::value('price_field_value_id', $items); | |
290 | if ($priceFieldId && $priceOptionId) { | |
291 | $priceFields[$priceFieldId][] = $priceOptionId; | |
292 | } | |
293 | } | |
294 | ||
295 | if (empty($priceFields)) { | |
296 | return $defaults; | |
297 | } | |
298 | ||
299 | // get all price set field html types. | |
300 | $sql = ' | |
301 | SELECT id, html_type | |
302 | FROM civicrm_price_field | |
303 | WHERE id IN (' . implode(',', array_keys($priceFields)) . ')'; | |
304 | $fieldDAO = CRM_Core_DAO::executeQuery($sql); | |
305 | while ($fieldDAO->fetch()) { | |
306 | $htmlTypes[$fieldDAO->id] = $fieldDAO->html_type; | |
307 | } | |
308 | ||
309 | foreach ($lineItems[$participantID] as $lineId => $items) { | |
310 | $fieldId = $items['price_field_id']; | |
311 | $htmlType = CRM_Utils_Array::value($fieldId, $htmlTypes); | |
312 | if (!$htmlType) { | |
313 | continue; | |
314 | } | |
315 | ||
316 | if ($htmlType == 'Text') { | |
317 | $defaults["price_{$fieldId}"] = $items['qty']; | |
318 | } | |
319 | else { | |
320 | $fieldOptValues = CRM_Utils_Array::value($fieldId, $priceFields); | |
321 | if (!is_array($fieldOptValues)) { | |
322 | continue; | |
323 | } | |
324 | ||
325 | foreach ($fieldOptValues as $optionId) { | |
326 | if ($htmlType == 'CheckBox') { | |
327 | $defaults["price_{$fieldId}"][$optionId] = TRUE; | |
328 | } | |
329 | else { | |
330 | $defaults["price_{$fieldId}"] = $optionId; | |
331 | break; | |
332 | } | |
333 | } | |
334 | } | |
335 | } | |
336 | } | |
337 | ||
338 | return $defaults; | |
339 | } | |
340 | ||
341 | /** | |
342 | * Function to build the form | |
343 | * | |
2a6da8d7 EM |
344 | * @param $form |
345 | * | |
355ba699 | 346 | * @return void |
6a488035 TO |
347 | * @access public |
348 | */ | |
349 | static function buildQuickForm(&$form) { | |
350 | if ($form->_eventId) { | |
351 | $form->_isPaidEvent = CRM_Core_DAO::getFieldValue('CRM_Event_DAO_Event', $form->_eventId, 'is_monetary'); | |
352 | if ($form->_isPaidEvent) { | |
353 | $form->addElement('hidden', 'hidden_feeblock', 1); | |
354 | } | |
355 | ||
356 | // make sure this is for backoffice registration. | |
357 | if ($form->getName() == 'Participant') { | |
358 | $eventfullMsg = CRM_Event_BAO_Participant::eventFullMessage($form->_eventId, $form->_pId); | |
359 | $form->addElement('hidden', 'hidden_eventFullMsg', $eventfullMsg, array('id' => 'hidden_eventFullMsg')); | |
360 | } | |
361 | } | |
362 | ||
363 | if ($form->_pId) { | |
364 | if (CRM_Core_DAO::getFieldValue('CRM_Event_DAO_ParticipantPayment', | |
365 | $form->_pId, 'contribution_id', 'participant_id' | |
366 | )) { | |
367 | $form->_online = TRUE; | |
368 | } | |
369 | } | |
370 | ||
371 | if ($form->_isPaidEvent) { | |
372 | $params = array('id' => $form->_eventId); | |
373 | CRM_Event_BAO_Event::retrieve($params, $event); | |
374 | ||
375 | //retrieve custom information | |
376 | $form->_values = array(); | |
377 | CRM_Event_Form_Registration::initEventFee($form, $event['id']); | |
378 | CRM_Event_Form_Registration_Register::buildAmount($form, TRUE, $form->_discountId); | |
379 | $lineItem = array(); | |
380 | if (!CRM_Utils_System::isNull(CRM_Utils_Array::value('line_items', $form->_values))) { | |
381 | $lineItem[] = $form->_values['line_items']; | |
382 | } | |
383 | $form->assign('lineItem', empty($lineItem) ? FALSE : $lineItem); | |
384 | $discounts = array(); | |
385 | if (!empty($form->_values['discount'])) { | |
386 | foreach ($form->_values['discount'] as $key => $value) { | |
8567d0f8 | 387 | $value = current($value); |
6a488035 TO |
388 | $discounts[$key] = $value['name']; |
389 | } | |
390 | ||
391 | $element = $form->add('select', 'discount_id', | |
392 | ts('Discount Set'), | |
393 | array( | |
394 | 0 => ts('- select -')) + $discounts, | |
395 | FALSE, | |
396 | array('onchange' => "buildFeeBlock( {$form->_eventId}, this.value );") | |
397 | ); | |
398 | ||
399 | if ($form->_online) { | |
400 | $element->freeze(); | |
401 | } | |
402 | } | |
403 | if ($form->_mode) { | |
404 | CRM_Core_Payment_Form::buildCreditCard($form, TRUE); | |
405 | } | |
406 | elseif (!$form->_mode) { | |
407 | $form->addElement('checkbox', 'record_contribution', ts('Record Payment?'), NULL, | |
408 | array('onclick' => "return showHideByValue('record_contribution','','payment_information','table-row','radio',false);") | |
409 | ); | |
410 | ||
411 | $form->add('select', 'financial_type_id', | |
412 | ts( 'Financial Type' ), | |
413 | array('' => ts('- select -')) + CRM_Contribute_PseudoConstant::financialType() | |
414 | ); | |
415 | ||
416 | $form->addDate('receive_date', ts('Received'), FALSE, array('formatType' => 'activityDate')); | |
417 | ||
418 | $form->add('select', 'payment_instrument_id', | |
419 | ts('Paid By'), | |
420 | array('' => ts('- select -')) + CRM_Contribute_PseudoConstant::paymentInstrument(), | |
421 | FALSE, array('onChange' => "return showHideByValue('payment_instrument_id','4','checkNumber','table-row','select',false);") | |
422 | ); | |
423 | // don't show transaction id in batch update mode | |
424 | $path = CRM_Utils_System::currentPath(); | |
425 | $form->assign('showTransactionId', FALSE); | |
426 | if ($path != 'civicrm/contact/search/basic') { | |
427 | $form->add('text', 'trxn_id', ts('Transaction ID')); | |
428 | $form->addRule('trxn_id', ts('Transaction ID already exists in Database.'), | |
429 | 'objectExists', array('CRM_Contribute_DAO_Contribution', $form->_eventId, 'trxn_id') | |
430 | ); | |
431 | $form->assign('showTransactionId', TRUE); | |
432 | } | |
433 | ||
32266c8c DG |
434 | $status = CRM_Contribute_PseudoConstant::contributionStatus(); |
435 | ||
436 | // CRM-14417 suppressing contribution statuses that are NOT relevant to new participant registrations | |
437 | $statusName = CRM_Contribute_PseudoConstant::contributionStatus(NULL, 'name'); | |
438 | foreach (array( | |
439 | 'Cancelled', | |
440 | 'Failed', | |
441 | 'In Progress', | |
442 | 'Overdue', | |
443 | 'Refunded', | |
444 | 'Pending refund', | |
445 | ) as $suppress) { | |
446 | unset($status[CRM_Utils_Array::key($suppress, $statusName)]); | |
6a488035 | 447 | } |
32266c8c | 448 | |
6a488035 | 449 | $form->add('select', 'contribution_status_id', |
32266c8c | 450 | ts('Payment Status'), $status |
6a488035 TO |
451 | ); |
452 | ||
453 | $form->add('text', 'check_number', ts('Check Number'), | |
454 | CRM_Core_DAO::getAttribute('CRM_Contribute_DAO_Contribution', 'check_number') | |
455 | ); | |
456 | ||
b8c7e40c | 457 | $form->add('text', 'total_amount', ts('Amount'), |
6a488035 TO |
458 | CRM_Core_DAO::getAttribute('CRM_Contribute_DAO_Contribution', 'total_amount') |
459 | ); | |
460 | } | |
461 | } | |
462 | else { | |
463 | $form->add('text', 'amount', ts('Event Fee(s)')); | |
464 | } | |
465 | $form->assign('onlinePendingContributionId', $form->get('onlinePendingContributionId')); | |
466 | ||
467 | $form->assign('paid', $form->_isPaidEvent); | |
468 | ||
469 | $form->addElement('checkbox', | |
470 | 'send_receipt', | |
471 | ts('Send Confirmation?'), NULL, | |
472 | array('onclick' => "showHideByValue('send_receipt','','notice','table-row','radio',false); showHideByValue('send_receipt','','from-email','table-row','radio',false);") | |
473 | ); | |
474 | ||
475 | $form->add('select', 'from_email_address', ts('Receipt From'), $form->_fromEmails['from_email_id']); | |
476 | ||
477 | $form->add('textarea', 'receipt_text', ts('Confirmation Message')); | |
478 | ||
479 | // Retrieve the name and email of the contact - form will be the TO for receipt email ( only if context is not standalone) | |
480 | if ($form->_context != 'standalone') { | |
481 | if ($form->_contactId) { | |
482 | list($form->_contributorDisplayName, | |
483 | $form->_contributorEmail | |
484 | ) = CRM_Contact_BAO_Contact_Location::getEmailDetails($form->_contactId); | |
485 | $form->assign('email', $form->_contributorEmail); | |
486 | } | |
487 | else { | |
488 | //show email block for batch update for event | |
489 | $form->assign('batchEmail', TRUE); | |
490 | } | |
491 | } | |
492 | ||
493 | $mailingInfo = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::MAILING_PREFERENCES_NAME, | |
494 | 'mailing_backend' | |
495 | ); | |
496 | $form->assign('outBound_option', $mailingInfo['outBound_option']); | |
497 | $form->assign('hasPayment', $form->_paymentId); | |
498 | } | |
499 | } | |
500 |