~eventum-developers/eventum/trunk

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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
{extends "base.tpl.html"}
{block "title"}#{$issue_id} - Upload File{/block}

{block "javascripts" append}
  {include file="include/dropzone.tpl.html" form="dropzone" param="dropfile"}
{/block}

{block "content"}
{if $core.current_role > $core.roles.viewer}
{if $upload_file_result|default:'' != ''}
    <br />
    <center>
    <span><b>
    {if $upload_file_result == -1}
      {t}An error occurred while trying to process the uploaded file.{/t}
    {elseif $upload_file_result == -2}
      {t}The uploaded file is already attached to the current issue. Please rename the file and try again.{/t}
    {elseif $upload_file_result == 1}
      {t}Thank you, the uploaded file was associated with the issue below.{/t}
    {/if}
    </b></span>
    </center>
    <script type="text/javascript">
    <!--
    {if $current_user_prefs.close_popup_windows == '1' && $upload_file_result == 1}
    setTimeout('Eventum.close_and_refresh()', 2000);
    {/if}
    //-->
    </script>
    <br />
    {if not $current_user_prefs.close_popup_windows}
    <center>
      <span><a href="javascript:void(null);" onClick="Eventum.close_and_refresh();">{t}Continue{/t}</a></span>
    </center>
    {/if}
{else}
<script type="text/javascript">
function validateUpload(f)
{
  {if !empty($smarty.get.legacy)}
  if ($("input[name='attachment[]'][value!='']").length < 1) {
        Validation.errors[Validation.errors.length] = new Option('Files', 'attachment[]');
    }
  {else}
  if ($("#iaf_ids").val().length < 1) {
    Validation.errors[Validation.errors.length] = new Option('Files', 'dropfile[]');
  }
  {/if}
}
</script>

    <form name="attachment_form" id="dropzone" action="file_upload.php" method="post" enctype="multipart/form-data" class="dropzone validate" data-validation-function="validateUpload">

    <table class="bordered">
    <tr class="title">
      <th colspan="2">{t}Add New Files{/t}:</th>
    </tr>
    <input type="hidden" name="cat" value="upload_file">
    <input type="hidden" name="issue_id" value="{$issue_id}">
    <input type="hidden" name="iaf_ids" id="iaf_ids" value="">

      {if $core.current_role > $core.roles.customer}
      <tr>
        <th width="120" nowrap class="internal">
          {t}Status{/t}
        </th>
        <td>
          <input type="radio" name="status" value="public" id="public" checked>
          <label for="public">{t}Public{/t} ({t}visible to all{/t})</label>
          <br>
          <input type="radio" name="status" value="internal" id="internal">
          <label for="internal">{t}Private{/t} ({t}standard user and above only{/t})</label>
        </td>
      </tr>
      {else}
      <input type="hidden" name="status" value="public">
      {/if}
      <tr>
        <th>
          {t}Filenames{/t}
        </th>
        <td>
          <div class="dz-message">
            {if empty($smarty.get.legacy)}
              {t}Drop files here or click to upload.{/t}
            {/if}

          <div class="dropzone-previews"></div>

          <div class="fallback">
          <table width="100%" cellpadding="2" cellspacing="0" id="file_table">
            <tr>
              <td><input size="50" name="attachment[]" type="file" class="shortcut"></td>
            </tr>
            <tr>
              <td><input size="50" name="attachment[]" type="file" class="shortcut"></td>
            </tr>
            <tr>
              <td><input size="50" name="attachment[]" type="file" class="shortcut"></td>
            </tr>
          </table>
          </div>

          <br/><br/>
          <i>{t 1=$max_attachment_size}Note: The current maximum allowed upload file size is %1{/t}</i>

          </div>

          {if empty($smarty.get.legacy)}
          <br/>
          <b>{t}NOTE{/t}</b>: {t escape=no 1="?iss_id=$issue_id&legacy=1"}To use legacy uploader, click <a href="%1">here</a>{/t}
          {/if}
        </td>
      </tr>
      <tr>
        <th>
          {t}Description{/t}:
        </th>
        <td>
          <textarea name="file_description" rows="4" style="width: 97%"></textarea>
        </td>
      </tr>
      <tr class="buttons">
        <td colspan="2">
          <input type="submit" value="{t}Upload File{/t}">
        </td>
      </tr>
  </table>
  </form>
{/if}
{else}
<center><span>{t}You do not have the correct role to access this page{/t}</span></center>
{/if}
{/block}