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 %]
- -

- - - - - - - [%- FOREACH file = WEBDAV %] - - - - - [%- END %] - -
[% 'File name' | $T8 %][% 'WebDAV link' | $T8 %]
[% HTML.escape(file.name) %][% HTML.escape(file.type) %]
-

- -
- [%- 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 @@
+
+ + +
+ diff --git a/templates/webpages/ir/form_footer.html b/templates/webpages/ir/form_footer.html index 5b66f7031..8538fd42d 100644 --- a/templates/webpages/ir/form_footer.html +++ b/templates/webpages/ir/form_footer.html @@ -78,21 +78,19 @@ -[% PROCESS 'webdav/_list.html' %] - [% PROCESS 'ir/_payments.html' %] - -
- - - -[% print_options %] - - +
+[% PROCESS 'webdav/_list.html' %] +
+ [%- LxERP.t8("Loading...") %] +
+
+
+

[% print_options %]

[% IF id %] diff --git a/templates/webpages/ir/form_header.html b/templates/webpages/ir/form_header.html index 4065b039e..6f6bf238d 100644 --- a/templates/webpages/ir/form_header.html +++ b/templates/webpages/ir/form_header.html @@ -25,6 +25,18 @@ [%- INCLUDE 'common/flash.html' %] +
+ + +
- - - +
diff --git a/templates/webpages/is/form_footer.html b/templates/webpages/is/form_footer.html index 79bbdb162..52179c295 100644 --- a/templates/webpages/is/form_footer.html +++ b/templates/webpages/is/form_footer.html @@ -1,7 +1,7 @@ [%- USE T8 %] [%- USE HTML %] [%- USE LxERP %] -[%- USE L %] +[%- USE L %][%- USE P -%]
@@ -107,21 +107,18 @@ -[% PROCESS 'webdav/_list.html' %] - [% PROCESS 'is/_payments.html' %] - - - - - - -

-[% print_options %] -
+ +[% PROCESS 'webdav/_list.html' %] +
+ [% LxERP.t8('Loading...') %] +
+ +
+

[% print_options %]

[% IF id %] diff --git a/templates/webpages/is/form_header.html b/templates/webpages/is/form_header.html index 97561d154..c1c4c9e89 100644 --- a/templates/webpages/is/form_header.html +++ b/templates/webpages/is/form_header.html @@ -26,6 +26,18 @@ [%- PROCESS 'common/flash.html' %] +
+ + +
diff --git a/templates/webpages/oe/form_footer.html b/templates/webpages/oe/form_footer.html index f83334c44..bfad52d2d 100644 --- a/templates/webpages/oe/form_footer.html +++ b/templates/webpages/oe/form_footer.html @@ -96,41 +96,18 @@

-[%- IF webdav %] - - Dokumente im Webdav-Repository - - - - - - - - - [%- FOREACH file = WEBDAV %] - - - - - [%- END %] -
DateinameWebdavlink
[% HTML.escape(file.name) %][% HTML.escape(file.type) %]
- - - -
- -[%- END %] +
+[%- PROCESS 'webdav/_list.html' %] +
+ [%- LxERP.t8("Loading...") %] +
+
- - - [% print_options %] - - - +
+ +

[% PRINT_OPTIONS %]

[% label_edit %]
diff --git a/templates/webpages/oe/form_header.html b/templates/webpages/oe/form_header.html index eed285c72..50c9c46db 100644 --- a/templates/webpages/oe/form_header.html +++ b/templates/webpages/oe/form_header.html @@ -29,6 +29,19 @@ [%- INCLUDE 'common/flash.html' %] +
+ + +
+ - - +[%- IF conf_webdav %] +
+ +
[% 'Documents in the WebDAV repository' | $T8 %]
+ +
diff --git a/templates/webpages/webdav/_list.html b/templates/webpages/webdav/_list.html index 5e86becb9..2e1d1e44e 100644 --- a/templates/webpages/webdav/_list.html +++ b/templates/webpages/webdav/_list.html @@ -1,25 +1,23 @@ +[% USE HTML %][% USE T8 %] -[%- IF webdav %] -

- + + + +[%- FOREACH file = WEBDAV %] - + + -[% END %] +[%- END %] +
Dokumente im Webdav-Repository[% 'File name' | $T8 %][% 'WebDAV link' | $T8 %]
- - - - - - [%- FOREACH file = WEBDAV %] - - - - - [%- END %] -
DateinameWebdavlink
[% file.name %][% file.type %]
-
[% HTML.escape(file.name) %][% HTML.escape(file.type) %]
+
+ +[%- END %] -- 2.20.1