diff options
author | ivan <ivan> | 2009-06-17 02:39:09 +0000 |
---|---|---|
committer | ivan <ivan> | 2009-06-17 02:39:09 +0000 |
commit | 3a02c437eadd9a39f7e56056ca987a4846650209 (patch) | |
tree | 377c23a23f9c8590ea1523172c9eb928153c4079 /httemplate/search | |
parent | 8588f3c0bfbcbeb58dd25a57b5ea375cec00279a (diff) |
finish up initial work on customer view tabs (ensure links back to customer view call include show=packages if default view isn't jumbo or packages already), RT#5586
Diffstat (limited to 'httemplate/search')
-rw-r--r-- | httemplate/search/cust_event.html | 7 | ||||
-rwxr-xr-x | httemplate/search/cust_main.cgi | 10 | ||||
-rwxr-xr-x | httemplate/search/cust_pkg.cgi | 15 |
3 files changed, 27 insertions, 5 deletions
diff --git a/httemplate/search/cust_event.html b/httemplate/search/cust_event.html index d55b5c6d2..e8164c280 100644 --- a/httemplate/search/cust_event.html +++ b/httemplate/search/cust_event.html @@ -124,7 +124,12 @@ my $trigger_link = sub { my $eventtable = $cust_event->eventtable; if ( $eventtable eq 'cust_pkg' ) { my $custnum = $cust_event->cust_main_custnum; - [ "${p}view/cust_main.cgi?$custnum#cust_pkg", 'tablenum' ]; + my $show = $FS::CurrentUser::CurrentUser->default_customer_view =~ /^(jumbo|packages)$/ + ? '' + : ';show=packages'; + my $pkgnum = $cust_event->tablenum; + my $frag = "cust_pkg$pkgnum"; #hack for IE ignoring real #fragment + [ "${p}view/cust_main.cgi?custnum=$custnum$show;fragment=$frag#cust_pkg", 'tablenum' ]; } else { [ "${p}view/$eventtable.cgi?", 'tablenum' ]; } diff --git a/httemplate/search/cust_main.cgi b/httemplate/search/cust_main.cgi index 36e4374ee..658069b08 100755 --- a/httemplate/search/cust_main.cgi +++ b/httemplate/search/cust_main.cgi @@ -1,5 +1,7 @@ +%my $curuser = $FS::CurrentUser::CurrentUser; +% %die "access denied" -% unless $FS::CurrentUser::CurrentUser->access_right('List customers'); +% unless $curuser->access_right('List customers'); % %my $conf = new FS::Conf; %my $maxrecords = $conf->config('maxsearchrecordsperpage'); @@ -485,7 +487,11 @@ % % my $pkg = $part_pkg->pkg; % my $comment = $part_pkg->comment; -% my $pkgview = "${p}view/cust_main.cgi?$custnum#cust_pkg$pkgnum"; +% my $show = $curuser->default_customer_view =~ /^(jumbo|packages)$/ +% ? '' +% : ';show=packages'; +% my $frag = "cust_pkg$pkgnum"; #hack for IE ignoring real #fragment +% my $pkgview = "${p}view/cust_main.cgi?custnum=$custnum$show;fragment=$frag#$frag"; % my @cust_svc = @{shift @lol_cust_svc}; % #my(@cust_svc) = qsearch( 'cust_svc', { 'pkgnum' => $_->pkgnum } ); % my $rowspan = scalar(@cust_svc) || 1; diff --git a/httemplate/search/cust_pkg.cgi b/httemplate/search/cust_pkg.cgi index e797e35e9..2a702801c 100755 --- a/httemplate/search/cust_pkg.cgi +++ b/httemplate/search/cust_pkg.cgi @@ -147,8 +147,10 @@ %> <%init> +my $curuser = $FS::CurrentUser::CurrentUser; + die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('List packages'); + unless $curuser->access_right('List packages'); my $conf = new FS::Conf; my $money_char = $conf->config('money_char') || '$'; @@ -192,8 +194,17 @@ foreach my $field (qw( setup last_bill bill adjourn susp expire cancel )) { my $sql_query = FS::cust_pkg->search_sql(\%search_hash); my $count_query = delete($sql_query->{'count_query'}); +my $show = $curuser->default_customer_view =~ /^(jumbo|packages)$/ + ? '' + : ';show=packages'; + my $link = sub { - [ "${p}view/cust_main.cgi?".shift->custnum.'#cust_pkg', 'pkgnum' ]; + my $self = shift; + my $frag = 'cust_pkg'. $self->pkgnum; #hack for IE ignoring real #fragment + [ "${p}view/cust_main.cgi?custnum=".$self->custnum. + "$show;fragment=$frag#cust_pkg", + 'pkgnum' + ]; }; my $clink = sub { |