예제 #1
0
function subtask_select(&$state, &$HTML, $rec = -1)
{
    if ($rec < 0) {
        //checking returned
        if (!isset($_GET["row"])) {
            return;
        }
        $rec = $_GET["row"];
        //get row number
    }
    subtask_list($state);
    //restore the record list
    if (!array_key_exists($rec, $state->records)) {
        throw_the_bum_out(NULL, "Evicted(" . __LINE__ . "): invalid subtask id " . $rec, true);
    }
    $record = $state->records[$rec];
    if ($record[1] != "") {
        $inactive = new DateTime($record[1]);
        $diff = date_diff($state->from_date, $inactive)->days;
        if ($diff < $state->columns[COL_INACTIVE]) {
            $state->columns[COL_INACTIVE] = $diff;
            $state->columns[COL_AGENT] = "subtask";
        }
        $record[0] .= "<br>(inactive as of " . $record[1] . ")";
    }
    $state->subtask_id = $rec;
    $state->msgStatus = "";
    $HTML .= "cell = document.getElementById('ST_" . $state->row . "');\n";
    $HTML .= "cell.innerHTML = '" . $record[0] . "';\n";
}
예제 #2
0
function subtask_select($ID = -1)
{
    global $_STATE;
    if ($ID < 0) {
        //not yet selected
        subtask_list();
        //restore the record list
        if (!array_key_exists(strval($_POST["selSubtask"]), $_STATE->records)) {
            throw_the_bum_out(NULL, "Evicted(" . __LINE__ . "): invalid subtask id " . $_POST["selSubtask"]);
            //we're being spoofed
        }
        $ID = intval($_POST["selSubtask"]);
    }
    $_STATE->record_id = $ID;
}
예제 #3
0
function subtask_select($ID = -1)
{
    global $_DB, $_STATE;
    if ($ID < 0) {
        //not yet selected
        subtask_list();
        //restore the record list
        if (!array_key_exists(strval($_POST["selSubtask"]), $_STATE->records)) {
            throw_the_bum_out(NULL, "Evicted(" . __LINE__ . "): invalid subtask id " . $_POST["selSubtask"]);
            //we're being spoofed
        }
        $ID = intval($_POST["selSubtask"]);
    }
    $_STATE->record_id = $ID;
    $sql = "SELECT name, description FROM " . $_DB->prefix . "a14_subtask\n\t\t\tWHERE subtask_id=" . $_STATE->record_id . ";";
    $row = $_DB->query($sql)->fetchObject();
    $_STATE->forwho = $row->name . ": " . $row->description;
    //PROPERTIES wants to see this
}
예제 #4
0
파일: timelog.php 프로젝트: bbogin/sr2s
function subtask_select(&$state, &$HTML, $rec = -1)
{
    if ($rec < 0) {
        //checking returned
        if (!isset($_GET["row"])) {
            return;
        }
        $rec = strval($_GET["row"]);
    }
    subtask_list($state);
    //restore the record list
    if (!array_key_exists($rec, $state->records)) {
        throw_the_bum_out(NULL, "Evicted(" . __LINE__ . "): invalid subtask id " . $rec, true);
    }
    $record = $state->records[$rec];
    if ($record[1] != "") {
        $inactive = new DateTime($record[1]);
        if ($inactive < $state->inactive_date) {
            $state->inactive_date = $inactive;
            $state->max_column = date_diff($state->from_date, $inactive)->days - 1;
            //0 rel
        }
        $record[0] .= "<br>(inactive as of " . $record[1] . ")";
    }
    $state->subtask_id = $rec;
    $state->msgStatus = "";
    $HTML .= "cell = document.getElementById('ST_0');\n";
    $HTML .= "cell.innerHTML = '" . $record[0] . "';\n";
}
예제 #5
0
function change_subtask(&$state)
{
    global $_DB;
    include_once "lib/callback/subtask.php";
    subtask_list($state);
    //restore the record list
    if (!array_key_exists($state->subtask_id, $state->records)) {
        throw_the_bum_out(NULL, "Evicted(" . __LINE__ . "): invalid subtask id " . $state->subtask_id, true);
    }
    log_list($state, $state->row);
    //find this row's records
    $record = reset($state->records);
    if ($state->subtask_id == $record["subtask_id"]) {
        return;
    }
    foreach ($state->records as $ID => $record) {
        if ($record["column"] < $state->columns[COL_OPEN]) {
            continue;
        }
        $sql = "UPDATE " . $_DB->prefix . "b00_timelog\n\t\t\t\tSET subtask_idref=" . $state->subtask_id . " WHERE timelog_id=" . $ID . ";";
        $_DB->exec($sql);
    }
}