<%@ page import="com.progress.lang.Character" %> <%@ page import="com.progress.lang.LongChar" %> <%@ page import="java.util.*"%> <%@ page import="com.savvion.sbm.bpmportal.service.CollaborationService"%> <%@ page import="com.savvion.sbm.bizmanage.api.*" %> <%@ page import="com.savvion.sbm.bizlogic.server.svo.*" %> <%@ page import="com.savvion.sbm.bpmportal.bizsite.util.*"%> <%@ page import="com.savvion.sbm.bpmportal.util.ServletUtilities" %> <%@ page import="com.savvion.sbm.bizmanage.aim.AimUtil"%> <%@ page import="com.savvion.sbm.bpmportal.util.DateTimeUtils"%> <%@ page import="com.savvion.sbm.bizmanage.pagegenerator.ServletTools"%> <%@ page import="com.savvion.sbm.bpmportal.util.PortalConstants" %> <%@ page import="com.savvion.common.appinfo.AppInfo" %> <%@ page import="com.savvion.common.appinfo.AppInfoKeeper" %> <%@ page import="com.savvion.sbm.bpmportal.util.PortalDateFormatter" %> <%@ page import="com.savvion.sbm.bpmportal.util.PortalNumberFormatUtil" %> <%@ page import="com.savvion.sbm.bpmportal.bizsite.util.HexEncoder" %> <%@ page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8" %> <%@ include file="../common/include_tag.jspf" %> <%@ taglib uri="/bpmportal/tld/bpmportal.tld" prefix="sbm" %> <% String loginUser = bizSite.getCurrentUser(); bizManage.setRequest(request); bizManage.setResponse(response); String menu1 = "0"; String submenu1 = "9"; String bizsite_taskNameE = ServletTools.getUTFString(request,"bizsite_taskNameE"); long cWorkItemId = Long.valueOf(ServletTools.getUTFString(request,"cwiId")); boolean isCollaborator = false; isCollaborator = Boolean.valueOf(ServletTools.getUTFString(request,"isCollaborator")); Map collabDetails = CollaborationService.getCollaborativeTaskDetails(cWorkItemId, bizManage); boolean isTaskTerminated = (Boolean)collabDetails.get(CollaborationService.IS_TERMINATED); boolean isTaskCompleted = (Boolean) collabDetails.get(CollaborationService.IS_COMPLETED); boolean isTaskAssigned = (Boolean) collabDetails.get(CollaborationService.IS_ASSIGNED); String viewCollabFlag = ServletTools.getUTFString(request,"viewCollaboration"); int taskAccessType = (Integer) collabDetails.get(CollaborationService.ACCESSTYPE); String cTaskName = (String) collabDetails.get(CollaborationService.CTASKNAME); String instructions = (String) collabDetails.get(CollaborationService.INSTRUCTIONS); ArrayList dataslots = (ArrayList) collabDetails.get(CollaborationService.DATASLOTS); String strResponse = (String) collabDetails.get(CollaborationService.RESPONSE); boolean isDataslotEditable = !(taskAccessType == 0 ||(!isCollaborator)); boolean isNotesEnabled = (Boolean) collabDetails.get(CollaborationService.NOTESENABLED); String ptName = (String) collabDetails.get(CollaborationService.PTNAME); String wsName = (String) collabDetails.get(CollaborationService.WSNAME); AppInfo appInfo = AppInfoKeeper.getAppInfo(ptName); long workItemId = (Long) collabDetails.get(CollaborationService.PWIID); %> <sbm:message key="collaborativeTaskDetail" /> - <sbm:message key="SBM" /> <%@ include file="../common/include_css_static.jsp" %> <%@ include file="../common/include_top.jsp" %>
<%@ include file="../common/include_body.jsp" %>
<%@ include file="../common/include_menu_static.jsp" %>
<% if(ServletUtil.isBreadcrumbEnabled(request)) {%> <% } %>
');"> <%@ include file="../common/include_form_body.jsp" %>
<% boolean enableButtons = false; StringBuffer dateConvert = new StringBuffer(""); StringBuffer textAreaCheck = new StringBuffer(""); StringBuffer dateFix = new StringBuffer(""); for (int i=0;i <% // check for dataslot accessType if(taskAccessType == 0 || taskAccessType == 1) { %> <% if (dataslot.hasChoices()) { ArrayList allchoices = dataslot.getChoices(); HashMap choiceLabels = dataslot.getChoiceLabels(); %> <% } //end dataslot.hasChoices(); else if (dataslot.isDocument() || dataslot.isObject() || dataslot.isSet()) { if (dataslot.isDocument()) { dataslot.setUpdatable(isDataslotEditable && dataslot.updatable()); } else { dataslot.setUpdatable(isDataslotEditable); } %> <%= ((dataslot.isDocument())?"":"") %> <% } //end dataslot.isDocument() || dataslot.isObject() || dataslot.isSet() || dataslot.isList()//end dataslot.isDocument() || dataslot.isObject() || dataslot.isSet() || dataslot.isList() else if (dataslot.isABLLongChar()) { String dsValue = ""; LongChar charValue = null; if (dataslot.getValue() instanceof LongChar) { charValue = (LongChar) dataslot.getValue(); dsValue = charValue.getValue(); } else dsValue = (null == dataslot.getValue()) ? "" : dataslot.getValue().toString(); if (dsValue != null) { final String tempVal = dsValue; dsValue = PortalUtil.getShortString(tempVal); } else dsValue = ""; %> <% } //end dataslot.isABLLongChar() else if (dataslot.isMultiLine()) { %> <% textAreaCheck.append("var textarea").append(i).append(" = document.getElementById('ta").append(i).append("');\n"); textAreaCheck.append("if (textarea").append(i).append(".value.length > ").append(dataslot.getSize()-1).append(")\n"); textAreaCheck.append("{\n"); textAreaCheck.append("\talert('").append(bizManage.getResourceString("textAreaAlert1")).append(" ").append(dataslot.getLabel()); textAreaCheck.append(" ").append(bizManage.getResourceString("textAreaAlert2")).append(" ").append(dataslot.getSize()-1); textAreaCheck.append(" ").append(bizManage.getResourceString("textAreaAlert3")).append("');\n"); textAreaCheck.append("\treturn false;\n"); textAreaCheck.append("}\n"); } //end dataslot.isMultiLine() else if (dataslot.isBoolean() || dataslot.isABLLogical()) { %> <% } //end datslot.isBoolean() else if (dataslot.isString() || dataslot.isURL() || dataslot.isABLCharacter() || dataslot.isABLLongChar()) { String inputType = "text"; if(dataslot.isPassword()){ inputType = "password"; } String dsValue = ""; if ((dataslot.isABLCharacter() || dataslot.isABLLongChar()) && dataslot.getValue() instanceof Character) { Character charValue = (Character) dataslot.getValue(); dsValue = charValue.getValue(); dsValue = (dsValue == null) ? "" : AimUtil.getHtmlSafeString(dsValue); } else dsValue = AimUtil.getHtmlSafeString(dataslot.getValue().toString()); %> <% }// end dataslot.isString() || dataslot.isURL else if (dataslot.isLong() || dataslot.isDouble() || dataslot.isABLInteger() || dataslot.isABLInt64()) { String type = "text"; String finalValue = ""; Number nValue = null; try{ if(dataslot.isLong()) nValue = Long.parseLong(dataslot.getValue().toString()); else if(dataslot.isDouble()) nValue = Double.parseDouble(dataslot.getValue().toString()); else if(dataslot.isABLInteger()){ com.progress.lang.Integer intt = (com.progress.lang.Integer)dataslot.getValue(); if(intt.getValue() != null){ nValue = Integer.parseInt(dataslot.getValue().toString()); } } else if(dataslot.isABLInt64()){ com.progress.lang.Int64 int64 = (com.progress.lang.Int64)dataslot.getValue(); if(int64.getValue() != null){ nValue = Long.parseLong(dataslot.getValue().toString()); } } }catch(Exception ex){} if( ! ( nValue == null && (dataslot.isABLInteger() || dataslot.isABLInt64())) ) finalValue = PortalNumberFormatUtil.prepareLocalizedNumber(nValue, bizManage.getLocale()); %> <% }// end dataslot.isLong() || dataslot.isDouble() else if (dataslot.isABLDecimal()) { String dsValue; Locale locale = bizManage.getLocale(); java.math.BigDecimal bigdecimal = (java.math.BigDecimal) (((com.progress.lang.Decimal)(dataslot.getValue())).getValue()); if(bigdecimal != null) dsValue = PortalNumberFormatUtil.prepareLocalizedNumber(bigdecimal, bizManage.getLocale()); else dsValue = ""; %> <% }// end dataslot.isABLDecimal() else if (dataslot.isDecimal()) { Decimal decimal = (Decimal) dataslot.getValue(); String overallValue = PortalNumberFormatUtil.prepareLocalizedNumber(decimal.getValue(), bizManage.getLocale()); %> <% }// end dataslot.isDecimal() else if (dataslot.isDateTime() || dataslot.isABLDateTime()) { String datetimeValue = ""; if(dataslot.isABLDateTime()){ com.progress.lang.DateTimeTZ dateTimeTZ = (com.progress.lang.DateTimeTZ) dataslot.getValue(); java.util.GregorianCalendar gc = (java.util.GregorianCalendar) dateTimeTZ.getValue(); datetimeValue = gc == null ? "" : bizManage.getDate(gc.getTime().getTime(), ptName, dataslot.getName()); }else{ Object anyDateObject = dataslot.getValue(); if (anyDateObject instanceof com.progress.lang.Int64) { com.progress.lang.Int64 sysDsDate = (com.progress.lang.Int64) anyDateObject; if (sysDsDate.getValue() != null) { Long longVal = sysDsDate.getValue(); datetimeValue = bizManage.getDate(longVal, ptName, dataslot.getName()); } } else if (anyDateObject instanceof DateTime) { DateTime datetime = (DateTime) anyDateObject; datetimeValue = ( (datetime == null) ? "": ( (datetime.getValue() == null) ? "" : bizManage.getDate(datetime.getValue().getTime(), ptName, dataslot.getName()))); } } dateConvert.append("\tdocument.dataslot.").append(dataslot.getName()); dateConvert.append(".value = date2Long(document.dataslot.").append(dataslot.getName()); dateConvert.append(".value);\n"); dateFix.append("\tlong2Date(document.dataslot.").append(dataslot.getName()).append(");\n"); %> <% }// end dataslot.isDateTime() else if (dataslot.isXML()) { dataslot.setUpdatable(isDataslotEditable); %> <% }// end dataslot.isXML() else if (dataslot.isMap()) { %> <% } else if (dataslot.isList()){ Vector v = (Vector) dataslot.getValue(); if(v == null){ v = new Vector(); } Iterator it = v.iterator (); %> <% }// end dataslot.isMap() %> <% } %> <% } %> <%-- This is the end of the dataslot table. --%> <%-- Instruction field for collaborator (Non Editable) --%>
" width="35%"> <%= dataslot.getLabel() %> <% if(dataslot.isRequired()){ %> * <% } %> "> " ><%= dataslot.getValue().toString() %> <% if(dataslot.isDocument()) { %> <% } %> " width="80%">
<%= dsValue%> &PIID=<%=collabDetails.get("piid")%>&dsName=<%=dataslot.getName()%>&dontUpdate=<%=(taskAccessType == 0 ||(!isCollaborator)||isReadOnly)%>','popusergroupsearch','scrollbars=yes,resizable=yes,width=900,height=600')"/>
" > ">
<%= ((dataslot.getValue().toString().equalsIgnoreCase("true"))?" checked=\"checked\"":"") %> name="<%= dataslot.getName() %>" value="true" />        <%= ((dataslot.getValue().toString().equalsIgnoreCase("false"))?" checked=\"checked\"":"") %> name="<%= dataslot.getName() %>" value="false" />
"> class="InptTxt" name="<%= dataslot.getName() %>" value="<%= dsValue %>" <%= ((dataslot.isString())?"maxlength=\""+dataslot.getSize()+"\"":"") %> <%= (dataslot.getValidationType() != null) ? ("alt=\""+dataslot.getValidationType()+"\""):"" %> size="40" /> "> class="InptTxt" name="<%= dataslot.getName() %>" value="<%= finalValue %>" <%= ((dataslot.isString())?"maxlength=\""+dataslot.getSize()+"\"":"") %> <%= (dataslot.getValidationType() != null) ? ("alt=\""+dataslot.getValidationType()+"\""):"" %> size="40" /> " width="50%">
id="<%= dataslot.getName() %>" name="<%= dataslot.getName() %>" value="<%= dsValue %>" <%= (dataslot.getValidationType() != null) ? ("alt=\""+dataslot.getValidationType()+"\""):"" %> />
"> <% if(taskAccessType != 0 && (isCollaborator) && (!isReadOnly)) { %> <% } %>
id="<%= dataslot.getName() %>" onclick="editDecimal('<%= dataslot.getName() %>','<%= String.valueOf(decimal.getPrecision() - decimal.getScale()) %>','<%= String.valueOf(decimal.getScale()) %>');" class="InptTxt" name="<%= dataslot.getName() %>" size="5" value="<%= overallValue %>" <%= (dataslot.getValidationType() != null) ? ("alt=\""+dataslot.getValidationType()+"\""):"" %>/>    /images/icon_edit_decimal_dataslot.gif" width="16" height="16" border="0" title="" />
" width="50%"> <% String dateFmt = DateTimeUtils.getJSCalendarDateFormat(ptName, dataslot.getName(), wsName, bizManage.getLocale(), bizManage.getName()); %>
id="<%= dataslot.getName() %>" name="<%= dataslot.getName() %>" value="<%= datetimeValue %>" <%= (dataslot.getValidationType() != null) ? ("alt=\""+dataslot.getValidationType()+"\""):"" %>/> <%= ((taskAccessType == 0 ||(!isCollaborator)||isReadOnly)?"":"")%>Select Date/images/calender.gif" width="16" height="16" border="0" vspace="2" hspace="2" /><%= ((taskAccessType == 0 ||(!isCollaborator)||isReadOnly)?"":"") %>
"> <%= (String)dataslot.getValue() %> "> <% Map mapValue = (Map)dataslot.getValue(); if(mapValue != null && mapValue.size() > 0 ) { Set keys = mapValue.keySet(); Iterator iter = keys.iterator(); while (iter != null && iter.hasNext()) { String key = (String)iter.next(); Object oval = mapValue.get(key); String val = "FALSE"; if (oval != null) val = oval.toString(); %> <% } } session.setAttribute(dataslot.getName(),mapValue); %>
<%= ((taskAccessType == 0 ||(!isCollaborator)||isReadOnly)?" disabled=\"disabled\"":"") %> ><%=key%>
">
">: ">
" >: ">
<% if(isNotesEnabled) { %> <%}%> <% } else { if(isTaskAssigned) { %> <% } } %> <% if(isCollaborator) {%> <%} String forwardTo = (String)session.getAttribute(PortalConstants.FORWARD_TO); if(null == forwardTo){ forwardTo = PortalConstants.URI_MYHOME_MYTASKS; } %> <% //} %>
" class="ScrnButton" onMouseOver="this.className='ScrnButtonHover';" onMouseOut="this.className='ScrnButton';" onClick="goToNotes();"> <% if(isCollaborator && (isTaskCompleted == false)) { %> " class="ScrnButton" onMouseOver="this.className='ScrnButtonHover';" onMouseOut="this.className='ScrnButton';" onClick="doAction('save');"> " class="ScrnButton" onMouseOver="this.className='ScrnButtonHover';" onMouseOut="this.className='ScrnButton';" onClick="doAction('complete');"> " class="ScrnButton" onMouseOver="this.className='ScrnButtonHover';" onMouseOut="this.className='ScrnButton';" onClick="doAction('decline');"> " class="ScrnButton" onMouseOver="this.className='ScrnButtonHover';" onMouseOut="this.className='ScrnButton';" onClick="doAction('terminate');"> " class="ScrnButton" onMouseOver="this.className='ScrnButtonHover';" onMouseOut="this.className='ScrnButton';"onclick="document.dataslot.reset();fixDatesOnReset();"> <% if(!isCollaborator) { %> " class="ScrnButton" onMouseOver="this.className='ScrnButtonHover';" onMouseOut="this.className='ScrnButton';" onClick="MM_goToURL('self','../myhome/bizsite.ctask.list');return document.MM_returnValue"> <% } else { %> " class="ScrnButton" onMouseOver="this.className='ScrnButtonHover';" onMouseOut="this.className='ScrnButton';" onClick="MM_goToURL('self','<%=forwardTo%>');return document.MM_returnValue"> <% } %>
<%@ include file="../common/include_copyright_static.jsp" %>
<%@ include file="../common/include_bottom.jsp" %>