Пример #1
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;
     break 1;
     //re-switch to SELECTED_PERSON
 }
 $_STATE->msgGreet = "Select the person whose logs are to be editted";
Пример #2
0
            }
        }
    }
    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
            $persons = unserialize($_STATE->person_select);
            $persons->set_state();
            $_STATE->status = SELECTED_PERSON;
            //	break 1; //re-switch