--- /dev/null
+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;
</table>
</p>
- <hr size="3" noshade>
+ </div>
+[% PROCESS 'webdav/_list.html' %]
+ <div id="ui-tabs-1">
+ [%- LxERP.t8("Loading...") %]
+ </div>
+</div>
- [%- IF conf_webdav %]
- <div class="listtop" align="left">[% 'Documents in the WebDAV repository' | $T8 %]</div>
-
- <p>
- <table width="100%">
- <tr>
- <td align="left" width="30%"><b>[% 'File name' | $T8 %]</b></td>
- <td align="left" width="70%"><b>[% 'WebDAV link' | $T8 %]</b></td>
- </tr>
-
- [%- FOREACH file = WEBDAV %]
- <tr>
- <td align="left">[% HTML.escape(file.name) %]</td>
- <td align="left"><a href="[% HTML.escape(file.link) %]">[% HTML.escape(file.type) %]</a></td>
- </tr>
- [%- END %]
-
- </table>
- </p>
-
- <hr size="3" noshade>
- [%- END %]
+<hr size="3" noshade>
<p>[% PRINT_OPTIONS %]</p>
<form method="post" name="do" action="do.pl">
+ <div class="tabwidget">
+ <ul>
+ <li><a href="#ui-tabs-basic-data">[% 'Basic Data' | $T8 %]</a></li>
+[%- IF conf_webdav %]
+ <li><a href="#ui-tabs-webdav">[% 'WebDAV' | $T8 %]</a></li>
+[%- END %]
+[%- IF id %]
+ <li><a href="controller.pl?action=RecordLinks/ajax_list&object_model=DeliveryOrder&object_id=[% HTML.url(id) %]">[% 'Linked Records' | $T8 %]</a></li>
+[%- END %]
+ </ul>
+
+ <div id="ui-tabs-basic-data">
+
<input type="hidden" name="follow_up_trans_id_1" value="[% HTML.escape(id) %]">
<input type="hidden" name="follow_up_trans_type_1" value="[% HTML.escape(type) %]">
<input type="hidden" name="follow_up_trans_info_1" value="[% HTML.escape(follow_up_trans_info) %]">
</td>
</tr>
-[% PROCESS 'webdav/_list.html' %]
-
[% PROCESS 'ir/_payments.html' %]
- <tr>
- <td><hr size="3" noshade></td>
- </tr>
- <tr>
- <td>
-[% print_options %]
- </td>
- </tr>
</table>
+</div>
+[% PROCESS 'webdav/_list.html' %]
+<div id="ui-tabs-1">
+ [%- LxERP.t8("Loading...") %]
+</div>
+</div>
+<hr size="3" noshade>
+<p>[% print_options %]</p>
[% IF id %]
[%- INCLUDE 'common/flash.html' %]
+<div class="tabwidget">
+ <ul>
+ <li><a href="#ui-tabs-basic-data">[% 'Basic Data' | $T8 %]</a></li>
+[%- IF conf_webdav %]
+ <li><a href="#ui-tabs-webdav">[% 'WebDAV' | $T8 %]</a></li>
+[%- END %]
+[%- IF id %]
+ <li><a href="controller.pl?action=RecordLinks/ajax_list&object_model=PurchaseInvoice&object_id=[% HTML.url(id) %]">[% 'Linked Records' | $T8 %]</a></li>
+[%- END %]
+ </ul>
+
+ <div id="ui-tabs-basic-data">
<table width="100%">
<tr>
<td valign="top">
[%- USE T8 %]
[%- USE HTML %]
[%- USE LxERP %]
-[%- USE L %]
+[%- USE L %][%- USE P -%]
<tr>
<td>
<table width="100%">
</td>
</tr>
-[% PROCESS 'webdav/_list.html' %]
-
[% PROCESS 'is/_payments.html' %]
-
- <tr>
- <td><hr size="3" noshade></td>
- </tr>
- <tr>
- <td>
-[% print_options %]
- </td>
- </tr>
</table>
+</div>
+[% PROCESS 'webdav/_list.html' %]
+<div id="ui-tabs-1">
+ [% LxERP.t8('Loading...') %]
+</div>
+</div>
+<hr size="3" noshade>
+<p>[% print_options %]</p>
[% IF id %]
[%- PROCESS 'common/flash.html' %]
+<div class="tabwidget">
+ <ul>
+ <li><a href="#ui-tabs-basic-data">[% 'Basic Data' | $T8 %]</a></li>
+[%- IF conf_webdav %]
+ <li><a href="#ui-tabs-webdav">[% 'WebDAV' | $T8 %]</a></li>
+[%- END %]
+[%- IF id %]
+ <li><a href="controller.pl?action=RecordLinks/ajax_list&object_model=Invoice&object_id=[% HTML.url(id) %]">[% 'Linked Records' | $T8 %]</a></li>
+[%- END %]
+ </ul>
+
+<div id="ui-tabs-basic-data">
<table width="100%">
<tr>
<td valign="top">
</table>
</td>
</tr>
- <tr>
- <td><hr size="3" noshade></td>
- </tr>
+</table>
-[%- IF webdav %]
- <tr>
- <th class="listtop" align="left">Dokumente im Webdav-Repository</th>
- </tr>
- <tr>
- <td>
- <table width="100%">
- <tr>
- <td align="left" width="30%"><b>Dateiname</b></td>
- <td align="left" width="70%"><b>Webdavlink</b></td>
- </tr>
- [%- FOREACH file = WEBDAV %]
- <tr>
- <td align="left">[% HTML.escape(file.name) %]</td>
- <td align="left"><a href="[% file.link %]">[% HTML.escape(file.type) %]</a></td>
- </tr>
- [%- END %]
- </table>
- </td>
- </tr>
- <tr>
- <td><hr size="3" noshade></td>
- </tr>
-[%- END %]
+</div>
+[%- PROCESS 'webdav/_list.html' %]
+<div id="ui-tabs-1">
+ [%- LxERP.t8("Loading...") %]
+</div>
+</div>
- <tr>
- <td>
- [% print_options %]
- </td>
- </tr>
-</table>
+<hr size="3" noshade>
+
+<p>[% PRINT_OPTIONS %]</p>
[% label_edit %]<br>
<input class="submit" type="submit" name="action_update" id="update_button" value="[% 'Update' | $T8 %]">
[%- INCLUDE 'common/flash.html' %]
+ <div class="tabwidget">
+ <ul>
+ <li><a href="#ui-tabs-basic-data">[% 'Basic Data' | $T8 %]</a></li>
+[%- IF conf_webdav %]
+ <li><a href="#ui-tabs-webdav">[% 'WebDAV' | $T8 %]</a></li>
+[%- END %]
+[%- IF id %]
+ <li><a href="controller.pl?action=RecordLinks/ajax_list&object_model=Order&object_id=[% HTML.url(id) %]">[% 'Linked Records' | $T8 %]</a></li>
+[%- END %]
+ </ul>
+
+ <div id="ui-tabs-basic-data">
+
<table width="100%">
<tr>
<td>
+[% USE HTML %][% USE T8 %]
-[%- IF webdav %]
- <tr>
- <td><hr size="3" noshade></td>
- </tr>
+[%- IF conf_webdav %]
+<div id="ui-tabs-webdav">
+
+ <div class="listtop" align="left">[% 'Documents in the WebDAV repository' | $T8 %]</div>
+
+ <table width="100%">
<tr>
- <th class="listtop" align="left">Dokumente im Webdav-Repository</th>
+ <td align="left" width="30%"><b>[% 'File name' | $T8 %]</b></td>
+ <td align="left" width="70%"><b>[% 'WebDAV link' | $T8 %]</b></td>
</tr>
+
+[%- FOREACH file = WEBDAV %]
<tr>
- <td>
- <table width="100%">
- <tr>
- <td align="left" width="30%"><b>Dateiname</b></td>
- <td align="left" width="70%"><b>Webdavlink</b></td>
- </tr>
- [%- FOREACH file = WEBDAV %]
- <tr>
- <td align="left">[% file.name %]</td>
- <td align="left"><a href="[% file.link %]">[% file.type %]</a></td>
- </tr>
- [%- END %]
- </table>
- </td>
+ <td align="left">[% HTML.escape(file.name) %]</td>
+ <td align="left"><a href="[% HTML.escape(file.link) %]">[% HTML.escape(file.type) %]</a></td>
</tr>
-[% END %]
+[%- END %]
+ </table>
+</div>
+
+[%- END %]