diff --git a/assign.php b/assign.php index ef97210f0..0e716059f 100644 --- a/assign.php +++ b/assign.php @@ -449,17 +449,7 @@ function pcAssignments($qreq) { // PC assignments if ($Me->can_administer($prow)) { - $result = $Conf->qe("select ContactInfo.contactId, allReviews - from ContactInfo - left join (select contactId, group_concat(reviewType separator '') allReviews - from PaperReview join Paper using (paperId) - where reviewType>=" . REVIEW_PC . " and timeSubmitted>=0 - group by contactId) A using (contactId) - where ContactInfo.roles!=0 and (ContactInfo.roles&" . Contact::ROLE_PC . ")!=0"); - $pcx = []; - while (($row = $result->fetch_object())) { - $pcx[$row->contactId] = $row; - } + $acs = AssignmentCountSet::load($Me, AssignmentCountSet::HAS_REVIEW); // PC conflicts row echo '
', @@ -481,7 +471,6 @@ function pcAssignments($qreq) { $tagger = new Tagger($Me); foreach ($Conf->full_pc_members() as $pc) { - $p = $pcx[$pc->contactId]; if (!$pc->can_accept_review_assignment_ignore_conflict($prow)) { continue; } @@ -540,18 +529,17 @@ function pcAssignments($qreq) { // then, number of reviews echo '
'; - $numReviews = strlen($p->allReviews); - $numPrimary = substr_count($p->allReviews, (string) REVIEW_PRIMARY); - if (!$numReviews) { + $ac = $acs->get($pc->contactId); + if ($ac->rev === 0) { echo "0 reviews"; } else { echo 'email)), '">', - plural($numReviews, "review"), ""; - if ($numPrimary && $numPrimary < $numReviews) { + $Conf->hoturl("search", "q=re:" . urlencode($pc->email)), '">', + plural($ac->rev, "review"), ""; + if ($ac->pri && $ac->pri < $ac->rev) { echo '  (email)), - "\">$numPrimary primary)"; + $Conf->hoturl("search", "q=pri:" . urlencode($pc->email)), + "\">{$ac->pri} primary)"; } } echo "
\n"; // .pctbnrev .ctelti .ctelt diff --git a/manualassign.php b/manualassign.php index e888b9f04..d1d0f211e 100644 --- a/manualassign.php +++ b/manualassign.php @@ -155,23 +155,14 @@ function saveAssignments($qreq, $reviewer) { Ht::form(hoturl("manualassign"), array("method" => "get", "id" => "selectreviewerform")); Ht::stash_script('hotcrp.highlight_form_children("#selectreviewerform")'); -$result = $Conf->qe_raw("select ContactInfo.contactId, count(reviewId) - from ContactInfo - left join PaperReview on (PaperReview.contactId=ContactInfo.contactId and PaperReview.reviewType>=" . REVIEW_SECONDARY . ") - where roles!=0 and (roles&" . Contact::ROLE_PC . ")!=0 - group by ContactInfo.contactId"); -$rev_count = []; -while (($row = $result->fetch_row())) { - $rev_count[$row[0]] = $row[1]; -} - +$acs = AssignmentCountSet::load($Me, AssignmentCountSet::HAS_REVIEW); $rev_opt = array(); if (!$reviewer) { $rev_opt[0] = "(Select a PC member)"; } foreach ($Conf->pc_members() as $pc) { $rev_opt[$pc->email] = htmlspecialchars($pc->name(NAME_P|NAME_S)) . " (" - . plural(get($rev_count, $pc->contactId, 0), "assignment") . ")"; + . plural($acs->get($pc->contactId)->rev, "assignment") . ")"; } echo "",
PC member: