コード例 #1
0
ファイル: DocumentList.php プロジェクト: ConSked/scheduler
function createDocumentHTMLList(array $documentList, array $workerList, $isEditable = FALSE)
{
    if (!is_null($workerList)) {
        $reindexedWorkers = array();
        foreach ($workerList as $w) {
            $reindexedWorkers[$w->workerid] = $w;
        }
        // $w
        // now convert workerList into a duplicate entry list in documentList order
        $workerList = array();
        foreach ($documentList as $d) {
            $workerList[] = $reindexedWorkers[$d->workerid];
        }
        // $w
        $reindexedWorkers = NULL;
        // gc
    }
    // prepare for selections
    $_SESSION[PARAM_LIST2] = $documentList;
    $_SESSION[PARAM_LIST] = $workerList;
    // now set up the html
    echo "<div>\n<table>\n";
    makeDocumentListHTMLHeader(TRUE);
    if (0 == count($documentList)) {
        echo "<tr><td class='fieldError' colspan='5'>There are No Documents for this Expo.</td></tr>\n";
    }
    for ($k = 0; $k < count($documentList); $k++) {
        $d = $documentList[$k];
        $w = $workerList[$k];
        // must be organizer on this page
        makeDocumentListHTMLRow($d, $k, $isEditable, TRUE, $w);
    }
    echo "</table>\n</div>\n";
}
コード例 #2
0
ファイル: ExpoList.php プロジェクト: ConSked/scheduler
function expoListWorkerRow(Expo $expo, $position, $isOrganizer, Worker $worker, array $docList)
{
    expoListStartRow($expo, $position, $isOrganizer);
    if ($expo->isPast() || $expo->isRunning()) {
        $hours = ShiftStatus::WorkerHours($worker->workerid, $expo->expoid);
    } else {
        $hours = "-";
    }
    echo "  <td class='fieldValue'>" . htmlspecialchars($hours) . "</td>\n";
    if ($isOrganizer || !$expo->isPast()) {
        echo "  <td class='fieldValue'><a href='WorkerDocumentUploadPage.php?" . PARAM_LIST_INDEX . "=" . $position . "'>Upload</a></td>\n";
    } else {
        echo "  <td class='fieldValue'>Upload</td>\n";
    }
    echo "</tr>\n";
    // insert a non-expo row in the expo table!
    if (($isOrganizer || !$expo->isPast()) && !is_null($docList)) {
        if (count($docList) > 0) {
            makeDocumentListHTMLHeader(FALSE);
            for ($d = 0; $d < count($docList); $d++) {
                $document = $docList[$d];
                if ($document->expoid == $expo->expoid) {
                    makeDocumentListHTMLRow($document, $d, !$expo->isPast(), $isOrganizer, NULL);
                }
            }
            // $d
        }
    }
}