Beispiel #1
0
 function hBoxesDefault($mode)
 {
     # KFD 10/8/08, correction to setting of context, make dtimes
     #              use the same format that we display, so they
     #              don't come back looking changed when they have not
     $oldRow = array();
     #hprint_r($this->row);
     foreach ($this->table['flat'] as $colname => $colinfo) {
         if (!isset($this->row[$colname])) {
             $oldRow[$colname] = '';
         } else {
             if ($colinfo['type_id'] != 'dtime') {
                 $oldRow[$colname] = $this->row[$colname];
             } else {
                 $oldRow[$colname] = date('m/d/Y h:i A', dEnsureTs($this->row[$colname]));
             }
         }
     }
     ContextSet('OldRow', $oldRow);
     // KFD 5/27/07, This line replaces the commented line
     //    below that used ahInputsComprehensive().  We now
     //    want to allow more complex arrangements, and
     //    eventually do ui.yaml and stuff.
     //
     //    In any event, this remains a two-line routine
     return $this->hBoxesX3($mode);
     //return $this->hBoxesFromProjection($mode);
 }
Beispiel #2
0
function index_hidden_x6FETCH()
{
    $returns = array();
    # This is everything that *might* go back, make a place
    # for all of it
    $GLOBALS['AG']['x4'] = array('error' => array(), 'debug' => array(), 'notice' => array(), 'html' => array(), 'script' => array());
    // First fetch the values
    $table_id = gp('x6fetch');
    $dd = ddTable($table_id);
    $column = gp('x6col');
    $colvalue = gp('x6val');
    # Look for fetch columns that pull from this column's
    # table_id_fko
    $tfko = $dd['flat'][$column]['table_id_fko'];
    $cfko = $dd['flat'][$column]['column_id_fko'];
    $cols = array();
    foreach ($dd['flat'] as $fcol => $cdetails) {
        $arr = array('FETCH', 'FETCHDEF', 'DISTRIBUTE');
        if (in_array($cdetails['automation_id'], $arr)) {
            if ($cdetails['auto_table_id'] == $tfko) {
                $cols[$fcol] = $cdetails['auto_column_id'];
            }
        }
    }
    # We now have a list of source and destination
    # columns, build the query
    $sql = "Select " . implode(',', $cols) . " FROM {$tfko} WHERE {$cfko} = " . SQLFC($colvalue);
    $row = SQL_OneRow($sql);
    foreach ($cols as $fcol => $srccol) {
        $type = $dd['flat'][$fcol]['formshort'];
        if ($type == 'date') {
            x6html("x6inp_{$table_id}_{$fcol}", date("Y-m-d", dEnsureTs($row[$srccol])));
        } else {
            x6html("x6inp_{$table_id}_{$fcol}", $row[$srccol]);
        }
    }
    echo json_encode_safe($GLOBALS['AG']['x4']);
    exit;
}