Please go back and select at least one submission and one reviewer

'; } else { // Get conflicts? if ($OC_configAR['OC_allowConflictOverride'] && isset($_POST['conflict_override']) && ($_POST['conflict_override'] == 1)) { $conflictAR = array(); } else { $conflictAR = getConflicts(); } // Assign reviews $reviewerAssignmentAR = array(); // keep track of reviewers w/successful assignments foreach ($_POST['reviewers'] as $i) { // valid rev id? if (!preg_match("/^\d+$/", $i)) { err('Invalid reviewer selected'); } // iterate through submissions for reviewers foreach ($_POST['papers'] as $j) { // valid sub id? if (!preg_match("/^\d+$/", $j)) { err('Invalid submission selected'); } // Check for conflict if (in_array("$j-$i",$conflictAR)) { print "

! Submission $j is in conflict with reviewer $i.

\n"; continue; } // Make assignment $q = "INSERT INTO `" . OCC_TABLE_PAPERREVIEWER . "` (`paperid`,`reviewerid`) VALUES ($j,$i)"; ocsql_query($q); if (($merr = ocsql_errno()) != 0) { if ($merr == 1062) { // Duplicate entry print "

! Submission $j was already assigned reviewer $i.

\n"; } else { print "

!! Error assigning submission $j to reviewer $i (" . safeHTMLstr(ocsql_error()) . ")

\n"; } } else { print "

Submission $j assigned to reviewer $i.

\n"; if (!in_array($i,$reviewerAssignmentAR)) { $reviewerAssignmentAR[] = $i; } // Hook if (oc_hookSet('chair-assign-review')) { foreach ($OC_hooksAR['chair-assign-review'] as $f) { require_once $f; } } } } } // Notify? if (isset($_POST['notify']) && ($_POST['notify'] == 1) && !empty($reviewerAssignmentAR)) { $q = "SELECT `reviewerid`, `name_first`, `name_last`, CONCAT_WS(' ', `name_first`, `name_last`) AS `name`, `email` FROM `" . OCC_TABLE_REVIEWER . "` WHERE `reviewerid` IN (" . implode(',',$reviewerAssignmentAR) . ")"; $r = ocsql_query($q) or err('Unable not get reviewer email address(es) for notification ' . ocsql_errno()); $msg = sprintf(oc_('New assignments have been made for you to review in the %s OpenConf system.'), $OC_configAR['OC_confNameFull']) . "\n\n" . oc_('Thank you.') . "\n"; $mailsubject = oc_('New Reviewer Assignment(s)'); // Hook if (oc_hookSet('chair-assign-review-notify')) { foreach ($OC_hooksAR['chair-assign-review-notify'] as $f) { require_once $f; } } while ($l = ocsql_fetch_assoc($r)) { if (sendEmail($l['email'], $mailsubject, $msg)) { print '

Notification sent to ' . $l['name'] . ' (' . $l['reviewerid'] . ')

'; } else { print '

!! Unable to email notification to ' . $l['name'] . ' (' . $l['reviewerid'] . ')

'; } } } } print '

» Make additional assignments

» View/Edit assignments

'; } else { $pq = "SELECT `" . OCC_TABLE_PAPER . "`.`paperid`, `" . OCC_TABLE_PAPER . "`.`title`, count(`" . OCC_TABLE_PAPERREVIEWER . "`.`paperid`) AS `pcount` FROM `" . OCC_TABLE_PAPER . "` LEFT JOIN `" . OCC_TABLE_PAPERREVIEWER . "` ON `" . OCC_TABLE_PAPER . "`.`paperid`=`" . OCC_TABLE_PAPERREVIEWER . "`.`paperid` GROUP BY `" . OCC_TABLE_PAPER . "`.`paperid` ORDER BY `" . OCC_TABLE_PAPER . "`.`paperid`"; $pr = ocsql_query($pq) or err("Unable to get submissions"); // Get pad size for paper id's - yes, we really need the max id, but this should do:) $rows = ocsql_num_rows($pr); $psize = oc_strlen((string) $rows); if ($rows == 0) { print 'No submissions have been made yet

'; } else { if (!isset($_GET['s']) || ($_GET['s'] == "id")) { $idsortstr = 'ID'; $nsortstr = 'Name'; $rsortstr = '# Reviews'; $legend = "[ Reviewer ID - $nsortstr ($rsortstr) ]"; $sortby = "`" . OCC_TABLE_REVIEWER . "`.`reviewerid`"; } elseif ($_GET['s'] == "reviews") { $rsortstr = '# Reviews'; $idsortstr = 'ID'; $nsortstr = 'Name'; $legend = "[ # Reviews - Reviewer $nsortstr - $idsortstr ]"; $sortby = "`rcount`, `" . OCC_TABLE_REVIEWER . "`.`name_last`, `" . OCC_TABLE_REVIEWER . "`.`name_first`"; } else { $idsortstr = 'ID'; $nsortstr = 'Name'; $rsortstr = '# Reviews'; $legend = "[ Reviewer Name - $idsortstr ($rsortstr) ]"; $sortby = "`" . OCC_TABLE_REVIEWER . "`.`name_last`, `" . OCC_TABLE_REVIEWER . "`.`name_first`"; } $rq = "SELECT `" . OCC_TABLE_REVIEWER . "`.`reviewerid`, `onprogramcommittee`, CONCAT_WS(' ', `" . OCC_TABLE_REVIEWER . "`.`name_first`, `" . OCC_TABLE_REVIEWER . "`.`name_last`) AS `name`, COUNT(`" . OCC_TABLE_PAPERREVIEWER . "`.`reviewerid`) AS `rcount` FROM `" . OCC_TABLE_REVIEWER . "` LEFT JOIN `" . OCC_TABLE_PAPERREVIEWER . "` ON `" . OCC_TABLE_REVIEWER . "`.`reviewerid`=`" . OCC_TABLE_PAPERREVIEWER . "`.`reviewerid` GROUP BY `" . OCC_TABLE_REVIEWER . "`.`reviewerid` ORDER BY $sortby"; $rr = ocsql_query($rq) or err("Unable to get reviewers"); // Get pad size for reviewer id's - yes, we really need the max id, but this should do:) $rsize = oc_strlen((string) ocsql_num_rows($rr)); if (ocsql_num_rows($rr) == 0) { print 'No reviewers have signed up yet

'; } else { print '

Select Submission(s):

[ Submission ID - Title (# Reviewers) ]

Select Reviewer(s):

' . $legend . '

Tip: Click the ID, Name, or Reviews links above
to re-sort this list (page will reload)


Options:

'; if ($OC_configAR['OC_allowConflictOverride']) { print '

Override Conflicts – check box to force assignments even if there is a conflict

'; } print '

– check box to notify reviewer(s) that new assignments have been made


'; } } } printFooter(); ?>