add cust_main-external_links and menu-prepend_links options for wisper NORM links...
authorivan <ivan>
Fri, 17 Dec 2010 23:44:40 +0000 (23:44 +0000)
committerivan <ivan>
Fri, 17 Dec 2010 23:44:40 +0000 (23:44 +0000)
FS/FS/Conf.pm
httemplate/elements/menu.html
httemplate/view/cust_main.cgi

index 25b6a08..9e43208 100644 (file)
@@ -4106,6 +4106,20 @@ and customer address. Include units.',
     'type'        => 'textarea',
   },
 
+  {
+    'key'         => 'menu-prepend_links',
+    'section'     => 'UI',
+    'description' => 'Links to prepend to the main menu, one per line, with format "URL Link Label (optional ALT popup)".',
+    'type'        => 'textarea',
+  },
+
+  {
+    'key'         => 'cust_main-external_links',
+    'section'     => 'UI',
+    'description' => 'External links available in customer view, one per line, with format "URL Link Label (optional ALT popup)".  The URL will have custnum appended.',
+    'type'        => 'textarea',
+  },
+
   { key => "apacheroot", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
   { key => "apachemachine", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
   { key => "apachemachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
index 46f9a0c..339cc8b 100644 (file)
@@ -560,9 +560,19 @@ $help_menu{"About RT v$RT::VERSION"} = [ 'http://www.bestpractical.com/rt', 'Req
   if $conf->config('ticket_system') eq 'RT_Internal';
 
 
-tie my %menu, 'Tie::IxHash',
-  'Billing Main'   => [ $fsurl, 'Billing start page', ],
-;
+tie my %menu, 'Tie::IxHash';
+
+if ( $conf->config('menu-prepend_links')) {
+  my @links = split(/\n/, $conf->config('menu-prepend_links'));
+  foreach my $link (@links) {
+    $link =~ /^\s*(\S+)\s+(.*?)(\s*\(([^\)]*)\))?$/ or next;
+    my($url, $label, $alt) = ($1, $2, $4);
+    $menu{$label} = [ $url, $alt ];
+  }
+}
+
+$menu{'Billing Main'} = [ $fsurl, 'Billing start page', ];
+
 if ( $conf->config('ticket_system') ) {
   $menu{'Ticketing Main'} =
     [ 
index 0f9c1e2..c4c0b57 100755 (executable)
@@ -93,14 +93,28 @@ function areyousure(href, message) {
 
 <BR><BR>
 
+% my $br = 0;
 % if (    $curuser->access_right('Billing event reports') 
 %      || $curuser->access_right('View customer billing events')
 %    ) {
-
+% $br=1;
   <A HREF="<% $p %>search/cust_event.html?custnum=<% $custnum %>">View billing events for this customer</A>
-  <BR><BR>
+% }
 
+% if ( $conf->config('cust_main-external_links') ) {
+    <% $br++ ? ' | ' : '' %>
+%   my @links = split(/\n/, $conf->config('menu-prepend_links'));
+%   foreach my $link (@links) {
+%     $link =~ /^\s*(\S+)\s+(.*?)(\s*\(([^\)]*)\))?$/ or next;
+%     my($url, $label, $alt) = ($1, $2, $4);
+      <A HREF="<% $url.$custnum %>" ALT="<% $alt |h %>"><% $label |h %></A>
+%   }
+% }
+
+% if ( $br ) {
+  <BR><BR>
 % }
+</%doc>
 
 %my $signupurl = $conf->config('signupurl');
 %if ( $signupurl ) {