diff --git a/admin/committees.php b/admin/committees.php index f047efc..2e72694 100644 --- a/admin/committees.php +++ b/admin/committees.php @@ -41,17 +41,13 @@ if($_POST['users_id']) exit; } - if($_POST['action'] == 'edit') { - header("location: {$config['SFIABDIRECTORY']}/user_personal.php?edit=$uid"); - exit; - } - /* Now, start the output for this page */ send_header("Committee Management", array('Committee Main' => 'committee_main.php', 'Administration' => 'admin/index.php' ), "committee_management"); + $_SESSION['last_page'] = 'committee_management'; ?> @@ -59,6 +55,17 @@ if($_POST['users_id']) - -".i18n("Active Judges list for %1",array($config['FAIRYEAR'])).""; - echo ""; - $querystr="SELECT - judges.id, - judges.firstname, - judges.lastname, - judges.email, - judges.complete, - judges_years.year - FROM - judges - JOIN judges_years ON judges.id=judges_years.judges_id - WHERE - judges_years.year='".$config['FAIRYEAR']."' - AND judges.deleted='no' - ORDER BY - lastname, - firstname"; - $q=mysql_query($querystr); - $num=mysql_num_rows($q); - echo i18n("Listing %1 judges total. See the bottom for breakdown of judges by complete status",array($num),array("the number of judges")); - - echo mysql_error(); - echo ""; - echo " "; - echo " "; - echo " "; - echo " "; - echo ""; - $completeyes=0; - $completeno=0; - while($r=mysql_fetch_object($q)) - { - echo ""; - echo ""; - - if($r->complete=="yes" && $r->year) - { - echo ""; - $completeyes++; - } - else - { - echo ""; - $cl="error"; - $completeno++; - } - echo ""; - echo ""; - } - - echo "
".i18n("Judge Name")."".i18n("Email Address")."".i18n("Complete")."".i18n("Actions")."
"; - echo "id)\">$r->firstname $r->lastname"; - echo "$r->email".i18n("yes")."".i18n("no").""; - echo "id\">"; - echo "
"; - echo i18n("Note: Deleting judges from this list only deactivates the judge for this year's fair. To completely delete a judge, use the 'Manage Judges' page"); - echo "
"; - echo "
"; - echo i18n("There are %1 total active judges.",array($num),array("the number of judges")); - echo "
"; - echo i18n("There are %1 complete judges.",array($completeyes),array("the number of judges")); - echo "
"; - echo i18n("There are %1 incomplete judges.",array($completeno),array("the number of judges")); - echo "
"; - echo "
"; - echo "
"; - - send_footer(); -?> diff --git a/admin/judges_manager.php b/admin/judges_manager.php deleted file mode 100644 index 233fcd2..0000000 --- a/admin/judges_manager.php +++ /dev/null @@ -1,100 +0,0 @@ - - Copyright (C) 2005 James Grant - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public - License as published by the Free Software Foundation, version 2. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. If not, write to - the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ -?> - 'committee_main.php', - 'Administration' => 'admin/index.php', - 'Judges' => 'admin/judges.php') ); - -?> - - -"); - if(isset($_GET['show_what'])) { - $_SESSION['judgesmanager_show_what']=$_GET['show_what']; - } - if($_SESSION['judgesmanager_show_what']) { - $show_what = $_SESSION['judgesmanager_show_what']; - } else { - $show_what = "cy_complete"; - } - print("
"); - print(""); - print(""); - print("
"); - -// echo i18n("Note: Deleting a judge from this screen only unlinks them from the current fairyear"); - - $editor = new TableEditor('judge'); - -// $editor->setDebug(true); - - switch($show_what) { - case "all": - $editor->setOption('judges_show_what', 'all'); - break; - case "cy_active": - $editor->setOption('judges_show_what', 'current_year_active'); - break; - case "cy_complete": - $editor->setOption('judges_show_what', 'current_year_complete'); - break; - } - - $editor->execute(); - - - send_footer(); -?> diff --git a/admin/user_editor_window.php b/admin/user_editor_window.php new file mode 100644 index 0000000..8fb8498 --- /dev/null +++ b/admin/user_editor_window.php @@ -0,0 +1,100 @@ + + Copyright (C) 2005 James Grant + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public + License as published by the Free Software Foundation, version 2. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. +*/ +?> + array( + 'name' => 'Personal', + 'types' => array('student','judge','committee','volunteer'), + 'file' => '../user_personal.php', + ), + 'judgeother' => array( + 'name' => 'Judge Other', + 'types' => array('judge'), + 'file' => '../judge_other.php', + ), + 'judgeexpertise' => array( + 'name' => 'Expertise', + 'types' => array('judge'), + 'file' => '../judge_expertise.php', + ), + 'judgesa' => array( + 'name' => 'Special Awards', + 'types' => array('judge'), + 'file' => '../judge_special_awards.php', + ), + 'volunteerpos' => array( + 'name' => 'Volunteer Positions', + 'types' => array('volunteer'), + 'file' => '../volunteer_position.php', + ), + + ); + +$selected = $_GET['tab']; +if(!array_key_exists($selected, $tabs)) $selected = 'personal'; + +$id = $_GET['id']; + +$u = user_load($id); +send_popup_header(i18n("User Editor").": {$u['name']}"); + +?> + +'; +foreach($tabs as $k=>$t) { + $i = array_intersect($t['types'], $u['types']); + if(count($i) == 0) continue; + $sel = ($selected == $k) ? 'htabsel' : ''; + $href = "$PHP_SELF?id=$id&tab=$k"; + echo "
  • ".i18n($t['name'])."
  • "; +} +echo ''; + +$t = $tabs[$selected]; + +/* Setup some things */ +$_SESSION['embed'] = true; +$_SESSION['embed_submit_url'] = "{$_SERVER['PHP_SELF']}?id=$id&tab=$selected"; +$_SESSION['embed_edit_id'] = $id; + +echo '
    '; +include("{$t['file']}"); +echo '
    '; + +unset($_SESSION['embed']); +unset($_SESSION['embed_edit_id']); +unset($_SESSION['embed_submit_url']); + +$icon_path = $config['SFIABDIRECTORY']."/images/16/"; +$icon_exitension = $config['icon_extension']; + + + send_popup_footer(); +?> diff --git a/admin/user_list.php b/admin/user_list.php new file mode 100644 index 0000000..7dd36a9 --- /dev/null +++ b/admin/user_list.php @@ -0,0 +1,225 @@ + + Copyright (C) 2005 James Grant + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public + License as published by the Free Software Foundation, version 2. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. +*/ +?> + 'committee_main.php', + 'Administration' => 'admin/index.php') + ); +?> + + +"; + echo "- ".i18n('Hide Display Options').""; + + echo "
    "; + + echo "
    "; + echo ""; + $x = 0; + foreach($user_what as $k=>$v ) { + $sel = (in_array($k, $show_types)) ? 'checked="checked"' : ''; + echo ""; + if($x) echo ""; + $x = ~$x; + } + echo ""; + + echo ""; + echo "
    ".i18n('Type').":".i18n($v)."
    ".i18n('Complete').":"; + echo ""; + + echo "
    ".i18n('Year').":"; + echo ""; + echo "
    "; + echo "
    "; + echo ""; + echo "
    "; + echo "
    "; + + echo ""; + + echo "
    "; + + /* Grab a list of users */ + $w = array(); + foreach($show_types as $t) { + $w [] = "users.types LIKE '%$t%'"; + } + $where_types = "AND (".join(" OR ", $w).")"; + + $where_complete = ""; + if($show_complete == 'yes') { + foreach($show_types as $t) { + $where_complete .= "AND ({$t}_complete='yes' OR {$t}_complete IS NULL) "; + } + } + + if($show_year == 'current') + $where_year = "AND year={$config['FAIRYEAR']}"; + + echo ""; + $querystr="SELECT + * + FROM + users + LEFT JOIN `users_committee` ON `users_committee`.`users_id`=`users`.`id` + LEFT JOIN `users_judge` ON `users_judge`.`users_id`=`users`.`id` + LEFT JOIN `users_volunteer` ON `users_volunteer`.`users_id`=`users`.`id` + LEFT JOIN `users_fair` ON `users_fair`.`users_id`=`users`.`id` + LEFT JOIN `users_sponsor` ON `users_sponsor`.`users_id`=`users`.`id` + WHERE + users.deleted='no' + $where_year + $where_types + $where_complete + ORDER BY + lastname ASC, + firstname ASC, + year DESC"; + $q=mysql_query($querystr); + echo mysql_error(); +// echo $querystr; + $num=mysql_num_rows($q); + echo i18n("Listing %1 people total. See the bottom for breakdown of by complete status",array($num)); + + echo mysql_error(); + echo ""; + echo " "; + echo " "; + echo " "; + echo " "; + echo " "; + echo " "; + echo ""; + $completeyes=0; + $completeno=0; + while($r=mysql_fetch_assoc($q)) + { + echo ""; + + echo ""; + + echo ""; + + echo ""; + echo ""; + echo ""; + } + + echo "
    ".i18n("Name")."".i18n("Type(s)")."".i18n("Email Address")."".i18n("Year")."".i18n("Complete")."".i18n("Actions")."
    "; + echo "{$r['firstname']} {$r['lastname']}"; + echo ""; + $types = split(',', $r['types']); + foreach($types as $t) { + echo $user_what[$t]."
    "; + } + echo "
    {$r['email']}{$r['year']}"; + foreach($types as $t) { + + if($r["{$t}_complete"] == 'yes') { + echo "
    ".i18n("yes")."
    "; + $completeyes++; + } else { + echo "
    ".i18n("no")."
    "; + $completeno++; + } + } + echo "
    "; + echo "id\">"; + echo "
    "; + echo i18n("Note: Deleting judges from this list only deactivates the judge for this year's fair. To completely delete a judge, use the 'Manage Judges' page"); + echo "
    "; + echo "
    "; + echo "$num ".i18n("people listed."); + echo "
    "; + echo "$completeyes ".i18n('complete'); + echo "
    "; + echo "$completeno ".i18n('incomplete'); + echo "
    "; + echo "
    "; + echo "
    "; + + send_footer(); +?> diff --git a/admin/volunteers.php b/admin/volunteers.php index 53af384..f44d9be 100644 --- a/admin/volunteers.php +++ b/admin/volunteers.php @@ -32,8 +32,9 @@ "volunteer_management" ); echo "
    "; - echo "".i18n("Invite Volunteers")."
    "; + echo "".i18n("Volunteer Manager")."
    "; echo "".i18n("Volunteer Position Management")."
    "; + echo "".i18n("Invite Volunteers")."
    "; send_footer(); diff --git a/common.inc.php b/common.inc.php index ec88c48..d04b765 100644 --- a/common.inc.php +++ b/common.inc.php @@ -353,6 +353,15 @@ function happy($str,$type="normal") return "$str
    "; } +function display_messages() +{ + /* Dump any messages in the queue */ + if(is_array($_SESSION['messages'])) { + foreach($_SESSION['messages'] as $m) echo $m; + } + $_SESSION['messages'] = array(); +} + $HEADER_SENT=false; function send_header($title="", $nav=null, $icon=null, $titletranslated=false) { @@ -610,13 +619,10 @@ if(substr(getcwd(),-6)=="/admin" || substr(getcwd(),-7)=="/config") } ""; echo ""; -/* Dump any messages in the queue */ -if(is_array($_SESSION['messages'])) { - foreach($_SESSION['messages'] as $m) echo $m; -} -$_SESSION['messages'] = array(); - + + display_messages(); } +/* END OF send_header */ function send_footer() { @@ -665,6 +671,7 @@ function send_popup_header($title="") ".i18n($title).""; + } function send_popup_footer() diff --git a/htabs.css b/htabs.css new file mode 100644 index 0000000..ac24665 --- /dev/null +++ b/htabs.css @@ -0,0 +1,64 @@ +/* Ideas borrowed from: http://unraveled.com/projects/assets/css_tabs/ */ +ul#htabs { + text-align: left; /* set to left, right or center */ + margin: 1em 0 0 0; /* set margins as desired */ + font-family: Verdana, Arial, Sans-Serif; + font-size: 10px; + font-weight: bold; + border-bottom-width: 1px; + border-bottom-style: solid; +/* border-color: defined in sfiab.css */ + list-style-type: none; + padding: 3px 10px 3px 10px; /* THIRD number must change with respect to padding-top (X) below */ +} + +ul#htabs li { /* do not change */ + display: inline; + margin-right: 5px; /* set additional spacing between tabs as desired */ +} + +ul#htabs li.htabsel { /* settings for selected tab */ + border-bottom-width: 1px; + border-bottom-style: solid; +/* border-bottom-color: defined in sfiab.css */ +/* background-color: defined in sfiab.css */ +} + +ul#htabs li a { /* settings for all tab links */ + padding: 3px 4px; /* set padding (tab size) as desired; FIRST number must change with respect to padding-top (X) above */ + border-width: 1px; + border-style: solid; +/* border-color: defined in sfiab.css */ +/* background-color: defined in sfiab.css */ +/* color: defined in sfiab.css */ + margin-right: 0px; /* Use margin-right in the li def to change spacing */ + text-decoration: none; + border-bottom: none; + text-align: center; +} + +ul#htabs li.htabsel a { /* settings for selected tab link */ +/* background-color: defined in sfiab.css */ +/* color: defined in sfiab.css */ + position: relative; + top: 1px; + padding-top: 4px; /* must change with respect to padding (X) above and below */ +} + + +ul#htabs a:hover { /* settings for hover effect */ +/* background: defined in sfiab.css */ +} + +#htabmain { + margin-top: 0; + margin-right: 10px; +/* background: defined in sfiab.css */ + padding: 3px; + padding-top: 0; + border-width: 1px; + border-style: solid; +/* border-color: defined in sfiab.css */ + border-top: none; +} + diff --git a/judge_expertise.php b/judge_expertise.php index bfaf24d..e7e5616 100644 --- a/judge_expertise.php +++ b/judge_expertise.php @@ -26,13 +26,12 @@ require_once('user.inc.php'); require_once('judge.inc.php'); - $u = user_load($_SESSION['users_id']); + if($_SESSION['embed'] == true) { + $u = user_load($_SESSION['embed_edit_id']); + } else { + $u = user_load($_SESSION['users_id']); + } - //send the header -// $type = $_SESSION['users_type']; - send_header('Category and Division Preferences', - array('Judge Registration' => 'judge_main.php') - ); if($_POST['action']=="save") { @@ -67,14 +66,28 @@ $u = user_load($u['id']); } + if($_SESSION['embed'] == true) { + echo "
    "; + display_messages(); +// echo "

    ".i18n('Category and Division Preferences')."

    "; + echo "
    "; + } else { + //send the header + send_header('Category and Division Preferences', + array('Judge Registration' => 'judge_main.php') + ); + } + judge_status_update($u); -//output the current status -$newstatus=judge_status_expertise($u); -if($newstatus!="complete") - echo error(i18n("Divisional Judging Information Incomplete")); -else - echo happy(i18n("Divisional Judging Information Complete")); +if($_SESSION['embed'] != true) { + //output the current status + $newstatus=judge_status_expertise($u); + if($newstatus!="complete") + echo error(i18n("Divisional Judging Information Incomplete")); + else + echo happy(i18n("Divisional Judging Information Complete")); +} if($u['special_award_only'] == 'yes') { echo i18n("You have specified that you are a judge for a specific special award. Divisional Judging preferences have been disabled because they do not apply to you."); @@ -83,7 +96,11 @@ else exit; } - echo "
    \n"; +if($_SESSION['embed'] == true) { + echo "\n"; +} else { + echo "\n"; +} echo "\n"; $q=mysql_query("SELECT * FROM projectcategories WHERE year='".$config['FAIRYEAR']."' ORDER BY mingrade"); @@ -181,5 +198,6 @@ else echo "
    "; - send_footer(); + if($_SESSION['embed'] != true) send_footer(); + ?> diff --git a/judge_other.php b/judge_other.php index a51f9ff..39dab79 100644 --- a/judge_other.php +++ b/judge_other.php @@ -27,12 +27,12 @@ require_once('judge.inc.php'); require_once("questions.inc.php"); - $u = user_load($_SESSION['users_id']); + if($_SESSION['embed'] == true) { + $u = user_load($_SESSION['embed_edit_id']); + } else { + $u = user_load($_SESSION['users_id']); + } - //send the header - send_header('Other Information', - array('Judge Registration' => 'judge_main.php') - ); if($_POST['action']=="save") { @@ -55,16 +55,36 @@ $u = user_load($u['id']); } + if($_SESSION['embed'] == true) { + echo "
    "; + display_messages(); + echo "

    ".i18n('Other Information')."

    "; + echo "
    "; + } else { + //send the header + send_header('Other Information', + array('Judge Registration' => 'judge_main.php') + ); + } + judge_status_update($u); -//output the current status -$newstatus=judge_status_other($u); -if($newstatus!="complete") - echo error(i18n("Other Information Incomplete")); -else - echo happy(i18n("Other Information Complete")); - echo "
    \n"; +if($_SESSION['embed'] != true) { + //output the current status + $newstatus=judge_status_other($u); + if($newstatus!="complete") + echo error(i18n("Other Information Incomplete")); + else + echo happy(i18n("Other Information Complete")); +} + + +if($_SESSION['embed'] == true) { + echo "\n"; +} else { + echo "\n"; +} echo "\n"; echo "\n"; @@ -134,5 +154,5 @@ echo "
    "; echo "
    "; - send_footer(); + if($_SESSION['embed'] != true) send_footer(); ?> diff --git a/judge_special_awards.php b/judge_special_awards.php index 09b5cf2..8140e8b 100644 --- a/judge_special_awards.php +++ b/judge_special_awards.php @@ -25,13 +25,13 @@ require_once('common.inc.php'); require_once('user.inc.php'); require_once('judge.inc.php'); - - $u = user_load($_SESSION['users_id']); - //send the header - send_header('Special Awards', - array('Judge Registration' => 'judge_main.php') - ); + if($_SESSION['embed'] == true) { + $u = user_load($_SESSION['embed_edit_id']); + } else { + $u = user_load($_SESSION['users_id']); + } + if($_POST['action']=="save") { //first delete all their old associations for this year.. @@ -43,20 +43,37 @@ VALUES ('{$u['id']}','$aid')"); } } - echo notice(i18n("Special Award preferences successfully saved")); + message_push(notice(i18n("Special Award preferences successfully saved"))); } + if($_SESSION['embed'] == true) { + echo "
    "; + display_messages(); + echo "

    ".i18n('Special Awards')."

    "; + echo "
    "; + } else { + //send the header + send_header('Special Awards', + array('Judge Registration' => 'judge_main.php') + ); + } judge_status_update($u); -//output the current status -$newstatus=judge_status_special_awards($u); -if($newstatus!='complete') - echo error(i18n("Special Award Preferences Incomplete")); -else - echo happy(i18n("Special Award Preferences Complete")); +if($_SESSION['embed'] != true) { + //output the current status + $newstatus=judge_status_special_awards($u); + if($newstatus!='complete') + echo error(i18n("Special Award Preferences Incomplete")); + else + echo happy(i18n("Special Award Preferences Complete")); +} - echo "
    \n"; +if($_SESSION['embed'] == true) { + echo "\n"; +} else { + echo "\n"; +} echo "\n"; if($u['special_award_only'] == 'yes') { echo i18n("Please select the special award you are supposed to judge."); @@ -113,5 +130,6 @@ else echo "
    "; - send_footer(); + if($_SESSION['embed'] != true) send_footer(); + ?> diff --git a/theme/default/sfiab.css b/theme/default/sfiab.css index e072698..407bb02 100644 --- a/theme/default/sfiab.css +++ b/theme/default/sfiab.css @@ -31,6 +31,7 @@ td { vertical-align: top; } + table tr.even { background: #EEEEFF; } @@ -422,4 +423,38 @@ tr.externalaward { padding: 2px; } +/* Tab colours, boy this will be nice when CSS variables exist */ +/* Tab Line Colour */ +ul#htabs { + border-bottom-color: #A5B5C6; /* Line colour */ +} + +/* Non-selected tab */ +ul#htabs li a { + background-color: #D0D0FF; /* Background Colour */ + color: #000000; /* Font colour */ + border-color: #A5B5C6; +} + +/* Selected tab */ +ul#htabs li.htabsel { + background-color: #EEEEFF; /* Backgroudn Colour */ + border-bottom-color: #EEEEFF; /* Bottom border colour, should match the bkgrnd */ +} + +/* Selected tab link */ +ul#htabs li.htabsel a { + background-color: #EEEEFF; /* Background Colour */ + color: #000000; /* Font colour */ +} + +/* Hover over colour */ +ul#htabs a:hover { + background: #ffffff; +} + +#htabmain { + background: #EEEEFF; /* Should match selected tab background */ + border-color: #A5B5C6;/* Should match UL border */ +} diff --git a/user.inc.php b/user.inc.php index 1db3714..f520ae6 100644 --- a/user.inc.php +++ b/user.inc.php @@ -29,6 +29,18 @@ $user_what = array('student'=>'Participant', 'judge' => 'Judge', 'committee'=>'Committee Member','volunteer' => 'Volunteer', 'fair'=>'Science Fair','sponsor' => 'Sponsor Contact'); +function user_valid_type($type) +{ + global $user_types; + if(is_array($type)) { + foreach($type as $t) { + if(!in_array($t, $user_types)) return false; + } + } else { + if(!in_array($type, $user_types)) return false; + } + return true; +} /* Duplicate of common.inc.php:generatePassword, which will be deleted * eventually when ALL users are handled through this file */ diff --git a/user_invite.php b/user_invite.php index 9873fe0..0c09cf5 100644 --- a/user_invite.php +++ b/user_invite.php @@ -156,13 +156,21 @@ echo "
    "; - if($_POST['action']!="" && $_POST['email']) - { + $allowed_types = array('judge', 'volunteer'); + $type = $_POST['type']; + if($type == '') $type = $_GET['type']; + if($type != '') { + if(!in_array($type, $allowed_types)) { + echo "Type $type not allowed for invite

    "; + exit; + } + } + + if($_POST['action']!="" && $_POST['email'] && $type != '') { $allowed_actions = array('notexist','norole','noyear'); $email = stripslashes($_POST['email']); - $type = $_POST['type']; - $action = $_POST['action']; + $action = $_POST['action']; if(!in_array($action, $allowed_actions)) exit; @@ -213,8 +221,10 @@ echo i18n("Select a Role: "); echo ""; echo i18n("Enter an Email: "); echo ""; diff --git a/user_personal.php b/user_personal.php index c3dedc8..0bff036 100644 --- a/user_personal.php +++ b/user_personal.php @@ -71,20 +71,26 @@ /* See if there is an edit request */ - $eid = intval($_GET['edit']); + if($_SESSION['embed_edit_id']) + $eid = $_SESSION['embed_edit_id']; + else + $eid = intval($_GET['edit']); - if($eid != 0) { - /* There is an edit request, the user must be: + /* Force them to edit themselves if no eid found */ + if($eid == 0) $eid = $_SESSION['users_id']; + + if($_SESSION['users_id'] != $eid) { + /* There is an edit request for someone other than the logged in user, + * the user must be: * - on the committee * - with admin access */ user_auth_required('committee', 'admin'); - $u = user_load($eid); - + $ext_editor = true; } else { - /* Else, force them to edit themselves */ - $eid = false; - $u = user_load($_SESSION['users_id']); + /* Else, they are just editing themselves */ + $ext_editor = false; } + $u = user_load($eid); /* Load the fields the user can edit, and theones that are required */ @@ -166,10 +172,15 @@ } //send the header - if($eid == false) { - $type = $_SESSION['users_type']; - $m = ($type == 'committee') ? 'Committee' : $user_what[$type]; - send_header("Personal Information", + if($_SESSION['embed'] == true) { + echo "
    "; + display_messages(); + echo "

    ".i18n("Personal Information")."

    "; + echo "
    "; + } else if($ext_editor == true) { + $type = $_SESSION['users_type']; + $m = ($type == 'committee') ? 'Committee' : $user_what[$type]; + send_header("Personal Information", array("$m Main" => "{$type}_main.php") ,"edit_profile" ); @@ -183,7 +194,7 @@ ); } else { send_header("Personal Information for {$u['firstname']} {$u['lastname']}", - array("Committee Main" => "committee_main.php") + array("Judge Registration" => "judge_main.php") ,"edit_profile" ); } @@ -196,7 +207,7 @@ } if(count($errorfields)) { echo error(i18n('Information will not be saved until the above errors are corrected')); - } else if ($eid == false) { + } else if ($ext_editor == false) { //output the current status $newstatus=user_personal_info_status($u); if($newstatus!='complete') @@ -248,11 +259,12 @@ function item($user, $fname, $subtext='') } - $eidstr = ''; - if($eid != false) { - $eidstr="?edit=$eid"; + if($_SESSION['embed'] != true) { + echo "
    \n"; + } else { + echo "\n"; } - echo "\n"; + echo "\n"; echo "\n"; @@ -361,5 +373,8 @@ echo ""; echo "
    "; -send_footer(); +if($_SESSION['embed'] != true) { + send_footer(); +} + ?> diff --git a/volunteer_position.php b/volunteer_position.php index dacaa8f..ad93349 100644 --- a/volunteer_position.php +++ b/volunteer_position.php @@ -27,11 +27,15 @@ require_once("user.inc.php"); require_once("volunteer.inc.php"); - user_auth_required('volunteer'); - $u = user_load($_SESSION['users_id']); + if($_SESSION['embed'] == true) { + $u = user_load($_SESSION['embed_edit_id']); + } else { + user_auth_required('volunteer'); + $u = user_load($_SESSION['users_id']); + } + - if($_POST['action']=="save") { $vals = ''; @@ -76,25 +80,29 @@ /* update overall status */ volunteer_status_update($u); -//output the current status -$newstatus=volunteer_status_position($u); -if($newstatus!='complete') -{ - message_push(error(i18n("Volunteer Position Selection Incomplete"))); -} -else -{ - message_push(happy(i18n("Volunteer Position Selection Complete"))); +if($_SESSION['embed'] != true) { + //output the current status + $newstatus=volunteer_status_position($u); + if($newstatus!='complete') + message_push(error(i18n("Volunteer Position Selection Incomplete"))); + else + message_push(happy(i18n("Volunteer Position Selection Complete"))); } - //send the header - send_header("Volunteer Positions", +if($_SESSION['embed'] == true) { + echo "
    "; + display_messages(); + echo "

    ".i18n('Volutneer Positions')."

    "; + echo "
    "; +} else { + //send the header + send_header("Volunteer Positions", array("Volunteer Registration" => "volunteer_main.php") ); +} - - - echo "\n"; + $s = ($_SESSION['embed'] == true) ? $_SESSION['embed_submit_url'] : 'volunteer_position.php'; + echo "\n"; echo "\n"; echo "
    \n"; @@ -154,5 +162,5 @@ echo ""; echo "
    "; -send_footer(); + if($_SESSION['embed'] != true) send_footer(); ?>