Bugfixes
This commit is contained in:
@@ -1183,6 +1183,8 @@ function _booking_update($node) {
|
||||
->condition('nid', $node->nid)
|
||||
->execute();
|
||||
|
||||
//now process some post-update triggers
|
||||
|
||||
//if booking_partner_id is set, make sure the nid it refers to has this node as its booking_partner_id
|
||||
if ($node->booking_partner_id != 0)
|
||||
{
|
||||
@@ -1203,8 +1205,7 @@ function _booking_update($node) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//now check if someone needs to move from the waiting list to the booked in list
|
||||
//check if someone needs to move from the waiting list to the booked in list
|
||||
if ($previous_status->booking_status == 1 && $node->booking_status == 3)
|
||||
{
|
||||
watchdog('booking', 'Detected person moving from Booked In list to No Longer Coming');
|
||||
@@ -1228,8 +1229,8 @@ function _booking_update($node) {
|
||||
else
|
||||
watchdog('booking', 'Still no room on the booked in list though.');
|
||||
}
|
||||
//if we're not automatically sending emails on registration, then check if
|
||||
//someone moved from not-paid to booked-in (ie, manual payment process)
|
||||
//if we're not automatically sending emails on registration
|
||||
//and someone moved from not-paid to booked-in (ie, manual payment process)
|
||||
elseif (variable_get('booking_auto_confirm_email', 0) == 0 && $previous_status->booking_status == 0 && $node->booking_status == 1)
|
||||
{
|
||||
watchdog('booking', 'Detected person moving from Not Paid list to Booked In list');
|
||||
@@ -1243,7 +1244,39 @@ function _booking_update($node) {
|
||||
//_booking_promoted_from_waitinglist_email($node->nid);
|
||||
}
|
||||
}
|
||||
|
||||
//if someone moved from the not-paid list to waiting list by manual update
|
||||
elseif ($previous_status->booking_status == 0 && $node->booking_status == 2)
|
||||
{
|
||||
watchdog('booking', 'Detected person moving from Not Paid list to Waiting List');
|
||||
|
||||
|
||||
//create a manual payment entry of zero dollars
|
||||
//so things like the waiting list report work
|
||||
$result = db_insert('booking_payment')
|
||||
->fields(array(
|
||||
'booking_person_nid' => $node->nid,
|
||||
'booking_eventid' => $event->eid,
|
||||
'booking_mc_gross' => '0.00',
|
||||
'booking_mc_currency' => 'AUD',
|
||||
'booking_mc_fee' => '0.00',
|
||||
'booking_quantity' => 1,
|
||||
'booking_invoice' => 'ManualPayment',
|
||||
'booking_payer_id' => '',
|
||||
'booking_payment_date' => REQUEST_TIME,
|
||||
'booking_payment_status' => '',
|
||||
'booking_first_name' => $node->booking_firstname,
|
||||
'booking_last_name' => $node->booking_lastname,
|
||||
'booking_buyer_email' => '',
|
||||
'booking_payer_status' => '',
|
||||
'booking_item_name' => '',
|
||||
'booking_ipn_track_id' => '',
|
||||
))
|
||||
->execute();
|
||||
|
||||
//send them an email
|
||||
_booking_registration_email($node->nid, FALSE, FALSE);
|
||||
}
|
||||
|
||||
//if the payment ID has changed then update the total pay required
|
||||
if ($previous_status->booking_payment_id != $node->booking_payment_id)
|
||||
{
|
||||
|
Reference in New Issue
Block a user