By default, the timesheet project allows users to track weekly time spent for up to four different projects.
If you need to track time for more than four different projects or tasks, you can add more rows to the
timesheet.
1 Create
a new choice list for selecting projects. Copy the Project1 field and name it Project5.
2 Create
the input fields for the days of the week.
a Copy
the P1HRsMon field and name it P5HrsMon.
b Copy
P5HrsMon and name it P5HrsTue.
c Copy
P5HrsTue and name it P5HrsWed.
d Continue
until you have input fields for all seven days of the week.
3 Create
a field to hold the weekly total. Copy Proj1TotalWkHrs and name it Proj5TotalWkHrs.
4 Click
Apply to add the fields to the project.
1 In the
Web View Editor, click the timesheet view in the Project / View list.
2 Under
Fields, click the last field (Product4)
in the Export to View list. Click Attributes,
and delete the value of the Html code after control attribute.
3 Move
the new fields from the Available list to the Export
to View list.
The new fields are added to the end of the Export to View list. The order
of the fields does not matter.
4 Click
the last field in the Export to View list. Click Attributes,
and set the value of the Html code after control attribute to “-->”.
1 Open
timesheet.js in your favorite text editor. You can find this file in the folder:
CensusServer\CensusWeb\CUSTOMIZEDFILES\#Project#Timesheet\#AllWebViews#\Js
This is the file to edit if you want to add a row to all Web views of your timesheet project. If you want
to add rows to only certain Web views, you’ll need to create a new folder. For example:
CensusServer\CensusWeb\CUSTOMIZEDFILES
\#Project#Timesheet\#WebViews#Timesheets_MyTimesheets\Js
2 At the
top of the file, declare and initialize a variable that holds the ID of the new row:
var PROJ_FIVE_ID=4;
3 In the
WriteTimesheetGrid() function, create a new array that holds the row information,
and store this new array in m_arrTimesheet:
m_arrTimesheet[PROJ_FIVE_ID]=new Array(
"cbo_97_cbo_97_Project5"
+ INNER_ARRAY_SPLITTER + INNER_ARRAY_SPLITTER+ strProjComboOptions,
"nbr_98_nbr_98_P5HrsMon",
"nbr_99_nbr_99_P5HrsTue",
"nbr_100_nbr_100_P5HrsWed",
"nbr_101_nbr_101_P5HrsThu",
"nbr_102_nbr_102_P5HrsFri",
"nbr_103_nbr_103_P5HrsSat",
"nbr_104_nbr_104_P5HrsSun",
"nbr_105_nbr_105_Proj5TotalWkHrs"
+ INNER_ARRAY_SPLITTER + CONTROL_TYPE_TOTAL);
4 Use
the ID of the new row (PROJ_FIVE_ID) as an index into the m_arrTimesheet array.
In the new array, specify the names assigned to form controls in the generated HTML. These names are based
on the tBoundControlName, which you can find in the tblDtsFields
table of the project definitions database. For example, if the tBoundControlName
is cbo_97_Project5, then the form control name is cbo_97_cbo_97_Project5.
Add a call to GetTimesheetProjRow() for the new row. Put this call before
the call to GetTimesheetDayTotalRow().
// Calls to GetTimesheetProjRow() for previous rows
strHTML+=m_oTimesheet.GetTimesheetProjRow(
m_arrTimesheet[PROJ_FIVE_ID]
);
// call to GetTimesheetDayTotalRow()