From 63e66acd2ed45300d095d5428ebdfff7652070ea Mon Sep 17 00:00:00 2001 From: wei <> Date: Tue, 18 Jul 2006 23:41:18 +0000 Subject: Add mappings for time-tracker --- .gitattributes | 5 + .../protected/App_Data/mysql-maps/category.xml | 93 +++++++++++++ .../protected/App_Data/mysql-maps/projects.xml | 154 +++++++++++++++++++++ .../protected/App_Data/mysql-maps/reports.xml | 45 ++++++ .../protected/App_Data/mysql-maps/time-entry.xml | 91 ++++++++++++ .../protected/App_Data/mysql-maps/users.xml | 137 ++++++++++++++++++ 6 files changed, 525 insertions(+) create mode 100644 demos/time-tracker/protected/App_Data/mysql-maps/category.xml create mode 100644 demos/time-tracker/protected/App_Data/mysql-maps/projects.xml create mode 100644 demos/time-tracker/protected/App_Data/mysql-maps/reports.xml create mode 100644 demos/time-tracker/protected/App_Data/mysql-maps/time-entry.xml create mode 100644 demos/time-tracker/protected/App_Data/mysql-maps/users.xml diff --git a/.gitattributes b/.gitattributes index d987f37a..f6f4d0a7 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1078,6 +1078,11 @@ demos/time-tracker/protected/App_Code/UserManager.php -text demos/time-tracker/protected/App_Code/UserReport.php -text demos/time-tracker/protected/App_Code/UserReportsDao.php -text demos/time-tracker/protected/App_Code/exceptions.txt -text +demos/time-tracker/protected/App_Data/mysql-maps/category.xml -text +demos/time-tracker/protected/App_Data/mysql-maps/projects.xml -text +demos/time-tracker/protected/App_Data/mysql-maps/reports.xml -text +demos/time-tracker/protected/App_Data/mysql-maps/time-entry.xml -text +demos/time-tracker/protected/App_Data/mysql-maps/users.xml -text demos/time-tracker/protected/App_Data/mysql-reset.sql -text demos/time-tracker/protected/App_Data/mysql-sqlmap.xml -text demos/time-tracker/protected/App_Data/project.xml -text diff --git a/demos/time-tracker/protected/App_Data/mysql-maps/category.xml b/demos/time-tracker/protected/App_Data/mysql-maps/category.xml new file mode 100644 index 00000000..f2b7b21c --- /dev/null +++ b/demos/time-tracker/protected/App_Data/mysql-maps/category.xml @@ -0,0 +1,93 @@ + + + + + + + + + + + + + + INSERT INTO categories + (Name, ProjectID, Abbreviation, EstimateDuration) + VALUES(#Name#, #ProjectID#, #Abbreviation#, #EstimateDuration#) + + select LAST_INSERT_ID() as value + + + + + + + + + DELETE FROM categories WHERE CategoryID = #value# + + + + + + + + UPDATE categories SET + Abbreviation = #Abbreviation#, + EstimateDuration = #EstimateDuration#, + Name = #Name#, + ProjectId = #ProjectID# + WHERE + CategoryID = #ID# + + + \ No newline at end of file diff --git a/demos/time-tracker/protected/App_Data/mysql-maps/projects.xml b/demos/time-tracker/protected/App_Data/mysql-maps/projects.xml new file mode 100644 index 00000000..8fa28b64 --- /dev/null +++ b/demos/time-tracker/protected/App_Data/mysql-maps/projects.xml @@ -0,0 +1,154 @@ + + + + + + + + + + + + + + + + + + + INSERT INTO project + (Name, Description, CreationDate, EstimateDuration, CompletionDate, CreatorID, ManagerID) + VALUES + (#Name#, #Description#, NOW(), #EstimateDuration#, + #CompletionDate, typeHandler=DateTime#, + #CreatorUserName#, #ManagerUserName#) + + select LAST_INSERT_ID() as value + + + + + + + + + + + + + UPDATE project SET Disabled = 1 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#, + Description = #Description#, + EstimateDuration = #EstimateDuration#, + ManagerId =#ManagerUserName#, + Name = #Name# + WHERE + ProjectID = #ID# + + + \ No newline at end of file diff --git a/demos/time-tracker/protected/App_Data/mysql-maps/reports.xml b/demos/time-tracker/protected/App_Data/mysql-maps/reports.xml new file mode 100644 index 00000000..83f922d0 --- /dev/null +++ b/demos/time-tracker/protected/App_Data/mysql-maps/reports.xml @@ -0,0 +1,45 @@ + + + + + + + + + + \ 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 new file mode 100644 index 00000000..2708a6c5 --- /dev/null +++ b/demos/time-tracker/protected/App_Data/mysql-maps/time-entry.xml @@ -0,0 +1,91 @@ + + + + + INSERT INTO time_entry( + EntryCreated, + Duration, + Description, + CategoryID, + EntryDate, + CreatorID, + UserID + ) + VALUES( + NOW(), + #Duration#, + #Description#, + #Category.ID#, + #ReportDate, typeHandler=DateTime#, + #CreatorUserName#, + #Username# + ) + + select LAST_INSERT_ID() as value + + + + + + + + + + + + + + + + + + DELETE FROM time_entry WHERE EntryID = #value# + + + + + + UPDATE time_entry SET + Duration = #Duration#, + Description = #Description#, + CategoryID = #Category.ID#, + EntryDate = #ReportDate, typeHandler=DateTime#, + UserID = #Username# + WHERE + EntryID = #ID# + + + + + \ No newline at end of file diff --git a/demos/time-tracker/protected/App_Data/mysql-maps/users.xml b/demos/time-tracker/protected/App_Data/mysql-maps/users.xml new file mode 100644 index 00000000..6053c7ea --- /dev/null +++ b/demos/time-tracker/protected/App_Data/mysql-maps/users.xml @@ -0,0 +1,137 @@ + + + + + + + + + + + + + + + + + + + + + + + + + INSERT INTO + users (Username, Password, EmailAddress) + VALUES + (#user.Name#, #password#, #user.EmailAddress#) + + + + UPDATE users SET Disabled = 1 WHERE username = #value# + + + + INSERT INTO + signon (SessionToken, Username, LastSignOnDate) + VALUES + (#token#, #username#, NOW()) + + + + + + UPDATE signon SET LastSignOnDate = NOW() + WHERE SessionToken = #value# + + + + DELETE FROM user_roles WHERE UserID = #Name# + + + + INSERT INTO user_roles (UserID, RoleType) + VALUES(#username#, #role#) + + + + UPDATE users + SET EmailAddress = #EmailAddress# + WHERE Username = #Name# + + + + UPDATE users + SET EmailAddress = #user.EmailAddress#, Password=#password# + WHERE Username = #user.Name# + + + + DELETE FROM signon WHERE Username = #value# + + + + DELETE FROM signon + + + \ No newline at end of file -- cgit v1.2.3