invoices look like they belong under customers
[freeside.git] / httemplate / view / cust_main / menu.html
index e641d3a..c6aa15c 100644 (file)
@@ -1,36 +1,32 @@
 <style type="text/css">
 
 #customer_menu {
-/*  padding: 0;
-  margin: .5em 0 0 0;
-*/
   font-size: smaller;
   border: none;
+  margin-top: .6em;
+  margin-bottom: 16px;
 }
 
 #customer_menu li {
-/*  margin: 0; */
   float: left;
-  padding-left: 0;
-  padding-right: .25em;
-  padding-bottom: 0;
-  padding-top: 0;
+  padding: .25em;
+}
+
+/* #customer_menu .ui-menu-item  */
+#customer_menu > li {
+  background-color: #f8f8f8;
+  padding-left: 0px;
 }
 
 /* #customer_menu .ui-menu-item  */
 #customer_menu > li.ui-state-focus {
   background-color: #f8f8f8;
-  border-top: 1px solid transparent;
-  border-left: 1px solid transparent;
-  border-right: 1px solid transparent;
-  border-bottom: none;
-  margin-bottom: 0px;
+  border: 1px solid transparent;
 }
 
 #customer_menu > li.ui-state-active {
-  border-top: 1px solid transparent;
-  border-left: 1px solid transparent;
-  border-right: 1px solid transparent;
+  background-color: #f8f8f8;
+  border: 1px solid transparent;
 }
 
 #customer_menu > li > a {
   border-left: 1px solid transparent;
   border-right: 1px solid transparent;
   border-bottom: none;
-  margin-bottom: 0px;
   padding: .5em .75em;
 }
 
+#customer_menu > li.ui-state-active > a {
+
+/* if i could find something light enough that didn't look pink?
+     or is this too visually distracting and not the useful hint i think it is?
+  background: #ED55E7;
+*/
+}
+
 #customer_menu a.current_show {
   font-weight: bold;
   background: #FFFFFF;
   border-top: 1px solid #7e0079;
   border-left: 1px solid #7e0079;
   border-right: 1px solid #7e0079;
-  border-bottom: 1px solid #ffffff;
-  margin-bottom: -1px;
+  border-bottom: 2px solid #ffffff;
+  margin-bottom: -2px;
+  border-bottom-left-radius: 2px;
+  border-bottom-right-radius: 2px;
 }
 
 #customer_menu a {
-  display: block;
-
   margin-left: 0;
   margin-right: 1em;
   margin-top: 0;
-  padding: .4em .5em;
   border-top-left-radius: .5em;
   border-top-right-radius: .5em;
 
 }
 
 #customer_menu ul li.ui-state-active {
-/*  background: #f2c9ec; */
-  border: 1px solid transparent;
+  background: #f8f0fc;
+  border: 1px solid #7e0079;
+  border-radius: 2px;
   margin-right: 1px;
   margin-left: 1px;
 }
 
 #customer_menu a .arrow {
   float: right;
-  margin-top:-.8em;
+  background-image: url("<% $p %>images/arrow.right.black.png");
+  width: 3px;
+  height: 6px;
+  margin-top:4px;
+}
+
+@-moz-document url-prefix() {
+  #customer_menu a .arrow {
+    margin-top:-.8em;
+  }
 }
 
 </style>
 <script type="text/javascript">
 
   $("#customer_menu").menu({
-    position: { my: "left top", at: "left+1 bottom" },
+    position: { my: "left top", at: "left+1 bottom+3" },
     blur: function() {
-      $(this).menu("option", "position", { my:"left top", at:"left+1 bottom" } );
+      $(this).menu("option", "position", { my:"left top", at:"left+1 bottom+3" } );
     },
     focus: function(e,ui) {
       if ($("#customer_menu").get(0) !== $(ui).get(0).item.parent().get(0)) {
-        $(this).menu("option", "position", { my:"left top", at:"right+1 top"} );
+        $(this).menu("option", "position", { my:"left top", at:"right+2 top"} );
       }
     },
   });
@@ -210,7 +222,7 @@ my @menu = (
     },
     {
       label       => 'Cancel',
-      popup       => "misc/suspend_cust.html?custnum=$custnum",
+      popup       => "misc/cancel_cust.html?custnum=$custnum",
       acl         => 'Cancel customer',
       condition   => sub { shift->ncancelled_pkgs > 0 },
       actionlabel => 'Confirm Cancellation',
@@ -303,7 +315,7 @@ my @menu = (
       label       => 'Schedule new appointment',
       confexists  => 'ticket_system',
       acl        => 'Make appointment',
-      popup       => "elements/make_appointment.html?custnum=$custnum",
+      popup       => "misc/make_appointment.html?custnum=$custnum",
       actionlabel => 'Schedule appointment',
     },
   ],
@@ -344,11 +356,7 @@ my @menu = (
     {
       # it's just a popup, but there's some freaky CCH tax stuff in it
       label       => 'One-time charge',
-      content     => sub {
-                      include( '/elements/one_time_charge_link.html',
-                        custnum => shift->custnum,
-                      );
-                     },
+      url         => "edit/quick-charge.html?custnum=$custnum",
       acl         => 'One-time charge',
     },
     {
@@ -371,7 +379,7 @@ my @menu = (
 
     {
       label => 'Package reports',
-      url   => "search/report_cust_pkg?custnum=$custnum",
+      url   => "search/report_cust_pkg.html?custnum=$custnum",
     },
     {
       label => 'View qualifications',
@@ -383,8 +391,18 @@ my @menu = (
       url   => "search/report_svc_acct.html?custnum=$custnum",
     },
     {
+      label => 'View data usage',
+      popup => "search/report_sqlradius_usage-custnum.html?$custnum",
+      acl   => 'Usage: RADIUS sessions',
+      actionlabel => 'Data usage report',
+      width   => 480,
+      height  => 345,
+      condition => sub { shift->num_usage_pkgs > 0 },
+    },
+    {
       label => 'View CDRs',
       url   => "search/report_cdr.html?custnum=$custnum",
+      # XXX should have a condition that the customer has any CDR packages
     },
   ],
   [
@@ -403,7 +421,6 @@ my @menu = (
           width       => 763,
           height      => 392,
           acl         => [ 'Post payment', 'Post check payment' ],
-          condition   => sub { $payby{BILL} },
         },
         {
           label       => 'Enter cash payment',
@@ -412,35 +429,34 @@ my @menu = (
           width       => 763,
           height      => 392,
           acl         => [ 'Post payment', 'Post cash payment' ],
-          condition   => sub { $payby{CASH} },
-        },
-        {
-          label       => 'Enter Western Union payment',
-          popup       => "edit/cust_pay.cgi?popup=1;payby=WEST;custnum=$custnum",
-          actionlabel => 'Enter Western Union payment',
-          width       => 763,
-          height      => 392,
-          acl         => [ 'Post payment', ],
-          condition   => sub { $payby{WEST} },
-        },
-        {
-          label       => 'Record manual (offline/POS) credit card payment',
-          popup       => "edit/cust_pay.cgi?popup=1;payby=MCRD;custnum=$custnum",
-          actionlabel => 'Enter credit card payment',
-          width       => 763,
-          height      => 392,
-          acl         => [ 'Post payment', ],
-          condition   => sub { $payby{MCRD} },
-        },
-        {
-          label       => 'Record manual (offline/POS) electronic check',
-          popup       => "edit/cust_pay.cgi?popup=1;payby=MCHK;custnum=$custnum",
-          actionlabel => 'Enter credit card payment',
-          width       => 763,
-          height      => 392,
-          acl         => [ 'Post payment', ],
-          condition   => sub { $payby{MCHK} },
         },
+        #{
+        #  label       => 'Enter Western Union payment',
+        #  popup       => "edit/cust_pay.cgi?popup=1;payby=WEST;custnum=$custnum",
+        #  actionlabel => 'Enter Western Union payment',
+        #  width       => 763,
+        #  height      => 392,
+        #  acl         => [ 'Post payment', ],
+        ##  condition   => sub { $payby{WEST} },
+        #},
+        #{
+        #  label       => 'Record manual (offline/POS) credit card payment',
+        #  popup       => "edit/cust_pay.cgi?popup=1;payby=MCRD;custnum=$custnum",
+        #  actionlabel => 'Enter credit card payment',
+        #  width       => 763,
+        #  height      => 392,
+        #  acl         => [ 'Post payment', ],
+        ##  condition   => sub { $payby{MCRD} },
+        #},
+        #{
+        #  label       => 'Record manual (offline/POS) electronic check',
+        #  popup       => "edit/cust_pay.cgi?popup=1;payby=MCHK;custnum=$custnum",
+        #  actionlabel => 'Enter credit card payment',
+        #  width       => 763,
+        #  height      => 392,
+        #  acl         => [ 'Post payment', ],
+        ##  condition   => sub { $payby{MCHK} },
+        #},
       ],
     },
 
@@ -498,7 +514,6 @@ my @menu = (
           actionlabel => 'Enter check refund',
           width       => 440,
           acl         => ['Post refund', 'Post check refund'],
-          condition   => sub { $payby{BILL} },
         },
         {
           label       => 'Enter cash refund',
@@ -506,24 +521,23 @@ my @menu = (
           actionlabel => 'Enter cash refund',
           width       => 392,
           acl         => ['Post refund', 'Post cash refund'],
-          condition   => sub { $payby{CASH} },
-        },
-        {
-          label       => 'Record manual (offline/POS) credit card refund',
-          popup       => "edit/cust_refund.cgi?popup=1;payby=MCRD;custnum=$custnum",
-          actionlabel => 'Enter credit card refund',
-          width       => 440,
-          acl         => ['Post refund' ],
-          condition   => sub { $payby{MCRD} },
-        },
-        {
-          label       => 'Record manual (offline/POS) electronic check refund',
-          popup       => "edit/cust_refund.cgi?popup=1;payby=MCHK;custnum=$custnum",
-          actionlabel => 'Enter electronic check refund',
-          width       => 440,
-          acl         => ['Post refund' ],
-          condition   => sub { $payby{MCHK} },
         },
+        #{
+        #  label       => 'Record manual (offline/POS) credit card refund',
+        #  popup       => "edit/cust_refund.cgi?popup=1;payby=MCRD;custnum=$custnum",
+        #  actionlabel => 'Enter credit card refund',
+        #  width       => 440,
+        #  acl         => ['Post refund' ],
+        ##  condition   => sub { $payby{MCRD} },
+        #},
+        #{
+        #  label       => 'Record manual (offline/POS) electronic check refund',
+        #  popup       => "edit/cust_refund.cgi?popup=1;payby=MCHK;custnum=$custnum",
+        #  actionlabel => 'Enter electronic check refund',
+        #  width       => 440,
+        #  acl         => ['Post refund' ],
+        ##  condition   => sub { $payby{MCHK} },
+        #},
 
       ],
 
@@ -650,7 +664,7 @@ sub entry2link {
     if ( $entry->{submenu} ) {
 
       my $a = '<a href="javascript:void(0);">'. $label.
-              '<img class="arrow" src="'. $p. 'images/arrow.right.black.png">'.
+              '<span class="arrow"></span>'.
               '</a><ul class="customer_subsubmenu">';
       foreach my $submenu (@{ $entry->{submenu} }) {
         $a .= '<li>'. entry2link($submenu, $cust_main, $show), '</li>';
@@ -674,7 +688,13 @@ sub entry2link {
 
       # the menu head: always a link back to this page
       $cgi->param('show', $entry->{show});
-      $target = $cgi->self_url;
+
+      #$target = $cgi->self_url;
+      #XXX support installs outside /freeside in 4.x
+      $target = '/freeside/view/cust_main.cgi?'.
+                  'show='. $entry->{show}.
+                  ';custnum='. $cust_main->custnum;
+
       $cgi->param('show', $show);
 
       my $a = qq[ <A HREF="$target"];
@@ -702,7 +722,7 @@ sub entry2link {
       return qq[ <A HREF="$target">$label</A> ];
 
     } else {
-      die "bad entry $entry in menu: no url, popup or content";
+      die "bad entry ". join(',',%$entry). " in menu: no url, popup or content";
     }
 
 }