diff --git a/lib/admin/Controller/account.pm b/lib/admin/Controller/account.pm index c645e63..ab0bb88 100644 --- a/lib/admin/Controller/account.pm +++ b/lib/admin/Controller/account.pm @@ -126,7 +126,7 @@ sub detail : Local { or $#{$c->session->{voip_account}{subscribers}} == -1; $c->stash->{account} = $c->session->{voip_account}; -# $c->stash->{account}{is_locked} = 1 if $c->session->{voip_account}{status} eq 'locked'; + $c->stash->{account}{is_locked} = 1 if $c->session->{voip_account}{status} eq 'locked'; return 1; } @@ -221,6 +221,31 @@ sub lock : Local { $c->response->redirect("/account/detail?account_id=$account_id"); } +=head2 activate + +Activates an account by calling finish on it. + +=cut + +sub activate : Local { + my ( $self, $c ) = @_; + + my %messages; + + my $account_id = $c->request->params->{account_id}; + + if($c->model('Provisioning')->call_prov( $c, 'billing', 'activate_voip_account', + { id => $account_id }, + undef)) + { + $messages{topmsg} = 'Web.Account.Activated'; + } + + $c->session->{messages} = \%messages; + $c->response->redirect("/account/detail?account_id=$account_id"); + return; +} + =head2 terminate Terminates an account. @@ -249,7 +274,7 @@ sub terminate : Local { return; } -=head2 update_account +=head2 update_balance Update a VoIP account cash and free time balance. diff --git a/lib/admin/Controller/customer.pm b/lib/admin/Controller/customer.pm index cf8e38e..3534485 100644 --- a/lib/admin/Controller/customer.pm +++ b/lib/admin/Controller/customer.pm @@ -131,7 +131,8 @@ sub detail : Local { } $c->stash->{show_pass} = $c->request->params->{show_pass}; - $c->stash->{edit_customer} = $c->request->params->{edit_customer}; +# there's currently nothing to edit +# $c->stash->{edit_customer} = $c->request->params->{edit_customer}; $c->stash->{edit_contact} = $c->request->params->{edit_contact}; $c->stash->{edit_commercial} = $c->request->params->{edit_commercial}; $c->stash->{edit_technical} = $c->request->params->{edit_technical}; diff --git a/root/tt/account_detail.tt b/root/tt/account_detail.tt index 2b2d2c8..e804e63 100644 --- a/root/tt/account_detail.tt +++ b/root/tt/account_detail.tt @@ -4,36 +4,43 @@ [% IF ! account.terminate_timestamp %] -
- [% IF billing_features %] - edit - [% END %] - [% IF edit_account %] - cancel - [% ELSE %] - [% IF account.is_locked %] - unlock +
+ [% IF billing_features %] + edit + [% END %] + [% IF edit_account %] + cancel [% ELSE %] - lock + [% IF account.status == "pending" %] + activate + [% ELSE %] + [% IF account.is_locked %] + unlock + [% ELSE %] + lock + [% END %] + terminate + [% END %] [% END %] - terminate - [% END %] -
+
[% END %]
[% IF account.is_locked %] -
Account is LOCKED!
+
Account is locked!
+ [% END %] + [% IF account.status == "pending" %] +
Account is in pending state!
[% END %] [% IF messages.accmsg %]
[% messages.accmsg %]
[% END %] [% IF messages.accerr %]
[% messages.accerr %]
[% END %]
- + [% IF billing_features %] - +
ID:[% account.id %]
ContractID:[% account.id %]
customer:CustomerID: [% IF account.customer_id %] [% account.customer_id %] diff --git a/root/tt/customer_detail.tt b/root/tt/customer_detail.tt index f750509..08dbf74 100644 --- a/root/tt/customer_detail.tt +++ b/root/tt/customer_detail.tt @@ -3,13 +3,14 @@ #[% customer.id %] +
[% IF messages.custmsg %]
[% messages.custmsg %]
[% END %] [% IF messages.custerr %]
[% messages.custerr %]
[% END %] @@ -18,14 +19,14 @@ - + - + - + [% END %] diff --git a/root/tt/subscriber_detail.tt b/root/tt/subscriber_detail.tt index 468b695..2a3ca60 100644 --- a/root/tt/subscriber_detail.tt +++ b/root/tt/subscriber_detail.tt @@ -40,31 +40,36 @@
CustomerID:[% customer.id %]
shopuser:shop user:
shoppass:shop password: [% IF edit_customer %] @@ -341,7 +342,7 @@ [% contract.product %] [% END %] [% contract.status %][% contract.status %] [% contract.create_timestamp %]
- + - + - - [% IF subscriber.subscriber_id %] - - [% ELSE %] + + - + - [% END %] + [% END %] [% IF messages.number_ac %][% END %] [% IF messages.number_sn %][% END %] + + [% IF subscriber.subscriber_id %] + + [% ELSE %] - + + [% END %]
ID:[% subscriber.subscriber_id %]
SubscriberID:[% subscriber.subscriber_id %]
account ID:ContractID: [% subscriber.account_id || account_id %]
user:[% subscriber.webusername %]
SIP URI:[% subscriber.username %]@[% subscriber.domain %]
web user:[% subscriber.webusername %]
SIP URI:web password: - - @ - + [% ELSE %] + Hide + [% ELSE %] + [% IF subscriber.webpassword %] + value="********" /> Show + [% ELSE %] + value="" /> + [% END %] [% END %] - + [% END %]
E.164 number: @@ -86,25 +91,23 @@ [% IF messages.number_cc %]
[% messages.number_cc %]
[% messages.number_ac %]
[% messages.number_sn %]
SIP URI:[% subscriber.username %]@[% subscriber.domain %]
web password:SIP URI: - [% IF edit_subscriber %] - - [% ELSE %] - Hide - [% ELSE %] - [% IF subscriber.webpassword %] - value="********" /> Show - [% ELSE %] - value="" /> - [% END %] + + @ +
SIP password: