update reading goup colour processing to use booking_is_readinggroup flag
This commit is contained in:
@@ -877,8 +877,6 @@ function booking_schema() {
|
|||||||
'booking_node_id' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'disp-width' => '10'),
|
'booking_node_id' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'disp-width' => '10'),
|
||||||
'booking_studygroup_id' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'disp-width' => '10'),
|
'booking_studygroup_id' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'disp-width' => '10'),
|
||||||
'booking_session_id' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'disp-width' => '10', 'default' => 0),
|
'booking_session_id' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'disp-width' => '10', 'default' => 0),
|
||||||
//'booking_is_leader' => array('type' => 'varchar', 'length' => '1', 'not null' => FALSE),
|
|
||||||
//'booking_is_helper' => array('type' => 'varchar', 'length' => '1', 'not null' => FALSE),
|
|
||||||
'booking_studygroup_role' => array('type' => 'varchar', 'length' => '100', 'not null' => FALSE, 'default' => 0),
|
'booking_studygroup_role' => array('type' => 'varchar', 'length' => '100', 'not null' => FALSE, 'default' => 0),
|
||||||
),
|
),
|
||||||
'primary key' => array('sid'),
|
'primary key' => array('sid'),
|
||||||
|
@@ -1762,14 +1762,22 @@ function booking_studygroups_process_colours() {
|
|||||||
global $event;
|
global $event;
|
||||||
|
|
||||||
//get the id of the special study group that is actually the reading group
|
//get the id of the special study group that is actually the reading group
|
||||||
$readinggroup_studygroup_id = variable_get('booking_readinggroup_id','7');
|
//$readinggroup_studygroup_id = variable_get('booking_readinggroup_id','7');
|
||||||
|
|
||||||
//TODO: Query for all groups with the reading group flag set to Y, and loop through them all
|
//TODO: Query for all groups with the reading group flag set to Y, and loop through them all
|
||||||
|
|
||||||
|
//db select
|
||||||
|
// join on booking_studygroup_list where booking_is_readinggroup = Y
|
||||||
|
$query = db_select('booking_studygroup_mapping', 'm');
|
||||||
|
$query->join('booking_studygroup_list', 's', 's.sid = m.booking_studygroup_id');
|
||||||
|
$query->condition('s.booking_is_readinggroup', 'Y', '=');
|
||||||
|
$query->fields('m')->fields('s', array('booking_studygroup_descrip'));
|
||||||
|
$group_mapping = $query->execute()->fetchAllAssoc('sid');
|
||||||
|
|
||||||
//query for the mappings relating to $readinggroup_studygroup_id
|
//query for the mappings relating to $readinggroup_studygroup_id
|
||||||
$group_mapping_query = db_query("SELECT * FROM {booking_studygroup_mapping} WHERE booking_eventid = :eid AND booking_studygroup_id = :sid",
|
//$group_mapping_query = db_query("SELECT * FROM {booking_studygroup_mapping} WHERE booking_eventid = :eid AND booking_studygroup_id = :sid",
|
||||||
array(':eid' => $event->eid, ':sid' => $readinggroup_studygroup_id));
|
// array(':eid' => $event->eid, ':sid' => $readinggroup_studygroup_id));
|
||||||
$group_mapping = $group_mapping_query->fetchAll();
|
//$group_mapping = $group_mapping_query->fetchAll();
|
||||||
|
|
||||||
foreach ($group_mapping as $mapping)
|
foreach ($group_mapping as $mapping)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user