From 994065ffd524ade2db3de900226143f5123c5fb1 Mon Sep 17 00:00:00 2001 From: wei <> Date: Fri, 28 Jul 2006 06:24:40 +0000 Subject: Update time-tracker --- .../protected/pages/TimeTracker/ReportProject.php | 47 ++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 demos/time-tracker/protected/pages/TimeTracker/ReportProject.php (limited to 'demos/time-tracker/protected/pages/TimeTracker/ReportProject.php') diff --git a/demos/time-tracker/protected/pages/TimeTracker/ReportProject.php b/demos/time-tracker/protected/pages/TimeTracker/ReportProject.php new file mode 100644 index 00000000..fea372be --- /dev/null +++ b/demos/time-tracker/protected/pages/TimeTracker/ReportProject.php @@ -0,0 +1,47 @@ +Application->Modules['daos']->getDao('ProjectDao'); + $projects = array(); + foreach($projectDao->getAllProjects() as $project) + $projects[$project->ID] = $project->Name; + return $projects; + } + + public function onLoad($param) + { + if(!$this->IsPostBack) + { + $this->projectList->DataSource = $this->getProjects(); + $this->dataBind(); + } + } + + public function generateReport_Clicked($sender, $param) + { + $reportDao = $this->Application->Modules['daos']->getDao('ReportDao'); + $reports = $reportDao->getTimeReportsByProjectIDs($this->projectList->SelectedValues); + $this->views->ActiveViewIndex = 1; + $this->projects->DataSource = $reports; + $this->projects->dataBind(); + } + + public function project_itemCreated($sender, $param) + { + $item = $param->Item; + if($item->ItemType==='Item' || $item->ItemType==='AlternatingItem') + $item->category->DataSource = $item->DataItem->Categories; + } + + public function category_itemCreated($sender, $param) + { + $item = $param->Item; + if($item->ItemType==='Item' || $item->ItemType==='AlternatingItem') + $item->members->DataSource = $item->DataItem->members; + } +} + +?> \ No newline at end of file -- cgit v1.2.3