Dialogbuchen um WebDAV-Funktion erweitert
authorJan Büren <jan@kivitendo-premium.de>
Fri, 23 Dec 2016 08:35:11 +0000 (09:35 +0100)
committerJan Büren <jan@kivitendo-premium.de>
Fri, 23 Dec 2016 08:35:11 +0000 (09:35 +0100)
SL/Webdav.pm
bin/mozilla/gl.pl
templates/webpages/gl/form_footer.html
templates/webpages/gl/form_header.html

index 505fef4..22a4020 100644 (file)
@@ -30,6 +30,7 @@ my %type_to_path = (
   service                 => 'dienstleistungen',
   assembly                => 'erzeugnisse',
   letter                  => 'briefe',
+  general_ledger          => 'dialogbuchungen',
 );
 
 sub get_all_files {
index 77591f5..2c5f74a 100644 (file)
@@ -43,6 +43,8 @@ use SL::GL;
 use SL::IS;
 use SL::ReportGenerator;
 use SL::DBUtils qw(selectrow_query selectall_hashref_query);
+use SL::Webdav;
+use SL::Locale::String qw(t8);
 
 require "bin/mozilla/common.pl";
 require "bin/mozilla/reportgenerator.pl";
@@ -200,6 +202,18 @@ sub edit {
 
   $form->{show_details} = $myconfig{show_form_details} unless defined $form->{show_details};
 
+  if ($form->{reference} && $::instance_conf->get_webdav) {
+    my $webdav = SL::Webdav->new(
+      type     => 'general_ledger',
+      number   => $form->{reference},
+    );
+    my $webdav_path = $webdav->webdav_path;
+    my @all_objects = $webdav->get_all_objects;
+    @{ $form->{WEBDAV} } = map { { name => $_->filename,
+                                   type => t8('File'),
+                                   link => File::Spec->catdir($webdav_path, $_->filename),
+                               } } @all_objects;
+  }
   form_header();
   display_rows();
   form_footer();
@@ -1168,6 +1182,11 @@ sub post {
   $form->{storno} = 0;
 
   post_transaction();
+  if ($::instance_conf->get_webdav) {
+    SL::Webdav->new(type     => 'general_ledger',
+                    number   => $form->{reference},
+                   )->webdav_path;
+  }
 
   $form->{callback} = build_std_url("action=add", "show_details");
   $form->redirect($form->{callback});
index 1742ec3..48bbbea 100644 (file)
   </td>
   </tr>
 </table>
+</div>
+[% PROCESS 'webdav/_list.html' %]
+</div>
 
+<hr size="3" noshade>
 <input name=callback type=hidden value="[% callback %]">
 
 [%- IF id && follow_ups.size %]
index 1ad7197..ec74206 100644 (file)
@@ -49,6 +49,15 @@ function updateTaxes(row)
 <input type="hidden" name="follow_up_trans_info_1" value="[% id | html %]">
 <input type="hidden" name="follow_up_rowcount" value="1">
 
+<div id="ir_tabs" class="tabwidget">
+ <ul>
+  <li><a href="#ui-tabs-basic-data">[% 'Basic Data' | $T8 %]</a></li>
+[%- IF INSTANCE_CONF.get_webdav %]
+  <li><a href="#ui-tabs-webdav">[% 'WebDAV' | $T8 %]</a></li>
+[%- END %]
+ </ul>
+ <div id="ui-tabs-basic-data">
+
 <table width=100%>
 [%- IF saved_message %]
   <tr>