summaryrefslogtreecommitdiff
path: root/httemplate
diff options
context:
space:
mode:
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/log_email.html11
-rw-r--r--httemplate/edit/process/fiber_olt.html11
-rw-r--r--httemplate/edit/process/svc_fiber.html11
-rw-r--r--httemplate/edit/quick-charge.html2
-rw-r--r--httemplate/edit/svc_fiber.html36
-rw-r--r--httemplate/elements/broadband_snmp_get.html (renamed from httemplate/elements/broadband_snmp_get-dialog.html)34
-rw-r--r--httemplate/elements/menu.html14
-rw-r--r--httemplate/elements/standardize_locations.js7
-rw-r--r--httemplate/misc/download-batch.cgi13
-rw-r--r--httemplate/search/cust_msg.html6
-rw-r--r--httemplate/search/log.html2
-rwxr-xr-xhttemplate/search/report_svc_fiber.html47
-rw-r--r--httemplate/search/svc_fiber.html69
-rw-r--r--httemplate/view/cust_main/packages/location.html2
-rw-r--r--httemplate/view/cust_main/packages/package.html2
-rw-r--r--httemplate/view/svc_broadband.cgi2
-rw-r--r--httemplate/view/svc_fiber.cgi34
19 files changed, 304 insertions, 34 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/log_email.html b/httemplate/edit/log_email.html
index bbce7c708..709a24069 100644
--- a/httemplate/edit/log_email.html
+++ b/httemplate/edit/log_email.html
@@ -18,6 +18,7 @@
{ 'field' => 'msgnum',
'type' => 'select-msg_template',
'empty_label' => 'Select template',
+ 'value' => $msgnum,
'required' => 1,
},
],
@@ -42,4 +43,14 @@ my %opts = @_;
die "access denied"
unless $FS::CurrentUser::CurrentUser->access_right([ 'View system logs', 'Configuration' ]);
+my $msgnum = $cgi->param('msgnum');
+unless ($msgnum) {
+ my ($msg_template) = qsearch('msg_template',{ msgname => 'System log' });
+ # doesn't seem worth having a config just for the default selected template
+ # if they've deleted the system-generated one, just default to empty "Select template"
+ if ($msg_template) {
+ $msgnum = $msg_template->msgnum;
+ }
+}
+
</%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/quick-charge.html b/httemplate/edit/quick-charge.html
index 4d87fab28..14c3f51e6 100644
--- a/httemplate/edit/quick-charge.html
+++ b/httemplate/edit/quick-charge.html
@@ -328,6 +328,8 @@ function bill_now_changed (what) {
</TR>
% my $row = 0;
+% # quotation details are handled by quotation_pkg_detail records, added via link from view/quotation.html
+% # the details below get attached to the part_pkg record, and there's no way to edit that from quotations
% unless ($quotationnum) {
<TR>
<TD></TD>
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/broadband_snmp_get-dialog.html b/httemplate/elements/broadband_snmp_get.html
index 61bb9c763..d4cc4e49d 100644
--- a/httemplate/elements/broadband_snmp_get-dialog.html
+++ b/httemplate/elements/broadband_snmp_get.html
@@ -1,9 +1,10 @@
<%doc>
-Adds a link to display snmp statistics based on broadband_snmp_get export config.
-Performs necessary checks such that, if no such exports are configured for the passed
-service, returns blank space (ie may be safely invoked even if no exports are configured.)
+Adds a table to display dynamically loaded snmp statistics based on broadband_snmp_get
+export config. Performs necessary checks such that, if no such exports are configured
+for the passed service, returns blank space (ie may be safely invoked even if no exports
+are configured.)
- <& '/elements/broadband_snmp_get-dialog.html', svc => $svc &>
+ <& '/elements/broadband_snmp_get.html', svc => $svc &>
</%doc>
% if (@snmp) {
@@ -11,13 +12,10 @@ service, returns blank space (ie may be safely invoked even if no exports are co
'url' => $fsurl.'misc/xmlhttp-broadband_snmp_get.cgi',
'subs' => [ 'broadband_snmp_get_request' ]
&>
+<DIV ID="broadband_snmp_get"></DIV>
<SCRIPT>
function broadband_snmp_get (svcnum) {
- var jqd = $( '#broadband_snmp_get_dialog' );
- if (!jqd.dialog( 'isOpen' )) {
- jqd.dialog( 'open' );
- }
- document.getElementById('broadband_snmp_get_dialog').innerHTML = '<B>Loading...</B>';
+ document.getElementById('broadband_snmp_get').innerHTML = 'Loading SNMP...';
broadband_snmp_get_request('svcnum',svcnum,
function (result) {
var objects = JSON.parse(result) || [];
@@ -41,24 +39,14 @@ function broadband_snmp_get (svcnum) {
}
table.appendChild(row);
}
- var dialog = document.getElementById('broadband_snmp_get_dialog');
- dialog.innerHTML = '';
- dialog.appendChild(table);
+ var resultblock = document.getElementById('broadband_snmp_get');
+ resultblock.innerHTML = '';
+ resultblock.appendChild(table);
} // if objects.length
} // function
); // broadband_snmp_get_request
} // broadband_snmp_get
-</SCRIPT>
-<SPAN ID="broadband_snmp_get_dialog"></SPAN>
-<SPAN ID="broadband_snmp_get_link">
-<A HREF="javascript: void(0)" onclick="broadband_snmp_get('<% $svcnum %>')">(snmp)</A>
-</SPAN>
-<SCRIPT>
-$( '#broadband_snmp_get_dialog' ).dialog({
- position: { my: "left top", at: "left top", of: "#broadband_snmp_get_link" },
- autoOpen: false,
- title: 'SNMP',
-});
+broadband_snmp_get('<% $svcnum %>');
</SCRIPT>
% } #if @snmp
<%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/elements/standardize_locations.js b/httemplate/elements/standardize_locations.js
index b824fb249..0c4fb029a 100644
--- a/httemplate/elements/standardize_locations.js
+++ b/httemplate/elements/standardize_locations.js
@@ -114,7 +114,12 @@ function confirm_standardize(arg) {
// then all entered address fields are correct
// but we still need to set the lat/long fields and addr_clean
- status_message('Verified');
+
+ if ( returned['addr_clean'] ) {
+ status_message('Verified');
+ } else {
+ status_message('Unverified');
+ }
replace_address();
} else {
diff --git a/httemplate/misc/download-batch.cgi b/httemplate/misc/download-batch.cgi
index f3a31eb3b..c4bc37e93 100644
--- a/httemplate/misc/download-batch.cgi
+++ b/httemplate/misc/download-batch.cgi
@@ -1,4 +1,4 @@
-<% $pay_batch->export_batch(%opt) %><%init>
+<% $exporttext %><%init>
#http_header('Content-Type' => 'text/comma-separated-values' ); #IE chokes
http_header('Content-Type' => 'text/plain' ); # not necessarily correct...
@@ -23,4 +23,15 @@ elsif ( $cgi->param('format') =~ /^([\w\- ]+)$/ ) {
my $pay_batch = qsearchs('pay_batch', { batchnum => $batchnum } );
die "Batch not found: '$batchnum'" if !$pay_batch;
+my $exporttext = $pay_batch->export_batch(%opt);
+unless ($exporttext) {
+ http_header('Content-Type' => 'text/html' );
+ $exporttext = <<EOF;
+<SCRIPT>
+alert('Batch was empty, and has been resolved');
+window.top.location.href = '${p}search/pay_batch.cgi?magic=_date;open=1;intransit=1;resolved=1';
+</SCRIPT>
+EOF
+}
+
</%init>
diff --git a/httemplate/search/cust_msg.html b/httemplate/search/cust_msg.html
index e9aece202..2bfbd7cb0 100644
--- a/httemplate/search/cust_msg.html
+++ b/httemplate/search/cust_msg.html
@@ -59,8 +59,10 @@ my $conf = new FS::Conf;
my $title = 'Outgoing Message Log';
#here is the agent virtualization
-my $agentnums_sql =
- $FS::CurrentUser::CurrentUser->agentnums_sql( 'table' => 'cust_main' );
+my $agentnums_sql = $FS::CurrentUser::CurrentUser->agentnums_sql(
+ 'table' => 'cust_main',
+ 'null_right' => [ 'View system logs', 'Configuration' ],
+);
my @where = ( $agentnums_sql );
diff --git a/httemplate/search/log.html b/httemplate/search/log.html
index a707928d7..b607f505d 100644
--- a/httemplate/search/log.html
+++ b/httemplate/search/log.html
@@ -138,7 +138,7 @@ my $tt_sub = sub {
return '' if @context == 1 and length($log->message) <= 60;
my $html = '<DIV CLASS="tooltip">'.(shift @context).'</DIV>';
my $pre = '&#8627;';
- foreach (@context, $log->message) {
+ foreach (map encode_entities($_), @context, $log->message) {
$html .= "<DIV>$pre$_</DIV>";
$pre = '&nbsp;&nbsp;&nbsp;'.$pre;
}
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/cust_main/packages/location.html b/httemplate/view/cust_main/packages/location.html
index 99d91e514..595d6b3b1 100644
--- a/httemplate/view/cust_main/packages/location.html
+++ b/httemplate/view/cust_main/packages/location.html
@@ -91,7 +91,7 @@ sub pkg_change_location_link {
'actionlabel' => emt('Change'),
'cust_pkg' => $cust_pkg,
'width' => 960,
- 'height' => 490,
+ 'height' => 530,
);
}
diff --git a/httemplate/view/cust_main/packages/package.html b/httemplate/view/cust_main/packages/package.html
index e98b95e1c..dec1c6f40 100644
--- a/httemplate/view/cust_main/packages/package.html
+++ b/httemplate/view/cust_main/packages/package.html
@@ -371,7 +371,7 @@ sub pkg_change_location_link {
'actionlabel' => emt('Change'),
'cust_pkg' => $cust_pkg,
'width' => 960,
- 'height' => 490,
+ 'height' => 530,
);
}
diff --git a/httemplate/view/svc_broadband.cgi b/httemplate/view/svc_broadband.cgi
index bc272e844..0517c307a 100644
--- a/httemplate/view/svc_broadband.cgi
+++ b/httemplate/view/svc_broadband.cgi
@@ -72,7 +72,6 @@ sub ip_addr {
my $out = $ip_addr;
$out .= ' (' . include('/elements/popup_link-ping.html', ip => $ip_addr) . ')'
if $ip_addr;
- $out .= include('/elements/broadband_snmp_get-dialog.html', svc => $svc);
if ($svc->cust_svc->part_svc->part_export('cacti')) {
$out .= ' (<A HREF="'
. popurl(2)
@@ -84,6 +83,7 @@ sub ip_addr {
$out .= '<br>Netmask: ' . $addr_block->NetAddr->mask .
'<br>Gateway: ' . $addr_block->ip_gateway;
}
+ $out .= include('/elements/broadband_snmp_get.html', svc => $svc);
$out;
}
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>