diff options
Diffstat (limited to 'demos')
-rw-r--r-- | demos/time-tracker/protected/App_Code/UserDao.php | 2 | ||||
-rw-r--r-- | demos/time-tracker/protected/pages/TimeTracker/ProjectDetails.page | 44 | ||||
-rw-r--r-- | demos/time-tracker/protected/pages/TimeTracker/ProjectDetails.php | 35 | ||||
-rw-r--r-- | demos/time-tracker/tests/unit/TimeEntryDaoTestCase.php | 9 | ||||
-rw-r--r-- | demos/time-tracker/themes/TimeTracker/bar.png | bin | 0 -> 344 bytes | |||
-rw-r--r-- | demos/time-tracker/themes/TimeTracker/project.css | 70 |
6 files changed, 155 insertions, 5 deletions
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 @@ <com:TContent ID="Main">
-<h1>Project Details</h1>
+<h1>Create New Project</h1>
+
+<fieldset class="project"><legend>Project Configuration</legend>
+ <p>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 <tt>SAVE</tt> button at the bottom for your configuration
+ to take effect.</p>
+ <div class="projectInfo">
+ <h2>Project Information</h2>
+ <div class="projectName">
+ <com:TLabel ForControl="projectName" Text="Project Name"/>
+ <com:TTextBox ID="projectName" />
+ </div>
+ <div class="manager">
+ <com:TLabel ForControl="manager" Text="Project Manager" />
+ <com:TDropDownList ID="manager" />
+ </div>
+ <div class="completionDate">
+ <com:TLabel ForControl="completionDate" Text="Estimated complete date:"/>
+ <com:TDatePicker ID="completionDate" InputMode="DropDownList" />
+ </div>
+ <div class="estimateHours">
+ <com:TLabel ForControl="estimateHours" Text="Estimated Duration (in hours):"/>
+ <com:TTextBox ID="estimateHours" />
+ </div>
+ <div class="description">
+ <com:TLabel ForControl="description" Text="Description:" />
+ <com:TTextBox ID="description" TextMode="MultiLine" />
+ </div>
+ </div>
+
+ <div class="projectMembers">
+ <h2>Specify Project Members</h2>
+ <p>Select a resource. Use ctrl+click to select multiple resources at once:</p>
+ <com:TListBox ID="members" SelectionMode="Multiple" />
+ </div>
+
+ <div class="actionButtons">
+ <com:TButton Text="Save" />
+ <com:TButton Text="Cancel" />
+ <com:TButton Text="Delete" />
+ </div>
+ </fieldset>
</com:TContent>
\ 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 @@ +<?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 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 Binary files differnew file mode 100644 index 00000000..571641c9 --- /dev/null +++ b/demos/time-tracker/themes/TimeTracker/bar.png 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 |