[eGroupWare-svn] r56002 - /trunk/timesheet/inc/class.timesheet_ui.inc.php
[email protected] Tue, 03 May 2016 22:18:53 -0000
| Newsgroups | gmane.comp.web.egroupware.cvs |
|---|---|
| Message-ID | <[email protected]> |
Author: nathangray
Date: Wed May 4 00:18:49 2016
New Revision: 56002
URL: http://svn.stylite.de/viewvc/egroupware?rev=56002&view=rev
Log:
Calculate totals all the time
Modified:
trunk/timesheet/inc/class.timesheet_ui.inc.php
Modified: trunk/timesheet/inc/class.timesheet_ui.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/timesheet/inc/class.timesheet_ui.inc.php?rev=56002&r1=56001&r2=56002&view=diff
==============================================================================
--- trunk/timesheet/inc/class.timesheet_ui.inc.php (original)
+++ trunk/timesheet/inc/class.timesheet_ui.inc.php Wed May 4 00:18:49 2016
@@ -471,47 +471,45 @@
function get_rows(&$query_in,&$rows,&$readonlys,$id_only=false)
{
$this->show_sums = false;
- if ($query_in['filter'])
- {
- $query_in['enddate'] = $query_in['enddate'] ? $query_in['enddate'] : time();
- $date_filter = $this->date_filter($query_in['filter'],$query_in['startdate'],$query_in['enddate']);
-
- if ($query_in['startdate'])
- {
- $start = explode('-',date('Y-m-d',$query_in['startdate']+12*60*60));
- $end = explode('-',date('Y-m-d',$query_in['enddate'] ? $query_in['enddate'] : $query_in['startdate']+7.5*24*60*60));
-
- // show year-sums, if we are year-aligned (show full years)?
- if ((int)$start[2] == 1 && (int)$start[1] == 1 && (int)$end[2] == 31 && (int)$end[1] == 12)
- {
- $this->show_sums[] = 'year';
- }
- // show month-sums, if we are month-aligned (show full monthes)?
- if ((int)$start[2] == 1 && (int)$end[2] == (int)date('d',mktime(12,0,0,$end[1]+1,0,$end[0])))
- {
- $this->show_sums[] = 'month';
- }
- // show week-sums, if we are week-aligned (show full weeks)?
- $week_start_day = $GLOBALS['egw_info']['user']['preferences']['calendar']['weekdaystarts'];
- if (!$week_start_day) $week_start_day = 'Sunday';
- switch($week_start_day)
- {
- case 'Sunday': $week_end_day = 'Saturday'; break;
- case 'Monday': $week_end_day = 'Sunday'; break;
- case 'Saturday': $week_end_day = 'Friday'; break;
- }
- $filter_start_day = date('l',$query_in['startdate']+12*60*60);
- $filter_end_day = $query_in['enddate'] ? date('l',$query_in['enddate']+12*60*60) : false;
- //echo "<p align=right>prefs: $week_start_day - $week_end_day, filter: $filter_start_day - $filter_end_day</p>\n";
- if ($filter_start_day == $week_start_day && (!$filter_end_day || $filter_end_day == $week_end_day))
- {
- $this->show_sums[] = 'week';
- }
- // show day-sums, if range <= 5 weeks
- if (!$query_in['enddate'] || $query_in['enddate'] - $query_in['startdate'] < 36*24*60*60)
- {
- $this->show_sums[] = 'day';
- }
+
+ $query_in['enddate'] = $query_in['enddate'] ? $query_in['enddate'] : time();
+ $date_filter = $this->date_filter($query_in['filter'],$query_in['startdate'],$query_in['enddate']);
+
+ if ($query_in['startdate'])
+ {
+ $start = explode('-',date('Y-m-d',$query_in['startdate']+12*60*60));
+ $end = explode('-',date('Y-m-d',$query_in['enddate'] ? $query_in['enddate'] : $query_in['startdate']+7.5*24*60*60));
+
+ // show year-sums, if we are year-aligned (show full years)?
+ if ((int)$start[2] == 1 && (int)$start[1] == 1 && (int)$end[2] == 31 && (int)$end[1] == 12)
+ {
+ $this->show_sums[] = 'year';
+ }
+ // show month-sums, if we are month-aligned (show full monthes)?
+ if ((int)$start[2] == 1 && (int)$end[2] == (int)date('d',mktime(12,0,0,$end[1]+1,0,$end[0])))
+ {
+ $this->show_sums[] = 'month';
+ }
+ // show week-sums, if we are week-aligned (show full weeks)?
+ $week_start_day = $GLOBALS['egw_info']['user']['preferences']['calendar']['weekdaystarts'];
+ if (!$week_start_day) $week_start_day = 'Sunday';
+ switch($week_start_day)
+ {
+ case 'Sunday': $week_end_day = 'Saturday'; break;
+ case 'Monday': $week_end_day = 'Sunday'; break;
+ case 'Saturday': $week_end_day = 'Friday'; break;
+ }
+ $filter_start_day = date('l',$query_in['startdate']+12*60*60);
+ $filter_end_day = $query_in['enddate'] ? date('l',$query_in['enddate']+12*60*60) : false;
+ //echo "<p align=right>prefs: $week_start_day - $week_end_day, filter: $filter_start_day - $filter_end_day</p>\n";
+ if ($filter_start_day == $week_start_day && (!$filter_end_day || $filter_end_day == $week_end_day))
+ {
+ $this->show_sums[] = 'week';
+ }
+ // show day-sums, if range <= 5 weeks
+ if (!$query_in['enddate'] || $query_in['enddate'] - $query_in['startdate'] < 36*24*60*60)
+ {
+ $this->show_sums[] = 'day';
}
}
//echo "<p align=right>show_sums=".print_r($this->show_sums,true)."</p>\n";
@@ -785,15 +783,9 @@
if ($query['col_filter']['ts_owner']) $rows['ownerClass'] = 'noPrint';
$rows['no_owner_col'] = $query['no_owner_col'];
if (!$rows['no_owner_col'] && $query['selectcols'] && !strpos($query['selectcols'],'ts_owner')) $rows['no_owner_col'] = 1;
- if ($query['filter'])
- {
- $rows += $this->summary;
- }
- else
- {
- // Clear summary
- $rows += array('duration'=>'','price'=>'','quantity'=>'');
- }
+
+ $rows += $this->summary;
+
$rows['pm_integration'] = $this->pm_integration;
$rows['ts_viewtype'] = $rows['no_ts_quantity'] = $rows['no_ts_unitprice'] = $rows['no_ts_total'] = $this->ts_viewtype == 'short';
if (!$rows['ts_viewtype'])
------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z