From ff6db29dff9b4778b97d2234d08cdcc10770562a Mon Sep 17 00:00:00 2001 From: wei <> Date: Fri, 28 Jul 2006 06:26:05 +0000 Subject: Update time-tracker --- .../protected/App_Data/mysql-maps/category.xml | 12 +-- .../protected/App_Data/mysql-maps/projects.xml | 30 +++---- .../protected/App_Data/mysql-maps/reports.xml | 94 ++++++++++++++++------ .../protected/App_Data/mysql-maps/time-entry.xml | 42 +++++----- 4 files changed, 112 insertions(+), 66 deletions(-) (limited to 'demos/time-tracker') diff --git a/demos/time-tracker/protected/App_Data/mysql-maps/category.xml b/demos/time-tracker/protected/App_Data/mysql-maps/category.xml index f2b7b21c..66b0ae5f 100644 --- a/demos/time-tracker/protected/App_Data/mysql-maps/category.xml +++ b/demos/time-tracker/protected/App_Data/mysql-maps/category.xml @@ -10,7 +10,7 @@ - + INSERT INTO categories (Name, ProjectID, Abbreviation, EstimateDuration) VALUES(#Name#, #ProjectID#, #Abbreviation#, #EstimateDuration#) @@ -19,7 +19,7 @@ - SELECT categories.*, sum(time_entry.Duration) as ActualDuration @@ -34,7 +34,7 @@ categories.Name - SELECT categories.*, sum(time_entry.Duration) as ActualDuration @@ -51,7 +51,7 @@ DELETE FROM categories WHERE CategoryID = #value# - SELECT categories.*, sum(time_entry.Duration) as ActualDuration @@ -66,7 +66,7 @@ categories.Name - SELECT categories.*, sum(time_entry.Duration) as ActualDuration @@ -80,7 +80,7 @@ categories.CategoryID - + UPDATE categories SET Abbreviation = #Abbreviation#, EstimateDuration = #EstimateDuration#, diff --git a/demos/time-tracker/protected/App_Data/mysql-maps/projects.xml b/demos/time-tracker/protected/App_Data/mysql-maps/projects.xml index 8fa28b64..f087b864 100644 --- a/demos/time-tracker/protected/App_Data/mysql-maps/projects.xml +++ b/demos/time-tracker/protected/App_Data/mysql-maps/projects.xml @@ -1,7 +1,7 @@ - + @@ -13,11 +13,11 @@ - SELECT COUNT(Name) FROM project WHERE Name = #value# - + INSERT INTO project (Name, Description, CreationDate, EstimateDuration, CompletionDate, CreatorID, ManagerID) VALUES @@ -29,7 +29,7 @@ - SELECT project.ProjectID as ProjectID, project.Name as Name, @@ -52,7 +52,7 @@ project.Name - SELECT project.ProjectID as ProjectID, project.Name as Name, @@ -70,11 +70,13 @@ Disabled = 0 GROUP BY project.ProjectID - ORDER BY - project.Name - + ORDER BY $sort$ $order$ + + + - SELECT project.ProjectID as ProjectID, project.Name as Name, @@ -122,24 +124,24 @@ project.Name - + UPDATE project SET Disabled = 1 WHERE ProjectID = #value# - SELECT UserID FROM project_members WHERE ProjectID = #value# - + INSERT INTO project_members (UserID, ProjectID) VALUES(#username#, #project#) - + DELETE FROM project_members WHERE ProjectID = #project# AND UserID = #username# - + UPDATE project SET CompletionDate = #CompletionDate, typeHandler=DateTime#, diff --git a/demos/time-tracker/protected/App_Data/mysql-maps/reports.xml b/demos/time-tracker/protected/App_Data/mysql-maps/reports.xml index 83f922d0..4b537708 100644 --- a/demos/time-tracker/protected/App_Data/mysql-maps/reports.xml +++ b/demos/time-tracker/protected/App_Data/mysql-maps/reports.xml @@ -1,45 +1,87 @@ - + + + + + + - SELECT + categories.Name as CategoryName, categories.CategoryID as CategoryID, + project.ProjectID as ProjectID, + categories.EstimateDuration as CategoryEstimate, + project.Name as ProjectName, + project.EstimateDuration as ProjectEstimate, + project.CompletionDate as ProjectCompletion, time_entry.UserID as Username, SUM(time_entry.Duration) as ActualDuration FROM - time_entry, categories + project + LEFT JOIN categories ON categories.ProjectID = project.ProjectID + LEFT JOIN time_entry ON categories.CategoryID = time_entry.CategoryID WHERE - categories.CategoryID = time_entry.CategoryID - AND categories.CategoryID = #value# + project.ProjectID IN ( $value$ ) GROUP BY + categories.ProjectID, + categories.CategoryID, time_entry.UserID ORDER BY - categories.CategoryID - + project.ProjectID + + - SELECT - SUM(Duration) as TotalDuration - FROM - time_entry + users.Username, + project.Name as ProjectName, + categories.Name as CategoryName, + time_entry.Duration, + time_entry.Description, + time_entry.EntryDate + FROM + users + LEFT JOIN time_entry ON time_entry.UserID = users.Username + AND time_entry.EntryDate BETWEEN + #startDate, typeHandler=DateTime# AND + #endDate, typeHandler=DateTime# + LEFT JOIN categories ON time_entry.CategoryID = categories.CategoryID + LEFT JOIN project ON categories.ProjectID = project.ProjectID + AND project.ProjectID in ($projects$) WHERE - UserID = #value# + users.Username in ($members$) + ORDER BY + users.Username ASC, + time_entry.EntryDate ASC, + project.Name ASC, + categories.Name ASC \ No newline at end of file diff --git a/demos/time-tracker/protected/App_Data/mysql-maps/time-entry.xml b/demos/time-tracker/protected/App_Data/mysql-maps/time-entry.xml index 2708a6c5..841bd03e 100644 --- a/demos/time-tracker/protected/App_Data/mysql-maps/time-entry.xml +++ b/demos/time-tracker/protected/App_Data/mysql-maps/time-entry.xml @@ -1,7 +1,7 @@ - + INSERT INTO time_entry( EntryCreated, Duration, @@ -36,7 +36,23 @@ - SELECT * FROM @@ -49,9 +65,10 @@ DELETE FROM time_entry WHERE EntryID = #value# - SELECT - time_entry.* + time_entry.*, + categories.Name as CategoryName FROM time_entry, categories WHERE @@ -62,7 +79,7 @@ EntryID ASC - + UPDATE time_entry SET Duration = #Duration#, Description = #Description#, @@ -73,19 +90,4 @@ EntryID = #ID# - - \ No newline at end of file -- cgit v1.2.3