add same functionality to hook_update()
This commit is contained in:
@@ -458,6 +458,24 @@ function booking_update($node) {
|
||||
}
|
||||
}
|
||||
|
||||
//repeat the process for bf/gf
|
||||
if ($node->booking_bf_gf_nid != 0) {
|
||||
$partner = db_query("Select booking_bf_gf_nid from {booking_person} where nid = :nid",
|
||||
array(':nid' => $node->booking_bf_gf_nid))
|
||||
->fetchObject();
|
||||
if ($partner->booking_bf_gf_nid == 0) {
|
||||
watchdog('booking', 'Updating bf/gf node !partner to refer to this node !nid',
|
||||
array('!partner' => $node->booking_bf_gf_nid, '!nid' => $node->nid));
|
||||
//update the partner id of the partner to refer to this node
|
||||
db_update('booking_person')
|
||||
->fields(array(
|
||||
'booking_bf_gf_nid' => $node->nid,
|
||||
))
|
||||
->condition('nid', $node->booking_bf_gf_nid)
|
||||
->execute();
|
||||
}
|
||||
}
|
||||
|
||||
//status change triggers start here
|
||||
|
||||
//check if someone has moved to not-coming list from the booked-in list
|
||||
|
Reference in New Issue
Block a user