svn commit: r607416 - /ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/EditWeekTimesheet.bsh

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r607416 - /ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/EditWeekTimesheet.bsh

hansbak-2
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")));