[freeside-commits] freeside/httemplate/elements select-state.html, 1.4, 1.4.4.1 select-did.html, 1.14, 1.14.2.1 select-exchange.html, 1.1, 1.1.10.1 select-areacode.html, 1.2, 1.2.6.1 select-phonenum.html, 1.5, 1.5.2.1
Ivan,,,
ivan at wavetail.420.am
Tue Aug 9 22:22:35 PDT 2011
Update of /home/cvs/cvsroot/freeside/httemplate/elements
In directory wavetail.420.am:/tmp/cvs-serv19007/httemplate/elements
Modified Files:
Tag: FREESIDE_2_3_BRANCH
select-state.html select-did.html select-exchange.html
select-areacode.html select-phonenum.html
Log Message:
multiple DID provisioning, RT#13721
Index: select-phonenum.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/elements/select-phonenum.html,v
retrieving revision 1.5
retrieving revision 1.5.2.1
diff -u -w -d -r1.5 -r1.5.2.1
--- select-phonenum.html 10 Jan 2011 19:44:43 -0000 1.5
+++ select-phonenum.html 10 Aug 2011 05:22:33 -0000 1.5.2.1
@@ -30,7 +30,9 @@
what.form.<% $opt{'prefix'} %>phonenum.options[i] = null;
% if ($opt{empty}) {
+ if ( what.form.<% $opt{'prefix'} %>phonenum.type != 'select-multiple' ){
opt(what.form.<% $opt{'prefix'} %>phonenum, '', '<% $opt{empty} %>');
+ }
% }
// add the new phonenums
@@ -127,10 +129,15 @@
<DIV ID="phonenumerror" STYLE="display:none"><IMG SRC="<%$fsurl%>images/cross.png"> <B>Select a different city/exchange</B></DIV>
% }
-<SELECT ID="<% $opt{'prefix'} %>phonenum" NAME="<% $opt{'prefix'} %>phonenum"
- notonChange="<% $opt{'prefix'} %>phonenum_changed(this); <% $opt{'onchange'} %>"
- <% $opt{'disabled'} %>>
+<SELECT <% $opt{multiple} ? 'MULTIPLE SIZE=25' : '' %>
+ ID = "<% $opt{'prefix'} %>phonenum"
+ NAME = "<% $opt{'prefix'} %>phonenum"
+ <% $opt{'disabled'} %>
+%# notonChange="<% $opt{'prefix'} %>phonenum_changed(this); <% $opt{'onchange'} %>"
+>
+% unless ( $opt{multiple} ) {
<OPTION VALUE="">Select phone number</OPTION>
+% }
</SELECT>
<%init>
Index: select-exchange.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/elements/select-exchange.html,v
retrieving revision 1.1
retrieving revision 1.1.10.1
diff -u -w -d -r1.1 -r1.1.10.1
--- select-exchange.html 28 Jun 2008 23:03:09 -0000 1.1
+++ select-exchange.html 10 Aug 2011 05:22:33 -0000 1.1.10.1
@@ -33,7 +33,9 @@
// blank the current phonenum too
for ( var i = what.form.<% $opt{'prefix'} %>phonenum.length; i >= 0; i-- )
what.form.<% $opt{'prefix'} %>phonenum.options[i] = null;
+ if ( what.form.<% $opt{'prefix'} %>phonenum.type != 'select-multiple' ) {
opt(what.form.<% $opt{'prefix'} %>phonenum, '', 'Select phone number');
+ }
% if ($opt{empty}) {
opt(what.form.<% $opt{'prefix'} %>exchange, '', '<% $opt{empty} %>');
Index: select-state.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/elements/select-state.html,v
retrieving revision 1.4
retrieving revision 1.4.4.1
diff -u -w -d -r1.4 -r1.4.4.1
--- select-state.html 2 Nov 2010 00:49:32 -0000 1.4
+++ select-state.html 10 Aug 2011 05:22:33 -0000 1.4.4.1
@@ -42,7 +42,9 @@
<%init>
my %opt = @_;
-foreach my $opt (qw( state country prefix onchange disabled empty_label )) {
+foreach my $opt (qw(
+ state country prefix onchange disabled empty_label svcpart
+)) {
$opt{$opt} = '' unless exists($opt{$opt}) && defined($opt{$opt});
}
@@ -62,5 +64,16 @@
tie my %states, 'Tie::IxHash', states_hash( $opt{'country'} );
+if ( $opt{'svcpart'} ) {
+
+ my $sth = dbh->prepare(
+ 'SELECT DISTINCT state FROM phone_avail WHERE svcnum IS NULL'
+ ) or die dbh->errstr;
+ $sth->execute or die $sth->errstr;
+ my %avail_states = map { $_->[0] => 1 } @{ $sth->fetchall_arrayref };
+
+ delete $states{$_} foreach grep ! $avail_states{$_}, keys %states;
+}
+
</%init>
Index: select-did.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/elements/select-did.html,v
retrieving revision 1.14
retrieving revision 1.14.2.1
diff -u -w -d -r1.14 -r1.14.2.1
--- select-did.html 26 Mar 2011 00:17:19 -0000 1.14
+++ select-did.html 10 Aug 2011 05:22:33 -0000 1.14.2.1
@@ -18,47 +18,46 @@
<TABLE>
<TR>
- <TD>
+ <TD VALIGN="top">
<% include('/elements/select-state.html',
'prefix' => 'phonenum_', #$field.'_',
'country' => $country,
+ 'svcpart' => $svcpart,
'disable_empty' => 0,
'empty_label' => 'Select state',
)
%>
+ <BR><FONT SIZE="-1">State</FONT>
</TD>
- <TD>
+ <TD VALIGN="top">
<% include('/elements/select-areacode.html',
'state_prefix' => 'phonenum_', #$field.'_',
'svcpart' => $svcpart,
'empty' => 'Select area code',
)
%>
+ <BR><FONT SIZE="-1">Area code</FONT>
</TD>
- <TD>
+ <TD VALIGN="top">
<% include('/elements/select-exchange.html',
'svcpart' => $svcpart,
'empty' => 'Select exchange',
)
%>
+ <BR><FONT SIZE="-1">City / Exchange</FONT>
</TD>
- <TD>
+ <TD VALIGN="top">
<% include('/elements/select-phonenum.html',
'svcpart' => $svcpart,
'empty' => 'Select phone number',
'bulknum' => $bulknum,
+ 'multiple' => $multiple,
)
%>
+ <BR><FONT SIZE="-1">Phone number</FONT>
</TD>
</TR>
- <TR>
- <TD><FONT SIZE="-1">State</FONT></TD>
- <TD><FONT SIZE="-1">Area code</FONT></TD>
- <TD><FONT SIZE="-1">City / Exchange</FONT></TD>
- <TD><FONT SIZE="-1">Phone number</FONT></TD>
- </TR>
-
</TABLE>
% }
@@ -118,7 +117,8 @@
my $use_selector = scalar(@exports) ? 1 : 0;
-my $bulknum = $opt{'bulknum'} || 0;
+my $bulknum = $opt{'bulknum'} || 0; #Bulk DID orders via ordering system, vs.
+my $multiple = $opt{'multiple'} || 0; #just selecting a bunch at a time
my $country = ( $export && $export->option('country') )
|| $conf->config('countrydefault')
Index: select-areacode.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/elements/select-areacode.html,v
retrieving revision 1.2
retrieving revision 1.2.6.1
diff -u -w -d -r1.2 -r1.2.6.1
--- select-areacode.html 26 Mar 2010 22:25:36 -0000 1.2
+++ select-areacode.html 10 Aug 2011 05:22:33 -0000 1.2.6.1
@@ -38,7 +38,9 @@
// blank the current phonenum too
for ( var i = what.form.<% $opt{'prefix'} %>phonenum.length; i >= 0; i-- )
what.form.<% $opt{'prefix'} %>phonenum.options[i] = null;
+ if ( what.form.<% $opt{'prefix'} %>phonenum.type != 'select-multiple' ) {
opt(what.form.<% $opt{'prefix'} %>phonenum, '', 'Select phone number');
+ }
% if ($opt{empty}) {
opt(what.form.<% $opt{'prefix'} %>areacode, '', '<% $opt{empty} %>');
More information about the freeside-commits
mailing list