summaryrefslogtreecommitdiff
path: root/httemplate
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2015-12-21 14:41:40 -0800
committerMark Wells <mark@freeside.biz>2015-12-21 14:42:14 -0800
commit38444ef88b5e93aa9aa724369ae8fe17c97fa480 (patch)
treead3d567424176a4f0169ab1e2e0a40876f970450 /httemplate
parent97ac81431c508194cd14586fa96d68259a79efe1 (diff)
svc_fiber, #35260
Diffstat (limited to 'httemplate')
-rw-r--r--httemplate/browse/fiber_olt.html11
-rw-r--r--httemplate/edit/fiber_olt.html24
-rw-r--r--httemplate/edit/process/fiber_olt.html11
-rw-r--r--httemplate/edit/process/svc_fiber.html11
-rw-r--r--httemplate/edit/svc_fiber.html36
-rw-r--r--httemplate/elements/menu.html14
-rwxr-xr-xhttemplate/search/report_svc_fiber.html47
-rw-r--r--httemplate/search/svc_fiber.html69
-rw-r--r--httemplate/view/svc_fiber.cgi34
9 files changed, 254 insertions, 3 deletions
diff --git a/httemplate/browse/fiber_olt.html b/httemplate/browse/fiber_olt.html
new file mode 100644
index 000000000..bffd5f222
--- /dev/null
+++ b/httemplate/browse/fiber_olt.html
@@ -0,0 +1,11 @@
+<& elements/browse-simple.html,
+ 'table' => 'fiber_olt',
+ 'title' => 'Fiber service OLTs',
+ 'menubar' => [ ],
+ 'name_singular' => 'OLT',
+ 'acl' => 'Configuration',
+# overrides
+ 'disabled_statuspos' => 3,
+ 'header' => [ '#', 'Name', 'Serial' ],
+ 'fields' => [ 'oltnum', 'oltname', 'serial' ],
+&>
diff --git a/httemplate/edit/fiber_olt.html b/httemplate/edit/fiber_olt.html
new file mode 100644
index 000000000..ab7d2f07e
--- /dev/null
+++ b/httemplate/edit/fiber_olt.html
@@ -0,0 +1,24 @@
+<& elements/edit.html,
+ 'popup' => 1,
+ 'table' => 'fiber_olt',
+ 'name_singular' => 'OLT',
+ 'labels' => \%labels,
+ 'fields' => \@fields,
+&>
+<%init>
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
+
+my @fields = (
+ 'oltname',
+ 'serial',
+ { field => 'disabled', type => 'checkbox', value => 'Y' }
+);
+
+my %labels = (
+ 'oltnum' => '',
+ 'oltname' => 'Name',
+ 'serial' => 'Serial',
+ 'disabled' => 'Disabled',
+);
+</%init>
diff --git a/httemplate/edit/process/fiber_olt.html b/httemplate/edit/process/fiber_olt.html
new file mode 100644
index 000000000..c8c4af490
--- /dev/null
+++ b/httemplate/edit/process/fiber_olt.html
@@ -0,0 +1,11 @@
+<& elements/process.html,
+ 'table' => 'fiber_olt',
+ 'viewall_dir' => 'browse',
+ 'popup_reload' => 'Updating',
+&>
+<%init>
+
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
+
+</%init>
diff --git a/httemplate/edit/process/svc_fiber.html b/httemplate/edit/process/svc_fiber.html
new file mode 100644
index 000000000..815a8eeb8
--- /dev/null
+++ b/httemplate/edit/process/svc_fiber.html
@@ -0,0 +1,11 @@
+<& elements/svc_Common.html,
+ table => 'svc_fiber',
+ edit_ext => 'html',
+ redirect => popurl(3)."view/svc_fiber.cgi?",
+&>
+<%init>
+
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Provision customer service'); #something else more specific?
+
+</%init>
diff --git a/httemplate/edit/svc_fiber.html b/httemplate/edit/svc_fiber.html
new file mode 100644
index 000000000..e07caa1b1
--- /dev/null
+++ b/httemplate/edit/svc_fiber.html
@@ -0,0 +1,36 @@
+<& elements/svc_Common.html,
+ 'table' => 'svc_fiber',
+ 'fields' => \@fields,
+&>
+<%init>
+
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Provision customer service'); #something else more specific?
+
+my $conf = new FS::Conf;
+
+my @fields = (
+ { field => 'oltnum',
+ type => 'select-table',
+ table => 'fiber_olt',
+ name_col => 'oltname',
+ hashref => { disabled => '' },
+ disable_empty => 1,
+ },
+ { field => 'shelf' },
+ { field => 'card' },
+ { field => 'olt_port' },
+ { field => 'ont_id' },
+ { field => 'ont_typenum',
+ type => 'select-hardware_type'
+ },
+ { field => 'ont_serial' },
+ { field => 'ont_port' },
+ { field => 'vlan' },
+ { field => 'signal' },
+ { field => 'speed_down' },
+ { field => 'speed_up' },
+ { field => 'ont_install', size => 50 },
+);
+
+</%init>
diff --git a/httemplate/elements/menu.html b/httemplate/elements/menu.html
index fa44e86e7..a3bfeb7b0 100644
--- a/httemplate/elements/menu.html
+++ b/httemplate/elements/menu.html
@@ -227,10 +227,12 @@ foreach my $svcdb ( FS::part_svc->svc_tables() ) {
];
}
- $report_svc{"Advanced $lcsname reports"} =
+ 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");
+ }
if ( $svcdb eq 'svc_phone' ) {
@@ -594,6 +596,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' ];
@@ -617,6 +623,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');
diff --git a/httemplate/search/report_svc_fiber.html b/httemplate/search/report_svc_fiber.html
new file mode 100755
index 000000000..d563c5339
--- /dev/null
+++ b/httemplate/search/report_svc_fiber.html
@@ -0,0 +1,47 @@
+<& /elements/header.html, $title &>
+
+<FORM ACTION="svc_fiber.html" METHOD="GET">
+
+ <TABLE BGCOLOR="#cccccc" CELLSPACING=0>
+ <TR>
+ <TH CLASS="background" COLSPAN=2 ALIGN="left"><FONT SIZE="+1">Search options</FONT></TH>
+ </TR>
+
+ <& /elements/tr-select-table.html,
+ label => 'OLT',
+ table => 'fiber_olt',
+ name_col => 'oltname',
+ &>
+ <& /elements/tr-input-text.html, field => 'shelf', label => 'Shelf' &>
+ <& /elements/tr-input-text.html, field => 'card', label => 'Card' &>
+ <& /elements/tr-input-text.html, field => 'olt_port', label => 'Port' &>
+
+ <& /elements/tr-td-label.html, label => 'ONT model' &>
+ <TD>
+ <& /elements/select-hardware_type.html,
+ 'empty_label' => '(all)'
+ &>
+ </TD>
+ </TR>
+
+ <& /elements/tr-input-text.html, field => 'ont_serial', label => 'Serial number' &>
+ <& /elements/tr-input-text.html, field => 'vlan', label => 'VLAN' &>
+ </TABLE>
+
+<BR>
+<INPUT TYPE="submit" VALUE="Search">
+
+</FORM>
+
+<& /elements/footer.html &>
+<%init>
+
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Services: Fiber');
+
+my $title = 'Search Fiber Services';
+
+my @olts = qsearch('fiber_olt', {});
+
+</%init>
+
diff --git a/httemplate/search/svc_fiber.html b/httemplate/search/svc_fiber.html
new file mode 100644
index 000000000..0cb735c96
--- /dev/null
+++ b/httemplate/search/svc_fiber.html
@@ -0,0 +1,69 @@
+<& elements/svc_Common.html,
+ 'title' => 'Fiber Search Results',
+ 'name' => 'fiber services',
+ 'query' => $query,
+ 'count_query' => $query->{'count_query'},
+ 'redirect' => $link,
+ 'header' => [ '#',
+ 'OLT',
+ 'Shelf/Card/Port',
+ 'ONT',
+ 'Model',
+ 'Serial',
+ FS::UI::Web::cust_header($cgi->param('cust_fields')),
+ ],
+ 'fields' => [ 'svcnum',
+ 'oltname',
+ sub { my $svc = shift;
+ join('-', $svc->shelf, $svc->card, $svc->olt_port)
+ },
+ 'ont_id',
+ 'ont_description',
+ 'ont_serial',
+ \&FS::UI::Web::cust_fields,
+ ],
+ 'links' => [ $link,
+ '',
+ '',
+ $link,
+ $link,
+ $link,
+ FS::UI::Web::cust_links($cgi->param('cust_fields')),
+ ],
+ 'align' => 'rlllll'. FS::UI::Web::cust_aligns(),
+ 'color' => [
+ ('') x 6,
+ FS::UI::Web::cust_colors(),
+ ],
+ 'style' => [
+ ('') x 6,
+ FS::UI::Web::cust_styles(),
+ ],
+
+&>
+<%init>
+
+die "access denied" unless
+ $FS::CurrentUser::CurrentUser->access_right([ 'Services: Fiber',
+ 'List services'
+ ]);
+
+my $conf = new FS::Conf;
+
+my %search_hash;
+if ( $cgi->param('magic') eq 'unlinked' ) {
+ %search_hash = ( 'unlinked' => 1 );
+} else {
+ foreach (qw( custnum agentnum svcpart cust_fields
+ ont_typenum oltnum shelf olt_port card vlan )) {
+ $search_hash{$_} = $cgi->param($_) if defined($cgi->param($_));
+ }
+}
+
+my $query = FS::svc_fiber->search(\%search_hash);
+$query->{addl_from} .= ' LEFT JOIN fiber_olt USING (oltnum) ';
+$query->{select} .= ', oltname';
+
+my $link = [ $p.'view/svc_fiber.cgi?', 'svcnum' ];
+
+</%init>
diff --git a/httemplate/view/svc_fiber.cgi b/httemplate/view/svc_fiber.cgi
new file mode 100644
index 000000000..ce9c03dc7
--- /dev/null
+++ b/httemplate/view/svc_fiber.cgi
@@ -0,0 +1,34 @@
+<& elements/svc_Common.html,
+ 'table' => 'svc_fiber',
+ 'fields' => \@fields,
+ 'labels' => \%labels,
+ 'edit_url' => $fsurl.'edit/svc_fiber.html?',
+&>
+<%init>
+
+my @fields = (
+ { field => 'oltnum',
+ type => 'select-table',
+ table => 'fiber_olt',
+ name_col => 'oltname',
+ },
+ 'shelf',
+ 'card',
+ 'olt_port',
+ 'ont_id',
+ 'ont_description',
+ 'ont_serial',
+ 'ont_port',
+ 'vlan',
+ 'signal',
+ 'speed_down',
+ 'speed_up',
+ 'ont_install',
+);
+
+my $fields = FS::svc_fiber->table_info->{'fields'};
+my %labels = map { $_ => $fields->{$_}{'label'} } keys %$fields;
+
+$labels{'ont_description'} = 'ONT model';
+
+</%init>