Skip to content

Commit

Permalink
Start standardizing review counts: do not include withdrawn papers.
Browse files Browse the repository at this point in the history
  • Loading branch information
kohler committed Nov 12, 2020
1 parent 75f0a43 commit 3d07d6c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
15 changes: 10 additions & 5 deletions src/assignmentcountset.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ private function easy_load() {
$result = $this->user->conf->qe("select r.contactId, group_concat(r.reviewType separator '')
from PaperReview r
join Paper p on (p.paperId=r.paperId)
where p.timeWithdrawn<=0 and p.timeSubmitted>0 and r.reviewType>=" . REVIEW_PC
. " group by r.contactId");
where r.reviewType>=" . REVIEW_PC . " and (r.reviewSubmitted>0 or r.timeApprovalRequested!=0 or p.timeSubmitted>0)
group by r.contactId");
while (($row = $result->fetch_row())) {
$ct = $this->ensure((int) $row[0]);
$ct->rev = strlen($row[1]);
Expand All @@ -121,7 +121,7 @@ private function easy_load() {
foreach (["lead", "shepherd"] as $k) {
if ($this->has & ($k === "lead" ? self::HAS_LEAD : self::HAS_SHEPHERD)) {
$result = $this->user->conf->qe("select {$k}ContactId, count(paperId)
from Paper where timeWithdrawn<=0 and timeSubmitted>0
from Paper where timeSubmitted>0
group by {$k}ContactId");
while (($row = $result->fetch_row())) {
$ct = $this->ensure((int) $row[0]);
Expand Down Expand Up @@ -151,6 +151,7 @@ private function hard_load() {
&& $this->user->can_view_review_identity($prow, null)) {
foreach ($prow->reviews_by_id() as $rrow) {
if ($rrow->reviewType >= REVIEW_PC
&& ($rrow->reviewStatus >= ReviewInfo::RS_ADOPTED || $prow->timeSubmitted > 0)
&& $this->user->can_view_review_assignment($prow, $rrow)
&& $this->user->can_view_review_identity($prow, $rrow)) {
$ct = $this->ensure($rrow->contactId);
Expand All @@ -165,10 +166,14 @@ private function hard_load() {
}
}
}
if (($this->has & self::HAS_LEAD) && $prow->leadContactId) {
if (($this->has & self::HAS_LEAD)
&& $prow->leadContactId > 0
&& $prow->timeSubmitted > 0) {
$this->ensure($prow->leadContactId)->lead += 1;
}
if (($this->has & self::HAS_SHEPHERD) && $prow->shepherdContactId) {
if (($this->has & self::HAS_SHEPHERD)
&& $prow->shepherdContactId > 0
&& $prow->timeSubmitted > 0) {
$this->ensure($prow->shepherdContactId)->shepherd += 1;
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/contactlist.php
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ private function collect_review_data($prow, $rrow, $repapers, $review_limit, $sc
$this->_reord_data[$cid][] = [$rrow->paperId, $rrow->reviewId, $rrow->reviewOrdinal];
}
if ($review_limit
&& ($prow->timeSubmitted > 0 || $rrow->reviewStatus >= ReviewInfo::RS_ADOPTED)) {
&& ($rrow->reviewStatus >= ReviewInfo::RS_ADOPTED || $prow->timeSubmitted > 0)) {
if ($this->limit === "re"
|| ($this->limit === "req" && $rrow->reviewType == REVIEW_EXTERNAL && $rrow->requestedBy == $this->user->contactId)
|| ($this->limit === "ext" && $rrow->reviewType == REVIEW_EXTERNAL)
Expand All @@ -378,7 +378,7 @@ private function collect_review_data($prow, $rrow, $repapers, $review_limit, $sc
}
}
}
} else if ($rrow->reviewNeedsSubmit) {
} else if ($rrow->reviewNeedsSubmit && $prow->timeSubmitted > 0) {
$this->_rect_data[$cid][0] += 1;
}
}
Expand Down

0 comments on commit 3d07d6c

Please sign in to comment.