summaryrefslogtreecommitdiff
path: root/httemplate/elements
diff options
context:
space:
mode:
authormark <mark>2011-04-01 02:52:24 +0000
committermark <mark>2011-04-01 02:52:24 +0000
commitb65b8096089410001dfbcd35f9a56f9405b9f5f1 (patch)
treedf16b0422007bd876bc969bdff857d8a510b0aca /httemplate/elements
parent19b0c403fbf697a1de92f12abc8a2104daca07bc (diff)
svc_hardware and svc_dish, #11454
Diffstat (limited to 'httemplate/elements')
-rw-r--r--httemplate/elements/menu.html5
-rw-r--r--httemplate/elements/select-hardware_class.html10
-rw-r--r--httemplate/elements/select-hardware_type.html14
-rw-r--r--httemplate/elements/tr-cust_svc.html78
-rw-r--r--httemplate/elements/tr-cust_svc_cancel.html24
-rw-r--r--httemplate/elements/tr-select-hardware_type.html10
6 files changed, 140 insertions, 1 deletions
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 = @_;
+</%init>
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;
+
+</%init>
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.
+</%doc>
+<TR>
+ <TD ALIGN="right" VALIGN="top"><%
+FS::UI::Web::svc_link($m, $part_svc, $cust_svc)
+%></TD>
+ <TD STYLE="padding-bottom:0px"><B><%
+FS::UI::Web::svc_label_link($m, $part_svc, $cust_svc)
+%></B></TD>
+</TR>
+% if ( $cust_svc->overlimit ) {
+<TR>
+ <TD ALIGN="right" COLSPAN="3" VALIGN="top"
+ STYLE="padding-bottom:1px; padding-top:0px">
+ <FONT SIZE="-2" COLOR="#FFD000">Overlimit: <%
+time2str('%b %o %Y' . $opt{'cust_pkg-display_times'} ? ' %l:%M %P' : '',
+$cust_svc->overlimit )
+ %></FONT>
+ </TD>
+</TR>
+% }
+<TR>
+% # first column: recharge link
+ <TD ALIGN="right" VALIGN="top" STYLE="padding-bottom:5px; padding-top:0px">
+% 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 ''
+% )
+% ) {
+ <FONT SIZE="-2">(&nbsp;<% svc_recharge_link($cust_svc)%>&nbsp;)</FONT>
+% }
+ </TD>
+% # second column: all other action links
+ <TD ALIGN="right" VALIGN="top" STYLE="padding-bottom:5px; padding-top:0px">
+% if ( $part_svc->svcdb eq 'svc_broadband' ) {
+ <FONT SIZE="-1" STYLE="float:left">(&nbsp;<%
+ include('/elements/popup_link-ping.html',
+ 'ip' => $svc_x->ip_addr
+ ) %>&nbsp;)</FONT>
+% my $manage_link = $opt{'svc_broadband-manage_link'};
+% if ( $manage_link ) {
+ <FONT SIZE="-1" STYLE="float:left">(&nbsp;<A HREF="<%
+ eval(qq("$manage_link"))
+ %>">Manage Device</A>&nbsp;)</FONT>
+% }
+% } #svc_broadband
+% if ( $curuser->access_right('Unprovision customer service') ) {
+ <FONT SIZE="-2">(&nbsp;<% $svc_unprovision_link %>&nbsp;)</FONT>
+% }
+% if ( $part_svc->svcdb eq 'svc_pbx' && $opt{'maestro-status_test'} ) {
+ <FONT SIZE="-2">(&nbsp;<A HREF="<%$p%>misc/maestro-customer_status-test.html?<% $cust_pkg->custnum.'+'.$cust_svc->svcnum %>">Test maestro status</A>&nbsp;)
+ </FONT>
+% }
+ </TD>
+</TR>
+
+<%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!<A HREF="javascript:areyousure('${p}misc/unprovision.cgi?! .
+ $cust_svc->svcnum .
+ qq!', 'Permanently unprovision and delete this service?')">Unprovision</A>!;
+
+</%init>
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.
+</%doc>
+<TR STYLE="color:#cccccc;">
+ <TD ALIGN="right" VALIGN="top"><%
+FS::UI::Web::svc_link($m, $part_svc, $cust_svc)
+%></TD>
+ <TD STYLE="padding-bottom:0px;"><B><%
+FS::UI::Web::svc_label_link($m, $part_svc, $cust_svc)
+%></B></TD>
+</TR>
+%# 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;
+
+</%init>
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 @@
+<TR>
+ <TD ALIGN="right"><% $opt{'label'} || 'Device type: ' %></TD>
+ <TD><% include('select-hardware_type.html', %opt) %></TD>
+</TR>
+
+<%init>
+
+my %opt = @_;
+
+</%init>