Tweaks to refunds, study groups, travel emails

This commit is contained in:
2014-05-06 14:51:06 +10:00
parent eb3fa7e7bf
commit 5e8e1bd22d
7 changed files with 204 additions and 61 deletions

View File

@@ -682,6 +682,13 @@ function booking_studygroups_calculate() {
$group_mapping = $group_mapping_query->fetchAllAssoc('sid');
//TODO: search for entries already in the mapping table that have a booking_status of 3 (not coming) and remove them from the mapping table
$to_remove_query = db_query("SELECT m.* FROM {booking_studygroup_mapping} m
inner join {booking_person} p on p.nid = m.booking_node_id
WHERE booking_eventid = :eid AND p.booking_status = 3",
array(':eid' => $event->eid));
$to_remove = $to_remove_query->fetchAll();
watchdog('booking', "<pre>Study group mappings to remove:\n@info</pre>", array('@info' => print_r( $to_remove, true)));
//iterate over the attendee associative array and add some fields
foreach ($attendees as $person)
@@ -889,9 +896,9 @@ function booking_studygroups_calculate() {
foreach($working_list as $person)
{
watchdog('booking', "<pre>Working list person:\n@info</pre>", array('@info' => print_r( $person, true)));
//watchdog('booking', "<pre>Working list person:\n@info</pre>", array('@info' => print_r( $person, true)));
//TODO: a check to update existing records rather than inserting new one
//check to update existing records rather than inserting new one
// if already in $group_mapping then just run an update query here
$found = FALSE;
@@ -941,7 +948,7 @@ function booking_studygroups_calculate() {
}
$insert_query->execute();
watchdog('booking', "<pre>Session statistics list:\n@info</pre>", array('@info' => print_r( $session_count, true)));
//watchdog('booking', "<pre>Session statistics list:\n@info</pre>", array('@info' => print_r( $session_count, true)));
//clear the arrays we've been using for this iteration
unset($session_count);
@@ -1029,6 +1036,7 @@ function booking_studygroups_printview_form($node, &$form_state, $group_id) {
'booking_session_id' => array('data' => t('Study Group Session'), 'field' => 'm.booking_session_id'),
'booking_name' => array('data' => t('Name'), 'field' => 'p.booking_lastname', 'sort' => 'asc'),
'booking_mobilenum' => array('data' => t('Mobile Number'), 'field' => 'p.booking_mobile'),
'booking_email' => array('data' => t('Email'), 'field' => 'p.booking_email'),
'booking_studygroup_role' => array('data' => t('Role')),
);
@@ -1075,6 +1083,7 @@ function booking_studygroups_printview_form($node, &$form_state, $group_id) {
$data->booking_session_id,
$data->booking_firstname . " " . $data->booking_lastname,
$data->booking_mobile,
$data->booking_email,
$role,
),
'class' => array($class),