Changeset 17897

Show
Ignore:
Timestamp:
08/14/08 11:20:31 (3 months ago)
Author:
avinash
Message:

blog :
- added work capture for single day on blog it popup from Assignments (Beta) page
- added scrolling functionality for single day and capturing single day work

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/core/src/net/project/hibernate/service/IPnAssignmentWorkService.java

    r17871 r17897  
    5252         * @param request a <code>HttpServletRequest</code> object that we can use 
    5353     * to look up what time the user has entered. 
    54      * @param ObjectID 
    55      * @param dateToStart to load the date list according to scrolling  
    56      * null for first time. 
    5754     * The date value list has been set according to this paramaeter and pass it to 
    5855     * getTimeValueForJS method to set the date value list. 
    5956     * and after that in session. 
    6057         */ 
    61         public String getModifiedTimeSheetEntries(String objectId ,String dateToStart,HttpServletRequest request); 
    62          
    63         /** 
    64          * Return the String as array for time values as array in blogit.js for soem validations  
     58        public String getModifiedTimeSheetEntries(HttpServletRequest request); 
     59         
     60        /** 
     61         * Return the String as array for time values as array in blogit.js for some validations  
    6562         * while updating the time sheet.  
    66          * @param dateToStrart string sent while scrolling the week 
     63         * @param dateToStrart string sent while scrolling the week/days 
     64         * @param  scrollType string sent while scrolling to identify for week/days 
     65         * @param objectId to filter data 
    6766         * and null for First time load. 
    6867         */ 
    69         public String getTimeValueForJS(String dateToStart); 
     68        public String getTimeValueForJS(String dateToStart,String scrollType,String objectId); 
    7069         
    7170        /** 
     
    7776     * the database. 
    7877     */ 
    79         public void setDateValues(); 
     78        public void setDateValues(String objectId,String scrollType); 
    8079         
    8180        /** 
     
    8483         * and set to dateHeaders and dateLongNames list. 
    8584         */ 
    86         public void getDateHeaders(); 
     85        public void getDateHeaders(String scrollType); 
    8786         
    8887        /** 
     
    129128     *   
    130129         */ 
    131         public String findUpdatedPercentComplete(HttpServletRequest request, String id) throws ParseException; 
     130        public String findUpdatedPercentComplete(HttpServletRequest request) throws ParseException; 
    132131         
    133132        /** 
  • trunk/core/src/net/project/hibernate/service/impl/PnAssignmentWorkServiceImpl.java

    r17871 r17897  
    119119        private TimeQuantity currentWork = assnWork; 
    120120     
    121         Date scrollBackStartDate; 
     121        private Date scrollBackStartDate; 
    122122     
    123         Date scrollForwardStartDate; 
     123        private Date scrollForwardStartDate; 
    124124     
    125125        private TaskFinder finder = new TaskFinder(); 
     
    161161         * @see net.project.hibernate.service.IPnAssignmentWorkService#getModifiedTimeSheetEntries(java.lang.String, java.lang.String, javax.servlet.http.HttpServletRequest) 
    162162         */ 
    163         public String getModifiedTimeSheetEntries(String objectId, 
    164                         String dateToStart, HttpServletRequest request) { 
     163        public String getModifiedTimeSheetEntries(HttpServletRequest request) { 
     164                String objectId = request.getParameter("objectId"); 
     165                String dateToStart = request.getParameter("scroll"); 
    165166                NumberFormat nf = NumberFormat.getInstance(); 
     167                String scrollType=request.getParameter("scrollType")==null?"week":request.getParameter("scrollType"); 
     168                 
    166169                // Get Get/Set Date values List while scrolling and first Time Laod. 
    167                 getTimeValueForJS(dateToStart); 
     170                String jsTimesValueArray=getTimeValueForJS(dateToStart,scrollType,objectId); 
    168171 
    169172                // Get the assignments that we are displaying 
     
    176179                String strTDwidth = "52px"; 
    177180                String timeSheetTable = ""; 
    178                 timeSheetTable += "<table align='left' id='timecard' border='0' width='100%' align=\"center\">"; 
    179                 timeSheetTable += "<tr>"; 
    180  
    181                 timeSheetTable += "<td width='50%'><div id='div1' style='display:block'><table width='100%'><tr class='tableHeader'>"; 
    182                 timeSheetTable += "<td width='15'><img src='" 
     181                timeSheetTable += "<table align='left' id='timecard' border='0' width='100%' align=\"center\">\n"; 
     182                timeSheetTable += "\t<tr>\n"; 
     183                timeSheetTable += "\t\t<td width='75%'><div id='div1' style='display:block'><table align=\"center\"><tr class='timeSheetHeader'>\n"; 
     184                timeSheetTable += "\t\t\t<td><img src='" 
    183185                                + SessionManager.getJSPRootURL() 
    184                                 + "/images/icons/prev_page_sm.gif' border='0' onClick='scrollBack(\"" 
    185                                 + scrollBackStartDate.getTime() + "\");'/></td>"; 
     186                                + "/images/leftsingle.gif' border='0' onClick='scrollBack(\"" 
     187                                + scrollBackStartDate.getTime() + "\",\""+scrollType+"\");'/></td>\n"; 
    186188 
    187189                for (Iterator it = dateHeaders.iterator(); it.hasNext();) { 
    188190                        DateHeader dateHeader = (DateHeader) it.next(); 
    189                         timeSheetTable += "<td align=\"center\"  width='" + strTDwidth 
     191                        timeSheetTable += "\t\t\t<td align=\"center\"  width='" + strTDwidth 
    190192                                        + "'>" + dateHeader.dayOfWeek + "<br>" + dateHeader.date 
    191                                         + "</td>"; 
    192                 } 
    193  
    194                 timeSheetTable += "<td width='15'><img src='" 
     193                                        + "</td>\n"; 
     194                } 
     195 
     196                timeSheetTable += "\t\t\t<td><img src='" 
    195197                                + SessionManager.getJSPRootURL() 
    196                                 + "/images/icons/next_page_sm.gif' border='0' onClick='scrollForward(\"" 
    197                                 + scrollForwardStartDate.getTime() + "\");'/></td>"; 
    198                 timeSheetTable += "</tr>"; 
    199                 timeSheetTable += "<tr><td colspan='9' align='center'><a href='javascript:showdiv2();'>day</a>&nbsp;week</td></tr>"; 
    200                 timeSheetTable += "</table></div>"; 
    201  
    202                 timeSheetTable += "<div id='div2' style='display:none'><table width='50%' align=\"center\"><tr class='tableHeader'>"; 
    203                 timeSheetTable += "<td width='15'><img src='" 
    204                                 + SessionManager.getJSPRootURL() 
    205                                 + "/images/icons/prev_page_sm.gif' border='0' onClick='scrollBack();'/></td>"; 
    206                 timeSheetTable += "<td align='center'>Today</td>"; 
    207                 timeSheetTable += "<td width='15'><img src='" 
    208                                 + SessionManager.getJSPRootURL() 
    209                                 + "/images/icons/next_page_sm.gif' border='0' onClick='scrollForward();'/></td>"; 
    210                 timeSheetTable += "</tr>"; 
    211                 timeSheetTable += "<tr><td colspan='3' align='center'>day&nbsp;<a href='javascript:showdiv1();'>week</a></td></tr>"; 
    212                 timeSheetTable += "</table></div></td>"; 
    213  
    214                 timeSheetTable += "<td align='center' valign='top' class='blogEntryLabel' nowrap='nowrap' >Total Days<br/>Reported<br/><a href='#' class='bluelink'>history</a></td>"; 
    215                 timeSheetTable += "<td align='center' valign='top' class='blogEntryLabel' nowrap='nowrap' >Estimated <br/>Remaining</td>"; 
    216                 timeSheetTable += "<td align='center' valign='top' class='blogEntryLabel' nowrap='nowrap' >Total <br/>Est.Days</td>"; 
    217                 timeSheetTable += "<td align='center' valign='top' class='blogEntryLabel' nowrap='nowrap' >% <br/>complete<br/><a href='#' class='redlink'>not accurate?</a></td>"; 
    218                 timeSheetTable += "<td></td>"; 
    219  
    220                 timeSheetTable += "</tr><tr><td colspan='7' class='blogbar'></td></tr>"; 
    221  
    222                 timeSheetTable += "<tr class='tableContent'>"; 
    223  
    224                 timeSheetTable += "<td width='50%'><div id='div11' style='display:block'><table width='100%' align=\"center\"><tr class='tableContent'>"; 
    225                 timeSheetTable += "<td width='15'></td>"; 
     198                                + "/images/rightsingle.gif' border='0' align=\"right\" onClick='scrollForward(\"" 
     199                                + scrollForwardStartDate.getTime() + "\",\""+scrollType+"\");'/></td>\n"; 
     200                timeSheetTable += "\t\t</tr>"; 
     201                timeSheetTable += "\t\t<tr>\n"; 
     202                timeSheetTable += "\t\t\t<td colspan='9' align='center'>\n"; 
     203                if(scrollType.equalsIgnoreCase("week")){ 
     204                        timeSheetTable += "\t\t\t\t <a href='javascript:changeScrollType(\"day\");'>day</a> &nbsp; week\n"; 
     205                }else{ 
     206                        timeSheetTable += "\t\t\t\t day &nbsp; <a href='javascript:changeScrollType(\"week\");'>week</a>\n"; 
     207                } 
     208                timeSheetTable += "\t\t\t</td></tr></table></div>\n"; 
     209 
     210                timeSheetTable += "\t\t</td>\n"; 
     211 
     212                timeSheetTable += "\t\t<td align='center' valign='top' class='blogEntryLabel' nowrap='nowrap' >Total Days<br/>Reported<br/><a href='#' class='bluelink'>history</a></td>\n"; 
     213                timeSheetTable += "\t\t<td align='center' valign='top' class='blogEntryLabel' nowrap='nowrap' >Estimated <br/>Remaining</td>\n"; 
     214                timeSheetTable += "\t\t<td align='center' valign='top' class='blogEntryLabel' nowrap='nowrap' >Total <br/>Est.Days</td>\n"; 
     215                timeSheetTable += "\t\t<td align='center' valign='top' class='blogEntryLabel' nowrap='nowrap' >% <br/>complete<br/><a href='#' class='redlink'>not accurate?</a></td>\n"; 
     216                timeSheetTable += "\t\t<td></td>\n"; 
     217 
     218                timeSheetTable += "\t</tr>\n"; 
     219                timeSheetTable += "\t<tr><td colspan='7' class='blogbar2'></td></tr>\n"; 
     220 
     221                timeSheetTable += "\t<tr class='tableContent'>\n"; 
     222 
     223                timeSheetTable += "\t\t<td width='75%'><div id='div11' style='display:block'><table align=\"center\"><tr class='tableContent'>\n"; 
     224                timeSheetTable += "\t\t\t<td></td>\n"; 
    226225                double percenComplete = 1.0; 
    227226                int forcount = 0; 
     
    266265                                String valueValue = (request.getParameter(valueName) == null ? " " 
    267266                                                : " value='" + request.getParameter(valueName) + "' "); 
    268                                 timeSheetTable += "<td nowrap='nowrap' width='" + strTDwidth 
    269                                                 + "' align=\"center\">"; 
     267                                timeSheetTable += "\t\t\t<td nowrap='nowrap' width='" + strTDwidth 
     268                                                + "' align=\"center\">\n"; 
    270269                                timeSheetTable += work.toShortString(0, 2); 
    271                                 timeSheetTable += "<br>"; 
    272  
    273                                 timeSheetTable += "<input type='text' size='1' maxlength='2' id='timesheetbox" 
     270                                timeSheetTable += "\t\t\t\t<br>\n"; 
     271 
     272                                timeSheetTable += "\t\t\t\t<input type='text' size='1' maxlength='2' id='timesheetbox" 
    274273                                                + forcount 
    275274                                                + "' name='" 
     
    283282                                                + "','" 
    284283                                                + Module.PERSONAL_SPACE 
    285                                                 + "')\";/><a id='timerLink' href=\"javascript:showtime('timesheetbox" 
     284                                                + "','"+scrollType+"')\";/>\n" 
     285                                                + "\t\t\t\t<a id='timerLink' href=\"javascript:showtime('timesheetbox" 
    286286                                                + forcount 
    287287                                                + "');\"><img src='" 
    288288                                                + SessionManager.getJSPRootURL() 
    289                                                 + "/images/sm_clock.gif' border='0'/></a>"; 
     289                                                + "/images/sm_clock.gif' border='0'/></a>\n"; 
    290290                                forcount++; 
    291                                 timeSheetTable += "</td>"; 
    292                         } 
    293                 } 
    294                 timeSheetTable += "<td width='15'></td></tr>"; 
    295                 timeSheetTable += "</table></div>"; 
    296  
    297                 timeSheetTable += "<div id='div22' style='display:none'><table width='50%' align=\"center\"><tr class='tableContent'>"; 
    298                 timeSheetTable += "             <td width='15'></td>"; 
    299                 timeSheetTable += "             <td nowrap='nowrap'> 0 hrs <br><input type='text' size='1' maxlength='2' id='txt8'/><img src='" 
    300                                 + SessionManager.getJSPRootURL() 
    301                                 + "/images/sm_clock.gif' border='0' name='8' onclick='showtime(this);'/></td>"; 
    302                 timeSheetTable += "             <td width='15'></td>"; 
    303                 timeSheetTable += "</tr></table><div></td>"; 
    304  
    305                 timeSheetTable += "<td align='center'><span name='wk' id='wk'>" 
    306                                 + strWork + "</span></td>"; 
    307                 timeSheetTable += "<td align='center'><span name='wkrm' id='wkrm'>" 
    308                                 + strWorkRemaining + "</span></td>"; 
    309                 timeSheetTable += "<td align='center'><span name='wkrp' id='wkrp'>" 
    310                                 + strWorkComplete + "</span></td>"; 
    311                 timeSheetTable += "<td align='center'><span name='pc' id='pc'>" 
    312                                 + nf.formatPercent(percenComplete, 2) + "</span></td>"; 
    313  
    314                 timeSheetTable += "<td nowrap='nowrap'><b>Done?</b>&nbsp;<input type='checkbox' style='border-style: none;'/></td>"; 
    315                 timeSheetTable += "</tr>"; 
     291                                timeSheetTable += "\t\t\t</td>\n"; 
     292                        } 
     293                } 
     294                timeSheetTable += "\t\t\t<td></td>\n"; 
     295                timeSheetTable += "\t\t</tr></table></div>\n"; 
     296 
     297                timeSheetTable += "\t\t</td>\n"; 
     298 
     299                timeSheetTable += "\t\t<td align='center'><span name='wk' id='wk'>" 
     300                                + strWork + "</span></td>\n"; 
     301                timeSheetTable += "\t\t<td align='center'><span name='wkrm' id='wkrm'>" 
     302                                + strWorkRemaining + "</span></td>\n"; 
     303                timeSheetTable += "\t\t<td align='center'><span name='wkrp' id='wkrp'>" 
     304                                + strWorkComplete + "</span></td>\n"; 
     305                timeSheetTable += "\t\t<td align='center'><span name='pc' id='pc'>" 
     306                                + nf.formatPercent(percenComplete, 2) + "</span></td>\n"; 
     307 
     308                timeSheetTable += "\t\t<td nowrap='nowrap'><b>Done?</b>&nbsp;<input type='checkbox' style='border-style: none;'/></td>\n"; 
     309                timeSheetTable += "\t</tr>\n"; 
    316310 
    317311                // Put some date objects into the session that we'll use repeatedly 
     
    322316                                        + e.getMessage()); 
    323317                } 
    324                 return timeSheetTable
     318                return timeSheetTable+"TimesValueArray"+jsTimesValueArray
    325319        } 
    326320         
     
    328322         * @see net.project.hibernate.service.IPnAssignmentWorkService#getTimeValueForJS(java.lang.String) 
    329323         */ 
    330         public String getTimeValueForJS(String dateToStart) { 
     324        public String getTimeValueForJS(String dateToStart,String scrollType,String objectId) { 
    331325                PnCalendar cal = new PnCalendar(); 
    332                 if (dateToStart != null) { 
    333                         startDate = new Date(Long.parseLong(dateToStart)); 
    334                 } else { 
    335                         cal.setTime(new Date()); 
    336                         startDate = cal.startOfWeek(); 
    337                 } 
    338                 cal.setTime(startDate); 
    339                 cal.add(PnCalendar.DATE, -7); 
    340                 scrollBackStartDate = cal.getTime(); 
    341  
    342                 cal.setTime(startDate); 
    343                 cal.add(PnCalendar.DATE, 7); 
    344                 scrollForwardStartDate = cal.getTime(); 
    345  
    346                 endDate = cal.endOfDay(); 
     326                if(scrollType.equalsIgnoreCase("week")){ 
     327                        if (dateToStart != null) { 
     328                                startDate = new Date(Long.parseLong(dateToStart)); 
     329                        } else { 
     330                                cal.setTime(new Date()); 
     331                                startDate = cal.startOfWeek(); 
     332                        } 
     333                        cal.setTime(startDate); 
     334                        cal.add(PnCalendar.DATE, -7); 
     335                        scrollBackStartDate = cal.getTime(); 
     336         
     337                        cal.setTime(startDate); 
     338                        cal.add(PnCalendar.DATE, 7); 
     339                        scrollForwardStartDate = cal.getTime(); 
     340                        endDate = cal.endOfDay(); 
     341                } 
     342                else{ 
     343                        if (dateToStart != null) { 
     344                                startDate = new Date(Long.parseLong(dateToStart)); 
     345                        } else { 
     346                                cal.setTime(new Date()); 
     347                                startDate = cal.startOfDay(); 
     348                        } 
     349                        cal.setTime(startDate); 
     350                        cal.add(PnCalendar.DATE, -1); 
     351                        scrollBackStartDate = cal.getTime(); 
     352         
     353                        cal.setTime(startDate); 
     354                        cal.add(PnCalendar.DATE, 1); 
     355                        scrollForwardStartDate = cal.getTime(); 
     356                        endDate = cal.getTime(); 
     357                } 
     358                 
    347359 
    348360                // Get the column headers for each day 
    349                 getDateHeaders(); 
     361                getDateHeaders(scrollType); 
    350362                // Figure out how many hours were worked on each day 
    351                 setDateValues(); 
     363                setDateValues(objectId,scrollType); 
    352364                String timesValueString = ""; 
    353365                for (Iterator it = dateLongNames.iterator(); it.hasNext();) { 
     
    362374         * @see net.project.hibernate.service.IPnAssignmentWorkService#setDateValues() 
    363375         */ 
    364         public void setDateValues(){ 
     376        public void setDateValues(String objectId,String scrollType){ 
    365377        dateValues = new HashMap(); 
    366378        summaryDateValues = new HashMap(); 
     
    450462                                .get(dateID.date); 
    451463                if (existingSummaryWork == null) { 
    452                         summaryDateValues.put(dateID.date, work); 
     464                        this.summaryDateValues.put(dateID.date, work); 
    453465                } else { 
    454                         summaryDateValues.put(dateID.date, existingSummaryWork.add(work)); 
     466                        this.summaryDateValues.put(dateID.date, existingSummaryWork.add(work)); 
    455467                } 
    456468 
     
    466478         * @see net.project.hibernate.service.IPnAssignmentWorkService#getDateHeaders() 
    467479         */ 
    468         public void getDateHeaders() { 
     480        public void getDateHeaders(String scrollType) { 
    469481                PnCalendar cal = new PnCalendar(); 
    470482                dateHeaders = new LinkedList(); 
     
    477489                dayOfWeekFormatter.setTimeZone(cal.getTimeZone()); 
    478490                cal.setTime(startDate); 
    479                 for (int i = 0; i < 7; i++) { 
     491                if(scrollType.equalsIgnoreCase("week")){ 
     492                        for (int i = 0; i < 7; i++) { 
     493                                DateHeader dh = new DateHeader(); 
     494                                dh.date = dateFormat.formatDate(cal.getTime(), 
     495                                                java.text.DateFormat.SHORT); 
     496                                dh.dayOfWeek = dayOfWeekFormatter.format(cal.getTime()); 
     497                                dateHeaders.add(dh); 
     498                                dateLongNames.add(String.valueOf(cal.getTime().getTime())); 
     499                                cal.add(Calendar.DATE, 1); 
     500                        } 
     501                }else{ 
    480502                        DateHeader dh = new DateHeader(); 
    481503                        dh.date = dateFormat.formatDate(cal.getTime(), 
     
    719741         * @see net.project.hibernate.service.IPnAssignmentWorkService#findUpdatedPercentComplete(javax.servlet.http.HttpServletRequest, java.lang.String) 
    720742         */ 
    721         public String findUpdatedPercentComplete(HttpServletRequest request, 
    722                        String id) throws ParseException { 
     743        public String findUpdatedPercentComplete(HttpServletRequest request) throws ParseException { 
     744                String id = request.getParameter("objectId"); 
    723745                errorReporter = new ErrorReporter(); 
     746                String scrollType=request.getParameter("scrollType")==null?"week":request.getParameter("scrollType"); 
     747                int for_cnt; 
     748                if(scrollType.equalsIgnoreCase("week")){ 
     749                        for_cnt=7; 
     750                }else{ 
     751                        for_cnt=1; 
     752                } 
    724753                Date earliestStartDate = null; 
    725754                Date latestStartDate = null; 
     
    734763                List workCompleteStrings = new ArrayList(); 
    735764                //Total work check. It should not be below zero. 
     765                 
    736766                double totalRowWork = 0; 
    737                 for (int i = 0; i < 7; i++) { 
     767                for (int i = 0; i < for_cnt; i++) { 
    738768                        String workString = request.getParameter("wc" + i); 
    739769                        Date startDate = new Date(Long.parseLong(request.getParameter("tv" + i))); 
     
    768798                                continue; 
    769799                        } else if (!Validator.isNumeric(workString)) { 
    770                                 //this is verified above 
    771                                 //errorReporter.addError(new ErrorDescription(PropertyProvider.get("prm.resource.updatework.error.invalid.message", workString, DateFormat.getInstance().formatDate(workDate)))); 
    772800                                continue; 
    773801                        } 
    774802                        totalColumnWork += Double.parseDouble(workString); 
    775803                } 
    776                 //if(Validator.isNegative(""+totalColumnWork)) { 
    777                 //      errorReporter.addError(new ErrorDescription(PropertyProvider.get("prm.resource.updatework.total.negative.error.message"))); 
    778                 //} 
    779  
    780                 //String percentComplete = null; 
    781                 //TimeQuantity assnWork = TimeQuantity.O_HOURS; 
    782                 //TimeQuantity currentWork = assnWork; 
    783804                NumberFormat nf = NumberFormat.getInstance(); 
    784805                assignmentMap = (Map) request.getSession().getAttribute("updateAssignmentsMap"); 
  • trunk/core/src/net/project/view/pages/assignments/MyAssignments.java

    r17884 r17897  
    201201                        // otherwise generate a blank time sheet div for js and return 
    202202                        else if (action.equalsIgnoreCase(WorkCaptureAction.GET_TIME_SHEET_ENTRIES.toString())) { 
    203                                 String objectId = request.getParameter("objectId"); 
    204                                 String dateToStart = request.getParameter("scroll"); 
    205                                 String timeSheetTable = pnAssignmentWorkService.getModifiedTimeSheetEntries(objectId, dateToStart, 
    206                                                 request); 
     203                                String timeSheetTable = pnAssignmentWorkService.getModifiedTimeSheetEntries(request); 
    207204                                return new TextStreamResponse("text", timeSheetTable); 
    208205                        } 
     
    211208                        //                                      update time sheet call if no error found                          
    212209                        else if (action.equalsIgnoreCase(WorkCaptureAction.UPDATE_TIME_SHEET_ENTRIES.toString())) { 
    213                                 String objectId = request.getParameter("objectId"); 
    214210                                String updatedJSCall = ""; 
    215211                                try { 
    216                                         updatedJSCall = pnAssignmentWorkService.findUpdatedPercentComplete(request, objectId); 
     212                                        updatedJSCall = pnAssignmentWorkService.findUpdatedPercentComplete(request); 
    217213                                } catch (Exception e) { 
    218214                                        log.error("Error occured while updating the work caputre" + e.getMessage()); 
     
    221217 
    222218                        } 
    223                         // Get the times value array for js array variable 
    224                         // to do some validations while updating the hours of work done on each day. 
    225                         else if (action.equalsIgnoreCase(WorkCaptureAction.GET_TIME_VALUES_ARRAY.toString())) { 
    226                                 String dateToStart = request.getParameter("scroll"); 
    227                                 return new TextStreamResponse("text", pnAssignmentWorkService.getTimeValueForJS(dateToStart)); 
    228  
    229                         }                        
    230219                         // Action to save the time sheet in database if error free, 
    231220                         // otherwise return a js error message call like not a working day.                      
  • trunk/core/web/css/blog.css

    r17829 r17897  
    4242        text-decoration: none; 
    4343} 
     44.blogEntryTitle { 
     45         padding-left:80px; 
     46         font-family: Verdana,Arial,Helvetica; 
     47         font-size: 12px; 
     48         font-weight: bold; 
     49         width: 30%; 
     50 
     51} 
    4452.blogEntryLabel { 
    4553         font-family: Verdana,Arial,Helvetica; 
     
    4755         font-weight: bold; 
    4856         width: 30%; 
     57         color:#999999; 
    4958} 
    5059#weblogEntryContents  
     
    7483        padding:0pt; 
    7584} 
     85.blogbar2 { 
     86        background-color:#CC99FF; 
     87        border-collapse:collapse; 
     88        height:1px; 
     89        padding:0pt; 
     90} 
    7691.redlink{ 
    77          
     92        color:#CC0000; 
    7893} 
    7994.bluelink{ 
    80          
     95        color:#005CB9; 
    8196} 
     97.timeSheetHeader { 
     98background-color:#FFFFFF; 
     99color:#666666; 
     100font-weight: bold; 
     101} 
  • trunk/core/web/html/assignments/MyAssignments.html

    r17884 r17897  
    44<style> 
    55.x-date-middle { 
    6     padding-top:2px;padding-bottom:2px; 
    7     width:130px; /* FF3 */ 
     6    padding-top: 2px; padding-bottom: 2px; 
     7    width: 130px; /* FF3 */ 
    88} 
    99.filter-icon { 
     
    1212 
    1313html, body { 
    14         font:normal 12px verdana; 
    15         margin:0; 
    16         padding:0; 
    17         border:0 none; 
    18         overflow:hidden; 
    19         height:100%; 
    20    
    21        p { 
    22            margin:5px; 
    23        
    24     .settings { 
    25         background-image:url(${JSPRootURL}/shared/icons/fam/folder_wrench.png); 
    26    
    27     .nav { 
    28         background-image:url(${JSPRootURL}/shared/icons/fam/folder_go.png); 
    29    
     14       font: normal 12px verdana; 
     15       margin: 0; 
     16       padding: 0; 
     17       border: 0 none; 
     18       overflow: hidden; 
     19       height: 100%; 
     20
     21p { 
     22    margin: 5px; 
     23
     24.settings { 
     25    background-image:url(${JSPRootURL}/shared/icons/fam/folder_wrench.png); 
     26
     27.nav { 
     28    background-image:url(${JSPRootURL}/shared/icons/fam/folder_go.png); 
     29
    3030   
    3131#assignmentPanelPosition{ 
     
    3939         
    4040        <script type="text/javascript"> 
    41                 var JSPRootURL = '${JSPRootURL}'; 
    42                 var moduleId = ${moduleId}; 
    43                 var spaceId = ${spaceId}; 
    44                 var userId = '${userId}'; 
    45                 var blogItFor = 'myAssignments'; 
    46                 var validationMessageForBlogEntry = '${validationMessageForBlogEntry}'; 
    47                 var validationMessageForBlogComment = '${validationMessageForBlogComment}'; 
    48                 var noSelectionErrMes = 'Please select a node from tree before posting a blog entry.'; 
    49                 var assigneeOrAssignorParameter = '${assigneeOrAssignorParameter}'; 
    50                 var projectOptionsData = ${projectOptionsString}; 
    51                 var businessOptionsData = ${businessOptionsString}; 
    52                 var treeViewParamerer ='${treeViewParamerer}'; 
    53         </script>                
     41        var JSPRootURL = '${JSPRootURL}'; 
     42        var moduleId = ${moduleId}; 
     43        var spaceId = ${spaceId}; 
     44        var userId = '${userId}'; 
     45        var blogItFor = 'myAssignments'; 
     46        var validationMessageForBlogEntry = '${validationMessageForBlogEntry}'; 
     47        var validationMessageForBlogComment = '${validationMessageForBlogComment}'; 
     48        var noSelectionErrMes = 'Please select a node from tree before posting a blog entry.'; 
     49        var assigneeOrAssignorParameter = '${assigneeOrassignorParameter}'; 
     50        var projectOptionsData = ${projectOptionsString}; 
     51        var businessOptionsData = ${businessOptionsString}; 
     52        var treeViewParamerer ='${treeViewParamerer}'; 
     53         
     54        // About Timeline 
     55        var tl; 
     56        function onLoad() { 
     57                var eventSource = new Timeline.DefaultEventSource(); 
     58                var bandInfos = [ 
     59                  Timeline.createBandInfo({                      
     60                        eventSource:    eventSource, 
     61                        date:           "Aug 11 2008 00:00:00 GMT", 
     62                        width:          "70%",  
     63                        intervalUnit:   Timeline.DateTime.DAY,  
     64                        intervalPixels: 100 
     65                }), 
     66                Timeline.createBandInfo({ 
     67                        showEventText:  false, 
     68                        trackHeight:    0.5, 
     69                        trackGap:       0.2, 
     70                        eventSource:    eventSource, 
     71                        date:           "Aug 11 2008 00:00:00 GMT", 
     72                        width:          "30%",  
     73                        intervalUnit:   Timeline.DateTime.WEEK, 
     74                        intervalPixels: 200 
     75                }) 
     76                ];       
     77                 
     78                bandInfos[1].syncWith = 0; 
     79                bandInfos[1].highlight = true; 
     80                 
     81                //tl = Timeline.create(document.getElementById("my-timeline"), bandInfos); 
     82                //Timeline.loadXML("example1.xml", function(xml, url) { eventSource.loadXML(xml, url); }); 
     83        } 
     84         
     85        var resizeTimerID = null; 
     86        function onResize() { 
     87                if (resizeTimerID == null) { 
     88                    resizeTimerID = window.setTimeout(function() { 
     89                        resizeTimerID = null; 
     90                        tl.layout(); 
     91                    }, 500); 
     92                } 
     93        } 
     94         
     95        //document.body.onload = onLoad();               
     96        //document.body.onresizeend = onResize(); 
     97         
     98        </script> 
    5499        <script type='text/javascript' src='${JSPRootURL}/src/RowExpander.js'></script> 
    55100        <script type="text/javascript" src="${jSPRootURL}/src/extjs/extensions/treeGrid.js"></script> 
     
    64109         
    65110        <t:PersonalMenu /> 
    66         <t:SpaceMainMenu />     
     111        <t:SpaceMainMenu /> 
    67112         
    68         <div id ="assignmentPanelPosition"></div>        
     113        <!-- div> 
     114                <div id="my-timeline" style="left: 23%; height: 20%; width : 76%; border: 1px solid #aaa"></div> 
     115        </div --> 
     116         
     117        <div id ="assignmentPanelPosition"></div> 
    69118</t:BlogLayout> 
  • trunk/core/web/src/blogit.js

    r17891 r17897  
    5858var paramString = ''; 
    5959 
    60 function scrollBack(scrollby) { 
     60function scrollBack(scrollby,scrolltype) { 
    6161        Ext.Ajax.request({ 
    6262           url: JSPRootURL +'/assignments/My/Get_Time_Sheet_Entries?module='+moduleId, 
    63            params: {module: moduleId, objectId: objectId,scroll:scrollby}, 
     63           params: {module: moduleId, objectId: objectId,scroll:scrollby, scrollType:scrolltype}, 
    6464           method: 'POST', 
    6565           success: function(result, request){ 
    6666               var responseText = result.responseText; 
    67           document.getElementById('timeWorkedDiv').innerHTML = responseText; 
    68                   Ext.Ajax.request({ 
    69                    url: JSPRootURL +'/assignments/My/get_Time_Values_Array?module='+moduleId, 
    70                    params: {module: moduleId, objectId: objectId,scroll:scrollby}, 
    71                    method: 'POST', 
    72                    success: function(result, request){ 
    73                            var responseText =result.responseText; 
    74                            timeValues=new Array(); 
    75                            timeValues = responseText.split(","); 
    76                    }, 
    77                    failure: function(result, response){                            
    78                            extAlert(errorTitle, 'Server Request Failed..', Ext.MessageBox.ERROR); 
    79                            hidePopup(); 
    80                    } 
    81                 });      
     67           var splitVal=responseText.split('TimesValueArray'); 
     68                   document.getElementById("timeWorkedDiv").innerHTML = splitVal[0]; 
     69                   timeValues = new Array(); 
     70                   timeValues = splitVal[1].split(","); 
    8271           }, 
    8372           failure: function(result, response){                            
     
    8877} 
    8978 
    90 function scrollForward(scrollby) {     
     79function scrollForward(scrollby,scrolltype) {     
    9180        Ext.Ajax.request({ 
    9281           url: JSPRootURL +'/assignments/My/Get_Time_Sheet_Entries?module='+moduleId, 
    93            params: {module: moduleId, objectId: objectId,scroll:scrollby}, 
     82           params: {module: moduleId, objectId: objectId,scroll:scrollby,scrollType:scrolltype}, 
    9483           method: 'POST', 
    9584           success: function(result, request){ 
    9685               var responseText = result.responseText; 
    97           document.getElementById('timeWorkedDiv').innerHTML = responseText; 
    98                   Ext.Ajax.request({ 
    99                    url: JSPRootURL +'/assignments/My/get_Time_Values_Array?module='+moduleId, 
    100                    params: {module: moduleId, objectId: objectId,scroll:scrollby}, 
    101                    method: 'POST', 
    102                    success: function(result, request){ 
    103                            var responseText =result.responseText; 
    104                            timeValues=new Array(); 
    105                            timeValues = responseText.split(","); 
    106                    }, 
    107                    failure: function(result, response){                            
    108                            extAlert(errorTitle, 'Server Request Failed..', Ext.MessageBox.ERROR); 
    109                            hidePopup(); 
    110                    } 
    111                 });      
     86           var splitVal=responseText.split('TimesValueArray'); 
     87                   document.getElementById("timeWorkedDiv").innerHTML = splitVal[0]; 
     88                   timeValues = new Array(); 
     89                   timeValues = splitVal[1].split(","); 
    11290           }, 
    11391           failure: function(result, response){                            
     
    142120        } 
    143121} 
    144  
    145 function showdiv1(){ 
    146         document.getElementById("div1").style.display="block"; 
    147         document.getElementById("div11").style.display="block"; 
    148         document.getElementById("div2").style.display="none"; 
    149         document.getElementById("div22").style.display="none"; 
    150 
    151  
    152 function showdiv2(){ 
    153         document.getElementById("div2").style.display="block"; 
    154         document.getElementById("div22").style.display="block"; 
    155         document.getElementById("div1").style.display="none"; 
    156         document.getElementById("div11").style.display="none"; 
     122function changeScrollType(scrolltype) 
     123
     124                getTimeSheetEntries(objectId,scrolltype); 
    157125} 
    158126 
     
    218186                timeSheetTable += '<table align="left" border="0" width="100%">'; 
    219187            timeSheetTable += '<tr>'; 
    220             timeSheetTable += '         <td width="30%" class="blogEntryLabel">Date:</td>'; 
    221             timeSheetTable += '         <td width="70%" nowrap="nowrap" class="blogEntryLabel">'+days[now.getDay()]+', '+months[now.getMonth()]+' '+now.getDate()+', '+now.getFullYear()+'</td>'; 
     188            timeSheetTable += '         <td width="70%" nowrap="nowrap" class="blogEntryTitle">'+days[now.getDay()]+', '+months[now.getMonth()]+' '+now.getDate()+', '+now.getFullYear()+'</td>'; 
    222189            timeSheetTable += '</tr>'; 
    223             timeSheetTable += '<tr><td colspan="2" class="blogbar"></td></tr>'; 
     190            timeSheetTable += '<tr><td colspan="1" class="blogbar"></td></tr>'; 
    224191            timeSheetTable += '<tr>'; 
    225             timeSheetTable += '         <td width="30%" class="blogEntryLabel">Topic:</td>'; 
    226             timeSheetTable += '         <td width="70%"><input type="text" size="40" maxlength="50" name="txttopic"/></td>'; 
     192            timeSheetTable += '         <td width="70%" nowrap="nowrap" class="blogEntryTitle">Task :'+selectedTask+'</td>'; 
    227193            timeSheetTable += '</tr></table>'; 
    228194                timeSheetTable += '</td></tr><tr><td>'; 
    229195                        timeSheetTable += '<table width="100%"><tr><td width="100%">'; 
    230                         timeSheetTable += '<font class="blogEntryLabel">Time Worked </font>';  
     196                        timeSheetTable += '<font class="blogEntryLabel">Time Worked: </font>';         
    231197