From b65b8096089410001dfbcd35f9a56f9405b9f5f1 Mon Sep 17 00:00:00 2001 From: mark Date: Fri, 1 Apr 2011 02:52:24 +0000 Subject: svc_hardware and svc_dish, #11454 --- httemplate/elements/menu.html | 5 +- httemplate/elements/select-hardware_class.html | 10 +++ httemplate/elements/select-hardware_type.html | 14 +++++ httemplate/elements/tr-cust_svc.html | 78 ++++++++++++++++++++++++ httemplate/elements/tr-cust_svc_cancel.html | 24 ++++++++ httemplate/elements/tr-select-hardware_type.html | 10 +++ 6 files changed, 140 insertions(+), 1 deletion(-) create mode 100644 httemplate/elements/select-hardware_class.html create mode 100644 httemplate/elements/select-hardware_type.html create mode 100644 httemplate/elements/tr-cust_svc.html create mode 100644 httemplate/elements/tr-cust_svc_cancel.html create mode 100644 httemplate/elements/tr-select-hardware_type.html (limited to 'httemplate/elements') diff --git a/httemplate/elements/menu.html b/httemplate/elements/menu.html index a70abe475..f558777b5 100644 --- a/httemplate/elements/menu.html +++ b/httemplate/elements/menu.html @@ -191,7 +191,7 @@ foreach my $svcdb ( FS::part_svc->svc_tables() ) { ]; } - if ( $svcdb eq 'svc_acct' || $svcdb eq 'svc_broadband' ) { + if ( $svcdb =~ /^svc_(acct|broadband|hardware)$/ ) { $report_svc{"Advanced $lcsname reports"} = [ $fsurl."search/report_$svcdb.html", '' ]; } @@ -532,6 +532,9 @@ $config_misc{'Inventory classes and inventory'} = [ $fsurl.'browse/inventory_cla || $curuser->access_right('Edit global inventory') || $curuser->access_right('Configuration'); +$config_misc{'Hardware types'} = [ $fsurl.'browse/hardware_class.html', 'Set up hardware type catalog' ] + if $curuser->access_right('Configuration'); + tie my %config_menu, 'Tie::IxHash'; if ( $curuser->access_right('Configuration' ) ) { %config_menu = ( diff --git a/httemplate/elements/select-hardware_class.html b/httemplate/elements/select-hardware_class.html new file mode 100644 index 000000000..692b3c9fd --- /dev/null +++ b/httemplate/elements/select-hardware_class.html @@ -0,0 +1,10 @@ +<% include( '/elements/select-table.html', + 'table' => 'hardware_class', + 'name_col' => 'classname', + 'hashref' => { 'disabled' => '' }, + %opt, + ) +%> +<%init> +my %opt = @_; + diff --git a/httemplate/elements/select-hardware_type.html b/httemplate/elements/select-hardware_type.html new file mode 100644 index 000000000..ae07798fc --- /dev/null +++ b/httemplate/elements/select-hardware_type.html @@ -0,0 +1,14 @@ +<% include( '/elements/select-table.html', + 'table' => 'hardware_type', + 'name_col' => 'model', + 'hashref' => $hashref, + %opt, + ) +%> +<%init> +my %opt = @_; +my $classnum = delete $opt{'classnum'}; +my $hashref = $opt{'hashref'} || {}; +$hashref->{'classnum'} = $classnum if $classnum; + + diff --git a/httemplate/elements/tr-cust_svc.html b/httemplate/elements/tr-cust_svc.html new file mode 100644 index 000000000..e792ff350 --- /dev/null +++ b/httemplate/elements/tr-cust_svc.html @@ -0,0 +1,78 @@ +<%doc> +tr-cust_svc - Short display of a customer service for use in view/cust_main. + +Formerly part of view/cust_main/packages/services.html, moved here for +cleanliness. + + + <% +FS::UI::Web::svc_link($m, $part_svc, $cust_svc) +%> + <% +FS::UI::Web::svc_label_link($m, $part_svc, $cust_svc) +%> + +% if ( $cust_svc->overlimit ) { + + + Overlimit: <% +time2str('%b %o %Y' . $opt{'cust_pkg-display_times'} ? ' %l:%M %P' : '', +$cust_svc->overlimit ) + %> + + +% } + +% # first column: recharge link + +% if ( $curuser->access_right('Recharge customer service') +% && $part_svc->svcdb eq 'svc_acct' +% && ( $svc_x->seconds ne '' +% || $svc_x->upbytes ne '' +% || $svc_x->downbytes ne '' +% || $svc_x->totalbytes ne '' +% ) +% ) { + ( <% svc_recharge_link($cust_svc)%> ) +% } + +% # second column: all other action links + +% if ( $part_svc->svcdb eq 'svc_broadband' ) { + ( <% + include('/elements/popup_link-ping.html', + 'ip' => $svc_x->ip_addr + ) %> ) +% my $manage_link = $opt{'svc_broadband-manage_link'}; +% if ( $manage_link ) { + ">Manage Device ) +% } +% } #svc_broadband +% if ( $curuser->access_right('Unprovision customer service') ) { + ( <% $svc_unprovision_link %> ) +% } +% if ( $part_svc->svcdb eq 'svc_pbx' && $opt{'maestro-status_test'} ) { + Test maestro status ) + +% } + + + +<%init> +my %opt = @_; +my $curuser = $FS::CurrentUser::CurrentUser; + +my $cust_svc = $opt{'cust_svc'}; +my $part_svc = $opt{'part_svc'} || $cust_svc->part_svc; +my $cust_pkg = $opt{'cust_pkg'} || $cust_svc->cust_pkg; +my $svc_x = $cust_svc->svc_x; + +my $svc_unprovision_link = + qq!Unprovision!; + + diff --git a/httemplate/elements/tr-cust_svc_cancel.html b/httemplate/elements/tr-cust_svc_cancel.html new file mode 100644 index 000000000..e7fa47a92 --- /dev/null +++ b/httemplate/elements/tr-cust_svc_cancel.html @@ -0,0 +1,24 @@ +<%doc> +tr-cust_svc_cancel - Short display of a canceled customer service +for use in view/cust_main. + + + <% +FS::UI::Web::svc_link($m, $part_svc, $cust_svc) +%> + <% +FS::UI::Web::svc_label_link($m, $part_svc, $cust_svc) +%> + +%# no action links, the service is canceled + +<%init> +my %opt = @_; +my $curuser = $FS::CurrentUser::CurrentUser; + +my $cust_svc = $opt{'cust_svc'}; +my $part_svc = $opt{'part_svc'} || $cust_svc->part_svc; +my $cust_pkg = $opt{'cust_pkg'} || $cust_svc->cust_pkg; +my $svc_x = $cust_svc->svc_x; + + diff --git a/httemplate/elements/tr-select-hardware_type.html b/httemplate/elements/tr-select-hardware_type.html new file mode 100644 index 000000000..c3066417b --- /dev/null +++ b/httemplate/elements/tr-select-hardware_type.html @@ -0,0 +1,10 @@ + + <% $opt{'label'} || 'Device type: ' %> + <% include('select-hardware_type.html', %opt) %> + + +<%init> + +my %opt = @_; + + -- cgit v1.2.1