3 my $conf = new FS::Conf;
4 my $fsurl = $opt{'freeside_baseurl'};
6 #Active tickets not assigned to a customer
8 tie my %report_customers_lists, 'Tie::IxHash',
9 'by customer number' => [ $fsurl. 'search/cust_main.cgi?browse=custnum', '' ],
10 'by last name' => [ $fsurl. 'search/cust_main.cgi?browse=last', '' ],
11 'by company name' => [ $fsurl. 'search/cust_main.cgi?browse=company', '' ],
12 'by active trouble tickets' => [ $fsurl. 'search/cust_main.cgi?browse=tickets', '' ],
15 tie my %report_customers_search, 'Tie::IxHash',
16 'by ordering employee' => [ $fsurl. 'search/cust_main-otaker.cgi' ],
19 tie my %report_customers, 'Tie::IxHash',
20 'List customers' => [ \%report_customers_lists, 'List customers' ],
21 'Search customers' => [ \%report_customers_search, 'Search customers' ],
22 'Zip code distribution' => [ $fsurl.'search/report_cust_main-zip.html', 'Zip codes by number of customers' ],
25 tie my %report_invoices_open, 'Tie::IxHash',
26 'All open invoices' => [ $fsurl.'search/cust_bill.html?OPEN_date', 'All invoices with an unpaid balance' ],
27 '15 day open invoices' => [ $fsurl.'search/cust_bill.html?OPEN15_date', 'Invoices 15 days or older with an unpaid balance' ],
28 '30 day open invoices' => [ $fsurl.'search/cust_bill.html?OPEN30_date', 'Invoices 30 days or older with an unpaid balance' ],
29 '60 day open invoices' => [ $fsurl.'search/cust_bill.html?OPEN60_date', 'Invoices 60 days or older with an unpaid balance' ],
30 '90 day open invoices' => [ $fsurl.'search/cust_bill.html?OPEN90_date', 'Invoices 90 days or older with an unpaid balance' ],
31 '120 day open invoices' => [ $fsurl.'search/cust_bill.html?OPEN120_date', 'Invoices 120 days or older with an unpaid balance' ],
34 tie my %report_invoices, 'Tie::IxHash',
35 'Open invoices' => [ \%report_invoices_open, 'Open invoices' ],
36 'All invoices' => [ $fsurl. 'search/cust_bill.html?date', 'List all invoices' ],
37 'Advanced invoice reports' => [ $fsurl.'search/report_cust_bill.html', 'by agent, date range, etc.' ],
40 tie my %report_services_acct, 'Tie::IxHash',
41 'All accounts by username' => [ $fsurl.'search/svc_acct.cgi?username', '' ],
42 'All accounts by UID' => [ $fsurl.'search/svc_acct.cgi?uid', '' ],
43 'Unlinked accounts' => [ $fsurl.'search/svc_acct.cgi?UN_uid', 'Pre-Freeside accounts without a customer record' ],
46 tie my %report_services_domain, 'Tie::IxHash',
47 'All domains' => [ $fsurl.'search/svc_domain.cgi?domain', '' ],
48 'Unlinked domains' => [ $fsurl.'search/svc_domain.cgi?UN_domain', 'Pre-Freeside domains without a customer record' ],
51 tie my %report_services_forward, 'Tie::IxHash',
52 'All mail forwards' => [ $fsurl.'search/svc_forward.cgi?svcnum', '' ],
53 'Unlinked mail forwards' => [ $fsurl.'search/svc_forward.cgi?UN_svcnum', 'Pre-Freeside mail forwards without a customer record' ],
56 tie my %report_services_www, 'Tie::IxHash',
57 'All virtual hosts' => [ $fsurl.'search/svc_www.cgi?svcnum', '' ],
58 'Unlinked virtual hosts' => [ $fsurl.'search/svc_www.cgi?UN_svcnum', 'Pre-Freeside virtual hosts without a customer record' ],
61 tie my %report_services_broadband, 'Tie::IxHash',
62 'All broadband services' => [ $fsurl.'search/svc_broadband.cgi?svcnum', '' ],
63 #'Unlinked domain' => [ $fsurl.'search/svc_acct.cgi?UN_uid', 'Pre-Freeside domains without a customer record' ],
66 tie my %report_services_external, 'Tie::IxHash',
67 'All external services' => [ $fsurl.'search/svc_external.cgi?id', '' ],
68 'Unlinked external services' => [ $fsurl.'search/svc_external.cgi?UN_id', 'Pre-Freeside domains without a customer record' ],
71 tie my %report_services, 'Tie::IxHash',
72 'Service definitions' => [ $fsurl.'browse/part_svc.cgi?orderby=active', 'Service definitions by number of active packages' ],
74 'Accounts' => [ \%report_services_acct, 'Access accounts and mailboxes' ],
75 'Domains' => [ \%report_services_domain, 'Domains', ],
76 'Mail forwards' => [ \%report_services_forward, 'Mail forwards', ],
77 'Virtual hosts' => [ \%report_services_www, 'Virtual hosting', ],
78 'Broadband services' => [ \%report_services_broadband, 'Fixed (username-less) broadband services', ],
79 'External services' => [ \%report_services_external, 'External services', ],
82 tie my %report_packages, 'Tie::IxHash',
83 'Package definitions' => [ $fsurl.'browse/part_pkg.cgi?active=1', 'Package definitions by number of active packages' ],
85 'All customer packages' => [ $fsurl.'search/cust_pkg.cgi?pkgnum', 'List all customer packages', ],
86 'Suspended customer packages' => [ $fsurl.'search/cust_pkg.cgi?magic=suspended', 'List suspended packages' ],
87 'Customer packages with unconfigured services' => [ $fsurl.'search/cust_pkg.cgi?APKG_pkgnum', 'List packages which have provisionable services' ],
88 'Advanced package reports' => [ $fsurl.'search/report_cust_pkg.html', 'by agent, date range, status, package definition' ],
91 tie my %report_financial, 'Tie::IxHash',
92 'Sales, Credits and Receipts' => [ $fsurl.'graph/report_money_time.html', 'Sales, credits and receipts summary graph' ],
93 'Sales Report' => [ $fsurl.'graph/report_cust_bill_pkg.html', 'Sales report and graph (by agent, package class and/or date range)' ],
94 'Credit Report' => [ $fsurl.'search/report_cust_credit.html', 'Credit report (by employee and/or date range)' ],
95 'Payment Report' => [ $fsurl.'search/report_cust_pay.html', 'Credit report (by type and/or date range)' ],
96 'A/R Aging' => [ $fsurl.'search/report_receivables.html', 'Accounts Receivable Aging report' ],
97 'Prepaid Income' => [ $fsurl.'search/report_prepaid_income.html', 'Prepaid income (unearned revenue) report' ],
98 'Sales Tax Liability' => [ $fsurl.'search/report_tax.html', 'Sales tax liability report' ],
101 tie my %report_menu, 'Tie::IxHash',
102 'Customers' => [ \%report_customers, 'Customer reports' ],
103 'Invoices' => [ \%report_invoices, 'Invoice reports' ],
104 'Packages' => [ \%report_packages, 'Package reports' ],
105 'Services' => [ \%report_services, 'Services reports' ],
106 'Financial' => [ \%report_financial, 'Financial reports' ],
109 tie my %tools_importing, 'Tie::IxHash',
110 'Import customers from CSV file' => [ $fsurl.'misc/cust_main-import.cgi', '' ],
111 'Import one-time charges from CSV file' => [ $fsurl.'misc/cust_main-import_charges.cgi', '' ],
114 tie my %tools_exporting, 'Tie::IxHash',
115 'Download database dump' => [ $fsurl. 'misc/dump.cgi', '' ],
118 # <!-- <BR>View active NAS ports:
119 # <A HREF="browse/nas.cgi">session server</A> -->
120 # <!-- or <A HREF="browse/nas-sqlradius.cgi">RADIUS</A>
123 tie my %tools_menu, 'Tie::IxHash',
124 'Quick payment entry' => [ $fsurl.'misc/batch-cust_pay.html', 'Enter multiple payments in a batch' ],
125 'Job Queue' => [ $fsurl.'search/queue.html', 'View pending job queue' ],
126 'Importing' => [ \%tools_importing, 'Import tools' ],
127 'Exporting' => [ \%tools_exporting, 'Export tools' ],
130 tie my %config_employees, 'Tie::IxHash',
131 'View/Edit employees' => [ $fsurl.'browse/access_user.html', 'Setup internal users' ],
132 'View/Edit employee groups' => [ $fsurl.'browse/access_group.html', 'Employee groups allow you to control access to the backend' ],
135 tie my %config_export_svc_pkg, 'Tie::IxHash',
136 'View/Edit exports' => [ $fsurl.'browse/part_export.cgi', 'Provisioning services to external machines, databases and APIs' ],
137 'View/Edit service definitions' => [ $fsurl.'browse/part_svc.cgi', 'Services are items you offer to your customers' ],
138 'View/Edit package definitions' => [ $fsurl.'browse/part_pkg.cgi', 'One or more services are grouped together into a package and given pricing information. Customers purchase packages, not services' ],
139 'View/Edit package classes' => [ $fsurl.'browse/pkg_class.html', 'Package classes define groups of packages, for reporting and convenience purposes.' ],
142 tie my %config_agent, 'Tie::IxHash',
143 'View/Edit agent types' => [ $fsurl.'browse/agent_type.cgi', 'Agent types define groups of package definitions that you can then assign to particular agents' ],
144 'View/Edit agents' => [ $fsurl.'browse/agent.cgi', 'Agents are resellers of your service. Agents may be limited to a subset of your full offerings (via their type)' ],
147 tie my %config_billing, 'Tie::IxHash',
148 'View/Edit payment gateways' => [ $fsurl.'browse/payment_gateway.html', 'Credit card and electronic check processors' ],
149 'View/Edit invoice events' => [ $fsurl.'browse/part_bill_event.cgi', 'Actions for overdue invoices' ],
150 'View/Edit prepaid cards' => [ $fsurl.'search/prepay_credit.html', 'View outstanding cards, generate new cards' ],
151 'View/Edit call rates and regions' => [ $fsurl.'browse/rate.cgi', 'Manage rate plans, regions and prefixes for VoIP and call billing' ],
152 'View/Edit locales and tax rates' => [ $fsurl.'browse/cust_main_county.cgi', 'Change tax rates, or break down a country into states, or a state into counties and assign different tax rates to each' ],
155 tie my %config_dialup, 'Tie::IxHash',
156 'View/Edit access numbers' => [ $fsurl.'browse/svc_acct_pop.cgi', 'Points of Presence' ],
159 tie my %config_broadband, 'Tie::IxHash',
160 'View/Edit routers' => [ $fsurl.'browse/router.cgi', 'Broadband access routers' ],
161 'View/Edit address blocks' => [ $fsurl.'browse/addr_block.cgi', 'Manage address blocks and block assignments to broadband routers' ],
164 tie my %config_misc, 'Tie::IxHash',
165 'View/Edit advertising sources' => [ $fsurl.'browse/part_referral.cgi', 'Where a customer heard about your service. Tracked for informational purposes' ],
166 'View/Edit virtual fields' => [ $fsurl.'browse/part_virtual_field.cgi', 'Locally defined fields', ],
167 'View/Edit message catalog' => [ $fsurl.'browse/msgcat.cgi', 'Change error messages and other customizable labels' ],
168 'View/Edit inventory classes and inventory' => [ $fsurl.'browse/inventory_class.html', 'Setup inventory classes and stock inventory' ],
171 tie my %config_menu, 'Tie::IxHash',
172 'Settings' => [ $fsurl.'config/config-view.cgi', '' ],
173 'separator' => '', #its a separator!
174 'Employees' => [ \%config_employees, '' ],
175 'Provisioning, services and packages'
176 => [ \%config_export_svc_pkg, '' ],
177 'Resellers' => [ \%config_agent, '' ],
178 'Billing' => [ \%config_billing, '' ],
179 'Dialup' => [ \%config_dialup, '' ],
180 'Fixed (username-less) broadband'
181 => [ \%config_broadband, '' ],
182 'Miscellaneous' => [ \%config_misc, '' ],
185 tie my %menu, 'Tie::IxHash',
186 'Billing Main' => [ $fsurl, 'Billing start page', ],
187 'Ticketing Main' => [
188 ( $conf->config('ticket_system') eq 'RT_External'
189 ? FS::TicketSystem->baseurl()
192 'Ticketing start page',
194 'Reports' => [ \%report_menu, 'Lists, reporting and graphing' ],
195 'Tools' => [ \%tools_menu, 'Tools' ],
196 'Configuration' => [ \%config_menu, 'Configuraiton and setup' ],
199 use vars qw($gmenunum);
203 my($submenu, $title) = @_;
204 my $menunum = $gmenunum++;
206 #return two args: html, menuname
208 "var myMenu$menunum = new WebFXMenu;\n".
209 #"myMenu$menunum.useAutoPosition = true;\n".
210 "myMenu$menunum.emptyText = '$title';\n".
215 if ( !ref( $submenu->{$_} ) ) {
217 "myMenu$menunum.add(new WebFXMenuSeparator());";
221 my($url_or_submenu, $tooltip ) = @{ $submenu->{$_} };
222 if ( ref($url_or_submenu) ) {
224 my($subhtml, $submenuname ) = submenu($url_or_submenu, $_); #mmm, recursion
227 "myMenu$menunum.add(new WebFXMenuItem(\"$_\", null, \"$tooltip\", $submenuname ));";
231 "myMenu$menunum.add(new WebFXMenuItem(\"$_\", \"$url_or_submenu\", \"$tooltip\" ));";
239 "myMenu$menunum.width = 224\n",
247 <script type="text/javascript" src="<%=$fsurl%>elements/cssexpr.js"></script>
248 <script type="text/javascript" src="<%=$fsurl%>elements/xmenu.js"></script>
249 <link href="<%=$fsurl%>elements/xmenu.css" type="text/css" rel="stylesheet">
250 <link href="<%=$fsurl%>elements/freeside.css" type="text/css" rel="stylesheet">
252 <SCRIPT TYPE="text/javascript">
254 webfxMenuImagePath = "<%=$fsurl%>images/";
255 webfxMenuUseHover = 1;
256 webfxMenuShowTime = 300;
257 webfxMenuHideTime = 300;
259 var myBar = new WebFXMenuBar;
261 <% foreach my $item ( keys %menu ) {
263 my( $url_or_submenu, $tooltip ) = @{ $menu{$item} };
265 if ( ref($url_or_submenu) ) {
269 my( $subhtml, $submenuname ) = submenu($url_or_submenu, $item);
274 myBar.add(new WebFXMenuButton("<%= $item %>", null, "<%= $tooltip %>", <%= $submenuname %> ));
278 myBar.add(new WebFXMenuButton("<%= $item %>", "<%= $url_or_submenu %>", "<%= $tooltip %>" ));
285 myBar.show( null, 'vertical' );
286 //myBar.show( null, 'horizontal' );
288 //var myMenu = new WebFXMenu;
289 //myMenu.add(new WebFXMenuItem("Menu Item 1", "http://www.domain.com", "Tool tip to show"));
290 //myMenu.add(new WebFXMenuSeparator());
291 //myMenu.add(new WebFXMenuItem("Menu Item 2", "http://www.domain.com", "Tool tip to show"));
293 //var mySubMenu = new WebFXMenu;
294 //mySubMenu.add(new WebFXMenuItem("Menu Item 3", "http://www.domain.com", "Tool tip to show"));
295 //myMenu.add(new WebFXMenuItem("Menu Item 4 with sub menu", null, "Tool tip to show", mySubMenu));