[freeside-commits] freeside/httemplate/elements header.html, 1.11,
1.12 menu.html, 1.16, 1.17
Ivan,,,
ivan at wavetail.420.am
Fri Dec 29 00:51:35 PST 2006
Update of /home/cvs/cvsroot/freeside/httemplate/elements
In directory wavetail:/tmp/cvs-serv4384/httemplate/elements
Modified Files:
header.html menu.html
Log Message:
service refactor!
Index: menu.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/elements/menu.html,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- menu.html 26 Nov 2006 23:09:07 -0000 1.16
+++ menu.html 29 Dec 2006 08:51:33 -0000 1.17
@@ -80,58 +80,49 @@
'Advanced invoice reports' => [ $fsurl.'search/report_cust_bill.html', 'by agent, date range, etc.' ],
;
-tie my %report_services_acct, 'Tie::IxHash',
- 'All accounts by username' => [ $fsurl.'search/svc_acct.cgi?username', '' ],
- 'All accounts by UID' => [ $fsurl.'search/svc_acct.cgi?uid', '' ],
-;
-$report_services_acct{'Unlinked accounts'} = [ $fsurl.'search/svc_acct.cgi?UN_username', 'Pre-Freeside accounts without a customer record' ]
- if $curuser->access_right('View/link unlinked services');
+tie my %report_services, 'Tie::IxHash';
+if ( $curuser->access_right('Configuration') ) {
+ $report_services{'Service definitions'} = [ $fsurl.'browse/part_svc.cgi?orderby=active', 'Service definitions by number of active packages' ];
+ $report_services{'separator'} = '';
+}
+foreach my $svcdb ( FS::part_svc->svc_tables() ) {
-tie my %report_services_domain, 'Tie::IxHash',
- 'All domains' => [ $fsurl.'search/svc_domain.cgi?domain', '' ],
-;
-$report_services_domain{'Unlinked domains'} = [ $fsurl.'search/svc_domain.cgi?UN_domain', 'Pre-Freeside domains without a customer record' ]
- if $curuser->access_right('View/link unlinked services');
+ my $name = "FS::$svcdb"->table_info->{'name_plural'}
+ || PL( "FS::$svcdb"->table_info->{'name'} );
+ my $lcname = lc($name);
+ my $longname = "FS::$svcdb"->table_info->{'longname_plural'} || $name;
+ my $lclongname = lc($longname);
+ my $sorts = "FS::$svcdb"->table_info->{'sorts'} || [ 'svcnum' ];
+ $sorts = [ $sorts ] unless ref($sorts);
+ my %svc_url = ( 'm' => $m,
+ 'action' => 'search',
+ 'svcdb' => $svcdb,
+ );
-tie my %report_services_forward, 'Tie::IxHash',
- 'All mail forwards' => [ $fsurl.'search/svc_forward.cgi?svcnum', '' ],
-;
-$report_services_forward{'Unlinked mail forwards'} = [ $fsurl.'search/svc_forward.cgi?UN_svcnum', 'Pre-Freeside mail forwards without a customer record' ]
- if $curuser->access_right('View/link unlinked services');
+ tie my %report_svc, 'Tie::IxHash';
-tie my %report_services_www, 'Tie::IxHash',
- 'All virtual hosts' => [ $fsurl.'search/svc_www.cgi?svcnum', '' ],
-;
-$report_services_www{'Unlinked virtual hosts'} = [ $fsurl.'search/svc_www.cgi?UN_svcnum', 'Pre-Freeside virtual hosts without a customer record' ]
- if $curuser->access_right('View/link unlinked services');
+ foreach my $sort ( @$sorts ) {
-tie my %report_services_broadband, 'Tie::IxHash',
- 'All broadband services' => [ $fsurl.'search/svc_broadband.cgi?svcnum', '' ],
- #'Unlinked domain' => [ $fsurl.'search/svc_acct.cgi?UN_uid', 'Pre-Freeside broadband services without a customer record' ],
-;
+ my $title = "All $lcname";
+ $title .= " by ". FS::part_svc->svc_table_fields($svcdb)->{$sort}->{'label'}
+ if scalar(@$sorts) > 1;
-tie my %report_services_phone, 'Tie::IxHash',
- 'All phone numbers' => [ $fsurl.'search/svc_phone.cgi?svcnum', '' ],
-;
+ $report_svc{$title} =
+ [ FS::UI::Web::svc_url( %svc_url, 'query' => "magic=all;sortby=$sort" ),
+ '',
+ ];
+ }
-tie my %report_services_external, 'Tie::IxHash',
- 'All external services' => [ $fsurl.'search/svc_external.cgi?id', '' ],
-;
-$report_services_external{'Unlinked external services'} = [ $fsurl.'search/svc_external.cgi?UN_id', 'Pre-Freeside external services without a customer record' ]
- if $curuser->access_right('View/link unlinked services');
+ if ( $curuser->access_right('View/link unlinked services') ) {
+ $report_svc{"Unlinked $lcname"} =
+ [ FS::UI::Web::svc_url( %svc_url, 'query' => "magic=unlinked;sortby=". $sorts->[0] ),
+ "Pre-Freeside $lcname without a customer record",
+ ];
+ }
+
+ $report_services{$name} = [ \%report_svc, $longname ];
-tie my %report_services, 'Tie::IxHash';
-if ( $curuser->access_right('Configuration') ) {
- $report_services{'Service definitions'} = [ $fsurl.'browse/part_svc.cgi?orderby=active', 'Service definitions by number of active packages' ];
- $report_services{'separator'} = '';
}
-$report_services{'Accounts'} = [ \%report_services_acct, 'Access accounts and mailboxes' ];
-$report_services{'Domains'} = [ \%report_services_domain, 'Domains', ];
-$report_services{'Mail forwards'} = [ \%report_services_forward, 'Mail forwards', ];
-$report_services{'Virtual hosts'} = [ \%report_services_www, 'Virtual hosting', ];
-$report_services{'Broadband services'} = [ \%report_services_broadband, 'Fixed (username-less) broadband services', ];
-$report_services{'Phone numbers'} = [ \%report_services_phone, 'Telephone numbers', ];
-$report_services{'External services'} = [ \%report_services_external, 'External services', ];
tie my %report_packages, 'Tie::IxHash';
if ( $curuser->access_right('Configuration') ) {
Index: header.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/elements/header.html,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- header.html 13 Nov 2006 01:09:17 -0000 1.11
+++ header.html 29 Dec 2006 08:51:33 -0000 1.12
@@ -132,7 +132,7 @@
<TD COLSPAN=1 BGCOLOR="#000000" ALIGN="right">
<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/cust_main.html" STYLE="color: #000000; font-size: 70%">Advanced</A>
+ <A NOTYET="<%$fsurl%>search/cust_main.html" STYLE="color: #000000; 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>
@@ -155,10 +155,10 @@
</TD>
<TD COLSPAN=1 BGCOLOR="#000000" ALIGN="right">
- <FORM ACTION="<%$fsurl%>search/svc_Smart.html" METHOD="GET" STYLE="margin:0">
+ <FORM ACTION="<%$fsurl%>search/cust_svc.html" METHOD="GET" STYLE="margin:0">
<INPUT NAME="search_svc" TYPE="text" VALUE="(user, user at domain or domain)" SIZE="26" onFocus="clearhint_search_svc(this);" onClick="clearhint_search_svc(this);" STYLE="vertical-align:bottom;text-align:right"><BR>
- <A HREF="<%$fsurl%>search/svc_Smarter.html" STYLE="color: #000000; font-size: 70%">Advanced</A>
- <INPUT TYPE="submit" VALUE="Search services"CLASS="fsblackbutton" onMouseOver="this.className='fsblackbuttonselected'; return true;" onMouseOut="this.className='fsblackbutton'; return true;" STYLE="font-size:70%">
+ <A NOTYET="<%$fsurl%>search/svc_Smarter.html" STYLE="color: #000000; font-size: 70%">Advanced</A>
+ <INPUT TYPE="submit" VALUE="Search services" CLASS="fsblackbutton" onMouseOver="this.className='fsblackbuttonselected'; return true;" onMouseOut="this.className='fsblackbutton'; return true;" STYLE="font-size:70%">
</FORM>
</TD>
More information about the freeside-commits
mailing list