diff options
Diffstat (limited to 'httemplate')
-rwxr-xr-x | httemplate/edit/cust_main.cgi | 5 | ||||
-rw-r--r-- | httemplate/elements/menu.html | 12 | ||||
-rwxr-xr-x | httemplate/misc/cancel_pkg.html | 38 | ||||
-rw-r--r-- | httemplate/search/employee_audit.html | 2 | ||||
-rw-r--r-- | httemplate/search/report_access_user_log.html | 2 | ||||
-rw-r--r-- | httemplate/search/report_employee_audit.html | 2 | ||||
-rw-r--r-- | httemplate/view/Status-db_size_detail.html | 39 | ||||
-rw-r--r-- | httemplate/view/Status.html | 13 | ||||
-rw-r--r-- | httemplate/view/cust_main/payment_history/payment.html | 17 |
9 files changed, 95 insertions, 35 deletions
diff --git a/httemplate/edit/cust_main.cgi b/httemplate/edit/cust_main.cgi index e58441d24..05bf4377a 100755 --- a/httemplate/edit/cust_main.cgi +++ b/httemplate/edit/cust_main.cgi @@ -296,8 +296,13 @@ if ( $cgi->param('error') ) { $custnum=''; $cust_main = new FS::cust_main ( {} ); + + my @agentnums = $curuser->agentnums; + $cust_main->agentnum( $agentnums[0] ) + if scalar(@agentnums) == 1; $cust_main->agentnum( $conf->config('default_agentnum') ) if $conf->exists('default_agentnum'); + $cust_main->referral_custnum( $cgi->param('referral_custnum') ); $cust_main->set('postal_invoice', 'Y') unless $conf->exists('disablepostalinvoicedefault'); diff --git a/httemplate/elements/menu.html b/httemplate/elements/menu.html index 58a7d5783..cadbd864d 100644 --- a/httemplate/elements/menu.html +++ b/httemplate/elements/menu.html @@ -428,8 +428,6 @@ $report_logs{'Billing events'} = [ $fsurl.'search/report_cust_event.html', 'Sea if $curuser->access_right('Billing event reports'); $report_logs{'Credit limit incidents'} = [ $fsurl.'search/report_cust_main_credit_limit.html', '' ] if $curuser->access_right('List rating data'); -$report_logs{'Employee activity'} = [ $fsurl.'search/report_employee_audit.html', '' ] - if $curuser->access_right('Employees: Audit Report'); $report_logs{'System log'} = [ $fsurl.'search/log.html', 'View system events and debugging information.' ], if $curuser->access_right('View system logs') || $curuser->access_right('Configuration'); @@ -437,6 +435,12 @@ $report_logs{'Outgoing messages'} = [ $fsurl.'search/cust_msg.html', 'View outgo if $curuser->access_right('View email logs') || $curuser->access_right('Configuration'); +tie my %report_employee, 'Tie::IxHash', + 'Employee activity' => [ $fsurl.'search/report_employee_audit.html', '' ], + 'Employee sessions' => [ $fsurl.'search/report_access_user_session_log.html', '' ], + 'Access log statistics' => [ $fsurl.'search/report_access_user_log.html?group_by=path', '' ], +; + tie my %report_menu, 'Tie::IxHash'; $report_menu{'Saved searches'} = [ \%report_saved_searches, 'My saved searches' ] if keys(%report_saved_searches); @@ -475,6 +479,8 @@ $report_menu{'Financial (Receivables)'} = [ \%report_financial, 'Financial repor $report_menu{'Financial (Payables)'} = [ \%report_payable, 'Financial reports (Payables)' ] if $curuser->access_right('Financial reports'); +$report_menu{'Employees'} = [ \%report_employee, 'Employee reports' ] + if $curuser->access_right('Employee Reports'); $report_menu{'Logs'} = [ \%report_logs, 'System and email logs' ] if (keys %report_logs); # empty if the user has no rights to it $report_menu{'SQL Query'} = [ $fsurl.'search/report_sql.html', 'SQL Query'] @@ -554,8 +560,6 @@ $tools_system{'Status'} = [ $fsurl.'view/Status.html', 'System status' ] if $curuser->access_right('Configuration'); # 'View system status'); $tools_system{'Job Queue'} = [ $fsurl.'search/queue.html', 'View pending job queue' ] if $curuser->access_right('Job queue'); -$tools_system{'Access log statistics'} = [ $fsurl.'search/report_access_user_log.html?group_by=path', '' ] - if $curuser->access_right('Configuration'); # 'View profiling data'); tie my %tools_menu, 'Tie::IxHash', (); $tools_menu{'Customers'} = [ \%tools_customers, 'Customer tools' ] diff --git a/httemplate/misc/cancel_pkg.html b/httemplate/misc/cancel_pkg.html index 3c1862212..96cf6412c 100755 --- a/httemplate/misc/cancel_pkg.html +++ b/httemplate/misc/cancel_pkg.html @@ -197,25 +197,27 @@ my $cust_pkg = qsearchs('cust_pkg', {'pkgnum' => $pkgnum}) my $part_pkg = $cust_pkg->part_pkg; -my @unprovision_warning; -{ - my @services_w_export; - for ( $cust_pkg->cust_svc ) { - push( @services_w_export, ($_->label)[0] . ': ' . ($_->label)[1], ) - if $_->part_svc->export_svc; - } - if ( @services_w_export ) { - push( @unprovision_warning, 'NOTE: This package has ' - . @services_w_export . ' ' . PL( "service", @services_w_export ) - . ' that will be unprovisioned', ); - if ( @services_w_export < 10 ) { - $unprovision_warning[0] .= ':'; - push( @unprovision_warning, @services_w_export, ); - } - else { - $unprovision_warning[0] .= '.'; - } +my @unprovision_warning = (); +unless ( $method =~ /^(resume|uncancel)$/ ) { + my @services_w_export = map { my @l = $_->label; $l[0]. ': '. $l[1]; } + grep $_->part_svc->export_svc, + $cust_pkg->cust_svc; + if ( @services_w_export ) { + + my $actioned = ($method =~ /^(suspend|adjourn)$/) ? 'suspended' + : 'unprovisioned'; + push @unprovision_warning, + 'NOTE: This package has '. @services_w_export. ' '. + PL( 'service', @services_w_export ). " that will be $actioned"; + + if ( @services_w_export < 10 ) { + $unprovision_warning[0] .= ':'; + push @unprovision_warning, @services_w_export; + } else { + $unprovision_warning[0] .= '.'; } + + } } $date ||= $cust_pkg->get($method); diff --git a/httemplate/search/employee_audit.html b/httemplate/search/employee_audit.html index 2bc6ff46e..991758c4a 100644 --- a/httemplate/search/employee_audit.html +++ b/httemplate/search/employee_audit.html @@ -7,7 +7,7 @@ <%init> die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('Employees: Audit Report'); + unless $FS::CurrentUser::CurrentUser->access_right('Employee Reports'); my %tables = ( cust_pay => 'Payments', diff --git a/httemplate/search/report_access_user_log.html b/httemplate/search/report_access_user_log.html index 0c8acb35e..d43c74274 100644 --- a/httemplate/search/report_access_user_log.html +++ b/httemplate/search/report_access_user_log.html @@ -27,7 +27,7 @@ <%init> die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('Configuration'); + unless $FS::CurrentUser::CurrentUser->access_right('Employee Reports'); my $group_by = ''; if ( $cgi->param('group_by') =~ /^(\w+)$/ ) { diff --git a/httemplate/search/report_employee_audit.html b/httemplate/search/report_employee_audit.html index 461849b76..6008e1caa 100644 --- a/httemplate/search/report_employee_audit.html +++ b/httemplate/search/report_employee_audit.html @@ -23,7 +23,7 @@ <%init> die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('Employees: Audit Report'); + unless $FS::CurrentUser::CurrentUser->access_right('Employee Reports'); my %tables = ( cust_pay => 'Payments', diff --git a/httemplate/view/Status-db_size_detail.html b/httemplate/view/Status-db_size_detail.html new file mode 100644 index 000000000..96c2da006 --- /dev/null +++ b/httemplate/view/Status-db_size_detail.html @@ -0,0 +1,39 @@ +<& /elements/header-popup.html, { + 'title' => 'Database size details', + } +&> + +<& /search/elements/search.html, + 'name_singular' => 'table', + 'header' => [ 'Table', 'Size' ], + 'query' => $query, + 'count_query' => $count_query, + 'nohtmlheader' => 1, +&> + +<& /elements/footer-popup.html &> +<%init> + +my $query = q{ + + SELECT table_name, pg_size_pretty(total_bytes) AS total + FROM ( + SELECT * FROM ( + SELECT relname AS TABLE_NAME, + pg_total_relation_size(c.oid) AS total_bytes + FROM pg_class c + LEFT JOIN pg_namespace n ON n.oid = c.relnamespace + WHERE relkind = 'r' + AND nspname = 'public' + ) a + ) a order by total_bytes desc +}; + +my $count_query = q{ + SELECT count(*) FROM pg_class c + LEFT JOIN pg_namespace n ON n.oid = c.relnamespace + WHERE relkind = 'r' + AND nspname = 'public' +}; + +</%init> diff --git a/httemplate/view/Status.html b/httemplate/view/Status.html index e08bfe44b..7fb03eb2f 100644 --- a/httemplate/view/Status.html +++ b/httemplate/view/Status.html @@ -1,4 +1,7 @@ <& /elements/header.html, 'System Status' &> + +<& /elements/init_overlib.html &> + % foreach my $section ( keys %status ) { <FONT CLASS="fsinnerbox-title"><% mt($section) |h %></FONT> <TABLE CLASS="fsinnerbox"> @@ -11,6 +14,7 @@ </TABLE> <BR><BR> % } + <& /elements/footer.html &> <%init> @@ -40,8 +44,13 @@ if ( $db eq 'PostgreSQL' && $db_ver =~ /^\s*PostgreSQL\s+([\w\.]+)\s+on\s+/ ) { my $db_size = 'Unknown'; if ( $db eq 'PostgreSQL' ) { $db_size = FS::Record->scalar_sql(qq( - SELECT pg_size_pretty(pg_database_size('freeside')) - )); + SELECT pg_size_pretty(pg_database_size('freeside')) + )). ' '. + include('/elements/popup_link.html', + 'action' => 'Status-db_size_detail.html', + 'label' => '(details)', + 'actionlabel' => 'Database size details', + ); } tie my %status, 'Tie::IxHash', diff --git a/httemplate/view/cust_main/payment_history/payment.html b/httemplate/view/cust_main/payment_history/payment.html index 6241f11b8..6402383d8 100644 --- a/httemplate/view/cust_main/payment_history/payment.html +++ b/httemplate/view/cust_main/payment_history/payment.html @@ -180,17 +180,18 @@ if ( $cust_pay->closed !~ /^Y/i } my $void = ''; -# note: "TOKN" is not yet supported in stock freeside -my $voidmsg = $cust_pay->payby =~ /^(CARD|CHEK|TOKN)$/ +my $voidmsg = $cust_pay->payby =~ /^(CARD|CHEK)$/ ? ' (' . emt('do not send anything to the payment gateway').')' : ''; $void = ' ('. - include( '/elements/popup_link.html', - 'label' => emt('void'), - 'action' => "${p}misc/void-cust_pay.html?".$cust_pay->paynum, - 'actionlabel' => emt('Void payment'), - ). - ')' + include( '/elements/popup_link.html', + 'label' => emt('void'), + 'action' => "${p}misc/void-cust_pay.html?".$cust_pay->paynum, + 'actionlabel' => emt('Void payment'), + 'title' => emt('Void this payment from the database'). + $voidmsg, + ). + ')' if $cust_pay->closed !~ /^Y/i && ( ( $cust_pay->payby eq 'CARD' && $opt{'Credit card void'} ) || ( $cust_pay->payby eq 'CHEK' && $opt{'Echeck void'} ) |