don't print sub total for one page result

zedzed - April 23, 2009 - 14:53
Project:Views Calc
Version:6.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed
Description

hi,

Sub total it's good functionality, but when view render has only one page, subtotal has the same data as total.
The sub total could be hidden.

this code works :
(file theme.inc, function template_preprocess_views_calc_table, line 163)

if($view->total_rows > $view->pager['items_per_page']) {
  $process_available = array('sub_totals', 'totals'); 
}else{
  $process_available = array('totals');
  $vars['sub_totals'] = array(); //if don't set, error in template
}

and replace line 165
foreach (array('sub_totals', 'totals') as $process) {

by
foreach ($process_available as $process) {

AttachmentSize
view_calc_hide_subtotal_on_single_page.patch630 bytes

#1

KarenS - April 23, 2009 - 18:34
Status:active» fixed

Good idea, committed. You didn't get a commit acknowledgment because I'm still learning how to do this on a Mac and I couldn't get the message working right, but thanks!

#2

zedzed - April 24, 2009 - 08:10

You're welcome

#3

System Message - May 8, 2009 - 08:20
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.