signup w/globalpops DID selection via mason components pass-through
[freeside.git] / fs_selfservice / FS-SelfService / SelfService.pm
index ec4668f..6867fd8 100644 (file)
@@ -57,8 +57,9 @@ $socket .= '.'.$tag if defined $tag && length($tag);
   'agent_logout'              => 'Agent/agent_logout',
   'agent_info'                => 'Agent/agent_info',
   'agent_list_customers'      => 'Agent/agent_list_customers',
+  'mason_comp'                => 'MasonComponent/mason_comp',
 );
-@EXPORT_OK = ( keys(%autoload), qw( regionselector expselect popselector domainselector) );
+@EXPORT_OK = ( keys(%autoload), qw( regionselector expselect popselector domainselector didselector) );
 
 $ENV{'PATH'} ='/usr/bin:/usr/ucb:/bin';
 $ENV{'SHELL'} = '/bin/sh';
@@ -1412,7 +1413,7 @@ sub domainselector {
 
   return '<INPUT TYPE="hidden" NAME="domsvc" VALUE="">'
     unless scalar(keys %$domains);
-    
+
   if (scalar(keys %$domains) == 1) {
     my $key;
     foreach(keys %$domains) {
@@ -1437,6 +1438,39 @@ sub domainselector {
 
 }
 
+=item didselector HASHREF | LIST
+
+Takes as input a hashref or list of key/value pairs with the following keys:
+
+=over 4
+
+=item field
+
+=item svcpart
+
+=back
+
+Returns an HTML fragment for DID selection.
+
+=cut
+
+sub didselector {
+  my $param;
+  if ( ref($_[0]) ) {
+    $param = shift;
+  } else {
+    $param = { @_ };
+  }
+
+  my $rv = mason_comp( 'comp'=>'/elements/select-did.html',
+                       'args'=>[ %$param ],
+                     );
+
+  #hmm.
+  $rv->{'error'} || $rv->{'output'};
+
+}
+
 =back
 
 =head1 RESELLER FUNCTIONS