";
diff --git a/admin/user_list.php b/admin/user_list.php
index 2339e93..18fc0dd 100644
--- a/admin/user_list.php
+++ b/admin/user_list.php
@@ -20,6 +20,11 @@
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
+
+// This file was modified March of 2015 by Sebastian Ruan
+/* Flagging for judges has been added to monitor concerns.
+ Update User button also added; allows super users to update
+ a judge to the current fair year without logging in as them. */
?>
require_once('../common.inc.php');
@@ -46,6 +51,8 @@
message_push(happy(i18n('User deleted.')));
}
+
+
send_header("User Editor",
array('Committee Main' => 'committee_main.php',
'Administration' => 'admin/index.php')
@@ -62,6 +69,8 @@ function openeditor(id)
}
+
+
function toggleoptions()
{
if(document.getElementById('options').style.display == 'none') {
@@ -95,10 +104,96 @@ function neweditor()
return false;
}
+
+/* update (id) grabs the current url and appends an action called update as well as the id it is going to renew.
+ If there is already an action called update and an id the function will change the id to the new
+ id as determined by the button clicked
+
+ update (id) Int -> String
+
+ Effects: update(id) reloads the page with the adjusted url
+
+ Example: update (2526) => http://localhost/sfiab/testfair/admin/user_list.php?show_types[]=judge&action=update&id=2526 */
+
+function update (id)
+{
+ var url = window.location.href;
+
+ // if a previous update button was already clicked
+ if(url.indexOf('&action=')>-1){
+ url = url.substring(0,url.indexOf('&action=update'));
+ url += '&action=update&id='+id;
+ }
+ // if there is no ? in the url already present
+ else if (url.indexOf ('?') == -1) {
+ url += '?action=update&id='+id;
+ }
+ //if '?action...' is present in url
+ else if(url.indexOf('?action=')>-1){
+ url = url.substring(0,url.indexOf('?action=update'));
+ url += '?action=update&id='+id;
+ }
+
+ else{
+ url += '&action=update&id='+id;
+ }
+
+ // reload using adjusted url
+ window.location.href=url;
+
+
+}
+
+// Begin updating user
+ if($_GET['action']=='update') {
+ $id = intval($_GET['id']);
+
+ //if no id print error
+ if(!$id) {
+ echo "Invalid id for update";
+ exit;
+ }
+
+ $user = user_load($id);
+
+ // Determine if there is a more recent uid that may possibly be in the current FAIRYEAR (allows refresh page to work)
+ $query = mysql_query("SELECT id,uid,year FROM users WHERE uid='{$user['uid']}'
+ ORDER BY year DESC LIMIT 1");
+
+ $user_new = mysql_fetch_assoc($query);
+
+ // Make sure our user is NOT in the current FAIRYEAR (again, this helps with page refresh to work )
+ if ($user_new['year'] != $config['FAIRYEAR']) {
+ /* Update user to new year via dupelicating row into new id.
+ If multiple Roles, all updated */
+ user_dupe($user, $config['FAIRYEAR']);
+ message_push(happy(i18n('User Updated')));
+
+ //find the newly updated user
+ $q_reload = mysql_query("SELECT id FROM users WHERE uid='{$user['uid']}'
+ ORDER BY year DESC LIMIT 1");
+
+ $reload_user = mysql_fetch_assoc($q_reload);
+
+ ?>
+
+
+
+ }
+
+ }
+ //End update to user
+
echo "
";
echo "- ".i18n('Hide Display Options')."";
@@ -207,9 +302,14 @@ function neweditor()
echo mysql_error();
// echo $querystr;
$num=mysql_num_rows($q);
- echo i18n("Listing %1 people total. See the table at the bottom for the totals by status",array($num));
-
echo mysql_error();
+ echo i18n("Listing %1 people total. See the table at the bottom for the totals by status
",array($num));
+ echo i18n(" Notes:
Deleting users from this list is a permanent operation and cannot be undone. Consider editing the user and deactivating or deleting roles in their account instead.
+
Updating a user to the current fair year allows you to then complete the user from this list.
+
A flagged judge indicates there is text in the private information field for that judge.
+
Only committee members can see text entered into the private information field for judges. This field is not seen nor editable by any judge.");
+
+
echo "";
echo "
";
echo "
".i18n("Name")."
";
@@ -218,6 +318,7 @@ function neweditor()
echo "
".i18n("Type(s)")."
";
echo "
".i18n("Active")."
";
echo "
".i18n("Complete")."
";
+ echo "
".i18n("Flagged")."
";
echo "
".i18n("Actions")."
";
echo "
";
echo "";
@@ -237,9 +338,14 @@ function neweditor()
if(in_array('judge',$show_types)){
$u=user_load_by_uid($r['uid']);
- //we also set teh $r array so it displays properly on first load
+ //we also set the $r array so it displays properly on first load
if(judge_status_update($u)=="complete")
$r['judge_complete']='yes';
+
+ else{
+ $r['judge_complete']='no';
+ }
+
}
$types = explode(',', $r['types']);
$span = count($types) > 1 ? "rowspan=\"".count($types)."\"" : '';
@@ -289,11 +395,54 @@ function neweditor()
}
echo "";
+
+ // Begin flagging process
+
+ echo "
";
+
+ // Must be a judge in order to be flagged
+ if ($t == 'judge'){
+
+ /* Determine if judge is flagged and display X icon.
+ Icon is clickable. Brings user to user_editor_window file.
+ Would preferably ALSO bring the user to the judge other tab*/
+ if($r['flagged_judge'] == '1') {
+ echo "";
+ echo "";
+ echo "";
+
+ // Otherwise judge is not flagged; display checkmark icon. Also clickable.
+ } else { echo "";
+ echo "";
+ echo "";
+ }
+
+ } else {
+ // Do nothing. Only judges can be flagged.
+ }
+
+ echo "
";
+
+ //end flagging process
+
+
if($first) {
/* Finish off the the first line */
- echo "
";
- echo " ";
- echo "";
+ // If judge not in current fair year need seperate icons so that all icons align nicely in the table
+ if ($t == 'judge' and $r['year'] != $config['FAIRYEAR']){
+ echo "
";
}
@@ -309,7 +458,6 @@ function neweditor()
}
echo "";
- echo i18n("Note: Deleting users from this list is a permanent operation and cannot be undone. Consider editting the user and deactivating or deleting roles in their account instead.");
// let's make a table with the complete/incomplete counts and the active/inacteve states
?>
diff --git a/config/index.php b/config/index.php
index 4f139db..6c28888 100644
--- a/config/index.php
+++ b/config/index.php
@@ -23,6 +23,7 @@
?>
require("../common.inc.php");
+ require("signaturepage_or_permissionform.php");
require_once("../user.inc.php");
require_once("../chat.inc.php");
user_auth_required('committee', 'config');
@@ -46,7 +47,7 @@ draw_chatbox('general');
echo "
";
diff --git a/config/signaturepage.php b/config/signaturepage.php
index fc73a93..5a638f7 100644
--- a/config/signaturepage.php
+++ b/config/signaturepage.php
@@ -23,9 +23,10 @@
?>
require("../common.inc.php");
+ require("signaturepage_or_permissionform.php");
require_once("../user.inc.php");
user_auth_required('committee', 'config');
- send_header("Signature Page",
+ send_header("$participationform",
array('Committee Main' => 'committee_main.php',
'SFIAB Configuration' => 'config/index.php')
,"exhibitor_signature_page"
@@ -44,7 +45,7 @@
mysql_query("UPDATE signaturepage SET `use`='$usete', `text`='".mysql_escape_string(stripslashes($_POST['teacherdeclaration']))."' WHERE name='teacherdeclaration'");
mysql_query("UPDATE signaturepage SET `use`='$usepa', `text`='".mysql_escape_string(stripslashes($_POST['postamble']))."' WHERE name='postamble'");
mysql_query("UPDATE signaturepage SET `use`='$userf', `text`='' WHERE name='regfee'");
- echo happy(i18n("Signature page text successfully saved"));
+ echo happy(i18n("$sentence_begin_participationform text successfully saved"));
}
echo "Preview your signature form as a PDF (as a student would see it) ";
@@ -81,7 +82,7 @@ echo " ";
$q=mysql_query("SELECT * FROM signaturepage WHERE name='regfee'");
$r=mysql_fetch_object($q);
if($r->use) $ch="checked=\"checked\""; else $ch="";
-echo "".i18n("Include registration fee information on the signature page");
+echo "".i18n("Include registration fee information on the $non_capital_participationform");
echo " ";
echo " ";
@@ -94,7 +95,7 @@ echo "";
echo " ";
-echo "";
+echo "";
echo "";
send_footer();
diff --git a/confirmed_participants.php b/confirmed_participants.php
index 5909a26..333a065 100644
--- a/confirmed_participants.php
+++ b/confirmed_participants.php
@@ -23,6 +23,7 @@
?>
require("common.inc.php");
+ require("./config/signaturepage_or_permissionform.php");
send_header("Confirmed Participants");
@@ -32,7 +33,7 @@
if($r->test!=1)
{
list($d,$t)=explode(" ",$config['dates']['postparticipants']);
- echo i18n("Confirmed participants (that signature forms have been received for) will be posted here on %1 at %2. Please do not contact the fair to inquire about receipt of your signature form until after this date (and only if you are not listed here after this date).",array($d,$t));
+ echo i18n("Confirmed participants (that $signatureformpermissionform have been received for) will be posted here on %1 at %2. Please do not contact the fair to inquire about receipt of your $signatureformpermissionform until after this date (and only if you are not listed here after this date).",array($d,$t));
}
else
{
@@ -66,11 +67,11 @@
$lastcat="something_that_does_not_exist";
$lastdiv="something_that_does_not_exist";
- echo i18n("The following is a list of all confirmed participants that the signature form has been received for. If you think you registered but you are not on this list, you should contact the %1 immediately.",array($config['fairname']))." ";
+ echo i18n("The following is a list of all confirmed participants that the $signatureformpermissionform has been received for. If you think you registered but you are not on this list, you should contact the %1 immediately.",array($config['fairname']))." ";
if($config['regfee']>0)
{
echo " ";
- echo "*".i18n(" indicates payment was not received with the signature form.");
+ echo "*".i18n(" indicates payment was not received with the $signatureformpermissionform.");
echo " ";
echo " ";
}
diff --git a/db/db.code.version.txt b/db/db.code.version.txt
index eec4941..f84d24e 100644
--- a/db/db.code.version.txt
+++ b/db/db.code.version.txt
@@ -1 +1 @@
-177
+178
diff --git a/judge_other.php b/judge_other.php
index 89bb33c..4ab87df 100644
--- a/judge_other.php
+++ b/judge_other.php
@@ -20,6 +20,11 @@
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
+
+// This file was modified March of 2015 by Sebastian Ruan
+// Judges now have a private information field which only committee members can see and edit.
+// If information is entered into this field the judge will be flagged in ./admin/user_list.php table.
+
?>
require_once('common.inc.php');
@@ -57,11 +62,22 @@ case 'save':
$u['years_regional'] = intval($_POST['years_regional']);
$u['years_national'] = intval($_POST['years_national']);
$u['highest_psd'] = stripslashes($_POST['highest_psd']);
+ $u['private_info'] = mysql_escape_string(iconv("UTF-8","ISO-8859-1//TRANSLIT",stripslashes($_POST['private_info'])));
+
+ //check if judge has been flagged then update them
+
+ if(empty($_POST['private_info'])) {
+ $u['flagged_judge'] = '0';
+ }
+ else {
+ $u['flagged_judge'] = '1';
+ }
user_save($u);
questions_save_answers("judgereg",$u['id'],$_POST['questions']);
happy_("Preferences successfully saved");
+
$u=user_load($eid);
$newstatus=judge_status_other($u);
echo "