Fix up studygroups update functions
This commit is contained in:
@@ -965,7 +965,7 @@ function booking_studygroups_update() {
|
||||
$firstgroup = reset($studygroups);
|
||||
$limit = variable_get('booking_regn_limit','500');
|
||||
//be a bit more lenient with maximums to avoid excessive re-arrangement of groups
|
||||
$fudge_factor = 3;
|
||||
$fudge_factor = 1;
|
||||
$max_people = (int) ($limit / $firstgroup->booking_num_group_sessions) + $fudge_factor;
|
||||
|
||||
//select all the attendees booked in
|
||||
@@ -1272,7 +1272,7 @@ function booking_studygroups_update() {
|
||||
'!role' => $person->booking_studygroup_role)));
|
||||
|
||||
//update the entry
|
||||
/*
|
||||
|
||||
db_update('booking_studygroup_mapping')
|
||||
->fields(array(
|
||||
'booking_session_id' => $person->session,
|
||||
@@ -1280,7 +1280,7 @@ function booking_studygroups_update() {
|
||||
))
|
||||
->condition('sid', $mapping->sid)
|
||||
->execute();
|
||||
*/
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1296,8 +1296,8 @@ function booking_studygroups_update() {
|
||||
//if we didn't find an existing record, add it to the list to insert
|
||||
if (! $found && $person->session <> 0)
|
||||
{
|
||||
//drupal_set_message(t('Found no existing study group session for user id !id. Adding to list of inserts.',
|
||||
// array('!id' => $person->nid, '!sid' => $mapping->sid, '!session' => $person->session)));
|
||||
drupal_set_message(t('Found no existing study group session for user id !id. Adding to list of inserts.',
|
||||
array('!id' => $person->nid, '!sid' => $mapping->sid, '!session' => $person->session)));
|
||||
|
||||
$record = array(
|
||||
'booking_eventid' => $event->eid,
|
||||
@@ -1310,7 +1310,7 @@ function booking_studygroups_update() {
|
||||
}
|
||||
|
||||
}
|
||||
//$insert_query->execute();
|
||||
$insert_query->execute();
|
||||
|
||||
//watchdog('booking', "<pre>Session statistics list:\n@info</pre>", array('@info' => print_r( $session_count, true)));
|
||||
|
||||
|
Reference in New Issue
Block a user