function expoListStartRow(Expo $expo, $position, $isOrganizer) { echo "<tr>\n <td class='fieldValueFirst'>"; if ($isOrganizer) { echo "<a href='ExpoViewPage.php?" . PARAM_LIST_INDEX . "=" . $position . "'>" . htmlspecialchars($expo->title) . "</a>"; } else { if (!$expo->isPast()) { echo "<a href='PreferenceWelcomePage.php?" . PARAM_LIST_INDEX . "=" . $position . "'>" . htmlspecialchars($expo->title) . "</a>"; } else { echo htmlspecialchars($expo->title); } } echo "</td>\n"; echo " <td class='fieldValue'>" . htmlspecialchars(swwat_format_usdate($expo->startTime)) . "</td>\n"; echo " <td class='fieldValue'>" . htmlspecialchars(swwat_format_usdate($expo->stopTime)) . "</td>\n"; }
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; }