summaryrefslogtreecommitdiff
path: root/demos/time-tracker/protected/pages/TimeTracker/LogTimeEntry.php
diff options
context:
space:
mode:
Diffstat (limited to 'demos/time-tracker/protected/pages/TimeTracker/LogTimeEntry.php')
-rw-r--r--demos/time-tracker/protected/pages/TimeTracker/LogTimeEntry.php33
1 files changed, 18 insertions, 15 deletions
diff --git a/demos/time-tracker/protected/pages/TimeTracker/LogTimeEntry.php b/demos/time-tracker/protected/pages/TimeTracker/LogTimeEntry.php
index a134289c..28611c3c 100644
--- a/demos/time-tracker/protected/pages/TimeTracker/LogTimeEntry.php
+++ b/demos/time-tracker/protected/pages/TimeTracker/LogTimeEntry.php
@@ -88,21 +88,24 @@ class LogTimeEntry extends TPage
if(!$this->IsValid)
return;
- $entry = new TimeEntry;
- $entry->CreatorUserName = $this->User->Name;
- $category = new Category;
- $category->ID = $this->category->SelectedValue;
- $entry->Category = $category;
- $entry->Description = $this->description->Text;
- $entry->Duration = floatval($this->hours->Text);
- $entry->ReportDate = $this->day->TimeStamp;
- $entry->Username = $this->projectMembers->SelectedItem->Text;
-
- $this->hours->Text = '';
- $this->description->Text = '';
-
- $this->getTimeEntryDao()->addNewTimeEntry($entry);
- $this->showTimeSheet();
+ if($this->projectMembers->SelectedItem)
+ {
+ $entry = new TimeEntry;
+ $entry->CreatorUserName = $this->User->Name;
+ $category = new Category;
+ $category->ID = $this->category->SelectedValue;
+ $entry->Category = $category;
+ $entry->Description = $this->description->Text;
+ $entry->Duration = floatval($this->hours->Text);
+ $entry->ReportDate = $this->day->TimeStamp;
+ $entry->Username = $this->projectMembers->SelectedItem->Text;
+
+ $this->hours->Text = '';
+ $this->description->Text = '';
+
+ $this->getTimeEntryDao()->addNewTimeEntry($entry);
+ $this->showTimeSheet();
+ }
}
}