Add new participnt registration type: openorinvite - allows you to use the system as if it was OPEN or INVITE however limits cannot be imposed in the inviter since when its reached in the inviter it could easily be bypassed by registering through the 'open' way.

This commit is contained in:
james 2007-01-02 23:38:53 +00:00
parent 0dd2da7145
commit 2d17c8c21a
5 changed files with 70 additions and 43 deletions

View File

@ -1,3 +1,3 @@
INSERT INTO `config` (category,ord,var,val,description,year) VALUES ('Participant Registration','1160','participant_project_table','yes','Ask if the project requires a table (yes/no)',-1);
INSERT INTO `config` (category,ord,var,val,description,year) VALUES ('Participant Registration','1170','participant_project_electricity','yes','Ask if the project requires electricity (yes/no)',-1);
UPDATE `config` SET description = 'The type of Participant Registration to use: open | singlepassword | schoolpassword | invite | openorinvite' WHERE `var` = 'participant_registration_type'

View File

@ -285,7 +285,10 @@
else if($config['participant_registration_type']=="open")
{
//thats fine, continue on and create them the account.
}
else if($config['participant_registration_type']=="openorinvite")
{
//thats fine too, continue on and create them the account.
}
else
{

View File

@ -381,7 +381,7 @@ if($config['participant_student_personal']=="yes")
echo "<tr>\n";
echo " <td>".i18n("School")."</td><td colspan=\"3\">";
if( $config['participant_registration_type']=="open" || $config['participant_registration_type']=="singlepassword" || ($studentinfo && !$studentinfo->schools_id) )
if( $config['participant_registration_type']=="open" || $config['participant_registration_type']=="singlepassword" || $config['participant_registration_type']=="openorinvite" || ($studentinfo && !$studentinfo->schools_id) )
{
$schoolq=mysql_query("SELECT id,school FROM schools WHERE year='".$config['FAIRYEAR']."' ORDER by school");
echo "<select name=\"schools_id[$x]\">\n";

View File

@ -123,7 +123,7 @@ if($_SESSION['schoolid'] && $_SESSION['schoolaccesscode'])
echo "<br />";
echo "<br />";
}
else if($config['participant_registration_type']=="invite")
else if($config['participant_registration_type']=="invite" || $config['participant_registration_type']=="openorinvite" )
{
echo "<h4>".i18n("Participant Registration Invitations")."</h4>";

View File

@ -12,7 +12,7 @@ if($_SESSION['schoolid'] && $_SESSION['schoolaccesscode'])
$school=mysql_fetch_object($q);
if($school)
{
if($config['participant_registration_type']=="invite")
if($config['participant_registration_type']=="invite" || $config['participant_registration_type']=="openorinvite" )
{
if($_POST['action']=="invite")
{
@ -105,13 +105,16 @@ if($_SESSION['schoolid'] && $_SESSION['schoolaccesscode'])
ORDER BY
lastname,
firstname");
if($datecheck!=0)
$currentinvited=mysql_num_rows($q);
if($datecheck!=0)
{
echo i18n("In order for your school's students to register for the fair, you will need to invite them to register. Simply enter their email address below to invite them to register. <b>Important</b>: for group projects, only add one of the participants, that participant will then add the other group member(s) to the project");
echo "<br />";
echo "<br />";
$okaygrades=array();
if($config['participant_registration_type']=="invite")
{
if($school->projectlimitper=="total")
{
if($school->projectlimit)
@ -153,7 +156,7 @@ if($_SESSION['schoolid'] && $_SESSION['schoolaccesscode'])
$r2=mysql_fetch_object($q2);
$currentinvited=$r2->num;
if($currentinvited<$school->projectlimit)
if($currentinvited<$school->projectlimit || $school->projectlimit==0)
{
for($a=$catr->mingrade;$a<=$catr->maxgrade;$a++)
$okaygrades[]=$a;
@ -164,6 +167,27 @@ if($_SESSION['schoolid'] && $_SESSION['schoolaccesscode'])
}
}
else
{
//hmm projectlimitper has not been set
//so we have no limits, anyone can register or they can add as many as they want.
for($x=$config['mingrade']; $x<=$config['maxgrade']; $x++)
$okaygrades[]=$x;
}
}
else
{
// this could be an else if $config['participant_registration_type']=="openorinvite" )
//because openorinvite is the only other option
//so we have no limits, anyone can register or they can add as many as they want.
//you cannot enforce limits when the system is 'open' because anyone can choose any school
//and if its openorinvite then whatever happens in the inviter still morepeople can be added
//by themselves, so there's no point in having limits.
for($x=$config['mingrade']; $x<=$config['maxgrade']; $x++)
$okaygrades[]=$x;
}
echo "<br />";
if(count($okaygrades))