home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 March / CHIPCD_3_98.iso / software / testsoft / exchange / webdata / usa / forms / report / ipnrn / frmroot.asp
Text File  |  1997-08-25  |  10KB  |  300 lines

  1. <!--#include file="../../../constant.inc"-->
  2. <!--#include file="../../../lib/Store.inc"-->
  3. <!--#include file="../../../lib/Render.inc"-->
  4. <!--#include file="../../../lib/session.inc"-->
  5. <!--#include file="../../../lib/jsutil.inc"-->
  6. <% 
  7. '<!--Microsoft Outlook Web Access-->
  8. '<!--frmRoot.asp : Root frame for IPM.Note
  9. '<!--Copyright (c) Microsoft Corporation 1993-1997. All rights reserved.-->
  10.  
  11. On Error Resume Next
  12.  
  13. CheckSession2 bstrVirtRoot + "/forms/report/ipnrn/frmroot.asp?timedout=1"
  14.  
  15. '''do own checkindex (avoid pageutil (15k))
  16. strIndex = Request.QueryString("index")
  17. If Len(strIndex) > 0 Then
  18.    iIndex = CInt(strIndex)
  19.    Session(CURRENT_INDEX) = iIndex
  20. End If
  21.  
  22. urlcommand = Request.QueryString("command")
  23. url = Request.QueryString()
  24. bstrObj = Request.QueryString("obj")
  25.  
  26. Set objRenderer = GetObjectRenderer
  27.  
  28. bstrError = ""
  29. fHasAttach=false
  30. If Request.QueryString("timedout") <> "" Then
  31.    bstrError = "<b>" + L_Error_ErrorMessage + "<br><br>" _ 
  32.                   + L_errFailOpenMessage_ErrorMessage + "</b><br>" _
  33.                   + L_errMessageTimedOut2_ErrorMessage
  34. Else
  35.      'Get the message from the cache
  36.       Set objOneMsg = Session(bstrObj)
  37.       If objOneMsg Is Nothing Then
  38.          'If the message was not in the cache then try and get it from the database
  39.          Set objOneMsg = OpenMessage(bstrObj)
  40.  
  41.          If objOneMsg.ID = "" Then
  42.                  If Request.QueryString("timedout")<>"" Then 'session timedout - lost message
  43.                      bstrError = "<b>" + L_Error_ErrorMessage + "<br><br>" _ 
  44.                            + L_errFailOpenMessage_ErrorMessage + "</b><br>" _
  45.                            + L_errMessageTimedOut_ErrorMessage
  46.                  Else
  47.                      bstrError = "<b>" + L_Error_ErrorMessage + "<br><br>" _ 
  48.                            + L_errFailOpenMessage_ErrorMessage + "</b><br>" _
  49.                            + L_errMessageDeleted_ErrorMessage
  50.                  End If
  51.          Else
  52.             Set Session(bstrObj) = objOneMsg
  53.             AddIDToCache(bstrObj)
  54.          End If
  55.        End If
  56. End If
  57.  
  58. bcMsgBdy = "#c0c0c0" 'gray
  59. bcMsgHdr = "#a0a0a0"
  60. bcToolbar = "#707070"
  61. fcToolbar = "#cccc99"
  62.  
  63. CheckSession
  64.  
  65. bAuthenticated = Session(bstrAuthenticated)
  66. 'validate underlying message structure
  67. Set objMessages = Session(CURRENT_CONTENTS) 
  68. If objMessages Is Nothing Or Err.Number <> 0 Then fHaveContent = False Else fHaveContent = True
  69.  
  70. %>
  71. <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 3.2//EN">
  72.  
  73. <% If objOneMsg.ID="" Then
  74.     ReportErrorClose L_errMessageDeleted_ErrorMessage
  75. Else
  76.     Set objRenderMsg = GetMessageRenderer
  77.     objRenderMsg.DataSource = objOneMsg
  78. %>
  79.  
  80. <HEAD>
  81. <TITLE><%objRenderMsg.RenderProperty ActMsgPR_SUBJECT, 0, Response%></TITLE>
  82. </HEAD>
  83. <SCRIPT language=javascript>
  84. function DoCommand(szCommand) {
  85.           
  86.     if (szCommand == "delete"){
  87.       self.location="<%=bstrVirtRoot%>/forms/report/commands.asp?command=delete&obj=<%=bstrObj%>";
  88.       
  89.     }
  90.      else if (szCommand == "forward"){
  91.       self.location="<%=bstrVirtRoot%>/forms/report/commands.asp?command=forward&obj=<%=bstrObj%>";
  92.       
  93.     }
  94.  
  95.     else if (szCommand == "close"){
  96.        self.close();
  97.     }
  98.     else if (szCommand == "next"){
  99.       
  100.       self.location="<%=bstrVirtRoot%>/item.asp?action=next";
  101.     }
  102.      else if (szCommand == "previous"){
  103.       
  104.       self.location="<%=bstrVirtRoot%>/item.asp?action=prev";
  105.     }
  106.  
  107. }
  108.  
  109. </Script>
  110.  
  111. <BODY TEXT=000000 BGCOLOR=<%=bcMsgBdy%> TOPMARGIN=4 LEFTMARGIN=4 text=000000 link=000000 vlink=000000 alink=000000>
  112. <!--- begin toolbar --------->
  113. <form>
  114. <TABLE BORDER=0 bgcolor=<%=bcMsgBdy%> CELLSPACING=0 CELLPADDING=0 WIDTH="100%">
  115. <tr>
  116. <td width=100%>
  117. <img src="<%=bstrVirtRoot%>/images/divider.gif" width=4 height=24 align="middle">
  118.  
  119. <% If fHaveContent Then 'validate underlying message structure %>
  120. <%        If bAuthenticated Then 'Anon can't reply/fwd (no inbox) %>
  121.  
  122. <A href="JavaScript:DoCommand('forward')">  
  123. <IMG SRC="<%=bstrVirtRoot%>/forms/forward.gif" Alt="<%=L_Forward_ToolTip%>" align="middle" border=0 height=24 width=24></a>
  124.  
  125. <img src="<%=bstrVirtRoot%>/images/divider.gif" width=4 height=24 align="middle">
  126.  
  127. <a href="JavaScript:openNewWindow('<%=bstrVirtRoot%>/movcpy/root.asp?msgID=<%=bstrObj%>&fldID=<%=objOneMsg.FolderID%>&process=1','newMessageWindow',440,500)">
  128. <IMG SRC="<%=bstrVirtRoot%>/forms/movcpy.gif" align="middle" Alt="<%=L_MoveCopy_ToolTip%>" border=0 height=24 width=24></a>
  129.  
  130. <img src="<%=bstrVirtRoot%>/images/divider.gif" width=4 height=24 align="middle">
  131.  
  132. <%        End If %>
  133. <%        End If %>
  134.  
  135. <A href="JavaScript:DoCommand('delete')">  
  136. <IMG SRC="<%=bstrVirtRoot%>/forms/delmark.gif" Alt='<%=L_Delete_ToolTip%>' align="middle" border=0 height=24 width=24></a>
  137.  
  138. <img src="<%=bstrVirtRoot%>/images/divider.gif" width=4 height=24 align="middle">
  139.  
  140. <A href="JavaScript:DoCommand('previous')">  
  141. <IMG SRC="<%=bstrVirtRoot%>/forms/prevmsg.gif" Alt="<%=L_PrevMsg_ToolTip%>" align="middle" border=0 width=24 height=24></a>
  142.  
  143. <A href="JavaScript:DoCommand('next')">  
  144. <IMG SRC="<%=bstrVirtRoot%>/forms/nextmsg.gif" Alt='<%=L_NextMsg_ToolTip%>' align="middle" border=0 width=24 height=24></a>
  145.  
  146.  
  147. <img src="<%=bstrVirtRoot%>/images/divider.gif" width=4 height=24 align="middle">
  148.  
  149. <A href="JAVASCRIPT:openNewWindow('<%=bstrVirtRoot%>/help/READMSG.HTM','inlineHelpWindow',600,400)">
  150. <IMG SRC="<%=bstrVirtRoot%>/images/help.gif" alt="<%=L_Help_ToolTip%>" align="middle" border=0 height=20 width=20></a>
  151.  
  152. <img src="<%=bstrVirtRoot%>/images/divider.gif" width=4 height=24 align="middle">
  153. </td>
  154.  
  155. <td align="right">
  156. <input type="button" value="Close" onClick="DoCommand('close')">
  157. </td>
  158.  
  159. </tr>
  160.  
  161. </table>
  162. </form>
  163. <!--<br>-->
  164. <!--- begin header --->
  165. <TABLE border=0 cellpadding=3 cellspacing=0 width="100%" bgcolor=<%=bcMsgBdy%>>
  166.     <TR> 
  167.         <TD width=10%>
  168.             <font size=2><b><%=L_From_StaticText%></b></font>
  169.         </TD>        
  170.         <TD>
  171.             <font size=2>
  172. <% 
  173. AddrType = objOneMsg.Fields(ActMsgPR_SENT_REPRESENTING_ADDRTYPE)
  174. Address  = objOneMsg.Fields(ActMsgPR_SENT_REPRESENTING_EMAIL_ADDRESS)
  175. objRenderMsg.RenderProperty ActMsgPR_SENT_REPRESENTING_NAME, 0, Response %>
  176. <% If AddrType <> "" And AddrType <> "EX" And Address <> "" Then %>
  177. [<% objRenderMsg.RenderProperty ActMsgPR_SENT_REPRESENTING_ADDRTYPE, 0, Response %>:<% objRenderMsg.RenderProperty ActMsgPR_SENT_REPRESENTING_EMAIL_ADDRESS, 0, Response %>]
  178. <% End If %>
  179.             </font>
  180.         </TD>
  181.     </TR>
  182.     <TR> 
  183.         <TD>
  184.             <font size=2><b><%=L_TO_StaticText%></b></font>
  185.         </TD>        
  186.         <TD>
  187.             <font size=2>
  188.             <% objRenderMsg.RenderProperty ActMsgPR_DISPLAY_TO, 0, Response %> 
  189.             </font>
  190.         </TD>
  191.     </TR>
  192.     
  193.     <TR>
  194.         <TD><font size=2><b><%=L_CC_StaticText%></b></font>
  195.         </TD>        
  196.         <TD><font size=2>
  197.             <% objRenderMsg.RenderProperty ActMsgPR_DISPLAY_CC, 0, Response %> 
  198.             </font>
  199.         </TD>
  200.     </TR>
  201.     <TR>
  202.         <TD> </TD>
  203.     </TR>
  204.     </TABLE>
  205.  
  206.  
  207. <!---begin subject bar --->
  208.     <TABLE width="100%" border=0 cellspacing=0 cellpadding=3>
  209.     <TR bgcolor=<%=bcMsgBdy%> width=100% valign=baseline>
  210.         <TD width=10%>
  211.             <font color=000000 size=2><b><%=L_Subject_StaticText%></b></font>
  212.         </TD>
  213.         <TD colspan=3>
  214.             <font color=000000 size=2>
  215.             <% objRenderMsg.RenderProperty ActMsgPR_SUBJECT, 0, Response %> 
  216.             </font>
  217.         </TD>
  218.         </tr><tr>
  219.         <TD>
  220.             <font size=2><nobr><b><%=L_Sent_StaticText%></b>
  221.         </td><td width=62%><font size=2>
  222.             <% objRenderMsg.RenderProperty ActMsgPR_CLIENT_SUBMIT_TIME, 0, Response %> </nobr><br>
  223.         </TD>
  224.         <TD align=right>
  225.             <font size=2><nobr><b><%=L_Importance_StaticText%></b>
  226.         </td><td align=right><font size=2>
  227.             <% objRenderMsg.RenderProperty ActMsgPR_IMPORTANCE, 0, Response %> </nobr>
  228.             </font>
  229.         </TD>
  230.     </TR>
  231.     </TABLE>
  232.  
  233.  
  234. <!--- message text ----->
  235.     <TABLE width="100%" border=1 cellspacing=2 cellpadding=6>
  236. <TR>
  237.     <TD bgcolor=white width=100% height=300 valign=top colspan=2 >
  238.         <%
  239.         strMsgData = L_YourMessage_Text & vbCrLf & vbCrLf
  240.         
  241.         strMsgData= strMsgData & L_TO_StaticText
  242.         If objOneMsg.Fields.Item(ActMsgPR_ORIGINAL_DISPLAY_TO) <> "" then
  243.             strMsgData = strMsgData & " " & objOneMsg.Fields.Item(ActMsgPR_ORIGINAL_DISPLAY_TO) 
  244.         End If
  245.  
  246.         strMsgData=strMsgData & vbCrLf
  247.  
  248.         If objOneMsg.Fields.Item(ActMsgPR_ORIGINAL_DISPLAY_CC) Is Nothing then
  249.         Else
  250.             strMsgData= strMsgData & L_CC_StaticText
  251.             strMsgData = strMsgData & " "  &  objOneMsg.Fields.Item(ActMsgPR_ORIGINAL_DISPLAY_CC) 
  252.             strMsgData=strMsgData & vbCrLf
  253.         End If
  254.  
  255.         If objOneMsg.Fields.Item(ActMsgPR_ORIGINAL_DISPLAY_BCC) Is Nothing then
  256.         Else
  257.             strMsgData= strMsgData & L_BCC_StaticText
  258.             strMsgData = strMsgData & " "  &  objOneMsg.Fields.Item(ActMsgPR_ORIGINAL_DISPLAY_BCC)
  259.             strMsgData=strMsgData & vbCrLf
  260.         End If
  261.  
  262.         strMsgData=strMsgData & L_Subject_StaticText
  263.         If objOneMsg.Fields.Item(ActMsgPR_ORIGINAL_SUBJECT) <> "" Then
  264.             strMsgData = strMsgData  &  " " & objOneMsg.Fields.Item(ActMsgPR_ORIGINAL_SUBJECT)
  265.         End If
  266.  
  267.         strMsgData=strMsgData & vbCrLf
  268.  
  269.         strMsgData=strMsgData & L_Sent_StaticText & " " & objOneMsg.Fields.Item(ActMsgPR_ORIGINAL_SUBMIT_TIME) & vbCrLf & vbCrLf 
  270.         
  271.         strMsgData = strMsgData  & " " & L_IPNRNread_Text & " " & objOneMsg.Fields.Item(ActMsgPR_CREATION_TIME)
  272.         
  273.         objOneMsg.Text=strMsgData
  274.  
  275.         'Do all the things that we would normally do at the end to prevent two calls to
  276.         'msg.update.  We have to call update() here because message does not have any text
  277.         'body yet.  In order to call RenderProperty, we must call Update to give our
  278.         'message a body!!!
  279.  
  280.         If bAuthenticated Then
  281.             objOneMsg.Unread = False
  282.         End If
  283.         
  284.         objOneMsg.Update
  285.         
  286.         Err.Clear
  287.  
  288.         objRenderMsg.RenderProperty ActMsgPR_RTF_COMPRESSED, 0, Response
  289.  
  290.         Set Session(bstrObj) = Nothing
  291.  
  292.         %> 
  293.     </TD>
  294. </TR>
  295. </TABLE>
  296.  
  297. </BODY>
  298. </HTML>
  299.  
  300. <%End If%>