Beispiel #1
0
function wf_processRequest($wf_id, $wfstatus_id, $action)
{
    global $dbi, $usertoken;
    $ret = 0;
    /*
     * $action = enter / leave
     */
    switch ($wfstatus_id) {
        case 4:
            if ($action == 'enter') {
                // this is a reject case ....
                // dsolog(3,'wfengine','Request rejected by:'.$usertoken['uname']);
                $obj = wf_getReqObject($wf_id);
                #debug($obj);
            }
            break;
        case 5:
            if ($action == 'enter') {
                // dsolog(1,'wfengine','Enter State for S:'.$wfstatus_id.'/ R:'.$wf_id);
                $obj = wf_getReqObject($wf_id);
                #debug($obj);
                if ($obj['wfobject'] == 'wflineup') {
                    $ret = wf_process_lineup($obj);
                } elseif ($obj['wfobject'] == 'wfplayer') {
                    $ret = wf_process_player($obj);
                } elseif ($obj['wfobject'] == 'wfteam') {
                    $ret = wf_process_team($obj);
                } elseif ($obj['wfobject'] == 'wfmessage') {
                    /*
                     * nothing to do - there is no actual automatic
                     * processing job to finish
                     */
                    $ret = 1;
                }
            }
            break;
        default:
            // dsolog(3,'wfengine','Unhandled opcodes:'.$wfstatus_id.'/'.$action);
    }
    return $ret;
}
Beispiel #2
0
    case 'save':
        $req_id = _saverequest($req_type, $v_id);
        if ($req_id > 0) {
            $obj = wf_getReqObject($req_id);
        } else {
            debug('Error :: Request could not be created');
            return;
        }
        if (sizeof($obj) > 2) {
            _editobject($obj);
        } else {
            debug('Error :: Request not found');
            return;
        }
        break;
    case 'edit':
        $obj = wf_getReqObject($req_id);
        if (sizeof($obj) > 2) {
            _editobject($obj);
        } else {
            debug('Error :: Request not found');
            return;
        }
        break;
    case 'new':
    default:
        _newrequest();
}
echo '</div>';
#-> close the maincontent
LS_page_end();
Beispiel #3
0
if (isset($_POST['vrcomm']) && $_POST['vrcomm'] != 'undefined') {
    $wfcomment = strip_tags(utf8_decode(urldecode($_POST['vrcomm'])));
} else {
    $wfcomment = '';
}
$dbi = sql_connect($dbhost, $dbuname, $dbpass, $dbname);
$usertoken = initLsdbSec($dbi);
if ($usertoken['usertype_id'] < 5) {
    // looks bad ... prevent change by setting to identical UID
    $WHERE = ' AND user_id=' . $usertoken['id'];
} else {
    $WHERE = '';
}
$qry = "";
$allresult = 0;
$obj = wf_getReqObject($wf_id);
/*
 * a meaningful description is loaded into $obj['msg']
 */
switch ($wfstatus_id) {
    case 1:
        $sMSG = 'Created: ' . $obj['msg'] . ' Rem: ' . $wfcomment;
        $p1 = 1;
        break;
    case 2:
        $sMSG = 'Submitted: ' . $obj['msg'] . ' Rem: ' . $wfcomment;
        $recipient = 'admin';
        $p1 = 1;
        break;
    case 3:
        $sMSG = 'Approved: ' . $obj['msg'] . ' Rem: ' . $wfcomment;