From 0c16571c091f8c4c89ae18427b2c2994cd4cf3bb Mon Sep 17 00:00:00 2001 From: wei <> Date: Wed, 19 Jul 2006 03:55:25 +0000 Subject: Add project details in time-tracker --- demos/time-tracker/protected/App_Code/UserDao.php | 2 +- .../pages/TimeTracker/ProjectDetails.page | 44 ++++++++++++- .../protected/pages/TimeTracker/ProjectDetails.php | 35 +++++++++++ .../tests/unit/TimeEntryDaoTestCase.php | 9 ++- demos/time-tracker/themes/TimeTracker/bar.png | Bin 0 -> 344 bytes demos/time-tracker/themes/TimeTracker/project.css | 70 +++++++++++++++++++++ 6 files changed, 155 insertions(+), 5 deletions(-) create mode 100644 demos/time-tracker/protected/pages/TimeTracker/ProjectDetails.php create mode 100644 demos/time-tracker/themes/TimeTracker/bar.png create mode 100644 demos/time-tracker/themes/TimeTracker/project.css (limited to 'demos/time-tracker') diff --git a/demos/time-tracker/protected/App_Code/UserDao.php b/demos/time-tracker/protected/App_Code/UserDao.php index 6064be7e..6f31090d 100644 --- a/demos/time-tracker/protected/App_Code/UserDao.php +++ b/demos/time-tracker/protected/App_Code/UserDao.php @@ -51,7 +51,7 @@ class UserDao extends BaseDao $sqlmap = $this->getConnection(); return $sqlmap->queryForList('GetAllUsers'); } - + /** * @param TimeTrackerUser new user details. * @param string new user password. diff --git a/demos/time-tracker/protected/pages/TimeTracker/ProjectDetails.page b/demos/time-tracker/protected/pages/TimeTracker/ProjectDetails.page index a8a7d1d3..2a7cb6dd 100644 --- a/demos/time-tracker/protected/pages/TimeTracker/ProjectDetails.page +++ b/demos/time-tracker/protected/pages/TimeTracker/ProjectDetails.page @@ -1,4 +1,46 @@ -

Project Details

+

Create New Project

+ +
Project Configuration +

Define the project and specify which users will be part of the project. + Then add categories to the project to help keep track of specific areas of + product. Press the SAVE button at the bottom for your configuration + to take effect.

+
+

Project Information

+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ +
+

Specify Project Members

+

Select a resource. Use ctrl+click to select multiple resources at once:

+ +
+ +
+ + + +
+
\ No newline at end of file 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 @@ +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 diff --git a/demos/time-tracker/tests/unit/TimeEntryDaoTestCase.php b/demos/time-tracker/tests/unit/TimeEntryDaoTestCase.php index 29e3ba67..20b1266e 100644 --- a/demos/time-tracker/tests/unit/TimeEntryDaoTestCase.php +++ b/demos/time-tracker/tests/unit/TimeEntryDaoTestCase.php @@ -155,7 +155,7 @@ class TimeEntryDaoTestCase extends BaseTestCase return array($entry, $entry2, $added); } -/* + function testCreateNewTimeEntry() { $added = $this->createTimeEntry1(); @@ -247,7 +247,7 @@ class TimeEntryDaoTestCase extends BaseTestCase $this->assertEqual($list[0]->Username, 'consultant'); $this->assertEqual($list[0]->ActualDuration, 1.2); } -*/ + function testTimeReportsByProject() { $added = $this->createTimeEntries2(); @@ -256,7 +256,10 @@ class TimeEntryDaoTestCase extends BaseTestCase $list = $this->reportDao->getTimeReportsByProjectID(1); - var_dump($list); + $this->assertEqual(count($list),1); + $this->assertEqual($list[0]->Username, 'consultant'); + $this->assertEqual($list[0]->CategoryID, 1); + $this->assertEqual($list[0]->ActualDuration, 6.7); } } diff --git a/demos/time-tracker/themes/TimeTracker/bar.png b/demos/time-tracker/themes/TimeTracker/bar.png new file mode 100644 index 00000000..571641c9 Binary files /dev/null and b/demos/time-tracker/themes/TimeTracker/bar.png differ diff --git a/demos/time-tracker/themes/TimeTracker/project.css b/demos/time-tracker/themes/TimeTracker/project.css new file mode 100644 index 00000000..7b6863a0 --- /dev/null +++ b/demos/time-tracker/themes/TimeTracker/project.css @@ -0,0 +1,70 @@ +fieldset.project label +{ + display: block; + font-size: 0.9em; + margin-bottom: 0.2em; +} + +.projectInfo +{ + width: 40%; + float: left; +} + +.projectMembers +{ + width: 40%; + float: left; + margin-left: 0.3em; +} + +fieldset.project h2 +{ + background-color: #D2E8E8; + font-size: 0.8em; + color: #4169E1; + padding: 0.65em; + text-align: center; + background-image: url(bar.png); + background-repeat: repeat-x; + background-position: center; +} + +.projectInfo div, .projectMembers div +{ + margin: 0.7em 0; +} + +.projectInfo div input, .projectInfo div.manager select +{ + width: 15em; +} + +.projectInfo .estimateHours input +{ + width: 4em; +} + +.projectInfo .description textarea +{ + width: 17em; + height: 10em; +} + +.projectMembers select +{ + width: 15em; + height: 17em; +} + +.actionButtons +{ + float: left; + width: 90%; + padding: 0.65em; + text-align: center; + background-color: #D2E8E8; + background-image: url(bar.png); + background-repeat: repeat-x; + background-position: center; +} \ No newline at end of file -- cgit v1.2.3