epic-ts
[kivitendo-erp.git] / SL / Layout / Top.pm
index 075e2f2..e2e5d2d 100644 (file)
@@ -6,16 +6,22 @@ use parent qw(SL::Layout::Base);
 sub pre_content {
   my ($self) = @_;
 
-  $self->SUPER::render('menu/header', { partial => 1, no_output => 1 },
-                now        => DateTime->now_local,
-                is_fastcgi => scalar($::dispatcher->interface_type =~ /fastcgi/i),
-                is_links   => scalar($ENV{HTTP_USER_AGENT}         =~ /links/i));
+  $self->presenter->render('menu/header',
+    now        => DateTime->now_local,
+    is_fastcgi => $::dispatcher ? scalar($::dispatcher->interface_type =~ /fastcgi/i) : 0,
+    is_links   => scalar($ENV{HTTP_USER_AGENT}         =~ /links/i),
+  );
 }
 
 sub stylesheets {
  'frame_header/header.css';
 }
 
+sub javascripts {
+  ('jquery-ui.js', 'quicksearch_input.js') x!! $::auth->assert('customer_vendor_edit', 1),
+  ('jquery-ui.js', 'glquicksearch.js')     x!! $::auth->assert('general_ledger', 1)
+}
+
 1;
 
 __END__