Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 18b1b180

Von Moritz Bunkus vor mehr als 11 Jahren hinzugefügt

  • ID 18b1b18015503fb46e8e1201f79e968f097f66e0
  • Vorgänger f3978ea1
  • Nachfolger 942a5b2c

Verkaufs-/Einkaufsbelege: Neuer Tab "Verknüpfte Belege", per AJAX geladen

Außerdem WebDAV in eigenen Tab geschoben und Ausgabe vereinheitlicht

Unterschiede anzeigen:

SL/Controller/RecordLinks.pm
1
package SL::Controller::RecordLinks;
2

  
3
use strict;
4

  
5
use parent qw(SL::Controller::Base);
6

  
7
use SL::DB::Order;
8
use SL::DB::DeliveryOrder;
9
use SL::DB::Invoice;
10
use SL::DB::PurchaseInvoice;
11
use SL::Locale::String;
12

  
13
#
14
# actions
15
#
16

  
17
sub action_ajax_list {
18
  my ($self) = @_;
19

  
20
  eval {
21
    die $::locale->text("Invalid parameters") if (!$::form->{object_id} || ($::form->{object_model} !~ m/^(?:Order|DeliveryOrder|Invoice|PurchaseInvoice)$/));
22

  
23
    my $model          = 'SL::DB::' . $::form->{object_model};
24
    my $object         = $model->new(id => $::form->{object_id})->load || die $::locale->text("Record not found");
25
    my $linked_records = $object->linked_records(direction => 'both');
26
    my $output         = SL::Presenter->get->grouped_record_list($linked_records);
27
    $self->render(\$output, { layout => 0, process => 0 });
28

  
29
    1;
30
  } or do {
31
    $self->render('generic/error', { layout => 0 }, label_error => $@);
32
  };
33
}
34

  
35
1;
templates/webpages/do/form_footer.html
23 23
   </table>
24 24
  </p>
25 25

  
26
  <hr size="3" noshade>
26
 </div>
27
[% PROCESS 'webdav/_list.html' %]
28
 <div id="ui-tabs-1">
29
  [%- LxERP.t8("Loading...") %]
30
 </div>
31
</div>
27 32

  
28
  [%- IF conf_webdav %]
29
  <div class="listtop" align="left">[% 'Documents in the WebDAV repository' | $T8 %]</div>
30

  
31
  <p>
32
   <table width="100%">
33
    <tr>
34
     <td align="left" width="30%"><b>[% 'File name' | $T8 %]</b></td>
35
     <td align="left" width="70%"><b>[% 'WebDAV link' | $T8 %]</b></td>
36
    </tr>
37

  
38
    [%- FOREACH file = WEBDAV %]
39
    <tr>
40
     <td align="left">[% HTML.escape(file.name) %]</td>
41
     <td align="left"><a href="[% HTML.escape(file.link) %]">[% HTML.escape(file.type) %]</a></td>
42
    </tr>
43
    [%- END %]
44

  
45
   </table>
46
  </p>
47

  
48
  <hr size="3" noshade>
49
  [%- END %]
33
<hr size="3" noshade>
50 34

  
51 35
  <p>[% PRINT_OPTIONS %]</p>
52 36

  
templates/webpages/do/form_header.html
45 45

  
46 46
 <form method="post" name="do" action="do.pl">
47 47

  
48
 <div class="tabwidget">
49
  <ul>
50
   <li><a href="#ui-tabs-basic-data">[% 'Basic Data' | $T8 %]</a></li>
51
[%- IF conf_webdav %]
52
   <li><a href="#ui-tabs-webdav">[% 'WebDAV' | $T8 %]</a></li>
53
[%- END %]
54
[%- IF id %]
55
   <li><a href="controller.pl?action=RecordLinks/ajax_list&object_model=DeliveryOrder&object_id=[% HTML.url(id) %]">[% 'Linked Records' | $T8 %]</a></li>
56
[%- END %]
57
  </ul>
58

  
59
  <div id="ui-tabs-basic-data">
60

  
48 61
  <input type="hidden" name="follow_up_trans_id_1" value="[% HTML.escape(id) %]">
49 62
  <input type="hidden" name="follow_up_trans_type_1" value="[% HTML.escape(type) %]">
50 63
  <input type="hidden" name="follow_up_trans_info_1" value="[% HTML.escape(follow_up_trans_info) %]">
templates/webpages/ir/form_footer.html
78 78
   </td>
79 79
  </tr>
80 80

  
81
[% PROCESS 'webdav/_list.html' %]
82

  
83 81
[% PROCESS 'ir/_payments.html' %]
84 82

  
85
  <tr>
86
    <td><hr size="3" noshade></td>
87
  </tr>
88
  <tr>
89
    <td>
90
[% print_options %]
91
    </td>
92
  </tr>
93 83
 </table>
84
</div>
85
[% PROCESS 'webdav/_list.html' %]
86
<div id="ui-tabs-1">
87
 [%- LxERP.t8("Loading...") %]
88
</div>
89
</div>
94 90

  
91
<hr size="3" noshade>
95 92

  
93
<p>[% print_options %]</p>
96 94

  
97 95
  [% IF id %]
98 96

  
templates/webpages/ir/form_header.html
25 25

  
26 26
[%- INCLUDE 'common/flash.html' %]
27 27

  
28
<div class="tabwidget">
29
 <ul>
30
  <li><a href="#ui-tabs-basic-data">[% 'Basic Data' | $T8 %]</a></li>
31
[%- IF conf_webdav %]
32
  <li><a href="#ui-tabs-webdav">[% 'WebDAV' | $T8 %]</a></li>
33
[%- END %]
34
[%- IF id %]
35
  <li><a href="controller.pl?action=RecordLinks/ajax_list&object_model=PurchaseInvoice&object_id=[% HTML.url(id) %]">[% 'Linked Records' | $T8 %]</a></li>
36
[%- END %]
37
 </ul>
38

  
39
 <div id="ui-tabs-basic-data">
28 40
<table width="100%">
29 41
  <tr>
30 42
    <td valign="top">
templates/webpages/is/form_footer.html
1 1
[%- USE T8 %]
2 2
[%- USE HTML %]
3 3
[%- USE LxERP %]
4
[%- USE L %]
4
[%- USE L %][%- USE P -%]
5 5
  <tr>
6 6
   <td>
7 7
    <table width="100%">
......
107 107
   </td>
108 108
  </tr>
109 109

  
110
[% PROCESS 'webdav/_list.html' %]
111

  
112 110
[% PROCESS 'is/_payments.html' %]
113

  
114
  <tr>
115
    <td><hr size="3" noshade></td>
116
  </tr>
117
  <tr>
118
    <td>
119
[% print_options %]
120
    </td>
121
  </tr>
122 111
 </table>
112
</div>
113
[% PROCESS 'webdav/_list.html' %]
114
<div id="ui-tabs-1">
115
 [% LxERP.t8('Loading...') %]
116
</div>
117
</div>
123 118

  
119
<hr size="3" noshade>
124 120

  
121
<p>[% print_options %]</p>
125 122

  
126 123
  [% IF id %]
127 124

  
templates/webpages/is/form_header.html
26 26

  
27 27
[%- PROCESS 'common/flash.html' %]
28 28

  
29
<div class="tabwidget">
30
 <ul>
31
  <li><a href="#ui-tabs-basic-data">[% 'Basic Data' | $T8 %]</a></li>
32
[%- IF conf_webdav %]
33
  <li><a href="#ui-tabs-webdav">[% 'WebDAV' | $T8 %]</a></li>
34
[%- END %]
35
[%- IF id %]
36
  <li><a href="controller.pl?action=RecordLinks/ajax_list&object_model=Invoice&object_id=[% HTML.url(id) %]">[% 'Linked Records' | $T8 %]</a></li>
37
[%- END %]
38
 </ul>
39

  
40
<div id="ui-tabs-basic-data">
29 41
<table width="100%">
30 42
  <tr>
31 43
    <td valign="top">
templates/webpages/oe/form_footer.html
96 96
      </table>
97 97
    </td>
98 98
  </tr>
99
  <tr>
100
    <td><hr size="3" noshade></td>
101
  </tr>
99
</table>
102 100

  
103
[%- IF webdav %]
104
  <tr>
105
    <th class="listtop" align="left">Dokumente im Webdav-Repository</th>
106
  </tr>
107
  <tr>
108
   <td>
109
    <table width="100%">
110
     <tr>
111
      <td align="left" width="30%"><b>Dateiname</b></td>
112
      <td align="left" width="70%"><b>Webdavlink</b></td>
113
     </tr>
114
 [%- FOREACH file = WEBDAV %]
115
      <tr>
116
        <td align="left">[% HTML.escape(file.name) %]</td>
117
        <td align="left"><a href="[% file.link %]">[% HTML.escape(file.type) %]</a></td>
118
      </tr>
119
 [%- END %]
120
    </table>
121
   </td>
122
  </tr>
123
  <tr>
124
    <td><hr size="3" noshade></td>
125
  </tr>
126
[%- END %]
101
</div>
102
[%- PROCESS 'webdav/_list.html' %]
103
<div id="ui-tabs-1">
104
 [%- LxERP.t8("Loading...") %]
105
</div>
106
</div>
127 107

  
128
  <tr>
129
    <td>
130
      [% print_options %]
131
    </td>
132
  </tr>
133
</table>
108
<hr size="3" noshade>
109

  
110
<p>[% PRINT_OPTIONS %]</p>
134 111

  
135 112
[% label_edit %]<br>
136 113
<input class="submit" type="submit" name="action_update" id="update_button" value="[% 'Update' | $T8 %]">
templates/webpages/oe/form_header.html
29 29

  
30 30
[%- INCLUDE 'common/flash.html' %]
31 31

  
32
    <div class="tabwidget">
33
     <ul>
34
      <li><a href="#ui-tabs-basic-data">[% 'Basic Data' | $T8 %]</a></li>
35
[%- IF conf_webdav %]
36
      <li><a href="#ui-tabs-webdav">[% 'WebDAV' | $T8 %]</a></li>
37
[%- END %]
38
[%- IF id %]
39
      <li><a href="controller.pl?action=RecordLinks/ajax_list&object_model=Order&object_id=[% HTML.url(id) %]">[% 'Linked Records' | $T8 %]</a></li>
40
[%- END %]
41
     </ul>
42

  
43
     <div id="ui-tabs-basic-data">
44

  
32 45
    <table width="100%">
33 46
      <tr>
34 47
        <td>
templates/webpages/webdav/_list.html
1
[% USE HTML %][% USE T8 %]
1 2

  
2
[%- IF webdav %]
3
  <tr>
4
   <td><hr size="3" noshade></td>
5
  </tr>
3
[%- IF conf_webdav %]
4
<div id="ui-tabs-webdav">
5

  
6
 <div class="listtop" align="left">[% 'Documents in the WebDAV repository' | $T8 %]</div>
7

  
8
 <table width="100%">
6 9
  <tr>
7
   <th class="listtop" align="left">Dokumente im Webdav-Repository</th>
10
   <td align="left" width="30%"><b>[% 'File name' | $T8 %]</b></td>
11
   <td align="left" width="70%"><b>[% 'WebDAV link' | $T8 %]</b></td>
8 12
  </tr>
13

  
14
[%- FOREACH file = WEBDAV %]
9 15
  <tr>
10
   <td>
11
   <table width="100%">
12
    <tr>
13
     <td align="left" width="30%"><b>Dateiname</b></td>
14
     <td align="left" width="70%"><b>Webdavlink</b></td>
15
    </tr>
16
 [%- FOREACH file = WEBDAV %]
17
    <tr>
18
     <td align="left">[% file.name %]</td>
19
     <td align="left"><a href="[% file.link %]">[% file.type %]</a></td>
20
    </tr>
21
 [%- END %]
22
   </table>
23
   </td>
16
   <td align="left">[% HTML.escape(file.name) %]</td>
17
   <td align="left"><a href="[% HTML.escape(file.link) %]">[% HTML.escape(file.type) %]</a></td>
24 18
  </tr>
25
[% END %]
19
[%- END %]
20
 </table>
21
</div>
22

  
23
[%- END %]

Auch abrufbar als: Unified diff