diff options
| author | ivan <ivan> | 2011-08-10 05:22:34 +0000 | 
|---|---|---|
| committer | ivan <ivan> | 2011-08-10 05:22:34 +0000 | 
| commit | 8737dc99be5a9874c40f36d1420447253ee12c31 (patch) | |
| tree | cc3adf5c4b80c874309f14fac6ae045a319fa555 /httemplate/elements/select-state.html | |
| parent | ea32d409b7b41c178a3e839e5be00f2eec0c90ed (diff) | |
multiple DID provisioning, RT#13721
Diffstat (limited to 'httemplate/elements/select-state.html')
| -rw-r--r-- | httemplate/elements/select-state.html | 15 | 
1 files changed, 14 insertions, 1 deletions
diff --git a/httemplate/elements/select-state.html b/httemplate/elements/select-state.html index 2d60fde0f..785b2ec24 100644 --- a/httemplate/elements/select-state.html +++ b/httemplate/elements/select-state.html @@ -42,7 +42,9 @@ Example:  <%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 @@ my $style =  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>  | 
