2006-03-01 15:59:51 +00:00
< ?
$mailqueries = array (
Fix all participant emails in communication module
Make queries for communications easier, all you need is a users.id queried, the system will find everything else for you
Add ability to use [PASSWORD], [USERNAME], [EMAIL] (tries accounts.email first, if its not there, it uses accounts.pendingemail), in _ANY_ email. [REGNUM] also added but will obviously only work for participants
Add "all" section to the tabs list for user editor, so a user without any roles can still get the basic pages like "account", "roles", and "personal info"
Put count on participant invitations for teachers (and superusers)
Fix a bug where changing a password for a different user didnt work (it changed YOURS!)
2011-03-22 04:37:51 +00:00
" myself " => array ( " name " => " Yourself (for testing) " , " query " => " SELECT users.id FROM users WHERE users.id=' { $_SESSION [ 'users_id' ] } ' " ),
2008-01-09 17:25:30 +00:00
" committee_all " => array ( " name " => " Committee members (all) " , " query " =>
Fix all participant emails in communication module
Make queries for communications easier, all you need is a users.id queried, the system will find everything else for you
Add ability to use [PASSWORD], [USERNAME], [EMAIL] (tries accounts.email first, if its not there, it uses accounts.pendingemail), in _ANY_ email. [REGNUM] also added but will obviously only work for participants
Add "all" section to the tabs list for user editor, so a user without any roles can still get the basic pages like "account", "roles", and "personal info"
Put count on participant invitations for teachers (and superusers)
Fix a bug where changing a password for a different user didnt work (it changed YOURS!)
2011-03-22 04:37:51 +00:00
" SELECT users.id FROM users
JOIN accounts ON users . accounts_id = accounts . id
2010-11-01 21:23:17 +00:00
JOIN user_roles ON user_roles . users_id = users . id
JOIN roles ON roles . id = user_roles . roles_id
Fix all participant emails in communication module
Make queries for communications easier, all you need is a users.id queried, the system will find everything else for you
Add ability to use [PASSWORD], [USERNAME], [EMAIL] (tries accounts.email first, if its not there, it uses accounts.pendingemail), in _ANY_ email. [REGNUM] also added but will obviously only work for participants
Add "all" section to the tabs list for user editor, so a user without any roles can still get the basic pages like "account", "roles", and "personal info"
Put count on participant invitations for teachers (and superusers)
Fix a bug where changing a password for a different user didnt work (it changed YOURS!)
2011-03-22 04:37:51 +00:00
WHERE roles . type = 'committee' AND accounts . deleted = 'no' " ),
2007-10-31 15:22:30 +00:00
2009-09-18 04:04:20 +00:00
/* The WHERE clause evaluates which rows to add to the GROUP
BY , the HAVING clase evaluates which grouped rows show up . We
want to to evaluate 'deleted' AFTER the grouping , so we catch
2010-11-01 21:23:17 +00:00
the case where the MAX ( conferences_id ) has deleted = 'yes' . If we use WHERE
2009-09-18 04:04:20 +00:00
deleted = 'no' , we ' ll only add non - deleted rows to the group , and
end up picking up a user active in , say 2007 and 2008 , but
deleted in 2009. */
2010-11-01 21:23:17 +00:00
" judges_all " => array ( " name " => " Judges from all conferences (except deleted judges) " , " query " =>
" SELECT firstname, lastname, email, deleted, MAX(conferences_id) FROM users
JOIN user_roles ON user_roles . users_id = users . id
JOIN roles ON roles . id = user_roles . roles_id
WHERE roles . type = 'judge' GROUP BY users . accounts_id HAVING deleted = 'no' ORDER BY email " ),
" judges_active_thisconference " => array ( " name " => " Judges active for this conference " , " query " =>
" SELECT firstname, lastname, email FROM users
LEFT JOIN user_roles ON user_roles . users_id = users . id
JOIN roles ON roles . id = user_roles . roles_id
WHERE roles . type = 'judge' AND conferences_id = { $conference [ 'id' ]} AND deleted = 'no' AND user_roles . active = 'yes' ORDER BY email " ),
" judges_inactive_thisconference " => array ( " name " => " Judges in the conference that are not active " , " query " =>
" SELECT firstname, lastname, email FROM users
LEFT JOIN user_roles ON user_roles . users_id = users . id
JOIN roles ON roles . id = user_roles . roles_id
WHERE roles . type = 'judge' AND conferences_id = { $conference [ 'id' ]} AND deleted = 'no' AND user_roles . active = 'no' ORDER BY email " ),
" judges_inactive_allconferences " => array ( " name " => " Judges inactive for any conference " , " query " =>
" SELECT firstname, lastname, email FROM users
LEFT JOIN user_roles ON user_roles . users_id = users . id
JOIN roles ON roles . id = user_roles . roles_id
WHERE roles . type = 'judge' AND deleted = 'no' AND user_roles . active = 'no' ORDER BY email " ),
" judges_active_complete_thisconference " => array ( " name " => " Judges active for this conference and complete " , " query " =>
" SELECT firstname, lastname, email FROM users
LEFT JOIN user_roles ON user_roles . users_id = users . id
JOIN roles ON roles . id = user_roles . id
WHERE roles . type = 'judge' AND conferences_id = { $conference [ 'id' ]}
AND user_roles . complete = 'yes'
AND deleted = 'no'
AND user_roles . active = 'yes'
ORDER BY email " ),
" judges_active_incomplete_thisconference " => array ( " name " => " Judges active for this conference but not complete " , " query " =>
" SELECT firstname, lastname, email FROM users
LEFT JOIN user_roles ON user_roles . users_id = users . id
JOIN roles ON roles . id = user_roles . id
WHERE roles . type = 'judge' AND conferences_id = { $conference [ 'id' ]}
AND user_roles . complete = 'no'
AND deleted = 'no'
AND user_roles . active = 'yes'
ORDER BY email " ),
Fix all participant emails in communication module
Make queries for communications easier, all you need is a users.id queried, the system will find everything else for you
Add ability to use [PASSWORD], [USERNAME], [EMAIL] (tries accounts.email first, if its not there, it uses accounts.pendingemail), in _ANY_ email. [REGNUM] also added but will obviously only work for participants
Add "all" section to the tabs list for user editor, so a user without any roles can still get the basic pages like "account", "roles", and "personal info"
Put count on participant invitations for teachers (and superusers)
Fix a bug where changing a password for a different user didnt work (it changed YOURS!)
2011-03-22 04:37:51 +00:00
" participants_all_thisconference " => array ( " name " => " Participants (all) for this conference " , " query " =>
" SELECT users.id
FROM users
JOIN user_roles ON user_roles . users_id = users . id
JOIN roles ON user_roles . roles_id = roles . id
WHERE users . conferences_id = '{$conference[' id ']}'
AND roles . type = 'participant' " ),
2010-11-01 21:23:17 +00:00
Fix all participant emails in communication module
Make queries for communications easier, all you need is a users.id queried, the system will find everything else for you
Add ability to use [PASSWORD], [USERNAME], [EMAIL] (tries accounts.email first, if its not there, it uses accounts.pendingemail), in _ANY_ email. [REGNUM] also added but will obviously only work for participants
Add "all" section to the tabs list for user editor, so a user without any roles can still get the basic pages like "account", "roles", and "personal info"
Put count on participant invitations for teachers (and superusers)
Fix a bug where changing a password for a different user didnt work (it changed YOURS!)
2011-03-22 04:37:51 +00:00
" participants_complete_thisconference " => array ( " name " => " Participants complete/paymentpending for this conference " , " query " =>
" SELECT users.id FROM users
JOIN registrations ON users . registrations_id = registrations . id
JOIN user_roles ON user_roles . users_id = users . id
JOIN roles ON roles . id = user_roles . roles_id
WHERE roles . type = 'participant'
AND registrations . conferences_id = '".$conference[' id ']."'
AND ( registrations . status = 'complete' OR registrations . status = 'paymentpending' ) " ),
" participants_complete_paymentpending_thisconference " => array ( " name " => " Participants payment pending for this conference " , " query " =>
" SELECT users.id FROM users
JOIN registrations ON users . registrations_id = registrations . id
JOIN user_roles ON user_roles . users_id = users . id
JOIN roles ON roles . id = user_roles . roles_id
WHERE roles . type = 'participant'
AND registrations . conferences_id = '".$conference[' id ']."'
AND registrations . status = 'paymentpending' " ),
2010-11-01 21:23:17 +00:00
" participants_notcomplete_thisconference " => array ( " name " => " Participants not complete for this conference " , " query " =>
Fix all participant emails in communication module
Make queries for communications easier, all you need is a users.id queried, the system will find everything else for you
Add ability to use [PASSWORD], [USERNAME], [EMAIL] (tries accounts.email first, if its not there, it uses accounts.pendingemail), in _ANY_ email. [REGNUM] also added but will obviously only work for participants
Add "all" section to the tabs list for user editor, so a user without any roles can still get the basic pages like "account", "roles", and "personal info"
Put count on participant invitations for teachers (and superusers)
Fix a bug where changing a password for a different user didnt work (it changed YOURS!)
2011-03-22 04:37:51 +00:00
" SELECT users.id
FROM users
JOIN user_roles ON user_roles . users_id = users . id
JOIN roles ON user_roles . roles_id = roles . id
LEFT JOIN registrations ON users . registrations_id = registrations . id
WHERE users . conferences_id = '{$conference[' id ']}'
AND roles . type = 'participant'
AND ( registrations . status IS NULL OR registrations . status = 'open' OR registrations . status = 'new' ) " ),
2010-11-01 21:23:17 +00:00
/* // FIXME - not sure if this has a sensible equivalent when dealing with "conferences" rather than fair years
2008-09-17 14:23:30 +00:00
" participants_complete_lastyear " => array ( " name " => " Participants complete last year " , " query " =>
" SELECT firstname, lastname, students.email FROM students,registrations WHERE students.registrations_id=registrations.id AND registrations.year=' " . ( $config [ 'FAIRYEAR' ] - 1 ) . " ' AND ( registrations.status='complete' OR registrations.status='paymentpending') ORDER BY students.email " ),
2010-11-01 21:23:17 +00:00
" participants_complete_allconferences " => array ( " name " => " Participants complete for all conferences " , " query " =>
2008-09-17 14:23:30 +00:00
Fix all participant emails in communication module
Make queries for communications easier, all you need is a users.id queried, the system will find everything else for you
Add ability to use [PASSWORD], [USERNAME], [EMAIL] (tries accounts.email first, if its not there, it uses accounts.pendingemail), in _ANY_ email. [REGNUM] also added but will obviously only work for participants
Add "all" section to the tabs list for user editor, so a user without any roles can still get the basic pages like "account", "roles", and "personal info"
Put count on participant invitations for teachers (and superusers)
Fix a bug where changing a password for a different user didnt work (it changed YOURS!)
2011-03-22 04:37:51 +00:00
" SELECT users.id, users.firstname, users.lastname, accounts.email FROM users
JOIN accounts on users . accounts_id = accounts . id
JOIN registrations ON users . registrations_id = registrations . id
JOIN user_roles ON user_roles . users_id = users . id
JOIN roles ON roles . id = user_roles . roles_id
WHERE roles . type = 'participant'
AND ( registrations . status = 'complete' OR registrations . status = 'paymentpending' ) ORDER BY accounts . email " ),
*/
2010-11-01 21:23:17 +00:00
" participants_cwsf_thisconference " => array ( " name " => " CWSF Winners for this conference " , " query " => "
Fix all participant emails in communication module
Make queries for communications easier, all you need is a users.id queried, the system will find everything else for you
Add ability to use [PASSWORD], [USERNAME], [EMAIL] (tries accounts.email first, if its not there, it uses accounts.pendingemail), in _ANY_ email. [REGNUM] also added but will obviously only work for participants
Add "all" section to the tabs list for user editor, so a user without any roles can still get the basic pages like "account", "roles", and "personal info"
Put count on participant invitations for teachers (and superusers)
Fix a bug where changing a password for a different user didnt work (it changed YOURS!)
2011-03-22 04:37:51 +00:00
SELECT users . id
2010-04-13 15:00:03 +00:00
FROM award_awards
JOIN award_prizes ON award_prizes . award_awards_id = award_awards . id
JOIN winners ON winners . awards_prizes_id = award_prizes . id
JOIN projects ON winners . projects_id = projects . id
JOIN registrations ON projects . registrations_id = registrations . id
Fix all participant emails in communication module
Make queries for communications easier, all you need is a users.id queried, the system will find everything else for you
Add ability to use [PASSWORD], [USERNAME], [EMAIL] (tries accounts.email first, if its not there, it uses accounts.pendingemail), in _ANY_ email. [REGNUM] also added but will obviously only work for participants
Add "all" section to the tabs list for user editor, so a user without any roles can still get the basic pages like "account", "roles", and "personal info"
Put count on participant invitations for teachers (and superusers)
Fix a bug where changing a password for a different user didnt work (it changed YOURS!)
2011-03-22 04:37:51 +00:00
JOIN users ON users . registrations_id = registrations . id
WHERE award_awards . cwsfaward = '1'
AND winners . conferences_id = '".$conference[' id ']."' " ),
2010-04-13 15:00:03 +00:00
2009-09-18 15:57:35 +00:00
" sponsors " => array ( " name " => " Organization sponsors " , " query " =>
" SELECT id, organization, email FROM sponsors WHERE email!='' ORDER BY email " ),
2007-03-12 14:23:44 +00:00
2009-09-18 15:57:35 +00:00
" sponsors_primarycontacts " => array ( " name " => " Organization sponsors (primary contacts) " , " query " =>
2010-11-03 17:18:02 +00:00
" SELECT users.id, conferences_id, organization, firstname, lastname, email, `primary`
FROM users
JOIN user_roles on users . id = user_roles . id
JOIN roles ON user_roles . roles_id = roles . id
2009-09-18 15:57:35 +00:00
WHERE
2010-11-03 17:18:02 +00:00
roles . type = 'sponsor'
AND email != ''
AND deleted = 'no'
AND `primary` = 'yes'
ORDER BY email
2009-09-18 15:57:35 +00:00
" ),
" sponsors_allcontacts " => array ( " name " => " Organization sponsors (all contacts) " , " query " =>
2010-11-01 21:23:17 +00:00
" SELECT DISTINCT(users.email), sponsors.organization, users.firstname, users.lastname, users.email
FROM sponsors
JOIN users_sponsor ON users_sponsor . sponsors_id = sponsors . id
JOIN users ON users . id = users_sponsor . users_id
JOIN user_roles ON user_roles . users_id = users . id
JOIN roles ON roles . id = user_roles . roles_id
WHERE
roles . type = 'sponsor'
AND users . deleted = 'no'
AND users . email != ''
ORDER BY users . email " ),
2009-09-18 15:57:35 +00:00
/*
2008-01-09 17:25:30 +00:00
" special_award_sponsors_unconfirmed " => array ( " name " => " Special award sponsors (unconfirmed only) " , " query " =>
2010-03-26 17:41:44 +00:00
" SELECT DISTINCT(award_sponsors.id), organization, firstname, lastname, award_contacts.email FROM award_sponsors, award_awards, award_contacts WHERE award_awards.sponsors_id=award_sponsors.id AND award_contacts.award_sponsors_id=award_sponsors.id AND award_sponsors.confirmed='no' AND award_awards.award_types_id='2' AND award_contacts.year=' " . $config [ 'FAIRYEAR' ] . " ' " ),
2007-03-12 14:23:44 +00:00
2008-01-09 17:25:30 +00:00
" special_award_sponsors_all " => array ( " name " => " Special award sponsors (all) " , " query " =>
2010-03-26 17:41:44 +00:00
" SELECT DISTINCT(award_sponsors.id), organization, firstname, lastname, award_contacts.email FROM award_sponsors, award_awards, award_contacts WHERE award_awards.sponsors_id=award_sponsors.id AND award_contacts.award_sponsors_id=award_sponsors.id AND award_awards.award_types_id='2' AND award_contacts.year=' " . $config [ 'FAIRYEAR' ] . " ' " ),
2009-09-18 15:57:35 +00:00
*/
2011-03-04 02:26:22 +00:00
" school_principals " => array ( " name " => " School principals this conference " , " query " =>
2011-03-23 19:44:08 +00:00
" SELECT principal_uid AS id FROM schools
2011-03-04 02:26:22 +00:00
WHERE schools . conferences_id = '".$conference[' id ']."'
2011-03-23 19:44:08 +00:00
AND principal_uid > 0
2011-03-04 02:26:22 +00:00
" ),
2011-03-23 19:44:08 +00:00
2011-03-04 02:26:22 +00:00
" school_scienceheads " => array ( " name " => " School science heads this conference " , " query " =>
2011-03-23 19:44:08 +00:00
" SELECT sciencehead_uid AS id FROM schools
2011-03-04 02:26:22 +00:00
WHERE schools . conferences_id = '".$conference[' id ']."'
2011-03-23 19:44:08 +00:00
AND sciencehead_uid > 0
2011-03-04 02:26:22 +00:00
" ),
2011-03-23 19:44:08 +00:00
" teachers_with_school " => array ( " name " => " Teachers with a school in this conference " , " query " =>
" SELECT users.id
2011-03-04 02:26:22 +00:00
FROM users
JOIN schools ON users . schools_id = schools . id
JOIN user_roles ON users . id = user_roles . users_id
JOIN roles ON user_roles . roles_id = roles . id
WHERE schools . conferences_id = '".$conference[' id ']."'
AND roles . type = 'teacher'
" ),
2011-03-23 19:44:08 +00:00
" teachers_without_school " => array ( " name " => " Teachers without a school in this conference " , " query " =>
" SELECT users.id
2011-03-04 02:26:22 +00:00
FROM users
JOIN user_roles ON users . id = user_roles . users_id
JOIN roles ON user_roles . roles_id = roles . id
WHERE roles . type = 'teacher'
AND users . conferences_id = '".$conference[' id ']."'
AND ( users . schools_id = '' OR users . schools_id = 0 )
" ),
/*
2010-11-01 21:23:17 +00:00
" school_teachers_thisconference " => array ( " name " => " Teachers (as entered by students) for this conference " , " query " =>
" SELECT DISTINCT(teacheremail) AS email, teachername AS firstname FROM students WHERE conferences_id=' " . $conference [ 'id' ] . " ' AND teacheremail!='' " ),
2011-03-04 02:26:22 +00:00
*/
2010-11-01 21:23:17 +00:00
/* // FIXME again, not sure that this has a sensible equivalent with conferences
2008-01-09 17:25:30 +00:00
" school_teachers_lastyear " => array ( " name " => " Teachers (as entered by students) last year " , " query " =>
2008-01-09 17:28:11 +00:00
" SELECT DISTINCT(teacheremail) AS email, teachername AS firstname FROM students WHERE year=' " . ( $config [ 'FAIRYEAR' ] - 1 ) . " ' AND teacheremail!='' " ),
2010-11-01 21:23:17 +00:00
*/
2011-03-04 02:26:22 +00:00
/*
2010-11-01 21:23:17 +00:00
" school_teachers_allconferences " => array ( " name " => " Teachers (as entered by students) all conferences " , " query " =>
2008-01-09 17:28:11 +00:00
" SELECT DISTINCT(teacheremail) AS email, teachername AS firstname FROM students WHERE teacheremail!='' " ),
2011-03-04 02:26:22 +00:00
*/
2009-09-09 00:26:12 +00:00
/* Volunteers */
2010-11-01 21:23:17 +00:00
" volunteers_active_complete_thisconference " => array ( " name " => " Volunteers active for this conference and complete " , " query " =>
" SELECT users.id, firstname, lastname, email
FROM users LEFT JOIN user_roles ON user_roles . users_id = users . id JOIN roles ON roles . id = user_roles . roles_id
WHERE users . conferences_id = '".$conference[' id ']."'
AND roles . type = 'volunteer'
AND user_roles . complete = 'yes'
AND user_roles . active = 'yes'
AND users . deleted = 'no'
ORDER BY email " ),
" volunteers_active_incomplete_thisconference " => array ( " name " => " Volunteers active for this conference but not complete " , " query " =>
" SELECT users.id, firstname, lastname, email
FROM users LEFT JOIN user_roles ON user_roles . users_id = users . id JOIN roles ON roles . id = user_roles . roles_id
WHERE users . conferences_id = '".$conference[' id ']."'
AND roles . type = 'volunteer'
AND user_roles . complete = 'no'
AND user_roles . active = 'yes'
AND users . deleted = 'no'
ORDER BY email " ),
2009-09-09 00:26:12 +00:00
2006-03-01 15:59:51 +00:00
);
2006-10-25 01:50:59 +00:00
?>