]> wagnertech.de Git - mfinanz.git/blobdiff - SL/Template/Plugin/L.pm
Merge branch 'master' of github.com:kivitendo/kivitendo-erp
[mfinanz.git] / SL / Template / Plugin / L.pm
index d9deef78ed4cefb96ce23b73b4856c74fddc1872..3e157a3665b41dd04200d34fd7e6c786067b6265 100644 (file)
@@ -185,7 +185,7 @@ sub ajax_submit_tag {
 
   $url           = _J($url);
   $form_selector = _J($form_selector);
-  my $onclick    = qq|submit_ajax_form('${url}', '${form_selector}')|;
+  my $onclick    = qq|kivi.submit_ajax_form('${url}', '${form_selector}')|;
 
   return $self->button_tag($onclick, $text, @slurp);
 }
@@ -390,8 +390,10 @@ JAVASCRIPT
     my $filter  = ".filter(function(idx) { return this.substr(0, " . length($params{with}) . ") == '$params{with}'; })";
     $filter    .= ".map(function(idx, str) { return str.replace('$params{with}_', ''); })";
 
+    my $params_js = $params{params} ? qq| + ($params{params})| : '';
+
     $stop_event = <<JAVASCRIPT;
-        \$.post('$params{url}', { '${as}[]': \$(\$('${selector}').sortable('toArray'))${filter}.toArray() });
+        \$.post('$params{url}'${params_js}, { '${as}[]': \$(\$('${selector}').sortable('toArray'))${filter}.toArray() });
 JAVASCRIPT
   }
 
@@ -580,8 +582,8 @@ clicks the dialog's ok/yes button.
 Creates a HTML 'input type="button"' tag with a very specific onclick
 handler that submits the form given by the jQuery selector
 C<$form_selector> to the URL C<$url> (the actual JavaScript function
-called for that is C<submit_ajax_form()> in C<js/client_js.js>). The
-button's label will be C<$text>.
+called for that is C<kivi.submit_ajax_form()> in
+C<js/client_js.js>). The button's label will be C<$text>.
 
 =item C<button_tag $onclick, $text, %attributes>
 
@@ -733,6 +735,11 @@ If trueish then the children will not be recolored. The default is to
 recolor the children by setting the class C<listrow0> on odd and
 C<listrow1> on even entries.
 
+=item C<params>
+
+An optional JavaScript string that is evaluated before sending the
+POST request. The result must be a string that is appended to the URL.
+
 =back
 
 Example: