Skip to content

Commit

Permalink
Support different kinds of submission counting.
Browse files Browse the repository at this point in the history
  • Loading branch information
kohler committed Sep 28, 2023
1 parent 7cf6f57 commit 0fd31bc
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions batch/updatecontactdb.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ private function try_cdb() {
throw new ErrorException("Conference is not recorded in contactdb");
}
$this->cdb_confid = $this->confrow->confid = (int) $this->confrow->confid;
$this->confrow->conf_flags = (int) $this->confrow->conf_flags;
$qf = $qv = [];
if ($this->conf->short_name !== $this->confrow->shortName) {
$qf[] = "shortName=?";
Expand Down Expand Up @@ -220,6 +221,7 @@ private function run_papers($cdb) {
}
$result->close();

$subcount_type = ($this->confrow->conf_flags & 15);
$result = Dbl::ql($this->conf->dblink, "select paperId, title, timeSubmitted, exists (select * from PaperReview where paperId=Paper.paperId and reviewModified>0) from Paper");
$max_submitted = 0;
$nsubmitted = 0;
Expand All @@ -228,14 +230,19 @@ private function run_papers($cdb) {
while (($row = $result->fetch_row())) {
$pid = (int) $row[0];
$pids[] = $pid;
$st = (int) $row[2];
$timeSubmitted = (int) $row[2];
$has_review = (int) $row[3] > 0;
$erow = $epapers[$pid] ?? null;
if (!$erow || $erow->title !== $row[1] || $erow->timeSubmitted !== $st) {
$qv[] = [$this->cdb_confid, $pid, $row[1], $st];
if (!$erow
|| $erow->title !== $row[1]
|| $erow->timeSubmitted !== $timeSubmitted) {
$qv[] = [$this->cdb_confid, $pid, $row[1], $timeSubmitted];
}
unset($epapers[$pid]);
$max_submitted = max($max_submitted, $st);
if ($st > 0 || ($st < 0 && (int) $row[3] > 0)) {
$max_submitted = max($max_submitted, abs($timeSubmitted));
if ($timeSubmitted > 0
|| ($timeSubmitted < 0
&& ($has_review || $subcount_type === 1))) {
++$nsubmitted;
}
}
Expand Down

0 comments on commit 0fd31bc

Please sign in to comment.