[freeside-commits] freeside/httemplate/search cust_pkg.cgi, 1.53, 1.54 cust_main.cgi, 1.77, 1.78 cust_event.html, 1.3, 1.4

Ivan,,, ivan at wavetail.420.am
Tue Jun 16 19:39:11 PDT 2009


Update of /home/cvs/cvsroot/freeside/httemplate/search
In directory wavetail.420.am:/tmp/cvs-serv9378/httemplate/search

Modified Files:
	cust_pkg.cgi cust_main.cgi cust_event.html 
Log Message:
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

Index: cust_main.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/search/cust_main.cgi,v
retrieving revision 1.77
retrieving revision 1.78
diff -u -d -r1.77 -r1.78
--- cust_main.cgi	10 Oct 2008 01:15:50 -0000	1.77
+++ cust_main.cgi	17 Jun 2009 02:39:09 -0000	1.78
@@ -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;

Index: cust_event.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/search/cust_event.html,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- cust_event.html	13 Jan 2008 20:56:59 -0000	1.3
+++ cust_event.html	17 Jun 2009 02:39:09 -0000	1.4
@@ -124,7 +124,12 @@
   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' ];
   }

Index: cust_pkg.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/search/cust_pkg.cgi,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -d -r1.53 -r1.54
--- cust_pkg.cgi	10 Jun 2009 07:58:21 -0000	1.53
+++ cust_pkg.cgi	17 Jun 2009 02:39:09 -0000	1.54
@@ -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 @@
 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 {



More information about the freeside-commits mailing list