fix link to prepaid card setup
[freeside.git] / httemplate / elements / menu.html
1 <%
2   my( %opt ) = @_;
3   my $conf = new FS::Conf;
4   my $fsurl = $opt{'freeside_baseurl'};
5
6   #Active tickets not assigned to a customer
7
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', '' ],
13   ;
14
15   tie my %report_customers_search, 'Tie::IxHash',
16     'by ordering employee' => [ $fsurl. 'search/cust_main-otaker.cgi' ],
17   ;
18
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' ],
23   ;
24
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' ],
32   ;
33
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.' ],
38   ;
39
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' ],
44   ;
45
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' ],
49   ;
50
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' ],
54   ;
55
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' ],
59   ;
60
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' ],
64   ;
65
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' ],
69   ;
70
71   tie my %report_services, 'Tie::IxHash',
72     'Service definitions' => [ $fsurl.'browse/part_svc.cgi?orderby=active', 'Service definitions by number of active packages' ],
73     'separator' => '',
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', ],
80   ;
81
82   tie my %report_packages, 'Tie::IxHash',
83     'Package definitions' => [ $fsurl.'browse/part_pkg.cgi?active=1', 'Package definitions by number of active packages' ],
84     'separator' => '',
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     'By next bill date' => [ $fsurl.'search/cust_pkg_report.cgi', 'Search packages by next bill date' ],
89   ;
90
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' ],
99   ;
100
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' ],
107   ;
108
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', '' ],
112   ;
113
114   tie my %tools_exporting, 'Tie::IxHash',
115     'Download database dump' => [ $fsurl. 'misc/dump.cgi', '' ],
116   ;
117   
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>
121   #    <BR> -->
122
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' ],
128   ;
129
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' ],
133   ;
134
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.' ],
140   ;
141
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)' ],
145   ;
146
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' ],
153   ;
154
155   tie my %config_dialup, 'Tie::IxHash',
156     'View/Edit access numbers' => [ $fsurl.'browse/svc_acct_pop.cgi', 'Points of Presence' ],
157   ;
158
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' ],
162   ;
163
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' ],
169   ;
170
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, ''    ],
183   ;
184
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()
190                             : $fsurl.'rt/'
191                           ),
192                           'Ticketing start page',
193                         ],
194     'Reports'        => [ \%report_menu, 'Lists, reporting and graphing' ],
195     'Tools'          => [ \%tools_menu, 'Tools' ],
196     'Configuration'  => [ \%config_menu, 'Configuraiton and setup' ],
197   ;
198
199   use vars qw($gmenunum);
200   $gmenunum = 0;
201
202   sub submenu {
203     my($submenu, $title) = @_;
204     my $menunum = $gmenunum++;
205
206     #return two args: html, menuname
207
208     "var myMenu$menunum = new WebFXMenu;\n".
209     #"myMenu$menunum.useAutoPosition = true;\n".
210     "myMenu$menunum.emptyText = '$title';\n".
211
212     (
213       join("\n", map {
214
215         if ( !ref( $submenu->{$_} ) ) {
216
217           "myMenu$menunum.add(new WebFXMenuSeparator());";
218
219         } else {
220
221           my($url_or_submenu, $tooltip ) = @{ $submenu->{$_} };
222           if ( ref($url_or_submenu) ) {
223
224             my($subhtml, $submenuname ) = submenu($url_or_submenu, $_); #mmm, recursion
225
226             "$subhtml\n".
227             "myMenu$menunum.add(new WebFXMenuItem(\"$_\", null, \"$tooltip\", $submenuname ));";
228
229           } else {
230
231             "myMenu$menunum.add(new WebFXMenuItem(\"$_\", \"$url_or_submenu\", \"$tooltip\" ));";
232
233           }
234
235         }
236
237       } keys %$submenu )
238     ). "\n".
239     "myMenu$menunum.width = 224\n",
240
241     "myMenu$menunum";
242
243   }
244
245 %>
246
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">
251
252 <SCRIPT TYPE="text/javascript">
253
254   webfxMenuImagePath      = "<%=$fsurl%>images/";
255   webfxMenuUseHover       = 1;
256   webfxMenuShowTime       = 300;
257   webfxMenuHideTime       = 300;
258
259   var myBar = new WebFXMenuBar;
260
261   <% foreach my $item ( keys %menu ) {
262
263        my( $url_or_submenu, $tooltip ) = @{ $menu{$item} };
264
265        if ( ref($url_or_submenu) ) {
266
267          warn $item;
268
269          my( $subhtml, $submenuname ) = submenu($url_or_submenu, $item);
270
271   %>
272
273          <%= $subhtml %>
274          myBar.add(new WebFXMenuButton("<%= $item %>", null, "<%= $tooltip %>", <%= $submenuname %> ));
275
276   <%   } else { %>
277     
278          myBar.add(new WebFXMenuButton("<%= $item %>", "<%= $url_or_submenu %>", "<%= $tooltip %>" ));
279
280   <%   }
281
282     }
283   %>
284
285   myBar.show( null, 'vertical' );
286   //myBar.show( null, 'horizontal' );
287
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"));
292   
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));
296
297   myBar.width = 154;
298
299 </SCRIPT>