projects
/
civicrm-core.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
phpcs - Fix error, "Expected 1 newline at end of file; XXX found".
[civicrm-core.git]
/
CRM
/
Event
/
Form
/
EventFees.php
diff --git
a/CRM/Event/Form/EventFees.php
b/CRM/Event/Form/EventFees.php
index 898bbf90405a8a7d589dca2a082b7787153741ee..6b116153fd7d1d9d77e2b5bdfa658d4506fc5299 100644
(file)
--- a/
CRM/Event/Form/EventFees.php
+++ b/
CRM/Event/Form/EventFees.php
@@
-1,7
+1,7
@@
<?php
/*
+--------------------------------------------------------------------+
<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.
5
|
+ | CiviCRM version 4.
6
|
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
@@
-40,14
+40,13
@@
class CRM_Event_Form_EventFees {
/**
class CRM_Event_Form_EventFees {
/**
- *
Function to s
et variables up before form is built
+ *
S
et variables up before form is built
*
*
- * @param $form
+ * @param
CRM_Core_Form
$form
*
* @return void
*
* @return void
- * @access public
*/
*/
- static function preProcess(&$form) {
+
public
static function preProcess(&$form) {
//as when call come from register.php
if (!$form->_eventId) {
$form->_eventId = CRM_Utils_Request::retrieve('eventId', 'Positive', $form);
//as when call come from register.php
if (!$form->_eventId) {
$form->_eventId = CRM_Utils_Request::retrieve('eventId', 'Positive', $form);
@@
-71,13
+70,12
@@
class CRM_Event_Form_EventFees {
* This function sets the default values for the form in edit/view mode
* the default values are retrieved from the database
*
* This function sets the default values for the form in edit/view mode
* the default values are retrieved from the database
*
- * @access public
*
*
- * @param $form
+ * @param
CRM_Core_Form
$form
*
* @return void
*/
*
* @return void
*/
- static function setDefaultValues(&$form) {
+
public
static function setDefaultValues(&$form) {
$defaults = array();
if ($form->_eventId) {
$defaults = array();
if ($form->_eventId) {
@@
-253,15
+251,14
@@
class CRM_Event_Form_EventFees {
/**
* This function sets the default values for price set.
*
/**
* This function sets the default values for price set.
*
- * @access public
*
*
- * @param $participantID
- * @param
null
$eventID
+ * @param
int
$participantID
+ * @param
int
$eventID
* @param bool $includeQtyZero
*
* @return void
*/
* @param bool $includeQtyZero
*
* @return void
*/
- static function setDefaultPriceSet($participantID, $eventID = NULL, $includeQtyZero = TRUE) {
+
public
static function setDefaultPriceSet($participantID, $eventID = NULL, $includeQtyZero = TRUE) {
$defaults = array();
if (!$eventID && $participantID) {
$eventID = CRM_Core_DAO::getFieldValue('CRM_Event_DAO_Participant', $participantID, 'event_id');
$defaults = array();
if (!$eventID && $participantID) {
$eventID = CRM_Core_DAO::getFieldValue('CRM_Event_DAO_Participant', $participantID, 'event_id');
@@
-339,14
+336,13
@@
SELECT id, html_type
}
/**
}
/**
- *
Function to build the form
+ *
Build the form object
*
*
- * @param $form
+ * @param
CRM_Core_Form
$form
*
* @return void
*
* @return void
- * @access public
*/
*/
- static function buildQuickForm(&$form) {
+
public
static function buildQuickForm(&$form) {
if ($form->_eventId) {
$form->_isPaidEvent = CRM_Core_DAO::getFieldValue('CRM_Event_DAO_Event', $form->_eventId, 'is_monetary');
if ($form->_isPaidEvent) {
if ($form->_eventId) {
$form->_isPaidEvent = CRM_Core_DAO::getFieldValue('CRM_Event_DAO_Event', $form->_eventId, 'is_monetary');
if ($form->_isPaidEvent) {
@@
-377,8
+373,17
@@
SELECT id, html_type
CRM_Event_Form_Registration::initEventFee($form, $event['id']);
CRM_Event_Form_Registration_Register::buildAmount($form, TRUE, $form->_discountId);
$lineItem = array();
CRM_Event_Form_Registration::initEventFee($form, $event['id']);
CRM_Event_Form_Registration_Register::buildAmount($form, TRUE, $form->_discountId);
$lineItem = array();
+ $invoiceSettings = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME,'contribution_invoice_settings');
+ $invoicing = CRM_Utils_Array::value('invoicing', $invoiceSettings);
+ $totalTaxAmount = 0;
if (!CRM_Utils_System::isNull(CRM_Utils_Array::value('line_items', $form->_values))) {
$lineItem[] = $form->_values['line_items'];
if (!CRM_Utils_System::isNull(CRM_Utils_Array::value('line_items', $form->_values))) {
$lineItem[] = $form->_values['line_items'];
+ foreach ($form->_values['line_items'] as $key => $value) {
+ $totalTaxAmount = $value['tax_amount'] + $totalTaxAmount;
+ }
+ }
+ if ($invoicing) {
+ $form->assign('totalTaxAmount', $totalTaxAmount);
}
$form->assign('lineItem', empty($lineItem) ? FALSE : $lineItem);
$discounts = array();
}
$form->assign('lineItem', empty($lineItem) ? FALSE : $lineItem);
$discounts = array();
@@
-401,7
+406,7
@@
SELECT id, html_type
}
}
if ($form->_mode) {
}
}
if ($form->_mode) {
- CRM_Core_Payment_Form::build
CreditCard($form, TRU
E);
+ CRM_Core_Payment_Form::build
PaymentForm($form, $form->_paymentProcessor, FALS
E);
}
elseif (!$form->_mode) {
$form->addElement('checkbox', 'record_contribution', ts('Record Payment?'), NULL,
}
elseif (!$form->_mode) {
$form->addElement('checkbox', 'record_contribution', ts('Record Payment?'), NULL,
@@
-497,4
+502,3
@@
SELECT id, html_type
$form->assign('hasPayment', $form->_paymentId);
}
}
$form->assign('hasPayment', $form->_paymentId);
}
}
-