summaryrefslogtreecommitdiff
path: root/demos/time-tracker/protected/pages/TimeTracker/ReportResource.php
diff options
context:
space:
mode:
authorctrlaltca <>2012-07-12 11:21:01 +0000
committerctrlaltca <>2012-07-12 11:21:01 +0000
commit903ae8a581fac1e6917fc3e31d2ad8fb91df80c3 (patch)
treee08bf04f0823650a231227ac3499121270172a23 /demos/time-tracker/protected/pages/TimeTracker/ReportResource.php
parent3e4e6e66aeb3f8fea4e1eb4237498ef9d2358f63 (diff)
standardize the use of unix eol; use svn properties to enforce native eol
Diffstat (limited to 'demos/time-tracker/protected/pages/TimeTracker/ReportResource.php')
-rw-r--r--demos/time-tracker/protected/pages/TimeTracker/ReportResource.php140
1 files changed, 70 insertions, 70 deletions
diff --git a/demos/time-tracker/protected/pages/TimeTracker/ReportResource.php b/demos/time-tracker/protected/pages/TimeTracker/ReportResource.php
index 65283417..26644bc9 100644
--- a/demos/time-tracker/protected/pages/TimeTracker/ReportResource.php
+++ b/demos/time-tracker/protected/pages/TimeTracker/ReportResource.php
@@ -1,71 +1,71 @@
-<?php
-
-class ReportResource extends TPage
-{
- protected function getProjects()
- {
- $projectDao = $this->Application->Modules['daos']->getDao('ProjectDao');
- $projects = array();
- foreach($projectDao->getAllProjects() as $project)
- $projects[$project->ID] = $project->Name;
- return $projects;
- }
-
- protected function getUsers()
- {
- $dao = $this->Application->Modules['daos']->getDao('UserDao');
- $users = array();
- foreach($dao->getAllUsers() as $user)
- {
- $users[$user->Name] = $user->Name;
- }
- return $users;
- }
-
- public function onLoad($param)
- {
- if(!$this->IsPostBack)
- {
- $this->projectList->DataSource = $this->getProjects();
- $this->resourceList->DataSource = $this->getUsers();
- $this->dataBind();
- }
- }
-
- public function generateReport_Clicked($sender, $param)
- {
- if(count($this->projectList->SelectedValues) > 0
- && count($this->resourceList->SelectedValues) >0)
- {
- $this->showReport();
- }
- }
-
- protected function showReport()
- {
- $this->views->ActiveViewIndex = 1;
- $reportDao = $this->Application->Modules['daos']->getDao('ReportDao');
- $projects = $this->projectList->SelectedValues;
- $users = $this->resourceList->SelectedValues;
- $start = $this->dateFrom->TimeStamp;
- $end = $this->dateTo->TimeStamp;
-
- $report = $reportDao->getUserProjectTimeReports($users, $projects, $start, $end);
-
- $this->resource_report->DataSource = $report;
- $this->resource_report->dataBind();
- }
-
- public function resource_report_itemCreated($sender, $param)
- {
- $item = $param->Item;
- if($item->ItemType==='Item' || $item->ItemType==='AlternatingItem')
- {
- if(count($item->DataItem->Projects) > 0 &&
- $item->DataItem->Projects[0]->ProjectName !== null)
- $item->time_entries->DataSource = $item->DataItem->Projects;
- }
- }
-}
-
+<?php
+
+class ReportResource extends TPage
+{
+ protected function getProjects()
+ {
+ $projectDao = $this->Application->Modules['daos']->getDao('ProjectDao');
+ $projects = array();
+ foreach($projectDao->getAllProjects() as $project)
+ $projects[$project->ID] = $project->Name;
+ return $projects;
+ }
+
+ protected function getUsers()
+ {
+ $dao = $this->Application->Modules['daos']->getDao('UserDao');
+ $users = array();
+ foreach($dao->getAllUsers() as $user)
+ {
+ $users[$user->Name] = $user->Name;
+ }
+ return $users;
+ }
+
+ public function onLoad($param)
+ {
+ if(!$this->IsPostBack)
+ {
+ $this->projectList->DataSource = $this->getProjects();
+ $this->resourceList->DataSource = $this->getUsers();
+ $this->dataBind();
+ }
+ }
+
+ public function generateReport_Clicked($sender, $param)
+ {
+ if(count($this->projectList->SelectedValues) > 0
+ && count($this->resourceList->SelectedValues) >0)
+ {
+ $this->showReport();
+ }
+ }
+
+ protected function showReport()
+ {
+ $this->views->ActiveViewIndex = 1;
+ $reportDao = $this->Application->Modules['daos']->getDao('ReportDao');
+ $projects = $this->projectList->SelectedValues;
+ $users = $this->resourceList->SelectedValues;
+ $start = $this->dateFrom->TimeStamp;
+ $end = $this->dateTo->TimeStamp;
+
+ $report = $reportDao->getUserProjectTimeReports($users, $projects, $start, $end);
+
+ $this->resource_report->DataSource = $report;
+ $this->resource_report->dataBind();
+ }
+
+ public function resource_report_itemCreated($sender, $param)
+ {
+ $item = $param->Item;
+ if($item->ItemType==='Item' || $item->ItemType==='AlternatingItem')
+ {
+ if(count($item->DataItem->Projects) > 0 &&
+ $item->DataItem->Projects[0]->ProjectName !== null)
+ $item->time_entries->DataSource = $item->DataItem->Projects;
+ }
+ }
+}
+
?> \ No newline at end of file