]> 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 5ef07b75bbfc2a5bf90d049db01caa76fa0b1c1b..ff507d10792cd5c8510e363f03af6ecefb83ab85 100644 (file)
@@ -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
   }
 
@@ -466,7 +468,7 @@ sub sortable_table_header {
 }
 
 sub paginate_controls {
-  my ($self)          = @_;
+  my ($self, %params) = _hashify(1, @_);
 
   my $controller      = $self->{CONTEXT}->stash->get('SELF');
   my $paginate_spec   = $controller->get_paginate_spec;
@@ -481,6 +483,7 @@ sub paginate_controls {
 
       return $controller->get_callback(%url_params);
     },
+    %params,
   );
 
   return SL::Presenter->get->render('common/paginate', %template_params);
@@ -733,6 +736,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: