got automatic timesheets working and summary of hours working.

Should be good to go but just following the procedure.
It doesn’t.  Records look like this:

{
            startDate: 10/12/14,
            endDate: 10/21/14,
            userId: 123,
            active: 1,
            revision: [ …]
            projectEntriesArray: [ {ProjectID, [S,M,T,W,T,F,S] (hours),  Comment, Approved?, type:2},
                                                {ProjectID, [S,M,T,W,T,F,S] (hours),  Comment, Approved?, type:2}

],
            type:1,
            generalComment: “I like working at this company”,
            concerns: “concerns for this week”
            submitted: true
}


The rows are only in the projectEntriesArray.  So if you query the Timesheet collection, you only get the overview records- you have to dig into the projectEntriesArray to find the row you want.  To do that, I used a rowID which I randomly generate to make sure I have the right row


From: Dan Iverson [mailto:notifications@github.com]
Sent: Tuesday, November 11, 2014 9:41 AM
To: lanceriechel/senior-project
Subject: Re: [senior-project] got automatic timesheets working and summary of hours working. (#8)


In client/activeTimesheets/activeDbService.js:

> @@ -17,10 +17,9 @@ ActiveDBService = {

>          return false;

>

>      },

> -    getActiveTimesheets: function(){

> -        return TimeSheet.find({});

> +    getActiveTimeSheetsForUser: function (userId) {

> +        return TimeSheet.find({"userID": userId, $or: [{Approved: "false"}, {active: 1}]});

>      },
What do you do when a row comes up? From: Teddy Sterne [mailto:notifications@github.com] Sent: Tuesday, November 11, 2014 9:40 AM To: lanceriechel/senior-project Cc: Iverson, Daniel A Subject: Re: [senior-project] got automatic timesheets working and summary of hours working. (#8<https://github.com/lanceriechel/senior-project/pull/8>) In client/activeTimesheets/activeDbService.js:
@@ -17,10 +17,9 @@ ActiveDBService = { return false; }, - getActiveTimesheets: function(){ - return TimeSheet.find({}); + getActiveTimeSheetsForUser: function (userId) { + return TimeSheet.find({"userID": userId, $or: [{Approved: "false"}, {active: 1}]}); },
I chose this way because it is possible for timesheets to only have the type 1 row. Because empty timesheets need to be shown on the front page i just check if the type 1 is present and if it is then I just hardcode 0 values for all the days. — Reply to this email directly or view it on GitHub<https://github.com/lanceriechel/senior-project/pull/8/files#r20153177>.

—
Reply to this email directly or view it on GitHub<https://github.com/lanceriechel/senior-project/pull/8/files#r20153275>.