Fixes for PHP 5.4+

This commit is contained in:
2016-04-28 18:06:27 +10:00
parent b10da453e5
commit c1b2621d3b
5 changed files with 12 additions and 10 deletions

View File

@@ -1269,7 +1269,8 @@ function _booking_process_refund($person)
* Helper function to generate paypal form for payments * Helper function to generate paypal form for payments
*/ */
function _booking_paypal_form($person, $invoiceid, $amount_owing, $button_text) { function _booking_paypal_form($person, $invoiceid, $amount_owing, $button_text) {
return drupal_render(drupal_get_form('_booking_paypal_form_builder', $person, $invoiceid, $amount_owing, $button_text)); $form = drupal_get_form('_booking_paypal_form_builder', $person, $invoiceid, $amount_owing, $button_text);
return drupal_render($form);
} }
/** /**

View File

@@ -1396,7 +1396,7 @@ function booking_form_submit($form, &$form_state) {
$node->booking_total_pay_reqd = $payment_total_price->booking_price; $node->booking_total_pay_reqd = $payment_total_price->booking_price;
//watchdog('booking', 'Node data: @info', array('@info' => var_export($node, TRUE))); //watchdog('booking', 'Node data: @info', array('@info' => var_export($node, TRUE)));
$foo = node_submit(&$node); $foo = node_submit($node);
//watchdog('booking', 'Node data after submit: @info', array('@info' => var_export($foo, TRUE))); //watchdog('booking', 'Node data after submit: @info', array('@info' => var_export($foo, TRUE)));
$blah = node_save($foo); $blah = node_save($foo);
//watchdog('booking', 'Node data after save: @info', array('@info' => var_export($blah, TRUE))); //watchdog('booking', 'Node data after save: @info', array('@info' => var_export($blah, TRUE)));

View File

@@ -62,6 +62,7 @@ function booking_report_summary() {
$state_header = array('State', 'Count', 'Males', 'Females', 'Baptised', 'Male Average Age', 'Female Average Age', 'Overall Average Age'); $state_header = array('State', 'Count', 'Males', 'Females', 'Baptised', 'Male Average Age', 'Female Average Age', 'Overall Average Age');
$state_rows = array(); $state_rows = array();
$state_statistics = array(); $state_statistics = array();
//$state_statistics = new stdClass();
//do some analysis about the people booked in //do some analysis about the people booked in
//first the summary of states //first the summary of states
@@ -84,6 +85,9 @@ function booking_report_summary() {
if (strcmp($state->booking_country,'Australia') == 0 ) { if (strcmp($state->booking_country,'Australia') == 0 ) {
//$state_rows[] = array($state->booking_state, $state->state_count); //$state_rows[] = array($state->booking_state, $state->state_count);
//store the total count for this state //store the total count for this state
if (!isset($state_statistics[$state->booking_state])) {
$state_statistics[$state->booking_state] = new stdClass();
}
$state_statistics[$state->booking_state]->total_count = $state->state_count; $state_statistics[$state->booking_state]->total_count = $state->state_count;
$state_statistics[$state->booking_state]->male_count = 0; $state_statistics[$state->booking_state]->male_count = 0;
$state_statistics[$state->booking_state]->male_avg = 0; $state_statistics[$state->booking_state]->male_avg = 0;
@@ -97,6 +101,7 @@ function booking_report_summary() {
} }
//non australian states //non australian states
//$state_rows[] = array('International', $non_australia_count); //$state_rows[] = array('International', $non_australia_count);
$state_statistics['International'] = new stdClass();
$state_statistics['International']->total_count = $non_australia_count; $state_statistics['International']->total_count = $non_australia_count;
$state_statistics['International']->male_count = 0; $state_statistics['International']->male_count = 0;
$state_statistics['International']->male_avg = 0; $state_statistics['International']->male_avg = 0;

View File

@@ -135,9 +135,7 @@ function booking_rooms_allocate_test_form($node, &$form_state, $location_id) {
//create an additional row for each queen bed //create an additional row for each queen bed
//_booking_rooms_allocate_generate_queenbeds($data, $existing_beds, $default_row, &$counter, &$form); //_booking_rooms_allocate_generate_queenbeds($data, $existing_beds, $default_row, &$counter, &$form);
_booking_rooms_allocate_generate_queenbeds($data, $existing_beds, $default_row, $counter, $form); _booking_rooms_allocate_generate_queenbeds($data, $existing_beds, $default_row, $counter, $form);
} //end foreach $room_query
}
$form['submit'] = array ( $form['submit'] = array (
'#type' => 'submit', '#type' => 'submit',
@@ -147,8 +145,7 @@ function booking_rooms_allocate_test_form($node, &$form_state, $location_id) {
return array ( return array (
'form' => $form, 'form' => $form,
); );
} //end booking_rooms_allocate_test_form
}
/** /**
* Process the submission for room assignment * Process the submission for room assignment
@@ -177,7 +174,6 @@ function booking_rooms_allocate_test_form_submit($form, &$form_state) {
//go through the different bed types //go through the different bed types
foreach ($bed_inputs as $type => $type_id) foreach ($bed_inputs as $type => $type_id)
{ {
//if this bed type wasn't defined in the form, skip it //if this bed type wasn't defined in the form, skip it
if (empty($values[$type])) if (empty($values[$type]))
continue; continue;

View File

@@ -470,7 +470,7 @@ function travel_form_submit($form, &$form_state) {
//watchdog('booking', "<pre>Travel data to save:\n@info</pre>", array('@info' => print_r( $node, true))); //watchdog('booking', "<pre>Travel data to save:\n@info</pre>", array('@info' => print_r( $node, true)));
//store the node //store the node
$foo = node_submit(&$node); $foo = node_submit($node);
$blah = node_save($foo); $blah = node_save($foo);
//send a confirmation email //send a confirmation email