1 [%- USE LxERP -%][% USE L %]
4 <div id="[% file_type %]_list_[% object_type %]">
6 <div class="listtop">[% title %]</div>
8 <div style="padding-bottom: 15px">
9 [%- SET can_rename = 0 %]
10 [%- FOREACH source = SOURCES %]
11 <table style="width: 100%" >
13 <tr><th class="listheading" colspan="6">[% source.title %]</th></tr>
15 [%- SET checkname = source.chk_action %]
17 [%- SET checkname = object_type _ '_' _ source.chk_action %]
19 [%- IF edit_attachments %]
20 <script type="text/javascript">
23 $('#[% checkname %]_checkall').checkall('INPUT[name="[% checkname %][]"]');
27 <th class="listheading" width="3%">[% L.checkbox_tag(checkname _ '_checkall') %]</th>
28 <th class="listheading" width="7%">[% source.chkall_title %]</th>
30 <th class="listheading" width="15%"><b>[% LxERP.t8('Date') %]</b></th>
31 <th class="listheading" width="20%"><b>[% source.file_title %]</b></th>
32 [%- IF file_type == 'image' %]
33 <th class="listheading" width="15%"><b>[% LxERP.t8('Title') %]</b></th>
34 <th class="listheading" width="10%">
35 <b>[% LxERP.t8('ImagePreview') %]</b>
37 <th class="listheading" width="30%"><b>[% LxERP.t8('Description') %]</b></th>
39 <th class="listheading" width="40%"></th>
45 [%- FOREACH file = source.files %]
46 <tr class="listrow[% loop.count % 2 %]">
47 [%- IF edit_attachments %]
48 <td>[%- L.checkbox_tag(checkname _ '[]', 'value'=file.id _ '_' _ file.version, 'class'=checkname) %]</td>
51 <td>[% file.mtime_as_timestamp_s %][% L.hidden_tag("version[]", file.version) %]</td>
53 <a href="controller.pl?action=File/download&id=[% file.id %][%- IF file.version %]&version=[%- file.version %][%- END %]">
54 <span id="[% "filename_" _ file.id %][%- IF file.version %]_[% file.version %][%- END %]">[% file.file_name %]</span>
57 [%- IF file_type == 'image' %]
58 <td>[% file.title %]</td>
60 <img src="controller.pl?action=File/download&id=[% file.id %][%- IF file.version %]&version=[%- file.version %][%- END %]" alt="[% file.title %]" width="64px">
62 <td>[% file.description %]</td>
67 [%- END # FOREACH file %]
72 [%- IF edit_attachments %]
73 [%- IF source.can_import %]
74 [% L.button_tag("kivi.File.unimport(" _ object_id _ ",'" _ object_type _ "','" _ file_type _ "','" _ checkname _ "');",source.chk_title) %]
76 [%- IF source.can_delete %]
77 [% L.button_tag("kivi.File.delete(" _ object_id _ ",'" _ object_type _ "','" _ file_type _ "','" _ checkname _ "'," _ is_global _ ");", source.chk_title) %]
81 [%- IF source.can_rename %]
83 [% L.button_tag("kivi.File.rename(" _ object_id _ ",'" _ object_type _ "','" _ file_type _ "','" _ checkname _ "'," _ is_global _ ");", source.rename_title ) %]
85 [%- IF source.can_import %]
86 [% L.button_tag("kivi.File.import(" _ object_id _ ",'" _ object_type _ "','" _ file_type _ "','" _ source.name _ "','" _ source.path _"');", source.import_title ) %]
88 [%- IF source.can_upload %]
89 [% L.button_tag("kivi.File.upload(" _ object_id _ ",'" _ object_type _ "','" _ file_type _ "','" _ source.upload_title _ "'," _ is_global _ ");", source.upload_title ) %]
90 <span class="upload_drop_zone"
91 data-object-type="[% object_type %]"
92 data-object-id="[% object_id %]"
93 data-file-type="[% file_type %]"
94 data-is-global="[% is_global %]"
95 data-maxsize="[% INSTANCE_CONF.get_doc_max_filesize %]">
96 [% 'Drag and drop files here' | $T8 %]
100 [%- END # FOREACH source %]
103 [% L.button_tag("kivi.File.update(" _ object_id _ ",'" _ object_type _ "','" _ file_type _ "'," _ is_global _ ");", LxERP.t8('Update')) %]
109 [%- UNLESS is_global %]
111 [% INCLUDE 'file/rename_dialog.html' -%]
118 kivi.File.list_div_id = "[% file_type %]_list_[% object_type %]";