if (get_post('_show_inactive_update')) { $Ajax->activate('AccountList'); set_focus('AccountList'); } } br(1); start_table(TABLESTYLE2); if ($selected_account != "") { //editing an existing account $myrow = get_gl_account($selected_account); $_POST['account_code'] = $myrow["account_code"]; $_POST['account_code2'] = $myrow["account_code2"]; $_POST['account_name'] = $myrow["account_name"]; $_POST['account_type'] = $myrow["account_type"]; $_POST['inactive'] = $myrow["inactive"]; $tags_result = get_tags_associated_with_record(TAG_ACCOUNT, $selected_account); $tagids = array(); while ($tag = db_fetch($tags_result)) { $tagids[] = $tag['id']; } $_POST['account_tags'] = $tagids; hidden('account_code', $_POST['account_code']); hidden('selected_account', $selected_account); label_row(_("Account Code:"), $_POST['account_code']); } else { if (!isset($_POST['account_code'])) { $_POST['account_tags'] = array(); $_POST['account_code'] = $_POST['account_code2'] = ''; $_POST['account_name'] = $_POST['account_type'] = ''; $_POST['inactive'] = 0; }
display_footer_exit(); } // if it's a closed dimension can't edit it //if ($myrow["closed"] == 1) //{ // display_error(_("This dimension is closed and cannot be edited.")); // display_footer_exit(); //} $_POST['ref'] = $myrow["reference"]; $_POST['closed'] = $myrow["closed"]; $_POST['name'] = $myrow["name"]; $_POST['type_'] = $myrow["type_"]; $_POST['date_'] = sql2date($myrow["date_"]); $_POST['due_date'] = sql2date($myrow["due_date"]); $_POST['memo_'] = get_comments_string(ST_DIMENSION, $selected_id); $tags_result = get_tags_associated_with_record(TAG_DIMENSION, $selected_id); $tagids = array(); while ($tag = db_fetch($tags_result)) { $tagids[] = $tag['id']; } $_POST['dimension_tags'] = $tagids; hidden('ref', $_POST['ref']); label_row(_("Dimension Reference:"), $_POST['ref']); hidden('selected_id', $selected_id); } else { $_POST['dimension_tags'] = array(); ref_row(_("Dimension Reference:"), 'ref', '', $Refs->get_next(ST_DIMENSION)); } text_row_ex(_("Name") . ":", 'name', 50, 75); $dim = get_company_pref('use_dimension'); number_list_row(_("Type"), 'type_', null, 1, $dim);