X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Felements%2Fmenu.html;h=759ae338c0f4e1865512a6f9107e32aa6e8dff68;hp=8f8788731e310edcc906f418a1e3c18d1371d1b6;hb=6d42808bbd3ac9c840c6259aef1dc79a0dc620ff;hpb=10614457fd7db63cbcc0bf9bfeebbbb99258eaa3 diff --git a/httemplate/elements/menu.html b/httemplate/elements/menu.html index 8f8788731..759ae338c 100644 --- a/httemplate/elements/menu.html +++ b/httemplate/elements/menu.html @@ -87,12 +87,33 @@ my $mobile = $opt{'mobile'} || 0; my $curuser = $FS::CurrentUser::CurrentUser; +# saved searches +tie my %report_saved_searches, 'Tie::IxHash'; +if ( my @searches = grep { $_->disabled eq '' } $curuser->saved_search ) { + foreach my $search (@searches) { + $report_saved_searches{ $search->searchname } = [ + # don't use query_string here; we don't want to override the format + $fsurl . $search->path . '?' . $search->params , '' + ]; + } + $report_saved_searches{'separator'} = ''; + $report_saved_searches{'My saved searches'} = + [ $fsurl. 'browse/saved_search.html', + 'Manage saved searches and subscriptions' ]; +} + #XXX Active tickets not assigned to a customer -tie my %report_prospects, 'Tie::IxHash', - 'List prospects' => [ $fsurl. 'search/prospect_main.html', '' ], - 'Advanced prospect reports' => [ $fsurl. 'search/report_prospect_main.html', '' ], -; +tie my %report_prospects, 'Tie::IxHash'; +if ( $curuser->access_right('List prospects') ) { + $report_prospects{'List prospects'} = [ $fsurl. 'search/prospect_main.html', '' ]; + $report_prospects{'Advanced prospect reports'} = [ $fsurl. 'search/report_prospect_main.html', '' ]; +} +$report_prospects{'separator'} = '' + if $curuser->access_right('List prospects') + && $curuser->access_right('List contacts'); +$report_prospects{'Prospect contacts'} = [ $fsurl. 'search/report_contact.html?link=prospect_main', '' ] + if $curuser->access_right('List contacts'); tie my %report_quotations, 'Tie::IxHash', 'List quotations' => [ $fsurl. 'search/quotation.html', '' ], @@ -108,16 +129,25 @@ $report_customers_lists{'by active trouble tickets'} = [ $fsurl. 'search/cust_ma if $conf->config('ticket_system'); $report_customers_lists{'with USPS-unvalidated addresses'} = [ $fsurl. 'search/cust_main.cgi?browse=uspsunvalid', '' ] if $conf->config('usps_webtools-userid') && $conf->config('usps_webtools-password'); +$report_customers_lists{'with referrals'} = [ $fsurl. 'search/cust_main.html?with_referrals=1' ]; tie my %report_customers, 'Tie::IxHash'; $report_customers{'List customers'} = [ \%report_customers_lists, 'List customers' ] if $curuser->access_right('List all customers'); -$report_customers{'Zip code distribution'} = [ $fsurl. 'search/report_cust_main-zip.html', 'Zip codes by number of customers' ]; -$report_customers{'Customer signup report'} = [ $fsurl. 'graph/report_cust_signup.html', 'New customer signups by date' ]; -$report_customers{'Customer churn report'} = [ $fsurl.'graph/report_cust_churn.html', 'New customers, suspensions, and cancellations summary' ]; +$report_customers{'Zip code distribution'} = [ $fsurl. 'search/report_cust_main-zip.html', 'Zip codes by number of customers' ] + if $curuser->access_right('List zip codes'); +$report_customers{'Customer signup report'} = [ $fsurl. 'graph/report_cust_signup.html', 'New customer signups by date' ] + if $curuser->access_right('Financial reports'); +$report_customers{'Customer churn report'} = [ $fsurl.'graph/report_cust_churn.html', 'New customers, suspensions, and cancellations summary' ] + if $curuser->access_right('Customers: Customer churn report'); $report_customers{'Signup date report'} = [ $fsurl. 'graph/report_signupdate.html', 'Signup date report (by date of signup)' ]; $report_customers{'Advanced customer reports'} = [ $fsurl. 'search/report_cust_main.html', 'by status, signup date, agent, etc.' ] if $curuser->access_right('Advanced customer search'); +if ( $curuser->access_right('List contacts') ) { + $report_customers{'separator'} = ''; + $report_customers{'Customer contacts'} = [ $fsurl. 'search/report_contact.html?link=cust_main' ]; + $report_customers{'Customer timespan'} = [ $fsurl. 'search/report_cust_timespan.html' ]; +} tie my %report_invoices_open, 'Tie::IxHash', 'All open invoices' => [ $fsurl.'search/cust_bill.html?OPEN_date', 'All invoices with an unpaid balance' ], @@ -216,10 +246,12 @@ foreach my $svcdb ( FS::part_svc->svc_tables() ) { ]; } + if ( $curuser->access_right("Services: $name: Advanced search") + && $svcdb =~ /^svc_(acct|broadband|hardware|phone|fiber)$/ ) { + $report_svc{"Advanced $lcsname reports"} = - [ $fsurl."search/report_$svcdb.html", '' ] - if $svcdb =~ /^svc_(acct|broadband|hardware|phone)$/ - && $curuser->access_right("Services: $name: Advanced search"); + [ $fsurl."search/report_$svcdb.html", '' ] + } if ( $svcdb eq 'svc_phone' ) { @@ -262,6 +294,7 @@ $report_packages{'Suspension summary'} = [ $fsurl.'search/cust_pkg_susp.html', ' $report_packages{'Customer packages with unconfigured services'} = [ $fsurl.'search/cust_pkg.cgi?APKG_pkgnum', 'List packages which have provisionable services' ]; $report_packages{'FCC Form 477'} = [ $fsurl.'search/report_477.html' ] if $conf->exists('part_pkg-show_fcc_options'); +$report_packages{'Contract end dates'} = [ $fsurl.'search/report_cust_pkg-date.html?date=contract_end', 'Show packages by contract end date' ]; $report_packages{'Advanced package reports'} = [ $fsurl.'search/report_cust_pkg.html', 'by agent, date range, status, package definition' ]; tie my %report_inventory, 'Tie::IxHash', @@ -278,9 +311,12 @@ $report_rating{'Call Detail Records (CDRs)'} = [ $fsurl.'search/report_cdr.html' if $curuser->access_right("Usage: Call Detail Records (CDRs)"); $report_rating{'Unrateable CDRs'} = [ $fsurl.'search/cdr.html?freesidestatus=failed;cdrbatchnum=_ALL_' ] if $curuser->access_right("Usage: Unrateable CDRs"); +$report_rating{'Customer CDRs Profit/Loss'} = [ $fsurl.'search/report_customer_cdr_profit.html', 'Profit/loss from customer CDRs' ] + if $curuser->access_right('Financial reports'); if ( $curuser->access_right("Usage: Time worked") ) { $report_rating{'Time worked'} = [ $fsurl.'search/report_rt_transaction.html', '' ]; - $report_rating{'Time worked summary'} = [ $fsurl.'search/report_rt_ticket.html', '' ]; + $report_rating{'Time worked summary per ticket'} = [ $fsurl.'search/report_rt_ticket.html', '' ]; + $report_rating{'Time worked summary per customer'} = [ $fsurl.'search/report_rt_cust.html', '' ]; } tie my %report_ticketing_statistics, 'Tie::IxHash', @@ -310,31 +346,31 @@ $report_employees{'Employee Audit Report'} = [ $fsurl.'search/report_employee_au if $curuser->access_right('Employees: Audit Report'); ; -tie my %report_bill_event, 'Tie::IxHash', - 'All billing events' => [ $fsurl.'search/report_cust_event.html', 'All billing events for a date range' ], - 'Billing event errors' => [ $fsurl.'search/report_cust_event.html?failed=1', 'Failed credit cards, processor or printer problems, etc.' ], -# 'All invoice events' => [ $fsurl.'search/cust_bill_event.html', 'Reports on deprecated, old-style invoice events for a date range' ], -# 'Invoice event errors' => [ $fsurl.'search/cust_bill_event.html?failed=1', 'Reports on deprecated, old-style events for failed credit cards, processor or printer problems, etc.' ], -; - -tie my %report_payments, 'Tie::IxHash', - 'Payments' => [ $fsurl.'search/report_cust_pay.html', 'Payment report (by type and/or date range)' ], -; +tie my %report_payments, 'Tie::IxHash'; +$report_payments{'Payments'} = [ $fsurl.'search/report_cust_pay.html', 'Payment report (by type and/or date range)' ] + if $curuser->access_right('Basic payment and refund reports'); +$report_payments{'Payment application detail'} = [ $fsurl.'search/report_cust_bill_pay_pkg.html', 'Line item application detail' ] + if $curuser->access_right('Financial reports'); $report_payments{'Pending Payments'} = [ $fsurl.'search/cust_pay_pending.html?magic=_date;statusNOT=done', 'Pending real-time payments' ] if $curuser->access_right('View customer pending payments'); +$report_payments{'Unapplied Payments'} = [ $fsurl.'search/report_cust_pay.html?unapplied=1', 'Unapplied payment report (by type and/or date range)' ] + if $curuser->access_right('Financial reports'); #not enforced $report_payments{'Voided Payments'} = [ $fsurl.'search/report_cust_pay.html?void=1', 'Voided payment report (by type and/or date range)' ] - if $curuser->access_right('View customer pending payments'); -$report_payments{'Unapplied Payments'} = [ $fsurl.'search/report_cust_pay.html?unapplied=1', 'Unapplied payment report (by type and/or date range)' ]; + if $curuser->access_right('Financial reports'); #not enforced $report_payments{'Payment Batches'} = [ $fsurl.'search/pay_batch.html', 'Payment batches (by status and/or date range)' ] - if $conf->exists('batch-enable') || $conf->config('batch-enable_payby'); -$report_payments{'Unapplied Payment Aging'} = [ $fsurl.'search/report_unapplied_cust_pay.html', 'Unapplied payment aging report' ]; + if ( $conf->exists('batch-enable') || $conf->config('batch-enable_payby') ) + && $curuser->access_right('Financial reports'); +$report_payments{'Unapplied Payment Aging'} = [ $fsurl.'search/report_unapplied_cust_pay.html', 'Unapplied payment aging report' ] + if $curuser->access_right('Financial reports'); $report_payments{'Deleted Payments / Payment history table'} = [ $fsurl.'search/report_h_cust_pay.html', 'Deleted payments / payment history table' ] - if $conf->exists('payment-history-report'); + if $conf->exists('payment-history-report') + && $curuser->access_right('Financial reports'); tie my %report_credits, 'Tie::IxHash', 'Credit Report' => [ $fsurl.'search/report_cust_credit.html', 'Credit report (by employee and/or date range)' ], 'Credit application detail' => [ $fsurl.'search/report_cust_credit_bill_pkg.html', 'Line item application detail' ], 'Unapplied Credits' => [ $fsurl.'search/report_cust_credit.html?unapplied=1', 'Unapplied credit report (by type and/or date range)' ], + 'Voided Credits' => [ $fsurl.'search/report_cust_credit_void.html', 'Voided credit report (by employee and/or date range)' ], ; tie my %report_refunds, 'Tie::IxHash', @@ -348,10 +384,17 @@ tie my %report_sales, 'Tie::IxHash', 'Sales Report' => [ $fsurl.'graph/report_cust_bill_pkg.html', 'Sales report and graph (by agent, package class and/or date range)' ], 'Rated Call Sales Report' => [ $fsurl.'graph/report_cust_bill_pkg_detail.html', 'Sales report and graph (by agent, package class, usage class and/or date range)' ], 'Sales with Advertising Source' => [ $fsurl.'search/report_cust_bill_pkg_referral.html' ], +; + +tie my %report_commissions, 'Tie::IxHash', 'Agent Commissions' => [ $fsurl.'search/report_agent_commission.html' ], + 'Agent Commissions Per Package' => [ $fsurl.'search/report_agent_commission_pkg.html' ], 'Sales Person Commissions' => [ $fsurl.'search/report_sales_commission.html' ], - 'Sales Person Commission per package' => [ $fsurl.'search/report_sales_commission_pkg.html' ], + 'Sales Person Commissions Per Package' => [ $fsurl.'search/report_sales_commission_pkg.html' ], ; +$report_commissions{'Employee Commissions'} = [ $fsurl.'search/report_employee_commission.html', '' ] + if $curuser->access_right('Employees: Commission Report'); +$report_commissions{'Agent Credits and Payments'} = [ $fsurl.'search/report_agent_credit_payment.html' ]; tie my %report_financial, 'Tie::IxHash'; if( $curuser->access_right('Financial reports') ) { @@ -360,6 +403,7 @@ if( $curuser->access_right('Financial reports') ) { 'Sales' => [ \%report_sales, 'Sales reports', ], 'Credits' => [ \%report_credits, 'Credit reports', ], 'Refunds' => [ \%report_refunds, 'Refund reports', ], + 'Commissions' => [ \%report_commissions, 'Commission reports' ], ); $report_financial{'A/R Aging'} = [ $fsurl.'search/report_receivables.html', 'Accounts Receivable Aging report' ]; $report_financial{'Prepaid Income'} = [ $fsurl.'search/report_prepaid_income.html', 'Prepaid income (unearned revenue) report' ]; @@ -369,6 +413,8 @@ if( $curuser->access_right('Financial reports') ) { $report_financial{'Tax Liability (vendor tax data)'} = [ $fsurl.'search/report_newtax.html', 'Tax liability report (vendor tax data)' ] if $taxproducts; + $report_financial{'Monthly Sales and Taxes'} = [$fsurl.'search/tax_sales.html', 'Monthly sales and taxes report']; + # most sites don't need this but there isn't really a config to enable it $report_financial{'E911 Fee Summary'} = [ $fsurl.'search/report_e911.html', 'E911 fee summary' ]; @@ -391,18 +437,26 @@ $report_logs{'Outgoing messages'} = [ $fsurl.'search/cust_msg.html', 'View outgo || $curuser->access_right('Configuration'); tie my %report_menu, 'Tie::IxHash'; +$report_menu{'Saved searches'} = [ \%report_saved_searches, 'My saved searches' ] + if keys(%report_saved_searches); $report_menu{'Prospects'} = [ \%report_prospects, 'Prospect reports' ] - if $curuser->access_right('List prospects'); + if $curuser->access_right('List prospects') + || $curuser->access_right('List contacts'); $report_menu{'Quotations'} = [ \%report_quotations, 'Quotation reports' ] if $curuser->access_right('List quotations'); $report_menu{'Customers'} = [ \%report_customers, 'Customer reports' ] - if $curuser->access_right('List customers'); + if $curuser->access_right('List customers') + || $curuser->access_right('List contacts') + || $curuser->access_right('Advanced customer search') + || $curuser->access_right('List zip codes') + || $curuser->access_right('Financial reports') + || $curuser->access_right('Customers: Customer churn report'); $report_menu{'Invoices'} = [ \%report_invoices, 'Invoice reports' ] if $curuser->access_right('List invoices'); $report_menu{'Discounts'} = [ \%report_discounts, 'Discount reports' ] if $curuser->access_right('Financial reports'); $report_menu{'Payments'} = [ \%report_payments, 'Payment reports' ] - if $curuser->access_right('Financial reports'); + if keys %report_payments; $report_menu{'Packages'} = [ \%report_packages, 'Package reports' ] if $curuser->access_right('List packages'); $report_menu{'Services'} = [ \%report_services, 'Services reports' ] @@ -416,7 +470,7 @@ $report_menu{'Tickets'} = [ \%report_ticketing, 'Ticket reports' ] ;#&& FS::TicketSystem->access_right(\%session, 'Something'); $report_menu{'Employees'} = [ \%report_employees, 'Employee reports' ] if keys %report_employees; -$report_menu{'Billing events'} = [ \%report_bill_event, 'Billing events' ] +$report_menu{'Billing events'} = [ $fsurl.'search/report_cust_event.html', 'Search billing events by date and status' ] if $curuser->access_right('Billing event reports'); $report_menu{'Financial'} = [ \%report_financial, 'Financial reports' ] if $curuser->access_right('Financial reports') @@ -426,13 +480,20 @@ $report_menu{'Logs'} = [ \%report_logs, 'System and email logs' ] $report_menu{'SQL Query'} = [ $fsurl.'search/report_sql.html', 'SQL Query'] if $curuser->access_right('Raw SQL'); +tie my %tools_customers, 'Tie::IxHash', (); +$tools_customers{'Appointments'} = [ $fsurl.'rt/Search/Schedule.html?LengthMin=0', 'View appointment schedule' ] + if $curuser->access_right('View appointments'); + tie my %tools_importing, 'Tie::IxHash', - 'Customers' => [ $fsurl.'misc/cust_main-import.cgi', '' ], - 'Customer packages' => [ $fsurl.'misc/cust_pkg-import.html', '' ], - 'Customer comments' => [ $fsurl.'misc/cust_main_note-import.html', '' ], - 'One-time charges' => [ $fsurl.'misc/cust_main-import_charges.cgi', '' ], - 'Payments' => [ $fsurl.'misc/cust_pay-import.cgi', '' ], - 'Credits' => [ $fsurl.'misc/cust_credit-import.html', '' ], + 'Customers' => [ $fsurl.'misc/cust_main-import.cgi', '' ], + 'Package definitions' => [ $fsurl.'misc/part_pkg-import.html', '' ], + 'Customer packages' => [ $fsurl.'misc/cust_pkg-import.html', '' ], + 'Customer comments' => [ $fsurl.'misc/cust_main_note-import.html', '' ], + 'Customer notes' => [ $fsurl.'misc/cust_main_note-import.html', '' ], + 'Customer Contacts' => [ $fsurl.'misc/contact-import.cgi', '' ], + 'One-time charges' => [ $fsurl.'misc/cust_main-import_charges.cgi', '' ], + 'Payments' => [ $fsurl.'misc/cust_pay-import.cgi', '' ], + 'Credits' => [ $fsurl.'misc/cust_credit-import.html', '' ], 'Phone numbers (DIDs)' => [ $fsurl.'misc/phone_avail-import.html', '' ], 'Call Detail Records (CDRs)' => [ $fsurl.'misc/cdr-import.html', '' ], ; @@ -467,6 +528,8 @@ $tools_ticketing{'Cron Tool'} = [ $fsurl.'rt/Developer/CronTool/', '' ] if $conf->exists('rt-crontool'); tie my %tools_menu, 'Tie::IxHash', (); +$tools_menu{'Customers'} = [ \%tools_customers, 'Customer tools' ] + if keys %tools_customers; $tools_menu{'Quick payment entry'} = [ $fsurl.'misc/batch-cust_pay.html', 'Enter multiple payments in a batch' ] if $curuser->access_right('Post payment batch'); $tools_menu{'Process payment batches'} = [ $fsurl.'search/pay_batch.cgi?magic=_date;open=1;intransit=1', 'Process credit card and electronic check batches' ] @@ -547,6 +610,10 @@ tie my %config_circuit, 'Tie::IxHash', 'Termination types' => [ $fsurl.'browse/circuit_termination.html', '' ], ; +tie my %config_fiber, 'Tie::IxHash', + 'OLTs' => [ $fsurl.'browse/fiber_olt.html', '' ], +; + tie my %config_export_svc, 'Tie::IxHash', (); if ( $curuser->access_right('Configuration') ) { $config_export_svc{'Service definitions'} = [ $fsurl.'browse/part_svc.cgi', 'Services are items you offer to your customers' ]; @@ -567,6 +634,8 @@ $config_export_svc{'Alarm'} = [ \%config_alarm, '' ] if $curuser->access_right(['Alarm configuration', 'Alarm global configuration']); $config_export_svc{'Circuits'} = [ \%config_circuit, '' ] if $curuser->access_right('Configuration'); +$config_export_svc{'Fiber'} = [ \%config_fiber, '' ] + if $curuser->access_right('Configuration'); $config_export_svc{'Hardware types'} = [ $fsurl.'browse/hardware_class.html', 'Set up hardware type catalog' ] if $curuser->access_right('Configuration'); @@ -606,8 +675,7 @@ tie my %config_cust, 'Tie::IxHash', 'Contact types' => [ $fsurl.'browse/contact_class.html', ''], #XXX useful description ; -$config_cust{'Note classes'} = [ $fsurl.'browse/cust_note_class.html', 'Note classes define groups of customer notes for reporting.' ] - if ($conf->exists('note-classes') && $conf->config('note-classes') > 0); +$config_cust{'Note classes'} = [ $fsurl.'browse/cust_note_class.html', 'Note classes define groups of customer notes for reporting.' ]; tie my %config_agent, 'Tie::IxHash', 'Agent types' => [ $fsurl.'browse/agent_type.cgi', 'Agent types define groups of package definitions that you can then assign to particular agents' ], @@ -659,8 +727,14 @@ if ( $curuser->access_right('Configuration') ) { if $conf->exists('enable_taxproducts'); $config_billing{'Tax classes'} = [ $fsurl. 'browse/part_pkg_taxclass.html', 'Tax classes' ]; + $config_billing{'separator5'} = ''; #its a separator! $config_billing{'Credit reasons'} = [ $fsurl.'browse/reason.html?class=R', 'Credit reasons explain why a credit was issued.' ]; $config_billing{'Credit reason types'} = [ $fsurl.'browse/reason_type.html?class=R', 'Credit reason types define groups of reasons.' ]; + $config_billing{'Credit void reasons'} = [ $fsurl.'browse/reason.html?class=X', 'Credit void reasons explain why a credit was voided.' ]; + $config_billing{'Credit void reason types'} = [ $fsurl.'browse/reason_type.html?class=X', 'Credit void reason types define groups of reasons.' ]; + + $config_billing{'Refund reasons'} = [ $fsurl.'browse/reason.html?class=F', 'Refund reasons explain why a refund was issued.' ]; + $config_billing{'Refund reason types'} = [ $fsurl.'browse/reason_type.html?class=F', 'Refund reason types define groups of reasons.' ]; } #XXX also to be unified @@ -715,10 +789,10 @@ $config_misc{'Message templates'} = [ $fsurl.'browse/msg_template.html', 'Templa $config_misc{'Advertising sources'} = [ $fsurl.'browse/part_referral.html', 'Where a customer heard about your service.' ] if $curuser->access_right('Edit advertising sources') || $curuser->access_right('Edit global advertising sources'); -if ( $curuser->access_right('Configuration') ) { - $config_misc{'Custom fields'} = [ $fsurl.'browse/part_virtual_field.html', 'Locally defined fields', ]; - $config_misc{'Translation strings'} = [ $fsurl.'browse/msgcat.html', 'Translations and other customizable labels for each locale' ]; -} +$config_misc{'Custom fields'} = [ $fsurl.'browse/part_virtual_field.html', 'Locally defined fields', ] + if $curuser->access_right('Edit custom fields'); +$config_misc{'Translation strings'} = [ $fsurl.'browse/msgcat.html', 'Translations and other customizable labels for each locale' ] + if $curuser->access_right('Configuration'); $config_misc{'Inventory classes and inventory'} = [ $fsurl.'browse/inventory_class.html', 'Setup inventory classes and stock inventory' ] if $curuser->access_right('Edit inventory') || $curuser->access_right('Edit global inventory') @@ -727,6 +801,10 @@ $config_misc{'Inventory classes and inventory'} = [ $fsurl.'browse/inventory_cla $config_misc{'Upload targets'} = [ $fsurl.'browse/upload_target.html', 'Billing and payment upload destinations' ] if $curuser->access_right('Configuration'); +$config_misc{'System log emails'} = [ $fsurl.'browse/log_email.html', 'Configure conditions for sending email when logging' ] + if $curuser->access_right('View system logs') + || $curuser->access_right('Configuration'); + tie my %config_menu, 'Tie::IxHash'; if ( $curuser->access_right('Configuration' ) ) { %config_menu = ( @@ -760,7 +838,7 @@ $config_menu{'Billing'} = [ \%config_billing, '' ] if keys %config_billing; $config_menu{'Ticketing'} = [ \%config_ticketing, '' ] if $conf->config('ticket_system') - && FS::TicketSystem->access_right(\%session, 'ShowConfigTab'); + && eval { FS::TicketSystem->access_right(\%session, 'ShowConfigTab') }; $config_menu{'Network Monitoring'} = [ \%config_nms, '' ] if $curuser->access_right('Configure network monitoring') && $conf->config('network_monitoring_system') eq 'Torrus_Internal';