## -*- coding: utf_8 -*- <% from fcp import connection from fcp import fcpdefs from fcutils import util from fcws.fcweb import webutil from fcp import mlitem import os.path import urllib %> <%namespace name="fcnames" file="fcnames.html" import="renderFCNames"/> <% myMLItem = fcp.MyMLItem thisWebID = myMLItem.WebID() type = myMLItem.Type() subType = myMLItem.SubType() jsonStr = fcp.MeAsJSON((client.serverTZ,client.clientTZ)) isEditable = True if fcp.rights & fcpdefs.acWrite else False canEdit = isEditable isSent = True if myMLItem.Status() & fcpdefs.Sent or type == fcpdefs.oConfItem else False if isSent and isEditable and pageargs and not 'Editable' in pageargs: isEditable = False editableClass = " editable" if isEditable else " readonly" fType,subject = fcp.GetEscapedFormField(fcpdefs.dSubject) if subject is None: subject = "" fType,objName = fcp.GetEscapedFormField(fcpdefs.dObjName) if (type == fcpdefs.oDocument or type == oFormDoc) and subject is "" else (None,None) if objName is None: objName = "" windowTitle = objName if len(objName) else ("New Message" if isEditable and subject is "" else subject) fType,envInfo = fcp.GetEscapedFormField(fcpdefs.dEnvInfo) dateSent,NTo,NCc = envInfo fwdNames = fcp.GetMsgNameList(fcpdefs.dFwdNames) fromNames = fcp.GetMsgNameList(fcpdefs.dFromName) if fwdNames and len(fwdNames) and fromNames: fromNames = fromNames + fwdNames numFromNames = len(fromNames) if fromNames else 0 fromseparator ="" toNames = fcp.GetMsgNameList(fcpdefs.dToName) numToNames = len(toNames) if toNames else 0 ccNames = fcp.GetMsgNameList(fcpdefs.dCopyName) numCcNames = len(ccNames) if ccNames else 0 bccNames = fcp.GetMsgNameList(fcpdefs.dBCCNames) numBccNames = len(bccNames) if bccNames else 0 nvNames = [] numNvNames = [] for i in xrange(0,9): nvNames.append(fcp.GetMsgNameList(fcpdefs.dNameVal1+i)) numNvNames.append(len(nvNames[i]) if nvNames[i] else 0) msgStatus = fcp.MyMLItem.Status() body = fcp.body if fcp.body is not None else "" fromNameID = 'fcfid-'+str(fcpdefs.dFromName) subjectID = 'fcfid-'+str(fcpdefs.dSubject) toNameID = 'fcfid-'+str(fcpdefs.dToName) ccNameID = 'fcfid-'+str(fcpdefs.dCopyName) bccNameID = 'fcfid-'+str(fcpdefs.dBCCNames) attachClasses = 'fc-form-row multiline' if fcp.GetNthMLItem(0) is None and not isEditable: attachClasses += ' fc-mouse-only' %>
%if canEdit: %if isSent and not isEditable: %else:
%if not isSent: %endif %endif   %endif
%if isEditable:
%endif
%if isEditable: %else: ${subject}
%endif
%if not isEditable: ${fcnames.renderFCNames(fromNames,fcpdefs.dFromName,"From:",isEditable,False,"",fromseparator)} %endif %if numToNames > 0 or isEditable: ${fcnames.renderFCNames(toNames,fcpdefs.dToName,"To:",isEditable,True,"","")} %endif %if numCcNames > 0 or numBccNames > 0 or isEditable:
%if numCcNames > 0 or isEditable: ${fcnames.renderFCNames(ccNames,fcpdefs.dCopyName,"Cc:",isEditable,True,"","")} %endif %if numBccNames > 0 or isEditable: ${fcnames.renderFCNames(bccNames,fcpdefs.dBCCNames,"Bcc:",isEditable,True,"","")} %endif
%endif %if fcp.GetNthMLItem(0) or isEditable:
%if isEditable:
%else:
%endif
    %endif
    %if isEditable: %else:
    %endif