From: Moritz Bunkus
Date: Wed, 27 Feb 2013 13:19:29 +0000 (+0100)
Subject: Verkaufs-/Einkaufsbelege: Neuer Tab "Verknüpfte Belege", per AJAX geladen
X-Git-Tag: release-3.1.0beta1~596
X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=18b1b18015503fb46e8e1201f79e968f097f66e0;p=kivitendo-erp.git
Verkaufs-/Einkaufsbelege: Neuer Tab "Verknüpfte Belege", per AJAX geladen
Außerdem WebDAV in eigenen Tab geschoben und Ausgabe vereinheitlicht
---
diff --git a/SL/Controller/RecordLinks.pm b/SL/Controller/RecordLinks.pm
new file mode 100644
index 000000000..fd424b967
--- /dev/null
+++ b/SL/Controller/RecordLinks.pm
@@ -0,0 +1,35 @@
+package SL::Controller::RecordLinks;
+
+use strict;
+
+use parent qw(SL::Controller::Base);
+
+use SL::DB::Order;
+use SL::DB::DeliveryOrder;
+use SL::DB::Invoice;
+use SL::DB::PurchaseInvoice;
+use SL::Locale::String;
+
+#
+# actions
+#
+
+sub action_ajax_list {
+ my ($self) = @_;
+
+ eval {
+ die $::locale->text("Invalid parameters") if (!$::form->{object_id} || ($::form->{object_model} !~ m/^(?:Order|DeliveryOrder|Invoice|PurchaseInvoice)$/));
+
+ my $model = 'SL::DB::' . $::form->{object_model};
+ my $object = $model->new(id => $::form->{object_id})->load || die $::locale->text("Record not found");
+ my $linked_records = $object->linked_records(direction => 'both');
+ my $output = SL::Presenter->get->grouped_record_list($linked_records);
+ $self->render(\$output, { layout => 0, process => 0 });
+
+ 1;
+ } or do {
+ $self->render('generic/error', { layout => 0 }, label_error => $@);
+ };
+}
+
+1;
diff --git a/templates/webpages/do/form_footer.html b/templates/webpages/do/form_footer.html
index 364367b92..78ad35a41 100644
--- a/templates/webpages/do/form_footer.html
+++ b/templates/webpages/do/form_footer.html
@@ -23,30 +23,14 @@
-
+
+[% PROCESS 'webdav/_list.html' %]
+
+ [%- LxERP.t8("Loading...") %]
+
+
- [%- IF conf_webdav %]
- [% 'Documents in the WebDAV repository' | $T8 %]
-
-
-
-
- [% 'File name' | $T8 %] |
- [% 'WebDAV link' | $T8 %] |
-
-
- [%- FOREACH file = WEBDAV %]
-
- [% HTML.escape(file.name) %] |
- [% HTML.escape(file.type) %] |
-
- [%- END %]
-
-
-
-
-
- [%- END %]
+
[% PRINT_OPTIONS %]
diff --git a/templates/webpages/do/form_header.html b/templates/webpages/do/form_header.html
index cd99f9619..ceed4e564 100644
--- a/templates/webpages/do/form_header.html
+++ b/templates/webpages/do/form_header.html
@@ -45,6 +45,19 @@