projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
a893d5a
)
svc_pbx in signup server, RT#9380
author
mark
<mark>
Wed, 29 Sep 2010 05:40:12 +0000
(
05:40
+0000)
committer
mark
<mark>
Wed, 29 Sep 2010 05:40:12 +0000
(
05:40
+0000)
FS/FS/ClientAPI/Signup.pm
patch
|
blob
|
history
fs_selfservice/drupal/signup.inc
patch
|
blob
|
history
diff --git
a/FS/FS/ClientAPI/Signup.pm
b/FS/FS/ClientAPI/Signup.pm
index
d6f5f14
..
ec45e79
100644
(file)
--- a/
FS/FS/ClientAPI/Signup.pm
+++ b/
FS/FS/ClientAPI/Signup.pm
@@
-451,6
+451,9
@@
sub new_customer {
unless $packet->{'popnum'} || !scalar(qsearch('svc_acct_pop',{} ));
}
unless $packet->{'popnum'} || !scalar(qsearch('svc_acct_pop',{} ));
}
+ elsif ( $svc_x eq 'svc_pbx' ) {
+ #possibly some validation will be needed
+ }
my $agentnum;
if ( exists $packet->{'session_id'} ) {
my $agentnum;
if ( exists $packet->{'session_id'} ) {
@@
-585,18
+588,23
@@
sub new_customer {
}
$svc->child_objects( \@acct_snarf );
}
$svc->child_objects( \@acct_snarf );
- push @svc, $svc;
} elsif ( $svc_x eq 'svc_phone' ) {
} elsif ( $svc_x eq 'svc_phone' ) {
-
my $svc =
new FS::svc_phone ( {
+
push @svc,
new FS::svc_phone ( {
'svcpart' => $svcpart,
map { $_ => $packet->{$_} }
qw( countrycode phonenum sip_password pin ),
} );
'svcpart' => $svcpart,
map { $_ => $packet->{$_} }
qw( countrycode phonenum sip_password pin ),
} );
- push @svc, $svc;
+ } elsif ( $svc_x eq 'svc_pbx' ) {
+ push @svc, new FS::svc_pbx ( {
+ 'svcpart' => $svcpart,
+ map { $_ => $packet->{$_} }
+ qw( id title ),
+ } );
+
} else {
die "unknown signup service $svc_x";
}
} else {
die "unknown signup service $svc_x";
}
@@
-722,14
+730,20
@@
sub new_customer {
my %return = ( 'error' => '',
'signup_service' => $svc_x,
my %return = ( 'error' => '',
'signup_service' => $svc_x,
+ 'svcnum' => $svc[0]->svcnum,
+ 'custnum' => $cust_main->custnum,
);
if ( $svc_x eq 'svc_acct' ) {
$return{$_} = $svc[0]->$_() for qw( username _password );
} elsif ( $svc_x eq 'svc_phone' ) {
$return{$_} = $svc[0]->$_() for qw( countrycode phonenum sip_password pin );
);
if ( $svc_x eq 'svc_acct' ) {
$return{$_} = $svc[0]->$_() for qw( username _password );
} elsif ( $svc_x eq 'svc_phone' ) {
$return{$_} = $svc[0]->$_() for qw( countrycode phonenum sip_password pin );
+ } elsif ( $svc_x eq 'svc_pbx' ) {
+ #$return{$_} = $svc[0]->$_() for qw( ) #nothing yet
} else {
} else {
- die "unknown signup service $svc_x";
+ return { 'error' => "configuration error: unknown signup service $svc_x" };
+ #die "unknown signup service $svc_x";
+ # return an error that's visible to someone somewhere
}
return \%return;
}
return \%return;
diff --git
a/fs_selfservice/drupal/signup.inc
b/fs_selfservice/drupal/signup.inc
index
9e9443a
..
b3e54f0
100644
(file)
--- a/
fs_selfservice/drupal/signup.inc
+++ b/
fs_selfservice/drupal/signup.inc
@@
-66,6
+66,7
@@
function freeside_signup_form($form_state) {
'payby_longname',
'part_pkg',
'default_pkgpart',
'payby_longname',
'part_pkg',
'default_pkgpart',
+ 'signup_service',
);
$signup_info = signup_info($keys);
dkpr($signup_info);
);
$signup_info = signup_info($keys);
dkpr($signup_info);
@@
-249,19
+250,28
@@
function freeside_signup_form($form_state) {
'#value' => $pkgs[0]['pkgpart'],
)
),
'#value' => $pkgs[0]['pkgpart'],
)
),
- 'username'=> array(
- '#type' => 'textfield',
- '#title' => t('Username'),
- '#size' => 20,
- '#required'=>1,
- ),
- 'password'=> array(
- '#type' => 'password_confirm',
- '#size' => 20,
- '#required'=>1,
- '#process'=> array('freeside_expand_password_confirm'),
- ),
);
);
+
+ switch($signup_info['signup_service']) {
+ case 'svc_acct':
+ $form['package'] += array(
+ 'username'=> array(
+ '#type' => 'textfield',
+ '#title' => t('Username'),
+ '#size' => 20,
+ '#required'=>1,
+ ),
+ 'password'=> array(
+ '#type' => 'password_confirm',
+ '#size' => 20,
+ '#required'=>1,
+ '#process'=> array('freeside_expand_password_confirm'),
+ )
+ );
+ break;
+ case 'svc_pbx':
+ break; // nothing yet implemented
+ }
$form['package']['pkgpart']['#default_value'] = $signup_info['default_pkgpart'];
$form['submit'] = array(
$form['package']['pkgpart']['#default_value'] = $signup_info['default_pkgpart'];
$form['submit'] = array(
@@
-333,7
+343,11
@@
function freeside_signup_form_submit($form, &$form_state) {
}
else {
drupal_set_message(t("Signup successful!"),'status');
}
else {
drupal_set_message(t("Signup successful!"),'status');
- $form_state['redirect'] = variable_get('freeside_redirect_after_signup','/');
+ $form_state['redirect'] = array(
+ variable_get('freeside_redirect_after_signup','/'),
+ //query string would go here
+ //'custnum='.$response['custnum'].'&svcnum='.$response['svcnum'],
+ );
}
}
}
}