$tval) { if (preg_match("/^name-(\d+)$/", $tid, $tmatch) && !empty($tval)) { $q2 = "INSERT INTO `" . OCC_TABLE_TOPIC . "` (`topicid`, `topicname`, `short`) VALUES ('" . safeSQLstr($j) . "','" . safeSQLstr(substr($tval,0,250)) . "','" . safeSQLstr(substr($_POST["short-".$tmatch[1]],0,20)) . "')"; issueSQL($q2); $j++; } } // Success - if install, redirect, else let user know if (isset($_REQUEST['install']) && ($_REQUEST['install'] == 1)) { header("Location: set_status.php?install=1"); exit; } else { print '

Options successfully updated

'; } } $displayWarning = false; if (isset($_REQUEST['install']) && ($_REQUEST['install'] == 1)) { printHeader($hdr,$hdrfn); print '

Step 4 of 5: Set Topics

'; } else { $countsr = ocsql_query("SELECT COUNT(*) AS `count` FROM `" . OCC_TABLE_PAPER . "`") or err('Unable to check for existing submissions'); $countsl = ocsql_fetch_assoc($countsr); $countcr = ocsql_query("SELECT COUNT(*) AS `count` FROM `" . OCC_TABLE_REVIEWER . "`") or err('Unable to check for existing committee member'); $countcl = ocsql_fetch_assoc($countcr); if (($countsl['count'] > 0) || ($countcl['count'] > 0)) { $displayWarning = true; } } print '

Topics are used when making automated assignments. By default, both ' . oc_strtolower(OCC_WORD_AUTHOR) . 's and committee members are asked to select topics. Enter a sequential list of topics below. When you click on Set Topics, topics will be added sequentially regardless of the Topic ID listed, with blank topics skipped; thus topics should only be deleted until a submission has been made or committee member signed up. The Short Name field is optional; if present, it is used where a long topic name may be cumbersome.

'; if ($displayWarning) { print '

NOTE: As submissions have been made or committee members signed up already, deleting, changing, or re-ordering topics may result in data corruption. Instead, add new topics at the end, and rename topics no longer in use to "N/A" (without quotes) to have it skipped on applicable forms.

'; } if (isset($_REQUEST['install']) && ($_REQUEST['install'] == 1)) { print ''; } print ' '; // Display existing topics $q = "SELECT * FROM `" . OCC_TABLE_TOPIC . "`"; $r = ocsql_query($q) or err("Unable to query topics"); $topicNum = ocsql_num_rows($r); $tAR = array(); $row=1; while ($l=ocsql_fetch_array($r)) { print ' '; if ($row==1) { $row=2; } else { $row=1; } } // Display additional rows $addRows = ((($topicNum + 4) < $minTopics) ? ($minTopics - $topicNum) : 4); for ($i=1; $i <= $addRows; $i++) { $topicNum++; print ' '; if ($row==1) { $row=2; } else { $row=1; } } print '
Topic IDTopic NameShort Name*
' . $l['topicid'] . '
' . $topicNum . '

'; if (!oc_moduleActive('oc_customforms')) { print '

Allow ' . oc_strtolower(OCC_WORD_AUTHOR) . 's to select multiple submission topics? ' . generateRadioOptions('OC_multipleSubmissionTopics', $yesNoAR, $OC_configAR['OC_multipleSubmissionTopics']) . '
Select Yes to allow multiple topics, or No to limit ' . oc_strtolower(OCC_WORD_AUTHOR) . ' to one topic.

Allow committee members to select multiple submission topics? ' . generateRadioOptions('OC_multipleCommitteeTopics', $yesNoAR, $OC_configAR['OC_multipleCommitteeTopics']) . '
Select Yes to allow multiple topics, or No to limit committee member to one topic.

'; } print '

Display topics alphabetically? ' . generateRadioOptions('OC_topicDisplayAlpha', $yesNoAR, $OC_configAR['OC_topicDisplayAlpha']) . '
Select Yes to display topics alphabetically on submission and committee sign up forms, or No to use order above.

'; printFooter(); ?>