public function handleNotification(INotification $note) { switch ($note->getName()) { case AppFacade::NEW_USER: $this->clearForm(); break; case AppFacade::USER_ADDED: $this->rolePanel->user = $note->getBody(); $this->roleProxy->addItem(new RoleVO($this->rolePanel->user->username)); $this->clearForm(); break; case AppFacade::USER_UPDATED: $this->clearForm(); break; case AppFacade::USER_DELETED: $this->clearForm(); break; case AppFacade::CANCEL_SELECTED: $this->clearForm(); break; case AppFacade::USER_SELECTED: $this->rolePanel->user = $note->getBody(); $this->rolePanel->setUserRoles($this->roleProxy->getUserRoles($this->rolePanel->user->username)); $this->rolePanel->reset(); break; case AppFacade::ADD_ROLE_RESULT: $note->getBody() && $this->rolePanel->addUserRole($note->getType(), RoleEnum::getValue($note->getType())); $this->rolePanel->reset(); break; } }
static function PrivateStaticConstructor() { // todo - should be internationalized; should be easy enough with dates! if (!is_null(RoleEnum::$ROLE_ARRAY)) { return; } RoleEnum::$ROLE_ARRAY = array(CREWMEMBER, SUPERVISOR, ORGANIZER); RoleEnum::$STRING_ARRAY = array(CREWMEMBER => "Crew", SUPERVISOR => "Supervisor", ORGANIZER => "Organizer"); RoleEnum::$OPTION_CREWMEMBER = array(CREWMEMBER, RoleEnum::$STRING_ARRAY[CREWMEMBER]); RoleEnum::$OPTION_SUPERVISOR = array(SUPERVISOR, RoleEnum::$STRING_ARRAY[SUPERVISOR]); RoleEnum::$OPTION_ORGANIZER = array(ORGANIZER, RoleEnum::$STRING_ARRAY[ORGANIZER]); RoleEnum::$OPTION = array(RoleEnum::$OPTION_CREWMEMBER, RoleEnum::$OPTION_SUPERVISOR, RoleEnum::$OPTION_ORGANIZER); }
public function setUserRoles(array $roles) { $this->roleListStore->refClear(); if (count($roles) > 0) { foreach ($roles as $roleEnum) { $userRoles[$roleEnum] = RoleEnum::getValue($roleEnum); } $this->roleListStore->refInsert(isset($userRoles) ? $userRoles : array()); } }
public function roleString() { return RoleEnum::getString($this->authrole); }
require_once 'db/Expo.php'; require_once 'db/Worker.php'; require_once 'util/log.php'; require_once 'util/mail.php'; require_once 'util/mailSchedule.php'; require_once 'util/session.php'; require_once 'swwat/gizmos/format.php'; require_once 'swwat/gizmos/parse.php'; $author = getWorkerAuthenticated(); $expo = Expo::selectActive($author->workerid); $subject = swwat_parse_string(html_entity_decode($_POST[PARAM_SUBJECT_MESSAGE])); $message = swwat_parse_string(html_entity_decode($_POST[PARAM_MESSAGE])); $to = "*****@*****.**"; $message .= "\n\n\n...............................\nStandard Data Included\n..............................."; $message .= "\nfrom: {$author->lastName}, {$author->firstName}"; $message .= "\nrole: " . RoleEnum::getString($author->authrole); $message .= "\nemail: {$author->email}"; $message .= "\nphone: " . swwat_format_phone($author->phone); $message .= "\nstatus: " . ($author->isDisabled ? "disabled" : "enabled"); if (!is_null($expo)) { $message .= "\ncurrent expo: " . $expo->titleString(); $message .= "\nschedule:\n"; $savList = ShiftAssignmentView::selectWorker($expo->expoid, $author->workerid); $message .= sprintfSchedule($savList); } else { $message .= "no current expo"; } $message .= "\n\n"; FormMail::send($to, $subject, $message); header('Location: WorkerViewPage.php'); include 'WorkerViewPage.php';