From 18b1b18015503fb46e8e1201f79e968f097f66e0 Mon Sep 17 00:00:00 2001
From: Moritz Bunkus
Date: Wed, 27 Feb 2013 14:19:29 +0100
Subject: [PATCH] =?utf8?q?Verkaufs-/Einkaufsbelege:=20Neuer=20Tab=20"Verkn?=
=?utf8?q?=C3=BCpfte=20Belege",=20per=20AJAX=20geladen?=
MIME-Version: 1.0
Content-Type: text/plain; charset=utf8
Content-Transfer-Encoding: 8bit
AuÃerdem WebDAV in eigenen Tab geschoben und Ausgabe vereinheitlicht
---
SL/Controller/RecordLinks.pm | 35 +++++++++++++++++++++
templates/webpages/do/form_footer.html | 30 +++++-------------
templates/webpages/do/form_header.html | 13 ++++++++
templates/webpages/ir/form_footer.html | 18 +++++------
templates/webpages/ir/form_header.html | 12 +++++++
templates/webpages/is/form_footer.html | 21 ++++++-------
templates/webpages/is/form_header.html | 12 +++++++
templates/webpages/oe/form_footer.html | 43 ++++++--------------------
templates/webpages/oe/form_header.html | 13 ++++++++
templates/webpages/webdav/_list.html | 38 +++++++++++------------
10 files changed, 137 insertions(+), 98 deletions(-)
create mode 100644 SL/Controller/RecordLinks.pm
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 @@