diff options
author | wei <> | 2006-07-19 03:55:25 +0000 |
---|---|---|
committer | wei <> | 2006-07-19 03:55:25 +0000 |
commit | 0c16571c091f8c4c89ae18427b2c2994cd4cf3bb (patch) | |
tree | bd0186684f6291e735c585c1c36baee7046ae0e9 /demos/time-tracker/protected/pages/TimeTracker/ProjectDetails.php | |
parent | 63e66acd2ed45300d095d5428ebdfff7652070ea (diff) |
Add project details in time-tracker
Diffstat (limited to 'demos/time-tracker/protected/pages/TimeTracker/ProjectDetails.php')
-rw-r--r-- | demos/time-tracker/protected/pages/TimeTracker/ProjectDetails.php | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/demos/time-tracker/protected/pages/TimeTracker/ProjectDetails.php b/demos/time-tracker/protected/pages/TimeTracker/ProjectDetails.php new file mode 100644 index 00000000..16c10e6f --- /dev/null +++ b/demos/time-tracker/protected/pages/TimeTracker/ProjectDetails.php @@ -0,0 +1,35 @@ +<?php
+
+class ProjectDetails extends TPage
+{
+ private $allUsers = null;
+
+ public function onLoad($param)
+ {
+ if(!$this->IsPostBack)
+ {
+ $this->manager->DataSource = $this->getUsersWithRole('manager');
+ $this->manager->dataBind();
+ $this->members->DataSource = $this->getUsersWithRole('consultant');
+ $this->members->dataBind();
+ }
+ }
+
+ protected function getUsersWithRole($role)
+ {
+ if(is_null($this->allUsers))
+ {
+ $dao = $this->Application->Modules['daos']->getDao('UserDao');
+ $this->allUsers = $dao->getAllUsers();
+ }
+ $users = array();
+ foreach($this->allUsers as $user)
+ {
+ if($user->isInRole($role))
+ $users[] = $user->Name;
+ }
+ return $users;
+ }
+}
+
+?>
\ No newline at end of file |