~porten-deactivatedaccount/eventum/devel

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
{literal}
<script type="text/javascript">
<!--
function viewDraft(draft_id, issue_id)
{
    var features = 'width=740,height=580,top=30,left=30,resizable=yes,scrollbars=yes,toolbar=no,location=no,menubar=no,status=no';
    var draftWin = window.open('send.php?cat=view_draft&issue_id=' + issue_id + '&id=' + draft_id, '_draft' + draft_id, features);
    draftWin.focus();
}
function createDraft(issue_id)
{
    var features = 'width=740,height=580,top=30,left=30,resizable=yes,scrollbars=yes,toolbar=no,location=no,menubar=no,status=no';
    var draftWin = window.open('send.php?cat=create_draft&issue_id=' + issue_id, '_createDraft', features);
    draftWin.focus();
}

function showAllDrafts(thisBox)
{
    if (thisBox.checked) {
        showValue = 1;
    } else {
        showValue = 0;
    }
    setCookie('show_all_drafts', showValue);
    document.location.href = document.location.href;
}
//-->
</script>
{/literal}
{if $smarty.request.show_all_drafts == 1}
  {assign var="draft_col_count" value="7"}
{else}
  {assign var="draft_col_count" value="6"}
{/if}
<table width="100%" bgcolor="{$cell_color}" border="0" cellspacing="0" cellpadding="1" align="center">
  <tr>
    <td width="100%">
      <table bgcolor="#FFFFFF" width="100%" cellspacing="1" cellpadding="2" border="0">
        <form name="draft_form">
        <tr>
          <td class="default" nowrap>
            <b>{t}Drafts{/t} ({$drafts|@count})</b>
          </td>
          <td align="right" class="default">
            [ <a class="link" href="#top">{t}Back to Top{/t}</a> ]
          {if $browser.ie5up or $browser.ns6up or $browser.gecko or $browser.safari or $browser.opera5up or $browser.safari or $browser.opera5up}
            [ <a id="drafts_link" class="link" href="javascript:void(null);" onClick="toggleVisibility('drafts');">{get_innerhtml element_name="drafts" total=$drafts|@count}</a> ]
            {/if}
          </td>
        </tr>
        <tr>
          <td colspan="2">
            <table width="100%" cellpadding="2" cellspacing="1">
              <tr id="drafts1" {get_display_style element_name="drafts" total=$drafts|@count} bgcolor="{$internal_color}">
                <td class="default_white" NOWRAP>{include file="expandable_cell/buttons.tpl.html" remote_func="getDraft" ec_id="draft"}</td>
                <td width="5" class="default_white" align="center">#</td>
                {if $smarty.request.show_all_drafts == 1}
                <td width="5%" class="default_white">{t}Status{/t}</td>
                {/if}
                <td width="20%" class="default_white">{t}From{/t}</td>
                <td width="20%" class="default_white">{t}To{/t}</td>
                <td width="20%" class="default_white" nowrap>{t}Last Updated Date{/t}</td>
                <td width="40%" class="default_white">{t}Subject{/t}</td>
              </tr>
              {section name="i" loop=$drafts}
              {cycle values=$cycle assign="row_color"}
              <tr id="drafts{$smarty.section.i.iteration+1}" {get_display_style element_name="drafts" total=$drafts|@count} {if $drafts[i].emd_status != 'pending'}style="text-decoration: line-through;"{/if}>
                <td class="default" NOWRAP bgcolor="{$row_color}">{include file="expandable_cell/buttons.tpl.html" ec_id="draft" list_id=$drafts[i].emd_id}</td>
                <td width="5" class="default" bgcolor="{$row_color}" align="center">{$smarty.section.i.iteration}</td>
                {if $smarty.request.show_all_drafts == 1}
                <td width="5%" class="default" bgcolor="{$row_color}">{$drafts[i].emd_status}</td>
                {/if}
                <td width="20%" class="default" bgcolor="{$row_color}">{$drafts[i].from|escape:"html"}</td>
                <td width="20%" class="default" bgcolor="{$row_color}">{$drafts[i].to|escape:"html"}</td>
                <td width="20%" class="default" nowrap bgcolor="{$row_color}">{$drafts[i].emd_updated_date}</td>
                <td width="40%" class="default" bgcolor="{$row_color}">
                  <a title="{t}view email details{/t}" href="javascript:void(null);" onClick="viewDraft({$drafts[i].emd_id}, {$smarty.get.id|intval});" class="link">{$drafts[i].emd_subject|default:"<Empty Subject Header>"|escape:"html"}</a>
                </td>
              </tr>
              {include file="expandable_cell/body.tpl.html" ec_id="draft" list_id=$drafts[i].emd_id colspan=$draft_col_count}
              {sectionelse}
              <tr id="drafts2" {get_display_style element_name="drafts" total=$drafts|@count}>
                <td colspan="{$draft_col_count}" bgcolor="{$light_color}" class="default" align="center">
                  <i>{t}No email drafts could be found.{/t}</i>
                </td>
              </tr>
              {/section}
              {if $current_role > $roles.reporter}
              <tr>
                <td colspan="{$draft_col_count}" bgcolor="{$internal_color}" align="center">
                  <table width="100%" border="0" cellpadding="0" cellspacing="0">
                    <tr>
                      <td width="20%">&nbsp;</td>
                      <td width="60%" align="center"><input type="button" value="{t}Create Draft{/t}" class="button" onClick="createDraft({$smarty.get.id|intval});"></td>
                      <td width="20%" align="right">
                        <input type="checkbox" name="show_all_drafts" id="show_all_drafts" value="1" {if $smarty.request.show_all_drafts == 1}checked{/if} onClick="showAllDrafts(this)"><span class="default_white"><label for="show_all_drafts">{t}Show All Drafts{/t}</label></span>
                      </td>
                    </tr>
                  </table>
                </td>
              </tr>
              {/if}
            </table>
          </td>
        </tr>
        </form>
      </table>
    </td>
  </tr>
</table>