summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
25b6e6a)
Der Umbau von Mosu im commit
c60cb1f08f fixed das mehrfache Aufrufen eines Tabs,
der replace_dialog wird aber sowohl vom "documents" Tab als auch vom "attachment" Tab verwendet,
und ist somit zweimal vorhanden. Das Umbenennen funktioniert somit nur einmal,
dann muss ein reload gemacht werden.
Jetzt haben die Dialoge unterschiedliche Id Namen per suffix _attachment oder _document
my $first = shift @{$self->existing};
my ($first_id, $sfile) = split('_', $first, 2);
my $file = SL::File->get(id => $first_id );
my $first = shift @{$self->existing};
my ($first_id, $sfile) = split('_', $first, 2);
my $file = SL::File->get(id => $first_id );
- $self->js->run('kivi.File.askForRename', $first_id, $file->file_name, $sfile, join (',', @{$self->existing}), $self->is_global);
+ $self->js->run('kivi.File.askForRename', $first_id, $file->file_type, $file->file_name, $sfile, join (',', @{$self->existing}), $self->is_global);
}
$self->js->render();
} else {
}
$self->js->render();
} else {
namespace('kivi.File', function(ns) {
ns.rename = function(id,type,file_type,checkbox_class,is_global) {
namespace('kivi.File', function(ns) {
ns.rename = function(id,type,file_type,checkbox_class,is_global) {
- var $dlg = $('#rename_dialog');
+ var $dlg = $('#rename_dialog_'+file_type);
var parent_id = $dlg.parent("div.ui-tabs-panel").attr('id');
var checkboxes = $('.'+checkbox_class).filter(function () { return $(this).prop('checked'); });
if (checkboxes.size() === 0) {
var parent_id = $dlg.parent("div.ui-tabs-panel").attr('id');
var checkboxes = $('.'+checkbox_class).filter(function () { return $(this).prop('checked'); });
if (checkboxes.size() === 0) {
- alert(kivi.t8("No file selected, please set one checkbox!"));
- return false;
- }
+ alert(kivi.t8("No file selected, please set one checkbox!"));
+ return false;
+ }
if (checkboxes.size() > 1) {
if (checkboxes.size() > 1) {
- alert(kivi.t8("More than one file selected, please set only one checkbox!"));
- return false;
- }
+ alert(kivi.t8("More than one file selected, please set only one checkbox!"));
+ return false;
+ }
var file_id = checkboxes[0].value;
var file_id = checkboxes[0].value;
- $('#newfilename_id').val($('#filename_'+file_id).text());
- $('#next_ids_id').val('');
- $('#is_global_id').val(is_global);
- $('#rename_id_id').val(file_id);
- $('#sessionfile_id').val('');
- $('#rename_extra_text').html('');
+ $('#newfilename_id_'+file_type).val($('#filename_'+file_id).text());
+ $('#next_ids_id_'+file_type).val('');
+ $('#is_global_id_'+file_type).val(is_global);
+ $('#rename_id_id_'+file_type).val(file_id);
+ $('#sessionfile_id_'+file_type).val('');
+ $('#rename_extra_text_'+file_type).html('');
+ id: 'rename_dialog_'+file_type,
dialog: { title: kivi.t8("Rename attachment")
, width: 400
, height: 200
dialog: { title: kivi.t8("Rename attachment")
, width: 400
, height: 200
- ns.renameclose = function() {
- $("#rename_dialog").dialog('close');
+ ns.renameclose = function(file_type) {
+ $("#rename_dialog_"+file_type).dialog('close');
- ns.renameaction = function() {
- $("#rename_dialog").dialog('close');
+ ns.renameaction = function(file_type) {
+ $("#rename_dialog_"+file_type).dialog('close');
var data = {
action: 'File/ajax_rename',
var data = {
action: 'File/ajax_rename',
- id: $('#rename_id_id').val(),
- to: $('#newfilename_id').val(),
- next_ids: $('#next_ids_id').val(),
- is_global: $('#is_global_id').val(),
- sessionfile: $('#sessionfile_id').val(),
+ id: $('#rename_id_id_'+file_type).val(),
+ to: $('#newfilename_id_'+file_type).val(),
+ next_ids: $('#next_ids_id_'+file_type).val(),
+ is_global: $('#is_global_id_'+file_type).val(),
+ sessionfile: $('#sessionfile_id_'+file_type).val(),
};
$.post("controller.pl", data, kivi.eval_json_result);
return true;
}
};
$.post("controller.pl", data, kivi.eval_json_result);
return true;
}
- ns.askForRename = function(file_id,file_name,sessionfile,next_ids,is_global) {
- $('#newfilename_id').val(file_name);
- $('#rename_id_id').val(file_id);
- $('#is_global_id').val(is_global);
- $('#next_ids_id').val(next_ids);
- $('#sessionfile_id').val(sessionfile);
- $('#rename_extra_text').html(kivi.t8("The uploaded filename still exists.<br>If you not modify the name this is a new version of the file"));
- var $dlg = $('#rename_dialog');
+ ns.askForRename = function(file_id,file_type,file_name,sessionfile,next_ids,is_global) {
+ $('#newfilename_id_'+file_type).val(file_name);
+ $('#rename_id_id_'+file_type).val(file_id);
+ $('#is_global_id_'+file_type).val(is_global);
+ $('#next_ids_id_'+file_type).val(next_ids);
+ $('#sessionfile_id_'+file_type).val(sessionfile);
+ $('#rename_extra_text_'+file_type).html(kivi.t8("The uploaded filename still exists.<br>If you not modify the name this is a new version of the file"));
+ var $dlg = $('#rename_dialog_'+file_type);
var parent_id = $dlg.parent("div.ui-tabs-panel").attr('id');
kivi.popup_dialog(
{
var parent_id = $dlg.parent("div.ui-tabs-panel").attr('id');
kivi.popup_dialog(
{
+ id: 'rename_dialog_'+file_type,
dialog: { title: kivi.t8("Rename attachment")
, width: 400
, height: 200
dialog: { title: kivi.t8("Rename attachment")
, width: 400
, height: 200
ns.importaction = function(id,type,file_type,fromwhere,frompath,checkbox_class) {
var checkboxes = $('.'+checkbox_class).filter(function () { return $(this).prop('checked'); });
ns.importaction = function(id,type,file_type,fromwhere,frompath,checkbox_class) {
var checkboxes = $('.'+checkbox_class).filter(function () { return $(this).prop('checked'); });
- $("#import_dialog").dialog('close');
+ $("#import_dialog").dialog('close');
if (checkboxes.size() === 0) {
if (checkboxes.size() === 0) {
- return false;
- }
- var data = {
+ return false;
+ }
+ var data = {
action : 'File/ajax_import',
object_id : id,
object_type: type,
action : 'File/ajax_import',
object_id : id,
object_type: type,
}
ns.downloadOrderitemsFiles = function(type,id) {
}
ns.downloadOrderitemsFiles = function(type,id) {
action: 'DownloadZip/download_orderitems_files',
object_type: type,
object_id: id,
action: 'DownloadZip/download_orderitems_files',
object_type: type,
object_id: id,
[%- USE LxERP -%][%- USE L -%]
<div id="attachments">
[%- USE LxERP -%][%- USE L -%]
<div id="attachments">
+[% SET file_type = 'attachment' %]
[% INCLUDE 'file/rename_dialog.html' %]
<table>
<tr><td class="listheading" colspan="4">[% LxERP.t8("Global Attachments") %]
[% INCLUDE 'file/rename_dialog.html' %]
<table>
<tr><td class="listheading" colspan="4">[% LxERP.t8("Global Attachments") %]
[%- USE LxERP -%][%- USE L -%]
[%- USE LxERP -%][%- USE L -%]
-<div class="loading" id="rename_dialog" style="display:none" >
+<div class="loading" id="rename_dialog_[% file_type %]" style="display:none" >
<div style="padding-bottom: 15px">
<div>
<table>
<div style="padding-bottom: 15px">
<div>
<table>
- <tr><td colspan="2" id="rename_extra_text"></td></tr>
+ <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">[%- LxERP.t8("Please modify filename") %]:</td></tr>
- <tr><td colspan="2"><input size='40' name="newfilename" id="newfilename_id" value=""></td></tr>
- <tr><td><input type="hidden" name="next_ids" id="next_ids_id" value="">
- <input type="hidden" name="sessionfile" id="sessionfile_id" value="">
- <input type="hidden" name="rename_id" id="rename_id_id" value="">
- <input type="hidden" name="is_global" id="is_global_id" value="">
- [% L.button_tag("return kivi.File.renameaction();", LxERP.t8('Continue'), id => "rename_cont_btn") %]</td>
- <td>[% L.button_tag("return kivi.File.renameclose();" , LxERP.t8('Cancel') , class => "submit") %]</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>