CustomerVendor: namespace-Aufrufe entfernt
authorThomas Heck <theck@linet-services.de>
Tue, 16 Jul 2013 08:09:51 +0000 (10:09 +0200)
committerThomas Heck <theck@linet-services.de>
Tue, 16 Jul 2013 12:23:58 +0000 (14:23 +0200)
SL/Controller/CustomerVendor.pm
js/kivi.CustomerVendor.js
templates/webpages/customer_vendor/form.html
templates/webpages/customer_vendor/tabs/billing.html
templates/webpages/customer_vendor/tabs/contacts.html
templates/webpages/customer_vendor/tabs/deliveries.html
templates/webpages/customer_vendor/tabs/shipto.html

index 7937949..cfe7acc 100644 (file)
@@ -732,7 +732,7 @@ sub _pre_render {
        WHERE salesman';
     my $business_ids = [
       map(
-        { $_->{id} }
+        { $_->{id}; }
         selectall_hashref_query($::form, $dbh, $query)
       )
     ];
@@ -771,6 +771,7 @@ sub _pre_render {
   $self->{template_args} ||= {};
 
   $::request->{layout}->add_javascripts('autocomplete_customer.js');
+  $::request->{layout}->add_javascripts('kivi.CustomerVendor.js');
 }
 
 1;
index 134efb4..928c673 100644 (file)
@@ -1,7 +1,5 @@
 namespace('kivi.CustomerVendor', function(ns) {
 
-  var kivi = namespace('kivi');
-
   this.selectShipto = function(params) {
     var shiptoId = $('#shipto_shipto_id').val();
 
index 9aed709..c8ec6b0 100644 (file)
@@ -67,7 +67,7 @@
   [%- END %]
 
   [%- IF ( SELF.cv.id ) %]
-    <input type="button" class="submit" onclick="namespace('kivi.CustomerVendor').showHistoryWindow([% SELF.cv.id %]);" name="history" id="history" value="[% 'history' | $T8 %]">
+    <input type="button" class="submit" onclick="kivi.CustomerVendor.showHistoryWindow([% SELF.cv.id %]);" name="history" id="history" value="[% 'history' | $T8 %]">
   [%- END %]
 
 </form>
index 67c4ec7..7635af4 100644 (file)
@@ -88,7 +88,7 @@
         [% L.input_tag('cv.street', SELF.cv.street, size = 35, maxlength = 75) %]
         <span id="billing_map"></span>
         <script type="text/javascript">
-          namespace('kivi.CustomerVendor').showMapWidget('cv_', $('#billing_map'));
+          kivi.CustomerVendor.showMapWidget('cv_', $('#billing_map'));
         </script>
       </td>
     </tr>
index 398f60c..d2b87b1 100644 (file)
@@ -18,7 +18,7 @@
             empty_title = LxERP.t8('New contact'),
             value_key = 'cp_id',
             title_key = 'full_name',
-            onchange = "namespace('kivi.CustomerVendor').selectContact({onFormSet: function(){contactsMapWidget.testInputs();}});",
+            onchange = "kivi.CustomerVendor.selectContact({onFormSet: function(){contactsMapWidget.testInputs();}});",
           )
         %]
       </td>
         [% L.input_tag('contact.cp_street', SELF.contact.cp_street, size = 40, maxlength = 75) %]
         <span id="contact_map"></span>
         <script type="text/javascript">
-        var contactsMapWidget = namespace('kivi.CustomerVendor').showMapWidget('contact_cp_', $('#contact_map'));
+        var contactsMapWidget = kivi.CustomerVendor.showMapWidget('contact_cp_', $('#contact_map'));
         </script>
       </td>
     </tr>
index 559dc0b..8cf755f 100644 (file)
@@ -16,7 +16,7 @@
             value_key = 'shipto_id',
             title_key = 'displayable_id',
             with_empty = 1,
-            onchange = "namespace('kivi.CustomerVendor').selectDelivery();"
+            onchange = "kivi.CustomerVendor.selectDelivery();"
           )
         %]
       </td>
@@ -30,7 +30,7 @@
           L.date_tag(
             'delivery_from',
             FORM.delivery_from,
-            onchange => "namespace('kivi.CustomerVendor').selectDelivery(this.form.delivery_from.value, this.form.delivery_to.value);"
+            onchange => "kivi.CustomerVendor.selectDelivery(this.form.delivery_from.value, this.form.delivery_to.value);"
           )
         %]
       </td>
@@ -43,7 +43,7 @@
           L.date_tag(
             'delivery_to',
             FORM.delivery_to,
-            onchange => "namespace('kivi.CustomerVendor').selectDelivery(this.form.delivery_from.value, this.form.delivery_to.value);"
+            onchange => "kivi.CustomerVendor.selectDelivery(this.form.delivery_from.value, this.form.delivery_to.value);"
           )
         %]
       </td>
index 5080802..b4fbb28 100644 (file)
@@ -16,7 +16,7 @@
              title_key = 'displayable_id',
              with_empty = 1,
              empty_title = LxERP.t8('New shipto'),
-             onchange = "namespace('kivi.CustomerVendor').selectShipto({onFormSet: function(){shiptoMapWidget.testInputs();}});",
+             onchange = "kivi.CustomerVendor.selectShipto({onFormSet: function(){shiptoMapWidget.testInputs();}});",
            )
         %]
       </td>
@@ -47,7 +47,7 @@
 
         <span id="shipto_map"></span>
         <script type="text/javascript">
-          var shiptoMapWidget = namespace('kivi.CustomerVendor').showMapWidget('shipto_shipto', $('#shipto_map'));
+          var shiptoMapWidget = kivi.CustomerVendor.showMapWidget('shipto_shipto', $('#shipto_map'));
         </script>
       </td>
     </tr>