Lieferungentab mit jQuery & AJAX neu laden lassen, nicht via CGI::AJAX
authorMoritz Bunkus <m.bunkus@linet-services.de>
Fri, 22 Jul 2011 11:42:09 +0000 (13:42 +0200)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Fri, 22 Jul 2011 11:42:09 +0000 (13:42 +0200)
bin/mozilla/ct.pl
templates/webpages/ct/form_header.html
templates/webpages/ct/get_delivery.html

index 92ef085..cdb0852 100644 (file)
@@ -45,7 +45,6 @@
 # $locale->text('Vendor deleted!')
 # $locale->text('Cannot delete vendor!')
 
-use CGI::Ajax;
 use POSIX qw(strftime);
 
 use SL::CT;
@@ -327,7 +326,6 @@ sub form_header {
   $form->{taxzone_id}     = 0                                                               if !$form->{id};
   $form->{jsscript}       = 1;
   $form->{fokus}          = "ct.greeting";
-  $form->{AJAX}           = [ new CGI::Ajax( map {; "get_$_" => "$form->{script}?action=get_$_" } qw(delivery) ) ];
   $form->{SHIPTO_ALL}     = [ +{ shipto_id => '0', shiptoname => $::locale->text('All') }, @{ $form->{SHIPTO} } ];
 
   $form->{title} = $form->{title_save}
index a09bfe3..91d8636 100644 (file)
     <table>
      <tr>
       <th align="right">[% 'Shipping Address' | $T8 %]</th>
-      <td>
-       [%- INCLUDE generic/multibox.html
-             name       = 'delivery_id',
-             id         = 'delivery_id',
-             DATA       = SHIPTO_ALL,
-             onChange   = "get_delivery(['shipto_id__' + this.value, 'from__' + from.value, 'to__' + to.value, 'id__' + cvid.value, 'db__' + db.value], ['delivery'])",
-             id_key     = 'shipto_id',
-             label_sub  = 'shipto_label',
-             show_empty = 1,
-       -%]
+      <td colspan="3">
+       [% L.select_tag('delivery_id', L.options_for_select(SHIPTO_ALL, title_sub => \shipto_label, with_empty => 1),
+                       onchange => "\$('#delivery').load('ct.pl?action=get_delivery&id=' + \$('#cvid').attr('value') + '&db=' + \$('#db').attr('value') + '&shipto_id=' + this.value)") %]
       </td>
      </tr>
 
index 73d2154..921aaba 100644 (file)
@@ -1,5 +1,6 @@
 [%- USE T8 %]
 [% USE HTML %][% USE LxERP %]
+<div id="delivery">
 <table width="100%">
   <tr>
     <td>
@@ -39,3 +40,4 @@
 [%- IF DELIVERY.size == 15 %]
      <p>[% 'This list is capped at 15 items to keep it fast. If you need a full list, please use reports.' | $T8 %]</p>
 [%- END %]
+</div>