Please go back and select at least one submission and one advocate
'; } else { // Get conflicts? if ($OC_configAR['OC_allowConflictOverride'] && isset($_POST['conflict_override']) && ($_POST['conflict_override'] == 1)) { $conflictAR = array(); } else { $conflictAR = getConflicts(); } // Assign advocates (and reviewers?) // NOTE: Although a foreach is used below for future expansion, there should only be 1 advocate $advocateAssignmentAR = array(); // keep track of advocates w/successful assignments $submissionAssignmentAR = array(); // keep track of submissions assigned foreach ($_POST['advocates'] as $i) { if (!is_numeric($i)) { err('Invalid advocate ID: ' . safeHTMLstr($i)); } foreach ($_POST['papers'] as $j) { if (!is_numeric($j)) { err('Invalid submission ID: ' . safeHTMLstr($j)); } // Check for conflict if (in_array("$j-$i",$conflictAR)) { print "
! Submission $j is in conflict with advocate $i.
\n"; continue; } // Delete current assignment? if (isset($_POST['assignment_override']) && ($_POST['assignment_override'] == 1)) { oc_deleteAssignments($j, null, 'advocate'); } // Make assignment $q = "INSERT INTO `" . OCC_TABLE_PAPERADVOCATE . "` (`paperid`,`advocateid`) VALUES ('" . safeSQLstr($j) . "','" . safeSQLstr($i) . "')"; ocsql_query($q); if (($merr = ocsql_errno()) != 0) { if ($merr == 1062) { // Duplicate entry print "! Submission $j already has an advocate assigned. Please delete the existing advocate first before assigning a new one, or select Override Current Assingment.\n"; } else { print "!! Error assigning submission $j to advocate $i\n"; } } else { print "Submission $j assigned to advocate $i.\n"; if (!isset($advocateAssignmentAR[$i])) { $advocateAssignmentAR[$i] = array(); } $advocateAssignmentAR[$i][] = $j; if (!in_array($j, $submissionAssignmentAR)) { $submissionAssignmentAR[] = $j; } // Also assign a reviewer? if (isset($_POST['asrev']) && ($_POST['asrev'] == "yes")) { $q = "INSERT INTO `" . OCC_TABLE_PAPERREVIEWER . "` (`paperid`,`reviewerid`,`assigned`) VALUES ('" . safeSQLstr($j) . "','" . safeSQLstr($i) . "','" . safeSQLstr(date('Y-m-d')) . "')"; ocsql_query($q); if (($merr = ocsql_errno()) != 0) { if ($merr == 1062) { // Duplicate entry print "
Notification sent to ' . safeHTMLstr($l['name']) . ' (' . safeHTMLstr($l['reviewerid']) . ')
'; } else { print '!! Unable to email notification to ' . safeHTMLstr($l['name']) . ' (' . safeHTMLstr($l['reviewerid']) . ')
'; } } print ''; } else { if (!isset($_GET['s']) || ($_GET['s'] == "id")) { $idsortstr = 'ID'; $nsortstr = 'Name'; $rsortstr = 'No. Submission'; $legend = "[ Advocate ID - $nsortstr ($rsortstr) ]"; $sortby = "`" . OCC_TABLE_REVIEWER . "`.`reviewerid`"; } elseif ($_GET['s'] == "reviews") { $rsortstr = 'No. Reviews'; $idsortstr = 'ID'; $nsortstr = 'Name'; $legend = "[ No. Submissions - Advocate $nsortstr - $idsortstr ]"; $sortby = "`acount`, `" . OCC_TABLE_REVIEWER . "`.`name_last`, `" . OCC_TABLE_REVIEWER . "`.`name_first`"; } else { $idsortstr = 'ID'; $nsortstr = 'Name'; $rsortstr = 'No. Submissions'; $legend = "[ Advocate Name - $idsortstr ($rsortstr) ]"; $sortby = "`" . OCC_TABLE_REVIEWER . "`.`name_last`, `" . OCC_TABLE_REVIEWER . "`.`name_first`"; } $rq = "SELECT `" . OCC_TABLE_REVIEWER . "`.`reviewerid`, CONCAT_WS(' ', `" . OCC_TABLE_REVIEWER . "`.`name_first`, `" . OCC_TABLE_REVIEWER . "`.`name_last`) AS `name`, count(`" . OCC_TABLE_PAPERADVOCATE . "`.`advocateid`) AS `acount` FROM `" . OCC_TABLE_REVIEWER . "` LEFT JOIN `" . OCC_TABLE_PAPERADVOCATE . "` ON `" . OCC_TABLE_REVIEWER . "`.`reviewerid`=`" . OCC_TABLE_PAPERADVOCATE . "`.`advocateid` WHERE `" . OCC_TABLE_REVIEWER . "`.`onprogramcommittee`='T' GROUP BY `" . OCC_TABLE_REVIEWER . "`.`reviewerid` ORDER BY $sortby"; $rr = ocsql_query($rq) or err("Unable to get program committee members"); // Get pad size for advocate 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 program committee members have signed up yet
'; } else { print '
'; } } } printFooter(); ?>