//delete permit $sql = "DELETE FROM " . $_DB->prefix . "c20_person_permit\n\t\t\t\t\tWHERE person_permit_id=" . $permit->person_permit . ";"; $_DB->exec($sql); $permit->assigned = false; } } } return TRUE; } //Main State Gate: (the while (1==1) allows a loop back through the switch using a 'break 1') while (1 == 1) { switch ($_STATE->status) { case STATE::INIT: $_STATE->person_id = 0; require_once "person_select.php"; $persons = new PERSON_SELECT(false); //false: user can't change own permits if ($persons->selected != 0) { //solo person? $persons->set_state(); $_STATE->status = SELECTED_PERSON; break 1; //re-switch } $_STATE->person_select = serialize(clone $persons); $_STATE->msgGreet = "Select a person to assign permissions"; $_STATE->status = SELECT_PERSON; break 2; case SELECT_PERSON: require_once "person_select.php"; //catches $_GET list refresh
$_STATE->inactive_date = COM_NOW(); $_STATE->project_id = 0; $_STATE->close_date = COM_NOW(); $_STATE->accounting_id = 0; $_STATE->accounting = ""; $_STATE->task_id = 0; $_STATE->subtask_id = 0; $_STATE->account_id = 0; $_STATE->activity_id = 0; $_STATE->columns = -1; $_STATE->max_column = 0; $_STATE->closedCols = 0; //in tabular form => cols prior to close date unset($_SESSION["_EXTENSION"]); require_once "person_select.php"; $persons = new PERSON_SELECT(true); //true: user can edit their own stuff if (!$_EDIT) { //set by executive.php $persons->set_state($_SESSION["person_id"]); $_STATE->person_select = serialize($persons); $_STATE->status = SELECTED_PERSON; break 1; //re-switch to SELECTED_PERSON } if (!$_PERMITS->can_pass("edit_logs")) { throw_the_bum_out(NULL, "Evicted(" . __LINE__ . "): no permit"); } $_STATE->person_select = serialize(clone $persons); if ($persons->selected) { $_STATE->status = SELECTED_PERSON;
define('LIST_PERSONS', STATE::INIT); define('SELECT_PERSON', LIST_PERSONS + 1); define('SELECTED_PERSON', LIST_PERSONS + 2); define('CHANGE_PERSON', LIST_PERSONS + 3); define('UPDATE_PERSON', LIST_PERSONS + 4); define('ADD_PERSON', LIST_PERSONS + 5); define('DELETE_PERSON', LIST_PERSONS + 6); define('PREFERENCES', STATE::INIT + 20); //Main State Gate: (the while (1==1) allows a loop back through the switch using a 'break 1') while (1 == 1) { switch ($_STATE->status) { case LIST_PERSONS: $_STATE->person_organization_id = 0; $_STATE->person_id = 0; require_once "lib/person_select.php"; $persons = new PERSON_SELECT(); if (!$_PERMITS->can_pass("person_edit")) { $persons->set_state($_SESSION["person_id"]); $_STATE->status = SELECTED_PERSON; break 1; //re-switch to SELECTED_PERSON } $persons->show_new = true; $_STATE->person_select = serialize(clone $persons); $_STATE->msgGreet = "Select a person record to edit"; $_STATE->status = SELECT_PERSON; break 2; case SELECT_PERSON: require_once "lib/person_select.php"; //catches $_GET list refresh $persons = unserialize($_STATE->person_select);