<tr>
<th class="listheading" width="3%">[% L.checkbox_tag(source.chk_action _ '_checkall') %]</th>
<th class="listheading" width="11%">[% source.chkall_title %]</th>
- <th>[% LxERP.t8("Attached Filename") %]</th>
+ <th>[% LxERP.t8("Attached Filename") %]</th>
</tr>
</thead>
<tbody>
[%- FOREACH file = source.files %]
- <tr class="listrow[% loop.count % 2 %]">
- <td>[%- L.checkbox_tag(source.chk_action _ '[]', 'value'=file.name, 'class'=source.chk_action) %]</td>
- <td></td>
- <td><span id="[% "filename_" _ file.name %]">[% file.filename %]</span></td>
- </tr>
+ <tr class="listrow[% loop.count % 2 %]">
+ <td>[%- L.checkbox_tag(source.chk_action _ '[]', 'value'=file.name, 'class'=source.chk_action) %]</td>
+ <td></td>
+ <td><span id="[% "filename_" _ file.name %]">[% file.filename %]</span></td>
+ </tr>
[%- END %]
</tbody>
</table>
<p>
- [%- L.button_tag("kivi.File.importaction(" _ SELF.object_id _ ",'" _ SELF.object_type _ "','" _ SELF.file_type _ "','" _ source.name _ "','" _ source.path _ "','"_ source.chk_action _ "');", LxERP.t8('Continue'), id => "import_cont_btn") %]</td>
- [%- L.button_tag("kivi.File.importclose();" , LxERP.t8('Cancel') , class => "submit") %]</td></tr>
+ [%- L.button_tag("kivi.File.importaction(" _ SELF.object_id _ ",'" _ SELF.object_type _ "','" _ SELF.file_type _ "','" _ source.name _ "','" _ source.path _ "','"_ source.chk_action _ "');", LxERP.t8('Continue'), id => "import_cont_btn") %]</td>
+ [%- L.button_tag("kivi.File.importclose();" , LxERP.t8('Cancel') , class => "submit") %]</td></tr>
</p>
</form>
<script type="text/javascript">
-<!--
-$(function() {
- $('#[% source.chk_action %]_checkall').checkall('INPUT[name="[% source.chk_action %][]"]');
-});
--->
+ <!--
+ $(function() {
+ $('#[% source.chk_action %]_checkall').checkall('INPUT[name="[% source.chk_action %][]"]');
+ });
+ -->
</script>
[%- USE LxERP -%][% USE L %][% USE HTML %]
[%- IF ! json %]
-<div id="[% file_type %]_list_[% object_type %]">
+ <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>
+ [%- 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 %]
+ <td>[%- L.checkbox_tag(checkname _ '[]', 'value'=file.id _ '_' _ file.version, 'class'=checkname) %]</td>
+ <td></td>
+ [%- END %]
+ <td>[% file.mtime_as_timestamp_s %][% L.hidden_tag("version[]", file.version) %]</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 # FOREACH file %]
+ </tbody>
+ </table
- <tbody>
- [%- FOREACH file = source.files %]
- <tr class="listrow[% loop.count % 2 %]">
- [%- IF edit_attachments %]
- <td>[%- L.checkbox_tag(checkname _ '[]', 'value'=file.id _ '_' _ file.version, 'class'=checkname) %]</td>
- <td></td>
- [%- END %]
- <td>[% file.mtime_as_timestamp_s %][% L.hidden_tag("version[]", file.version) %]</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 edit_attachments %]
[%- IF source.can_import %]
- [% L.button_tag("kivi.File.unimport(" _ object_id _ ",'" _ object_type _ "','" _ file_type _ "','" _ checkname _ "');",source.chk_title) %]
+ [% L.button_tag("kivi.File.unimport(" _ object_id _ ",'" _ object_type _ "','" _ file_type _ "','" _ checkname _ "');",source.chk_title) %]
[%- ELSE %]
- [%- IF source.can_delete %]
- [% L.button_tag("kivi.File.delete(" _ object_id _ ",'" _ object_type _ "','" _ file_type _ "','" _ checkname _ "'," _ is_global _ ");", source.chk_title) %]
- [%- END %]
+ [%- IF source.can_delete %]
+ [% L.button_tag("kivi.File.delete(" _ object_id _ ",'" _ object_type _ "','" _ file_type _ "','" _ checkname _ "'," _ is_global _ ");", source.chk_title) %]
+ [%- END %]
[%- END %]
- [%- END %]
- [%- IF source.can_rename %]
+ [%- 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 %]
+ [%- 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 %]
+ [%- 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')) %]
+ [%- END %]
</div>
+ [%- END # FOREACH source %]
+ <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 %]
+ </div>
+ [%- UNLESS is_global %]
+ [%- IF can_rename %]
+ [% INCLUDE 'file/rename_dialog.html' -%]
+ [%- END %]
+ [%- END %]
[%- END %]
[%- USE LxERP -%][%- USE L -%]
-<div class="loading" id="rename_dialog_[% file_type %]" style="display:none" >
+<div class="loading" id="rename_dialog_[% file_type %]" style="display:none">
<div style="padding-bottom: 15px">
<div>
- <table>
- <tr><td colspan="2" id="rename_extra_text_[% file_type %]"></td></tr>
- <tr><td colspan="2">[%- LxERP.t8("Please modify filename") %]:</td></tr>
- <tr><td colspan="2"><input size='40' name="newfilename" id="newfilename_id_[% file_type %]" value=""></td></tr>
- <tr><td><input type="hidden" name="next_ids" id="next_ids_id_[% file_type %]" value="">
- <input type="hidden" name="sessionfile" id="sessionfile_id_[% file_type %]" value="">
- <input type="hidden" name="rename_id" id="rename_id_id_[% file_type %]" value="">
- <input type="hidden" name="is_global" id="is_global_id_[% file_type %]" value="">
- [% L.button_tag("return kivi.File.renameaction('" _ file_type _ "');", LxERP.t8('Continue'), id => "rename_cont_btn") %]</td>
- <td>[% L.button_tag("return kivi.File.renameclose('" _ file_type _"');" , LxERP.t8('Cancel') , class => "submit") %]</td></tr>
- </table>
+ <table>
+ <tr><td colspan="2" id="rename_extra_text_[% file_type %]"></td></tr>
+ <tr><td colspan="2">[%- LxERP.t8("Please modify filename") %]:</td></tr>
+ <tr><td colspan="2"><input size='40' name="newfilename" id="newfilename_id_[% file_type %]" value=""></td></tr>
+ <tr>
+ <td>
+ <input type="hidden" name="next_ids" id="next_ids_id_[% file_type %]" value="">
+ <input type="hidden" name="sessionfile" id="sessionfile_id_[% file_type %]" value="">
+ <input type="hidden" name="rename_id" id="rename_id_id_[% file_type %]" value="">
+ <input type="hidden" name="is_global" id="is_global_id_[% file_type %]" value="">
+ [% L.button_tag("return kivi.File.renameaction('" _ file_type _ "');", LxERP.t8('Continue'), id => "rename_cont_btn") %]
+ </td>
+ <td>[% L.button_tag("return kivi.File.renameclose('" _ file_type _"');" , LxERP.t8('Cancel') , class => "submit") %]</td>
+ </tr>
+ </table>
</div>
</div>
</div>
[%- USE L -%][%- USE LxERP -%][%- USE JavaScript -%]
<form method="post" id="upload_form" enctype="multipart/form-data" action="controller.pl">
- [% SET multiple = 'true' %]
- [% IF SELF.object_type == 'shop_image' %][% multiple = 'false' %][% END %]
+ [% SET multiple = 'true' %]
+ [% IF SELF.object_type == 'shop_image' %][% multiple = 'false' %][% END %]
<table>
<tr>
- <td>[%- LxERP.t8("Filename") %]:</td><td>
- <input type="file" name="uploadfiles[]" multiple="[% multiple %]" id="upload_files" size="45" accept="[% SELF.accept_types %]" onchange="kivi.File.allow_upload_submit();"></td>
+ <td>[%- LxERP.t8("Filename") %]:</td>
+ <td>
+ <input type="file" name="uploadfiles[]" multiple="[% multiple %]" id="upload_files" size="45" accept="[% SELF.accept_types %]" onchange="kivi.File.allow_upload_submit();">
+ </td>
</tr>
[% IF SELF.object_type == 'shop_image' %]
- <tr>
- <td>[% LxERP.t8("Title") %]</td>
- <td>[% L.input_tag("title",'') %]</td>
- </tr>
- <tr>
- <td>[% LxERP.t8("Description") %]</td>
- <td>[% L.input_tag("description",'') %]</td>
- </tr>
+ <tr>
+ <td>[% LxERP.t8("Title") %]</td>
+ <td>[% L.input_tag("title",'') %]</td>
+ </tr>
+ <tr>
+ <td>[% LxERP.t8("Description") %]</td>
+ <td>[% L.input_tag("description",'') %]</td>
+ </tr>
[% END %]
</table>
<p>
<input value="[%- LxERP.t8("Upload file") %]" id="upload_selected_button"
onclick="kivi.File.upload_selected_files([% SELF.object_id %],'[% SELF.object_type %]','[% SELF.file_type %]',[% SELF.maxsize %],[% SELF.is_global %]);"
- type="button" disabled >
+ type="button" disabled>
<a href="#" onclick="kivi.File.reset_upload_form();">[%- LxERP.t8("Reset") %]</a>
<a href="#" onclick="$('#files_upload').dialog('close');">[% LxERP.t8("Cancel") %]</a>
</p>