The first
task is to get the target date of the project in a displayable MM/DD/YYYY format. Next, we
need to determine whether the user is assigned to the project or not, and we know from our
previous experience that there??™s an isUserAssignedToProject() method in the timekeeper
object that will tell us this, so we??™re golden here.
Creating the Project Overview Summary Table on the Home Page
Next up is the first table creation, which is for the project overview summary on the home
page:
var cellFuncs = [
function(data) { return data.split("~~")[0]; },
function(data) { return data.split("~~")[1]; },
CHAPTER 9 n TIMEKEEPER: DWR EVEN MAKES PROJECT MANAGEMENT FUN! 496
...SNIP...
];
if (timekeeper.currentUser.isAdministrator ||
timekeeper.currentUser.id == project.projectManager ||
isUserAssignedToProject) {
dwr.util.addRows("divHome_projectOverviewList",
[
project.name + " ~~" +
timekeeper.getUserByID(
project.projectManager).username + "~~" +
project.allocatedHours + "~~" +
project.bookedHours + "~~" +
targetDate + "~~" +
timekeeper.calculateProjectStatus(project.allocatedHours,
project.bookedHours, project.targetDate) + ""
],
cellFuncs,
{ escapeHtml : false, altRow : altRow,
rowCreator : function(inOptions) {
var cn = null;
if (inOptions.
Pages:
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843