Updated code to allow invitaiton of committee members.

This commit is contained in:
jacob 2012-02-10 20:19:19 +00:00
parent 4f8b8c6a57
commit 6893a22276
2 changed files with 18 additions and 7 deletions

View File

@ -184,7 +184,7 @@ if($_GET['unlinkmember'] && $_GET['unlinkcommittee']) {
echo happy(i18n("Committee member unlinked from committee"));
}
echo '<a href="../user_invite.php?type=committee">Create a new member</a><br/>';
echo "<a href=\"committee_committees.php\">Manage Committees</a><br />";
echo "<form name=\"memberaction\" method=\"post\" action=\"committees.php\" onsubmit=\"return actionSubmit()\">\n";
echo "<table>";
@ -197,12 +197,17 @@ if($_GET['unlinkmember'] && $_GET['unlinkcommittee']) {
echo "</select>";
echo "</td><td>";
$q=mysql_query("SELECT accounts_id,MAX(year),firstname,lastname,email,deleted FROM users WHERE types LIKE '%committee%' GROUP BY accounts_id ORDER BY firstname");
$query = "
SELECT accounts_id, firstname, lastname, email, deleted FROM users WHERE accounts_id IN(
SELECT accounts_id FROM user_roles JOIN roles ON user_roles.roles_id = roles.id WHERE roles.type = 'committee'
)
AND conferences_id = " . $conference['id'];
$q = mysql_query($query);
echo "<select name=\"accounts_id\">";
echo "<option value=\"\">".i18n("Select a Member")."</option>\n";
while($r=mysql_fetch_object($q))
{
if($r->deleted != 'no') continue;
if($r->deleted == 'yes') continue;
$displayname = $r->firstname.' '.$r->lastname;
echo "<option value=\"$r->accounts_id\">$displayname ($r->email)</option>\n";
}

View File

@ -160,6 +160,12 @@
}
}
*/
// Hrm - at the moment, only committee members and admins can access this page anyway, so no need to worry about who's making this invitation - Jacob, 2012-02-10
$allowed_types = array(
'judge' => 'Judge',
'volunteer' => 'Volunteer',
'committee' => 'Committee Memeber'
);
if($_POST['action']=="invitenew" && $_POST['email'] && $type != '') {
$newUser=user_invite($_POST['email'], null, $_POST['email'], $type);
@ -189,10 +195,10 @@ if($_POST['action']=="invitenew" && $_POST['email'] && $type != '') {
echo i18n("Select a Role: ");
echo "</td><td><select id=\"role\" name=\"type\" onChange=\"checkEmail();\">\n";
echo "<option value=\"\" >".i18n('Choose')."</option>\n";
$sel = ($type == 'judge') ? 'selected="selected"' : '';
echo "<option value=\"judge\" $sel >".i18n('Judge')."</option>\n";
$sel = ($type == 'volunteer') ? 'selected="selected"' : '';
echo "<option value=\"volunteer\" $sel >".i18n('Volunteer')."</option>\n";
foreach($allowed_types as $rtype => $label){
$sel = ($type == $rtype) ? ' selected="selected"' : '';
echo "<option value=\"$rtype\"$sel>" . i18n($label) . "</option>\n";
}
echo "</select></td></tr><tr><td>";
echo i18n("Enter an Email: ");
echo "</td><td><input type=\"text\" id=\"email\" name=\"email\" size=\"40\" onKeyUp=\"checkEmailLater();\" />";