1 [%- USE LxERP -%][% USE L %][% USE HTML %]
 
   3 <div id="[% file_type %]_list_[% object_type %]">
 
   5 <div class="listtop">[% title %]</div>
 
   7 <div style="padding-bottom: 15px">
 
   8 [%- SET can_rename = 0 %]
 
   9 [%- FOREACH source = SOURCES %]
 
  10  <table style="width: 100%" >
 
  12    <tr><th class="listheading" colspan="6">[% source.title %]</th></tr>
 
  14   [%- SET checkname = source.chk_action %]
 
  16   [%- SET checkname = object_type _ '_' _ source.chk_action %]
 
  18   [%- IF edit_attachments %]
 
  19  <script type="text/javascript">
 
  22   $('#[% checkname %]_checkall').checkall('INPUT[name="[% checkname %][]"]');
 
  26     <th class="listheading" width="3%">[% L.checkbox_tag(checkname _ '_checkall') %]</th>
 
  27     <th class="listheading" width="7%">[% source.chkall_title %]</th>
 
  29     <th class="listheading" width="15%"><b>[%  LxERP.t8('Date') %]</b></th>
 
  30     <th class="listheading" width="20%"><b>[%  source.file_title %]</b></th>
 
  31   [%- IF file_type == 'image' %]
 
  32     <th class="listheading" width="15%"><b>[%  LxERP.t8('Title') %]</b></th>
 
  33     <th class="listheading" width="10%">
 
  34     <b>[%  LxERP.t8('ImagePreview') %]</b>
 
  36     <th class="listheading" width="30%"><b>[%  LxERP.t8('Description') %]</b></th>
 
  38     <th class="listheading" width="40%"></th>
 
  44   [%- FOREACH file = source.files %]
 
  45    <tr class="listrow[% loop.count % 2 %]">
 
  46     [%- IF edit_attachments %]
 
  48     <td>[%- L.checkbox_tag(checkname _ '[]', 'value'=file.id, 'class'=checkname) %]</td>
 
  54     <td>[% file.mtime_as_timestamp_s %]</td>
 
  55     <td><a href="controller.pl?action=File/download&id=[% file.id %][%- IF file.version %]&version=[%- file.version %][%- END %]">
 
  56         <span id="[% "filename_" _ file.id %][%- IF file.version %]_[% file.version %][%- END %]">[% file.file_name %]</span></a></td>
 
  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>
 
  71   [%- IF edit_attachments %]
 
  72     [%- IF source.can_import %]
 
  73       [% L.button_tag("kivi.File.unimport(" _ object_id _ ",'" _ object_type _ "','" _ file_type _ "','" _ checkname _ "');",source.chk_title) %]
 
  75       [% L.button_tag("kivi.File.delete("   _ object_id _ ",'" _ object_type _ "','" _ file_type _ "','" _ checkname _ "'," _ is_global _ ");",  source.chk_title) %]
 
  78   [%- IF source.can_rename %]
 
  80     [% L.button_tag("kivi.File.rename(" _ object_id _ ",'" _ object_type _ "','" _ file_type _ "','" _ checkname _ "'," _ is_global _ ");",  source.rename_title ) %]
 
  82   [%- IF source.can_upload %]
 
  83     [% L.button_tag("kivi.File.upload(" _ object_id _ ",'" _ object_type _ "','" _ file_type _ "','" _ source.upload_title _ "'," _ is_global _ ");", source.upload_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 ) %]
 
  91 [% L.button_tag("kivi.File.update(" _ object_id _ ",'" _ object_type _ "','" _ file_type _ "'," _ is_global _ ");", LxERP.t8('Update')) %]
 
  96 [%- UNLESS is_global %]
 
  98 [% INCLUDE 'file/rename_dialog.html' -%]