From 0cd172c48bd322558592b445c6f04d147092ed55 Mon Sep 17 00:00:00 2001 From: jacob Date: Tue, 13 Apr 2010 20:11:15 +0000 Subject: [PATCH] Modified the info pop-up for judges in the team members editing form. The info now comes up in a compact div within the page rather than a separate window. When the info div is clicked on, the user editor opens up that user. --- admin/judges_info.php | 263 +++++++++++++++++++-------------- admin/judges_teams_members.php | 74 ++++++++-- judge_main.php | 9 +- 3 files changed, 215 insertions(+), 131 deletions(-) diff --git a/admin/judges_info.php b/admin/judges_info.php index d0277a5..3b6b6ae 100644 --- a/admin/judges_info.php +++ b/admin/judges_info.php @@ -40,104 +40,146 @@ $preferencechoices=array( ); - $id = intval($_GET['id']); +$id = intval($_GET['id']); +$judgeinfo = user_load($id); + +echo '
'; +send_popup_header("Judge Information"); - send_popup_header("Judge Information"); if($id < 1) { echo error(i18n("No Judge ID passed to Judges Info")); send_popup_footer(); exit; } - $judgeinfo = user_load($id); +?> + + + + + + + + + + + +
- send_popup_header(i18n("Judge Information - %1 %2",array($judgeinfo['firstname'],$judgeinfo['lastname']))); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
::
::
::
::
::
-echo "Complete for {$config['FAIRYEAR']}: ".(($judgeinfo['complete']=="yes") ? "Yes" : "No"); -echo "
"; +".i18n("Personal Info").""; -echo "\n"; - -echo "\n"; -echo " \n"; -echo " \n"; -echo "\n"; -echo "\n"; -echo " \n"; -echo " \n"; -echo "\n"; -echo "\n"; -echo " \n"; -echo " \n"; -echo "\n"; -echo "\n"; -echo " \n"; -echo " \n"; -echo "\n"; - -echo "\n"; -echo " \n"; -echo " \n"; -echo ""; - -echo "\n"; -echo " \n"; -echo " \n"; -echo ""; - -echo ""; - -echo "
".i18n("First Name").": {$judgeinfo['firstname']}".i18n("Last Name").":{$judgeinfo['lastname']}
".i18n("Email Address").":{$judgeinfo['email']}".i18n("City").":{$judgeinfo['city']}
".i18n("Address 1").":{$judgeinfo['address']}".i18n($config['provincestate']).": {$judgeinfo['province']}
".i18n("Address 2").":{$judgeinfo['address2']}".i18n("Phone (Home)").":{$judgeinfo['phonehome']}
".i18n($config['postalzip']).":{$judgeinfo['postalcode']}".i18n("Phone (Work)").":{$judgeinfo['phonework']}
".i18n("Organization").":{$judgeinfo['organization']}".i18n("Phone (Cell)").":{$judgeinfo['phonecell']}

"; -echo ""; - -echo "\n"; -echo " "; -echo ""; -echo " \n"; -echo "\n"; +?> -echo "\n"; -echo "\n"; +
".i18n("Time Availability").":"; -$q = mysql_query("SELECT * FROM judges_availability WHERE users_id=\"{$judgeinfo['id']}\" ORDER BY `start`"); -$sel = array(); -while($r=mysql_fetch_object($q)) { - $st = substr($r->start, 0, 5); - $end = substr($r->end, 0, 5); - echo "$st - $end
"; +// get their availability +$availabilityText = ""; +if($config['judges_availability_enable'] == 'yes'){ + $q = mysql_query("SELECT * FROM judges_availability WHERE users_id=\"{$judgeinfo['id']}\" ORDER BY `start`"); + $sel = array(); + while($r=mysql_fetch_object($q)) { + $st = substr($r->start, 0, 5); + $end = substr($r->end, 0, 5); + $availabilityText .= "
  • $st - $end
  • "; + } + if(strlen($availabilityText) > 0){ + $availabilityText = '
      ' . $availabilityText . '
    '; + }else{ + $availabilityText = i18n("Unspecified"); + } } -echo "
    ".i18n("Age category preference").":"; +echo '
    '; -$q=mysql_query("SELECT * FROM projectcategories - WHERE year='{$config['FAIRYEAR']}'"); -echo mysql_error(); +// is their info complete? +$completeText = $judgeinfo['complete']=="yes" ? "Yes" : "No"; + +// find out if they've signed up for judging any special awards +$specialAwardsText = ""; +if($judgeinfo['special_award_only'] == "yes"){ + $query = "SELECT aa.name AS awardname FROM judges_specialaward_sel jss" + . " JOIN users ON jss.users_id = users.id" + . " JOIN award_awards aa ON aa.id = jss.award_awards_id" + . " WHERE users.id=" . $id; + $results = mysql_query($query); + while($record = mysql_fetch_array($results)){ + $awardList[] = $record['awardname']; + } + $specialAwardsText .= implode(', ', $awardList); + +}else{ + $specialAwardsText .= i18n("None"); +} + +// get their preference for age category +$q=mysql_query("SELECT * FROM projectcategories WHERE year='{$config['FAIRYEAR']}'"); + +$catPreferenceText = mysql_error() . "
      "; while($r=mysql_fetch_object($q)) { $p = intval($judgeinfo['cat_prefs'][$r->id]); - echo i18n($r->category).": {$preferencechoices[$p]}
      "; + $catPreferenceText .= "
    • " . i18n($r->category).": {$preferencechoices[$p]}
    • "; } +$catPreferenceText .= "
    "; -echo "
    + \n"; -echo " "; -echo " \n"; -echo "\n"; +
  • : +
  • -echo "\n"; -echo " "; -echo " \n"; -echo "\n"; +
  • : +
  • -//questions_print_answers('judgereg',$judgeinfo['id'], $config['FAIRYEAR']); +
  • : +
  • -echo "
    +
      -echo "
    ".i18n("Highest post-secondary degree").":{$judgeinfo['highest_psd']}
    ".i18n("Languages").":".join(', ', $judgeinfo['languages']). "
    "; -echo "
    "; +
  • : +
  • - -echo "
    "; -echo "
    "; -echo "

    Areas of Expertise

    "; -echo ""; + " . i18n("Time Availability") . ": "; + echo $availabilityText . ""; + } + ?> + + +
    +

    + +id]=$r->division; } -/* -$subdivq=mysql_query("SELECT judges_expertise.*, - projectsubdivisions.subdivision, - projectsubdivisions.projectdivisions_id AS parent_id - FROM judges_expertise - LEFT JOIN projectsubdivisions ON judges_expertise.projectsubdivisions_id=projectsubdivisions.id - WHERE judges_id='{$judgeinfo['id']}' - AND judges_expertise.year='".$config['FAIRYEAR']."' - ORDER BY projectdivisions_id, projectsubdivisions_id"); - echo mysql_error(); -$judge_divs=array(); -$judge_subdivs=array(); -$divdata=array(); -*/ -/* -while($subdivr=mysql_fetch_object($subdivq)) -{ - if($subdivr->projectdivisions_id) - { - $judge_divs[$subdivr->projectdivisions_id]=$subdivr->val; - } - else - $judge_subdivs[$subdivr->parent_id][]=$subdivr->subdivision; -} -*/ - foreach($divs as $div) { $p = $judgeinfo['div_prefs'][$div]; @@ -190,7 +206,7 @@ foreach($divs as $div) } } - /* Only show subdiv if main div >=3 */ + // Only show subdiv if main div >=3 if($p >= 3) echo implode(", ",$sd); else echo " "; @@ -202,13 +218,36 @@ echo " "; echo " \n"; echo "\n"; - -echo "
    ".i18n("Other").":{$judgeinfo['expertise_other']}
    "; echo "
    "; - - - - - -send_popup_footer(); - +?> +
    + + +
    '; + +/* + send_popup_header("Judge Information"); +*/ + + +/* +echo "\n"; +echo " ".i18n("Time Availability").":"; +$q = mysql_query("SELECT * FROM judges_availability WHERE users_id=\"{$judgeinfo['id']}\" ORDER BY `start`"); +$sel = array(); +while($r=mysql_fetch_object($q)) { + $st = substr($r->start, 0, 5); + $end = substr($r->end, 0, 5); + echo "$st - $end
    "; +} +echo ""; +echo ""; +*/ + + + +//send_popup_footer(); ?> diff --git a/admin/judges_teams_members.php b/admin/judges_teams_members.php index 73cf56d..005b4df 100644 --- a/admin/judges_teams_members.php +++ b/admin/judges_teams_members.php @@ -41,17 +41,6 @@ function addbuttonclicked(team) document.forms.judges.submit(); } -function openjudgeinfo(id) -{ - if(id) - currentid=id; - else - currentid=document.forms.judges["judgelist[]"].options[document.forms.judges["judgelist[]"].selectedIndex].value; - - window.open("judges_info.php?id="+currentid,"JudgeInfo","location=no,menubar=no,directories=no,toolbar=no,width=770,height=500,scrollbars=yes"); - return false; - -} function switchjudgeinfo() { if(document.forms.judges["judgelist[]"].selectedIndex != -1) @@ -71,8 +60,50 @@ function switchjudgeinfo() } - +var mousex = 0, mousey = 0; +var selectedMemberId; +function showMemberDetails(judgeId){ + if(judgeId == undefined){ + judgeId = document.forms.judges["judgelist[]"].options[document.forms.judges["judgelist[]"].selectedIndex].value; + } + $('#infodiv').load("judges_info.php?id=" + judgeId, + function(){ eval('doShowMemberDetails(' + judgeId + ');'); } + ); +} + +function editMember(memberId){ + if(memberId == undefined) memberId = selectedMemberId; + hideMemberDetails(); + window.open("user_editor_window.php?id="+memberId,"UserEditor","location=no,menubar=no,directories=no,toolbar=no,width=770,height=500,scrollbars=yes"); +} + +function hideMemberDetails(){ + $('#infodiv').css("display", "none"); + $('#infodivcover').css("display", "none"); +} + +function doShowMemberDetails(judgeId){ + selectedMemberId = judgeId; + $('#infodiv').css("top", mousey + 5); + $('#infodiv').css("left", mousex + 20); + $('#infodiv').css("display", "inline"); + $('#infodivcover').css("top", mousey + 5); + $('#infodivcover').css("left", mousex + 20); + $('#infodivcover').css("display", "inline"); + $('#infodivcover').css("width", $('#infodiv').width()); + $('#infodivcover').css("height", $('#infodiv').height()); +} + +jQuery(document).ready(function(){ + $('#infodivcover').click(function(){ editMember(); }); + $(document).mousemove(function(e){ + mousex = e.pageX; + mousey = e.pageY; + }); +}); + + 0) @@ -216,7 +247,7 @@ function switchjudgeinfo() echo ""; echo "".i18n("Judges List"); echo "
    "; - echo ""; + echo ""; echo ""; echo "".i18n("Judge Teams").""; echo ""; @@ -268,7 +299,7 @@ function switchjudgeinfo() echo "
    "; echo ""; echo mysql_error(); - echo ""; foreach($jlist as $jid) { $u = &$judgelist[$jid]; @@ -329,7 +360,7 @@ function switchjudgeinfo() echo " "; } - echo ""; + echo ""; echo $member['firstname']." ".$member['lastname']; if(is_array($j['languages'])) $l = is_array($j['languages']) ? join(' ',$j['languages']) : ''; @@ -363,6 +394,19 @@ function switchjudgeinfo() echo ""; echo ""; echo ""; + echo ''; + echo '
    '; + send_footer(); diff --git a/judge_main.php b/judge_main.php index 6fe35ea..d9bea1e 100644 --- a/judge_main.php +++ b/judge_main.php @@ -89,15 +89,16 @@ "user_personal.php", "user_personal_info_status", array($u)); user_page_summary_item("Other Information", "judge_other.php", "judge_status_other", array($u)); - user_page_summary_item("Areas of Expertise", - "judge_expertise.php", "judge_status_expertise", array($u)); - + if($config['judges_specialaward_enable'] != 'yes' || $u['special_award_only'] != 'yes') { + user_page_summary_item("Areas of Expertise", + "judge_expertise.php", "judge_status_expertise", array($u)); + } if($config['judges_availability_enable'] == 'yes') { user_page_summary_item("Time Availability", "judge_availability.php", "judge_status_availability", array($u)); } - if($config['judges_specialaward_enable'] == 'yes' || $u['special_award_only'] == 'yes') { + if($config['judges_specialaward_enable'] == 'yes' && $u['special_award_only'] == 'yes') { user_page_summary_item("Special Award Preferences", "judge_special_awards.php", "judge_status_special_awards", array($u)); }