{include file="header.tpl.html" extra_title=$extra_title}

{if $note == ''}
<br />
<table width="100%" align="center">
  <tr>
    <td align="center">
      &nbsp;<span class="default"><b>{t escape="none"}The specified note does not exist. <br />
      It could have been converted to an email.{/t}</b>
      <br /><br />
      &nbsp;<a class="link" href="javascript:self.close();">{t}Close{/t}</a></span>
    </td>
  </tr>
</table>
{else}
{literal}
<script language="JavaScript">
<!--
function reply(id, issue_id)
{
    window.location.href = 'post_note.php?cat=reply&id=' + id + '&issue_id=' + issue_id;
}
function openRawHeaders()
{
{/literal}
    var features = 'width=740,height=580,top=60,left=60,resizable=yes,scrollbars=yes,toolbar=no,location=no,menubar=no,status=no';
    var headersWin = window.open('view_headers.php?cat=note&id={$smarty.get.id}', '_headers', features);
    headersWin.focus();
{literal}
}
function viewNote(id)
{
    window.location.href = 'view_note.php?id=' + id;
}
//-->
</script>
{/literal}
<form method="post" action="popup.php">
<table align="center" width="100%" cellpadding="3">
  <tr>
    <td>
      <table width="100%" cellspacing="1" cellpadding="2" border="0">
        <tr>
          <td colspan="2" class="default">
            <b>{t}View Note Details{/t}{if $issue_id} ({t}Associated with Issue{/t} #{$issue_id}){/if}</b>
          </td>
        </tr>
        {if $next != "" || $previous != ""}
        <tr>
          <td colspan="2" bgcolor="{$internal_color}" align="center">
            <table border="0" width="100%" cellspacing="0" cellpadding="1">
              <tr>
                <td>
                  {if $previous != ""}
                  <input class="button" type="button" value="&lt;&lt; {t}Previous Note{/t}" onClick="javascript:viewNote({$previous});">
                  {/if}
                </td>
                <td align="right">
                  {if $next != ""}
                  <input class="button" type="button" value="{t}Next Note{/t} &gt;&gt;" onClick="javascript:viewNote({$next});">
                  {/if}
                </td>
              </tr>
            </table>
          </td>
        </tr>
        {/if}
        <tr>
          <td width="120" bgcolor="{$internal_color}" class="default_white">
            <b>{t}Posted Date:{/t}</b>
          </td>
          <td bgcolor="{$light_color}" class="default">
            {$note.not_created_date}
          </td>
        </tr>
        <tr>
          <td width="120" bgcolor="{$internal_color}" class="default_white">
            <b>{t}From:{/t}</b>
          </td>
          <td bgcolor="{$light_color}" class="default">
            {$note.not_from|escape:"html"}
          </td>
        </tr>
        {if $recipients|@count > 0}
        <tr>
          <td width="120" bgcolor="{$internal_color}" class="default_white">
            <b>{t}Recipients{/t}:</b>
          </td>
          <td bgcolor="{$light_color}" class="default">
            {strip}
            {section name="i" loop=$recipients}
              {if not $smarty.section.i.first}, {/if}
              {$recipients[i]|escape:"html"}
            {/section}
            {/strip}
          </td>
        </tr>
        {/if}
        <tr>
          <td width="120" bgcolor="{$internal_color}" class="default_white">
            <b>{t}Title:{/t}</b>
          </td>
          <td bgcolor="{$light_color}" class="default">
            {$note.not_title|default:"<Empty Title>"|escape:"html"}
          </td>
        </tr>
        {if $note.attachments}
        <tr>
          <td width="120" bgcolor="{$internal_color}" class="default_white">
            <b>{t}Attachments:{/t}</b>
          </td>
          <td bgcolor="{$dark_color}" class="default">
            {section name="i" loop=$note.attachments}
            <a title="{t}download file{/t}" class="link" href="get_attachment.php?cat=blocked_email&note_id={$note.not_id}&filename={$note.attachments[i].filename}{if $note.attachments[i].cid}&cid={$note.attachments[i].cid|escape:"html"}{/if}"><img src="{$rel_url}images/attachment.gif" border="0"></a>
            <a title="{t}download file{/t}" class="link" href="get_attachment.php?cat=blocked_email&note_id={$note.not_id}&filename={$note.attachments[i].filename}{if $note.attachments[i].cid}&cid={$note.attachments[i].cid|escape:"html"}{/if}">{$note.attachments[i].filename}</a><br />
            {/section}
          </td>
        </tr>
        {/if}
        <tr>
          <td colspan="2" bgcolor="{$internal_color}">
            <table width="100%">
              <tr>
                <td>
                  <span class="default_white"><b>{t}Message:{/t}</b></span>
                  <span class="small_default_white">(<a class="white_link" href="javascript:void(null);" onClick="javascript:displayFixedWidth('email_message');">{t}display in fixed width font{/t}</a>)</span>
                </td>
                <td align="right" class="default_white">
                  {if $note.has_blocked_message}
                  <a class="white_link" href="javascript:void(null);" onClick="javascript:openRawHeaders();">{t}Blocked Message Raw Headers{/t}</a>
                  {/if}
                </td>
              </tr>
            </table>
          </td>
        </tr>
        <tr>
          <td colspan="2" bgcolor="{$light_color}" id="email_message" class="default">
{$note.message|highlight_quoted|nl2br|activateLinks}
          </td>
        </tr>
        <tr>
          <td colspan="2" bgcolor="{$internal_color}" align="center">
            <input class="button" type="button" value="{t}Reply{/t}" onClick="javascript:reply({$smarty.get.id}, {$issue_id});">&nbsp;&nbsp;
            <input class="button" type="button" value="{t}Close{/t}" onClick="javascript:window.close();">
          </td>
        </tr>
        {if $next != "" || $previous != ""}
        <tr>
          <td colspan="2" bgcolor="{$internal_color}" align="center">
            <table border="0" width="100%" cellspacing="0" cellpadding="1">
              <tr>
                <td>
                  {if $previous != ""}
                  <input class="button" type="button" value="&lt;&lt; {t}Previous Note{/t}" onClick="javascript:viewNote({$previous});">
                  {/if}
                </td>
                <td align="right">
                  {if $next != ""}
                  <input class="button" type="button" value="{t}Next Note{/t} &gt;&gt;" onClick="javascript:viewNote({$next});">
                  {/if}
                </td>
              </tr>
            </table>
          </td>
        </tr>
        {/if}
      </table>
    </td>
  </tr>
</table>
</form>

{include file="app_info.tpl.html"}
{/if}
{include file="footer.tpl.html"}