function makeDocumentListHTMLRow(Document $document, $position, $isEditable, $isOrganizer, Worker $worker = NULL) { echo "<tr>\n<td class='fieldValueFirst'>"; if (!is_null($worker)) { // reset to match up; note duplicates ok echo "<a href='WorkerViewPage.php?" . PARAM_LIST2_INDEX . "={$position}'>" . htmlspecialchars($worker->nameString()) . "</a>"; } echo "</td>\t<td class='fieldValue'><a href='DocumentViewAction.php?" . PARAM_LIST2_INDEX . "={$position}'>" . htmlspecialchars($document->docType) . "</a></td>\n"; $date = htmlspecialchars(swwat_format_usdate($document->uploadDate)); echo "\t<td class='fieldValue'>{$date}</td>\n"; // todo - should this also check (0 == strcmp(UNREVIEWED, $document->reviewStatus))? $date = is_null($document->reviewDate) ? "" : htmlspecialchars(swwat_format_usdate($document->reviewDate)); echo "\t<td class='fieldValue'>{$date}</td>\n"; echo "\t<td class='fieldValue'>"; // permissions checks - $isEditable is like a potential to be edited if (!$isOrganizer) { // workers can only delete a non-reviewed document $isEditable &= 0 == strcmp(UNREVIEWED, $document->reviewStatus); } if ($isEditable) { echo "<form method='POST' action='WorkerDocumentAction.php'>"; swwat_createInputHidden(PARAM_LIST2_INDEX, $position); // set up options // if Organizer: UnReviewed->Approve, Decline, Delete; Approve->UnReviewed, Decline; Decline->UnReviewed, Approve // repeat if Organizer: Delete only from UnReviewed // if Worker: UnReviewed->Delete $options = ReviewEnum::getList($isOrganizer, $document->reviewStatus); swwat_createSelect(0, PARAM_STATUSTYPE, $options, $document->reviewStatus, !$isEditable); echo " "; swwat_createInputSubmit(is_null($worker) ? PARAM_LASTNAME : "", $isOrganizer ? "Change Status" : "Delete"); echo "</form>"; } else { echo htmlspecialchars(ReviewEnum::getString($document->reviewStatus)); } echo "</td>\n</tr>\n"; return; }
" size="25"/></td> </tr> <tr><td class="fieldTitle">Require generic code:</td> <td> <?php swwat_createInputHidden(PARAM_WITHCODE, FALSE); ?> <?php swwat_createRadioOption(PARAM_WITHCODE, array(PARAM_WITHCODE, ""), SWWAT_CHECKBOX, $withCode, FALSE); ?> </td> </tr> <tr><td class="fieldTitle">Make code unique:</td> <td> <?php swwat_createInputHidden(PARAM_UNIQUE, FALSE); ?> <?php swwat_createRadioOption(PARAM_UNIQUE, array(PARAM_UNIQUE, ""), SWWAT_CHECKBOX, $uniqueCode, FALSE); ?> </td> </tr> <tr><td><?php swwat_createInputSubmit(PARAM_UPLOAD, "Upload File"); ?> </td></tr> <tr><td></td></tr> <tr><td class="fieldTitle">List of emails</td><td>(white-space separated)</td></tr> <tr><td colspan="2"> <textarea name="<?php echo PARAM_EMAIL;
<tr> <td class="fieldTitle">Password:</td> <td><?php echo '<input type="password" name="', PARAM_PASSWORD, '" value="" size="30" />'; ?> </td> </tr> <tr> <td colspan="2"><input type="submit" value="Login"/></td> </tr> </table> </form> <form method="POST" name="workerloginpage_reset_form" action="WorkerLoginResetAction.php" onsubmit="setEmailParam()"> <?php swwat_createInputHidden(PARAM_EMAIL, ""); ?> <table> <tr> <td><input type="submit" value="Reset Password"/></td> </tr> </table> </form> <?php if (OPENREGISTRATION == "true") { echo "<a href=RegistrationPage.php>Register</a>"; } ?> </div><!-- workerloginpage_unpw --> </div><!-- main -->