SOURCES: eventum-reports-tt.patch - correct diff
glen
glen at pld-linux.org
Mon Apr 23 16:22:34 CEST 2007
Author: glen Date: Mon Apr 23 14:22:34 2007 GMT
Module: SOURCES Tag: HEAD
---- Log message:
- correct diff
---- Files affected:
SOURCES:
eventum-reports-tt.patch (1.2 -> 1.3)
---- Diffs:
================================================================
Index: SOURCES/eventum-reports-tt.patch
diff -u SOURCES/eventum-reports-tt.patch:1.2 SOURCES/eventum-reports-tt.patch:1.3
--- SOURCES/eventum-reports-tt.patch:1.2 Mon Apr 23 15:58:15 2007
+++ SOURCES/eventum-reports-tt.patch Mon Apr 23 16:22:29 2007
@@ -1,57 +1,50 @@
---- eventum-r3319.old/include/class.history.php 2007-04-23 16:41:31.705254000 +0300
-+++ eventum-r3319/include/class.history.php 2007-04-23 16:56:09.570910295 +0300
-@@ -271,7 +271,7 @@
- $details = Customer::getDetails($row["iss_prj_id"], $row["iss_customer_id"]);
- $row["customer_name"] = $details["customer_name"];
- }
-- $timeForIssue = Time_Tracking::getTimeSpentByIssueAndTime($row['iss_id'], $start, $end);
-+ $timeForIssue = Time_Tracking::getTimeSpentByIssueAndTime($row['iss_id'], $usr_id, $start, $end);
- $row['time_spent'] = Misc::getFormattedTime($timeForIssue, false);
-
- if (($separate_closed) && ($row['sta_is_closed'] == 1)) {
---- eventum-r3319.old/include/class.time_tracking.php 2007-04-23 16:41:31.709255000 +0300
-+++ eventum-r3319/include/class.time_tracking.php 2007-04-23 16:56:09.478906751 +0300
-@@ -548,17 +548,19 @@
- *
- * @access public
- * @param integer $issue_id The issue ID
-- * @param date $start The start date
-- * @param date $end The end date
-- * @return integer The total time spent
+--- old/include/class.time_tracking.php 2007-04-20 12:20:38.000000000 +0300
++++ new/include/class.time_tracking.php 2007-04-20 12:27:29.000000000 +0300
+@@ -541,6 +541,36 @@
+ return $res;
+ }
+ }
++
++ /**
++ * Method used to get the time spent for a specific issue
++ * at a specific time.
++ *
++ * @access public
++ * @param integer $issue_id The issue ID
+ * @param string $usr_id The ID of the user this report is for.
+ * @param integer The timestamp of the beginning of the report.
+ * @param integer The timestamp of the end of this report.
+ * @return integer The time spent
- */
-- function getTimeSpentByIssueAndTime($issue_id, $start, $end)
++ */
+ function getTimeSpentByIssueAndTime($issue_id, $usr_id, $start, $end)
- {
- $stmt = "SELECT
- SUM(ttr_time_spent)
- FROM
- " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "time_tracking
- WHERE
-+ ttr_usr_id = " . Misc::escapeInteger($usr_id) . " AND
- ttr_created_date BETWEEN '" . Misc::escapeString($start) . "' AND '" . Misc::escapeString($end) . "' AND
- ttr_iss_id=" . Misc::escapeInteger($issue_id);
- $res = $GLOBALS["db_api"]->dbh->getOne($stmt);
-@@ -569,9 +571,6 @@
- return $res;
- }
- }
--
--
--
++ {
++ $stmt = "SELECT
++ SUM(ttr_time_spent)
++ FROM
++ " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "time_tracking
++ WHERE
++ ttr_usr_id = " . Misc::escapeInteger($usr_id) . " AND
++ ttr_created_date BETWEEN '" . Misc::escapeString($start) . "' AND '" . Misc::escapeString($end) . "' AND
++ ttr_iss_id=" . Misc::escapeInteger($issue_id);
++ $res = $GLOBALS["db_api"]->dbh->getOne($stmt);
++ if (PEAR::isError($res)) {
++ Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);
++ return 0;
++ } else {
++ return $res;
++ }
++ }
}
// benchmarking the included file (aka setup time)
---- eventum-r3319.old/templates/reports/weekly.tpl.html 2007-04-23 16:41:31.545248000 +0300
-+++ eventum-r3319/templates/reports/weekly.tpl.html 2007-04-23 16:56:09.554909678 +0300
+
+--- old/templates/reports/weekly.tpl.html 2006-12-05 22:53:38.000000000 +0200
++++ new/templates/reports/weekly.tpl.html 2007-04-20 12:31:32.000000000 +0300
@@ -76,6 +76,11 @@
<input type="checkbox" name="ignore_statuses" value="1" class="default" {if $smarty.post.ignore_statuses == 1}checked{/if}>
<a id="link" class="link" href="javascript:void(null)"
onClick="javascript:toggleCheckbox('weekly_report', 'ignore_statuses', 0)">{t}Ignore Issue Status Changes{/t}</a>
-+ <br />
++ <br />
+ <input type="checkbox" name="show_per_issue" value="1" class="default" {if $smarty.post.show_per_issue == 1}checked{/if}>
+ <a id="link" class="link" href="javascript:void(null)"
+ onClick="javascript:toggleCheckbox('weekly_report', 'show_per_issue', 0)">{t}Show Times spent on issue{/t}</a>
@@ -59,13 +52,14 @@
</td>
</tr>
</table>
---- eventum-r3319.old/templates/reports/weekly_data.tpl.html 2007-04-23 16:41:31.709255000 +0300
-+++ eventum-r3319/templates/reports/weekly_data.tpl.html 2007-04-23 16:56:09.558909832 +0300
+
+--- old/templates/reports/weekly_data.tpl.html 2006-04-19 06:37:26.000000000 +0300
++++ new/templates/reports/weekly_data.tpl.html 2007-04-20 15:36:17.000000000 +0300
@@ -3,7 +3,8 @@
{$application_title} {t}issues worked on{/t}:
-
+
{section name=issue loop=$data.issues.other}
--{$data.issues.other[issue].iss_id|str_pad:4:" ":"STR_PAD_LEFT"} {$data.issues.other[issue].iss_summary|htmlspecialchars} ({$data.issues.other[issue].time_spent})
+-{$data.issues.other[issue].iss_id|str_pad:4:" ":"STR_PAD_LEFT"} {$data.issues.other[issue].iss_summary|htmlspecialchars}
+{$data.issues.other[issue].iss_id|str_pad:4:" ":"STR_PAD_LEFT"} {$data.issues.other[issue].iss_summary|htmlspecialchars} {if
+$smarty.post.show_per_issue == 1}({$data.issues.other[issue].time_spent}){/if}
{sectionelse}
@@ -73,7 +67,7 @@
{/section}
@@ -12,7 +13,8 @@
{t}Issues Closed{/t}:
-
+
{section name=issue loop=$data.issues.closed}
-{$data.issues.closed[issue].iss_id|str_pad:4:" ":"STR_PAD_LEFT"} {$data.issues.closed[issue].iss_summary|htmlspecialchars}
+{$data.issues.closed[issue].iss_id|str_pad:4:" ":"STR_PAD_LEFT"} {$data.issues.closed[issue].iss_summary|htmlspecialchars}{if
@@ -81,3 +75,16 @@
{sectionelse}
{t}No issues closed this time period{/t}
{/section}
+
+--- old/include/class.history.php 2007-04-20 12:20:39.000000000 +0300
++++ new/include/class.history.php 2007-04-20 12:25:41.000000000 +0300
+@@ -271,6 +271,9 @@
+ $details = Customer::getDetails($row["iss_prj_id"], $row["iss_customer_id"]);
+ $row["customer_name"] = $details["customer_name"];
+ }
++ $timeForIssue = Time_Tracking::getTimeSpentByIssueAndTime($row['iss_id'], $usr_id, $start, $end);
++ $row['time_spent'] = Misc::getFormattedTime($timeForIssue, false);
++
+ if (($separate_closed) && ($row['sta_is_closed'] == 1)) {
+ $data['closed'][] = $row;
+ } else {
================================================================
---- CVS-web:
http://cvs.pld-linux.org/SOURCES/eventum-reports-tt.patch?r1=1.2&r2=1.3&f=u
More information about the pld-cvs-commit
mailing list