Beispiel #1
0
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 "&nbsp;";
        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;
}
Beispiel #2
0
function wizardPageContent($author, $expo)
{
    $dateSpanList = GrossPreference::selectDateSpan($expo->expoid);
    $locationList = GrossPreference::selectLocation($expo->expoid);
    $_SESSION[PARAM_DATETIME] = $dateSpanList;
    $_SESSION[PARAM_LOCATION] = $locationList;
    echo "<form method=\"POST\" name=\"preferencewizard_form\" action=\"PreferenceWizardAction.php\">\n";
    echo "<div id=\"content\" style=\"clear:both\">\n";
    echo "<table>\n";
    echo "   <tr>\n";
    echo "      <td>\n";
    echo "         <br><b>For the following dropdown menus:</b><br>\n";
    echo "         <i>\n";
    echo "            0 = I absolutely cannot work at this station and/or time.<br>\n";
    echo "            1 = I'll do it if absolutely necessary.<br>\n";
    echo "            5 or 6 ish = Yes, sounds like fun, I'm available.<br>\n";
    echo "            10 = I'd absolutely love to work this one!<br>\n";
    echo "            So consider 0, 1, and 10 as extremes (pay attention to \"absolutely\").<br><br>\n";
    echo "            <b>Note: We'll do our best to schedule everyone to their top choices, but you'll be schedule between your preferences and our need!</b>\n";
    echo "         </i>\n";
    echo "      </td>\n";
    echo "   </tr>\n";
    echo "</table>\n";
    echo "<p />\n";
    echo "<div id=\"shiftpreferencepage_data\">\n";
    echo "<table width=\"100%\">\n";
    echo "   <tr>\n";
    echo "      <td valign=\"top\">\n";
    echo "         <table>\n";
    echo "            <tr><th class=\"rowTitle2\" colspan=\"5\">Shift</th></tr>\n";
    $tp = TimePreference::selectID($author->workerid, $expo->expoid);
    for ($k = 0; $k < count($dateSpanList); $k++) {
        $dateSpanFormatted = format_shift($dateSpanList[$k]);
        if (!is_null($tp)) {
            $arg = 'shift' . ($k + 1);
            $default = $tp->{$arg};
        } else {
            $default = 50;
        }
        createPreferenceHTMLRows(12, $dateSpanFormatted, $default, PARAM_DATETIME . $k, TRUE);
    }
    echo "         </table>\n";
    echo "      </td>\n";
    echo "      <td valign=\"top\">\n";
    echo "         <table>\n";
    echo "            <tr><th class=\"rowTitle2\" colspan=\"5\">Job</th></tr>\n";
    $jp = JobPreference::selectID($author->workerid, $expo->expoid);
    for ($k = 0; $k < count($locationList); $k++) {
        if (!is_null($jp)) {
            $arg = 'job' . ($k + 1);
            $default = $jp->{$arg};
        } else {
            $default = 50;
        }
        createPreferenceHTMLRows(12, $locationList[$k], $default, PARAM_LOCATION . $k, FALSE);
    }
    echo "         </table>\n";
    echo "      </td>\n";
    echo "   </tr>\n";
    echo "</table>\n";
    echo "<p />\n";
    echo "<table>\n";
    echo "   <tr>\n";
    echo "      <td class=\"fieldTitle\"><h2>How many hours can you work:&nbsp;</h2></td>\n";
    echo "      <td>\n";
    $maxhours = $_POST[PARAM_MAXHOURS] = $author->selectMaxHours($expo->expoid);
    $optionArray = array();
    for ($k = 0; $k < $maxhours; $k++) {
        $optionArray[$k] = array($maxhours - $k, "&nbsp;" . ($maxhours - $k) . "&nbsp;");
    }
    swwat_createSelect(6, PARAM_MAXHOURS, $optionArray, $maxhours);
    echo "      </td>\n";
    echo "   </tr>\n";
    echo "</table>\n";
    echo "</div><!-- shiftpreferencepage_data -->\n";
    echo "</div><!-- content -->\n";
}
Beispiel #3
0
function maxHoursPreferences($step, $author, $expo)
{
    echo "<div class=\"center\"><b>" . $step . "</b>. How many hours can you work?</div>\n";
    echo "<br>\n";
    echo "<div class=\"center\">\n";
    $maxhours = $author->selectMaxHours($expo->expoid);
    $optionArray = array();
    for ($i = 0; $i < $maxhours; $i++) {
        $optionArray[$i] = array($maxhours - $i, $maxhours - $i);
    }
    swwat_createSelect(0, PARAM_MAXHOURS, $optionArray, $maxhours);
    echo "</div>\n";
    echo "<br><br>\n";
    $step++;
    return $step;
}
            </tr>
            <tr><td class="fieldTitle">Require generic code:</td>
                <td><?php 
swwat_createRadioOption(PARAM_WITHCODE, array(PARAM_WITHCODE, ""), SWWAT_CHECKBOX, $withCode, TRUE);
?>
</td>
            </tr>
            <tr><td class="fieldTitle">Make code unique:</td>
                <td><?php 
swwat_createRadioOption(PARAM_UNIQUE, array(PARAM_UNIQUE, ""), SWWAT_CHECKBOX, $uniqueCode, TRUE);
?>
</td>
            </tr>
            <tr><td class="fieldTitle">CSV File Format:</td>
                <td><?php 
swwat_createSelect(0, "CSVFileFormat", array(array("FiveDegrees", "Five Degrees")), "FiveDegrees", TRUE);
?>
</td>
            </tr>
            <tr><td></td><td></td></tr>
            <tr><td class="fieldTitle">Upload File:</td><td><?php 
createFileUploadForm("InvitationFileUploadAction.php", PARAM_DOCUMENT);
?>
</td></tr>
		</table>
		<!-- /form -->
	</div><!-- invitation_fileupload -->

    <div id="invitation_fileupload_results">
        <h5>File Invitation Results</h5>
        <table>
Beispiel #5
0
function createJobDataHTMLRows(StationJob $job, $formName, $showDates, $isDisabledFlag = TRUE)
{
    if (is_null($job)) {
        return;
    }
    $_POST[PARAM_MAXCREW] = htmlspecialchars($job->maxCrew);
    $_POST[PARAM_MINCREW] = htmlspecialchars($job->minCrew);
    $_POST[PARAM_ASSIGNEDCREW] = htmlspecialchars($job->assignedCrew);
    $_POST[PARAM_MAXSUPERVISOR] = htmlspecialchars($job->maxSupervisor);
    $_POST[PARAM_MINSUPERVISOR] = htmlspecialchars($job->minSupervisor);
    $_POST[PARAM_ASSIGNEDSUPERVISOR] = htmlspecialchars($job->assignedSupervisor);
    if ($showDates) {
        // remember these are READ-only
        echo "<tr><td class='fieldTitle'>Start Time:</td>\n<td>";
        echo "<input type='text' value='" . swwat_format_isodatetime($job->startTime) . "' disabled='disabled'/>";
        echo "</td></tr>\n";
        echo "<tr><td class='fieldTitle'>Start Time:</td>\n<td>";
        echo "<input type='text' value='" . swwat_format_isodatetime($job->stopTime) . "' disabled='disabled'/>";
        echo "</td></tr>\n";
    }
    // $optionArray = 2D array {{name, value}, {name, value}, ...}
    $jobOptionArray = JobTitle::titleOptions($job->expoid);
    if (is_null($job->jobTitle)) {
        $job->jobTitle = $jobOptionArray[0][0];
    }
    $_POST[PARAM_JOB] = $job->jobTitle;
    echo "  <tr><td class='fieldTitle'>Job:</td>\n<td>";
    swwat_createSelect(0, PARAM_JOB, $jobOptionArray, $_POST[PARAM_JOB], $isDisabledFlag);
    echo "</td></tr>\n";
    echo "  <tr><td class='fieldTitle'>Min Crew:</td>\n<td>";
    swwat_createInputValidateLength(PARAM_MINCREW, $formName, 'mincrewCheck', 11, $isDisabledFlag);
    echo "</td></tr>\n";
    echo "  <tr><td class='fieldTitle'>Max Crew:</td>\n<td>";
    swwat_createInputValidateLength(PARAM_MAXCREW, $formName, 'maxcrewCheck', 11, $isDisabledFlag);
    echo "</td></tr>\n";
    echo "  <tr><td class='fieldTitle'>Assigned Crew:</td>\n<td>";
    swwat_createInputValidateLength(PARAM_ASSIGNEDCREW, $formName, NULL, 11, TRUE);
    echo "</td></tr>\n";
    echo "  <tr><td class='fieldTitle'>Min Supervisor:</td>\n<td>";
    swwat_createInputValidateLength(PARAM_MINSUPERVISOR, $formName, 'minsupervisorCheck', 11, $isDisabledFlag);
    echo "</td></tr>\n";
    echo "  <tr><td class='fieldTitle'>Max Supervisor:</td>\n<td>";
    swwat_createInputValidateLength(PARAM_MAXSUPERVISOR, $formName, 'maxsupervisorCheck', 11, $isDisabledFlag);
    echo "</td></tr>\n";
    echo "  <tr><td class='fieldTitle'>Assigned Supervisor:</td>\n<td>";
    swwat_createInputValidateLength(PARAM_ASSIGNEDSUPERVISOR, $formName, NULL, 11, TRUE);
    echo "</td></tr>\n";
}
Beispiel #6
0
?>

<div id="main">

    <?php 
include 'section/LinkExpo.php';
?>

    <div id="scheduleexpopage_parameters">
        <h5>Schedule Parameters</h5>
        <form method="POST" name="scheduleexpopage_scheduleexpo_form" action="ScheduleExpoAction.php">
            <table>
            <tr>
                <td class='fieldValueFirst'>Algorithm</td>
                <td class='fieldValue'><?php 
swwat_createSelect(0, PARAM_SCHEDULE_ALGO, ScheduleEnum::$OPTIONS, $algorithm, FALSE);
?>
</td>
            </tr>
            </table>

            <input class="fieldValue" type="Submit" value="Run Algorithm"/>
        </form>
    </div><!-- scheduleexpopage_parameters -->

    <div id="scheduleexpopage_results">
        <h5>Schedule Results</h5>
        <form method="POST" name="scheduleexpopage_scheduleexpo_form" action="ScheduleExpoAction.php">
            <?php 
$disableAttr = isset($_SESSION[PARAM_SCHEDULE_PUBLISH]) ? "" : " disabled='disabled'";
echo "<input class='fieldValue' type='Submit' name='" . PARAM_SCHEDULE_PUBLISH . "' value='Save Schedule'{$disableAttr}/>\n";
// ok, start the html
include 'section/header.php';
?>

<div id="main">
    <?php 
if (!is_null($expo->expoid)) {
    include 'section/LinkExpoWorker.php';
}
?>

	<div id="workerdocument_fileupload">
		<table>
            <tr><td class="fieldTitle">Document Type:</td>
                <td><?php 
swwat_createSelect(0, PARAM_DOCTYPE, $docTypeOption, $defaultOption, TRUE);
?>
</td>
            </tr>
            <tr><td></td><td></td></tr>
            <tr><td class="fieldTitle">Upload File:</td>
                <td><?php 
createFileUploadForm("WorkerDocumentUploadAction.php", PARAM_DOCUMENT);
?>
</td></tr>
		</table>
	</div><!-- workerdocument_fileupload -->

    <div id="workerdocument_fileupload_results">
        <h5>Document Upload Results</h5>
        <p><?php