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 foreach ($_POST['advocates'] as $i) { if (!is_numeric($i)) { err('Invalid advocate ID: ' . safeHTMLstr($i)); } $count = 0; // keep track of # of successful assignments 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)) { issueSQL("DELETE FROM " . OCC_TABLE_PAPERADVOCATE . " WHERE paperid=" . $j); } // Make assignment $q = "INSERT INTO " . OCC_TABLE_PAPERADVOCATE . " (paperid,advocateid) VALUES ($j,$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 (" . safeHTMLstr(ocsql_error()) . ")

\n"; } } else { print "

Submission $j assigned to advocate $i.\n"; $count++; // Also assign a reviewer? if (isset($_POST['asrev']) && ($_POST['asrev'] == "yes")) { $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 has already been assigned reviewer $i.

\n"; } else { print "!! Error assigning submission $j to reviewer $i (" . safeHTMLstr(ocsql_error()) . ")

\n"; } } } } } if ($count > 0) { $advocateAssignmentAR[] = $i; } } // Notify? if (isset($_POST['notify']) && ($_POST['notify'] == 1) && !empty($advocateAssignmentAR)) { $q = "SELECT `reviewerid`, CONCAT_WS(' ', `name_first`, `name_last`) AS `name`, `email` FROM `" . OCC_TABLE_REVIEWER . "` WHERE `reviewerid` IN (" . implode(',',$advocateAssignmentAR) . ")"; $r = ocsql_query($q) or err('Unable not get advocate email address(es) for notification ' . ocsql_errno()); $msg = sprintf(oc_('New assignments have been made for you to advocate in the %s OpenConf system.'), $OC_configAR['OC_confNameFull']) . "\n\n" . oc_('Thank you.') . "\n"; $mailsubject = oc_('New Advocate Assignment(s)'); // Hook if (oc_hookSet('chair-assign-advocate-notify')) { foreach ($OC_hooksAR['chair-assign-advocate-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`, `" . OCC_TABLE_PAPERADVOCATE . "`.`advocateid` FROM `" . OCC_TABLE_PAPER . "` LEFT JOIN `" . OCC_TABLE_PAPERADVOCATE . "` ON `" . OCC_TABLE_PAPER . "`.`paperid`=`" . OCC_TABLE_PAPERADVOCATE . "`.`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:) $psize = oc_strlen((string) ocsql_num_rows($pr)); if (ocsql_num_rows($pr) == 0) { print 'No submissions have been made yet

'; } else { if (!isset($_GET['s']) || ($_GET['s'] == "id")) { $idsortstr = 'ID'; $nsortstr = 'Name'; $rsortstr = '# Submission'; $legend = "[ Advocate ID - $nsortstr ($rsortstr) ]"; $sortby = "`" . OCC_TABLE_REVIEWER . "`.`reviewerid`"; } elseif ($_GET['s'] == "reviews") { $rsortstr = '# Reviews'; $idsortstr = 'ID'; $nsortstr = 'Name'; $legend = "[ # Submissions - Advocate $nsortstr - $idsortstr ]"; $sortby = "`acount`, `" . OCC_TABLE_REVIEWER . "`.`name_last`, `" . OCC_TABLE_REVIEWER . "`.`name_first`"; } else { $idsortstr = 'ID'; $nsortstr = 'Name'; $rsortstr = '# 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 '

Select Submission(s):

[ Submission ID - Title (Advocate ID or ***) ]

Select Advocate:   (one per submission)

' . $legend . '


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

Options:

– check box to also assign advocate as reviewer of submission

– check box to change advocate if one already assigned

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

– check box to make assignments even if there is a conflict

'; } print '

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


'; } } } printFooter(); ?>