From: Bernd Bleßmann Date: Wed, 7 Jul 2021 16:03:04 +0000 (+0200) Subject: Dialogbuchung: Bei Verbleib in der Maske nach Buchen Dokumenten-Tab laden X-Git-Tag: kivitendo-mebil_0.1-0~9^2~48 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=c342d50b6999ca85ce15201b6d79c79b7f669fa3;p=kivitendo-erp.git Dialogbuchung: Bei Verbleib in der Maske nach Buchen Dokumenten-Tab laden --- diff --git a/bin/mozilla/gl.pl b/bin/mozilla/gl.pl index dbaddc596..6f519428b 100644 --- a/bin/mozilla/gl.pl +++ b/bin/mozilla/gl.pl @@ -1402,7 +1402,7 @@ sub post_transaction { print $form->redirect_header($form->{callback}); $form->redirect($locale->text('GL transaction posted.') . ' ' . $locale->text('ID') . ': ' . $form->{id}); } elsif ($::instance_conf->get_gl_add_doc && $::instance_conf->get_doc_storage) { - my $add_doc_url = build_std_url("script=gl.pl", 'action=edit', 'id=' . E($form->{id})); + my $add_doc_url = build_std_url("script=gl.pl", 'action=edit', 'id=' . E($form->{id}), 'fragment=ui-tabs-docs'); print $form->redirect_header($add_doc_url); $form->redirect($locale->text('GL transaction posted.') . ' ' . $locale->text('ID') . ': ' . $form->{id}); } diff --git a/js/kivi.File.js b/js/kivi.File.js index bdd7acd36..63a85346c 100644 --- a/js/kivi.File.js +++ b/js/kivi.File.js @@ -393,4 +393,20 @@ namespace('kivi.File', function(ns) { $('.overlay_div img').on('click', ns.download); }; + ns.doc_tab_init = function(tabs_id, doc_tab_id, id, object_type) { + var url = 'controller.pl?action=File/list&file_type=document&object_type=' + object_type + '&object_id=' + $('#id').val(); + + $('#' + tabs_id).on('tabsbeforeactivate', function(e, ui) { + if (ui.newPanel.attr('id') !== doc_tab_id) return; + $('#' + doc_tab_id).html(kivi.t8('Loading...')); + $('#' + doc_tab_id).load(url); + }); + + $('#' + tabs_id).on('tabscreate', function(e, ui) { + if (ui.panel.attr('id') !== doc_tab_id) return; + $('#' + doc_tab_id).html(kivi.t8('Loading...')); + $('#' + doc_tab_id).load(url); + }); + }; + }); diff --git a/js/kivi.GL.js b/js/kivi.GL.js index 374113c54..dc17ff38f 100644 --- a/js/kivi.GL.js +++ b/js/kivi.GL.js @@ -29,3 +29,7 @@ namespace('kivi.GL', function(ns) { }); }; }); + +$(function() { + kivi.File.doc_tab_init('gl_tabs', 'ui-tabs-docs', $('#id').val(), 'gl_transaction'); +}); diff --git a/js/locale/de.js b/js/locale/de.js index 7e9a60b42..e36f8829e 100644 --- a/js/locale/de.js +++ b/js/locale/de.js @@ -89,6 +89,7 @@ namespace("kivi").setupLocale({ "July":"Juli", "Jun":"Jun", "June":"Juni", +"Loading...":"Wird geladen...", "Map":"Karte", "Mar":"März", "March":"März", diff --git a/js/locale/en.js b/js/locale/en.js index 81da3f9f5..b03ddb34b 100644 --- a/js/locale/en.js +++ b/js/locale/en.js @@ -89,6 +89,7 @@ namespace("kivi").setupLocale({ "July":"", "Jun":"", "June":"", +"Loading...":"", "Map":"", "Mar":"", "March":"", diff --git a/templates/webpages/gl/form_header.html b/templates/webpages/gl/form_header.html index cbfaddbe7..dad0d69cf 100644 --- a/templates/webpages/gl/form_header.html +++ b/templates/webpages/gl/form_header.html @@ -31,7 +31,7 @@ -
+
+ +[%- IF INSTANCE_CONF.get_doc_storage %] +
+[%- END %] +