X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=includes%2Fui%2Fdb_pager_view.inc;h=4bc49948dc312bae82ff99a40624a22f793bd908;hb=510d6e1925c4d1621ae3efd85e117cc9bb4320f0;hp=4367dc98539a06bf1c42c692e31549773bd2b022;hpb=a5242af68e65661edb7175412444dce536a7f311;p=fa-stable.git diff --git a/includes/ui/db_pager_view.inc b/includes/ui/db_pager_view.inc index 4367dc98..4bc49948 100644 --- a/includes/ui/db_pager_view.inc +++ b/includes/ui/db_pager_view.inc @@ -14,12 +14,11 @@ function pager_link($link_text, $url, $icon=false) { global $path_to_root; - $link = access_string($link_text); if (user_graphic_links() && $icon) - $link[0] = set_icon($icon, $link[0]); + $link_text = set_icon($icon, $link_text); $href = $path_to_root . $url; - return "" . $link[0] . ""; + return "" . $link_text . ""; } function navi_button($name, $value, $enabled=true, $icon = false) { @@ -34,6 +33,8 @@ 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. @@ -47,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' : @@ -60,7 +62,7 @@ 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'); + table_header($headers); if($pager->header_fun) { // if set header handler start_row("class='{$pager->header_class}'"); @@ -99,14 +101,13 @@ function display_db_pager(&$pager) { } else $cell = ''; } - switch($coltype) { // format column case 'time': label_cell($cell, "width=40"); break; case 'date': - label_cell(sql2date($cell), "align='center' width=50"); break; + label_cell(sql2date($cell), "align='center' nowrap"); break; case 'dstamp': // time stamp displayed as date - label_cell(sql2date(substr($cell, 0, 10)), "align='center'"); break; + label_cell(sql2date(substr($cell, 0, 10)), "align='center' nowrap"); break; case 'tstamp': // time stamp - FIX user format label_cell(sql2date(substr($cell, 0, 10)). ' '. substr($cell, 10), "align='center'"); break; @@ -122,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'])) @@ -153,45 +160,18 @@ function display_db_pager(&$pager) { end_row(); } - //end_table(); - //start_table("$table_style align='center' class='navibar' width=100%"); - /* - start_row("class='navibar'"); - $colspan = count($pager->columns); - if($pager->rec_count) { - $from = ($pager->curr_page-1)*$pager->page_len+1; - $to = $from + $pager->page_len - 1; - if ($to > $pager->rec_count) - $to = $pager->rec_count; - $all = $pager->rec_count; - $lcols = ($colspan > 4 ? 3 : 2); - label_cell(sprintf( _('Records %d-%d of %d'), $from, $to, $all), - "colspan=$lcols class='navibar' style='border:none'"); - //echo "