Пример #1
0
        $class = 'error';
    }
    // column_no hidden must be null for us to determine if a row has been populated
    $buffer .= get_input_field("column_no[{$row}]", NULL, 'Column No', 'hidden', 'N', $record_r['column_no'], FALSE);
    while (list(, $column_r) = each($columns_r)) {
        $buffer .= '<td class="' . $class . '" id="' . $column_r['column'] . '[' . $row . ']" nowrap>' . $column_r['field'] . '</td>';
    }
    $buffer .= '</tr>';
    return $buffer;
}
if ($HTTP_VARS['op'] == 'update') {
    if (($HTTP_VARS['s_item_type_group'] == '*' || is_exists_item_type_group($HTTP_VARS['s_item_type_group'])) && ($HTTP_VARS['s_item_type'] == '*' || is_exists_item_type($HTTP_VARS['s_item_type']))) {
        $column_conf_rs = NULL;
        $errors_found = FALSE;
        for ($row = 0; $row < count($HTTP_VARS['column_no']); $row++) {
            if (validate_column_type($HTTP_VARS['column_type'][$row])) {
                $column_conf_r = array('column_no' => $row, 'column_type' => $HTTP_VARS['column_type'][$row], 's_field_type' => $HTTP_VARS['s_field_type'][$row], 's_attribute_type' => $HTTP_VARS['s_attribute_type'][$row], 'override_prompt' => $HTTP_VARS['override_prompt'][$row], 'printable_support_ind' => $HTTP_VARS['printable_support_ind'][$row], 'orderby_support_ind' => $HTTP_VARS['orderby_support_ind'][$row], 'orderby_datatype' => $HTTP_VARS['orderby_datatype'][$row], 'orderby_default_ind' => $HTTP_VARS['orderby_default_ind'][$row], 'orderby_sort_order' => $HTTP_VARS['orderby_sort_order'][$row]);
                if (validate_item_column_conf_r($column_conf_r, $error)) {
                    $column_conf_rs[] = $column_conf_r;
                } else {
                    $column_conf_r['error'] = $error;
                    $column_conf_rs[] = $column_conf_r;
                    $errors_found = TRUE;
                }
            }
        }
        if (!$errors_found) {
            $HTTP_VARS['silc_id'] = fetch_s_item_listing_conf_id($HTTP_VARS['s_item_type_group'], $HTTP_VARS['s_item_type']);
            if (is_not_empty_array($column_conf_rs)) {
                // if no parent item_listing_conf record, we must create one now
                if (!is_numeric($HTTP_VARS['silc_id'])) {
Пример #2
0
function validate_item_column_conf(&$column_no, &$column_type, &$s_field_type, &$s_attribute_type, &$override_prompt, &$printable_support_ind, &$orderby_support_ind, &$orderby_datatype, &$orderby_default_ind, &$orderby_sort_order, &$error)
{
    $column_type = validate_column_type($column_type);
    if ($column_type !== FALSE) {
        if ($column_type == 'borrow_status' || $column_type == 'action_links') {
            $s_field_type = NULL;
            $s_attribute_type = NULL;
            $orderby_support_ind = 'N';
            $orderby_default_ind = 'N';
            $orderby_datatype = NULL;
            $orderby_sort_order = NULL;
        } else {
            if ($column_type == 's_field_type') {
                $s_field_type = validate_s_field_type($s_field_type);
                if ($s_field_type === FALSE) {
                    $error = 'Invalid System Field Type';
                    return FALSE;
                }
                if ($s_field_type == 'STATUSCMNT' || $s_field_type == 'RATING') {
                    $orderby_support_ind = 'N';
                }
            } else {
                $s_field_type = NULL;
            }
            if ($column_type == 's_attribute_type') {
                $s_attribute_type = validate_s_attribute_type($s_attribute_type);
                if ($s_attribute_type === FALSE) {
                    $error = 'Invalid System Attribute Type';
                    return FALSE;
                }
            } else {
                $s_attribute_type = NULL;
            }
            $orderby_support_ind = validate_ind_column($orderby_support_ind);
            if ($orderby_support_ind == 'Y') {
                $orderby_datatype = validate_orderby_datatype($orderby_datatype);
            } else {
                $orderby_datatype = NULL;
            }
            $orderby_default_ind = validate_ind_column($orderby_default_ind);
            if ($orderby_default_ind == 'Y') {
                $orderby_sort_order = validate_orderby_sort_order($orderby_sort_order);
            } else {
                $orderby_sort_order = NULL;
            }
            $printable_support_ind = validate_ind_column($printable_support_ind);
        }
        //else
        return TRUE;
    } else {
        $error = 'Invalid Column Type';
        return FALSE;
    }
}