Changeset 18355

Show
Ignore:
Timestamp:
11/14/08 11:05:33 (2 months ago)
Author:
ritesh
Message:

Bug Fixes:
- bug428 Date field caption in New Assignment dialog is inappropriate
- bug323 No validation on the numeric characters for the Phone and the Mobile fields
- bug317 Double clicking a meeting opens the View assignment page instead of the Meeting page
- bug326 Invalid error message while the user who is Space Administrator of a business tries to remove himself
- bug498 Task with large number of hours gives error, but still appears on workplan
- bug478 Schedule Dates in Workplan not changed as per the Task created in Assignments page
- bug501 HTTP Status 404 error on choosing Add to Workflow in the form data page
- bug284 Improper alert message from assignment module

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/core/db/oracle/create-scripts/versions/8.5.0/update_system_properties.sql

    r18353 r18355  
    12051205values (2000, 'en', 'text', 'prm.project.process.deletedeliverable.label', '{@all.global.toolbar.channel.remove} Deliverable', 'A', 0, 1, null); 
    12061206 
    1207  
     1207insert into pn_property (CONTEXT_ID, LANGUAGE, PROPERTY_TYPE, PROPERTY, PROPERTY_VALUE, PROPERTY_VALUE_CLOB,RECORD_STATUS,IS_SYSTEM_PROPERTY,IS_TRANSLATABLE_PROPERTY)  
     1208values (2000,'en','text','prm.directory.resource.roster.removeperson.projectspaceadmingroup.message','You can not remove the last remaining member of the workspace administrator role. The project may only be disabled.','','A',0,1); 
     1209 
     1210insert into pn_property (CONTEXT_ID, LANGUAGE, PROPERTY_TYPE, PROPERTY, PROPERTY_VALUE, PROPERTY_VALUE_CLOB,RECORD_STATUS,IS_SYSTEM_PROPERTY,IS_TRANSLATABLE_PROPERTY)  
     1211values (2000,'en','text','prm.directory.resource.roster.removeperson.businessspaceadmingroup.message','You can not remove the last remaining member of the workspace administrator role. The business may only be disabled.','','A',0,1); 
    12081212 
    12091213commit; 
  • trunk/core/src/net/project/resource/AssignmentStoreDataFactory.java

    r18319 r18355  
    244244                                                        // +"','image': '"+ 
    245245                                                        // +"','link': '"+ 
     246                                                        + "','spaceId': '"+ assignment.getSpaceId() 
    246247                                                        + "','workSpace': '"+ assignment.getSpaceName().replaceAll("'", "´") 
    247248                                                        + "','objectId': '"+ assignment.getPnObjectName().getObjectId() 
  • trunk/core/src/net/project/resource/Roster.java

    r18057 r18355  
    2727 
    2828import net.project.base.DefaultDirectory; 
     29import net.project.base.ObjectType; 
    2930import net.project.base.property.PropertyProvider; 
    3031import net.project.database.DBBean; 
     
    669670                if (spaceAdmin.isMember(personID) && 
    670671                        spaceAdmin.getPersonMembers().size() == 1) { 
    671  
    672                     throw new PersistenceException(PropertyProvider.get("prm.directory.resource.roster.removeperson.spaceadmingroup.message")); 
     672                        if(space.getType().equals(ObjectType.PROJECT)){  
     673                                throw new PersistenceException(PropertyProvider.get("prm.directory.resource.roster.removeperson.projectspaceadmingroup.message")); 
     674                        }else{ 
     675                                throw new PersistenceException(PropertyProvider.get("prm.directory.resource.roster.removeperson.businessspaceadmingroup.message")); 
     676                        } 
    673677 
    674678                } 
  • trunk/core/src/net/project/view/pages/assignments/MyAssignments.java

    r18321 r18355  
    188188        private List<PnAssignment> assignments; 
    189189         
    190         private String userDateForamtString; 
     190        private String userDateFormatString; 
    191191         
    192192        private String startDisplayFrom; 
     
    266266                //Some user properties 
    267267                userDateFormat = SessionManager.getUser().getDateFormatter(); 
    268                 userDateForamtString = SessionManager.getUser().getDateFormatter().getDateFormatExample(); 
     268                userDateFormatString = SessionManager.getUser().getDateFormatter().getDateFormatExample(); 
    269269                userId = SessionManager.getUser().getID(); 
    270270                userDisplayName = SessionManager.getUser().getDisplayName().replaceAll("'", "&acute;"); 
     
    314314                                setAssignmentViewParameter(StringUtils.isNotEmpty(request.getParameter("view")) ? request 
    315315                                                .getParameter("view") : "indent"); 
     316                                return new TextStreamResponse("text", ""); 
    316317                        } else if (action.equalsIgnoreCase(AssignmentsAction.SETFILTERPARAMETER.toString())) { 
    317318                                setAllFilterParameter(request); 
     
    335336                                                        + request.getParameter("column"), PROPERTY, request.getParameter("value")); 
    336337                                } 
     338                                return new TextStreamResponse("text", ""); 
    337339                        } else if (action.equalsIgnoreCase(AssignmentsAction.SETGROUPINGPARAMETER.toString())){ 
    338340                                initializeGroupingParameter(request); 
     341                                return new TextStreamResponse("text", ""); 
    339342                        } else if (action.equalsIgnoreCase(AssignmentsAction.GETRESOURCESTOASSIGN.toString())){ 
    340343                                return getResourceAssignGridData(request); 
     
    343346                        } else if (action.equalsIgnoreCase(AssignmentsAction.REPLACEMYASSIGNMENTSPANELSTATE.toString())) { 
    344347                                replaceMyAssignmentsPanelPropetry(PANELCOLLAPSED_PROPERTY_CONTEXT, PROPERTY, request.getParameter("value")); 
     348                                return new TextStreamResponse("text", ""); 
    345349                        } else if (action.equalsIgnoreCase(AssignmentsAction.REPLACEMYASSIGNMENTSPANELRESIZESTATE.toString())) { 
    346350                                replaceMyAssignmentsPanelPropetry(PANELWIDTH_PROPERTY_CONTEXT, PROPERTY, request.getParameter("value")); 
     351                                return new TextStreamResponse("text", ""); 
    347352                        } else if (action.equalsIgnoreCase(AssignmentsAction.REPLACEMYASSIGNMENTSCOLUMNSIZE.toString())) { 
    348353                                replaceMyAssignmentsColumnSize(request); 
     354                                return new TextStreamResponse("text", ""); 
    349355                        } else if (action.equalsIgnoreCase(AssignmentsAction.GETTIMELINEDATA.toString())){ 
    350356                                return getTimeLineData();        
     
    685691                        scheduleEntry.setName(request.getParameter("taskName")); 
    686692                        scheduleEntry.setDescription(request.getParameter("taskDescription")); 
    687                         scheduleEntry.store(false, schedule); 
     693                        scheduleEntry.store(schedule.isAutocalculateTaskEndpoints(), schedule); 
    688694                        schedule.loadAll(); 
    689695                        ServiceFactory.getInstance().getAssignResourceService().assignResourcesToSingleTask(scheduleEntry, 
     
    761767                } 
    762768                JSONStringer jsonStringer = new JSONStringer(); 
    763                 //creaing and calculating schedule entry 
    764                 //IAddTaskService addTaskService = ServiceFactory.getInstance().getAddTaskService(); 
    765769                try { 
    766                         Date date = userDateFormat.parseDateString(dateString); 
    767                         scheduleEntry = addTaskService.reCalculateScheduleEntry(schedule, scheduleEntry, work, workUnit, date, calculateBy, SessionManager.getUser()); 
    768770                        jsonStringer.object(); 
    769                         jsonStringer = populateJsonObjectForScheduleEntry(jsonStringer, scheduleEntry);  
     771                        try { 
     772                                Date date = userDateFormat.parseDateString(dateString); 
     773                                scheduleEntry = addTaskService.reCalculateScheduleEntry(schedule, scheduleEntry, work, workUnit, date, calculateBy, SessionManager.getUser()); 
     774                                jsonStringer.key("error").value(""); 
     775                                jsonStringer = populateJsonObjectForScheduleEntry(jsonStringer, scheduleEntry); 
     776                        } catch (ParseException pnetEx) { 
     777                                jsonStringer.key("error").value(pnetEx.getMessage()); 
     778                                log.error("Parsing error occured while reCalculating shedule entry: " + pnetEx.getMessage()); 
     779                        } catch (InvalidDateException pnetEx) { 
     780                                jsonStringer.key("error").value(pnetEx.getMessage()); 
     781                                log.error("Error occured while parsing date string to date type: " + pnetEx.getMessage()); 
     782                        } catch (IllegalArgumentException pnetEx) { 
     783                                jsonStringer.key("error").value(pnetEx.getMessage()); 
     784                                log.error("Error occured while calculating task: " + pnetEx.getMessage()); 
     785                        } 
    770786                        jsonStringer.endObject(); 
    771787                } catch (JSONException pnetEx) { 
    772                         log.error("Json error occured while settng value Json Stringer: "+ pnetEx.getMessage()); 
    773                 } catch (ParseException pnetEx) { 
    774                         log.error("Parsing error occured while reCalculating shedule entry: "+ pnetEx.getMessage()); 
    775                 } catch (InvalidDateException pnetEx) { 
    776                         log.error("Error occured while parsing date string to date type: "+ pnetEx.getMessage()); 
    777                 } 
     788                        log.error("Json error occured while settng value Json Stringer: " + pnetEx.getMessage()); 
     789                }  
    778790                return new TextStreamResponse("text/json", jsonStringer.toString()); 
    779791        } 
     
    12231235         * @return the userDateForamtString 
    12241236         */ 
    1225         public String getUserDateForamtString() { 
    1226                 return userDateForamtString; 
     1237        public String getUserDateFormatString() { 
     1238                return userDateFormatString; 
    12271239        } 
    12281240 
     
    12301242         * @param userDateForamtString the userDateForamtString to set 
    12311243         */ 
    1232         public void setUserDateForamtString(String userDateForamtString) { 
    1233                 this.userDateForamtString = userDateForamtString; 
     1244        public void setUserDateFormatString(String userDateFormatString) { 
     1245                this.userDateFormatString = userDateFormatString; 
    12341246        } 
    12351247        /** 
  • trunk/core/src/net/project/view/pages/resource/management/Directory.java

    r18341 r18355  
    3535import net.project.util.Version; 
    3636 
     37import org.apache.commons.collections.CollectionUtils; 
    3738import org.apache.commons.lang.StringUtils; 
    3839import org.apache.log4j.Logger; 
     
    775776                                                +"', spaceName : '"+ spaceName.replaceAll("'", "&acute;"); 
    776777                 
    777                 if(personBusinessesList!= null && personProjectList!=null  
    778                                 && (personBusinessesList.indexOf(new BusinessSpace(spaceId)) != -1  
    779                                 || personProjectList.indexOf(new PnProjectSpace(Integer.parseInt(spaceId), spaceName))!= -1)){ 
     778                if(personIsMemberOfThisSpace(spaceId)){ 
    780779                        configString += "', role : '"+ getPersonRolesBySpaceID(spaceId) 
    781780                                                +"', checked : true"; 
     
    908907                return ((string == null || string.equals("null")) ? returnString : string); 
    909908        } 
     909         
     910        private boolean personIsMemberOfThisSpace(String spaceId){ 
     911                boolean personInSpace = false; 
     912                if (CollectionUtils.isNotEmpty(personBusinessesList)) { 
     913                        for(BusinessSpace business : personBusinessesList){ 
     914                                personInSpace = business.getID().equals(spaceId); 
     915                                if(personInSpace) break; 
     916                        } 
     917                } 
     918                if(!personInSpace && CollectionUtils.isNotEmpty(personProjectList)){ 
     919                        for(PnProjectSpace project : personProjectList){ 
     920                                personInSpace = project.getProjectId() == Integer.parseInt(spaceId); 
     921                                if(personInSpace) break; 
     922                        } 
     923                } 
     924                return personInSpace;  
     925        } 
    910926 
    911927        @CleanupRender 
  • trunk/core/web/html/assignments/MyAssignments.html

    r18310 r18355  
    8686        var isAgileWorkRemainingEnabled = ${isAgileWorkRemainingEnabled}; 
    8787        var actionsIconEnabled = ${actionsIconEnabled}; 
    88         var userDateForamtString = '${userDateForamtString}'; 
     88        var userDateFormatString = '${userDateFormatString}'; 
    8989        var userDisplayName = '${userDisplayName}'; 
    9090 
  • trunk/core/web/jsp/calendar/MeetingManager.jsp

    r18047 r18355  
    297297        <tb:band name="action"> 
    298298                 
    299                 <tb:button type="cancel" show="<%=showCancelButton%>" /
     299                <!-- tb:button type="cancel" show="<%=showCancelButton%>" /--
    300300                <tb:button type="submit" show="<%=showSubmitButton%>" /> 
    301301        </tb:band> 
  • trunk/core/web/jsp/form/FormList.jsp

    r18322 r18355  
    2525            net.project.persistence.*, 
    2626                        net.project.base.*, 
    27                         java.net.URLEncoder"  
     27                        java.net.URLEncoder, 
     28                        net.project.space.*"  
    2829%> 
    2930<%@ include file="/base/taglibInclude.jsp" %> 
     
    3536<title><display:get name="prm.global.application.title" /></title> 
    3637<% 
     38        boolean isPersonalSpace=user.getCurrentSpace().isTypeOf(Space.PERSONAL_SPACE); 
    3739        form.setUser(user); 
    3840        form.setSpace(user.getCurrentSpace()); 
     
    307309                                <a href="javascript:notify();"><%= PropertyProvider.get("all.global.toolbar.standard.notify") %></a> 
    308310                              </span> 
    309                               <br/> 
     311                              <br/><%if(!isPersonalSpace) {%> 
    310312                              <span> 
    311313                                <a href="javascript:workflow();"><%= PropertyProvider.get("all.global.toolbar.standard.workflow") %></a> 
    312314                              </span> 
    313                               <br/> 
     315                              <br/><%}%> 
    314316                              <span> 
    315317                                <a href="javascript:search();"><%= PropertyProvider.get("prm.form.list.search.button.tooltip") %></a> 
  • trunk/core/web/jsp/form/FormListProcessing.jsp

    r17700 r18355  
    9797        } else if ((request.getParameter("theAction") != null) && request.getParameter("theAction").equals("workflow")) 
    9898        { 
    99                 pageContext.forward(SessionManager.getJSPRootURL() + "/workflow/envelope/EnvelopeWizardStart.jsp?id=" + request.getParameter("selected")); 
     99                pageContext.forward("/workflow/envelope/EnvelopeWizardStart.jsp?id=" + request.getParameter("selected")); 
    100100        } 
    101101%> 
  • trunk/core/web/src/components/myAssignments-dashboardPanel.js

    r18341 r18355  
    509509                window.location.href = JSPRootURL+'/form/FormEdit.jsp?id='+assignmentTreeNodeId+'&module=30&action=1&redirectedFromSpace=true'; 
    510510        } else if(objectType.toString() == 'meeting' || objectType.toString() == 'activity'){ 
    511                 window.location.href = JSPRootURL+'/servlet/AssignmentController/View?module='+moduleId+'&objectID='+assignmentTreeNodeId+'&personID='+userId +'&returnTo=/assignments/My?module='+moduleId+'&refLink=/assignments/My?module='+moduleId
     511                window.location.href=JSPRootURL+'/calendar/MeetingManager.jsp?id='+assignmentTreeNodeId+'&action=1&module=70'
    512512        } else { 
    513513                extAlert('Error', 'Details are not available for this object.', Ext.MessageBox.ERROR); 
  • trunk/core/web/src/components/myAssignments-filterForm.js

    r18314 r18355  
    102102                                                labelWidth:30, 
    103103                                                value : startDateValue, 
     104                                                emptyText : 'Start Date', 
    104105                                                format:'m/d/Y', 
    105106                                                invalidText:'Current date is not a valid date. It must be in the format mm/dd/yyyy', 
     
    140141                                        toDate = new Ext.form.DateField({ 
    141142                                                hideLabel : true, 
     143                                                emptyText : 'Due Date', 
    142144                                                value : endDateValue, 
    143145                                                format:'m/d/Y', 
  • trunk/core/web/src/components/myAssignments-taskAssignWindow.js

    r18341 r18355  
    88var dueDate; 
    99 
    10 if(userDateForamtString.indexOf('yy') > 0){ 
    11         userDateForamtString = userDateForamtString.replace('yy', 'y'); 
    12 
    13 userDateForamtString = userDateForamtString.toLowerCase(); 
     10 
     11if(userDateFormatString.indexOf('yy') > 0){ 
     12        userDateFormatString = userDateFormatString.replace('yy', 'y'); 
     13
     14userDateFormatString = userDateFormatString.toLowerCase(); 
    1415 
    1516String.prototype.trim = function(){ 
     
    199200                                                        name : 'startDate', 
    200201                                                        labelWidth:30, 
    201                                                         format: userDateForamtString, 
     202                                                        format: userDateFormatString, 
    202203                                                        width : 100, 
     204                                                        invalidText:'Current date is not a valid date. It must be in the format '+ getDateFormatExample(userDateFormatString), 
    203205                                                        labelSeparator : ':', 
    204206                                                    listeners : {'change':calculateTask} 
     
    209211                                                        name : 'End Date', 
    210212                                                        labelWidth:30, 
    211                                                         format: userDateForamtString, 
     213                                                        format: userDateFormatString, 
    212214                                                        width : 100, 
     215                                                        invalidText:'Current date is not a valid date. It must be in the format '+ getDateFormatExample(userDateFormatString), 
    213216                                                        labelSeparator : ':', 
    214217                                                        listeners : {'change':calculateTask} 
     
    219222                        buttons:[{ 
    220223                         text:'Submit', 
    221                          handler: submitAssignResouceForm 
     224                         handler: function (){ 
     225                                        if(taskCalculated) 
     226                                                submitAssignResouceForm(); 
     227                                } 
    222228                         }, 
    223229                         { text: 'Close', 
     
    297303 
    298304function calculateTask(thisField, newValue, oldValue) { 
     305        taskCalculated = false 
    299306        if(!taskWork.isValid(false)){ 
    300307                extAlert('Error', 'Please enter valid work.', Ext.MessageBox.ERROR); 
     
    302309        } 
    303310        var startDateString = ''; 
    304         if(startDate.value != ''){ 
    305                 date = startDate.getValue();//new Date(startDate) 
    306                 startDateString = date.dateFormat(userDateForamtString); 
    307         } 
    308         if(dueDate.value != ''){ 
     311        var dueDateString = ''; 
     312        if(startDate.getValue() != ''){ 
     313                date = startDate.getValue(); 
     314                startDateString = date.dateFormat(userDateFormatString); 
     315        } 
     316        if(dueDate.getValue() != ''){ 
    309317                date = dueDate.getValue(); 
    310                 dueDateString = date.dateFormat(userDateForamtString); 
     318                dueDateString = date.dateFormat(userDateFormatString); 
     319        } 
     320        if(startDateString == '' || dueDateString == ''){ 
     321                extAlert('Error', 'Please enter valid Date.', Ext.MessageBox.ERROR); 
     322                return; 
    311323        } 
    312324         
     
    323335                success: function(result, request){ 
    324336                        var responseObject = eval("(" +result.responseText +")" ); 
    325                         taskWork.setValue(responseObject.work); 
    326                         taskWorkUnit.setValue(responseObject.workUnit); 
    327                         startDate.setValue(getDateInExtDateFieldFormat(responseObject.startDate)); 
    328                         dueDate.setValue(getDateInExtDateFieldFormat(responseObject.dueDate)); 
     337                        if(responseObject.error == ''){ 
     338                                taskWork.setValue(responseObject.work); 
     339                                taskWorkUnit.setValue(responseObject.workUnit); 
     340                                startDate.setValue(getDateInExtDateFieldFormat(responseObject.startDate)); 
     341                                dueDate.setValue(getDateInExtDateFieldFormat(responseObject.dueDate)); 
     342                        } else{ 
     343                        extAlert('Error', responseObject.error, Ext.MessageBox.ERROR); 
     344                        taskWork.setValue(''); 
     345                    } 
     346                    taskCalculated = true; 
    329347                }, 
    330348                failure: function(result, response){ 
     349                        taskCalculated = true; 
    331350                        extAlert('Error', 'Server request failed please try again...', Ext.MessageBox.ERROR); 
    332351                } 
     
    360379        } 
    361380        return splitedDate[0]+'/'+splitedDate[1]+'/'+splitedDate[2]; 
     381} 
     382 
     383function getDateFormatExample(dateFormatString){ 
     384        var splitedDateFormat = dateFormatString.split('/'); 
     385        if(splitedDateFormat[0].length == 1){ 
     386                splitedDateFormat[0] = splitedDateFormat[0] + splitedDateFormat[0]; 
     387        } 
     388        if(splitedDateFormat[1].length == 1){ 
     389                splitedDateFormat[1] = splitedDateFormat[1] + splitedDateFormat[1]; 
     390        } 
     391        if(splitedDateFormat[2].length == 1){ 
     392                splitedDateFormat[2] = splitedDateFormat[2] + splitedDateFormat[2]; 
     393        } 
     394        return splitedDateFormat[0]+'/'+splitedDateFormat[1]+'/'+splitedDateFormat[2]; 
    362395} 
    363396 
     
    373406 
    374407function create(){ 
     408        //If no data in assignment grid 
     409        if (assignmentTreeGrid.getStore().getCount() == 0){ 
     410                extAlert('Error', 'No any project or task avilable to create new assignment.', Ext.MessageBox.ERROR); 
     411                return; 
     412        } 
    375413        if(assignmentTreeNodeId != 0 && (objectType == 'task' || objectType == 'summary' || objectType == 'project')){ 
     414                taskCalculated = true; 
    376415                selectedTaskId = assignmentTreeNodeId; 
    377416                if(objectType == 'project'){ 
  • trunk/core/web/src/components/myAssignments-timeline.js

    r18319 r18355  
    4242        Timeline.DurationEventPainter.prototype._onClickDurationEvent = function(domEvt,evt,target){ 
    4343                assignmentTreeNodeId = childTaskList = evt.getProperty("objectId"); 
     44                taskSpaceId = evt.getProperty("spaceId"); 
    4445                objectType = evt.getProperty("objectType"); 
    4546                objectName = evt.getProperty("title"); 
     
    4748                loadBlogEntriesForAssignment(); 
    4849                loadWikiForAssignment( objectName, assignmentTreeNodeId); 
    49                 taskSpaceId = assignmentTreeNodeId;                           //set taskSpaceId for wikiPanel Cancel button 
     50                //taskSpaceId = assignmentTreeNodeId;                         //set taskSpaceId for wikiPanel Cancel button 
    5051                 
    5152                domEvt.cancelBubble=true; 
  • trunk/core/web/src/directory-Panel.js

    r18341 r18355  
    911911                return false; 
    912912            } 
     913            if((gridStore.getAt(3).get('value').search(/[a-zA-Z]+/))> -1) { 
     914                extAlert('Error', 'Invalid office phone number', Ext.MessageBox.ERROR); 
     915                return false; 
     916            } 
     917                 
     918                if((gridStore.getAt(4).get('value').search(/[a-zA-Z]+/))> -1 ) { 
     919                extAlert('Error', 'Invalid Mobile numbers', Ext.MessageBox.ERROR); 
     920                return false; 
     921            } 
    913922                var resourceProperty = '[{ "displayName" : "'+ gridStore.getAt(0).get('value') 
    914923                                                                +'", "firstName" : "'+ gridStore.getAt(1).get('value') 
     
    918927                                                                +'", "fax" : "'+ gridStore.getAt(5).get('value') 
    919928                                                                +'", "email" : "'+ gridStore.getAt(6).get('value')+'"}]'; 
     929                 
    920930                //Updating Resource 
    921931                document.getElementById('messageDiv').innerHTML  
     
    10231033                        function(btn){ 
    10241034                                if(btn=='yes'){ 
    1025                                         saveSpaceChange(spaceChanges); 
     1035                                        saveSpaceChanges(spaceChanges); 
    10261036                                }else{ 
    10271037                                        return false;