[freeside-commits] freeside/httemplate/search report_phone_avail.html, NONE, 1.1 phone_avail.html, 1.1, 1.2
Erik Levinson
levinse at wavetail.420.am
Mon Nov 8 18:51:52 PST 2010
Update of /home/cvs/cvsroot/freeside/httemplate/search
In directory wavetail.420.am:/tmp/cvs-serv7580/httemplate/search
Modified Files:
phone_avail.html
Added Files:
report_phone_avail.html
Log Message:
add phone number search report, RT10464
Index: phone_avail.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/search/phone_avail.html,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -w -d -r1.1 -r1.2
--- phone_avail.html 5 Oct 2008 10:17:59 -0000 1.1
+++ phone_avail.html 9 Nov 2010 02:51:50 -0000 1.2
@@ -16,6 +16,8 @@
'header' => [ '#',
'State',
'Phone Number',
+ 'Rate Center',
+ 'Batch',
'Export',
'Service',
FS::UI::Web::cust_header(),
@@ -27,16 +29,20 @@
'+'. $pn->countrycode. ' '.
$pn->npa. ' '. $pn->nxx. '-'. $pn->station;
},
+ 'name',
+ 'availbatch',
'exportnum', #XXX
#sub { },
'svcnum', #XXX
\&FS::UI::Web::cust_fields,
],
- 'align' => 'rllll'.FS::UI::Web::cust_aligns(),
+ 'align' => 'rllllll'.FS::UI::Web::cust_aligns(),
'links' => [
'',
'',
'',
+ '',
+ '',
'', #XXX #$export_link
'', #XXX #$svc_link
( map { $_ ne 'Cust. Status' ? $link_cust : '' }
@@ -49,6 +55,8 @@
'',
'',
'',
+ '',
+ '',
FS::UI::Web::cust_colors(),
],
'style' => [
@@ -57,6 +65,8 @@
'',
'',
'',
+ '',
+ '',
FS::UI::Web::cust_styles(),
],
)
@@ -68,9 +78,28 @@
my @search = ();
-if ( $cgi->param('availbatch') =~ /^([\w\/\:\-\.]+)$/ ) {
- push @search, "availbatch = '$1'";
-}
+push @search, "availbatch = '$1'"
+ if ( $cgi->param('availbatch') =~ /^([\w\d \/\:\-\.]+)$/ );
+
+push @search, "countrycode = '$1'"
+ if ( $cgi->param('countrycode') =~ /^(\d{1,3})$/ );
+
+push @search, "phone_avail.state = '$1'"
+ if ( $cgi->param('state') =~ /^(\w{2})$/ );
+
+# i know that the regexps match more than NPA/NXX, but this is good enough now
+push @search, "npa = '$1'"
+ if ( $cgi->param('npa') =~ /^(\d{3})$/ );
+push @search, "nxx = '$1'"
+ if ( $cgi->param('npa') =~ /^\d{3}$/ && $cgi->param('nxx') =~ /^(\d{3})$/ );
+
+push @search, "name = '$1'"
+ if ( $cgi->param('ratecenter') =~ /^([\w \-\.]+)$/ );
+
+push @search, "svcnum is null"
+ if ( $cgi->param('avail_status') eq 'AVAIL' );
+push @search, "svcnum is not null"
+ if ( $cgi->param('avail_status') eq 'UNAVAIL' );
# #here is the agent virtualization
# push @search, $FS::CurrentUser::CurrentUser->agentnums_sql;
--- NEW FILE: report_phone_avail.html ---
<% include('/elements/header.html', 'Phone number (DID) Availability Report' ) %>
<FORM ACTION="phone_avail.html" METHOD="GET">
<TABLE BGCOLOR="#cccccc" CELLSPACING=0>
<TR>
<TH CLASS="background" COLSPAN=2 ALIGN="left"><FONT SIZE="+1">Search options</FONT></TH>
</TR>
<% include( '/elements/tr-input-text.html',
'id' => 'countrycode',
'field' => 'countrycode',
'label' => 'Country Code',
'maxlength' => 3,
'size' => 3,
)
%>
<% include( '/elements/tr-input-text.html',
'id' => 'state',
'field' => 'state',
'label' => 'State',
'maxlength' => 2,
'size' => 2,
)
%>
<% include( '/elements/tr-input-text.html',
'id' => 'npa',
'field' => 'npa',
'label' => 'NPA',
'maxlength' => 3,
'size' => 3,
)
%>
<% include( '/elements/tr-input-text.html',
'id' => 'nxx',
'field' => 'nxx',
'label' => 'NXX',
'maxlength' => 3,
'size' => 3,
)
%>
<% include( '/elements/tr-input-text.html',
'id' => 'ratecenter',
'field' => 'ratecenter',
'label' => 'Rate Center',
'size' => 80,
)
%>
<% include( '/elements/tr-input-text.html',
'id' => 'availbatch',
'field' => 'availbatch',
'label' => 'Batch Name',
'size' => 80,
)
%>
<TR>
<TD ALIGN="RIGHT">Status</TD>
<TD>
<INPUT TYPE="RADIO" NAME="avail_status" value="BOTH" CHECKED>Available & Unavailable
Numbers
<INPUT TYPE="RADIO" NAME="avail_status" value="AVAIL">Available Numbers Only
<INPUT TYPE="RADIO" NAME="avail_status" value="UNAVAIL">Unavailable Numbers Only
</TD>
</TR>
</TABLE>
<BR>
<INPUT TYPE="submit" VALUE="Get Report">
</FORM>
<% include('/elements/footer.html') %>
<%init>
die "access denied"
unless ( $FS::CurrentUser::CurrentUser->access_right('List customers') &&
$FS::CurrentUser::CurrentUser->access_right('List packages')
);
my $conf = new FS::Conf;
</%init>
More information about the freeside-commits
mailing list