summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--LedgerSMB/DBObject.pm2
-rw-r--r--UI/menu/drilldown.html34
-rw-r--r--UI/menu/expanding.css3
-rw-r--r--UI/menu/expanding.html (renamed from UI/menu_expand.html)2
-rw-r--r--scripts/menu.pl76
5 files changed, 86 insertions, 31 deletions
diff --git a/LedgerSMB/DBObject.pm b/LedgerSMB/DBObject.pm
index d50c300c..e712c934 100644
--- a/LedgerSMB/DBObject.pm
+++ b/LedgerSMB/DBObject.pm
@@ -133,7 +133,7 @@ sub exec_method {
for (@in_args) { push @call_args, $_ } ;
$self->{call_args} = \@call_args;
$self->debug({file => '/tmp/dbobject'});
- $self->call_procedure( procname => $funcname, args => @call_args );
+ $self->call_procedure( procname => $funcname, args => \@call_args );
}
sub run_custom_queries {
diff --git a/UI/menu/drilldown.html b/UI/menu/drilldown.html
new file mode 100644
index 00000000..a09a3c7e
--- /dev/null
+++ b/UI/menu/drilldown.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <title>Accounting Menu - LedgerSMB Version 1.2.7 - Chris Travers - metatron_ledger</title>
+ <meta http-equiv="Pragma" content="no-cache" />
+ <meta http-equiv="Expires" content="-1" />
+ <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
+ <link rel="stylesheet" href="css/<?lsmb stylesheet ?>" type="text/css" title="LedgerSMB stylesheet" />
+ <link rel="stylesheet" href="UI/menu/expanding.css" type="text/css" title="LedgerSMB stylesheet" />
+
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
+
+ <meta name="robots" content="noindex,nofollow" />
+</head>
+<body>
+ <?lsmb FOR item = menu_items ?>
+ <a href="<?lsmb IF item.module ?><?lsmb item.module
+ ?><?lsmb ELSE ?>menu.pl<?lsmb END
+ ?>?login=<?lsmb login
+ ?>&<?lsmb FOREACH arg IN item.args
+ ?><?lsmb arg
+ ?><?lsmb END
+ ?><?lsmb IF item.menu
+ ?>&parent_id=<?lsmb item.id
+ ?>&open=<?lsmb open
+ ?><?lsmb END ?>&menubar=1"
+ class = "<?lsmb IF item.menu ?>Menu<?lsmb
+ ELSE ?>Item<?lsmb END ?>"
+ ><?lsmb text(item.label) ?></a>
+ <br/>
+ <?lsmb END ?>
+</body>
+</html>
diff --git a/UI/menu/expanding.css b/UI/menu/expanding.css
new file mode 100644
index 00000000..46461cff
--- /dev/null
+++ b/UI/menu/expanding.css
@@ -0,0 +1,3 @@
+div.submenu {
+ display: none;
+}
diff --git a/UI/menu_expand.html b/UI/menu/expanding.html
index 7a4ef447..9aa4fead 100644
--- a/UI/menu_expand.html
+++ b/UI/menu/expanding.html
@@ -7,7 +7,7 @@
<meta http-equiv="Expires" content="-1" />
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
<link rel="stylesheet" href="css/<?lsmb stylesheet ?>" type="text/css" title="LedgerSMB stylesheet" />
- <link rel="stylesheet" href="UI/menu_expand.css" type="text/css" title="LedgerSMB stylesheet" />
+ <link rel="stylesheet" href="UI/menu/expanding.css" type="text/css" title="LedgerSMB stylesheet" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
diff --git a/scripts/menu.pl b/scripts/menu.pl
index af5a428a..ee88f08e 100644
--- a/scripts/menu.pl
+++ b/scripts/menu.pl
@@ -15,7 +15,7 @@ use strict;
sub __default {
my ($request) = @_;
if ($request->{menubar}){
- # todo
+ drilldown_menu($request);
} else {
expanding_menu($request);
}
@@ -29,46 +29,64 @@ sub root_doc {
$request->{main} = "am.pl?action=recurring_transactions"
if $request->{main} eq 'recurring_transactions';
$template = LedgerSMB::Template->new(
- user =>$request->{_user},
- locale => $request->{_locale},
- path => 'UI',
- template => 'frameset',
- format => 'HTML'
- );
- } else {
- # TODO: Create Lynx Initial Menu
- }
- $template->render($request);
- }
+ user =>$request->{_user},
+ locale => $request->{_locale},
+ path => 'UI',
+ template => 'frameset',
+ format => 'HTML'
+ );
+ } else {
+ drilldown_menu($request);
+ return;
+ }
+ $template->render($request);
+}
- sub expanding_menu {
- my ($request) = @_;
- if ($request->{'open'} !~ s/:$request->{id}:/:/){
- $request->{'open'} .= ":$request->{id}:";
- }
+sub expanding_menu {
+ my ($request) = @_;
+ if ($request->{'open'} !~ s/:$request->{id}:/:/){
+ $request->{'open'} .= ":$request->{id}:";
+ }
- # The above system can lead to extra colons.
- $request->{'open'} =~ s/:+/:/g;
+ # The above system can lead to extra colons.
+ $request->{'open'} =~ s/:+/:/g;
-
+
- my $menu = LedgerSMB::DBObject::Menu->new({base => $request});
- $menu->generate();
- for my $item (@{$menu->{menu_items}}){
- if ($request->{'open'} =~ /:$item->{id}:/ ){
- $item->{'open'} = 'true';
- }
- }
+ my $menu = LedgerSMB::DBObject::Menu->new({base => $request});
+ $menu->generate();
+ for my $item (@{$menu->{menu_items}}){
+ if ($request->{'open'} =~ /:$item->{id}:/ ){
+ $item->{'open'} = 'true';
+ }
+ }
my $template = LedgerSMB::Template->new(
user => $request->{_user},
locale => $request->{_locale},
- path => 'UI',
- template => 'menu_expand',
+ path => 'UI/menu',
+ template => 'expanding',
format => 'HTML',
);
$template->render($menu);
}
+sub drilldown_menu {
+ my ($request) = @_;
+ my $menu = LedgerSMB::DBObject::Menu->new({base => $request});
+
+ $menu->{parent_id} ||= 0;
+
+ print STDERR "Testing";
+ $menu->generate_section;
+ my $template = LedgerSMB::Template->new(
+ user => $request->{_user},
+ locale => $request->{_locale},
+ path => 'UI/menu',
+ template => 'drilldown',
+ format => 'HTML',
+ );
+ $template->render($menu);
+}
1;