Changeset 20515
- Timestamp:
- 03/02/10 08:24:04 (5 months ago)
- Files:
-
- trunk/core/src/net/project/view/pages/assignments/Timesheet.java (modified) (4 diffs)
- trunk/core/web/html/assignments/Timesheet.tml (modified) (1 diff)
- trunk/core/web/html/workplan/TaskView.tml (modified) (1 diff)
- trunk/core/web/src/ScheduleMain.js (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/core/src/net/project/view/pages/assignments/Timesheet.java
r19945 r20515 21 21 import java.util.Calendar; 22 22 import java.util.Date; 23 import java.util.Iterator;24 23 import java.util.List; 25 24 … … 40 39 import net.project.resource.AssignmentWorkCaptureHelper.DateLongName; 41 40 import net.project.resource.mvc.handler.AssignmentDate; 41 import net.project.schedule.Schedule; 42 42 import net.project.security.SessionManager; 43 43 import net.project.util.DateFormat; … … 139 139 140 140 @Property 141 private boolean isAssignmentFound;141 private boolean assignmentFound; 142 142 143 143 private int todayToHighlightCount = 0; … … 206 206 } 207 207 if(org.apache.commons.collections.CollectionUtils.isNotEmpty(assignments)){ 208 getModifiedTimeSheetEntries(objectId, assignments, getHttpServletRequest()); 209 isAssignmentFound = true; 210 }else{ 211 isAssignmentFound = false; 208 boolean dummayAssignment = false; 209 Schedule schedule = (Schedule) getSession().getAttribute("schedule"); 210 boolean unAssignedWorkCapture = schedule != null ? schedule.isUnAssignedWorkcapture() : false; 211 212 if(assignments.size() == 1){ 213 ScheduleEntryAssignment sea = (ScheduleEntryAssignment)assignments.get(0); 214 dummayAssignment = sea.getAssignorID() == null; 215 } 216 if(dummayAssignment && !unAssignedWorkCapture){ 217 assignmentFound = false; 218 }else{ 219 getModifiedTimeSheetEntries(objectId, assignments, getHttpServletRequest()); 220 assignmentFound = true; 221 } 212 222 } 213 223 } trunk/core/web/html/assignments/Timesheet.tml
r19969 r20515 7 7 <tr> 8 8 <td width="100%" nowrap="nowrap"> 9 <t:if test=" isAssignmentFound">9 <t:if test="assignmentFound"> 10 10 <div id="entry-time"> 11 11 <span class="title" width="100%"><t:Message value="prm.blog.timesheet.timeentry.title"/></span> trunk/core/web/html/workplan/TaskView.tml
r20473 r20515 79 79 var workPlanLoaded = false; 80 80 var isAutoEndPointCalculateSchedule = ${taskListPage.schedule.autocalculateTaskEndpoints}; 81 var warningEnable = ${taskListPage.schedule.editingWarning}; 81 82 var userDateFormatString = '${user.dateFormatter.dateFormatExample}'; 82 83 var isBlogEnabled = <t:Message value="prm.blog.isenabled"/>; trunk/core/web/src/ScheduleMain.js
r20491 r20515 149 149 //First initialize data length 150 150 var dataLength = parseInt(taskData.length); 151 if( dataLength > 1){ 152 //the last index contains schedule information 153 var scheduleInfo = eval("("+taskData[dataLength-1]+")"); 154 155 //Show warning message if schedule date changed. 156 if(scheduleInfo.scheduleDateChanged){ 157 Ext.Msg.show({ 158 title:workPlanWarningTitle, 159 msg: msgFormat.format(scheduleDateChangeWarningMsg, scheduleInfo.changeType, scheduleInfo.date), 160 buttons: Ext.Msg.OKCANCEL, 161 fn: function(btn){ 162 if(btn != 'ok'){ 163 revert(); 164 return; 165 }else{ 166 //Show warning if nonworking editing. 167 if(scheduleInfo.isNonworkingDay){ 168 initializeWarningWindow(scheduleInfo, taskData); 169 warningWindow.show(); 170 return; 171 } 172 //No warning update the tasksheet. 173 updateInformation(scheduleInfo, taskData); 174 } 175 }, 176 icon: Ext.MessageBox.WARNING 177 }); 178 }else{ 179 //Show warning if nonworking editing. 180 if(scheduleInfo.isNonworkingDay){ 181 initializeWarningWindow(scheduleInfo, taskData); 182 warningWindow.show(); 151 //If task data length is less then two just return from here. 152 //Since if any update it must have atleast length two, atleast one row update and schedule info. 153 if( dataLength < 2){ 154 return; 155 } 156 //the last index contains schedule information 157 var scheduleInfo = eval("("+taskData[dataLength-1]+")"); 158 159 //Show warning if nonworking day date editing. 160 if(warningEnable && scheduleInfo.isNonworkingDay){ 161 initializeWarningWindow(scheduleInfo, taskData); 162 warningWindow.show(); 163 return; 164 } 165 166 //Show warning message if schedule date changed. 167 if(warningEnable && scheduleInfo.scheduleDateChanged){ 168 showScheduleDateChagneWarning(scheduleInfo, taskData); 169 return; 170 } 171 172 //No warning, update the tasksheet. 173 updateInformation(scheduleInfo, taskData); 174 } 175 176 function showScheduleDateChagneWarning(scheduleInfo, taskData){ 177 Ext.Msg.show({ 178 title:workPlanWarningTitle, 179 msg: msgFormat.format(scheduleDateChangeWarningMsg, scheduleInfo.changeType, scheduleInfo.date), 180 buttons: Ext.Msg.OKCANCEL, 181 fn: function(btn){ 182 if(btn != 'ok'){ 183 revert(); 183 184 return; 185 }else{ 186 //OK update the tasksheet. 187 updateInformation(scheduleInfo, taskData); 184 188 } 185 //No warning update the tasksheet. 186 updateInformation(scheduleInfo, taskData); 187 } 188 } 189 }, 190 icon: Ext.MessageBox.WARNING 191 }); 189 192 } 190 193 … … 506 509 //For work complete and work percent complete, we need to show one warning message. if task has any assignment. 507 510 508 if( document.getElementById("has_assignment_"+currentEntryID)&& document.getElementById("has_assignment_"+currentEntryID).value=="true"){511 if(warningEnable && document.getElementById("has_assignment_"+currentEntryID)&& document.getElementById("has_assignment_"+currentEntryID).value=="true"){ 509 512 Ext.Msg.show({ 510 513 title:workPlanWarningTitle, … … 1639 1642 if(document.getElementById('blogPopupScreen') != null) 1640 1643 document.getElementsByTagName('body')[0].removeChild(blogPopupScreen); 1641 if(selected_option == 0) 1642 updateInformation(info, taskData); 1644 if(selected_option == 0){ 1645 if(warningEnable && info.scheduleDateChanged){ 1646 showScheduleDateChagneWarning(info, taskData); 1647 }else{ 1648 //No warning update the tasksheet. 1649 updateInformation(info, taskData); 1650 } 1651 } 1643 1652 warningWindow.destroy(); 1644 1653 }}, … … 1648 1657 if(selected_option == 1){ 1649 1658 submitParameter( '{"makeWorkingDay":"true", "newDateToChange":"'+info.editedDate+'","taskId":"'+currentEntryID+'","action":"'+ (currentField == "sd" ? "startDateChanged" : "endDateChanged") +'"}'); 1650 } else {1651 updateInformation(info, taskData);1652 1659 } 1653 1660 warningWindow.hide();
