static function echo_username_form(Contact $user, $first)
 {
     global $Me;
     if (!$first && !$user->seascode_username) {
         return;
     }
     echo Ht::form(hoturl_post("index", array("set_username" => 1, "u" => $Me->user_linkpart($user), "reposite" => "harvardseas"))), '<div class="f-contain">';
     $notes = array();
     if (!$user->seascode_username) {
         $notes[] = array(true, "Please enter your " . self::home_link("code.seas.harvard.edu") . " username and click “Save.”");
     }
     ContactView::echo_group(self::home_link("code.seas") . " username", Ht::entry("username", $user->seascode_username) . "  " . Ht::submit("Save"), $notes);
     echo "</div></form>";
 }
示例#2
0
// space, nbsp
$TABWIDTH = $Info->commit_info("tabwidth") ?: 4;
echo "<table><tr><td><h2>diff</h2></td><td style=\"padding-left:10px;line-height:110%\">", "<div class=\"diffl61 gd\" style=\"padding:2px 5px\"><big><code>", substr($hasha, 0, 7), "</code> ", htmlspecialchars($commita->subject), "</big></div>", "<div class=\"diffl61 gi\" style=\"padding:2px 5px\"><big><code>", substr($hashb, 0, 7), "</code> ", htmlspecialchars($commitb->subject), "</big></div>", "</td></tr></table><hr>\n";
// collect diff and sort line notes
$diff = $User->repo_diff($Info->repo, $hashb, $Pset, $diff_options);
$all_linenotes = $hashb_mine ? $Info->commit_info("linenotes") : array();
$lnorder = new LinenotesOrder($all_linenotes, $Info->can_see_grades);
$lnorder->set_diff($diff);
// print line notes
$notelinks = array();
foreach ($lnorder->seq() as $fl) {
    $f = str_starts_with($fl[0], $Pset->directory_slash) ? substr($fl[0], strlen($Pset->directory_slash)) : $fl[0];
    $notelinks[] = '<a href="#L' . $fl[1] . '_' . html_id_encode($fl[0]) . '" onclick="return gotoline61(this)" class="noteref61' . (!$fl[2] && !$Info->user_can_see_grades ? " hiddennote61" : "") . '">' . htmlspecialchars($f) . ':' . substr($fl[1], 1) . '</a>';
}
if (count($notelinks)) {
    ContactView::echo_group("notes", join(", ", $notelinks));
}
// check for any linenotes
$has_any_linenotes = false;
foreach ($diff as $file => $dinfo) {
    if ($lnorder->file($file)) {
        $has_any_linenotes = true;
        break;
    }
}
// line notes
foreach ($diff as $file => $dinfo) {
    $linenotes = $lnorder->file($file);
    $open = $linenotes || !$dinfo->boring || !$hasha_mine && !$hashb_mine;
    $Info->echo_file_diff($file, $dinfo, $lnorder, $open);
}
示例#3
0
    Dbl::qe_apply("update ContactInfo set " . join($ck, ",") . " where contactId=" . $User->contactId, $cv);
    redirectSelf();
}
$Conf->header("Profile", "profile");
$xsep = " <span class='barsep'>&nbsp;|&nbsp;</span> ";
echo "<div id='homeinfo'>";
echo "<h2 class='homeemail'>", Text::user_html($User), "</h2>";
if ($User->seascode_username || $User->huid) {
    echo '<h3><a href="', hoturl("index", array("u" => $Me->user_linkpart($User))), '">', htmlspecialchars($User->seascode_username ?: $User->huid), '</a>';
    if ($Me->privChair) {
        echo "&nbsp;", become_user_link($User);
    }
    echo "</h3>";
}
if ($User->dropped) {
    ContactView::echo_group("", '<strong class="err">You have dropped the course.</strong> If this is incorrect, contact us.');
}
echo Ht::form(hoturl_post("profile", array("u" => $User->email))), "<div>";
if ($User->disabled || $User->password == "") {
    echo Ht::submit("enable", "Enable user", array("value" => 1));
} else {
    echo Ht::submit("disable", "Disable user", array("value" => 1));
}
echo '<hr>';
echo '<table class="pltable" style="margin-top:1em"><tbody class="pltable pltable_alternate">';
echo '<tr><td class="pl pls">Roles</td><td class="pl">';
echo Ht::radio("pctype", "chair", $User->roles & Contact::ROLE_CHAIR), "&nbsp;", Ht::label("Course instructor"), "<br>";
echo Ht::radio("pctype", "pc", $User->roles & Contact::ROLE_PC && !($User->roles & Contact::ROLE_CHAIR)), "&nbsp;", Ht::label("Course staff"), "<br>";
echo Ht::radio("pctype", "no", !($User->roles & (Contact::ROLE_PC | Contact::ROLE_CHAIR))), "&nbsp;", Ht::label("Not on course staff"), "<br>";
echo "</td></tr>\n";
echo '</tbody></table>';
示例#4
0
function show_pset($pset, $user)
{
    global $Me;
    if ($pset->gitless_grades && $Me == $user && !$pset->partner && !$pset->contact_grade_for($user)) {
        return;
    }
    echo "<hr/>\n";
    $pseturl = hoturl("pset", array("pset" => $pset->urlkey, "u" => $Me->user_linkpart($user), "sort" => req("sort")));
    echo "<h2><a href=\"", $pseturl, "\">", htmlspecialchars($pset->title), "</a>";
    $info = ContactView::user_pset_info($user, $pset);
    $grade_check_user = $Me->isPC && $Me != $user ? $user : $Me;
    $can_grade = $grade_check_user->can_see_grades($pset, $user, $info);
    if ($can_grade && $info->has_grading()) {
        echo ' <a class="gradesready" href="', $pseturl, '">(grade ready)</a>';
    }
    echo "</a></h2>";
    ContactView::echo_partner_group($info);
    ContactView::echo_repo_group($info);
    if ($info->repo) {
        Contact::check_repo($info->repo, 30);
    }
    if ($info->has_grading()) {
        ContactView::echo_repo_grade_commit_group($info);
        if ($can_grade && ($gi = $info->grading_info())) {
            $garr = render_grades($pset, $gi, null);
            if ($garr->totalindex !== null) {
                $t = $garr->all[$garr->totalindex] . " / " . $garr->maxtotal;
                ContactView::echo_group("grade", $t);
            }
        }
        ContactView::echo_repo_regrades_group($info);
    } else {
        ContactView::echo_repo_last_commit_group($info, true);
    }
}
示例#5
0
function echo_all_grades()
{
    global $Me, $User, $Pset, $Info;
    if ($Info->is_handout_commit()) {
        return;
    }
    $gj = ContactView::grade_json($Info);
    if (get($gj, "grades") || $Info->can_see_grades && $Me != $User) {
        echo_grade_total($gj);
        foreach ($Pset->grades as $ge) {
            echo_grade_entry($ge);
        }
    }
    $lhg = $Info->late_hours();
    if ($lhg && $User == $Me && $Info->can_see_grades) {
        if ($lhg->hours || get($gj, "grades")) {
            echo '<div style="margin-top:1.5em">';
            ContactView::echo_group("late hours", '<span class="grader61" data-pa-grade="late_hours">' . htmlspecialchars($lhg->hours) . '</span>', array(), array("nowrap" => true));
            echo '</div>';
        }
    } else {
        if ($User != $Me) {
            $lhag = $Info->late_hours(true);
            $value = '<span class="gradeholder61">' . Ht::entry("late_hours", $lhg ? $lhg->hours : "", array("onchange" => "jQuery(this).closest('form').submit()", "class" => "grader61")) . '</span>';
            $value .= " " . Ht::submit("Save", array("tabindex" => 1));
            $value .= ' <span class="ajaxsave61"></span>';
            if ($lhag && $lhag->hours !== $lhg->hours) {
                $value .= ' <span class="autograde61">auto-late hours is ' . htmlspecialchars($lhag->hours) . '</span>';
            }
            echo Ht::form($Info->hoturl_post("pset", array("setlatehours" => 1)), array("onsubmit" => "return gradesubmit61(this)")), '<div class="f-contain" style="margin-top:1.5em">';
            ContactView::echo_group("late hours", $value, array(), array("nowrap" => true));
            echo '</div></form>';
        }
    }
}
示例#6
0
 static function echo_heading($user)
 {
     global $Me;
     $u = $Me->user_linkpart($user);
     if ($user !== $Me && !$user->is_anonymous && $user->contactImageId) {
         echo '<img class="smallface61" src="' . hoturl("face", array("u" => $u, "imageid" => $user->contactImageId)) . '" />';
     }
     echo '<h2 class="homeemail"><a href="', hoturl("index", array("u" => $u)), '">', htmlspecialchars($u), '</a>';
     if ($user->extension) {
         echo " (X)";
     }
     if ($Me->privChair) {
         echo "&nbsp;", become_user_link($user);
     }
     echo '</h2>';
     if ($user !== $Me && !$user->is_anonymous) {
         echo '<h3>', Text::user_html($user), '</h3>';
     }
     if ($user->dropped) {
         ContactView::echo_group("", '<strong class="err">You have dropped the course.</strong> If this is incorrect, contact us.');
     }
     echo '<hr class="c" />';
 }