Changeset 20515

Show
Ignore:
Timestamp:
03/02/10 08:24:04 (5 months ago)
Author:
nilesh
Message:

implementation of schedule configuration in warning messages and work capture to an un-assigned task.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/core/src/net/project/view/pages/assignments/Timesheet.java

    r19945 r20515  
    2121import java.util.Calendar; 
    2222import java.util.Date; 
    23 import java.util.Iterator; 
    2423import java.util.List; 
    2524 
     
    4039import net.project.resource.AssignmentWorkCaptureHelper.DateLongName; 
    4140import net.project.resource.mvc.handler.AssignmentDate; 
     41import net.project.schedule.Schedule; 
    4242import net.project.security.SessionManager; 
    4343import net.project.util.DateFormat; 
     
    139139         
    140140        @Property 
    141         private boolean isAssignmentFound; 
     141        private boolean assignmentFound; 
    142142         
    143143        private int todayToHighlightCount = 0; 
     
    206206                        } 
    207207                        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                                } 
    212222                        } 
    213223                } 
  • trunk/core/web/html/assignments/Timesheet.tml

    r19969 r20515  
    77                                <tr> 
    88                                        <td width="100%" nowrap="nowrap"> 
    9                                                 <t:if test="isAssignmentFound"> 
     9                                                <t:if test="assignmentFound"> 
    1010                                                <div id="entry-time"> 
    1111                                                        <span class="title" width="100%"><t:Message value="prm.blog.timesheet.timeentry.title"/></span> 
  • trunk/core/web/html/workplan/TaskView.tml

    r20473 r20515  
    7979var workPlanLoaded = false; 
    8080var isAutoEndPointCalculateSchedule = ${taskListPage.schedule.autocalculateTaskEndpoints}; 
     81var warningEnable = ${taskListPage.schedule.editingWarning}; 
    8182var userDateFormatString = '${user.dateFormatter.dateFormatExample}'; 
    8283var isBlogEnabled = <t:Message value="prm.blog.isenabled"/>; 
  • trunk/core/web/src/ScheduleMain.js

    r20491 r20515  
    149149        //First initialize data length 
    150150        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 
     176function 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();        
    183184                                return; 
     185                        }else{ 
     186                                //OK update the tasksheet. 
     187                                updateInformation(scheduleInfo, taskData); 
    184188                        } 
    185                         //No warning update the tasksheet. 
    186                         updateInformation(scheduleInfo, taskData); 
    187                 } 
    188         } 
     189                }, 
     190           icon: Ext.MessageBox.WARNING 
     191        }); 
    189192} 
    190193 
     
    506509                //For work complete and work percent complete, we need to show one warning message. if task has any assignment. 
    507510                 
    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"){ 
    509512                        Ext.Msg.show({ 
    510513                           title:workPlanWarningTitle, 
     
    16391642                                if(document.getElementById('blogPopupScreen') != null) 
    16401643                                        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                                } 
    16431652                                warningWindow.destroy(); 
    16441653                        }}, 
     
    16481657                                if(selected_option == 1){ 
    16491658                                        submitParameter( '{"makeWorkingDay":"true", "newDateToChange":"'+info.editedDate+'","taskId":"'+currentEntryID+'","action":"'+ (currentField == "sd" ? "startDateChanged" : "endDateChanged") +'"}');                                                    
    1650                                 } else { 
    1651                                         updateInformation(info, taskData); 
    16521659                                } 
    16531660                                warningWindow.hide();