Dateimanagement: Controller zum Laden und Generierung der Dateien
[kivitendo-erp.git] / templates / webpages / file / list.html
diff --git a/templates/webpages/file/list.html b/templates/webpages/file/list.html
new file mode 100644 (file)
index 0000000..238fb12
--- /dev/null
@@ -0,0 +1,101 @@
+[%- USE LxERP -%][% USE L %][% USE HTML %]
+[%- IF ! json %]
+<div id="[% file_type %]_list_[% object_type %]">
+[%- END %]
+<div class="listtop">[% title %]</div>
+
+<div style="padding-bottom: 15px">
+[%- SET can_rename = 0 %]
+[%- FOREACH source = SOURCES %]
+ <table style="width: 100%" >
+  <thead>
+   <tr><th class="listheading" colspan="6">[% source.title %]</th></tr>
+   <tr>
+  [%- SET checkname = source.chk_action %]
+  [%- IF is_global %]
+  [%- SET checkname = object_type _ '_' _ source.chk_action %]
+  [%- END %]
+  [%- IF edit_attachments %]
+ <script type="text/javascript">
+  <!--
+$(function() {
+  $('#[% checkname %]_checkall').checkall('INPUT[name="[% checkname %][]"]');
+});
+ -->
+</script>
+    <th class="listheading" width="3%">[% L.checkbox_tag(checkname _ '_checkall') %]</th>
+    <th class="listheading" width="7%">[% source.chkall_title %]</th>
+  [%- END %]
+    <th class="listheading" width="15%"><b>[%  LxERP.t8('Date') %]</b></th>
+    <th class="listheading" width="20%"><b>[%  source.file_title %]</b></th>
+  [%- IF file_type == 'image' %]
+    <th class="listheading" width="15%"><b>[%  LxERP.t8('Title') %]</b></th>
+    <th class="listheading" width="10%">
+    <b>[%  LxERP.t8('ImagePreview') %]</b>
+    </th>
+    <th class="listheading" width="30%"><b>[%  LxERP.t8('Description') %]</b></th>
+  [%- ELSE %]
+    <th class="listheading" width="40%"></th>
+  [%- END %]
+   </tr>
+  </thead>
+
+  <tbody>
+  [%- FOREACH file = source.files %]
+   <tr class="listrow[% loop.count % 2 %]">
+    [%- IF edit_attachments %]
+    [%- IF file.newest %]
+    <td>[%- L.checkbox_tag(checkname _ '[]', 'value'=file.id, 'class'=checkname) %]</td>
+    [%- ELSE %]
+    <td></td>
+    [%- END %]
+    <td></td>
+    [%- END %]
+    <td>[% file.mtime_as_timestamp_s %]</td>
+    <td><a href="controller.pl?action=File/download&id=[% file.id %][%- IF file.version %]&version=[%- file.version %][%- END %]">
+        <span id="[% "filename_" _ file.id %][%- IF file.version %]_[% file.version %][%- END %]">[% file.file_name %]</span></a></td>
+    [%- IF file_type == 'image' %]
+    <td>[% file.title %]</td>
+    <td>
+      <img src="controller.pl?action=File/download&id=[% file.id %][%- IF file.version %]&version=[%- file.version %][%- END %]" alt="[% file.title %]" width="64px">
+    </td>
+    <td>[% file.description %]</td>
+    [%- ELSE %]
+    <td></td>
+    [%- END %]
+   </tr>
+  [%- END %]
+  </tbody>
+ </table
+  <div>
+  [%- IF edit_attachments %]
+    [%- IF source.can_import %]
+      [% L.button_tag("kivi.File.unimport(" _ object_id _ ",'" _ object_type _ "','" _ file_type _ "','" _ checkname _ "');",source.chk_title) %]
+    [%- ELSE %]
+      [% L.button_tag("kivi.File.delete("   _ object_id _ ",'" _ object_type _ "','" _ file_type _ "','" _ checkname _ "'," _ is_global _ ");",  source.chk_title) %]
+    [%- END %]
+  [%- END %]
+  [%- IF source.can_rename %]
+    [%- can_rename = 1 %]
+    [% L.button_tag("kivi.File.rename(" _ object_id _ ",'" _ object_type _ "','" _ file_type _ "','" _ checkname _ "'," _ is_global _ ");",  source.rename_title ) %]
+  [%- END %]
+  [%- IF source.can_upload %]
+    [% L.button_tag("kivi.File.upload(" _ object_id _ ",'" _ object_type _ "','" _ file_type _ "','" _ source.upload_title _ "'," _ is_global _ ");", source.upload_title ) %]
+  [%- END %]
+  [%- IF source.can_import %]
+    [% L.button_tag("kivi.File.import("   _ object_id _ ",'" _ object_type _ "','" _ file_type _ "','" _ source.name _ "','" _ source.path _"');",  source.import_title ) %]
+  [%- END %]
+  </div>
+[%- END %]
+  <div></div><div>
+[% L.button_tag("kivi.File.update(" _ object_id _ ",'" _ object_type _ "','" _ file_type _ "'," _ is_global _ ");", LxERP.t8('Update')) %]
+  </div>
+</div>
+[%- IF ! json %]
+</div>
+[%- UNLESS is_global %]
+[%- IF can_rename %]
+[% INCLUDE 'file/rename_dialog.html' -%]
+[%- END %]
+[%- END %]
+[%- END %]