summaryrefslogtreecommitdiff
path: root/httemplate
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2016-03-10 01:20:21 -0800
committerMark Wells <mark@freeside.biz>2016-03-10 01:20:49 -0800
commit5a9a411b980edea1b0f9690fc92e3b93574ee974 (patch)
treeef7133da8ea9bf680c6b9a5913dba44cff6191a5 /httemplate
parentefad6767531821f6796e193a53aed4d2981cb983 (diff)
add svc_fiber circuit id field, OLT sites, and other improvements, #35260
Diffstat (limited to 'httemplate')
-rw-r--r--httemplate/browse/fiber_olt.html6
-rw-r--r--httemplate/browse/olt_site.html12
-rw-r--r--httemplate/edit/elements/edit.html2
-rw-r--r--httemplate/edit/fiber_olt.html9
-rw-r--r--httemplate/edit/olt_site.html20
-rw-r--r--httemplate/edit/process/olt_site.html4
-rw-r--r--httemplate/edit/process/svc_fiber.html12
-rw-r--r--httemplate/edit/svc_fiber.html7
-rw-r--r--httemplate/elements/tr-input-fiber_circuit.html31
-rw-r--r--httemplate/view/svc_fiber.cgi3
10 files changed, 100 insertions, 6 deletions
diff --git a/httemplate/browse/fiber_olt.html b/httemplate/browse/fiber_olt.html
index bffd5f222..2355ec023 100644
--- a/httemplate/browse/fiber_olt.html
+++ b/httemplate/browse/fiber_olt.html
@@ -1,11 +1,11 @@
<& elements/browse-simple.html,
'table' => 'fiber_olt',
'title' => 'Fiber service OLTs',
- 'menubar' => [ ],
+ 'menubar' => [ 'View sites' => 'olt_site.html' ],
'name_singular' => 'OLT',
'acl' => 'Configuration',
# overrides
'disabled_statuspos' => 3,
- 'header' => [ '#', 'Name', 'Serial' ],
- 'fields' => [ 'oltnum', 'oltname', 'serial' ],
+ 'header' => [ '#', 'Site', 'Name', 'Serial' ],
+ 'fields' => [ 'oltnum', 'site_description', 'oltname', 'serial' ],
&>
diff --git a/httemplate/browse/olt_site.html b/httemplate/browse/olt_site.html
new file mode 100644
index 000000000..ea2e7de1f
--- /dev/null
+++ b/httemplate/browse/olt_site.html
@@ -0,0 +1,12 @@
+<& elements/browse-simple.html,
+ 'table' => 'olt_site',
+ 'title' => 'Fiber OLT markets and sites',
+ 'menubar' => [ 'View OLTs' => 'fiber_olt.html' ],
+ 'name_singular' => 'site',
+ 'acl' => 'Configuration',
+# overrides
+ 'disabled_statuspos' => '',
+ 'disableable' => 0,
+ 'header' => [ '#', 'Market', 'Site', ],
+ 'fields' => [ 'sitenum', 'market', 'site', ],
+&>
diff --git a/httemplate/edit/elements/edit.html b/httemplate/edit/elements/edit.html
index c6d45531e..bbc9797dc 100644
--- a/httemplate/edit/elements/edit.html
+++ b/httemplate/edit/elements/edit.html
@@ -362,7 +362,7 @@ Example:
% $include_common{$_} = $f->{$_} foreach grep exists($f->{$_}),
% qw( js_only html_only select_only layers_only cell_style ),#selectlayers,?
% qw( empty_label ), # select-*
-% qw( value_col compare_sub order_by ), # select-table
+% qw( value_col compare_sub order_by addl_from ), # select-table
% qw( table name_col ), #(select,checkboxes)-table
% qw( target_table link_table ), #checkboxes-table
% qw( hashref agent_virt agent_null agent_null_right ),#*-table
diff --git a/httemplate/edit/fiber_olt.html b/httemplate/edit/fiber_olt.html
index ab7d2f07e..8cbcbb590 100644
--- a/httemplate/edit/fiber_olt.html
+++ b/httemplate/edit/fiber_olt.html
@@ -11,6 +11,14 @@ die "access denied"
my @fields = (
'oltname',
+ {
+ field => 'sitenum',
+ type => 'select-table',
+ table => 'olt_site',
+ name_col => 'description',
+ order_by => 'ORDER BY market, site',
+ empty_label => ' ',
+ },
'serial',
{ field => 'disabled', type => 'checkbox', value => 'Y' }
);
@@ -18,6 +26,7 @@ my @fields = (
my %labels = (
'oltnum' => '',
'oltname' => 'Name',
+ 'sitenum' => 'Site',
'serial' => 'Serial',
'disabled' => 'Disabled',
);
diff --git a/httemplate/edit/olt_site.html b/httemplate/edit/olt_site.html
new file mode 100644
index 000000000..c243bab18
--- /dev/null
+++ b/httemplate/edit/olt_site.html
@@ -0,0 +1,20 @@
+<& elements/edit.html,
+ popup => 1,
+ name_singular => 'OLT site',
+ table => 'olt_site',
+ viewall_dir => 'browse',
+ fields => [
+ { field => 'market',
+ type => 'text',
+ size => 4,
+ },
+ { field => 'site',
+ type => 'text',
+ size => 4,
+ },
+ ],
+ labels => { 'market' => 'Market',
+ 'site' => 'Site',
+ 'sitenum' => 'Site',
+ },
+&>
diff --git a/httemplate/edit/process/olt_site.html b/httemplate/edit/process/olt_site.html
new file mode 100644
index 000000000..f328cfefe
--- /dev/null
+++ b/httemplate/edit/process/olt_site.html
@@ -0,0 +1,4 @@
+<& elements/process.html,
+ table => 'olt_site',
+ viewall_dir => 'browse',
+&>
diff --git a/httemplate/edit/process/svc_fiber.html b/httemplate/edit/process/svc_fiber.html
index 815a8eeb8..3dabede13 100644
--- a/httemplate/edit/process/svc_fiber.html
+++ b/httemplate/edit/process/svc_fiber.html
@@ -2,10 +2,22 @@
table => 'svc_fiber',
edit_ext => 'html',
redirect => popurl(3)."view/svc_fiber.cgi?",
+ precheck_callback => $precheck_callback,
&>
<%init>
die "access denied"
unless $FS::CurrentUser::CurrentUser->access_right('Provision customer service'); #something else more specific?
+my $precheck_callback = sub {
+ my $cgi = shift;
+ # recombine fdu/fat/subfat/port
+ my $circuit_id = $cgi->param('circuit_id_fdu') . '/' .
+ $cgi->param('circuit_id_fat') . $cgi->param('circuit_id_subfat') . '/' .
+ $cgi->param('circuit_id_port');
+ $cgi->param('circuit_id', $circuit_id);
+ $cgi->delete(qw( circuit_id_fdu circuit_id_fat circuit_id_subfat circuit_id_port ));
+ '';
+};
+
</%init>
diff --git a/httemplate/edit/svc_fiber.html b/httemplate/edit/svc_fiber.html
index e07caa1b1..982b0bf05 100644
--- a/httemplate/edit/svc_fiber.html
+++ b/httemplate/edit/svc_fiber.html
@@ -10,10 +10,15 @@ die "access denied"
my $conf = new FS::Conf;
my @fields = (
+ { field => 'circuit_id',
+ type => 'input-fiber_circuit',
+ },
{ field => 'oltnum',
type => 'select-table',
table => 'fiber_olt',
- name_col => 'oltname',
+ name_col => 'description',
+ addl_from => 'LEFT JOIN olt_site USING (sitenum)',
+ order_by => 'ORDER BY market, site, oltname',
hashref => { disabled => '' },
disable_empty => 1,
},
diff --git a/httemplate/elements/tr-input-fiber_circuit.html b/httemplate/elements/tr-input-fiber_circuit.html
new file mode 100644
index 000000000..fb6462bb6
--- /dev/null
+++ b/httemplate/elements/tr-input-fiber_circuit.html
@@ -0,0 +1,31 @@
+<& /elements/tr-td-label.html, %opt &>
+ <td>
+ <table class="inv">
+ <tr>
+ <th>FDU#</th>
+ <td><input name="<% $field %>_fdu" value="<% $fdu |h %>" SIZE="1"></td>
+ <th>FAT#</th>
+ <td><input name="<% $field %>_fat" value="<% $fat |h %>" SIZE="1">
+ <input name="<% $field %>_subfat" value="<% $subfat |h %>" SIZE="1">
+ </td>
+ <th>Port#</th>
+ <td><input name="<% $field %>_port" value="<% $port |h %>" SIZE="1"></td>
+ </tr>
+ </table>
+ </td>
+</tr>
+<%doc>
+Supports a circuit ID of the form
+FDU# (digit), FAT# (digit), SubFAT (letter), Port# (numeric)
+May support other formats in the future, or just a free text field.
+</%doc>
+<%init>
+my %opt = @_;
+my $value = length($opt{curr_value}) ? $opt{curr_value} : $opt{value};
+my ($fdu, $fat, $port) = split('/', $value);
+my $subfat = '';
+if ( $fat =~ /[A-Z]$/i ) {
+ $subfat = substr($fat, -1, 1, '');
+}
+my $field = $opt{'field'} || 'circuit_id';
+</%init>
diff --git a/httemplate/view/svc_fiber.cgi b/httemplate/view/svc_fiber.cgi
index ce9c03dc7..80a833890 100644
--- a/httemplate/view/svc_fiber.cgi
+++ b/httemplate/view/svc_fiber.cgi
@@ -7,10 +7,11 @@
<%init>
my @fields = (
+ 'circuit_id',
{ field => 'oltnum',
type => 'select-table',
table => 'fiber_olt',
- name_col => 'oltname',
+ name_col => 'description',
},
'shelf',
'card',