summaryrefslogtreecommitdiff
path: root/demos/time-tracker/protected/pages/TimeTracker/ProjectDetails.php
diff options
context:
space:
mode:
Diffstat (limited to 'demos/time-tracker/protected/pages/TimeTracker/ProjectDetails.php')
-rw-r--r--demos/time-tracker/protected/pages/TimeTracker/ProjectDetails.php35
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