hide customer search if user does not have "List customers" ACL, closes: RT#3105
authorivan <ivan>
Sun, 16 Mar 2008 04:00:30 +0000 (04:00 +0000)
committerivan <ivan>
Sun, 16 Mar 2008 04:00:30 +0000 (04:00 +0000)
httemplate/elements/header.html
httemplate/elements/menu.html
rt/html/Elements/FreesideSearch

index 7bf5670..0ee6f9c 100644 (file)
@@ -154,11 +154,13 @@ input.fsblackbuttonselected {
         </TD>
 
         <TD COLSPAN=1 BGCOLOR="#000000" ALIGN="right">
+% if ( $FS::CurrentUser::CurrentUser->access_right('List customers') ) {
           <FORM ACTION="<%$fsurl%>search/cust_main.cgi" METHOD="GET" STYLE="margin:0">
             <INPUT NAME="search_cust" TYPE="text" VALUE="(cust #, name, company or phone)" SIZE="28" onFocus="clearhint_search_cust(this);" onClick="clearhint_search_cust(this);" STYLE="vertical-align:bottom;text-align:right"><BR>
             <A HREF="<%$fsurl%>search/report_cust_main.html" STYLE="color: #ffffff; font-size: 70%">Advanced</A>
             <INPUT TYPE="submit" VALUE="Search customers" CLASS="fsblackbutton" onMouseOver="this.className='fsblackbuttonselected'; return true;" onMouseOut="this.className='fsblackbutton'; return true;" STYLE="font-size:70%">
           </FORM>
+% }
         </TD>
 
         <TD COLSPAN=1 BGCOLOR="#000000" ALIGN="center">
index f43fca1..0c74746 100644 (file)
@@ -70,9 +70,9 @@ tie my %report_customers_search, 'Tie::IxHash';
 $report_customers_search{'by ordering employee'} = [ $fsurl. 'search/cust_main-otaker.cgi' ]
   if $curuser->access_right('Configuration');
 
-tie my %report_customers, 'Tie::IxHash',
-  'List customers' => [ \%report_customers_lists, 'List customers' ],
-;
+tie my %report_customers, 'Tie::IxHash';
+$report_customers{'List customers'} = [ \%report_customers_lists, 'List customers' ]
+  if $curuser->access_right('List customers');
 $report_customers{'Search customers'} = [ \%report_customers_search, 'Search customers' ]
   if keys %report_customers_search;
 $report_customers{'Zip code distribution'}     = [ $fsurl. 'search/report_cust_main-zip.html', 'Zip codes by number of customers' ];
index 2fed8fc..8e609bb 100644 (file)
@@ -1,3 +1,4 @@
+% if ( $FS::CurrentUser::CurrentUser->access_right('List customers') ) {
 <form action="<% $RT::URI::freeside::URL %>/search/cust_main.cgi" STYLE="margin:0">
     <SCRIPT TYPE="text/javascript">
       function clearhint_search_cust (what) {
@@ -6,6 +7,7 @@
       }
     </SCRIPT>
 <input name="search_cust" accesskey="0" VALUE="(cust #, name, company or phone)" SIZE="28" onFocus="clearhint_search_cust(this);" onClick="clearhint_search_cust(this);" STYLE="text-align:right; font-family: Arial, Verdana, Helvetica, sans-serif;"><BR>
-<A NOTYET="<% $RT::URI::freeside::URL %>/search/cust_main.html" STYLE="color: #000000; font-size: 70%; font-weight:normal">Advanced</A>
+<A HREF="<% $RT::URI::freeside::URL %>/search/report_cust_main.html" STYLE="color: #ffffff; font-size: 70%; font-weight:normal">Advanced</A>
 <input type="submit" value="<&|/l&>Search customers</&>" CLASS="fsblackbutton" onMouseOver="this.className='fsblackbuttonselected'; return true;" onMouseOut="this.className='fsblackbutton'; return true;" STYLE="font-size:70%">
 </form>
+% }