You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ha...@apache.org on 2007/12/29 15:14:19 UTC
svn commit: r607416 -
/ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/EditWeekTimesheet.bsh
Author: hansbak
Date: Sat Dec 29 06:14:15 2007
New Revision: 607416
URL: http://svn.apache.org/viewvc?rev=607416&view=rev
Log:
make sure the screen is shown with demoadmin
Modified:
ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/EditWeekTimesheet.bsh
Modified: ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/EditWeekTimesheet.bsh
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/EditWeekTimesheet.bsh?rev=607416&r1=607415&r2=607416&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/EditWeekTimesheet.bsh (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/EditWeekTimesheet.bsh Sat Dec 29 06:14:15 2007
@@ -53,11 +53,17 @@
if (!UtilValidate.isEmpty(timesheets)) {
timesheet = timesheets.get(0);
} else {
- result = dispatcher.runSync("createTimesheetForThisWeek",
- UtilMisc.toMap("userLogin", userLogin, "partyId", partyId));
- timesheet = delegator.findByPrimaryKey("Timesheet", UtilMisc.toMap("timesheetId", result.get("timesheetId")));
+ if (security.hasPermission("WORKEFFORTMGR_CREATE", session)) {
+ result = dispatcher.runSync("createTimesheetForThisWeek",
+ UtilMisc.toMap("userLogin", userLogin, "partyId", partyId));
+ }
+ if (result != void && result.get("timesheetId") != null) {
+ timesheet = delegator.findByPrimaryKey("Timesheet", UtilMisc.toMap("timesheetId", result.get("timesheetId")));
+ }
}
}
+
+if (timesheet == null) return;
context.put("timesheet", timesheet);
context.put("weekNumber", UtilDateTime.weekNumber(timesheet.getTimestamp("fromDate")));