require_once 'db/JobTitle.php'; require_once 'db/Worker.php'; require_once 'db/JobTitle.php'; require_once 'util/log.php'; require_once 'util/session.php'; require_once 'swwat/gizmos/parse.php'; $station = getStationCurrent(); if (isset($_REQUEST['copy'])) { $station->stationid = NULL; } if (isset($_POST[PARAM_SAVE])) { $titleEnums = JobTitle::titleEnums($station->expoid); try { $station->startTime = swwat_parse_date(html_entity_decode($_POST[PARAM_DATE] . " " . $_POST[PARAM_STARTHOUR]), true); $station->stopTime = swwat_parse_date(html_entity_decode($_POST[PARAM_DATE] . " " . $_POST[PARAM_STOPHOUR]), true); $station->jobTitle = swwat_parse_enum($_POST[PARAM_JOB], $titleEnums, false); $station->maxCrew = swwat_parse_integer(html_entity_decode($_POST[PARAM_MAXCREW]), 11, true); $station->minCrew = swwat_parse_integer(html_entity_decode($_POST[PARAM_MINCREW]), 11, true); $station->maxSupervisor = swwat_parse_integer(html_entity_decode($_POST[PARAM_MAXSUPERVISOR]), 11, true); $station->minSupervisor = swwat_parse_integer(html_entity_decode($_POST[PARAM_MINSUPERVISOR]), 11, true); $station->description = swwat_parse_string(html_entity_decode($_POST[PARAM_DESCRIPTION]), true); $station->title = swwat_parse_string(html_entity_decode($_POST[PARAM_TITLE]), true); $station->location = swwat_parse_string(html_entity_decode($_POST[PARAM_LOCATION]), true); $station->instruction = swwat_parse_string(html_entity_decode($_POST[PARAM_INSTRUCTION]), true); } catch (Exception $ex) { header('Location: WorkerLoginPage.php'); include 'WorkerLoginPage.php'; return; } $station = is_null($station->stationid) ? $station->insert() : $station->update(); setStationCurrent($station);
include 'util/authenticate.php'; require_once 'properties/constants.php'; require_once 'db/Document.php'; require_once 'db/Worker.php'; require_once 'util/log.php'; require_once 'util/session.php'; require_once 'util/ReviewEnum.php'; require_once 'swwat/gizmos/parse.php'; $author = getWorkerAuthenticated(); $document = getParamItem(PARAM_LIST2, PARAM_LIST2_INDEX); unset($_SESSION[PARAM_LIST2]); // not needed anymore if (!is_null($document)) { try { $status = $_REQUEST[PARAM_STATUSTYPE]; $status = swwat_parse_enum($status, ReviewEnum::$REVIEW_ARRAY, FALSE); // do nothing if no status change if (0 != strcmp($status, $document->reviewStatus)) { if (0 == strcmp(DELETE, $status)) { // cannot delete reviewed doc; set it unreviewed first // either organizer or self can delete if has not been reviewed if (0 == strcmp(UNREVIEWED, $document->reviewStatus) && ($author->isOrganizer() || $author->workerid == $document->workerid)) { $document->delete(); } else { throw new ParseSWWATException(); // they futzed the client } } else { if ($author->isOrganizer()) { $document->reviewStatus = $status; $document->update();
<?php // $Id: WorkerViewUpdateRoles.php 604 2012-06-07 21:11:57Z cross $ Copyright (c) ConSked, LLC. All Rights Reserved. include 'util/authenticateOrganizer.php'; require_once 'properties/constants.php'; require_once 'db/Worker.php'; require_once 'util/log.php'; require_once 'util/session.php'; require_once 'swwat/gizmos/parse.php'; $worker = getWorkerCurrent(); if (isset($_REQUEST[PARAM_AUTHROLE])) { $worker->authrole = swwat_parse_enum(html_entity_decode($_REQUEST[PARAM_AUTHROLE]), RoleEnum::$ROLE_ARRAY, true); $worker = $worker->updateRole(); } // in all cases header('Location: WorkerViewPage.php'); include 'WorkerViewPage.php';
require_once 'swwat/gizmos/parse.php'; $expo = getExpoCurrent(); if (isset($_POST[PARAM_SCHEDULE_PUBLISH]) && isset($_SESSION[PARAM_SCHEDULE_PUBLISH])) { $keepFlag = isset($_SESSION[PARAM_SCHEDULE_KEEP]); AbstractScheduler::commitSchedule($expo->expoid, $keepFlag, $_SESSION[PARAM_SCHEDULE_PUBLISH]); unset($_SESSION[PARAM_SCHEDULE_PUBLISH]); unset($_SESSION[PARAM_SCHEDULE_ALGO]); unset($_SESSION[PARAM_PAGE_MESSAGE]); unset($_SESSION[PARAM_SCHEDULE_KEEP]); header('Location: SchedulingReportPage.php'); include 'SchedulingReportPage.php'; return; } $algorithm = $_POST[PARAM_SCHEDULE_ALGO]; try { $algorithm = swwat_parse_enum($algorithm, ScheduleEnum::$ENUM_ARRAY, FALSE); } catch (ParseSWWATException $ex) { header('Location: WorkerLoginPage.php'); include 'WorkerLoginPage.php'; return; } $keepFlag = isset($_POST[PARAM_SCHEDULE_KEEP]); $_SESSION[PARAM_SCHEDULE_ALGO] = $_POST[PARAM_SCHEDULE_ALGO]; $_SESSION[PARAM_SCHEDULE_KEEP] = $_POST[PARAM_SCHEDULE_KEEP]; $workerList = NULL; $stationList = NULL; $assignmentList = NULL; try { // needed for all $workerList = WorkerSchedule::selectExpo($expo->expoid); // needed for all excepting PREFERENCEASSIGN
// $Id: WorkerEditAction.php 914 2012-07-14 13:26:32Z preston $ Copyright (c) ConSked, LLC. All Rights Reserved. include 'util/authenticate.php'; require_once 'properties/constants.php'; require_once 'db/Worker.php'; require_once 'util/log.php'; require_once 'util/session.php'; require_once 'util/SMSEnum.php'; require_once 'swwat/gizmos/parse.php'; $worker = getWorkerCurrent(); if (isset($_POST[PARAM_SAVE])) { $worker->firstName = swwat_parse_string(html_entity_decode($_POST[PARAM_FIRSTNAME]), true); $worker->middleName = swwat_parse_string(html_entity_decode($_POST[PARAM_MIDDLENAME]), true); $worker->lastName = swwat_parse_string(html_entity_decode($_POST[PARAM_LASTNAME]), true); $worker->email = swwat_parse_string(html_entity_decode($_POST[PARAM_EMAIL]), true); $worker->phone = swwat_parse_phone(html_entity_decode($_POST[PARAM_PHONE]), true); $sms = swwat_parse_enum(html_entity_decode($_POST[PARAM_SMS_SERVICE]), SMSEnum::$SMS_ARRAY, true); if (0 == strcmp(SMSEnum::$NONE, $sms)) { $sms = NULL; } $worker->smsemail = is_null($worker->phone) || is_null($sms) ? NULL : $worker->phone . "@" . $sms; $worker = $worker->update(); if ($worker->workerid == getWorkerAuthenticated()->workerid) { $_SESSION[AUTHENTICATED] = $worker; // unusual; but I believe the only place required to do so } else { setWorkerCurrent($worker); } } // in all cases header('Location: WorkerViewPage.php'); include 'WorkerViewPage.php';