X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=includes%2Fui%2Fdb_pager_view.inc;h=96609dc3afe1afefb983e613bf33020a5fbe8908;hb=7561718ee5113232ce917f63085d272884b0929c;hp=ce3ae3ddf6cc2ad184829e339e752a60df747db6;hpb=e45f20590c233b377d7159a014526e7072896ecd;p=fa-stable.git diff --git a/includes/ui/db_pager_view.inc b/includes/ui/db_pager_view.inc index ce3ae3dd..96609dc3 100644 --- a/includes/ui/db_pager_view.inc +++ b/includes/ui/db_pager_view.inc @@ -33,12 +33,14 @@ function navi_button($name, $value, $enabled=true, $icon = false) { function navi_button_cell($name, $value, $enabled=true, $align='left') { label_cell(navi_button($name, $value, $enabled), "align='$align'"); } + + //----------------------------------------------------------------------------- // // Sql paged table view. Call this function inside form. // function display_db_pager(&$pager) { - global $table_style, $use_popup_windows, $use_date_picker, $path_to_root; + global $path_to_root; $pager->select_records(); @@ -46,8 +48,9 @@ function display_db_pager(&$pager) { $headers = array(); foreach($pager->columns as $num_col=>$col) { - if (isset($col['head'])) { - if (!isset($col['ord'])) + // record status control column is displayed only when control checkbox is on + if (isset($col['head']) && ($col['type']!='inactive' || get_post('show_inactive'))) { + if (!isset($col['ord'])) $headers[] = $col['head']; else { $icon = (($col['ord'] == 'desc') ? 'sort_desc.gif' : @@ -58,8 +61,8 @@ function display_db_pager(&$pager) { } } /* show a table of records returned by the sql */ - start_table("$table_style width=$pager->width"); - table_header($headers, 'nowrap'); + start_table(TABLESTYLE, "width=$pager->width"); + table_header($headers); if($pager->header_fun) { // if set header handler start_row("class='{$pager->header_class}'"); @@ -98,7 +101,6 @@ function display_db_pager(&$pager) { } else $cell = ''; } - switch($coltype) { // format column case 'time': label_cell($cell, "width=40"); break; @@ -121,8 +123,14 @@ function display_db_pager(&$pager) { label_cell(''); else qty_cell($cell, false, isset($col['dec']) ? $col['dec'] : null); break; + case 'email': + email_cell($cell,isset( $col['align']) ? "align='" . $col['align'] . "'" : null); + break; case 'rate': label_cell(number_format2($cell, user_exrate_dec()), "align=center"); break; + case 'inactive': + if(get_post('show_inactive')) + $pager->inactive_control_cell($row); break; default: // case 'text': if (isset( $col['align'])) @@ -154,12 +162,16 @@ function display_db_pager(&$pager) { start_row("class='navibar'"); $colspan = count($pager->columns); + $inact = @$pager->inactive_ctrl==true + ? ' '.checkbox(null, 'show_inactive', null, true). _("Show also Inactive") : ''; if($pager->rec_count) { echo "