X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=js%2Fkivi.File.js;h=addacde8286f7326f3da3ff05ba45c5d8b98aaf2;hb=12b50381201808e89a1b418be5b38d820d500e44;hp=68ef7ac526f2d6a04d165cc5e7ef6421f33958f5;hpb=65922b0d6c4a14e29354f65c60dea2176d10f941;p=kivitendo-erp.git diff --git a/js/kivi.File.js b/js/kivi.File.js index 68ef7ac52..addacde82 100644 --- a/js/kivi.File.js +++ b/js/kivi.File.js @@ -1,6 +1,8 @@ namespace('kivi.File', function(ns) { ns.rename = function(id,type,file_type,checkbox_class,is_global) { + var $dlg = $('#rename_dialog'); + 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) { @@ -23,15 +25,19 @@ namespace('kivi.File', function(ns) { dialog: { title: kivi.t8("Rename attachment") , width: 400 , height: 200 - , modal: true } }); + , modal: true + , close: function() { + $dlg.remove().appendTo('#' + parent_id); + } + } }); return true; } - + ns.renameclose = function() { $("#rename_dialog").dialog('close'); return false; } - + ns.renameaction = function() { $("#rename_dialog").dialog('close'); var data = { @@ -45,7 +51,7 @@ namespace('kivi.File', function(ns) { $.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); @@ -103,7 +109,7 @@ namespace('kivi.File', function(ns) { } catch(err2) { fname ='';} $("#upload_result").html(kivi.t8("filename has not uploadable characters ")+fname); - return; + return; } } if ( filesize > maxsize ) { @@ -149,7 +155,7 @@ namespace('kivi.File', function(ns) { ns.delete = function(id,type,file_type,checkbox_class,is_global) { var checkboxes = $('.'+checkbox_class).filter(function () { return $(this).prop('checked'); }); - if ((checkboxes.size() === 0) || + if ((checkboxes.size() === 0) || !confirm(kivi.t8('Do you really want to delete the selected documents?'))) return false; var data = { @@ -167,7 +173,7 @@ namespace('kivi.File', function(ns) { ns.unimport = function(id,type,file_type,checkbox_class) { var checkboxes = $('.'+checkbox_class).filter(function () { return $(this).prop('checked'); }); - if ((checkboxes.size() === 0) || + if ((checkboxes.size() === 0) || !confirm(kivi.t8('Do you really want to unimport the selected documents?'))) return false; var data = { @@ -209,12 +215,12 @@ namespace('kivi.File', function(ns) { }); return true; } - + ns.importclose = function() { $("#import_dialog").dialog('close'); return false; } - + ns.importaction = function(id,type,file_type,fromwhere,frompath,checkbox_class) { var checkboxes = $('.'+checkbox_class).filter(function () { return $(this).prop('checked'); }); @@ -247,7 +253,6 @@ namespace('kivi.File', function(ns) { return false; } - ns.init = function() { }